froala-editor
Advanced tools
Comparing version 2.3.2 to 2.3.3
/*! | ||
* froala_editor v2.3.2 (https://www.froala.com/wysiwyg-editor) | ||
* froala_editor v2.3.3 (https://www.froala.com/wysiwyg-editor) | ||
* License https://froala.com/wysiwyg-editor/terms/ | ||
@@ -4,0 +4,0 @@ * Copyright 2014-2016 Froala Labs |
/*! | ||
* froala_editor v2.3.2 (https://www.froala.com/wysiwyg-editor) | ||
* froala_editor v2.3.3 (https://www.froala.com/wysiwyg-editor) | ||
* License https://froala.com/wysiwyg-editor/terms/ | ||
@@ -4,0 +4,0 @@ * Copyright 2014-2016 Froala Labs |
/*! | ||
* froala_editor v2.3.2 (https://www.froala.com/wysiwyg-editor) | ||
* froala_editor v2.3.3 (https://www.froala.com/wysiwyg-editor) | ||
* License https://froala.com/wysiwyg-editor/terms/ | ||
@@ -4,0 +4,0 @@ * Copyright 2014-2016 Froala Labs |
/*! | ||
* froala_editor v2.3.2 (https://www.froala.com/wysiwyg-editor) | ||
* froala_editor v2.3.3 (https://www.froala.com/wysiwyg-editor) | ||
* License https://froala.com/wysiwyg-editor/terms/ | ||
@@ -4,0 +4,0 @@ * Copyright 2014-2016 Froala Labs |
/*! | ||
* froala_editor v2.3.2 (https://www.froala.com/wysiwyg-editor) | ||
* froala_editor v2.3.3 (https://www.froala.com/wysiwyg-editor) | ||
* License https://froala.com/wysiwyg-editor/terms/ | ||
@@ -4,0 +4,0 @@ * Copyright 2014-2016 Froala Labs |
/*! | ||
* froala_editor v2.3.2 (https://www.froala.com/wysiwyg-editor) | ||
* froala_editor v2.3.3 (https://www.froala.com/wysiwyg-editor) | ||
* License https://froala.com/wysiwyg-editor/terms/ | ||
@@ -4,0 +4,0 @@ * Copyright 2014-2016 Froala Labs |
/*! | ||
* froala_editor v2.3.2 (https://www.froala.com/wysiwyg-editor) | ||
* froala_editor v2.3.3 (https://www.froala.com/wysiwyg-editor) | ||
* License https://froala.com/wysiwyg-editor/terms/ | ||
@@ -4,0 +4,0 @@ * Copyright 2014-2016 Froala Labs |
/*! | ||
* froala_editor v2.3.2 (https://www.froala.com/wysiwyg-editor) | ||
* froala_editor v2.3.3 (https://www.froala.com/wysiwyg-editor) | ||
* License https://froala.com/wysiwyg-editor/terms/ | ||
@@ -4,0 +4,0 @@ * Copyright 2014-2016 Froala Labs |
/*! | ||
* froala_editor v2.3.2 (https://www.froala.com/wysiwyg-editor) | ||
* froala_editor v2.3.3 (https://www.froala.com/wysiwyg-editor) | ||
* License https://froala.com/wysiwyg-editor/terms/ | ||
@@ -4,0 +4,0 @@ * Copyright 2014-2016 Froala Labs |
/*! | ||
* froala_editor v2.3.2 (https://www.froala.com/wysiwyg-editor) | ||
* froala_editor v2.3.3 (https://www.froala.com/wysiwyg-editor) | ||
* License https://froala.com/wysiwyg-editor/terms/ | ||
@@ -4,0 +4,0 @@ * Copyright 2014-2016 Froala Labs |
/*! | ||
* froala_editor v2.3.2 (https://www.froala.com/wysiwyg-editor) | ||
* froala_editor v2.3.3 (https://www.froala.com/wysiwyg-editor) | ||
* License https://froala.com/wysiwyg-editor/terms/ | ||
@@ -4,0 +4,0 @@ * Copyright 2014-2016 Froala Labs |
/*! | ||
* froala_editor v2.3.2 (https://www.froala.com/wysiwyg-editor) | ||
* froala_editor v2.3.3 (https://www.froala.com/wysiwyg-editor) | ||
* License https://froala.com/wysiwyg-editor/terms/ | ||
@@ -4,0 +4,0 @@ * Copyright 2014-2016 Froala Labs |
/*! | ||
* froala_editor v2.3.2 (https://www.froala.com/wysiwyg-editor) | ||
* froala_editor v2.3.3 (https://www.froala.com/wysiwyg-editor) | ||
* License https://froala.com/wysiwyg-editor/terms/ | ||
@@ -4,0 +4,0 @@ * Copyright 2014-2016 Froala Labs |
/*! | ||
* froala_editor v2.3.2 (https://www.froala.com/wysiwyg-editor) | ||
* froala_editor v2.3.3 (https://www.froala.com/wysiwyg-editor) | ||
* License https://froala.com/wysiwyg-editor/terms/ | ||
@@ -4,0 +4,0 @@ * Copyright 2014-2016 Froala Labs |
/*! | ||
* froala_editor v2.3.2 (https://www.froala.com/wysiwyg-editor) | ||
* froala_editor v2.3.3 (https://www.froala.com/wysiwyg-editor) | ||
* License https://froala.com/wysiwyg-editor/terms/ | ||
@@ -14,3 +14,3 @@ * Copyright 2014-2016 Froala Labs | ||
// Place holder | ||
"Type something": "T\u00edpus valami", | ||
"Type something": "Sz\u00f6veg...", | ||
@@ -24,3 +24,3 @@ // Basic formatting | ||
// Main buttons | ||
"Insert": "Beilleszt\u00e9se", | ||
"Insert": "Beilleszt\u00e9s", | ||
"Delete": "T\u00f6r\u00f6l", | ||
@@ -30,3 +30,3 @@ "Cancel": "M\u00e9gse", | ||
"Back": "Vissza", | ||
"Remove": "Elt\u00e1vol\u00edt\u00e1sa", | ||
"Remove": "Elt\ u00e1vol\u00edt\u00e1s", | ||
"More": "T\u00f6bb", | ||
@@ -56,3 +56,3 @@ "Update": "Friss\u00edt\u00e9s", | ||
"Paragraph Style": "Bekezd\u00e9s st\u00edlus\u00e1t", | ||
"Inline Style": "Helyi st\u00edlus", | ||
"Inline Style": " Helyi st\u00edlus", | ||
@@ -76,21 +76,21 @@ // Alignment | ||
// Links | ||
"Insert Link": "Link beilleszt\u00e9se", | ||
"Insert Link": "Hivatkoz\u00e1s beilleszt\u00e9se", | ||
"Open in new tab": "Megnyit\u00e1s \u00faj lapon", | ||
"Open Link": "Link megnyit\u00e1sa", | ||
"Edit Link": "Szerkeszt\u00e9s linkre", | ||
"Open Link": "Hivatkoz\u00e1s megnyit\u00e1sa", | ||
"Edit Link": "Hivatkoz\u00e1 s szerkeszt\u00e9se", | ||
"Unlink": "Hivatkoz\u00e1s t\u00f6rl\u00e9se", | ||
"Choose Link": "V\u00e1lasztani linket", | ||
"Choose Link": "V\u00e1lasszon weboldalt", | ||
// Images | ||
"Insert Image": "K\u00e9p besz\u00far\u00e1sa", | ||
"Upload Image": "Felt\u00f6lt\u00e9s k\u00e9p", | ||
"By URL": "\u00c1ltal URL", | ||
"Browse": "B\u00f6ng\u00e9sszen", | ||
"Drop image": "Dobd k\u00e9p", | ||
"or click": "vagy kattintson", | ||
"Insert Image": "K\u00e9p beilleszt\u00e9se", | ||
"Upload Image": "K\u00e9p felt\u00f6lt\u00e9se", | ||
"By URL": "Webc\u00edm megad\u00e1sa", | ||
"Browse": "B\u00f6ng\u00e9sz\u00e9s", | ||
"Drop image": "H\u00fazza ide a k\u00e9pet", | ||
"or click": "vagy kattintson ide", | ||
"Manage Images": "K\u00e9pek kezel\u00e9se", | ||
"Loading": "Terhel\u00e9s", | ||
"Loading": "Bet\u00f6lt\u00e9s...", | ||
"Deleting": "T\u00f6rl\u00e9se", | ||
"Tags": "C\u00edmk\u00e9k", | ||
"Are you sure? Image will be deleted.": "Biztos vagy benne? K\u00e9p t\u00f6rl\u00e9sre ker\u00fcl.", | ||
"Are you sure? Image will be deleted.": "Biztos benne? K\u00e9p t\u00f6rl\u00e9sre ker\u00fcl.", | ||
"Replace": "Cser\u00e9je", | ||
@@ -110,8 +110,8 @@ "Uploading": "Felt\u00f6lt\u00e9s", | ||
"Insert Video": "Vide\u00f3 beilleszt\u00e9se", | ||
"Embedded Code": "Be\u00e1gyazott k\u00f3dot", | ||
"Embedded Code": "Vide\u00f3 be\u00e1gyazása", | ||
// Tables | ||
"Insert Table": "T\u00e1bl\u00e1zat beilleszt\u00e9se", | ||
"Table Header": "T\u00e1bl\u00e1zat fejl\u00e9ce", | ||
"Remove Table": "T\u00e1bla elt\u00e1vol\u00edt\u00e1sa", | ||
"Table Header": "T\u00e1bl\u00e1zat fejl\u00e9c", | ||
"Remove Table": "T\u00e1bla elt\u00e1vol\u00edt\u00e1s", | ||
"Table Style": "T\u00e1bl\u00e1zat st\u00edlus", | ||
@@ -143,3 +143,3 @@ "Horizontal Align": "V\u00edzszintes igaz\u00edt\u00e1s", | ||
"Upload File": "F\u00e1jl felt\u00f6lt\u00e9se", | ||
"Drop file": "Csepp f\u00e1jl", | ||
"Drop file": "H\u00fazza ide a f\u00e1jl", | ||
@@ -152,3 +152,3 @@ // Emoticons | ||
"Smiling face with open mouth": "Mosolyg\u00f3 arc t\u00e1tott sz\u00e1jjal", | ||
"Smiling face with open mouth and smiling eyes": "Mosolyg\u00f3 arc t\u00e1tott sz\u00e1jjal \u00e9s mosolyg\u00f3 szemek", | ||
"Smiling face with open mouth and smiling eyes": "Mosoly g\u00f3 arc t\u00e1tott sz\u00e1jjal \u00e9s mosolyg\u00f3 szemek", | ||
"Smiling face with open mouth and cold sweat": "Mosolyg\u00f3 arc t\u00e1tott sz\u00e1jjal \u00e9s hideg ver\u00edt\u00e9k", | ||
@@ -163,3 +163,3 @@ "Smiling face with open mouth and tightly-closed eyes": "Mosolyg\u00f3 arc t\u00e1tott sz\u00e1jjal \u00e9s szorosan lehunyt szemmel", | ||
"Smiling face with heart-shaped eyes": "Mosolyg\u00f3 arc sz\u00edv alak\u00fa szemek", | ||
"Smiling face with sunglasses": "Mosolyg\u00f3 arc, napszem\u00fcveg", | ||
"Smilin g face with sunglasses": "Mosolyg\u00f3 arc, napszem\u00fcveg", | ||
"Smirking face": "Vigyorg\u00f3 arca", | ||
@@ -177,3 +177,3 @@ "Neutral face": "Semleges arc", | ||
"Kissing face with closed eyes": "Cs\u00f3kos arc\u00e1t csukott szemmel", | ||
"Face with stuck out tongue": "Szembe kiny\u00fajtotta a nyelv\u00e9t", | ||
"Face with stuck out tongue": "Szembe kiny\u00faj totta a nyelv\u00e9t", | ||
"Face with stuck out tongue and winking eye": "Szembe kiny\u00fajtotta a nyelv\u00e9t, \u00e9s kacsintott szem", | ||
@@ -204,3 +204,3 @@ "Face with stuck out tongue and tightly-closed eyes": "Arc kiny\u00fajtotta a nyelv\u00e9t, \u00e9s szorosan lehunyt szemmel", | ||
"Sleeping face": "Alv\u00f3 arc\u00e1t", | ||
"Dizzy face": "sz\u00e1d\u00fcl arca", | ||
"Dizzy face": " sz\u00e1d\u00fcl arca", | ||
"Face without mouth": "Arc n\u00e9lkül sz\u00e1j", | ||
@@ -210,3 +210,3 @@ "Face with medical mask": "Arc\u00e1t orvosi maszk", | ||
// Line breaker | ||
"Break": "T\u00f6r", | ||
"Break": "T\u00f6r\u00e9s", | ||
@@ -218,6 +218,6 @@ // Math | ||
// Full screen | ||
"Fullscreen": "Teljes k\u00e9perny\u0151s", | ||
"Fullscreen": "Teljes k\u00e9perny\u0151", | ||
// Horizontal line | ||
"Insert Horizontal Line": "Helyezze v\u00edzszintes vonal", | ||
"Insert Horizontal Line": "V\u00edzszintes vonal", | ||
@@ -235,3 +235,3 @@ // Clear formatting | ||
// Code view | ||
"Code View": "K\u00f3d n\u00e9zet", | ||
"Code View": "Forr\u00e1sk\u00f3d", | ||
@@ -241,8 +241,8 @@ // Quote | ||
"Increase": "N\u00f6veked\u00e9s", | ||
"Decrease": "Cs\u00f6kkent", | ||
"Decrease": "Cs\u00f6kken\u00e9s", | ||
// Quick Insert | ||
"Quick Insert": "Gyors bet\u00e9t" | ||
"Quick Insert": "Beilleszt\u00e9s" | ||
}, | ||
direction: "ltr" | ||
}; |
/*! | ||
* froala_editor v2.3.2 (https://www.froala.com/wysiwyg-editor) | ||
* froala_editor v2.3.3 (https://www.froala.com/wysiwyg-editor) | ||
* License https://froala.com/wysiwyg-editor/terms/ | ||
@@ -4,0 +4,0 @@ * Copyright 2014-2016 Froala Labs |
/*! | ||
* froala_editor v2.3.2 (https://www.froala.com/wysiwyg-editor) | ||
* froala_editor v2.3.3 (https://www.froala.com/wysiwyg-editor) | ||
* License https://froala.com/wysiwyg-editor/terms/ | ||
@@ -4,0 +4,0 @@ * Copyright 2014-2016 Froala Labs |
/*! | ||
* froala_editor v2.3.2 (https://www.froala.com/wysiwyg-editor) | ||
* froala_editor v2.3.3 (https://www.froala.com/wysiwyg-editor) | ||
* License https://froala.com/wysiwyg-editor/terms/ | ||
@@ -4,0 +4,0 @@ * Copyright 2014-2016 Froala Labs |
/*! | ||
* froala_editor v2.3.2 (https://www.froala.com/wysiwyg-editor) | ||
* froala_editor v2.3.3 (https://www.froala.com/wysiwyg-editor) | ||
* License https://froala.com/wysiwyg-editor/terms/ | ||
@@ -4,0 +4,0 @@ * Copyright 2014-2016 Froala Labs |
/*! | ||
* froala_editor v2.3.2 (https://www.froala.com/wysiwyg-editor) | ||
* froala_editor v2.3.3 (https://www.froala.com/wysiwyg-editor) | ||
* License https://froala.com/wysiwyg-editor/terms/ | ||
@@ -4,0 +4,0 @@ * Copyright 2014-2016 Froala Labs |
/*! | ||
* froala_editor v2.3.2 (https://www.froala.com/wysiwyg-editor) | ||
* froala_editor v2.3.3 (https://www.froala.com/wysiwyg-editor) | ||
* License https://froala.com/wysiwyg-editor/terms/ | ||
@@ -4,0 +4,0 @@ * Copyright 2014-2016 Froala Labs |
/*! | ||
* froala_editor v2.3.2 (https://www.froala.com/wysiwyg-editor) | ||
* froala_editor v2.3.3 (https://www.froala.com/wysiwyg-editor) | ||
* License https://froala.com/wysiwyg-editor/terms/ | ||
@@ -4,0 +4,0 @@ * Copyright 2014-2016 Froala Labs |
/*! | ||
* froala_editor v2.3.2 (https://www.froala.com/wysiwyg-editor) | ||
* froala_editor v2.3.3 (https://www.froala.com/wysiwyg-editor) | ||
* License https://froala.com/wysiwyg-editor/terms/ | ||
@@ -4,0 +4,0 @@ * Copyright 2014-2016 Froala Labs |
/*! | ||
* froala_editor v2.3.2 (https://www.froala.com/wysiwyg-editor) | ||
* froala_editor v2.3.3 (https://www.froala.com/wysiwyg-editor) | ||
* License https://froala.com/wysiwyg-editor/terms/ | ||
@@ -4,0 +4,0 @@ * Copyright 2014-2016 Froala Labs |
/*! | ||
* froala_editor v2.3.2 (https://www.froala.com/wysiwyg-editor) | ||
* froala_editor v2.3.3 (https://www.froala.com/wysiwyg-editor) | ||
* License https://froala.com/wysiwyg-editor/terms/ | ||
@@ -4,0 +4,0 @@ * Copyright 2014-2016 Froala Labs |
/*! | ||
* froala_editor v2.3.2 (https://www.froala.com/wysiwyg-editor) | ||
* froala_editor v2.3.3 (https://www.froala.com/wysiwyg-editor) | ||
* License https://froala.com/wysiwyg-editor/terms/ | ||
@@ -4,0 +4,0 @@ * Copyright 2014-2016 Froala Labs |
/*! | ||
* froala_editor v2.3.2 (https://www.froala.com/wysiwyg-editor) | ||
* froala_editor v2.3.3 (https://www.froala.com/wysiwyg-editor) | ||
* License https://froala.com/wysiwyg-editor/terms/ | ||
@@ -4,0 +4,0 @@ * Copyright 2014-2016 Froala Labs |
/*! | ||
* froala_editor v2.3.2 (https://www.froala.com/wysiwyg-editor) | ||
* froala_editor v2.3.3 (https://www.froala.com/wysiwyg-editor) | ||
* License https://froala.com/wysiwyg-editor/terms/ | ||
@@ -4,0 +4,0 @@ * Copyright 2014-2016 Froala Labs |
/*! | ||
* froala_editor v2.3.2 (https://www.froala.com/wysiwyg-editor) | ||
* froala_editor v2.3.3 (https://www.froala.com/wysiwyg-editor) | ||
* License https://froala.com/wysiwyg-editor/terms/ | ||
@@ -4,0 +4,0 @@ * Copyright 2014-2016 Froala Labs |
/*! | ||
* froala_editor v2.3.2 (https://www.froala.com/wysiwyg-editor) | ||
* froala_editor v2.3.3 (https://www.froala.com/wysiwyg-editor) | ||
* License https://froala.com/wysiwyg-editor/terms/ | ||
@@ -4,0 +4,0 @@ * Copyright 2014-2016 Froala Labs |
/*! | ||
* froala_editor v2.3.2 (https://www.froala.com/wysiwyg-editor) | ||
* froala_editor v2.3.3 (https://www.froala.com/wysiwyg-editor) | ||
* License https://froala.com/wysiwyg-editor/terms/ | ||
@@ -4,0 +4,0 @@ * Copyright 2014-2016 Froala Labs |
/*! | ||
* froala_editor v2.3.2 (https://www.froala.com/wysiwyg-editor) | ||
* froala_editor v2.3.3 (https://www.froala.com/wysiwyg-editor) | ||
* License https://froala.com/wysiwyg-editor/terms/ | ||
@@ -4,0 +4,0 @@ * Copyright 2014-2016 Froala Labs |
/*! | ||
* froala_editor v2.3.2 (https://www.froala.com/wysiwyg-editor) | ||
* froala_editor v2.3.3 (https://www.froala.com/wysiwyg-editor) | ||
* License https://froala.com/wysiwyg-editor/terms/ | ||
@@ -4,0 +4,0 @@ * Copyright 2014-2016 Froala Labs |
/*! | ||
* froala_editor v2.3.2 (https://www.froala.com/wysiwyg-editor) | ||
* froala_editor v2.3.3 (https://www.froala.com/wysiwyg-editor) | ||
* License https://froala.com/wysiwyg-editor/terms/ | ||
@@ -4,0 +4,0 @@ * Copyright 2014-2016 Froala Labs |
/*! | ||
* froala_editor v2.3.2 (https://www.froala.com/wysiwyg-editor) | ||
* froala_editor v2.3.3 (https://www.froala.com/wysiwyg-editor) | ||
* License https://froala.com/wysiwyg-editor/terms/ | ||
@@ -4,0 +4,0 @@ * Copyright 2014-2016 Froala Labs |
/*! | ||
* froala_editor v2.3.2 (https://www.froala.com/wysiwyg-editor) | ||
* froala_editor v2.3.3 (https://www.froala.com/wysiwyg-editor) | ||
* License https://froala.com/wysiwyg-editor/terms/ | ||
@@ -4,0 +4,0 @@ * Copyright 2014-2016 Froala Labs |
/*! | ||
* froala_editor v2.3.2 (https://www.froala.com/wysiwyg-editor) | ||
* froala_editor v2.3.3 (https://www.froala.com/wysiwyg-editor) | ||
* License https://froala.com/wysiwyg-editor/terms/ | ||
@@ -4,0 +4,0 @@ * Copyright 2014-2016 Froala Labs |
/*! | ||
* froala_editor v2.3.2 (https://www.froala.com/wysiwyg-editor) | ||
* froala_editor v2.3.3 (https://www.froala.com/wysiwyg-editor) | ||
* License https://froala.com/wysiwyg-editor/terms/ | ||
@@ -4,0 +4,0 @@ * Copyright 2014-2016 Froala Labs |
/*! | ||
* froala_editor v2.3.2 (https://www.froala.com/wysiwyg-editor) | ||
* froala_editor v2.3.3 (https://www.froala.com/wysiwyg-editor) | ||
* License https://froala.com/wysiwyg-editor/terms/ | ||
@@ -4,0 +4,0 @@ * Copyright 2014-2016 Froala Labs |
/*! | ||
* froala_editor v2.3.2 (https://www.froala.com/wysiwyg-editor) | ||
* froala_editor v2.3.3 (https://www.froala.com/wysiwyg-editor) | ||
* License https://froala.com/wysiwyg-editor/terms/ | ||
@@ -4,0 +4,0 @@ * Copyright 2014-2016 Froala Labs |
/*! | ||
* froala_editor v2.3.2 (https://www.froala.com/wysiwyg-editor) | ||
* froala_editor v2.3.3 (https://www.froala.com/wysiwyg-editor) | ||
* License https://froala.com/wysiwyg-editor/terms/ | ||
@@ -4,0 +4,0 @@ * Copyright 2014-2016 Froala Labs |
/*! | ||
* froala_editor v2.3.2 (https://www.froala.com/wysiwyg-editor) | ||
* froala_editor v2.3.3 (https://www.froala.com/wysiwyg-editor) | ||
* License https://froala.com/wysiwyg-editor/terms/ | ||
@@ -4,0 +4,0 @@ * Copyright 2014-2016 Froala Labs |
/*! | ||
* froala_editor v2.3.2 (https://www.froala.com/wysiwyg-editor) | ||
* froala_editor v2.3.3 (https://www.froala.com/wysiwyg-editor) | ||
* License https://froala.com/wysiwyg-editor/terms/ | ||
@@ -4,0 +4,0 @@ * Copyright 2014-2016 Froala Labs |
/*! | ||
* froala_editor v2.3.2 (https://www.froala.com/wysiwyg-editor) | ||
* froala_editor v2.3.3 (https://www.froala.com/wysiwyg-editor) | ||
* License https://froala.com/wysiwyg-editor/terms/ | ||
@@ -4,0 +4,0 @@ * Copyright 2014-2016 Froala Labs |
/*! | ||
* froala_editor v2.3.2 (https://www.froala.com/wysiwyg-editor) | ||
* froala_editor v2.3.3 (https://www.froala.com/wysiwyg-editor) | ||
* License https://froala.com/wysiwyg-editor/terms/ | ||
@@ -4,0 +4,0 @@ * Copyright 2014-2016 Froala Labs |
/*! | ||
* froala_editor v2.3.2 (https://www.froala.com/wysiwyg-editor) | ||
* froala_editor v2.3.3 (https://www.froala.com/wysiwyg-editor) | ||
* License https://froala.com/wysiwyg-editor/terms/ | ||
@@ -4,0 +4,0 @@ * Copyright 2014-2016 Froala Labs |
/*! | ||
* froala_editor v2.3.2 (https://www.froala.com/wysiwyg-editor) | ||
* froala_editor v2.3.3 (https://www.froala.com/wysiwyg-editor) | ||
* License https://froala.com/wysiwyg-editor/terms/ | ||
@@ -7,2 +7,2 @@ * Copyright 2014-2016 Froala Labs | ||
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=function(b,c){return void 0===c&&(c="undefined"!=typeof window?require("jquery"):require("jquery")(b)),a(c),c}:a(jQuery)}(function(a){"use strict";a.FE.PLUGINS.fullscreen=function(b){function c(){return b.$box.hasClass("fr-fullscreen")}function d(){i=a(b.o_win).scrollTop(),b.$box.toggleClass("fr-fullscreen"),a("body").toggleClass("fr-fullscreen"),j=a('<div style="display: none;"></div>'),b.$box.after(j),b.helpers.isMobile()&&(b.$tb.data("parent",b.$tb.parent()),b.$tb.prependTo(b.$box),b.$tb.data("sticky-dummy")&&b.$tb.after(b.$tb.data("sticky-dummy"))),k=b.opts.height,l=b.opts.heightMax,b.opts.height=b.o_win.innerHeight-(b.opts.toolbarInline?0:b.$tb.outerHeight()),b.size.refresh(),b.opts.toolbarInline&&b.toolbar.showInline();for(var c=b.$box.parent();!c.is("body");)c.data("z-index",c.css("z-index")).css("z-index","9990"),c=c.parent();b.events.trigger("charCounter.update"),b.$win.trigger("scroll")}function e(){b.$box.toggleClass("fr-fullscreen"),a("body").toggleClass("fr-fullscreen"),b.$tb.prependTo(b.$tb.data("parent")),b.$tb.data("sticky-dummy")&&b.$tb.after(b.$tb.data("sticky-dummy")),b.opts.height=k,b.opts.heightMax=l,b.size.refresh(),a(b.o_win).scrollTop(i),b.opts.toolbarInline&&b.toolbar.showInline(),b.events.trigger("charCounter.update"),b.opts.toolbarSticky&&b.opts.toolbarStickyOffset&&(b.opts.toolbarBottom?b.$tb.css("bottom",b.opts.toolbarStickyOffset).data("bottom",b.opts.toolbarStickyOffset):b.$tb.css("top",b.opts.toolbarStickyOffset).data("top",b.opts.toolbarStickyOffset));for(var c=b.$box.parent();!c.is("body");)c.data("z-index")&&(c.css("z-index",""),c.css("z-index")!=c.data("z-index")&&c.css("z-index",c.data("z-index")),c.removeData("z-index")),c=c.parent();b.$win.trigger("scroll")}function f(){c()?e():d(),g(b.$tb.find('.fr-command[data-cmd="fullscreen"]'))}function g(a){var d=c();a.toggleClass("fr-active",d),a.find("> *").replaceWith(d?b.icon.create("fullscreenCompress"):b.icon.create("fullscreen"))}function h(){return b.$wp?(b.events.$on(a(b.o_win),"resize",function(){c()&&(e(),d())}),void b.events.on("toolbar.hide",function(){return c()&&b.helpers.isMobile()?!1:void 0})):!1}var i,j,k,l;return{_init:h,toggle:f,refresh:g,isActive:c}},a.FE.RegisterCommand("fullscreen",{title:"Fullscreen",undo:!1,focus:!1,forcedRefresh:!0,callback:function(){this.fullscreen.toggle()},refresh:function(a){this.fullscreen.refresh(a)},plugin:"fullscreen"}),a.FE.DefineIcon("fullscreen",{NAME:"expand"}),a.FE.DefineIcon("fullscreenCompress",{NAME:"compress"})}); | ||
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=function(b,c){return void 0===c&&(c="undefined"!=typeof window?require("jquery"):require("jquery")(b)),a(c),c}:a(jQuery)}(function(a){"use strict";a.FE.PLUGINS.fullscreen=function(b){function c(){return b.$box.hasClass("fr-fullscreen")}function d(){i=a(b.o_win).scrollTop(),b.$box.toggleClass("fr-fullscreen"),a("body").toggleClass("fr-fullscreen"),j=a('<div style="display: none;"></div>'),b.$box.after(j),b.helpers.isMobile()&&(b.$tb.data("parent",b.$tb.parent()),b.$tb.prependTo(b.$box),b.$tb.data("sticky-dummy")&&b.$tb.after(b.$tb.data("sticky-dummy"))),k=b.opts.height,l=b.opts.heightMax,b.opts.height=b.o_win.innerHeight-(b.opts.toolbarInline?0:b.$tb.outerHeight()),b.opts.heightMax=null,b.size.refresh(),b.opts.toolbarInline&&b.toolbar.showInline();for(var c=b.$box.parent();!c.is("body");)c.data("z-index",c.css("z-index")).css("z-index","9990"),c=c.parent();b.events.trigger("charCounter.update"),b.$win.trigger("scroll")}function e(){b.$box.toggleClass("fr-fullscreen"),a("body").toggleClass("fr-fullscreen"),b.$tb.prependTo(b.$tb.data("parent")),b.$tb.data("sticky-dummy")&&b.$tb.after(b.$tb.data("sticky-dummy")),b.opts.height=k,b.opts.heightMax=l,b.size.refresh(),a(b.o_win).scrollTop(i),b.opts.toolbarInline&&b.toolbar.showInline(),b.events.trigger("charCounter.update"),b.opts.toolbarSticky&&b.opts.toolbarStickyOffset&&(b.opts.toolbarBottom?b.$tb.css("bottom",b.opts.toolbarStickyOffset).data("bottom",b.opts.toolbarStickyOffset):b.$tb.css("top",b.opts.toolbarStickyOffset).data("top",b.opts.toolbarStickyOffset));for(var c=b.$box.parent();!c.is("body");)c.data("z-index")&&(c.css("z-index",""),c.css("z-index")!=c.data("z-index")&&c.css("z-index",c.data("z-index")),c.removeData("z-index")),c=c.parent();b.$win.trigger("scroll")}function f(){c()?e():d(),g(b.$tb.find('.fr-command[data-cmd="fullscreen"]'))}function g(a){var d=c();a.toggleClass("fr-active",d),a.find("> *").replaceWith(d?b.icon.create("fullscreenCompress"):b.icon.create("fullscreen"))}function h(){return b.$wp?(b.events.$on(a(b.o_win),"resize",function(){c()&&(e(),d())}),void b.events.on("toolbar.hide",function(){return c()&&b.helpers.isMobile()?!1:void 0})):!1}var i,j,k,l;return{_init:h,toggle:f,refresh:g,isActive:c}},a.FE.RegisterCommand("fullscreen",{title:"Fullscreen",undo:!1,focus:!1,forcedRefresh:!0,callback:function(){this.fullscreen.toggle()},refresh:function(a){this.fullscreen.refresh(a)},plugin:"fullscreen"}),a.FE.DefineIcon("fullscreen",{NAME:"expand"}),a.FE.DefineIcon("fullscreenCompress",{NAME:"compress"})}); |
/*! | ||
* froala_editor v2.3.2 (https://www.froala.com/wysiwyg-editor) | ||
* froala_editor v2.3.3 (https://www.froala.com/wysiwyg-editor) | ||
* License https://froala.com/wysiwyg-editor/terms/ | ||
@@ -4,0 +4,0 @@ * Copyright 2014-2016 Froala Labs |
/*! | ||
* froala_editor v2.3.2 (https://www.froala.com/wysiwyg-editor) | ||
* froala_editor v2.3.3 (https://www.froala.com/wysiwyg-editor) | ||
* License https://froala.com/wysiwyg-editor/terms/ | ||
@@ -7,3 +7,3 @@ * Copyright 2014-2016 Froala Labs | ||
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=function(b,c){return void 0===c&&(c="undefined"!=typeof window?require("jquery"):require("jquery")(b)),a(c),c}:a(jQuery)}(function(a){"use strict";a.extend(a.FE.POPUP_TEMPLATES,{"image.insert":"[_BUTTONS_][_UPLOAD_LAYER_][_BY_URL_LAYER_][_PROGRESS_BAR_]","image.edit":"[_BUTTONS_]","image.alt":"[_BUTTONS_][_ALT_LAYER_]","image.size":"[_BUTTONS_][_SIZE_LAYER_]"}),a.extend(a.FE.DEFAULTS,{imageInsertButtons:["imageBack","|","imageUpload","imageByURL"],imageEditButtons:["imageReplace","imageAlign","imageRemove","|","imageLink","linkOpen","linkEdit","linkRemove","-","imageDisplay","imageStyle","imageAlt","imageSize"],imageAltButtons:["imageBack","|"],imageSizeButtons:["imageBack","|"],imageUploadURL:"https://i.froala.com/upload",imageUploadParam:"file",imageUploadParams:{},imageUploadToS3:!1,imageUploadMethod:"POST",imageMaxSize:10485760,imageAllowedTypes:["jpeg","jpg","png","gif","svg+xml"],imageResize:!0,imageResizeWithPercent:!1,imageRoundPercent:!1,imageDefaultWidth:300,imageDefaultAlign:"center",imageDefaultDisplay:"block",imageSplitHTML:!1,imageStyles:{"fr-rounded":"Rounded","fr-bordered":"Bordered"},imageMove:!0,imageMultipleStyles:!0,imageTextNear:!0,imagePaste:!0,imagePasteProcess:!1,imageMinWidth:16,imageOutputSize:!1}),a.FE.PLUGINS.image=function(b){function c(){var a=b.popups.get("image.insert"),c=a.find(".fr-image-by-url-layer input");c.val(""),qa&&c.val(qa.attr("src")),c.trigger("change")}function d(){var a=b.$tb.find('.fr-command[data-cmd="insertImage"]'),c=b.popups.get("image.insert");if(c||(c=L()),r(),!c.hasClass("fr-active"))if(b.popups.refresh("image.insert"),b.popups.setContainer("image.insert",b.$tb),a.is(":visible")){var d=a.offset().left+a.outerWidth()/2,e=a.offset().top+(b.opts.toolbarBottom?10:a.outerHeight()-10);b.popups.show("image.insert",d,e,a.outerHeight())}else b.position.forSelection(c),b.popups.show("image.insert")}function e(){var c=b.popups.get("image.edit");c||(c=p()),b.popups.setContainer("image.edit",a(b.opts.scrollableContainer)),b.popups.refresh("image.edit");var d=qa.offset().left+qa.outerWidth()/2,e=qa.offset().top+qa.outerHeight();b.popups.show("image.edit",d,e,qa.outerHeight())}function f(){r()}function g(a){if(!a.hasClass("fr-dii")&&!a.hasClass("fr-dib")){var c=a.css("float");a.css("float","none"),"block"==a.css("display")?(a.css("float",c),b.opts.imageEditButtons.indexOf("imageAlign")>=0&&(0===parseInt(a.css("margin-left"),10)&&(a.attr("style")||"").indexOf("margin-right: auto")>=0?a.addClass("fr-fil"):0===parseInt(a.css("margin-right"),10)&&(a.attr("style")||"").indexOf("margin-left: auto")>=0&&a.addClass("fr-fir")),a.addClass("fr-dib")):(a.css("float",c),b.opts.imageEditButtons.indexOf("imageAlign")>=0&&("left"==a.css("float")?a.addClass("fr-fil"):"right"==a.css("float")&&a.addClass("fr-fir")),a.addClass("fr-dii")),a.css("margin",""),a.css("float",""),a.css("display",""),a.css("z-index",""),a.css("position",""),a.css("overflow",""),a.css("vertical-align","")}}function h(){for(var c="IMG"==b.$el.get(0).tagName?[b.$el.get(0)]:b.$el.get(0).querySelectorAll("img"),d=0;d<c.length;d++){var e=a(c[d]);(b.opts.imageEditButtons.indexOf("imageAlign")>=0||b.opts.imageEditButtons.indexOf("imageDisplay")>=0)&&g(e),e.attr("width")&&(e.css("width",e.width()),e.removeAttr("width")),b.opts.imageTextNear||e.removeClass("fr-dii").addClass("fr-dib"),b.opts.iframe&&e.on("load",b.size.syncIframe)}}function i(){var c,d=Array.prototype.slice.call(b.$el.get(0).querySelectorAll("img")),e=[];for(c=0;c<d.length;c++)e.push(d[c].getAttribute("src")),a(d[c]).toggleClass("fr-draggable",b.opts.imageMove),""===d[c].className&&d[c].removeAttribute("class"),""===d[c].getAttribute("style")&&d[c].removeAttribute("style");if(Da)for(c=0;c<Da.length;c++)e.indexOf(Da[c].getAttribute("src"))<0&&b.events.trigger("image.removed",[a(Da[c])]);Da=d}function j(){ra||X();var c=b.$wp||a(b.opts.scrollableContainer);c.append(ra),ra.data("instance",b);var d=c.scrollTop()-("static"!=c.css("position")?c.offset().top:0),e=c.scrollLeft()-("static"!=c.css("position")?c.offset().left:0);e-=b.helpers.getPX(c.css("border-left-width")),d-=b.helpers.getPX(c.css("border-top-width")),ra.css("top",(b.opts.iframe?qa.offset().top:qa.offset().top+d)-1).css("left",(b.opts.iframe?qa.offset().left:qa.offset().left+e)-1).css("width",qa.get(0).getBoundingClientRect().width).css("height",qa.get(0).getBoundingClientRect().height).addClass("fr-active")}function k(a){return'<div class="fr-handler fr-h'+a+'"></div>'}function l(c){if(!b.core.sameInstance(ra))return!0;if(c.preventDefault(),c.stopPropagation(),b.$el.find("img.fr-error").left)return!1;b.undo.canDo()||b.undo.saveStep(),sa=a(this),sa.data("start-x",c.pageX||c.originalEvent.touches[0].pageX),sa.data("start-width",qa.width()),sa.data("start-height",qa.height());var d=qa.width();if(b.opts.imageResizeWithPercent){var e=qa.parentsUntil(b.$el,b.html.blockTagsQuery()).get(0)||b.$el.get(0);qa.css("width",(d/a(e).outerWidth()*100).toFixed(2)+"%")}else qa.css("width",d);ta.show(),b.popups.hideAll(),ea()}function m(c){if(!b.core.sameInstance(ra))return!0;if(sa&&qa){if(c.preventDefault(),b.$el.find("img.fr-error").left)return!1;var d=c.pageX||(c.originalEvent.touches?c.originalEvent.touches[0].pageX:null);if(!d)return!1;var e=sa.data("start-x"),f=d-e,g=sa.data("start-width");if((sa.hasClass("fr-hnw")||sa.hasClass("fr-hsw"))&&(f=0-f),b.opts.imageResizeWithPercent){var h=qa.parentsUntil(b.$el,b.html.blockTagsQuery()).get(0)||b.$el.get(0);g=((g+f)/a(h).outerWidth()*100).toFixed(2),b.opts.imageRoundPercent&&(g=Math.round(g)),qa.css("width",g+"%"),qa.css("height","").removeAttr("height")}else g+f>=b.opts.imageMinWidth&&qa.css("width",g+f),qa.css("height",sa.data("start-height")*qa.width()/sa.data("start-width"));j(),b.events.trigger("image.resize",[oa()])}}function n(a){if(!b.core.sameInstance(ra))return!0;if(sa&&qa){if(a&&a.stopPropagation(),b.$el.find("img.fr-error").left)return!1;sa=null,ta.hide(),j(),e(),b.undo.saveStep(),b.events.trigger("image.resizeEnd",[oa()])}}function o(a,c){b.edit.on(),qa&&qa.addClass("fr-error"),t(b.language.translate("Something went wrong. Please try again.")),b.events.trigger("image.error",[{code:a,message:Ca[a]},c])}function p(a){if(a)return b.$wp&&b.events.$on(b.$wp,"scroll",function(){qa&&b.popups.isVisible("image.edit")&&e()}),!0;var c="";b.opts.imageEditButtons.length>0&&(c+='<div class="fr-buttons">',c+=b.button.buildList(b.opts.imageEditButtons),c+="</div>");var d={buttons:c},f=b.popups.create("image.edit",d);return f}function q(c){var d=b.popups.get("image.insert");if(d||(d=L()),d.find(".fr-layer.fr-active").removeClass("fr-active").addClass("fr-pactive"),d.find(".fr-image-progress-bar-layer").addClass("fr-active"),d.find(".fr-buttons").hide(),qa){b.popups.setContainer("image.insert",a(b.opts.scrollableContainer));var e=qa.offset().left+qa.width()/2,f=qa.offset().top+qa.height();b.popups.show("image.insert",e,f,qa.outerHeight())}"undefined"==typeof c&&s("Uploading",0)}function r(a){var c=b.popups.get("image.insert");c&&(c.find(".fr-layer.fr-pactive").addClass("fr-active").removeClass("fr-pactive"),c.find(".fr-image-progress-bar-layer").removeClass("fr-active"),c.find(".fr-buttons").show(),(a||b.$el.find("img.fr-error").length)&&(b.events.focus(),b.$el.find("img.fr-error").remove(),b.undo.saveStep(),b.undo.run(),b.undo.dropRedo()))}function s(a,c){var d=b.popups.get("image.insert");if(d){var e=d.find(".fr-image-progress-bar-layer");e.find("h3").text(a+(c?" "+c+"%":"")),e.removeClass("fr-error"),c?(e.find("div").removeClass("fr-indeterminate"),e.find("div > span").css("width",c+"%")):e.find("div").addClass("fr-indeterminate")}}function t(a){q();var c=b.popups.get("image.insert"),d=c.find(".fr-image-progress-bar-layer");d.addClass("fr-error"),d.find("h3").text(a)}function u(){var a=b.popups.get("image.insert"),c=a.find(".fr-image-by-url-layer input");c.val().length>0&&(q(),s("Loading image"),x(b.helpers.sanitizeURL(c.val()),!0,[],qa),c.val(""),c.blur())}function v(a){ba.call(a.get(0))}function w(){var c=a(this);b.popups.hide("image.insert"),c.removeClass("fr-uploading"),c.next().is("br")&&c.next().remove(),v(c),b.events.trigger("image.loaded",[c])}function x(a,c,d,e,f){b.edit.off(),s("Loading image");var g=new Image;g.onload=function(){var c,g;if(e){var h=e.data("fr-old-src");b.$wp?(c=e.clone().removeData("fr-old-src").removeClass("fr-uploading"),c.off("load"),h&&e.attr("src",h),e.replaceWith(c)):c=e;for(var j=c.get(0).attributes,k=0;k<j.length;k++){var l=j[k];0===l.nodeName.indexOf("data-")&&c.removeAttr(l.nodeName)}if("undefined"!=typeof d)for(g in d)d.hasOwnProperty(g)&&"link"!=g&&c.attr("data-"+g,d[g]);c.on("load",w),c.attr("src",a),b.edit.on(),i(),b.undo.saveStep(),b.events.trigger(h?"image.replaced":"image.inserted",[c,f])}else c=D(a,d,w),i(),b.undo.saveStep(),b.events.trigger("image.inserted",[c,f])},g.onerror=function(){o(va)},g.src=a}function y(c){try{if(b.events.trigger("image.uploaded",[c],!0)===!1)return b.edit.on(),!1;var d=a.parseJSON(c);return d.link?d:(o(wa,c),!1)}catch(e){return o(ya,c),!1}}function z(c){try{var d=a(c).find("Location").text(),e=a(c).find("Key").text();return b.events.trigger("image.uploadedToS3",[d,e,c],!0)===!1?(b.edit.on(),!1):d}catch(f){return o(ya,c),!1}}function A(a){s("Loading image");var c=this.status,d=this.response,e=this.responseXML,f=this.responseText;try{if(b.opts.imageUploadToS3)if(201==c){var g=z(e);g&&x(g,!1,[],a,d||e)}else o(ya,d||e);else if(c>=200&&300>c){var h=y(f);h&&x(h.link,!1,h,a,d||f)}else o(xa,d||f)}catch(i){o(ya,d||f)}}function B(){o(ya,this.response||this.responseText||this.responseXML)}function C(a){if(a.lengthComputable){var b=a.loaded/a.total*100|0;s("Uploading",b)}}function D(c,d,e){var f,g="";if(d&&"undefined"!=typeof d)for(f in d)d.hasOwnProperty(f)&&"link"!=f&&(g+=" data-"+f+'="'+d[f]+'"');var h=b.opts.imageDefaultWidth;h&&"auto"!=h&&(""+h).indexOf("px")<0&&(""+h).indexOf("%")<0&&(h+="px");var i=a('<img class="'+(b.opts.imageDefaultDisplay?"fr-di"+b.opts.imageDefaultDisplay[0]:"")+(b.opts.imageDefaultAlign&&"center"!=b.opts.imageDefaultAlign?" fr-fi"+b.opts.imageDefaultAlign[0]:"")+'" src="'+c+'"'+g+(h?' style="width: '+h+';"':"")+">");i.on("load",e),b.edit.on(),b.events.focus(!0),b.selection.restore(),b.undo.saveStep(),b.opts.imageSplitHTML?b.markers.split():b.markers.insert();var j=b.$el.find(".fr-marker");return j.replaceWith(i),b.html.wrap(),b.selection.clear(),i}function E(){b.edit.on(),r(!0)}function F(c,d,e){function f(){var e=a(this);e.off("load"),e.addClass("fr-uploading"),e.next().is("br")&&e.next().remove(),b.placeholder.refresh(),e.is(qa)||v(e),j(),q(),b.edit.off(),c.onload=function(){A.call(c,e)},c.onerror=B,c.upload.onprogress=C,c.onabort=E,e.off("abortUpload").on("abortUpload",function(){4!=c.readyState&&c.abort()}),c.send(d)}var g,h=new FileReader;h.addEventListener("load",function(){var a=h.result;if(h.result.indexOf("svg+xml")<0){for(var c=atob(h.result.split(",")[1]),d=[],e=0;e<c.length;e++)d.push(c.charCodeAt(e));a=window.URL.createObjectURL(new Blob([new Uint8Array(d)],{type:"image/jpeg"}))}qa?(qa.on("load",f),b.edit.on(),b.undo.saveStep(),qa.data("fr-old-src",qa.attr("src")),qa.attr("src",a)):g=D(a,null,f)},!1),h.readAsDataURL(e)}function G(a){if(b.events.trigger("image.beforeUpload",[a])===!1)return!1;if("undefined"!=typeof a&&a.length>0){var c=a[0];if(c.size>b.opts.imageMaxSize)return o(za),!1;if(b.opts.imageAllowedTypes.indexOf(c.type.replace(/image\//g,""))<0)return o(Aa),!1;var d;if(b.drag_support.formdata&&(d=b.drag_support.formdata?new FormData:null),d){var e;if(b.opts.imageUploadToS3!==!1){d.append("key",b.opts.imageUploadToS3.keyStart+(new Date).getTime()+"-"+(c.name||"untitled")),d.append("success_action_status","201"),d.append("X-Requested-With","xhr"),d.append("Content-Type",c.type);for(e in b.opts.imageUploadToS3.params)b.opts.imageUploadToS3.params.hasOwnProperty(e)&&d.append(e,b.opts.imageUploadToS3.params[e])}for(e in b.opts.imageUploadParams)b.opts.imageUploadParams.hasOwnProperty(e)&&d.append(e,b.opts.imageUploadParams[e]);d.append(b.opts.imageUploadParam,c);var f=b.opts.imageUploadURL;b.opts.imageUploadToS3&&(f="https://"+b.opts.imageUploadToS3.region+".amazonaws.com/"+b.opts.imageUploadToS3.bucket);var g=b.core.getXHR(f,b.opts.imageUploadMethod);F(g,d,c)}}}function H(c){b.events.$on(c,"dragover dragenter",".fr-image-upload-layer",function(){return a(this).addClass("fr-drop"),!1}),b.events.$on(c,"dragleave dragend",".fr-image-upload-layer",function(){return a(this).removeClass("fr-drop"),!1}),b.events.$on(c,"drop",".fr-image-upload-layer",function(d){d.preventDefault(),d.stopPropagation(),a(this).removeClass("fr-drop");var e=d.originalEvent.dataTransfer;if(e&&e.files){var f=c.data("instance")||b;f.events.disableBlur(),f.image.upload(e.files),f.events.enableBlur()}}),b.events.$on(c,"change",'.fr-image-upload-layer input[type="file"]',function(){if(this.files){var d=c.data("instance")||b;d.events.disableBlur(),c.find("input:focus").blur(),d.events.enableBlur(),d.image.upload(this.files)}a(this).val("")})}function I(c){var d=c.originalEvent.dataTransfer;if(d&&d.files&&d.files.length){var e=d.files[0];if(e&&e.type&&b.opts.imageAllowedTypes.indexOf(e.type.replace(/image\//g,""))>=0){b.markers.remove(),b.markers.insertAtPoint(c.originalEvent),b.$el.find(".fr-marker").replaceWith(a.FE.MARKERS),b.popups.hideAll();var f=b.popups.get("image.insert");return f||(f=L()),b.popups.setContainer("image.insert",a(b.opts.scrollableContainer)),b.popups.show("image.insert",c.originalEvent.pageX,c.originalEvent.pageY),q(),G(d.files),c.preventDefault(),c.stopPropagation(),!1}}}function J(){var c,d,e=b.selection.ranges(0);e.collapsed&&e.startContainer.nodeType==Node.ELEMENT_NODE&&(e.startContainer.childNodes.length==e.startOffset?(c=e.startContainer.childNodes[e.startOffset-1],c&&"IMG"==c.tagName&&"block"==a(c).css("display")&&(d=b.node.blockParent(c),d&&b.html.defaultTag()?d.nextSibling||(["TD","TH"].indexOf(d.tagName)<0?a(d).after("<"+b.html.defaultTag()+"><br>"+a.FE.MARKERS+"</"+b.html.defaultTag()+">"):a(img).after("<br>"+a.FE.MARKERS),b.selection.restore()):d||(a(c).after("<br>"+a.FE.MARKERS),b.selection.restore()))):0===e.startOffset&&e.startContainer.childNodes.length>e.startOffset&&(c=e.startContainer.childNodes[e.startOffset],c&&"IMG"==c.tagName&&"block"==a(c).css("display")&&(d=b.node.blockParent(c),d&&b.html.defaultTag()?d.previousSibling||(["TD","TH"].indexOf(d.tagName)<0?a(d).before("<"+b.html.defaultTag()+"><br>"+a.FE.MARKERS+"</"+b.html.defaultTag()+">"):a(img).before("<br>"+a.FE.MARKERS),b.selection.restore()):d||(a(c).before(a.FE.MARKERS+"<br>"),b.selection.restore()))))}function K(){b.events.$on(b.$el,b._mousedown,"IMG"==b.$el.get(0).tagName?null:'img:not([contenteditable="false"])',function(c){return a(this).parents('[contenteditable="false"]:not(.fr-element):not(body)').length?!0:(b.selection.clear(),ua=!0,b.browser.msie&&(b.events.disableBlur(),b.$el.attr("contenteditable",!1)),b.draggable||c.preventDefault(),void c.stopPropagation())}),b.events.$on(b.$el,b._mouseup,"IMG"==b.$el.get(0).tagName?null:'img:not([contenteditable="false"])',function(c){return a(this).parents('[contenteditable="false"]:not(.fr-element):not(body)').length?!0:void(ua&&(ua=!1,c.stopPropagation(),b.browser.msie&&(b.$el.attr("contenteditable",!0),b.events.enableBlur())))}),b.events.on("keyup",function(c){if(c.shiftKey&&""===b.selection.text().replace(/\n/g,"")){var d=b.selection.element(),e=b.selection.endElement();d&&"IMG"==d.tagName?v(a(d)):e&&"IMG"==e.tagName&&v(a(e))}},!0),b.events.on("drop",I),b.events.on("mousedown window.mousedown",da),b.events.on("window.touchmove",ea),b.events.on("mouseup window.mouseup",function(){return qa?(ca(),!1):void 0}),b.events.on("commands.mousedown",function(a){a.parents(".fr-toolbar").length>0&&ca()}),b.events.on("mouseup",J),b.events.on("blur image.hideResizer commands.undo commands.redo element.dropped",function(){ua=!1,ca(!0)})}function L(a){if(a)return b.popups.onRefresh("image.insert",c),b.popups.onHide("image.insert",f),!0;var d,e="";b.opts.imageInsertButtons.length>1&&(e='<div class="fr-buttons">'+b.button.buildList(b.opts.imageInsertButtons)+"</div>");var g=b.opts.imageInsertButtons.indexOf("imageUpload"),h=b.opts.imageInsertButtons.indexOf("imageByURL"),i="";g>=0&&(d=" fr-active",h>=0&&g>h&&(d=""),i='<div class="fr-image-upload-layer'+d+' fr-layer" id="fr-image-upload-layer-'+b.id+'"><strong>'+b.language.translate("Drop image")+"</strong><br>("+b.language.translate("or click")+')<div class="fr-form"><input type="file" accept="image/'+b.opts.imageAllowedTypes.join(", image/").toLowerCase()+'" tabIndex="-1"></div></div>');var j="";h>=0&&(d=" fr-active",g>=0&&h>g&&(d=""),j='<div class="fr-image-by-url-layer'+d+' fr-layer" id="fr-image-by-url-layer-'+b.id+'"><div class="fr-input-line"><input type="text" placeholder="http://" tabIndex="1"></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-submit" data-cmd="imageInsertByURL" tabIndex="2">'+b.language.translate("Insert")+"</button></div></div>");var k='<div class="fr-image-progress-bar-layer fr-layer"><h3 class="fr-message">Uploading</h3><div class="fr-loader"><span class="fr-progress"></span></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-back" data-cmd="imageDismissError" tabIndex="2">OK</button></div></div>',l={buttons:e,upload_layer:i,by_url_layer:j,progress_bar:k},m=b.popups.create("image.insert",l);return b.$wp&&b.events.$on(b.$wp,"scroll",function(){qa&&b.popups.isVisible("image.insert")&&la()}),H(m),m}function M(){if(qa){var a=b.popups.get("image.alt");a.find("input").val(qa.attr("alt")||"").trigger("change")}}function N(){var c=b.popups.get("image.alt");c||(c=O()),r(),b.popups.refresh("image.alt"),b.popups.setContainer("image.alt",a(b.opts.scrollableContainer));var d=qa.offset().left+qa.width()/2,e=qa.offset().top+qa.height();b.popups.show("image.alt",d,e,qa.outerHeight())}function O(a){if(a)return b.popups.onRefresh("image.alt",M),!0;var c="";c='<div class="fr-buttons">'+b.button.buildList(b.opts.imageAltButtons)+"</div>";var d="";d='<div class="fr-image-alt-layer fr-layer fr-active" id="fr-image-alt-layer-'+b.id+'"><div class="fr-input-line"><input type="text" placeholder="'+b.language.translate("Alternate Text")+'" tabIndex="1"></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-submit" data-cmd="imageSetAlt" tabIndex="2">'+b.language.translate("Update")+"</button></div></div>";var e={buttons:c,alt_layer:d},f=b.popups.create("image.alt",e);return b.$wp&&b.events.$on(b.$wp,"scroll.image-alt",function(){qa&&b.popups.isVisible("image.alt")&&N()}),f}function P(a){if(qa){var c=b.popups.get("image.alt");qa.attr("alt",a||c.find("input").val()||""),c.find("input:focus").blur(),v(qa)}}function Q(){if(qa){var a=b.popups.get("image.size");a.find('input[name="width"]').val(qa.get(0).style.width).trigger("change"),a.find('input[name="height"]').val(qa.get(0).style.height).trigger("change")}}function R(){var c=b.popups.get("image.size");c||(c=S()),r(),b.popups.refresh("image.size"),b.popups.setContainer("image.size",a(b.opts.scrollableContainer));var d=qa.offset().left+qa.width()/2,e=qa.offset().top+qa.height();b.popups.show("image.size",d,e,qa.outerHeight())}function S(a){if(a)return b.popups.onRefresh("image.size",Q),!0;var c="";c='<div class="fr-buttons">'+b.button.buildList(b.opts.imageSizeButtons)+"</div>";var d="";d='<div class="fr-image-size-layer fr-layer fr-active" id="fr-image-size-layer-'+b.id+'"><div class="fr-image-group"><div class="fr-input-line"><input type="text" name="width" placeholder="'+b.language.translate("Width")+'" tabIndex="1"></div><div class="fr-input-line"><input type="text" name="height" placeholder="'+b.language.translate("Height")+'" tabIndex="1"></div></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-submit" data-cmd="imageSetSize" tabIndex="2">'+b.language.translate("Update")+"</button></div></div>";var e={buttons:c,size_layer:d},f=b.popups.create("image.size",e);return b.$wp&&b.events.$on(b.$wp,"scroll.image-size",function(){qa&&b.popups.isVisible("image.size")&&R()}),f}function T(a,c){if(qa){var d=b.popups.get("image.size");qa.css("width",a||d.find('input[name="width"]').val()),qa.css("height",c||d.find('input[name="height"]').val()),d.find("input:focus").blur(),v(qa)}}function U(a){var c,d,e=b.popups.get("image.insert");if(qa||b.opts.toolbarInline)qa&&(d=qa.offset().top+qa.outerHeight());else{var f=b.$tb.find('.fr-command[data-cmd="insertImage"]');c=f.offset().left+f.outerWidth()/2,d=f.offset().top+(b.opts.toolbarBottom?10:f.outerHeight()-10)}!qa&&b.opts.toolbarInline&&(d=e.offset().top-b.helpers.getPX(e.css("margin-top")),e.hasClass("fr-above")&&(d+=e.outerHeight())),e.find(".fr-layer").removeClass("fr-active"),e.find(".fr-"+a+"-layer").addClass("fr-active"),b.popups.show("image.insert",c,d,qa?qa.outerHeight():0)}function V(a){var c=b.popups.get("image.insert");c.find(".fr-image-upload-layer").hasClass("fr-active")&&a.addClass("fr-active")}function W(a){var c=b.popups.get("image.insert");c.find(".fr-image-by-url-layer").hasClass("fr-active")&&a.addClass("fr-active")}function X(){var c;b.shared.$image_resizer?(ra=b.shared.$image_resizer,ta=b.shared.$img_overlay,b.events.on("destroy",function(){ra.removeClass("fr-active").appendTo(a("body"))},!0)):(b.shared.$image_resizer=a('<div class="fr-image-resizer"></div>'),ra=b.shared.$image_resizer,b.events.$on(ra,"mousedown",function(a){a.stopPropagation()},!0),b.opts.imageResize&&(ra.append(k("nw")+k("ne")+k("sw")+k("se")),b.shared.$img_overlay=a('<div class="fr-image-overlay"></div>'),ta=b.shared.$img_overlay,c=ra.get(0).ownerDocument,a(c).find("body").append(ta))),b.events.on("shared.destroy",function(){ra.html("").removeData().remove(),ra=null,b.opts.imageResize&&(ta.remove(),ta=null)},!0),b.helpers.isMobile()||b.events.$on(a(b.o_win),"resize",function(){qa&&!qa.hasClass("fr-uploading")?ca(!0):qa&&(j(),la(),q(!1))}),b.opts.imageResize&&(c=ra.get(0).ownerDocument,b.events.$on(ra,b._mousedown,".fr-handler",l),b.events.$on(a(c),b._mousemove,m),b.events.$on(a(c.defaultView||c.parentWindow),b._mouseup,n),b.events.$on(ta,"mouseleave",n))}function Y(c){c=c||qa,c&&b.events.trigger("image.beforeRemove",[c])!==!1&&(b.popups.hideAll(),ca(!0),c.get(0)==b.$el.get(0)?c.removeAttr("src"):("A"==c.get(0).parentNode.tagName?(b.selection.setBefore(c.get(0).parentNode)||b.selection.setAfter(c.get(0).parentNode)||c.parent().after(a.FE.MARKERS),a(c.get(0).parentNode).remove()):(b.selection.setBefore(c.get(0))||b.selection.setAfter(c.get(0))||c.after(a.FE.MARKERS),c.remove()),b.html.fillEmptyBlocks(),b.selection.restore()),b.undo.saveStep())}function Z(){if(K(),"IMG"==b.$el.get(0).tagName&&b.$el.addClass("fr-view"),b.events.$on(b.$el,b.helpers.isMobile()&&!b.helpers.isWindowsPhone()?"touchend":"click","IMG"==b.$el.get(0).tagName?null:'img:not([contenteditable="false"])',ba),b.helpers.isMobile()&&(b.events.$on(b.$el,"touchstart","IMG"==b.$el.get(0).tagName?null:'img:not([contenteditable="false"])',function(){Ea=!1}),b.events.$on(b.$el,"touchmove",function(){Ea=!0})),b.events.on("window.keydown keydown",function(c){var d=c.which;if(qa&&(d==a.FE.KEYCODE.BACKSPACE||d==a.FE.KEYCODE.DELETE))return c.preventDefault(),c.stopPropagation(),Y(),!1;if(qa&&d==a.FE.KEYCODE.ESC){var e=qa;return ca(!0),b.selection.setAfter(e.get(0)),b.selection.restore(),c.preventDefault(),!1}return qa&&!b.keys.ctrlKey(c)?(c.preventDefault(),!1):void 0},!0),b.events.$on(a(b.o_win),"keydown",function(b){var c=b.which;return qa&&c==a.FE.KEYCODE.BACKSPACE?(b.preventDefault(),!1):void 0}),b.events.$on(b.$win,"keydown",function(b){var c=b.which;qa&&qa.hasClass("fr-uploading")&&c==a.FE.KEYCODE.ESC&&qa.trigger("abortUpload")}),b.events.on("destroy",function(){qa&&qa.hasClass("fr-uploading")&&qa.trigger("abortUpload")}),b.events.on("paste.before",_),b.events.on("paste.beforeCleanup",aa),b.events.on("paste.after",$),b.events.on("html.set",h),b.events.on("html.inserted",h),h(),b.events.on("destroy",function(){Da=[]}),b.events.on("html.get",function(a){return a=a.replace(/<(img)((?:[\w\W]*?))class="([\w\W]*?)(fr-uploading|fr-error)([\w\W]*?)"((?:[\w\W]*?))>/g,"")}),b.opts.imageOutputSize){var c;b.events.on("html.beforeGet",function(){c=b.$el.get(0).querySelectorAll("img");for(var d=0;d<c.length;d++)c[d].setAttribute("width",a(c[d]).width()),c[d].setAttribute("height",a(c[d]).height())}),b.events.on("html.afterGet",function(){for(var a=0;a<c.length;a++)c[a].removeAttribute("width"),c[a].removeAttribute("height")})}b.opts.iframe&&b.events.on("image.loaded",b.size.syncIframe),b.$wp&&(i(),b.events.on("contentChanged",i)),b.events.$on(a(b.o_win),"orientationchange.image",function(){setTimeout(function(){var a=oa();a&&v(a)},0)}),p(!0),L(!0),S(!0),O(!0),b.events.on("node.remove",function(a){return"IMG"==a.get(0).tagName?(Y(a),!1):void 0})}function $(){b.opts.imagePaste?b.$el.find("img[data-fr-image-pasted]").each(function(c,d){if(b.opts.imagePasteProcess){var f=b.opts.imageDefaultWidth;f&&"auto"!=f&&(f+=b.opts.imageResizeWithPercent?"%":"px"),a(d).css("width",f),a(d).removeClass("fr-dii fr-dib fr-fir fr-fil").addClass((b.opts.imageDefaultDisplay?"fr-di"+b.opts.imageDefaultDisplay[0]:"")+(b.opts.imageDefaultAlign&&"center"!=b.opts.imageDefaultAlign?" fr-fi"+b.opts.imageDefaultAlign[0]:""))}if(0===d.src.indexOf("data:")){if(b.events.trigger("image.beforePasteUpload",[d])===!1)return!1;qa=a(d),j(),e(),la(),q(),b.edit.off();for(var g=atob(a(d).attr("src").split(",")[1]),h=[],i=0;i<g.length;i++)h.push(g.charCodeAt(i));var k=new Blob([new Uint8Array(h)],{type:"image/jpeg"});G([k]),a(d).removeAttr("data-fr-image-pasted")}else 0!==d.src.indexOf("http")?(b.selection.save(),a(d).remove(),b.selection.restore()):a(d).removeAttr("data-fr-image-pasted")}):b.$el.find("img[data-fr-image-pasted]").remove()}function _(a){if(a&&a.clipboardData&&a.clipboardData.items&&a.clipboardData.items[0]){var c=a.clipboardData.items[0].getAsFile();if(c){var d=new FileReader;return d.onload=function(a){var c=a.target.result,d=b.opts.imageDefaultWidth;d&&"auto"!=d&&(""+d).indexOf("px")<0&&(""+d).indexOf("%")<0&&(d+="px"),b.html.insert('<img data-fr-image-pasted="true" class="'+(b.opts.imageDefaultDisplay?"fr-di"+b.opts.imageDefaultDisplay[0]:"")+(b.opts.imageDefaultAlign&&"center"!=b.opts.imageDefaultAlign?" fr-fi"+b.opts.imageDefaultAlign[0]:"")+'" src="'+c+'"'+(d?' style="width: '+d+';"':"")+">"),b.events.trigger("paste.after")},d.readAsDataURL(c),!1}}}function aa(a){return a=a.replace(/<img /gi,'<img data-fr-image-pasted="true" ')}function ba(c){if(a(this).parents('[contenteditable="false"]:not(.fr-element):not(body)').length)return!0;if(c&&"touchend"==c.type&&Ea)return!0;if(c&&b.edit.isDisabled())return c.stopPropagation(),c.preventDefault(),!1;for(var d=0;d<a.FE.INSTANCES.length;d++)a.FE.INSTANCES[d]!=b&&a.FE.INSTANCES[d].events.trigger("image.hideResizer");b.toolbar.disable(),c&&(c.stopPropagation(),c.preventDefault()),b.helpers.isMobile()&&(b.events.disableBlur(),b.$el.blur(),b.events.enableBlur()),b.opts.iframe&&b.size.syncIframe(),qa=a(this),ma(),j(),e(),b.selection.clear(),b.button.bulkRefresh(),b.events.trigger("video.hideResizer")}function ca(a){qa&&(fa()||a===!0)&&(b.toolbar.enable(),ra.removeClass("fr-active"),b.popups.hide("image.edit"),qa=null,ea())}function da(){Fa=!0}function ea(){Fa=!1}function fa(){return Fa}function ga(a){qa.removeClass("fr-fir fr-fil"),"left"==a?qa.addClass("fr-fil"):"right"==a&&qa.addClass("fr-fir"),j(),e()}function ha(a){qa&&(qa.hasClass("fr-fil")?a.find("> *:first").replaceWith(b.icon.create("align-left")):qa.hasClass("fr-fir")?a.find("> *:first").replaceWith(b.icon.create("align-right")):a.find("> *:first").replaceWith(b.icon.create("align-justify")))}function ia(a,b){if(qa){var c="justify";qa.hasClass("fr-fil")?c="left":qa.hasClass("fr-fir")&&(c="right"),b.find('.fr-command[data-param1="'+c+'"]').addClass("fr-active")}}function ja(a){qa.removeClass("fr-dii fr-dib"),"inline"==a?qa.addClass("fr-dii"):"block"==a&&qa.addClass("fr-dib"),j(),e()}function ka(a,b){var c="block";qa.hasClass("fr-dii")&&(c="inline"),b.find('.fr-command[data-param1="'+c+'"]').addClass("fr-active")}function la(){var c=b.popups.get("image.insert");c||(c=L()),b.popups.isVisible("image.insert")||(r(),b.popups.refresh("image.insert"),b.popups.setContainer("image.insert",a(b.opts.scrollableContainer)));var d=qa.offset().left+qa.width()/2,e=qa.offset().top+qa.height();b.popups.show("image.insert",d,e,qa.outerHeight())}function ma(){if(qa){b.selection.clear();var a=b.doc.createRange();a.selectNode(qa.get(0));var c=b.selection.get();c.addRange(a)}}function na(){qa?(a(".fr-popup input:focus").blur(),v(qa)):(b.events.disableBlur(),b.selection.restore(),b.events.enableBlur(),b.popups.hide("image.insert"),b.toolbar.showInline())}function oa(){return qa}function pa(a,c,d){if("undefined"==typeof c&&(c=b.opts.imageStyles),"undefined"==typeof d&&(d=b.opts.imageMultipleStyles),!qa)return!1;if(!d){var e=Object.keys(c);e.splice(e.indexOf(a),1),qa.removeClass(e.join(" "))}qa.toggleClass(a),v(qa)}var qa,ra,sa,ta,ua=!1,va=1,wa=2,xa=3,ya=4,za=5,Aa=6,Ba=7,Ca={};Ca[va]="Image cannot be loaded from the passed link.",Ca[wa]="No link in upload response.",Ca[xa]="Error during file upload.",Ca[ya]="Parsing response failed.",Ca[za]="File is too large.",Ca[Aa]="Image file type is invalid.",Ca[Ba]="Files can be uploaded only to same domain in IE 8 and IE 9.";var Da,Ea,Fa=!1;return{_init:Z,showInsertPopup:d,showLayer:U,refreshUploadButton:V,refreshByURLButton:W,upload:G,insertByURL:u,align:ga,refreshAlign:ha,refreshAlignOnShow:ia,display:ja,refreshDisplayOnShow:ka,replace:la,back:na,get:oa,insert:x,showProgressBar:q,remove:Y,hideProgressBar:r,applyStyle:pa,showAltPopup:N,showSizePopup:R,setAlt:P,setSize:T,exitEdit:ca,edit:v}},a.FE.DefineIcon("insertImage",{NAME:"image"}),a.FE.RegisterShortcut(a.FE.KEYCODE.P,"insertImage",null,"P"),a.FE.RegisterCommand("insertImage",{title:"Insert Image",undo:!1,focus:!0,refreshAfterCallback:!1,popup:!0,callback:function(){this.popups.isVisible("image.insert")?(this.$el.find(".fr-marker")&&(this.events.disableBlur(),this.selection.restore()),this.popups.hide("image.insert")):this.image.showInsertPopup()},plugin:"image"}),a.FE.DefineIcon("imageUpload",{NAME:"upload"}),a.FE.RegisterCommand("imageUpload",{title:"Upload Image",undo:!1,focus:!1,callback:function(){this.image.showLayer("image-upload")},refresh:function(a){this.image.refreshUploadButton(a)}}),a.FE.DefineIcon("imageByURL",{NAME:"link"}),a.FE.RegisterCommand("imageByURL",{title:"By URL",undo:!1,focus:!1,callback:function(){this.image.showLayer("image-by-url")},refresh:function(a){this.image.refreshByURLButton(a)}}),a.FE.RegisterCommand("imageInsertByURL",{title:"Insert Image",undo:!0,refreshAfterCallback:!1,callback:function(){this.image.insertByURL()},refresh:function(a){var b=this.image.get();b?a.text(this.language.translate("Replace")):a.text(this.language.translate("Insert"))}}),a.FE.DefineIcon("imageDisplay",{NAME:"star"}),a.FE.RegisterCommand("imageDisplay",{title:"Display",type:"dropdown",options:{inline:"Inline",block:"Break Text"},callback:function(a,b){this.image.display(b)},refresh:function(a){this.opts.imageTextNear||a.addClass("fr-hidden")},refreshOnShow:function(a,b){this.image.refreshDisplayOnShow(a,b)}}),a.FE.DefineIcon("imageAlign",{NAME:"align-center"}),a.FE.RegisterCommand("imageAlign",{type:"dropdown",title:"Align",options:{left:"Align Left",justify:"None",right:"Align Right"},html:function(){var b='<ul class="fr-dropdown-list">',c=a.FE.COMMANDS.imageAlign.options;for(var d in c)c.hasOwnProperty(d)&&(b+='<li><a class="fr-command fr-title" data-cmd="imageAlign" data-param1="'+d+'" title="'+this.language.translate(c[d])+'">'+this.icon.create("align-"+d)+"</a></li>");return b+="</ul>"},callback:function(a,b){this.image.align(b)},refresh:function(a){this.image.refreshAlign(a); | ||
},refreshOnShow:function(a,b){this.image.refreshAlignOnShow(a,b)}}),a.FE.DefineIcon("imageReplace",{NAME:"exchange"}),a.FE.RegisterCommand("imageReplace",{title:"Replace",undo:!1,focus:!1,refreshAfterCallback:!1,callback:function(){this.image.replace()}}),a.FE.DefineIcon("imageRemove",{NAME:"trash"}),a.FE.RegisterCommand("imageRemove",{title:"Remove",callback:function(){this.image.remove()}}),a.FE.DefineIcon("imageBack",{NAME:"arrow-left"}),a.FE.RegisterCommand("imageBack",{title:"Back",undo:!1,focus:!1,back:!0,callback:function(){this.image.back()},refresh:function(a){var b=this.image.get();b||this.opts.toolbarInline?(a.removeClass("fr-hidden"),a.next(".fr-separator").removeClass("fr-hidden")):(a.addClass("fr-hidden"),a.next(".fr-separator").addClass("fr-hidden"))}}),a.FE.RegisterCommand("imageDismissError",{title:"OK",undo:!1,callback:function(){this.image.hideProgressBar(!0)}}),a.FE.DefineIcon("imageStyle",{NAME:"magic"}),a.FE.RegisterCommand("imageStyle",{title:"Style",type:"dropdown",html:function(){var a='<ul class="fr-dropdown-list">',b=this.opts.imageStyles;for(var c in b)b.hasOwnProperty(c)&&(a+='<li><a class="fr-command" data-cmd="imageStyle" data-param1="'+c+'">'+this.language.translate(b[c])+"</a></li>");return a+="</ul>"},callback:function(a,b){this.image.applyStyle(b)},refreshOnShow:function(b,c){var d=this.image.get();d&&c.find(".fr-command").each(function(){var b=a(this).data("param1");a(this).toggleClass("fr-active",d.hasClass(b))})}}),a.FE.DefineIcon("imageAlt",{NAME:"info"}),a.FE.RegisterCommand("imageAlt",{undo:!1,focus:!1,title:"Alternate Text",callback:function(){this.image.showAltPopup()}}),a.FE.RegisterCommand("imageSetAlt",{undo:!0,focus:!1,title:"Update",refreshAfterCallback:!1,callback:function(){this.image.setAlt()}}),a.FE.DefineIcon("imageSize",{NAME:"arrows-alt"}),a.FE.RegisterCommand("imageSize",{undo:!1,focus:!1,title:"Change Size",callback:function(){this.image.showSizePopup()}}),a.FE.RegisterCommand("imageSetSize",{undo:!0,focus:!1,title:"Update",refreshAfterCallback:!1,callback:function(){this.image.setSize()}})}); | ||
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=function(b,c){return void 0===c&&(c="undefined"!=typeof window?require("jquery"):require("jquery")(b)),a(c),c}:a(jQuery)}(function(a){"use strict";a.extend(a.FE.POPUP_TEMPLATES,{"image.insert":"[_BUTTONS_][_UPLOAD_LAYER_][_BY_URL_LAYER_][_PROGRESS_BAR_]","image.edit":"[_BUTTONS_]","image.alt":"[_BUTTONS_][_ALT_LAYER_]","image.size":"[_BUTTONS_][_SIZE_LAYER_]"}),a.extend(a.FE.DEFAULTS,{imageInsertButtons:["imageBack","|","imageUpload","imageByURL"],imageEditButtons:["imageReplace","imageAlign","imageRemove","|","imageLink","linkOpen","linkEdit","linkRemove","-","imageDisplay","imageStyle","imageAlt","imageSize"],imageAltButtons:["imageBack","|"],imageSizeButtons:["imageBack","|"],imageUploadURL:"https://i.froala.com/upload",imageUploadParam:"file",imageUploadParams:{},imageUploadToS3:!1,imageUploadMethod:"POST",imageMaxSize:10485760,imageAllowedTypes:["jpeg","jpg","png","gif","svg+xml"],imageResize:!0,imageResizeWithPercent:!1,imageRoundPercent:!1,imageDefaultWidth:300,imageDefaultAlign:"center",imageDefaultDisplay:"block",imageSplitHTML:!1,imageStyles:{"fr-rounded":"Rounded","fr-bordered":"Bordered"},imageMove:!0,imageMultipleStyles:!0,imageTextNear:!0,imagePaste:!0,imagePasteProcess:!1,imageMinWidth:16,imageOutputSize:!1}),a.FE.PLUGINS.image=function(b){function c(){var a=b.popups.get("image.insert"),c=a.find(".fr-image-by-url-layer input");c.val(""),qa&&c.val(qa.attr("src")),c.trigger("change")}function d(){var a=b.$tb.find('.fr-command[data-cmd="insertImage"]'),c=b.popups.get("image.insert");if(c||(c=L()),r(),!c.hasClass("fr-active"))if(b.popups.refresh("image.insert"),b.popups.setContainer("image.insert",b.$tb),a.is(":visible")){var d=a.offset().left+a.outerWidth()/2,e=a.offset().top+(b.opts.toolbarBottom?10:a.outerHeight()-10);b.popups.show("image.insert",d,e,a.outerHeight())}else b.position.forSelection(c),b.popups.show("image.insert")}function e(){var c=b.popups.get("image.edit");c||(c=p()),b.popups.setContainer("image.edit",a(b.opts.scrollableContainer)),b.popups.refresh("image.edit");var d=qa.offset().left+qa.outerWidth()/2,e=qa.offset().top+qa.outerHeight();b.popups.show("image.edit",d,e,qa.outerHeight())}function f(){r()}function g(a){if(!a.hasClass("fr-dii")&&!a.hasClass("fr-dib")){var c=a.css("float");a.css("float","none"),"block"==a.css("display")?(a.css("float",c),b.opts.imageEditButtons.indexOf("imageAlign")>=0&&(0===parseInt(a.css("margin-left"),10)&&(a.attr("style")||"").indexOf("margin-right: auto")>=0?a.addClass("fr-fil"):0===parseInt(a.css("margin-right"),10)&&(a.attr("style")||"").indexOf("margin-left: auto")>=0&&a.addClass("fr-fir")),a.addClass("fr-dib")):(a.css("float",c),b.opts.imageEditButtons.indexOf("imageAlign")>=0&&("left"==a.css("float")?a.addClass("fr-fil"):"right"==a.css("float")&&a.addClass("fr-fir")),a.addClass("fr-dii")),a.css("margin",""),a.css("float",""),a.css("display",""),a.css("z-index",""),a.css("position",""),a.css("overflow",""),a.css("vertical-align","")}}function h(){for(var c="IMG"==b.$el.get(0).tagName?[b.$el.get(0)]:b.$el.get(0).querySelectorAll("img"),d=0;d<c.length;d++){var e=a(c[d]);(b.opts.imageEditButtons.indexOf("imageAlign")>=0||b.opts.imageEditButtons.indexOf("imageDisplay")>=0)&&g(e),e.attr("width")&&(e.css("width",e.width()),e.removeAttr("width")),b.opts.imageTextNear||e.removeClass("fr-dii").addClass("fr-dib"),b.opts.iframe&&e.on("load",b.size.syncIframe)}}function i(){var c,d=Array.prototype.slice.call(b.$el.get(0).querySelectorAll("img")),e=[];for(c=0;c<d.length;c++)e.push(d[c].getAttribute("src")),a(d[c]).toggleClass("fr-draggable",b.opts.imageMove),""===d[c].className&&d[c].removeAttribute("class"),""===d[c].getAttribute("style")&&d[c].removeAttribute("style");if(Da)for(c=0;c<Da.length;c++)e.indexOf(Da[c].getAttribute("src"))<0&&b.events.trigger("image.removed",[a(Da[c])]);Da=d}function j(){ra||X();var c=b.$wp||a(b.opts.scrollableContainer);c.append(ra),ra.data("instance",b);var d=c.scrollTop()-("static"!=c.css("position")?c.offset().top:0),e=c.scrollLeft()-("static"!=c.css("position")?c.offset().left:0);e-=b.helpers.getPX(c.css("border-left-width")),d-=b.helpers.getPX(c.css("border-top-width")),ra.css("top",(b.opts.iframe?qa.offset().top:qa.offset().top+d)-1).css("left",(b.opts.iframe?qa.offset().left:qa.offset().left+e)-1).css("width",qa.get(0).getBoundingClientRect().width).css("height",qa.get(0).getBoundingClientRect().height).addClass("fr-active")}function k(a){return'<div class="fr-handler fr-h'+a+'"></div>'}function l(c){if(!b.core.sameInstance(ra))return!0;if(c.preventDefault(),c.stopPropagation(),b.$el.find("img.fr-error").left)return!1;b.undo.canDo()||b.undo.saveStep(),sa=a(this),sa.data("start-x",c.pageX||c.originalEvent.touches[0].pageX),sa.data("start-width",qa.width()),sa.data("start-height",qa.height());var d=qa.width();if(b.opts.imageResizeWithPercent){var e=qa.parentsUntil(b.$el,b.html.blockTagsQuery()).get(0)||b.$el.get(0);qa.css("width",(d/a(e).outerWidth()*100).toFixed(2)+"%")}else qa.css("width",d);ta.show(),b.popups.hideAll(),ea()}function m(c){if(!b.core.sameInstance(ra))return!0;if(sa&&qa){if(c.preventDefault(),b.$el.find("img.fr-error").left)return!1;var d=c.pageX||(c.originalEvent.touches?c.originalEvent.touches[0].pageX:null);if(!d)return!1;var e=sa.data("start-x"),f=d-e,g=sa.data("start-width");if((sa.hasClass("fr-hnw")||sa.hasClass("fr-hsw"))&&(f=0-f),b.opts.imageResizeWithPercent){var h=qa.parentsUntil(b.$el,b.html.blockTagsQuery()).get(0)||b.$el.get(0);g=((g+f)/a(h).outerWidth()*100).toFixed(2),b.opts.imageRoundPercent&&(g=Math.round(g)),qa.css("width",g+"%"),qa.css("height","").removeAttr("height")}else g+f>=b.opts.imageMinWidth&&qa.css("width",g+f),qa.css("height",sa.data("start-height")*qa.width()/sa.data("start-width"));j(),b.events.trigger("image.resize",[oa()])}}function n(a){if(!b.core.sameInstance(ra))return!0;if(sa&&qa){if(a&&a.stopPropagation(),b.$el.find("img.fr-error").left)return!1;sa=null,ta.hide(),j(),e(),b.undo.saveStep(),b.events.trigger("image.resizeEnd",[oa()])}}function o(a,c){b.edit.on(),qa&&qa.addClass("fr-error"),t(b.language.translate("Something went wrong. Please try again.")),b.events.trigger("image.error",[{code:a,message:Ca[a]},c])}function p(a){if(a)return b.$wp&&b.events.$on(b.$wp,"scroll",function(){qa&&b.popups.isVisible("image.edit")&&e()}),!0;var c="";b.opts.imageEditButtons.length>0&&(c+='<div class="fr-buttons">',c+=b.button.buildList(b.opts.imageEditButtons),c+="</div>");var d={buttons:c},f=b.popups.create("image.edit",d);return f}function q(c){var d=b.popups.get("image.insert");if(d||(d=L()),d.find(".fr-layer.fr-active").removeClass("fr-active").addClass("fr-pactive"),d.find(".fr-image-progress-bar-layer").addClass("fr-active"),d.find(".fr-buttons").hide(),qa){b.popups.setContainer("image.insert",a(b.opts.scrollableContainer));var e=qa.offset().left+qa.width()/2,f=qa.offset().top+qa.height();b.popups.show("image.insert",e,f,qa.outerHeight())}"undefined"==typeof c&&s("Uploading",0)}function r(a){var c=b.popups.get("image.insert");c&&(c.find(".fr-layer.fr-pactive").addClass("fr-active").removeClass("fr-pactive"),c.find(".fr-image-progress-bar-layer").removeClass("fr-active"),c.find(".fr-buttons").show(),(a||b.$el.find("img.fr-error").length)&&(b.events.focus(),b.$el.find("img.fr-error").remove(),b.undo.saveStep(),b.undo.run(),b.undo.dropRedo()))}function s(a,c){var d=b.popups.get("image.insert");if(d){var e=d.find(".fr-image-progress-bar-layer");e.find("h3").text(a+(c?" "+c+"%":"")),e.removeClass("fr-error"),c?(e.find("div").removeClass("fr-indeterminate"),e.find("div > span").css("width",c+"%")):e.find("div").addClass("fr-indeterminate")}}function t(a){q();var c=b.popups.get("image.insert"),d=c.find(".fr-image-progress-bar-layer");d.addClass("fr-error"),d.find("h3").text(a)}function u(){var a=b.popups.get("image.insert"),c=a.find(".fr-image-by-url-layer input");c.val().length>0&&(q(),s("Loading image"),x(b.helpers.sanitizeURL(c.val()),!0,[],qa),c.val(""),c.blur())}function v(a){ba.call(a.get(0))}function w(){var c=a(this);b.popups.hide("image.insert"),c.removeClass("fr-uploading"),c.next().is("br")&&c.next().remove(),v(c),b.events.trigger("image.loaded",[c])}function x(a,c,d,e,f){b.edit.off(),s("Loading image");var g=new Image;g.onload=function(){var c,g;if(e){var h=e.data("fr-old-src");b.$wp?(c=e.clone().removeData("fr-old-src").removeClass("fr-uploading"),c.off("load"),h&&e.attr("src",h),e.replaceWith(c)):c=e;for(var j=c.get(0).attributes,k=0;k<j.length;k++){var l=j[k];0===l.nodeName.indexOf("data-")&&c.removeAttr(l.nodeName)}if("undefined"!=typeof d)for(g in d)d.hasOwnProperty(g)&&"link"!=g&&c.attr("data-"+g,d[g]);c.on("load",w),c.attr("src",a),b.edit.on(),i(),b.undo.saveStep(),b.events.trigger(h?"image.replaced":"image.inserted",[c,f])}else c=D(a,d,w),i(),b.undo.saveStep(),b.events.trigger("image.inserted",[c,f])},g.onerror=function(){o(va)},g.src=a}function y(c){try{if(b.events.trigger("image.uploaded",[c],!0)===!1)return b.edit.on(),!1;var d=a.parseJSON(c);return d.link?d:(o(wa,c),!1)}catch(e){return o(ya,c),!1}}function z(c){try{var d=a(c).find("Location").text(),e=a(c).find("Key").text();return b.events.trigger("image.uploadedToS3",[d,e,c],!0)===!1?(b.edit.on(),!1):d}catch(f){return o(ya,c),!1}}function A(a){s("Loading image");var c=this.status,d=this.response,e=this.responseXML,f=this.responseText;try{if(b.opts.imageUploadToS3)if(201==c){var g=z(e);g&&x(g,!1,[],a,d||e)}else o(ya,d||e);else if(c>=200&&300>c){var h=y(f);h&&x(h.link,!1,h,a,d||f)}else o(xa,d||f)}catch(i){o(ya,d||f)}}function B(){o(ya,this.response||this.responseText||this.responseXML)}function C(a){if(a.lengthComputable){var b=a.loaded/a.total*100|0;s("Uploading",b)}}function D(c,d,e){var f,g="";if(d&&"undefined"!=typeof d)for(f in d)d.hasOwnProperty(f)&&"link"!=f&&(g+=" data-"+f+'="'+d[f]+'"');var h=b.opts.imageDefaultWidth;h&&"auto"!=h&&(h+=b.opts.imageResizeWithPercent?"%":"px");var i=a('<img class="'+(b.opts.imageDefaultDisplay?"fr-di"+b.opts.imageDefaultDisplay[0]:"")+(b.opts.imageDefaultAlign&&"center"!=b.opts.imageDefaultAlign?" fr-fi"+b.opts.imageDefaultAlign[0]:"")+'" src="'+c+'"'+g+(h?' style="width: '+h+';"':"")+">");i.on("load",e),b.edit.on(),b.events.focus(!0),b.selection.restore(),b.undo.saveStep(),b.opts.imageSplitHTML?b.markers.split():b.markers.insert();var j=b.$el.find(".fr-marker");return j.replaceWith(i),b.html.wrap(),b.selection.clear(),i}function E(){b.edit.on(),r(!0)}function F(c,d,e){function f(){var e=a(this);e.off("load"),e.addClass("fr-uploading"),e.next().is("br")&&e.next().remove(),b.placeholder.refresh(),e.is(qa)||v(e),j(),q(),b.edit.off(),c.onload=function(){A.call(c,e)},c.onerror=B,c.upload.onprogress=C,c.onabort=E,e.off("abortUpload").on("abortUpload",function(){4!=c.readyState&&c.abort()}),c.send(d)}var g,h=new FileReader;h.addEventListener("load",function(){var a=h.result;if(h.result.indexOf("svg+xml")<0){for(var c=atob(h.result.split(",")[1]),d=[],e=0;e<c.length;e++)d.push(c.charCodeAt(e));a=window.URL.createObjectURL(new Blob([new Uint8Array(d)],{type:"image/jpeg"}))}qa?(qa.on("load",f),b.edit.on(),b.undo.saveStep(),qa.data("fr-old-src",qa.attr("src")),qa.attr("src",a)):g=D(a,null,f)},!1),h.readAsDataURL(e)}function G(a){if(b.events.trigger("image.beforeUpload",[a])===!1)return!1;if("undefined"!=typeof a&&a.length>0){var c=a[0];if(c.size>b.opts.imageMaxSize)return o(za),!1;if(b.opts.imageAllowedTypes.indexOf(c.type.replace(/image\//g,""))<0)return o(Aa),!1;var d;if(b.drag_support.formdata&&(d=b.drag_support.formdata?new FormData:null),d){var e;if(b.opts.imageUploadToS3!==!1){d.append("key",b.opts.imageUploadToS3.keyStart+(new Date).getTime()+"-"+(c.name||"untitled")),d.append("success_action_status","201"),d.append("X-Requested-With","xhr"),d.append("Content-Type",c.type);for(e in b.opts.imageUploadToS3.params)b.opts.imageUploadToS3.params.hasOwnProperty(e)&&d.append(e,b.opts.imageUploadToS3.params[e])}for(e in b.opts.imageUploadParams)b.opts.imageUploadParams.hasOwnProperty(e)&&d.append(e,b.opts.imageUploadParams[e]);d.append(b.opts.imageUploadParam,c);var f=b.opts.imageUploadURL;b.opts.imageUploadToS3&&(f="https://"+b.opts.imageUploadToS3.region+".amazonaws.com/"+b.opts.imageUploadToS3.bucket);var g=b.core.getXHR(f,b.opts.imageUploadMethod);F(g,d,c)}}}function H(c){b.events.$on(c,"dragover dragenter",".fr-image-upload-layer",function(){return a(this).addClass("fr-drop"),!1}),b.events.$on(c,"dragleave dragend",".fr-image-upload-layer",function(){return a(this).removeClass("fr-drop"),!1}),b.events.$on(c,"drop",".fr-image-upload-layer",function(d){d.preventDefault(),d.stopPropagation(),a(this).removeClass("fr-drop");var e=d.originalEvent.dataTransfer;if(e&&e.files){var f=c.data("instance")||b;f.events.disableBlur(),f.image.upload(e.files),f.events.enableBlur()}}),b.events.$on(c,"change",'.fr-image-upload-layer input[type="file"]',function(){if(this.files){var d=c.data("instance")||b;d.events.disableBlur(),c.find("input:focus").blur(),d.events.enableBlur(),d.image.upload(this.files)}a(this).val("")})}function I(c){var d=c.originalEvent.dataTransfer;if(d&&d.files&&d.files.length){var e=d.files[0];if(e&&e.type&&b.opts.imageAllowedTypes.indexOf(e.type.replace(/image\//g,""))>=0){b.markers.remove(),b.markers.insertAtPoint(c.originalEvent),b.$el.find(".fr-marker").replaceWith(a.FE.MARKERS),b.popups.hideAll();var f=b.popups.get("image.insert");return f||(f=L()),b.popups.setContainer("image.insert",a(b.opts.scrollableContainer)),b.popups.show("image.insert",c.originalEvent.pageX,c.originalEvent.pageY),q(),G(d.files),c.preventDefault(),c.stopPropagation(),!1}}}function J(){var c,d,e=b.selection.ranges(0);e.collapsed&&e.startContainer.nodeType==Node.ELEMENT_NODE&&(e.startContainer.childNodes.length==e.startOffset?(c=e.startContainer.childNodes[e.startOffset-1],c&&"IMG"==c.tagName&&"block"==a(c).css("display")&&(d=b.node.blockParent(c),d&&b.html.defaultTag()?d.nextSibling||(["TD","TH"].indexOf(d.tagName)<0?a(d).after("<"+b.html.defaultTag()+"><br>"+a.FE.MARKERS+"</"+b.html.defaultTag()+">"):a(img).after("<br>"+a.FE.MARKERS),b.selection.restore()):d||(a(c).after("<br>"+a.FE.MARKERS),b.selection.restore()))):0===e.startOffset&&e.startContainer.childNodes.length>e.startOffset&&(c=e.startContainer.childNodes[e.startOffset],c&&"IMG"==c.tagName&&"block"==a(c).css("display")&&(d=b.node.blockParent(c),d&&b.html.defaultTag()?d.previousSibling||(["TD","TH"].indexOf(d.tagName)<0?a(d).before("<"+b.html.defaultTag()+"><br>"+a.FE.MARKERS+"</"+b.html.defaultTag()+">"):a(img).before("<br>"+a.FE.MARKERS),b.selection.restore()):d||(a(c).before(a.FE.MARKERS+"<br>"),b.selection.restore()))))}function K(){b.events.$on(b.$el,b._mousedown,"IMG"==b.$el.get(0).tagName?null:'img:not([contenteditable="false"])',function(c){return a(this).parents('[contenteditable="false"]:not(.fr-element):not(body)').length?!0:(b.selection.clear(),ua=!0,b.browser.msie&&(b.events.disableBlur(),b.$el.attr("contenteditable",!1)),b.draggable||c.preventDefault(),void c.stopPropagation())}),b.events.$on(b.$el,b._mouseup,"IMG"==b.$el.get(0).tagName?null:'img:not([contenteditable="false"])',function(c){return a(this).parents('[contenteditable="false"]:not(.fr-element):not(body)').length?!0:void(ua&&(ua=!1,c.stopPropagation(),b.browser.msie&&(b.$el.attr("contenteditable",!0),b.events.enableBlur())))}),b.events.on("keyup",function(c){if(c.shiftKey&&""===b.selection.text().replace(/\n/g,"")){var d=b.selection.element(),e=b.selection.endElement();d&&"IMG"==d.tagName?v(a(d)):e&&"IMG"==e.tagName&&v(a(e))}},!0),b.events.on("drop",I),b.events.on("mousedown window.mousedown",da),b.events.on("window.touchmove",ea),b.events.on("mouseup window.mouseup",function(){return qa?(ca(),!1):void 0}),b.events.on("commands.mousedown",function(a){a.parents(".fr-toolbar").length>0&&ca()}),b.events.on("mouseup",J),b.events.on("blur image.hideResizer commands.undo commands.redo element.dropped",function(){ua=!1,ca(!0)})}function L(a){if(a)return b.popups.onRefresh("image.insert",c),b.popups.onHide("image.insert",f),!0;var d,e="";b.opts.imageInsertButtons.length>1&&(e='<div class="fr-buttons">'+b.button.buildList(b.opts.imageInsertButtons)+"</div>");var g=b.opts.imageInsertButtons.indexOf("imageUpload"),h=b.opts.imageInsertButtons.indexOf("imageByURL"),i="";g>=0&&(d=" fr-active",h>=0&&g>h&&(d=""),i='<div class="fr-image-upload-layer'+d+' fr-layer" id="fr-image-upload-layer-'+b.id+'"><strong>'+b.language.translate("Drop image")+"</strong><br>("+b.language.translate("or click")+')<div class="fr-form"><input type="file" accept="image/'+b.opts.imageAllowedTypes.join(", image/").toLowerCase()+'" tabIndex="-1"></div></div>');var j="";h>=0&&(d=" fr-active",g>=0&&h>g&&(d=""),j='<div class="fr-image-by-url-layer'+d+' fr-layer" id="fr-image-by-url-layer-'+b.id+'"><div class="fr-input-line"><input type="text" placeholder="http://" tabIndex="1"></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-submit" data-cmd="imageInsertByURL" tabIndex="2">'+b.language.translate("Insert")+"</button></div></div>");var k='<div class="fr-image-progress-bar-layer fr-layer"><h3 class="fr-message">Uploading</h3><div class="fr-loader"><span class="fr-progress"></span></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-back" data-cmd="imageDismissError" tabIndex="2">OK</button></div></div>',l={buttons:e,upload_layer:i,by_url_layer:j,progress_bar:k},m=b.popups.create("image.insert",l);return b.$wp&&b.events.$on(b.$wp,"scroll",function(){qa&&b.popups.isVisible("image.insert")&&la()}),H(m),m}function M(){if(qa){var a=b.popups.get("image.alt");a.find("input").val(qa.attr("alt")||"").trigger("change")}}function N(){var c=b.popups.get("image.alt");c||(c=O()),r(),b.popups.refresh("image.alt"),b.popups.setContainer("image.alt",a(b.opts.scrollableContainer));var d=qa.offset().left+qa.width()/2,e=qa.offset().top+qa.height();b.popups.show("image.alt",d,e,qa.outerHeight())}function O(a){if(a)return b.popups.onRefresh("image.alt",M),!0;var c="";c='<div class="fr-buttons">'+b.button.buildList(b.opts.imageAltButtons)+"</div>";var d="";d='<div class="fr-image-alt-layer fr-layer fr-active" id="fr-image-alt-layer-'+b.id+'"><div class="fr-input-line"><input type="text" placeholder="'+b.language.translate("Alternate Text")+'" tabIndex="1"></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-submit" data-cmd="imageSetAlt" tabIndex="2">'+b.language.translate("Update")+"</button></div></div>";var e={buttons:c,alt_layer:d},f=b.popups.create("image.alt",e);return b.$wp&&b.events.$on(b.$wp,"scroll.image-alt",function(){qa&&b.popups.isVisible("image.alt")&&N()}),f}function P(a){if(qa){var c=b.popups.get("image.alt");qa.attr("alt",a||c.find("input").val()||""),c.find("input:focus").blur(),v(qa)}}function Q(){if(qa){var a=b.popups.get("image.size");a.find('input[name="width"]').val(qa.get(0).style.width).trigger("change"),a.find('input[name="height"]').val(qa.get(0).style.height).trigger("change")}}function R(){var c=b.popups.get("image.size");c||(c=S()),r(),b.popups.refresh("image.size"),b.popups.setContainer("image.size",a(b.opts.scrollableContainer));var d=qa.offset().left+qa.width()/2,e=qa.offset().top+qa.height();b.popups.show("image.size",d,e,qa.outerHeight())}function S(a){if(a)return b.popups.onRefresh("image.size",Q),!0;var c="";c='<div class="fr-buttons">'+b.button.buildList(b.opts.imageSizeButtons)+"</div>";var d="";d='<div class="fr-image-size-layer fr-layer fr-active" id="fr-image-size-layer-'+b.id+'"><div class="fr-image-group"><div class="fr-input-line"><input type="text" name="width" placeholder="'+b.language.translate("Width")+'" tabIndex="1"></div><div class="fr-input-line"><input type="text" name="height" placeholder="'+b.language.translate("Height")+'" tabIndex="1"></div></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-submit" data-cmd="imageSetSize" tabIndex="2">'+b.language.translate("Update")+"</button></div></div>";var e={buttons:c,size_layer:d},f=b.popups.create("image.size",e);return b.$wp&&b.events.$on(b.$wp,"scroll.image-size",function(){qa&&b.popups.isVisible("image.size")&&R()}),f}function T(a,c){if(qa){var d=b.popups.get("image.size");qa.css("width",a||d.find('input[name="width"]').val()),qa.css("height",c||d.find('input[name="height"]').val()),d.find("input:focus").blur(),v(qa)}}function U(a){var c,d,e=b.popups.get("image.insert");if(qa||b.opts.toolbarInline)qa&&(d=qa.offset().top+qa.outerHeight());else{var f=b.$tb.find('.fr-command[data-cmd="insertImage"]');c=f.offset().left+f.outerWidth()/2,d=f.offset().top+(b.opts.toolbarBottom?10:f.outerHeight()-10)}!qa&&b.opts.toolbarInline&&(d=e.offset().top-b.helpers.getPX(e.css("margin-top")),e.hasClass("fr-above")&&(d+=e.outerHeight())),e.find(".fr-layer").removeClass("fr-active"),e.find(".fr-"+a+"-layer").addClass("fr-active"),b.popups.show("image.insert",c,d,qa?qa.outerHeight():0)}function V(a){var c=b.popups.get("image.insert");c.find(".fr-image-upload-layer").hasClass("fr-active")&&a.addClass("fr-active")}function W(a){var c=b.popups.get("image.insert");c.find(".fr-image-by-url-layer").hasClass("fr-active")&&a.addClass("fr-active")}function X(){var c;b.shared.$image_resizer?(ra=b.shared.$image_resizer,ta=b.shared.$img_overlay,b.events.on("destroy",function(){ra.removeClass("fr-active").appendTo(a("body"))},!0)):(b.shared.$image_resizer=a('<div class="fr-image-resizer"></div>'),ra=b.shared.$image_resizer,b.events.$on(ra,"mousedown",function(a){a.stopPropagation()},!0),b.opts.imageResize&&(ra.append(k("nw")+k("ne")+k("sw")+k("se")),b.shared.$img_overlay=a('<div class="fr-image-overlay"></div>'),ta=b.shared.$img_overlay,c=ra.get(0).ownerDocument,a(c).find("body").append(ta))),b.events.on("shared.destroy",function(){ra.html("").removeData().remove(),ra=null,b.opts.imageResize&&(ta.remove(),ta=null)},!0),b.helpers.isMobile()||b.events.$on(a(b.o_win),"resize",function(){qa&&!qa.hasClass("fr-uploading")?ca(!0):qa&&(j(),la(),q(!1))}),b.opts.imageResize&&(c=ra.get(0).ownerDocument,b.events.$on(ra,b._mousedown,".fr-handler",l),b.events.$on(a(c),b._mousemove,m),b.events.$on(a(c.defaultView||c.parentWindow),b._mouseup,n),b.events.$on(ta,"mouseleave",n))}function Y(c){c=c||qa,c&&b.events.trigger("image.beforeRemove",[c])!==!1&&(b.popups.hideAll(),ca(!0),c.get(0)==b.$el.get(0)?c.removeAttr("src"):("A"==c.get(0).parentNode.tagName?(b.selection.setBefore(c.get(0).parentNode)||b.selection.setAfter(c.get(0).parentNode)||c.parent().after(a.FE.MARKERS),a(c.get(0).parentNode).remove()):(b.selection.setBefore(c.get(0))||b.selection.setAfter(c.get(0))||c.after(a.FE.MARKERS),c.remove()),b.html.fillEmptyBlocks(),b.selection.restore()),b.undo.saveStep())}function Z(){if(K(),"IMG"==b.$el.get(0).tagName&&b.$el.addClass("fr-view"),b.events.$on(b.$el,b.helpers.isMobile()&&!b.helpers.isWindowsPhone()?"touchend":"click","IMG"==b.$el.get(0).tagName?null:'img:not([contenteditable="false"])',ba),b.helpers.isMobile()&&(b.events.$on(b.$el,"touchstart","IMG"==b.$el.get(0).tagName?null:'img:not([contenteditable="false"])',function(){Ea=!1}),b.events.$on(b.$el,"touchmove",function(){Ea=!0})),b.events.on("window.keydown keydown",function(c){var d=c.which;if(qa&&(d==a.FE.KEYCODE.BACKSPACE||d==a.FE.KEYCODE.DELETE))return c.preventDefault(),c.stopPropagation(),Y(),!1;if(qa&&d==a.FE.KEYCODE.ESC){var e=qa;return ca(!0),b.selection.setAfter(e.get(0)),b.selection.restore(),c.preventDefault(),!1}return qa&&!b.keys.ctrlKey(c)?(c.preventDefault(),!1):void 0},!0),b.events.on("window.cut window.copy",function(c){ma(),a.FE.copied_text="\n",a.FE.copied_html=qa.get(0).outerHTML,"copy"==c.type?setTimeout(function(){v(qa)}):(ca(!0),b.undo.saveStep(),setTimeout(function(){b.undo.saveStep()},0))},!0),b.events.$on(a(b.o_win),"keydown",function(b){var c=b.which;return qa&&c==a.FE.KEYCODE.BACKSPACE?(b.preventDefault(),!1):void 0}),b.events.$on(b.$win,"keydown",function(b){var c=b.which;qa&&qa.hasClass("fr-uploading")&&c==a.FE.KEYCODE.ESC&&qa.trigger("abortUpload")}),b.events.on("destroy",function(){qa&&qa.hasClass("fr-uploading")&&qa.trigger("abortUpload")}),b.events.on("paste.before",_),b.events.on("paste.beforeCleanup",aa),b.events.on("paste.after",$),b.events.on("html.set",h),b.events.on("html.inserted",h),h(),b.events.on("destroy",function(){Da=[]}),b.events.on("html.get",function(a){return a=a.replace(/<(img)((?:[\w\W]*?))class="([\w\W]*?)(fr-uploading|fr-error)([\w\W]*?)"((?:[\w\W]*?))>/g,"")}),b.opts.imageOutputSize){var c;b.events.on("html.beforeGet",function(){c=b.$el.get(0).querySelectorAll("img");for(var d=0;d<c.length;d++)c[d].setAttribute("width",a(c[d]).width()),c[d].setAttribute("height",a(c[d]).height())}),b.events.on("html.afterGet",function(){for(var a=0;a<c.length;a++)c[a].removeAttribute("width"),c[a].removeAttribute("height")})}b.opts.iframe&&b.events.on("image.loaded",b.size.syncIframe),b.$wp&&(i(),b.events.on("contentChanged",i)),b.events.$on(a(b.o_win),"orientationchange.image",function(){setTimeout(function(){var a=oa();a&&v(a)},0)}),p(!0),L(!0),S(!0),O(!0),b.events.on("node.remove",function(a){return"IMG"==a.get(0).tagName?(Y(a),!1):void 0})}function $(){b.opts.imagePaste?b.$el.find("img[data-fr-image-pasted]").each(function(c,d){if(b.opts.imagePasteProcess){var f=b.opts.imageDefaultWidth;f&&"auto"!=f&&(f+=b.opts.imageResizeWithPercent?"%":"px"),a(d).css("width",f),a(d).removeClass("fr-dii fr-dib fr-fir fr-fil").addClass((b.opts.imageDefaultDisplay?"fr-di"+b.opts.imageDefaultDisplay[0]:"")+(b.opts.imageDefaultAlign&&"center"!=b.opts.imageDefaultAlign?" fr-fi"+b.opts.imageDefaultAlign[0]:""))}if(0===d.src.indexOf("data:")){if(b.events.trigger("image.beforePasteUpload",[d])===!1)return!1;qa=a(d),j(),e(),la(),q(),b.edit.off();for(var g=atob(a(d).attr("src").split(",")[1]),h=[],i=0;i<g.length;i++)h.push(g.charCodeAt(i));var k=new Blob([new Uint8Array(h)],{type:"image/jpeg"});G([k]),a(d).removeAttr("data-fr-image-pasted")}else 0!==d.src.indexOf("http")?(b.selection.save(),a(d).remove(),b.selection.restore()):a(d).removeAttr("data-fr-image-pasted")}):b.$el.find("img[data-fr-image-pasted]").remove()}function _(a){if(a&&a.clipboardData&&a.clipboardData.items&&a.clipboardData.items[0]){var c=a.clipboardData.items[0].getAsFile();if(c){var d=new FileReader;return d.onload=function(a){var c=a.target.result,d=b.opts.imageDefaultWidth;d&&"auto"!=d&&(d+=b.opts.imageResizeWithPercent?"%":"px"),b.html.insert('<img data-fr-image-pasted="true" class="'+(b.opts.imageDefaultDisplay?"fr-di"+b.opts.imageDefaultDisplay[0]:"")+(b.opts.imageDefaultAlign&&"center"!=b.opts.imageDefaultAlign?" fr-fi"+b.opts.imageDefaultAlign[0]:"")+'" src="'+c+'"'+(d?' style="width: '+d+';"':"")+">"),b.events.trigger("paste.after")},d.readAsDataURL(c),!1}}}function aa(a){return a=a.replace(/<img /gi,'<img data-fr-image-pasted="true" ')}function ba(c){if(a(this).parents('[contenteditable="false"]:not(.fr-element):not(body)').length)return!0;if(c&&"touchend"==c.type&&Ea)return!0;if(c&&b.edit.isDisabled())return c.stopPropagation(),c.preventDefault(),!1;for(var d=0;d<a.FE.INSTANCES.length;d++)a.FE.INSTANCES[d]!=b&&a.FE.INSTANCES[d].events.trigger("image.hideResizer");b.toolbar.disable(),c&&(c.stopPropagation(),c.preventDefault()),b.helpers.isMobile()&&(b.events.disableBlur(),b.$el.blur(),b.events.enableBlur()),b.opts.iframe&&b.size.syncIframe(),qa=a(this),ma(),j(),e(),b.selection.clear(),b.button.bulkRefresh(),b.events.trigger("video.hideResizer")}function ca(a){qa&&(fa()||a===!0)&&(b.toolbar.enable(),ra.removeClass("fr-active"),b.popups.hide("image.edit"),qa=null,ea())}function da(){Fa=!0}function ea(){Fa=!1}function fa(){return Fa}function ga(a){qa.removeClass("fr-fir fr-fil"),"left"==a?qa.addClass("fr-fil"):"right"==a&&qa.addClass("fr-fir"),j(),e()}function ha(a){qa&&(qa.hasClass("fr-fil")?a.find("> *:first").replaceWith(b.icon.create("align-left")):qa.hasClass("fr-fir")?a.find("> *:first").replaceWith(b.icon.create("align-right")):a.find("> *:first").replaceWith(b.icon.create("align-justify")))}function ia(a,b){if(qa){var c="justify";qa.hasClass("fr-fil")?c="left":qa.hasClass("fr-fir")&&(c="right"),b.find('.fr-command[data-param1="'+c+'"]').addClass("fr-active")}}function ja(a){qa.removeClass("fr-dii fr-dib"),"inline"==a?qa.addClass("fr-dii"):"block"==a&&qa.addClass("fr-dib"),j(),e()}function ka(a,b){var c="block";qa.hasClass("fr-dii")&&(c="inline"),b.find('.fr-command[data-param1="'+c+'"]').addClass("fr-active")}function la(){var c=b.popups.get("image.insert");c||(c=L()),b.popups.isVisible("image.insert")||(r(),b.popups.refresh("image.insert"),b.popups.setContainer("image.insert",a(b.opts.scrollableContainer)));var d=qa.offset().left+qa.width()/2,e=qa.offset().top+qa.height();b.popups.show("image.insert",d,e,qa.outerHeight())}function ma(){if(qa){b.selection.clear();var a=b.doc.createRange();a.selectNode(qa.get(0));var c=b.selection.get();c.addRange(a)}}function na(){qa?(a(".fr-popup input:focus").blur(),v(qa)):(b.events.disableBlur(),b.selection.restore(),b.events.enableBlur(),b.popups.hide("image.insert"),b.toolbar.showInline())}function oa(){return qa}function pa(a,c,d){if("undefined"==typeof c&&(c=b.opts.imageStyles),"undefined"==typeof d&&(d=b.opts.imageMultipleStyles),!qa)return!1;if(!d){var e=Object.keys(c);e.splice(e.indexOf(a),1),qa.removeClass(e.join(" "))}qa.toggleClass(a),v(qa)}var qa,ra,sa,ta,ua=!1,va=1,wa=2,xa=3,ya=4,za=5,Aa=6,Ba=7,Ca={};Ca[va]="Image cannot be loaded from the passed link.",Ca[wa]="No link in upload response.",Ca[xa]="Error during file upload.",Ca[ya]="Parsing response failed.",Ca[za]="File is too large.",Ca[Aa]="Image file type is invalid.",Ca[Ba]="Files can be uploaded only to same domain in IE 8 and IE 9.";var Da,Ea,Fa=!1;return{_init:Z,showInsertPopup:d,showLayer:U,refreshUploadButton:V,refreshByURLButton:W,upload:G,insertByURL:u,align:ga,refreshAlign:ha,refreshAlignOnShow:ia,display:ja,refreshDisplayOnShow:ka,replace:la,back:na,get:oa,insert:x,showProgressBar:q,remove:Y,hideProgressBar:r,applyStyle:pa,showAltPopup:N,showSizePopup:R,setAlt:P,setSize:T,exitEdit:ca,edit:v}},a.FE.DefineIcon("insertImage",{NAME:"image"}),a.FE.RegisterShortcut(a.FE.KEYCODE.P,"insertImage",null,"P"),a.FE.RegisterCommand("insertImage",{title:"Insert Image",undo:!1,focus:!0,refreshAfterCallback:!1,popup:!0,callback:function(){this.popups.isVisible("image.insert")?(this.$el.find(".fr-marker")&&(this.events.disableBlur(),this.selection.restore()),this.popups.hide("image.insert")):this.image.showInsertPopup()},plugin:"image"}),a.FE.DefineIcon("imageUpload",{NAME:"upload"}),a.FE.RegisterCommand("imageUpload",{title:"Upload Image",undo:!1,focus:!1,callback:function(){this.image.showLayer("image-upload")},refresh:function(a){this.image.refreshUploadButton(a)}}),a.FE.DefineIcon("imageByURL",{NAME:"link"}),a.FE.RegisterCommand("imageByURL",{title:"By URL",undo:!1,focus:!1,callback:function(){this.image.showLayer("image-by-url")},refresh:function(a){this.image.refreshByURLButton(a)}}),a.FE.RegisterCommand("imageInsertByURL",{title:"Insert Image",undo:!0,refreshAfterCallback:!1,callback:function(){this.image.insertByURL()},refresh:function(a){var b=this.image.get();b?a.text(this.language.translate("Replace")):a.text(this.language.translate("Insert"))}}),a.FE.DefineIcon("imageDisplay",{NAME:"star"}),a.FE.RegisterCommand("imageDisplay",{title:"Display",type:"dropdown",options:{inline:"Inline",block:"Break Text"},callback:function(a,b){this.image.display(b)},refresh:function(a){this.opts.imageTextNear||a.addClass("fr-hidden")},refreshOnShow:function(a,b){this.image.refreshDisplayOnShow(a,b)}}),a.FE.DefineIcon("imageAlign",{NAME:"align-center"}),a.FE.RegisterCommand("imageAlign",{type:"dropdown",title:"Align",options:{left:"Align Left",justify:"None",right:"Align Right"},html:function(){var b='<ul class="fr-dropdown-list">',c=a.FE.COMMANDS.imageAlign.options;for(var d in c)c.hasOwnProperty(d)&&(b+='<li><a class="fr-command fr-title" data-cmd="imageAlign" data-param1="'+d+'" title="'+this.language.translate(c[d])+'">'+this.icon.create("align-"+d)+"</a></li>"); | ||
return b+="</ul>"},callback:function(a,b){this.image.align(b)},refresh:function(a){this.image.refreshAlign(a)},refreshOnShow:function(a,b){this.image.refreshAlignOnShow(a,b)}}),a.FE.DefineIcon("imageReplace",{NAME:"exchange"}),a.FE.RegisterCommand("imageReplace",{title:"Replace",undo:!1,focus:!1,refreshAfterCallback:!1,callback:function(){this.image.replace()}}),a.FE.DefineIcon("imageRemove",{NAME:"trash"}),a.FE.RegisterCommand("imageRemove",{title:"Remove",callback:function(){this.image.remove()}}),a.FE.DefineIcon("imageBack",{NAME:"arrow-left"}),a.FE.RegisterCommand("imageBack",{title:"Back",undo:!1,focus:!1,back:!0,callback:function(){this.image.back()},refresh:function(a){var b=this.image.get();b||this.opts.toolbarInline?(a.removeClass("fr-hidden"),a.next(".fr-separator").removeClass("fr-hidden")):(a.addClass("fr-hidden"),a.next(".fr-separator").addClass("fr-hidden"))}}),a.FE.RegisterCommand("imageDismissError",{title:"OK",undo:!1,callback:function(){this.image.hideProgressBar(!0)}}),a.FE.DefineIcon("imageStyle",{NAME:"magic"}),a.FE.RegisterCommand("imageStyle",{title:"Style",type:"dropdown",html:function(){var a='<ul class="fr-dropdown-list">',b=this.opts.imageStyles;for(var c in b)b.hasOwnProperty(c)&&(a+='<li><a class="fr-command" data-cmd="imageStyle" data-param1="'+c+'">'+this.language.translate(b[c])+"</a></li>");return a+="</ul>"},callback:function(a,b){this.image.applyStyle(b)},refreshOnShow:function(b,c){var d=this.image.get();d&&c.find(".fr-command").each(function(){var b=a(this).data("param1");a(this).toggleClass("fr-active",d.hasClass(b))})}}),a.FE.DefineIcon("imageAlt",{NAME:"info"}),a.FE.RegisterCommand("imageAlt",{undo:!1,focus:!1,title:"Alternate Text",callback:function(){this.image.showAltPopup()}}),a.FE.RegisterCommand("imageSetAlt",{undo:!0,focus:!1,title:"Update",refreshAfterCallback:!1,callback:function(){this.image.setAlt()}}),a.FE.DefineIcon("imageSize",{NAME:"arrows-alt"}),a.FE.RegisterCommand("imageSize",{undo:!1,focus:!1,title:"Change Size",callback:function(){this.image.showSizePopup()}}),a.FE.RegisterCommand("imageSetSize",{undo:!0,focus:!1,title:"Update",refreshAfterCallback:!1,callback:function(){this.image.setSize()}})}); |
/*! | ||
* froala_editor v2.3.2 (https://www.froala.com/wysiwyg-editor) | ||
* froala_editor v2.3.3 (https://www.froala.com/wysiwyg-editor) | ||
* License https://froala.com/wysiwyg-editor/terms/ | ||
@@ -4,0 +4,0 @@ * Copyright 2014-2016 Froala Labs |
/*! | ||
* froala_editor v2.3.2 (https://www.froala.com/wysiwyg-editor) | ||
* froala_editor v2.3.3 (https://www.froala.com/wysiwyg-editor) | ||
* License https://froala.com/wysiwyg-editor/terms/ | ||
@@ -4,0 +4,0 @@ * Copyright 2014-2016 Froala Labs |
/*! | ||
* froala_editor v2.3.2 (https://www.froala.com/wysiwyg-editor) | ||
* froala_editor v2.3.3 (https://www.froala.com/wysiwyg-editor) | ||
* License https://froala.com/wysiwyg-editor/terms/ | ||
@@ -7,2 +7,2 @@ * Copyright 2014-2016 Froala Labs | ||
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=function(b,c){return void 0===c&&(c="undefined"!=typeof window?require("jquery"):require("jquery")(b)),a(c),c}:a(jQuery)}(function(a){"use strict";a.extend(a.FE.POPUP_TEMPLATES,{"link.edit":"[_BUTTONS_]","link.insert":"[_BUTTONS_][_INPUT_LAYER_]"}),a.extend(a.FE.DEFAULTS,{linkEditButtons:["linkOpen","linkStyle","linkEdit","linkRemove"],linkInsertButtons:["linkBack","|","linkList"],linkAttributes:{},linkAutoPrefix:"http://",linkStyles:{"fr-green":"Green","fr-strong":"Thick"},linkMultipleStyles:!0,linkConvertEmailAddress:!0,linkAlwaysBlank:!1,linkAlwaysNoFollow:!1,linkList:[{text:"Froala",href:"https://froala.com",target:"_blank"},{text:"Google",href:"https://google.com",target:"_blank"},{displayText:"Facebook",href:"https://facebook.com"}],linkText:!0}),a.FE.PLUGINS.link=function(b){function c(){var c=b.image?b.image.get():null;if(!c&&b.$wp){var d=b.selection.element(),e=b.selection.endElement();return"A"!=d.tagName&&(d=a(d).parents("a:first").get(0)),"A"!=e.tagName&&(e=a(e).parents("a:first").get(0)),e&&e==d?d:null}return"A"==b.$el.get(0).tagName&&b.core.hasFocus()?b.$el.get(0):c&&c.get(0).parentNode&&"A"==c.get(0).parentNode.tagName?c.get(0).parentNode:void 0}function d(){var a=b.image?b.image.get():null,c=[];if(a)"A"==a.get(0).parentNode.tagName&&c.push(a.get(0).parentNode);else{var d,e,f,g;if(b.win.getSelection){var h=b.win.getSelection();if(h.getRangeAt&&h.rangeCount){g=b.doc.createRange();for(var i=0;i<h.rangeCount;++i)if(d=h.getRangeAt(i),e=d.commonAncestorContainer,e&&1!=e.nodeType&&(e=e.parentNode),e&&"a"==e.nodeName.toLowerCase())c.push(e);else{f=e.getElementsByTagName("a");for(var j=0;j<f.length;++j)g.selectNodeContents(f[j]),g.compareBoundaryPoints(d.END_TO_START,d)<1&&g.compareBoundaryPoints(d.START_TO_END,d)>-1&&c.push(f[j])}}}else if(b.doc.selection&&"Control"!=b.doc.selection.type)if(d=b.doc.selection.createRange(),e=d.parentElement(),"a"==e.nodeName.toLowerCase())c.push(e);else{f=e.getElementsByTagName("a"),g=b.doc.body.createTextRange();for(var k=0;k<f.length;++k)g.moveToElementText(f[k]),g.compareEndPoints("StartToEnd",d)>-1&&g.compareEndPoints("EndToStart",d)<1&&c.push(f[k])}}return c}function e(d){g(),setTimeout(function(){if(!d||d&&(1==d.which||"mouseup"!=d.type)){var e=c(),g=b.image?b.image.get():null;if(e&&!g){if(b.image){var h=b.node.contents(e);if(1==h.length&&"IMG"==h[0].tagName){var i=b.selection.ranges(0);return 0===i.startOffset&&0===i.endOffset?a(e).before(a.FE.MARKERS):a(e).after(a.FE.MARKERS),b.selection.restore(),!1}}d&&d.stopPropagation(),f(e)}}},b.helpers.isIOS()?100:0)}function f(c){var d=b.popups.get("link.edit");d||(d=h());var e=a(c);b.popups.isVisible("link.edit")||b.popups.refresh("link.edit"),b.popups.setContainer("link.edit",a(b.opts.scrollableContainer));var f=e.offset().left+a(c).outerWidth()/2,g=e.offset().top+e.outerHeight();b.popups.show("link.edit",f,g,e.outerHeight())}function g(){b.popups.hide("link.edit")}function h(){var a="";b.opts.linkEditButtons.length>1&&("A"==b.$el.get(0).tagName&&b.opts.linkEditButtons.indexOf("linkRemove")>=0&&b.opts.linkEditButtons.splice(b.opts.linkEditButtons.indexOf("linkRemove"),1),a='<div class="fr-buttons">'+b.button.buildList(b.opts.linkEditButtons)+"</div>");var d={buttons:a},e=b.popups.create("link.edit",d);return b.$wp&&b.events.$on(b.$wp,"scroll.link-edit",function(){c()&&b.popups.isVisible("link.edit")&&f(c())}),e}function i(){}function j(){var d=b.popups.get("link.insert"),e=c();if(e){var f,g,h=a(e),i=d.find('input.fr-link-attr[type="text"]'),j=d.find('input.fr-link-attr[type="checkbox"]');for(f=0;f<i.length;f++)g=a(i[f]),g.val(h.attr(g.attr("name")||""));for(j.prop("checked",!1),f=0;f<j.length;f++)g=a(j[f]),h.attr(g.attr("name"))==g.data("checked")&&g.prop("checked",!0);d.find('input.fr-link-attr[type="text"][name="text"]').val(h.text())}else d.find('input.fr-link-attr[type="text"]').val(""),d.find('input.fr-link-attr[type="checkbox"]').prop("checked",!1),d.find('input.fr-link-attr[type="text"][name="text"]').val(b.selection.text());d.find("input.fr-link-attr").trigger("change");var k=b.image?b.image.get():null;k?d.find('.fr-link-attr[name="text"]').parent().hide():d.find('.fr-link-attr[name="text"]').parent().show()}function k(){var c=b.$tb.find('.fr-command[data-cmd="insertLink"]'),d=b.popups.get("link.insert");if(d||(d=l()),!d.hasClass("fr-active"))if(b.popups.refresh("link.insert"),b.popups.setContainer("link.insert",b.$tb||a(b.opts.scrollableContainer)),c.is(":visible")){var e=c.offset().left+c.outerWidth()/2,f=c.offset().top+(b.opts.toolbarBottom?10:c.outerHeight()-10);b.popups.show("link.insert",e,f,c.outerHeight())}else b.position.forSelection(d),b.popups.show("link.insert")}function l(a){if(a)return b.popups.onRefresh("link.insert",j),b.popups.onHide("link.insert",i),!0;var d="";b.opts.linkInsertButtons.length>=1&&(d='<div class="fr-buttons">'+b.button.buildList(b.opts.linkInsertButtons)+"</div>");var e='<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="10" height="10" viewBox="0 0 32 32"><path d="M27 4l-15 15-7-7-5 5 12 12 20-20z" fill="#FFF"></path></svg>',f="",g=0;f='<div class="fr-link-insert-layer fr-layer fr-active" id="fr-link-insert-layer-'+b.id+'">',f+='<div class="fr-input-line"><input name="href" type="text" class="fr-link-attr" placeholder="URL" tabIndex="'+ ++g+'"></div>',b.opts.linkText&&(f+='<div class="fr-input-line"><input name="text" type="text" class="fr-link-attr" placeholder="'+b.language.translate("Text")+'" tabIndex="'+ ++g+'"></div>');for(var h in b.opts.linkAttributes)if(b.opts.linkAttributes.hasOwnProperty(h)){var k=b.opts.linkAttributes[h];f+='<div class="fr-input-line"><input name="'+h+'" type="text" class="fr-link-attr" placeholder="'+b.language.translate(k)+'" tabIndex="'+ ++g+'"></div>'}b.opts.linkAlwaysBlank||(f+='<div class="fr-checkbox-line"><span class="fr-checkbox"><input name="target" class="fr-link-attr" data-checked="_blank" type="checkbox" id="fr-link-target-'+b.id+'" tabIndex="'+ ++g+'"><span>'+e+'</span></span><label for="fr-link-target-'+b.id+'">'+b.language.translate("Open in new tab")+"</label></div>"),f+='<div class="fr-action-buttons"><button class="fr-command fr-submit" data-cmd="linkInsert" href="#" tabIndex="'+ ++g+'" type="button">'+b.language.translate("Insert")+"</button></div></div>";var l={buttons:d,input_layer:f},m=b.popups.create("link.insert",l);return b.$wp&&b.events.$on(b.$wp,"scroll.link-insert",function(){var a=b.image?b.image.get():null;a&&b.popups.isVisible("link.insert")&&u(),c&&b.popups.isVisible("link.insert")&&s()}),m}function m(){var d=c(),e=b.image?b.image.get():null;return b.events.trigger("link.beforeRemove",[d])===!1?!1:void(e&&d?(e.unwrap(),b.image.edit(e)):d&&(b.selection.save(),a(d).replaceWith(a(d).html()),b.selection.restore(),g()))}function n(){b.events.on("keyup",function(b){b.which!=a.FE.KEYCODE.ESC&&e(b)}),b.events.on("window.mouseup",e),b.helpers.isMobile()&&b.events.$on(b.$doc,"selectionchange",e),l(!0),"A"==b.$el.get(0).tagName&&b.$el.addClass("fr-view")}function o(c){var d,e,f=b.opts.linkList[c],g=b.popups.get("link.insert"),h=g.find('input.fr-link-attr[type="text"]'),i=g.find('input.fr-link-attr[type="checkbox"]');for(e=0;e<h.length;e++)d=a(h[e]),f[d.attr("name")]?d.val(f[d.attr("name")]):"text"!=d.attr("name")&&d.val("");for(e=0;e<i.length;e++)d=a(i[e]),d.prop("checked",d.data("checked")==f[d.attr("name")])}function p(){var c,d,e=b.popups.get("link.insert"),f=e.find('input.fr-link-attr[type="text"]'),g=e.find('input.fr-link-attr[type="checkbox"]'),h=f.filter('[name="href"]').val(),i=f.filter('[name="text"]').val(),j={};for(d=0;d<f.length;d++)c=a(f[d]),["href","text"].indexOf(c.attr("name"))<0&&(j[c.attr("name")]=c.val());for(d=0;d<g.length;d++)c=a(g[d]),c.is(":checked")?j[c.attr("name")]=c.data("checked"):j[c.attr("name")]=c.data("unchecked");var k=a(b.o_win).scrollTop();r(h,i,j),a(b.o_win).scrollTop(k)}function q(){if(!b.selection.isCollapsed()){b.selection.save();for(var c=b.$el.find(".fr-marker").addClass("fr-unprocessed").toArray();c.length;){var d=a(c.pop());d.removeClass("fr-unprocessed");var e=b.node.deepestParent(d.get(0));if(e){var f=d.get(0),g="",h="";do f=f.parentNode,b.node.isBlock(f)||(g+=b.node.closeTagString(f),h=b.node.openTagString(f)+h);while(f!=e);var i=b.node.openTagString(d.get(0))+d.html()+b.node.closeTagString(d.get(0));d.replaceWith('<span id="fr-break"></span>');var j=a(e).html();j=j.replace(/<span id="fr-break"><\/span>/g,g+i+h),a(e).html(j)}c=b.$el.find(".fr-marker.fr-unprocessed").toArray()}b.selection.restore()}}function r(f,g,h){"undefined"==typeof h&&(h={});var i=b.image?b.image.get():null;i||"A"==b.$el.get(0).tagName?"A"==b.$el.get(0).tagName&&b.$el.focus():(b.selection.restore(),b.popups.hide("link.insert"));var j=f;if(b.opts.linkConvertEmailAddress){var k=/^[\w._]+@[a-z\u00a1-\uffff0-9_-]+?\.[a-z\u00a1-\uffff0-9]{2,}$/i;k.test(f)&&!/^mailto:.*/i.test(f)&&(f="mailto:"+f)}if(""===b.opts.linkAutoPrefix||/^(mailto|tel|sms|notes|data):.*/i.test(f)||/^data:image.*/i.test(f)||/^(https?:|ftps?:|file:|)\/\//i.test(f)||["/","{","[","#","("].indexOf((f||"")[0])<0&&(f=b.opts.linkAutoPrefix+f),f=b.helpers.sanitizeURL(f),b.opts.linkAlwaysBlank&&(h.target="_blank"),b.opts.linkAlwaysNoFollow&&(h.rel="nofollow"),g=g||"",f===b.opts.linkAutoPrefix){var l=b.popups.get("link.insert");return l.find('input[name="href"]').addClass("fr-error"),b.events.trigger("link.bad",[j]),!1}var m,n=c();if(n){m=a(n);var o=b.node.rawAttributes(n);for(var p in o)o.hasOwnProperty(p)&&"class"!=p&&"style"!=p&&m.removeAttr(p);m.attr("href",f),g.length>0&&m.text()!=g&&!i&&m.text(g),i||m.prepend(a.FE.START_MARKER).append(a.FE.END_MARKER),m.attr(h),i||b.selection.restore()}else{i?i.wrap('<a href="'+f+'"></a>'):(b.format.remove("a"),b.selection.isCollapsed()?(g=0===g.length?j:g,b.html.insert('<a href="'+f+'">'+a.FE.START_MARKER+g+a.FE.END_MARKER+"</a>"),b.selection.restore()):g.length>0&&g!=b.selection.text().replace(/\n/g,"")?(b.selection.remove(),b.html.insert('<a href="'+f+'">'+a.FE.START_MARKER+g+a.FE.END_MARKER+"</a>"),b.selection.restore()):(q(),b.format.apply("a",{href:f})));for(var r=d(),s=0;s<r.length;s++)m=a(r[s]),m.attr(h),m.removeAttr("_moz_dirty");1==r.length&&b.$wp&&!i&&(a(r[0]).prepend(a.FE.START_MARKER).append(a.FE.END_MARKER),b.selection.restore())}if(i){var t=b.popups.get("link.insert");t.find("input:focus").blur(),b.image.edit(i)}else e()}function s(){g();var d=c();if(d){var e=b.popups.get("link.insert");e||(e=l()),b.popups.isVisible("link.insert")||(b.popups.refresh("link.insert"),b.selection.save(),b.helpers.isMobile()&&(b.events.disableBlur(),b.$el.blur(),b.events.enableBlur())),b.popups.setContainer("link.insert",a(b.opts.scrollableContainer));var f=(b.image?b.image.get():null)||a(d),h=f.offset().left+f.outerWidth()/2,i=f.offset().top+f.outerHeight();b.popups.show("link.insert",h,i,f.outerHeight())}}function t(){var a=b.image?b.image.get():null;if(a)b.image.back();else{b.events.disableBlur(),b.selection.restore(),b.events.enableBlur();var d=c();d&&b.$wp?(b.selection.restore(),g(),e()):"A"==b.$el.get(0).tagName?(b.$el.focus(),e()):(b.popups.hide("link.insert"),b.toolbar.showInline())}}function u(){var c=b.image?b.image.get():null;if(c){var d=b.popups.get("link.insert");d||(d=l()),j(!0),b.popups.setContainer("link.insert",a(b.opts.scrollableContainer));var e=c.offset().left+c.outerWidth()/2,f=c.offset().top+c.outerHeight();b.popups.show("link.insert",e,f,c.outerHeight())}}function v(d,f,g){"undefined"==typeof g&&(g=b.opts.linkMultipleStyles),"undefined"==typeof f&&(f=b.opts.linkStyles);var h=c();if(!h)return!1;if(!g){var i=Object.keys(f);i.splice(i.indexOf(d),1),a(h).removeClass(i.join(" "))}a(h).toggleClass(d),e()}return{_init:n,remove:m,showInsertPopup:k,usePredefined:o,insertCallback:p,insert:r,update:s,get:c,allSelected:d,back:t,imageLink:u,applyStyle:v}},a.FE.DefineIcon("insertLink",{NAME:"link"}),a.FE.RegisterShortcut(a.FE.KEYCODE.K,"insertLink",null,"K"),a.FE.RegisterCommand("insertLink",{title:"Insert Link",undo:!1,focus:!0,refreshOnCallback:!1,popup:!0,callback:function(){this.popups.isVisible("link.insert")?(this.$el.find(".fr-marker")&&(this.events.disableBlur(),this.selection.restore()),this.popups.hide("link.insert")):this.link.showInsertPopup()},plugin:"link"}),a.FE.DefineIcon("linkOpen",{NAME:"external-link"}),a.FE.RegisterCommand("linkOpen",{title:"Open Link",undo:!1,refresh:function(a){var b=this.link.get();b?a.removeClass("fr-hidden"):a.addClass("fr-hidden")},callback:function(){var a=this.link.get();a&&this.o_win.open(a.href)}}),a.FE.DefineIcon("linkEdit",{NAME:"edit"}),a.FE.RegisterCommand("linkEdit",{title:"Edit Link",undo:!1,refreshAfterCallback:!1,callback:function(){this.link.update()},refresh:function(a){var b=this.link.get();b?a.removeClass("fr-hidden"):a.addClass("fr-hidden")}}),a.FE.DefineIcon("linkRemove",{NAME:"unlink"}),a.FE.RegisterCommand("linkRemove",{title:"Unlink",callback:function(){this.link.remove()},refresh:function(a){var b=this.link.get();b?a.removeClass("fr-hidden"):a.addClass("fr-hidden")}}),a.FE.DefineIcon("linkBack",{NAME:"arrow-left"}),a.FE.RegisterCommand("linkBack",{title:"Back",undo:!1,focus:!1,back:!0,refreshAfterCallback:!1,callback:function(){this.link.back()},refresh:function(a){var b=this.link.get(),c=this.image?this.image.get():null;c||b||this.opts.toolbarInline?(a.removeClass("fr-hidden"),a.next(".fr-separator").removeClass("fr-hidden")):(a.addClass("fr-hidden"),a.next(".fr-separator").addClass("fr-hidden"))}}),a.FE.DefineIcon("linkList",{NAME:"search"}),a.FE.RegisterCommand("linkList",{title:"Choose Link",type:"dropdown",focus:!1,undo:!1,refreshAfterCallback:!1,html:function(){for(var a='<ul class="fr-dropdown-list">',b=this.opts.linkList,c=0;c<b.length;c++)a+='<li><a class="fr-command" data-cmd="linkList" data-param1="'+c+'">'+(b[c].displayText||b[c].text)+"</a></li>";return a+="</ul>"},callback:function(a,b){this.link.usePredefined(b)}}),a.FE.RegisterCommand("linkInsert",{focus:!1,refreshAfterCallback:!1,callback:function(){this.link.insertCallback()},refresh:function(a){var b=this.link.get();b?a.text(this.language.translate("Update")):a.text(this.language.translate("Insert"))}}),a.FE.DefineIcon("imageLink",{NAME:"link"}),a.FE.RegisterCommand("imageLink",{title:"Insert Link",undo:!1,focus:!1,callback:function(){this.link.imageLink()},refresh:function(a){var b,c=this.link.get();c?(b=a.prev(),b.hasClass("fr-separator")&&b.removeClass("fr-hidden"),a.addClass("fr-hidden")):(b=a.prev(),b.hasClass("fr-separator")&&b.addClass("fr-hidden"),a.removeClass("fr-hidden"))}}),a.FE.DefineIcon("linkStyle",{NAME:"magic"}),a.FE.RegisterCommand("linkStyle",{title:"Style",type:"dropdown",html:function(){var a='<ul class="fr-dropdown-list">',b=this.opts.linkStyles;for(var c in b)b.hasOwnProperty(c)&&(a+='<li><a class="fr-command" data-cmd="linkStyle" data-param1="'+c+'">'+this.language.translate(b[c])+"</a></li>");return a+="</ul>"},callback:function(a,b){this.link.applyStyle(b)},refreshOnShow:function(b,c){var d=this.link.get();if(d){var e=a(d);c.find(".fr-command").each(function(){var b=a(this).data("param1");a(this).toggleClass("fr-active",e.hasClass(b))})}}})}); | ||
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=function(b,c){return void 0===c&&(c="undefined"!=typeof window?require("jquery"):require("jquery")(b)),a(c),c}:a(jQuery)}(function(a){"use strict";a.extend(a.FE.POPUP_TEMPLATES,{"link.edit":"[_BUTTONS_]","link.insert":"[_BUTTONS_][_INPUT_LAYER_]"}),a.extend(a.FE.DEFAULTS,{linkEditButtons:["linkOpen","linkStyle","linkEdit","linkRemove"],linkInsertButtons:["linkBack","|","linkList"],linkAttributes:{},linkAutoPrefix:"http://",linkStyles:{"fr-green":"Green","fr-strong":"Thick"},linkMultipleStyles:!0,linkConvertEmailAddress:!0,linkAlwaysBlank:!1,linkAlwaysNoFollow:!1,linkList:[{text:"Froala",href:"https://froala.com",target:"_blank"},{text:"Google",href:"https://google.com",target:"_blank"},{displayText:"Facebook",href:"https://facebook.com"}],linkText:!0}),a.FE.PLUGINS.link=function(b){function c(){var c=b.image?b.image.get():null;if(!c&&b.$wp){var d=b.selection.element(),e=b.selection.endElement();return"A"==d.tagName||b.node.isElement(d)||(d=a(d).parentsUntil(b.$el,"a:first").get(0)),"A"==e.tagName||b.node.isElement(e)||(e=a(e).parentsUntil(b.$el,"a:first").get(0)),e&&e==d&&"A"==e.tagName?d:null}return"A"==b.$el.get(0).tagName&&b.core.hasFocus()?b.$el.get(0):c&&c.get(0).parentNode&&"A"==c.get(0).parentNode.tagName?c.get(0).parentNode:void 0}function d(){var a=b.image?b.image.get():null,c=[];if(a)"A"==a.get(0).parentNode.tagName&&c.push(a.get(0).parentNode);else{var d,e,f,g;if(b.win.getSelection){var h=b.win.getSelection();if(h.getRangeAt&&h.rangeCount){g=b.doc.createRange();for(var i=0;i<h.rangeCount;++i)if(d=h.getRangeAt(i),e=d.commonAncestorContainer,e&&1!=e.nodeType&&(e=e.parentNode),e&&"a"==e.nodeName.toLowerCase())c.push(e);else{f=e.getElementsByTagName("a");for(var j=0;j<f.length;++j)g.selectNodeContents(f[j]),g.compareBoundaryPoints(d.END_TO_START,d)<1&&g.compareBoundaryPoints(d.START_TO_END,d)>-1&&c.push(f[j])}}}else if(b.doc.selection&&"Control"!=b.doc.selection.type)if(d=b.doc.selection.createRange(),e=d.parentElement(),"a"==e.nodeName.toLowerCase())c.push(e);else{f=e.getElementsByTagName("a"),g=b.doc.body.createTextRange();for(var k=0;k<f.length;++k)g.moveToElementText(f[k]),g.compareEndPoints("StartToEnd",d)>-1&&g.compareEndPoints("EndToStart",d)<1&&c.push(f[k])}}return c}function e(d){g(),setTimeout(function(){if(!d||d&&(1==d.which||"mouseup"!=d.type)){var e=c(),g=b.image?b.image.get():null;if(e&&!g){if(b.image){var h=b.node.contents(e);if(1==h.length&&"IMG"==h[0].tagName){var i=b.selection.ranges(0);return 0===i.startOffset&&0===i.endOffset?a(e).before(a.FE.MARKERS):a(e).after(a.FE.MARKERS),b.selection.restore(),!1}}d&&d.stopPropagation(),f(e)}}},b.helpers.isIOS()?100:0)}function f(c){var d=b.popups.get("link.edit");d||(d=h());var e=a(c);b.popups.isVisible("link.edit")||b.popups.refresh("link.edit"),b.popups.setContainer("link.edit",a(b.opts.scrollableContainer));var f=e.offset().left+a(c).outerWidth()/2,g=e.offset().top+e.outerHeight();b.popups.show("link.edit",f,g,e.outerHeight())}function g(){b.popups.hide("link.edit")}function h(){var a="";b.opts.linkEditButtons.length>1&&("A"==b.$el.get(0).tagName&&b.opts.linkEditButtons.indexOf("linkRemove")>=0&&b.opts.linkEditButtons.splice(b.opts.linkEditButtons.indexOf("linkRemove"),1),a='<div class="fr-buttons">'+b.button.buildList(b.opts.linkEditButtons)+"</div>");var d={buttons:a},e=b.popups.create("link.edit",d);return b.$wp&&b.events.$on(b.$wp,"scroll.link-edit",function(){c()&&b.popups.isVisible("link.edit")&&f(c())}),e}function i(){}function j(){var d=b.popups.get("link.insert"),e=c();if(e){var f,g,h=a(e),i=d.find('input.fr-link-attr[type="text"]'),j=d.find('input.fr-link-attr[type="checkbox"]');for(f=0;f<i.length;f++)g=a(i[f]),g.val(h.attr(g.attr("name")||""));for(j.prop("checked",!1),f=0;f<j.length;f++)g=a(j[f]),h.attr(g.attr("name"))==g.data("checked")&&g.prop("checked",!0);d.find('input.fr-link-attr[type="text"][name="text"]').val(h.text())}else d.find('input.fr-link-attr[type="text"]').val(""),d.find('input.fr-link-attr[type="checkbox"]').prop("checked",!1),d.find('input.fr-link-attr[type="text"][name="text"]').val(b.selection.text());d.find("input.fr-link-attr").trigger("change");var k=b.image?b.image.get():null;k?d.find('.fr-link-attr[name="text"]').parent().hide():d.find('.fr-link-attr[name="text"]').parent().show()}function k(){var c=b.$tb.find('.fr-command[data-cmd="insertLink"]'),d=b.popups.get("link.insert");if(d||(d=l()),!d.hasClass("fr-active"))if(b.popups.refresh("link.insert"),b.popups.setContainer("link.insert",b.$tb||a(b.opts.scrollableContainer)),c.is(":visible")){var e=c.offset().left+c.outerWidth()/2,f=c.offset().top+(b.opts.toolbarBottom?10:c.outerHeight()-10);b.popups.show("link.insert",e,f,c.outerHeight())}else b.position.forSelection(d),b.popups.show("link.insert")}function l(a){if(a)return b.popups.onRefresh("link.insert",j),b.popups.onHide("link.insert",i),!0;var d="";b.opts.linkInsertButtons.length>=1&&(d='<div class="fr-buttons">'+b.button.buildList(b.opts.linkInsertButtons)+"</div>");var e='<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="10" height="10" viewBox="0 0 32 32"><path d="M27 4l-15 15-7-7-5 5 12 12 20-20z" fill="#FFF"></path></svg>',f="",g=0;f='<div class="fr-link-insert-layer fr-layer fr-active" id="fr-link-insert-layer-'+b.id+'">',f+='<div class="fr-input-line"><input name="href" type="text" class="fr-link-attr" placeholder="URL" tabIndex="'+ ++g+'"></div>',b.opts.linkText&&(f+='<div class="fr-input-line"><input name="text" type="text" class="fr-link-attr" placeholder="'+b.language.translate("Text")+'" tabIndex="'+ ++g+'"></div>');for(var h in b.opts.linkAttributes)if(b.opts.linkAttributes.hasOwnProperty(h)){var k=b.opts.linkAttributes[h];f+='<div class="fr-input-line"><input name="'+h+'" type="text" class="fr-link-attr" placeholder="'+b.language.translate(k)+'" tabIndex="'+ ++g+'"></div>'}b.opts.linkAlwaysBlank||(f+='<div class="fr-checkbox-line"><span class="fr-checkbox"><input name="target" class="fr-link-attr" data-checked="_blank" type="checkbox" id="fr-link-target-'+b.id+'" tabIndex="'+ ++g+'"><span>'+e+'</span></span><label for="fr-link-target-'+b.id+'">'+b.language.translate("Open in new tab")+"</label></div>"),f+='<div class="fr-action-buttons"><button class="fr-command fr-submit" data-cmd="linkInsert" href="#" tabIndex="'+ ++g+'" type="button">'+b.language.translate("Insert")+"</button></div></div>";var l={buttons:d,input_layer:f},m=b.popups.create("link.insert",l);return b.$wp&&b.events.$on(b.$wp,"scroll.link-insert",function(){var a=b.image?b.image.get():null;a&&b.popups.isVisible("link.insert")&&u(),c&&b.popups.isVisible("link.insert")&&s()}),m}function m(){var d=c(),e=b.image?b.image.get():null;return b.events.trigger("link.beforeRemove",[d])===!1?!1:void(e&&d?(e.unwrap(),b.image.edit(e)):d&&(b.selection.save(),a(d).replaceWith(a(d).html()),b.selection.restore(),g()))}function n(){b.events.on("keyup",function(b){b.which!=a.FE.KEYCODE.ESC&&e(b)}),b.events.on("window.mouseup",e),b.helpers.isMobile()&&b.events.$on(b.$doc,"selectionchange",e),l(!0),"A"==b.$el.get(0).tagName&&b.$el.addClass("fr-view")}function o(c){var d,e,f=b.opts.linkList[c],g=b.popups.get("link.insert"),h=g.find('input.fr-link-attr[type="text"]'),i=g.find('input.fr-link-attr[type="checkbox"]');for(e=0;e<h.length;e++)d=a(h[e]),f[d.attr("name")]?d.val(f[d.attr("name")]):"text"!=d.attr("name")&&d.val("");for(e=0;e<i.length;e++)d=a(i[e]),d.prop("checked",d.data("checked")==f[d.attr("name")])}function p(){var c,d,e=b.popups.get("link.insert"),f=e.find('input.fr-link-attr[type="text"]'),g=e.find('input.fr-link-attr[type="checkbox"]'),h=f.filter('[name="href"]').val(),i=f.filter('[name="text"]').val(),j={};for(d=0;d<f.length;d++)c=a(f[d]),["href","text"].indexOf(c.attr("name"))<0&&(j[c.attr("name")]=c.val());for(d=0;d<g.length;d++)c=a(g[d]),c.is(":checked")?j[c.attr("name")]=c.data("checked"):j[c.attr("name")]=c.data("unchecked");var k=a(b.o_win).scrollTop();r(h,i,j),a(b.o_win).scrollTop(k)}function q(){if(!b.selection.isCollapsed()){b.selection.save();for(var c=b.$el.find(".fr-marker").addClass("fr-unprocessed").toArray();c.length;){var d=a(c.pop());d.removeClass("fr-unprocessed");var e=b.node.deepestParent(d.get(0));if(e){var f=d.get(0),g="",h="";do f=f.parentNode,b.node.isBlock(f)||(g+=b.node.closeTagString(f),h=b.node.openTagString(f)+h);while(f!=e);var i=b.node.openTagString(d.get(0))+d.html()+b.node.closeTagString(d.get(0));d.replaceWith('<span id="fr-break"></span>');var j=a(e).html();j=j.replace(/<span id="fr-break"><\/span>/g,g+i+h),a(e).html(j)}c=b.$el.find(".fr-marker.fr-unprocessed").toArray()}b.selection.restore()}}function r(f,g,h){"undefined"==typeof h&&(h={});var i=b.image?b.image.get():null;i||"A"==b.$el.get(0).tagName?"A"==b.$el.get(0).tagName&&b.$el.focus():(b.selection.restore(),b.popups.hide("link.insert"));var j=f;if(b.opts.linkConvertEmailAddress){var k=/^[\w._]+@[a-z\u00a1-\uffff0-9_-]+?\.[a-z\u00a1-\uffff0-9]{2,}$/i;k.test(f)&&!/^mailto:.*/i.test(f)&&(f="mailto:"+f)}if(""===b.opts.linkAutoPrefix||/^(mailto|tel|sms|notes|data):.*/i.test(f)||/^data:image.*/i.test(f)||/^(https?:|ftps?:|file:|)\/\//i.test(f)||["/","{","[","#","("].indexOf((f||"")[0])<0&&(f=b.opts.linkAutoPrefix+f),f=b.helpers.sanitizeURL(f),b.opts.linkAlwaysBlank&&(h.target="_blank"),b.opts.linkAlwaysNoFollow&&(h.rel="nofollow"),g=g||"",f===b.opts.linkAutoPrefix){var l=b.popups.get("link.insert");return l.find('input[name="href"]').addClass("fr-error"),b.events.trigger("link.bad",[j]),!1}var m,n=c();if(n){m=a(n);var o=b.node.rawAttributes(n);for(var p in o)o.hasOwnProperty(p)&&"class"!=p&&"style"!=p&&m.removeAttr(p);m.attr("href",f),g.length>0&&m.text()!=g&&!i&&m.text(g),i||m.prepend(a.FE.START_MARKER).append(a.FE.END_MARKER),m.attr(h),i||b.selection.restore()}else{i?i.wrap('<a href="'+f+'"></a>'):(b.format.remove("a"),b.selection.isCollapsed()?(g=0===g.length?j:g,b.html.insert('<a href="'+f+'">'+a.FE.START_MARKER+g+a.FE.END_MARKER+"</a>"),b.selection.restore()):g.length>0&&g!=b.selection.text().replace(/\n/g,"")?(b.selection.remove(),b.html.insert('<a href="'+f+'">'+a.FE.START_MARKER+g+a.FE.END_MARKER+"</a>"),b.selection.restore()):(q(),b.format.apply("a",{href:f})));for(var r=d(),s=0;s<r.length;s++)m=a(r[s]),m.attr(h),m.removeAttr("_moz_dirty");1==r.length&&b.$wp&&!i&&(a(r[0]).prepend(a.FE.START_MARKER).append(a.FE.END_MARKER),b.selection.restore())}if(i){var t=b.popups.get("link.insert");t.find("input:focus").blur(),b.image.edit(i)}else e()}function s(){g();var d=c();if(d){var e=b.popups.get("link.insert");e||(e=l()),b.popups.isVisible("link.insert")||(b.popups.refresh("link.insert"),b.selection.save(),b.helpers.isMobile()&&(b.events.disableBlur(),b.$el.blur(),b.events.enableBlur())),b.popups.setContainer("link.insert",a(b.opts.scrollableContainer));var f=(b.image?b.image.get():null)||a(d),h=f.offset().left+f.outerWidth()/2,i=f.offset().top+f.outerHeight();b.popups.show("link.insert",h,i,f.outerHeight())}}function t(){var a=b.image?b.image.get():null;if(a)b.image.back();else{b.events.disableBlur(),b.selection.restore(),b.events.enableBlur();var d=c();d&&b.$wp?(b.selection.restore(),g(),e()):"A"==b.$el.get(0).tagName?(b.$el.focus(),e()):(b.popups.hide("link.insert"),b.toolbar.showInline())}}function u(){var c=b.image?b.image.get():null;if(c){var d=b.popups.get("link.insert");d||(d=l()),j(!0),b.popups.setContainer("link.insert",a(b.opts.scrollableContainer));var e=c.offset().left+c.outerWidth()/2,f=c.offset().top+c.outerHeight();b.popups.show("link.insert",e,f,c.outerHeight())}}function v(d,f,g){"undefined"==typeof g&&(g=b.opts.linkMultipleStyles),"undefined"==typeof f&&(f=b.opts.linkStyles);var h=c();if(!h)return!1;if(!g){var i=Object.keys(f);i.splice(i.indexOf(d),1),a(h).removeClass(i.join(" "))}a(h).toggleClass(d),e()}return{_init:n,remove:m,showInsertPopup:k,usePredefined:o,insertCallback:p,insert:r,update:s,get:c,allSelected:d,back:t,imageLink:u,applyStyle:v}},a.FE.DefineIcon("insertLink",{NAME:"link"}),a.FE.RegisterShortcut(a.FE.KEYCODE.K,"insertLink",null,"K"),a.FE.RegisterCommand("insertLink",{title:"Insert Link",undo:!1,focus:!0,refreshOnCallback:!1,popup:!0,callback:function(){this.popups.isVisible("link.insert")?(this.$el.find(".fr-marker")&&(this.events.disableBlur(),this.selection.restore()),this.popups.hide("link.insert")):this.link.showInsertPopup()},plugin:"link"}),a.FE.DefineIcon("linkOpen",{NAME:"external-link"}),a.FE.RegisterCommand("linkOpen",{title:"Open Link",undo:!1,refresh:function(a){var b=this.link.get();b?a.removeClass("fr-hidden"):a.addClass("fr-hidden")},callback:function(){var a=this.link.get();a&&this.o_win.open(a.href)}}),a.FE.DefineIcon("linkEdit",{NAME:"edit"}),a.FE.RegisterCommand("linkEdit",{title:"Edit Link",undo:!1,refreshAfterCallback:!1,callback:function(){this.link.update()},refresh:function(a){var b=this.link.get();b?a.removeClass("fr-hidden"):a.addClass("fr-hidden")}}),a.FE.DefineIcon("linkRemove",{NAME:"unlink"}),a.FE.RegisterCommand("linkRemove",{title:"Unlink",callback:function(){this.link.remove()},refresh:function(a){var b=this.link.get();b?a.removeClass("fr-hidden"):a.addClass("fr-hidden")}}),a.FE.DefineIcon("linkBack",{NAME:"arrow-left"}),a.FE.RegisterCommand("linkBack",{title:"Back",undo:!1,focus:!1,back:!0,refreshAfterCallback:!1,callback:function(){this.link.back()},refresh:function(a){var b=this.link.get(),c=this.image?this.image.get():null;c||b||this.opts.toolbarInline?(a.removeClass("fr-hidden"),a.next(".fr-separator").removeClass("fr-hidden")):(a.addClass("fr-hidden"),a.next(".fr-separator").addClass("fr-hidden"))}}),a.FE.DefineIcon("linkList",{NAME:"search"}),a.FE.RegisterCommand("linkList",{title:"Choose Link",type:"dropdown",focus:!1,undo:!1,refreshAfterCallback:!1,html:function(){for(var a='<ul class="fr-dropdown-list">',b=this.opts.linkList,c=0;c<b.length;c++)a+='<li><a class="fr-command" data-cmd="linkList" data-param1="'+c+'">'+(b[c].displayText||b[c].text)+"</a></li>";return a+="</ul>"},callback:function(a,b){this.link.usePredefined(b)}}),a.FE.RegisterCommand("linkInsert",{focus:!1,refreshAfterCallback:!1,callback:function(){this.link.insertCallback()},refresh:function(a){var b=this.link.get();b?a.text(this.language.translate("Update")):a.text(this.language.translate("Insert"))}}),a.FE.DefineIcon("imageLink",{NAME:"link"}),a.FE.RegisterCommand("imageLink",{title:"Insert Link",undo:!1,focus:!1,callback:function(){this.link.imageLink()},refresh:function(a){var b,c=this.link.get();c?(b=a.prev(),b.hasClass("fr-separator")&&b.removeClass("fr-hidden"),a.addClass("fr-hidden")):(b=a.prev(),b.hasClass("fr-separator")&&b.addClass("fr-hidden"),a.removeClass("fr-hidden"))}}),a.FE.DefineIcon("linkStyle",{NAME:"magic"}),a.FE.RegisterCommand("linkStyle",{title:"Style",type:"dropdown",html:function(){var a='<ul class="fr-dropdown-list">',b=this.opts.linkStyles;for(var c in b)b.hasOwnProperty(c)&&(a+='<li><a class="fr-command" data-cmd="linkStyle" data-param1="'+c+'">'+this.language.translate(b[c])+"</a></li>");return a+="</ul>"},callback:function(a,b){this.link.applyStyle(b)},refreshOnShow:function(b,c){var d=this.link.get();if(d){var e=a(d);c.find(".fr-command").each(function(){var b=a(this).data("param1");a(this).toggleClass("fr-active",e.hasClass(b))})}}})}); |
/*! | ||
* froala_editor v2.3.2 (https://www.froala.com/wysiwyg-editor) | ||
* froala_editor v2.3.3 (https://www.froala.com/wysiwyg-editor) | ||
* License https://froala.com/wysiwyg-editor/terms/ | ||
@@ -4,0 +4,0 @@ * Copyright 2014-2016 Froala Labs |
/*! | ||
* froala_editor v2.3.2 (https://www.froala.com/wysiwyg-editor) | ||
* froala_editor v2.3.3 (https://www.froala.com/wysiwyg-editor) | ||
* License https://froala.com/wysiwyg-editor/terms/ | ||
@@ -4,0 +4,0 @@ * Copyright 2014-2016 Froala Labs |
/*! | ||
* froala_editor v2.3.2 (https://www.froala.com/wysiwyg-editor) | ||
* froala_editor v2.3.3 (https://www.froala.com/wysiwyg-editor) | ||
* License https://froala.com/wysiwyg-editor/terms/ | ||
@@ -4,0 +4,0 @@ * Copyright 2014-2016 Froala Labs |
/*! | ||
* froala_editor v2.3.2 (https://www.froala.com/wysiwyg-editor) | ||
* froala_editor v2.3.3 (https://www.froala.com/wysiwyg-editor) | ||
* License https://froala.com/wysiwyg-editor/terms/ | ||
@@ -4,0 +4,0 @@ * Copyright 2014-2016 Froala Labs |
/*! | ||
* froala_editor v2.3.2 (https://www.froala.com/wysiwyg-editor) | ||
* froala_editor v2.3.3 (https://www.froala.com/wysiwyg-editor) | ||
* License https://froala.com/wysiwyg-editor/terms/ | ||
@@ -4,0 +4,0 @@ * Copyright 2014-2016 Froala Labs |
/*! | ||
* froala_editor v2.3.2 (https://www.froala.com/wysiwyg-editor) | ||
* froala_editor v2.3.3 (https://www.froala.com/wysiwyg-editor) | ||
* License https://froala.com/wysiwyg-editor/terms/ | ||
@@ -4,0 +4,0 @@ * Copyright 2014-2016 Froala Labs |
/*! | ||
* froala_editor v2.3.2 (https://www.froala.com/wysiwyg-editor) | ||
* froala_editor v2.3.3 (https://www.froala.com/wysiwyg-editor) | ||
* License https://froala.com/wysiwyg-editor/terms/ | ||
@@ -7,3 +7,3 @@ * Copyright 2014-2016 Froala Labs | ||
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=function(b,c){return void 0===c&&(c="undefined"!=typeof window?require("jquery"):require("jquery")(b)),a(c),c}:a(jQuery)}(function(a){"use strict";a.extend(a.FE.POPUP_TEMPLATES,{"table.insert":"[_BUTTONS_][_ROWS_COLUMNS_]","table.edit":"[_BUTTONS_]","table.colors":"[_BUTTONS_][_COLORS_]"}),a.extend(a.FE.DEFAULTS,{tableInsertMaxSize:10,tableEditButtons:["tableHeader","tableRemove","|","tableRows","tableColumns","tableStyle","-","tableCells","tableCellBackground","tableCellVerticalAlign","tableCellHorizontalAlign","tableCellStyle"],tableInsertButtons:["tableBack","|"],tableResizerOffset:5,tableResizingLimit:30,tableColorsButtons:["tableBack","|"],tableColors:["#61BD6D","#1ABC9C","#54ACD2","#2C82C9","#9365B8","#475577","#CCCCCC","#41A85F","#00A885","#3D8EB9","#2969B0","#553982","#28324E","#000000","#F7DA64","#FBA026","#EB6B56","#E25041","#A38F84","#EFEFEF","#FFFFFF","#FAC51C","#F37934","#D14841","#B8312F","#7C706B","#D1D5D8","REMOVE"],tableColorsStep:7,tableCellStyles:{"fr-highlighted":"Highlighted","fr-thick":"Thick"},tableStyles:{"fr-dashed-borders":"Dashed Borders","fr-alternate-rows":"Alternate Rows"},tableCellMultipleStyles:!0,tableMultipleStyles:!0,tableInsertHelper:!0,tableInsertHelperOffset:15}),a.FE.PLUGINS.table=function(b){function c(){var a=b.$tb.find('.fr-command[data-cmd="insertTable"]'),c=b.popups.get("table.insert");if(c||(c=g()),!c.hasClass("fr-active")){b.popups.refresh("table.insert"),b.popups.setContainer("table.insert",b.$tb);var d=a.offset().left+a.outerWidth()/2,e=a.offset().top+(b.opts.toolbarBottom?10:a.outerHeight()-10);b.popups.show("table.insert",d,e,a.outerHeight())}}function d(){var c=B();if(c){var d=b.popups.get("table.edit");d||(d=i()),b.popups.setContainer("table.edit",a(b.opts.scrollableContainer));var e=I(c),f=(e.left+e.right)/2,g=e.bottom;b.popups.show("table.edit",f,g,e.bottom-e.top),b.edit.isDisabled()&&(b.toolbar.disable(),b.$el.removeClass("fr-no-selection"),b.edit.on(),b.selection.setAtEnd(b.$el.find(".fr-selected-cell:last").get(0)),b.selection.restore(),b.button.bulkRefresh())}}function e(){var c=B();if(c){var d=b.popups.get("table.colors");d||(d=j()),b.popups.setContainer("table.colors",a(b.opts.scrollableContainer));var e=I(c),f=(e.left+e.right)/2,g=e.bottom;l(),b.popups.show("table.colors",f,g,e.bottom-e.top)}}function f(){0===ga().length&&b.toolbar.enable()}function g(c){if(c)return b.popups.onHide("table.insert",function(){b.popups.get("table.insert").find('.fr-table-size .fr-select-table-size > span[data-row="1"][data-col="1"]').trigger("mouseenter")}),!0;var d="";b.opts.tableInsertButtons.length>0&&(d='<div class="fr-buttons">'+b.button.buildList(b.opts.tableInsertButtons)+"</div>");var e={buttons:d,rows_columns:h()},f=b.popups.create("table.insert",e);return b.events.$on(f,"mouseenter",".fr-table-size .fr-select-table-size .fr-table-cell",function(c){var d=a(c.currentTarget),e=d.data("row"),f=d.data("col"),g=d.parent();g.siblings(".fr-table-size-info").html(e+" × "+f),g.find("> span").removeClass("hover");for(var h=1;h<=b.opts.tableInsertMaxSize;h++)for(var i=0;i<=b.opts.tableInsertMaxSize;i++){var j=g.find('> span[data-row="'+h+'"][data-col="'+i+'"]');e>=h&&f>=i?j.addClass("hover"):e+1>=h||2>=h&&!b.helpers.isMobile()?j.css("display","inline-block"):h>2&&!b.helpers.isMobile()&&j.css("display","none")}},!0),f}function h(){for(var a='<div class="fr-table-size"><div class="fr-table-size-info">1 × 1</div><div class="fr-select-table-size">',c=1;c<=b.opts.tableInsertMaxSize;c++){for(var d=1;d<=b.opts.tableInsertMaxSize;d++){var e="inline-block";c>2&&!b.helpers.isMobile()&&(e="none");var f="fr-table-cell ";1==c&&1==d&&(f+=" hover"),a+='<span class="fr-command '+f+'" data-cmd="tableInsert" data-row="'+c+'" data-col="'+d+'" data-param1="'+c+'" data-param2="'+d+'" style="display: '+e+';"><span></span></span>'}a+='<div class="new-line"></div>'}return a+="</div></div>"}function i(a){if(a)return b.popups.onHide("table.edit",f),!0;var c="";b.opts.tableEditButtons.length>0&&(c='<div class="fr-buttons">'+b.button.buildList(b.opts.tableEditButtons)+"</div>");var e={buttons:c},g=b.popups.create("table.edit",e);return b.events.$on(b.$wp,"scroll.table-edit",function(){b.popups.isVisible("table.edit")&&d()}),g}function j(){var a="";b.opts.tableColorsButtons.length>0&&(a='<div class="fr-buttons fr-table-colors-buttons">'+b.button.buildList(b.opts.tableColorsButtons)+"</div>");var c={buttons:a,colors:k()},d=b.popups.create("table.colors",c);return b.events.$on(b.$wp,"scroll.table-colors",function(){b.popups.isVisible("table.colors")&&e()}),d}function k(){for(var a='<div class="fr-table-colors">',c=0;c<b.opts.tableColors.length;c++)0!==c&&c%b.opts.tableColorsStep===0&&(a+="<br>"),a+="REMOVE"!=b.opts.tableColors[c]?'<span class="fr-command" style="background: '+b.opts.tableColors[c]+';" data-cmd="tableCellBackgroundColor" data-param1="'+b.opts.tableColors[c]+'"></span>':'<span class="fr-command" data-cmd="tableCellBackgroundColor" data-param1="REMOVE" title="'+b.language.translate("Clear Formatting")+'"><i class="fa fa-eraser"></i></span>';return a+="</div>"}function l(){var a=b.popups.get("table.colors"),c=b.$el.find(".fr-selected-cell:first");a.find(".fr-selected-color").removeClass("fr-selected-color"),a.find('span[data-param1="'+b.helpers.RGBToHex(c.css("background-color"))+'"]').addClass("fr-selected-color")}function m(c,d){var e,f,g='<table style="width: 100%;"><tbody>',h=100/d;for(e=0;c>e;e++){for(g+="<tr>",f=0;d>f;f++)g+='<td style="width: '+h.toFixed(4)+'%;">',0===e&&0===f&&(g+=a.FE.MARKERS),g+="<br></td>";g+="</tr>"}g+="</tbody></table>",b.html.insert(g),b.selection.restore()}function n(){if(ga().length>0){var a=ha();b.selection.setBefore(a.get(0))||b.selection.setAfter(a.get(0)),b.selection.restore(),b.popups.hide("table.edit"),a.remove(),b.toolbar.enable()}}function o(){var b=ha();if(b.length>0&&0===b.find("th").length){var c,e="<thead><tr>",f=0;for(b.find("tr:first > td").each(function(){var b=a(this);f+=parseInt(b.attr("colspan"),10)||1}),c=0;f>c;c++)e+="<th><br></th>";e+="</tr></thead>",b.prepend(e),d()}}function p(){var a=ha(),c=a.find("thead");if(c.length>0)if(0===a.find("tbody tr").length)n();else if(c.remove(),ga().length>0)d();else{b.popups.hide("table.edit");var e=a.find("tbody tr:first td:first").get(0);e&&(b.selection.setAtEnd(e),b.selection.restore())}}function q(c){var e=ha();if(e.length>0){if(b.$el.find("th.fr-selected-cell").length>0&&"above"==c)return;var f,g,h=B(),i=G(h);g="above"==c?i.min_i:i.max_i;var j="<tr>";for(f=0;f<h[g].length;f++)if("below"==c&&g<h.length-1&&h[g][f]==h[g+1][f]||"above"==c&&g>0&&h[g][f]==h[g-1][f]){if(0===f||f>0&&h[g][f]!=h[g][f-1]){var k=a(h[g][f]);k.attr("rowspan",parseInt(k.attr("rowspan"),10)+1)}}else j+="<td><br></td>";j+="</tr>";var l=a(e.find("tr").not(e.find("table tr")).get(g));"below"==c?l.after(j):"above"==c&&(l.before(j),b.popups.isVisible("table.edit")&&d())}}function r(){var c=ha();if(c.length>0){var d,e,f,g=B(),h=G(g);if(0===h.min_i&&h.max_i==g.length-1)n();else{for(d=h.max_i;d>=h.min_i;d--){for(f=a(c.find("tr").not(c.find("table tr")).get(d)),e=0;e<g[d].length;e++)if(0===e||g[d][e]!=g[d][e-1]){var i=a(g[d][e]);if(parseInt(i.attr("rowspan"),10)>1){var j=parseInt(i.attr("rowspan"),10)-1;1==j?i.removeAttr("rowspan"):i.attr("rowspan",j)}if(d<g.length-1&&g[d][e]==g[d+1][e]&&(0===d||g[d][e]!=g[d-1][e])){for(var k=g[d][e],l=e;l>0&&g[d][l]==g[d][l-1];)l--;0===l?a(c.find("tr").not(c.find("table tr")).get(d+1)).prepend(k):a(g[d+1][l-1]).after(k)}}var m=f.parent();f.remove(),0===m.find("tr").length&&m.remove(),g=B(c)}h.min_i>0?b.selection.setAtEnd(g[h.min_i-1][0]):b.selection.setAtEnd(g[0][0]),b.selection.restore(),b.popups.hide("table.edit")}}}function s(c){var e=ha();if(e.length>0){var f,g=B(),h=G(g);f="before"==c?h.min_j:h.max_j;var i,j=100/g[0].length,k=100/(g[0].length+1);e.find("th, td").each(function(){i=a(this),i.data("old-width",i.outerWidth()/e.outerWidth()*100)}),e.find("tr").not(e.find("table tr")).each(function(b){for(var d,e=a(this),h=0,i=0;f>h-1;){if(d=e.find("> th, > td").get(i),!d){d=null;break}d==g[b][h]?(h+=parseInt(a(d).attr("colspan"),10)||1,i++):(h+=parseInt(a(g[b][h]).attr("colspan"),10)||1,"after"==c&&(d=0===i?-1:e.find("> th, > td").get(i-1)))}var l=a(d);if("after"==c&&h-1>f||"before"==c&&f>0&&g[b][f]==g[b][f-1]){if(0===b||b>0&&g[b][f]!=g[b-1][f]){var m=parseInt(l.attr("colspan"),10)+1;l.attr("colspan",m),l.css("width",(l.data("old-width")*k/j+k).toFixed(4)+"%"),l.removeData("old-width")}}else{var n;n=e.find("th").length>0?'<th style="width: '+k.toFixed(4)+'%;"><br></th>':'<td style="width: '+k.toFixed(4)+'%;"><br></td>',-1==d?e.prepend(n):null==d?e.append(n):"before"==c?l.before(n):"after"==c&&l.after(n)}}),e.find("th, td").each(function(){i=a(this),i.data("old-width")&&(i.css("width",(i.data("old-width")*k/j).toFixed(4)+"%"),i.removeData("old-width"))}),b.popups.isVisible("table.edit")&&d()}}function t(){var c=ha();if(c.length>0){var d,e,f,g=B(),h=G(g);if(0===h.min_j&&h.max_j==g[0].length-1)n();else{var i=100/g[0].length,j=100/(g[0].length-h.max_j+h.min_j-1);for(c.find("th, td").each(function(){f=a(this),f.hasClass("fr-selected-cell")||f.data("old-width",f.outerWidth()/c.outerWidth()*100)}),e=h.max_j;e>=h.min_j;e--)for(d=0;d<g.length;d++)if(0===d||g[d][e]!=g[d-1][e])if(f=a(g[d][e]),parseInt(f.attr("colspan"),10)>1){var k=parseInt(f.attr("colspan"),10)-1;1==k?f.removeAttr("colspan"):f.attr("colspan",k),f.css("width",((f.data("old-width")-$(e,g))*j/i).toFixed(4)+"%"),f.removeData("old-width")}else{var l=a(f.parent().get(0));f.remove(),0===l.find("> th, > td").length&&(0===l.prev().length||0===l.next().length||l.prev().find("> th[rowspan], > td[rowspan]").length<l.prev().find("> th, > td").length)&&l.remove()}h.min_j>0?b.selection.setAtEnd(g[h.min_i][h.min_j-1]):b.selection.setAtEnd(g[h.min_i][0]),b.selection.restore(),b.popups.hide("table.edit"),c.find("th, td").each(function(){f=a(this),f.data("old-width")&&(f.css("width",(f.data("old-width")*j/i).toFixed(4)+"%"),f.removeData("old-width"))})}}}function u(){if(ga().length>1&&(0===b.$el.find("th.fr-selected-cell").length||0===b.$el.find("td.fr-selected-cell").length)){var c,e,f,g=B(),h=G(g),i=b.$el.find(".fr-selected-cell"),j=a(i[0]),k=j.parent(),l=k.find(".fr-selected-cell"),m=j.closest("table"),n=j.html(),o=0;for(c=0;c<l.length;c++)o+=a(l[c]).outerWidth();for(j.css("width",(o/k.outerWidth()*100).toFixed(4)+"%"),h.min_j<h.max_j&&j.attr("colspan",h.max_j-h.min_j+1),h.min_i<h.max_i&&j.attr("rowspan",h.max_i-h.min_i+1),c=1;c<i.length;c++)e=a(i[c]),"<br>"!=e.html()&&""!==e.html()&&(n+="<br>"+e.html()),e.remove();j.html(n),b.selection.setAtEnd(j.get(0)),b.selection.restore(),b.toolbar.enable();var p=m.find("tr:empty");for(c=p.length-1;c>=0;c--)f=a(p[c]),(0===f.prev().length||0===f.next().length||f.prev().find("> th[rowspan], > td[rowspan]").length<f.prev().find("> th, > td").length)&&f.remove();d()}}function v(){if(1==ga().length){var c=b.$el.find(".fr-selected-cell"),d=c.parent(),e=c.closest("table"),f=parseInt(c.attr("rowspan"),10),g=B(),h=C(c.get(0),g),i=c.clone().html("<br>");if(f>1){var j=Math.ceil(f/2);j>1?c.attr("rowspan",j):c.removeAttr("rowspan"),f-j>1?i.attr("rowspan",f-j):i.removeAttr("rowspan");for(var k=h.row+j,l=0===h.col?h.col:h.col-1;l>=0&&(g[k][l]==g[k][l-1]||k>0&&g[k][l]==g[k-1][l]);)l--;-1==l?a(e.find("tr").not(e.find("table tr")).get(k)).prepend(i):a(g[k][l]).after(i)}else{var m,n=a("<tr>").append(i);for(m=0;m<g[0].length;m++)if(0===m||g[h.row][m]!=g[h.row][m-1]){var o=a(g[h.row][m]);o.is(c)||o.attr("rowspan",(parseInt(o.attr("rowspan"),10)||1)+1)}d.after(n)}E(),b.popups.hide("table.edit")}}function w(){if(1==ga().length){var c=b.$el.find(".fr-selected-cell"),d=parseInt(c.attr("colspan"),10)||1,e=c.parent().outerWidth(),f=c.outerWidth(),g=c.clone().html("<br>"),h=B(),i=C(c.get(0),h);if(d>1){var j=Math.ceil(d/2);f=_(i.col,i.col+j-1,h)/e*100;var k=_(i.col+j,i.col+d-1,h)/e*100;j>1?c.attr("colspan",j):c.removeAttr("colspan"),d-j>1?g.attr("colspan",d-j):g.removeAttr("colspan"),c.css("width",f.toFixed(4)+"%"),g.css("width",k.toFixed(4)+"%")}else{var l;for(l=0;l<h.length;l++)if(0===l||h[l][i.col]!=h[l-1][i.col]){var m=a(h[l][i.col]);if(!m.is(c)){var n=(parseInt(m.attr("colspan"),10)||1)+1;m.attr("colspan",n)}}f=f/e*100/2,c.css("width",f.toFixed(4)+"%"),g.css("width",f.toFixed(4)+"%")}c.after(g),E(),b.popups.hide("table.edit")}}function x(a){"REMOVE"!=a?b.$el.find(".fr-selected-cell").css("background-color",b.helpers.HEXtoRGB(a)):b.$el.find(".fr-selected-cell").css("background-color","")}function y(a){b.$el.find(".fr-selected-cell").css("vertical-align",a)}function z(a){b.$el.find(".fr-selected-cell").css("text-align",a)}function A(a,b,c,d){if(b.length>0){if(!c){var e=Object.keys(d);e.splice(e.indexOf(a),1),b.removeClass(e.join(" "))}b.toggleClass(a)}}function B(b){b=b||null;var c=[];if(null==b&&ga().length>0&&(b=ha()),b){var d=a(b);return d.find("tr").not(d.find("table tr")).each(function(b,d){var e=a(d),f=0;e.find("> th, > td").each(function(d,e){for(var g=a(e),h=parseInt(g.attr("colspan"),10)||1,i=parseInt(g.attr("rowspan"),10)||1,j=b;b+i>j;j++)for(var k=f;f+h>k;k++)c[j]||(c[j]=[]),c[j][k]?f++:c[j][k]=e;f+=h})}),c}}function C(a,b){for(var c=0;c<b.length;c++)for(var d=0;d<b[c].length;d++)if(b[c][d]==a)return{row:c,col:d}}function D(a,b,c){for(var d=a+1,e=b+1;d<c.length;){if(c[d][b]!=c[a][b]){d--;break}d++}for(d==c.length&&d--;e<c[a].length;){if(c[a][e]!=c[a][b]){e--;break}e++}return e==c[a].length&&e--,{row:d,col:e}}function E(){var c=b.$el.find(".fr-selected-cell");c.length>0&&c.each(function(){var b=a(this);b.removeClass("fr-selected-cell"),""===b.attr("class")&&b.removeAttr("class")})}function F(){setTimeout(function(){b.selection.clear(),b.$el.addClass("fr-no-selection"),b.$el.blur()},0)}function G(a){var c,d=a.length,e=0,f=a[0].length,g=0,h=b.$el.find(".fr-selected-cell");for(c=0;c<h.length;c++){var i=C(h[c],a),j=D(i.row,i.col,a);d=Math.min(i.row,d),e=Math.max(j.row,e),f=Math.min(i.col,f),g=Math.max(j.col,g)}return{min_i:d,max_i:e,min_j:f,max_j:g}}function H(b,c,d,e,f){var g,h,i,j,k=b,l=c,m=d,n=e;for(g=k;l>=g;g++)((parseInt(a(f[g][m]).attr("rowspan"),10)||1)>1||(parseInt(a(f[g][m]).attr("colspan"),10)||1)>1)&&(i=C(f[g][m],f),j=D(i.row,i.col,f),k=Math.min(i.row,k),l=Math.max(j.row,l),m=Math.min(i.col,m),n=Math.max(j.col,n)),((parseInt(a(f[g][n]).attr("rowspan"),10)||1)>1||(parseInt(a(f[g][n]).attr("colspan"),10)||1)>1)&&(i=C(f[g][n],f),j=D(i.row,i.col,f),k=Math.min(i.row,k),l=Math.max(j.row,l),m=Math.min(i.col,m),n=Math.max(j.col,n));for(h=m;n>=h;h++)((parseInt(a(f[k][h]).attr("rowspan"),10)||1)>1||(parseInt(a(f[k][h]).attr("colspan"),10)||1)>1)&&(i=C(f[k][h],f),j=D(i.row,i.col,f),k=Math.min(i.row,k),l=Math.max(j.row,l),m=Math.min(i.col,m),n=Math.max(j.col,n)),((parseInt(a(f[l][h]).attr("rowspan"),10)||1)>1||(parseInt(a(f[l][h]).attr("colspan"),10)||1)>1)&&(i=C(f[l][h],f),j=D(i.row,i.col,f),k=Math.min(i.row,k),l=Math.max(j.row,l),m=Math.min(i.col,m),n=Math.max(j.col,n));return k==b&&l==c&&m==d&&n==e?{min_i:b,max_i:c,min_j:d,max_j:e}:H(k,l,m,n,f)}function I(b){var c=G(b),d=a(b[c.min_i][c.min_j]),e=a(b[c.min_i][c.max_j]),f=a(b[c.max_i][c.min_j]),g=d.offset().left,h=e.offset().left+e.outerWidth(),i=d.offset().top,j=f.offset().top+f.outerHeight();return{left:g,right:h,top:i,bottom:j}}function J(c,d){if(a(c).is(d))E(),b.edit.on(),a(c).addClass("fr-selected-cell");else{F(),b.edit.off();var e=B(),f=C(c,e),g=C(d,e),h=H(Math.min(f.row,g.row),Math.max(f.row,g.row),Math.min(f.col,g.col),Math.max(f.col,g.col),e);E();for(var i=h.min_i;i<=h.max_i;i++)for(var j=h.min_j;j<=h.max_j;j++)a(e[i][j]).addClass("fr-selected-cell")}}function K(c){var d=null,e=a(c.target);return"TD"==c.target.tagName||"TH"==c.target.tagName?d=c.target:e.closest("td").length>0?d=e.closest("td").get(0):e.closest("th").length>0&&(d=e.closest("th").get(0)),0===b.$el.find(d).length?null:d}function L(){E(),b.popups.hide("table.edit")}function M(c){var d=K(c);if(ga().length>0&&!d&&L(),1!=c.which||1==c.which&&b.helpers.isMac()&&c.ctrlKey)(3==c.which||1==c.which&&b.helpers.isMac()&&c.ctrlKey)&&d&&L();else if(ma=!0,d){ga().length>0&&!c.shiftKey&&L(),c.stopPropagation(),b.events.trigger("image.hideResizer"),b.events.trigger("video.hideResizer"),la=!0;var e=d.tagName.toLowerCase();c.shiftKey&&b.$el.find(e+".fr-selected-cell").length>0?a(b.$el.find(e+".fr-selected-cell").closest("table")).is(a(d).closest("table"))?J(na,d):F():((b.keys.ctrlKey(c)||c.shiftKey)&&F(),na=d,J(na,na))}}function N(c){if(!(1!=c.which||1==c.which&&b.helpers.isMac()&&c.ctrlKey)){if(ma=!1,la){la=!1;var e=K(c);e||1!=ga().length?ga().length>0&&(b.selection.isCollapsed()?d():E()):E()}else b.$tb.is(c.target)||b.$tb.is(a(c.target).closest(b.$tb.get(0)))||(ga().length>0&&b.toolbar.enable(),E());if(pa){pa=!1,ja.removeClass("fr-moving"),b.$el.removeClass("fr-no-selection"),b.edit.on();var f=parseFloat(ja.css("left"))+b.opts.tableResizerOffset;b.opts.iframe&&(f-=b.$iframe.offset().left),ja.data("release-position",f),ja.removeData("max-left"),ja.removeData("max-right"),Z(c),R()}}}function O(c){if(la===!0){var d=a(c.currentTarget);if(d.closest("table").is(ha())){if("TD"==c.currentTarget.tagName&&0===b.$el.find("th.fr-selected-cell").length)return void J(na,c.currentTarget);if("TH"==c.currentTarget.tagName&&0===b.$el.find("td.fr-selected-cell").length)return void J(na,c.currentTarget)}F()}}function P(a){(37==a.which||38==a.which||39==a.which||40==a.which)&&ga().length>0&&L()}function Q(){b.shared.$table_resizer||(b.shared.$table_resizer=a('<div class="fr-table-resizer"><div></div></div>')),ja=b.shared.$table_resizer,b.events.$on(ja,"mousedown",function(a){return b.core.sameInstance(ja)?(ga().length>0&&L(),1==a.which?(pa=!0,ja.addClass("fr-moving"),F(),b.edit.off(),ja.find("div").css("opacity",1),!1):void 0):!0}),b.events.$on(ja,"mousemove",function(a){return b.core.sameInstance(ja)?void(pa&&(b.opts.iframe&&(a.pageX-=b.$iframe.offset().left),aa(a))):!0}),b.events.on("shared.destroy",function(){ja.html("").removeData().remove(),ja=null},!0),b.events.on("destroy",function(){b.$el.find(".fr-selected-cell").removeClass("fr-selected-cell"),ja.hide().appendTo(a("body"))},!0)}function R(){ja&&(ja.find("div").css("opacity",0),ja.css("top",0),ja.css("left",0),ja.css("height",0),ja.find("div").css("height",0),ja.hide())}function S(){ka&&ka.removeClass("fr-visible").css("left","-9999px")}function T(c,d){var e=a(d),f=e.closest("table");if(d&&"TD"!=d.tagName&&"TH"!=d.tagName&&(e.closest("td").length>0?d=e.closest("td"):e.closest("th").length>0&&(d=e.closest("th"))),!d||"TD"!=d.tagName&&"TH"!=d.tagName)ja&&e.get(0)!=ja.get(0)&&e.parent().get(0)!=ja.get(0)&&b.core.sameInstance(ja)&&R();else{if(e=a(d),0===b.$el.find(e).length)return!1;var g=e.offset().left-1,h=g+e.outerWidth();if(Math.abs(c.pageX-g)<=b.opts.tableResizerOffset||Math.abs(h-c.pageX)<=b.opts.tableResizerOffset){var i,j,k,l,m,n=B(f),o=C(d,n),p=D(o.row,o.col,n),q=f.offset().top,r=f.outerHeight()-1;if(o.col>0&&c.pageX-g<=b.opts.tableResizerOffset){k=g;var s=a(n[o.row][o.col-1]);l=1==(parseInt(s.attr("colspan"),10)||1)?s.offset().left-1+b.opts.tableResizingLimit:g-$(o.col-1,n)+b.opts.tableResizingLimit,m=1==(parseInt(e.attr("colspan"),10)||1)?g+e.outerWidth()-b.opts.tableResizingLimit:g+$(o.col,n)-b.opts.tableResizingLimit,i=o.col-1,j=o.col}else if(h-c.pageX<=b.opts.tableResizerOffset)if(k=h,p.col<n[p.row].length&&n[p.row][p.col+1]){var t=a(n[p.row][p.col+1]);l=1==(parseInt(e.attr("colspan"),10)||1)?g+b.opts.tableResizingLimit:h-$(p.col,n)+b.opts.tableResizingLimit,m=1==(parseInt(t.attr("colspan"),10)||1)?h+t.outerWidth()-b.opts.tableResizingLimit:h+$(o.col+1,n)-b.opts.tableResizingLimit,i=p.col,j=p.col+1}else{i=p.col,j=null;var u=f.parent();l=f.offset().left-1+n[0].length*b.opts.tableResizingLimit,m=u.offset().left-1+u.width()+parseFloat(u.css("padding-left"))}ja||Q(),ja.data("table",f),ja.data("first",i),ja.data("second",j),ja.data("instance",b),b.$wp.append(ja);var v=k-b.win.pageXOffset-b.opts.tableResizerOffset,w=q-b.win.pageYOffset;b.opts.iframe&&(v+=b.$iframe.offset().left-a(b.o_win).scrollLeft(),w+=b.$iframe.offset().top-a(b.o_win).scrollTop(),l+=b.$iframe.offset().left,m+=b.$iframe.offset().left),ja.data("max-left",l),ja.data("max-right",m),ja.data("origin",k-b.win.pageXOffset),ja.css("top",w),ja.css("left",v),ja.css("height",r),ja.find("div").css("height",r),ja.css("padding-left",b.opts.tableResizerOffset),ja.css("padding-right",b.opts.tableResizerOffset),ja.show()}else b.core.sameInstance(ja)&&R()}}function U(c,d){if(b.$box.find(".fr-line-breaker").is(":visible"))return!1;ka||da(),b.$box.append(ka),ka.data("instance",b);var e=a(d),f=e.find("tr:first"),g=c.pageX,h=0,i=0;b.opts.iframe&&(h+=b.$iframe.offset().left-a(b.o_win).scrollLeft(),i+=b.$iframe.offset().top-a(b.o_win).scrollTop());var j;f.find("th, td").each(function(){var c=a(this);return c.offset().left<=g&&g<c.offset().left+c.outerWidth()/2?(j=parseInt(ka.find("a").css("width"),10),ka.css("top",i+c.offset().top-b.win.pageYOffset-j-5),ka.css("left",h+c.offset().left-b.win.pageXOffset-j/2),ka.data("selected-cell",c),ka.data("position","before"),ka.addClass("fr-visible"),!1):c.offset().left+c.outerWidth()/2<=g&&g<c.offset().left+c.outerWidth()?(j=parseInt(ka.find("a").css("width"),10),ka.css("top",i+c.offset().top-b.win.pageYOffset-j-5),ka.css("left",h+c.offset().left+c.outerWidth()-b.win.pageXOffset-j/2),ka.data("selected-cell",c),ka.data("position","after"),ka.addClass("fr-visible"),!1):void 0})}function V(c,d){if(b.$box.find(".fr-line-breaker").is(":visible"))return!1;ka||da(),b.$box.append(ka),ka.data("instance",b);var e=a(d),f=c.pageY,g=0,h=0;b.opts.iframe&&(g+=b.$iframe.offset().left-a(b.o_win).scrollLeft(),h+=b.$iframe.offset().top-a(b.o_win).scrollTop());var i;e.find("tr").each(function(){var c=a(this);return c.offset().top<=f&&f<c.offset().top+c.outerHeight()/2?(i=parseInt(ka.find("a").css("width"),10),ka.css("top",h+c.offset().top-b.win.pageYOffset-i/2),ka.css("left",g+c.offset().left-b.win.pageXOffset-i-5),ka.data("selected-cell",c.find("td:first")),ka.data("position","above"),ka.addClass("fr-visible"),!1):c.offset().top+c.outerHeight()/2<=f&&f<c.offset().top+c.outerHeight()?(i=parseInt(ka.find("a").css("width"),10),ka.css("top",h+c.offset().top+c.outerHeight()-b.win.pageYOffset-i/2),ka.css("left",g+c.offset().left-b.win.pageXOffset-i-5),ka.data("selected-cell",c.find("td:first")),ka.data("position","below"),ka.addClass("fr-visible"),!1):void 0})}function W(c,d){if(0===ga().length){var e,f,g;if(d&&("HTML"==d.tagName||"BODY"==d.tagName||b.node.isElement(d)))for(e=1;e<=b.opts.tableInsertHelperOffset;e++){if(f=b.doc.elementFromPoint(c.pageX-b.win.pageXOffset,c.pageY-b.win.pageYOffset+e),a(f).hasClass("fr-tooltip"))return!0;if(f&&("TH"==f.tagName||"TD"==f.tagName||"TABLE"==f.tagName)&&(a(f).parents(".fr-wrapper").length||b.opts.iframe))return U(c,f.closest("table")),!0;if(g=b.doc.elementFromPoint(c.pageX-b.win.pageXOffset+e,c.pageY-b.win.pageYOffset),a(g).hasClass("fr-tooltip"))return!0;if(g&&("TH"==g.tagName||"TD"==g.tagName||"TABLE"==g.tagName)&&(a(g).parents(".fr-wrapper").length||b.opts.iframe))return V(c,g.closest("table")),!0}b.core.sameInstance(ka)&&S()}}function X(a){oa=null;var c=b.doc.elementFromPoint(a.pageX-b.win.pageXOffset,a.pageY-b.win.pageYOffset);(!b.popups.areVisible()||b.popups.areVisible()&&b.popups.isVisible("table.edit"))&&T(a,c),b.popups.areVisible()||b.$tb.hasClass("fr-inline")&&b.$tb.is(":visible")||W(a,c)}function Y(){if(pa){var c=ja.data("table"),d=c.offset().top-b.win.pageYOffset;b.opts.iframe&&(d+=b.$iframe.offset().top-a(b.o_win).scrollTop()),ja.css("top",d)}}function Z(){var c=ja.data("origin"),d=ja.data("release-position");if(c!==d){var e=ja.data("first"),f=ja.data("second"),g=ja.data("table"),h=g.outerWidth();if(null!==e&&null!==f){var i,j,k,l=B(g),m=[],n=[],o=[],p=[];for(i=0;i<l.length;i++)j=a(l[i][e]),k=a(l[i][f]),m[i]=j.outerWidth(),o[i]=k.outerWidth(),n[i]=m[i]/h*100,p[i]=o[i]/h*100;for(i=0;i<l.length;i++){j=a(l[i][e]),k=a(l[i][f]);var q=(n[i]*(m[i]+d-c)/m[i]).toFixed(4);j.css("width",q+"%"),k.css("width",(n[i]+p[i]-q).toFixed(4)+"%")}}else{var r,s=g.parent(),t=h/s.width()*100;r=null==e?(h-d+c)/h*t:(h+d-c)/h*t,g.css("width",Math.round(r).toFixed(4)+"%")}}ja.removeData("origin"),ja.removeData("release-position"),ja.removeData("first"),ja.removeData("second"),ja.removeData("table"),b.undo.saveStep()}function $(b,c){var d,e=a(c[0][b]).outerWidth();for(d=1;d<c.length;d++)e=Math.min(e,a(c[d][b]).outerWidth());return e}function _(a,b,c){var d,e=0;for(d=a;b>=d;d++)e+=$(d,c);return e}function aa(a){if(ga().length>1&&ma&&F(),ma===!1&&la===!1&&pa===!1)oa&&clearTimeout(oa),oa=setTimeout(X,30,a);else if(pa){var c=a.pageX-b.win.pageXOffset;b.opts.iframe&&(c+=b.$iframe.offset().left);var d=ja.data("max-left"),e=ja.data("max-right");c>=d&&e>=c?ja.css("left",c-b.opts.tableResizerOffset):d>c&&parseFloat(ja.css("left"),10)>d-b.opts.tableResizerOffset?ja.css("left",d-b.opts.tableResizerOffset):c>e&&parseFloat(ja.css("left"),10)<e-b.opts.tableResizerOffset&&ja.css("left",e-b.opts.tableResizerOffset)}else ma&&S()}function ba(c){b.node.isEmpty(c.get(0))?c.prepend(a.FE.MARKERS):c.prepend(a.FE.START_MARKER).append(a.FE.END_MARKER)}function ca(c){var d=c.which;if(d==a.FE.KEYCODE.TAB&&0===b.opts.tabSpaces){var e;if(ga().length>0)e=b.$el.find(".fr-selected-cell:last");else{var f=b.selection.element();"TD"==f.tagName||"TH"==f.tagName?e=a(f):a(f).closest("td").length>0?e=a(f).closest("td"):a(f).closest("th").length>0&&(e=a(f).closest("th"))}e&&(c.preventDefault(),L(),c.shiftKey?e.prev().length>0?ba(e.prev()):e.closest("tr").length>0&&e.closest("tr").prev().length>0?ba(e.closest("tr").prev().find("td:last")):e.closest("tbody").length>0&&e.closest("table").find("thead tr").length>0&&ba(e.closest("table").find("thead tr th:last")):e.next().length>0?ba(e.next()):e.closest("tr").length>0&&e.closest("tr").next().length>0?ba(e.closest("tr").next().find("td:first")):e.closest("thead").length>0&&e.closest("table").find("tbody tr").length>0?ba(e.closest("table").find("tbody tr td:first")):(e.addClass("fr-selected-cell"),q("below"),E(),ba(e.closest("tr").next().find("td:first"))),b.selection.restore())}}function da(){b.shared.$ti_helper||(b.shared.$ti_helper=a('<div class="fr-insert-helper"><a class="fr-floating-btn" role="button" tabindex="-1" title="'+b.language.translate("Insert")+'"><svg viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"><path d="M22,16.75 L16.75,16.75 L16.75,22 L15.25,22.000 L15.25,16.75 L10,16.75 L10,15.25 L15.25,15.25 L15.25,10 L16.75,10 L16.75,15.25 L22,15.25 L22,16.75 Z"/></svg></a></div>'),b.events.bindClick(b.shared.$ti_helper,"a",function(){var a=ka.data("selected-cell"),c=ka.data("position"),d=ka.data("instance")||b;"before"==c?(a.addClass("fr-selected-cell"),d.table.insertColumn(c),a.removeClass("fr-selected-cell")):"after"==c?(a.addClass("fr-selected-cell"),d.table.insertColumn(c),a.removeClass("fr-selected-cell")):"above"==c?(a.addClass("fr-selected-cell"),d.table.insertRow(c),a.removeClass("fr-selected-cell")):"below"==c&&(a.addClass("fr-selected-cell"),d.table.insertRow(c),a.removeClass("fr-selected-cell")),S()}),b.events.on("shared.destroy",function(){b.shared.$ti_helper.html("").removeData().remove(),b.shared.$ti_helper=null},!0),b.events.$on(b.shared.$ti_helper,"mousemove",function(a){a.stopPropagation()},!0),b.events.$on(a(b.o_win),"scroll",function(){S()},!0),b.events.$on(b.$wp,"scroll",function(){S()},!0)),ka=b.shared.$ti_helper,b.events.on("destroy",function(){ka=null}),b.tooltip.bind(b.$box,".fr-insert-helper > a.fr-floating-btn")}function ea(){na=null,clearTimeout(oa)}function fa(){ga().length>0?d():(b.popups.hide("table.insert"),b.toolbar.showInline())}function ga(){return b.$el.get(0).querySelectorAll(".fr-selected-cell")}function ha(){var c=ga();if(c.length){for(var d=c[0];d&&"TABLE"!=d.tagName&&d.parentNode!=b.$el.get(0);)d=d.parentNode;return a(d&&"TABLE"==d.tagName?d:[])}}function ia(){if(!b.$wp)return!1;if(!b.helpers.isMobile()){ma=!1,la=!1,pa=!1,b.events.$on(b.$el,"mousedown",M),b.popups.onShow("image.edit",function(){E(),ma=!1,la=!1}),b.popups.onShow("link.edit",function(){E(),ma=!1,la=!1}),b.events.on("commands.mousedown",function(a){a.parents(".fr-toolbar").length>0&&E()}),b.events.$on(b.$el,"mouseenter","th, td",O),b.events.$on(b.$win,"mouseup",N),b.opts.iframe&&b.events.$on(a(b.o_win),"mouseup",N),b.events.$on(b.$el,"keydown",P),b.events.$on(b.$win,"mousemove",aa),b.events.$on(a(b.o_win),"scroll",Y),b.events.on("contentChanged",function(){ga().length>0&&(d(),b.$el.find("img").on("load.selected-cells",function(){a(this).off("load.selected-cells"),ga().length>0&&d()}))}),b.events.$on(a(b.o_win),"resize",function(){E()}),b.events.on("keydown",function(c){var d=ga();if(d.length>0){if(c.which==a.FE.KEYCODE.ESC&&b.popups.isVisible("table.edit"))return E(),b.popups.hide("table.edit"),c.preventDefault(),c.stopPropagation(),c.stopImmediatePropagation(),d=[],!1;if(c.which==a.FE.KEYCODE.BACKSPACE){b.undo.saveStep();for(var e=0;e<d.length;e++)a(d[e]).html("");return b.undo.saveStep(),d=[],!1}if(d.length>1&&!b.keys.ctrlKey(c))return c.preventDefault(),d=[],!1}d=[]},!0);var c=[];b.events.on("html.beforeGet",function(){c=ga();for(var a=0;a<c.length;a++)c[a].className=(c[a].className||"").replace(/fr-selected-cell/g,"")}),b.events.on("html.get",function(a){return a=a.replace(/<(td|th)((?:[\w\W]*?)) class=""((?:[\w\W]*?))>((?:[\w\W]*?))<\/(td|th)>/g,"<$1$2$3>$4</$5>")}),b.events.on("html.afterGet",function(){for(var a=0;a<c.length;a++)c[a].className=(c[a].className?c[a].className+" ":"")+"fr-selected-cell";c=[]}),g(!0),i(!0)}b.events.on("keydown",ca,!0),b.events.on("destroy",ea)}var ja,ka,la,ma,na,oa,pa;return{_init:ia,insert:m,remove:n,insertRow:q,deleteRow:r,insertColumn:s,deleteColumn:t,mergeCells:u,splitCellVertically:w,splitCellHorizontally:v,addHeader:o,removeHeader:p,setBackground:x,showInsertPopup:c,showEditPopup:d,showColorsPopup:e,back:fa,verticalAlign:y,horizontalAlign:z,applyStyle:A,selectedTable:ha,selectedCells:ga}},a.FE.DefineIcon("insertTable",{NAME:"table"}),a.FE.RegisterCommand("insertTable",{title:"Insert Table",undo:!1,focus:!0,refreshOnCallback:!1,popup:!0,callback:function(){this.popups.isVisible("table.insert")?(this.$el.find(".fr-marker")&&(this.events.disableBlur(),this.selection.restore()),this.popups.hide("table.insert")):this.table.showInsertPopup()},plugin:"table"}),a.FE.RegisterCommand("tableInsert",{callback:function(a,b,c){this.table.insert(b,c),this.popups.hide("table.insert")}}),a.FE.DefineIcon("tableHeader",{NAME:"header"}),a.FE.RegisterCommand("tableHeader",{title:"Table Header",focus:!1,callback:function(){var a=this.popups.get("table.edit").find('.fr-command[data-cmd="tableHeader"]');a.hasClass("fr-active")?this.table.removeHeader():this.table.addHeader()},refresh:function(a){var b=this.table.selectedTable();b.length>0&&(0===b.find("th").length?a.removeClass("fr-active"):a.addClass("fr-active"))}}),a.FE.DefineIcon("tableRows",{NAME:"bars"}),a.FE.RegisterCommand("tableRows",{type:"dropdown",focus:!1,title:"Row",options:{above:"Insert row above",below:"Insert row below","delete":"Delete row"},html:function(){var b='<ul class="fr-dropdown-list">',c=a.FE.COMMANDS.tableRows.options;for(var d in c)c.hasOwnProperty(d)&&(b+='<li><a class="fr-command" data-cmd="tableRows" data-param1="'+d+'" title="'+this.language.translate(c[d])+'">'+this.language.translate(c[d])+"</a></li>");return b+="</ul>"},callback:function(a,b){"above"==b||"below"==b?this.table.insertRow(b):this.table.deleteRow()}}),a.FE.DefineIcon("tableColumns",{NAME:"bars fa-rotate-90"}),a.FE.RegisterCommand("tableColumns",{type:"dropdown",focus:!1,title:"Column",options:{before:"Insert column before",after:"Insert column after","delete":"Delete column"},html:function(){var b='<ul class="fr-dropdown-list">',c=a.FE.COMMANDS.tableColumns.options;for(var d in c)c.hasOwnProperty(d)&&(b+='<li><a class="fr-command" data-cmd="tableColumns" data-param1="'+d+'" title="'+this.language.translate(c[d])+'">'+this.language.translate(c[d])+"</a></li>"); | ||
return b+="</ul>"},callback:function(a,b){"before"==b||"after"==b?this.table.insertColumn(b):this.table.deleteColumn()}}),a.FE.DefineIcon("tableCells",{NAME:"square-o"}),a.FE.RegisterCommand("tableCells",{type:"dropdown",focus:!1,title:"Cell",options:{merge:"Merge cells","vertical-split":"Vertical split","horizontal-split":"Horizontal split"},html:function(){var b='<ul class="fr-dropdown-list">',c=a.FE.COMMANDS.tableCells.options;for(var d in c)c.hasOwnProperty(d)&&(b+='<li><a class="fr-command" data-cmd="tableCells" data-param1="'+d+'" title="'+this.language.translate(c[d])+'">'+this.language.translate(c[d])+"</a></li>");return b+="</ul>"},callback:function(a,b){"merge"==b?this.table.mergeCells():"vertical-split"==b?this.table.splitCellVertically():this.table.splitCellHorizontally()},refreshOnShow:function(a,b){this.$el.find(".fr-selected-cell").length>1?(b.find('a[data-param1="vertical-split"]').addClass("fr-disabled"),b.find('a[data-param1="horizontal-split"]').addClass("fr-disabled"),b.find('a[data-param1="merge"]').removeClass("fr-disabled")):(b.find('a[data-param1="merge"]').addClass("fr-disabled"),b.find('a[data-param1="vertical-split"]').removeClass("fr-disabled"),b.find('a[data-param1="horizontal-split"]').removeClass("fr-disabled"))}}),a.FE.DefineIcon("tableRemove",{NAME:"trash"}),a.FE.RegisterCommand("tableRemove",{title:"Remove Table",focus:!1,callback:function(){this.table.remove()}}),a.FE.DefineIcon("tableStyle",{NAME:"paint-brush"}),a.FE.RegisterCommand("tableStyle",{title:"Table Style",type:"dropdown",focus:!1,html:function(){var a='<ul class="fr-dropdown-list">',b=this.opts.tableStyles;for(var c in b)b.hasOwnProperty(c)&&(a+='<li><a class="fr-command" data-cmd="tableStyle" data-param1="'+c+'" title="'+this.language.translate(b[c])+'">'+this.language.translate(b[c])+"</a></li>");return a+="</ul>"},callback:function(a,b){this.table.applyStyle(b,this.$el.find(".fr-selected-cell").closest("table"),this.opts.tableMultipleStyles,this.opts.tableStyles)},refreshOnShow:function(b,c){var d=this.$el.find(".fr-selected-cell").closest("table");d&&c.find(".fr-command").each(function(){var b=a(this).data("param1");a(this).toggleClass("fr-active",d.hasClass(b))})}}),a.FE.DefineIcon("tableCellBackground",{NAME:"tint"}),a.FE.RegisterCommand("tableCellBackground",{title:"Cell Background",focus:!1,callback:function(){this.table.showColorsPopup()}}),a.FE.RegisterCommand("tableCellBackgroundColor",{undo:!0,focus:!1,callback:function(a,b){this.table.setBackground(b)}}),a.FE.DefineIcon("tableBack",{NAME:"arrow-left"}),a.FE.RegisterCommand("tableBack",{title:"Back",undo:!1,focus:!1,back:!0,callback:function(){this.table.back()},refresh:function(a){0!==this.table.selectedCells().length||this.opts.toolbarInline?(a.removeClass("fr-hidden"),a.next(".fr-separator").removeClass("fr-hidden")):(a.addClass("fr-hidden"),a.next(".fr-separator").addClass("fr-hidden"))}}),a.FE.DefineIcon("tableCellVerticalAlign",{NAME:"arrows-v"}),a.FE.RegisterCommand("tableCellVerticalAlign",{type:"dropdown",focus:!1,title:"Vertical Align",options:{Top:"Align Top",Middle:"Align Middle",Bottom:"Align Bottom"},html:function(){var b='<ul class="fr-dropdown-list">',c=a.FE.COMMANDS.tableCellVerticalAlign.options;for(var d in c)c.hasOwnProperty(d)&&(b+='<li><a class="fr-command" data-cmd="tableCellVerticalAlign" data-param1="'+d.toLowerCase()+'" title="'+this.language.translate(c[d])+'">'+this.language.translate(d)+"</a></li>");return b+="</ul>"},callback:function(a,b){this.table.verticalAlign(b)},refreshOnShow:function(a,b){b.find('.fr-command[data-param1="'+this.$el.find(".fr-selected-cell").css("vertical-align")+'"]').addClass("fr-active")}}),a.FE.DefineIcon("tableCellHorizontalAlign",{NAME:"align-left"}),a.FE.DefineIcon("align-left",{NAME:"align-left"}),a.FE.DefineIcon("align-right",{NAME:"align-right"}),a.FE.DefineIcon("align-center",{NAME:"align-center"}),a.FE.DefineIcon("align-justify",{NAME:"align-justify"}),a.FE.RegisterCommand("tableCellHorizontalAlign",{type:"dropdown",focus:!1,title:"Horizontal Align",options:{left:"Align Left",center:"Align Center",right:"Align Right",justify:"Align Justify"},html:function(){var b='<ul class="fr-dropdown-list">',c=a.FE.COMMANDS.tableCellHorizontalAlign.options;for(var d in c)c.hasOwnProperty(d)&&(b+='<li><a class="fr-command fr-title" data-cmd="tableCellHorizontalAlign" data-param1="'+d+'" title="'+this.language.translate(c[d])+'">'+this.icon.create("align-"+d)+"</a></li>");return b+="</ul>"},callback:function(a,b){this.table.horizontalAlign(b)},refresh:function(b){var c=this.table.selectedCells();c.length&&b.find("> *:first").replaceWith(this.icon.create("align-"+this.helpers.getAlignment(a(c[0]))))},refreshOnShow:function(a,b){b.find('.fr-command[data-param1="'+this.helpers.getAlignment(this.$el.find(".fr-selected-cell:first"))+'"]').addClass("fr-active")}}),a.FE.DefineIcon("tableCellStyle",{NAME:"magic"}),a.FE.RegisterCommand("tableCellStyle",{title:"Cell Style",type:"dropdown",focus:!1,html:function(){var a='<ul class="fr-dropdown-list">',b=this.opts.tableCellStyles;for(var c in b)b.hasOwnProperty(c)&&(a+='<li><a class="fr-command" data-cmd="tableCellStyle" data-param1="'+c+'" title="'+this.language.translate(b[c])+'">'+this.language.translate(b[c])+"</a></li>");return a+="</ul>"},callback:function(a,b){this.table.applyStyle(b,this.$el.find(".fr-selected-cell"),this.opts.tableCellMultipleStyles,this.opts.tableCellStyles)},refreshOnShow:function(b,c){var d=this.$el.find(".fr-selected-cell:first");d&&c.find(".fr-command").each(function(){var b=a(this).data("param1");a(this).toggleClass("fr-active",d.hasClass(b))})}})}); | ||
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=function(b,c){return void 0===c&&(c="undefined"!=typeof window?require("jquery"):require("jquery")(b)),a(c),c}:a(jQuery)}(function(a){"use strict";a.extend(a.FE.POPUP_TEMPLATES,{"table.insert":"[_BUTTONS_][_ROWS_COLUMNS_]","table.edit":"[_BUTTONS_]","table.colors":"[_BUTTONS_][_COLORS_]"}),a.extend(a.FE.DEFAULTS,{tableInsertMaxSize:10,tableEditButtons:["tableHeader","tableRemove","|","tableRows","tableColumns","tableStyle","-","tableCells","tableCellBackground","tableCellVerticalAlign","tableCellHorizontalAlign","tableCellStyle"],tableInsertButtons:["tableBack","|"],tableResizer:!0,tableResizerOffset:5,tableResizingLimit:30,tableColorsButtons:["tableBack","|"],tableColors:["#61BD6D","#1ABC9C","#54ACD2","#2C82C9","#9365B8","#475577","#CCCCCC","#41A85F","#00A885","#3D8EB9","#2969B0","#553982","#28324E","#000000","#F7DA64","#FBA026","#EB6B56","#E25041","#A38F84","#EFEFEF","#FFFFFF","#FAC51C","#F37934","#D14841","#B8312F","#7C706B","#D1D5D8","REMOVE"],tableColorsStep:7,tableCellStyles:{"fr-highlighted":"Highlighted","fr-thick":"Thick"},tableStyles:{"fr-dashed-borders":"Dashed Borders","fr-alternate-rows":"Alternate Rows"},tableCellMultipleStyles:!0,tableMultipleStyles:!0,tableInsertHelper:!0,tableInsertHelperOffset:15}),a.FE.PLUGINS.table=function(b){function c(){var a=b.$tb.find('.fr-command[data-cmd="insertTable"]'),c=b.popups.get("table.insert");if(c||(c=g()),!c.hasClass("fr-active")){b.popups.refresh("table.insert"),b.popups.setContainer("table.insert",b.$tb);var d=a.offset().left+a.outerWidth()/2,e=a.offset().top+(b.opts.toolbarBottom?10:a.outerHeight()-10);b.popups.show("table.insert",d,e,a.outerHeight())}}function d(){var c=B();if(c){var d=b.popups.get("table.edit");d||(d=i()),b.popups.setContainer("table.edit",a(b.opts.scrollableContainer));var e=I(c),f=(e.left+e.right)/2,g=e.bottom;b.popups.show("table.edit",f,g,e.bottom-e.top),b.edit.isDisabled()&&(b.toolbar.disable(),b.$el.removeClass("fr-no-selection"),b.edit.on(),b.selection.setAtEnd(b.$el.find(".fr-selected-cell:last").get(0)),b.selection.restore(),b.button.bulkRefresh())}}function e(){var c=B();if(c){var d=b.popups.get("table.colors");d||(d=j()),b.popups.setContainer("table.colors",a(b.opts.scrollableContainer));var e=I(c),f=(e.left+e.right)/2,g=e.bottom;l(),b.popups.show("table.colors",f,g,e.bottom-e.top)}}function f(){0===ga().length&&b.toolbar.enable()}function g(c){if(c)return b.popups.onHide("table.insert",function(){b.popups.get("table.insert").find('.fr-table-size .fr-select-table-size > span[data-row="1"][data-col="1"]').trigger("mouseenter")}),!0;var d="";b.opts.tableInsertButtons.length>0&&(d='<div class="fr-buttons">'+b.button.buildList(b.opts.tableInsertButtons)+"</div>");var e={buttons:d,rows_columns:h()},f=b.popups.create("table.insert",e);return b.events.$on(f,"mouseenter",".fr-table-size .fr-select-table-size .fr-table-cell",function(c){var d=a(c.currentTarget),e=d.data("row"),f=d.data("col"),g=d.parent();g.siblings(".fr-table-size-info").html(e+" × "+f),g.find("> span").removeClass("hover");for(var h=1;h<=b.opts.tableInsertMaxSize;h++)for(var i=0;i<=b.opts.tableInsertMaxSize;i++){var j=g.find('> span[data-row="'+h+'"][data-col="'+i+'"]');e>=h&&f>=i?j.addClass("hover"):e+1>=h||2>=h&&!b.helpers.isMobile()?j.css("display","inline-block"):h>2&&!b.helpers.isMobile()&&j.css("display","none")}},!0),f}function h(){for(var a='<div class="fr-table-size"><div class="fr-table-size-info">1 × 1</div><div class="fr-select-table-size">',c=1;c<=b.opts.tableInsertMaxSize;c++){for(var d=1;d<=b.opts.tableInsertMaxSize;d++){var e="inline-block";c>2&&!b.helpers.isMobile()&&(e="none");var f="fr-table-cell ";1==c&&1==d&&(f+=" hover"),a+='<span class="fr-command '+f+'" data-cmd="tableInsert" data-row="'+c+'" data-col="'+d+'" data-param1="'+c+'" data-param2="'+d+'" style="display: '+e+';"><span></span></span>'}a+='<div class="new-line"></div>'}return a+="</div></div>"}function i(a){if(a)return b.popups.onHide("table.edit",f),!0;var c="";b.opts.tableEditButtons.length>0&&(c='<div class="fr-buttons">'+b.button.buildList(b.opts.tableEditButtons)+"</div>");var e={buttons:c},g=b.popups.create("table.edit",e);return b.events.$on(b.$wp,"scroll.table-edit",function(){b.popups.isVisible("table.edit")&&d()}),g}function j(){var a="";b.opts.tableColorsButtons.length>0&&(a='<div class="fr-buttons fr-table-colors-buttons">'+b.button.buildList(b.opts.tableColorsButtons)+"</div>");var c={buttons:a,colors:k()},d=b.popups.create("table.colors",c);return b.events.$on(b.$wp,"scroll.table-colors",function(){b.popups.isVisible("table.colors")&&e()}),d}function k(){for(var a='<div class="fr-table-colors">',c=0;c<b.opts.tableColors.length;c++)0!==c&&c%b.opts.tableColorsStep===0&&(a+="<br>"),a+="REMOVE"!=b.opts.tableColors[c]?'<span class="fr-command" style="background: '+b.opts.tableColors[c]+';" data-cmd="tableCellBackgroundColor" data-param1="'+b.opts.tableColors[c]+'"></span>':'<span class="fr-command" data-cmd="tableCellBackgroundColor" data-param1="REMOVE" title="'+b.language.translate("Clear Formatting")+'"><i class="fa fa-eraser"></i></span>';return a+="</div>"}function l(){var a=b.popups.get("table.colors"),c=b.$el.find(".fr-selected-cell:first");a.find(".fr-selected-color").removeClass("fr-selected-color"),a.find('span[data-param1="'+b.helpers.RGBToHex(c.css("background-color"))+'"]').addClass("fr-selected-color")}function m(c,d){var e,f,g='<table style="width: 100%;"><tbody>',h=100/d;for(e=0;c>e;e++){for(g+="<tr>",f=0;d>f;f++)g+='<td style="width: '+h.toFixed(4)+'%;">',0===e&&0===f&&(g+=a.FE.MARKERS),g+="<br></td>";g+="</tr>"}g+="</tbody></table>",b.html.insert(g),b.selection.restore()}function n(){if(ga().length>0){var a=ha();b.selection.setBefore(a.get(0))||b.selection.setAfter(a.get(0)),b.selection.restore(),b.popups.hide("table.edit"),a.remove(),b.toolbar.enable()}}function o(){var b=ha();if(b.length>0&&0===b.find("th").length){var c,e="<thead><tr>",f=0;for(b.find("tr:first > td").each(function(){var b=a(this);f+=parseInt(b.attr("colspan"),10)||1}),c=0;f>c;c++)e+="<th><br></th>";e+="</tr></thead>",b.prepend(e),d()}}function p(){var a=ha(),c=a.find("thead");if(c.length>0)if(0===a.find("tbody tr").length)n();else if(c.remove(),ga().length>0)d();else{b.popups.hide("table.edit");var e=a.find("tbody tr:first td:first").get(0);e&&(b.selection.setAtEnd(e),b.selection.restore())}}function q(c){var e=ha();if(e.length>0){if(b.$el.find("th.fr-selected-cell").length>0&&"above"==c)return;var f,g,h=B(),i=G(h);g="above"==c?i.min_i:i.max_i;var j="<tr>";for(f=0;f<h[g].length;f++)if("below"==c&&g<h.length-1&&h[g][f]==h[g+1][f]||"above"==c&&g>0&&h[g][f]==h[g-1][f]){if(0===f||f>0&&h[g][f]!=h[g][f-1]){var k=a(h[g][f]);k.attr("rowspan",parseInt(k.attr("rowspan"),10)+1)}}else j+="<td><br></td>";j+="</tr>";var l=a(e.find("tr").not(e.find("table tr")).get(g));"below"==c?l.after(j):"above"==c&&(l.before(j),b.popups.isVisible("table.edit")&&d())}}function r(){var c=ha();if(c.length>0){var d,e,f,g=B(),h=G(g);if(0===h.min_i&&h.max_i==g.length-1)n();else{for(d=h.max_i;d>=h.min_i;d--){for(f=a(c.find("tr").not(c.find("table tr")).get(d)),e=0;e<g[d].length;e++)if(0===e||g[d][e]!=g[d][e-1]){var i=a(g[d][e]);if(parseInt(i.attr("rowspan"),10)>1){var j=parseInt(i.attr("rowspan"),10)-1;1==j?i.removeAttr("rowspan"):i.attr("rowspan",j)}if(d<g.length-1&&g[d][e]==g[d+1][e]&&(0===d||g[d][e]!=g[d-1][e])){for(var k=g[d][e],l=e;l>0&&g[d][l]==g[d][l-1];)l--;0===l?a(c.find("tr").not(c.find("table tr")).get(d+1)).prepend(k):a(g[d+1][l-1]).after(k)}}var m=f.parent();f.remove(),0===m.find("tr").length&&m.remove(),g=B(c)}h.min_i>0?b.selection.setAtEnd(g[h.min_i-1][0]):b.selection.setAtEnd(g[0][0]),b.selection.restore(),b.popups.hide("table.edit")}}}function s(c){var e=ha();if(e.length>0){var f,g=B(),h=G(g);f="before"==c?h.min_j:h.max_j;var i,j=100/g[0].length,k=100/(g[0].length+1);e.find("th, td").each(function(){i=a(this),i.data("old-width",i.outerWidth()/e.outerWidth()*100)}),e.find("tr").not(e.find("table tr")).each(function(b){for(var d,e=a(this),h=0,i=0;f>h-1;){if(d=e.find("> th, > td").get(i),!d){d=null;break}d==g[b][h]?(h+=parseInt(a(d).attr("colspan"),10)||1,i++):(h+=parseInt(a(g[b][h]).attr("colspan"),10)||1,"after"==c&&(d=0===i?-1:e.find("> th, > td").get(i-1)))}var l=a(d);if("after"==c&&h-1>f||"before"==c&&f>0&&g[b][f]==g[b][f-1]){if(0===b||b>0&&g[b][f]!=g[b-1][f]){var m=parseInt(l.attr("colspan"),10)+1;l.attr("colspan",m),l.css("width",(l.data("old-width")*k/j+k).toFixed(4)+"%"),l.removeData("old-width")}}else{var n;n=e.find("th").length>0?'<th style="width: '+k.toFixed(4)+'%;"><br></th>':'<td style="width: '+k.toFixed(4)+'%;"><br></td>',-1==d?e.prepend(n):null==d?e.append(n):"before"==c?l.before(n):"after"==c&&l.after(n)}}),e.find("th, td").each(function(){i=a(this),i.data("old-width")&&(i.css("width",(i.data("old-width")*k/j).toFixed(4)+"%"),i.removeData("old-width"))}),b.popups.isVisible("table.edit")&&d()}}function t(){var c=ha();if(c.length>0){var d,e,f,g=B(),h=G(g);if(0===h.min_j&&h.max_j==g[0].length-1)n();else{var i=100/g[0].length,j=100/(g[0].length-h.max_j+h.min_j-1);for(c.find("th, td").each(function(){f=a(this),f.hasClass("fr-selected-cell")||f.data("old-width",f.outerWidth()/c.outerWidth()*100)}),e=h.max_j;e>=h.min_j;e--)for(d=0;d<g.length;d++)if(0===d||g[d][e]!=g[d-1][e])if(f=a(g[d][e]),parseInt(f.attr("colspan"),10)>1){var k=parseInt(f.attr("colspan"),10)-1;1==k?f.removeAttr("colspan"):f.attr("colspan",k),f.css("width",((f.data("old-width")-$(e,g))*j/i).toFixed(4)+"%"),f.removeData("old-width")}else{var l=a(f.parent().get(0));f.remove(),0===l.find("> th, > td").length&&(0===l.prev().length||0===l.next().length||l.prev().find("> th[rowspan], > td[rowspan]").length<l.prev().find("> th, > td").length)&&l.remove()}h.min_j>0?b.selection.setAtEnd(g[h.min_i][h.min_j-1]):b.selection.setAtEnd(g[h.min_i][0]),b.selection.restore(),b.popups.hide("table.edit"),c.find("th, td").each(function(){f=a(this),f.data("old-width")&&(f.css("width",(f.data("old-width")*j/i).toFixed(4)+"%"),f.removeData("old-width"))})}}}function u(){if(ga().length>1&&(0===b.$el.find("th.fr-selected-cell").length||0===b.$el.find("td.fr-selected-cell").length)){var c,e,f,g=B(),h=G(g),i=b.$el.find(".fr-selected-cell"),j=a(i[0]),k=j.parent(),l=k.find(".fr-selected-cell"),m=j.closest("table"),n=j.html(),o=0;for(c=0;c<l.length;c++)o+=a(l[c]).outerWidth();for(j.css("width",(o/k.outerWidth()*100).toFixed(4)+"%"),h.min_j<h.max_j&&j.attr("colspan",h.max_j-h.min_j+1),h.min_i<h.max_i&&j.attr("rowspan",h.max_i-h.min_i+1),c=1;c<i.length;c++)e=a(i[c]),"<br>"!=e.html()&&""!==e.html()&&(n+="<br>"+e.html()),e.remove();j.html(n),b.selection.setAtEnd(j.get(0)),b.selection.restore(),b.toolbar.enable();var p=m.find("tr:empty");for(c=p.length-1;c>=0;c--)f=a(p[c]),(0===f.prev().length||0===f.next().length||f.prev().find("> th[rowspan], > td[rowspan]").length<f.prev().find("> th, > td").length)&&f.remove();d()}}function v(){if(1==ga().length){var c=b.$el.find(".fr-selected-cell"),d=c.parent(),e=c.closest("table"),f=parseInt(c.attr("rowspan"),10),g=B(),h=C(c.get(0),g),i=c.clone().html("<br>");if(f>1){var j=Math.ceil(f/2);j>1?c.attr("rowspan",j):c.removeAttr("rowspan"),f-j>1?i.attr("rowspan",f-j):i.removeAttr("rowspan");for(var k=h.row+j,l=0===h.col?h.col:h.col-1;l>=0&&(g[k][l]==g[k][l-1]||k>0&&g[k][l]==g[k-1][l]);)l--;-1==l?a(e.find("tr").not(e.find("table tr")).get(k)).prepend(i):a(g[k][l]).after(i)}else{var m,n=a("<tr>").append(i);for(m=0;m<g[0].length;m++)if(0===m||g[h.row][m]!=g[h.row][m-1]){var o=a(g[h.row][m]);o.is(c)||o.attr("rowspan",(parseInt(o.attr("rowspan"),10)||1)+1)}d.after(n)}E(),b.popups.hide("table.edit")}}function w(){if(1==ga().length){var c=b.$el.find(".fr-selected-cell"),d=parseInt(c.attr("colspan"),10)||1,e=c.parent().outerWidth(),f=c.outerWidth(),g=c.clone().html("<br>"),h=B(),i=C(c.get(0),h);if(d>1){var j=Math.ceil(d/2);f=_(i.col,i.col+j-1,h)/e*100;var k=_(i.col+j,i.col+d-1,h)/e*100;j>1?c.attr("colspan",j):c.removeAttr("colspan"),d-j>1?g.attr("colspan",d-j):g.removeAttr("colspan"),c.css("width",f.toFixed(4)+"%"),g.css("width",k.toFixed(4)+"%")}else{var l;for(l=0;l<h.length;l++)if(0===l||h[l][i.col]!=h[l-1][i.col]){var m=a(h[l][i.col]);if(!m.is(c)){var n=(parseInt(m.attr("colspan"),10)||1)+1;m.attr("colspan",n)}}f=f/e*100/2,c.css("width",f.toFixed(4)+"%"),g.css("width",f.toFixed(4)+"%")}c.after(g),E(),b.popups.hide("table.edit")}}function x(a){"REMOVE"!=a?b.$el.find(".fr-selected-cell").css("background-color",b.helpers.HEXtoRGB(a)):b.$el.find(".fr-selected-cell").css("background-color","")}function y(a){b.$el.find(".fr-selected-cell").css("vertical-align",a)}function z(a){b.$el.find(".fr-selected-cell").css("text-align",a)}function A(a,b,c,d){if(b.length>0){if(!c){var e=Object.keys(d);e.splice(e.indexOf(a),1),b.removeClass(e.join(" "))}b.toggleClass(a)}}function B(b){b=b||null;var c=[];if(null==b&&ga().length>0&&(b=ha()),b){var d=a(b);return d.find("tr").not(d.find("table tr")).each(function(b,d){var e=a(d),f=0;e.find("> th, > td").each(function(d,e){for(var g=a(e),h=parseInt(g.attr("colspan"),10)||1,i=parseInt(g.attr("rowspan"),10)||1,j=b;b+i>j;j++)for(var k=f;f+h>k;k++)c[j]||(c[j]=[]),c[j][k]?f++:c[j][k]=e;f+=h})}),c}}function C(a,b){for(var c=0;c<b.length;c++)for(var d=0;d<b[c].length;d++)if(b[c][d]==a)return{row:c,col:d}}function D(a,b,c){for(var d=a+1,e=b+1;d<c.length;){if(c[d][b]!=c[a][b]){d--;break}d++}for(d==c.length&&d--;e<c[a].length;){if(c[a][e]!=c[a][b]){e--;break}e++}return e==c[a].length&&e--,{row:d,col:e}}function E(){var c=b.$el.find(".fr-selected-cell");c.length>0&&c.each(function(){var b=a(this);b.removeClass("fr-selected-cell"),""===b.attr("class")&&b.removeAttr("class")})}function F(){setTimeout(function(){b.selection.clear(),b.$el.addClass("fr-no-selection"),b.$el.blur()},0)}function G(a){var c,d=a.length,e=0,f=a[0].length,g=0,h=b.$el.find(".fr-selected-cell");for(c=0;c<h.length;c++){var i=C(h[c],a),j=D(i.row,i.col,a);d=Math.min(i.row,d),e=Math.max(j.row,e),f=Math.min(i.col,f),g=Math.max(j.col,g)}return{min_i:d,max_i:e,min_j:f,max_j:g}}function H(b,c,d,e,f){var g,h,i,j,k=b,l=c,m=d,n=e;for(g=k;l>=g;g++)((parseInt(a(f[g][m]).attr("rowspan"),10)||1)>1||(parseInt(a(f[g][m]).attr("colspan"),10)||1)>1)&&(i=C(f[g][m],f),j=D(i.row,i.col,f),k=Math.min(i.row,k),l=Math.max(j.row,l),m=Math.min(i.col,m),n=Math.max(j.col,n)),((parseInt(a(f[g][n]).attr("rowspan"),10)||1)>1||(parseInt(a(f[g][n]).attr("colspan"),10)||1)>1)&&(i=C(f[g][n],f),j=D(i.row,i.col,f),k=Math.min(i.row,k),l=Math.max(j.row,l),m=Math.min(i.col,m),n=Math.max(j.col,n));for(h=m;n>=h;h++)((parseInt(a(f[k][h]).attr("rowspan"),10)||1)>1||(parseInt(a(f[k][h]).attr("colspan"),10)||1)>1)&&(i=C(f[k][h],f),j=D(i.row,i.col,f),k=Math.min(i.row,k),l=Math.max(j.row,l),m=Math.min(i.col,m),n=Math.max(j.col,n)),((parseInt(a(f[l][h]).attr("rowspan"),10)||1)>1||(parseInt(a(f[l][h]).attr("colspan"),10)||1)>1)&&(i=C(f[l][h],f),j=D(i.row,i.col,f),k=Math.min(i.row,k),l=Math.max(j.row,l),m=Math.min(i.col,m),n=Math.max(j.col,n));return k==b&&l==c&&m==d&&n==e?{min_i:b,max_i:c,min_j:d,max_j:e}:H(k,l,m,n,f)}function I(b){var c=G(b),d=a(b[c.min_i][c.min_j]),e=a(b[c.min_i][c.max_j]),f=a(b[c.max_i][c.min_j]),g=d.offset().left,h=e.offset().left+e.outerWidth(),i=d.offset().top,j=f.offset().top+f.outerHeight();return{left:g,right:h,top:i,bottom:j}}function J(c,d){if(a(c).is(d))E(),b.edit.on(),a(c).addClass("fr-selected-cell");else{F(),b.edit.off();var e=B(),f=C(c,e),g=C(d,e),h=H(Math.min(f.row,g.row),Math.max(f.row,g.row),Math.min(f.col,g.col),Math.max(f.col,g.col),e);E();for(var i=h.min_i;i<=h.max_i;i++)for(var j=h.min_j;j<=h.max_j;j++)a(e[i][j]).addClass("fr-selected-cell")}}function K(c){var d=null,e=a(c.target);return"TD"==c.target.tagName||"TH"==c.target.tagName?d=c.target:e.closest("td").length>0?d=e.closest("td").get(0):e.closest("th").length>0&&(d=e.closest("th").get(0)),0===b.$el.find(d).length?null:d}function L(){E(),b.popups.hide("table.edit")}function M(c){var d=K(c);if(ga().length>0&&!d&&L(),!b.edit.isDisabled()||b.popups.isVisible("table.edit"))if(1!=c.which||1==c.which&&b.helpers.isMac()&&c.ctrlKey)(3==c.which||1==c.which&&b.helpers.isMac()&&c.ctrlKey)&&d&&L();else if(ma=!0,d){ga().length>0&&!c.shiftKey&&L(),c.stopPropagation(),b.events.trigger("image.hideResizer"),b.events.trigger("video.hideResizer"),la=!0;var e=d.tagName.toLowerCase();c.shiftKey&&b.$el.find(e+".fr-selected-cell").length>0?a(b.$el.find(e+".fr-selected-cell").closest("table")).is(a(d).closest("table"))?J(na,d):F():((b.keys.ctrlKey(c)||c.shiftKey)&&(ga().length>1||0===a(d).find(b.selection.element()).length&&!a(d).is(b.selection.element()))&&F(),na=d,J(na,na))}}function N(c){if(la||b.$tb.is(c.target)||b.$tb.is(a(c.target).closest(b.$tb.get(0)))||(ga().length>0&&b.toolbar.enable(),E()),!(1!=c.which||1==c.which&&b.helpers.isMac()&&c.ctrlKey)){if(ma=!1,la){la=!1;var e=K(c);e||1!=ga().length?ga().length>0&&(b.selection.isCollapsed()?d():E()):E()}if(pa){pa=!1,ja.removeClass("fr-moving"),b.$el.removeClass("fr-no-selection"),b.edit.on();var f=parseFloat(ja.css("left"))+b.opts.tableResizerOffset;b.opts.iframe&&(f-=b.$iframe.offset().left),ja.data("release-position",f),ja.removeData("max-left"),ja.removeData("max-right"),Z(c),R()}}}function O(c){if(la===!0){var d=a(c.currentTarget);if(d.closest("table").is(ha())){if("TD"==c.currentTarget.tagName&&0===b.$el.find("th.fr-selected-cell").length)return void J(na,c.currentTarget);if("TH"==c.currentTarget.tagName&&0===b.$el.find("td.fr-selected-cell").length)return void J(na,c.currentTarget)}F()}}function P(a){(37==a.which||38==a.which||39==a.which||40==a.which)&&ga().length>0&&L()}function Q(){b.shared.$table_resizer||(b.shared.$table_resizer=a('<div class="fr-table-resizer"><div></div></div>')),ja=b.shared.$table_resizer,b.events.$on(ja,"mousedown",function(a){return b.core.sameInstance(ja)?(ga().length>0&&L(),1==a.which?(pa=!0,ja.addClass("fr-moving"),F(),b.edit.off(),ja.find("div").css("opacity",1),!1):void 0):!0}),b.events.$on(ja,"mousemove",function(a){return b.core.sameInstance(ja)?void(pa&&(b.opts.iframe&&(a.pageX-=b.$iframe.offset().left),aa(a))):!0}),b.events.on("shared.destroy",function(){ja.html("").removeData().remove(),ja=null},!0),b.events.on("destroy",function(){b.$el.find(".fr-selected-cell").removeClass("fr-selected-cell"),ja.hide().appendTo(a("body"))},!0)}function R(){ja&&(ja.find("div").css("opacity",0),ja.css("top",0),ja.css("left",0),ja.css("height",0),ja.find("div").css("height",0),ja.hide())}function S(){ka&&ka.removeClass("fr-visible").css("left","-9999px")}function T(c,d){var e=a(d),f=e.closest("table");if(d&&"TD"!=d.tagName&&"TH"!=d.tagName&&(e.closest("td").length>0?d=e.closest("td"):e.closest("th").length>0&&(d=e.closest("th"))),!d||"TD"!=d.tagName&&"TH"!=d.tagName)ja&&e.get(0)!=ja.get(0)&&e.parent().get(0)!=ja.get(0)&&b.core.sameInstance(ja)&&R();else{if(e=a(d),0===b.$el.find(e).length)return!1;var g=e.offset().left-1,h=g+e.outerWidth();if(Math.abs(c.pageX-g)<=b.opts.tableResizerOffset||Math.abs(h-c.pageX)<=b.opts.tableResizerOffset){var i,j,k,l,m,n=B(f),o=C(d,n),p=D(o.row,o.col,n),q=f.offset().top,r=f.outerHeight()-1;if(o.col>0&&c.pageX-g<=b.opts.tableResizerOffset){k=g;var s=a(n[o.row][o.col-1]);l=1==(parseInt(s.attr("colspan"),10)||1)?s.offset().left-1+b.opts.tableResizingLimit:g-$(o.col-1,n)+b.opts.tableResizingLimit,m=1==(parseInt(e.attr("colspan"),10)||1)?g+e.outerWidth()-b.opts.tableResizingLimit:g+$(o.col,n)-b.opts.tableResizingLimit,i=o.col-1,j=o.col}else if(h-c.pageX<=b.opts.tableResizerOffset)if(k=h,p.col<n[p.row].length&&n[p.row][p.col+1]){var t=a(n[p.row][p.col+1]);l=1==(parseInt(e.attr("colspan"),10)||1)?g+b.opts.tableResizingLimit:h-$(p.col,n)+b.opts.tableResizingLimit,m=1==(parseInt(t.attr("colspan"),10)||1)?h+t.outerWidth()-b.opts.tableResizingLimit:h+$(o.col+1,n)-b.opts.tableResizingLimit,i=p.col,j=p.col+1}else{i=p.col,j=null;var u=f.parent();l=f.offset().left-1+n[0].length*b.opts.tableResizingLimit,m=u.offset().left-1+u.width()+parseFloat(u.css("padding-left"))}ja||Q(),ja.data("table",f),ja.data("first",i),ja.data("second",j),ja.data("instance",b),b.$wp.append(ja);var v=k-b.win.pageXOffset-b.opts.tableResizerOffset,w=q-b.win.pageYOffset;b.opts.iframe&&(v+=b.$iframe.offset().left-a(b.o_win).scrollLeft(),w+=b.$iframe.offset().top-a(b.o_win).scrollTop(),l+=b.$iframe.offset().left,m+=b.$iframe.offset().left),ja.data("max-left",l),ja.data("max-right",m),ja.data("origin",k-b.win.pageXOffset),ja.css("top",w),ja.css("left",v),ja.css("height",r),ja.find("div").css("height",r),ja.css("padding-left",b.opts.tableResizerOffset),ja.css("padding-right",b.opts.tableResizerOffset),ja.show()}else b.core.sameInstance(ja)&&R()}}function U(c,d){if(b.$box.find(".fr-line-breaker").is(":visible"))return!1;ka||da(),b.$box.append(ka),ka.data("instance",b);var e=a(d),f=e.find("tr:first"),g=c.pageX,h=0,i=0;b.opts.iframe&&(h+=b.$iframe.offset().left-a(b.o_win).scrollLeft(),i+=b.$iframe.offset().top-a(b.o_win).scrollTop());var j;f.find("th, td").each(function(){var c=a(this);return c.offset().left<=g&&g<c.offset().left+c.outerWidth()/2?(j=parseInt(ka.find("a").css("width"),10),ka.css("top",i+c.offset().top-b.win.pageYOffset-j-5),ka.css("left",h+c.offset().left-b.win.pageXOffset-j/2),ka.data("selected-cell",c),ka.data("position","before"),ka.addClass("fr-visible"),!1):c.offset().left+c.outerWidth()/2<=g&&g<c.offset().left+c.outerWidth()?(j=parseInt(ka.find("a").css("width"),10),ka.css("top",i+c.offset().top-b.win.pageYOffset-j-5),ka.css("left",h+c.offset().left+c.outerWidth()-b.win.pageXOffset-j/2),ka.data("selected-cell",c),ka.data("position","after"),ka.addClass("fr-visible"),!1):void 0})}function V(c,d){if(b.$box.find(".fr-line-breaker").is(":visible"))return!1;ka||da(),b.$box.append(ka),ka.data("instance",b);var e=a(d),f=c.pageY,g=0,h=0;b.opts.iframe&&(g+=b.$iframe.offset().left-a(b.o_win).scrollLeft(),h+=b.$iframe.offset().top-a(b.o_win).scrollTop());var i;e.find("tr").each(function(){var c=a(this);return c.offset().top<=f&&f<c.offset().top+c.outerHeight()/2?(i=parseInt(ka.find("a").css("width"),10),ka.css("top",h+c.offset().top-b.win.pageYOffset-i/2),ka.css("left",g+c.offset().left-b.win.pageXOffset-i-5),ka.data("selected-cell",c.find("td:first")),ka.data("position","above"),ka.addClass("fr-visible"),!1):c.offset().top+c.outerHeight()/2<=f&&f<c.offset().top+c.outerHeight()?(i=parseInt(ka.find("a").css("width"),10),ka.css("top",h+c.offset().top+c.outerHeight()-b.win.pageYOffset-i/2),ka.css("left",g+c.offset().left-b.win.pageXOffset-i-5),ka.data("selected-cell",c.find("td:first")),ka.data("position","below"),ka.addClass("fr-visible"),!1):void 0})}function W(c,d){if(0===ga().length){var e,f,g;if(d&&("HTML"==d.tagName||"BODY"==d.tagName||b.node.isElement(d)))for(e=1;e<=b.opts.tableInsertHelperOffset;e++){if(f=b.doc.elementFromPoint(c.pageX-b.win.pageXOffset,c.pageY-b.win.pageYOffset+e),a(f).hasClass("fr-tooltip"))return!0;if(f&&("TH"==f.tagName||"TD"==f.tagName||"TABLE"==f.tagName)&&(a(f).parents(".fr-wrapper").length||b.opts.iframe))return U(c,f.closest("table")),!0;if(g=b.doc.elementFromPoint(c.pageX-b.win.pageXOffset+e,c.pageY-b.win.pageYOffset),a(g).hasClass("fr-tooltip"))return!0;if(g&&("TH"==g.tagName||"TD"==g.tagName||"TABLE"==g.tagName)&&(a(g).parents(".fr-wrapper").length||b.opts.iframe))return V(c,g.closest("table")),!0}b.core.sameInstance(ka)&&S()}}function X(a){oa=null;var c=b.doc.elementFromPoint(a.pageX-b.win.pageXOffset,a.pageY-b.win.pageYOffset);b.opts.tableResizer&&(!b.popups.areVisible()||b.popups.areVisible()&&b.popups.isVisible("table.edit"))&&T(a,c),!b.opts.tableInsertHelper||b.popups.areVisible()||b.$tb.hasClass("fr-inline")&&b.$tb.is(":visible")||W(a,c)}function Y(){if(pa){var c=ja.data("table"),d=c.offset().top-b.win.pageYOffset;b.opts.iframe&&(d+=b.$iframe.offset().top-a(b.o_win).scrollTop()),ja.css("top",d)}}function Z(){var c=ja.data("origin"),d=ja.data("release-position");if(c!==d){var e=ja.data("first"),f=ja.data("second"),g=ja.data("table"),h=g.outerWidth();if(null!==e&&null!==f){var i,j,k,l=B(g),m=[],n=[],o=[],p=[];for(i=0;i<l.length;i++)j=a(l[i][e]),k=a(l[i][f]),m[i]=j.outerWidth(),o[i]=k.outerWidth(),n[i]=m[i]/h*100,p[i]=o[i]/h*100;for(i=0;i<l.length;i++){j=a(l[i][e]),k=a(l[i][f]);var q=(n[i]*(m[i]+d-c)/m[i]).toFixed(4);j.css("width",q+"%"),k.css("width",(n[i]+p[i]-q).toFixed(4)+"%")}}else{var r,s=g.parent(),t=h/s.width()*100;r=null==e?(h-d+c)/h*t:(h+d-c)/h*t,g.css("width",Math.round(r).toFixed(4)+"%")}}ja.removeData("origin"),ja.removeData("release-position"),ja.removeData("first"),ja.removeData("second"),ja.removeData("table"),b.undo.saveStep()}function $(b,c){var d,e=a(c[0][b]).outerWidth();for(d=1;d<c.length;d++)e=Math.min(e,a(c[d][b]).outerWidth());return e}function _(a,b,c){var d,e=0;for(d=a;b>=d;d++)e+=$(d,c);return e}function aa(a){if(ga().length>1&&ma&&F(),ma===!1&&la===!1&&pa===!1)oa&&clearTimeout(oa),(!b.edit.isDisabled()||b.popups.isVisible("table.edit"))&&(oa=setTimeout(X,30,a));else if(pa){var c=a.pageX-b.win.pageXOffset;b.opts.iframe&&(c+=b.$iframe.offset().left);var d=ja.data("max-left"),e=ja.data("max-right");c>=d&&e>=c?ja.css("left",c-b.opts.tableResizerOffset):d>c&&parseFloat(ja.css("left"),10)>d-b.opts.tableResizerOffset?ja.css("left",d-b.opts.tableResizerOffset):c>e&&parseFloat(ja.css("left"),10)<e-b.opts.tableResizerOffset&&ja.css("left",e-b.opts.tableResizerOffset)}else ma&&S()}function ba(c){b.node.isEmpty(c.get(0))?c.prepend(a.FE.MARKERS):c.prepend(a.FE.START_MARKER).append(a.FE.END_MARKER)}function ca(c){var d=c.which;if(d==a.FE.KEYCODE.TAB&&0===b.opts.tabSpaces){var e;if(ga().length>0)e=b.$el.find(".fr-selected-cell:last");else{var f=b.selection.element();"TD"==f.tagName||"TH"==f.tagName?e=a(f):a(f).closest("td").length>0?e=a(f).closest("td"):a(f).closest("th").length>0&&(e=a(f).closest("th"))}e&&(c.preventDefault(),L(),c.shiftKey?e.prev().length>0?ba(e.prev()):e.closest("tr").length>0&&e.closest("tr").prev().length>0?ba(e.closest("tr").prev().find("td:last")):e.closest("tbody").length>0&&e.closest("table").find("thead tr").length>0&&ba(e.closest("table").find("thead tr th:last")):e.next().length>0?ba(e.next()):e.closest("tr").length>0&&e.closest("tr").next().length>0?ba(e.closest("tr").next().find("td:first")):e.closest("thead").length>0&&e.closest("table").find("tbody tr").length>0?ba(e.closest("table").find("tbody tr td:first")):(e.addClass("fr-selected-cell"),q("below"),E(),ba(e.closest("tr").next().find("td:first"))),b.selection.restore())}}function da(){b.shared.$ti_helper||(b.shared.$ti_helper=a('<div class="fr-insert-helper"><a class="fr-floating-btn" role="button" tabindex="-1" title="'+b.language.translate("Insert")+'"><svg viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"><path d="M22,16.75 L16.75,16.75 L16.75,22 L15.25,22.000 L15.25,16.75 L10,16.75 L10,15.25 L15.25,15.25 L15.25,10 L16.75,10 L16.75,15.25 L22,15.25 L22,16.75 Z"/></svg></a></div>'),b.events.bindClick(b.shared.$ti_helper,"a",function(){var a=ka.data("selected-cell"),c=ka.data("position"),d=ka.data("instance")||b;"before"==c?(a.addClass("fr-selected-cell"),d.table.insertColumn(c),a.removeClass("fr-selected-cell")):"after"==c?(a.addClass("fr-selected-cell"),d.table.insertColumn(c),a.removeClass("fr-selected-cell")):"above"==c?(a.addClass("fr-selected-cell"),d.table.insertRow(c),a.removeClass("fr-selected-cell")):"below"==c&&(a.addClass("fr-selected-cell"),d.table.insertRow(c),a.removeClass("fr-selected-cell")),S()}),b.events.on("shared.destroy",function(){b.shared.$ti_helper.html("").removeData().remove(),b.shared.$ti_helper=null},!0),b.events.$on(b.shared.$ti_helper,"mousemove",function(a){a.stopPropagation()},!0),b.events.$on(a(b.o_win),"scroll",function(){S()},!0),b.events.$on(b.$wp,"scroll",function(){S()},!0)),ka=b.shared.$ti_helper,b.events.on("destroy",function(){ka=null}),b.tooltip.bind(b.$box,".fr-insert-helper > a.fr-floating-btn")}function ea(){na=null,clearTimeout(oa)}function fa(){ga().length>0?d():(b.popups.hide("table.insert"),b.toolbar.showInline())}function ga(){return b.$el.get(0).querySelectorAll(".fr-selected-cell")}function ha(){var c=ga();if(c.length){for(var d=c[0];d&&"TABLE"!=d.tagName&&d.parentNode!=b.$el.get(0);)d=d.parentNode;return a(d&&"TABLE"==d.tagName?d:[])}return a([])}function ia(){if(!b.$wp)return!1;if(!b.helpers.isMobile()){ma=!1,la=!1,pa=!1,b.events.$on(b.$el,"mousedown",M),b.popups.onShow("image.edit",function(){E(),ma=!1,la=!1}),b.popups.onShow("link.edit",function(){E(),ma=!1,la=!1}),b.events.on("commands.mousedown",function(a){a.parents(".fr-toolbar").length>0&&E()}),b.events.$on(b.$el,"mouseenter","th, td",O),b.events.$on(b.$win,"mouseup",N),b.opts.iframe&&b.events.$on(a(b.o_win),"mouseup",N),b.events.$on(b.$el,"keydown",P),b.events.$on(b.$win,"mousemove",aa),b.events.$on(a(b.o_win),"scroll",Y),b.events.on("contentChanged",function(){ga().length>0&&(d(),b.$el.find("img").on("load.selected-cells",function(){a(this).off("load.selected-cells"),ga().length>0&&d()}))}),b.events.$on(a(b.o_win),"resize",function(){E()}),b.events.on("keydown",function(c){var d=ga();if(d.length>0){if(c.which==a.FE.KEYCODE.ESC&&b.popups.isVisible("table.edit"))return E(),b.popups.hide("table.edit"),c.preventDefault(),c.stopPropagation(),c.stopImmediatePropagation(),d=[],!1;if(d.length>1&&c.which==a.FE.KEYCODE.BACKSPACE){b.undo.saveStep();for(var e=0;e<d.length;e++)a(d[e]).html("<br>"),e==d.length-1&&a(d[e]).prepend(a.FE.MARKERS);return b.selection.restore(),b.undo.saveStep(),d=[],!1}if(d.length>1&&!b.keys.ctrlKey(c))return c.preventDefault(),d=[],!1}d=[]},!0);var c=[];b.events.on("html.beforeGet",function(){c=ga();for(var a=0;a<c.length;a++)c[a].className=(c[a].className||"").replace(/fr-selected-cell/g,"")}),b.events.on("html.get",function(a){return a=a.replace(/<(td|th)((?:[\w\W]*?)) class=""((?:[\w\W]*?))>((?:[\w\W]*?))<\/(td|th)>/g,"<$1$2$3>$4</$5>")}),b.events.on("html.afterGet",function(){for(var a=0;a<c.length;a++)c[a].className=(c[a].className?c[a].className+" ":"")+"fr-selected-cell";c=[]}),g(!0),i(!0)}b.events.on("keydown",ca,!0),b.events.on("destroy",ea)}var ja,ka,la,ma,na,oa,pa;return{_init:ia,insert:m,remove:n,insertRow:q,deleteRow:r,insertColumn:s,deleteColumn:t,mergeCells:u,splitCellVertically:w,splitCellHorizontally:v,addHeader:o,removeHeader:p,setBackground:x,showInsertPopup:c,showEditPopup:d,showColorsPopup:e,back:fa,verticalAlign:y,horizontalAlign:z,applyStyle:A,selectedTable:ha,selectedCells:ga}},a.FE.DefineIcon("insertTable",{NAME:"table"}),a.FE.RegisterCommand("insertTable",{title:"Insert Table",undo:!1,focus:!0,refreshOnCallback:!1,popup:!0,callback:function(){this.popups.isVisible("table.insert")?(this.$el.find(".fr-marker")&&(this.events.disableBlur(),this.selection.restore()),this.popups.hide("table.insert")):this.table.showInsertPopup()},plugin:"table"}),a.FE.RegisterCommand("tableInsert",{callback:function(a,b,c){this.table.insert(b,c),this.popups.hide("table.insert")}}),a.FE.DefineIcon("tableHeader",{NAME:"header"}),a.FE.RegisterCommand("tableHeader",{title:"Table Header",focus:!1,callback:function(){var a=this.popups.get("table.edit").find('.fr-command[data-cmd="tableHeader"]');a.hasClass("fr-active")?this.table.removeHeader():this.table.addHeader()},refresh:function(a){var b=this.table.selectedTable();b.length>0&&(0===b.find("th").length?a.removeClass("fr-active"):a.addClass("fr-active"))}}),a.FE.DefineIcon("tableRows",{NAME:"bars"}),a.FE.RegisterCommand("tableRows",{type:"dropdown",focus:!1,title:"Row",options:{above:"Insert row above",below:"Insert row below","delete":"Delete row"},html:function(){var b='<ul class="fr-dropdown-list">',c=a.FE.COMMANDS.tableRows.options;for(var d in c)c.hasOwnProperty(d)&&(b+='<li><a class="fr-command" data-cmd="tableRows" data-param1="'+d+'" title="'+this.language.translate(c[d])+'">'+this.language.translate(c[d])+"</a></li>");return b+="</ul>"},callback:function(a,b){"above"==b||"below"==b?this.table.insertRow(b):this.table.deleteRow()}}),a.FE.DefineIcon("tableColumns",{NAME:"bars fa-rotate-90" | ||
}),a.FE.RegisterCommand("tableColumns",{type:"dropdown",focus:!1,title:"Column",options:{before:"Insert column before",after:"Insert column after","delete":"Delete column"},html:function(){var b='<ul class="fr-dropdown-list">',c=a.FE.COMMANDS.tableColumns.options;for(var d in c)c.hasOwnProperty(d)&&(b+='<li><a class="fr-command" data-cmd="tableColumns" data-param1="'+d+'" title="'+this.language.translate(c[d])+'">'+this.language.translate(c[d])+"</a></li>");return b+="</ul>"},callback:function(a,b){"before"==b||"after"==b?this.table.insertColumn(b):this.table.deleteColumn()}}),a.FE.DefineIcon("tableCells",{NAME:"square-o"}),a.FE.RegisterCommand("tableCells",{type:"dropdown",focus:!1,title:"Cell",options:{merge:"Merge cells","vertical-split":"Vertical split","horizontal-split":"Horizontal split"},html:function(){var b='<ul class="fr-dropdown-list">',c=a.FE.COMMANDS.tableCells.options;for(var d in c)c.hasOwnProperty(d)&&(b+='<li><a class="fr-command" data-cmd="tableCells" data-param1="'+d+'" title="'+this.language.translate(c[d])+'">'+this.language.translate(c[d])+"</a></li>");return b+="</ul>"},callback:function(a,b){"merge"==b?this.table.mergeCells():"vertical-split"==b?this.table.splitCellVertically():this.table.splitCellHorizontally()},refreshOnShow:function(a,b){this.$el.find(".fr-selected-cell").length>1?(b.find('a[data-param1="vertical-split"]').addClass("fr-disabled"),b.find('a[data-param1="horizontal-split"]').addClass("fr-disabled"),b.find('a[data-param1="merge"]').removeClass("fr-disabled")):(b.find('a[data-param1="merge"]').addClass("fr-disabled"),b.find('a[data-param1="vertical-split"]').removeClass("fr-disabled"),b.find('a[data-param1="horizontal-split"]').removeClass("fr-disabled"))}}),a.FE.DefineIcon("tableRemove",{NAME:"trash"}),a.FE.RegisterCommand("tableRemove",{title:"Remove Table",focus:!1,callback:function(){this.table.remove()}}),a.FE.DefineIcon("tableStyle",{NAME:"paint-brush"}),a.FE.RegisterCommand("tableStyle",{title:"Table Style",type:"dropdown",focus:!1,html:function(){var a='<ul class="fr-dropdown-list">',b=this.opts.tableStyles;for(var c in b)b.hasOwnProperty(c)&&(a+='<li><a class="fr-command" data-cmd="tableStyle" data-param1="'+c+'" title="'+this.language.translate(b[c])+'">'+this.language.translate(b[c])+"</a></li>");return a+="</ul>"},callback:function(a,b){this.table.applyStyle(b,this.$el.find(".fr-selected-cell").closest("table"),this.opts.tableMultipleStyles,this.opts.tableStyles)},refreshOnShow:function(b,c){var d=this.$el.find(".fr-selected-cell").closest("table");d&&c.find(".fr-command").each(function(){var b=a(this).data("param1");a(this).toggleClass("fr-active",d.hasClass(b))})}}),a.FE.DefineIcon("tableCellBackground",{NAME:"tint"}),a.FE.RegisterCommand("tableCellBackground",{title:"Cell Background",focus:!1,callback:function(){this.table.showColorsPopup()}}),a.FE.RegisterCommand("tableCellBackgroundColor",{undo:!0,focus:!1,callback:function(a,b){this.table.setBackground(b)}}),a.FE.DefineIcon("tableBack",{NAME:"arrow-left"}),a.FE.RegisterCommand("tableBack",{title:"Back",undo:!1,focus:!1,back:!0,callback:function(){this.table.back()},refresh:function(a){0!==this.table.selectedCells().length||this.opts.toolbarInline?(a.removeClass("fr-hidden"),a.next(".fr-separator").removeClass("fr-hidden")):(a.addClass("fr-hidden"),a.next(".fr-separator").addClass("fr-hidden"))}}),a.FE.DefineIcon("tableCellVerticalAlign",{NAME:"arrows-v"}),a.FE.RegisterCommand("tableCellVerticalAlign",{type:"dropdown",focus:!1,title:"Vertical Align",options:{Top:"Align Top",Middle:"Align Middle",Bottom:"Align Bottom"},html:function(){var b='<ul class="fr-dropdown-list">',c=a.FE.COMMANDS.tableCellVerticalAlign.options;for(var d in c)c.hasOwnProperty(d)&&(b+='<li><a class="fr-command" data-cmd="tableCellVerticalAlign" data-param1="'+d.toLowerCase()+'" title="'+this.language.translate(c[d])+'">'+this.language.translate(d)+"</a></li>");return b+="</ul>"},callback:function(a,b){this.table.verticalAlign(b)},refreshOnShow:function(a,b){b.find('.fr-command[data-param1="'+this.$el.find(".fr-selected-cell").css("vertical-align")+'"]').addClass("fr-active")}}),a.FE.DefineIcon("tableCellHorizontalAlign",{NAME:"align-left"}),a.FE.DefineIcon("align-left",{NAME:"align-left"}),a.FE.DefineIcon("align-right",{NAME:"align-right"}),a.FE.DefineIcon("align-center",{NAME:"align-center"}),a.FE.DefineIcon("align-justify",{NAME:"align-justify"}),a.FE.RegisterCommand("tableCellHorizontalAlign",{type:"dropdown",focus:!1,title:"Horizontal Align",options:{left:"Align Left",center:"Align Center",right:"Align Right",justify:"Align Justify"},html:function(){var b='<ul class="fr-dropdown-list">',c=a.FE.COMMANDS.tableCellHorizontalAlign.options;for(var d in c)c.hasOwnProperty(d)&&(b+='<li><a class="fr-command fr-title" data-cmd="tableCellHorizontalAlign" data-param1="'+d+'" title="'+this.language.translate(c[d])+'">'+this.icon.create("align-"+d)+"</a></li>");return b+="</ul>"},callback:function(a,b){this.table.horizontalAlign(b)},refresh:function(b){var c=this.table.selectedCells();c.length&&b.find("> *:first").replaceWith(this.icon.create("align-"+this.helpers.getAlignment(a(c[0]))))},refreshOnShow:function(a,b){b.find('.fr-command[data-param1="'+this.helpers.getAlignment(this.$el.find(".fr-selected-cell:first"))+'"]').addClass("fr-active")}}),a.FE.DefineIcon("tableCellStyle",{NAME:"magic"}),a.FE.RegisterCommand("tableCellStyle",{title:"Cell Style",type:"dropdown",focus:!1,html:function(){var a='<ul class="fr-dropdown-list">',b=this.opts.tableCellStyles;for(var c in b)b.hasOwnProperty(c)&&(a+='<li><a class="fr-command" data-cmd="tableCellStyle" data-param1="'+c+'" title="'+this.language.translate(b[c])+'">'+this.language.translate(b[c])+"</a></li>");return a+="</ul>"},callback:function(a,b){this.table.applyStyle(b,this.$el.find(".fr-selected-cell"),this.opts.tableCellMultipleStyles,this.opts.tableCellStyles)},refreshOnShow:function(b,c){var d=this.$el.find(".fr-selected-cell:first");d&&c.find(".fr-command").each(function(){var b=a(this).data("param1");a(this).toggleClass("fr-active",d.hasClass(b))})}})}); |
/*! | ||
* froala_editor v2.3.2 (https://www.froala.com/wysiwyg-editor) | ||
* froala_editor v2.3.3 (https://www.froala.com/wysiwyg-editor) | ||
* License https://froala.com/wysiwyg-editor/terms/ | ||
@@ -4,0 +4,0 @@ * Copyright 2014-2016 Froala Labs |
/*! | ||
* froala_editor v2.3.2 (https://www.froala.com/wysiwyg-editor) | ||
* froala_editor v2.3.3 (https://www.froala.com/wysiwyg-editor) | ||
* License https://froala.com/wysiwyg-editor/terms/ | ||
@@ -4,0 +4,0 @@ * Copyright 2014-2016 Froala Labs |
{ | ||
"name": "froala-editor", | ||
"version": "2.3.2", | ||
"version": "2.3.3", | ||
"description": "A beautiful jQuery WYSIWYG HTML rich text editor. High performance and modern design make it easy to use for developers and loved by users.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2615639