").firstChild),i.addEventListener("dragover",e),i.addEventListener("dragleave",d),i.addEventListener("dragend",d),i.addEventListener("drop",t),r.getBody().addEventListener("dragover",e),r.getBody().addEventListener("drop",d)},this.signalPasteHtml=function(e){if(!("handlePaste"in A)||A.handlePaste){var t=document.createElement("div");t.innerHTML=e.val;for(var n=t.querySelectorAll("img"),r=0;r
",""+t+">"):e.execCommand("formatblock","<"+t+">")},a=function(e){var o=this,r=document.createElement("div");i.utils.each(c,function(t,a){var e=document.createElement("a");e.className="sceditor-option",e.textContent=a.name||a,e.addEventListener("click",function(e){o.closeDropDown(!0),a.exec?a.exec(o):n(o,t),e.preventDefault()}),r.appendChild(e)}),o.createDropDown(e,"format",r)}}}(sceditor);
\ No newline at end of file
diff --git a/admin/res/sceditor/plugins/plaintext.js b/admin/res/sceditor/plugins/plaintext.js
deleted file mode 100644
index 9ba5bf2..0000000
--- a/admin/res/sceditor/plugins/plaintext.js
+++ /dev/null
@@ -1,3 +0,0 @@
-/* SCEditor v2.1.3 | (C) 2017, Sam Clarke | sceditor.com/license */
-
-!function(t){"use strict";var i=t.utils.extend;t.plugins.plaintext=function(){var e=!0;this.init=function(){var t=this.commands,n=this.opts;n&&n.plaintext&&n.plaintext.addButton&&(e=n.plaintext.enabled,t.pastetext=i(t.pastetext||{},{state:function(){return e?1:0},exec:function(){e=!e}}))},this.signalPasteRaw=function(t){if(e){if(t.html&&!t.text){var n=document.createElement("div");n.innerHTML=t.html,t.text=n.innerText}t.html=null}}}}(sceditor);
\ No newline at end of file
diff --git a/admin/res/sceditor/plugins/strictbbcode.js b/admin/res/sceditor/plugins/strictbbcode.js
deleted file mode 100644
index 8367926..0000000
--- a/admin/res/sceditor/plugins/strictbbcode.js
+++ /dev/null
@@ -1,2 +0,0 @@
-/* SCEditor v2.1.3 | (C) 2017, Sam Clarke | sceditor.com/license */
-
diff --git a/admin/res/sceditor/plugins/undo.js b/admin/res/sceditor/plugins/undo.js
deleted file mode 100644
index 7407178..0000000
--- a/admin/res/sceditor/plugins/undo.js
+++ /dev/null
@@ -1,3 +0,0 @@
-/* SCEditor v2.1.3 | (C) 2017, Sam Clarke | sceditor.com/license */
-
-!function(e){"use strict";sceditor.plugins.undo=function(){var r,o,e=this,u=0,a=50,n=[],c=[],s=!1,l=function(e){s=!0,o=e.value,r.sourceMode(e.sourceMode),r.val(e.value,!1),r.focus(),e.sourceMode?r.sourceEditorCaret(e.caret):r.getRangeHelper().restoreRange(),s=!1};e.init=function(){a=(r=this).undoLimit||a,r.addShortcut("ctrl+z",e.undo),r.addShortcut("ctrl+shift+z",e.redo),r.addShortcut("ctrl+y",e.redo)},e.undo=function(){var e=c.pop(),t=r.val(null,!1);return e&&!n.length&&t===e.value&&(e=c.pop()),e&&(n.length||n.push({caret:r.sourceEditorCaret(),sourceMode:r.sourceMode(),value:t}),n.push(e),l(e)),!1},e.redo=function(){var e=n.pop();return c.length||(c.push(e),e=n.pop()),e&&(c.push(e),l(e)),!1},e.signalReady=function(){var e=r.val(null,!1);o=e,c.push({caret:this.sourceEditorCaret(),sourceMode:this.sourceMode(),value:e})},e.signalValuechangedEvent=function(e){var t=e.detail.rawValue;0a&&c.shift(),!s&&o&&o!==t&&(n.length=0,(u+=function(e,t){var r,o,u,a,n=e.length,c=t.length,s=Math.max(n,c);for(r=0;rresult = $resultValue;
+ $Value->content = $resultContent;
+ echo json_encode($Value);
+ die();
+}
+
+/* Include all Admin Ajax operations */
+
+require_once(ADMIN_DIR . 'adminAjaxOperations.php');
+
+foreach($AjaxFunctionMap as $currentName => $currentFunction) {
+ addAdminAjaxOperation($currentName, $currentFunction);
+}
+
+/* Recibe $POST to access ajax Function */
+
+$_POST['Operation'] = 'Hello World'; // Test
+$_POST['Arguments'] = 'BLa bLa bLa'; // Test
+
+if(isset($_POST)) {
+
+ if(!isset($_POST['Operation'])) {
+ returnJSONValue(AJAXERROR, 'Flatpress Ajax needs operation');
+ }
+
+ if(!array_key_exists($_POST['Operation'], $ajaxFunctions)) {
+ returnJSONValue(AJAXERROR, 'Flatpress Ajax Operation doesnt not exist');
+ }
+
+ //Check if this OP needs admin permissions. If true, check users permissions.
+ if($ajaxIsAdminOrNot[$_POST['Operation']]) {
+ if(!user_loggedin()) {
+ returnJSONValue(AJAXERROR, 'Forbidden. You dont have admin permissions');
+ }
+ }
+
+ try {
+ if(!isset($_POST['Arguments'])) {
+ $result = $ajaxFunctions[$_POST['Operation']]();
+ } else {
+ $result = $ajaxFunctions[$_POST['Operation']]($_POST['Arguments']);
+ }
+ returnJSONValue(AJAXSUCCESS, $result);
+ } catch(Exception $e) {
+ returnJSONValue(AJAXERROR, $e->getMessage());
+ }
+}
+?>
+