diff --git a/accounts/ap/ap.php b/accounts/ap/ap.php index d7482381..2a568e7b 100644 --- a/accounts/ap/ap.php +++ b/accounts/ap/ap.php @@ -44,13 +44,14 @@ function execute() $this->obj_table->add_column("price", "amount", "account_ap.amount"); $this->obj_table->add_column("price", "amount_total", "account_ap.amount_total"); $this->obj_table->add_column("price", "amount_paid", "account_ap.amount_paid"); + $this->obj_table->add_column("bool_tick", "closed", "(account_ap.amount_paid=account_ap.amount_total AND account_ap.amount_total>0)"); // totals $this->obj_table->total_columns = array("amount_tax", "amount", "amount_total", "amount_paid"); // defaults - $this->obj_table->columns = array("name_vendor", "code_invoice", "date_trans", "amount_total", "amount_paid"); + $this->obj_table->columns = array("name_vendor", "code_invoice", "date_trans", "amount_total", "amount_paid","closed"); $this->obj_table->columns_order = array("code_invoice"); $this->obj_table->columns_order_options = array("name_vendor", "code_invoice", "code_ordernumber", "code_ponumber", "name_staff", "date_trans", "date_due", "sent"); @@ -93,13 +94,11 @@ function execute() $structure = NULL; $structure["fieldname"] = "hide_closed"; $structure["type"] = "checkbox"; - $structure["options"]["label"] = "Hide Closed Invoices"; + $structure["options"]["label"] = "Hide Completed Invoices"; $structure["defaultvalue"] = "enabled"; - $structure["sql"] = "account_ap.amount_paid!=account_ap.amount_total"; + $structure["sql"] = "((account_ap.amount_paid<>account_ap.amount_total AND account_ap.amount_total>0) OR (account_ap.amount_total=0))"; $this->obj_table->add_filter($structure); - - // load options $this->obj_table->load_options_form(); @@ -158,6 +157,12 @@ function render_html() $structure["id"]["column"] = "id"; $this->obj_table->add_link("payments", "accounts/ap/invoice-payments.php", $structure); + // journal link + $structure = NULL; + $structure["id"]["column"] = "id"; + $this->obj_table->add_link("journal", "accounts/ap/journal.php", $structure); + + // display the table $this->obj_table->render_table_html(); diff --git a/accounts/ap/invoice-bulk-payments.php b/accounts/ap/invoice-bulk-payments.php index 7355bca6..ca2af00d 100644 --- a/accounts/ap/invoice-bulk-payments.php +++ b/accounts/ap/invoice-bulk-payments.php @@ -14,7 +14,7 @@ class page_output var $obj_table; var $obj_form; - function page_output() + function __construct() { // requirements $this->requires["css"][] = "include/accounts/css/invoice-bulk-payments.css"; diff --git a/accounts/ap/invoice-delete.php b/accounts/ap/invoice-delete.php index 2087fb1e..eea73248 100644 --- a/accounts/ap/invoice-delete.php +++ b/accounts/ap/invoice-delete.php @@ -21,7 +21,7 @@ class page_output var $obj_form_invoice; - function page_output() + function __construct() { // fetch vapiables $this->id = @security_script_input('/^[0-9]*$/', $_GET["id"]); diff --git a/accounts/ap/invoice-items-edit.php b/accounts/ap/invoice-items-edit.php index 1ee8d2af..6d42f8eb 100644 --- a/accounts/ap/invoice-items-edit.php +++ b/accounts/ap/invoice-items-edit.php @@ -28,10 +28,10 @@ class page_output var $obj_form_item; - function page_output() + function __construct() { //require javascript file - $this->requires["javascript"][] = "include/accounts/javascript/invoice-items-edit.js"; + $this->requires["javascript"][] = "include/accounts/javascript/invoice-items-edit_ap.js"; // fetch vapiables $this->id = @security_script_input('/^[0-9]*$/', $_GET["id"]); diff --git a/accounts/ap/invoice-items.php b/accounts/ap/invoice-items.php index 8046d14b..38e0ca04 100644 --- a/accounts/ap/invoice-items.php +++ b/accounts/ap/invoice-items.php @@ -21,7 +21,7 @@ class page_output var $obj_table_items; - function page_output() + function __construct() { $this->requires["css"][] = "include/accounts/css/invoice-items-edit.css"; // fetch vapiables diff --git a/accounts/ap/invoice-payments-edit.php b/accounts/ap/invoice-payments-edit.php index 6b0d94ea..08fbf17f 100644 --- a/accounts/ap/invoice-payments-edit.php +++ b/accounts/ap/invoice-payments-edit.php @@ -27,7 +27,7 @@ class page_output var $obj_form_item; - function page_output() + function __construct() { // fetch variables $this->id = @security_script_input('/^[0-9]*$/', $_GET["id"]); diff --git a/accounts/ap/invoice-payments.php b/accounts/ap/invoice-payments.php index cfc30dbb..d1947d77 100644 --- a/accounts/ap/invoice-payments.php +++ b/accounts/ap/invoice-payments.php @@ -20,7 +20,7 @@ class page_output var $obj_table_payments; - function page_output() + function __construct() { // fetch vapiables $this->id = @security_script_input('/^[0-9]*$/', $_GET["id"]); diff --git a/accounts/ap/invoice-view.php b/accounts/ap/invoice-view.php index 329cb5d2..fba38436 100644 --- a/accounts/ap/invoice-view.php +++ b/accounts/ap/invoice-view.php @@ -26,7 +26,7 @@ class page_output var $obj_form_invoice; - function page_output() + function __construct() { // fetch vapiables $this->id = @security_script_input('/^[0-9]*$/', $_GET["id"]); diff --git a/accounts/ap/journal-edit-process.php b/accounts/ap/journal-edit-process.php index eb863549..89b2864b 100644 --- a/accounts/ap/journal-edit-process.php +++ b/accounts/ap/journal-edit-process.php @@ -40,7 +40,7 @@ /// if there was an error, go back to the entry page - if ($_SESSION["error"]["message"]) + if (isset($_SESSION["error"]["message"])) { $_SESSION["error"]["form"]["journal_edit"] = "failed"; header("Location: ../../index.php?page=accounts/ap/journal.php&id=". $journal->structure["customid"] ."&journalid=". $journal->structure["id"] ."&action=". $journal->structure["action"] .""); diff --git a/accounts/ap/journal-edit.php b/accounts/ap/journal-edit.php index 5ea88f32..04b5f0ea 100644 --- a/accounts/ap/journal-edit.php +++ b/accounts/ap/journal-edit.php @@ -20,7 +20,7 @@ class page_output var $obj_form_journal; - function page_output() + function __construct() { // fetch vapiables $this->id = @security_script_input('/^[0-9]*$/', $_GET["id"]); diff --git a/accounts/ap/journal.php b/accounts/ap/journal.php index 35e3c12c..7c194c9a 100644 --- a/accounts/ap/journal.php +++ b/accounts/ap/journal.php @@ -17,7 +17,7 @@ class page_output var $obj_journal; - function page_output() + function __construct() { // fetch vapiables $this->id = @security_script_input('/^[0-9]*$/', $_GET["id"]); @@ -113,6 +113,8 @@ function render_html() format_msgbox("locked", "

Note: your permissions limit you to read-only access to the journal

"); } + + // display options form $this->obj_journal->render_options_form(); diff --git a/accounts/ar/account-statements.php b/accounts/ar/account-statements.php index 31481d5f..1f106825 100644 --- a/accounts/ar/account-statements.php +++ b/accounts/ar/account-statements.php @@ -15,7 +15,7 @@ class page_output var $obj_table; var $obj_form; - function page_output() + function __construct() { // requirements $this->requires["css"][] = "include/accounts/css/account-statements.css"; diff --git a/accounts/ar/ar.php b/accounts/ar/ar.php index bd494bfd..9bf68e64 100644 --- a/accounts/ar/ar.php +++ b/accounts/ar/ar.php @@ -46,13 +46,15 @@ function execute() $this->obj_table->add_column("price", "amount_total", "account_ar.amount_total"); $this->obj_table->add_column("price", "amount_paid", "account_ar.amount_paid"); $this->obj_table->add_column("bool_tick", "sent", "account_ar.sentmethod"); + $this->obj_table->add_column("bool_tick", "cancelled", "account_ar.cancelled"); + $this->obj_table->add_column("bool_tick", "closed", "(account_ar.amount_paid=account_ar.amount_total AND account_ar.amount_total>0)"); // totals $this->obj_table->total_columns = array("amount_tax", "amount", "amount_total", "amount_paid"); // defaults - $this->obj_table->columns = array("code_invoice", "name_customer", "date_trans", "amount_total", "amount_paid"); + $this->obj_table->columns = array("code_invoice", "name_customer", "date_trans", "amount_total", "amount_paid","closed"); $this->obj_table->columns_order = array("code_invoice"); $this->obj_table->columns_order_options = array("code_invoice", "code_ordernumber", "code_ponumber", "name_customer", "name_staff", "date_trans", "date_due", "sent"); @@ -93,13 +95,23 @@ function execute() $this->obj_table->add_filter($structure); $structure = NULL; - $structure["fieldname"] = "hide_closed"; - $structure["type"] = "checkbox"; - $structure["options"]["label"] = "Hide Closed Invoices"; - $structure["defaultvalue"] = "enabled"; - $structure["sql"] = "account_ar.amount_paid!=account_ar.amount_total"; + $structure["fieldname"] = "hide_closed"; + $structure["type"] = "checkbox"; + $structure["options"]["label"] = "Hide Completed Invoices"; + $structure["defaultvalue"] = "enabled"; + $structure["sql"] = "((account_ar.amount_paid<>account_ar.amount_total AND account_ar.amount_total>0) OR (account_ar.amount_total=0))"; $this->obj_table->add_filter($structure); - + + $structure = NULL; + $structure["fieldname"] = "hide_cancelled"; + $structure["type"] = "checkbox"; + $structure["options"]["label"] = "Hide Cancelled Invoices"; + $structure["options"]["no_fieldname"] = true; + $structure["options"]["no_shift"] = true; + $structure["defaultvalue"] = "enabled"; + $structure["sql"] = "account_ar.cancelled=0"; + $this->obj_table->add_filter($structure); + // load options $this->obj_table->load_options_form(); @@ -158,6 +170,15 @@ function render_html() $structure["id"]["column"] = "id"; $this->obj_table->add_link("payments", "accounts/ar/invoice-payments.php", $structure); + // journal link + $structure = NULL; + $structure["id"]["column"] = "id"; + $this->obj_table->add_link("journal", "accounts/ar/journal.php", $structure); + + // export link + $structure = NULL; + $structure["id"]["column"] = "id"; + $this->obj_table->add_link("export", "accounts/ar/invoice-export.php", $structure); diff --git a/accounts/ar/credit-add.php b/accounts/ar/credit-add.php index 27abd20d..6c2d4867 100644 --- a/accounts/ar/credit-add.php +++ b/accounts/ar/credit-add.php @@ -18,7 +18,7 @@ class page_output var $obj_menu_nav; var $obj_form_credit; - function page_output() + function __construct() { $this->requires["javascript"][] = "include/customers/javascript/populate_invoices_dropdown.js"; } diff --git a/accounts/ar/credit-delete.php b/accounts/ar/credit-delete.php index c1575903..0de87589 100644 --- a/accounts/ar/credit-delete.php +++ b/accounts/ar/credit-delete.php @@ -22,7 +22,7 @@ class page_output var $obj_form_credit; - function page_output() + function __construct() { // fetch variables $this->id = @security_script_input('/^[0-9]*$/', $_GET["id"]); diff --git a/accounts/ar/credit-export.php b/accounts/ar/credit-export.php index 5b51fbe4..9b96f703 100644 --- a/accounts/ar/credit-export.php +++ b/accounts/ar/credit-export.php @@ -21,7 +21,7 @@ class page_output var $obj_form_credit; - function page_output() + function __construct() { $this->requires["javascript"][] = "include/accounts/javascript/credit-export.js"; diff --git a/accounts/ar/credit-items-edit.php b/accounts/ar/credit-items-edit.php index d0696a22..9869f32d 100644 --- a/accounts/ar/credit-items-edit.php +++ b/accounts/ar/credit-items-edit.php @@ -29,10 +29,10 @@ class page_output var $obj_form_item; - function page_output() + function __construct() { //require javascript file - $this->requires["javascript"][] = "include/accounts/javascript/invoice-items-edit.js"; + $this->requires["javascript"][] = "include/accounts/javascript/invoice-items-edit_ar.js"; // fetch variables $this->id = @@security_script_input('/^[0-9]*$/', $_GET["id"]); diff --git a/accounts/ar/credit-items.php b/accounts/ar/credit-items.php index bd8ba9c1..137d0475 100644 --- a/accounts/ar/credit-items.php +++ b/accounts/ar/credit-items.php @@ -22,7 +22,7 @@ class page_output var $obj_table_items; - function page_output() + function __construct() { $this->requires["css"][] = "include/accounts/css/invoice-items-edit.css"; diff --git a/accounts/ar/credit-journal-edit.php b/accounts/ar/credit-journal-edit.php index 794f8bc6..c3751df2 100644 --- a/accounts/ar/credit-journal-edit.php +++ b/accounts/ar/credit-journal-edit.php @@ -20,7 +20,7 @@ class page_output var $obj_form_journal; - function page_output() + function __construct() { // fetch variables $this->id = @@security_script_input('/^[0-9]*$/', $_GET["id"]); diff --git a/accounts/ar/credit-journal.php b/accounts/ar/credit-journal.php index 35f67946..679ce32a 100644 --- a/accounts/ar/credit-journal.php +++ b/accounts/ar/credit-journal.php @@ -17,7 +17,7 @@ class page_output var $obj_journal; - function page_output() + function __construct() { // fetch variables $this->id = @security_script_input('/^[0-9]*$/', $_GET["id"]); diff --git a/accounts/ar/credit-payments.php b/accounts/ar/credit-payments.php index ce1f6994..979929b7 100644 --- a/accounts/ar/credit-payments.php +++ b/accounts/ar/credit-payments.php @@ -20,7 +20,7 @@ class page_output var $obj_table_items; - function page_output() + function __construct() { $this->requires["css"][] = "include/accounts/css/invoice-items-edit.css"; diff --git a/accounts/ar/credit-view.php b/accounts/ar/credit-view.php index 0648ce18..f89a488b 100644 --- a/accounts/ar/credit-view.php +++ b/accounts/ar/credit-view.php @@ -21,7 +21,7 @@ class page_output var $obj_form_credit; - function page_output() + function __construct() { // fetch variables $this->id = @security_script_input('/^[0-9]*$/', $_GET["id"]); diff --git a/accounts/ar/invoice-bulk-payments.php b/accounts/ar/invoice-bulk-payments.php index ba9c4ac8..6f6f092b 100644 --- a/accounts/ar/invoice-bulk-payments.php +++ b/accounts/ar/invoice-bulk-payments.php @@ -14,7 +14,7 @@ class page_output var $obj_table; var $obj_form; - function page_output() + function __construct() { // requirements $this->requires["css"][] = "include/accounts/css/invoice-bulk-payments.css"; diff --git a/accounts/ar/invoice-delete.php b/accounts/ar/invoice-delete.php index 3a5e18fa..07019b03 100644 --- a/accounts/ar/invoice-delete.php +++ b/accounts/ar/invoice-delete.php @@ -21,7 +21,7 @@ class page_output var $obj_form_invoice; - function page_output() + function __construct() { // fetch variables $this->id = @security_script_input('/^[0-9]*$/', $_GET["id"]); @@ -34,7 +34,15 @@ function page_output() $this->obj_menu_nav->add_item("Invoice Payments", "page=accounts/ar/invoice-payments.php&id=". $this->id .""); $this->obj_menu_nav->add_item("Invoice Journal", "page=accounts/ar/journal.php&id=". $this->id .""); $this->obj_menu_nav->add_item("Export Invoice", "page=accounts/ar/invoice-export.php&id=". $this->id .""); - $this->obj_menu_nav->add_item("Delete Invoice", "page=accounts/ar/invoice-delete.php&id=". $this->id ."", TRUE); + if($GLOBALS["config"]["ACCOUNTS_CANCEL_DELETE"]=="1") + { + $title="Cancel Invoice"; + } + else + { + $title="Delete Invoice"; + } + $this->obj_menu_nav->add_item($title, "page=accounts/ar/invoice-delete.php&id=". $this->id ."",TRUE); } @@ -77,10 +85,18 @@ function execute() function render_html() { - // heading - print "

DELETE INVOICE


"; - print "

This page allows you to delete incorrect invoices, provided that they have not been locked.

"; - + if($GLOBALS["config"]["ACCOUNTS_CANCEL_DELETE"]=="1") + { + // heading + print "

CANCEL INVOICE


"; + print "

This page allows you to cancel incorrect invoices, provided that they have not been locked.

"; + } + else + { + // heading + print "

DELETE INVOICE


"; + print "

This page allows you to delete incorrect invoices, provided that they have not been locked.

"; + } // display summary box invoice_render_summarybox("ar", $this->id); diff --git a/accounts/ar/invoice-export.php b/accounts/ar/invoice-export.php index c8d8c2ed..047dc208 100644 --- a/accounts/ar/invoice-export.php +++ b/accounts/ar/invoice-export.php @@ -20,7 +20,7 @@ class page_output var $obj_form_invoice; - function page_output() + function __construct() { $this->requires["javascript"][] = "include/accounts/javascript/invoice-export.js"; @@ -36,9 +36,20 @@ function page_output() $this->obj_menu_nav->add_item("Invoice Journal", "page=accounts/ar/journal.php&id=". $this->id .""); $this->obj_menu_nav->add_item("Export Invoice", "page=accounts/ar/invoice-export.php&id=". $this->id ."", TRUE); - if (user_permissions_get("accounts_ar_write")) + if (user_permissions_get("accounts_ar_write") + && ((sql_get_singlevalue("SELECT cancelled as value FROM account_ar WHERE id='".$this->id."'")=='0' && $GLOBALS["config"]["ACCOUNTS_CANCEL_DELETE"]=="1") + || $GLOBALS["config"]["ACCOUNTS_CANCEL_DELETE"]=="0") + ) { - $this->obj_menu_nav->add_item("Delete Invoice", "page=accounts/ar/invoice-delete.php&id=". $this->id .""); + if($GLOBALS["config"]["ACCOUNTS_CANCEL_DELETE"]=="1") + { + $title="Cancel Invoice"; + } + else + { + $title="Delete Invoice"; + } + $this->obj_menu_nav->add_item($title, "page=accounts/ar/invoice-delete.php&id=". $this->id .""); } } diff --git a/accounts/ar/invoice-items-edit.php b/accounts/ar/invoice-items-edit.php index 0017952d..7197d43b 100644 --- a/accounts/ar/invoice-items-edit.php +++ b/accounts/ar/invoice-items-edit.php @@ -22,6 +22,7 @@ class page_output var $id; var $itemid; var $item_type; + var $productid; var $requires; var $obj_menu_nav; @@ -29,10 +30,10 @@ class page_output var $obj_form_item; - function page_output() + function __construct() { //require javascript file - $this->requires["javascript"][] = "include/accounts/javascript/invoice-items-edit.js"; + $this->requires["javascript"][] = "include/accounts/javascript/invoice-items-edit_ar.js"; // fetch variables $this->id = @@security_script_input('/^[0-9]*$/', $_GET["id"]); @@ -48,7 +49,22 @@ function page_output() $this->obj_menu_nav->add_item("Invoice Payments", "page=accounts/ar/invoice-payments.php&id=". $this->id .""); $this->obj_menu_nav->add_item("Invoice Journal", "page=accounts/ar/journal.php&id=". $this->id .""); $this->obj_menu_nav->add_item("Export Invoice", "page=accounts/ar/invoice-export.php&id=". $this->id .""); - $this->obj_menu_nav->add_item("Delete Invoice", "page=accounts/ar/invoice-delete.php&id=". $this->id .""); + + if (user_permissions_get("accounts_ar_write") + && ((sql_get_singlevalue("SELECT cancelled as value FROM account_ar WHERE id='".$this->id."'")=='0' && $GLOBALS["config"]["ACCOUNTS_CANCEL_DELETE"]=="1") + || $GLOBALS["config"]["ACCOUNTS_CANCEL_DELETE"]=="0") + ) + { + if($GLOBALS["config"]["ACCOUNTS_CANCEL_DELETE"]=="1") + { + $title="Cancel Invoice"; + } + else + { + $title="Delete Invoice"; + } + $this->obj_menu_nav->add_item($title, "page=accounts/ar/invoice-delete.php&id=". $this->id .""); + } } diff --git a/accounts/ar/invoice-items.php b/accounts/ar/invoice-items.php index 2e921951..ab8ddfd4 100644 --- a/accounts/ar/invoice-items.php +++ b/accounts/ar/invoice-items.php @@ -21,7 +21,7 @@ class page_output var $obj_table_items; - function page_output() + function __construct() { $this->requires["css"][] = "include/accounts/css/invoice-items-edit.css"; // fetch variables @@ -36,9 +36,20 @@ function page_output() $this->obj_menu_nav->add_item("Invoice Journal", "page=accounts/ar/journal.php&id=". $this->id .""); $this->obj_menu_nav->add_item("Export Invoice", "page=accounts/ar/invoice-export.php&id=". $this->id .""); - if (user_permissions_get("accounts_ar_write")) + if (user_permissions_get("accounts_ar_write") + && ((sql_get_singlevalue("SELECT cancelled as value FROM account_ar WHERE id='".$this->id."'")=='0' && $GLOBALS["config"]["ACCOUNTS_CANCEL_DELETE"]=="1") + || $GLOBALS["config"]["ACCOUNTS_CANCEL_DELETE"]=="0") + ) { - $this->obj_menu_nav->add_item("Delete Invoice", "page=accounts/ar/invoice-delete.php&id=". $this->id .""); + if($GLOBALS["config"]["ACCOUNTS_CANCEL_DELETE"]=="1") + { + $title="Cancel Invoice"; + } + else + { + $title="Delete Invoice"; + } + $this->obj_menu_nav->add_item($title, "page=accounts/ar/invoice-delete.php&id=". $this->id .""); } } diff --git a/accounts/ar/invoice-payments-edit.php b/accounts/ar/invoice-payments-edit.php index e2a7a215..2dc2f6c5 100644 --- a/accounts/ar/invoice-payments-edit.php +++ b/accounts/ar/invoice-payments-edit.php @@ -27,7 +27,7 @@ class page_output var $obj_form_item; - function page_output() + function __construct() { // fetch variables $this->id = @@security_script_input('/^[0-9]*$/', $_GET["id"]); @@ -41,7 +41,21 @@ function page_output() $this->obj_menu_nav->add_item("Invoice Payments", "page=accounts/ar/invoice-payments.php&id=". $this->id ."", TRUE); $this->obj_menu_nav->add_item("Invoice Journal", "page=accounts/ar/journal.php&id=". $this->id .""); $this->obj_menu_nav->add_item("Export Invoice", "page=accounts/ar/invoice-export.php&id=". $this->id .""); - $this->obj_menu_nav->add_item("Delete Invoice", "page=accounts/ar/invoice-delete.php&id=". $this->id .""); + if (user_permissions_get("accounts_ar_write") + && ((sql_get_singlevalue("SELECT cancelled as value FROM account_ar WHERE id='".$this->id."'")=='0' && $GLOBALS["config"]["ACCOUNTS_CANCEL_DELETE"]=="1") + || $GLOBALS["config"]["ACCOUNTS_CANCEL_DELETE"]=="0") + ) + { + if($GLOBALS["config"]["ACCOUNTS_CANCEL_DELETE"]=="1") + { + $title="Cancel Invoice"; + } + else + { + $title="Delete Invoice"; + } + $this->obj_menu_nav->add_item($title, "page=accounts/ar/invoice-delete.php&id=". $this->id .""); + } } diff --git a/accounts/ar/invoice-payments.php b/accounts/ar/invoice-payments.php index 6e1372b2..e9ffb72f 100644 --- a/accounts/ar/invoice-payments.php +++ b/accounts/ar/invoice-payments.php @@ -20,7 +20,7 @@ class page_output var $obj_table_payments; - function page_output() + function __construct() { // fetch variables $this->id = @security_script_input('/^[0-9]*$/', $_GET["id"]); @@ -34,9 +34,20 @@ function page_output() $this->obj_menu_nav->add_item("Invoice Journal", "page=accounts/ar/journal.php&id=". $this->id .""); $this->obj_menu_nav->add_item("Export Invoice", "page=accounts/ar/invoice-export.php&id=". $this->id .""); - if (user_permissions_get("accounts_ar_write")) + if (user_permissions_get("accounts_ar_write") + && ((sql_get_singlevalue("SELECT cancelled as value FROM account_ar WHERE id='".$this->id."'")=='0' && $GLOBALS["config"]["ACCOUNTS_CANCEL_DELETE"]=="1") + || $GLOBALS["config"]["ACCOUNTS_CANCEL_DELETE"]=="0") + ) { - $this->obj_menu_nav->add_item("Delete Invoice", "page=accounts/ar/invoice-delete.php&id=". $this->id .""); + if($GLOBALS["config"]["ACCOUNTS_CANCEL_DELETE"]=="1") + { + $title="Cancel Invoice"; + } + else + { + $title="Delete Invoice"; + } + $this->obj_menu_nav->add_item($title, "page=accounts/ar/invoice-delete.php&id=". $this->id .""); } } diff --git a/accounts/ar/invoice-view.php b/accounts/ar/invoice-view.php index 9e4eb8ba..9a991e80 100644 --- a/accounts/ar/invoice-view.php +++ b/accounts/ar/invoice-view.php @@ -20,7 +20,7 @@ class page_output var $obj_form_invoice; - function page_output() + function __construct() { // fetch variables $this->id = @security_script_input('/^[0-9]*$/', $_GET["id"]); @@ -34,9 +34,20 @@ function page_output() $this->obj_menu_nav->add_item("Invoice Journal", "page=accounts/ar/journal.php&id=". $this->id .""); $this->obj_menu_nav->add_item("Export Invoice", "page=accounts/ar/invoice-export.php&id=". $this->id .""); - if (user_permissions_get("accounts_ar_write")) + if (user_permissions_get("accounts_ar_write") + && ((sql_get_singlevalue("SELECT cancelled as value FROM account_ar WHERE id='".$this->id."'")=='0' && $GLOBALS["config"]["ACCOUNTS_CANCEL_DELETE"]=="1") + || $GLOBALS["config"]["ACCOUNTS_CANCEL_DELETE"]=="0") + ) { - $this->obj_menu_nav->add_item("Delete Invoice", "page=accounts/ar/invoice-delete.php&id=". $this->id .""); + if($GLOBALS["config"]["ACCOUNTS_CANCEL_DELETE"]=="1") + { + $title="Cancel Invoice"; + } + else + { + $title="Delete Invoice"; + } + $this->obj_menu_nav->add_item($title, "page=accounts/ar/invoice-delete.php&id=". $this->id .""); } } diff --git a/accounts/ar/journal-edit.php b/accounts/ar/journal-edit.php index b7cbb31d..f7961806 100644 --- a/accounts/ar/journal-edit.php +++ b/accounts/ar/journal-edit.php @@ -20,7 +20,7 @@ class page_output var $obj_form_journal; - function page_output() + function __construct() { // fetch variables $this->id = @@security_script_input('/^[0-9]*$/', $_GET["id"]); @@ -37,7 +37,22 @@ function page_output() $this->obj_menu_nav->add_item("Invoice Payments", "page=accounts/ar/invoice-payments.php&id=". $this->id .""); $this->obj_menu_nav->add_item("Invoice Journal", "page=accounts/ar/journal.php&id=". $this->id ."", TRUE); $this->obj_menu_nav->add_item("Export Invoice", "page=accounts/ar/invoice-export.php&id=". $this->id .""); - $this->obj_menu_nav->add_item("Delete Invoice", "page=accounts/ar/invoice-delete.php&id=". $this->id .""); + + if (user_permissions_get("accounts_ar_write") + && ((sql_get_singlevalue("SELECT cancelled as value FROM account_ar WHERE id='".$this->id."'")=='0' && $GLOBALS["config"]["ACCOUNTS_CANCEL_DELETE"]=="1") + || $GLOBALS["config"]["ACCOUNTS_CANCEL_DELETE"]=="0") + ) + { + if($GLOBALS["config"]["ACCOUNTS_CANCEL_DELETE"]=="1") + { + $title="Cancel Invoice"; + } + else + { + $title="Delete Invoice"; + } + $this->obj_menu_nav->add_item($title, "page=accounts/ar/invoice-delete.php&id=". $this->id .""); + } } diff --git a/accounts/ar/journal.php b/accounts/ar/journal.php index 6f26f678..3342680d 100644 --- a/accounts/ar/journal.php +++ b/accounts/ar/journal.php @@ -17,7 +17,7 @@ class page_output var $obj_journal; - function page_output() + function __construct() { // fetch variables $this->id = @security_script_input('/^[0-9]*$/', $_GET["id"]); @@ -31,9 +31,20 @@ function page_output() $this->obj_menu_nav->add_item("Invoice Journal", "page=accounts/ar/journal.php&id=". $this->id ."", TRUE); $this->obj_menu_nav->add_item("Export Invoice", "page=accounts/ar/invoice-export.php&id=". $this->id .""); - if (user_permissions_get("accounts_ar_write")) + if (user_permissions_get("accounts_ar_write") + && ((sql_get_singlevalue("SELECT cancelled as value FROM account_ar WHERE id='".$this->id."'")=='0' && $GLOBALS["config"]["ACCOUNTS_CANCEL_DELETE"]=="1") + || $GLOBALS["config"]["ACCOUNTS_CANCEL_DELETE"]=="0") + ) { - $this->obj_menu_nav->add_item("Delete Invoice", "page=accounts/ar/invoice-delete.php&id=". $this->id .""); + if($GLOBALS["config"]["ACCOUNTS_CANCEL_DELETE"]=="1") + { + $title="Cancel Invoice"; + } + else + { + $title="Delete Invoice"; + } + $this->obj_menu_nav->add_item($title, "page=accounts/ar/invoice-delete.php&id=". $this->id .""); } } diff --git a/accounts/charts/delete.php b/accounts/charts/delete.php index 10bf0b2d..de94bbf0 100644 --- a/accounts/charts/delete.php +++ b/accounts/charts/delete.php @@ -22,7 +22,7 @@ class page_output var $locked; - function page_output() + function __construct() { // fetch variables $this->id = @security_script_input('/^[0-9]*$/', $_GET["id"]); diff --git a/accounts/charts/ledger.php b/accounts/charts/ledger.php index 9c198aa7..b8c02e20 100644 --- a/accounts/charts/ledger.php +++ b/accounts/charts/ledger.php @@ -20,7 +20,7 @@ class page_output var $obj_ledger; - function page_output() + function __construct() { // fetch variables $this->id = @security_script_input('/^[0-9]*$/', $_GET["id"]); diff --git a/accounts/charts/view.php b/accounts/charts/view.php index 32b687a3..a2506dce 100644 --- a/accounts/charts/view.php +++ b/accounts/charts/view.php @@ -19,7 +19,7 @@ class page_output var $chart_type; // hold the ID of the chart type - function page_output() + function __construct() { // fetch variables $this->id = @security_script_input('/^[0-9]*$/', $_GET["id"]); diff --git a/accounts/gl/delete.php b/accounts/gl/delete.php index ee9cf0ba..eee6880a 100644 --- a/accounts/gl/delete.php +++ b/accounts/gl/delete.php @@ -18,7 +18,7 @@ class page_output var $locked; - function page_output() + function __construct() { // fetch variables $this->id = @security_script_input('/^[0-9]*$/', $_GET["id"]); diff --git a/accounts/gl/view.php b/accounts/gl/view.php index 5db98796..024b1495 100644 --- a/accounts/gl/view.php +++ b/accounts/gl/view.php @@ -22,7 +22,7 @@ class page_output var $num_trans; - function page_output() + function __construct() { // define page dependencies $this->requires["javascript"][] = "include/accounts/javascript/gl.js"; diff --git a/accounts/import/bankstatement-assign.php b/accounts/import/bankstatement-assign.php index 65639750..d3042184 100644 --- a/accounts/import/bankstatement-assign.php +++ b/accounts/import/bankstatement-assign.php @@ -20,7 +20,7 @@ class page_output var $obj_form; - function page_output() + function __construct() { $this->requires["javascript"][] = "include/accounts/javascript/import.js"; $this->requires["css"][] = "include/accounts/css/bankstatement-assign.css"; diff --git a/accounts/import/bankstatement-csv.php b/accounts/import/bankstatement-csv.php index a9789bb9..624c5647 100644 --- a/accounts/import/bankstatement-csv.php +++ b/accounts/import/bankstatement-csv.php @@ -15,7 +15,7 @@ class page_output var $example_array; - function page_output() + function __construct() { $this->requires["javascript"][] = "include/accounts/javascript/import.js"; $this->requires["css"][] = "include/accounts/css/bankstatement-csv.css"; diff --git a/accounts/quotes/journal-edit.php b/accounts/quotes/journal-edit.php index 2f22eae0..d497626b 100644 --- a/accounts/quotes/journal-edit.php +++ b/accounts/quotes/journal-edit.php @@ -19,7 +19,7 @@ class page_output var $obj_form_journal; - function page_output() + function __construct() { // fetch quote ID $this->id = @security_script_input('/^[0-9]*$/', $_GET["id"]); @@ -35,6 +35,7 @@ function page_output() $this->obj_menu_nav->add_item("Quote Items", "page=accounts/quotes/quotes-items.php&id=". $this->id .""); $this->obj_menu_nav->add_item("Quote Journal", "page=accounts/quotes/journal.php&id=". $this->id ."", TRUE); $this->obj_menu_nav->add_item("Export Quote", "page=accounts/quotes/quotes-export.php&id=". $this->id .""); + $this->obj_menu_nav->add_item("Create Project", "page=accounts/quotes/quotes-convert-project.php&id=". $this->id .""); $this->obj_menu_nav->add_item("Convert to Invoice", "page=accounts/quotes/quotes-convert.php&id=". $this->id .""); $this->obj_menu_nav->add_item("Delete Quote", "page=accounts/quotes/quotes-delete.php&id=". $this->id .""); } diff --git a/accounts/quotes/journal.php b/accounts/quotes/journal.php index 6931213a..98fd6d1e 100644 --- a/accounts/quotes/journal.php +++ b/accounts/quotes/journal.php @@ -18,7 +18,7 @@ class page_output var $obj_journal; - function page_output() + function __construct() { // fetch quote ID $this->id = @security_script_input('/^[0-9]*$/', $_GET["id"]); @@ -33,6 +33,7 @@ function page_output() if (user_permissions_get("accounts_quotes_write")) { + $this->obj_menu_nav->add_item("Create Project", "page=accounts/quotes/quotes-convert-project.php&id=". $this->id .""); $this->obj_menu_nav->add_item("Convert to Invoice", "page=accounts/quotes/quotes-convert.php&id=". $this->id .""); $this->obj_menu_nav->add_item("Delete Quote", "page=accounts/quotes/quotes-delete.php&id=". $this->id .""); } diff --git a/accounts/quotes/quotes-convert-project.php b/accounts/quotes/quotes-convert-project.php new file mode 100644 index 00000000..40df4f14 --- /dev/null +++ b/accounts/quotes/quotes-convert-project.php @@ -0,0 +1,130 @@ +id = @security_script_input('/^[0-9]*$/', $_GET["id"]); + + // define the navigiation menu + $this->obj_menu_nav = New menu_nav; + + $this->obj_menu_nav->add_item("Quote Details", "page=accounts/quotes/quotes-view.php&id=". $this->id .""); + $this->obj_menu_nav->add_item("Quote Items", "page=accounts/quotes/quotes-items.php&id=". $this->id .""); + $this->obj_menu_nav->add_item("Quote Journal", "page=accounts/quotes/journal.php&id=". $this->id .""); + $this->obj_menu_nav->add_item("Export Quote", "page=accounts/quotes/quotes-export.php&id=". $this->id .""); + $this->obj_menu_nav->add_item("Create Project", "page=accounts/quotes/quotes-convert-project.php&id=". $this->id ."",TRUE); + $this->obj_menu_nav->add_item("Convert to Invoice", "page=accounts/quotes/quotes-convert.php&id=". $this->id .""); + $this->obj_menu_nav->add_item("Delete Quote", "page=accounts/quotes/quotes-delete.php&id=". $this->id .""); + } + + function check_permissions() + { + return user_permissions_get("projects_write"); + } + + function check_requirements() + { + // nothing todo + return 1; + } + + + function execute() + { + /* + Define form structure + */ + $this->obj_form = New form_input; + $this->obj_form->formname = "project_add"; + $this->obj_form->language = $_SESSION["user"]["lang"]; + + $this->obj_form->action = "projects/edit-process.php"; + $this->obj_form->method = "post"; + + + // general + $structure = NULL; + $structure["fieldname"] = "name_project"; + $structure["type"] = "input"; + $structure["options"]["req"] = "yes"; + $this->obj_form->add_input($structure); + + $structure = NULL; + $structure["fieldname"] = "code_project"; + $structure["type"] = "input"; + $this->obj_form->add_input($structure); + + $structure = NULL; + $structure["fieldname"] = "project_quote"; + $structure["type"] = "input"; + $structure["defaultvalue"] = sql_get_singlevalue("SELECT code_quote as value FROM account_quotes WHERE id=".$this->id); + $this->obj_form->add_input($structure); + + $structure = NULL; + $structure["fieldname"] = "date_start"; + $structure["type"] = "date"; + $structure["defaultvalue"] = date("Y-m-d"); + $structure["options"]["req"] = "yes"; + $this->obj_form->add_input($structure); + + $structure = NULL; + $structure["fieldname"] = "date_end"; + $structure["type"] = "date"; + $this->obj_form->add_input($structure); + + $structure = NULL; + $structure["fieldname"] = "internal_only"; + $structure["type"] = "checkbox"; + $structure["options"]["label"] = "This is an internal project - do not alert to unbilled hours"; + $this->obj_form->add_input($structure); + + $structure = NULL; + $structure["fieldname"] = "details"; + $structure["type"] = "textarea"; + $this->obj_form->add_input($structure); + + + // submit button + $structure = NULL; + $structure["fieldname"] = "submit"; + $structure["type"] = "submit"; + $structure["defaultvalue"] = "Create Project"; + $this->obj_form->add_input($structure); + + + // define subforms + $this->obj_form->subforms["project_view"] = array("code_project", "name_project", "project_quote", "date_start", "date_end", "internal_only", "details"); + $this->obj_form->subforms["submit"] = array("submit"); + + // load any data returned due to errors + $this->obj_form->load_data_error(); + + } + + function render_html() + { + // Title + Summary + print "

ADD NEW PROJECT


"; + print "

This page allows you to add a new project.

"; + + + // display the form + $this->obj_form->render_form(); + } + +} + +?> diff --git a/accounts/quotes/quotes-convert.php b/accounts/quotes/quotes-convert.php index 1b8795d9..13690524 100644 --- a/accounts/quotes/quotes-convert.php +++ b/accounts/quotes/quotes-convert.php @@ -20,7 +20,7 @@ class page_output var $obj_form_quote; - function page_output() + function __construct() { // fetch quote ID $this->id = @security_script_input('/^[0-9]*$/', $_GET["id"]); @@ -32,6 +32,7 @@ function page_output() $this->obj_menu_nav->add_item("Quote Items", "page=accounts/quotes/quotes-items.php&id=". $this->id .""); $this->obj_menu_nav->add_item("Quote Journal", "page=accounts/quotes/journal.php&id=". $this->id .""); $this->obj_menu_nav->add_item("Export Quote", "page=accounts/quotes/quotes-export.php&id=". $this->id .""); + $this->obj_menu_nav->add_item("Create Project", "page=accounts/quotes/quotes-convert-project.php&id=". $this->id .""); $this->obj_menu_nav->add_item("Convert to Invoice", "page=accounts/quotes/quotes-convert.php&id=". $this->id ."", TRUE); $this->obj_menu_nav->add_item("Delete Quote", "page=accounts/quotes/quotes-delete.php&id=". $this->id .""); } diff --git a/accounts/quotes/quotes-delete.php b/accounts/quotes/quotes-delete.php index 797a9d92..a6fcc269 100644 --- a/accounts/quotes/quotes-delete.php +++ b/accounts/quotes/quotes-delete.php @@ -19,7 +19,7 @@ class page_output var $obj_form_quote; - function page_output() + function __construct() { // fetch quote ID $this->id = @security_script_input('/^[0-9]*$/', $_GET["id"]); @@ -31,6 +31,7 @@ function page_output() $this->obj_menu_nav->add_item("Quote Items", "page=accounts/quotes/quotes-items.php&id=". $this->id .""); $this->obj_menu_nav->add_item("Quote Journal", "page=accounts/quotes/journal.php&id=". $this->id .""); $this->obj_menu_nav->add_item("Export Quote", "page=accounts/quotes/quotes-export.php&id=". $this->id .""); + $this->obj_menu_nav->add_item("Create Project", "page=accounts/quotes/quotes-convert-project.php&id=". $this->id .""); $this->obj_menu_nav->add_item("Convert to Invoice", "page=accounts/quotes/quotes-convert.php&id=". $this->id .""); $this->obj_menu_nav->add_item("Delete Quote", "page=accounts/quotes/quotes-delete.php&id=". $this->id ."", TRUE); } diff --git a/accounts/quotes/quotes-export.php b/accounts/quotes/quotes-export.php index 076c2881..ad882679 100644 --- a/accounts/quotes/quotes-export.php +++ b/accounts/quotes/quotes-export.php @@ -21,7 +21,7 @@ class page_output var $obj_form_invoice; - function page_output() + function __construct() { // fetch variables $this->id = @security_script_input('/^[0-9]*$/', $_GET["id"]); @@ -36,6 +36,7 @@ function page_output() if (user_permissions_get("accounts_quotes_write")) { + $this->obj_menu_nav->add_item("Create Project", "page=accounts/quotes/quotes-convert-project.php&id=". $this->id .""); $this->obj_menu_nav->add_item("Convert to Invoice", "page=accounts/quotes/quotes-convert.php&id=". $this->id .""); $this->obj_menu_nav->add_item("Delete Quote", "page=accounts/quotes/quotes-delete.php&id=". $this->id .""); } diff --git a/accounts/quotes/quotes-items-edit.php b/accounts/quotes/quotes-items-edit.php index 41d91810..db3e5fce 100644 --- a/accounts/quotes/quotes-items-edit.php +++ b/accounts/quotes/quotes-items-edit.php @@ -28,10 +28,10 @@ class page_output var $obj_form_item; - function page_output() + function __construct() { //require javascript file - $this->requires["javascript"][] = "include/accounts/javascript/invoice-items-edit.js"; + $this->requires["javascript"][] = "include/accounts/javascript/invoice-items-edit_ar.js"; // fetch vapiables $this->id = @security_script_input('/^[0-9]*$/', $_GET["id"]); @@ -46,6 +46,7 @@ function page_output() $this->obj_menu_nav->add_item("Quote Items", "page=accounts/quotes/quotes-items.php&id=". $this->id ."", TRUE); $this->obj_menu_nav->add_item("Quote Journal", "page=accounts/quotes/journal.php&id=". $this->id .""); $this->obj_menu_nav->add_item("Export Quote", "page=accounts/quotes/quotes-export.php&id=". $this->id .""); + $this->obj_menu_nav->add_item("Create Project", "page=accounts/quotes/quotes-convert-project.php&id=". $this->id .""); $this->obj_menu_nav->add_item("Convert to Invoice", "page=accounts/quotes/quotes-convert.php&id=". $this->id .""); $this->obj_menu_nav->add_item("Delete Quote", "page=accounts/quotes/quotes-delete.php&id=". $this->id .""); diff --git a/accounts/quotes/quotes-items.php b/accounts/quotes/quotes-items.php index b2a1b2ef..294db685 100644 --- a/accounts/quotes/quotes-items.php +++ b/accounts/quotes/quotes-items.php @@ -22,7 +22,7 @@ class page_output var $obj_table_items; - function page_output() + function __construct() { $this->requires["css"][] = "include/accounts/css/invoice-items-edit.css"; // fetch quote ID @@ -38,6 +38,7 @@ function page_output() if (user_permissions_get("accounts_quotes_write")) { + $this->obj_menu_nav->add_item("Create Project", "page=accounts/quotes/quotes-convert-project.php&id=". $this->id .""); $this->obj_menu_nav->add_item("Convert to Invoice", "page=accounts/quotes/quotes-convert.php&id=". $this->id .""); $this->obj_menu_nav->add_item("Delete Quote", "page=accounts/quotes/quotes-delete.php&id=". $this->id .""); } diff --git a/accounts/quotes/quotes-view.php b/accounts/quotes/quotes-view.php index 0e15b068..0933e990 100644 --- a/accounts/quotes/quotes-view.php +++ b/accounts/quotes/quotes-view.php @@ -20,7 +20,7 @@ class page_output var $obj_form_quote; - function page_output() + function __construct() { // fetch quote ID $this->id = @security_script_input('/^[0-9]*$/', $_GET["id"]); @@ -35,6 +35,7 @@ function page_output() if (user_permissions_get("accounts_quotes_write")) { + $this->obj_menu_nav->add_item("Create Project", "page=accounts/quotes/quotes-convert-project.php&id=". $this->id .""); $this->obj_menu_nav->add_item("Convert to Invoice", "page=accounts/quotes/quotes-convert.php&id=". $this->id .""); $this->obj_menu_nav->add_item("Delete Quote", "page=accounts/quotes/quotes-delete.php&id=". $this->id .""); } diff --git a/accounts/reports/incomestatement.php b/accounts/reports/incomestatement.php index e5583487..d0355a27 100644 --- a/accounts/reports/incomestatement.php +++ b/accounts/reports/incomestatement.php @@ -232,6 +232,8 @@ function execute() $sql_obj->prepare_sql_addwhere("date_trans <= '". $this->date_end ."'"); } + // Only include uncancelled invoices only + $sql_obj->prepare_sql_addwhere("cancelled='0'"); // paid invoices only if ($this->mode == "Cash") diff --git a/accounts/taxes/delete.php b/accounts/taxes/delete.php index b5bee3f8..34001922 100644 --- a/accounts/taxes/delete.php +++ b/accounts/taxes/delete.php @@ -19,7 +19,7 @@ class page_output var $locked; - function page_output() + function __construct() { // fetch variables $this->id = @security_script_input('/^[0-9]*$/', $_GET["id"]); diff --git a/accounts/taxes/ledger.php b/accounts/taxes/ledger.php index 76c96a9c..f70ef09e 100644 --- a/accounts/taxes/ledger.php +++ b/accounts/taxes/ledger.php @@ -17,7 +17,7 @@ class page_output var $obj_sql_tax; - function page_output() + function __construct() { // fetch variables $this->id = @security_script_input('/^[0-9]*$/', $_GET["id"]); diff --git a/accounts/taxes/tax_collected.php b/accounts/taxes/tax_collected.php index 809f41be..ec143a81 100644 --- a/accounts/taxes/tax_collected.php +++ b/accounts/taxes/tax_collected.php @@ -19,7 +19,7 @@ class page_output var $obj_taxreport; - function page_output() + function __construct() { // fetch variables $this->id = @security_script_input('/^[0-9]*$/', $_GET["id"]); diff --git a/accounts/taxes/tax_paid.php b/accounts/taxes/tax_paid.php index db008bb6..73538366 100644 --- a/accounts/taxes/tax_paid.php +++ b/accounts/taxes/tax_paid.php @@ -20,7 +20,7 @@ class page_output var $obj_taxreport; - function page_output() + function __construct() { // fetch variables $this->id = @security_script_input('/^[0-9]*$/', $_GET["id"]); diff --git a/accounts/taxes/view.php b/accounts/taxes/view.php index a8c5829c..bf256d96 100644 --- a/accounts/taxes/view.php +++ b/accounts/taxes/view.php @@ -21,7 +21,7 @@ class page_output var $obj_form; - function page_output() + function __construct() { // fetch variables $this->id = @security_script_input('/^[0-9]*$/', $_GET["id"]); diff --git a/admin/config_application-process.php b/admin/config_application-process.php index 1140e7b4..3a7950ce 100644 --- a/admin/config_application-process.php +++ b/admin/config_application-process.php @@ -35,6 +35,7 @@ $data["ACCOUNTS_SERVICES_DATESHIFT"] = @security_form_input_predefined("int", "ACCOUNTS_SERVICES_DATESHIFT", 1, ""); $data["ACCOUNTS_TERMS_DAYS"] = @security_form_input_predefined("int", "ACCOUNTS_TERMS_DAYS", 0, ""); $data["ACCOUNTS_AUTOPAY"] = @security_form_input_predefined("checkbox", "ACCOUNTS_AUTOPAY", 0, ""); + $data["ACCOUNTS_CANCEL_DELETE"] = @security_form_input_predefined("checkbox", "ACCOUNTS_CANCEL_DELETE", 0, ""); $data["ACCOUNTS_EMAIL_ADDRESS"] = @security_form_input_predefined("email", "ACCOUNTS_EMAIL_ADDRESS", 1, ""); $data["ACCOUNTS_EMAIL_AUTOBCC"] = @security_form_input_predefined("checkbox", "ACCOUNTS_EMAIL_AUTOBCC", 1, ""); diff --git a/admin/config_application.php b/admin/config_application.php index 7c7db4f2..840df9d4 100644 --- a/admin/config_application.php +++ b/admin/config_application.php @@ -139,6 +139,12 @@ function execute() $structure["options"]["label"] = " Check to have invoices automatically paid where there is credit or reoccuring billing details."; $this->obj_form->add_input($structure); + $structure = NULL; + $structure["fieldname"] = "ACCOUNTS_CANCEL_DELETE"; + $structure["type"] = "checkbox"; + $structure["options"]["no_translate_fieldname"] = "yes"; + $structure["options"]["label"] = " Check to have invoices cancelled when 'deleted'. Uncheck for proper deletion."; + $this->obj_form->add_input($structure); // email options @@ -358,7 +364,7 @@ function execute() // define subforms $this->obj_form->subforms["config_defcodes"] = array("ACCOUNTS_AP_INVOICENUM", "ACCOUNTS_AR_INVOICENUM", "ACCOUNTS_GL_TRANSNUM", "ACCOUNTS_QUOTES_NUM", "ACCOUNTS_CREDIT_NUM", "CODE_ACCOUNT", "CODE_CUSTOMER", "CODE_VENDOR", "CODE_PRODUCT", "CODE_PROJECT", "CODE_STAFF"); - $this->obj_form->subforms["config_accounts"] = array("ACCOUNTS_SERVICES_ADVANCEBILLING", "ACCOUNTS_SERVICES_DATESHIFT", "ACCOUNTS_TERMS_DAYS", "ACCOUNTS_AUTOPAY"); + $this->obj_form->subforms["config_accounts"] = array("ACCOUNTS_SERVICES_ADVANCEBILLING", "ACCOUNTS_SERVICES_DATESHIFT", "ACCOUNTS_TERMS_DAYS", "ACCOUNTS_AUTOPAY", "ACCOUNTS_CANCEL_DELETE"); $this->obj_form->subforms["config_accounts_email"] = array("ACCOUNTS_EMAIL_ADDRESS", "ACCOUNTS_INVOICE_AUTOEMAIL", "ACCOUNTS_EMAIL_AUTOBCC", "ACCOUNTS_INVOICE_BATCHREPORT"); $this->obj_form->subforms["config_services_email"] = array("SERVICES_USAGEALERTS_ENABLE"); $this->obj_form->subforms["config_orders"] = array("ORDERS_BILL_ONSERVICE", "ORDERS_BILL_ENDOFMONTH"); diff --git a/admin/config_company-process.php b/admin/config_company-process.php index dcb34f3d..0198a5bc 100644 --- a/admin/config_company-process.php +++ b/admin/config_company-process.php @@ -29,9 +29,15 @@ $data["COMPANY_ADDRESS1_COUNTRY"] = @security_form_input_predefined("any", "COMPANY_ADDRESS1_COUNTRY", 1, ""); $data["COMPANY_ADDRESS1_ZIPCODE"] = @security_form_input_predefined("any", "COMPANY_ADDRESS1_ZIPCODE", 0, ""); $data["COMPANY_PAYMENT_DETAILS"] = @security_form_input_predefined("any", "COMPANY_PAYMENT_DETAILS", 1, ""); - - - + $data["COMPANY_TAX_NUMBER"] = @security_form_input_predefined("any", "COMPANY_TAX_NUMBER", 0, ""); + $data["COMPANY_REG_NUMBER"] = @security_form_input_predefined("any", "COMPANY_REG_NUMBER", 0, ""); + $data["COMPANY_ADDRESS2_STREET"] = @security_form_input_predefined("any", "COMPANY_ADDRESS2_STREET", 1, ""); + $data["COMPANY_ADDRESS2_CITY"] = @security_form_input_predefined("any", "COMPANY_ADDRESS2_CITY", 1, ""); + $data["COMPANY_ADDRESS2_STATE"] = @security_form_input_predefined("any", "COMPANY_ADDRESS2_STATE", 0, ""); + $data["COMPANY_ADDRESS2_COUNTRY"] = @security_form_input_predefined("any", "COMPANY_ADDRESS2_COUNTRY", 1, ""); + $data["COMPANY_ADDRESS2_ZIPCODE"] = @security_form_input_predefined("any", "COMPANY_ADDRESS2_ZIPCODE", 0, ""); + $data["COMPANY_B2C_TERMS"] = @security_form_input_predefined("html", "COMPANY_B2C_TERMS", 0,""); + $data["COMPANY_B2B_TERMS"] = @security_form_input_predefined("html", "COMPANY_B2B_TERMS", 0,""); /* Process company logo upload and verify content if any has been supplied. Enforce png only diff --git a/admin/config_company.php b/admin/config_company.php index a5511577..62be6d03 100644 --- a/admin/config_company.php +++ b/admin/config_company.php @@ -44,6 +44,18 @@ function execute() $structure["type"] = "input"; $structure["options"]["no_translate_fieldname"] = "yes"; $this->obj_form->add_input($structure); + + $structure = NULL; + $structure["fieldname"] = "COMPANY_REG_NUMBER"; + $structure["type"] = "input"; + $structure["options"]["no_translate_fieldname"] = "yes"; + $this->obj_form->add_input($structure); + + $structure = NULL; + $structure["fieldname"] = "COMPANY_TAX_NUMBER"; + $structure["type"] = "input"; + $structure["options"]["no_translate_fieldname"] = "yes"; + $this->obj_form->add_input($structure); $structure = NULL; $structure["fieldname"] = "COMPANY_CONTACT_EMAIL"; @@ -102,7 +114,64 @@ function execute() $structure["options"]["height"] = "60"; $structure["options"]["no_translate_fieldname"] = "yes"; $this->obj_form->add_input($structure); - + + $structure = NULL; + $structure["fieldname"] = "COMPANY_ADDRESS2_STREET"; + $structure["type"] = "textarea"; + $structure["options"]["width"] = "300"; + $structure["options"]["height"] = "60"; + $structure["options"]["no_translate_fieldname"] = "yes"; + $this->obj_form->add_input($structure); + + $structure = NULL; + $structure["fieldname"] = "COMPANY_ADDRESS2_CITY"; + $structure["type"] = "input"; + $structure["options"]["no_translate_fieldname"] = "yes"; + $this->obj_form->add_input($structure); + + $structure = NULL; + $structure["fieldname"] = "COMPANY_ADDRESS2_STATE"; + $structure["type"] = "input"; + $structure["options"]["no_translate_fieldname"] = "yes"; + $this->obj_form->add_input($structure); + + $structure = NULL; + $structure["fieldname"] = "COMPANY_ADDRESS2_COUNTRY"; + $structure["type"] = "input"; + $structure["options"]["no_translate_fieldname"] = "yes"; + $this->obj_form->add_input($structure); + + $structure = NULL; + $structure["fieldname"] = "COMPANY_ADDRESS2_ZIPCODE"; + $structure["type"] = "input"; + $structure["options"]["no_translate_fieldname"] = "yes"; + $this->obj_form->add_input($structure); + + $structure = NULL; + $structure["fieldname"] = "COMPANY_ADDRESS_MSG"; + $structure["type"] = "message"; + $structure["defaultvalue"] = "Enter the registered address of the company below, if different to the contact address."; + $structure["options"]["no_translate_fieldname"] = "yes"; + $this->obj_form->add_input($structure); + + $structure = NULL; + $structure["fieldname"] = "COMPANY_B2C_TERMS"; + $structure["type"] = "tinymce"; + $structure["options"]["width"] = 500; + $structure["options"]["height"] = 100; + $structure["options"]["no_translate_fieldname"] = "yes"; + $structure["options"]["css_field_class"] = "tinymce"; + $this->obj_form->add_input($structure); + + $structure = NULL; + $structure["fieldname"] = "COMPANY_B2B_TERMS"; + $structure["type"] = "tinymce"; + $structure["options"]["width"] = 500; + $structure["options"]["height"] = 100; + $structure["options"]["no_translate_fieldname"] = "yes"; + $structure["options"]["css_field_class"] = "tinymce"; + $this->obj_form->add_input($structure); + $structure = NULL; $structure["fieldname"] = "COMPANY_LOGO"; $structure["type"] = "file"; @@ -127,7 +196,8 @@ function execute() // define subforms $this->obj_form->subforms["config_company_details"] = array("COMPANY_NAME", "COMPANY_LOGO", "COMPANY_LOGO_MSG"); $this->obj_form->subforms["config_company_contact"] = array("COMPANY_CONTACT_EMAIL", "COMPANY_CONTACT_PHONE", "COMPANY_CONTACT_FAX", "COMPANY_ADDRESS1_STREET", "COMPANY_ADDRESS1_CITY","COMPANY_ADDRESS1_STATE","COMPANY_ADDRESS1_COUNTRY", "COMPANY_ADDRESS1_ZIPCODE"); - $this->obj_form->subforms["config_company_invoices"] = array("COMPANY_PAYMENT_DETAILS"); + $this->obj_form->subforms["config_company_registration"] = array("COMPANY_TAX_NUMBER","COMPANY_REG_NUMBER","COMPANY_ADDRESS_MSG","COMPANY_ADDRESS2_STREET","COMPANY_ADDRESS2_CITY","COMPANY_ADDRESS2_STATE","COMPANY_ADDRESS2_COUNTRY","COMPANY_ADDRESS2_ZIPCODE"); + $this->obj_form->subforms["config_company_terms"] = array("COMPANY_PAYMENT_DETAILS","COMPANY_B2C_TERMS","COMPANY_B2B_TERMS"); $this->obj_form->subforms["submit"] = array("submit"); if (error_check()) diff --git a/admin/templates.php b/admin/templates.php index 9d2cb431..5e4e69e1 100644 --- a/admin/templates.php +++ b/admin/templates.php @@ -14,7 +14,7 @@ class page_output var $email_template_array = array(); var $obj_sql_invoice_data = array(); - function page_output() + function __construct() { // define page dependencies $this->requires["css"][] = "include/admin/css/templates.css"; @@ -266,7 +266,7 @@ function render_html() print "

TEMPLATE SELECTION


"; print "

You can adjust the PDFs generated by the Amberdms Billing System by using different templates - these templates may include different languages, different layouts or other styling effects.

"; - format_msgbox("info", "

If you have made your own template you would like to contribute back or if you need customisation work, please contact support@amberdms.com for details and we will be happy to assist.

"); + //format_msgbox("info", "

If you have made your own template you would like to contribute back or if you need customisation work, please contact support@amberdms.com for details and we will be happy to assist.

"); foreach ( $this->obj_sql_invoice_data as $invoice_type_name => $invoice_type_data ) diff --git a/customers/add.php b/customers/add.php index d5a6e438..eaf28ebc 100644 --- a/customers/add.php +++ b/customers/add.php @@ -14,7 +14,7 @@ class page_output var $num_contacts; var $tax_array = array(); - function page_output() + function __construct() { // required pages $this->requires["javascript"][] = "include/customers/javascript/addedit_customers.js"; @@ -103,6 +103,7 @@ function execute() $structure = NULL; $structure["fieldname"] = "contact_" .$i; $structure["type"] = "input"; + $structure["defaultvalue"] = ""; if (isset($_SESSION["error"]["contact_" .$i. "-error"])) { $structure["options"]["css_field_class"] = "hidden_form_field_error"; @@ -153,6 +154,7 @@ function execute() $structure = NULL; $structure["fieldname"] = "description_" .$i; $structure["type"] = "textarea"; + $structure["defaultvalue"] = ""; if (isset($_SESSION["error"]["contact_" .$i. "-error"])) { $structure["options"]["css_field_class"] = "hidden_form_field_error"; @@ -443,7 +445,7 @@ function render_html() { print ""; } - else if ($_SESSION["error"]["contact_" .$i. "-error"]) + else if (isset($_SESSION["error"]["contact_" .$i. "-error"])) { print ""; } @@ -459,7 +461,7 @@ function render_html() { print ""; } - else if ($_SESSION["error"]["contact_" .$i. "-error"]) + else if (isset($_SESSION["error"]["contact_" .$i. "-error"])) { print ""; } @@ -473,7 +475,7 @@ function render_html() $this->obj_form->render_field("num_records_$i"); print "
"; } - else if ($_SESSION["error"]["contact_" .$i. "-error"]) + else if (isset($_SESSION["error"]["contact_" .$i. "-error"])) { print ""; } @@ -545,7 +547,7 @@ function render_html() } print ""; } diff --git a/customers/attributes.php b/customers/attributes.php index 0f35c06f..f1532b3d 100644 --- a/customers/attributes.php +++ b/customers/attributes.php @@ -27,7 +27,7 @@ class page_output var $group_list; - function page_output() + function __construct() { // requirements $this->requires["css"][] = "include/attributes/css/attributes.css"; diff --git a/customers/credit-refund.php b/customers/credit-refund.php index 570a0122..672d4fcb 100644 --- a/customers/credit-refund.php +++ b/customers/credit-refund.php @@ -24,7 +24,7 @@ class page_output var $obj_refund; - function page_output() + function __construct() { // fetch variables $this->obj_customer = New customer_credits; diff --git a/customers/credit.php b/customers/credit.php index d85ef5db..f3a2111f 100644 --- a/customers/credit.php +++ b/customers/credit.php @@ -19,7 +19,7 @@ class page_output var $obj_table; - function page_output() + function __construct() { // fetch variables $this->obj_customer = New customer_credits; diff --git a/customers/delete.php b/customers/delete.php index fbd31aa5..93829115 100644 --- a/customers/delete.php +++ b/customers/delete.php @@ -22,7 +22,7 @@ class page_output var $locked; // hold locked status of customer - function page_output() + function __construct() { // fetch variables $this->id = @security_script_input('/^[0-9]*$/', $_GET["id"]); diff --git a/customers/invoices.php b/customers/invoices.php index fe3bf13a..ffd730d0 100644 --- a/customers/invoices.php +++ b/customers/invoices.php @@ -17,7 +17,7 @@ class page_output var $obj_table; - function page_output() + function __construct() { // fetch variables $this->id = @security_script_input('/^[0-9]*$/', $_GET["id"]); diff --git a/customers/journal-edit.php b/customers/journal-edit.php index 361f1457..288db326 100644 --- a/customers/journal-edit.php +++ b/customers/journal-edit.php @@ -22,7 +22,7 @@ class page_output var $obj_customer; - function page_output() + function __construct() { // fetch variables $this->id = @security_script_input('/^[0-9]*$/', $_GET["id"]); diff --git a/customers/journal.php b/customers/journal.php index 3a157401..10dbbb6f 100644 --- a/customers/journal.php +++ b/customers/journal.php @@ -18,7 +18,7 @@ class page_output var $obj_journal; - function page_output() + function __construct() { // fetch variables $this->id = @security_script_input('/^[0-9]*$/', $_GET["id"]); diff --git a/customers/orders-view.php b/customers/orders-view.php index c827dc06..45bb5911 100644 --- a/customers/orders-view.php +++ b/customers/orders-view.php @@ -22,10 +22,10 @@ class page_output - function page_output() + function __construct() { // javascript: AJAX call to load product information - $this->requires["javascript"][] = "include/accounts/javascript/invoice-items-edit.js"; + $this->requires["javascript"][] = "include/accounts/javascript/invoice-items-edit_ar.js"; // customer object $this->obj_customer = New customer_orders; diff --git a/customers/orders.php b/customers/orders.php index d69d8f50..5fabfbe1 100644 --- a/customers/orders.php +++ b/customers/orders.php @@ -23,7 +23,7 @@ class page_output var $obj_table; - function page_output() + function __construct() { // customer object $this->obj_customer = New customer_orders; diff --git a/customers/portal.php b/customers/portal.php index 92cfeecb..c0d15cfb 100644 --- a/customers/portal.php +++ b/customers/portal.php @@ -20,7 +20,7 @@ class page_output var $obj_form; - function page_output() + function __construct() { $this->obj_customer = New customer; diff --git a/customers/reseller.php b/customers/reseller.php index 1e42bbe5..8c2d3924 100644 --- a/customers/reseller.php +++ b/customers/reseller.php @@ -13,7 +13,7 @@ class page_output { var $obj_table_list; - function page_output() + function __construct() { // customer object $this->obj_customer = New customer; diff --git a/customers/service-cdr-override-edit.php b/customers/service-cdr-override-edit.php index bee67778..b1f61669 100644 --- a/customers/service-cdr-override-edit.php +++ b/customers/service-cdr-override-edit.php @@ -24,7 +24,7 @@ class page_output - function page_output() + function __construct() { $this->obj_customer = New customer_services; $this->obj_cdr_rate_table = New cdr_rate_table_rates_override; diff --git a/customers/service-cdr-override.php b/customers/service-cdr-override.php index 83d92043..7daf4702 100644 --- a/customers/service-cdr-override.php +++ b/customers/service-cdr-override.php @@ -24,7 +24,7 @@ class page_output - function page_output() + function __construct() { $this->obj_customer = New customer_services; $this->obj_cdr_rate_table = New cdr_rate_table_rates_override; diff --git a/customers/service-ddi-edit.php b/customers/service-ddi-edit.php index 3763b40a..32b0bb33 100644 --- a/customers/service-ddi-edit.php +++ b/customers/service-ddi-edit.php @@ -24,7 +24,7 @@ class page_output - function page_output() + function __construct() { $this->obj_customer = New customer_services; $this->obj_ddi = New cdr_customer_service_ddi; diff --git a/customers/service-ddi.php b/customers/service-ddi.php index 4caf34f8..54ead427 100644 --- a/customers/service-ddi.php +++ b/customers/service-ddi.php @@ -24,7 +24,7 @@ class page_output - function page_output() + function __construct() { $this->obj_customer = New customer_services; $this->obj_cdr_rate_table = New cdr_rate_table_rates_override; diff --git a/customers/service-delete.php b/customers/service-delete.php index 0a835798..bc46701a 100644 --- a/customers/service-delete.php +++ b/customers/service-delete.php @@ -23,7 +23,7 @@ class page_output var $obj_form; - function page_output() + function __construct() { $this->obj_customer = New customer_services; diff --git a/customers/service-edit.php b/customers/service-edit.php index 64959e8d..2dd72e05 100644 --- a/customers/service-edit.php +++ b/customers/service-edit.php @@ -28,7 +28,7 @@ class page_output - function page_output() + function __construct() { // define page dependencies $this->requires["javascript"][] = "include/javascript/services.js"; diff --git a/customers/service-history-cdr-export.php b/customers/service-history-cdr-export.php index 8a69baef..29977237 100644 --- a/customers/service-history-cdr-export.php +++ b/customers/service-history-cdr-export.php @@ -27,7 +27,7 @@ class page_output var $output; - function page_output() + function __construct() { $this->obj_customer = New customer_services; diff --git a/customers/service-history-cdr.php b/customers/service-history-cdr.php index 2e335e45..6928cc89 100644 --- a/customers/service-history-cdr.php +++ b/customers/service-history-cdr.php @@ -24,7 +24,7 @@ class page_output var $id_service_period; - function page_output() + function __construct() { $this->obj_customer = New customer_services; diff --git a/customers/service-history.php b/customers/service-history.php index e10d5497..41274e3c 100644 --- a/customers/service-history.php +++ b/customers/service-history.php @@ -18,7 +18,7 @@ class page_output var $obj_table; - function page_output() + function __construct() { $this->obj_customer = New customer_services; diff --git a/customers/service-ipv4-edit.php b/customers/service-ipv4-edit.php index b29fcd66..9b1059d8 100644 --- a/customers/service-ipv4-edit.php +++ b/customers/service-ipv4-edit.php @@ -24,7 +24,7 @@ class page_output - function page_output() + function __construct() { $this->obj_customer = New customer_services; $this->obj_ipv4 = New traffic_customer_service_ipv4; diff --git a/customers/service-ipv4.php b/customers/service-ipv4.php index 099ac6c8..1eaef1ba 100644 --- a/customers/service-ipv4.php +++ b/customers/service-ipv4.php @@ -27,7 +27,7 @@ class page_output - function page_output() + function __construct() { $this->obj_customer = New customer_services; diff --git a/customers/services.php b/customers/services.php index 8edde7aa..db71c229 100644 --- a/customers/services.php +++ b/customers/services.php @@ -23,7 +23,7 @@ class page_output var $obj_customer; - function page_output() + function __construct() { // fetch variables $this->id = @security_script_input('/^[0-9]*$/', $_GET["id"]); diff --git a/customers/view.php b/customers/view.php index d040f4d1..b71ebba0 100644 --- a/customers/view.php +++ b/customers/view.php @@ -22,7 +22,7 @@ class page_output var $tax_array = array(); - function page_output() + function __construct() { // fetch variables $this->id = @security_script_input('/^[0-9]*$/', $_GET["id"]); diff --git a/external/tinymce/LICENSE.TXT b/external/tinymce/LICENSE.TXT new file mode 100644 index 00000000..b17fc904 --- /dev/null +++ b/external/tinymce/LICENSE.TXT @@ -0,0 +1,504 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + + diff --git a/external/tinymce/changelog.txt b/external/tinymce/changelog.txt new file mode 100644 index 00000000..f48ded0e --- /dev/null +++ b/external/tinymce/changelog.txt @@ -0,0 +1,759 @@ +Version 4.6.6 (2017-08-30) + Fixed so that notifications wrap long text content instead of bleeding outside the notification element. + Fixed so the content_style css is added after the skin and custom stylesheets. + Fixed bug where it wasn't possible to remove a table with the Cut button. + Fixed bug where the center format wasn't getting the same font size as the other formats in the format preview. + Fixed bug where the wordcount plugin wasn't counting hyphenated words correctly. + Fixed bug where all content pasted into the editor was added to the end of the editor. + Fixed bug where enter keydown on list item selection only deleted content and didn't create a new line. + Fixed bug where destroying the editor while the content css was still loading caused error notifications on Firefox. + Fixed bug where undoing cut operation in IE11 left some unwanted html in the editor content. + Fixed bug where enter keydown would throw an error in IE11. + Fixed bug where duplicate instances of an editor were added to the editors array when using the createEditor API. + Fixed bug where the formatter applied formats on the wrong content when spellchecker was activated. + Fixed bug where switching formats would reset font size on child nodes. + Fixed bug where the table caption element weren't always the first descendant to the table tag. + Fixed bug where pasting some content into the editor on chrome some newlines were removed. + Fixed bug where it wasn't possible to remove a list if a list item was a table element. + Fixed bug where copy/pasting partial selections of tables wouldn't produce a proper table. + Fixed bug where the searchreplace plugin could not find consecutive spaces. + Fixed bug where background color wasn't applied correctly on some partially selected contents. +Version 4.6.5 (2017-08-02) + Added new inline_boundaries_selector that allows you to specify the elements that should have boundaries. + Added new local upload feature this allows the user to upload images directly from the image dialog. + Added a new api for providing meta data for plugins. It will show up in the help dialog if it's provided. + Fixed so that the notifications created by the notification manager are more screen reader accessible. + Fixed bug where changing the list format on multiple selected lists didn't change all of the lists. + Fixed bug where the nonbreaking plugin would insert multiple undo levels when pressing the tab key. + Fixed bug where delete/backspace wouldn't render a caret when all editor contents where deleted. + Fixed bug where delete/backspace wouldn't render a caret if the deleted element was a single contentEditable false element. + Fixed bug where the wordcount plugin wouldn't count words correctly if word where typed after applying a style format. + Fixed bug where the wordcount plugin would count mathematical formulas as multiple words for example 1+1=2. + Fixed bug where formatting of triple clicked blocks on Chrome/Safari would result in styles being added outside the visual selection. + Fixed bug where paste would add the contents to the end of the editor area when inline mode was used. + Fixed bug where toggling off bold formatting on text entered in a new paragraph would add an extra line break. + Fixed bug where autolink plugin would only produce a link on every other consecutive link on Firefox. + Fixed bug where it wasn't possible to select all contents if the content only had one pre element. + Fixed bug where sizzle would produce lagging behavior on some sites due to repaints caused by feature detection. + Fixed bug where toggling off inline formats wouldn't include the space on selected contents with leading or trailing spaces. + Fixed bug where the cut operation in UI wouldn't work in Chrome. + Fixed bug where some legacy editor initialization logic would throw exceptions about editor settings not being defined. + Fixed bug where it wasn't possible to apply text color to links if they where part of a non collapsed selection. + Fixed bug where an exception would be thrown if the user selected a video element and then moved the focus outside the editor. + Fixed bug where list operations didn't work if there where block elements inside the list items. + Fixed bug where applying block formats to lists wrapped in block elements would apply to all elements in that wrapped block. +Version 4.6.4 (2017-06-13) + Fixed bug where the editor would move the caret when clicking on the scrollbar next to a content editable false block. + Fixed bug where the text color select dropdowns wasn't placed correctly when they didn't fit the width of the screen. + Fixed bug where the default editor line height wasn't working for mixed font size contents. + Fixed bug where the content css files for inline editors were loaded multiple times for multiple editor instances. + Fixed bug where the initial value of the font size/font family dropdowns wasn't displayed. + Fixed bug where the I18n api was not supporting arrays as the translation replacement values. + Fixed bug where chrome would display "The given range isn't in document." errors for invalid ranges passed to setRng. + Fixed bug where the compat3x plugin wasn't working since the global tinymce references wasn't resolved correctly. + Fixed bug where the preview plugin wasn't encoding the base url passed into the iframe contents producing a xss bug. + Fixed bug where the dom parser/serializer wasn't handling some special elements like noframes, title and xmp. + Fixed bug where the dom parser/serializer wasn't handling cdata sections with comments inside. + Fixed bug where the editor would scroll to the top of the editable area if a dialog was closed in inline mode. + Fixed bug where the link dialog would not display the right rel value if rel_list was configured. + Fixed bug where the context menu would select images on some platforms but not others. + Fixed bug where the filenames of images were not retained on dragged and drop into the editor from the desktop. + Fixed bug where the paste plugin would misrepresent newlines when pasting plain text and having forced_root_block configured. + Fixed so that the error messages for the imagetools plugin is more human readable. + Fixed so the internal validate setting for the parser/serializer can't be set from editor initialization settings. +Version 4.6.3 (2017-05-30) + Fixed bug where the arrow keys didn't work correctly when navigating on nested inline boundary elements. + Fixed bug where delete/backspace didn't work correctly on nested inline boundary elements. + Fixed bug where image editing didn't work on subsequent edits of the same image. + Fixed bug where charmap descriptions wouldn't properly wrap if they exceeded the width of the box. + Fixed bug where the default image upload handler only accepted 200 as a valid http status code. + Fixed so rel on target=_blank links gets forced with only noopener instead of both noopener and noreferrer. +Version 4.6.2 (2017-05-23) + Fixed bug where the SaxParser would run out of memory on very large documents. + Fixed bug with formatting like font size wasn't applied to del elements. + Fixed bug where various api calls would be throwing exceptions if they where invoked on a removed editor instance. + Fixed bug where the branding position would be incorrect if the editor was inside a hidden tab and then later showed. + Fixed bug where the color levels feature in the imagetools dialog wasn't working properly. + Fixed bug where imagetools dialog wouldn't pre-load images from CORS domains, before trying to prepare them for editing. + Fixed bug where the tab key would move the caret to the next table cell if being pressed inside a list inside a table. + Fixed bug where the cut/copy operations would loose parent context like the current format etc. + Fixed bug with format preview not working on invalid elements excluded by valid_elements. + Fixed bug where blocks would be merged in incorrect order on backspace/delete. + Fixed bug where zero length text nodes would cause issues with the undo logic if there where iframes present. + Fixed bug where the font size/family select lists would throw errors if the first node was a comment. + Fixed bug with csp having to allow local script evaluation since it was used to detect global scope. + Fixed bug where CSP required a relaxed option for javascript: URLs in unsupported legacy browsers. + Fixed bug where a fake caret would be rendered for td with the contenteditable=false. + Fixed bug where typing would be blocked on IE 11 when within a nested contenteditable=true/false structure. +Version 4.6.1 (2017-05-10) + Added configuration option to list plugin to disable tab indentation. + Fixed bug where format change on very specific content could cause the selection to change. + Fixed bug where TinyMCE could not be lazyloaded through jquery integration. + Fixed bug where entities in style attributes weren't decoded correctly on paste in webkit. + Fixed bug where fontsize_formats option had been renamed incorrectly. + Fixed bug with broken backspace/delete behaviour between contenteditable=false blocks. + Fixed bug where it wasn't possible to backspace to the previous line with the inline boundaries functionality turned on. + Fixed bug where is wasn't possible to move caret left and right around a linked image with the inline boundaries functionality turned on. + Fixed bug where pressing enter after/before hr element threw exception. Patch contributed bradleyke. + Fixed so the CSS in the visualblocks plugin doesn't overwrite background color. Patch contributed by Christian Rank. + Fixed bug where multibyte characters weren't encoded correctly. Patch contributed by James Tarkenton. + Fixed bug where shift-click to select within contenteditable=true fields wasn't working. +Version 4.6.0 (2017-05-04) + Dropped support for IE 8-10 due to market share and lack of support from Microsoft. See tinymce docs for details. + Added an inline boundary caret position feature that makes it easier to type at the beginning/end of links/code elements. + Added a help plugin that adds a button and a dialog showing the editor shortcuts and loaded plugins. + Added an inline_boundaries option that allows you to disable the inline boundary feature if it's not desired. + Added a new ScrollIntoView event that allows you to override the default scroll to element behavior. + Added role and aria- attributes as valid elements in the default valid elements config. + Added new internal flag for PastePreProcess/PastePostProcess this is useful to know if the paste was coming from an external source. + Added new ignore function to UndoManager this works similar to transact except that it doesn't add an undo level by default. + Fixed so that urls gets retained for images when being edited. This url is then passed on to the upload handler. + Fixed so that the editors would be initialized on readyState interactive instead of complete. + Fixed so that the init event of the editor gets fired once all contentCSS files have been properly loaded. + Fixed so that width/height of the editor gets taken from the textarea element if it's explicitly specified in styles. + Fixed so that keep_styles set to false no longer clones class/style from the previous paragraph on enter. + Fixed so that the default line-height is 1.2em to avoid zwnbsp characters from producing text rendering glitches on Windows. + Fixed so that loading errors of content css gets presented by a notification message. + Fixed so figure image elements can be linked when selected this wraps the figure image in a anchor element. + Fixed bug where it wasn't possible to copy/paste rows with colspans by using the table copy/paste feature. + Fixed bug where the protect setting wasn't properly applied to header/footer parts when using the fullpage plugin. + Fixed bug where custom formats that specified upper case element names where not applied correctly. + Fixed bug where some screen readers weren't reading buttons due to an aria specific fix for IE 8. + Fixed bug where cut wasn't working correctly on iOS due to it's clipboard API not working correctly. + Fixed bug where Edge would paste div elements instead of paragraphs when pasting plain text. + Fixed bug where the textpattern plugin wasn't dealing with trailing punctuations correctly. + Fixed bug where image editing would some times change the image format from jpg to png. + Fixed bug where some UI elements could be inserted into the toolbar even if they where not registered. + Fixed bug where it was possible to click the TD instead of the character in the character map and that caused an exception. + Fixed bug where the font size/font family dropdowns would sometimes show an incorrect value due to css not being loaded in time. + Fixed bug with the media plugin inserting undefined instead of retaining size when media_dimensions was set to false. + Fixed bug with deleting images when forced_root_blocks where set to false. + Fixed bug where input focus wasn't properly handled on nested content editable elements. + Fixed bug where Chrome/Firefox would throw an exception when selecting images due to recent change of setBaseAndExtent support. + Fixed bug where malformed blobs would throw exceptions now they are simply ignored. + Fixed bug where backspace/delete wouldn't work properly in some cases where all contents was selected in WebKit. + Fixed bug with Angular producing errors since it was expecting events objects to be patched with their custom properties. + Fixed bug where the formatter would apply formatting to spellchecker errors now all bogus elements are excluded. + Fixed bug with backspace/delete inside table caption elements wouldn't behave properly on IE 11. + Fixed bug where typing after a contenteditable false inline element could move the caret to the end of that element. + Fixed bug where backspace before/after contenteditable false blocks wouldn't properly remove the right element. + Fixed bug where backspace before/after contenteditable false inline elements wouldn't properly empty the current block element. + Fixed bug where vertical caret navigation with a custom line-height would sometimes match incorrect positions. + Fixed bug with paste on Edge where character encoding wasn't handled properly due to a browser bug. + Fixed bug with paste on Edge where extra fragment data was inserted into the contents when pasting. + Fixed bug with pasting contents when having a whole block element selected on WebKit could cause WebKit spans to appear. + Fixed bug where the visualchars plugin wasn't working correctly showing invisible nbsp characters. + Fixed bug where browsers would hang if you tried to load some malformed html contents. + Fixed bug where the init call promise wouldn't resolve if the specified selector didn't find any matching elements. + Fixed bug where the Schema isValidChild function was case sensitive. +Version 4.5.3 (2017-02-01) + Added keyboard navigation for menu buttons when the menu is in focus. + Added api to the list plugin for setting custom classes/attributes on lists. + Added validation for the anchor plugin input field according to W3C id naming specifications. + Fixed bug where media placeholders were removed after resize with the forced_root_block setting set to false. + Fixed bug where deleting selections with similar sibling nodes sometimes deleted the whole document. + Fixed bug with inlite theme where several toolbars would appear scrolling when more than one instance of the editor was in use. + Fixed bug where the editor would throw error with the fontselect plugin on hidden editor instances in Firefox. + Fixed bug where the background color would not stretch to the font size. + Fixed bug where font size would be removed when changing background color. + Fixed bug where the undomanager trimmed away whitespace between nodes on undo/redo. + Fixed bug where media_dimensions=false in media plugin caused the editor to throw an error. + Fixed bug where IE was producing font/u elements within links on paste. + Fixed bug where some button tooltips were broken when compat3x was in use. + Fixed bug where backspace/delete/typeover would remove the caption element. + Fixed bug where powerspell failed to function when compat3x was enabled. + Fixed bug where it wasn't possible to apply sub/sup on text with large font size. + Fixed bug where pre tags with spaces weren't treated as content. + Fixed bug where Meta+A would select the entire document instead of all contents in nested ce=true elements. +Version 4.5.2 (2017-01-04) + Added missing keyboard shortcut description for the underline menu item in the format menu. + Fixed bug where external blob urls wasn't properly handled by editor upload logic. Patch contributed by David Oviedo. + Fixed bug where urls wasn't treated as a single word by the wordcount plugin. + Fixed bug where nbsp characters wasn't treated as word delimiters by the wordcount plugin. + Fixed bug where editor instance wasn't properly passed to the format preview logic. Patch contributed by NullQuery. + Fixed bug where the fake caret wasn't hidden when you moved selection to a cE=false element. + Fixed bug where it wasn't possible to edit existing code sample blocks. + Fixed bug where it wasn't possible to delete editor contents if the selection included an empty block. + Fixed bug where the formatter wasn't expanding words on some international characters. Patch contributed by Martin Larochelle. + Fixed bug where the open link feature wasn't working correctly on IE 11. + Fixed bug where enter before/after a cE=false block wouldn't properly padd the paragraph with an br element. + Fixed so font size and font family select boxes always displays a value by using the runtime style as a fallback. + Fixed so missing plugins will be logged to console as warnings rather than halting the initialization of the editor. + Fixed so splitbuttons become normal buttons in advlist plugin if styles are empty. Patch contributed by René Schleusner. + Fixed so you can multi insert rows/cols by selecting table cells and using insert rows/columns. +Version 4.5.1 (2016-12-07) + Fixed bug where the lists plugin wouldn't initialize without the advlist plugins if served from cdn. + Fixed bug where selectors with "*" would cause the style format preview to throw an error. + Fixed bug with toggling lists off on lists with empty list items would throw an error. + Fixed bug where editing images would produce non existing blob uris. + Fixed bug where the offscreen toc selection would be treated as the real toc element. + Fixed bug where the aria level attribute for element path would have an incorrect start index. + Fixed bug where the offscreen selection of cE=false that where very wide would be shown onscreen. Patch contributed by Steven Bufton. + Fixed so the default_link_target gets applied to links created by the autolink plugin. + Fixed so that the name attribute gets removed by the anchor plugin if editing anchors. +Version 4.5.0 (2016-11-23) + Added new toc plugin allows you to insert table of contents based on editor headings. + Added new auto complete menu to all url fields. Adds history, link to anchors etc. + Added new sidebar api that allows you to add custom sidebar panels and buttons to toggle these. + Added new insert menu button that allows you to have multiple insert functions under the same menu button. + Added new open link feature to ctrl+click, alt+enter and context menu. + Added new media_embed_handler option to allow the media plugin to be populated with custom embeds. + Added new support for editing transparent images using the image tools dialog. + Added new images_reuse_filename option to allow filenames of images to be retained for upload. + Added new security feature where links with target="_blank" will by default get rel="noopener noreferrer". + Added new allow_unsafe_link_target to allow you to opt-out of the target="_blank" security feature. + Added new style_formats_autohide option to automatically hide styles based on context. + Added new codesample_content_css option to specify where the code sample prism css is loaded from. + Added new support for Japanese/Chinese word count following the unicode standards on this. + Added new fragmented undo levels this dramatically reduces flicker on contents with iframes. + Added new live previews for complex elements like table or lists. + Fixed bug where it wasn't possible to properly tab between controls in a dialog with a disabled form item control. + Fixed bug where firefox would generate a rectangle on elements produced after/before a cE=false elements. + Fixed bug with advlist plugin not switching list element format properly in some edge cases. + Fixed bug where col/rowspans wasn't correctly computed by the table plugin in some cases. + Fixed bug where the table plugin would thrown an error if object_resizing was disabled. + Fixed bug where some invalid markup would cause issues when running in XHTML mode. Patch contributed by Charles Bourasseau. + Fixed bug where the fullscreen class wouldn't be removed properly when closing dialogs. + Fixed bug where the PastePlainTextToggle event wasn't fired by the paste plugin when the state changed. + Fixed bug where table the row type wasn't properly updated in table row dialog. Patch contributed by Matthias Balmer. + Fixed bug where select all and cut wouldn't place caret focus back to the editor in WebKit. Patch contributed by Daniel Jalkut. + Fixed bug where applying cell/row properties to multiple cells/rows would reset other unchanged properties. + Fixed bug where some elements in the schema would have redundant/incorrect children. + Fixed bug where selector and target options would cause issues if used together. + Fixed bug where drag/drop of images from desktop on chrome would thrown an error. + Fixed bug where cut on WebKit/Blink wouldn't add an undo level. + Fixed bug where IE 11 would scroll to the cE=false elements when they where selected. + Fixed bug where keys like F5 wouldn't work when a cE=false element was selected. + Fixed bug where the undo manager wouldn't stop the typing state when commands where executed. + Fixed bug where unlink on wrapped links wouldn't work properly. + Fixed bug with drag/drop of images on WebKit where the image would be deleted form the source editor. + Fixed bug where the visual characters mode would be disabled when contents was extracted from the editor. + Fixed bug where some browsers would toggle of formats applied to the caret when clicking in the editor toolbar. + Fixed bug where the custom theme function wasn't working correctly. + Fixed bug where image option for custom buttons required you to have icon specified as well. + Fixed bug where the context menu and contextual toolbars would be visible at the same time and sometimes overlapping. + Fixed bug where the noneditable plugin would double wrap elements when using the noneditable_regexp option. + Fixed bug where tables would get padding instead of margin when you used the indent button. + Fixed bug where the charmap plugin wouldn't properly insert non breaking spaces. + Fixed bug where the color previews in color input boxes wasn't properly updated. + Fixed bug where the list items of previous lists wasn't merged in the right order. + Fixed bug where it wasn't possible to drag/drop inline-block cE=false elements on IE 11. + Fixed bug where some table cell merges would produce incorrect rowspan/colspan. + Fixed so the font size of the editor defaults to 14px instead of 11px this can be overridden by custom css. + Fixed so wordcount is debounced to reduce cpu hogging on larger texts. + Fixed so tinymce global gets properly exported as a module when used with some module bundlers. + Fixed so it's possible to specify what css properties you want to preview on specific formats. + Fixed so anchors are contentEditable=false while within the editor. + Fixed so selected contents gets wrapped in a inline code element by the codesample plugin. + Fixed so conditional comments gets properly stripped independent of case. Patch contributed by Georgii Dolzhykov. + Fixed so some escaped css sequences gets properly handled. Patch contributed by Georgii Dolzhykov. + Fixed so notifications with the same message doesn't get displayed at the same time. + Fixed so F10 can be used as an alternative key to focus to the toolbar. + Fixed various api documentation issues and typos. + Removed layer plugin since it wasn't really ported from 3.x and there doesn't seem to be much use for it. + Removed moxieplayer.swf from the media plugin since it wasn't used by the media plugin. + Removed format state from the advlist plugin to be more consistent with common word processors. +Version 4.4.3 (2016-09-01) + Fixed bug where copy would produce an exception on Chrome. + Fixed bug where deleting lists on IE 11 would merge in correct text nodes. + Fixed bug where deleting partial lists with indentation wouldn't cause proper normalization. +Version 4.4.2 (2016-08-25) + Added new importcss_exclusive option to disable unique selectors per group. + Added new group specific selector_converter option to importcss plugin. + Added new codesample_languages option to apply custom languages to codesample plugin. + Added new codesample_dialog_width/codesample_dialog_height options. + Fixed bug where fullscreen button had an incorrect keyboard shortcut. + Fixed bug where backspace/delete wouldn't work correctly from a block to a cE=false element. + Fixed bug where smartpaste wasn't detecting links with special characters in them like tilde. + Fixed bug where the editor wouldn't get proper focus if you clicked on a cE=false element. + Fixed bug where it wasn't possible to copy/paste table rows that had merged cells. + Fixed bug where merging cells could some times produce invalid col/rowspan attibute values. + Fixed bug where getBody would sometimes thrown an exception now it just returns null if the iframe is clobbered. + Fixed bug where drag/drop of cE=false element wasn't properly constrained to viewport. + Fixed bug where contextmenu on Mac would collapse any selection to a caret. + Fixed bug where rtl mode wasn't rendered properly when loading a language pack with the rtl flag. + Fixed bug where Kamer word bounderies would be stripped from contents. + Fixed bug where lists would sometimes render two dots or numbers on the same line. + Fixed bug where the skin_url wasn't used by the inlite theme. + Fixed so data attributes are ignored when comparing formats in the formatter. + Fixed so it's possible to disable inline toolbars in the inlite theme. + Fixed so template dialog gets resized if it doesn't fit the window viewport. +Version 4.4.1 (2016-07-26) + Added smart_paste option to paste plugin to allow disabling the paste behavior if needed. + Fixed bug where png urls wasn't properly detected by the smart paste logic. + Fixed bug where the element path wasn't working properly when multiple editor instances where used. + Fixed bug with creating lists out of multiple paragraphs would just create one list item instead of multiple. + Fixed bug where scroll position wasn't properly handled by the inlite theme to place the toolbar properly. + Fixed bug where multiple instances of the editor using the inlite theme didn't render the toolbar properly. + Fixed bug where the shortcut label for fullscreen mode didn't match the actual shortcut key. + Fixed bug where it wasn't possible to select cE=false blocks using touch devices on for example iOS. + Fixed bug where it was possible to select the child image within a cE=false on IE 11. + Fixed so inserts of html containing lists doesn't merge with any existing lists unless it's a paste operation. +Version 4.4.0 (2016-06-30) + Added new inlite theme this is a more lightweight inline UI. + Added smarter paste logic that auto detects urls in the clipboard and inserts images/links based on that. + Added a better image resize algorithm for better image quality in the imagetools plugin. + Fixed bug where it wasn't possible to drag/dropping cE=false elements on FF. + Fixed bug where backspace/delete before/after a cE=false block would produce a new paragraph. + Fixed bug where list style type css property wasn't preserved when indenting lists. + Fixed bug where merging of lists where done even if the list style type was different. + Fixed bug where the image_dataimg_filter function wasn't used when pasting images. + Fixed bug where nested editable within a non editable element would cause scroll on focus in Chrome. + Fixed so invalid targets for inline mode is blocked on initialization. We only support elements that can have children. +Version 4.3.13 (2016-06-08) + Added characters with a diacritical mark to charmap plugin. Patch contributed by Dominik Schilling. + Added better error handling if the image proxy service would produce errors. + Fixed issue with pasting list items into list items would produce nested list rather than a merged list. + Fixed bug where table selection could get stuck in selection mode for inline editors. + Fixed bug where it was possible to place the caret inside the resize grid elements. + Fixed bug where it wasn't possible to place in elements horizontally adjacent cE=false blocks. + Fixed bug where multiple notifications wouldn't be properly placed on screen. + Fixed bug where multiple editor instance of the same id could be produces in some specific integrations. +Version 4.3.12 (2016-05-10) + Fixed bug where focus calls couldn't be made inside the editors PostRender event handler. + Fixed bug where some translations wouldn't work as expected due to a bug in editor.translate. + Fixed bug where the node change event could fire with a node out side the root of the editor. + Fixed bug where Chrome wouldn't properly present the keyboard paste clipboard details when paste was clicked. + Fixed bug where merged cells in tables couldn't be selected from right to left. + Fixed bug where insert row wouldn't properly update a merged cells rowspan property. + Fixed bug where the color input boxes preview field wasn't properly set on initialization. + Fixed bug where IME composition inside table cells wouldn't work as expected on IE 11. + Fixed so all shadow dom support is under and experimental flag due to flaky browser support. +Version 4.3.11 (2016-04-25) + Fixed bug where it wasn't possible to insert empty blocks though the API unless they where padded. + Fixed bug where you couldn't type the Euro character on Windows. + Fixed bug where backspace/delete from a cE=false element to a text block didn't work properly. + Fixed bug where the text color default grid would render incorrectly. + Fixed bug where the codesample plugin wouldn't load the css in the editor for multiple editors. + Fixed so the codesample plugin textarea gets focused by default. +Version 4.3.10 (2016-04-12) + Fixed bug where the key "y" on WebKit couldn't be entered due to conflict with keycode for F10 on keypress. +Version 4.3.9 (2016-04-12) + Added support for focusing the contextual toolbars using keyboard. + Added keyboard support for slider UI controls. You can no increase/decrease using arrow keys. + Added url pattern matching for Dailymotion to media plugin. Patch contributed by Bertrand Darbon. + Added body_class to template plugin preview. Patch contributed by Milen Petrinski. + Added options to better override textcolor pickers with custom colors. Patch contributed by Xavier Boubert. + Added visual arrows to inline contextual toolbars so that they point to the element being active. + Fixed so toolbars for tables or other larger elements get better positioned below the scrollable viewport. + Fixed bug where it was possible to click links inside cE=false blocks. + Fixed bug where event targets wasn't properly handled in Safari Technical Preview. + Fixed bug where drag/drop text in FF 45 would make the editor caret invisible. + Fixed bug where the remove state wasn't properly set on editor instances when detected as clobbered. + Fixed bug where offscreen selection of some cE=false elements would render onscreen. Patch contributed by Steven Bufton + Fixed bug where enter would clone styles out side the root on editors inside a span. Patch contributed by ChristophKaser. + Fixed bug where drag/drop of images into the editor didn't work correctly in FF. + Fixed so the first item in panels for the imagetools dialog gets proper keyboard focus. + Changed the Meta+Shift+F shortcut to Ctrl+Shift+F since Czech, Slovak, Polish languages used the first one for input. +Version 4.3.8 (2016-03-15) + Fixed bug where inserting HR at the end of a block element would produce an extra empty block. + Fixed bug where links would be clickable when readonly mode was enabled. + Fixed bug where the formatter would normalize to the wrong node on very specific content. + Fixed bug where some nested list items couldn't be indented properly. + Fixed bug where links where clickable in the preview dialog. + Fixed so the alt attribute doesn't get padded with an empty value by default. + Fixed so nested alignment works more correctly. You will now alter the alignment to the closest block parent. +Version 4.3.7 (2016-03-02) + Fixed bug where incorrect icons would be rendered for imagetools edit and color levels. + Fixed bug where navigation using arrow keys inside a SelectBox didn't move up/down. + Fixed bug where the visualblocks plugin would render borders round internal UI elements. +Version 4.3.6 (2016-03-01) + Added new paste_remember_plaintext_info option to allow a global disable of the plain text mode notification. + Added new PastePlainTextToggle event that fires when plain text mode toggles on/off. + Fixed bug where it wasn't possible to select media elements since the drag logic would snap it to mouse cursor. + Fixed bug where it was hard to place the caret inside nested cE=true elements when the outer cE=false element was focused. + Fixed bug where editors wouldn't properly initialize if both selector and mode where used. + Fixed bug where IME input inside table cells would switch the IME off. + Fixed bug where selection inside the first table cell would cause the whole table cell to get selected. + Fixed bug where error handling of images being uploaded wouldn't properly handle faulty statuses. + Fixed bug where inserting contents before a HR would cause an exception to be thrown. + Fixed bug where copy/paste of Excel data would be inserted as an image. + Fixed caret position issues with copy/paste of inline block cE=false elements. + Fixed issues with various menu item focus bugs in Chrome. Where the focused menu bar item wasn't properly blurred. + Fixed so the notifications have a solid background since it would be hard to read if there where text under it. + Fixed so notifications gets animated similar to the ones used by dialogs. + Fixed so larger images that gets pasted is handled better. + Fixed so the window close button is more uniform on various platform and also increased it's hit area. +Version 4.3.5 (2016-02-11) + Npm version bump due to package not being fully updated. +Version 4.3.4 (2016-02-11) + Added new OpenWindow/CloseWindow events that gets fired when windows open/close. + Added new NewCell/NewRow events that gets fired when table cells/rows are created. + Added new Promise return value to tinymce.init makes it easier to handle initialization. + Removed the jQuery version the jQuery plugin is now moved into the main package. + Removed jscs from build process since eslint can now handle code style checking. + Fixed various bugs with drag/drop of contentEditable:false elements. + Fixed bug where deleting of very specific nested list items would result in an odd list. + Fixed bug where lists would get merged with adjacent lists outside the editable inline root. + Fixed bug where MS Edge would crash when closing a dialog then clicking a menu item. + Fixed bug where table cell selection would add undo levels. + Fixed bug where table cell selection wasn't removed when inline editor where removed. + Fixed bug where table cell selection wouldn't work properly on nested tables. + Fixed bug where table merge menu would be available when merging between thead and tbody. + Fixed bug where table row/column resize wouldn't get properly removed when the editor was removed. + Fixed bug where Chrome would scroll to the editor if there where a empty hash value in document url. + Fixed bug where the cache suffix wouldn't work correctly with the importcss plugin. + Fixed bug where selection wouldn't work properly on MS Edge on Windows Phone 10. + Fixed so adjacent pre blocks gets joined into one pre block since that seems like the user intent. + Fixed so events gets properly dispatched in shadow dom. Patch provided by Nazar Mokrynskyi. +Version 4.3.3 (2016-01-14) + Added new table_resize_bars configuration setting. This setting allows you to disable the table resize bars. + Added new beforeInitialize event to tinymce.util.XHR lets you modify XHR properties before open. Patch contributed by Brent Clintel. + Added new autolink_pattern setting to autolink plugin. Enables you to override the default autolink formats. Patch contributed by Ben Tiedt. + Added new charmap option that lets you override the default charmap of the charmap plugin. + Added new charmap_append option that lets you add new characters to the default charmap of the charmap plugin. + Added new insertCustomChar event that gets fired when a character is inserted by the charmap plugin. + Fixed bug where table cells started with a superfluous   in IE10+. + Fixed bug where table plugin would retain all BR tags when cells were merged. + Fixed bug where media plugin would strip underscores from youtube urls. + Fixed bug where IME input would fail on IE 11 if you typed within a table. + Fixed bug where double click selection of a word would remove the space before the word on insert contents. + Fixed bug where table plugin would produce exceptions when hovering tables with invalid structure. + Fixed bug where fullscreen wouldn't scroll back to it's original position when untoggled. + Fixed so the template plugins templates setting can be a function that gets a callback that can provide templates. +Version 4.3.2 (2015-12-14) + Fixed bug where the resize bars for table cells were not affected by the object_resizing property. + Fixed bug where the contextual table toolbar would appear incorrectly if TinyMCE was initialized inline inside a table. + Fixed bug where resizing table cells did not fire a node change event or add an undo level. + Fixed bug where double click selection of text on IE 11 wouldn't work properly. + Fixed bug where codesample plugin would incorrectly produce br elements inside code elements. + Fixed bug where media plugin would strip dashes from youtube urls. + Fixed bug where it was possible to move the caret into the table resize bars. + Fixed bug where drag/drop into a cE=false element was possible on IE. +Version 4.3.1 (2015-11-30) + Fixed so it's possible to disable the table inline toolbar by setting it to false or an empty string. + Fixed bug where it wasn't possible to resize some tables using the drag handles. + Fixed bug where unique id:s would clash for multiple editor instances and cE=false selections. + Fixed bug where the same plugin could be initialized multiple times. + Fixed bug where the table inline toolbars would be displayed at the same time as the image toolbars. + Fixed bug where the table selection rect wouldn't be removed when selecting another control element. +Version 4.3.0 (2015-11-23) + Added new table column/row resize support. Makes it a lot more easy to resize the columns/rows in a table. + Added new table inline toolbar. Makes it easier to for example add new rows or columns to a table. + Added new notification API. Lets you display floating notifications to the end user. + Added new codesample plugin that lets you insert syntax highlighted pre elements into the editor. + Added new image_caption to images. Lets you create images with captions using a HTML5 figure/figcaption elements. + Added new live previews of embeded videos. Lets you play the video right inside the editor. + Added new setDirty method and "dirty" event to the editor. Makes it easier to track the dirty state change. + Added new setMode method to Editor instances that lets you dynamically switch between design/readonly. + Added new core support for contentEditable=false elements within the editor overrides the browsers broken behavior. + Rewrote the noneditable plugin to use the new contentEditable false core logic. + Fixed so the dirty state doesn't set set to false automatically when the undo index is set to 0. + Fixed the Selection.placeCaretAt so it works better on IE when the coordinate is between paragraphs. + Fixed bug where data-mce-bogus="all" element contents where counted by the word count plugin. + Fixed bug where contentEditable=false elements would be indented by the indent buttons. + Fixed bug where images within contentEditable=false would be selected in WebKit on mouse click. + Fixed bug in DOMUntils split method where the replacement parameter wouldn't work on specific cases. + Fixed bug where the importcss plugin would import classes from the skin content css file. + Fixed so all button variants have a wrapping span for it's text to make it easier to skin. + Fixed so it's easier to exit pre block using the arrow keys. + Fixed bug where listboxes with fix widths didn't render correctly. +Version 4.2.8 (2015-11-13) + Fixed bug where it was possible to delete tables as the inline root element if all columns where selected. + Fixed bug where the UI buttons active state wasn't properly updated due to recent refactoring of that logic. +Version 4.2.7 (2015-10-27) + Fixed bug where backspace/delete would remove all formats on the last paragraph character in WebKit/Blink. + Fixed bug where backspace within a inline format element with a bogus caret container would move the caret. + Fixed bug where backspace/delete on selected table cells wouldn't add an undo level. + Fixed bug where script tags embedded within the editor could sometimes get a mce- prefix prepended to them + Fixed bug where validate: false option could produce an error to be thrown from the Serialization step. + Fixed bug where inline editing of a table as the root element could let the user delete that table. + Fixed bug where inline editing of a table as the root element wouldn't properly handle enter key. + Fixed bug where inline editing of a table as the root element would normalize the selection incorrectly. + Fixed bug where inline editing of a list as the root element could let the user delete that list. + Fixed bug where inline editing of a list as the root element could let the user split that list. + Fixed bug where resize handles would be rendered on editable root elements such as table. +Version 4.2.6 (2015-09-28) + Added capability to set request headers when using XHRs. + Added capability to upload local images automatically default delay is set to 30 seconds after editing images. + Added commands ids mceEditImage, mceAchor and mceMedia to be avaiable from execCommand. + Added Edge browser to saucelabs grunt task. Patch contributed by John-David Dalton. + Fixed bug where blob uris not produced by tinymce would produce HTML invalid markup. + Fixed bug where selection of contents of a nearly empty editor in Edge would sometimes fail. + Fixed bug where color styles woudln't be retained on copy/paste in Blink/Webkit. + Fixed bug where the table plugin would throw an error when inserting rows after a child table. + Fixed bug where the template plugin wouldn't handle functions as variable replacements. + Fixed bug where undo/redo sometimes wouldn't work properly when applying formatting collapsed ranges. + Fixed bug where shift+delete wouldn't do a cut operation on Blink/WebKit. + Fixed bug where cut action wouldn't properly store the before selection bookmark for the undo level. + Fixed bug where backspace in side an empty list element on IE would loose editor focus. + Fixed bug where the save plugin wouldn't enable the buttons when a change occurred. + Fixed bug where Edge wouldn't initialize the editor if a document.domain was specified. + Fixed bug where enter key before nested images would sometimes not properly expand the previous block. + Fixed bug where the inline toolbars wouldn't get properly hidden when blurring the editor instance. + Fixed bug where Edge would paste Chinese characters on some Windows 10 installations. + Fixed bug where IME would loose focus on IE 11 due to the double trailing br bug fix. + Fixed bug where the proxy url in imagetools was incorrect. Patch contributed by Wong Ho Wang. +Version 4.2.5 (2015-08-31) + Added fullscreen capability to embedded youtube and vimeo videos. + Fixed bug where the uploadImages call didn't work on IE 10. + Fixed bug where image place holders would be uploaded by uploadImages call. + Fixed bug where images marked with bogus would be uploaded by the uploadImages call. + Fixed bug where multiple calls to uploadImages would result in decreased performance. + Fixed bug where pagebreaks were editable to imagetools patch contributed by Rasmus Wallin. + Fixed bug where the element path could cause too much recursion exception. + Fixed bug for domains containing ".min". Patch contributed by Loïc Février. + Fixed so validation of external links to accept a number after www. Patch contributed by Victor Carvalho. + Fixed so the charmap is exposed though execCommand. Patch contributed by Matthew Will. + Fixed so that the image uploads are concurrent for improved performance. + Fixed various grammar problems in inline documentation. Patches provided by nikolas. +Version 4.2.4 (2015-08-17) + Added picture as a valid element to the HTML 5 schema. Patch contributed by Adam Taylor. + Fixed bug where contents would be duplicated on drag/drop within the same editor. + Fixed bug where floating/alignment of images on Edge wouldn't work properly. + Fixed bug where it wasn't possible to drag images on IE 11. + Fixed bug where image selection on Edge would sometimes fail. + Fixed bug where contextual toolbars icons wasn't rendered properly when using the toolbar_items_size. + Fixed bug where searchreplace dialog doesn't get prefilled with the selected text. + Fixed bug where fragmented matches wouldn't get properly replaced by the searchreplace plugin. + Fixed bug where enter key wouldn't place the caret if was after a trailing space within an inline element. + Fixed bug where the autolink plugin could produce multiple links for the same text on Gecko. + Fixed bug where EditorUpload could sometimes throw an exception if the blob wasn't found. + Fixed xss issues with media plugin not properly filtering out some script attributes. +Version 4.2.3 (2015-07-30) + Fixed bug where image selection wasn't possible on Edge due to incompatible setBaseAndExtend API. + Fixed bug where image blobs urls where not properly destroyed by the imagetools plugin. + Fixed bug where keyboard shortcuts wasn't working correctly on IE 8. + Fixed skin issue where the borders of panels where not visible on IE 8. +Version 4.2.2 (2015-07-22) + Fixed bug where float panels were not being hidden on inline editor blur when fixed_toolbar_container config option was in use. + Fixed bug where combobox states wasn't properly updated if contents where updated without keyboard. + Fixed bug where pasting into textbox or combobox would move the caret to the end of text. + Fixed bug where removal of bogus span elements before block elements would remove whitespace between nodes. + Fixed bug where repositioning of inline toolbars where async and producing errors if the editor was removed from DOM to early. Patch by iseulde. + Fixed bug where element path wasn't working correctly. Patch contributed by iseulde. + Fixed bug where menus wasn't rendered correctly when custom images where added to a menu. Patch contributed by Naim Hammadi. +Version 4.2.1 (2015-06-29) + Fixed bug where back/forward buttons in the browser would render blob images as broken images. + Fixed bug where Firefox would throw regexp to big error when replacing huge base64 chunks. + Fixed bug rendering issues with resize and context toolbars not being placed properly until next animation frame. + Fixed bug where the rendering of the image while cropping would some times not be centered correctly. + Fixed bug where listbox items with submenus would me selected as active. + Fixed bug where context menu where throwing an error when rendering. + Fixed bug where resize both option wasn't working due to resent addClass API change. Patch contributed by Jogai. + Fixed bug where a hideAll call for container rendered inline toolbars would throw an error. + Fixed bug where onclick event handler on combobox could cause issues if element.id was a function by some polluting libraries. + Fixed bug where listboxes wouldn't get proper selected sub menu item when using link_list or image_list. + Fixed so the UI controls are as wide as 4.1.x to avoid wrapping controls in toolbars. + Fixed so the imagetools dialog is adaptive for smaller screen sizes. +Version 4.2.0 (2015-06-25) + Added new flat default skin to make the UI more modern. + Added new imagetools plugin, lets you crop/resize and apply filters to images. + Added new contextual toolbars support to the API lets you add floating toolbars for specific CSS selectors. + Added new promise feature fill as tinymce.util.Promise. + Added new built in image upload feature lets you upload any base64 encoded image within the editor as files. + Fixed bug where resize handles would appear in the right position in the wrong editor when switching between resizable content in different inline editors. + Fixed bug where tables would not be inserted in inline mode due to previous float panel fix. + Fixed bug where floating panels would remain open when focus was lost on inline editors. + Fixed bug where cut command on Chrome would thrown a browser security exception. + Fixed bug where IE 11 sometimes would report an incorrect size for images in the image dialog. + Fixed bug where it wasn't possible to remove inline formatting at the end of block elements. + Fixed bug where it wasn't possible to delete table cell contents when cell selection was vertical. + Fixed bug where table cell wasn't emptied from block elements if delete/backspace where pressed in empty cell. + Fixed bug where cmd+shift+arrow didn't work correctly on Firefox mac when selecting to start/end of line. + Fixed bug where removal of bogus elements would sometimes remove whitespace between nodes. + Fixed bug where the resize handles wasn't updated when the main window was resized. + Fixed so script elements gets removed by default to prevent possible XSS issues in default config implementations. + Fixed so the UI doesn't need manual reflows when using non native layout managers. + Fixed so base64 encoded images doesn't slow down the editor on modern browsers while editing. + Fixed so all UI elements uses touch events to improve mobile device support. + Removed the touch click quirks patch for iOS since it did more harm than good. + Removed the non proportional resize handles since. Unproportional resize can still be done by holding the shift key. +Version 4.1.10 (2015-05-05) + Fixed bug where plugins loaded with compat3x would sometimes throw errors when loading using the jQuery version. + Fixed bug where extra empty paragraphs would get deleted in WebKit/Blink due to recent Quriks fix. + Fixed bug where the editor wouldn't work properly on IE 12 due to some required browser sniffing. + Fixed bug where formatting shortcut keys where interfering with Mac OS X screenshot keys. + Fixed bug where the caret wouldn't move to the next/previous line boundary on Cmd+Left/Right on Gecko. + Fixed bug where it wasn't possible to remove formats from very specific nested contents. + Fixed bug where undo levels wasn't produced when typing letters using the shift or alt+ctrl modifiers. + Fixed bug where the dirty state wasn't properly updated when typing using the shift or alt+ctrl modifiers. + Fixed bug where an error would be thrown if an autofocused editor was destroyed quickly after its initialization. Patch provided by thorn0. + Fixed issue with dirty state not being properly updated on redo operation. + Fixed issue with entity decoder not handling incorrectly written numeric entities. + Fixed issue where some PI element values wouldn't be properly encoded. +Version 4.1.9 (2015-03-10) + Fixed bug where indentation wouldn't work properly for non list elements. + Fixed bug with image plugin not pulling the image dimensions out correctly if a custom document_base_url was used. + Fixed bug where ctrl+alt+[1-9] would conflict with the AltGr+[1-9] on Windows. New shortcuts is ctrl+shift+[1-9]. + Fixed bug with removing formatting on nodes in inline mode would sometimes include nodes outside the editor body. + Fixed bug where extra nbsp:s would be inserted when you replaced a word surrounded by spaces using insertContent. + Fixed bug with pasting from Google Docs would produce extra strong elements and line feeds. +Version 4.1.8 (2015-03-05) + Added new html5 sizes attribute to img elements used together with srcset. + Added new elementpath option that makes it possible to disable the element path but keep the statusbar. + Added new option table_style_by_css for the table plugin to set table styling with css rather than table attributes. + Added new link_assume_external_targets option to prompt the user to prepend http:// prefix if the supplied link does not contain a protocol prefix. + Added new image_prepend_url option to allow a custom base path/url to be added to images. + Added new table_appearance_options option to make it possible to disable some options. + Added new image_title option to make it possible to alter the title of the image, disabled by default. + Fixed bug where selection starting from out side of the body wouldn't produce a proper selection range on IE 11. + Fixed bug where pressing enter twice before a table moves the cursor in the table and causes a javascript error. + Fixed bug where advanced image styles were not respected. + Fixed bug where the less common Shift+Delete didn't produce a proper cut operation on WebKit browsers. + Fixed bug where image/media size constrain logic would produce NaN when handling non number values. + Fixed bug where internal classes where removed by the removeformat command. + Fixed bug with creating links table cell contents with a specific selection would throw a exceptions on WebKit/Blink. + Fixed bug where valid_classes option didn't work as expected according to docs. Patch provided by thorn0. + Fixed bug where jQuery plugin would patch the internal methods multiple times. Patch provided by Drew Martin. + Fixed bug where backspace key wouldn't delete the current selection of newly formatted content. + Fixed bug where type over of inline formatting elements wouldn't properly keep the format on WebKit/Blink. + Fixed bug where selection needed to be properly normalized on modern IE versions. + Fixed bug where Command+Backspace didn't properly delete the whole line of text but the previous word. + Fixed bug where UI active states wheren't properly updated on IE if you placed caret within the current range. + Fixed bug where delete/backspace on WebKit/Blink would remove span elements created by the user. + Fixed bug where delete/backspace would produce incorrect results when deleting between two text blocks with br elements. + Fixed bug where captions where removed when pasting from MS Office. + Fixed bug where lists plugin wouldn't properly remove fully selected nested lists. + Fixed bug where the ttf font used for icons would throw an warning message on Gecko on Mac OS X. + Fixed a bug where applying a color to text did not update the undo/redo history. + Fixed so shy entities gets displayed when using the visualchars plugin. + Fixed so removeformat removes ins/del by default since these might be used for strikethough. + Fixed so multiple language packs can be loaded and added to the global I18n data structure. + Fixed so transparent color selection gets treated as a normal color selection. Patch contributed by Alexander Hofbauer. + Fixed so it's possible to disable autoresize_overflow_padding, autoresize_bottom_margin options by setting them to false. + Fixed so the charmap plugin shows the description of the character in the dialog. Patch contributed by Jelle Hissink. + Removed address from the default list of block formats since it tends to be missused. + Fixed so the pre block format is called preformatted to make it more verbose. + Fixed so it's possible to context scope translation strings this isn't needed most of the time. + Fixed so the max length of the width/height input fields of the media dialog is 5 instead of 3. + Fixed so drag/dropped contents gets properly processed by paste plugin since it's basically a paste. Patch contributed by Greg Fairbanks. + Fixed so shortcut keys for headers is ctrl+alt+[1-9] instead of ctrl+[1-9] since these are for switching tabs in the browsers. + Fixed so "u" doesn't get converted into a span element by the legacy input filter. Since this is now a valid HTML5 element. + Fixed font families in order to provide appropriate web-safe fonts. +Version 4.1.7 (2014-11-27) + Added HTML5 schema support for srcset, source and picture. Patch contributed by mattheu. + Added new cache_suffix setting to enable cache busting by producing unique urls. + Added new paste_convert_word_fake_lists option to enable users to disable the fake lists convert logic. + Fixed so advlist style changes adds undo levels for each change. + Fixed bug where WebKit would sometimes produce an exception when the autolink plugin where looking for URLs. + Fixed bug where IE 7 wouldn't be rendered properly due to to aggressive css compression. + Fixed bug where DomQuery wouldn't accept window as constructor element. + Fixed bug where the color picker in 3.x dialogs wouldn't work properly. Patch contributed by Callidior. + Fixed bug where the image plugin wouldn't respect the document_base_url. + Fixed bug where the jQuery plugin would fail to append to elements named array prototype names. +Version 4.1.6 (2014-10-08) + Fixed bug with clicking on the scrollbar of the iframe would cause a JS error to be thrown. + Fixed bug where null would produce an exception if you passed it to selection.setRng. + Fixed bug where Ctrl/Cmd+Tab would indent the current list item if you switched tabs in the browser. + Fixed bug where pasting empty cells from Excel would result in a broken table. + Fixed bug where it wasn't possible to switch back to default list style type. + Fixed issue where the select all quirk fix would fire for other modifiers than Ctrl/Cmd combinations. + Replaced jake with grunt since it is more mainstream and has better plugin support. +Version 4.1.5 (2014-09-09) + Fixed bug where sometimes the resize rectangles wouldn't properly render on images on WebKit/Blink. + Fixed bug in list plugin where delete/backspace would merge empty LI elements in lists incorrectly. + Fixed bug where empty list elements would result in empty LI elements without it's parent container. + Fixed bug where backspace in empty caret formatted element could produce an type error exception of Gecko. + Fixed bug where lists pasted from word with a custom start index above 9 wouldn't be properly handled. + Fixed bug where tabfocus plugin would tab out of the editor instance even if the default action was prevented. + Fixed bug where tabfocus wouldn't tab properly to other adjacent editor instances. + Fixed bug where the DOMUtils setStyles wouldn't properly removed or update the data-mce-style attribute. + Fixed bug where dialog select boxes would be placed incorrectly if document.body wasn't statically positioned. + Fixed bug where pasting would sometimes scroll to the top of page if the user was using the autoresize plugin. + Fixed bug where caret wouldn't be properly rendered by Chrome when clicking on the iframes documentElement. + Fixed so custom images for menubutton/splitbutton can be provided. Patch contributed by Naim Hammadi. + Fixed so the default action of windows closing can be prevented by blocking the default action of the close event. + Fixed so nodeChange and focus of the editor isn't automatically performed when opening sub dialogs. +Version 4.1.4 (2014-08-21) + Added new media_filter_html option to media plugin that blocks any conditional comments, scripts etc within a video element. + Added new content_security_policy option allows you to set custom policy for iframe contents. Patch contributed by Francois Chagnon. + Fixed bug where activate/deactivate events wasn't firing properly when switching between editors. + Fixed bug where placing the caret on iOS was difficult due to a WebKit bug with touch events. + Fixed bug where the resize helper wouldn't render properly on older IE versions. + Fixed bug where resizing images inside tables on older IE versions would sometimes fail depending mouse position. + Fixed bug where editor.insertContent would produce an exception when inserting select/option elements. + Fixed bug where extra empty paragraphs would be produced if block elements where inserted inside span elements. + Fixed bug where the spellchecker menu item wouldn't be properly checked if spell checking was started before it was rendered. + Fixed bug where the DomQuery filter function wouldn't remove non elements from collection. + Fixed bug where document with custom document.domain wouldn't properly render the editor. + Fixed bug where IE 8 would throw exception when trying to enter invalid color values into colorboxes. + Fixed bug where undo manager could incorrectly add an extra undo level when custom resize handles was removed. + Fixed bug where it wouldn't be possible to alter cell properties properly on table cells on IE 8. + Fixed so the color picker button in table dialog isn't shown unless you include the colorpicker plugin or add your own custom color picker. + Fixed so activate/deactivate events fire when windowManager opens a window since. + Fixed so the table advtab options isn't separated by an underscore to normalize naming with image_advtab option. + Fixed so the table cell dialog has proper padding when the advanced tab in disabled. +Version 4.1.3 (2014-07-29) + Added event binding logic to tinymce.util.XHR making it possible to override headers and settings before any request is made. + Fixed bug where drag events wasn't fireing properly on older IE versions since the event handlers where bound to document. + Fixed bug where drag/dropping contents within the editor on IE would force the contents into plain text mode even if it was internal content. + Fixed bug where IE 7 wouldn't open menus properly due to a resize bug in the browser auto closing them immediately. + Fixed bug where the DOMUtils getPos logic wouldn't produce a valid coordinate inside the body if the body was positioned non static. + Fixed bug where the element path and format state wasn't properly updated if you had the wordcount plugin enabled. + Fixed bug where a comment at the beginning of source would produce an exception in the formatter logic. + Fixed bug where setAttrib/getAttrib on null would throw exception together with any hooked attributes like style. + Fixed bug where table sizes wasn't properly retained when copy/pasting on WebKit/Blink. + Fixed bug where WebKit/Blink would produce colors in RGB format instead of the forced HEX format when deleting contents. + Fixed bug where the width attribute wasn't updated on tables if you changed the size inside the table dialog. + Fixed bug where control selection wasn't properly handled when the caret was placed directly after an image. + Fixed bug where selecting the contents of table cells using the selection.select method wouldn't place the caret properly. + Fixed bug where the selection state for images wasn't removed when placing the caret right after an image on WebKit/Blink. + Fixed bug where all events wasn't properly unbound when and editor instance was removed or destroyed by some external innerHTML call. + Fixed bug where it wasn't possible or very hard to select images on iOS when the onscreen keyboard was visible. + Fixed so auto_focus can take a boolean argument this will auto focus the last initialized editor might be useful for single inits. + Fixed so word auto detect lists logic works better for faked lists that doesn't have specific markup. + Fixed so nodeChange gets fired on mouseup as it used to before 4.1.1 we optimized that event to fire less often. + Removed the finish menu item from spellchecker menu since it's redundant you can stop spellchecking by toggling menu item or button. +Version 4.1.2 (2014-07-15) + Added offset/grep to DomQuery class works basically the same as it's jQuery equivalent. + Fixed bug where backspace/delete or setContent with an empty string would remove header data when using the fullpage plugin. + Fixed bug where tinymce.remove with a selector not matching any editors would remove all editors. + Fixed bug where resizing of the editor didn't work since the theme was calling setStyles instead of setStyle. + Fixed bug where IE 7 would fail to append html fragments to iframe document when using DomQuery. + Fixed bug where the getStyle DOMUtils method would produce an exception if it was called with null as it's element. + Fixed bug where the paste plugin would remove the element if the none of the paste_webkit_styles rules matched the current style. + Fixed bug where contextmenu table items wouldn't work properly on IE since it would some times fire an incorrect selection change. + Fixed bug where the padding/border values wasn't used in the size calculation for the body size when using autoresize. Patch contributed by Matt Whelan. + Fixed bug where conditional word comments wouldn't be properly removed when pasting plain text. + Fixed bug where resizing would sometime fail on IE 11 when the mouseup occurred inside the resizable element. + Fixed so the iframe gets initialized without any inline event handlers for better CSP support. Patch contributed by Matt Whelan. + Fixed so the tinymce.dom.Sizzle is the latest version of sizzle this resolves the document context bug. +Version 4.1.1 (2014-07-08) + Fixed bug where pasting plain text on some WebKit versions would result in an empty line. + Fixed bug where resizing images inside tables on IE 11 wouldn't work properly. + Fixed bug where IE 11 would sometimes throw "Invalid argument" exception when editor contents was set to an empty string. + Fixed bug where document.activeElement would throw exceptions on IE 9 when that element was hidden or removed from dom. + Fixed bug where WebKit/Blink sometimes produced br elements with the Apple-interchange-newline class. + Fixed bug where table cell selection wasn't properly removed when copy/pasting table cells. + Fixed bug where pasting nested list items from Word wouldn't produce proper semantic nested lists. + Fixed bug where right clicking using the contextmenu plugin on WebKit/Blink on Mac OS X would select the target current word or line. + Fixed bug where it wasn't possible to alter table cell properties on IE 8 using the context menu. + Fixed bug where the resize helper wouldn't be correctly positioned on older IE versions. + Fixed bug where fullpage plugin would produce an error if you didn't specify a doctype encoding. + Fixed bug where anchor plugin would get the name/id of the current element even if it wasn't anchor element. + Fixed bug where visual aids for tables wouldn't be properly disabled when changing the border size. + Fixed bug where some control selection events wasn't properly fired on older IE versions. + Fixed bug where table cell selection on older IE versions would prevent resizing of images. + Fixed bug with paste_data_images paste option not working properly on modern IE versions. + Fixed bug where custom elements with underscores in the name wasn't properly parsed/serialized. + Fixed bug where applying inline formats to nested list elements would produce an incorrect formatting result. + Fixed so it's possible to hide items from elements path by using preventDefault/stopPropagation. + Fixed so inline mode toolbar gets rendered right aligned if the editable element positioned to the documents right edge. + Fixed so empty inline elements inside empty block elements doesn't get removed if configured to be kept intact. + Fixed so DomQuery parentsUntil/prevUntil/nextUntil supports selectors/elements/filters etc. + Fixed so legacyoutput plugin overrides fontselect and fontsizeselect controls and handles font elements properly. +Version 4.1.0 (2014-06-18) + Added new file_picker_callback option to replace the old file_browser_callback the latter will still work though. + Added new custom colors to textcolor plugin will be displayed if a color picker is provided also shows the latest colors. + Added new color_picker_callback option to enable you to add custom color pickers to the editor. + Added new advanced tabs to table/cell/row dialogs to enable you to select colors for border/background. + Added new colorpicker plugin that lets you select colors from a hsv color picker. + Added new tinymce.util.Color class to handle color parsing and converting. + Added new colorpicker UI widget element lets you add a hsv color picker to any form/window. + Added new textpattern plugin that allows you to use markdown like text patterns to format contents. + Added new resize helper element that shows the current width & height while resizing. + Added new "once" method to Editor and EventDispatcher enables since callback execution events. + Added new jQuery like class under tinymce.dom.DomQuery it's exposed on editor instances (editor.$) and globally under (tinymce.$). + Fixed so the default resize method for images are proportional shift/ctrl can be used to make an unproportional size. + Fixed bug where the image_dimensions option of the image plugin would cause exceptions when it tried to update the size. + Fixed bug where table cell dialog class field wasn't properly updated when editing an a table cell with an existing class. + Fixed bug where Safari on Mac would produce webkit-fake-url for pasted images so these are now removed. + Fixed bug where the nodeChange event would get fired before the selection was changed when clicking inside the current selection range. + Fixed bug where valid_classes option would cause exception when it removed internal prefixed classes like mce-item-. + Fixed bug where backspace would cause navigation in IE 8 on an inline element and after a caret formatting was applied. + Fixed so placeholder images produced by the media plugin gets selected when inserted/edited. + Fixed so it's possible to drag in images when the paste_data_images option is enabled. Might be useful for mail clients. + Fixed so images doesn't get a width/height applied if the image_dimensions option is set to false useful for responsive contents. + Fixed so it's possible to pass in an optional arguments object for the nodeChanged function to be passed to all nodechange event listeners. + Fixed bug where media plugin embed code didn't update correctly. diff --git a/external/tinymce/js/tinymce/jquery.tinymce.min.js b/external/tinymce/js/tinymce/jquery.tinymce.min.js new file mode 100644 index 00000000..651f1e07 --- /dev/null +++ b/external/tinymce/js/tinymce/jquery.tinymce.min.js @@ -0,0 +1 @@ +!function(){var a={},b=function(b){for(var c=a[b],e=c.deps,f=c.defn,g=e.length,h=new Array(g),i=0;i0&&(c=i().get(d[0].id)))return c.getContent()}function d(a){var b=null;return a&&a.id&&g.tinymce&&(b=i().get(a.id)),b}function e(a){return!!(a&&a.length&&g.tinymce&&a.is(":tinymce"))}var h={};f.each(["text","html","val"],function(a,g){var i=h[g]=f.fn[g],j="text"===g;f.fn[g]=function(a){var g=this;if(!e(g))return i.apply(g,arguments);if(a!==c)return b.call(g.filter(":tinymce"),a),i.apply(g.not(":tinymce"),arguments),g;var h="",k=arguments;return(j?g:g.eq(0)).each(function(a,b){var c=d(b);h+=c?j?c.getContent().replace(/<(?:"[^"]*"|'[^']*'|[^'">])*>/g,""):c.getContent({save:!0}):i.apply(f(b),k)}),h}}),f.each(["append","prepend"],function(a,b){var g=h[b]=f.fn[b],i="prepend"===b;f.fn[b]=function(a){var b=this;return e(b)?a!==c?("string"==typeof a&&b.filter(":tinymce").each(function(b,c){var e=d(c);e&&e.setContent(i?a+e.getContent():e.getContent()+a)}),g.apply(b.not(":tinymce"),arguments),b):void 0:g.apply(b,arguments)}}),f.each(["remove","replaceWith","replaceAll","empty"],function(b,c){var d=h[c]=f.fn[c];f.fn[c]=function(){return a.call(this,c),d.apply(this,arguments)}}),h.attr=f.fn.attr,f.fn.attr=function(a,g){var i=this,j=arguments;if(!a||"value"!==a||!e(i))return g!==c?h.attr.apply(i,j):h.attr.apply(i,j);if(g!==c)return b.call(i.filter(":tinymce"),g),h.attr.apply(i.not(":tinymce"),j),i;var k=i[0],l=d(k);return l?l.getContent({save:!0}):h.attr.apply(f(k),j)}}var c,d,e,f,g,h=[];g=a?a:window,f=g.jQuery;var i=function(){return g.tinymce};f.fn.tinymce=function(a){function c(){var c=[],d=0;e||(b(),e=!0),m.each(function(b,e){var f,g=e.id,h=a.oninit;g||(e.id=g=i().DOM.uniqueId()),i().get(g)||(f=i().createEditor(g,a),c.push(f),f.on("init",function(){var a,b=h;m.css("visibility",""),h&&++d==c.length&&("string"==typeof b&&(a=b.indexOf(".")===-1?null:i().resolve(b.replace(/\.\w+$/,"")),b=i().resolve(b)),b.apply(a||i(),c))}))}),f.each(c,function(a,b){b.render()})}var j,k,l,m=this,n="";if(!m.length)return m;if(!a)return i()?i().get(m[0].id):null;if(m.css("visibility","hidden"),g.tinymce||d||!(j=a.script_url))1===d?h.push(c):c();else{d=1,k=j.substring(0,j.lastIndexOf("/")),j.indexOf(".min")!=-1&&(n=".min"),g.tinymce=g.tinyMCEPreInit||{base:k,suffix:n},j.indexOf("gzip")!=-1&&(l=a.language||"en",j=j+(/\?/.test(j)?"&":"?")+"js=true&core=true&suffix="+escape(n)+"&themes="+escape(a.theme||"modern")+"&plugins="+escape(a.plugins||"")+"&languages="+(l||""),g.tinyMCE_GZ||(g.tinyMCE_GZ={start:function(){function b(a){i().ScriptLoader.markDone(i().baseURI.toAbsolute(a))}b("langs/"+l+".js"),b("themes/"+a.theme+"/theme"+n+".js"),b("themes/"+a.theme+"/langs/"+l+".js"),f.each(a.plugins.split(","),function(a,c){c&&(b("plugins/"+c+"/plugin"+n+".js"),b("plugins/"+c+"/langs/"+l+".js"))})},end:function(){}}));var o=document.createElement("script");o.type="text/javascript",o.onload=o.onreadystatechange=function(b){b=b||window.event,2===d||"load"!=b.type&&!/complete|loaded/.test(o.readyState)||(i().dom.Event.domLoaded=1,d=2,a.script_loaded&&a.script_loaded(),c(),f.each(h,function(a,b){b()}))},o.src=j,document.body.appendChild(o)}return m},f.extend(f.expr[":"],{tinymce:function(a){var b;return!!(a.id&&"tinymce"in g&&(b=i().get(a.id),b&&b.editorManager===i()))}})}}),d("0")()}(); \ No newline at end of file diff --git a/external/tinymce/js/tinymce/langs/readme.md b/external/tinymce/js/tinymce/langs/readme.md new file mode 100644 index 00000000..a52bf03f --- /dev/null +++ b/external/tinymce/js/tinymce/langs/readme.md @@ -0,0 +1,3 @@ +This is where language files should be placed. + +Please DO NOT translate these directly use this service: https://www.transifex.com/projects/p/tinymce/ diff --git a/external/tinymce/js/tinymce/license.txt b/external/tinymce/js/tinymce/license.txt new file mode 100644 index 00000000..b17fc904 --- /dev/null +++ b/external/tinymce/js/tinymce/license.txt @@ -0,0 +1,504 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + + diff --git a/external/tinymce/js/tinymce/plugins/advlist/plugin.min.js b/external/tinymce/js/tinymce/plugins/advlist/plugin.min.js new file mode 100644 index 00000000..e281ace2 --- /dev/null +++ b/external/tinymce/js/tinymce/plugins/advlist/plugin.min.js @@ -0,0 +1 @@ +!function(){var a={},b=function(b){for(var c=a[b],e=c.deps,f=c.defn,g=e.length,h=new Array(g),i=0;i0&&f[0].nodeName===c)})}};j(a,"lists")&&(a.addCommand("ApplyUnorderedListStyle",function(a,b){f("UL",b["list-style-type"])}),a.addCommand("ApplyOrderedListStyle",function(a,b){f("OL",b["list-style-type"])}),a.addButton("numlist",{type:h.length>0?"splitbutton":"button",tooltip:"Numbered list",menu:h,onPostRender:k("OL"),onshow:g,onselect:function(a){f("OL",a.control.settings.data)},onclick:function(){a.execCommand("InsertOrderedList")}}),a.addButton("bullist",{type:i.length>0?"splitbutton":"button",tooltip:"Bullet list",onPostRender:k("UL"),menu:i,onshow:g,onselect:function(a){f("UL",a.control.settings.data)},onclick:function(){a.execCommand("InsertUnorderedList")}}))}),function(){}}),d("0")()}(); \ No newline at end of file diff --git a/external/tinymce/js/tinymce/plugins/anchor/plugin.min.js b/external/tinymce/js/tinymce/plugins/anchor/plugin.min.js new file mode 100644 index 00000000..6b3361d2 --- /dev/null +++ b/external/tinymce/js/tinymce/plugins/anchor/plugin.min.js @@ -0,0 +1 @@ +!function(){var a={},b=function(b){for(var c=a[b],e=c.deps,f=c.defn,g=e.length,h=new Array(g),i=0;ic&&(b=c)}return b}function f(a,b){1!=a.nodeType||a.hasChildNodes()?h.setStart(a,e(a,b)):h.setStartBefore(a)}function g(a,b){1!=a.nodeType||a.hasChildNodes()?h.setEnd(a,e(a,b)):h.setEndAfter(a)}var h,j,k,l,m,n,o,p,q,r;if("A"!=a.selection.getNode().tagName){if(h=a.selection.getRng(!0).cloneRange(),h.startOffset<5){if(p=h.endContainer.previousSibling,!p){if(!h.endContainer.firstChild||!h.endContainer.firstChild.nextSibling)return;p=h.endContainer.firstChild.nextSibling}if(q=p.length,f(p,q),g(p,q),h.endOffset<5)return;j=h.endOffset,l=p}else{if(l=h.endContainer,3!=l.nodeType&&l.firstChild){for(;3!=l.nodeType&&l.firstChild;)l=l.firstChild;3==l.nodeType&&(f(l,0),g(l,l.nodeValue.length))}j=1==h.endOffset?2:h.endOffset-1-b}k=j;do f(l,j>=2?j-2:0),g(l,j>=1?j-1:0),j-=1,r=h.toString();while(" "!=r&&""!==r&&160!=r.charCodeAt(0)&&j-2>=0&&r!=d);c(h.toString(),d)?(f(l,j),g(l,k),j+=1):0===h.startOffset?(f(l,0),g(l,k)):(f(l,j),g(l,k)),n=h.toString(),"."==n.charAt(n.length-1)&&g(l,k-1),n=h.toString(),o=n.match(i),o&&("www."==o[1]?o[1]="http://www.":/@$/.test(o[1])&&!/^mailto:/.test(o[1])&&(o[1]="mailto:"+o[1]),m=a.selection.getBookmark(),a.selection.setRng(h),a.execCommand("createlink",!1,o[1]+o[2]),a.settings.default_link_target&&a.dom.setAttrib(a.selection.getNode(),"target",a.settings.default_link_target),a.selection.moveToBookmark(m),a.nodeChanged())}}var h,i=/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+\-]+@)(.+)$/i;return b.settings.autolink_pattern&&(i=b.settings.autolink_pattern),b.on("keydown",function(a){if(13==a.keyCode)return f(b)}),a.ie?void b.on("focus",function(){if(!h){h=!0;try{b.execCommand("AutoUrlDetect",!1,!0)}catch(a){}}}):(b.on("keypress",function(a){if(41==a.keyCode)return d(b)}),void b.on("keyup",function(a){if(32==a.keyCode)return e(b)}))}),function(){}}),d("0")()}(); \ No newline at end of file diff --git a/external/tinymce/js/tinymce/plugins/autoresize/plugin.min.js b/external/tinymce/js/tinymce/plugins/autoresize/plugin.min.js new file mode 100644 index 00000000..081b5d32 --- /dev/null +++ b/external/tinymce/js/tinymce/plugins/autoresize/plugin.min.js @@ -0,0 +1 @@ +!function(){var a={},b=function(b){for(var c=a[b],e=c.deps,f=c.defn,g=e.length,h=new Array(g),i=0;ih.autoresize_min_height&&(m=n),h.autoresize_max_height&&n>h.autoresize_max_height?(m=h.autoresize_max_height,k.style.overflowY="auto",l.style.overflowY="auto"):(k.style.overflowY="hidden",l.style.overflowY="hidden",k.scrollTop=0),m!==i&&(g=m-i,e.setStyle(a.iframeElement,"height",m+"px"),i=m,b.webKit&&g<0&&f(d))}}function g(b,c,e){d.setEditorTimeout(a,function(){f({}),b--?g(b,c,e):e&&e()},c)}var h=a.settings,i=0;a.settings.inline||(h.autoresize_min_height=parseInt(a.getParam("autoresize_min_height",a.getElement().offsetHeight),10),h.autoresize_max_height=parseInt(a.getParam("autoresize_max_height",0),10),a.on("init",function(){var b,c;b=a.getParam("autoresize_overflow_padding",1),c=a.getParam("autoresize_bottom_margin",50),b!==!1&&a.dom.setStyles(a.getBody(),{paddingLeft:b,paddingRight:b}),c!==!1&&a.dom.setStyles(a.getBody(),{paddingBottom:c})}),a.on("nodechange setcontent keyup FullscreenStateChanged",f),a.getParam("autoresize_on_init",!0)&&a.on("init",function(){g(20,100,function(){g(5,1e3)})}),a.addCommand("mceAutoResize",f))}),function(){}}),d("0")()}(); \ No newline at end of file diff --git a/external/tinymce/js/tinymce/plugins/autosave/plugin.min.js b/external/tinymce/js/tinymce/plugins/autosave/plugin.min.js new file mode 100644 index 00000000..447ddf83 --- /dev/null +++ b/external/tinymce/js/tinymce/plugins/autosave/plugin.min.js @@ -0,0 +1 @@ +!function(){var a={},b=function(b){for(var c=a[b],e=c.deps,f=c.defn,g=e.length,h=new Array(g),i=0;iq.autosave_retention)||(h(!1),!1)}function h(a){c.removeItem(o+"draft"),c.removeItem(o+"time"),a!==!1&&b.fire("RemoveDraft")}function i(){!n()&&b.isDirty()&&(c.setItem(o+"draft",b.getContent({format:"raw",no_events:!0})),c.setItem(o+"time",(new Date).getTime()),b.fire("StoreDraft"))}function j(){g()&&(b.setContent(c.getItem(o+"draft"),{format:"raw"}),b.fire("RestoreDraft"))}function k(){p||(setInterval(function(){b.removed||i()},q.autosave_interval),p=!0)}function l(){var a=this;a.disabled(!g()),b.on("StoreDraft RestoreDraft RemoveDraft",function(){a.disabled(!g())}),k()}function m(){b.undoManager.beforeChange(),j(),h(),b.undoManager.add()}function n(a){var c=b.settings.forced_root_block;return a=d.trim("undefined"==typeof a?b.getBody().innerHTML:a),""===a||new RegExp("^<"+c+"[^>]*>((\xa0| |[ \t]|]*>)+?|)|
$","i").test(a)}var o,p,q=b.settings;o=q.autosave_prefix||"tinymce-autosave-{path}{query}-{id}-",o=o.replace(/\{path\}/g,document.location.pathname),o=o.replace(/\{query\}/g,document.location.search),o=o.replace(/\{id\}/g,b.id),q.autosave_interval=f(q.autosave_interval,"30s"),q.autosave_retention=f(q.autosave_retention,"20m"),b.addButton("restoredraft",{title:"Restore last draft",onclick:m,onPostRender:l}),b.addMenuItem("restoredraft",{text:"Restore last draft",onclick:m,onPostRender:l,context:"file"}),b.settings.autosave_restore_when_empty!==!1&&(b.on("init",function(){g()&&n()&&j()}),b.on("saveContent",function(){h()})),e.onbeforeunload=a._beforeUnloadHandler,this.hasDraft=g,this.storeDraft=i,this.restoreDraft=j,this.removeDraft=h,this.isEmpty=n}),function(){}}),d("0")()}(); \ No newline at end of file diff --git a/external/tinymce/js/tinymce/plugins/bbcode/plugin.min.js b/external/tinymce/js/tinymce/plugins/bbcode/plugin.min.js new file mode 100644 index 00000000..966358a0 --- /dev/null +++ b/external/tinymce/js/tinymce/plugins/bbcode/plugin.min.js @@ -0,0 +1 @@ +!function(){var a={},b=function(b){for(var c=a[b],e=c.deps,f=c.defn,g=e.length,h=new Array(g),i=0;i(.*?)<\/a>/gi,"[url=$1]$2[/url]"),c(/(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"),c(/(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"),c(/(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"),c(/(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"),c(/(.*?)<\/span>/gi,"[color=$1]$2[/color]"),c(/(.*?)<\/font>/gi,"[color=$1]$2[/color]"),c(/(.*?)<\/span>/gi,"[size=$1]$2[/size]"),c(/(.*?)<\/font>/gi,"$1"),c(//gi,"[img]$1[/img]"),c(/(.*?)<\/span>/gi,"[code]$1[/code]"),c(/(.*?)<\/span>/gi,"[quote]$1[/quote]"),c(/(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]"),c(/(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]"),c(/(.*?)<\/em>/gi,"[code][i]$1[/i][/code]"),c(/(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]"),c(/(.*?)<\/u>/gi,"[code][u]$1[/u][/code]"),c(/(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]"),c(/<\/(strong|b)>/gi,"[/b]"),c(/<(strong|b)>/gi,"[b]"),c(/<\/(em|i)>/gi,"[/i]"),c(/<(em|i)>/gi,"[i]"),c(/<\/u>/gi,"[/u]"),c(/(.*?)<\/span>/gi,"[u]$1[/u]"),c(//gi,"[u]"),c(/]*>/gi,"[quote]"),c(/<\/blockquote>/gi,"[/quote]"),c(/
/gi,"\n"),c(//gi,"\n"),c(/
/gi,"\n"),c(/

/gi,""),c(/<\/p>/gi,"\n"),c(/ |\u00a0/gi," "),c(/"/gi,'"'),c(/</gi,"<"),c(/>/gi,">"),c(/&/gi,"&"),a},_punbb_bbcode2html:function(a){function c(b,c){a=a.replace(b,c)}return a=b.trim(a),c(/\n/gi,"
"),c(/\[b\]/gi,""),c(/\[\/b\]/gi,""),c(/\[i\]/gi,""),c(/\[\/i\]/gi,""),c(/\[u\]/gi,""),c(/\[\/u\]/gi,""),c(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,'$2'),c(/\[url\](.*?)\[\/url\]/gi,'$1'),c(/\[img\](.*?)\[\/img\]/gi,''),c(/\[color=(.*?)\](.*?)\[\/color\]/gi,'$2'),c(/\[code\](.*?)\[\/code\]/gi,'$1 '),c(/\[quote.*?\](.*?)\[\/quote\]/gi,'$1 '),a}}}),function(){}}),d("0")()}(); \ No newline at end of file diff --git a/external/tinymce/js/tinymce/plugins/charmap/plugin.min.js b/external/tinymce/js/tinymce/plugins/charmap/plugin.min.js new file mode 100644 index 00000000..3fd9e23d --- /dev/null +++ b/external/tinymce/js/tinymce/plugins/charmap/plugin.min.js @@ -0,0 +1 @@ +!function(){var a={},b=function(b){for(var c=a[b],e=c.deps,f=c.defn,g=e.length,h=new Array(g),i=0;i",d=0;d

'+n+"
"}else c+=""}c+=""}c+="";var o={type:"container",html:c,onclick:function(a){var c=a.target;if(/^(TD|DIV)$/.test(c.nodeName)){var d=b(c).firstChild;d&&d.hasAttribute("data-chr")&&(h(d.getAttribute("data-chr")),a.ctrlKey||f.close())}},onmouseover:function(a){var c=b(a.target);c&&c.firstChild?(f.find("#preview").text(c.firstChild.firstChild.data),f.find("#previewTitle").text(c.title)):(f.find("#preview").text(" "),f.find("#previewTitle").text(" "))}};f=a.windowManager.open({title:"Special character",spacing:10,padding:10,items:[o,{type:"container",layout:"flex",direction:"column",align:"center",spacing:5,minWidth:160,minHeight:160,items:[{type:"label",name:"preview",text:" ",style:"font-size: 40px; text-align: center",border:1,minWidth:140,minHeight:80},{type:"spacer",minHeight:20},{type:"label",name:"previewTitle",text:" ",style:"white-space: pre-wrap;",border:1,minWidth:140}]}],buttons:[{text:"Close",onclick:function(){f.close()}}]})}var j=b.isArray;return a.addCommand("mceShowCharmap",i),a.addButton("charmap",{icon:"charmap",tooltip:"Special character",cmd:"mceShowCharmap"}),a.addMenuItem("charmap",{icon:"charmap",text:"Special character",cmd:"mceShowCharmap",context:"insert"}),{getCharMap:g,insertChar:h}}),function(){}}),d("0")()}(); \ No newline at end of file diff --git a/external/tinymce/js/tinymce/plugins/code/plugin.min.js b/external/tinymce/js/tinymce/plugins/code/plugin.min.js new file mode 100644 index 00000000..7a0437ed --- /dev/null +++ b/external/tinymce/js/tinymce/plugins/code/plugin.min.js @@ -0,0 +1 @@ +!function(){var a={},b=function(b){for(var c=a[b],e=c.deps,f=c.defn,g=e.length,h=new Array(g),i=0;i code[class*="language-"], +pre[class*="language-"] { + background: #f5f2f0; +} + +/* Inline code */ +:not(pre) > code[class*="language-"] { + padding: .1em; + border-radius: .3em; +} + +.token.comment, +.token.prolog, +.token.doctype, +.token.cdata { + color: slategray; +} + +.token.punctuation { + color: #999; +} + +.namespace { + opacity: .7; +} + +.token.property, +.token.tag, +.token.boolean, +.token.number, +.token.constant, +.token.symbol, +.token.deleted { + color: #905; +} + +.token.selector, +.token.attr-name, +.token.string, +.token.char, +.token.builtin, +.token.inserted { + color: #690; +} + +.token.operator, +.token.entity, +.token.url, +.language-css .token.string, +.style .token.string { + color: #a67f59; + background: hsla(0, 0%, 100%, .5); +} + +.token.atrule, +.token.attr-value, +.token.keyword { + color: #07a; +} + +.token.function { + color: #DD4A68; +} + +.token.regex, +.token.important, +.token.variable { + color: #e90; +} + +.token.important, +.token.bold { + font-weight: bold; +} +.token.italic { + font-style: italic; +} + +.token.entity { + cursor: help; +} + diff --git a/external/tinymce/js/tinymce/plugins/codesample/plugin.min.js b/external/tinymce/js/tinymce/plugins/codesample/plugin.min.js new file mode 100644 index 00000000..a0285edc --- /dev/null +++ b/external/tinymce/js/tinymce/plugins/codesample/plugin.min.js @@ -0,0 +1 @@ +!function(){var a={},b=function(b){for(var c=a[b],e=c.deps,f=c.defn,g=e.length,h=new Array(g),i=0;ia.length)break a;if(!(q instanceof e)){k.lastIndex=0;var r=k.exec(q);if(r){m&&(n=r[1].length);var s=r.index-1+n,r=r[0].slice(n),t=r.length,u=s+t,v=q.slice(0,s+1),w=q.slice(u+1),x=[p,1];v&&x.push(v);var y=new e(h,l?c.tokenize(r,l):r,o);x.push(y),w&&x.push(w),Array.prototype.splice.apply(f,x)}}}}}return f},hooks:{all:{},add:function(a,b){var d=c.hooks.all;d[a]=d[a]||[],d[a].push(b)},run:function(a,b){var d=c.hooks.all[a];if(d&&d.length)for(var e,f=0;e=d[f++];)e(b)}}},d=c.Token=function(a,b,c){this.type=a,this.content=b,this.alias=c};if(d.stringify=function(a,b,e){if("string"==typeof a)return a;if("Array"===c.util.type(a))return a.map(function(c){return d.stringify(c,b,a)}).join("");var f={type:a.type,content:d.stringify(a.content,b,e),tag:"span",classes:["token",a.type],attributes:{},language:b,parent:e};if("comment"==f.type&&(f.attributes.spellcheck="true"),a.alias){var g="Array"===c.util.type(a.alias)?a.alias:[a.alias];Array.prototype.push.apply(f.classes,g)}c.hooks.run("wrap",f);var h="";for(var i in f.attributes)h+=(h?" ":"")+i+'="'+(f.attributes[i]||"")+'"';return"<"+f.tag+' class="'+f.classes.join(" ")+'" '+h+">"+f.content+""},!b.document)return b.addEventListener?(b.addEventListener("message",function(a){var d=JSON.parse(a.data),e=d.language,f=d.code,g=d.immediateClose;b.postMessage(c.highlight(f,c.languages[e],e)),g&&b.close()},!1),b.Prism):b.Prism}();return"undefined"!=typeof module&&module.exports&&(module.exports=c),"undefined"!=typeof global&&(global.Prism=c),c.languages.markup={comment://,prolog:/<\?[\w\W]+?\?>/,doctype://,cdata://i,tag:{pattern:/<\/?[^\s>\/=.]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\\1|\\?(?!\1)[\w\W])*\1|[^\s'">=]+))?)*\s*\/?>/i,inside:{tag:{pattern:/^<\/?[^\s>\/]+/i,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"attr-value":{pattern:/=(?:('|")[\w\W]*?(\1)|[^\s>]+)/i,inside:{punctuation:/[=>"']/}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:/&#?[\da-z]{1,8};/i},c.hooks.add("wrap",function(a){"entity"===a.type&&(a.attributes.title=a.content.replace(/&/,"&"))}),c.languages.xml=c.languages.markup,c.languages.html=c.languages.markup,c.languages.mathml=c.languages.markup,c.languages.svg=c.languages.markup,c.languages.css={comment:/\/\*[\w\W]*?\*\//,atrule:{pattern:/@[\w-]+?.*?(;|(?=\s*\{))/i,inside:{rule:/@[\w-]+/}},url:/url\((?:(["'])(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1|.*?)\)/i,selector:/[^\{\}\s][^\{\};]*?(?=\s*\{)/,string:/("|')(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1/,property:/(\b|\B)[\w-]+(?=\s*:)/i,important:/\B!important\b/i,"function":/[-a-z0-9]+(?=\()/i,punctuation:/[(){};:]/},c.languages.css.atrule.inside.rest=c.util.clone(c.languages.css),c.languages.markup&&(c.languages.insertBefore("markup","tag",{style:{pattern:/[\w\W]*?<\/style>/i,inside:{tag:{pattern:/|<\/style>/i,inside:c.languages.markup.tag.inside},rest:c.languages.css},alias:"language-css"}}),c.languages.insertBefore("inside","attr-value",{"style-attr":{pattern:/\s*style=("|').*?\1/i,inside:{"attr-name":{pattern:/^\s*style/i,inside:c.languages.markup.tag.inside},punctuation:/^\s*=\s*['"]|['"]\s*$/,"attr-value":{pattern:/.+/i,inside:c.languages.css}},alias:"language-css"}},c.languages.markup.tag)),c.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\w\W]*?\*\//,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0}],string:/(["'])(\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,"class-name":{pattern:/((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[a-z0-9_\.\\]+/i,lookbehind:!0,inside:{punctuation:/(\.|\\)/}},keyword:/\b(if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,"boolean":/\b(true|false)\b/,"function":/[a-z0-9_]+(?=\()/i,number:/\b-?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)\b/i,operator:/--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*|\/|~|\^|%/,punctuation:/[{}[\];(),.:]/},c.languages.javascript=c.languages.extend("clike",{keyword:/\b(as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|false|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\b/,number:/\b-?(0x[\dA-Fa-f]+|0b[01]+|0o[0-7]+|\d*\.?\d+([Ee][+-]?\d+)?|NaN|Infinity)\b/,"function":/[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*(?=\()/i}),c.languages.insertBefore("javascript","keyword",{regex:{pattern:/(^|[^\/])\/(?!\/)(\[.+?]|\\.|[^\/\\\r\n])+\/[gimyu]{0,5}(?=\s*($|[\r\n,.;})]))/,lookbehind:!0}}),c.languages.insertBefore("javascript","class-name",{"template-string":{pattern:/`(?:\\`|\\?[^`])*`/,inside:{interpolation:{pattern:/\$\{[^}]+\}/,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:c.languages.javascript}},string:/[\s\S]+/}}}),c.languages.markup&&c.languages.insertBefore("markup","tag",{script:{pattern:/[\w\W]*?<\/script>/i,inside:{tag:{pattern:/|<\/script>/i,inside:c.languages.markup.tag.inside},rest:c.languages.javascript},alias:"language-javascript"}}),c.languages.js=c.languages.javascript,c.languages.c=c.languages.extend("clike",{keyword:/\b(asm|typeof|inline|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|union|unsigned|void|volatile|while)\b/,operator:/\-[>-]?|\+\+?|!=?|<>?=?|==?|&&?|\|?\||[~^%?*\/]/,number:/\b-?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)[ful]*\b/i}),c.languages.insertBefore("c","string",{macro:{pattern:/(^\s*)#\s*[a-z]+([^\r\n\\]|\\.|\\(?:\r\n?|\n))*/im,lookbehind:!0,alias:"property",inside:{string:{pattern:/(#\s*include\s*)(<.+?>|("|')(\\?.)+?\3)/,lookbehind:!0}}}}),delete c.languages.c["class-name"],delete c.languages.c["boolean"],c.languages.csharp=c.languages.extend("clike",{keyword:/\b(abstract|as|async|await|base|bool|break|byte|case|catch|char|checked|class|const|continue|decimal|default|delegate|do|double|else|enum|event|explicit|extern|false|finally|fixed|float|for|foreach|goto|if|implicit|in|int|interface|internal|is|lock|long|namespace|new|null|object|operator|out|override|params|private|protected|public|readonly|ref|return|sbyte|sealed|short|sizeof|stackalloc|static|string|struct|switch|this|throw|true|try|typeof|uint|ulong|unchecked|unsafe|ushort|using|virtual|void|volatile|while|add|alias|ascending|async|await|descending|dynamic|from|get|global|group|into|join|let|orderby|partial|remove|select|set|value|var|where|yield)\b/,string:[/@("|')(\1\1|\\\1|\\?(?!\1)[\s\S])*\1/,/("|')(\\?.)*?\1/],number:/\b-?(0x[\da-f]+|\d*\.?\d+)\b/i}),c.languages.insertBefore("csharp","keyword",{preprocessor:{pattern:/(^\s*)#.*/m,lookbehind:!0}}),c.languages.cpp=c.languages.extend("c",{keyword:/\b(alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|class|compl|const|constexpr|const_cast|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|float|for|friend|goto|if|inline|int|long|mutable|namespace|new|noexcept|nullptr|operator|private|protected|public|register|reinterpret_cast|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,"boolean":/\b(true|false)\b/,operator:/[-+]{1,2}|!=?|<{1,2}=?|>{1,2}=?|\->|:{1,2}|={1,2}|\^|~|%|&{1,2}|\|?\||\?|\*|\/|\b(and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/}),c.languages.insertBefore("cpp","keyword",{"class-name":{pattern:/(class\s+)[a-z0-9_]+/i,lookbehind:!0}}),c.languages.java=c.languages.extend("clike",{keyword:/\b(abstract|continue|for|new|switch|assert|default|goto|package|synchronized|boolean|do|if|private|this|break|double|implements|protected|throw|byte|else|import|public|throws|case|enum|instanceof|return|transient|catch|extends|int|short|try|char|final|interface|static|void|class|finally|long|strictfp|volatile|const|float|native|super|while)\b/,number:/\b0b[01]+\b|\b0x[\da-f]*\.?[\da-fp\-]+\b|\b\d*\.?\d+(?:e[+-]?\d+)?[df]?\b/i,operator:{pattern:/(^|[^.])(?:\+[+=]?|-[-=]?|!=?|<>?>?=?|==?|&[&=]?|\|[|=]?|\*=?|\/=?|%=?|\^=?|[?:~])/m,lookbehind:!0}}),c.languages.php=c.languages.extend("clike",{keyword:/\b(and|or|xor|array|as|break|case|cfunction|class|const|continue|declare|default|die|do|else|elseif|enddeclare|endfor|endforeach|endif|endswitch|endwhile|extends|for|foreach|function|include|include_once|global|if|new|return|static|switch|use|require|require_once|var|while|abstract|interface|public|implements|private|protected|parent|throw|null|echo|print|trait|namespace|final|yield|goto|instanceof|finally|try|catch)\b/i,constant:/\b[A-Z0-9_]{2,}\b/,comment:{pattern:/(^|[^\\])(?:\/\*[\w\W]*?\*\/|\/\/.*)/,lookbehind:!0}}),c.languages.insertBefore("php","class-name",{"shell-comment":{pattern:/(^|[^\\])#.*/,lookbehind:!0,alias:"comment"}}),c.languages.insertBefore("php","keyword",{delimiter:/\?>|<\?(?:php)?/i,variable:/\$\w+\b/i,"package":{pattern:/(\\|namespace\s+|use\s+)[\w\\]+/,lookbehind:!0,inside:{punctuation:/\\/}}}),c.languages.insertBefore("php","operator",{property:{pattern:/(->)[\w]+/,lookbehind:!0}}),c.languages.markup&&(c.hooks.add("before-highlight",function(a){"php"===a.language&&(a.tokenStack=[],a.backupCode=a.code,a.code=a.code.replace(/(?:<\?php|<\?)[\w\W]*?(?:\?>)/gi,function(b){return a.tokenStack.push(b),"{{{PHP"+a.tokenStack.length+"}}}"}))}),c.hooks.add("before-insert",function(a){"php"===a.language&&(a.code=a.backupCode,delete a.backupCode)}),c.hooks.add("after-highlight",function(a){if("php"===a.language){for(var b,d=0;b=a.tokenStack[d];d++)a.highlightedCode=a.highlightedCode.replace("{{{PHP"+(d+1)+"}}}",c.highlight(b,a.grammar,"php").replace(/\$/g,"$$$$"));a.element.innerHTML=a.highlightedCode}}),c.hooks.add("wrap",function(a){"php"===a.language&&"markup"===a.type&&(a.content=a.content.replace(/(\{\{\{PHP[0-9]+\}\}\})/g,'$1'))}),c.languages.insertBefore("php","comment",{markup:{pattern:/<[^?]\/?(.*?)>/,inside:c.languages.markup},php:/\{\{\{PHP[0-9]+\}\}\}/})),c.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0},string:/"""[\s\S]+?"""|'''[\s\S]+?'''|("|')(?:\\?.)*?\1/,"function":{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_][a-zA-Z0-9_]*(?=\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)[a-z0-9_]+/i,lookbehind:!0},keyword:/\b(?:as|assert|async|await|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|pass|print|raise|return|try|while|with|yield)\b/,"boolean":/\b(?:True|False)\b/,number:/\b-?(?:0[bo])?(?:(?:\d|0x[\da-f])[\da-f]*\.?\d*|\.\d+)(?:e[+-]?\d+)?j?\b/i,operator:/[-+%=]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]|\b(?:or|and|not)\b/,punctuation:/[{}[\];(),.:]/},function(a){a.languages.ruby=a.languages.extend("clike",{comment:/#(?!\{[^\r\n]*?\}).*/,keyword:/\b(alias|and|BEGIN|begin|break|case|class|def|define_method|defined|do|each|else|elsif|END|end|ensure|false|for|if|in|module|new|next|nil|not|or|raise|redo|require|rescue|retry|return|self|super|then|throw|true|undef|unless|until|when|while|yield)\b/});var b={pattern:/#\{[^}]+\}/,inside:{delimiter:{pattern:/^#\{|\}$/,alias:"tag"},rest:a.util.clone(a.languages.ruby)}};a.languages.insertBefore("ruby","keyword",{regex:[{pattern:/%r([^a-zA-Z0-9\s\{\(\[<])(?:[^\\]|\\[\s\S])*?\1[gim]{0,3}/,inside:{interpolation:b}},{pattern:/%r\((?:[^()\\]|\\[\s\S])*\)[gim]{0,3}/,inside:{interpolation:b}},{pattern:/%r\{(?:[^#{}\\]|#(?:\{[^}]+\})?|\\[\s\S])*\}[gim]{0,3}/,inside:{interpolation:b}},{pattern:/%r\[(?:[^\[\]\\]|\\[\s\S])*\][gim]{0,3}/,inside:{interpolation:b}},{pattern:/%r<(?:[^<>\\]|\\[\s\S])*>[gim]{0,3}/,inside:{interpolation:b}},{pattern:/(^|[^\/])\/(?!\/)(\[.+?]|\\.|[^\/\r\n])+\/[gim]{0,3}(?=\s*($|[\r\n,.;})]))/,lookbehind:!0}],variable:/[@$]+[a-zA-Z_][a-zA-Z_0-9]*(?:[?!]|\b)/,symbol:/:[a-zA-Z_][a-zA-Z_0-9]*(?:[?!]|\b)/}),a.languages.insertBefore("ruby","number",{builtin:/\b(Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Stat|File|Fixnum|Fload|Hash|Integer|IO|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|String|Struct|TMS|Symbol|ThreadGroup|Thread|Time|TrueClass)\b/,constant:/\b[A-Z][a-zA-Z_0-9]*(?:[?!]|\b)/}),a.languages.ruby.string=[{pattern:/%[qQiIwWxs]?([^a-zA-Z0-9\s\{\(\[<])(?:[^\\]|\\[\s\S])*?\1/,inside:{interpolation:b}},{pattern:/%[qQiIwWxs]?\((?:[^()\\]|\\[\s\S])*\)/,inside:{interpolation:b}},{pattern:/%[qQiIwWxs]?\{(?:[^#{}\\]|#(?:\{[^}]+\})?|\\[\s\S])*\}/,inside:{interpolation:b}},{pattern:/%[qQiIwWxs]?\[(?:[^\[\]\\]|\\[\s\S])*\]/,inside:{interpolation:b}},{pattern:/%[qQiIwWxs]?<(?:[^<>\\]|\\[\s\S])*>/,inside:{interpolation:b}},{pattern:/("|')(#\{[^}]+\}|\\(?:\r?\n|\r)|\\?.)*?\1/,inside:{interpolation:b}}]}(c),c}),g("7",["6"],function(a){return a("tinymce.dom.DOMUtils")}),g("5",[],function(){function a(a){return a&&"PRE"==a.nodeName&&a.className.indexOf("language-")!==-1}function b(a){return function(b,c){return a(c)}}return{isCodeSample:a,trimArg:b}}),g("4",["7","3","5"],function(a,b,c){function d(a){var b=[{text:"HTML/XML",value:"markup"},{text:"JavaScript",value:"javascript"},{text:"CSS",value:"css"},{text:"PHP",value:"php"},{text:"Ruby",value:"ruby"},{text:"Python",value:"python"},{text:"Java",value:"java"},{text:"C",value:"c"},{text:"C#",value:"csharp"},{text:"C++",value:"cpp"}],c=a.settings.codesample_languages;return c?c:b}function e(a,c,d){a.undoManager.transact(function(){var e=f(a);d=i.encode(d),e?(a.dom.setAttrib(e,"class","language-"+c),e.innerHTML=d,b.highlightElement(e),a.selection.select(e)):(a.insertContent('
'+d+"
"),a.selection.select(a.$("#__new").removeAttr("id")[0]))})}function f(a){var b=a.selection.getNode();return c.isCodeSample(b)?b:null}function g(a){var b=f(a);return b?b.textContent:""}function h(a){var b,c=f(a);return c?(b=c.className.match(/language-(\w+)/),b?b[1]:""):""}var i=a.DOM;return{open:function(a){a.windowManager.open({title:"Insert/Edit code sample",minWidth:Math.min(i.getViewPort().w,a.getParam("codesample_dialog_width",800)),minHeight:Math.min(i.getViewPort().h,a.getParam("codesample_dialog_height",650)),layout:"flex",direction:"column",align:"stretch",body:[{type:"listbox",name:"language",label:"Language",maxWidth:200,value:h(a),values:d(a)},{type:"textbox",name:"code",multiline:!0,spellcheck:!1,ariaLabel:"Code view",flex:1,style:"direction: ltr; text-align: left",classes:"monospace",value:g(a),autofocus:!0}],onSubmit:function(b){e(a,b.data.language,b.data.code)}})}}}),g("0",["1","2","3","4","5"],function(a,b,c,d,e){var f,g=e.trimArg;return b.add("codesample",function(b,h){function i(){var a,c=b.settings.codesample_content_css;b.inline&&f||!b.inline&&j||(b.inline?f=!0:j=!0,c!==!1&&(a=b.dom.create("link",{rel:"stylesheet",href:c?c:h+"/css/prism.css"}),b.getDoc().getElementsByTagName("head")[0].appendChild(a)))}var j,k=b.$;a.ceFalse&&(b.on("PreProcess",function(a){k("pre[contenteditable=false]",a.node).filter(g(e.isCodeSample)).each(function(a,b){var c=k(b),d=b.textContent;c.attr("class",k.trim(c.attr("class"))),c.removeAttr("contentEditable"),c.empty().append(k("").each(function(){this.textContent=d}))})}),b.on("SetContent",function(){var a=k("pre").filter(g(e.isCodeSample)).filter(function(a,b){return"false"!==b.contentEditable});a.length&&b.undoManager.transact(function(){a.each(function(a,d){k(d).find("br").each(function(a,c){c.parentNode.replaceChild(b.getDoc().createTextNode("\n"),c)}),d.contentEditable=!1,d.innerHTML=b.dom.encode(d.textContent),c.highlightElement(d),d.className=k.trim(d.className)})})}),b.addCommand("codesample",function(){var a=b.selection.getNode();b.selection.isCollapsed()||e.isCodeSample(a)?d.open(b):b.formatter.toggle("code")}),b.addButton("codesample",{cmd:"codesample",title:"Insert/Edit code sample"}),b.on("init",i))}),function(){}}),d("0")()}(); \ No newline at end of file diff --git a/external/tinymce/js/tinymce/plugins/colorpicker/plugin.min.js b/external/tinymce/js/tinymce/plugins/colorpicker/plugin.min.js new file mode 100644 index 00000000..35bfea21 --- /dev/null +++ b/external/tinymce/js/tinymce/plugins/colorpicker/plugin.min.js @@ -0,0 +1 @@ +!function(){var a={},b=function(b){for(var c=a[b],e=c.deps,f=c.defn,g=e.length,h=new Array(g),i=0;i-1},h=function(a,b){return t(a,b).isSome()},i=function(a,b){for(var c=[],d=0;d=0;c--){var d=a[c];b(d,c,a)}},n=function(a,b){for(var c=[],d=[],e=0,f=a.length;e=a.left&&b<=a.right&&c>=a.top&&c<=a.bottom},c=function(c,d,e){return!e.collapsed&&a.foldl(e.getClientRects(),function(a,e){return a||b(e,c,d)},!1)};return{isXYWithinRange:c}}),g("0",["1","2","3","4","5","6"],function(a,b,c,d,e,f){var g=a.DOM;return c.add("contextmenu",function(a){var c,h,i=a.settings.contextmenu_never_use_native,j=function(a){return a.ctrlKey&&!i},k=function(){return b.mac&&b.webkit},l=function(){return h===!0},m=function(a){return a&&"IMG"===a.nodeName},n=function(a,b){return m(a.target)&&f.isXYWithinRange(a.clientX,a.clientY,b)===!1};return a.on("mousedown",function(b){k()&&2===b.button&&!j(b)&&a.selection.isCollapsed()&&a.once("contextmenu",function(b){m(b.target)||a.selection.placeCaretAt(b.clientX,b.clientY)})}),a.on("contextmenu",function(b){var f;if(!j(b)){if(n(b,a.selection.getRng())&&a.selection.select(b.target),b.preventDefault(),f=a.settings.contextmenu||"link openlink image inserttable | cell row column deletetable",c)c.show();else{var i=[];e.each(f.split(/[ ,]/),function(b){var c=a.menuItems[b];"|"==b&&(c={text:b}),c&&(c.shortcut="",i.push(c))});for(var k=0;k'}),a+=""}),a+=""}var e=[["cool","cry","embarassed","foot-in-mouth"],["frown","innocent","kiss","laughing"],["money-mouth","sealed","smile","surprised"],["tongue-out","undecided","wink","yell"]];a.addButton("emoticons",{type:"panelbutton",panel:{role:"application",autohide:!0,html:d,onclick:function(b){var c=a.dom.getParent(b.target,"a");c&&(a.insertContent(''+c.getAttribute('),this.hide())}},tooltip:"Emoticons"})}),function(){}}),d("0")()}(); \ No newline at end of file diff --git a/external/tinymce/js/tinymce/plugins/fullpage/plugin.min.js b/external/tinymce/js/tinymce/plugins/fullpage/plugin.min.js new file mode 100644 index 00000000..6aa103dd --- /dev/null +++ b/external/tinymce/js/tinymce/plugins/fullpage/plugin.min.js @@ -0,0 +1 @@ +!function(){var a={},b=function(b){for(var c=a[b],e=c.deps,f=c.defn,g=e.length,h=new Array(g),i=0;i"})}),c},c=function(a){return a.replace(//g,function(a,b){return unescape(b)})};return{protectHtml:b,unprotectHtml:c}}),g("0",["1","2","3","4","5","6"],function(a,b,c,d,e,f){return d.add("fullpage",function(d){function g(){var a=h();d.windowManager.open({title:"Document properties",data:a,defaults:{type:"textbox",size:40},body:[{name:"title",label:"Title"},{name:"keywords",label:"Keywords"},{name:"description",label:"Description"},{name:"robots",label:"Robots"},{name:"author",label:"Author"},{name:"docencoding",label:"Encoding"}],onSubmit:function(b){i(e.extend(a,b.data))}})}function h(){function a(a,b){var c=a.attr(b);return c||""}var b,c,f=j(),g={};return g.fontface=d.getParam("fullpage_default_fontface",""),g.fontsize=d.getParam("fullpage_default_fontsize",""),b=f.firstChild,7==b.type&&(g.xml_pi=!0,c=/encoding="([^"]+)"/.exec(b.value),c&&(g.docencoding=c[1])),b=f.getAll("#doctype")[0],b&&(g.doctype=""),b=f.getAll("title")[0],b&&b.firstChild&&(g.title=b.firstChild.value),p(f.getAll("meta"),function(a){var b,c=a.attr("name"),d=a.attr("http-equiv");c?g[c.toLowerCase()]=a.attr("content"):"Content-Type"==d&&(b=/charset\s*=\s*(.*)\s*/gi.exec(a.attr("content")),b&&(g.docencoding=b[1]))}),b=f.getAll("html")[0],b&&(g.langcode=a(b,"lang")||a(b,"xml:lang")),g.stylesheets=[],e.each(f.getAll("link"),function(a){"stylesheet"==a.attr("rel")&&g.stylesheets.push(a.attr("href"))}),b=f.getAll("body")[0],b&&(g.langdir=a(b,"dir"),g.style=a(b,"style"),g.visited_color=a(b,"vlink"),g.link_color=a(b,"link"),g.active_color=a(b,"alink")),g}function i(a){function f(a,b,c){a.attr(b,c?c:void 0)}function g(a){i.firstChild?i.insert(a,i.firstChild):i.append(a)}var h,i,k,l,m,o=d.dom;h=j(),i=h.getAll("head")[0],i||(l=h.getAll("html")[0],i=new b("head",1),l.firstChild?l.insert(i,l.firstChild,!0):l.append(i)),l=h.firstChild,a.xml_pi?(m='version="1.0"',a.docencoding&&(m+=' encoding="'+a.docencoding+'"'),7!=l.type&&(l=new b("xml",7),h.insert(l,h.firstChild,!0)),l.value=m):l&&7==l.type&&l.remove(),l=h.getAll("#doctype")[0],a.doctype?(l||(l=new b("#doctype",10),a.xml_pi?h.insert(l,h.firstChild):g(l)),l.value=a.doctype.substring(9,a.doctype.length-1)):l&&l.remove(),l=null,p(h.getAll("meta"),function(a){"Content-Type"==a.attr("http-equiv")&&(l=a)}),a.docencoding?(l||(l=new b("meta",1),l.attr("http-equiv","Content-Type"),l.shortEnded=!0,g(l)),l.attr("content","text/html; charset="+a.docencoding)):l&&l.remove(),l=h.getAll("title")[0],a.title?(l?l.empty():(l=new b("title",1),g(l)),l.append(new b("#text",3)).value=a.title):l&&l.remove(),p("keywords,description,author,copyright,robots".split(","),function(c){var d,e,f=h.getAll("meta"),i=a[c];for(d=0;d"))}function j(){return new a({validate:!1,root_name:"#document"}).parse(n)}function k(a){function b(a){return a.replace(/<\/?[A-Z]+/g,function(a){return a.toLowerCase()})}var c,g,h,i,k,m="",q=d.dom;if(!(a.selection||(h=f.protectHtml(d.settings.protect,a.content),"raw"==a.format&&n||a.source_view&&d.getParam("fullpage_hide_in_source_view")))){0!==h.length||a.source_view||(h=e.trim(n)+"\n"+e.trim(h)+"\n"+e.trim(o)),h=h.replace(/<(\/?)BODY/gi,"<$1body"),c=h.indexOf("",c),n=b(h.substring(0,c+1)),g=h.indexOf("\n"),i=j(),p(i.getAll("style"),function(a){a.firstChild&&(m+=a.firstChild.value)}),k=i.getAll("body")[0],k&&q.setAttribs(d.getBody(),{style:k.attr("style")||"",dir:k.attr("dir")||"",vLink:k.attr("vlink")||"",link:k.attr("link")||"",aLink:k.attr("alink")||""}),q.remove("fullpage_styles");var r=d.getDoc().getElementsByTagName("head")[0];m&&(q.add(r,"style",{id:"fullpage_styles"},m),k=q.get("fullpage_styles"),k.styleSheet&&(k.styleSheet.cssText=m));var s={};e.each(r.getElementsByTagName("link"),function(a){"stylesheet"==a.rel&&a.getAttribute("data-mce-fullpage")&&(s[a.href]=a)}),e.each(i.getAll("link"),function(a){var b=a.attr("href");return!b||(s[b]||"stylesheet"!=a.attr("rel")||q.add(r,"link",{rel:"stylesheet",text:"text/css",href:b,"data-mce-fullpage":"1"}),void delete s[b])}),e.each(s,function(a){a.parentNode.removeChild(a)})}}function l(){var a,b="",c="";return d.getParam("fullpage_default_xml_pi")&&(b+='\n'),b+=d.getParam("fullpage_default_doctype",""),b+="\n\n\n",(a=d.getParam("fullpage_default_title"))&&(b+=""+a+"\n"),(a=d.getParam("fullpage_default_encoding"))&&(b+='\n'),(a=d.getParam("fullpage_default_font_family"))&&(c+="font-family: "+a+";"),(a=d.getParam("fullpage_default_font_size"))&&(c+="font-size: "+a+";"),(a=d.getParam("fullpage_default_text_color"))&&(c+="color: "+a+";"),b+="\n\n"}function m(a){a.selection||a.source_view&&d.getParam("fullpage_hide_in_source_view")||(a.content=f.unprotectHtml(e.trim(n)+"\n"+e.trim(a.content)+"\n"+e.trim(o)))}var n,o,p=e.each;d.addCommand("mceFullPageProperties",g),d.addButton("fullpage",{title:"Document properties",cmd:"mceFullPageProperties"}),d.addMenuItem("fullpage",{text:"Document properties",cmd:"mceFullPageProperties",context:"file"}),d.on("BeforeSetContent",k),d.on("GetContent",m)}),function(){}}),d("0")()}(); \ No newline at end of file diff --git a/external/tinymce/js/tinymce/plugins/fullscreen/plugin.min.js b/external/tinymce/js/tinymce/plugins/fullscreen/plugin.min.js new file mode 100644 index 00000000..3db21765 --- /dev/null +++ b/external/tinymce/js/tinymce/plugins/fullscreen/plugin.min.js @@ -0,0 +1 @@ +!function(){var a={},b=function(b){for(var c=a[b],e=c.deps,f=c.defn,g=e.length,h=new Array(g),i=0;i-1},h=function(a,b){return t(a,b).isSome()},i=function(a,b){for(var c=[],d=0;d=0;c--){var d=a[c];b(d,c,a)}},n=function(a,b){for(var c=[],d=[],e=0,f=a.length;e Ctrl + Shift + P",action:"Focus to contextual toolbar"},{shortcut:b+" + K",action:"Insert link (if link plugin activated)"},{shortcut:b+" + S",action:"Save (if save plugin activated)"},{shortcut:b+" + F",action:"Find (if searchreplace plugin activated)"}];return{shortcuts:d}}),g("5",["8","9"],function(a,b){var c=function(){var c=function(a){return'aria-label="Action: '+a.action+", Shortcut: "+a.shortcut.replace(/Ctrl/g,"Control")+'"'},d=a.map(b.shortcuts,function(a){return'"+a.action+""+a.shortcut+""}).join("");return{title:"Handy Shortcuts",type:"container",style:"overflow-y: auto; overflow-x: hidden; max-height: 250px",items:[{type:"container",html:'
'+d+"
ActionShortcut
"}]}};return{makeTab:c}}),g("a",["e","j"],function(a,b){var c=function(){var a=b.keys,c=function(a){var b=[];for(var c in a)a.hasOwnProperty(c)&&b.push(c);return b};return void 0===a?c:a}(),d=function(a,b){for(var d=c(a),e=0,f=d.length;e${name}'),h=function(a,b){return c.find(f.urls,function(a){return a.key===b}).fold(function(){var c=a.plugins[b].getMetadata;return"function"==typeof c?g(c()):b},function(a){return g({name:a.name,url:"https://www.tinymce.com/docs/plugins/"+a.key})})},i=function(a){var e=b.keys(a.plugins);return void 0===a.settings.forced_plugins?e:c.filter(e,d.not(d.curry(c.contains,a.settings.forced_plugins)))},j=function(a){var b=i(a),d=c.map(b,function(b){return"
  • "+h(a,b)+"
  • "}),e=d.length,f=d.join("");return"

    Plugins installed ("+e+"):

      "+f+"
    "},k=function(a){return{type:"container",html:'
    '+j(a)+"
    ",flex:1}},l=function(){return{type:"container",html:'

    Premium plugins:

    • PowerPaste
    • Spell Checker Pro
    • Accessibility Checker
    • Advanced Code Editor
    • Enhanced Media Embed
    • Link Checker

    Learn more...

    ',flex:1}},m=function(a){return{title:"Plugins",type:"container",style:"overflow-y: auto; overflow-x: hidden;",layout:"flex",padding:10,spacing:10,items:[k(a),l()]}};return{makeTab:m}}),g("7",["4"],function(a){var b=function(a,b){return 0===a.indexOf("@")?"X.X.X":a+"."+b},c=function(){var c=b(a.majorVersion,a.minorVersion),d='TinyMCE '+c+"";return[{type:"label",html:"You are using "+d},{type:"spacer",flex:1},{text:"Close",onclick:function(){this.parent().parent().close()}}]};return{makeRow:c}}),g("2",["4","5","6","7"],function(a,b,c,d){var e=function(a,e){return function(){a.windowManager.open({title:"Help",bodyType:"tabpanel",layout:"flex",body:[b.makeTab(),c.makeTab(a,e)],buttons:d.makeRow(),onPostRender:function(){var a=this.getEl("title");a.innerHTML='TinyMCE Logo'}})}};return{openDialog:e}}),g("0",["1","2"],function(a,b){var c=function(a,c){a.addButton("help",{icon:"help",onclick:b.openDialog(a,c)}),a.addMenuItem("Help",{text:"Help",icon:"help",context:"view",onclick:b.openDialog(a,c)}),a.addCommand("mceHelp",b.openDialog(a,c)),a.shortcuts.add("Alt+0","Open help dialog",b.openDialog(a,c))};return a.add("help",c),function(){}}),d("0")()}(); \ No newline at end of file diff --git a/external/tinymce/js/tinymce/plugins/hr/plugin.min.js b/external/tinymce/js/tinymce/plugins/hr/plugin.min.js new file mode 100644 index 00000000..6c0dfa44 --- /dev/null +++ b/external/tinymce/js/tinymce/plugins/hr/plugin.min.js @@ -0,0 +1 @@ +!function(){var a={},b=function(b){for(var c=a[b],e=c.deps,f=c.defn,g=e.length,h=new Array(g),i=0;i")}),a.addButton("hr",{icon:"hr",tooltip:"Horizontal line",cmd:"InsertHorizontalRule"}),a.addMenuItem("hr",{icon:"hr",text:"Horizontal line",cmd:"InsertHorizontalRule",context:"insert"})}),function(){}}),d("0")()}(); \ No newline at end of file diff --git a/external/tinymce/js/tinymce/plugins/image/plugin.min.js b/external/tinymce/js/tinymce/plugins/image/plugin.min.js new file mode 100644 index 00000000..1374178a --- /dev/null +++ b/external/tinymce/js/tinymce/plugins/image/plugin.min.js @@ -0,0 +1 @@ +!function(){var a={},b=function(b){for(var c=a[b],e=c.deps,f=c.defn,g=e.length,h=new Array(g),i=0;i=300?void e("HTTP Error: "+g.status):(a=JSON.parse(g.responseText),a&&"string"==typeof a.location?void b(d(c.basePath,a.location)):void e("Invalid JSON: "+g.responseText))},h=new FormData,h.append("file",a.blob(),a.filename()),g.send(h)}function f(b,c){return new a(function(a,d){try{c(b,a,d,i)}catch(a){d(a.message)}})}function g(a){return a===e}function h(b){return!c.url&&g(c.handler)?a.reject("Upload url missng from the settings."):f(b,c.handler)}var i=function(){};return c=b.extend({credentials:!1,handler:e},c),{upload:h}}}),h("b",Math),g("a",["2","b","d"],function(a,b,c){var d=function(a,d){function e(a,b){f.parentNode&&f.parentNode.removeChild(f),d({width:a,height:b})}var f=c.createElement("img");f.onload=function(){e(b.max(f.width,f.clientWidth),b.max(f.height,f.clientHeight))},f.onerror=function(){e()};var g=f.style;g.visibility="hidden",g.position="fixed",g.bottom=g.left=0,g.width=g.height="auto",c.body.appendChild(f),f.src=a},e=function(b,c,d){function e(b,d){return d=d||[],a.each(b,function(a){var b={text:a.text||a.title};a.menu?b.menu=e(a.menu):(b.value=a.value,c(b)),d.push(b)}),d}return e(b,d||[])},f=function(a){return a&&(a=a.replace(/px$/,"")),a},g=function(a){return a.length>0&&/^[0-9]+$/.test(a)&&(a+="px"),a},h=function(a){if(a.margin){var b=a.margin.split(" ");switch(b.length){case 1:a["margin-top"]=a["margin-top"]||b[0],a["margin-right"]=a["margin-right"]||b[0],a["margin-bottom"]=a["margin-bottom"]||b[0],a["margin-left"]=a["margin-left"]||b[0];break;case 2:a["margin-top"]=a["margin-top"]||b[0],a["margin-right"]=a["margin-right"]||b[1],a["margin-bottom"]=a["margin-bottom"]||b[0],a["margin-left"]=a["margin-left"]||b[1];break;case 3:a["margin-top"]=a["margin-top"]||b[0],a["margin-right"]=a["margin-right"]||b[1],a["margin-bottom"]=a["margin-bottom"]||b[2],a["margin-left"]=a["margin-left"]||b[1];break;case 4:a["margin-top"]=a["margin-top"]||b[0],a["margin-right"]=a["margin-right"]||b[1],a["margin-bottom"]=a["margin-bottom"]||b[2],a["margin-left"]=a["margin-left"]||b[3]}delete a.margin}return a};return{getImageSize:d,buildListItems:e,removePixelSuffix:f,addPixelSuffix:g,mergeMargins:h}}),h("c",RegExp),g("3",["5","6","2","7","8","9","a","b","c","d"],function(a,b,c,d,e,f,g,h,i,j){return function(j){function k(a){var c=j.settings.image_list;"string"==typeof c?d.send({url:c,success:function(c){a(b.parse(c))}}):"function"==typeof c?c(a):a(c)}function l(b){function d(){var a=new e(s.getEl()),b=this.value(),c=new f({url:B.images_upload_url,basePath:B.images_upload_base_path,credentials:B.images_upload_credentials,handler:B.images_upload_handler}),d=j.editorUpload.blobCache.create({blob:b,name:b.name?b.name.replace(/\.[^\.]+$/,""):null,base64:"data:image/fake;base64,="}),g=function(){a.hide(),URL.revokeObjectURL(d.blobUri())};return a.show(),c.upload(d).then(function(a){var b=s.find("#src");return b.value(a),s.find("tabpanel")[0].activateTab(0),b.fire("change"),g(),a},function(a){j.windowManager.alert(a),g()})}function k(a){return j.schema.getTextBlockElements()[a.nodeName]}function l(){var a,b,c,d;a=s.find("#width")[0],b=s.find("#height")[0],a&&b&&(c=a.value(),d=b.value(),s.find("#constrain")[0].checked()&&v&&w&&c&&d&&(v!=c?(d=h.round(c/v*d),isNaN(d)||b.value(d)):(c=h.round(d/w*c),isNaN(c)||a.value(c))),v=c,w=d)}function m(){if(j.settings.image_advtab){var a=s.toJSON(),b=A.parseStyle(a.style);b=g.mergeMargins(b),a.vspace&&(b["margin-top"]=b["margin-bottom"]=g.addPixelSuffix(a.vspace)),a.hspace&&(b["margin-left"]=b["margin-right"]=g.addPixelSuffix(a.hspace)),a.border&&(b["border-width"]=g.addPixelSuffix(a.border)),s.find("#style").value(A.serializeStyle(A.parseStyle(A.serializeStyle(b))))}}function n(){if(j.settings.image_advtab){var a=s.toJSON(),b=A.parseStyle(a.style);s.find("#vspace").value(""),s.find("#hspace").value(""),b=g.mergeMargins(b),(b["margin-top"]&&b["margin-bottom"]||b["margin-right"]&&b["margin-left"])&&(b["margin-top"]===b["margin-bottom"]?s.find("#vspace").value(g.removePixelSuffix(b["margin-top"])):s.find("#vspace").value(""),b["margin-right"]===b["margin-left"]?s.find("#hspace").value(g.removePixelSuffix(b["margin-right"])):s.find("#hspace").value("")),b["border-width"]&&s.find("#border").value(g.removePixelSuffix(b["border-width"])),s.find("#style").value(A.serializeStyle(A.parseStyle(A.serializeStyle(b))))}}function o(a){function b(){a.onload=a.onerror=null,j.selection&&(j.selection.select(a),j.nodeChanged())}a.onload=function(){z.width||z.height||!C||A.setAttribs(a,{width:a.clientWidth,height:a.clientHeight}),b()},a.onerror=b}function p(){var a,b;m(),l(),z=c.extend(z,s.toJSON()),z.alt||(z.alt=""),z.title||(z.title=""),""===z.width&&(z.width=null),""===z.height&&(z.height=null),z.style||(z.style=null),z={src:z.src,alt:z.alt,title:z.title,width:z.width,height:z.height,style:z.style,caption:z.caption,"class":z["class"]},j.undoManager.transact(function(){if(!z.src)return void(t&&(A.remove(t),j.focus(),j.nodeChanged()));if(""===z.title&&(z.title=null),t?A.setAttribs(t,z):(z.id="__mcenew",j.focus(),j.selection.setContent(A.createHTML("img",z)),t=A.get("__mcenew"),A.setAttrib(t,"id",null)),j.editorUpload.uploadImagesAuto(),z.caption===!1&&A.is(t.parentNode,"figure.image")&&(a=t.parentNode,A.insertAfter(t,a),A.remove(a)),z.caption!==!0)o(t);else if(!A.is(t.parentNode,"figure.image")){b=t,t=t.cloneNode(!0),a=A.create("figure",{"class":"image"}),a.appendChild(t),a.appendChild(A.create("figcaption",{contentEditable:!0},"Caption")),a.contentEditable=!1;var c=A.getParent(b,k);c?A.split(c,b,a):A.replace(a,b),j.selection.select(a)}})}function q(a){var b,d,e,f=a.meta||{};x&&x.value(j.convertURL(this.value(),"src")),c.each(f,function(a,b){s.find("#"+b).value(a)}),f.width||f.height||(b=j.convertURL(this.value(),"src"),d=j.settings.image_prepend_url,e=new i("^(?:[a-z]+:)?//","i"),d&&!e.test(b)&&b.substring(0,d.length)!==d&&(b=d+b),this.value(b),g.getImageSize(j.documentBaseURI.toAbsolute(this.value()),function(a){a.width&&a.height&&C&&(v=a.width,w=a.height,s.find("#width").value(v),s.find("#height").value(w))}))}function r(a){a.meta=s.toJSON()}var s,t,u,v,w,x,y,z={},A=j.dom,B=j.settings,C=B.image_dimensions!==!1;t=j.selection.getNode(),u=A.getParent(t,"figure.image"),u&&(t=A.select("img",u)[0]),t&&("IMG"!=t.nodeName||t.getAttribute("data-mce-object")||t.getAttribute("data-mce-placeholder"))&&(t=null),t&&(v=A.getAttrib(t,"width"),w=A.getAttrib(t,"height"),z={src:A.getAttrib(t,"src"),alt:A.getAttrib(t,"alt"),title:A.getAttrib(t,"title"),"class":A.getAttrib(t,"class"),width:v,height:w,caption:!!u}),b&&(x={type:"listbox",label:"Image list",values:g.buildListItems(b,function(a){a.value=j.convertURL(a.value||a.url,"src")},[{text:"None",value:""}]),value:z.src&&j.convertURL(z.src,"src"),onselect:function(a){var b=s.find("#alt");(!b.value()||a.lastControl&&b.value()==a.lastControl.text())&&b.value(a.control.text()),s.find("#src").value(a.control.value()).fire("change")},onPostRender:function(){x=this}}),j.settings.image_class_list&&(y={name:"class",type:"listbox",label:"Class",values:g.buildListItems(j.settings.image_class_list,function(a){a.value&&(a.textStyle=function(){return j.formatter.getCssText({inline:"img",classes:[a.value]})})})});var D=[{name:"src",type:"filepicker",filetype:"image",label:"Source",autofocus:!0,onchange:q,onbeforecall:r},x];if(j.settings.image_description!==!1&&D.push({name:"alt",type:"textbox",label:"Image description"}),j.settings.image_title&&D.push({name:"title",type:"textbox",label:"Image Title"}),C&&D.push({type:"container",label:"Dimensions",layout:"flex",direction:"row",align:"center",spacing:5,items:[{name:"width",type:"textbox",maxLength:5,size:3,onchange:l,ariaLabel:"Width"},{type:"label",text:"x"},{name:"height",type:"textbox",maxLength:5,size:3,onchange:l,ariaLabel:"Height"},{name:"constrain",type:"checkbox",checked:!0,text:"Constrain proportions"}]}),D.push(y),j.settings.image_caption&&a.ceFalse&&D.push({name:"caption",type:"checkbox",label:"Caption"}),j.settings.image_advtab||j.settings.images_upload_url){var E=[{title:"General",type:"form",items:D}];if(j.settings.image_advtab&&(t&&(t.style.marginLeft&&t.style.marginRight&&t.style.marginLeft===t.style.marginRight&&(z.hspace=g.removePixelSuffix(t.style.marginLeft)),t.style.marginTop&&t.style.marginBottom&&t.style.marginTop===t.style.marginBottom&&(z.vspace=g.removePixelSuffix(t.style.marginTop)),t.style.borderWidth&&(z.border=g.removePixelSuffix(t.style.borderWidth)),z.style=j.dom.serializeStyle(j.dom.parseStyle(j.dom.getAttrib(t,"style")))),E.push({title:"Advanced",type:"form",pack:"start",items:[{label:"Style",name:"style",type:"textbox",onchange:n},{type:"form",layout:"grid",packV:"start",columns:2,padding:0,alignH:["left","right"],defaults:{type:"textbox",maxWidth:50,onchange:m},items:[{label:"Vertical space",name:"vspace"},{label:"Horizontal space",name:"hspace"},{label:"Border",name:"border"}]}]})),j.settings.images_upload_url){var F=".jpg,.jpeg,.png,.gif",G={title:"Upload",type:"form",layout:"flex",direction:"column",align:"stretch",padding:"20 20 20 20",items:[{type:"container",layout:"flex",direction:"column",align:"center",spacing:10,items:[{text:"Browse for an image",type:"browsebutton",accept:F,onchange:d},{text:"OR",type:"label"}]},{text:"Drop an image here",type:"dropzone",accept:F,height:100,onchange:d}]};E.push(G)}s=j.windowManager.open({title:"Insert/edit image",data:z,bodyType:"tabpanel",body:E,onSubmit:p})}else s=j.windowManager.open({title:"Insert/edit image",data:z,body:D,onSubmit:p})}function m(){k(l)}return{open:m}}}),g("0",["1","2","3"],function(a,b,c){return a.add("image",function(a){a.on("preInit",function(){function c(a){var b=a.attr("class");return b&&/\bimage\b/.test(b)}function d(a){return function(d){function e(b){b.attr("contenteditable",a?"true":null)}for(var f,g=d.length;g--;)f=d[g],c(f)&&(f.attr("contenteditable",a?"false":null),b.each(f.getAll("figcaption"),e))}}a.parser.addNodeFilter("figure",d(!0)),a.serializer.addNodeFilter("figure",d(!1))}),a.addButton("image",{icon:"image",tooltip:"Insert/edit image",onclick:c(a).open,stateSelector:"img:not([data-mce-object],[data-mce-placeholder]),figure.image"}),a.addMenuItem("image",{icon:"image",text:"Image",onclick:c(a).open,context:"insert",prependToContext:!0}),a.addCommand("mceImage",c(a).open)}),function(){}}),d("0")()}(); \ No newline at end of file diff --git a/external/tinymce/js/tinymce/plugins/imagetools/plugin.min.js b/external/tinymce/js/tinymce/plugins/imagetools/plugin.min.js new file mode 100644 index 00000000..d4d3605d --- /dev/null +++ b/external/tinymce/js/tinymce/plugins/imagetools/plugin.min.js @@ -0,0 +1,2 @@ +!function(){var a={},b=function(b){for(var c=a[b],e=c.deps,f=c.defn,g=e.length,h=new Array(g),i=0;ic?a=c:a0?3*d:d),f=.3086,g=.6094,h=.082,c(b,[f*(1-e)+e,g*(1-e),h*(1-e),0,0,f*(1-e),g*(1-e)+e,h*(1-e),0,0,f*(1-e),g*(1-e),h*(1-e)+e,0,0,0,0,0,1,0,0,0,0,0,1])}function g(b,d){var e,f,g,h,i;return d=a(d,-180,180)/180*Math.PI,e=Math.cos(d),f=Math.sin(d),g=.213,h=.715,i=.072,c(b,[g+e*(1-g)+f*-g,h+e*-h+f*-h,i+e*-i+f*(1-i),0,0,g+e*-g+.143*f,h+e*(1-h)+.14*f,i+e*-i+f*-.283,0,0,g+e*-g+f*-(1-g),h+e*-h+f*h,i+e*(1-i)+f*i,0,0,0,0,0,1,0,0,0,0,0,1])}function h(b,d){return d=a(255*d,-255,255),c(b,[1,0,0,0,d,0,1,0,0,d,0,0,1,0,d,0,0,0,1,0,0,0,0,0,1])}function i(b,d,e,f){return d=a(d,0,2),e=a(e,0,2),f=a(f,0,2),c(b,[d,0,0,0,0,0,e,0,0,0,0,0,f,0,0,0,0,0,1,0,0,0,0,0,1])}function j(b,e){return e=a(e,0,1),c(b,d([.393,.769,.189,0,0,.349,.686,.168,0,0,.272,.534,.131,0,0,0,0,0,1,0,0,0,0,0,1],e))}function k(b,e){return e=a(e,0,1),c(b,d([.33,.34,.33,0,0,.33,.34,.33,0,0,.33,.34,.33,0,0,0,0,0,1,0,0,0,0,0,1],e))}var l=[0,.01,.02,.04,.05,.06,.07,.08,.1,.11,.12,.14,.15,.16,.17,.18,.2,.21,.22,.24,.25,.27,.28,.3,.32,.34,.36,.38,.4,.42,.44,.46,.48,.5,.53,.56,.59,.62,.65,.68,.71,.74,.77,.8,.83,.86,.89,.92,.95,.98,1,1.06,1.12,1.18,1.24,1.3,1.36,1.42,1.48,1.54,1.6,1.66,1.72,1.78,1.84,1.9,1.96,2,2.12,2.25,2.37,2.5,2.62,2.75,2.87,3,3.2,3.4,3.6,3.8,4,4.3,4.7,4.9,5,5.5,6,6.5,6.8,7,7.3,7.5,7.8,8,8.4,8.7,9,9.4,9.6,9.8,10];return{identity:b,adjust:d,multiply:c,adjustContrast:e,adjustBrightness:h,adjustSaturation:f,adjustHue:g,adjustColors:i,adjustSepia:j,adjustGrayscale:k}}),g("e",["q","d","t"],function(a,b,c){function d(c,d){function e(a,b){var c,d,e,f,g,h=a.data,i=b[0],j=b[1],k=b[2],l=b[3],m=b[4],n=b[5],o=b[6],p=b[7],q=b[8],r=b[9],s=b[10],t=b[11],u=b[12],v=b[13],w=b[14],x=b[15],y=b[16],z=b[17],A=b[18],B=b[19];for(g=0;gc?a=c:a2)&&(i=i<.5?.5:2,k=!0),(j<.5||j>2)&&(j=j<.5?.5:2,k=!0);var l=f(a,i,j);return k?l.then(function(a){return e(a,b,c)}):l}function f(b,e,f){return new a(function(a){var g=d.getWidth(b),h=d.getHeight(b),i=Math.floor(g*e),j=Math.floor(h*f),k=c.create(i,j),l=c.get2dContext(k);l.drawImage(b,0,0,g,h,0,0,i,j),a(k)})}return{scale:e}}),g("f",["q","d","u"],function(a,b,c){function d(c,d){var e=c.toCanvas(),f=a.create(e.width,e.height),g=a.get2dContext(f),h=0,i=0;return d=d<0?360+d:d,90!=d&&270!=d||a.resize(f,f.height,f.width),90!=d&&180!=d||(h=f.width),270!=d&&180!=d||(i=f.height),g.translate(h,i),g.rotate(d*Math.PI/180),g.drawImage(e,0,0),b.fromCanvas(f,c.getType())}function e(c,d){var e=c.toCanvas(),f=a.create(e.width,e.height),g=a.get2dContext(f);return"v"==d?(g.scale(1,-1),g.drawImage(e,0,-f.height)):(g.scale(-1,1),g.drawImage(e,-f.width,0)),b.fromCanvas(f,c.getType())}function f(c,d,e,f,g){var h=c.toCanvas(),i=a.create(f,g),j=a.get2dContext(i);return j.drawImage(h,-d,-e),b.fromCanvas(i,c.getType())}function g(a,d,e){return c.scale(a.toCanvas(),d,e).then(function(c){return b.fromCanvas(c,a.getType())})}return{rotate:d,flip:e,crop:f,resize:g}}),g("2",["e","f"],function(a,b){var c=function(b){return a.invert(b)},d=function(b){return a.sharpen(b)},e=function(b){return a.emboss(b)},f=function(b,c){return a.gamma(b,c)},g=function(b,c){return a.exposure(b,c)},h=function(b,c,d,e){return a.colorize(b,c,d,e)},i=function(b,c){return a.brightness(b,c)},j=function(b,c){return a.hue(b,c)},k=function(b,c){return a.saturate(b,c)},l=function(b,c){return a.contrast(b,c)},m=function(b,c){return a.grayscale(b,c)},n=function(b,c){return a.sepia(b,c)},o=function(a,c){return b.flip(a,c)},p=function(a,c,d,e,f){return b.crop(a,c,d,e,f)},q=function(a,c,d){return b.resize(a,c,d)},r=function(a,c){return b.rotate(a,c)};return{invert:c,sharpen:d,emboss:e,brightness:i,hue:j,saturate:k,contrast:l,grayscale:m,sepia:n,colorize:h,gamma:f,exposure:g,flip:o,crop:p,resize:q,rotate:r}}),h("g",tinymce.util.Tools.resolve),g("3",["g"],function(a){return a("tinymce.Env")}),g("4",["g"],function(a){return a("tinymce.PluginManager")}),g("5",["g"],function(a){return a("tinymce.util.Delay")}),g("6",["g"],function(a){return a("tinymce.util.Promise")}),g("7",["g"],function(a){return a("tinymce.util.Tools")}),g("8",["g"],function(a){return a("tinymce.util.URI")}),g("9",[],function(){function a(a){function b(a){return/^[0-9\.]+px$/.test(a)}var c,d;return c=a.style.width,d=a.style.height,c||d?b(c)&&b(d)?{w:parseInt(c,10),h:parseInt(d,10)}:null:(c=a.width,d=a.height,c&&d?{w:parseInt(c,10),h:parseInt(d,10)}:null)}function b(a,b){var c,d;b&&(c=a.style.width,d=a.style.height,(c||d)&&(a.style.width=b.w+"px",a.style.height=b.h+"px",a.removeAttribute("data-mce-style")),c=a.width,d=a.height,(c||d)&&(a.setAttribute("width",b.w),a.setAttribute("height",b.h)))}function c(a){return{w:a.naturalWidth,h:a.naturalHeight}}return{getImageSize:a,setImageSize:b,getNaturalImageSize:c}}),h("12",Array),h("13",Error),g("w",["12","13"],function(a,b){var c=function(){},d=function(a,b){return function(){return a(b.apply(null,arguments))}},e=function(a){return function(){return a}},f=function(a){return a},g=function(a,b){return a===b},h=function(b){for(var c=new a(arguments.length-1),d=1;d-1},h=function(a,b){return t(a,b).isSome()},i=function(a,b){for(var c=[],d=0;d=0;c--){var d=a[c];b(d,c,a)}},n=function(a,b){for(var c=[],d=[],e=0,f=a.length;e=300?c.handleHttpError(b.status):a.resolve(b.blob)})}var f=function(a,b){var c=a.indexOf("?")===-1?"?":"&";return/[?&]apiKey=/.test(a)||!b?a:a+c+"apiKey="+encodeURIComponent(b)},g=function(b,e){return d.requestUrlAsBlob(f(b,e),{"Content-Type":"application/json;charset=UTF-8","tiny-api-key":e}).then(function(b){return b.status<200||b.status>=300?c.handleServiceErrorResponse(b.status,b.blob):a.resolve(b.blob)})},h=function(a,b){return b?g(a,b):e(a)};return{getUrl:h}}),g("j",["g"],function(a){return a("tinymce.dom.DOMUtils")}),g("k",["g"],function(a){return a("tinymce.ui.Container")}),g("l",["g"],function(a){return a("tinymce.ui.Form")}),g("x",["g"],function(a){return a("tinymce.geom.Rect")}),g("y",["g"],function(a){return a("tinymce.ui.Control")}),g("z",["g"],function(a){return a("tinymce.ui.DragHelper")}),g("15",["g"],function(a){return a("tinymce.dom.DomQuery")}),g("16",["g"],function(a){return a("tinymce.util.Observable")}),g("17",["g"],function(a){return a("tinymce.util.VK")}),g("10",["15","z","x","7","16","17"],function(a,b,c,d,e,f){var g=0;return function(h,i,j,k,l){function m(a,b){return{x:b.x+a.x,y:b.y+a.y,w:b.w,h:b.h}}function n(a,b){return{x:b.x-a.x,y:b.y-a.y,w:b.w,h:b.h}}function o(){return n(j,h)}function p(a,b,d,e){var f,g,i,k,l;f=b.x,g=b.y,i=b.w,k=b.h,f+=d*a.deltaX,g+=e*a.deltaY,i+=d*a.deltaW,k+=e*a.deltaH,i<20&&(i=20),k<20&&(k=20),l=h=c.clamp({x:f,y:g,w:i,h:k},j,"move"==a.name),l=n(j,l),y.fire("updateRect",{rect:l}),v(l)}function q(){function c(a){var c;return new b(D,{document:k.ownerDocument,handle:D+"-"+a.name,start:function(){c=h},drag:function(b){p(a,c,b.deltaX,b.deltaY)}})}a('
    ').appendTo(k),d.each(B,function(b){a("#"+D,k).append('").css({position:"absolute",top:0,left:0,width:p.width,height:p.height,zIndex:2147483647,opacity:1e-4,cursor:o}).appendTo(n.body),a(n).on("mousemove touchmove",k).on("mouseup touchend",j),e.start(d)},k=function(a){return c(a),a.button!==h?j(a):(a.deltaX=a.screenX-l,a.deltaY=a.screenY-m,a.preventDefault(),void e.drag(a))},j=function(b){c(b),a(n).off("mousemove touchmove",k).off("mouseup touchend",j),g.remove(),e.stop&&e.stop(b)},this.destroy=function(){a(f()).off()},a(f()).on("mousedown touchstart",i)}}),g("2v",["d","2u"],function(a,b){"use strict";return{init:function(){var a=this;a.on("repaint",a.renderScroll)},renderScroll:function(){function c(){function b(b,g,h,i,j,k){var l,m,n,o,p,q,r,s,t;if(m=e.getEl("scroll"+b)){if(s=g.toLowerCase(),t=h.toLowerCase(),a(e.getEl("absend")).css(s,e.layoutRect()[i]-1),!j)return void a(m).css("display","none");a(m).css("display","block"),l=e.getEl("body"),n=e.getEl("scroll"+b+"t"),o=l["client"+h]-2*f,o-=c&&d?m["client"+k]:0,p=l["scroll"+h],q=o/p,r={},r[s]=l["offset"+g]+f,r[t]=o,a(m).css(r),r={},r[s]=l["scroll"+g]*q,r[t]=o*q,a(n).css(r)}}var c,d,g;g=e.getEl("body"),c=g.scrollWidth>g.clientWidth,d=g.scrollHeight>g.clientHeight,b("h","Left","Width","contentW",c,"Height"),b("v","Top","Height","contentH",d,"Width")}function d(){function c(c,d,g,h,i){var j,k=e._id+"-scroll"+c,l=e.classPrefix;a(e.getEl()).append('
    '),e.draghelper=new b(k+"t",{start:function(){j=e.getEl("body")["scroll"+d],a("#"+k).addClass(l+"active")},drag:function(a){var b,k,l,m,n=e.layoutRect();k=n.contentW>n.innerW,l=n.contentH>n.innerH,m=e.getEl("body")["client"+g]-2*f,m-=k&&l?e.getEl("scroll"+c)["client"+i]:0,b=m/e.getEl("body")["scroll"+g],e.getEl("body")["scroll"+d]=j+a["delta"+h]/b},stop:function(){a("#"+k).removeClass(l+"active")}})}e.classes.add("scroll"),c("v","Top","Height","Y","Width"),c("h","Left","Width","X","Height")}var e=this,f=2;e.settings.autoScroll&&(e._hasScroll||(e._hasScroll=!0,d(),e.on("wheel",function(a){var b=e.getEl("body");b.scrollLeft+=10*(a.deltaX||0),b.scrollTop+=10*a.deltaY,c()}),a(e.getEl("body")).on("scroll",c)),c())}}}),g("2w",["2t","2v"],function(a,b){"use strict";return a.extend({Defaults:{layout:"fit",containerCls:"panel"},Mixins:[b],renderHtml:function(){var a=this,b=a._layout,c=a.settings.html;return a.preRender(),b.preRender(a),"undefined"==typeof c?c='
    '+b.renderHtml(a)+"
    ":("function"==typeof c&&(c=c.call(a)),a._hasBody=!1),'
    '+(a._preBodyHtml||"")+c+"
    "}})}),g("2x",["2c"],function(a){"use strict";function b(b,c,d){var e,f,g,h,i,j,k,l,m,n;return m=a.getViewPort(),f=a.getPos(c),g=f.x,h=f.y,b.state.get("fixed")&&"static"==a.getRuntimeStyle(document.body,"position")&&(g-=m.x,h-=m.y),e=b.getEl(),n=a.getSize(e),i=n.width,j=n.height,n=a.getSize(c),k=n.width,l=n.height,d=(d||"").split(""),"b"===d[0]&&(h+=l),"r"===d[1]&&(g+=k),"c"===d[0]&&(h+=Math.round(l/2)),"c"===d[1]&&(g+=Math.round(k/2)),"b"===d[3]&&(h-=j),"r"===d[4]&&(g-=i),"c"===d[3]&&(h-=Math.round(j/2)),"c"===d[4]&&(g-=Math.round(i/2)),{x:g,y:h,w:i,h:j}}return{testMoveRel:function(c,d){for(var e=a.getViewPort(),f=0;f0&&g.x+g.w0&&g.y+g.he.x&&g.x+g.we.y&&g.y+g.hb?(a=b-c,a<0?0:a):a}var e=this;if(e.settings.constrainToViewport){var f=a.getViewPort(window),g=e.layoutRect();b=d(b,f.w+f.x,g.w),c=d(c,f.h+f.y,g.h)}return e.state.get("rendered")?e.layoutRect({x:b,y:c}).repaint():(e.settings.x=b,e.settings.y=c),e.fire("move",{x:b,y:c}),e}}}),g("2y",["2c"],function(a){"use strict";return{resizeToContent:function(){this._layoutRect.autoResize=!0,this._lastRect=null,this.reflow()},resizeTo:function(b,c){if(b<=1||c<=1){var d=a.getWindowSize();b=b<=1?b*d.w:b,c=c<=1?c*d.h:c}return this._layoutRect.autoResize=!1,this.layoutRect({minW:b,minH:c,w:b,h:c}).reflow()},resizeBy:function(a,b){var c=this,d=c.layoutRect();return c.resizeTo(d.w+a,d.h+b)}}}),g("2z",["2w","2x","2y","2c","d","8"],function(a,b,c,d,e,f){"use strict";function g(a,b){for(;a;){if(a==b)return!0;a=a.parent()}}function h(a){for(var b=s.length;b--;){var c=s[b],d=c.getParentCtrl(a.target);if(c.settings.autohide){if(d&&(g(d,c)||c.parent()===d))continue;a=c.fire("autohide",{target:a.target}),a.isDefaultPrevented()||c.hide()}}}function i(){o||(o=function(a){2!=a.button&&h(a)},e(document).on("click touchstart",o))}function j(){p||(p=function(){var a;for(a=s.length;a--;)l(s[a])},e(window).on("scroll",p))}function k(){if(!q){var a=document.documentElement,b=a.clientWidth,c=a.clientHeight;q=function(){document.all&&b==a.clientWidth&&c==a.clientHeight||(b=a.clientWidth,c=a.clientHeight,u.hideAll())},e(window).on("resize",q)}}function l(a){function b(b,c){for(var d,e=0;ec&&(a.fixed(!1).layoutRect({y:a._autoFixY}).repaint(),b(!1,a._autoFixY-c)):(a._autoFixY=a.layoutRect().y,a._autoFixY
    ').appendTo(b.getContainerElm())),f.setTimeout(function(){c.addClass(d+"in"),e(b.getEl()).addClass(d+"in")}),r=!0),m(!0,b)}}),b.on("show",function(){b.parents().each(function(a){if(a.state.get("fixed"))return b.fixed(!0),!1})}),a.popover&&(b._preBodyHtml='
    ',b.classes.add("popover").add("bottom").add(b.isRtl()?"end":"start")),b.aria("label",a.ariaLabel),b.aria("labelledby",b._id),b.aria("describedby",b.describedBy||b._id+"-none")},fixed:function(a){var b=this;if(b.state.get("fixed")!=a){if(b.state.get("rendered")){var c=d.getViewPort();a?b.layoutRect().y-=c.y:b.layoutRect().y+=c.y}b.classes.toggle("fixed",a),b.state.set("fixed",a)}return b},show:function(){var a,b=this,c=b._super();for(a=s.length;a--&&s[a]!==b;);return a===-1&&s.push(b),c},hide:function(){return n(this),m(!1,this),this._super()},hideAll:function(){u.hideAll()},close:function(){var a=this;return a.fire("close").isDefaultPrevented()||(a.remove(),m(!1,a)),a},remove:function(){n(this),this._super()},postRender:function(){var a=this;return a.settings.bodyRole&&this.getEl("body").setAttribute("role",a.settings.bodyRole),a._super()}});return u.hideAll=function(){for(var a=s.length;a--;){var b=s[a];b&&b.settings.autohide&&(b.hide(),s.splice(a,1))}},u}),g("29",["2z","2w","2c","d","2u","5e","9","8"],function(a,b,c,d,e,f,g,h){"use strict";function i(a){var b,c="width=device-width,initial-scale=1.0,user-scalable=0,minimum-scale=1.0,maximum-scale=1.0",e=d("meta[name=viewport]")[0];g.overrideViewPort!==!1&&(e||(e=document.createElement("meta"),e.setAttribute("name","viewport"),document.getElementsByTagName("head")[0].appendChild(e)),b=e.getAttribute("content"),b&&"undefined"!=typeof n&&(n=b),e.setAttribute("content",a?c:n))}function j(a,b){k()&&b===!1&&d([document.documentElement,document.body]).removeClass(a+"fullscreen")}function k(){for(var a=0;aa.w&&(d=a.x-Math.max(0,b/2),f.layoutRect({w:b,x:d}),e=!0)),g&&(g.layoutRect({w:f.layoutRect().innerW}).recalc(),b=g.layoutRect().minW+a.deltaW,b>a.w&&(d=a.x-Math.max(0,b-a.w),f.layoutRect({w:b,x:d}),e=!0)),e&&f.recalc()},initLayoutRect:function(){var a,b=this,d=b._super(),e=0;if(b.settings.title&&!b._fullscreen){a=b.getEl("head");var f=c.getSize(a);d.headerW=f.width,d.headerH=f.height,e+=d.headerH}b.statusbar&&(e+=b.statusbar.layoutRect().h),d.deltaH+=e,d.minH+=e,d.h+=e;var g=c.getWindowSize();return d.x=b.settings.x||Math.max(0,g.w/2-d.w/2),d.y=b.settings.y||Math.max(0,g.h/2-d.h/2),d},renderHtml:function(){var a=this,b=a._layout,c=a._id,d=a.classPrefix,e=a.settings,f="",g="",h=e.html;return a.preRender(),b.preRender(a),e.title&&(f='
    '+a.encode(e.title)+'
    '),e.url&&(h=''),"undefined"==typeof h&&(h=b.renderHtml(a)),a.statusbar&&(g=a.statusbar.renderHtml()),'
    '+f+'
    '+h+"
    "+g+"
    "},fullscreen:function(a){var b,e,g=this,i=document.documentElement,j=g.classPrefix;if(a!=g._fullscreen)if(d(window).on("resize",function(){var a;if(g._fullscreen)if(b)g._timer||(g._timer=h.setTimeout(function(){var a=c.getWindowSize();g.moveTo(0,0).resizeTo(a.w,a.h),g._timer=0},50));else{a=(new Date).getTime();var d=c.getWindowSize();g.moveTo(0,0).resizeTo(d.w,d.h),(new Date).getTime()-a>50&&(b=!0)}}),e=g.layoutRect(),g._fullscreen=a,a){g._initial={x:e.x,y:e.y,w:e.w,h:e.h},g.borderBox=f.parseBox("0"),g.getEl("head").style.display="none",e.deltaH-=e.headerH+2,d([i,document.body]).addClass(j+"fullscreen"),g.classes.add("fullscreen");var k=c.getWindowSize();g.moveTo(0,0).resizeTo(k.w,k.h)}else g.borderBox=f.parseBox(g.settings.border),g.getEl("head").style.display="",e.deltaH+=e.headerH,d([i,document.body]).removeClass(j+"fullscreen"),g.classes.remove("fullscreen"),g.moveTo(g._initial.x,g._initial.y).resizeTo(g._initial.w,g._initial.h);return g.reflow()},postRender:function(){var a,b=this;setTimeout(function(){b.classes.add("in"),b.fire("open")},0),b._super(),b.statusbar&&b.statusbar.postRender(),b.focus(),this.dragHelper=new e(b._id+"-dragh",{start:function(){a={x:b.layoutRect().x,y:b.layoutRect().y}},drag:function(c){b.moveTo(a.x+c.deltaX,a.y+c.deltaY)}}),b.on("submit",function(a){a.isDefaultPrevented()||b.close()}),m.push(b),i(!0)},submit:function(){return this.fire("submit",{data:this.toJSON()})},remove:function(){var a,b=this;for(b.dragHelper.destroy(),b._super(),b.statusbar&&this.statusbar.remove(),j(b.classPrefix,!1),a=m.length;a--;)m[a]===b&&m.splice(a,1);i(m.length>0)},getContentWindow:function(){var a=this.getEl().getElementsByTagName("iframe")[0];return a?a.contentWindow:null}});return l(),o}),g("2a",["29"],function(a){"use strict";var b=a.extend({init:function(a){a={border:1,padding:20,layout:"flex",pack:"center",align:"center",containerCls:"panel",autoScroll:!0,buttons:{type:"button",text:"Ok",action:"ok"},items:{type:"label",multiline:!0,maxWidth:500,maxHeight:200}},this._super(a)},Statics:{OK:1,OK_CANCEL:2,YES_NO:3,YES_NO_CANCEL:4,msgBox:function(c){function d(a,b,c){return{type:"button",text:a,subtype:c?"primary":"",onClick:function(a){a.control.parents()[1].close(),f(b)}}}var e,f=c.callback||function(){};switch(c.buttons){case b.OK_CANCEL:e=[d("Ok",!0,!0),d("Cancel",!1)];break;case b.YES_NO:case b.YES_NO_CANCEL:e=[d("Yes",1,!0),d("No",0)],c.buttons==b.YES_NO_CANCEL&&e.push(d("Cancel",-1));break;default:e=[d("Ok",!0,!0)]}return new a({padding:20,x:c.x,y:c.y,minWidth:300,minHeight:100,layout:"flex",pack:"center",align:"center",buttons:e,title:c.title,role:"alertdialog",items:{type:"label",multiline:!0,maxWidth:500,maxHeight:200,text:c.text},onPostRender:function(){this.aria("describedby",this.items()[0]._id)},onClose:c.onClose,onCancel:function(){f(!1)}}).renderTo(document.body).reflow()},alert:function(a,c){return"string"==typeof a&&(a={text:a}),a.callback=c,b.msgBox(a)},confirm:function(a,c){return"string"==typeof a&&(a={text:a}),a.callback=c,a.buttons=b.OK_CANCEL,b.msgBox(a)}}});return b}),g("12",["29","2a"],function(a,b){return function(c){function d(){if(h.length)return h[h.length-1]}function e(a){c.fire("OpenWindow",{win:a})}function f(a){c.fire("CloseWindow",{win:a})}var g=this,h=[];g.windows=h,c.on("remove",function(){for(var a=h.length;a--;)h[a].close()}),g.open=function(b,d){var g;return c.editorManager.setActive(c),b.title=b.title||" ",b.url=b.url||b.file,b.url&&(b.width=parseInt(b.width||320,10),b.height=parseInt(b.height||240,10)),b.body&&(b.items={defaults:b.defaults,type:b.bodyType||"form",items:b.body,data:b.data,callbacks:b.commands}),b.url||b.buttons||(b.buttons=[{text:"Ok",subtype:"primary",onclick:function(){g.find("form")[0].submit()}},{text:"Cancel",onclick:function(){g.close()}}]),g=new a(b),h.push(g),g.on("close",function(){for(var a=h.length;a--;)h[a]===g&&h.splice(a,1);h.length||c.focus(),f(g)}),b.data&&g.on("postRender",function(){this.find("*").each(function(a){var c=a.name();c in b.data&&a.value(b.data[c])})}),g.features=b||{},g.params=d||{},1===h.length&&c.nodeChanged(),g=g.renderTo().reflow(),e(g),g},g.alert=function(a,d,g){var h;h=b.alert(a,function(){d?d.call(g||this):c.focus()}),h.on("close",function(){f(h)}),e(h)},g.confirm=function(a,c,d){var g;g=b.confirm(a,function(a){c.call(d||this,a)}),g.on("close",function(){f(g)}),e(g)},g.close=function(){d()&&d().close()},g.getParams=function(){return d()?d().params:null},g.setParams=function(a){d()&&(d().params=a)},g.getWindows=function(){return h}}}),g("6q",[],function(){var a=function(a){return void 0!==a.style};return{isSupported:a}}),h("5l",window),g("5g",["2k","2j","5i","49","66","6p","1w","4w","6q","5j","4","4p","5l"],function(a,b,c,d,e,f,g,h,i,j,k,l,m){var n=function(b,c,d){if(!a.isString(d))throw l.error("Invalid call to CSS.set. Property ",c,":: Value ",d,":: Element ",b),new k("CSS value must be a string: "+d);i.isSupported(b)&&b.style.setProperty(c,d)},o=function(a,b){i.isSupported(a)&&a.style.removeProperty(b)},p=function(a,b,c){var d=a.dom();n(d,b,c)},q=function(a,b){var d=a.dom();c.each(b,function(a,b){n(d,b,a)})},r=function(a,b){var d=a.dom();c.each(b,function(a,b){a.fold(function(){o(d,b)},function(a){n(d,b,a)})})},s=function(a,b){var c=a.dom(),d=m.getComputedStyle(c),e=d.getPropertyValue(b),g=""!==e||f.inBody(a)?e:t(c,b);return null===g?void 0:g},t=function(a,b){return i.isSupported(a)?a.style.getPropertyValue(b):""},u=function(a,b){var c=a.dom(),e=t(c,b);return d.from(e).filter(function(a){return a.length>0})},v=function(a,b,c){var d=g.fromTag(a);p(d,b,c);var e=u(d,b);return e.isSome()},w=function(a,b){var c=a.dom();o(c,b),e.has(a,"style")&&""===j.trim(e.get(a,"style"))&&e.remove(a,"style")},x=function(a,b){var c=e.get(a,"style"),d=b(a),f=void 0===c?e.remove:e.set;return f(a,"style",c),d},y=function(a,b){var c=a.dom(),d=b.dom();i.isSupported(c)&&i.isSupported(d)&&(d.style.cssText=c.style.cssText)},z=function(a){return a.dom().offsetWidth},A=function(a,b,c){u(a,c).each(function(a){u(b,c).isNone()&&p(b,c,a)})},B=function(a,c,d){h.isElement(a)&&h.isElement(c)&&b.each(d,function(b){A(a,c,b)})};return{copy:y,set:p,preserve:x,setAll:q,setOptions:r,remove:w,get:s,getRaw:u,isValidValue:v,reflow:z,transfer:B}}),g("2b",["1","49","21","1w","5g","5h"],function(a,b,c,d,e,f){var g=function(a,b){var c=b.dom();return c[a]},h=function(a,b){return parseInt(e.get(b,a),10)},i=a.curry(g,"clientWidth"),j=a.curry(g,"clientHeight"),k=a.curry(h,"margin-top"),l=a.curry(h,"margin-left"),m=function(a){return a.dom().getBoundingClientRect()},n=function(a,b,c){var d=i(a),e=j(a);return b>=0&&c>=0&&b<=d&&c<=e},o=function(a,b,c,d){var e=m(b),f=a?e.left+b.dom().clientLeft+l(b):0,g=a?e.top+b.dom().clientTop+k(b):0,h=c-f,i=d-g;return{x:h,y:i}},p=function(a,b,c){var e=d.fromDom(a.getBody()),g=a.inline?e:f.documentElement(e),h=o(a.inline,g,b,c);return n(g,h.x,h.y)},q=function(a){return b.from(a).map(d.fromDom)},r=function(a){var b=a.inline?a.getBody():a.getContentAreaContainer();return q(b).map(function(a){return c.contains(f.owner(a),a)}).getOr(!1)};return{isXYInContentArea:p,isEditorAttachedToDom:r}}),g("30",["2q","2x"],function(a,b){return a.extend({Mixins:[b],Defaults:{classes:"widget tooltip tooltip-n"},renderHtml:function(){var a=this,b=a.classPrefix;return'"},bindStates:function(){var a=this;return a.state.on("change:text",function(b){a.getEl().lastChild.innerHTML=a.encode(b.value)}),a._super()},repaint:function(){var a,b,c=this;a=c.getEl().style,b=c._layoutRect,a.left=b.x+"px",a.top=b.y+"px",a.zIndex=131070}})}),g("31",["2q","30"],function(a,b){"use strict";var c,d=a.extend({init:function(a){var b=this;b._super(a),a=b.settings,b.canFocus=!0,a.tooltip&&d.tooltips!==!1&&(b.on("mouseenter",function(c){var d=b.tooltip().moveTo(-65535);if(c.control==b){var e=d.text(a.tooltip).show().testMoveRel(b.getEl(),["bc-tc","bc-tl","bc-tr"]);d.classes.toggle("tooltip-n","bc-tc"==e),d.classes.toggle("tooltip-nw","bc-tl"==e),d.classes.toggle("tooltip-ne","bc-tr"==e),d.moveRel(b.getEl(),e)}else d.hide()}),b.on("mouseleave mousedown click",function(){b.tooltip().hide()})),b.aria("label",a.ariaLabel||a.tooltip)},tooltip:function(){return c||(c=new b({type:"tooltip"}),c.renderTo()),c},postRender:function(){var a=this,b=a.settings;a._super(),a.parent()||!b.width&&!b.height||(a.initLayoutRect(),a.repaint()),b.autofocus&&a.focus()},bindStates:function(){function a(a){c.aria("disabled",a),c.classes.toggle("disabled",a)}function b(a){c.aria("pressed",a),c.classes.toggle("active",a)}var c=this;return c.state.on("change:disabled",function(b){a(b.value)}),c.state.on("change:active",function(a){b(a.value)}),c.state.get("disabled")&&a(!0),c.state.get("active")&&b(!0),c._super()},remove:function(){this._super(),c&&(c.remove(),c=null)}});return d}),g("32",["31"],function(a){"use strict";return a.extend({Defaults:{value:0},init:function(a){var b=this;b._super(a),b.classes.add("progress"),b.settings.filter||(b.settings.filter=function(a){return Math.round(a)})},renderHtml:function(){var a=this,b=a._id,c=this.classPrefix;return'
    0%
    '},postRender:function(){var a=this;return a._super(),a.value(a.settings.value),a},bindStates:function(){function a(a){a=b.settings.filter(a),b.getEl().lastChild.innerHTML=a+"%",b.getEl().firstChild.firstChild.style.width=a+"%"}var b=this;return b.state.on("change:value",function(b){a(b.value)}),a(b.state.get("value")),b._super()}})}),g("2d",["2q","2x","32","8"],function(a,b,c,d){var e=function(a,b){a.getEl().lastChild.textContent=b+(a.progressBar?" "+a.progressBar.value()+"%":"")};return a.extend({Mixins:[b],Defaults:{classes:"widget notification"},init:function(a){var b=this;b._super(a),b.maxWidth=a.maxWidth,a.text&&b.text(a.text),a.icon&&(b.icon=a.icon),a.color&&(b.color=a.color),a.type&&b.classes.add("notification-"+a.type),a.timeout&&(a.timeout<0||a.timeout>0)&&!a.closeButton?b.closeButton=!1:(b.classes.add("has-close"),b.closeButton=!0),a.progressBar&&(b.progressBar=new c),b.on("click",function(a){a.target.className.indexOf(b.classPrefix+"close")!=-1&&b.close()})},renderHtml:function(){var a=this,b=a.classPrefix,c="",d="",e="",f="";return a.icon&&(c=''),f=' style="max-width: '+a.maxWidth+"px;"+(a.color?"background-color: "+a.color+';"':'"'),a.closeButton&&(d=''),a.progressBar&&(e=a.progressBar.renderHtml()),''},postRender:function(){var a=this;return d.setTimeout(function(){a.$el.addClass(a.classPrefix+"in"),e(a,a.state.get("text"))},100),a._super()},bindStates:function(){var a=this;return a.state.on("change:text",function(b){a.getEl().firstChild.innerHTML=b.value,e(a,b.value)}),a.progressBar&&(a.progressBar.bindStates(),a.progressBar.state.on("change:value",function(b){e(a,a.state.get("text"))})),a._super()},close:function(){var a=this;return a.fire("close").isDefaultPrevented()||a.remove(),a},repaint:function(){var a,b,c=this;a=c.getEl().style,b=c._layoutRect,a.left=b.x+"px",a.top=b.y+"px",a.zIndex=65534}})}),g("13",["2b","2c","2d","8","c"],function(a,b,c,d,e){return function(f){function g(){if(p.length)return p[p.length-1]}function h(a){return a.inline?a.getElement():a.getContentAreaContainer()}function i(){d.requestAnimationFrame(function(){j(),k()})}function j(){for(var a=0;a0){var a=p.slice(0,1)[0],b=h(f);if(a.moveRel(b,"tc-tc"),p.length>1)for(var c=1;c0&&(d.timer=setTimeout(function(){d.close()},b.timeout)),d.on("close",function(){var a=p.length;for(d.timer&&f.getWin().clearTimeout(d.timer);a--;)p[a]===d&&p.splice(a,1);k()}),d.renderTo(),k()):d=g,d}},o.close=function(){g()&&g().close()},o.getNotifications=function(){return p},f.on("SkinLoaded",function(){var a=f.settings.service_message;a&&f.notificationManager.open({text:a,type:"warning",timeout:0,icon:""})})}}),g("14",["11","h","c"],function(a,b,c){function d(a,b){return"selectionchange"==b?a.getDoc():!a.inline&&/^mouse|touch|click|contextmenu|drop|dragover|dragend/.test(b)?a.getDoc().documentElement:a.settings.event_root?(a.eventRoot||(a.eventRoot=g.select(a.settings.event_root)[0]),a.eventRoot):a.getBody()}function e(a,b){function c(a){return!a.hidden&&!a.readonly}var e,h;if(a.delegates||(a.delegates={}),!a.delegates[b]&&!a.removed)if(e=d(a,b),a.settings.event_root){if(f||(f={},a.editorManager.on("removeEditor",function(){var b;if(!a.editorManager.activeEditor&&f){for(b in f)a.dom.unbind(d(a,b));f=null}})),f[b])return;h=function(d){for(var e=d.target,f=a.editorManager.get(),h=f.length;h--;){var i=f[h].getBody();(i===e||g.isChildOf(e,i))&&c(f[h])&&f[h].fire(b,d)}},f[b]=h,g.bind(e,b,h)}else h=function(d){c(a)&&a.fire(b,d)},g.bind(e,b,h),a.delegates[b]=h}var f,g=b.DOM,h={bindPendingEventDelegates:function(){var a=this;c.each(a._pendingNativeEvents,function(b){e(a,b)})},toggleNativeEvent:function(a,b){var c=this;"focus"!=a&&"blur"!=a&&(b?c.initialized?e(c,a):c._pendingNativeEvents?c._pendingNativeEvents.push(a):c._pendingNativeEvents=[a]:c.initialized&&(c.dom.unbind(d(c,a),a,c.delegates[a]),delete c.delegates[a]))},unbindAllNativeEvents:function(){var a,b=this;if(b.delegates){for(a in b.delegates)b.dom.unbind(d(b,a),a,b.delegates[a]);delete b.delegates}b.inline||(b.getBody().onload=null,b.dom.unbind(b.getWin()),b.dom.unbind(b.getDoc())),b.dom.unbind(b.getBody()),b.dom.unbind(b.getContainer())}};return h=c.extend({},a,h)}),g("15",["c","9"],function(a,b){var c=a.each,d=a.explode,e={f9:120,f10:121,f11:122},f=a.makeMap("alt,ctrl,shift,meta,access");return function(g){function h(a){var g,h,i={};c(d(a,"+"),function(a){a in f?i[a]=!0:/^[0-9]{2,}$/.test(a)?i.keyCode=parseInt(a,10):(i.charCode=a.charCodeAt(0),i.keyCode=e[a]||a.toUpperCase().charCodeAt(0))}),g=[i.keyCode];for(h in f)i[h]?g.push(h):i[h]=!1;return i.id=g.join(","),i.access&&(i.alt=!0,b.mac?i.ctrl=!0:i.shift=!0),i.meta&&(b.mac?i.meta=!0:(i.ctrl=!0,i.meta=!1)),i}function i(b,c,e,f){var i;return i=a.map(d(b,">"),h),i[i.length-1]=a.extend(i[i.length-1],{func:e,scope:f||g}),a.extend(i[0],{desc:g.translate(c),subpatterns:i.slice(1)})}function j(a){return a.altKey||a.ctrlKey||a.metaKey}function k(a){return"keydown"===a.type&&a.keyCode>=112&&a.keyCode<=123}function l(a,b){return!!b&&(b.ctrl==a.ctrlKey&&b.meta==a.metaKey&&(b.alt==a.altKey&&b.shift==a.shiftKey&&(!!(a.keyCode==b.keyCode||a.charCode&&a.charCode==b.charCode)&&(a.preventDefault(),!0))))}function m(a){return a.func?a.func.call(a.scope):null}var n=this,o={},p=[];g.on("keyup keypress keydown",function(a){!j(a)&&!k(a)||a.isDefaultPrevented()||(c(o,function(b){if(l(a,b))return p=b.subpatterns.slice(0),"keydown"==a.type&&m(b),!0}),l(a,p[0])&&(1===p.length&&"keydown"==a.type&&m(p[0]),p.shift()))}),n.add=function(b,e,f,h){var j;return j=f,"string"==typeof f?f=function(){g.execCommand(j,!1,null)}:a.isArray(j)&&(f=function(){g.execCommand(j[0],j[1],j[2])}),c(d(a.trim(b.toLowerCase())),function(a){var b=i(a,e,f,h);o[b.id]=b}),!0},n.remove=function(a){var b=i(a);return!!o[b.id]&&(delete o[b.id],!0)}}}),g("2l",["j"],function(a){var b=a.PluginManager,c=function(a,c){for(var d in b.urls){var e=b.urls[d]+"/plugin"+c+".js";if(e===a)return d}return null},d=function(a,b){var d=c(b,a.suffix);return d?"Failed to load plugin: "+d+" from url "+b:"Failed to load plugin url: "+b},e=function(a,b){a.notificationManager.open({type:"error",text:b})},f=function(a,b){a._skinLoaded?e(a,b):a.on("SkinLoaded",function(){e(a,b)})},g=function(a,b){f(a,"Failed to upload image: "+b)},h=function(a,b){f(a,d(a,b))},i=function(a){var b=window.console;b&&!window.test&&(b.error?b.error.apply(b,arguments):b.log.apply(b,arguments))};return{pluginLoadError:h,uploadError:g,displayError:f,initError:i}}),g("77",["1","1w","4y","1u"],function(a,b,c,d){var e=function(d){return c.descendant(b.fromDom(d.getBody()),"*[data-mce-caret]").fold(a.constant(null),function(a){return a.dom()})},f=function(a){a.selection.setRng(a.selection.getRng())},g=function(a,b){b.hasAttribute("data-mce-caret")&&(d.showCaretContainerBlock(b),f(a),a.selection.scrollIntoView(b))},h=function(a,b){var c=e(a);if(c)return"compositionstart"===b.type?(b.preventDefault(),b.stopPropagation(),void g(c)):void(d.hasContent(c)&&g(a,c))},i=function(b){b.on("keyup compositionstart",a.curry(h,b))};return{setup:i}}),g("7h",["7","c","4e"],function(a,b,c){return function(c,d){function e(a,b){return a?a.replace(/\/$/,"")+"/"+b.replace(/^\//,""):b}function f(a,b,c,f){var g,h;g=new XMLHttpRequest,g.open("POST",d.url),g.withCredentials=d.credentials,g.upload.onprogress=function(a){f(a.loaded/a.total*100)},g.onerror=function(){c("Image upload failed due to a XHR Transport error. Code: "+g.status)},g.onload=function(){var a;return g.status<200||g.status>=300?void c("HTTP Error: "+g.status):(a=JSON.parse(g.responseText),a&&"string"==typeof a.location?void b(e(d.basePath,a.location)):void c("Invalid JSON: "+g.responseText))},h=new FormData,h.append("file",a.blob(),a.filename()),g.send(h)}function g(){return new a(function(a){a([])})}function h(a,b){return{url:b,blobInfo:a,status:!0}}function i(a,b){return{url:"",blobInfo:a,status:!1,error:b}}function j(a,c){b.each(p[a],function(a){a(c)}),delete p[a]}function k(b,d,e){return c.markPending(b.blobUri()),new a(function(a){var f,g,k=function(){};try{var l=function(){f&&(f.close(),g=k)},m=function(d){l(),c.markUploaded(b.blobUri(),d),j(b.blobUri(),h(b,d)),a(h(b,d))},n=function(d){l(),c.removeFailed(b.blobUri()),j(b.blobUri(),i(b,d)),a(i(b,d))};g=function(a){a<0||a>100||(f||(f=e()),f.progressBar.value(a))},d(b,m,n,g)}catch(c){a(i(b,c.message))}})}function l(a){return a===f}function m(b){var c=b.blobUri();return new a(function(a){p[c]=p[c]||[],p[c].push(a)})}function n(e,f){return e=b.grep(e,function(a){return!c.isUploaded(a.blobUri())}),a.all(b.map(e,function(a){return c.isPending(a.blobUri())?m(a):k(a,d.handler,f)}))}function o(a,b){return!d.url&&l(d.handler)?g():n(a,b)}var p={};return d=b.extend({credentials:!1,handler:f},d),{upload:o}}}),g("83",["5z"],function(a){var b=function(b){var c=a.getOrDie("requestAnimationFrame");c(b)},c=function(b){var c=a.getOrDie("atob");return c(b)};return{atob:c,requestAnimationFrame:b}}),g("7v",["83","7"],function(a,b){function c(a){return new b(function(b,c){var d=function(){c("Cannot convert "+a+" to Blob. Resource might not exist or is inaccessible.")};try{var e=new XMLHttpRequest;e.open("GET",a,!0),e.responseType="blob",e.onload=function(){200==this.status?b(this.response):d()},e.onerror=d,e.send()}catch(a){d()}})}function d(a){var b,c;return a=decodeURIComponent(a).split(","),c=/data:([^;]+)/.exec(a[0]),c&&(b=c[1]),{type:b,data:a[1]}}function e(c){return new b(function(b){var e,f,g;c=d(c);try{e=a.atob(c.data)}catch(a){return void b(new Blob([]))}for(f=new Uint8Array(e.length),g=0;g0&&b.moveEnd("character",f),b.select()}catch(a){}a.nodeChanged()}}},c=function(c){c.settings.forced_root_block&&c.on("NodeChange",a.curry(b,c))};return{setup:c}}),g("81",["1q","1t","4g"],function(a,b,c){function d(e){function f(b){return a.map(b,function(a){return a=c.clone(a),a.node=e,a})}if(a.isArray(e))return a.reduce(e,function(a,b){return a.concat(d(b))},[]);if(b.isElement(e))return f(e.getClientRects());if(b.isText(e)){var g=e.ownerDocument.createRange();return g.setStart(e,0),g.setEnd(e,e.data.length),f(g.getClientRects())}}return{getClientRects:d}}),g("7q",["4e","1q","1t","81","4g","5x","4f"],function(a,b,c,d,e,f,g){function h(a,b){return Math.abs(a.left-b)}function i(a,b){return Math.abs(a.right-b)}function j(a,c){function d(a,b){return a>=b.left&&a<=b.right}return b.reduce(a,function(a,b){var e,f;return e=Math.min(h(a,c),i(a,c)),f=Math.min(h(b,c),i(b,c)),d(c,b)?b:d(c,a)?a:f==e&&p(b.node)?b:f=a.top&&e<=a.bottom}),g=j(f,c),g&&(g=j(l(a,g),c),g&&p(g.node))?n(g,c):null}var p=c.isContentEditableFalse,q=f.findNode,r=a.curry;return{findClosestClientRect:j,findLineNodeRects:l,closestCaret:o}}),g("84",["4e","1q","81","4f","5x","5a","20","4g"],function(a,b,c,d,e,f,g,h){function i(a,b,c,f){for(;f=e.findNode(f,a,d.isEditableCaretCandidate,b);)if(c(f))return}function j(a,d,e,f,g,h){function j(f){var h,i,j;for(j=c.getClientRects(f),a==-1&&(j=j.reverse()),h=0;h0&&d(i,b.last(n))&&m++,i.line=m,g(i))return!0;n.push(i)}}var k,l,m=0,n=[];return(l=b.last(h.getClientRects()))?(k=h.getNode(),j(k),i(a,f,j,k),n):n}function k(a,b){return b.line>a}function l(a,b){return b.line===a}function m(a,c,d,e){function i(c){return 1==a?b.last(c.getClientRects()):b.last(c.getClientRects())}var j,k,l,m,n,o,p=new f(c),q=[],r=0;1==a?(j=p.next,k=h.isBelow,l=h.isAbove,m=g.after(e)):(j=p.prev,k=h.isAbove,l=h.isBelow,m=g.before(e)),o=i(m);do if(m.isVisible()&&(n=i(m),!l(n,o))){if(q.length>0&&k(n,b.last(q))&&r++,n=h.clone(n),n.position=m,n.line=r,d(n))return q;q.push(n)}while(m=j(m));return q}var n=a.curry,o=n(j,-1,h.isAbove,h.isBelow),p=n(j,1,h.isBelow,h.isAbove);return{upUntil:o,downUntil:p,positionsUntil:m,isAboveLine:n(k),isLine:n(l)}}),g("7s",["20","5x","1t","4e"],function(a,b,c,d){var e=c.isContentEditableTrue,f=c.isContentEditableFalse,g=function(a,b,c,d){return b._selectionOverrides.showCaret(a,c,d)},h=function(a){var b=a.ownerDocument.createRange();return b.selectNode(a),b},i=function(a,b){var c;return c=a.fire("BeforeObjectSelected",{target:b}),c.isDefaultPrevented()?null:h(b)},j=function(c,h){var i,j;return h=b.normalizeRange(1,c.getBody(),h),i=a.fromRangeStart(h),f(i.getNode())?g(1,c,i.getNode(),!i.isAtEnd()):f(i.getNode(!0))?g(1,c,i.getNode(!0),!1):(j=c.dom.getParent(i.getNode(),d.or(f,e)),f(j)?g(1,c,j,!1):null)},k=function(a,b){var c;return b&&b.collapsed?(c=j(a,b),c?c:b):b};return{showCaret:g,selectNode:i,renderCaretAtRange:j,renderRangeCaret:k}}),g("7x",["1u","20","5x","5a","7q","84","1t","k","9","7s","1q","4e"],function(a,b,c,d,e,f,g,h,i,j,k,l){var m=g.isContentEditableFalse,n=h.getSelectedNode,o=c.isAfterContentEditableFalse,p=c.isBeforeContentEditableFalse,q=function(a,b){for(;b=a(b);)if(b.isVisible())return b;return b},r=function(a,b){var d=c.isInSameBlock(a,b);return!(d||!g.isBr(a.getNode()))||d},s=function(b){return a.isCaretContainerBlock(b.startContainer)},t=function(a,d,e){return e=c.normalizeRange(a,d,e),a===-1?b.fromRangeStart(e):b.fromRangeEnd(e)},u=function(a,b,c,d,e){var f,g,h,i;return!e.collapsed&&(f=n(e),m(f))?j.showCaret(a,b,f,a===-1):(i=s(e),g=t(a,b.getBody(),e),d(g)?j.selectNode(b,g.getNode(a===-1)):(g=c(g))?d(g)?j.showCaret(a,b,g.getNode(a===-1),1===a):(h=c(g),d(h)&&r(g,h)?j.showCaret(a,b,h.getNode(a===-1),1===a):i?j.renderRangeCaret(b,g.toRange()):null):i?e:null)},v=function(a,b,c,d){var g,h,i,l,q,r,s,u,v;if(v=n(d),g=t(a,b.getBody(),d),h=c(b.getBody(),f.isAboveLine(1),g),i=k.filter(h,f.isLine(1)),q=k.last(g.getClientRects()),p(g)&&(v=g.getNode()),o(g)&&(v=g.getNode(!0)),!q)return null;if(r=q.left,l=e.findClosestClientRect(i,r),l&&m(l.node))return s=Math.abs(r-l.left),u=Math.abs(r-l.right),j.showCaret(a,b,l.node,s=11)&&(b.innerHTML='
    '),b},x=function(a,c,e){var f,g,h,i=new d(a.getBody()),j=l.curry(q,i.next),k=l.curry(q,i.prev);if(e.collapsed&&a.settings.forced_root_block){if(f=a.dom.getParent(e.startContainer,"PRE"),!f)return;g=1===c?j(b.fromRangeStart(e)):k(b.fromRangeStart(e)),g||(h=w(a),1===c?a.$(f).after(h):a.$(f).before(h),a.selection.select(h,!0),a.selection.collapse())}},y=function(a,b){var c,e=new d(a.getBody()),f=l.curry(q,e.next),g=l.curry(q,e.prev),h=b?1:-1,i=b?f:g,j=b?p:o,k=a.selection.getRng();return(c=u(h,a,i,j,k))?c:(c=x(a,h,k),c?c:null)},z=function(a,b){var c,d=b?1:-1,e=b?f.downUntil:f.upUntil,g=a.selection.getRng();return(c=v(d,a,e,g))?c:(c=x(a,d,g),c?c:null)},A=function(a,b){return function(){var c=y(a,b);return!!c&&(a.selection.setRng(c),!0)}},B=function(a,b){return function(){var c=z(a,b);return!!c&&(a.selection.setRng(c),!0)}};return{moveH:A,moveV:B}}),g("85",["2k","3","4"],function(a,b,c){var d=function(a,b){return b},e=function(b,c){var d=a.isObject(b)&&a.isObject(c);return d?g(b,c):c},f=function(a){return function(){for(var d=new b(arguments.length),e=0;e'},l=function(a,b){return a.nodeName===b||a.previousSibling&&a.previousSibling.nodeName===b},m=function(a){return a&&/^(OL|UL|LI)$/.test(a.nodeName)},n=function(a){return m(a)&&m(a.parentNode)},o=function(a,b){return b&&a.isBlock(b)&&!/^(TD|TH|CAPTION|FORM)$/.test(b.nodeName)&&!/^(fixed|absolute)/i.test(b.style.position)&&"true"!==a.getContentEditable(b)},p=function(a,b,c){var d,e=c,f=[];if(e){for(;e=e.firstChild;){if(a.isBlock(e))return;1!=e.nodeType||b[e.nodeName.toLowerCase()]||f.push(e)}for(d=f.length;d--;)e=f[d],!e.hasChildNodes()||e.firstChild==e.lastChild&&""===e.firstChild.nodeValue?a.remove(e):g(e)&&a.remove(e)}},q=function(a,c,d){return b.isText(c)===!1?d:a?1===d&&c.data.charAt(d-1)===e.ZWSP?0:d:d===c.data.length-1&&c.data.charAt(d)===e.ZWSP?c.data.length:d},r=function(a){var b=a.cloneRange();return b.setStart(a.startContainer,q(!0,a.startContainer,a.startOffset)),b.setEnd(a.endContainer,q(!1,a.endContainer,a.endOffset)),b},s=function(a){for(;a;){if(1===a.nodeType||3===a.nodeType&&a.data&&/[\r\n\s]/.test(a.data))return a;a=a.nextSibling}},t=function(a,b){a.execCommand("InsertLineBreak",!1,b)},u=function(a){do 3===a.nodeType&&(a.nodeValue=a.nodeValue.replace(/^[\r\n]+/,"")),a=a.firstChild;while(a)},v=function(a,b){var c,d,e=a.getRoot();for(c=b;c!==e&&"false"!==a.getContentEditable(c);)"true"===a.getContentEditable(c)&&(d=c),c=c.parentNode;return c!==e?d:e},w=function(a,b){var c=a.settings.forced_root_block;c&&c.toLowerCase()===b.tagName.toLowerCase()&&a.dom.setAttribs(b,a.settings.forced_root_block_attrs)},x=function(a,b,c,d,e){var f,g,i,j,k,l,m=b||"P",n=a.dom,p=v(n,d);if(g=n.getParent(d,n.isBlock),!g||!o(n,g)){if(g=g||p,l=g==a.getBody()||h(g)?g.nodeName.toLowerCase():g.parentNode.nodeName.toLowerCase(),!g.hasChildNodes())return f=n.create(m),w(a,f),g.appendChild(f),c.setStart(f,0),c.setEnd(f,0),f;for(j=d;j.parentNode!=g;)j=j.parentNode;for(;j&&!n.isBlock(j);)i=j,j=j.previousSibling;if(i&&a.schema.isValidChild(l,m.toLowerCase())){for(f=n.create(m),w(a,f),i.parentNode.insertBefore(f,i),j=i;j&&!n.isBlock(j);)k=j.nextSibling,f.appendChild(j),j=k;c.setStart(d,e),c.setEnd(d,e)}}return d},y=function(a,b){var c;b.normalize(),c=b.lastChild,c&&!/^(left|right)$/gi.test(a.getStyle(c,"float",!0))||a.add(b,"br")},z=function(a){var b=a.parentNode;return/^(LI|DT|DD)$/.test(b.nodeName)?b:a},A=function(a,b,c){for(var d=a[c?"firstChild":"lastChild"];d&&1!=d.nodeType;)d=d[c?"nextSibling":"previousSibling"];return d===b},B=function(b,e){function f(a){var b,c,e,f,g=a,h=S.getMoveCaretBeforeOnEnterElements();if(a){if(/^(LI|DT|DD)$/.test(a.nodeName)){var i=s(a.firstChild);i&&/^(UL|OL|DL)$/.test(i.nodeName)&&a.insertBefore(P.doc.createTextNode("\xa0"),a.firstChild)}if(e=P.createRng(),a.normalize(),a.hasChildNodes()){for(b=new d(a,a);c=b.current();){if(3==c.nodeType){e.setStart(c,0),e.setEnd(c,0);break}if(h[c.nodeName.toLowerCase()]){e.setStartBefore(c),e.setEndBefore(c);break}g=c,c=b.next()}c||(e.setStart(g,0),e.setEnd(g,0))}else"BR"==a.nodeName?a.nextSibling&&P.isBlock(a.nextSibling)?(e.setStartBefore(a),e.setEndBefore(a)):(e.setStartAfter(a),e.setEndAfter(a)):(e.setStart(a,0),e.setEnd(a,0));Q.setRng(e),P.remove(f),Q.scrollIntoView(a)}}function g(a){var c,d,e,f=E,g=S.getTextInlineElements();if(a||"TABLE"==L||"HR"==L?(c=P.create(a||N),w(b,c)):c=G.cloneNode(!1),e=c,R.keep_styles===!1)P.setAttrib(c,"style",null),P.setAttrib(c,"class",null);else do if(g[f.nodeName]){if("_mce_caret"==f.id)continue;d=f.cloneNode(!1),P.setAttrib(d,"id",""),c.hasChildNodes()?(d.appendChild(c.firstChild),c.appendChild(d)):(e=d,c.appendChild(d))}while((f=f.parentNode)&&f!=D);return k(e),c}function h(a){var b,c,e,f;if(f=q(a,E,F),3==E.nodeType&&(a?f>0:fE.childNodes.length-1,E=E.childNodes[Math.min(F,E.childNodes.length-1)]||E,F=O&&3==E.nodeType?E.nodeValue.length:0),D=v(P,E)){if(!P.isBlock(D)&&D!=P.getRoot())return void(N&&!H||t(b,e));if((N&&!H||!N&&H)&&(E=x(b,N,U,E,F)),G=P.getParent(E,P.isBlock),K=G?P.getParent(G.parentNode,P.isBlock):null,L=G?G.nodeName.toUpperCase():"",M=K?K.nodeName.toUpperCase():"","LI"!=M||e.ctrlKey||(G=K,K=K.parentNode,L=M),/^(LI|DT|DD)$/.test(L)){if(!N&&H)return void t(b,e);if(P.isEmpty(G))return void m()}if("PRE"==L&&R.br_in_pre!==!1){if(!H)return void t(b,e)}else if(!N&&!H&&"LI"!=L||N&&H)return void t(b,e);N&&G===b.getBody()||(N=N||"P",a.isCaretContainerBlock(G)?(I=a.showCaretContainerBlock(G),P.isEmpty(G)&&k(G),f(I)):h()?B():h(!0)?(I=G.parentNode.insertBefore(g(),G),f(l(G,"HR")?I:G)):(C=r(U).cloneRange(),C.setEndAfter(G),J=C.extractContents(),u(J),I=J.firstChild,P.insertAfter(J,G),p(P,T,I),y(P,G),P.isEmpty(G)&&k(G),I.normalize(),P.isEmpty(I)?(P.remove(I),B()):f(I)),P.setAttrib(I,"id",""),b.fire("NewBlock",{newBlock:I}))}};return{insert:B}}),g("7n",["7z","s"],function(a,b){var c=function(a){a.typing&&(a.typing=!1,a.add())},d=function(b,d){d.isDefaultPrevented()||(d.preventDefault(),c(b.undoManager),b.undoManager.transact(function(){b.selection.isCollapsed()===!1&&b.execCommand("Delete"),a.insert(b,d)}))},e=function(a){a.on("keydown",function(c){c.keyCode===b.ENTER&&d(a,c)})};return{setup:e}}),g("80",["1","20","1t","6j","6l"],function(a,b,c,d,e){var f=function(a,b){return j(a)&&c.isText(b.container())},g=function(a,b){var c=b.container(),d=b.offset();c.insertData(d,"\xa0"),a.selection.setCursorLocation(c,d+1)},h=function(a,b,c){return!!f(c,b)&&(g(a,b),!0)},i=function(c){var f=a.curry(e.isInlineTarget,c),g=b.fromRangeStart(c.selection.getRng()),i=d.readLocation(f,c.getBody(),g);return i.map(a.curry(h,c,g)).getOr(!1)},j=function(b){return b.fold(a.constant(!1),a.constant(!0),a.constant(!0),a.constant(!1))},k=function(a){return!!a.selection.isCollapsed()&&i(a)};return{insertAtSelection:k}}),g("7o",["80","7y","s"],function(a,b,c){var d=function(d,e){b.execute([{keyCode:c.SPACEBAR,action:b.action(a.insertAtSelection,d)}],e).each(function(a){e.preventDefault()})},e=function(a){a.on("keydown",function(b){b.isDefaultPrevented()===!1&&d(a,b)})};return{setup:e}}),g("7a",["7l","6k","7m","7n","7o"],function(a,b,c,d,e){var f=function(f){var g=b.setupSelectedState(f);a.setup(f,g),c.setup(f,g),d.setup(f),e.setup(f)};return{setup:f}}),g("7b",["k","9","8"],function(a,b,c){return function(d){function e(a){var b,c;if(c=d.$(a).parentsUntil(d.getBody()).add(a),c.length===g.length){for(b=c.length;b>=0&&c[b]===g[b];b--);if(b===-1)return g=c,!0}return g=c,!1}var f,g=[];"onselectionchange"in d.getDoc()||d.on("NodeChange Click MouseUp KeyUp Focus",function(b){var c,e;c=d.selection.getRng(),e={startContainer:c.startContainer, +startOffset:c.startOffset,endContainer:c.endContainer,endOffset:c.endOffset},"nodechange"!=b.type&&a.compareRanges(e,f)||d.fire("SelectionChange"),f=e}),d.on("contextmenu",function(){d.fire("SelectionChange")}),d.on("SelectionChange",function(){var a=d.selection.getStart(!0);!a||!b.range&&d.selection.isCollapsed()||!e(a)&&d.dom.isChildOf(a,d.getBody())&&d.nodeChanged({selectionChange:!0})}),d.on("MouseUp",function(a){a.isDefaultPrevented()||("IMG"==d.selection.getNode().nodeName?c.setEditorTimeout(d,function(){d.nodeChanged()}):d.nodeChanged())}),this.nodeChanged=function(a){var b,c,e,f=d.selection;d.initialized&&f&&!d.settings.disable_nodechange&&!d.readonly&&(e=d.getBody(),b=f.getStart(!0)||e,b.ownerDocument==d.getDoc()&&d.dom.isChildOf(b,e)||(b=e),c=[],d.dom.getParent(b,function(a){return a===e||void c.push(a)}),a=a||{},a.element=b,a.parents=c,d.fire("NodeChange",a))}}}),g("7p",["1u","74","20","d","1t","k","4g","8"],function(a,b,c,d,e,f,g,h){var i=e.isContentEditableFalse,j=function(a){return a&&/^(TD|TH)$/i.test(a.nodeName)};return function(c,e){function f(a,b){var d,e,f,h,i,j=g.collapse(a.getBoundingClientRect(),b);return"BODY"==c.tagName?(d=c.ownerDocument.documentElement,e=c.scrollLeft||d.scrollLeft,f=c.scrollTop||d.scrollTop):(i=c.getBoundingClientRect(),e=c.scrollLeft-i.left,f=c.scrollTop-i.top),j.left+=e,j.right+=e,j.top+=f,j.bottom+=f,j.width=1,h=a.offsetWidth-a.clientWidth,h>0&&(b&&(h*=-1),j.left+=h,j.right+=h),j}function k(){var b,e,f,g,h;for(b=d("*[contentEditable=false]",c),g=0;g
    ').css(h).appendTo(c),b&&r.addClass("mce-visual-caret-before"),n(),k=g.ownerDocument.createRange(),k.setStart(s,0),k.setEnd(s,0),k):(s=a.insertInline(g,b),k=g.ownerDocument.createRange(),i(s.nextSibling)?(k.setStart(s,0),k.setEnd(s,0)):(k.setStart(s,1),k.setEnd(s,1)),k)}function m(){k(),s&&(b.remove(s),s=null),r&&(r.remove(),r=null),clearInterval(q)}function n(){q=h.setInterval(function(){d("div.mce-visual-caret",c).toggleClass("mce-visual-caret-hidden")},500)}function o(){h.clearInterval(q)}function p(){return".mce-visual-caret {position: absolute;background-color: black;background-color: currentcolor;}.mce-visual-caret-hidden {display: none;}*[data-mce-caret] {position: absolute;left: -1000px;right: auto;top: 0;margin: 0;padding: 0;}"}var q,r,s;return{show:l,hide:m,getCss:p,destroy:o}}}),g("82",[],function(){var a=function(a){var b,c,d,e;return e=a.getBoundingClientRect(),b=a.ownerDocument,c=b.documentElement,d=b.defaultView,{top:e.top+d.pageYOffset-c.clientTop,left:e.left+d.pageXOffset-c.clientLeft}},b=function(b){return b.inline?a(b.getBody()):{left:0,top:0}},c=function(a){var b=a.getBody();return a.inline?{left:b.scrollLeft,top:b.scrollTop}:{left:0,top:0}},d=function(a){var b=a.getBody(),c=a.getDoc().documentElement,d={left:b.scrollLeft,top:b.scrollTop},e={left:b.scrollLeft||c.scrollLeft,top:b.scrollTop||c.scrollTop};return a.inline?d:e},e=function(b,c){if(c.target.ownerDocument!==b.getDoc()){var e=a(b.getContentAreaContainer()),f=d(b);return{left:c.pageX-e.left+f.left,top:c.pageY-e.top+f.top}}return{left:c.pageX,top:c.pageY}},f=function(a,b,c){return{pageX:c.left-a.left+b.left,pageY:c.top-a.top+b.top}},g=function(a,d){return f(b(a),c(a),e(a,d))};return{calc:g}}),g("7r",["1t","1q","4e","8","h","82"],function(a,b,c,d,e,f){var g=a.isContentEditableFalse,h=a.isContentEditableTrue,i=function(a,b){return g(b)&&b!==a},j=function(a,b,c){return b!==c&&!a.dom.isChildOf(b,c)&&!g(b)},k=function(a){var b=a.cloneNode(!0);return b.removeAttribute("data-mce-selected"),b},l=function(a,b,c,d){var e=b.cloneNode(!0);a.dom.setStyles(e,{width:c,height:d}),a.dom.setAttrib(e,"data-mce-selected",null);var f=a.dom.create("div",{"class":"mce-drag-container","data-mce-bogus":"all",unselectable:"on",contenteditable:"false"});return a.dom.setStyles(f,{position:"absolute",opacity:.5,overflow:"hidden",border:0,padding:0,margin:0,width:c,height:d}),a.dom.setStyles(e,{margin:0,boxSizing:"border-box"}),f.appendChild(e),f},m=function(a,b){a.parentNode!==b&&b.appendChild(a)},n=function(a,b,c,d,e,f){var g=0,h=0;a.style.left=b.pageX+"px",a.style.top=b.pageY+"px",b.pageX+c>e&&(g=b.pageX+c-e),b.pageY+d>f&&(h=b.pageY+d-f),a.style.width=c-g+"px",a.style.height=d-h+"px"},o=function(a){a&&a.parentNode&&a.parentNode.removeChild(a)},p=function(a){return 0===a.button},q=function(a){return a.element},r=function(a,b){return{pageX:b.pageX-a.relX,pageY:b.pageY+5}},s=function(a,d){return function(e){if(p(e)){var f=b.find(d.dom.getParents(e.target),c.or(g,h));if(i(d.getBody(),f)){var j=d.dom.getPos(f),k=d.getBody(),m=d.getDoc().documentElement;a.element=f,a.screenX=e.screenX,a.screenY=e.screenY,a.maxX=(d.inline?k.scrollWidth:m.offsetWidth)-2,a.maxY=(d.inline?k.scrollHeight:m.offsetHeight)-2,a.relX=e.pageX-j.x,a.relY=e.pageY-j.y,a.width=f.offsetWidth,a.height=f.offsetHeight,a.ghost=l(d,f,a.width,a.height)}}}},t=function(a,b){var c=d.throttle(function(a,c){b._selectionOverrides.hideFakeCaret(),b.selection.placeCaretAt(a,c)},0);return function(d){var e=Math.max(Math.abs(d.screenX-a.screenX),Math.abs(d.screenY-a.screenY));if(q(a)&&!a.dragging&&e>10){var g=b.fire("dragstart",{target:a.element});if(g.isDefaultPrevented())return;a.dragging=!0,b.focus()}if(a.dragging){var h=r(a,f.calc(b,d));m(a.ghost,b.getBody()),n(a.ghost,h,a.width,a.height,a.maxX,a.maxY),c(d.clientX,d.clientY)}}},u=function(a){var b=a.getSel().getRangeAt(0),c=b.startContainer;return 3===c.nodeType?c.parentNode:c},v=function(a,b){return function(c){if(a.dragging&&j(b,u(b.selection),a.element)){var d=k(a.element),e=b.fire("drop",{targetClone:d,clientX:c.clientX,clientY:c.clientY});e.isDefaultPrevented()||(d=e.targetClone,b.undoManager.transact(function(){o(a.element),b.insertContent(b.dom.getOuterHTML(d)),b._selectionOverrides.hideFakeCaret()}))}x(a)}},w=function(a,b){return function(){x(a),a.dragging&&b.fire("dragend")}},x=function(a){a.dragging=!1,a.element=null,o(a.ghost)},y=function(a){var b,c,d,f,g,h,i={};b=e.DOM,h=document,c=s(i,a),d=t(i,a),f=v(i,a),g=w(i,a),a.on("mousedown",c),a.on("mousemove",d),a.on("mouseup",f),b.bind(h,"mousemove",d),b.bind(h,"mouseup",g),a.on("remove",function(){b.unbind(h,"mousemove",d),b.unbind(h,"mouseup",g)})},z=function(a){a.on("drop",function(b){var c="undefined"!=typeof b.clientX?a.getDoc().elementFromPoint(b.clientX,b.clientY):null;(g(c)||g(a.dom.getContentEditableParent(c)))&&b.preventDefault()})},A=function(a){y(a),z(a)};return{init:A}}),g("7c",["2j","68","1w","66","4x","4y","1u","20","5x","5a","7p","7q","1t","1y","7r","2b","9","7s","8","s"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t){function u(m){function u(a){return m.dom.hasClass(a,"mce-offscreen-selection")}function z(){var a=m.dom.get(S);return a?a.getElementsByTagName("*")[0]:a}function A(a){return m.dom.isBlock(a)}function B(a){a&&m.selection.setRng(a)}function C(){return m.selection.getRng()}function D(a,b){m.selection.scrollIntoView(a,b)}function E(a,b,c){var d;return d=m.fire("ShowCaret",{target:b,direction:a,before:c}),d.isDefaultPrevented()?null:(D(b,a===-1),R.show(c,b))}function F(a,b){return b=i.normalizeRange(a,Q,b),a==-1?h.fromRangeStart(b):h.fromRangeEnd(b)}function G(a){a.hasAttribute("data-mce-caret")&&(g.showCaretContainerBlock(a),B(C()),D(a[0]))}function H(){function a(a){for(var b=m.getBody();a&&a!=b;){if(v(a)||w(a))return a;a=a.parentNode}return null}function b(b){var c=!1;b.on("touchstart",function(){c=!1}),b.on("touchmove",function(){c=!0}),b.on("touchend",function(d){var e=a(d.target);w(e)&&(c||(d.preventDefault(),L(r.selectNode(b,e))))})}m.on("mouseup",function(a){var b=C();b.collapsed&&p.isXYInContentArea(m,a.clientX,a.clientY)&&B(r.renderCaretAtRange(m,b))}),m.on("click",function(b){var c;c=a(b.target),c&&(w(c)&&(b.preventDefault(),m.focus()),v(c)&&m.dom.isChildOf(c,m.selection.getNode())&&M())}),m.on("blur NewBlock",function(){M(),O()});var c=function(a){var b=new j(a);if(!a.firstChild)return!1;var c=h.before(a.firstChild),d=b.next(c);return d&&!y(d)&&!x(d)},d=function(a,b){var c=m.dom.getParent(a,m.dom.isBlock),d=m.dom.getParent(b,m.dom.isBlock);return c===d},e=function(a,b){var e=m.dom.getParent(a,m.dom.isBlock),f=m.dom.getParent(b,m.dom.isBlock);return e&&!d(e,f)&&c(e)};b(m),m.on("mousedown",function(b){var c;if(p.isXYInContentArea(m,b.clientX,b.clientY)!==!1)if(c=a(b.target))w(c)?(b.preventDefault(),L(r.selectNode(m,c))):(M(),v(c)&&b.shiftKey||n.isXYWithinRange(b.clientX,b.clientY,m.selection.getRng())||m.selection.placeCaretAt(b.clientX,b.clientY));else{M(),O();var d=l.closestCaret(Q,b.clientX,b.clientY);d&&(e(b.target,d.node)||(b.preventDefault(),m.getBody().focus(),B(E(1,d.node,d.before))))}}),m.on("keypress",function(a){if(!t.modifierPressed(a))switch(a.keyCode){default:w(m.selection.getNode())&&a.preventDefault()}}),m.on("getSelectionRange",function(a){var b=a.range;if(P){if(!P.parentNode)return void(P=null);b=b.cloneRange(),b.selectNode(P),a.range=b}}),m.on("setSelectionRange",function(a){var b;b=L(a.range,a.forward),b&&(a.range=b)}),m.on("AfterSetSelectionRange",function(a){var b=a.range;K(b)||O(),u(b.startContainer.parentNode)||M()}),m.on("focus",function(){s.setEditorTimeout(m,function(){m.selection.setRng(r.renderRangeCaret(m,m.selection.getRng()))},0)}),m.on("copy",function(a){var b=a.clipboardData;if(!a.isDefaultPrevented()&&a.clipboardData&&!q.ie){var c=z();c&&(a.preventDefault(),b.clearData(),b.setData("text/html",c.outerHTML),b.setData("text/plain",c.outerText))}}),o.init(m)}function I(){var a=m.contentStyles,b=".mce-content-body";a.push(R.getCss()),a.push(b+" .mce-offscreen-selection {position: absolute;left: -9999999999px;max-width: 1000000px;}"+b+" *[contentEditable=false] {cursor: default;}"+b+" *[contentEditable=true] {cursor: text;}")}function J(a){return g.isCaretContainer(a)||g.startsWithCaretContainer(a)||g.endsWithCaretContainer(a)}function K(a){return J(a.startContainer)||J(a.endContainer)}function L(b,g){var h,i,j,k,l,n,o,p,r,s,t=m.$,u=m.dom;if(!b)return null;if(b.collapsed){if(!K(b))if(g===!1){if(p=F(-1,b),w(p.getNode(!0)))return E(-1,p.getNode(!0),!1);if(w(p.getNode()))return E(-1,p.getNode(),!p.isAtEnd())}else{if(p=F(1,b),w(p.getNode()))return E(1,p.getNode(),!p.isAtEnd());if(w(p.getNode(!0)))return E(1,p.getNode(!0),!1)}return null}return k=b.startContainer,l=b.startOffset,n=b.endOffset,3==k.nodeType&&0==l&&w(k.parentNode)&&(k=k.parentNode,l=u.nodeIndex(k),k=k.parentNode),1!=k.nodeType?null:(n==l+1&&(h=k.childNodes[l]),w(h)?(r=s=h.cloneNode(!0),o=m.fire("ObjectSelected",{target:h,targetClone:r}),o.isDefaultPrevented()?null:(i=f.descendant(c.fromDom(m.getBody()),"#"+S).fold(function(){return t([])},function(a){return t([a.dom()])}),r=o.targetClone,0===i.length&&(i=t('
    ').attr("id",S),i.appendTo(m.getBody())),b=m.dom.createRng(),r===s&&q.ie?(i.empty().append('

    \xa0

    ').append(r),b.setStartAfter(i[0].firstChild.firstChild),b.setEndAfter(r)):(i.empty().append("\xa0").append(r).append("\xa0"),b.setStart(i[0].firstChild,1),b.setEnd(i[0].lastChild,0)),i.css({top:u.getPos(h,m.getBody()).y}),i[0].focus(),j=m.selection.getSel(),j.removeAllRanges(),j.addRange(b),a.each(e.descendants(c.fromDom(m.getBody()),"*[data-mce-selected]"),function(a){d.remove(a,"data-mce-selected")}),h.setAttribute("data-mce-selected",1),P=h,O(),b)):null)}function M(){P&&(P.removeAttribute("data-mce-selected"),f.descendant(c.fromDom(m.getBody()),"#"+S).each(b.remove),P=null)}function N(){R.destroy(),P=null}function O(){R.hide()}var P,Q=m.getBody(),R=new k(m.getBody(),A),S="sel-"+m.dom.uniqueId();return q.ceFalse&&(H(),I()),{showCaret:E,showBlockCaretContainer:G,hideFakeCaret:O,destroy:N}}var v=m.isContentEditableTrue,w=m.isContentEditableFalse,x=i.isAfterContentEditableFalse,y=i.isBeforeContentEditableFalse;return u}),g("7t",["h"],function(a){function b(b,c,d){for(var e=[];c&&c!=b;c=c.parentNode)e.push(a.nodeIndex(c,d));return e}function c(a,b){var c,d,e;for(d=a,c=b.length-1;c>=0;c--){if(e=d.childNodes,b[c]>e.length-1)return null;d=e[b[c]]}return d}return{create:b,resolve:c}}),g("7d",["s","k","f","7t","l","g","9","c","8","1u","20","5a"],function(a,b,c,d,e,f,g,h,i,j,k,l){return function(c){function d(a,b){try{c.getDoc().execCommand(a,!1,b)}catch(a){}}function k(){var a=c.getDoc().documentMode;return a?a:6}function l(a){return a.isDefaultPrevented()}function m(a){var b,d;a.dataTransfer&&(c.selection.isCollapsed()&&"IMG"==a.target.tagName&&Y.select(a.target),b=c.selection.getContent(),b.length>0&&(d=da+escape(c.id)+","+escape(b),a.dataTransfer.setData(ea,d)))}function n(a){var b;return a.dataTransfer&&(b=a.dataTransfer.getData(ea),b&&b.indexOf(da)>=0)?(b=b.substr(da.length).split(","),{id:unescape(b[0]),html:unescape(b[1])}):null}function o(a,b){c.queryCommandSupported("mceInsertClipboardContent")?c.execCommand("mceInsertClipboardContent",!1,{content:a,internal:b}):c.execCommand("mceInsertContent",!1,a)}function p(){function a(a){var b=X.create("body"),c=a.cloneContents();return b.appendChild(c),Y.serializer.serialize(b,{format:"html"})}function d(d){if(!d.setStart){if(d.item)return!1;var e=d.duplicate();return e.moveToElementText(c.getBody()),b.compareRanges(d,e)}var f=a(d),g=X.createRng();g.selectNode(c.getBody());var h=a(g);return f===h}c.on("keydown",function(a){var b,e,f=a.keyCode;if(!l(a)&&(f==W||f==V)){if(b=c.selection.isCollapsed(),e=c.getBody(),b&&!X.isEmpty(e))return;if(!b&&!d(c.selection.getRng()))return;a.preventDefault(),c.setContent(""),e.firstChild&&X.isBlock(e.firstChild)?c.selection.setCursorLocation(e.firstChild,0):c.selection.setCursorLocation(e,0),c.nodeChanged()}})}function q(){c.shortcuts.add("meta+a",null,"SelectAll")}function r(){c.settings.content_editable||X.bind(c.getDoc(),"mousedown mouseup",function(a){var b;if(a.target==c.getDoc().documentElement)if(b=Y.getRng(),c.getBody().focus(),"mousedown"==a.type){if(j.isCaretContainer(b.startContainer))return;Y.placeCaretAt(a.clientX,a.clientY)}else Y.setRng(b)})}function s(){c.on("keydown",function(a){if(!l(a)&&a.keyCode===V){if(!c.getBody().getElementsByTagName("hr").length)return;if(Y.isCollapsed()&&0===Y.getRng(!0).startOffset){var b=Y.getNode(),d=b.previousSibling;if("HR"==b.nodeName)return X.remove(b),void a.preventDefault();d&&d.nodeName&&"hr"===d.nodeName.toLowerCase()&&(X.remove(d),a.preventDefault())}}})}function t(){window.Range.prototype.getClientRects||c.on("mousedown",function(a){if(!l(a)&&"HTML"===a.target.nodeName){var b=c.getBody();b.blur(),i.setEditorTimeout(c,function(){b.focus()})}})}function u(){c.on("click",function(a){var b=a.target;/^(IMG|HR)$/.test(b.nodeName)&&"false"!==X.getContentEditableParent(b)&&(a.preventDefault(),c.selection.select(b),c.nodeChanged()),"A"==b.nodeName&&X.hasClass(b,"mce-item-anchor")&&(a.preventDefault(),Y.select(b))})}function v(){function a(){var a=X.getAttribs(Y.getStart().cloneNode(!1));return function(){var b=Y.getStart();b!==c.getBody()&&(X.setAttrib(b,"style",null),U(a,function(a){b.setAttributeNode(a.cloneNode(!0))}))}}function b(){return!Y.isCollapsed()&&X.getParent(Y.getStart(),X.isBlock)!=X.getParent(Y.getEnd(),X.isBlock)}c.on("keypress",function(d){var e;if(!l(d)&&(8==d.keyCode||46==d.keyCode)&&b())return e=a(),c.getDoc().execCommand("delete",!1,null),e(),d.preventDefault(),!1}),X.bind(c.getDoc(),"cut",function(d){var e;!l(d)&&b()&&(e=a(),i.setEditorTimeout(c,function(){e()}))})}function w(){document.body.setAttribute("role","application")}function x(){c.on("keydown",function(a){if(!l(a)&&a.keyCode===V&&Y.isCollapsed()&&0===Y.getRng(!0).startOffset){var b=Y.getNode().previousSibling;if(b&&b.nodeName&&"table"===b.nodeName.toLowerCase())return a.preventDefault(),!1}})}function y(){k()>7||(d("RespectVisibilityInDesign",!0),c.contentStyles.push(".mceHideBrInPre pre br {display: none}"),X.addClass(c.getBody(),"mceHideBrInPre"),$.addNodeFilter("pre",function(a){for(var b,c,d,f,g=a.length;g--;)for(b=a[g].getAll("br"),c=b.length;c--;)d=b[c],f=d.prev,f&&3===f.type&&"\n"!=f.value.charAt(f.value-1)?f.value+="\n":d.parent.insert(new e("#text",3),d,!0).value="\n"}),_.addNodeFilter("pre",function(a){for(var b,c,d,e,f=a.length;f--;)for(b=a[f].getAll("br"),c=b.length;c--;)d=b[c],e=d.prev,e&&3==e.type&&(e.value=e.value.replace(/\r?\n$/,""))}))}function z(){X.bind(c.getBody(),"mouseup",function(){var a,b=Y.getNode();"IMG"==b.nodeName&&((a=X.getStyle(b,"width"))&&(X.setAttrib(b,"width",a.replace(/[^0-9%]+/g,"")),X.setStyle(b,"width","")),(a=X.getStyle(b,"height"))&&(X.setAttrib(b,"height",a.replace(/[^0-9%]+/g,"")),X.setStyle(b,"height","")))})}function A(){c.on("keydown",function(b){var d,e,f,g,h;if(!l(b)&&b.keyCode==a.BACKSPACE&&(d=Y.getRng(),e=d.startContainer,f=d.startOffset,g=X.getRoot(),h=e,d.collapsed&&0===f)){for(;h&&h.parentNode&&h.parentNode.firstChild==h&&h.parentNode!=g;)h=h.parentNode;"BLOCKQUOTE"===h.tagName&&(c.formatter.toggle("blockquote",null,h),d=X.createRng(),d.setStart(e,0),d.setEnd(e,0),Y.setRng(d))}})}function B(){function a(){S(),d("StyleWithCSS",!1),d("enableInlineTableEditing",!1),Z.object_resizing||d("enableObjectResizing",!1)}Z.readonly||c.on("BeforeExecCommand MouseDown",a)}function C(){function a(){U(X.select("a"),function(a){var b=a.parentNode,c=X.getRoot();if(b.lastChild===a){for(;b&&!X.isBlock(b);){if(b.parentNode.lastChild!==b||b===c)return;b=b.parentNode}X.add(b,"br",{"data-mce-bogus":1})}})}c.on("SetContent ExecCommand",function(b){"setcontent"!=b.type&&"mceInsertLink"!==b.command||a()})}function D(){Z.forced_root_block&&c.on("init",function(){d("DefaultParagraphSeparator",Z.forced_root_block)})}function E(){c.on("keydown",function(a){var b;l(a)||a.keyCode!=V||(b=c.getDoc().selection.createRange(),b&&b.item&&(a.preventDefault(),c.undoManager.beforeChange(),X.remove(b.item(0)),c.undoManager.add()))})}function F(){var a;k()>=10&&(a="",U("p div h1 h2 h3 h4 h5 h6".split(" "),function(b,c){a+=(c>0?",":"")+b+":empty"}),c.contentStyles.push(a+"{padding-right: 1px !important}"))}function G(){k()<9&&($.addNodeFilter("noscript",function(a){for(var b,c,d=a.length;d--;)b=a[d],c=b.firstChild,c&&b.attr("data-mce-innertext",c.value)}),_.addNodeFilter("noscript",function(a){for(var b,c,d,g=a.length;g--;)b=a[g],c=a[g].firstChild,c?c.value=f.decode(c.value):(d=b.attributes.map["data-mce-innertext"],d&&(b.attr("data-mce-innertext",null),c=new e("#text",3),c.value=d,c.raw=!0,b.append(c)))}))}function H(){function a(a,b){var c=h.createTextRange();try{c.moveToPoint(a,b)}catch(a){c=null}return c}function b(b){var d;b.button?(d=a(b.x,b.y),d&&(d.compareEndPoints("StartToStart",e)>0?d.setEndPoint("StartToStart",e):d.setEndPoint("EndToEnd",e),d.select())):c()}function c(){var a=g.selection.createRange();e&&!a.item&&0===a.compareEndPoints("StartToEnd",a)&&e.select(),X.unbind(g,"mouseup",c),X.unbind(g,"mousemove",b),e=d=0}var d,e,f,g=X.doc,h=g.body;g.documentElement.unselectable=!0,X.bind(g,"mousedown contextmenu",function(h){if("HTML"===h.target.nodeName){if(d&&c(),f=g.documentElement,f.scrollHeight>f.clientHeight)return;d=1,e=a(h.x,h.y),e&&(X.bind(g,"mouseup",c),X.bind(g,"mousemove",b),X.getRoot().focus(),e.select())}})}function I(){c.on("keyup focusin mouseup",function(b){65==b.keyCode&&a.metaKeyPressed(b)||("keyup"!==b.type||c.selection.isCollapsed())&&Y.normalize()},!0)}function J(){c.contentStyles.push("img:-moz-broken {-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}")}function K(){c.inline||c.on("keydown",function(){document.activeElement==document.body&&c.getWin().focus()})}function L(){c.inline||(c.contentStyles.push("body {min-height: 150px}"),c.on("click",function(a){var b;if("HTML"==a.target.nodeName){if(g.ie>11)return void c.getBody().focus();b=c.selection.getRng(),c.getBody().focus(),c.selection.setRng(b),c.selection.normalize(),c.nodeChanged()}}))}function M(){g.mac&&c.on("keydown",function(b){!a.metaKeyPressed(b)||b.shiftKey||37!=b.keyCode&&39!=b.keyCode||(b.preventDefault(),c.selection.getSel().modify("move",37==b.keyCode?"backward":"forward","lineboundary"))})}function N(){d("AutoUrlDetect",!1)}function O(){c.on("click",function(a){var b=a.target;do if("A"===b.tagName)return void a.preventDefault();while(b=b.parentNode)}),c.contentStyles.push(".mce-content-body {-webkit-touch-callout: none}")}function P(){c.on("init",function(){c.dom.bind(c.getBody(),"submit",function(a){a.preventDefault()})})}function Q(){$.addNodeFilter("br",function(a){for(var b=a.length;b--;)"Apple-interchange-newline"==a[b].attr("class")&&a[b].remove()})}function R(){c.on("dragstart",function(a){m(a)}),c.on("drop",function(a){if(!l(a)){var d=n(a);if(d&&d.id!=c.id){a.preventDefault();var e=b.getCaretRangeFromPoint(a.x,a.y,c.getDoc());Y.setRng(e),o(d.html,!0)}}})}function S(){}function T(){var a;return!aa||c.removed?0:(a=c.selection.getSel(),!a||!a.rangeCount||0===a.rangeCount)}var U=h.each,V=a.BACKSPACE,W=a.DELETE,X=c.dom,Y=c.selection,Z=c.settings,$=c.parser,_=c.serializer,aa=g.gecko,ba=g.ie,ca=g.webkit,da="data:text/mce-internal,",ea=ba?"Text":"URL";return A(),p(),g.windowsPhone||I(),ca&&(r(),u(),D(),P(),x(),Q(),g.iOS?(K(),L(),O()):q()),ba&&g.ie<11&&(s(),w(),y(),z(),E(),F(),G(),H()),g.ie>=11&&(L(),x()),g.ie&&(q(),N(),R()),aa&&(s(),t(),v(),B(),C(),J(),M(),x()),{refreshContentEditable:S,isHidden:T}}}),g("6t",["4t","1w","66","28","5l","5","77","h","v","r","78","2l","79","o","l","m","7a","7b","7c","w","8","7d","c"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w){var x=h.DOM,y=function(d,e){var f=b.fromDom(d.getDoc().head),g=b.fromTag("style");c.set(g,"type","text/css"),a.append(g,b.fromText(e)),a.append(f,g)},z=function(a){var b=new n(a.settings,a.schema);return b.addAttributeFilter("src,href,style,tabindex",function(b,c){for(var d,e,f,g=b.length,h=a.dom;g--;)if(d=b[g],e=d.attr(c),f="data-mce-"+c,!d.attributes.map[f]){if(0===e.indexOf("data:")||0===e.indexOf("blob:"))continue;"style"===c?(e=h.serializeStyle(h.parseStyle(e),d.name),e.length||(e=null),d.attr(f,e),d.attr(c,e)):"tabindex"===c?(d.attr(f,e),d.attr(c,null)):d.attr(f,a.convertURL(e,c,d.name))}}),b.addNodeFilter("script",function(a){for(var b,c,d=a.length;d--;)b=a[d],c=b.attr("type")||"no/type",0!==c.indexOf("mce-")&&b.attr("type","mce-"+c)}),b.addNodeFilter("#cdata",function(a){for(var b,c=a.length;c--;)b=a[c],b.type=8,b.name="#comment",b.value="[CDATA["+b.value+"]]"}),b.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",function(b){for(var c,d=b.length,e=a.schema.getNonEmptyElements();d--;)c=b[d],c.isEmpty(e)&&0===c.getAll("br").length&&(c.append(new o("br",1)).shortEnded=!0)}),b},A=function(a){a.settings.auto_focus&&u.setEditorTimeout(a,function(){var b;b=a.settings.auto_focus===!0?a:a.editorManager.get(a.settings.auto_focus),b.destroyed||b.focus()},100)},B=function(a){a.bindPendingEventDelegates(),a.initialized=!0,a.fire("init"),a.focus(!0),a.nodeChanged({initial:!0}),a.execCallback("init_instance_callback",a),A(a)},C=function(a){return a.inline?x.styleSheetLoader:a.dom.styleSheetLoader},D=function(a,b){var c,l,n=a.settings,o=a.getElement(),u=a.getDoc();n.inline||(a.getElement().style.visibility=a.orgVisibility),b||n.content_editable||(u.open(),u.write(a.iframeHTML),u.close()),n.content_editable&&(a.on("remove",function(){var a=this.getBody();x.removeClass(a,"mce-content-body"),x.removeClass(a,"mce-edit-focus"),x.setAttrib(a,"contentEditable",null)}),x.addClass(o,"mce-content-body"),a.contentDocument=u=n.content_document||d,a.contentWindow=n.content_window||e,a.bodyElement=o,n.content_document=n.content_window=null,n.root_name=o.nodeName.toLowerCase()),c=a.getBody(),c.disabled=!0,a.readonly=n.readonly,a.readonly||(a.inline&&"static"===x.getStyle(c,"position",!0)&&(c.style.position="relative"),c.contentEditable=a.getParam("content_editable_state",!0)),c.disabled=!1,a.editorUpload=new k(a),a.schema=new p(n),a.dom=new h(u,{keep_values:!0,url_converter:a.convertURL,url_converter_scope:a,hex_colors:n.force_hex_style_colors,class_filter:n.class_filter,update_styles:!0,root_element:a.inline?a.getBody():null,collect:n.content_editable,schema:a.schema,onSetAttrib:function(b){a.fire("SetAttrib",b)}}),a.parser=z(a),a.serializer=new j(n,a),a.selection=new i(a.dom,a.getWin(),a.serializer,a),a.formatter=new f(a),a.undoManager=new t(a),a._nodeChangeDispatcher=new r(a),a._selectionOverrides=new s(a),g.setup(a),q.setup(a),m.setup(a),a.fire("PreInit"),n.browser_spellcheck||n.gecko_spellcheck||(u.body.spellcheck=!1,x.setAttrib(c,"spellcheck","false")),a.quirks=new v(a),a.fire("PostRender"),n.directionality&&(c.dir=n.directionality),n.nowrap&&(c.style.whiteSpace="nowrap"),n.protect&&a.on("BeforeSetContent",function(a){w.each(n.protect,function(b){a.content=a.content.replace(b,function(a){return""})})}),a.on("SetContent",function(){a.addVisual(a.getBody())}),n.padd_empty_editor&&a.on("PostProcess",function(a){a.content=a.content.replace(/^(]*>( | |\s|\u00a0|
    |)<\/p>[\r\n]*|
    [\r\n]*)$/,"")}),a.load({initial:!0,format:"html"}),a.startContent=a.getContent({format:"raw"}),a.on("compositionstart compositionend",function(b){a.composing="compositionstart"===b.type}),a.contentStyles.length>0&&(l="",w.each(a.contentStyles,function(a){l+=a+"\r\n"}),a.dom.addStyle(l)),C(a).loadAll(a.contentCSS,function(b){B(a)},function(b){B(a)}),n.content_style&&y(a,n.content_style)};return{initContentBody:D}}),g("5n",["j"],function(a){return a.PluginManager}),g("5o",["j"],function(a){return a.ThemeManager}),g("5m",["28","5l","h","9","6t","5n","5o","c","2i"],function(a,b,c,d,e,f,g,h,i){var j=c.DOM,k=function(a,b,c){var d,e,g=f.get(c);if(d=f.urls[c]||a.documentBaseUrl.replace(/\/$/,""),c=h.trim(c),g&&h.inArray(b,c)===-1){if(h.each(f.dependencies(c),function(c){k(a,b,c)}),a.plugins[c])return;e=new g(a,d,a.$),a.plugins[c]=e,e.init&&(e.init(a,d),b.push(c))}},l=function(a){return a.replace(/^\-/,"")},m=function(a){var b=[];h.each(a.settings.plugins.split(/[ ,]/),function(c){k(a,b,l(c))})},n=function(a){var b,c=a.settings;c.theme&&("function"!=typeof c.theme?(c.theme=l(c.theme),b=g.get(c.theme),a.theme=new b(a,g.urls[c.theme]),a.theme.init&&a.theme.init(a,g.urls[c.theme]||a.documentBaseUrl.replace(/\/$/,""),a.$)):a.theme=c.theme)},o=function(a){var b,c,d,e,f,g=a.settings,h=a.getElement();return g.render_ui&&a.theme&&(a.orgDisplay=h.style.display,"function"!=typeof g.theme?(b=g.width||j.getStyle(h,"width")||"100%",c=g.height||j.getStyle(h,"height")||h.offsetHeight,d=g.min_height||100,e=/^[0-9\.]+(|px)$/i,e.test(""+b)&&(b=Math.max(parseInt(b,10),100)),e.test(""+c)&&(c=Math.max(parseInt(c,10),d)),f=a.theme.renderUI({targetNode:h,width:b,height:c,deltaWidth:g.delta_width,deltaHeight:g.delta_height}),g.content_editable||(c=(f.iframeHeight||c)+("number"==typeof c?f.deltaHeight||0:""),c",f.document_base_url!=a.documentBaseUrl&&(a.iframeHTML+=''),!d.caretAfter&&f.ie7_compat&&(a.iframeHTML+=''),a.iframeHTML+='',c=f.body_id||"tinymce",c.indexOf("=")!=-1&&(c=a.getParam("body_id","","hash"),c=c[a.id]||c),e=f.body_class||"",e.indexOf("=")!=-1&&(e=a.getParam("body_class","","hash"),e=e[a.id]||""),f.content_security_policy&&(a.iframeHTML+=''),a.iframeHTML+='
    ';var g=j.create("iframe",{id:a.id+"_ifr",frameBorder:"0",allowTransparency:"true",title:a.editorManager.translate("Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help"),style:{width:"100%",height:b.height,display:"block"}});g.onload=function(){g.onload=null,a.fire("load")};var h=p(a,g);return a.contentAreaContainer=b.iframeContainer,a.iframeElement=g,j.add(b.iframeContainer,g),h},r=function(a){var b,c=a.settings,d=a.getElement();if(a.rtl=c.rtl_ui||a.editorManager.i18n.rtl,a.editorManager.i18n.setCode(c.language),c.aria_label=c.aria_label||j.getAttrib(d,"aria-label",a.getLang("aria.rich_text_area")),a.fire("ScriptsLoaded"),n(a),m(a),b=o(a),c.content_css&&h.each(h.explode(c.content_css),function(b){a.contentCSS.push(a.documentBaseURI.toAbsolute(b))}),c.content_editable)return e.initContentBody(a);var f=q(a,b);b.editorContainer&&(j.get(b.editorContainer).style.display=a.orgDisplay,a.hidden=j.isHidden(b.editorContainer)),a.getElement().style.display="none",j.setAttrib(a.id,"aria-hidden",!0),f||e.initContentBody(a)};return{init:r}}),g("2f",["5l","h","a","i","9","2l","5m","13","5n","5o","c","12"],function(a,b,c,d,e,f,g,h,i,j,k,l){var m=b.DOM,n=function(a,b){var c=a.settings,e=d.ScriptLoader;if(c.language&&"en"!=c.language&&!c.language_url&&(c.language_url=a.editorManager.baseURL+"/langs/"+c.language+".js"),c.language_url&&e.add(c.language_url),c.theme&&"function"!=typeof c.theme&&"-"!=c.theme.charAt(0)&&!j.urls[c.theme]){var h=c.theme_url;h=h?a.documentBaseURI.toAbsolute(h):"themes/"+c.theme+"/theme"+b+".js",j.load(c.theme,h)}k.isArray(c.plugins)&&(c.plugins=c.plugins.join(" ")),k.each(c.external_plugins,function(a,b){i.load(b,a),c.plugins+=" "+b}),k.each(c.plugins.split(/[ ,]/),function(a){if(a=k.trim(a),a&&!i.urls[a])if("-"===a.charAt(0)){a=a.substr(1,a.length);var c=i.dependencies(a);k.each(c,function(a){var c={prefix:"plugins/",resource:a,suffix:"/plugin"+b+".js"};a=i.createUrl(c,a),i.load(a.resource,a)})}else i.load(a,{prefix:"plugins/",resource:a,suffix:"/plugin"+b+".js"})}),e.loadQueue(function(){a.removed||g.init(a)},a,function(b){f.pluginLoadError(a,b[0]),a.removed||g.init(a)})},o=function(b){function d(){m.unbind(a,"ready",d),b.render()}var f=b.settings,g=b.id;if(!c.Event.domLoaded)return void m.bind(a,"ready",d);if(b.getElement()&&e.contentEditable){f.inline?b.inline=!0:(b.orgVisibility=b.getElement().style.visibility,b.getElement().style.visibility="hidden");var i=b.getElement().form||m.getParent(g,"form");i&&(b.formElement=i,f.hidden_input&&!/TEXTAREA|INPUT/i.test(b.getElement().nodeName)&&(m.insertAfter(m.create("input",{type:"hidden",name:g}),g),b.hasHiddenInput=!0),b.formEventDelegate=function(a){b.fire(a.type,a)},m.bind(i,"submit reset",b.formEventDelegate),b.on("reset",function(){b.setContent(b.startContent,{format:"raw"})}),!f.submit_patch||i.submit.nodeType||i.submit.length||i._mceOldSubmit||(i._mceOldSubmit=i.submit,i.submit=function(){return b.editorManager.triggerSave(),b.setDirty(!1),i._mceOldSubmit(i)})),b.windowManager=new l(b),b.notificationManager=new h(b),"xml"===f.encoding&&b.on("GetContent",function(a){a.save&&(a.content=m.encode(a.content))}),f.add_form_submit_trigger&&b.on("submit",function(){b.initialized&&b.save()}),f.add_unload_trigger&&(b._beforeUnload=function(){!b.initialized||b.destroyed||b.isHidden()||b.save({format:"raw",no_events:!0,set_dirty:!1})},b.editorManager.on("BeforeUnload",b._beforeUnload)),b.editorManager.add(b),n(b,b.suffix)}};return{render:o}}),g("2g",[],function(){ +function a(a,b,c){try{a.getDoc().execCommand(b,!1,c)}catch(a){}}function b(a){var b,c;return b=a.getBody(),c=function(b){a.dom.getParents(b.target,"a").length>0&&b.preventDefault()},a.dom.bind(b,"click",c),{unbind:function(){a.dom.unbind(b,"click",c)}}}function c(c,d){c._clickBlocker&&(c._clickBlocker.unbind(),c._clickBlocker=null),d?(c._clickBlocker=b(c),c.selection.controlSelection.hideResizeRect(),c.readonly=!0,c.getBody().contentEditable=!1):(c.readonly=!1,c.getBody().contentEditable=!0,a(c,"StyleWithCSS",!1),a(c,"enableInlineTableEditing",!1),a(c,"enableObjectResizing",!1),c.focus(),c.nodeChanged())}function d(a,b){var d=a.readonly?"readonly":"design";b!=d&&(a.initialized?c(a,"readonly"==b):a.on("init",function(){c(a,"readonly"==b)}),a.fire("SwitchMode",{mode:b}))}return{setMode:d}}),g("2h",[],function(){var a=function(a,b,c){var d=a.sidebars?a.sidebars:[];d.push({name:b,settings:c}),a.sidebars=d};return{add:a}}),g("16",["j","d","h","x","14","2e","9","q","2f","2g","15","2h","c","y","2i"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o){function p(c,e,h){var i,j,l=this;i=l.documentBaseUrl=h.documentBaseURL,j=h.baseURI,e=f.getEditorSettings(l,c,i,h.defaultSettings,e),l.settings=e,a.language=e.language||"en",a.languageLoad=e.language_load,a.baseURL=h.baseURL,l.id=c,l.setDirty(!1),l.plugins={},l.documentBaseURI=new n(e.document_base_url,{base_uri:j}),l.baseURI=j,l.contentCSS=[],l.contentStyles=[],l.shortcuts=new k(l),l.loadedCSS={},l.editorCommands=new d(l),l.suffix=h.suffix,l.editorManager=h,l.inline=e.inline,e.cache_suffix&&(g.cacheSuffix=e.cache_suffix.replace(/^[\?\&]+/,"")),e.override_viewport===!1&&(g.overrideViewPort=!1),h.fire("SetupEditor",l),l.execCallback("setup",l),l.$=b.overrideDefaults(function(){return{context:l.inline?l.getBody():l.getDoc(),element:l.getBody()}})}var q=c.DOM,r=m.extend,s=m.each,t=m.trim,u=m.resolve,v=g.gecko,w=g.ie;return p.prototype={render:function(){i.render(this)},focus:function(a){function b(a){return f.dom.getParent(a,function(a){return"true"===f.dom.getContentEditable(a)})}var c,d,e,f=this,h=f.selection,i=f.settings.content_editable,j=f.getDoc(),k=f.getBody();if(!f.removed){if(!a){if(c=h.getRng(),c.item&&(d=c.item(0)),f.quirks.refreshContentEditable(),e=b(h.getNode()),f.$.contains(k,e))return e.focus(),h.normalize(),void f.editorManager.setActive(f);if(i||(g.opera||f.getBody().focus(),f.getWin().focus()),v||i){if(k.setActive)try{k.setActive()}catch(a){k.focus()}else f.inline&&document.activeElement!==k&&f.selection.setRng(f.lastRng),k.focus();i&&h.normalize()}d&&d.ownerDocument==j&&(c=j.body.createControlRange(),c.addElement(d),c.select())}f.editorManager.setActive(f)}},execCallback:function(a){var b,c=this,d=c.settings[a];if(d)return c.callbackLookup&&(b=c.callbackLookup[a])&&(d=b.func,b=b.scope),"string"==typeof d&&(b=d.replace(/\.\w+$/,""),b=b?u(b):0,d=u(d),c.callbackLookup=c.callbackLookup||{},c.callbackLookup[a]={func:d,scope:b}),d.apply(b||c,Array.prototype.slice.call(arguments,1))},translate:function(a){if(a&&m.is(a,"string")){var b=this.settings.language||"en",c=this.editorManager.i18n;a=c.data[b+"."+a]||a.replace(/\{\#([^\}]+)\}/g,function(a,d){return c.data[b+"."+d]||"{#"+d+"}"})}return this.editorManager.translate(a)},getLang:function(a,b){return this.editorManager.i18n.data[(this.settings.language||"en")+"."+a]||(void 0!==b?b:"{#"+a+"}")},getParam:function(a,b,c){var d,e=a in this.settings?this.settings[a]:b;return"hash"===c?(d={},"string"==typeof e?s(e.indexOf("=")>0?e.split(/[;,](?![^=;,]*(?:[;,]|$))/):e.split(","),function(a){a=a.split("="),a.length>1?d[t(a[0])]=t(a[1]):d[t(a[0])]=t(a)}):d=e,d):e},nodeChanged:function(a){this._nodeChangeDispatcher.nodeChanged(a)},addButton:function(a,b){var c=this;b.cmd&&(b.onclick=function(){c.execCommand(b.cmd)}),b.text||b.icon||(b.icon=a),c.buttons=c.buttons||{},b.tooltip=b.tooltip||b.title,c.buttons[a]=b},addSidebar:function(a,b){return l.add(this,a,b)},addMenuItem:function(a,b){var c=this;b.cmd&&(b.onclick=function(){c.execCommand(b.cmd)}),c.menuItems=c.menuItems||{},c.menuItems[a]=b},addContextToolbar:function(a,b){var c,d=this;d.contextToolbars=d.contextToolbars||[],"string"==typeof a&&(c=a,a=function(a){return d.dom.is(a,c)}),d.contextToolbars.push({id:o.uuid("mcet"),predicate:a,items:b})},addCommand:function(a,b,c){this.editorCommands.addCommand(a,b,c)},addQueryStateHandler:function(a,b,c){this.editorCommands.addQueryStateHandler(a,b,c)},addQueryValueHandler:function(a,b,c){this.editorCommands.addQueryValueHandler(a,b,c)},addShortcut:function(a,b,c,d){this.shortcuts.add(a,b,c,d)},execCommand:function(a,b,c,d){return this.editorCommands.execCommand(a,b,c,d)},queryCommandState:function(a){return this.editorCommands.queryCommandState(a)},queryCommandValue:function(a){return this.editorCommands.queryCommandValue(a)},queryCommandSupported:function(a){return this.editorCommands.queryCommandSupported(a)},show:function(){var a=this;a.hidden&&(a.hidden=!1,a.inline?a.getBody().contentEditable=!0:(q.show(a.getContainer()),q.hide(a.id)),a.load(),a.fire("show"))},hide:function(){var a=this,b=a.getDoc();a.hidden||(w&&b&&!a.inline&&b.execCommand("SelectAll"),a.save(),a.inline?(a.getBody().contentEditable=!1,a==a.editorManager.focusedEditor&&(a.editorManager.focusedEditor=null)):(q.hide(a.getContainer()),q.setStyle(a.id,"display",a.orgDisplay)),a.hidden=!0,a.fire("hide"))},isHidden:function(){return!!this.hidden},setProgressState:function(a,b){this.fire("ProgressState",{state:a,time:b})},load:function(a){var b,c=this,d=c.getElement();return c.removed?"":d?(a=a||{},a.load=!0,b=c.setContent(void 0!==d.value?d.value:d.innerHTML,a),a.element=d,a.no_events||c.fire("LoadContent",a),a.element=d=null,b):void 0},save:function(a){var b,c,d=this,e=d.getElement();if(e&&d.initialized&&!d.removed)return a=a||{},a.save=!0,a.element=e,b=a.content=d.getContent(a),a.no_events||d.fire("SaveContent",a),"raw"==a.format&&d.fire("RawSaveContent",a),b=a.content,/TEXTAREA|INPUT/i.test(e.nodeName)?e.value=b:(d.inline||(e.innerHTML=b),(c=q.getParent(d.id,"form"))&&s(c.elements,function(a){if(a.name==d.id)return a.value=b,!1})),a.element=e=null,a.set_dirty!==!1&&d.setDirty(!1),b},setContent:function(a,b){var c,d,e=this,f=e.getBody();return b=b||{},b.format=b.format||"html",b.set=!0,b.content=a,b.no_events||e.fire("BeforeSetContent",b),a=b.content,0===a.length||/^\s+$/.test(a)?(d=w&&w<11?"":'
    ',"TABLE"==f.nodeName?a=""+d+"":/^(UL|OL)$/.test(f.nodeName)&&(a="
  • "+d+"
  • "),c=e.settings.forced_root_block,c&&e.schema.isValidChild(f.nodeName.toLowerCase(),c.toLowerCase())?(a=d,a=e.dom.createHTML(c,e.settings.forced_root_block_attrs,a)):w||a||(a='
    '),e.dom.setHTML(f,a),e.fire("SetContent",b)):("raw"!==b.format&&(a=new h({validate:e.validate},e.schema).serialize(e.parser.parse(a,{isRootContent:!0}))),b.content=t(a),e.dom.setHTML(f,b.content),b.no_events||e.fire("SetContent",b)),b.content},getContent:function(a){var b,c=this,d=c.getBody();return c.removed?"":(a=a||{},a.format=a.format||"html",a.get=!0,a.getInner=!0,a.no_events||c.fire("BeforeGetContent",a),b="raw"==a.format?m.trim(c.serializer.getTrimmedContent()):"text"==a.format?d.innerText||d.textContent:c.serializer.serialize(d,a),"text"!=a.format?a.content=t(b):a.content=b,a.no_events||c.fire("GetContent",a),a.content)},insertContent:function(a,b){b&&(a=r({content:a},b)),this.execCommand("mceInsertContent",!1,a)},isDirty:function(){return!this.isNotDirty},setDirty:function(a){var b=!this.isNotDirty;this.isNotDirty=!a,a&&a!=b&&this.fire("dirty")},setMode:function(a){j.setMode(this,a)},getContainer:function(){var a=this;return a.container||(a.container=q.get(a.editorContainer||a.id+"_parent")),a.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return this.targetElm||(this.targetElm=q.get(this.id)),this.targetElm},getWin:function(){var a,b=this;return b.contentWindow||(a=b.iframeElement,a&&(b.contentWindow=a.contentWindow)),b.contentWindow},getDoc:function(){var a,b=this;return b.contentDocument||(a=b.getWin(),a&&(b.contentDocument=a.document)),b.contentDocument},getBody:function(){var a=this.getDoc();return this.bodyElement||(a?a.body:null)},convertURL:function(a,b,c){var d=this,e=d.settings;return e.urlconverter_callback?d.execCallback("urlconverter_callback",a,c,!0,b):!e.convert_urls||c&&"LINK"==c.nodeName||0===a.indexOf("file:")||0===a.length?a:e.relative_urls?d.documentBaseURI.toRelative(a):a=d.documentBaseURI.toAbsolute(a,e.remove_script_host)},addVisual:function(a){var b,c=this,d=c.settings,e=c.dom;a=a||c.getBody(),void 0===c.hasVisual&&(c.hasVisual=d.visual),s(e.select("table,a",a),function(a){var f;switch(a.nodeName){case"TABLE":return b=d.visual_table_class||"mce-item-table",f=e.getAttrib(a,"border"),void(f&&"0"!=f||!c.hasVisual?e.removeClass(a,b):e.addClass(a,b));case"A":return void(e.getAttrib(a,"href",!1)||(f=e.getAttrib(a,"name")||a.id,b=d.visual_anchor_class||"mce-item-anchor",f&&c.hasVisual?e.addClass(a,b):e.removeClass(a,b)))}}),c.fire("VisualAid",{element:a,hasVisual:c.hasVisual})},remove:function(){var a=this;a.removed||(a.save(),a.removed=1,a.unbindAllNativeEvents(),a.hasHiddenInput&&q.remove(a.getElement().nextSibling),a.inline||(w&&w<10&&a.getDoc().execCommand("SelectAll",!1,null),q.setStyle(a.id,"display",a.orgDisplay),a.getBody().onload=null),a.fire("remove"),a.editorManager.remove(a),q.remove(a.getContainer()),a._selectionOverrides.destroy(),a.editorUpload.destroy(),a.destroy())},destroy:function(a){var b,c=this;if(!c.destroyed){if(!a&&!c.removed)return void c.remove();a||(c.editorManager.off("beforeunload",c._beforeUnload),c.theme&&c.theme.destroy&&c.theme.destroy(),c.selection.destroy(),c.dom.destroy()),b=c.formElement,b&&(b._mceOldSubmit&&(b.submit=b._mceOldSubmit,b._mceOldSubmit=null),q.unbind(b,"submit reset",c.formEventDelegate)),c.contentAreaContainer=c.formElement=c.container=c.editorContainer=null,c.bodyElement=c.contentDocument=c.contentWindow=null,c.iframeElement=c.targetElm=null,c.selection&&(c.selection=c.selection.win=c.selection.dom=c.selection.dom.doc=null),c.destroyed=1}},uploadImages:function(a){return this.editorUpload.uploadImages(a)},_scanForImages:function(){return this.editorUpload.scanForImages()}},r(p.prototype,e),p}),g("17",["c"],function(a){"use strict";var b={},c="en";return{setCode:function(a){a&&(c=a,this.rtl=!!this.data[a]&&"rtl"===this.data[a]._dir)},getCode:function(){return c},rtl:!1,add:function(a,c){var d=b[a];d||(b[a]=d={});for(var e in c)d[e]=c[e];this.setCode(a)},translate:function(d){function e(b){return a.is(b,"function")?Object.prototype.toString.call(b):f(b)?"":""+b}function f(b){return""===b||null===b||a.is(b,"undefined")}function g(b){return b=e(b),a.hasOwn(h,b)?e(h[b]):b}var h=b[c]||{};if(f(d))return"";if(a.is(d,"object")&&a.hasOwn(d,"raw"))return e(d.raw);if(a.is(d,"array")){var i=d.slice(1);d=g(d[0]).replace(/\{([0-9]+)\}/g,function(b,c){return a.hasOwn(i,c)?e(i[c]):b})}return g(d).replace(/{context:\w+}$/,"")},data:b}}),g("18",["h","8","9"],function(a,b,c){function d(a){function d(){try{return document.activeElement}catch(a){return document.body}}function j(a,b){if(b&&b.startContainer){if(!a.isChildOf(b.startContainer,a.getRoot())||!a.isChildOf(b.endContainer,a.getRoot()))return;return{startContainer:b.startContainer,startOffset:b.startOffset,endContainer:b.endContainer,endOffset:b.endOffset}}return b}function l(a,b){var c;return b.startContainer?(c=a.getDoc().createRange(),c.setStart(b.startContainer,b.startOffset),c.setEnd(b.endContainer,b.endOffset)):c=b,c}function m(e){var m=e.editor;m.on("init",function(){(m.inline||c.ie)&&("onbeforedeactivate"in document&&c.ie<9?m.dom.bind(m.getBody(),"beforedeactivate",function(a){if(a.target==m.getBody())try{m.lastRng=m.selection.getRng()}catch(a){}}):m.on("nodechange mouseup keyup",function(a){var b=d();"nodechange"==a.type&&a.selectionChange||(b&&b.id==m.id+"_ifr"&&(b=m.getBody()),m.dom.isChildOf(b,m.getBody())&&(m.lastRng=m.selection.getRng()))}))}),m.on("setcontent",function(){m.lastRng=null}),m.on("mousedown",function(){m.selection.lastFocusBookmark=null}),m.on("focusin",function(){var b,c=a.focusedEditor;m.selection.lastFocusBookmark&&(b=l(m,m.selection.lastFocusBookmark),m.selection.lastFocusBookmark=null,m.selection.setRng(b)),c!=m&&(c&&c.fire("blur",{focusedEditor:m}),a.setActive(m),a.focusedEditor=m,m.fire("focus",{blurredEditor:c}),m.focus(!0)),m.lastRng=null}),m.on("focusout",function(){b.setEditorTimeout(m,function(){var b=a.focusedEditor;i(m,d())||b!=m||(m.fire("blur",{focusedEditor:null}),a.focusedEditor=null,m.selection&&(m.selection.lastFocusBookmark=null))})}),f||(f=function(b){var c,d=a.activeEditor;c=b.target,d&&c.ownerDocument===document&&(d.selection&&c!==d.getBody()&&k(m,c)&&(d.selection.lastFocusBookmark=j(d.dom,d.lastRng)),c===document.body||i(d,c)||a.focusedEditor!==d||(d.fire("blur",{focusedEditor:null}),a.focusedEditor=null))},h.bind(document,"focusin",f)),m.inline&&!g&&(g=function(b){var c=a.activeEditor,d=c.dom;if(c.inline&&d&&!d.isChildOf(b.target,c.getBody())){var e=c.selection.getRng();e.collapsed||(c.lastRng=e)}},h.bind(document,"mouseup",g))}function n(b){a.focusedEditor==b.editor&&(a.focusedEditor=null),a.activeEditor||(h.unbind(document,"selectionchange",e),h.unbind(document,"focusin",f),h.unbind(document,"mouseup",g),e=f=g=null)}a.on("AddEditor",m),a.on("RemoveEditor",n)}var e,f,g,h=a.DOM,i=function(a,b){var c=a?a.settings.custom_ui_selector:"",e=h.getParent(b,function(b){return d.isEditorUIElement(b)||!!c&&a.dom.is(b,c)});return null!==e},j=function(a){return a.inline===!0},k=function(a,b){return j(a)===!1||a.dom.isChildOf(b,a.getBody())===!1};return d.isEditorUIElement=function(a){return a.className.toString().indexOf("mce-")!==-1},d._isUIElement=i,d}),g("2m",["c"],function(a){var b=a.each,c=a.explode,d=function(a){a.on("AddEditor",function(a){var d=a.editor;d.on("preInit",function(){function a(a,c){b(c,function(b,c){b&&h.setStyle(a,c,b)}),h.rename(a,"span")}function e(a){h=d.dom,i.convert_fonts_to_spans&&b(h.select("font,u,strike",a.node),function(a){f[a.nodeName.toLowerCase()](h,a)})}var f,g,h,i=d.settings;i.inline_styles&&(g=c(i.font_size_legacy_values),f={font:function(b,c){a(c,{backgroundColor:c.style.backgroundColor,color:c.color,fontFamily:c.face,fontSize:g[parseInt(c.size,10)-1]})},u:function(b,c){"html4"===d.settings.schema&&a(c,{textDecoration:"underline"})},strike:function(b,c){a(c,{textDecoration:"line-through"})}},d.on("PreProcess SetContent",e))})})};return{register:d}}),g("19",["2j","2k","j","d","h","16","9","2l","18","2m","17","11","7","c","y"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o){function p(a){x(u.get(),function(b){"scroll"===a.type?b.fire("ScrollWindow",a):b.fire("ResizeWindow",a)})}function q(a){a!==A&&(a?d(window).on("resize scroll",p):d(window).off("resize scroll",p),A=a)}function r(b){var c=C;delete B[b.id];for(var d=0;d0?C[0]:null),u.focusedEditor===b&&(u.focusedEditor=null),c.length!==C.length}function s(a){return a&&a.initialized&&!(a.getContainer()||a.getBody()).parentNode&&(r(a),a.unbindAllNativeEvents(),a.destroy(!0),a.removed=!0,a=null),a}var t,u,v=e.DOM,w=n.explode,x=n.each,y=n.extend,z=0,A=!1,B=[],C=[];return u={$:d,majorVersion:"4",minorVersion:"6.6",releaseDate:"2017-08-30",editors:B,i18n:k,activeEditor:null,settings:{},setup:function(){var a,b,c,d,e=this,f="";if(b=o.getDocumentBaseUrl(document.location),/^[^:]+:\/\/\/?[^\/]+\//.test(b)&&(b=b.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(b)||(b+="/")),c=window.tinymce||window.tinyMCEPreInit)a=c.base||c.baseURL,f=c.suffix;else{for(var g=document.getElementsByTagName("script"),h=0;h0&&x(w(b),function(a){var b;(b=v.get(a))?c.push(b):x(document.forms,function(b){x(b.elements,function(b){b.name===a&&(a="mce_editor_"+z++,v.setAttrib(b,"id",a),c.push(b))})})});break;case"textareas":case"specific_textareas":x(v.select("textarea"),function(b){a.editor_deselector&&i(b,a.editor_deselector)||a.editor_selector&&!i(b,a.editor_selector)||c.push(b)})}return c}function k(){function g(a,b,c){var d=new f(a,b,p);m.push(d),d.on("init",function(){++l===i.length&&q(m)}),d.targetElm=d.targetElm||c,d.render()}var i,l=0,m=[];return v.unbind(window,"ready",k),e("onpageload"),i=d.unique(j(a)),a.types?void x(a.types,function(b){n.each(i,function(d){return!v.is(d,b.selector)||(g(c(d),y({},a,b),d),!1)})}):(n.each(i,function(a){s(p.get(a.id))}),i=n.grep(i,function(a){return!p.get(a.id)}),void(0===i.length?q([]):x(i,function(d){b(a,d)?h.initError("Could not initialize inline editor on invalid inline target element",d):g(c(d),a,d)})))}var l,o,p=this;o=n.makeMap("area base basefont br col frame hr img input isindex link meta param embed source wbr track colgroup option tbody tfoot thead tr script noscript style textarea video audio iframe object menu"," ");var q=function(a){l=a};return p.settings=a,v.bind(window,"ready",k),new m(function(a){l?a(l):q=function(b){a(b)}})},get:function(c){return 0===arguments.length?C.slice(0):b.isString(c)?a.find(C,function(a){return a.id===c}).getOr(null):b.isNumber(c)&&C[c]?C[c]:null},add:function(a){var b,c=this;return b=B[a.id],b===a?a:(null===c.get(a.id)&&(B[a.id]=a,B.push(a),C.push(a)),q(!0),c.activeEditor=a,c.fire("AddEditor",{editor:a}),t||(t=function(){c.fire("BeforeUnload")},v.bind(window,"beforeunload",t)),a)},createEditor:function(a,b){return this.add(new f(a,b,this))},remove:function(a){var c,d,e=this;{if(a)return b.isString(a)?(a=a.selector||a,void x(v.select(a),function(a){d=e.get(a.id),d&&e.remove(d)})):(d=a,b.isNull(e.get(d.id))?null:(r(d)&&e.fire("RemoveEditor",{editor:d}),0===C.length&&v.unbind(window,"beforeunload",t),d.remove(),q(C.length>0),d));for(c=C.length-1;c>=0;c--)e.remove(C[c])}},execCommand:function(a,b,c){var d=this,e=d.get(c);switch(a){case"mceAddEditor":return d.get(c)||new f(c,d.settings,d).render(),!0;case"mceRemoveEditor":return e&&e.remove(),!0;case"mceToggleEditor":return e?(e.isHidden()?e.show():e.hide(),!0):(d.execCommand("mceAddEditor",0,c),!0)}return!!d.activeEditor&&d.activeEditor.execCommand(a,b,c)},triggerSave:function(){x(C,function(a){a.save()})},addI18n:function(a,b){k.add(a,b)},translate:function(a){return k.translate(a)},setActive:function(a){var b=this.activeEditor;this.activeEditor!=a&&(b&&b.fire("deactivate",{relatedTarget:a}),a.fire("activate",{relatedTarget:b})),this.activeEditor=a}},y(u,l),u.setup(),j.register(u),u}),g("1a",["11","c"],function(a,b){var c={send:function(a){function d(){!a.async||4==e.readyState||f++>1e4?(a.success&&f<1e4&&200==e.status?a.success.call(a.success_scope,""+e.responseText,e,a):a.error&&a.error.call(a.error_scope,f>1e4?"TIMED_OUT":"GENERAL",e,a),e=null):setTimeout(d,10)}var e,f=0;if(a.scope=a.scope||this,a.success_scope=a.success_scope||a.scope,a.error_scope=a.error_scope||a.scope,a.async=a.async!==!1,a.data=a.data||"",c.fire("beforeInitialize",{settings:a}),e=new XMLHttpRequest){if(e.overrideMimeType&&e.overrideMimeType(a.content_type),e.open(a.type||(a.data?"POST":"GET"),a.url,a.async),a.crossDomain&&(e.withCredentials=!0),a.content_type&&e.setRequestHeader("Content-Type",a.content_type),a.requestheaders&&b.each(a.requestheaders,function(a){e.setRequestHeader(a.key,a.value)}),e.setRequestHeader("X-Requested-With","XMLHttpRequest"),e=c.fire("beforeSend",{xhr:e,settings:a}).xhr,e.send(a.data),!a.async)return d();setTimeout(d,10)}}};return b.extend(c,a),c}),g("1b",[],function(){function a(b,c){var d,e,f,g;if(c=c||'"',null===b)return"null";if(f=typeof b,"string"==f)return e="\bb\tt\nn\ff\rr\"\"''\\\\",c+b.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g,function(a,b){return'"'===c&&"'"===a?a:(d=e.indexOf(b),d+1?"\\"+e.charAt(d+1):(a=b.charCodeAt().toString(16),"\\u"+"0000".substring(a.length)+a))})+c;if("object"==f){if(b.hasOwnProperty&&"[object Array]"===Object.prototype.toString.call(b)){for(d=0,e="[";d0?",":"")+a(b[d],c);return e+"]"}e="{";for(g in b)b.hasOwnProperty(g)&&(e+="function"!=typeof b[g]?(e.length>1?","+c:c)+g+c+":"+a(b[g],c):"");return e+"}"}return""+b}return{serialize:a,parse:function(a){try{return window[String.fromCharCode(101)+"val"]("("+a+")")}catch(a){}}}}),g("1c",["1b","1a","c"],function(a,b,c){function d(a){this.settings=e({},a),this.count=0}var e=c.extend;return d.sendRPC=function(a){return(new d).send(a)},d.prototype={send:function(c){var d=c.error,f=c.success;c=e(this.settings,c),c.success=function(b,e){b=a.parse(b),"undefined"==typeof b&&(b={error:"JSON Parse error."}),b.error?d.call(c.error_scope||c.scope,b.error,e):f.call(c.success_scope||c.scope,b.result)},c.error=function(a,b){d&&d.call(c.error_scope||c.scope,a,b)},c.data=a.serialize({id:c.id||"c"+this.count++,method:c.method,params:c.params}),c.content_type="application/json",b.send(c)}},d}),g("1d",["h"],function(a){return{callbacks:{},count:0,send:function(b){var c=this,d=a.DOM,e=void 0!==b.count?b.count:c.count,f="tinymce_jsonp_"+e;c.callbacks[e]=function(a){d.remove(f),delete c.callbacks[e],b.callback(a)},d.add(d.doc.body,"script",{id:f,src:b.url,type:"text/javascript"}),c.count++}}}),g("1e",[],function(){function a(){g=[];for(var a in f)g.push(a);d.length=g.length}function b(){function b(a){var b,c;return c=void 0!==a?j+a:d.indexOf(",",j),c===-1||c>d.length?null:(b=d.substring(j,c),j=c+1,b)}var c,d,g,j=0;if(f={},i){e.load(h),d=e.getAttribute(h)||"";do{var k=b();if(null===k)break;if(c=b(parseInt(k,32)||0),null!==c){if(k=b(),null===k)break;g=b(parseInt(k,32)||0),c&&(f[c]=g)}}while(null!==c);a()}}function c(){var b,c="";if(i){for(var d in f)b=f[d],c+=(c?",":"")+d.length.toString(32)+","+d+","+b.length.toString(32)+","+b;e.setAttribute(h,c);try{e.save(h)}catch(a){}a()}}var d,e,f,g,h,i;try{if(window.localStorage)return localStorage}catch(a){}return h="tinymce",e=document.documentElement,i=!!e.addBehavior,i&&e.addBehavior("#default#userData"),d={key:function(a){return g[a]},getItem:function(a){return a in f?f[a]:null},setItem:function(a,b){f[a]=""+b,c()},removeItem:function(a){delete f[a],c()},clear:function(){f={},c()}},b(),d}),g("1f",[],function(){function a(a){function e(a,e,f){var g,h,i,j,k,l;return g=0,h=0,i=0,a/=255,e/=255,f/=255,k=b(a,b(e,f)),l=c(a,c(e,f)),k==l?(i=k,{h:0,s:0,v:100*i}):(j=a==k?e-f:f==k?a-e:f-a,g=a==k?3:f==k?1:5,g=60*(g-j/(l-k)),h=(l-k)/l,i=l,{h:d(g),s:d(100*h),v:d(100*i)})}function f(a,e,f){var g,h,i,j;if(a=(parseInt(a,10)||0)%360,e=parseInt(e,10)/100,f=parseInt(f,10)/100,e=c(0,b(e,1)),f=c(0,b(f,1)),0===e)return void(l=m=n=d(255*f));switch(g=a/60,h=f*e,i=h*(1-Math.abs(g%2-1)),j=f-h,Math.floor(g)){case 0:l=h,m=i,n=0;break;case 1:l=i,m=h,n=0;break;case 2:l=0,m=h,n=i;break;case 3:l=0,m=i,n=h;break;case 4:l=i,m=0,n=h;break;case 5:l=h,m=0,n=i;break;default:l=m=n=0}l=d(255*(l+j)),m=d(255*(m+j)),n=d(255*(n+j))}function g(){function a(a){return a=parseInt(a,10).toString(16),a.length>1?a:"0"+a}return"#"+a(l)+a(m)+a(n)}function h(){return{r:l,g:m,b:n}}function i(){return e(l,m,n)}function j(a){var b;return"object"==typeof a?"r"in a?(l=a.r,m=a.g,n=a.b):"v"in a&&f(a.h,a.s,a.v):(b=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)[^\)]*\)/gi.exec(a))?(l=parseInt(b[1],10),m=parseInt(b[2],10),n=parseInt(b[3],10)):(b=/#([0-F]{2})([0-F]{2})([0-F]{2})/gi.exec(a))?(l=parseInt(b[1],16),m=parseInt(b[2],16),n=parseInt(b[3],16)):(b=/#([0-F])([0-F])([0-F])/gi.exec(a))&&(l=parseInt(b[1]+b[1],16),m=parseInt(b[2]+b[2],16),n=parseInt(b[3]+b[3],16)),l=l<0?0:l>255?255:l,m=m<0?0:m>255?255:m,n=n<0?0:n>255?255:n,k}var k=this,l=0,m=0,n=0;a&&j(a),k.toRgb=h,k.toHsv=i,k.toHex=g,k.parse=j}var b=Math.min,c=Math.max,d=Math.round;return a}),g("33",["z","c"],function(a,b){"use strict";return a.extend({Defaults:{firstControlClass:"first",lastControlClass:"last"},init:function(a){this.settings=b.extend({},this.Defaults,a)},preRender:function(a){a.bodyClasses.add(this.settings.containerClass)},applyClasses:function(a){var b,c,d,e,f=this,g=f.settings;b=g.firstControlClass,c=g.lastControlClass,a.each(function(a){a.classes.remove(b).remove(c).add(g.controlClass),a.visible()&&(d||(d=a),e=a)}),d&&d.classes.add(b),e&&e.classes.add(c)},renderHtml:function(a){var b=this,c="";return b.applyClasses(a.items()),a.items().each(function(a){c+=a.renderHtml()}),c},recalc:function(){},postRender:function(){},isNative:function(){return!1}})}),g("34",["33"],function(a){"use strict";return a.extend({Defaults:{containerClass:"abs-layout",controlClass:"abs-layout-item"},recalc:function(a){a.items().filter(":visible").each(function(a){var b=a.settings;a.layoutRect({x:b.x,y:b.y,w:b.w,h:b.h}),a.recalc&&a.recalc()})},renderHtml:function(a){return'
    '+this._super(a)}})}),g("35",["31"],function(a){"use strict";return a.extend({Defaults:{classes:"widget btn",role:"button"},init:function(a){var b,c=this;c._super(a),a=c.settings,b=c.settings.size,c.on("click mousedown",function(a){a.preventDefault()}),c.on("touchstart",function(a){c.fire("click",a),a.preventDefault()}),a.subtype&&c.classes.add(a.subtype),b&&c.classes.add("btn-"+b),a.icon&&c.icon(a.icon)},icon:function(a){return arguments.length?(this.state.set("icon",a),this):this.state.get("icon")},repaint:function(){var a,b=this.getEl().firstChild;b&&(a=b.style,a.width=a.height="100%"),this._super()},renderHtml:function(){var a,b=this,c=b._id,d=b.classPrefix,e=b.state.get("icon"),f=b.state.get("text"),g="";return a=b.settings.image,a?(e="none","string"!=typeof a&&(a=window.getSelection?a[0]:a[1]),a=" style=\"background-image: url('"+a+"')\""):a="",f&&(b.classes.add("btn-has-text"),g=''+b.encode(f)+""),e=e?d+"ico "+d+"i-"+e:"",'
    "},bindStates:function(){function a(a){var e=c("span."+d,b.getEl());a?(e[0]||(c("button:first",b.getEl()).append(''),e=c("span."+d,b.getEl())),e.html(b.encode(a))):e.remove(),b.classes.toggle("btn-has-text",!!a)}var b=this,c=b.$,d=b.classPrefix+"txt";return b.state.on("change:text",function(b){a(b.value)}),b.state.on("change:icon",function(c){var d=c.value,e=b.classPrefix;b.settings.icon=d,d=d?e+"ico "+e+"i-"+b.settings.icon:"";var f=b.getEl().firstChild,g=f.getElementsByTagName("i")[0];d?(g&&g==f.firstChild||(g=document.createElement("i"),f.insertBefore(g,f.firstChild)),g.className=d):g&&f.removeChild(g),a(b.state.get("text"))}),b._super()}})}),g("36",["2t"],function(a){"use strict";return a.extend({Defaults:{defaultType:"button",role:"group"},renderHtml:function(){var a=this,b=a._layout;return a.classes.add("btn-group"),a.preRender(),b.preRender(a),'
    '+(a.settings.html||"")+b.renderHtml(a)+"
    "}})}),g("37",["31"],function(a){"use strict";return a.extend({Defaults:{classes:"checkbox",role:"checkbox",checked:!1},init:function(a){var b=this;b._super(a),b.on("click mousedown",function(a){a.preventDefault()}),b.on("click",function(a){a.preventDefault(),b.disabled()||b.checked(!b.checked())}),b.checked(b.settings.checked)},checked:function(a){return arguments.length?(this.state.set("checked",a),this):this.state.get("checked")},value:function(a){return arguments.length?this.checked(a):this.checked()},renderHtml:function(){var a=this,b=a._id,c=a.classPrefix;return'
    '+a.encode(a.state.get("text"))+"
    "},bindStates:function(){function a(a){b.classes.toggle("checked",a),b.aria("checked",a)}var b=this;return b.state.on("change:text",function(a){b.getEl("al").firstChild.data=b.translate(a.value)}),b.state.on("change:checked change:value",function(c){b.fire("change"),a(c.value)}),b.state.on("change:icon",function(a){var c=a.value,d=b.classPrefix;if("undefined"==typeof c)return b.settings.icon;b.settings.icon=c,c=c?d+"ico "+d+"i-"+b.settings.icon:"";var e=b.getEl().firstChild,f=e.getElementsByTagName("i")[0];c?(f&&f==e.firstChild||(f=document.createElement("i"),e.insertBefore(f,e.firstChild)),f.className=c):f&&e.removeChild(f)}),b.state.get("checked")&&a(!0),b._super()}})}),g("38",["31","2r","2c","d","s","c"],function(a,b,c,d,e,f){"use strict";return a.extend({init:function(a){var b=this;b._super(a),a=b.settings,b.classes.add("combobox"),b.subinput=!0,b.ariaTarget="inp",a.menu=a.menu||a.values,a.menu&&(a.icon="caret"),b.on("click",function(c){var e=c.target,f=b.getEl();if(d.contains(f,e)||e==f)for(;e&&e!=f;)e.id&&e.id.indexOf("-open")!=-1&&(b.fire("action"),a.menu&&(b.showMenu(),c.aria&&b.menu.items()[0].focus())),e=e.parentNode}),b.on("keydown",function(a){var c;13==a.keyCode&&"INPUT"===a.target.nodeName&&(a.preventDefault(),b.parents().reverse().each(function(a){if(a.toJSON)return c=a,!1}),b.fire("submit",{data:c.toJSON()}))}),b.on("keyup",function(a){if("INPUT"==a.target.nodeName){var c=b.state.get("value"),d=a.target.value;d!==c&&(b.state.set("value",d),b.fire("autocomplete",a))}}),b.on("mouseover",function(a){var c=b.tooltip().moveTo(-65535);if(b.statusLevel()&&a.target.className.indexOf(b.classPrefix+"status")!==-1){var d=b.statusMessage()||"Ok",e=c.text(d).show().testMoveRel(a.target,["bc-tc","bc-tl","bc-tr"]);c.classes.toggle("tooltip-n","bc-tc"==e),c.classes.toggle("tooltip-nw","bc-tl"==e),c.classes.toggle("tooltip-ne","bc-tr"==e),c.moveRel(a.target,e)}})},statusLevel:function(a){return arguments.length>0&&this.state.set("statusLevel",a),this.state.get("statusLevel")},statusMessage:function(a){return arguments.length>0&&this.state.set("statusMessage",a),this.state.get("statusMessage")},showMenu:function(){var a,c=this,d=c.settings;c.menu||(a=d.menu||[],a.length?a={type:"menu",items:a}:a.type=a.type||"menu",c.menu=b.create(a).parent(c).renderTo(c.getContainerElm()),c.fire("createmenu"),c.menu.reflow(),c.menu.on("cancel",function(a){a.control===c.menu&&c.focus()}),c.menu.on("show hide",function(a){a.control.items().each(function(a){a.active(a.value()==c.value())})}).fire("show"),c.menu.on("select",function(a){c.value(a.control.value())}),c.on("focusin",function(a){"INPUT"==a.target.tagName.toUpperCase()&&c.menu.hide()}),c.aria("expanded",!0)),c.menu.show(),c.menu.layoutRect({w:c.layoutRect().w}),c.menu.moveRel(c.getEl(),c.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"]); +},focus:function(){this.getEl("inp").focus()},repaint:function(){var a,b,e=this,f=e.getEl(),g=e.getEl("open"),h=e.layoutRect(),i=0,j=f.firstChild;e.statusLevel()&&"none"!==e.statusLevel()&&(i=parseInt(c.getRuntimeStyle(j,"padding-right"),10)-parseInt(c.getRuntimeStyle(j,"padding-left"),10)),a=g?h.w-c.getSize(g).width-10:h.w-10;var k=document;return k.all&&(!k.documentMode||k.documentMode<=8)&&(b=e.layoutRect().h-2+"px"),d(j).css({width:a-i,lineHeight:b}),e._super(),e},postRender:function(){var a=this;return d(this.getEl("inp")).on("change",function(b){a.state.set("value",b.target.value),a.fire("change",b)}),a._super()},renderHtml:function(){var a,b,c=this,d=c._id,e=c.settings,f=c.classPrefix,g=c.state.get("value")||"",h="",i="",j="";return"spellcheck"in e&&(i+=' spellcheck="'+e.spellcheck+'"'),e.maxLength&&(i+=' maxlength="'+e.maxLength+'"'),e.size&&(i+=' size="'+e.size+'"'),e.subtype&&(i+=' type="'+e.subtype+'"'),j='',c.disabled()&&(i+=' disabled="disabled"'),a=e.icon,a&&"caret"!=a&&(a=f+"ico "+f+"i-"+e.icon),b=c.state.get("text"),(a||b)&&(h='
    ",c.classes.add("has-open")),'
    '+j+h+"
    "},value:function(a){return arguments.length?(this.state.set("value",a),this):(this.state.get("rendered")&&this.state.set("value",this.getEl("inp").value),this.state.get("value"))},showAutoComplete:function(a,c){var d=this;if(0===a.length)return void d.hideMenu();var e=function(a,b){return function(){d.fire("selectitem",{title:b,value:a})}};d.menu?d.menu.items().remove():d.menu=b.create({type:"menu",classes:"combobox-menu",layout:"flow"}).parent(d).renderTo(),f.each(a,function(a){d.menu.add({text:a.title,url:a.previewUrl,match:c,classes:"menu-item-ellipsis",onclick:e(a.value,a.title)})}),d.menu.renderNew(),d.hideMenu(),d.menu.on("cancel",function(a){a.control.parent()===d.menu&&(a.stopPropagation(),d.focus(),d.hideMenu())}),d.menu.on("select",function(){d.focus()});var g=d.layoutRect().w;d.menu.layoutRect({w:g,minW:0,maxW:g}),d.menu.reflow(),d.menu.show(),d.menu.moveRel(d.getEl(),d.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"])},hideMenu:function(){this.menu&&this.menu.hide()},bindStates:function(){var a=this;a.state.on("change:value",function(b){a.getEl("inp").value!=b.value&&(a.getEl("inp").value=b.value)}),a.state.on("change:disabled",function(b){a.getEl("inp").disabled=b.value}),a.state.on("change:statusLevel",function(b){var d=a.getEl("status"),e=a.classPrefix,f=b.value;c.css(d,"display","none"===f?"none":""),c.toggleClass(d,e+"i-checkmark","ok"===f),c.toggleClass(d,e+"i-warning","warn"===f),c.toggleClass(d,e+"i-error","error"===f),a.classes.toggle("has-status","none"!==f),a.repaint()}),c.on(a.getEl("status"),"mouseleave",function(){a.tooltip().hide()}),a.on("cancel",function(b){a.menu&&a.menu.visible()&&(b.stopPropagation(),a.hideMenu())});var b=function(a,b){b&&b.items().length>0&&b.items().eq(a)[0].focus()};return a.on("keydown",function(c){var d=c.keyCode;"INPUT"===c.target.nodeName&&(d===e.DOWN?(c.preventDefault(),a.fire("autocomplete"),b(0,a.menu)):d===e.UP&&(c.preventDefault(),b(-1,a.menu)))}),a._super()},remove:function(){d(this.getEl("inp")).off(),this.menu&&this.menu.remove(),this._super()}})}),g("39",["38"],function(a){"use strict";return a.extend({init:function(a){var b=this;a.spellcheck=!1,a.onaction&&(a.icon="none"),b._super(a),b.classes.add("colorbox"),b.on("change keyup postrender",function(){b.repaintColor(b.value())})},repaintColor:function(a){var b=this.getEl("open"),c=b?b.getElementsByTagName("i")[0]:null;if(c)try{c.style.background=a}catch(a){}},bindStates:function(){var a=this;return a.state.on("change:value",function(b){a.state.get("rendered")&&a.repaintColor(b.value)}),a._super()}})}),g("3a",["35","2z"],function(a,b){"use strict";return a.extend({showPanel:function(){var a=this,c=a.settings;if(a.active(!0),a.panel)a.panel.show();else{var d=c.panel;d.type&&(d={layout:"grid",items:d}),d.role=d.role||"dialog",d.popover=!0,d.autohide=!0,d.ariaRoot=!0,a.panel=new b(d).on("hide",function(){a.active(!1)}).on("cancel",function(b){b.stopPropagation(),a.focus(),a.hidePanel()}).parent(a).renderTo(a.getContainerElm()),a.panel.fire("show"),a.panel.reflow()}var e=a.panel.testMoveRel(a.getEl(),c.popoverAlign||(a.isRtl()?["bc-tc","bc-tl","bc-tr"]:["bc-tc","bc-tr","bc-tl"]));a.panel.classes.toggle("start","bc-tl"===e),a.panel.classes.toggle("end","bc-tr"===e),a.panel.moveRel(a.getEl(),e)},hidePanel:function(){var a=this;a.panel&&a.panel.hide()},postRender:function(){var a=this;return a.aria("haspopup",!0),a.on("click",function(b){b.control===a&&(a.panel&&a.panel.visible()?a.hidePanel():(a.showPanel(),a.panel.focus(!!b.aria)))}),a._super()},remove:function(){return this.panel&&(this.panel.remove(),this.panel=null),this._super()}})}),g("3b",["3a","h"],function(a,b){"use strict";var c=b.DOM;return a.extend({init:function(a){this._super(a),this.classes.add("colorbutton")},color:function(a){return a?(this._color=a,this.getEl("preview").style.backgroundColor=a,this):this._color},resetColor:function(){return this._color=null,this.getEl("preview").style.backgroundColor=null,this},renderHtml:function(){var a=this,b=a._id,c=a.classPrefix,d=a.state.get("text"),e=a.settings.icon?c+"ico "+c+"i-"+a.settings.icon:"",f=a.settings.image?" style=\"background-image: url('"+a.settings.image+"')\"":"",g="";return d&&(a.classes.add("btn-has-text"),g=''+a.encode(d)+""),'
    '},postRender:function(){var a=this,b=a.settings.onclick;return a.on("click",function(d){d.aria&&"down"==d.aria.key||d.control!=a||c.getParent(d.target,"."+a.classPrefix+"open")||(d.stopImmediatePropagation(),b.call(a,d))}),delete a.settings.onclick,a._super()}})}),g("3c",["31","2u","2c","1f"],function(a,b,c,d){"use strict";return a.extend({Defaults:{classes:"widget colorpicker"},init:function(a){this._super(a)},postRender:function(){function a(a,b){var d,e,f=c.getPos(a);return d=b.pageX-f.x,e=b.pageY-f.y,d=Math.max(0,Math.min(d/a.clientWidth,1)),e=Math.max(0,Math.min(e/a.clientHeight,1)),{x:d,y:e}}function e(a,b){var e=(360-a.h)/360;c.css(j,{top:100*e+"%"}),b||c.css(l,{left:a.s+"%",top:100-a.v+"%"}),k.style.background=new d({s:100,v:100,h:a.h}).toHex(),m.color().parse({s:a.s,v:a.v,h:a.h})}function f(b){var c;c=a(k,b),h.s=100*c.x,h.v=100*(1-c.y),e(h),m.fire("change")}function g(b){var c;c=a(i,b),h=n.toHsv(),h.h=360*(1-c.y),e(h,!0),m.fire("change")}var h,i,j,k,l,m=this,n=m.color();i=m.getEl("h"),j=m.getEl("hp"),k=m.getEl("sv"),l=m.getEl("svp"),m._repaint=function(){h=n.toHsv(),e(h)},m._super(),m._svdraghelper=new b(m._id+"-sv",{start:f,drag:f}),m._hdraghelper=new b(m._id+"-h",{start:g,drag:g}),m._repaint()},rgb:function(){return this.color().toRgb()},value:function(a){var b=this;return arguments.length?(b.color().parse(a),void(b._rendered&&b._repaint())):b.color().toHex()},color:function(){return this._color||(this._color=new d),this._color},renderHtml:function(){function a(){var a,b,c,d,g="";for(c="filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=",d=f.split(","),a=0,b=d.length-1;a';return g}var b,c=this,d=c._id,e=c.classPrefix,f="#ff0000,#ff0080,#ff00ff,#8000ff,#0000ff,#0080ff,#00ffff,#00ff80,#00ff00,#80ff00,#ffff00,#ff8000,#ff0000",g="background: -ms-linear-gradient(top,"+f+");background: linear-gradient(to bottom,"+f+");";return b='
    '+a()+'
    ','
    '+b+"
    "}})}),g("3d",["31"],function(a){"use strict";return a.extend({init:function(a){var b=this;a.delimiter||(a.delimiter="\xbb"),b._super(a),b.classes.add("path"),b.canFocus=!0,b.on("click",function(a){var c,d=a.target;(c=d.getAttribute("data-index"))&&b.fire("select",{value:b.row()[c],index:c})}),b.row(b.settings.row)},focus:function(){var a=this;return a.getEl().firstChild.focus(),a},row:function(a){return arguments.length?(this.state.set("row",a),this):this.state.get("row")},renderHtml:function(){var a=this;return'
    '+a._getDataPathHtml(a.state.get("row"))+"
    "},bindStates:function(){var a=this;return a.state.on("change:row",function(b){a.innerHtml(a._getDataPathHtml(b.value))}),a._super()},_getDataPathHtml:function(a){var b,c,d=this,e=a||[],f="",g=d.classPrefix;for(b=0,c=e.length;b0?'":"")+'
    '+e[b].name+"
    ";return f||(f='
    \xa0
    '),f}})}),g("3e",["3d"],function(a){return a.extend({postRender:function(){function a(a){if(1===a.nodeType){if("BR"==a.nodeName||a.getAttribute("data-mce-bogus"))return!0;if("bookmark"===a.getAttribute("data-mce-type"))return!0}return!1}var b=this,c=b.settings.editor;return c.settings.elementpath!==!1&&(b.on("select",function(a){c.focus(),c.selection.select(this.row()[a.index].element),c.nodeChanged()}),c.on("nodeChange",function(d){for(var e=[],f=d.parents,g=f.length;g--;)if(1==f[g].nodeType&&!a(f[g])){var h=c.fire("ResolveName",{name:f[g].nodeName.toLowerCase(),target:f[g]});if(h.isDefaultPrevented()||e.push({name:h.name,element:f[g]}),h.isPropagationStopped())break}b.row(e)})),b._super()}})}),g("3f",["2t"],function(a){"use strict";return a.extend({Defaults:{layout:"flex",align:"center",defaults:{flex:1}},renderHtml:function(){var a=this,b=a._layout,c=a.classPrefix;return a.classes.add("formitem"),b.preRender(a),'
    '+(a.settings.title?'
    '+a.settings.title+"
    ":"")+'
    '+(a.settings.html||"")+b.renderHtml(a)+"
    "}})}),g("3g",["2t","3f","c"],function(a,b,c){"use strict";return a.extend({Defaults:{containerCls:"form",layout:"flex",direction:"column",align:"stretch",flex:1,padding:20,labelGap:30,spacing:10,callbacks:{submit:function(){this.submit()}}},preRender:function(){var a=this,d=a.items();a.settings.formItemDefaults||(a.settings.formItemDefaults={layout:"flex",autoResize:"overflow",defaults:{flex:1}}),d.each(function(d){var e,f=d.settings.label;f&&(e=new b(c.extend({items:{type:"label",id:d._id+"-l",text:f,flex:0,forId:d._id,disabled:d.disabled()}},a.settings.formItemDefaults)),e.type="formitem",d.aria("labelledby",d._id+"-l"),"undefined"==typeof d.settings.flex&&(d.settings.flex=1),a.replace(d,e),e.add(d))})},submit:function(){return this.fire("submit",{data:this.toJSON()})},postRender:function(){var a=this;a._super(),a.fromJSON(a.settings.data)},bindStates:function(){function a(){var a,c,d,e=0,f=[];if(b.settings.labelGapCalc!==!1)for(d="children"==b.settings.labelGapCalc?b.find("formitem"):b.items(),d.filter("formitem").each(function(a){var b=a.items()[0],c=b.getEl().clientWidth;e=c>e?c:e,f.push(b)}),c=b.settings.labelGap||0,a=f.length;a--;)f[a].settings.minWidth=e+c}var b=this;b._super(),b.on("show",a),a()}})}),g("3h",["3g"],function(a){"use strict";return a.extend({Defaults:{containerCls:"fieldset",layout:"flex",direction:"column",align:"stretch",flex:1,padding:"25 15 5 15",labelGap:30,spacing:10,border:1},renderHtml:function(){var a=this,b=a._layout,c=a.classPrefix;return a.preRender(),b.preRender(a),'
    '+(a.settings.title?''+a.settings.title+"":"")+'
    '+(a.settings.html||"")+b.renderHtml(a)+"
    "}})}),g("5p",["1w","4x","h","1t","1q","4e","c","2i"],function(a,b,c,d,e,f,g,h){var i=g.trim,j=function(a,b,c,d,e){return{type:a,title:b,url:c,level:d,attach:e}},k=function(a){for(;a=a.parentNode;){var b=a.contentEditable;if(b&&"inherit"!==b)return d.isContentEditableTrue(a)}return!1},l=function(c,d){return e.map(b.descendants(a.fromDom(d),c),function(a){return a.dom()})},m=function(a){return a.innerText||a.textContent},n=function(a){return a.id?a.id:h.uuid("h")},o=function(a){return a&&"A"===a.nodeName&&(a.id||a.name)},p=function(a){return o(a)&&r(a)},q=function(a){return a&&/^(H[1-6])$/.test(a.nodeName)},r=function(a){return k(a)&&!d.isContentEditableFalse(a)},s=function(a){return q(a)&&r(a)},t=function(a){return q(a)?parseInt(a.nodeName.substr(1),10):0},u=function(a){var b=n(a),c=function(){a.id=b};return j("header",m(a),"#"+b,t(a),c)},v=function(a){var b=a.id||a.name,c=m(a);return j("anchor",c?c:"#"+b,"#"+b,0,f.noop)},w=function(a){return e.map(e.filter(a,s),u)},x=function(a){return e.map(e.filter(a,p),v)},y=function(a){var b=l("h1,h2,h3,h4,h5,h6,a:not([href])",a);return b},z=function(a){return i(a.title).length>0},A=function(a){var b=y(a);return e.filter(w(b).concat(x(b)),z)};return{find:A}}),g("3i",["5l","5p","19","38","1q","4e","c"],function(a,b,c,d,e,f,g){"use strict";var h=function(){return a.tinymce?a.tinymce.activeEditor:c.activeEditor},i={},j=5,k=function(a){return{title:a.title,value:{title:{raw:a.title},url:a.url,attach:a.attach}}},l=function(a){return g.map(a,k)},m=function(a,b){return{title:a,value:{title:a,url:b,attach:f.noop}}},n=function(a,b){var c=e.find(b,function(b){return b.url===a});return!c},o=function(a,b,c){var d=b in a?a[b]:c;return d===!1?null:d},p=function(a,b,c,d){var h={title:"-"},j=function(a){var d=e.filter(a[c],function(a){return n(a,b)});return g.map(d,function(a){return{title:a,value:{title:a,url:a,attach:f.noop}}})},k=function(a){var c=e.filter(b,function(b){return b.type==a});return l(c)},p=function(){var a=k("anchor"),b=o(d,"anchor_top","#top"),c=o(d,"anchor_bottom","#bottom");return null!==b&&a.unshift(m("",b)),null!==c&&a.push(m("",c)),a},q=function(a){return e.reduce(a,function(a,b){var c=0===a.length||0===b.length;return c?a.concat(b):a.concat(h,b)},[])};return d.typeahead_urls===!1?[]:"file"===c?q([r(a,j(i)),r(a,k("header")),r(a,p())]):r(a,j(i))},q=function(a,b){var c=i[b];/^https?/.test(a)&&(c?e.indexOf(c,a)===-1&&(i[b]=c.slice(0,j).concat(a)):i[b]=[a])},r=function(a,b){var c=a.toLowerCase(),d=g.grep(b,function(a){return a.title.toLowerCase().indexOf(c)!==-1});return 1===d.length&&d[0].title===a?[]:d},s=function(a){var b=a.title;return b.raw?b.raw:b},t=function(a,c,d,e){var f=function(f){var g=b.find(d),h=p(f,g,e,c);a.showAutoComplete(h,f)};a.on("autocomplete",function(){f(a.value())}),a.on("selectitem",function(b){var c=b.value;a.value(c.url);var d=s(c);"image"===e?a.fire("change",{meta:{alt:d,attach:c.attach}}):a.fire("change",{meta:{text:d,attach:c.attach}}),a.focus()}),a.on("click",function(b){0===a.value().length&&"INPUT"===b.target.nodeName&&f("")}),a.on("PostRender",function(){a.getRoot().on("submit",function(b){b.isDefaultPrevented()||q(a.value(),e)})})},u=function(a){var b=a.status,c=a.message;return"valid"===b?{status:"ok",message:c}:"unknown"===b?{status:"warn",message:c}:"invalid"===b?{status:"warn",message:c}:{status:"none",message:""}},v=function(a,b,c){var d=b.filepicker_validator_handler;if(d){var e=function(b){return 0===b.length?void a.statusLevel("none"):void d({url:b,type:c},function(b){var c=u(b);a.statusMessage(c.message),a.statusLevel(c.status)})};a.state.on("change:value",function(a){e(a.value)})}};return d.extend({init:function(b){var c,d,e,f=this,i=h(),j=i.settings,k=b.filetype;b.spellcheck=!1,e=j.file_picker_types||j.file_browser_callback_types,e&&(e=g.makeMap(e,/[, ]/)),e&&!e[k]||(d=j.file_picker_callback,!d||e&&!e[k]?(d=j.file_browser_callback,!d||e&&!e[k]||(c=function(){d(f.getEl("inp").id,f.value(),k,a)})):c=function(){var a=f.fire("beforecall").meta;a=g.extend({filetype:k},a),d.call(i,function(a,b){f.value(a).fire("change",{meta:b})},f.value(),a)}),c&&(b.icon="browse",b.onaction=c),f._super(b),t(f,j,i.getBody(),k),v(f,j,k)}})}),g("3j",["34"],function(a){"use strict";return a.extend({recalc:function(a){var b=a.layoutRect(),c=a.paddingBox;a.items().filter(":visible").each(function(a){a.layoutRect({x:c.left,y:c.top,w:b.innerW-c.right-c.left,h:b.innerH-c.top-c.bottom}),a.recalc&&a.recalc()})}})}),g("3k",["34"],function(a){"use strict";return a.extend({recalc:function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N=[],O=Math.max,P=Math.min;for(d=a.items().filter(":visible"),e=a.layoutRect(),f=a.paddingBox,g=a.settings,m=a.isRtl()?g.direction||"row-reversed":g.direction,h=g.align,i=a.isRtl()?g.pack||"end":g.pack,j=g.spacing||0,"row-reversed"!=m&&"column-reverse"!=m||(d=d.set(d.toArray().reverse()),m=m.split("-")[0]),"column"==m?(z="y",x="h",y="minH",A="maxH",C="innerH",B="top",D="deltaH",E="contentH",J="left",H="w",F="x",G="innerW",I="minW",K="right",L="deltaW",M="contentW"):(z="x",x="w",y="minW",A="maxW",C="innerW",B="left",D="deltaW",E="contentW",J="top",H="h",F="y",G="innerH",I="minH",K="bottom",L="deltaH",M="contentH"),l=e[C]-f[B]-f[B],w=k=0,b=0,c=d.length;b0&&(k+=q,o[A]&&N.push(n),o.flex=q),l-=o[y],r=f[J]+o[I]+f[K],r>w&&(w=r);if(u={},l<0?u[y]=e[y]-l+e[D]:u[y]=e[C]-l+e[D],u[I]=w+e[L],u[E]=e[C]-l,u[M]=w,u.minW=P(u.minW,e.maxW),u.minH=P(u.minH,e.maxH),u.minW=O(u.minW,e.startMinWidth),u.minH=O(u.minH,e.startMinHeight),!e.autoResize||u.minW==e.minW&&u.minH==e.minH){for(t=l/k,b=0,c=N.length;bs?(l-=o[A]-o[y],k-=o.flex,o.flex=0,o.maxFlexSize=s):o.maxFlexSize=0;for(t=l/k,v=f[B],u={},0===k&&("end"==i?v=l+f[B]:"center"==i?(v=Math.round(e[C]/2-(e[C]-l)/2)+f[B],v<0&&(v=f[B])):"justify"==i&&(v=f[B],j=Math.floor(l/(d.length-1)))),u[F]=f[J],b=0,c=d.length;b0&&(r+=o.flex*t),u[x]=r,u[z]=v,n.layoutRect(u),n.recalc&&n.recalc(),v+=r+j}else if(u.w=u.minW,u.h=u.minH,a.layoutRect(u),this.recalc(a),null===a._lastRect){var Q=a.parent();Q&&(Q._lastRect=null,Q.recalc())}}})}),g("3l",["33"],function(a){return a.extend({Defaults:{containerClass:"flow-layout",controlClass:"flow-layout-item",endClass:"break"},recalc:function(a){a.items().filter(":visible").each(function(a){a.recalc&&a.recalc()})},isNative:function(){return!0}})}),g("5q",["1","49","1w","4w","h"],function(a,b,c,d,e){var f=function(a,c,d){for(;d!==c;){if(d.style[a]){var e=d.style[a];return""!==e?b.some(e):b.none()}d=d.parentNode}return b.none()},g=function(a){return/[0-9.]+px$/.test(a)?Math.round(72*parseInt(a,10)/96)+"pt":a},h=function(a){return a.replace(/[\'\"]/g,"").replace(/,\s+/g,",")},i=function(a,c){return b.from(e.DOM.getStyle(c,a,!0))},j=function(a){return function(e,g){return b.from(g).map(c.fromDom).filter(d.isElement).bind(function(b){return f(a,e,b.dom()).or(i(a,b.dom()))}).getOr("")}};return{getFontSize:j("fontSize"),getFontFamily:a.compose(h,j("fontFamily")),toPt:g}}),g("3m",["1","1w","4y","h","19","9","5q","2q","2z","31","1q","c"],function(a,b,c,d,e,f,g,h,i,j,k,l){function m(d){d.settings.ui_container&&(f.container=c.descendant(b.fromDom(document.body),d.settings.ui_container).fold(a.constant(null),function(a){return a.dom()}))}function n(a){a.on("ScriptsLoaded",function(){a.rtl&&(h.rtl=!0)})}function o(a){function b(b,c){return function(){var d=this;a.on("nodeChange",function(e){var f=a.formatter,g=null;p(e.parents,function(a){if(p(b,function(b){if(c?f.matchNode(a,c,{value:b.value})&&(g=b.value):f.matchNode(a,b.value)&&(g=b.value),g)return!1}),g)return!1}),d.value(g)})}}function c(b){return function(){var c=this,d=function(a){return a?a.split(",")[0]:""};a.on("init nodeChange",function(e){var f,h=null;f=g.getFontFamily(a.getBody(),e.element),p(b,function(a){a.value.toLowerCase()===f.toLowerCase()&&(h=a.value)}),p(b,function(a){h||d(a.value).toLowerCase()!==d(f).toLowerCase()||(h=a.value)}),c.value(h),!h&&f&&c.text(d(f))})}}function d(b){return function(){var c=this;a.on("init nodeChange",function(d){var e,f,h=null;e=g.getFontSize(a.getBody(),d.element),f=g.toPt(e),p(b,function(a){a.value===e?h=e:a.value===f&&(h=f)}),c.value(h),h||c.text(f)})}}function e(a){a=a.replace(/;$/,"").split(";");for(var b=a.length;b--;)a[b]=a[b].split("=");return a}function f(){function b(a){var c=[];if(a)return p(a,function(a){var f={text:a.title,icon:a.icon};if(a.items)f.menu=b(a.items);else{var g=a.format||"custom"+d++;a.format||(a.name=g,e.push(a)),f.format=g,f.cmd=a.cmd}c.push(f)}),c}function c(){var c;return c=b(a.settings.style_formats_merge?a.settings.style_formats?f.concat(a.settings.style_formats):f:a.settings.style_formats||f)}var d=0,e=[],f=[{title:"Headings",items:[{title:"Heading 1",format:"h1"},{title:"Heading 2",format:"h2"},{title:"Heading 3",format:"h3"},{title:"Heading 4",format:"h4"},{title:"Heading 5",format:"h5"},{title:"Heading 6",format:"h6"}]},{title:"Inline",items:[{title:"Bold",icon:"bold",format:"bold"},{title:"Italic",icon:"italic",format:"italic"},{title:"Underline",icon:"underline",format:"underline"},{title:"Strikethrough",icon:"strikethrough",format:"strikethrough"},{title:"Superscript",icon:"superscript",format:"superscript"},{title:"Subscript",icon:"subscript",format:"subscript"},{title:"Code",icon:"code",format:"code"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Alignment",items:[{title:"Left",icon:"alignleft",format:"alignleft"},{title:"Center",icon:"aligncenter",format:"aligncenter"},{title:"Right",icon:"alignright",format:"alignright"},{title:"Justify",icon:"alignjustify",format:"alignjustify"}]}];return a.on("init",function(){p(e,function(b){a.formatter.register(b.name,b)})}),{type:"menu",items:c(),onPostRender:function(b){a.fire("renderFormatsMenu",{control:b.control})},itemDefaults:{preview:!0,textStyle:function(){if(this.settings.format)return a.formatter.getCssText(this.settings.format)},onPostRender:function(){var b=this;b.parent().on("show",function(){var c,d;c=b.settings.format,c&&(b.disabled(!a.formatter.canApply(c)),b.active(a.formatter.match(c))),d=b.settings.cmd,d&&b.active(a.queryCommandState(d))})},onclick:function(){this.settings.format&&m(this.settings.format),this.settings.cmd&&a.execCommand(this.settings.cmd)}}}}function h(b){return function(){var c=this;a.formatter?a.formatter.formatChanged(b,function(a){c.active(a)}):a.on("init",function(){a.formatter.formatChanged(b,function(a){c.active(a)})})}}function j(b){return function(){function c(){var c="redo"==b?"hasRedo":"hasUndo";return!!a.undoManager&&a.undoManager[c]()}var d=this;d.disabled(!c()),a.on("Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",function(){d.disabled(a.readonly||!c())})}}function k(){var b=this;a.on("VisualAid",function(a){b.active(a.hasVisual)}),b.active(a.hasVisual)}function m(b){b.control&&(b=b.control.value()),b&&a.execCommand("mceToggleFormat",!1,b)}function n(b){var c=b.length;return l.each(b,function(b){b.menu&&(b.hidden=0===n(b.menu));var d=b.format;d&&(b.hidden=!a.formatter.canApply(d)),b.hidden&&c--}),c}function o(b){var c=b.items().length;return b.items().each(function(b){b.menu&&b.visible(o(b.menu)>0),!b.menu&&b.settings.menu&&b.visible(n(b.settings.menu)>0);var d=b.settings.format;d&&b.visible(a.formatter.canApply(d)),b.visible()||c--}),c}var r;r=f(),p({bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",subscript:"Subscript",superscript:"Superscript"},function(b,c){a.addButton(c,{tooltip:b,onPostRender:h(c),onclick:function(){m(c)}})}),p({outdent:["Decrease indent","Outdent"],indent:["Increase indent","Indent"],cut:["Cut","Cut"],copy:["Copy","Copy"],paste:["Paste","Paste"],help:["Help","mceHelp"],selectall:["Select all","SelectAll"],removeformat:["Clear formatting","RemoveFormat"],visualaid:["Visual aids","mceToggleVisualAid"],newdocument:["New document","mceNewDocument"]},function(b,c){a.addButton(c,{tooltip:b[0],cmd:b[1]})}),p({blockquote:["Blockquote","mceBlockQuote"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"],alignleft:["Align left","JustifyLeft"],aligncenter:["Align center","JustifyCenter"],alignright:["Align right","JustifyRight"],alignjustify:["Justify","JustifyFull"],alignnone:["No alignment","JustifyNone"]},function(b,c){a.addButton(c,{tooltip:b[0],cmd:b[1],onPostRender:h(c)})});var s=function(a){var b=a;return b.length>0&&"-"===b[0].text&&(b=b.slice(1)),b.length>0&&"-"===b[b.length-1].text&&(b=b.slice(0,b.length-1)),b},t=function(b){var c,d;if("string"==typeof b)d=b.split(" ");else if(l.isArray(b))return q(l.map(b,t));return c=l.grep(d,function(b){return"|"===b||b in a.menuItems}),l.map(c,function(b){return"|"===b?{text:"-"}:a.menuItems[b]})},u=function(b){var c=[{text:"-"}],d=l.grep(a.menuItems,function(a){return a.context===b});return l.each(d,function(a){"before"==a.separator&&c.push({text:"|"}),a.prependToContext?c.unshift(a):c.push(a),"after"==a.separator&&c.push({text:"|"})}),c},v=function(a){return s(a.insert_button_items?t(a.insert_button_items):u("insert"))};a.addButton("undo",{tooltip:"Undo",onPostRender:j("undo"),cmd:"undo"}),a.addButton("redo",{tooltip:"Redo",onPostRender:j("redo"),cmd:"redo"}),a.addMenuItem("newdocument",{text:"New document",icon:"newdocument",cmd:"mceNewDocument"}),a.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Meta+Z",onPostRender:j("undo"),cmd:"undo"}),a.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Meta+Y",onPostRender:j("redo"),cmd:"redo"}),a.addMenuItem("visualaid",{text:"Visual aids",selectable:!0,onPostRender:k,cmd:"mceToggleVisualAid"}),a.addButton("remove",{tooltip:"Remove",icon:"remove",cmd:"Delete"}),a.addButton("insert",{type:"menubutton",icon:"insert",menu:[],oncreatemenu:function(){this.menu.add(v(a.settings)),this.menu.renderNew()}}),p({cut:["Cut","Cut","Meta+X"],copy:["Copy","Copy","Meta+C"],paste:["Paste","Paste","Meta+V"],selectall:["Select all","SelectAll","Meta+A"],bold:["Bold","Bold","Meta+B"],italic:["Italic","Italic","Meta+I"],underline:["Underline","Underline","Meta+U"],strikethrough:["Strikethrough","Strikethrough"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"],removeformat:["Clear formatting","RemoveFormat"]},function(b,c){a.addMenuItem(c,{text:b[0],icon:c,shortcut:b[2],cmd:b[1]})}),a.on("mousedown",function(){i.hideAll()}),a.addButton("styleselect",{type:"menubutton",text:"Formats",menu:r,onShowMenu:function(){a.settings.style_formats_autohide&&o(this.menu)}}),a.addButton("formatselect",function(){var c=[],d=e(a.settings.block_formats||"Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre");return p(d,function(b){c.push({text:b[0],value:b[1],textStyle:function(){return a.formatter.getCssText(b[1])}})}),{type:"listbox",text:d[0][0],values:c,fixedWidth:!0,onselect:m,onPostRender:b(c)}}),a.addButton("fontselect",function(){var b="Andale Mono=andale mono,monospace;Arial=arial,helvetica,sans-serif;Arial Black=arial black,sans-serif;Book Antiqua=book antiqua,palatino,serif;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,palatino,serif;Helvetica=helvetica,arial,sans-serif;Impact=impact,sans-serif;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco,monospace;Times New Roman=times new roman,times,serif;Trebuchet MS=trebuchet ms,geneva,sans-serif;Verdana=verdana,geneva,sans-serif;Webdings=webdings;Wingdings=wingdings,zapf dingbats",d=[],f=e(a.settings.font_formats||b);return p(f,function(a){d.push({text:{raw:a[0]},value:a[1],textStyle:a[1].indexOf("dings")==-1?"font-family:"+a[1]:""})}),{type:"listbox",text:"Font Family",tooltip:"Font Family",values:d,fixedWidth:!0,onPostRender:c(d),onselect:function(b){b.control.settings.value&&a.execCommand("FontName",!1,b.control.settings.value)}}}),a.addButton("fontsizeselect",function(){var b=[],c="8pt 10pt 12pt 14pt 18pt 24pt 36pt",e=a.settings.fontsize_formats||c;return p(e.split(" "),function(a){var c=a,d=a,e=a.split("=");e.length>1&&(c=e[0],d=e[1]),b.push({text:c,value:d})}),{type:"listbox",text:"Font Sizes",tooltip:"Font Sizes",values:b,fixedWidth:!0,onPostRender:d(b),onclick:function(b){b.control.settings.value&&a.execCommand("FontSize",!1,b.control.settings.value)}}}),a.addMenuItem("formats",{text:"Formats",menu:r})}var p=l.each,q=function(a){return k.reduce(a,function(a,b){return a.concat(b)},[])};return e.on("AddEditor",function(a){var b=a.editor;n(b),o(b),m(b)}),h.translate=function(a){return e.translate(a)},j.tooltips=!f.iOS,{}}),g("3n",["34"],function(a){"use strict";return a.extend({recalc:function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E=[],F=[];b=a.settings,e=a.items().filter(":visible"),f=a.layoutRect(),d=b.columns||Math.ceil(Math.sqrt(e.length)),c=Math.ceil(e.length/d),s=b.spacingH||b.spacing||0,t=b.spacingV||b.spacing||0,u=b.alignH||b.align,v=b.alignV||b.align,q=a.paddingBox,C="reverseRows"in b?b.reverseRows:a.isRtl(),u&&"string"==typeof u&&(u=[u]),v&&"string"==typeof v&&(v=[v]);for(l=0;lE[l]?y:E[l],F[m]=z>F[m]?z:F[m];for(A=f.innerW-q.left-q.right,w=0,l=0;l0?s:0),A-=(l>0?s:0)+E[l];for(B=f.innerH-q.top-q.bottom,x=0,m=0;m0?t:0),B-=(m>0?t:0)+F[m];if(w+=q.left+q.right,x+=q.top+q.bottom,i={},i.minW=w+(f.w-f.innerW),i.minH=x+(f.h-f.innerH),i.contentW=i.minW-f.deltaW,i.contentH=i.minH-f.deltaH,i.minW=Math.min(i.minW,f.maxW),i.minH=Math.min(i.minH,f.maxH),i.minW=Math.max(i.minW,f.startMinWidth),i.minH=Math.max(i.minH,f.startMinHeight),!f.autoResize||i.minW==f.minW&&i.minH==f.minH){f.autoResize&&(i=a.layoutRect(i),i.contentW=i.minW-f.deltaW,i.contentH=i.minH-f.deltaH);var G;G="start"==b.packV?0:B>0?Math.floor(B/c):0;var H=0,I=b.flexWidths;if(I)for(l=0;l'; +},src:function(a){this.getEl().src=a},html:function(a,c){var d=this,e=this.getEl().contentWindow.document.body;return e?(e.innerHTML=a,c&&c()):b.setTimeout(function(){d.html(a)}),this}})}),g("3p",["31"],function(a){"use strict";return a.extend({init:function(a){var b=this;b._super(a),b.classes.add("widget").add("infobox"),b.canFocus=!1},severity:function(a){this.classes.remove("error"),this.classes.remove("warning"),this.classes.remove("success"),this.classes.add(a)},help:function(a){this.state.set("help",a)},renderHtml:function(){var a=this,b=a.classPrefix;return'
    '+a.encode(a.state.get("text"))+'
    '},bindStates:function(){var a=this;return a.state.on("change:text",function(b){a.getEl("body").firstChild.data=a.encode(b.value),a.state.get("rendered")&&a.updateLayoutRect()}),a.state.on("change:help",function(b){a.classes.toggle("has-help",b.value),a.state.get("rendered")&&a.updateLayoutRect()}),a._super()}})}),g("3q",["31","2c"],function(a,b){"use strict";return a.extend({init:function(a){var b=this;b._super(a),b.classes.add("widget").add("label"),b.canFocus=!1,a.multiline&&b.classes.add("autoscroll"),a.strong&&b.classes.add("strong")},initLayoutRect:function(){var a=this,c=a._super();if(a.settings.multiline){var d=b.getSize(a.getEl());d.width>c.maxW&&(c.minW=c.maxW,a.classes.add("multiline")),a.getEl().style.width=c.minW+"px",c.startMinH=c.h=c.minH=Math.min(c.maxH,b.getSize(a.getEl()).height)}return c},repaint:function(){var a=this;return a.settings.multiline||(a.getEl().style.lineHeight=a.layoutRect().h+"px"),a._super()},severity:function(a){this.classes.remove("error"),this.classes.remove("warning"),this.classes.remove("success"),this.classes.add(a)},renderHtml:function(){var a,b,c=this,d=c.settings.forId,e=c.settings.html?c.settings.html:c.encode(c.state.get("text"));return!d&&(b=c.settings.forName)&&(a=c.getRoot().find("#"+b)[0],a&&(d=a._id)),d?'":''+e+""},bindStates:function(){var a=this;return a.state.on("change:text",function(b){a.innerHtml(a.encode(b.value)),a.state.get("rendered")&&a.updateLayoutRect()}),a._super()}})}),g("3r",["2t"],function(a){"use strict";return a.extend({Defaults:{role:"toolbar",layout:"flow"},init:function(a){var b=this;b._super(a),b.classes.add("toolbar")},postRender:function(){var a=this;return a.items().each(function(a){a.classes.add("toolbar-item")}),a._super()}})}),g("3s",["3r"],function(a){"use strict";return a.extend({Defaults:{role:"menubar",containerCls:"menubar",ariaRoot:!0,defaults:{type:"menubutton"}}})}),g("3t",["35","2r","3s"],function(a,b,c){"use strict";function d(a,b){for(;a;){if(b===a)return!0;a=a.parentNode}return!1}var e=a.extend({init:function(a){var b=this;b._renderOpen=!0,b._super(a),a=b.settings,b.classes.add("menubtn"),a.fixedWidth&&b.classes.add("fixed-width"),b.aria("haspopup",!0),b.state.set("menu",a.menu||b.render())},showMenu:function(a){var c,d=this;return d.menu&&d.menu.visible()&&a!==!1?d.hideMenu():(d.menu||(c=d.state.get("menu")||[],c.length?c={type:"menu",items:c}:c.type=c.type||"menu",c.renderTo?d.menu=c.parent(d).show().renderTo():d.menu=b.create(c).parent(d).renderTo(),d.fire("createmenu"),d.menu.reflow(),d.menu.on("cancel",function(a){a.control.parent()===d.menu&&(a.stopPropagation(),d.focus(),d.hideMenu())}),d.menu.on("select",function(){d.focus()}),d.menu.on("show hide",function(a){a.control==d.menu&&d.activeMenu("show"==a.type),d.aria("expanded","show"==a.type)}).fire("show")),d.menu.show(),d.menu.layoutRect({w:d.layoutRect().w}),d.menu.moveRel(d.getEl(),d.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"]),void d.fire("showmenu"))},hideMenu:function(){var a=this;a.menu&&(a.menu.items().each(function(a){a.hideMenu&&a.hideMenu()}),a.menu.hide())},activeMenu:function(a){this.classes.toggle("active",a)},renderHtml:function(){var a,b=this,d=b._id,e=b.classPrefix,f=b.settings.icon,g=b.state.get("text"),h="";return a=b.settings.image,a?(f="none","string"!=typeof a&&(a=window.getSelection?a[0]:a[1]),a=" style=\"background-image: url('"+a+"')\""):a="",g&&(b.classes.add("btn-has-text"),h=''+b.encode(g)+""),f=b.settings.icon?e+"ico "+e+"i-"+f:"",b.aria("role",b.parent()instanceof c?"menuitem":"button"),'
    '},postRender:function(){var a=this;return a.on("click",function(b){b.control===a&&d(b.target,a.getEl())&&(a.focus(),a.showMenu(!b.aria),b.aria&&a.menu.items().filter(":visible")[0].focus())}),a.on("mouseenter",function(b){var c,d=b.control,f=a.parent();d&&f&&d instanceof e&&d.parent()==f&&(f.items().filter("MenuButton").each(function(a){a.hideMenu&&a!=d&&(a.menu&&a.menu.visible()&&(c=!0),a.hideMenu())}),c&&(d.focus(),d.showMenu()))}),a._super()},bindStates:function(){var a=this;return a.state.on("change:menu",function(){a.menu&&a.menu.remove(),a.menu=null}),a._super()},remove:function(){this._super(),this.menu&&this.menu.remove()}});return e}),g("3u",["31","2r","9","8"],function(a,b,c,d){"use strict";return a.extend({Defaults:{border:0,role:"menuitem"},init:function(a){var b,c=this;c._super(a),a=c.settings,c.classes.add("menu-item"),a.menu&&c.classes.add("menu-item-expand"),a.preview&&c.classes.add("menu-item-preview"),b=c.state.get("text"),"-"!==b&&"|"!==b||(c.classes.add("menu-item-sep"),c.aria("role","separator"),c.state.set("text","-")),a.selectable&&(c.aria("role","menuitemcheckbox"),c.classes.add("menu-item-checkbox"),a.icon="selected"),a.preview||a.selectable||c.classes.add("menu-item-normal"),c.on("mousedown",function(a){a.preventDefault()}),a.menu&&!a.ariaHideMenu&&c.aria("haspopup",!0)},hasMenus:function(){return!!this.settings.menu},showMenu:function(){var a,c=this,d=c.settings,e=c.parent();if(e.items().each(function(a){a!==c&&a.hideMenu()}),d.menu){a=c.menu,a?a.show():(a=d.menu,a.length?a={type:"menu",items:a}:a.type=a.type||"menu",e.settings.itemDefaults&&(a.itemDefaults=e.settings.itemDefaults),a=c.menu=b.create(a).parent(c).renderTo(),a.reflow(),a.on("cancel",function(b){b.stopPropagation(),c.focus(),a.hide()}),a.on("show hide",function(a){a.control.items&&a.control.items().each(function(a){a.active(a.settings.selected)})}).fire("show"),a.on("hide",function(b){b.control===a&&c.classes.remove("selected")}),a.submenu=!0),a._parentMenu=e,a.classes.add("menu-sub");var f=a.testMoveRel(c.getEl(),c.isRtl()?["tl-tr","bl-br","tr-tl","br-bl"]:["tr-tl","br-bl","tl-tr","bl-br"]);a.moveRel(c.getEl(),f),a.rel=f,f="menu-sub-"+f,a.classes.remove(a._lastRel).add(f),a._lastRel=f,c.classes.add("selected"),c.aria("expanded",!0)}},hideMenu:function(){var a=this;return a.menu&&(a.menu.items().each(function(a){a.hideMenu&&a.hideMenu()}),a.menu.hide(),a.aria("expanded",!1)),a},renderHtml:function(){function a(a){var b,d,e={};for(e=c.mac?{alt:"⌥",ctrl:"⌘",shift:"⇧",meta:"⌘"}:{meta:"Ctrl"},a=a.split("+"),b=0;b").replace(new RegExp(b("]mce~match!"),"g"),"")}var f=this,g=f._id,h=f.settings,i=f.classPrefix,j=f.state.get("text"),k=f.settings.icon,l="",m=h.shortcut,n=f.encode(h.url),o="";return k&&f.parent().classes.add("menu-has-icons"),h.image&&(l=" style=\"background-image: url('"+h.image+"')\""),m&&(m=a(m)),k=i+"ico "+i+"i-"+(f.settings.icon||"none"),o="-"!==j?'\xa0":"",j=e(f.encode(d(j))),n=e(f.encode(d(n))),'
    '+o+("-"!==j?''+j+"":"")+(m?'
    '+m+"
    ":"")+(h.menu?'
    ':"")+(n?'":"")+"
    "},postRender:function(){var a=this,b=a.settings,c=b.textStyle;if("function"==typeof c&&(c=c.call(this)),c){var e=a.getEl("text");e&&e.setAttribute("style",c)}return a.on("mouseenter click",function(c){c.control===a&&(b.menu||"click"!==c.type?(a.showMenu(),c.aria&&a.menu.focus(!0)):(a.fire("select"),d.requestAnimationFrame(function(){a.parent().hideAll()})))}),a._super(),a},hover:function(){var a=this;return a.parent().items().each(function(a){a.classes.remove("selected")}),a.classes.toggle("selected",!0),a},active:function(a){return"undefined"!=typeof a&&this.aria("checked",a),this._super(a)},remove:function(){this._super(),this.menu&&this.menu.remove()}})}),g("3v",["d","2q","8"],function(a,b,c){"use strict";return function(d,e){var f,g,h=this,i=b.classPrefix;h.show=function(b,j){function k(){f&&(a(d).append('
    '),j&&j())}return h.hide(),f=!0,b?g=c.setTimeout(k,b):k(),h},h.hide=function(){var a=d.lastChild;return c.clearTimeout(g),a&&a.className.indexOf("throbber")!=-1&&a.parentNode.removeChild(a),f=!1,h}}}),g("3w",["2z","3u","3v","c"],function(a,b,c,d){"use strict";return a.extend({Defaults:{defaultType:"menuitem",border:1,layout:"stack",role:"application",bodyRole:"menu",ariaRoot:!0},init:function(a){var b=this;if(a.autohide=!0,a.constrainToViewport=!0,"function"==typeof a.items&&(a.itemsFactory=a.items,a.items=[]),a.itemDefaults)for(var c=a.items,e=c.length;e--;)c[e]=d.extend({},a.itemDefaults,c[e]);b._super(a),b.classes.add("menu")},repaint:function(){return this.classes.toggle("menu-align",!0),this._super(),this.getEl().style.height="",this.getEl("body").style.height="",this},cancel:function(){var a=this;a.hideAll(),a.fire("select")},load:function(){function a(){e.throbber&&(e.throbber.hide(),e.throbber=null)}var b,d,e=this;d=e.settings.itemsFactory,d&&(e.throbber||(e.throbber=new c(e.getEl("body"),!0),0===e.items().length?(e.throbber.show(),e.fire("loading")):e.throbber.show(100,function(){e.items().remove(),e.fire("loading")}),e.on("hide close",a)),e.requestTime=b=(new Date).getTime(),e.settings.itemsFactory(function(c){return 0===c.length?void e.hide():void(e.requestTime===b&&(e.getEl().style.width="",e.getEl("body").style.width="",a(),e.items().remove(),e.getEl("body").innerHTML="",e.add(c),e.renderNew(),e.fire("loaded")))}))},hideAll:function(){var a=this;return this.find("menuitem").exec("hideMenu"),a._super()},preRender:function(){var a=this;return a.items().each(function(b){var c=b.settings;if(c.icon||c.image||c.selectable)return a._hasIcons=!0,!1}),a.settings.itemsFactory&&a.on("postrender",function(){a.settings.itemsFactory&&a.load()}),a._super()}})}),g("3x",["3t","3w"],function(a,b){"use strict";return a.extend({init:function(a){function b(c){for(var f=0;f0&&(e=c[0].text,g.state.set("value",c[0].value)),g.state.set("menu",c)),g.state.set("text",a.text||e),g.classes.add("listbox"),g.on("select",function(b){var c=b.control;f&&(b.lastControl=f),a.multiple?c.active(!c.active()):g.value(b.control.value()),f=c})},bindStates:function(){function a(a,c){a instanceof b&&a.items().each(function(a){a.hasMenus()||a.active(a.value()===c)})}function c(a,b){var d;if(a)for(var e=0;e'},postRender:function(){var a=this;a._super(),a.resizeDragHelper=new b(this._id,{start:function(){a.fire("ResizeStart")},drag:function(b){"both"!=a.settings.direction&&(b.deltaX=0),a.fire("Resize",b)},stop:function(){a.fire("ResizeEnd")}})},remove:function(){return this.resizeDragHelper&&this.resizeDragHelper.destroy(),this._super()}})}),g("40",["31"],function(a){"use strict";function b(a){var b="";if(a)for(var c=0;c'+a[c]+"";return b}return a.extend({Defaults:{classes:"selectbox",role:"selectbox",options:[]},init:function(a){var b=this;b._super(a),b.settings.size&&(b.size=b.settings.size),b.settings.options&&(b._options=b.settings.options),b.on("keydown",function(a){var c;13==a.keyCode&&(a.preventDefault(),b.parents().reverse().each(function(a){if(a.toJSON)return c=a,!1}),b.fire("submit",{data:c.toJSON()}))})},options:function(a){return arguments.length?(this.state.set("options",a),this):this.state.get("options")},renderHtml:function(){var a,c=this,d="";return a=b(c._options),c.size&&(d=' size = "'+c.size+'"'),'"},bindStates:function(){var a=this;return a.state.on("change:options",function(c){a.getEl().innerHTML=b(c.value)}),a._super()}})}),g("41",["31","2u","2c"],function(a,b,c){"use strict";function d(a,b,c){return ac&&(a=c),a}function e(a,b,c){a.setAttribute("aria-"+b,c)}function f(a,b){var d,f,g,h,i,j;"v"==a.settings.orientation?(h="top",g="height",f="h"):(h="left",g="width",f="w"),j=a.getEl("handle"),d=(a.layoutRect()[f]||100)-c.getSize(j)[g],i=d*((b-a._minValue)/(a._maxValue-a._minValue))+"px",j.style[h]=i,j.style.height=a.layoutRect().h+"px",e(j,"valuenow",b),e(j,"valuetext",""+a.settings.previewFilter(b)),e(j,"valuemin",a._minValue),e(j,"valuemax",a._maxValue)}return a.extend({init:function(a){var b=this;a.previewFilter||(a.previewFilter=function(a){return Math.round(100*a)/100}),b._super(a),b.classes.add("slider"),"v"==a.orientation&&b.classes.add("vertical"),b._minValue=a.minValue||0,b._maxValue=a.maxValue||100,b._initValue=b.state.get("value")},renderHtml:function(){var a=this,b=a._id,c=a.classPrefix;return'
    '},reset:function(){this.value(this._initValue).repaint()},postRender:function(){function a(a,b,c){return(c+a)/(b-a)}function e(a,b,c){return c*(b-a)-a}function f(b,c){function f(f){var g;g=n.value(),g=e(b,c,a(b,c,g)+.05*f),g=d(g,b,c),n.value(g),n.fire("dragstart",{value:g}),n.fire("drag",{value:g}),n.fire("dragend",{value:g})}n.on("keydown",function(a){switch(a.keyCode){case 37:case 38:f(-1);break;case 39:case 40:f(1)}})}function g(a,e,f){var g,h,i,o,p;n._dragHelper=new b(n._id,{handle:n._id+"-handle",start:function(a){g=a[j],h=parseInt(n.getEl("handle").style[k],10),i=(n.layoutRect()[m]||100)-c.getSize(f)[l],n.fire("dragstart",{value:p})},drag:function(b){var c=b[j]-g;o=d(h+c,0,i),f.style[k]=o+"px",p=a+o/i*(e-a),n.value(p),n.tooltip().text(""+n.settings.previewFilter(p)).show().moveRel(f,"bc tc"),n.fire("drag",{value:p})},stop:function(){n.tooltip().hide(),n.fire("dragend",{value:p})}})}var h,i,j,k,l,m,n=this;h=n._minValue,i=n._maxValue,"v"==n.settings.orientation?(j="screenY",k="top",l="height",m="h"):(j="screenX",k="left",l="width",m="w"),n._super(),f(h,i,n.getEl("handle")),g(h,i,n.getEl("handle"))},repaint:function(){this._super(),f(this,this.value())},bindStates:function(){var a=this;return a.state.on("change:value",function(b){f(a,b.value)}),a._super()}})}),g("42",["31"],function(a){"use strict";return a.extend({renderHtml:function(){var a=this;return a.classes.add("spacer"),a.canFocus=!1,'
    '}})}),g("43",["3t","2c","d"],function(a,b,c){return a.extend({Defaults:{classes:"widget btn splitbtn",role:"button"},repaint:function(){var a,d,e=this,f=e.getEl(),g=e.layoutRect();return e._super(),a=f.firstChild,d=f.lastChild,c(a).css({width:g.w-b.getSize(d).width,height:g.h-2}),c(d).css({height:g.h-2}),e},activeMenu:function(a){var b=this;c(b.getEl().lastChild).toggleClass(b.classPrefix+"active",a)},renderHtml:function(){var a,b=this,c=b._id,d=b.classPrefix,e=b.state.get("icon"),f=b.state.get("text"),g="";return a=b.settings.image,a?(e="none","string"!=typeof a&&(a=window.getSelection?a[0]:a[1]),a=" style=\"background-image: url('"+a+"')\""):a="",e=b.settings.icon?d+"ico "+d+"i-"+e:"",f&&(b.classes.add("btn-has-text"),g=''+b.encode(f)+""),'
    '},postRender:function(){var a=this,b=a.settings.onclick;return a.on("click",function(a){var c=a.target;if(a.control==this)for(;c;){if(a.aria&&"down"!=a.aria.key||"BUTTON"==c.nodeName&&c.className.indexOf("open")==-1)return a.stopImmediatePropagation(),void(b&&b.call(this,a));c=c.parentNode}}),delete a.settings.onclick,a._super()}})}),g("44",["3l"],function(a){"use strict";return a.extend({Defaults:{containerClass:"stack-layout",controlClass:"stack-layout-item",endClass:"break"},isNative:function(){return!0}})}),g("45",["2w","d","2c"],function(a,b,c){"use strict";return a.extend({Defaults:{layout:"absolute",defaults:{type:"panel"}},activateTab:function(a){var c;this.activeTabId&&(c=this.getEl(this.activeTabId),b(c).removeClass(this.classPrefix+"active"),c.setAttribute("aria-selected","false")),this.activeTabId="t"+a,c=this.getEl("t"+a),c.setAttribute("aria-selected","true"),b(c).addClass(this.classPrefix+"active"),this.items()[a].show().fire("showtab"),this.reflow(),this.items().each(function(b,c){a!=c&&b.hide()})},renderHtml:function(){var a=this,b=a._layout,c="",d=a.classPrefix;return a.preRender(),b.preRender(a),a.items().each(function(b,e){var f=a._id+"-t"+e;b.aria("role","tabpanel"),b.aria("labelledby",f),c+='"}),'
    '+c+'
    '+b.renderHtml(a)+"
    "},postRender:function(){var a=this;a._super(),a.settings.activeTab=a.settings.activeTab||0,a.activateTab(a.settings.activeTab),this.on("click",function(b){var c=b.target.parentNode;if(c&&c.id==a._id+"-head")for(var d=c.childNodes.length;d--;)c.childNodes[d]==b.target&&a.activateTab(d)})},initLayoutRect:function(){var a,b,d,e=this;b=c.getSize(e.getEl("head")).width,b=b<0?0:b,d=0,e.items().each(function(a){b=Math.max(b,a.layoutRect().minW),d=Math.max(d,a.layoutRect().minH)}),e.items().each(function(a){a.settings.x=0,a.settings.y=0,a.settings.w=b,a.settings.h=d,a.layoutRect({x:0,y:0,w:b,h:d})});var f=c.getSize(e.getEl("head")).height;return e.settings.minWidth=b,e.settings.minHeight=d+f,a=e._super(),a.deltaH+=f,a.innerH=a.h-a.deltaH,a}})}),g("46",["31","c","2c"],function(a,b,c){return a.extend({init:function(a){var b=this;b._super(a),b.classes.add("textbox"),a.multiline?b.classes.add("multiline"):(b.on("keydown",function(a){var c;13==a.keyCode&&(a.preventDefault(),b.parents().reverse().each(function(a){if(a.toJSON)return c=a,!1}),b.fire("submit",{data:c.toJSON()}))}),b.on("keyup",function(a){b.state.set("value",a.target.value)}))},repaint:function(){var a,b,c,d,e,f=this,g=0;a=f.getEl().style,b=f._layoutRect,e=f._lastRepaintRect||{};var h=document;return!f.settings.multiline&&h.all&&(!h.documentMode||h.documentMode<=8)&&(a.lineHeight=b.h-g+"px"),c=f.borderBox,d=c.left+c.right+8,g=c.top+c.bottom+(f.settings.multiline?8:0),b.x!==e.x&&(a.left=b.x+"px",e.x=b.x),b.y!==e.y&&(a.top=b.y+"px",e.y=b.y),b.w!==e.w&&(a.width=b.w-d+"px",e.w=b.w),b.h!==e.h&&(a.height=b.h-g+"px",e.h=b.h),f._lastRepaintRect=e,f.fire("repaint",{},!1),f},renderHtml:function(){var a,d,e=this,f=e.settings;return a={id:e._id,hidefocus:"1"},b.each(["rows","spellcheck","maxLength","size","readonly","min","max","step","list","pattern","placeholder","required","multiple"],function(b){a[b]=f[b]}),e.disabled()&&(a.disabled="disabled"),f.subtype&&(a.type=f.subtype),d=c.create(f.multiline?"textarea":"input",a),d.value=e.state.get("value"),d.className=e.classes,d.outerHTML},value:function(a){return arguments.length?(this.state.set("value",a),this):(this.state.get("rendered")&&this.state.set("value",this.getEl().value),this.state.get("value"))},postRender:function(){var a=this;a.getEl().value=a.state.get("value"),a._super(),a.$el.on("change",function(b){a.state.set("value",b.target.value),a.fire("change",b)})},bindStates:function(){var a=this;return a.state.on("change:value",function(b){a.getEl().value!=b.value&&(a.getEl().value=b.value)}),a.state.on("change:disabled",function(b){a.getEl().disabled=b.value}),a._super()},remove:function(){this.$el.off(),this._super()}})}),h("5r",RegExp),g("47",["31","c","2c","5r"],function(a,b,c,d){return a.extend({init:function(a){var c=this;a=b.extend({height:100,text:"Drop an image here",multiple:!1,accept:null},a),c._super(a),c.classes.add("dropzone"),a.multiple&&c.classes.add("multiple")},renderHtml:function(){var a,b,d=this,e=d.settings;return a={id:d._id,hidefocus:"1"},b=c.create("div",a,""+e.text+""),e.height&&c.css(b,"height",e.height+"px"),e.width&&c.css(b,"width",e.width+"px"),b.className=d.classes,b.outerHTML},postRender:function(){var a=this,c=function(b){b.preventDefault(),a.classes.toggle("dragenter"),a.getEl().className=a.classes},e=function(c){var e=a.settings.accept;if("string"!=typeof e)return c;var f=new d("("+e.split(/\s*,\s*/).join("|")+")$","i");return b.grep(c,function(a){return f.test(a.name)})};a._super(),a.$el.on("dragover",function(a){a.preventDefault()}),a.$el.on("dragenter",c),a.$el.on("dragleave",c),a.$el.on("drop",function(b){if(b.preventDefault(),!a.state.get("disabled")){var c=e(b.dataTransfer.files);a.value=function(){return c.length?a.settings.multiple?c:c[0]:null},c.length&&a.fire("change",b)}})},remove:function(){this.$el.off(),this._super()}})}),g("48",["35","c","2c","d","5r"],function(a,b,c,d,e){return a.extend({init:function(a){var c=this;a=b.extend({text:"Browse...",multiple:!1,accept:null},a),c._super(a),c.classes.add("browsebutton"),a.multiple&&c.classes.add("multiple")},postRender:function(){var a=this,b=c.create("input",{type:"file",id:a._id+"-browse",accept:a.settings.accept});a._super(),d(b).on("change",function(b){var c=b.target.files;a.value=function(){return c.length?a.settings.multiple?c:c[0]:null},b.preventDefault(),c.length&&a.fire("change",b)}),d(b).on("click",function(a){a.stopPropagation()}),d(a.getEl("button")).on("click",function(a){a.stopPropagation(),b.click()}),a.getEl().appendChild(b)},remove:function(){d(this.getEl("button")).off(),d(this.getEl("input")).off(),this._super()}})}),g("1g",["2n","2o","2p","2q","2r","2s","2t","2u","2v","2w","2x","2y","2z","29","2a","30","31","32","2d","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","3g","3h","3i","3j","3k","3l","3m","3n","3o","3p","3q","3r","3s","3t","3u","3v","3w","3x","3y","3z","40","41","42","43","44","45","46","47","48"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,$,_,aa,ba,ca,da,ea,fa,ga){"use strict";var ha=function(a,b){e.add(a.split(".").pop(),b)},ia=function(a,b,c){var d,e;for(e=b.split(/[.\/]/),d=0;d1E��*�a��C��`�������E ����}�C�Ng�eD\r���,A{��*OB�^8�\n�΃�c��%�-�7]�B(X���|+OB�R8�8���B{C�cy5�à�����Puƽ��7�����pb)t��3Bҁ\Zpl��� ��?��8�?j���$TA�>8�rgC��fo/,�/r �K�87N���C�������W�\no�rA�?�I���íCU�-Ky��&�Qc_�Pظʎ8�.�/��D㜼�(Q׺�o/�-r0$<97Ict%�c��wC�Cq��Er|��}�:���k� 0� ���A�wa�`�.u)g�5��� \'A�Kk  [�P�}\'�HO#~t�\r�`�P�������q��f}�_�����/.s�?�Tͥ�p�����JX�C�O���@��D���X�>�j9�D^%����K�C�P���XEY��N��*W���\n��� �=ޅ/S붜�$<\0�����C����*J3��}pd��r�^��ƈ�<��ϡ�$H����s�����߃m�A�Vo>͵�ҕwVBh�\n�w2��}���\"F�i�]�@��+�\ZH�ʎA�iP��v��j�5ϲ��o����nX)� �i��W+Ύ��t��`���px&TC�t��g��)�] ���t�a�r�� �\n�]p�Qq��8�1��IO��7��TßA��e(�̉e�w�� ��~��.�RO�BMy�4�;��e=d�d�f�S���&��œ������{ �������\'T�-O�a�X��7c_� w7p��������wxη�����}Ԉ!�_SU ��\Z(;���������aP]b��I��Cӑ��7��!�Am��h3T|#����p#{�ky��3����3\Z��%]Y\0�n�.��� J�������XG\r�Q@Q�U����ў?�`T�,-��I�K��L��ɐ9�6�݅1�Y����w6� ��F ���׼�B�Lth��uK���%�X������rC��}NW��(���ǵ���f�\n�n���~�� Q�� 3�j�.D�u����0k?�L�lT�t�KL.�e-}R�_\Zlܣ���a^��_�}��!�\n�Y>s����:L�.3�Mm����q�lE���ҿ��������dFEH�M/�N�=����t� ��u�Z�鸺�i��ϻ�b��~ڼ����9�\"f����5�+b�W���2]����Q�ᐺAި��c�K?��c޶F6 {X�6�\n�w[`�@��™���w��$*{�[���c��Xӥ�$�Xl�x��@�_��{�ذ�>���a��Ր�N��+�k�� ��r���:n����%�س��ˌ(g���i*�β~.�k:�U�\0aYm���G\0vq_���l=�(۷|�lr���@��z�l �/��@�ޭ���)����o�#:D\Z�N;��mm�I����]���uu��$�إ���W�]�}��z�ׅ���;������ N��\rW5��y��շ|����r�\r�Cf]�Z�x�|1`����Ll���+�wV����<�j�a����q3�3��(�����R��������ˠtm��/��\0gݮ‘���s\\䌭�B�Ű9��|��j]bGB�z8��SD�\r�S�& Se�_�1�b�\0�����c?��[Ǝ4��OA���s�񏆰 �(ak����������~]#����Vn�k[�^������q��mZL_H~Ҙ�Pq�:m�(5\r[�t�ԹF��o��� \0 �!f��o�_�v�?��s@$�vweY��Ac�u�t ą�ʴ„�2�(,�EE з��A1+,�.����dr��ba�e*̖#�Z�x�u�W��㇕�d ������ ~����b���`�P�Uۭ�v�S{z���\n� r�l(U�a�p�3��X܊B8��S�F-��O��w@�$i���I��W��@f�e��9ЩC�o�6�>��)�w�U�s1E��*�a��C��`�������E ����}�C�Ng�eD\r���,A{��*OB�^8�\n�΃�c��%�-�7]�B(X���|+OB�R8�8���B{C�cy5�à�����Puƽ��7�����pb)t��3Bҁ\Zpl��� ��?��8�?j���$TA�>8�rgC��fo/,�/r �K�87N���C�������W�\no�rA�?�I���íCU�-Ky��&�Qc_�Pظʎ8�.�/��D㜼�(Q׺�o/�-r0$<97Ict%�c��wC�Cq��Er|��}�:���k� 0� ���A�wa�`�.u)g�5��� \'A�Kk  [�P�}\'�HO#~t�\r�`�P�������q��f}�_�����/.s�?�Tͥ�p�����JX�C�O���@��D���X�>�j9�D^%����K�C�P���XEY��N��*W���\n��� �=ޅ/S붜�$<\0�����C����*J3��}pd��r�^��ƈ�<��ϡ�$H����s�����߃m�A�Vo>͵�ҕwVBh�\n�w2��}���\"F�i�]�@��+�\ZH�ʎA�iP��v��j�5ϲ��o����nX)� �i��W+Ύ��t��`���px&TC�t��g��)�] ���t�a�r�� �\n�]p�Qq��8�1��IO��7��TßA��e(�̉e�w�� ��~��.�RO�BMy�4�;��e=d�d�f�S���&��œ������{ �������\'T�-O�a�X��7c_� w7p��������wxη�����}Ԉ!�_SU ��\Z(;���������aP]b��I��Cӑ��7��!�Am��h3T|#����p#{�ky��3����3\Z��%]Y\0�n�.��� J�������XG\r�Q@Q�U����ў?�`T�,-��I�K��L��ɐ9�6�݅1�Y����w6� ��F ���׼�B�Lth��uK���%�X������rC��}NW��(���ǵ���f�\n�n���~�� Q�� 3�j�.D�u����0k?�L�lT�t�KL.�e-}R�_\Zlܣ���a^��_�}��!�\n�Y>s����:L�.3�Mm����q�lE���ҿ��������dFEH�M/�N�=����t� ��u�Z�鸺�i��ϻ�b��~ڼ����9�\"f����5�+b�W���2]����Q�ᐺAި��c�K?��c޶F6 {X�6�\n�w[`�@��™���w��$*{�[���c��Xӥ�$�Xl�x��@�_��{�ذ�>���a��Ր�N��+�k�� ��r���:n����%�س��ˌ(g���i*�β~.�k:�U�\0aYm���G\0vq_���l=�(۷|�lr���@��z�l �/��@�ޭ���)����o�#:D\Z�N;��mm�I����]���uu��$�إ���W�]�}��z�ׅ���;������ N��\rW5��y��շ|����r�\r�Cf]�Z�x�|1`����Ll���+�wV����<�j�a����q3�3��(�����R��������ˠtm��/��\0gݮ‘���s\\䌭�B�Ű9��|��j]bGB�z8��SD�\r�S�& Se�_�1�b�\0�����c?��[Ǝ4��OA���s�񏆰 �(ak����������~]#����Vn�k[�^������q��mZL_H~Ҙ�Pq�:m�(5\r[�t�ԹF��o��� \0 �!f��o�_�v�?��s@$�vweY��Ac�u�t ą�ʴ„�2�(,�EE з��A1+,�.����dr��ba�e*̖#�Z�x�u�W��㇕�d ������ ~����b���`�P�Uۭ�v�S{z���\n� r�l(U�a�p�3��X܊B8��S�F-��O��w@�$i���I��W��@f�e��9ЩC�o�6�>��)�w�U�s1E��*�a��C��`�������E ����}�C�Ng�eD\r���,A{��*OB�^8�\n�΃�c��%�-�7]�B(X���|+OB�R8�8���B{C�cy5�à�����Puƽ��7�����pb)t��3Bҁ\Zpl��� ��?��8�?j���$TA�>8�rgC��fo/,�/r �K�87N���C�������W�\no�rA�?�I���íCU�-Ky��&�Qc_�Pظʎ8�.�/��D㜼�(Q׺�o/�-r0$<97Ict%�c��wC�Cq��Er|��}�:���k� 0� ���A�wa�`�.u)g�5��� \'A�Kk  [�P�}\'�HO#~t�\r�`�P�������q��f}�_�����/.s�?�Tͥ�p�����JX�C�O���@��D���X�>�j9�D^%����K�C�P���XEY��N��*W���\n��� �=ޅ/S붜�$<\0�����C����*J3��}pd��r�^��ƈ�<��ϡ�$H����s�����߃m�A�Vo>͵�ҕwVBh�\n�w2��}���\"F�i�]�@��+�\ZH�ʎA�iP��v��j�5ϲ��o����nX)� �i��W+Ύ��t��`���px&TC�t��g��)�] ���t�a�r�� �\n�]p�Qq��8�1��IO��7��TßA��e(�̉e�w�� ��~��.�RO�BMy�4�;��e=d�d�f�S���&��œ������{ �������\'T�-O�a�X��7c_� w7p��������wxη�����}Ԉ!�_SU ��\Z(;���������aP]b��I��Cӑ��7��!�Am��h3T|#����p#{�ky��3����3\Z��%]Y\0�n�.��� J�������XG\r�Q@Q�U����ў?�`T�,-��I�K��L��ɐ9�6�݅1�Y����w6� ��F ���׼�B�Lth��uK���%�X������rC��}NW��(���ǵ���f�\n�n���~�� Q�� 3�j�.D�u����0k?�L�lT�t�KL.�e-}R�_\Zlܣ���a^��_�}��!�\n�Y>s����:L�.3�Mm����q�lE���ҿ��������dFEH�M/�N�=����t� ��u�Z�鸺�i��ϻ�b��~ڼ����9�\"f����5�+b�W���2]����Q�ᐺAި��c�K?��c޶F6 {X�6�\n�w[`�@��™���w��$*{�[���c��Xӥ�$�Xl�x��@�_��{�ذ�>���a��Ր�N��+�k�� ��r���:n����%�س��ˌ(g���i*�β~.�k:�U�\0aYm���G\0vq_���l=�(۷|�lr���@��z�l �/��@�ޭ���)����o�#:D\Z�N;��mm�I����]���uu��$�إ���W�]�}��z�ׅ���;������ N��\rW5��y��շ|����r�\r�Cf]�Z�x�|1`����Ll���+�wV����<�j�a����q3�3��(�����R��������ˠtm��/��\0gݮ‘���s\\䌭�B�Ű9��|��j]bGB�z8��SD�\r�S�& Se�_�1�b�\0�����c?��[Ǝ4��OA���s�񏆰 �(ak����������~]#����Vn�k[�^������q��mZL_H~Ҙ�Pq�:m�(5\r[�t�ԹF��o��� \0 �!f��o�_�v�?��s@$�vweY��Ac�u�t ą�ʴ„�2�(,�EE з��A1+,�.����dr��ba�e*̖#�Z�x�u�W��㇕�d ������ ~����b���`�P�Uۭ�v�S{z���\n� r�l(U�a�p�3��X܊B8��S�F-��O��w@�$i���I��W��@f�e��9ЩC�o�6�>��)�w�U�s1E��*�a��C��`�������E ����}�C�Ng�eD\r���,A{��*OB�^8�\n�΃�c��%�-�7]�B(X���|+OB�R8�8���B{C�cy5�à�����Puƽ��7�����pb)t��3Bҁ\Zpl��� ��?��8�?j���$TA�>8�rgC��fo/,�/r �K�87N���C�������W�\no�rA�?�I���íCU�-Ky��&�Qc_�Pظʎ8�.�/��D㜼�(Q׺�o/�-r0$<97Ict%�c��wC�Cq��Er|��}�:���k� 0� ���A�wa�`�.u)g�5��� \'A�Kk  [�P�}\'�HO#~t�\r�`�P�������q��f}�_�����/.s�?�Tͥ�p�����JX�C�O���@��D���X�>�j9�D^%����K�C�P���XEY��N��*W���\n��� �=ޅ/S붜�$<\0�����C����*J3��}pd��r�^��ƈ�<��ϡ�$H����s�����߃m�A�Vo>͵�ҕwVBh�\n�w2��}���\"F�i�]�@��+�\ZH�ʎA�iP��v��j�5ϲ��o����nX)� �i��W+Ύ��t��`���px&TC�t��g��)�] ���t�a�r�� �\n�]p�Qq��8�1��IO��7��TßA��e(�̉e�w�� ��~��.�RO�BMy�4�;��e=d�d�f�S���&��œ������{ �������\'T�-O�a�X��7c_� w7p��������wxη�����}Ԉ!�_SU ��\Z(;���������aP]b��I��Cӑ��7��!�Am��h3T|#����p#{�ky��3����3\Z��%]Y\0�n�.��� J�������XG\r�Q@Q�U����ў?�`T�,-��I�K��L��ɐ9�6�݅1�Y����w6� ��F ���׼�B�Lth��uK���%�X������rC��}NW��(���ǵ���f�\n�n���~�� Q�� 3�j�.D�u����0k?�L�lT�t�KL.�e-}R�_\Zlܣ���a^��_�}��!�\n�Y>s����:L�.3�Mm����q�lE���ҿ��������dFEH�M/�N�=����t� ��u�Z�鸺�i��ϻ�b��~ڼ����9�\"f����5�+b�W���2]����Q�ᐺAި��c�K?��c޶F6 {X�6�\n�w[`�@��™���w��$*{�[���c��Xӥ�$�Xl�x��@�_��{�ذ�>���a��Ր�N��+�k�� ��r���:n����%�س��ˌ(g���i*�β~.�k:�U�\0aYm���G\0vq_���l=�(۷|�lr���@��z�l �/��@�ޭ���)����o�#:D\Z�N;��mm�I����]���uu��$�إ���W�]�}��z�ׅ���;������ N��\rW5��y��շ|����r�\r�Cf]�Z�x�|1`����Ll���+�wV����<�j�a����q3�3��(�����R��������ˠtm��/��\0gݮ‘���s\\䌭�B�Ű9��|��j]bGB�z8��SD�\r�S�& Se�_�1�b�\0�����c?��[Ǝ4��OA���s�񏆰 �(ak����������~]#����Vn�k[�^������q��mZL_H~Ҙ�Pq�:m�(5\r[�t�ԹF��o��� \0 �!f��o�_�v�?��s@$�vweY��Ac�u�t ą�ʴ„�2�(,�EE з��A1+,�.����dr��ba�e*̖#�Z�x�u�W��㇕�d ������ ~����b���`�P�Uۭ�v�S{z���\n� r�l(U�a�p�3��X܊B8��S�F-��O��w@�$i���I��W��@f�e��9ЩC�o�6�>��)�w�U�s1E��*�a��C��`�������E ����}�C�Ng�eD\r���,A{��*OB�^8�\n�΃�c��%�-�7]�B(X���|+OB�R8�8���B{C�cy5�à�����Puƽ��7�����pb)t��3Bҁ\Zpl��� ��?��8�?j���$TA�>8�rgC��fo/,�/r �K�87N���C�������W�\no�rA�?�I���íCU�-Ky��&�Qc_�Pظʎ8�.�/��D㜼�(Q׺�o/�-r0$<97Ict%�c��wC�Cq��Er|��}�:���k� 0� ���A�wa�`�.u)g�5��� \'A�Kk  [�P�}\'�HO#~t�\r�`�P�������q��f}�_�����/.s�?�Tͥ�p�����JX�C�O���@��D���X�>�j9�D^%����K�C�P���XEY��N��*W���\n��� �=ޅ/S붜�$<\0�����C����*J3��}pd��r�^��ƈ�<��ϡ�$H����s�����߃m�A�Vo>͵�ҕwVBh�\n�w2��}���\"F�i�]�@��+�\ZH�ʎA�iP��v��j�5ϲ��o����nX)� �i��W+Ύ��t��`���px&TC�t��g��)�] ���t�a�r�� �\n�]p�Qq��8�1��IO��7��TßA��e(�̉e�w�� ��~��.�RO�BMy�4�;��e=d�d�f�S���&��œ������{ �������\'T�-O�a�X��7c_� w7p��������wxη�����}Ԉ!�_SU ��\Z(;���������aP]b��I��Cӑ��7��!�Am��h3T|#����p#{�ky��3����3\Z��%]Y\0�n�.��� J�������XG\r�Q@Q�U����ў?�`T�,-��I�K��L��ɐ9�6�݅1�Y����w6� ��F ���׼�B�Lth��uK���%�X������rC��}NW��(���ǵ���f�\n�n���~�� Q�� 3�j�.D�u����0k?�L�lT�t�KL.�e-}R�_\Zlܣ���a^��_�}��!�\n�Y>s����:L�.3�Mm����q�lE���ҿ��������dFEH�M/�N�=����t� ��u�Z�鸺�i��ϻ�b��~ڼ����9�\"f����5�+b�W���2]����Q�ᐺAި��c�K?��c޶F6 {X�6�\n�w[`�@��™���w��$*{�[���c��Xӥ�$�Xl�x��@�_��{�ذ�>���a��Ր�N��+�k�� ��r���:n����%�س��ˌ(g���i*�β~.�k:�U�\0aYm���G\0vq_���l=�(۷|�lr���@��z�l �/��@�ޭ���)����o�#:D\Z�N;��mm�I����]���uu��$�إ���W�]�}��z�ׅ���;������ N��\rW5��y��շ|����r�\r�Cf]�Z�x�|1`����Ll���+�wV����<�j�a����q3�3��(�����R��������ˠtm��/��\0gݮ‘���s\\䌭�B�Ű9��|��j]bGB�z8��SD�\r�S�& Se�_�1�b�\0�����c?��[Ǝ4��OA���s�񏆰 �(ak����������~]#����Vn�k[�^������q��mZL_H~Ҙ�Pq�:m�(5\r[�t�ԹF��o��� \0 �!f��o�_�v�?��s@$�vweY��Ac�u�t ą�ʴ„�2�(,�EE з��A1+,�.����dr��ba�e*̖#�Z�x�u�W��㇕�d ������ ~����b���`�P�Uۭ�v�S{z���\n� r�l(U�a�p�3��X܊B8��S�F-��O��w@�$i���I��W��@f�e��9ЩC�o�6�>��)�w�U�sid = @security_script_input('/^[0-9]*$/', $_GET["id"]); diff --git a/hr/staff-journal-edit.php b/hr/staff-journal-edit.php index 12c44335..266bf9cb 100644 --- a/hr/staff-journal-edit.php +++ b/hr/staff-journal-edit.php @@ -19,7 +19,7 @@ class page_output var $obj_form; - function page_output() + function __construct() { // fetch variables $this->id = @security_script_input('/^[0-9]*$/', $_GET["id"]); diff --git a/hr/staff-journal.php b/hr/staff-journal.php index 757955e2..b6787bc0 100644 --- a/hr/staff-journal.php +++ b/hr/staff-journal.php @@ -16,7 +16,7 @@ class page_output var $obj_journal; - function page_output() + function __construct() { // fetch variables $this->id = @security_script_input('/^[0-9]*$/', $_GET["id"]); diff --git a/hr/staff-timebooked.php b/hr/staff-timebooked.php index 89f3b717..fb771bbc 100644 --- a/hr/staff-timebooked.php +++ b/hr/staff-timebooked.php @@ -16,7 +16,7 @@ class page_output var $obj_table; - function page_output() + function __construct() { // fetch variables $this->id = @security_script_input('/^[0-9]*$/', $_GET["id"]); diff --git a/hr/staff-view.php b/hr/staff-view.php index 3c4f47ec..1d3b1a51 100644 --- a/hr/staff-view.php +++ b/hr/staff-view.php @@ -16,7 +16,7 @@ class page_output var $obj_form; - function page_output() + function __construct() { // fetch variables $this->id = @security_script_input('/^[0-9]*$/', $_GET["id"]); diff --git a/include/accounts/inc_credits.php b/include/accounts/inc_credits.php index 767eb755..21158074 100644 --- a/include/accounts/inc_credits.php +++ b/include/accounts/inc_credits.php @@ -1231,7 +1231,7 @@ function generate_pdf() switch($template_data['template_type']) { case $this->type .'_htmltopdf': - $this->obj_pdf =& New template_engine_htmltopdf; + $this->obj_pdf = New template_engine_htmltopdf; $template_file = $template_data['template_file']."/index.html"; if (is_dir("../../{$template_data['template_file']}")) @@ -1246,7 +1246,7 @@ function generate_pdf() case $this->type .'_tex': default: - $this->obj_pdf =& New template_engine_latex; + $this->obj_pdf = New template_engine_latex; $template_file = $template_data['template_file'].".tex"; break; diff --git a/include/accounts/inc_invoices.php b/include/accounts/inc_invoices.php index ee2d39a8..9475d260 100644 --- a/include/accounts/inc_invoices.php +++ b/include/accounts/inc_invoices.php @@ -83,6 +83,12 @@ function invoice_render_summarybox($type, $id) { log_debug("inc_invoices", "invoice_render_summarybox($type, $id)"); + if($type=="project") + { + print "
    "; + return; + } + // fetch invoice information $sql_obj = New sql_query; $sql_obj->prepare_sql_settable("account_$type"); @@ -91,6 +97,7 @@ function invoice_render_summarybox($type, $id) { $sql_obj->prepare_sql_addfield("date_sent"); $sql_obj->prepare_sql_addfield("sentmethod"); + $sql_obj->prepare_sql_addfield("cancelled"); } $sql_obj->prepare_sql_addfield("code_invoice"); @@ -105,7 +112,21 @@ function invoice_render_summarybox($type, $id) if ($sql_obj->num_rows()) { - $sql_obj->fetch_array(); + $sql_obj->fetch_array(); + + if(isset($sql_obj->data[0]["cancelled"]) && $sql_obj->data[0]["cancelled"]=='1') + { + print ""; + print ""; + print ""; + print ""; + print "
    "; + print "Invoice ". $sql_obj->data[0]["code_invoice"] ." is cancelled."; + print "

    This invoice cannot be modified.

    "; + print "
    "; + } + else + { // check for presence of invoice items $sql_item_obj = New sql_query; @@ -188,6 +209,7 @@ function invoice_render_summarybox($type, $id) } } + } print "
    "; } @@ -217,7 +239,6 @@ class invoice var $invoice_fields; // array for storage of all invoice fields with associated data - var $obj_pdf; // generated PDF object @@ -445,11 +466,34 @@ function load_data_export() $this->invoice_fields["company_address1_country"] = $data_company["company_address1_country"]; $this->invoice_fields["company_address1_zipcode"] = $data_company["company_address1_zipcode"]; + $this->invoice_fields["company_address2_street"] = $data_company["company_address2_street"]; + $this->invoice_fields["company_address2_city"] = $data_company["company_address2_city"]; + $this->invoice_fields["company_address2_state"] = $data_company["company_address2_state"]; + $this->invoice_fields["company_address2_country"] = $data_company["company_address2_country"]; + $this->invoice_fields["company_address2_zipcode"] = $data_company["company_address2_zipcode"]; + + $this->invoice_fields["company_reg_number"] = $data_company["company_reg_number"]; + $this->invoice_fields["company_tax_number"] = $data_company["company_tax_number"]; + if ($this->type == "ar") { $this->invoice_fields["company_payment_details"] = $data_company["company_payment_details"]; } + if ($this->type == "quotes") + { + $this->invoice_fields["notes"] = $this->data["notes"]; + + if($this->data["terms_of_business"]=="terms_consumer") + { + $this->invoice_fields["terms_of_business"] = $data_company["company_b2c_terms"]; + } + else if($this->data["terms_of_business"]=="terms_business") + { + $this->invoice_fields["terms_of_business"] = $data_company["company_b2b_terms"]; + } + } + /* Invoice Data (exc items/taxes) */ @@ -458,7 +502,11 @@ function load_data_export() $this->invoice_fields["code_invoice"] = $this->data["code_invoice"]; $this->invoice_fields["code_ordernumber"] = $this->data["code_ordernumber"]; $this->invoice_fields["code_ponumber"] = $this->data["code_ponumber"]; - $this->invoice_fields["date_due"] = time_format_humandate($this->data["date_due"]); + $this->invoice_fields["date_due"] = time_format_humandate($this->data["date_due"]); + if($this->data["cancelled"]=='1') + { + $this->invoice_fields["invoice_cancelled"]=$this->data["cancelled"]; + } } else { @@ -888,10 +936,32 @@ function action_delete() Delete Invoice */ - $sql_obj->string = "DELETE FROM account_". $this->type ." WHERE id='". $this->id ."' LIMIT 1"; - $sql_obj->execute(); - - + if($this->type=="ar") + { + if(sql_get_singlevalue("SELECT cancelled as value FROM account_ar WHERE id='".$this->id."'")=='0') + { + $rollback=1; + } + else + { + $rollback=0; + } + } + else + { + $rollback=1; + } + + if($GLOBALS["config"]["ACCOUNTS_CANCEL_DELETE"]=="1" && $this->type=="ar") + { + $sql_obj->string = "UPDATE account_". $this->type ." SET cancelled = 1 WHERE id='". $this->id ."' LIMIT 1"; + $sql_obj->execute(); + } + else + { + $sql_obj->string = "DELETE FROM account_". $this->type ." WHERE id='". $this->id ."' LIMIT 1"; + $sql_obj->execute(); + } /* Delete Invoice Items @@ -915,6 +985,8 @@ function action_delete() $obj_invoice_item->type_invoice = $this->type; $obj_invoice_item->id_invoice = $this->id; + $obj_invoice_item->rollback = $rollback; + $obj_invoice_item->deletecancel = $GLOBALS["config"]["ACCOUNTS_CANCEL_DELETE"]; $obj_invoice_item->id_item = $data_sql["id"]; $obj_invoice_item->action_delete(); @@ -927,8 +999,14 @@ function action_delete() /* Delete Journal */ - journal_delete_entire("account_". $this->type ."", $this->id); - + if($GLOBALS["config"]["ACCOUNTS_CANCEL_DELETE"]=="1" && $this->type=="ar") + { + journal_quickadd_event("account_".$this->type."", $this->id, "Invoice cancelled"); + } + else + { + journal_delete_entire("account_". $this->type ."", $this->id); + } /* @@ -1521,6 +1599,10 @@ function cmp_date($a, $b) $structure_taxitems[] = $structure; } } + else + { + $structure_taxitems=array(); + } $this->obj_pdf->prepare_add_array("taxes", $structure_taxitems); @@ -1629,7 +1711,7 @@ function cmp_date($a, $b) */ // perform string escaping for latex - $this->obj_pdf->prepare_escape_fields(); + $this->obj_pdf->prepare_escape_fields(array("terms_of_business")); // fillter template data $this->obj_pdf->fillter_template_data(); @@ -2095,7 +2177,10 @@ class invoice_items var $data; // data of the item - + var $rollback; // Set to true if items need to be rolled back + + var $deletecancel=0; // Set to true if items are for an invoice being cancelled. + // Items will be deleted otherwise. /* verify_invoice @@ -2109,11 +2194,19 @@ class invoice_items function verify_invoice() { /* - Verify that the invoice exists + Verify that the invoice exists (or the project) */ + $sql_obj = New sql_query; - $sql_obj->string = "SELECT id FROM account_". $this->type_invoice ." WHERE id='". $this->id_invoice ."' LIMIT 1"; - $sql_obj->execute(); + if($this->type_invoice=="project") + { + $sql_obj->string = "SELECT id FROM projects WHERE id='". $this->id_invoice ."' LIMIT 1"; + } + else + { + $sql_obj->string = "SELECT id FROM account_". $this->type_invoice ." WHERE id='". $this->id_invoice ."' LIMIT 1"; + } + $sql_obj->execute(); if (!$sql_obj->num_rows()) { @@ -2681,6 +2774,7 @@ function action_create() */ function action_update() { + log_debug("invoice_items", "Executing action_update()"); /* @@ -2690,7 +2784,7 @@ function action_update() $sql_obj = New sql_query; $sql_obj->trans_begin(); - + // create a new item if required if (!$this->id_item) @@ -2720,12 +2814,27 @@ function action_update() $this->data["credit"] = "CREDIT"; } - + if ($this->type_item == "product" && ($this->type_invoice=="ar" || $this->type_invoice=="ap" || $this->type_invoice=="project")) + { + $quantdiff= $this->data["quantity"]-sql_get_singlevalue("SELECT quantity as value FROM account_items WHERE id='".$this->id_item."'"); + } /* Update Item */ - + + // Setting defaults when they haven't been set + if(!isset($this->data["price"])) + $this->data["price"]=0; + if(!isset($this->data["discount"])) + $this->data["discount"]=0; + if(!isset($this->data["quantity"])) + $this->data["quantity"]=0; + if(!isset($this->data["units"])) + $this->data["units"]=""; + if(!isset($this->data["customid"])) + $this->data["customid"]=""; + $sql_obj->string = "UPDATE `account_items` SET " ."type='". $this->type_item ."', " ."amount='". $this->data["amount"] ."', " @@ -2739,7 +2848,30 @@ function action_update() $sql_obj->execute(); - + /* Update product quantities + * + */ + if($this->type_item=="product" && ($this->type_invoice=="ar" || $this->type_invoice=="ap" || $this->type_invoice=="project")) + { + $quantnew = sql_get_singlevalue("SELECT quantity_instock as value FROM products WHERE id='".$this->data["customid"]."'"); + + if($this->type_invoice=="ar" || $this->type_invoice=="project") + $quantdiff=-$quantdiff; + + $quantnew+=$quantdiff; + if($quantnew<0) + $quantnew=0; + + if($quantdiff!=0) + { + $sql_obj->string = "UPDATE products SET quantity_instock='".$quantnew."' WHERE id='".$this->data["customid"]."' LIMIT 1"; + $sql_obj->execute(); + + $invproj=$this->type_invoice=="project"?"project":"invoice"; + journal_quickadd_event("products",$this->data["customid"],"Product added to $invproj. (Stock Adj. ".sprintf("%+d",$quantdiff).")"); + } + } + /* Update Item Options */ @@ -3001,7 +3133,14 @@ function action_update_tax() { // automatic // note: no need to multiple by quantity, since the item amount is already price * quantity - $tax_structure[ $data_product_tax["taxid"] ]["auto"] += $data["amount"]; + if (!isset($tax_structure[ $data_product_tax["taxid"] ]["auto"])) + { + $tax_structure[ $data_product_tax["taxid"] ]["auto"] = $data["amount"]; + } + else + { + $tax_structure[ $data_product_tax["taxid"] ]["auto"] += $data["amount"]; + } } } break; @@ -3054,13 +3193,18 @@ function action_update_tax() if ($sql_item_tax_obj->num_rows()) { - $sql_item_tax_obj->fetch_array(); - foreach ($sql_item_tax_obj->data as $data_item_tax) { // automatic // note: no need to multiple by quantity, since the item amount is already price * quantity - $tax_structure[ $data_item_tax["taxid"] ]["auto"] += $data["amount"]; + if (!isset($tax_structure[ $data_item_tax["taxid"] ]["auto"])) + { + $tax_structure[ $data_item_tax["taxid"] ]["auto"] = $data["amount"]; + } + else + { + $tax_structure[ $data_item_tax["taxid"] ]["auto"] += $data["amount"]; + } } } break; @@ -3086,7 +3230,14 @@ function action_update_tax() { // automatic // note: no need to multiple by quantity, since the item amount is already price * quantity - $tax_structure[ $data_item_tax["taxid"] ]["auto"] += $data["amount"]; + if (!isset($tax_structure[ $data_item_tax["taxid"] ]["auto"])) + { + $tax_structure[ $data_item_tax["taxid"] ]["auto"] = $data["amount"]; + } + else + { + $tax_structure[ $data_item_tax["taxid"] ]["auto"] += $data["amount"]; + } } } break; @@ -3122,7 +3273,7 @@ function action_update_tax() } } } - else + elseif($this->type_invoice!="project") { $customerid = sql_get_singlevalue("SELECT customerid as value FROM account_". $this->type_invoice ." WHERE id='". $this->id_invoice ."'"); @@ -3251,6 +3402,11 @@ function action_update_total() { log_debug("invoice_items", "Executing action_update_total()"); + // Ignore if project + if($this->type_invoice=="project") + { + return 1; + } // default values $amount = "0"; @@ -3383,7 +3539,14 @@ function action_update_ledger() // fetch key information from invoice $sql_inv_obj = New sql_query; - $sql_inv_obj->string = "SELECT id, dest_account, date_trans FROM account_". $this->type_invoice ." WHERE id='". $this->id_invoice ."' LIMIT 1"; + if($this->type_invoice=="project") + { + $sql_inv_obj->string = "SELECT id, dest_account, CURDATE() AS date_trans FROM projects WHERE id='". $this->id_invoice ."' LIMIT 1"; + } + else + { + $sql_inv_obj->string = "SELECT id, dest_account, date_trans FROM account_". $this->type_invoice ." WHERE id='". $this->id_invoice ."' LIMIT 1"; + } $sql_inv_obj->execute(); $sql_inv_obj->fetch_array(); @@ -3452,6 +3615,7 @@ function action_update_ledger() break; case "ar": + case "project": default: ledger_trans_add("credit", $trans_type, $this->id_invoice, $sql_inv_obj->data[0]["date_trans"], $item_data["chartid"], $item_data["amount"], "", ""); break; @@ -3479,6 +3643,7 @@ function action_update_ledger() break; case "ar": + case "project": default: // create debit to AR account ledger_trans_add("debit", $this->type_invoice, $this->id_invoice, $sql_inv_obj->data[0]["date_trans"], $sql_inv_obj->data[0]["dest_account"], $amount, "", ""); @@ -3628,8 +3793,6 @@ function action_delete() $this->type_item = sql_get_singlevalue("SELECT type as value FROM account_items WHERE id='". $this->id_item ."' LIMIT 1"); } - - /* Start SQL Transaction */ @@ -3637,11 +3800,29 @@ function action_delete() $sql_obj->trans_begin(); - + /* + * Replace stock items if necessary + */ + if ($this->rollback==1 && $this->type_item == "product" && ($this->type_invoice=="ar" || $this->type_invoice=="ap" || $this->type_invoice=="project")) + { + $quant=sql_get_singlevalue("SELECT quantity as value FROM account_items WHERE id='".$this->id_item."'"); + $prodid=sql_get_singlevalue("SELECT customid as value FROM account_items WHERE id='".$this->id_item."'"); + $quantnew = sql_get_singlevalue("SELECT quantity_instock as value FROM products WHERE id='".$prodid."'"); + + if($this->type_invoice=="ap") + $quant=-$quant; + + $sql_obj->string = "UPDATE products SET quantity_instock='".($quantnew+$quant)."' WHERE id='".$prodid."' LIMIT 1"; + $sql_obj->execute(); + + $invproj=$this->type_invoice=="project"?"project":"invoice"; + journal_quickadd_event("products",$prodid,"Product removed from $invproj. (Stock Adj.".sprintf("%+d",$quant).")"); + } + /* Unlock time_groups if required */ - if ($this->type_item == "time") + if ($this->rollback==1 && $this->type_item == "time") { $groupid = sql_get_singlevalue("SELECT option_value as value FROM account_items_options WHERE itemid='". $this->id_item ."' AND option_name='TIMEGROUPID'"); @@ -3663,7 +3844,7 @@ function action_delete() Delete credit payments if required */ - if ($this->type_item == "payment") + if ($this->rollback==1 && $this->type_item == "payment") { $credit = sql_get_singlevalue("SELECT option_value as value FROM account_items_options WHERE itemid='". $this->id_item ."' AND option_name='CREDIT'"); @@ -3687,30 +3868,36 @@ function action_delete() } + // Delete any project expenses transactions + $sql_obj->string = "DELETE FROM account_trans WHERE type='proj_ar' AND customid='".$this->id_item."'"; + $sql_obj->execute(); + // Delete links to projects + $sql_obj->string = "DELETE FROM account_items_options WHERE option_name='INVOICED_EXPENSE' AND option_value='". $this->id_item ."'"; + $sql_obj->execute(); + /* Delete the invoice item options */ - - $sql_obj->string = "DELETE FROM account_items_options WHERE itemid='". $this->id_item ."'"; - $sql_obj->execute(); - + if(($this->deletecancel=="0" && $this->type_invoice=="ar") || $this->type_invoice!="ar") + { + $sql_obj->string = "DELETE FROM account_items_options WHERE itemid='". $this->id_item ."'"; + $sql_obj->execute(); + /* Delete the invoice item */ - $sql_obj->string = "DELETE FROM account_items WHERE id='". $this->id_item ."' AND invoicetype='". $this->type_invoice ."' LIMIT 1"; - $sql_obj->execute(); - - - /* - Update Journal - */ - - journal_quickadd_event("account_". $this->type_invoice ."", $this->id_invoice, "Item successfully deleted"); - - + $sql_obj->string = "DELETE FROM account_items WHERE id='". $this->id_item ."' AND invoicetype='". $this->type_invoice ."' LIMIT 1"; + $sql_obj->execute(); + + journal_quickadd_event("account_". $this->type_invoice ."", $this->id_invoice, "Item successfully deleted."); + } + else + { + journal_quickadd_event("account_". $this->type_invoice ."", $this->id_invoice, "Item successfully cancelled."); + } /* Commit diff --git a/include/accounts/inc_invoices_forms.php b/include/accounts/inc_invoices_forms.php index f3c02628..d5dcfccf 100644 --- a/include/accounts/inc_invoices_forms.php +++ b/include/accounts/inc_invoices_forms.php @@ -25,6 +25,8 @@ class invoice_form_details var $processpage; // Page to submit the form to var $locked; + + var $cancelled; var $mode; @@ -50,7 +52,10 @@ function execute() if ($this->mode == "edit") { $sql_invoice_obj = New sql_query; - $sql_invoice_obj->string = "SELECT id, locked FROM account_". $this->type ." WHERE id='". $this->invoiceid ."' LIMIT 1"; + if($this->type=="ar") + $sql_invoice_obj->string = "SELECT id, locked,cancelled FROM account_ar WHERE id='". $this->invoiceid ."' LIMIT 1"; + else + $sql_invoice_obj->string = "SELECT id, locked FROM account_". $this->type ." WHERE id='". $this->invoiceid ."' LIMIT 1"; $sql_invoice_obj->execute(); if (!$sql_invoice_obj->num_rows()) @@ -63,6 +68,11 @@ function execute() $sql_invoice_obj->fetch_array(); $this->locked = $sql_invoice_obj->data[0]["locked"]; + + if(isset($sql_invoice_obj->data[0]["cancelled"])) + $this->cancelled=$sql_invoice_obj->data[0]["cancelled"]; + else + $this->cancelled=0; } } @@ -116,7 +126,14 @@ function execute() $structure = form_helper_prepare_dropdownfromobj("customerid", $sql_struct_obj); $structure["options"]["req"] = "yes"; $structure["options"]["width"] = "600"; - $structure["options"]["search_filter"] = "enabled"; + if($this->cancelled==0) + { + $structure["options"]["search_filter"] = "enabled"; + } + else + { + $structure["options"]["disabled"] = "yes"; + } $structure["defaultvalue"] = $this->customer_id; $this->obj_form->add_input($structure); } @@ -133,13 +150,20 @@ function execute() $structure["options"]["req"] = "yes"; $structure["options"]["autoselect"] = "yes"; $structure["options"]["width"] = "600"; - $structure["options"]["search_filter"] = "enabled"; + if($this->cancelled==1) + { + $structure["options"]["disabled"] = "yes"; + } $structure["defaultvalue"] = @$_SESSION["user"]["default_employeeid"]; $this->obj_form->add_input($structure); $structure = NULL; $structure["fieldname"] = "code_invoice"; $structure["type"] = "input"; + if($this->cancelled==1) + { + $structure["options"]["disabled"] = "yes"; + } if ($this->mode == "edit") $structure["options"]["req"] = "yes"; @@ -150,11 +174,19 @@ function execute() $structure = NULL; $structure["fieldname"] = "code_ordernumber"; $structure["type"] = "input"; + if($this->cancelled==1) + { + $structure["options"]["disabled"] = "yes"; + } $this->obj_form->add_input($structure); $structure = NULL; $structure["fieldname"] = "code_ponumber"; $structure["type"] = "input"; + if($this->cancelled==1) + { + $structure["options"]["disabled"] = "yes"; + } $this->obj_form->add_input($structure); $structure = NULL; @@ -162,6 +194,10 @@ function execute() $structure["type"] = "textarea"; $structure["options"]["height"] = "100"; $structure["options"]["width"] = 500; + if($this->cancelled==1) + { + $structure["options"]["disabled"] = "yes"; + } $this->obj_form->add_input($structure); @@ -171,12 +207,20 @@ function execute() $structure["fieldname"] = "date_trans"; $structure["type"] = "date"; $structure["defaultvalue"] = date("Y-m-d"); + if($this->cancelled==1) + { + $structure["options"]["disabled"] = "yes"; + } $this->obj_form->add_input($structure); $structure = NULL; $structure["fieldname"] = "date_due"; $structure["type"] = "date"; $structure["defaultvalue"] = invoice_calc_duedate(date("Y-m-d")); + if($this->cancelled==1) + { + $structure["options"]["disabled"] = "yes"; + } $this->obj_form->add_input($structure); @@ -194,6 +238,10 @@ function execute() $structure["options"]["autoselect"] = "yes"; $structure["options"]["search_filter"] = "enabled"; $structure["options"]["width"] = "600"; + if($this->cancelled==1) + { + $structure["options"]["disabled"] = "yes"; + } $this->obj_form->add_input($structure); @@ -212,6 +260,10 @@ function execute() $structure["fieldname"] = "submit"; $structure["type"] = "submit"; $structure["defaultvalue"] = "Save Changes"; + if($this->cancelled==1) + { + $structure["options"]["disabled"] = "yes"; + } $this->obj_form->add_input($structure); @@ -254,7 +306,7 @@ function execute() $this->obj_form->subforms["hidden"] = array("id_invoice"); - if ($this->locked) + if ($this->locked ||$this->cancelled) { $this->obj_form->subforms["submit"] = array(); } @@ -622,10 +674,18 @@ function execute() $structure["type"] = "text"; $this->obj_form->add_input($structure); - $structure = NULL; - $structure["fieldname"] = "delete_confirm"; + $structure = NULL; + $structure["type"] = "checkbox"; - $structure["options"]["label"] = "Yes, I wish to delete this invoice and realise that once deleted the data can not be recovered."; + if($this->type=="ar" && $GLOBALS["config"]["ACCOUNTS_CANCEL_DELETE"]=="1") + { + $structure["options"]["label"] = "Yes, I wish to cancel this invoice and realise that once cancelled the invoice can not be used."; + } + else + { + $structure["options"]["label"] ="Yes, I wish to delete this invoice and realise that once deleted the data can not be recovered."; + } + $structure["fieldname"] = "delete_confirm"; $this->obj_form->add_input($structure); @@ -650,7 +710,14 @@ function execute() $structure = NULL; $structure["fieldname"] = "submit"; $structure["type"] = "submit"; - $structure["defaultvalue"] = "Delete Invoice"; + if($this->type=="ar" && $GLOBALS["config"]["ACCOUNTS_CANCEL_DELETE"]=="1") + { + $structure["defaultvalue"] = "Cancel Invoice"; + } + else + { + $structure["defaultvalue"] = "Delete Invoice"; + } $this->obj_form->add_input($structure); @@ -659,7 +726,14 @@ function execute() $this->obj_form->load_data(); - $this->obj_form->subforms[$this->type ."_invoice_delete"] = array("code_invoice"); + if($this->type=="ar" && $GLOBALS["config"]["ACCOUNTS_CANCEL_DELETE"]=="1") + { + $this->obj_form->subforms["ar_invoice_cancel"] = array("code_invoice"); + } + else + { + $this->obj_form->subforms[$this->type ."_invoice_delete"] = array("code_invoice"); + } $this->obj_form->subforms["hidden"] = array("id_invoice", "date_create"); @@ -670,7 +744,7 @@ function execute() } else { - $this->obj_form->subforms["submit"] = array("delete_confirm", "submit"); + $this->obj_form->subforms["submit"] = array("delete_confirm", "submit"); } } diff --git a/include/accounts/inc_invoices_items.php b/include/accounts/inc_invoices_items.php index 2fce7f93..382efd60 100644 --- a/include/accounts/inc_invoices_items.php +++ b/include/accounts/inc_invoices_items.php @@ -26,24 +26,36 @@ class invoice_list_items var $page_delete; // Page for deleting the invoice item var $locked; + var $cancelled; var $mode; var $obj_table_standard; var $obj_table_taxes; - + var $form_helper; function execute() { log_debug("invoice_list_items", "Executing execute()"); // check lock status - if ($this->type != "quotes") + if ($this->type != "quotes" && $this->type!="project") { $this->locked = sql_get_singlevalue("SELECT locked as value FROM account_". $this->type ." WHERE id='". $this->invoiceid ."'"); } - - + else + { + $this->locked=0; + } + + if ($this->type=="ar") + { + $this->cancelled=sql_get_singlevalue("SELECT cancelled as value FROM account_". $this->type ." WHERE id='". $this->invoiceid ."'"); + } + else + { + $this->cancelled=0; + } /* Create table of standard object data @@ -63,20 +75,46 @@ function execute() $this->obj_table_standard->add_column("money", "price", ""); $this->obj_table_standard->add_column("standard", "discount", "NONE"); $this->obj_table_standard->add_column("money", "amount", ""); - - // defaults - $this->obj_table_standard->columns = array("item_info", "description", "qnty", "units", "price", "discount", "amount"); - + if($this->type=="project") + { + // Add column for billed for project expenses + $this->obj_table_standard->add_column("bool_tick", "select", "NONE"); + $this->obj_table_standard->add_column("standard", "code_invoice", "c.code_invoice"); + $this->obj_table_standard->columns = array("select","item_info", "description", "qnty", "units", "price", "discount", "amount","code_invoice"); + } + else + { + // defaults + $this->obj_table_standard->columns = array("item_info", "description", "qnty", "units", "price", "discount", "amount"); + } + // totals $this->obj_table_standard->total_columns = array("amount"); // define SQL structure $this->obj_table_standard->sql_obj->prepare_sql_settable("account_items"); - $this->obj_table_standard->sql_obj->prepare_sql_addfield("id", ""); + $this->obj_table_standard->sql_obj->prepare_sql_addfield("id", "account_items.id"); $this->obj_table_standard->sql_obj->prepare_sql_addfield("type", ""); $this->obj_table_standard->sql_obj->prepare_sql_addfield("customid", ""); $this->obj_table_standard->sql_obj->prepare_sql_addfield("chartid", ""); + if($this->type=="project") + { + // Check to see if the expense item has been allocated to an invoice + $this->obj_table_standard->sql_obj->prepare_sql_addfield("invoice", "b.invid"); + $this->obj_table_standard->sql_obj->prepare_sql_addjoin("LEFT JOIN (SELECT itemid, option_value FROM account_items_options WHERE option_name=\"INVOICED_EXPENSE\") AS a ON account_items.id = a.itemid"); + $this->obj_table_standard->sql_obj->prepare_sql_addjoin("LEFT JOIN (SELECT id, invoiceid AS invid FROM account_items WHERE invoicetype='ar') AS b ON b.id= a.option_value"); + $this->obj_table_standard->sql_obj->prepare_sql_addjoin("LEFT JOIN (SELECT id, code_invoice FROM account_ar WHERE cancelled='0') AS c ON c.id= b.invid"); + } + + if($this->type=="ar") + { + $this->obj_table_standard->sql_obj->prepare_sql_addfield("projectid", "b.projid"); + $this->obj_table_standard->sql_obj->prepare_sql_addfield("code_project", "c.code_project"); + $this->obj_table_standard->sql_obj->prepare_sql_addjoin("LEFT JOIN (SELECT itemid, option_value FROM account_items_options WHERE option_name=\"INVOICED_EXPENSE\") AS a ON account_items.id = a.option_value"); + $this->obj_table_standard->sql_obj->prepare_sql_addjoin("LEFT JOIN (SELECT id, invoiceid AS projid FROM account_items WHERE invoicetype='project') AS b ON b.id= a.itemid"); + $this->obj_table_standard->sql_obj->prepare_sql_addjoin("LEFT JOIN (SELECT id, code_project FROM projects) AS c ON c.id= b.projid"); + } $this->obj_table_standard->sql_obj->prepare_sql_addwhere("invoiceid='". $this->invoiceid ."'"); $this->obj_table_standard->sql_obj->prepare_sql_addwhere("invoicetype='". $this->type ."'"); @@ -90,6 +128,7 @@ function execute() // run SQL query $this->obj_table_standard->generate_sql(); + $this->obj_table_standard->load_data_sql(); if ($this->obj_table_standard->data_num_rows) @@ -226,21 +265,25 @@ function execute() { case "ar": case "ar_credit": - $authtype = "ar"; + $authtype = "accounts_ar"; break; case "ap": case "ap_credit": - $authtype = "ap"; + $authtype = "accounts_ap"; break; case "quote": case "quotes": - $authtype = "quotes"; + $authtype = "accounts_quotes"; break; + + case "project": + $authtype = "projects"; + break; } - if (user_permissions_get("accounts_". $authtype ."_write") && !$this->locked) + if (user_permissions_get( $authtype ."_write") && !$this->locked) { // edit link $structure = NULL; @@ -325,14 +368,20 @@ function render_html() if (!$this->obj_table_standard->data_num_rows) { - if ($this->type == "ar" || $this->type == "ap" || $this->type == "quotes") + if (($this->type == "ar" && $this->cancelled==0) || $this->type == "ap" || $this->type == "quotes" || $this->type=="project") { // regular invoice item print ""; print "
    "; - - print "

    This invoice has no items and is currently empty.

    "; - + + if($this->type=="project") + { + print "

    This project has no expenses and is currently empty.

    "; + } + else + { + print "

    This invoice has no items and is currently empty.

    "; + } print "
    "; print "page_view ."&id=".$this->invoiceid."&type=standard\">   Basic Transaction @@ -360,7 +409,16 @@ function render_html() } else { - + /* + * If this is a project expenses sheet, then add a form to submit the expenses to an invoice + */ + + if($this->type=="project") + { + print "
    "; + + } + print ""; @@ -392,18 +450,45 @@ function render_html() { $content = $this->obj_table_standard->data_render[$i][$columns]; + if($columns=="select") + { + if($this->obj_table_standard->data_render[$i]["code_invoice"]=="") + { + $content="obj_table_standard->data[$i]["id"]."\">"; + } + else + { + $content=" "; + } + } + + if (isset($this->obj_table_standard->data_render[$i]["code_invoice"]) && $columns=="code_invoice") + { + $content = "obj_table_standard->data[$i]["invoice"] ."\">". $this->obj_table_standard->data_render[$i]["code_invoice"] .""; + } + + if($columns=="item_info") + { + if(isset($this->obj_table_standard->data[$i]["projectid"])) + { + $content=$content." (Project obj_table_standard->data[$i]["projectid"] ."\">".$this->obj_table_standard->data[$i]["code_project"]." expense)"; + } + } + if (!$content) { $content = " "; } + + // display print ""; } // links - if (!empty($this->obj_table_standard->links)) + if (!empty($this->obj_table_standard->links) && $this->cancelled==0) { print ""; + print ""; } + else + print ""; + + print ""; } /* @@ -470,27 +559,48 @@ function render_html() //calculate number of rows buttons can cover $footer_rows = $this->obj_table_taxes->data_num_rows + 2; + if($this->type=="project") + { + $cols=5; + } + else + { + $cols=4; + } + print ""; - print ""; @@ -615,9 +725,53 @@ function render_html() print ""; print ""; + print "
    $content"; @@ -430,7 +515,6 @@ function render_html() { print "obj_table_standard->links[$link]["page"] .""; } - // add each option foreach (array_keys($this->obj_table_standard->links[$link]["options"]) as $getfield) { @@ -445,7 +529,8 @@ function render_html() } else { - print "&$getfield=". $this->obj_table_standard->data[$i][ $this->obj_table_standard->links[$link]["options"][$getfield]["column"] ]; + if($getfield<>"full_link") + print "&$getfield=". $this->obj_table_standard->data[$i][ $this->obj_table_standard->links[$link]["options"][$getfield]["column"] ]; } } @@ -459,8 +544,12 @@ function render_html() } } - print "
    "; + print ""; + + if($this->type=="project") + { + $perm="projects"; + $invproj="project"; + } + else + { + $perm="accounts_".$this->type; + $invproj="invoice"; + } - if (user_permissions_get("accounts_". $this->type ."_write") && !$this->locked) + if (user_permissions_get($perm ."_write") && !$this->locked && $this->cancelled==0) { - print "

    Add new items to invoice:

    "; + print "

    Add new items to $invproj:

    "; print ""; + print "page_view ."&id=".$this->invoiceid."&type=product\"> +   Product"; + + print ""; } print "
     
    "; - + + if($this->type=="project") + { + // get customer of project + $customer=sql_get_singlevalue("SELECT customerid AS value FROM projects WHERE id='".$this->invoiceid."'"); + + $this->form_helper=new form_input; + $this->form_helper->language= $_SESSION["user"]["lang"]; + + $sql_struct_obj = New sql_query; + $sql_struct_obj->prepare_sql_settable("account_ar"); + $sql_struct_obj->prepare_sql_addfield("id", "account_ar.id"); + $sql_struct_obj->prepare_sql_addfield("label", "account_ar.code_invoice"); + $sql_struct_obj->prepare_sql_addorderby("code_invoice"); + $sql_struct_obj->prepare_sql_addwhere("customerid = '".$customer."' AND cancelled='0' AND ((amount_total<>amount_paid AND amount_total>0) OR amount_total=0)"); + + $structure = form_helper_prepare_dropdownfromobj("invoiceid", $sql_struct_obj); + $structure["options"]["req"] = "yes"; + $structure["options"]["autoselect"] = "yes"; + $structure["options"]["prelabel"]="Invoice: "; + $this->form_helper->add_input($structure); + + $this->form_helper->render_field("invoiceid"); + + $structure = NULL; + $structure["fieldname"] = "projectid"; + $structure["type"] = "hidden"; + $structure["defaultvalue"] = $this->invoiceid; + $this->form_helper->add_input($structure); + + $this->form_helper->render_field("projectid"); + + // submit + $structure = NULL; + $structure["fieldname"] = "submit"; + $structure["type"] = "submit"; + $structure["defaultvalue"] = "Add selected expenses to invoice"; + $this->form_helper->add_input($structure); + + print " "; + $this->form_helper->render_field("submit"); + + print "
    "; + } } // end if items exist @@ -742,6 +896,7 @@ class invoice_list_payments var $mode; var $locked; + var $cancelled; // var $obj_table_standard; // var $obj_table_taxes; @@ -755,7 +910,15 @@ function execute() // TODO: fix up this class to comply with the standard coding style of the rest of the application $this->locked = sql_get_singlevalue("SELECT locked as value FROM account_". $this->type ." WHERE id='". $this->invoiceid ."'"); - + + if($this->type=="ar") + { + $this->cancelled=sql_get_singlevalue("SELECT cancelled as value FROM account_". $this->type ." WHERE id='". $this->invoiceid ."'"); + } + else + { + $this->cancelled=0; + } return 1; } @@ -828,9 +991,16 @@ function render_html() } + if($this->type=="project") + { + $perm="projects"; + } + else + { + $perm="accounts_". $this->type; + } - - if (user_permissions_get("accounts_". $this->type ."_write") && !$this->locked) + if (user_permissions_get( $perm."_write") && !$this->locked && $this->cancelled==0) { // edit link $structure = NULL; @@ -855,7 +1025,7 @@ function render_html() $item_list->render_table_html(); } - if (!$this->locked) + if (!$this->locked && $this->cancelled==0) { print "

    page_view ."&id=". $this->invoiceid ."&type=payment\">Add Payment

    "; } @@ -928,11 +1098,15 @@ function execute() // fetch the vendorid for this invoice $orgid = sql_get_singlevalue("SELECT vendorid as value FROM account_". $this->type ." WHERE id='". $this->invoiceid ."' LIMIT 1"); } - else + elseif($this->type!="project") { // fetch the customer ID for this invoice $orgid = sql_get_singlevalue("SELECT customerid as value FROM account_". $this->type ." WHERE id='". $this->invoiceid ."' LIMIT 1"); } + else + { + $orgid=0; + } /* @@ -941,6 +1115,8 @@ function execute() switch ($this->item_type) { + + case "standard": /* @@ -1207,7 +1383,7 @@ function execute() if ($this->type == "ar") { // list of avaliable time groups - $structure = form_helper_prepare_dropdownfromdb("timegroupid", "SELECT time_groups.id, projects.name_project as label, time_groups.name_group as label1 FROM time_groups LEFT JOIN projects ON projects.id = time_groups.projectid WHERE customerid='$orgid' AND (invoiceitemid='0' OR invoiceitemid='". $this->itemid ."') ORDER BY name_group"); + $structure = form_helper_prepare_dropdownfromdb("timegroupid", "SELECT time_groups.id, projects.name_project as label, time_groups.name_group as label1 FROM time_groups LEFT JOIN projects ON projects.id = time_groups.projectid WHERE time_groups.customerid='$orgid' AND (invoiceitemid='0' OR invoiceitemid='". $this->itemid ."') ORDER BY name_group"); $structure["options"]["width"] = "600"; $structure["options"]["autoselect"] = "yes"; $structure["options"]["search_filter"] = "enabled"; @@ -1275,11 +1451,11 @@ function execute() // TODO: need to look at improving time <-> product relationships // fetch discount (if any) from product - // $discount_product = sql_get_singlevalue("SELECT discount FROM products WHERE id='". $this->productid ."' LIMIT 1"); + $discount_product = sql_get_singlevalue("SELECT discount as value FROM products WHERE id='". $this->productid ."' LIMIT 1"); // choose the largest discount - if ($discount_org || $discount_product) + if ($discount_org!=0 || $discount_product!=0) { if ($discount_org > $discount_product) { @@ -1783,7 +1959,7 @@ function render_html() invoice-items.php -> invoice-items-add-process.php -> invoice-items-edit.php Values - type "ar" or "ap" invoice + type "ar" or "ap" invoice or "project" returnpage_error Page to return to in event of errors or updates returnpage_success Page to return to if successful. */ @@ -1831,7 +2007,14 @@ function invoice_form_items_add_process($type, $returnpage_error, $returnpage_s } } - + if($type=="project") + { + $pathadj=""; + } + else + { + $pathadj="../"; + } /* Error Handling @@ -1839,7 +2022,7 @@ function invoice_form_items_add_process($type, $returnpage_error, $returnpage_s if ($_SESSION["error"]["message"]) { - header("Location: ../../index.php?page=$returnpage_error&id=$invoiceid"); + header("Location: ".$pathadj."../index.php?page=$returnpage_error&id=$invoiceid"); exit(0); } @@ -1849,7 +2032,7 @@ function invoice_form_items_add_process($type, $returnpage_error, $returnpage_s Success */ - header("Location: ../../index.php?page=$returnpage_success&id=$invoiceid&type=$item_type&productid=$productid"); + header("Location: ".$pathadj."../index.php?page=$returnpage_success&id=$invoiceid&type=$item_type&productid=$productid"); exit(0); @@ -1899,7 +2082,14 @@ function invoice_form_items_process($type, $returnpage_error, $returnpage_succe $mode = "add"; } - + if($type=="project") + { + $pathadj=""; + } + else + { + $pathadj="../"; + } //// ERROR CHECKING /////////////////////// @@ -2074,13 +2264,11 @@ function invoice_form_items_process($type, $returnpage_error, $returnpage_succe log_write("error", "process", "An error was encountered whilst processing supplied data."); } - - /// if there was an error, go back to the entry page - if ($_SESSION["error"]["message"]) + if (isset($_SESSION["error"]["message"])) { $_SESSION["error"]["form"][$item->type_invoice ."_invoice_". $mode] = "failed"; - header("Location: ../../index.php?page=$returnpage_error&id=". $item->id_invoice ."&itemid=". $item->id_item ."&type=". $item->type_item .""); + header("Location: $pathadj../index.php?page=$returnpage_error&id=". $item->id_invoice ."&itemid=". $item->id_item ."&type=". $item->type_item .""); exit(0); } else @@ -2160,7 +2348,7 @@ function invoice_form_items_process($type, $returnpage_error, $returnpage_succe } // display updated details - header("Location: ../../index.php?page=$returnpage_success&id=". $item->id_invoice.""); + header("Location: $pathadj../index.php?page=$returnpage_success&id=". $item->id_invoice.""); exit(0); @@ -2178,7 +2366,7 @@ function invoice_form_items_process($type, $returnpage_error, $returnpage_succe Processing page to delete invoice items. Values - type "ar", "ap" or "quotes" + type "ar", "ap", "quotes" or "project" returnpage_error Page to return to in event of errors or updates returnpage_success Page to return to if successful. */ @@ -2186,7 +2374,17 @@ function invoice_form_items_delete_process($type, $returnpage_error, $returnpag { log_debug("inc_invoices_items", "Executing invoice_form_items_delete_process($type, $returnpage_error, $returnpage_success)"); - + if($type=="project") + { + $pathadj=""; + } + else + { + $pathadj="../"; + } + + $mode="delete"; + /* Start invoice_items object */ @@ -2231,10 +2429,10 @@ function invoice_form_items_delete_process($type, $returnpage_error, $returnpag /// if there was an error, go back to the entry page - if ($_SESSION["error"]["message"]) + if (isset($_SESSION["error"]["message"])) { $_SESSION["error"]["form"][$type ."_invoice_". $mode] = "failed"; - header("Location: ../../index.php?page=$returnpage_error&id=$id"); + header("Location: ".$pathadj."../index.php?page=$returnpage_error&id=$item->id_invoice"); exit(0); } else @@ -2250,7 +2448,31 @@ function invoice_form_items_delete_process($type, $returnpage_error, $returnpag /* Delete the item */ - $item->action_delete(); + + $sql_obj->string="SELECT id FROM account_items_options WHERE option_name='INVOICED_EXPENSE' AND option_value='".$item->id_item."'"; + $sql_obj->execute(); + $sql_obj->fetch_array(); + + if($sql_obj->num_rows()) + { + $projectid=sql_get_singlevalue("SELECT b.projid AS value FROM account_items LEFT JOIN( SELECT itemid, option_value FROM account_items_options WHERE option_name = 'INVOICED_EXPENSE' ) AS a ON account_items.id = a.option_value LEFT JOIN( SELECT id, invoiceid AS projid FROM account_items WHERE invoicetype = 'project' ) AS b ON b.id = a.itemid WHERE account_items.id = '".$item->id_item."'"); + + $item->rollback=0; + $item->action_delete(); + + journal_quickadd_event("projects", $projectid, "Project expense removed from Invoice ". sql_get_singlevalue("SELECT code_invoice AS value FROM account_ar WHERE id='$item->id_invoice'")); + + $sql_obj->string="DELETE FROM account_items_options WHERE id='".$sql_obj->data[0]["id"]."'"; + $sql_obj->execute(); + + // Need to reverse the ledger transaction related to this item + $sql_obj->string="DELETE FROM account_trans WHERE type='proj_ar' AND customid='".$item->id_item."'"; + $sql_obj->execute(); } + else + { + $item->rollback=1; + $item->action_delete(); + } /* @@ -2297,7 +2519,7 @@ function invoice_form_items_delete_process($type, $returnpage_error, $returnpag $sql_obj->trans_commit(); } - header("Location: ../../index.php?page=$returnpage_success&id=". $item->id_invoice .""); + header("Location: $pathadj../index.php?page=$returnpage_success&id=". $item->id_invoice .""); exit(0); } @@ -2319,7 +2541,14 @@ function invoice_form_tax_override_process($returnpage) { log_debug("inc_invoices_items", "Executing invoice_form_tax_override_process($returnpage)"); - + if($type="project") + { + $pathadj=""; + } + else + { + $pathadj="../"; + } /* Start invoice_items object @@ -2364,7 +2593,7 @@ function invoice_form_tax_override_process($returnpage) if ($_SESSION["error"]["message"]) { $_SESSION["error"]["form"]["ap_invoice_". $mode ."_override"] = "failed"; - header("Location: ../../index.php?page=$returnpage&id=". $item->id_invoice); + header("Location: $pathadj../index.php?page=$returnpage&id=". $item->id_invoice); exit(0); } else @@ -2427,7 +2656,7 @@ function invoice_form_tax_override_process($returnpage) } // done - header("Location: ../../index.php?page=$returnpage&id=". $item->id_invoice); + header("Location: $pathadj../index.php?page=$returnpage&id=". $item->id_invoice); exit(0); } @@ -2435,8 +2664,139 @@ function invoice_form_tax_override_process($returnpage) } // end of invoice_form_tax_override_process +/* + expenses_to_invoice_form_items_process($returnpage_error, $returnpage_success) + Form for processing expenses to invoice form results + Values + returnpage_error Page to return to in event of errors or updates + returnpage_success Page to return to if successful. +*/ +function expenses_to_invoice_form_items_process($returnpage_error, $returnpage_success) +{ + log_debug("inc_invoices_items", "Executing expenses_to_invoice_form_items_process($returnpage_error, $returnpage_success)"); + $projectid=@security_form_input_predefined("int", "projectid", 1, ""); + $invoiceid=@security_form_input_predefined("int", "invoiceid", 1, ""); + + $sql_entries_obj = New sql_query; + + $sql_entries_obj->prepare_sql_settable("account_items"); + $sql_entries_obj->prepare_sql_addfield("id", ""); + $sql_entries_obj->prepare_sql_addwhere("invoicetype='project' AND invoiceid='".$projectid."'"); + $sql_entries_obj->generate_sql(); + $sql_entries_obj->execute(); + + if ($sql_entries_obj->num_rows()) + { + $sql_entries_obj->fetch_array(); + + foreach ($sql_entries_obj->data as $entries_data) + { + // only get the data for selected time entries + if ($_POST["itemid_" . $entries_data["id"]] == "on") + { + $form_data[$entries_data["id"]] = 1; + } + else + { + $form_data[$entries_data["id"]] = 0; + } + } + } + + /* + Start SQL Transaction + */ + $sql_obj = New sql_query; + $sql_obj->trans_begin(); + + foreach ($form_data as $itemid=>$isselected) + { + if($isselected) + { + // Add work to move expenses to invoice item here. + convert_expense_to_invoice($itemid,$invoiceid); + } + } + + + /* + Commit + */ + + if (error_check()) + { + $sql_obj->trans_rollback(); + + log_write("error", "inc_invoice_items", "An error occured whilst updating the invoice item. No changes have been made."); + } + else + { + $sql_obj->trans_commit(); + journal_quickadd_event("projects", $projectid, "Expense(s) transferred to Invoice ". sql_get_singlevalue("SELECT code_invoice AS value FROM account_ar WHERE id='$invoiceid'")); + journal_quickadd_event("account_ar",$invoice_id,"Expense(s) transferred from Project ".sql_get_singlevalue("SELECT code_project AS value FROM projects LEFT JOIN account_items ON account_items.invoiceid=projects.id WHERE account_items.id='".$item_id."'")); + + } + + // display updated details + header("Location: ../index.php?page=$returnpage_success&id=". $projectid.""); + exit(0); + +} + +function convert_expense_to_invoice($item_id,$invoice_id) +{ + $original=new invoice_items(); + + $original->id_item=$item_id; + $original->type_item=sql_get_singlevalue("SELECT type AS value FROM account_items WHERE id='".$item_id."'"); + $original->id_invoice=sql_get_singlevalue("SELECT invoiceid AS value FROM account_items WHERE id='".$item_id."'"); + $original->type_invoice="project"; + $original->load_data(); + + // Get values for use in updaing the ledger later on + $projectaccount=sql_get_singlevalue("SELECT dest_account AS value FROM projects WHERE id='".$original->id_invoice."'"); + $oldchartid=$original->data["chartid"]; + $oldamount=$original->data["amount"]; + + // Change the unit cost to the selling price, not the bought price + if($original->type_item=="product") + { + $original->data["price"]=sql_get_singlevalue("SELECT price_sale AS value FROM products WHERE id='".$original->data["customid"]."'"); + $original->data["amount"]=$original->data["price"]*$original->data["quantity"]; + } + + // Now, reset to make it a new item for the existing invoice. + $original->id_item=0; + $original->id_invoice=$invoice_id; + $original->type_invoice="ar"; + + // Carry out the addition process + $original->action_create(); + + // Credit the project account with the cost of the item + ledger_trans_add("credit", "proj_ar", $original->id_item, sql_get_singlevalue("SELECT CURDATE() AS value"), $projectaccount, $oldamount, "", ""); + ledger_trans_add("debit", "proj_ar", $original->id_item, sql_get_singlevalue("SELECT CURDATE() AS value"), $oldchartid, $oldamount, "", ""); + + $original->action_update(); + $original->action_update_tax(); + $original->action_update_total(); + $original->action_update_ledger(); + + if(!error_check()) + { + $sql_obj=new sql_query; + $sql_obj->string="INSERT INTO account_items_options (itemid,option_name, option_value) VALUES ('".$item_id."','INVOICED_EXPENSE','".$original->id_item."')"; + $sql_obj->execute(); + + if(!$sql_obj->fetch_insert_id()) + { + $_SESSION["error"]["message"][] = "Unable to update item data."; + } + + } +} ?> diff --git a/include/accounts/inc_invoices_process.php b/include/accounts/inc_invoices_process.php index bfc02b76..9f23cd24 100644 --- a/include/accounts/inc_invoices_process.php +++ b/include/accounts/inc_invoices_process.php @@ -423,7 +423,14 @@ function invoice_form_delete_process($type, $returnpage_error, $returnpage_succe if ($invoice->action_delete()) { + if($invoice->type=="ar" && $GLOBALS["config"]["ACCOUNTS_CANCEL_DELETE"]=="1") + { + $_SESSION["notification"]["message"] = array("Invoice has been successfully cancelled."); + } + else + { $_SESSION["notification"]["message"] = array("Invoice has been successfully deleted."); + } } else { diff --git a/include/accounts/inc_ledger.php b/include/accounts/inc_ledger.php index acef43f1..1f3c1b50 100644 --- a/include/accounts/inc_ledger.php +++ b/include/accounts/inc_ledger.php @@ -67,6 +67,7 @@ function ledger_trans_add($mode, $type, $customid, $date_trans, $chartid, $amoun ."'". $source ."', " ."'". $memo ."' " .")"; + if ($sql_obj->execute()) { return 1; @@ -118,7 +119,26 @@ function ledger_trans_typelabel($type, $customid, $enablelink = FALSE) if ($enablelink) $result = "$result"; break; + + case "project": + // for AR invoices/transaction fetch the invoice ID + $result = sql_get_singlevalue("SELECT code_project as value FROM projects WHERE id='$customid'"); + + $result = "Project expense $result"; + if ($enablelink) + $result = "$result"; + break; + + case "proj_ar": + // for project to invoice transation, get invoice + $result = sql_get_singlevalue("SELECT code_invoice as value FROM account_ar LEFT JOIN account_items ON account_items.invoiceid=account_ar.id WHERE account_items.id='$customid'"); + $invid = sql_get_singlevalue("SELECT invoiceid AS value FROM account_items WHERE id='".$customid."'"); + $result = "Project to AR invoice $result"; + + if ($enablelink) + $result = "$result"; + break; case "ap": case "ap_tax": diff --git a/include/accounts/inc_quotes_forms.php b/include/accounts/inc_quotes_forms.php index 0f0b2d42..9abd3c93 100644 --- a/include/accounts/inc_quotes_forms.php +++ b/include/accounts/inc_quotes_forms.php @@ -105,6 +105,13 @@ function execute() $structure["options"]["width"] = 500; $this->obj_form->add_input($structure); + $structure = NULL; + $structure["fieldname"] = "terms_of_business"; + $structure["type"] = "radio"; + $structure["options"]["autoselect"] = "yes"; + $structure["defaultvalue"] = "terms_none"; + $structure["values"] = array("terms_consumer","terms_business","terms_none"); + $this->obj_form->add_input($structure); // dates @@ -139,13 +146,13 @@ function execute() // load data - $this->obj_form->sql_query = "SELECT customerid, employeeid, code_quote, notes, date_trans, date_validtill FROM account_quotes WHERE id='". $this->quoteid ."'"; + $this->obj_form->sql_query = "SELECT customerid, employeeid, code_quote, notes, date_trans, date_validtill,terms_of_business FROM account_quotes WHERE id='". $this->quoteid ."'"; $this->obj_form->load_data(); // define subforms $this->obj_form->subforms["quote_details"] = array("customerid", "employeeid", "code_quote", "date_trans", "date_validtill"); - $this->obj_form->subforms["quote_other"] = array("notes"); + $this->obj_form->subforms["quote_other"] = array("notes","terms_of_business"); $this->obj_form->subforms["hidden"] = array("id_quote"); $this->obj_form->subforms["submit"] = array("submit"); diff --git a/include/accounts/inc_quotes_process.php b/include/accounts/inc_quotes_process.php index 7b718a78..6ca626f8 100644 --- a/include/accounts/inc_quotes_process.php +++ b/include/accounts/inc_quotes_process.php @@ -50,10 +50,10 @@ function quotes_form_details_process($mode, $returnpage_error, $returnpage_succe $data["customerid"] = @security_form_input_predefined("int", "customerid", 1, ""); $data["employeeid"] = @security_form_input_predefined("int", "employeeid", 1, ""); $data["notes"] = @security_form_input_predefined("any", "notes", 0, ""); - + $data["date_trans"] = @security_form_input_predefined("date", "date_trans", 1, ""); $data["date_validtill"] = @security_form_input_predefined("date", "date_validtill", 1, ""); - + $data["terms_of_business"] = @security_form_input_predefined("any", "terms_of_business",0,""); // are we editing an existing quote or adding a new one? if ($id) @@ -159,7 +159,8 @@ function quotes_form_details_process($mode, $returnpage_error, $returnpage_succe ."notes='". $data["notes"] ."', " ."code_quote='". $data["code_quote"] ."', " ."date_trans='". $data["date_trans"] ."', " - ."date_validtill='". $data["date_validtill"] ."' " + ."date_validtill='". $data["date_validtill"] ."', " + ."terms_of_business='". $data["terms_of_business"] ."' " ."WHERE id='$id' LIMIT 1"; $sql_obj->execute(); diff --git a/include/accounts/javascript/invoice-items-edit_ap.js b/include/accounts/javascript/invoice-items-edit_ap.js new file mode 100644 index 00000000..5cdb2620 --- /dev/null +++ b/include/accounts/javascript/invoice-items-edit_ap.js @@ -0,0 +1,76 @@ +/* + include/accounts/javascript/invoice-items-edit.js + + Various functions for powering the invoice items UI and providing + AJAX functions for loading data. +*/ +$(document).ready(function() +{ + + $("select[name='productid']").change(function() + { + var id_product = $("select[name='productid'] option:selected").val(); + + getProductData(id_product); + }); + + $("select[name='timegroupid']").change(function() + { + var id_timegroup= $("select[name='timegroupid'] option:selected").val(); + getTimeData(id_timegroup); + }); + + if ($("input[name='item_type']").val() == "time"){ + if ($("select[name='timegroupid'] option:selected").val() != 0) + { + getTimeData($("select[name='timegroupid'] option:selected").val()); + } + } +}); + + +/* + getTimeData + + Populates the form with time group data +*/ +function getTimeData(id_timegroup) +{ + $.getJSON("accounts/ajax/get_time_data.php", {id: id_timegroup}, + function(json) + { + $("textarea[name='description']").text(json['description']); + } + ); +} + + + +/* + getProductData + + Populates a form with product data when an item is selected. +*/ +function getProductData(id_product) +{ + $.getJSON("accounts/ajax/get_product_data.php", {id: id_product}, + function(json) + { + var type = $("input[name='item_type']").val(); + + if (type == 'time') + { + $("input[name='price']").val(json['price_cost']); + $("input[name='units']").val(json['units']); + $("input[name='discount']").val(json['discount']); + } + else + { + $("input[name='price']").val(json['price_cost']); + $("input[name='units']").val(json['units']); + $("textarea[name='description']").text(json['details']); + $("input[name='discount']").val(json['discount']); + } + } + ); +} diff --git a/include/accounts/javascript/invoice-items-edit_ar.js b/include/accounts/javascript/invoice-items-edit_ar.js new file mode 100644 index 00000000..863cbdc8 --- /dev/null +++ b/include/accounts/javascript/invoice-items-edit_ar.js @@ -0,0 +1,76 @@ +/* + include/accounts/javascript/invoice-items-edit_ar.js + + Various functions for powering the invoice items UI and providing + AJAX functions for loading data. +*/ +$(document).ready(function() +{ + + $("select[name='productid']").change(function() + { + var id_product = $("select[name='productid'] option:selected").val(); + + getProductData(id_product); + }); + + $("select[name='timegroupid']").change(function() + { + var id_timegroup= $("select[name='timegroupid'] option:selected").val(); + getTimeData(id_timegroup); + }); + + if ($("input[name='item_type']").val() == "time"){ + if ($("select[name='timegroupid'] option:selected").val() != 0) + { + getTimeData($("select[name='timegroupid'] option:selected").val()); + } + } +}); + + +/* + getTimeData + + Populates the form with time group data +*/ +function getTimeData(id_timegroup) +{ + $.getJSON("accounts/ajax/get_time_data.php", {id: id_timegroup}, + function(json) + { + $("textarea[name='description']").text(json['description']); + } + ); +} + + + +/* + getProductData + + Populates a form with product data when an item is selected. +*/ +function getProductData(id_product) +{ + $.getJSON("accounts/ajax/get_product_data.php", {id: id_product}, + function(json) + { + var type = $("input[name='item_type']").val(); + + if (type == 'time') + { + $("input[name='price']").val(json['price_sale']); + $("input[name='units']").val(json['units']); + $("input[name='discount']").val(json['discount']); + } + else + { + $("input[name='price']").val(json['price_sale']); + $("input[name='units']").val(json['units']); + $("textarea[name='description']").text(json['details']); + $("input[name='discount']").val(json['discount']); + } + } + ); +} diff --git a/include/amberphplib/inc_forms.php b/include/amberphplib/inc_forms.php index 7d8f1720..be36872e 100644 --- a/include/amberphplib/inc_forms.php +++ b/include/amberphplib/inc_forms.php @@ -547,6 +547,7 @@ function render_row ($fieldname) text - text only display, with hidden field as well textarea - space for blocks of text + tinymce - textarea with TinyMCE editor date - special date field - splits a timestamp into 3 DD/MM/YYYY fields hourmins - splits the specified number of seconds into hours, and minutes @@ -587,6 +588,7 @@ function render_row ($fieldname) ["search_filter"] Enable/disable the optional text box to allow search/ filtering of a dropdown ["help"] In-field help message for input and textarea types. Is ignored if defaultvalue is set. ["disabled"] Disables the field if set to yes + ["postlabellink"] Link to show after the field. An array of {[link],[caption]} is passed here. ["autofill"] Set to a value to fill the input field with upon being selected the first time. ["autocomplete"] Autocomplete option for input fields, it will display a dropdown that filters as the user types, using the Jquery Autocomplete UI functions. Options are @@ -674,6 +676,11 @@ function render_field ($fieldname) { print "structure[$fieldname]["options"]["autofill"] ."\">"; } + + if(isset($this->structure[$fieldname]["options"]["postlabellink"])) + { + print "structure[$fieldname]["options"]["postlabellink"]["link"] ."\">". $this->structure[$fieldname]["options"]["postlabellink"]["caption"] .""; + } break; @@ -824,6 +831,7 @@ function render_field ($fieldname) break; case "textarea": + case "tinymce": // set default size if (!isset($this->structure[$fieldname]["options"]["width"])) @@ -840,7 +848,12 @@ function render_field ($fieldname) // display print "