mirror of
https://github.com/processwire/processwire.git
synced 2025-08-11 01:04:16 +02:00
Various minor fixes and bump version number to 3.0.63
This commit is contained in:
@@ -45,7 +45,7 @@ class ProcessWire extends Wire {
|
|||||||
* Reversion revision number
|
* Reversion revision number
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
const versionRevision = 62;
|
const versionRevision = 63;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Version suffix string (when applicable)
|
* Version suffix string (when applicable)
|
||||||
|
@@ -139,7 +139,17 @@
|
|||||||
// build the modal URL
|
// build the modal URL
|
||||||
var modalUrl = ProcessWire.config.urls.admin + 'page/link/?id=' + pageID + '&modal=1';
|
var modalUrl = ProcessWire.config.urls.admin + 'page/link/?id=' + pageID + '&modal=1';
|
||||||
var $langWrapper = $textarea.closest('.LanguageSupport');
|
var $langWrapper = $textarea.closest('.LanguageSupport');
|
||||||
if($langWrapper.length) modalUrl += "&lang=" + $langWrapper.data("language");
|
|
||||||
|
if($langWrapper.length) {
|
||||||
|
// multi-language field
|
||||||
|
modalUrl += "&lang=" + $langWrapper.data("language");
|
||||||
|
} else {
|
||||||
|
// multi-language field in Table
|
||||||
|
$langWrapper = $textarea.parents('.InputfieldTable_langTabs').find('li.ui-state-active a')
|
||||||
|
if($langWrapper.length && typeof $langWrapper.data('lang') != "undefined") {
|
||||||
|
modalUrl += "&lang=" + $langWrapper.data('lang');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if($existingLink != null) {
|
if($existingLink != null) {
|
||||||
var attrs = ['href', 'title', 'class', 'rel', 'target'];
|
var attrs = ['href', 'title', 'class', 'rel', 'target'];
|
||||||
|
@@ -1 +1 @@
|
|||||||
(function(){CKEDITOR.plugins.add("pwlink",{requires:"dialog,fakeobjects",init:function(b){var d="a[!href,target,name,title,rel]";var c="a[href]";var e=ProcessWire.config.InputfieldCKEditor.pwlink.classOptions;if(e.length){d+="("+e+")"}b.addCommand("pwlink",{allowedContent:d,requiredContent:c,exec:a});b.addCommand("anchor",new CKEDITOR.dialogCommand("anchor",{allowedContent:"a[!name,id]",requiredContent:"a[name]"}));b.addCommand("unlink",new CKEDITOR.unlinkCommand());b.addCommand("removeAnchor",new CKEDITOR.removeAnchorCommand());b.setKeystroke(CKEDITOR.CTRL+76,"pwlink");if(b.ui.addButton){b.ui.addButton("PWLink",{label:b.lang.link.toolbar,command:"pwlink",toolbar:"links,10",hidpi:true,icon:(CKEDITOR.env.hidpi?this.path+"images/hidpi/pwlink.png":this.path+"images/pwlink.png")});b.ui.addButton("Unlink",{label:b.lang.link.unlink,command:"unlink",toolbar:"links,20"});b.ui.addButton("Anchor",{label:b.lang.link.anchor.toolbar,command:"anchor",toolbar:"links,30"})}b.on("doubleclick",function(f){var g=CKEDITOR.plugins.link.getSelectedLink(b)||f.data.element;if(g.is("a")&&!g.getAttribute("name")&&!g.isReadOnly()){var h=jQuery(g.$);if(h.children("img").length==0){f.cancel();b.commands.pwlink.exec()}}});b.on("instanceReady",function(f){f.editor.removeMenuItem("link")});if(b.contextMenu){b.addMenuItem("pwlinkitem",{label:ProcessWire.config.InputfieldCKEditor.pwlink.edit,command:"pwlink",group:"link",icon:(CKEDITOR.env.hidpi?this.path+"images/hidpi/pwlink.png":this.path+"images/pwlink.png")});b.contextMenu.addListener(function(g){if(!g||g.isReadOnly()){return null}var f=CKEDITOR.plugins.link.tryRestoreFakeAnchor(b,g);var h={};if(!f&&!(f=CKEDITOR.plugins.link.getSelectedLink(b))){return null}if(f.getAttribute("href")&&f.getChildCount()){h={pwlinkitem:CKEDITOR.TRISTATE_OFF}}return h})}}});function a(g){var i=jQuery("#Inputfield_id");if(i.length){var f=i.val()}else{var f=jQuery("#"+g.name).closest(".Inputfield").attr("data-pid")}var u=jQuery("#"+g.name);var w=g.getSelection(true);var s=w.getStartElement();var c=s.getName();var j=w.getSelectedText();var t=null;var p=CKEDITOR.plugins.link.getEditorAnchors(g);if(c=="a"){t=jQuery(s.$);j=s.getHtml();w.selectElement(s)}else{if(c=="td"||c=="th"||c=="tr"){var v=j.substring(0,1);if(v=="\n"||v=="\r"){ProcessWire.alert("Your selection includes part of the table. Please try selecting the text again.");return}}else{if(c=="img"){var k=jQuery(s.$);t=k.parent("a");j=s.$.outerHTML}else{if(j.length<1){return}else{}}}}var m=ProcessWire.config.urls.admin+"page/link/?id="+f+"&modal=1";var d=u.closest(".LanguageSupport");if(d.length){m+="&lang="+d.data("language")}if(t!=null){var q=["href","title","class","rel","target"];for(var r=0;r<q.length;r++){var x=t.attr(q[r]);if(x&&x.length){m+="&"+q[r]+"="+encodeURIComponent(x)}}}if(p.length>0){for(var r=0;r<p.length;r++){m+="&anchors[]="+encodeURIComponent(p[r].id)}}var b=ProcessWire.config.InputfieldCKEditor.pwlink.label;var l=ProcessWire.config.InputfieldCKEditor.pwlink.cancel;var o;function h(){var z=o.contents();var y=jQuery(jQuery("#link_markup",z).text());if(y.attr("href")&&y.attr("href").length){y.html(j);var n=jQuery("<div />").append(y).html();g.insertHtml(n)}o.dialog("close")}var e={title:"<i class='fa fa-link'></i> "+b,open:function(){if(jQuery(".cke_maximized").length>0){jQuery(".ui-dialog").css("z-index",9999);jQuery(".ui-widget-overlay").css("z-index",9998)}},buttons:[{"class":"pw_link_submit_insert",html:"<i class='fa fa-link'></i> "+b,click:h},{html:"<i class='fa fa-times-circle'></i> "+l,click:function(){o.dialog("close")},"class":"ui-priority-secondary"}]};var o=pwModalWindow(m,e,"medium");o.load(function(){var n=o.contents();n.find("#ProcessPageEditLinkForm").data("iframe",o);jQuery("#link_page_url",n).keydown(function(y){var z=jQuery(this);var A=jQuery.trim(z.val());if(y.keyCode==13){y.preventDefault();if(A.length>0){h()}return false}})})}})();
|
(function(){CKEDITOR.plugins.add("pwlink",{requires:"dialog,fakeobjects",init:function(b){var d="a[!href,target,name,title,rel]";var c="a[href]";var e=ProcessWire.config.InputfieldCKEditor.pwlink.classOptions;if(e.length){d+="("+e+")"}b.addCommand("pwlink",{allowedContent:d,requiredContent:c,exec:a});b.addCommand("anchor",new CKEDITOR.dialogCommand("anchor",{allowedContent:"a[!name,id]",requiredContent:"a[name]"}));b.addCommand("unlink",new CKEDITOR.unlinkCommand());b.addCommand("removeAnchor",new CKEDITOR.removeAnchorCommand());b.setKeystroke(CKEDITOR.CTRL+76,"pwlink");if(b.ui.addButton){b.ui.addButton("PWLink",{label:b.lang.link.toolbar,command:"pwlink",toolbar:"links,10",hidpi:true,icon:(CKEDITOR.env.hidpi?this.path+"images/hidpi/pwlink.png":this.path+"images/pwlink.png")});b.ui.addButton("Unlink",{label:b.lang.link.unlink,command:"unlink",toolbar:"links,20"});b.ui.addButton("Anchor",{label:b.lang.link.anchor.toolbar,command:"anchor",toolbar:"links,30"})}b.on("doubleclick",function(f){var g=CKEDITOR.plugins.link.getSelectedLink(b)||f.data.element;if(g.is("a")&&!g.getAttribute("name")&&!g.isReadOnly()){var h=jQuery(g.$);if(h.children("img").length==0){f.cancel();b.commands.pwlink.exec()}}});b.on("instanceReady",function(f){f.editor.removeMenuItem("link")});if(b.contextMenu){b.addMenuItem("pwlinkitem",{label:ProcessWire.config.InputfieldCKEditor.pwlink.edit,command:"pwlink",group:"link",icon:(CKEDITOR.env.hidpi?this.path+"images/hidpi/pwlink.png":this.path+"images/pwlink.png")});b.contextMenu.addListener(function(g){if(!g||g.isReadOnly()){return null}var f=CKEDITOR.plugins.link.tryRestoreFakeAnchor(b,g);var h={};if(!f&&!(f=CKEDITOR.plugins.link.getSelectedLink(b))){return null}if(f.getAttribute("href")&&f.getChildCount()){h={pwlinkitem:CKEDITOR.TRISTATE_OFF}}return h})}}});function a(g){var i=jQuery("#Inputfield_id");if(i.length){var f=i.val()}else{var f=jQuery("#"+g.name).closest(".Inputfield").attr("data-pid")}var u=jQuery("#"+g.name);var w=g.getSelection(true);var s=w.getStartElement();var c=s.getName();var j=w.getSelectedText();var t=null;var p=CKEDITOR.plugins.link.getEditorAnchors(g);if(c=="a"){t=jQuery(s.$);j=s.getHtml();w.selectElement(s)}else{if(c=="td"||c=="th"||c=="tr"){var v=j.substring(0,1);if(v=="\n"||v=="\r"){ProcessWire.alert("Your selection includes part of the table. Please try selecting the text again.");return}}else{if(c=="img"){var k=jQuery(s.$);t=k.parent("a");j=s.$.outerHTML}else{if(j.length<1){return}else{}}}}var m=ProcessWire.config.urls.admin+"page/link/?id="+f+"&modal=1";var d=u.closest(".LanguageSupport");if(d.length){m+="&lang="+d.data("language")}else{d=u.parents(".InputfieldTable_langTabs").find("li.ui-state-active a");if(d.length&&typeof d.data("lang")!="undefined"){m+="&lang="+d.data("lang")}}if(t!=null){var q=["href","title","class","rel","target"];for(var r=0;r<q.length;r++){var x=t.attr(q[r]);if(x&&x.length){m+="&"+q[r]+"="+encodeURIComponent(x)}}}if(p.length>0){for(var r=0;r<p.length;r++){m+="&anchors[]="+encodeURIComponent(p[r].id)}}var b=ProcessWire.config.InputfieldCKEditor.pwlink.label;var l=ProcessWire.config.InputfieldCKEditor.pwlink.cancel;var o;function h(){var z=o.contents();var y=jQuery(jQuery("#link_markup",z).text());if(y.attr("href")&&y.attr("href").length){y.html(j);var n=jQuery("<div />").append(y).html();g.insertHtml(n)}o.dialog("close")}var e={title:"<i class='fa fa-link'></i> "+b,open:function(){if(jQuery(".cke_maximized").length>0){jQuery(".ui-dialog").css("z-index",9999);jQuery(".ui-widget-overlay").css("z-index",9998)}},buttons:[{"class":"pw_link_submit_insert",html:"<i class='fa fa-link'></i> "+b,click:h},{html:"<i class='fa fa-times-circle'></i> "+l,click:function(){o.dialog("close")},"class":"ui-priority-secondary"}]};var o=pwModalWindow(m,e,"medium");o.load(function(){var n=o.contents();n.find("#ProcessPageEditLinkForm").data("iframe",o);jQuery("#link_page_url",n).keydown(function(y){var z=jQuery(this);var A=jQuery.trim(z.val());if(y.keyCode==13){y.preventDefault();if(A.length>0){h()}return false}})})}})();
|
@@ -178,6 +178,8 @@ class LanguageSupportPageNames extends WireData implements Module, ConfigurableM
|
|||||||
$sitePath = '/' . implode('/', $segments) . '/'; // combine to [/subdir]/site/
|
$sitePath = '/' . implode('/', $segments) . '/'; // combine to [/subdir]/site/
|
||||||
$sitePath = str_replace($config->urls->root, '', $sitePath); // remove possible subdir, reduce to: site/
|
$sitePath = str_replace($config->urls->root, '', $sitePath); // remove possible subdir, reduce to: site/
|
||||||
// if it is a request to assets, then don't attempt to modify it
|
// if it is a request to assets, then don't attempt to modify it
|
||||||
|
$sitePath = rtrim($sitePath, '/') . '/';
|
||||||
|
$path = rtrim($path, '/') . '/';
|
||||||
return strpos($path, $sitePath) === 0;
|
return strpos($path, $sitePath) === 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -843,6 +843,7 @@ class ProcessPageEdit extends Process implements WirePageEditor, ConfigurableMod
|
|||||||
|
|
||||||
/** @var InputfieldMarkup $field */
|
/** @var InputfieldMarkup $field */
|
||||||
$field = $this->modules->get("InputfieldMarkup");
|
$field = $this->modules->get("InputfieldMarkup");
|
||||||
|
$field->attr('id+name', 'ChildrenPageList');
|
||||||
$field->label = $title == $defaultTitle ? $this->_("Children / Subpages") : $title; // Children field label
|
$field->label = $title == $defaultTitle ? $this->_("Children / Subpages") : $title; // Children field label
|
||||||
if($pageList) {
|
if($pageList) {
|
||||||
$field->value = $pageList->execute();
|
$field->value = $pageList->execute();
|
||||||
@@ -870,6 +871,7 @@ class ProcessPageEdit extends Process implements WirePageEditor, ConfigurableMod
|
|||||||
if(empty($this->page->template->sortfield) && $this->user->hasPermission('page-sort', $this->page)) {
|
if(empty($this->page->template->sortfield) && $this->user->hasPermission('page-sort', $this->page)) {
|
||||||
$sortfield = $this->page->sortfield && $this->page->sortfield != 'sort' ? $this->page->sortfield : '';
|
$sortfield = $this->page->sortfield && $this->page->sortfield != 'sort' ? $this->page->sortfield : '';
|
||||||
$fieldset = self::buildFormSortfield($sortfield, $this);
|
$fieldset = self::buildFormSortfield($sortfield, $this);
|
||||||
|
$fieldset->attr('id+name', 'ChildrenSortSettings');
|
||||||
$fieldset->label = $this->_('Sort Settings'); // Children sort settings field label
|
$fieldset->label = $this->_('Sort Settings'); // Children sort settings field label
|
||||||
$fieldset->icon = 'sort';
|
$fieldset->icon = 'sort';
|
||||||
$fieldset->description = $this->_("If you want all current and future children to automatically sort by a specific field, select the field below and optionally check the 'reverse' checkbox to make the sort descending. Leave the sort field blank if you want to be able to drag-n-drop to your own order."); // Sort settings description text
|
$fieldset->description = $this->_("If you want all current and future children to automatically sort by a specific field, select the field below and optionally check the 'reverse' checkbox to make the sort descending. Leave the sort field blank if you want to be able to drag-n-drop to your own order."); // Sort settings description text
|
||||||
@@ -1229,7 +1231,7 @@ class ProcessPageEdit extends Process implements WirePageEditor, ConfigurableMod
|
|||||||
$field = $this->modules->get("InputfieldMarkup");
|
$field = $this->modules->get("InputfieldMarkup");
|
||||||
$field->label = $this->_('Who can access this page?'); // Roles information field label
|
$field->label = $this->_('Who can access this page?'); // Roles information field label
|
||||||
$field->icon = 'users';
|
$field->icon = 'users';
|
||||||
$field->attr('id', 'ProcessPageEditRoles');
|
$field->attr('id+name', 'ProcessPageEditRoles');
|
||||||
$field->collapsed = Inputfield::collapsedYesAjax;
|
$field->collapsed = Inputfield::collapsedYesAjax;
|
||||||
|
|
||||||
/** @var MarkupAdminDataTable $table */
|
/** @var MarkupAdminDataTable $table */
|
||||||
@@ -1836,6 +1838,7 @@ class ProcessPageEdit extends Process implements WirePageEditor, ConfigurableMod
|
|||||||
$labelAction = sprintf($this->_('Change template from "%1$s" to "%2$s"'), $this->page->template, $template); // Change template A to B headline
|
$labelAction = sprintf($this->_('Change template from "%1$s" to "%2$s"'), $this->page->template, $template); // Change template A to B headline
|
||||||
|
|
||||||
$this->headline($labelConfirm);
|
$this->headline($labelConfirm);
|
||||||
|
if($this->wire('input')->get('modal')) $this->error("$labelConfirm – $labelAction"); // force modal open
|
||||||
|
|
||||||
/** @var InputfieldForm $form */
|
/** @var InputfieldForm $form */
|
||||||
$form = $this->modules->get("InputfieldForm");
|
$form = $this->modules->get("InputfieldForm");
|
||||||
|
@@ -925,6 +925,8 @@ function InputfieldFormBeforeUnloadEvent(e) {
|
|||||||
function InputfieldStates($target) {
|
function InputfieldStates($target) {
|
||||||
|
|
||||||
var hasTarget = true;
|
var hasTarget = true;
|
||||||
|
var $ = jQuery;
|
||||||
|
|
||||||
if(typeof $target == "undefined") {
|
if(typeof $target == "undefined") {
|
||||||
$target = $("body");
|
$target = $("body");
|
||||||
hasTarget = false;
|
hasTarget = false;
|
||||||
|
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user