/** EnterMediaDB javascriptGenerator : /${applicationid}/components/javascript/jquery.form-4.3.0.min.js /WEB-INF/base/openedit/_site.xconf Modified: Sat Oct 04 11:50:05 ADT 2025 Size: 16.66 KB **/ /*! * jQuery Form Plugin * version: 4.3.0 * Requires jQuery v1.7.2 or later * Project repository: https://github.com/jquery-form/form * Copyright 2017 Kevin Morris * Copyright 2006 M. Alsup * Dual licensed under the LGPL-2.1+ or MIT licenses * https://github.com/jquery-form/form#license * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. */ !function(r){"function"==typeof define&&define.amd?define(["jquery"],r):"object"==typeof module&&module.exports?module.exports=function(e,t){return void 0===t&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(e)),r(t),t}:r(jQuery)}(function(q){"use strict";var m=/\r?\n/g,S={};S.fileapi=void 0!==q('').get(0).files,S.formdata=void 0!==window.FormData;var _=!!q.fn.prop;function o(e){var t=e.data;e.isDefaultPrevented()||(e.preventDefault(),q(e.target).closest("form").ajaxSubmit(t))}function i(e){var t=e.target,r=q(t);if(!r.is("[type=submit],[type=image]")){var a=r.closest("[type=submit]");if(0===a.length)return;t=a[0]}var n,o=t.form;"image"===(o.clk=t).type&&(void 0!==e.offsetX?(o.clk_x=e.offsetX,o.clk_y=e.offsetY):"function"==typeof q.fn.offset?(n=r.offset(),o.clk_x=e.pageX-n.left,o.clk_y=e.pageY-n.top):(o.clk_x=e.pageX-t.offsetLeft,o.clk_y=e.pageY-t.offsetTop)),setTimeout(function(){o.clk=o.clk_x=o.clk_y=null},100)}function N(){var e;q.fn.ajaxSubmit.debug&&(e="[jquery.form] "+Array.prototype.join.call(arguments,""),window.console&&window.console.log?window.console.log(e):window.opera&&window.opera.postError&&window.opera.postError(e))}q.fn.attr2=function(){if(!_)return this.attr.apply(this,arguments);var e=this.prop.apply(this,arguments);return e&&e.jquery||"string"==typeof e?e:this.attr.apply(this,arguments)},q.fn.ajaxSubmit=function(M,e,t,r){if(!this.length)return N("ajaxSubmit: skipping submit process - no element selected"),this;var O,a,n,o,X=this;"function"==typeof M?M={success:M}:"string"==typeof M||!1===M&&0',s)).css({position:"absolute",top:"-1000px",left:"-1000px"}),m=d[0],p={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(e){var t="timeout"===e?"timeout":"aborted";N("aborting upload... "+t),this.aborted=1;try{m.contentWindow.document.execCommand&&m.contentWindow.document.execCommand("Stop")}catch(e){}d.attr("src",l.iframeSrc),p.error=t,l.error&&l.error.call(l.context,p,t,e),f&&q.event.trigger("ajaxError",[p,l,t]),l.complete&&l.complete.call(l.context,p,t)}},(f=l.global)&&0==q.active++&&q.event.trigger("ajaxStart"),f&&q.event.trigger("ajaxSend",[p,l]),l.beforeSend&&!1===l.beforeSend.call(l.context,p,l))return l.global&&q.active--,g.reject(),g;if(p.aborted)return g.reject(),g;(a=i.clk)&&(n=a.name)&&!a.disabled&&(l.extraData=l.extraData||{},l.extraData[n]=a.value,"image"===a.type&&(l.extraData[n+".x"]=i.clk_x,l.extraData[n+".y"]=i.clk_y));var x=1,y=2;function b(t){var r=null;try{t.contentWindow&&(r=t.contentWindow.document)}catch(e){N("cannot get iframe.contentWindow document: "+e)}if(r)return r;try{r=t.contentDocument?t.contentDocument:t.document}catch(e){N("cannot get iframe.contentDocument: "+e),r=t.document}return r}var c=q("meta[name=csrf-token]").attr("content"),T=q("meta[name=csrf-param]").attr("content");function j(){var e=X.attr2("target"),t=X.attr2("action"),r=X.attr("enctype")||X.attr("encoding")||"multipart/form-data";i.setAttribute("target",o),O&&!/post/i.test(O)||i.setAttribute("method","POST"),t!==l.url&&i.setAttribute("action",l.url),l.skipEncodingOverride||O&&!/post/i.test(O)||X.attr({encoding:"multipart/form-data",enctype:"multipart/form-data"}),l.timeout&&(v=setTimeout(function(){h=!0,A(x)},l.timeout));var a=[];try{if(l.extraData)for(var n in l.extraData)l.extraData.hasOwnProperty(n)&&(q.isPlainObject(l.extraData[n])&&l.extraData[n].hasOwnProperty("name")&&l.extraData[n].hasOwnProperty("value")?a.push(q('',s).val(l.extraData[n].value).appendTo(i)[0]):a.push(q('',s).val(l.extraData[n]).appendTo(i)[0]));l.iframeTarget||d.appendTo(u),m.attachEvent?m.attachEvent("onload",A):m.addEventListener("load",A,!1),setTimeout(function e(){try{var t=b(m).readyState;N("state = "+t),t&&"uninitialized"===t.toLowerCase()&&setTimeout(e,50)}catch(e){N("Server abort: ",e," (",e.name,")"),A(y),v&&clearTimeout(v),v=void 0}},15);try{i.submit()}catch(e){document.createElement("form").submit.apply(i)}}finally{i.setAttribute("action",t),i.setAttribute("enctype",r),e?i.setAttribute("target",e):X.removeAttr("target"),q(a).remove()}}T&&c&&(l.extraData=l.extraData||{},l.extraData[T]=c),l.forceSync?j():setTimeout(j,10);var w,S,k,D=50;function A(e){if(!p.aborted&&!k){if((S=b(m))||(N("cannot access response document"),e=y),e===x&&p)return p.abort("timeout"),void g.reject(p,"timeout");if(e===y&&p)return p.abort("server abort"),void g.reject(p,"error","server abort");if(S&&S.location.href!==l.iframeSrc||h){m.detachEvent?m.detachEvent("onload",A):m.removeEventListener("load",A,!1);var t,r="success";try{if(h)throw"timeout";var a="xml"===l.dataType||S.XMLDocument||q.isXMLDoc(S);if(N("isXml="+a),!a&&window.opera&&(null===S.body||!S.body.innerHTML)&&--D)return N("requeing onLoad callback, DOM not available"),void setTimeout(A,250);var n=S.body?S.body:S.documentElement;p.responseText=n?n.innerHTML:null,p.responseXML=S.XMLDocument?S.XMLDocument:S,a&&(l.dataType="xml"),p.getResponseHeader=function(e){return{"content-type":l.dataType}[e.toLowerCase()]},n&&(p.status=Number(n.getAttribute("status"))||p.status,p.statusText=n.getAttribute("statusText")||p.statusText);var o,i,s,u=(l.dataType||"").toLowerCase(),c=/(json|script|text)/.test(u);c||l.textarea?(o=S.getElementsByTagName("textarea")[0])?(p.responseText=o.value,p.status=Number(o.getAttribute("status"))||p.status,p.statusText=o.getAttribute("statusText")||p.statusText):c&&(i=S.getElementsByTagName("pre")[0],s=S.getElementsByTagName("body")[0],i?p.responseText=i.textContent?i.textContent:i.innerText:s&&(p.responseText=s.textContent?s.textContent:s.innerText)):"xml"===u&&!p.responseXML&&p.responseText&&(p.responseXML=F(p.responseText));try{w=E(p,u,l)}catch(e){r="parsererror",p.error=t=e||r}}catch(e){N("error caught: ",e),r="error",p.error=t=e||r}p.aborted&&(N("upload aborted"),r=null),p.status&&(r=200<=p.status&&p.status<300||304===p.status?"success":"error"),"success"===r?(l.success&&l.success.call(l.context,w,"success",p),g.resolve(p.responseText,"success",p),f&&q.event.trigger("ajaxSuccess",[p,l])):r&&(void 0===t&&(t=p.statusText),l.error&&l.error.call(l.context,p,r,t),g.reject(p,"error",t),f&&q.event.trigger("ajaxError",[p,l,t])),f&&q.event.trigger("ajaxComplete",[p,l]),f&&!--q.active&&q.event.trigger("ajaxStop"),l.complete&&l.complete.call(l.context,p,r),k=!0,l.timeout&&clearTimeout(v),setTimeout(function(){l.iframeTarget?d.attr("src",l.iframeSrc):d.remove(),p.responseXML=null},100)}}}var F=q.parseXML||function(e,t){return window.ActiveXObject?((t=new ActiveXObject("Microsoft.XMLDOM")).async="false",t.loadXML(e)):t=(new DOMParser).parseFromString(e,"text/xml"),t&&t.documentElement&&"parsererror"!==t.documentElement.nodeName?t:null},L=q.parseJSON||function(e){return window.eval("("+e+")")},E=function(e,t,r){var a=e.getResponseHeader("content-type")||"",n=("xml"===t||!t)&&0<=a.indexOf("xml"),o=n?e.responseXML:e.responseText;return n&&"parsererror"===o.documentElement.nodeName&&q.error&&q.error("parsererror"),r&&r.dataFilter&&(o=r.dataFilter(o,t)),"string"==typeof o&&(("json"===t||!t)&&0<=a.indexOf("json")?o=L(o):("script"===t||!t)&&0<=a.indexOf("javascript")&&q.globalEval(o)),o};return g}},q.fn.ajaxForm=function(e,t,r,a){if(("string"==typeof e||!1===e&&0`), ); } var params = arguments[0]; var oldsucess = params.success; params.success = function (arg1, arg2, arg3, arg4) { //var oldcontent = $(targetdiv); //oldcontent.html(""); if (oldsucess != null) { oldsucess.call(form, arg1, arg2, arg3, arg4); } //Grab target div? $(document).trigger("domchanged",null,$(this)); if (targetdiv) { $(document).trigger("domchanged", [$("#" + targetdiv)]); } else { $(document).trigger("domchanged"); } }; var returned = oldajaxSubmit.call(form, params); params.success = oldsucess; return returned; }; })(jQuery); (function ($) { var regelements = new Array(); var eventregistry = new Array(); //Listener $(document).on("domchanged", function (event, args) { // if( livequeryrunning && args == null ) // { //console.log("Skipping reload" , args); //return; // } var element; if (typeof args == Array) { if (args.length > 1) { element = $(args[0], args[1]); } } else if (args != null) { element = args; } if (element == null) { element = document; } //console.log("domchanged reload on ",element); $.each(regelements, function () { //Everyone var item = this; var funct = item.function; $(item.selector, element).each(function () { try { var node = $(this); if (node.data("livequeryinit" + item.selector) == null) { //console.log("Not enabled: " + item.selector ); node.data("livequeryinit" + item.selector, true); funct.call(node); } } catch (error) { console.log("Could not process: " + item.selector, error); } }); }); //TODO: Loop over events ones and register them $.each(eventregistry, function () { var listener = this; var check = element; if (String(listener.selector).indexOf(" ") > -1) { check = document; } $(listener.selector, check).each(function () { var node = $(this); if (node.data("livequery" + listener.selector) == null) { //console.log("Registering " + listener.selector ); node.on(listener.event, listener.function); } else { //console.log("already Registered: "); //console.log(node); } }); }); //We need to do this as the end in case there are more than one click handlers on the same node $.each(eventregistry, function () { var listener = this; var check = element; if (String(listener.selector).indexOf(" ") > -1) { check = document; } $(listener.selector, check).each(function () { var node = $(this); if (node.data("livequery" + listener.selector) == null) { node.data("livequery" + listener.selector, true); } }); }); }); //document.on lQuery = function (selector) { if (selector == undefined || selector == null) { console.log("lQuery called with undefined selector"); return; } var runner = {}; runner.livequery = function () { var nodes = jQuery(selector); if (arguments.length == 1) { var func = arguments[0]; var item = { selector: selector, function: func }; /* if( selector.startsWith("#")) { regelements = $.grep(regelements, function (el, index) { if( el.selector == selector) { return false; } return true; // keep the element in the array }); } */ regelements.push(item); try { nodes.each(function () { //We need to make sure each row is initially handled var onerow = $(this); onerow.data("livequeryinit" + selector, true); func.call(onerow); }); } catch (error) { console.log("Could not process: " + selector, error); } } //Note: on does not support scope of selectors else { var eventtype = arguments[0]; //click var eventlistener = { selector: selector, event: eventtype }; if (arguments.length == 2) { eventlistener["function"] = arguments[1]; eventlistener["scope"] = document; } else { eventlistener["scope"] = arguments[1]; eventlistener["function"] = arguments[2]; } eventregistry.push(eventlistener); //console.log("Initial Registering event" + eventlistener.selector ); nodes.each(function () { //We need to make sure each row is initially handled var node = $(this); node.data("livequery" + selector, true); node.on(eventlistener.event, eventlistener.function); //$(document).on(eventlistener.event,eventlistener.selector,eventlistener.function); }); } return this; }; return runner; }; })(jQuery); //Ended: /${applicationid}/components/javascript/emedia/liveajax.js Size: 7.3 KB /** EnterMediaDB javascriptGenerator : /${applicationid}/components/javascript/openedit.js /WEB-INF/base/openedit/_site.xconf Modified: Wed Sep 23 16:12:26 ADT 2026 Size: 8.27 KB **/ jQuery(document).ready(function () { //insert a chunk of html var body = jQuery("body"); var hide = body.data("hidetoolbar"); var isBlockfind = $("#application").hasClass("blockfind"); //console.log(hide); if (hide != true && !isBlockfind) { var path = window.location.pathname; if (window.location.search) { path = path + window.location.search; } jQuery.get( "/openedit/components/toolbar/admintoolbarselector.html", { path: path }, function (data) { body.prepend(data); loadToolbar(); }, ); $(document).on("click", ".oe-enableedit", function () { var apphome = jQuery("#application").data("apphome"); //
  • Debug Mode
  • var args = $(this).data(); //Enable dashes on $.get(href, args, function (data) { //reload page }); }); $(document).on("click", ".oeDialog", function () { var target = $(this).data("target"); if (target == null) { target = $(this).attr("href"); } var title = $(this).data("title"); if (title != null) { $("#modal-title").text(title); } $("#edit-modal-body").load(target, function (result) { var textareas = jQuery(".htmleditor"); if (textareas.length > 0) { loadEditors(); } $("#editmodal").modal("show"); }); return false; }); $(document).on("click", ".oemodechange", function (e) { e.preventDefault(); var target = $(this).attr("href"); var title = $(this).attr("title"); jQuery.get(target, function () { if (title != "DebugMode") { window.location.reload(); } }); }); jQuery("a.openeditdialog").each(function () { var height = jQuery(window).height(); var width = jQuery(window).width(); height = height * 0.9; width = width * 0.9; if (width < 900) { width = 1050; } var newfancy = jQuery(this).fancybox({ zoomSpeedIn: 300, zoomSpeedOut: 300, overlayShow: true, enableEscapeButton: true, type: "iframe", height: height, width: width, }); }); //OLD Approach jQuery("a.oeinlineedit").on("click", function (e) { e.preventDefault(); e.stopPropagation(); var parent = $(this).closest(".openeditinline"); var container = parent.find(".openediteditcontent"); var editpath = parent.data("editpath"); // var catalogid = app.data("catalogid"); //alert("using " + catalogid); var home = $("#openedit").data("home"); if (!home) { home = ""; } var savepath = home + "/openedit/components/html/save.html"; container.data("savepath", savepath); container.data("editpath", editpath); $(window).trigger("inlinehtmlstart", [container]); /* CKEDITOR.config.saveSubmitURL = savepath + "?editPath=" + editpath; //TODO: Save this URL specific to this editor CKEDITOR.config.filebrowserBrowseUrl = home + "/openedit/components/html/browse/index.html?editPath=$editPath"; CKEDITOR.config.filebrowserUploadUrl = home + "/openedit/components/html/edit/actions/imageupload-finish.html"; CKEDITOR.config.filebrowserImageBrowseUrl = home + "/openedit/components/html/browse/index.html?editPath=$editPath"; CKEDITOR.config.filebrowserImageUploadUrl = home + "/openedit/components/html/edit/actions/imageupload-finish.html"; CKEDITOR.config.entities = false; CKEDITOR.config.basicEntities = true; var content = container.find(".openediteditcontent").get(0); //var content = jQuery(".openediteditcontent" ).get(0); content.setAttribute("contenteditable", "true"); var editor = CKEDITOR.inline(content, { extraConfig: { oldcontent: "null" }, startupFocus: true, on: { dataReady: function (event) { event.editor.config.extraConfig.oldcontent = event.editor.getData(); }, blur: function (event) { var enCollator = new Intl.Collator("en"); var data = event.editor.getData(); if ( enCollator.compare(data, editor.config.extraConfig.oldcontent) != 0 ) { $(window).on("beforeunload", function () { return "You have unsaved changes. Reloading will loose these changes."; }); } return false; }, savecontentdone: function (event) { location.reload(); }, }, }); */ }); } var content = $("textarea.oeeditorhtml"); if (content.length) { $(window).trigger("edithtmlstart", [content]); } loadHtmlEditor = function (field, viewtype, container) { var apphome = jQuery("#application").data("apphome"); var home = $("#openedit").data("home"); if (!home) { home = ""; } if (viewtype == "html") { var savepath = home + apphome + "/components/data/save.html"; container.data("savepath", savepath); var dataid = container.data("dataid"); if (dataid) { container.data("id", dataid); } $(window).trigger("edithtmlstart", [container]); } else if (viewtype == "input") { var savepath = home + apphome + "/components/data/save.html"; var oldborder = container.css("border"); container.css("border", "1px dashed black"); content.setAttribute("contenteditable", "true"); container.focus(); var options = container.data(); options.save = true; options.oemaxlevel = 1; options.id = options.dataid; var field = options.field; container.keyup(function (evt) { //save as we go? // enter pressed var contents = compoent.innerHTML; options[field + ".value"] = contents; //TODO: use "post" method for larger inputs not "get" $.get(savepath, options, function () { //reset border //content.setAttribute('contenteditable', 'false'); container.css("border", oldborder); }); }); //Capture the enter key } }; //onload var editmode = jQuery("#application").data("editmode"); if (editmode == "postedit") { var container = $(".oe-editable"); $(window).trigger("edithtmlstart", [container]); } //THis is a click that enabled something else to edit. Like a pencil icon jQuery(document).on("click", ".oe-dataedit", function (e) { console.log("Opening editor"); var container = $(this).data("target"); container = $(container); // var content = container.get(0); // var searchtype = container.data("searchtype"); // var id = container.data("dataid"); var field = container.data("field"); var viewtype = container.data("viewtype"); if (!viewtype) { viewtype = "html"; } var home = $("#openedit").data("home"); if (!home) { home = ""; } e.preventDefault(); loadHtmlEditor(field, viewtype, container); return false; }); var htminp = jQuery(".oehtmlinput"); if (htminp.length > 0) { var field = htminp.data("field"); var viewtype = "html"; loadHtmlEditor(field, viewtype, htminp); } jQuery("form.oeajaxform").on("submit", function () { var targetdiv = jQuery(this).attr("targetdiv"); targetdiv = targetdiv.replace(/\//g, "\\/"); //allows for posting to a div in the parent from a fancybox. if (targetdiv.indexOf("parent.") == 0) { targetdiv = targetdiv.substr(7); parent.jQuery(this).ajaxSubmit({ target: "#" + targetdiv, success: function () { $(document).trigger("domchanged", "#" + targetdiv); }, }); //closes the fancybox after submitting parent.jQuery.fn.fancybox.close(); } else { jQuery(this).ajaxSubmit({ target: "#" + targetdiv, success: function () { $(document).trigger("domchanged", "#" + targetdiv); }, }); } return false; }); }); loadToolbar = function () { jQuery("#oeselector").on("mouseenter", function () { if (jQuery("#oeadmintoolbarlocation").is(":visible")) { return; } var me = jQuery(this); jQuery.get(me.attr("href"), {}, function (data) { me.html(data); jQuery("#oeadmintoolbarlocation").on("mouseleave", function () { jQuery(this).hide(); }); }); }); }; showHover = function (inAssetId) { var el = document.getElementById("oehover"); el = jQuery(el); if (el.attr("status") == "show") { if (inAssetId == el.attr("assetid")) { el.show(); } } }; refreshFileMenu = function () { var editpath = $("#fileoptionsmenu").data("editpath"); var home = $("#openedit").data("home"); if (!home) { home = ""; } $("#fileoptionsmenu").load( home + "/openedit/components/html/edit/menu.html?oemaxlevel=1&editPath=" + editpath, ); }; //Ended: /${applicationid}/components/javascript/openedit.js Size: 8.27 KB /** EnterMediaDB javascriptGenerator : /${applicationid}/components/javascript/tabs.js /WEB-INF/base/openedit/_site.xconf Modified: Sat Jun 11 20:26:03 ADT 2022 Size: 783 bytes **/ showtab = function(inHome , inTabName) { var elem = document.getElementById(inTabName); if( elem ) { //the td itself elem.style.backgroundImage = "url(" + inHome + "/system/images/tabs/navlh.gif)"; elem.style.backgroundPosition = "left top"; elem.style.backgroundRepeat = "no-repeat"; elem.style.backgroundColor = "#31578d"; //the span var spane = elem.childNodes[0]; //span tag spane.style.backgroundImage = "url(" + inHome + "/system/images/tabs/navrh.gif)"; spane.style.backgroundPosition = "right top"; spane.style.backgroundRepeat = "no-repeat"; var atag = spane.childNodes[0]; //span tag atag.style.color = "#ffffff"; } } showpath = function(inDivId, inPath, inMaxLevel) { jQuery("#"+inDivId).load(inPath, { oemaxlevel: inMaxLevel }); } //Ended: /${applicationid}/components/javascript/tabs.js Size: 783 bytes