diff --git a/wire/modules/Jquery/JqueryUI/modal.js b/wire/modules/Jquery/JqueryUI/modal.js
index c4553864..1b00331a 100644
--- a/wire/modules/Jquery/JqueryUI/modal.js
+++ b/wire/modules/Jquery/JqueryUI/modal.js
@@ -166,6 +166,7 @@ function pwModalWindow(href, options, size) {
}
var $iframe = jQuery('');
$iframe.attr('id', 'pw-modal-window-' + (pwModalWindows.length+1));
+ pwModalWindows[pwModalWindows.length] = $iframe;
if(typeof size == "undefined" || size.length == 0) var size = 'large';
var settings = pwModalWindowSettings(size);
@@ -261,11 +262,11 @@ function pwModalOpenEvent(e) {
var settings = {
title: $a.attr('title'),
- close: function(event, ui) {
+ close: function(e, ui) {
// abort is true when the "x" button at top right of window is what closed the window
- var abort = typeof event.toElement != "undefined" && jQuery(event.toElement).hasClass('fa-times');
+ var abort = typeof e.originalEvent != "undefined" && jQuery(e.originalEvent.target).closest('.ui-dialog-titlebar-close').length > 0;
var eventData = {
- event: event,
+ event: e,
ui: ui,
abort: abort
};
diff --git a/wire/modules/Jquery/JqueryUI/modal.min.js b/wire/modules/Jquery/JqueryUI/modal.min.js
index b1c5a45e..385e362c 100644
--- a/wire/modules/Jquery/JqueryUI/modal.min.js
+++ b/wire/modules/Jquery/JqueryUI/modal.min.js
@@ -1 +1 @@
-var pwModalWindows=[];function pwModalWindowSettings(b){var d=ProcessWire.config.modals[b];if(typeof d=="undefined"){d=ProcessWire.config.modals.medium}d=d.split(",");var a={modal:true,draggable:false,resizable:true,hide:250,show:100,hideOverflow:true,closeOnEscape:false};if(d.length>=4){for(var f=4;f").find(".ui-icon").remove();if(frameElement&&parent.jQuery!="undefined"&&parent.jQuery(".ui-dialog").length){parent.jQuery(".ui-dialog .ui-button").addClass("pw-modal-hidden").hide();parent.jQuery(".ui-dialog-buttonpane").css("margin-top","-10px");jQuery("body").css("overflow","hidden")}},beforeClose:function(g,h){if(parent.jQuery!="undefined"&&parent.jQuery(".ui-dialog").length){if(frameElement){parent.jQuery(".pw-modal-hidden").show();jQuery("body").css("overflow","")}else{if(a.hideOverflow){parent.jQuery("body").css("overflow","")}}}}}}function pwModalWindow(c,j,i){for(var e=0;e<=pwModalWindows.length;e++){var h=pwModalWindows[e];if(h==null){continue}if(h.dialog("isOpen")){continue}h.dialog("destroy").remove();pwModalWindows[e]=null}if(c.indexOf("modal=")>0){var b=c}else{var b=c+(c.indexOf("?")>-1?"&":"?")+"modal=1"}var h=jQuery('');h.attr("id","pw-modal-window-"+(pwModalWindows.length+1));if(typeof i=="undefined"||i.length==0){var i="large"}var f=pwModalWindowSettings(i);if(f==null){alert("Unknown modal setting: "+i);return h}if(typeof j!="undefined"){jQuery.extend(f,j)}h.on("dialogopen",function(k,l){jQuery(document).trigger("pw-modal-opened",{event:k,ui:l})});h.on("dialogclose",function(k,l){jQuery(document).trigger("pw-modal-closed",{event:k,ui:l})});h.dialog(f);h.data("settings",f);h.load(function(){if(typeof f.title=="undefined"||!f.title){var k=jQuery("").text(h.contents().find("title").text()).html();h.dialog("option","title",k)}h.contents().find("form").css("-webkit-backface-visibility","hidden")});var d=0;var g=0;function a(){var n=jQuery(window).width();var l=jQuery(window).height();if(n==d&&l==g){return}var m=i;if(n<=960&&i!="full"&&i!="large"){m="large"}if(n<=700&&i!="full"){m="full"}var o=pwModalWindowSettings(m);var p=h.closest(".ui-dialog");if(p.length>0){var k=p.find(".ui-dialog-buttonpane").outerHeight()+p.find(".ui-dialog-titlebar").outerHeight();o.height-=k}h.dialog("option","width",o.width);h.dialog("option","height",o.height);h.dialog("option","position",o.position);h.width(o.width).height(o.height);d=n;g=l}a();jQuery(window).resize(a);h.refresh=function(){d=0;g=0;a()};h.setButtons=function(k){h.dialog("option","buttons",k);h.refresh()};h.setTitle=function(k){h.dialog("option","title",k)};return h}function pwModalOpenEvent(j){var c=jQuery(this);var a=c.attr("data-autoclose");var l=a!=null;var i=l&&a.length>1?a:"";var h=c.attr("data-close");var k=false;var f="medium";if(c.hasClass("pw-modal-large")){f="large"}else{if(c.hasClass("pw-modal-small")){f="small"}else{if(c.hasClass("pw-modal-full")){f="full"}}}var d={title:c.attr("title"),close:function(p,q){var r=typeof p.toElement!="undefined"&&jQuery(p.toElement).hasClass("fa-times");var e={event:p,ui:q,abort:r};c.trigger("modal-close",e);c.trigger("pw-modal-closed",e);jQuery(document).trigger("pw-modal-closed",e);g.remove()}};var o=c.attr("data-buttons");if(h==null){h=""}h+=(h.length>0?", ":"")+".pw-modal-cancel";var g=jQuery("").css({position:"absolute",top:(parseInt(jQuery(window).height()/2)-80)+"px",left:(parseInt(jQuery(window).width()/2)-20)+"px","z-index":9999}).hide();var b=c.attr("data-pw-modal-href");if(b&&b.length){}else{if(c.is("button")){var m=c.closest("a");b=m.length?m.attr("href"):c.attr("data-href");if(!b){b=c.find("a").attr("href")}}else{if(c.is("a")){b=c.attr("href")}else{b=c.attr("data-href")}}}if(!b){alert("Unable to find href attribute for: "+c.text());return false}var n=pwModalWindow(b,d,f);jQuery("body").append(g.fadeIn("fast"));setTimeout(function(){c.removeClass("ui-state-active")},500);n.load(function(){var q=[];var s=n.contents();var t=0;g.fadeOut("fast",function(){g.remove()});if(k){var e=s.find(".NoticeError, .ui-state-error");if(e.length==0){if(typeof Notifications!="undefined"){var p=[];s.find(".NoticeMessage").each(function(){p[p.length]=jQuery(this).text()});if(p.length>0){setTimeout(function(){for(var u=0;u0&&w.is(h)){n.dialog("close")}if(l){jQuery("body").append(g.fadeIn());if(i.length>1){k=w.is(i)}else{k=true}}}};t++}if(!w.hasClass("pw-modal-button-visible")){w.hide()}})}if(q.length>0){n.setButtons(q)}r.fadeIn("fast",function(){r.show()})});return false}(function(a){a.event.special.pwdoubletap={bindType:"touchend",delegateType:"touchend",handle:function(e){var d=e.handleObj,f=jQuery.data(e.target),c=new Date().getTime(),g=f.lastTouch?c-f.lastTouch:0,b=b==null?300:b;if(g30){f.lastTouch=null;e.type=d.origType;["clientX","clientY","pageX","pageY"].forEach(function(h){e[h]=e.originalEvent.changedTouches[0][h]});d.handler.apply(this,arguments)}else{f.lastTouch=c}}}})(jQuery);function pwModalDoubleClick(){var b=0,d=null,c=false;jQuery(document).on("click",".pw-modal-dblclick a",function(){var e=jQuery(this);if(c){c=false;return true}b++;if(b===1){d=setTimeout(function(){b=0;c=true;e[0].click();return true},700)}else{clearTimeout(d);c=false;b=0;jQuery(this).closest(".pw-modal-dblclick").trigger("dblclick")}return false});jQuery(document).on("dblclick",".pw-modal-dblclick a",function(f){f.stopPropagation();return false});var a=(("ontouchstart" in window)||(navigator.MaxTouchPoints>0)||(navigator.msMaxTouchPoints>0));if(a){jQuery(document).on("pwdoubletap",".pw-modal-dblclick",pwModalOpenEvent)}}jQuery(document).ready(function(a){a.widget("ui.dialog",a.extend({},a.ui.dialog.prototype,{_title:function(b){if(!this.options.title){b.html(" ")}else{b.html(this.options.title)}}}));a(document).on("pwdblclick",".pw-modal-dblclick",pwModalOpenEvent);a(document).on("click",".pw-modal:not(.pw-modal-dblclick):not(.pw-modal-longclick)",pwModalOpenEvent);a(document).on("dblclick",".pw-modal-dblclick",pwModalOpenEvent);a(document).on("longclick",".pw-modal-longclick",pwModalOpenEvent);pwModalDoubleClick()});
\ No newline at end of file
+var pwModalWindows=[];function pwModalWindowSettings(b){var d=ProcessWire.config.modals[b];if(typeof d=="undefined"){d=ProcessWire.config.modals.medium}d=d.split(",");var a={modal:true,draggable:false,resizable:true,hide:250,show:100,hideOverflow:true,closeOnEscape:false};if(d.length>=4){for(var f=4;f").find(".ui-icon").remove();if(frameElement&&parent.jQuery!="undefined"&&parent.jQuery(".ui-dialog").length){parent.jQuery(".ui-dialog .ui-button").addClass("pw-modal-hidden").hide();parent.jQuery(".ui-dialog-buttonpane").css("margin-top","-10px");jQuery("body").css("overflow","hidden")}},beforeClose:function(g,h){if(parent.jQuery!="undefined"&&parent.jQuery(".ui-dialog").length){if(frameElement){parent.jQuery(".pw-modal-hidden").show();jQuery("body").css("overflow","")}else{if(a.hideOverflow){parent.jQuery("body").css("overflow","")}}}}}}function pwModalWindow(c,j,i){for(var e=0;e<=pwModalWindows.length;e++){var h=pwModalWindows[e];if(h==null){continue}if(h.dialog("isOpen")){continue}h.dialog("destroy").remove();pwModalWindows[e]=null}if(c.indexOf("modal=")>0){var b=c}else{var b=c+(c.indexOf("?")>-1?"&":"?")+"modal=1"}var h=jQuery('');h.attr("id","pw-modal-window-"+(pwModalWindows.length+1));pwModalWindows[pwModalWindows.length]=h;if(typeof i=="undefined"||i.length==0){var i="large"}var f=pwModalWindowSettings(i);if(f==null){alert("Unknown modal setting: "+i);return h}if(typeof j!="undefined"){jQuery.extend(f,j)}h.on("dialogopen",function(k,l){jQuery(document).trigger("pw-modal-opened",{event:k,ui:l})});h.on("dialogclose",function(k,l){jQuery(document).trigger("pw-modal-closed",{event:k,ui:l})});h.dialog(f);h.data("settings",f);h.load(function(){if(typeof f.title=="undefined"||!f.title){var k=jQuery("").text(h.contents().find("title").text()).html();h.dialog("option","title",k)}h.contents().find("form").css("-webkit-backface-visibility","hidden")});var d=0;var g=0;function a(){var n=jQuery(window).width();var l=jQuery(window).height();if(n==d&&l==g){return}var m=i;if(n<=960&&i!="full"&&i!="large"){m="large"}if(n<=700&&i!="full"){m="full"}var o=pwModalWindowSettings(m);var p=h.closest(".ui-dialog");if(p.length>0){var k=p.find(".ui-dialog-buttonpane").outerHeight()+p.find(".ui-dialog-titlebar").outerHeight();o.height-=k}h.dialog("option","width",o.width);h.dialog("option","height",o.height);h.dialog("option","position",o.position);h.width(o.width).height(o.height);d=n;g=l}a();jQuery(window).resize(a);h.refresh=function(){d=0;g=0;a()};h.setButtons=function(k){h.dialog("option","buttons",k);h.refresh()};h.setTitle=function(k){h.dialog("option","title",k)};return h}function pwModalOpenEvent(j){var c=jQuery(this);var a=c.attr("data-autoclose");var l=a!=null;var i=l&&a.length>1?a:"";var h=c.attr("data-close");var k=false;var f="medium";if(c.hasClass("pw-modal-large")){f="large"}else{if(c.hasClass("pw-modal-small")){f="small"}else{if(c.hasClass("pw-modal-full")){f="full"}}}var d={title:c.attr("title"),close:function(r,q){var s=typeof r.originalEvent!="undefined"&&jQuery(r.originalEvent.target).closest(".ui-dialog-titlebar-close").length>0;var p={event:r,ui:q,abort:s};c.trigger("modal-close",p);c.trigger("pw-modal-closed",p);jQuery(document).trigger("pw-modal-closed",p);g.remove()}};var o=c.attr("data-buttons");if(h==null){h=""}h+=(h.length>0?", ":"")+".pw-modal-cancel";var g=jQuery("").css({position:"absolute",top:(parseInt(jQuery(window).height()/2)-80)+"px",left:(parseInt(jQuery(window).width()/2)-20)+"px","z-index":9999}).hide();var b=c.attr("data-pw-modal-href");if(b&&b.length){}else{if(c.is("button")){var m=c.closest("a");b=m.length?m.attr("href"):c.attr("data-href");if(!b){b=c.find("a").attr("href")}}else{if(c.is("a")){b=c.attr("href")}else{b=c.attr("data-href")}}}if(!b){alert("Unable to find href attribute for: "+c.text());return false}var n=pwModalWindow(b,d,f);jQuery("body").append(g.fadeIn("fast"));setTimeout(function(){c.removeClass("ui-state-active")},500);n.load(function(){var q=[];var s=n.contents();var t=0;g.fadeOut("fast",function(){g.remove()});if(k){var e=s.find(".NoticeError, .ui-state-error");if(e.length==0){if(typeof Notifications!="undefined"){var p=[];s.find(".NoticeMessage").each(function(){p[p.length]=jQuery(this).text()});if(p.length>0){setTimeout(function(){for(var u=0;u0&&w.is(h)){n.dialog("close")}if(l){jQuery("body").append(g.fadeIn());if(i.length>1){k=w.is(i)}else{k=true}}}};t++}if(!w.hasClass("pw-modal-button-visible")){w.hide()}})}if(q.length>0){n.setButtons(q)}r.fadeIn("fast",function(){r.show()})});return false}(function(a){a.event.special.pwdoubletap={bindType:"touchend",delegateType:"touchend",handle:function(e){var d=e.handleObj,f=jQuery.data(e.target),c=new Date().getTime(),g=f.lastTouch?c-f.lastTouch:0,b=b==null?300:b;if(g30){f.lastTouch=null;e.type=d.origType;["clientX","clientY","pageX","pageY"].forEach(function(h){e[h]=e.originalEvent.changedTouches[0][h]});d.handler.apply(this,arguments)}else{f.lastTouch=c}}}})(jQuery);function pwModalDoubleClick(){var b=0,d=null,c=false;jQuery(document).on("click",".pw-modal-dblclick a",function(){var e=jQuery(this);if(c){c=false;return true}b++;if(b===1){d=setTimeout(function(){b=0;c=true;e[0].click();return true},700)}else{clearTimeout(d);c=false;b=0;jQuery(this).closest(".pw-modal-dblclick").trigger("dblclick")}return false});jQuery(document).on("dblclick",".pw-modal-dblclick a",function(f){f.stopPropagation();return false});var a=(("ontouchstart" in window)||(navigator.MaxTouchPoints>0)||(navigator.msMaxTouchPoints>0));if(a){jQuery(document).on("pwdoubletap",".pw-modal-dblclick",pwModalOpenEvent)}}jQuery(document).ready(function(a){a.widget("ui.dialog",a.extend({},a.ui.dialog.prototype,{_title:function(b){if(!this.options.title){b.html(" ")}else{b.html(this.options.title)}}}));a(document).on("pwdblclick",".pw-modal-dblclick",pwModalOpenEvent);a(document).on("click",".pw-modal:not(.pw-modal-dblclick):not(.pw-modal-longclick)",pwModalOpenEvent);a(document).on("dblclick",".pw-modal-dblclick",pwModalOpenEvent);a(document).on("longclick",".pw-modal-longclick",pwModalOpenEvent);pwModalDoubleClick()});
\ No newline at end of file
diff --git a/wire/modules/Page/PageFrontEdit/PageFrontEdit.css b/wire/modules/Page/PageFrontEdit/PageFrontEdit.css
index 871adb87..4ba8d539 100644
--- a/wire/modules/Page/PageFrontEdit/PageFrontEdit.css
+++ b/wire/modules/Page/PageFrontEdit/PageFrontEdit.css
@@ -208,7 +208,7 @@ button.ui-button.ui-state-active,
background: #E4EBEE;
border: none;
margin-top: -8px;
- padding: 1px 8px 1px 8px; }
+ padding: 8px 8px 1px 8px; }
.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset {
float: right; }
.ui-dialog .ui-dialog-buttonpane button {
@@ -262,26 +262,36 @@ button.ui-button.ui-state-active,
opacity: 0;
filter: Alpha(Opacity=0); }
-/*** AdminThemeReno jQuery UI ************************************************/
+/*** AdminThemeReno or Uikit jQuery UI ************************************************/
+.pw-AdminThemeUikit .ui-dialog .ui-dialog-titlebar,
.pw-AdminThemeReno .ui-dialog .ui-dialog-titlebar {
background: #2a3c51; }
+ .pw-AdminThemeUikit .ui-dialog .ui-dialog-titlebar .ui-button,
.pw-AdminThemeReno .ui-dialog .ui-dialog-titlebar .ui-button {
background: none;
border: none; }
+.pw-AdminThemeUikit .ui-dialog .ui-dialog-buttonpane,
.pw-AdminThemeReno .ui-dialog .ui-dialog-buttonpane {
- margin-top: -5px; }
+ margin-top: -5px;
+ padding-top: 6px; }
+.pw-AdminThemeUikit .ui-dialog .ui-dialog-title,
.pw-AdminThemeReno .ui-dialog .ui-dialog-title {
padding: 5px 10px;
font-weight: normal;
color: #FFF;
font-size: 1.2em; }
+.pw-AdminThemeUikit .ui-dialog .ui-dialog-titlebar-close,
.pw-AdminThemeReno .ui-dialog .ui-dialog-titlebar-close {
right: 15px;
background: none;
border: none;
color: #FFF; }
+.pw-AdminThemeUikit .ui-widget-overlay,
.pw-AdminThemeReno .ui-widget-overlay {
background: #1C2836; }
+.pw-AdminThemeUikit .ui-button,
+.pw-AdminThemeUikit button.ui-button.ui-state-default,
+.pw-AdminThemeUikit .ui-button.ui-state-default,
.pw-AdminThemeReno .ui-button,
.pw-AdminThemeReno button.ui-button.ui-state-default,
.pw-AdminThemeReno .ui-button.ui-state-default {
@@ -292,20 +302,29 @@ button.ui-button.ui-state-active,
border: 1px solid #3eb998;
border-radius: 3px;
transition: all 120ms ease-in; }
-.pw-AdminThemeReno .ui-button-text, .pw-AdminThemeReno .ui-button-text-only .ui-button-text {
+.pw-AdminThemeUikit .ui-button-text, .pw-AdminThemeUikit .ui-button-text-only .ui-button-text,
+.pw-AdminThemeReno .ui-button-text,
+.pw-AdminThemeReno .ui-button-text-only .ui-button-text {
padding: 0.6em 1.1em;
font-size: 1em; }
+.pw-AdminThemeUikit button.ui-button.ui-priority-secondary,
+.pw-AdminThemeUikit .ui-button.ui-priority-secondary,
.pw-AdminThemeReno button.ui-button.ui-priority-secondary,
.pw-AdminThemeReno .ui-button.ui-priority-secondary {
background: #4d6c76;
border: 1px solid #4d6c76;
color: #fff; }
+ .pw-AdminThemeUikit button.ui-button.ui-priority-secondary:hover,
+ .pw-AdminThemeUikit .ui-button.ui-priority-secondary:hover,
.pw-AdminThemeReno button.ui-button.ui-priority-secondary:hover,
.pw-AdminThemeReno .ui-button.ui-priority-secondary:hover {
color: #fff;
border: 1px solid #3eb998;
background: #3eb998;
cursor: pointer; }
+.pw-AdminThemeUikit .ui-button:hover,
+.pw-AdminThemeUikit button.ui-button.ui-state-hover,
+.pw-AdminThemeUikit .ui-button.ui-state-hover,
.pw-AdminThemeReno .ui-button:hover,
.pw-AdminThemeReno button.ui-button.ui-state-hover,
.pw-AdminThemeReno .ui-button.ui-state-hover {
@@ -313,6 +332,8 @@ button.ui-button.ui-state-active,
background: #e83561;
border: 1px solid #e83561;
text-decoration: none; }
+.pw-AdminThemeUikit .ui-button.ui-state-hover.ui-state-active,
+.pw-AdminThemeUikit .ui-button.ui-state-hover.ui-priority-secondary.ui-state-active,
.pw-AdminThemeReno .ui-button.ui-state-hover.ui-state-active,
.pw-AdminThemeReno .ui-button.ui-state-hover.ui-priority-secondary.ui-state-active {
background: #e83561;
@@ -370,5 +391,3 @@ body.pw-AdminThemeDefault .pw-edit-cancel {
body.pw-AdminThemeDefault .pw-edit-cancel:hover {
background-color: #d80e1c;
border-color: #d80e1c; }
-
-/*# sourceMappingURL=PageFrontEdit.css.map */
diff --git a/wire/modules/Page/PageFrontEdit/PageFrontEdit.js b/wire/modules/Page/PageFrontEdit/PageFrontEdit.js
index af2a2943..5db174ce 100644
--- a/wire/modules/Page/PageFrontEdit/PageFrontEdit.js
+++ b/wire/modules/Page/PageFrontEdit/PageFrontEdit.js
@@ -336,7 +336,7 @@ function PageFrontEditInit($) {
$(document).on('pw-modal-closed', function(e, eventData) {
if(eventData.abort) return; // modal.js populates 'abort' if "x" button was clicked
var target = $(e.target);
- if(!target.is('.pw-edit-modal')) return;
+ if(!target.hasClass('pw-edit-modal')) return;
var targetID = target.attr('id');
var viewURL = $('#pw-url').val();
viewURL += (viewURL.indexOf('?') > -1 ? '&' : '?') + 'pw_edit_fields=' + target.attr('data-fields');
diff --git a/wire/modules/Page/PageFrontEdit/PageFrontEdit.min.js b/wire/modules/Page/PageFrontEdit/PageFrontEdit.min.js
index 4ededa7a..48f7da94 100644
--- a/wire/modules/Page/PageFrontEdit/PageFrontEdit.min.js
+++ b/wire/modules/Page/PageFrontEdit/PageFrontEdit.min.js
@@ -1 +1 @@
-function PageFrontEditInit(f){var k=f(".pw-edit-buttons");var a={};var e=(("ontouchstart" in window)||(navigator.MaxTouchPoints>0)||(navigator.msMaxTouchPoints>0));var i=false;function b(p){i=p;if(i){f("body").addClass("pw-busy")}else{f("body").removeClass("pw-busy")}}function d(p){f("",{rel:"stylesheet",type:"text/css",href:p}).appendTo("head")}function l(r){var q=r.editor;if(q.checkDirty()){var p=f(q.element.$);if(p.length){p.closest(".pw-edit").addClass("pw-changed")}}}function j(u,r,w,v){if(r.hasClass("pw-editing")||i){return}var p=v.attr("id");var q=r.attr("data-name");r.addClass("pw-editing pw-edited");if(!v.data("prev")){v.data("prev",v.html())}w.hide();v.show();k.show();if(r.hasClass("pw-edit-InputfieldCKEditor")&&typeof CKEDITOR!="undefined"){if(typeof a[p]=="undefined"){var s=CKEDITOR.inline(p,ProcessWire.config["InputfieldCKEditor_"+q]);a[p]=s;s.on("blur",function(t){r.removeClass("pw-editing");l(t)});s.on("change",l)}}setTimeout(function(){v.focus()},250)}function g(r){var w=r.children(".pw-edit-orig");var v=r.children(".pw-edit-copy");var p=r.attr("data-name");v.hide();if(e){w.on("pwdoubletap",function(t){j(t,r,w,v);return false})}w.dblclick(function(t){j(t,r,w,v);return false});if(r.hasClass("pw-edit-InputfieldText")){v.keydown(function(t){if(t.keyCode==13){t.preventDefault()}})}if(w.find("a").length){var q=0,u=null,s=false;w.on("click","a",function(){var t=jQuery(this);if(s){s=false;return true}q++;if(q===1){u=setTimeout(function(){q=0;s=true;t[0].click();return true},700)}else{clearTimeout(u);s=false;q=0;w.trigger("dblclick")}return false});w.on("dblclick","a",function(){return false})}if(!r.hasClass("pw-edit-InputfieldCKEditor")){v.blur(function(){var y=f(this);var x=y.closest(".pw-editing");if(x.length==0){return}if(y.html()!=y.data("prev")){x.addClass("pw-changed")}x.removeClass("pw-editing")})}}function m(){f(".pw-edited").each(function(){var p=f(this);var r=p.children(".pw-edit-copy");var q=p.children(".pw-edit-orig");r.hide().html(r.data("prev"));q.show();r.data("prev",null);p.removeClass("pw-changed pw-edited pw-editing")});k.hide()}function n(){if(f(".pw-changed").length>0){if(confirm(ProcessWire.config.PageFrontEdit.labels.cancelConfirm)){m();k.hide()}else{}}else{m()}return false}function h(){if(i){return}b(true);var y=parseInt(f("#Inputfield_id").val());var p=parseInt(f("#pw-edit-lang").val());var s=f(".pw-edit-save");var t=f(".pw-edit-cancel");var v=f(".pw-edit-saving");var w=f(".pw-edit-saved");var x=f(".pw-changed");var q={action:"PageFrontEditSave",id:y,language:p,fields:{}};var u=f("input._post_token");var r=u.attr("name");var z=u.val();q[r]=z;x.each(function(){var D=f(this);var B=D.attr("data-name");var F=parseInt(D.attr("data-page"));var H=D.children(".pw-edit-orig");var G=D.children(".pw-edit-copy");var C=F+"__"+B;if(D.hasClass("pw-edit-InputfieldCKEditor")){var E=a[G.attr("id")];E.getSelection().reset();E.getSelection().removeAllRanges();q.fields[C]=E.getData()}else{var A=document.createElement("textarea");A.innerHTML=G[0].innerHTML;q.fields[C]=A.value}});s.hide();t.hide();v.show();f.post(ProcessWire.config.PageFrontEdit.pageURL,q,function(C){v.hide();if(C.status>0){x.each(function(){var F=f(this);var D=F.attr("data-name");var G=F.attr("data-page");var I=F.children(".pw-edit-orig");var H=F.children(".pw-edit-copy");var E=G+"__"+D;F.removeClass("pw-editing pw-edited pw-changed");I.html(C.formatted[E]);H.html(C.unformatted[E]);H.data("prev",null);H.hide().trigger("pw-reloaded");I.show().trigger("pw-reloaded")});w.show();setTimeout(function(){k.fadeOut("fast",function(){w.hide();s.show();t.show();b(false)})},1000)}else{b(false);alert(C.error);s.show();t.show();k.hide();f(".pw-editing, .pw-edited").each(function(){var D=f(this);D.removeClass("pw-editing, pw-edited, pw-changed");var F=D.children(".pw-edit-orig");var E=D.children(".pw-edit-copy");E.hide();F.show()})}for(var B in a){var A=a[B];A.destroy()}a={}})}function c(){var p=f(".pw-edit-modal");if(!p.length){return}f(document).on("pw-modal-closed",function(u,r){if(r.abort){return}var t=f(u.target);if(!t.is(".pw-edit-modal")){return}var q=t.attr("id");var s=f("#pw-url").val();s+=(s.indexOf("?")>-1?"&":"?")+"pw_edit_fields="+t.attr("data-fields");b(true);t.load(s+" #"+q,{},function(){var x=f(this);var w=x.children();if(w.length){var v=x.children().html();x.html(v)}x.trigger("pw-reloaded");b(false)})})}function o(){if(e){k.addClass("pw-edit-buttons-touch")}var q=f("#pw-fa-test");var p=q.width();if(p<10){d(ProcessWire.config.PageFrontEdit.files.fa)}q.hide();d(ProcessWire.config.PageFrontEdit.files.css);f("body").addClass("pw-"+ProcessWire.config.PageFrontEdit.adminTheme);f(".pw-edit:not(.pw-edit-modal)").each(function(){g(f(this))});c();if(f(".pw-edit-InputfieldCKEditor").length){jQuery.getScript(ProcessWire.config.PageFrontEdit.files.ckeditor,function(){jQuery.getScript(ProcessWire.config.PageFrontEdit.files.modal,function(){for(var r in ProcessWire.config.InputfieldCKEditor.plugins){var s=ProcessWire.config.InputfieldCKEditor.plugins[r];CKEDITOR.plugins.addExternal(r,s,"")}}).fail(function(t,s,r){alert("failed to load modal.js: "+r)})}).fail(function(t,s,r){alert("failed to load ckeditor.js: "+r)})}else{jQuery.getScript(ProcessWire.config.PageFrontEdit.files.modal).fail(function(t,s,r){alert("failed to load modal.js: "+r)})}f(".pw-edit-cancel").click(n);f(".pw-edit-save").click(function(){f(".pw-editing:not(.pw-edit-InputfieldCKEditor)").blur();setTimeout(function(){h()},250)})}o()}jQuery(document).ready(function(a){PageFrontEditInit(a)});
\ No newline at end of file
+function PageFrontEditInit(f){var k=f(".pw-edit-buttons");var a={};var e=(("ontouchstart" in window)||(navigator.MaxTouchPoints>0)||(navigator.msMaxTouchPoints>0));var i=false;function b(p){i=p;if(i){f("body").addClass("pw-busy")}else{f("body").removeClass("pw-busy")}}function d(p){f("",{rel:"stylesheet",type:"text/css",href:p}).appendTo("head")}function l(r){var q=r.editor;if(q.checkDirty()){var p=f(q.element.$);if(p.length){p.closest(".pw-edit").addClass("pw-changed")}}}function j(u,r,w,v){if(r.hasClass("pw-editing")||i){return}var p=v.attr("id");var q=r.attr("data-name");r.addClass("pw-editing pw-edited");if(!v.data("prev")){v.data("prev",v.html())}w.hide();v.show();k.show();if(r.hasClass("pw-edit-InputfieldCKEditor")&&typeof CKEDITOR!="undefined"){if(typeof a[p]=="undefined"){var s=CKEDITOR.inline(p,ProcessWire.config["InputfieldCKEditor_"+q]);a[p]=s;s.on("blur",function(t){r.removeClass("pw-editing");l(t)});s.on("change",l)}}setTimeout(function(){v.focus()},250)}function g(r){var w=r.children(".pw-edit-orig");var v=r.children(".pw-edit-copy");var p=r.attr("data-name");v.hide();if(e){w.on("pwdoubletap",function(t){j(t,r,w,v);return false})}w.dblclick(function(t){j(t,r,w,v);return false});if(r.hasClass("pw-edit-InputfieldText")){v.keydown(function(t){if(t.keyCode==13){t.preventDefault()}})}if(w.find("a").length){var q=0,u=null,s=false;w.on("click","a",function(){var t=jQuery(this);if(s){s=false;return true}q++;if(q===1){u=setTimeout(function(){q=0;s=true;t[0].click();return true},700)}else{clearTimeout(u);s=false;q=0;w.trigger("dblclick")}return false});w.on("dblclick","a",function(){return false})}if(!r.hasClass("pw-edit-InputfieldCKEditor")){v.blur(function(){var y=f(this);var x=y.closest(".pw-editing");if(x.length==0){return}if(y.html()!=y.data("prev")){x.addClass("pw-changed")}x.removeClass("pw-editing")})}}function m(){f(".pw-edited").each(function(){var p=f(this);var r=p.children(".pw-edit-copy");var q=p.children(".pw-edit-orig");r.hide().html(r.data("prev"));q.show();r.data("prev",null);p.removeClass("pw-changed pw-edited pw-editing")});k.hide()}function n(){if(f(".pw-changed").length>0){if(confirm(ProcessWire.config.PageFrontEdit.labels.cancelConfirm)){m();k.hide()}else{}}else{m()}return false}function h(){if(i){return}b(true);var y=parseInt(f("#Inputfield_id").val());var p=parseInt(f("#pw-edit-lang").val());var s=f(".pw-edit-save");var t=f(".pw-edit-cancel");var v=f(".pw-edit-saving");var w=f(".pw-edit-saved");var x=f(".pw-changed");var q={action:"PageFrontEditSave",id:y,language:p,fields:{}};var u=f("input._post_token");var r=u.attr("name");var z=u.val();q[r]=z;x.each(function(){var D=f(this);var B=D.attr("data-name");var F=parseInt(D.attr("data-page"));var H=D.children(".pw-edit-orig");var G=D.children(".pw-edit-copy");var C=F+"__"+B;if(D.hasClass("pw-edit-InputfieldCKEditor")){var E=a[G.attr("id")];E.getSelection().reset();E.getSelection().removeAllRanges();q.fields[C]=E.getData()}else{var A=document.createElement("textarea");A.innerHTML=G[0].innerHTML;q.fields[C]=A.value}});s.hide();t.hide();v.show();f.post(ProcessWire.config.PageFrontEdit.pageURL,q,function(C){v.hide();if(C.status>0){x.each(function(){var F=f(this);var D=F.attr("data-name");var G=F.attr("data-page");var I=F.children(".pw-edit-orig");var H=F.children(".pw-edit-copy");var E=G+"__"+D;F.removeClass("pw-editing pw-edited pw-changed");I.html(C.formatted[E]);H.html(C.unformatted[E]);H.data("prev",null);H.hide().trigger("pw-reloaded");I.show().trigger("pw-reloaded")});w.show();setTimeout(function(){k.fadeOut("fast",function(){w.hide();s.show();t.show();b(false)})},1000)}else{b(false);alert(C.error);s.show();t.show();k.hide();f(".pw-editing, .pw-edited").each(function(){var D=f(this);D.removeClass("pw-editing, pw-edited, pw-changed");var F=D.children(".pw-edit-orig");var E=D.children(".pw-edit-copy");E.hide();F.show()})}for(var B in a){var A=a[B];A.destroy()}a={}})}function c(){var p=f(".pw-edit-modal");if(!p.length){return}f(document).on("pw-modal-closed",function(u,r){if(r.abort){return}var t=f(u.target);if(!t.hasClass("pw-edit-modal")){return}var q=t.attr("id");var s=f("#pw-url").val();s+=(s.indexOf("?")>-1?"&":"?")+"pw_edit_fields="+t.attr("data-fields");b(true);t.load(s+" #"+q,{},function(){var x=f(this);var w=x.children();if(w.length){var v=x.children().html();x.html(v)}x.trigger("pw-reloaded");b(false)})})}function o(){if(e){k.addClass("pw-edit-buttons-touch")}var q=f("#pw-fa-test");var p=q.width();if(p<10){d(ProcessWire.config.PageFrontEdit.files.fa)}q.hide();d(ProcessWire.config.PageFrontEdit.files.css);f("body").addClass("pw-"+ProcessWire.config.PageFrontEdit.adminTheme);f(".pw-edit:not(.pw-edit-modal)").each(function(){g(f(this))});c();if(f(".pw-edit-InputfieldCKEditor").length){jQuery.getScript(ProcessWire.config.PageFrontEdit.files.ckeditor,function(){jQuery.getScript(ProcessWire.config.PageFrontEdit.files.modal,function(){for(var r in ProcessWire.config.InputfieldCKEditor.plugins){var s=ProcessWire.config.InputfieldCKEditor.plugins[r];CKEDITOR.plugins.addExternal(r,s,"")}}).fail(function(t,s,r){alert("failed to load modal.js: "+r)})}).fail(function(t,s,r){alert("failed to load ckeditor.js: "+r)})}else{jQuery.getScript(ProcessWire.config.PageFrontEdit.files.modal).fail(function(t,s,r){alert("failed to load modal.js: "+r)})}f(".pw-edit-cancel").click(n);f(".pw-edit-save").click(function(){f(".pw-editing:not(.pw-edit-InputfieldCKEditor)").blur();setTimeout(function(){h()},250)})}o()}jQuery(document).ready(function(a){PageFrontEditInit(a)});
\ No newline at end of file
diff --git a/wire/modules/Page/PageFrontEdit/PageFrontEdit.module b/wire/modules/Page/PageFrontEdit/PageFrontEdit.module
index 56c3702e..8c778b7d 100644
--- a/wire/modules/Page/PageFrontEdit/PageFrontEdit.module
+++ b/wire/modules/Page/PageFrontEdit/PageFrontEdit.module
@@ -22,7 +22,7 @@ class PageFrontEdit extends WireData implements Module {
return array(
'title' => 'Front-End Page Editor',
'summary' => 'Enables front-end editing of page fields.',
- 'version' => 2,
+ 'version' => 3,
'author' => 'Ryan Cramer',
'license' => 'MPL 2.0',
'icon' => 'cube',
@@ -240,9 +240,13 @@ class PageFrontEdit extends WireData implements Module {
$className = $field->type->className();
$supported = false;
foreach($this->inlineAllowFieldtypes as $allowClass) {
- if($allowClass == $className || in_array($allowClass, $classParents)) {
+ if($allowClass == $className) {
$supported = true;
break;
+ } else if(in_array($allowClass, $classParents)) {
+ $test = $field->type->getBlankValue(new NullPage(), $field);
+ if(!is_object($test)) $supported = true;
+ break;
}
}
return $supported;
@@ -806,6 +810,7 @@ class PageFrontEdit extends WireData implements Module {
$unformatted = $this->getUnformattedValue($page, $field);
$this->inlineEditors[$field->name] = $field->name;
+ $langID = $this->wire('languages') ? $this->wire('user')->language->id : 0;
// make sure we've got any initialization from the Inputfield
$inputfield = $field->___getInputfield($page);
@@ -820,7 +825,7 @@ class PageFrontEdit extends WireData implements Module {
return
"<$tag id=pw-edit-$this->editorNum class='pw-edit pw-edit-$inputfield' data-name=$field->name " .
- "data-page=$page->id style='position:relative'>" .
+ "data-page=$page->id data-lang='$langID' style='position:relative'>" .
"<$tag class=pw-edit-orig>" .
$formatted .
"$tag>" .
diff --git a/wire/modules/Page/PageFrontEdit/PageFrontEdit.scss b/wire/modules/Page/PageFrontEdit/PageFrontEdit.scss
index 8987078e..18aba276 100644
--- a/wire/modules/Page/PageFrontEdit/PageFrontEdit.scss
+++ b/wire/modules/Page/PageFrontEdit/PageFrontEdit.scss
@@ -281,7 +281,7 @@ button.ui-button.ui-state-active,
background: $subtle-bg;
border: none;
margin-top: -8px;
- padding: 1px 8px 1px 8px;
+ padding: 8px 8px 1px 8px;
.ui-dialog-buttonset {
float: right;
}
@@ -345,8 +345,9 @@ button.ui-button.ui-state-active,
filter:Alpha(Opacity=0);
}
-/*** AdminThemeReno jQuery UI ************************************************/
+/*** AdminThemeReno or Uikit jQuery UI ************************************************/
+.pw-AdminThemeUikit,
.pw-AdminThemeReno {
.ui-dialog {
.ui-dialog-titlebar {
@@ -359,6 +360,7 @@ button.ui-button.ui-state-active,
.ui-dialog-buttonpane {
margin-top: -5px;
+ padding-top: 6px;
}
.ui-dialog-title {