openrat-cms

# OpenRat Content Management System
git clone http://git.code.weiherhei.de/openrat-cms.git
Log | Files | Refs

commit f862fe49bced6b01d13665d666d450c2039807ee
parent 0b86bf38dc90dd91d7dae67f6c2219f3df7819e9
Author: Jan Dankert <develop@jandankert.de>
Date:   Thu, 24 Oct 2019 22:35:36 +0200

Fix: Links with type=post and dataAfterSuccess

Diffstat:
modules/cms-ui/themes/default/script/plugin/jquery-plugin-orLinkify.js | 1+
modules/cms-ui/themes/default/script/plugin/jquery-plugin-orLinkify.min.js | 4++--
2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/modules/cms-ui/themes/default/script/plugin/jquery-plugin-orLinkify.js b/modules/cms-ui/themes/default/script/plugin/jquery-plugin-orLinkify.js @@ -30,6 +30,7 @@ jQuery.fn.orLinkify = function() // Create a temporary form element. $form = $('<form />').attr('method','POST').addClass('invisible'); + $form.data('afterSuccess', $(this).data('afterSuccess')); let params = jQuery.parseJSON( $(this).attr('data-data') ); params.output = 'json'; diff --git a/modules/cms-ui/themes/default/script/plugin/jquery-plugin-orLinkify.min.js b/modules/cms-ui/themes/default/script/plugin/jquery-plugin-orLinkify.min.js @@ -1 +1 @@ -;var popupWindow;jQuery.fn.orLinkify=function(){$(this).find("a").click(function(t){t.preventDefault()});return $(this).click(function(){$(this).find("a").first().each(function(){let type=$(this).attr("data-type");if($(this).parent().hasClass("inactive"))return;switch(type){case"post":$form=$("<form />").attr("method","POST").addClass("invisible");let params=jQuery.parseJSON($(this).attr("data-data"));params.output="json";$.each(params,function(t,a){let $input=$("<input />").attr("type","hidden").attr("name",t).attr("value",a);$form.append($input)});let form=new Openrat.Form();form.initOnElement($form);form.submit();break;case"dialog":startDialog($(this).attr("data-name"),$(this).attr("data-action"),$(this).attr("data-method"),$(this).attr("data-id"),$(this).attr("data-extra"));break;case"edit":startEdit($(this).attr("data-name"),$(this).attr("data-action"),$(this).attr("data-method"),$(this).attr("data-id"),$(this).attr("data-extra"));break;case"external":window.open($(this).attr("data-url")," _blank");break;case"popup":popupWindow=window.open($(this).attr("data-url"),"Popup","location=no,menubar=no,scrollbars=yes,toolbar=no,resizable=yes");break;case"help":help(this,$(this).attr("data-url"),$(this).attr("data-suffix"));break;case"fullscreen":fullscreen(this);break;case"open":openNewAction($(this).attr("data-name"),$(this).attr("data-action"),$(this).attr("data-id"));break;default:throw"UI error: Unknown link type: "+type+" in link "+$(this).html()}})})};$(document).on("orViewLoaded",function(t,a){if(typeof popupWindow!="undefined")$(t.target).find("a[data-type='popup']").each(function(){popupWindow.location.href=$(this).attr("data-url")})});$(document).on("orDataChanged",function(t,a){if(typeof popupWindow!="undefined")popupWindow.location.reload()});- \ No newline at end of file +;var popupWindow;jQuery.fn.orLinkify=function(){$(this).find("a").click(function(t){t.preventDefault()});return $(this).click(function(){$(this).find("a").first().each(function(){let type=$(this).attr("data-type");if($(this).parent().hasClass("inactive"))return;switch(type){case"post":$form=$("<form />").attr("method","POST").addClass("invisible");$form.data("afterSuccess",$(this).data("afterSuccess"));let params=jQuery.parseJSON($(this).attr("data-data"));params.output="json";$.each(params,function(t,a){let $input=$("<input />").attr("type","hidden").attr("name",t).attr("value",a);$form.append($input)});let form=new Openrat.Form();form.initOnElement($form);form.submit();break;case"dialog":startDialog($(this).attr("data-name"),$(this).attr("data-action"),$(this).attr("data-method"),$(this).attr("data-id"),$(this).attr("data-extra"));break;case"edit":startEdit($(this).attr("data-name"),$(this).attr("data-action"),$(this).attr("data-method"),$(this).attr("data-id"),$(this).attr("data-extra"));break;case"external":window.open($(this).attr("data-url")," _blank");break;case"popup":popupWindow=window.open($(this).attr("data-url"),"Popup","location=no,menubar=no,scrollbars=yes,toolbar=no,resizable=yes");break;case"help":help(this,$(this).attr("data-url"),$(this).attr("data-suffix"));break;case"fullscreen":fullscreen(this);break;case"open":openNewAction($(this).attr("data-name"),$(this).attr("data-action"),$(this).attr("data-id"));break;default:throw"UI error: Unknown link type: "+type+" in link "+$(this).html()}})})};$(document).on("orViewLoaded",function(t,a){if(typeof popupWindow!="undefined")$(t.target).find("a[data-type='popup']").each(function(){popupWindow.location.href=$(this).attr("data-url")})});$(document).on("orDataChanged",function(t,a){if(typeof popupWindow!="undefined")popupWindow.location.reload()});+ \ No newline at end of file