mirror of
https://github.com/processwire/processwire.git
synced 2025-08-16 19:54:24 +02:00
Update lots of core .js files to update and replace deprecated jQuery calls
This commit is contained in:
@@ -58,7 +58,7 @@ function CommentFormStars() {
|
||||
if(typeof offClass == "undefined") offClass = 'CommentStarOff';
|
||||
|
||||
if(typeof starOn != "undefined") {
|
||||
var starOff = $parent.attr('data-off');
|
||||
starOff = $parent.attr('data-off');
|
||||
starOn = decodeEntities(starOn);
|
||||
starOff = decodeEntities(starOff);
|
||||
} else {
|
||||
@@ -225,7 +225,8 @@ function CommentFormCookies() {
|
||||
$form.find(".CommentFormCite input").val(values[0]);
|
||||
$form.find(".CommentFormEmail input").val(values[1]);
|
||||
$form.find(".CommentFormWebsite input").val(values[2]);
|
||||
$form.find(".CommentFormNotify :input[value='" + values[3] + "']").attr('checked', 'checked');
|
||||
// $form.find(".CommentFormNotify :input[value='" + values[3] + "']").attr('checked', 'checked'); // JQM
|
||||
$form.find(".CommentFormNotify :input[value='" + values[3] + "']").prop('checked', true);
|
||||
}
|
||||
|
||||
/**
|
||||
|
File diff suppressed because one or more lines are too long
@@ -81,12 +81,14 @@ function InputfieldRepeater($) {
|
||||
var $checkbox = $item.find('#delete_repeater' + pageID);
|
||||
|
||||
if($checkbox.is(":checked")) {
|
||||
$checkbox.removeAttr('checked');
|
||||
// $checkbox.removeAttr('checked'); // JQM
|
||||
$checkbox.prop('checked', false);
|
||||
$header.removeClass('ui-state-error').addClass('ui-state-default');
|
||||
//if($parent.is('.InputfieldStateCollapsed')) $parent.toggleClass('InputfieldStateCollapsed', 100);
|
||||
$item.removeClass('InputfieldRepeaterDeletePending');
|
||||
} else {
|
||||
$checkbox.attr('checked', 'checked');
|
||||
// $checkbox.attr('checked', 'checked'); // JQM
|
||||
$checkbox.prop('checked', true);
|
||||
$header.removeClass('ui-state-default').addClass('ui-state-error');
|
||||
if(!$item.hasClass('InputfieldStateCollapsed')) {
|
||||
$header.find('.toggle-icon').click();
|
||||
@@ -427,13 +429,14 @@ function InputfieldRepeater($) {
|
||||
var $items = $repeater.children('.InputfieldContent').children('.Inputfields').children('.InputfieldRepeaterItem');
|
||||
if(!$items.length) return false;
|
||||
var $item = $items.eq(0);
|
||||
var label, selector;
|
||||
|
||||
if($item.hasClass('InputfieldStateCollapsed')) {
|
||||
var label = ProcessWire.config.InputfieldRepeater.labels.openAll;
|
||||
var selector = '.InputfieldStateCollapsed';
|
||||
label = ProcessWire.config.InputfieldRepeater.labels.openAll;
|
||||
selector = '.InputfieldStateCollapsed';
|
||||
} else {
|
||||
var label = ProcessWire.config.InputfieldRepeater.labels.collapseAll;
|
||||
var selector = '.InputfieldRepeaterItem:not(.InputfieldStateCollapsed)';
|
||||
label = ProcessWire.config.InputfieldRepeater.labels.collapseAll;
|
||||
selector = '.InputfieldRepeaterItem:not(.InputfieldStateCollapsed)';
|
||||
}
|
||||
ProcessWire.confirm(label, function() {
|
||||
$items.filter(selector).each(function() {
|
||||
@@ -745,17 +748,18 @@ function InputfieldRepeater($) {
|
||||
*
|
||||
*/
|
||||
function initRepeater($this) {
|
||||
var $inputfields, $inputfieldRepeater, isItem;
|
||||
|
||||
if($this.hasClass('InputfieldRepeaterItem')) {
|
||||
// single repeater item
|
||||
var $inputfields = $this;
|
||||
var $inputfieldRepeater = $this.closest('.InputfieldRepeater');
|
||||
var isItem = true;
|
||||
$inputfields = $this;
|
||||
$inputfieldRepeater = $this.closest('.InputfieldRepeater');
|
||||
isItem = true;
|
||||
} else {
|
||||
// enter repeater
|
||||
var $inputfields = $this.find('.Inputfields:eq(0)');
|
||||
var $inputfieldRepeater = $this;
|
||||
var isItem = false;
|
||||
$inputfields = $this.find('.Inputfields:eq(0)');
|
||||
$inputfieldRepeater = $this;
|
||||
isItem = false;
|
||||
}
|
||||
|
||||
if($inputfields.hasClass('InputfieldRepeaterInit')) return;
|
||||
|
File diff suppressed because one or more lines are too long
@@ -146,12 +146,13 @@
|
||||
|
||||
if(options.sortable) makeSortable();
|
||||
|
||||
/*
|
||||
if(typeof $.browser != "undefined" && typeof $.browser.msie != "undefined") {
|
||||
msie = $.browser.msie ? $.browser.version : 0;
|
||||
}
|
||||
|
||||
if(msie > 0 && msie < 8) $ol.css('display', 'inline-block'); // Thanks Matthew Hutton
|
||||
|
||||
*/
|
||||
|
||||
if(options.fieldset) {
|
||||
setupFieldsets();
|
||||
$original.children('option').each(function() {
|
||||
@@ -311,7 +312,8 @@
|
||||
// an already-open parent option has been clicked
|
||||
hideSelectOptions($children);
|
||||
parentHTML = parentHTML.replace(/\+\d+ ./, ''); // note the '.' represents the UTF-8 arrow icon
|
||||
$option.removeClass(options.optionParentOpenClass).removeAttr('selected');
|
||||
// $option.removeClass(options.optionParentOpenClass).removeAttr('selected');
|
||||
$option.removeClass(options.optionParentOpenClass).prop('selected', false);
|
||||
} else {
|
||||
// a closed parent has been clicked
|
||||
var indent = options.optionChildIndent;
|
||||
@@ -326,15 +328,18 @@
|
||||
}
|
||||
});
|
||||
showSelectOptions($children, $option);
|
||||
$select.find(':selected').removeAttr('selected');
|
||||
// $select.find(':selected').removeAttr('selected');
|
||||
$select.find(':selected').prop('selected', false);
|
||||
// collapse any existing parents that are open (behave as accordion)
|
||||
if(!$option.hasClass(options.optionChildClass)) {
|
||||
$select.find('.' + options.optionParentOpenClass).each(function() {
|
||||
$(this).attr('selected', 'selected').change(); // trigger close if any existing open
|
||||
// $(this).attr('selected', 'selected').change(); // trigger close if any existing open
|
||||
$(this).prop('selected', true).change(); // trigger close if any existing open
|
||||
});
|
||||
}
|
||||
// make the parent selected, encouraging them to click to select a child
|
||||
$option.addClass(options.optionParentOpenClass).attr('selected', 'selected');
|
||||
// $option.addClass(options.optionParentOpenClass).attr('selected', 'selected');
|
||||
$option.addClass(options.optionParentOpenClass).prop('selected', true);
|
||||
parentHTML += openLabel;
|
||||
var highlightOption = options.highlight;
|
||||
options.highlight = true; // temporarily enable, even if not otherwise enabled
|
||||
@@ -356,7 +361,8 @@
|
||||
*/
|
||||
function childOptionSelected($select, $option) {
|
||||
// if an option.asmChild was selected, keep the parent selected afterwards
|
||||
$select.find("option[value='" + $option.attr(options.optionChildAttr) + "']").attr('selected', 'selected');
|
||||
// $select.find("option[value='" + $option.attr(options.optionChildAttr) + "']").attr('selected', 'selected');
|
||||
$select.find("option[value='" + $option.attr(options.optionChildAttr) + "']").prop('selected', true);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -575,7 +581,8 @@
|
||||
*
|
||||
*/
|
||||
function selectFirstItem() {
|
||||
$select.children(":eq(0)").attr("selected", true);
|
||||
// $select.children(":eq(0)").attr("selected", true);
|
||||
$select.children(":eq(0)").prop("selected", true);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -589,9 +596,8 @@
|
||||
// because safari is the only browser that makes disabled items look 'disabled'
|
||||
// we apply a class that reproduces the disabled look in other browsers
|
||||
|
||||
$option.addClass(options.optionDisabledClass)
|
||||
.attr("selected", false)
|
||||
.attr("disabled", true);
|
||||
// $option.addClass(options.optionDisabledClass).attr("selected", false).attr("disabled", true);
|
||||
$option.addClass(options.optionDisabledClass).prop("selected", false).prop("disabled", true);
|
||||
|
||||
if(options.hideWhenEmpty) {
|
||||
if($option.siblings('[disabled!=true]').length < 2) $select.hide();
|
||||
@@ -708,7 +714,8 @@
|
||||
|
||||
if(!buildingSelect) {
|
||||
if($O.is(":selected")) return; // already have it
|
||||
$O.attr('selected', true);
|
||||
// $O.attr('selected', true);
|
||||
$O.prop('selected', true);
|
||||
}
|
||||
|
||||
if(options.addItemTarget == 'top' && !buildingSelect) {
|
||||
@@ -785,7 +792,8 @@
|
||||
|
||||
if(typeof highlightItem == "undefined") highlightItem = true;
|
||||
|
||||
$O.attr('selected', false);
|
||||
// $O.attr('selected', false);
|
||||
$O.prop('selected', false);
|
||||
$item = $ol.children("li[rel=" + optionId + "]");
|
||||
|
||||
dropListItemHide($item);
|
||||
|
File diff suppressed because one or more lines are too long
@@ -10,7 +10,8 @@ jQuery(document).ready(function($) {
|
||||
if(e.shiftKey) {
|
||||
var start = $checkboxes.index(this);
|
||||
var end = $checkboxes.index(lastChecked);
|
||||
$checkboxes.slice(Math.min(start,end), Math.max(start,end)+ 1).attr('checked', lastChecked.checked);
|
||||
// $checkboxes.slice(Math.min(start,end), Math.max(start,end)+ 1).attr('checked', lastChecked.checked); // JQM
|
||||
$checkboxes.slice(Math.min(start,end), Math.max(start,end)+ 1).prop('checked', lastChecked.checked ? true : false);
|
||||
}
|
||||
lastChecked = this;
|
||||
});
|
||||
|
@@ -1 +1 @@
|
||||
jQuery(document).ready(function(b){var a=null;b(document).on("click",".InputfieldCheckboxes ul input[type=checkbox]",function(f){var d=b(this).closest("ul").find("input[type=checkbox]");if(!a){a=this;return}if(f.shiftKey){var g=d.index(this);var c=d.index(a);d.slice(Math.min(g,c),Math.max(g,c)+1).attr("checked",a.checked)}a=this});b(document).on("resized",".InputfieldCheckboxes, .InputfieldPage",function(c){b(this).find(".InputfieldCheckboxesColumns").each(function(){var e=b(this);var d=0;var f=false;e.children("li").each(function(){var h=b(this);if(f){return}if(!d){d=h.height();return}var g=Math.abs(h.height()-d);if(g>5){f=true}});if(f){e.removeClass("InputfieldCheckboxesColumns");e.find("li").css("width","100%")}})});b(document).on("reloaded",".InputfieldCheckboxes, .InputfieldPage",function(c){if(b(this).find(".InputfieldCheckboxesColumns").length){b(this).trigger("resized")}});b(".InputfieldCheckboxesColumns").closest(".Inputfield").trigger("resized")});
|
||||
jQuery(document).ready(function($){var lastChecked=null;$(document).on("click",".InputfieldCheckboxes ul input[type=checkbox]",function(e){var $checkboxes=$(this).closest("ul").find("input[type=checkbox]");if(!lastChecked){lastChecked=this;return}if(e.shiftKey){var start=$checkboxes.index(this);var end=$checkboxes.index(lastChecked);$checkboxes.slice(Math.min(start,end),Math.max(start,end)+1).prop("checked",lastChecked.checked?true:false)}lastChecked=this});$(document).on("resized",".InputfieldCheckboxes, .InputfieldPage",function(e){$(this).find(".InputfieldCheckboxesColumns").each(function(){var $ul=$(this);var height=0;var collapseColumns=false;$ul.children("li").each(function(){var $li=$(this);if(collapseColumns)return;if(!height){height=$li.height();return}var diff=Math.abs($li.height()-height);if(diff>5)collapseColumns=true});if(collapseColumns){$ul.removeClass("InputfieldCheckboxesColumns");$ul.find("li").css("width","100%")}})});$(document).on("reloaded",".InputfieldCheckboxes, .InputfieldPage",function(e){if($(this).find(".InputfieldCheckboxesColumns").length)$(this).trigger("resized")});$(".InputfieldCheckboxesColumns").closest(".Inputfield").trigger("resized")});
|
@@ -71,7 +71,10 @@ class InputfieldCheckboxes extends InputfieldSelectMultiple implements Inputfiel
|
||||
$checked = '';
|
||||
|
||||
if($this->isOptionSelected($key)) $checked = " checked='checked'";
|
||||
$id = $this->id . "_" . $this->wire('sanitizer')->name($key);
|
||||
|
||||
$id = $this->wire()->sanitizer->name($key);
|
||||
if(!strlen(trim($id, '_'))) $id = trim(base64_encode($key), '=/.');
|
||||
$id = $this->id . '_' . $id;
|
||||
|
||||
$attrs = $this->getOptionAttributes($key);
|
||||
$disabled = empty($attrs['disabled']) ? '' : " disabled='disabled'";
|
||||
|
@@ -14,8 +14,13 @@ $(document).ready(function() {
|
||||
// enable double-click to delete all
|
||||
var $input = $(this).find('input');
|
||||
var $items = $(this).parents('.InputfieldFileList').find('.InputfieldFileDelete input');
|
||||
if($input.is(":checked")) $items.removeAttr('checked').change();
|
||||
else $items.attr('checked', 'checked').change();
|
||||
if($input.is(":checked")) {
|
||||
// $items.removeAttr('checked').change(); // JQM
|
||||
$items.prop('checked', false).change();
|
||||
} else {
|
||||
// $items.attr('checked', 'checked').change(); // JQM
|
||||
$items.prop('checked', true).change();
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
@@ -219,7 +224,7 @@ $(document).ready(function() {
|
||||
var dropArea = $this.get(0);
|
||||
var $fileList = $this.find(".InputfieldFileList");
|
||||
|
||||
if($fileList.size() < 1) {
|
||||
if($fileList.length < 1) {
|
||||
$fileList = $("<ul class='InputfieldFileList InputfieldFileListBlank'></ul>");
|
||||
$this.prepend($fileList);
|
||||
$this.parent('.Inputfield').addClass('InputfieldFileEmpty');
|
||||
@@ -293,7 +298,7 @@ $(document).ready(function() {
|
||||
|
||||
if(r.replace) {
|
||||
var $child = $this.find('.InputfieldFileList').children('li:eq(0)');
|
||||
if($child.size() > 0) $child.slideUp('fast', function() { $child.remove(); });
|
||||
if($child.length > 0) $child.slideUp('fast', function() { $child.remove(); });
|
||||
}
|
||||
|
||||
// ie10 file field stays populated, this fixes that
|
||||
|
File diff suppressed because one or more lines are too long
@@ -208,7 +208,8 @@ function InputfieldImage($) {
|
||||
if(checked) {
|
||||
$items.prop("checked", "checked").change();
|
||||
} else {
|
||||
$items.removeAttr("checked").change();
|
||||
// $items.removeAttr("checked").change(); // JQM
|
||||
$items.prop("checked", false).change();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -217,10 +218,11 @@ function InputfieldImage($) {
|
||||
*
|
||||
*/
|
||||
function updateGrid($inputfield) {
|
||||
var $gridImages;
|
||||
if(typeof $inputfield == "undefined") {
|
||||
var $gridImages = $(".gridImages");
|
||||
$gridImages = $(".gridImages");
|
||||
} else {
|
||||
var $gridImages = $inputfield.find(".gridImages");
|
||||
$gridImages = $inputfield.find(".gridImages");
|
||||
}
|
||||
$gridImages.each(function() {
|
||||
var $grid = $(this),
|
||||
@@ -237,8 +239,9 @@ function InputfieldImage($) {
|
||||
var narrowItems = [];
|
||||
var mediumItems = [];
|
||||
var wideItems = [];
|
||||
var ni = 0, mi = 0, wi = 0;
|
||||
var n = 0, ni = 0, mi = 0, wi = 0;
|
||||
var $inputfields;
|
||||
var $item;
|
||||
|
||||
if(typeof $inputfield == "undefined") {
|
||||
$inputfields = $(".InputfieldImage.Inputfield");
|
||||
@@ -249,7 +252,7 @@ function InputfieldImage($) {
|
||||
$inputfields.removeClass('InputfieldImageNarrow InputfieldImageMedium InputfieldImageWide');
|
||||
|
||||
$inputfields.each(function() {
|
||||
var $item = $(this);
|
||||
$item = $(this);
|
||||
var width = $item.width();
|
||||
if(width < 1) return;
|
||||
if(width <= 500) {
|
||||
@@ -264,16 +267,16 @@ function InputfieldImage($) {
|
||||
}
|
||||
});
|
||||
|
||||
for(var n = 0; n < ni; n++) {
|
||||
var $item = narrowItems[n];
|
||||
for(n = 0; n < ni; n++) {
|
||||
$item = narrowItems[n];
|
||||
$item.addClass('InputfieldImageNarrow');
|
||||
}
|
||||
for(var n = 0; n < mi; n++) {
|
||||
var $item = mediumItems[n];
|
||||
for(n = 0; n < mi; n++) {
|
||||
$item = mediumItems[n];
|
||||
$item.addClass('InputfieldImageMedium');
|
||||
}
|
||||
for(var n = 0; n < wi; n++) {
|
||||
var $item = wideItems[n];
|
||||
for(n = 0; n < wi; n++) {
|
||||
$item = wideItems[n];
|
||||
$item.addClass('InputfieldImageWide');
|
||||
}
|
||||
}
|
||||
@@ -397,7 +400,7 @@ function InputfieldImage($) {
|
||||
if(typeof focusStr == "undefined") {
|
||||
if(focusData !== null) return focusData;
|
||||
var $input = $edit.find('.InputfieldImageFocus');
|
||||
var focusStr = $input.val();
|
||||
focusStr = $input.val();
|
||||
}
|
||||
|
||||
var a = focusStr.split(' ');
|
||||
@@ -685,7 +688,7 @@ function InputfieldImage($) {
|
||||
*
|
||||
*/
|
||||
function getFocusZoomPosition4GridviewSquare(focusPercent, sourceDimPX, gridViewPX, zoomPercent, scale, smallestSidePX) {
|
||||
var sourceDimPX = sourceDimPX * scale; // is used to later get the position in pixel
|
||||
sourceDimPX = sourceDimPX * scale; // is used to later get the position in pixel
|
||||
var gridViewPercent = gridViewPX / sourceDimPX * 100; // get percent of the gridViewBox in regard to the current image side size (width|height)
|
||||
var adjustPercent = gridViewPercent / 2; // is used to calculate position from the circle center point to [left|top] percent
|
||||
var posPercent = focusPercent - adjustPercent; // get adjusted position in percent
|
||||
@@ -1125,11 +1128,12 @@ function InputfieldImage($) {
|
||||
*
|
||||
*/
|
||||
function setGridSizeItem($item, gridSize, ragged, focus) {
|
||||
var $img;
|
||||
|
||||
if($item.hasClass('gridImage__overflow')) {
|
||||
var $img = $item.children('img');
|
||||
$img = $item.children('img');
|
||||
} else if($item.is('img')) {
|
||||
var $img = $item;
|
||||
$img = $item;
|
||||
$item = $img.closest('.gridImage__overflow');
|
||||
} else {
|
||||
return;
|
||||
@@ -1174,17 +1178,18 @@ function InputfieldImage($) {
|
||||
|
||||
} else if(zoom > 0 && $item.closest('.InputfieldImageFocusZoom').length && !gridSliding) {
|
||||
// focus with zoom
|
||||
var maxHeight, maxWidth;
|
||||
if(w >= h) {
|
||||
var maxHeight = '100%';
|
||||
var maxWidth = 'none';
|
||||
maxHeight = '100%';
|
||||
maxWidth = 'none';
|
||||
if(w == dataW) {
|
||||
// scale full dimensions proportionally to gridSize
|
||||
h = gridSize;
|
||||
w = (h / dataH) * dataW
|
||||
}
|
||||
} else {
|
||||
var maxHeight = 'none';
|
||||
var maxWidth = '100%';
|
||||
maxHeight = 'none';
|
||||
maxWidth = '100%';
|
||||
if(h == dataH) {
|
||||
// scale full dimensions proportionally to gridSize
|
||||
w = gridSize;
|
||||
@@ -1237,7 +1242,7 @@ function InputfieldImage($) {
|
||||
$img.removeAttr('width').attr('height', gridSize);
|
||||
}
|
||||
|
||||
var w = $img.width();
|
||||
w = $img.width();
|
||||
// if(!w) w = $img.attr('data-w');
|
||||
|
||||
if(w) {
|
||||
@@ -1448,7 +1453,7 @@ function InputfieldImage($) {
|
||||
var data = cookieData ? cookieData : $.cookie('InputfieldImage');
|
||||
var value = null;
|
||||
|
||||
if(!data) var data = {};
|
||||
if(!data) data = {};
|
||||
|
||||
// setup default values
|
||||
if(typeof data[name] == "undefined") data[name] = {};
|
||||
|
File diff suppressed because one or more lines are too long
@@ -78,7 +78,7 @@ var InputfieldPageAutocomplete = {
|
||||
$icon.attr('data-class', $icon.attr('class'));
|
||||
|
||||
function isAddAllowed() {
|
||||
var allowed = $('#_' + id.replace('Inputfield_', '') + '_add_items').size() > 0;
|
||||
var allowed = $('#_' + id.replace('Inputfield_', '') + '_add_items').length > 0;
|
||||
return allowed;
|
||||
}
|
||||
|
||||
@@ -173,6 +173,7 @@ var InputfieldPageAutocomplete = {
|
||||
$icon.attr('class', $icon.attr('data-class'));
|
||||
|
||||
}).keydown(function(event) {
|
||||
var $addNote;
|
||||
if(event.keyCode == 13) {
|
||||
// prevents enter from submitting the form
|
||||
event.preventDefault();
|
||||
@@ -192,9 +193,9 @@ var InputfieldPageAutocomplete = {
|
||||
$value.val(page.page_id);
|
||||
$("#_" + id.replace('Inputfield_', '') + '_add_items').val(page.label);
|
||||
$input.addClass('added_item').blur();
|
||||
var $addNote = $note.siblings(".InputfieldPageAutocompleteNoteAdd");
|
||||
$addNote = $note.siblings(".InputfieldPageAutocompleteNoteAdd");
|
||||
if(!$addNote.length) {
|
||||
var $addNote = $("<div class='notes InputfieldPageAutocompleteNote InputfieldPageAutocompleteNoteAdd'></div>");
|
||||
$addNote = $("<div class='notes InputfieldPageAutocompleteNote InputfieldPageAutocompleteNoteAdd'></div>");
|
||||
$note.after($addNote);
|
||||
}
|
||||
$addNote.text($note.attr('data-adding') + ' ' + page.label);
|
||||
@@ -214,7 +215,7 @@ var InputfieldPageAutocomplete = {
|
||||
|
||||
if(numAdded && noList) {
|
||||
// some other key after an item already added, so remove added item info for potential new one
|
||||
var $addNote = $note.siblings(".InputfieldPageAutocompleteNoteAdd");
|
||||
$addNote = $note.siblings(".InputfieldPageAutocompleteNoteAdd");
|
||||
var $addText = $("#_" + id.replace('Inputfield_', '') + '_add_items');
|
||||
if($addNote.length && $addText.val() != $(this).val()) {
|
||||
// added value has changed
|
||||
@@ -365,8 +366,8 @@ var InputfieldPageAutocomplete = {
|
||||
var max = parseInt($input.attr('data-max'));
|
||||
|
||||
var $children = $ol.children(':not(.itemTemplate)');
|
||||
if(max > 0 && $children.size() > max) {
|
||||
while($children.size() > max) $children = $children.slice(1);
|
||||
if(max > 0 && $children.length > max) {
|
||||
while($children.length > max) $children = $children.slice(1);
|
||||
$ol.children(':not(.itemTemplate)').replaceWith($children);
|
||||
}
|
||||
|
||||
@@ -382,7 +383,7 @@ var InputfieldPageAutocomplete = {
|
||||
$input.val(value);
|
||||
|
||||
var $addItems = $('#_' + name + '_add_items');
|
||||
if($addItems.size() > 0) $addItems.val(addValue);
|
||||
if($addItems.length > 0) $addItems.val(addValue);
|
||||
},
|
||||
|
||||
updateIcons: function($target) {
|
||||
|
File diff suppressed because one or more lines are too long
@@ -176,8 +176,9 @@ $(document).ready(function() {
|
||||
|
||||
$(document).on('click', '.InputfieldPageTableOrphansAll', function() {
|
||||
var $checkboxes = $(this).closest('.InputfieldPageTableOrphans').find('input');
|
||||
if($checkboxes.eq(0).is(":checked")) $checkboxes.removeAttr('checked');
|
||||
else $checkboxes.attr('checked', 'checked');
|
||||
// if($checkboxes.eq(0).is(":checked")) $checkboxes.removeAttr('checked'); // JQM
|
||||
// else $checkboxes.attr('checked', 'checked'); // JQM
|
||||
$checkboxes.prop('checked', ($checkboxes.eq(0).is(':checked') ? false : true));
|
||||
return false;
|
||||
});
|
||||
});
|
||||
|
@@ -1 +1 @@
|
||||
function InputfieldPageTableDialog(){var c=$(this);var a=c.attr("data-url");var h=c.attr("data-title");var e=true;var j=$(this).parents(".InputfieldPageTableContainer");var f=0;var g=parseInt(j.attr("data-noclose"));var b={close:function(l,n){if(f>0){var m=j.attr("data-url")+"&InputfieldPageTableAdd="+f;var k=j.siblings(".InputfieldPageTableSort").val();if(typeof k!="undefined"&&k.length){m+="&InputfieldPageTableSort="+k.replace(/\|/g,",")}$.get(m,function(o){j.html(o);j.find(".Inputfield").trigger("reloaded",["InputfieldPageTable"]);j.effect("highlight",500,function(){var q=j.find("table");q.find("tbody").css("overflow","visible");InputfieldPageTableSortable(q);var p=j.siblings("input.InputfieldPageTableDelete").eq(0).val().split("|");if(p.length){for(var s=0;s<p.length;s++){var r=p[s];q.find("tr[data-id="+r+"]").addClass("InputfieldPageTableDelete ui-state-error-text ui-state-disabled")}}})})}}};var i=pwModalWindow(a,b,"large");var d=false;if(c.is(".InputfieldPageTableAdd")){e=false}i.load(function(){var l=[];var m=i.contents();var o=0;f=m.find("#Inputfield_id").val();m.find("#wrap_Inputfield_template, #wrap_template, #wrap_parent_id").hide();m.find("#_ProcessPageEditDelete, #_ProcessPageEditChildren").hide();e=g==0&&m.find("#ProcessPageAdd").length==0;if(e&&d){if(m.find(".NoticeError, .NoticeWarning, .ui-state-error").length==0){if(typeof Notifications!="undefined"){var k=[];m.find(".NoticeMessage").each(function(){k[k.length]=$(this).text()});if(k.length>0){setTimeout(function(){for(var n=0;n<k.length;n++){Notifications.message(k[n])}},500)}}i.dialog("close");return}else{}}m.find("#content form button.ui-button[type=submit]").each(function(){var q=$(this);var r=q.text();var p=false;for(var n=0;n<l.length;n++){if(l[n].text==r||r.length<1){p=true}}if(!p){l[o]={text:r,"class":(q.is(".ui-priority-secondary")?"ui-priority-secondary":""),click:function(){q.click();if(e){d=true}if(!g){e=true}}};o++}q.hide()});i.setButtons(l)});return false}function InputfieldPageTableUpdate(a){var b="";if(!a.is("tbody")){a=a.find("tbody")}a.find("tr").each(function(){var e=$(this).attr("data-id");if(b.length>0){b+="|"}b+=e});var c=a.parents(".InputfieldPageTableContainer");var d=c.siblings(".InputfieldPageTableSort");d.val(b)}function InputfieldPageTableSortable(a){a.find("tbody").sortable({axis:"y",start:function(c,d){var b=[];var e=0;a.find("thead").find("th").each(function(){b[e]=$(this).width();e++});e=0;d.helper.find("td").each(function(){$(this).attr("width",b[e]);e++})},stop:function(b,c){InputfieldPageTableUpdate($(this))}})}function InputfieldPageTableDelete(){var a=$(this).closest("tr");a.toggleClass("InputfieldPageTableDelete ui-state-error-text ui-state-disabled");var b="";a.parents("tbody").children("tr").each(function(){var d=$(this);var e=d.attr("data-id");if(d.is(".InputfieldPageTableDelete")){b+=(b.length>0?"|":"")+e}});var c=$(this).parents(".InputfieldPageTableContainer").siblings("input.InputfieldPageTableDelete");c.val(b);return false}$(document).ready(function(){$(document).on("click",".InputfieldPageTableAdd, .InputfieldPageTableEdit",InputfieldPageTableDialog);$(document).on("click","a.InputfieldPageTableDelete",InputfieldPageTableDelete);$(document).on("dblclick",".InputfieldPageTable .AdminDataTable td",function(){$(this).closest("tr").find(".InputfieldPageTableEdit").click()});InputfieldPageTableSortable($(".InputfieldPageTable table"));$(document).on("reloaded",".InputfieldPageTable",function(){InputfieldPageTableSortable($(this).find(".InputfieldPageTableContainer > table"))});$(document).on("click",".InputfieldPageTableOrphansAll",function(){var a=$(this).closest(".InputfieldPageTableOrphans").find("input");if(a.eq(0).is(":checked")){a.removeAttr("checked")}else{a.attr("checked","checked")}return false})});
|
||||
function InputfieldPageTableDialog(){var $a=$(this);var url=$a.attr("data-url");var title=$a.attr("data-title");var closeOnSave=true;var $container=$(this).parents(".InputfieldPageTableContainer");var dialogPageID=0;var noclose=parseInt($container.attr("data-noclose"));var modalSettings={close:function(event,ui){if(dialogPageID>0){var ajaxURL=$container.attr("data-url")+"&InputfieldPageTableAdd="+dialogPageID;var sort=$container.siblings(".InputfieldPageTableSort").val();if(typeof sort!="undefined"&&sort.length)ajaxURL+="&InputfieldPageTableSort="+sort.replace(/\|/g,",");$.get(ajaxURL,function(data){$container.html(data);$container.find(".Inputfield").trigger("reloaded",["InputfieldPageTable"]);$container.effect("highlight",500,function(){var $table=$container.find("table");$table.find("tbody").css("overflow","visible");InputfieldPageTableSortable($table);var deleteIDs=$container.siblings("input.InputfieldPageTableDelete").eq(0).val().split("|");if(deleteIDs.length){for(var n=0;n<deleteIDs.length;n++){var deleteID=deleteIDs[n];$table.find("tr[data-id="+deleteID+"]").addClass("InputfieldPageTableDelete ui-state-error-text ui-state-disabled")}}})})}}};var $iframe=pwModalWindow(url,modalSettings,"large");var closeOnSaveReady=false;if($a.is(".InputfieldPageTableAdd"))closeOnSave=false;$iframe.load(function(){var buttons=[];var $icontents=$iframe.contents();var n=0;dialogPageID=$icontents.find("#Inputfield_id").val();$icontents.find("#wrap_Inputfield_template, #wrap_template, #wrap_parent_id").hide();$icontents.find("#_ProcessPageEditDelete, #_ProcessPageEditChildren").hide();closeOnSave=noclose==0&&$icontents.find("#ProcessPageAdd").length==0;if(closeOnSave&&closeOnSaveReady){if($icontents.find(".NoticeError, .NoticeWarning, .ui-state-error").length==0){if(typeof Notifications!="undefined"){var messages=[];$icontents.find(".NoticeMessage").each(function(){messages[messages.length]=$(this).text()});if(messages.length>0)setTimeout(function(){for(var i=0;i<messages.length;i++){Notifications.message(messages[i])}},500)}$iframe.dialog("close");return}else{}}$icontents.find("#content form button.ui-button[type=submit]").each(function(){var $button=$(this);var text=$button.text();var skip=false;for(var i=0;i<buttons.length;i++){if(buttons[i].text==text||text.length<1)skip=true}if(!skip){buttons[n]={text:text,class:$button.is(".ui-priority-secondary")?"ui-priority-secondary":"",click:function(){$button.click();if(closeOnSave)closeOnSaveReady=true;if(!noclose)closeOnSave=true}};n++}$button.hide()});$iframe.setButtons(buttons)});return false}function InputfieldPageTableUpdate($table){var value="";if(!$table.is("tbody"))$table=$table.find("tbody");$table.find("tr").each(function(){var pageID=$(this).attr("data-id");if(value.length>0)value+="|";value+=pageID});var $container=$table.parents(".InputfieldPageTableContainer");var $input=$container.siblings(".InputfieldPageTableSort");$input.val(value)}function InputfieldPageTableSortable($table){$table.find("tbody").sortable({axis:"y",start:function(event,ui){var widths=[];var n=0;$table.find("thead").find("th").each(function(){widths[n]=$(this).width();n++});n=0;ui.helper.find("td").each(function(){$(this).attr("width",widths[n]);n++})},stop:function(event,ui){InputfieldPageTableUpdate($(this))}})}function InputfieldPageTableDelete(){var $row=$(this).closest("tr");$row.toggleClass("InputfieldPageTableDelete ui-state-error-text ui-state-disabled");var ids="";$row.parents("tbody").children("tr").each(function(){var $tr=$(this);var id=$tr.attr("data-id");if($tr.is(".InputfieldPageTableDelete"))ids+=(ids.length>0?"|":"")+id});var $input=$(this).parents(".InputfieldPageTableContainer").siblings("input.InputfieldPageTableDelete");$input.val(ids);return false}$(document).ready(function(){$(document).on("click",".InputfieldPageTableAdd, .InputfieldPageTableEdit",InputfieldPageTableDialog);$(document).on("click","a.InputfieldPageTableDelete",InputfieldPageTableDelete);$(document).on("dblclick",".InputfieldPageTable .AdminDataTable td",function(){$(this).closest("tr").find(".InputfieldPageTableEdit").click()});InputfieldPageTableSortable($(".InputfieldPageTable table"));$(document).on("reloaded",".InputfieldPageTable",function(){InputfieldPageTableSortable($(this).find(".InputfieldPageTableContainer > table"))});$(document).on("click",".InputfieldPageTableOrphansAll",function(){var $checkboxes=$(this).closest(".InputfieldPageTableOrphans").find("input");$checkboxes.prop("checked",$checkboxes.eq(0).is(":checked")?false:true);return false})});
|
@@ -63,7 +63,10 @@ class InputfieldRadios extends InputfieldSelect {
|
||||
foreach($options as $key => $value) {
|
||||
|
||||
$checked = '';
|
||||
$id = $this->id . "_" . $sanitizer->name($key);
|
||||
|
||||
$id = $sanitizer->name($key);
|
||||
if(!strlen(trim($id, '_'))) $id = trim(base64_encode($key), '=/.');
|
||||
$id = $this->id . '_' . $id;
|
||||
$attrs = $this->getOptionAttributes($key);
|
||||
|
||||
$inputClass = trim($this->attr('class'));
|
||||
|
@@ -38,21 +38,25 @@ function InputfieldToggleInit() {
|
||||
// check of another item was clicked when an existing selection was in place
|
||||
if($prevInput.length && $prevInput.attr('id') != $input.attr('id')) {
|
||||
// remove our custom class from existing selection
|
||||
$prevInput.removeClass(inputCheckedClass).removeAttr('checked');
|
||||
// $prevInput.removeClass(inputCheckedClass).removeAttr('checked'); // JQM
|
||||
$prevInput.removeClass(inputCheckedClass).prop('checked', false);
|
||||
if($prevLabel) $prevLabel.removeClass(labelCheckedClass);
|
||||
}
|
||||
|
||||
// check if clicked input was already checked
|
||||
if($input.hasClass(inputCheckedClass) && $input.closest('.InputfieldToggleUseDeselect').length) {
|
||||
// if clicked input was already checked, now make it un-checked
|
||||
$input.removeAttr('checked').removeClass(inputCheckedClass);
|
||||
// $input.removeAttr('checked').removeClass(inputCheckedClass); // JQM
|
||||
$input.prop('checked', false).removeClass(inputCheckedClass);
|
||||
$label.removeClass(labelCheckedClass);
|
||||
// if this de-select was the first selection in the request, it's necessary to remove
|
||||
// the checked attribute again a short while later for some reason
|
||||
setTimeout(function() { $input.removeAttr('checked').trigger('change'); }, 100);
|
||||
// setTimeout(function() { $input.removeAttr('checked').trigger('change'); }, 100); // JQM
|
||||
setTimeout(function() { $input.prop('checked', false).trigger('change'); }, 100);
|
||||
} else {
|
||||
// input was just checked (and wasn't before), so add our checked class to the input
|
||||
$input.attr('checked', 'checked').prop('checked', 'checked');
|
||||
// $input.attr('checked', 'checked').prop('checked', true); // JQM
|
||||
$input.prop('checked', true);
|
||||
$input.addClass(inputCheckedClass);
|
||||
$label.addClass(labelCheckedClass);
|
||||
$input.trigger('change');
|
||||
|
@@ -1 +1 @@
|
||||
function InputfieldToggleInit(){var isClick=false;var inputCheckedClass="InputfieldToggleChecked";var labelCheckedClass="InputfieldToggleCurrent";function getLabelFromInput($input){var $label=$input.next("label");if(!$label.length)$label=$input.parent("label");if(!$label.length)$label=$("label[for="+$input.attr("id")+"]");return $label}function getInputFromLabel($label){var $input=$label.prev("input");if(!$input.length)$input=$label.find("input");if(!$input.length)$input=$("input[id="+$label.attr("for")+"]");return $input}function toggleInputEvent($input){var $label=getLabelFromInput($input);var $prevInput=$input.closest(".Inputfield").find("input."+inputCheckedClass);var $prevLabel=$prevInput.length?getLabelFromInput($prevInput):null;if($prevInput.length&&$prevInput.attr("id")!=$input.attr("id")){$prevInput.removeClass(inputCheckedClass).removeAttr("checked");if($prevLabel)$prevLabel.removeClass(labelCheckedClass)}if($input.hasClass(inputCheckedClass)&&$input.closest(".InputfieldToggleUseDeselect").length){$input.removeAttr("checked").removeClass(inputCheckedClass);$label.removeClass(labelCheckedClass);setTimeout(function(){$input.removeAttr("checked").trigger("change")},100)}else{$input.attr("checked","checked").prop("checked","checked");$input.addClass(inputCheckedClass);$label.addClass(labelCheckedClass);$input.trigger("change")}}function initEvents(){$(document).on("change",".InputfieldToggle input",function(){if(isClick)return false;toggleInputEvent($(this))}).on("click",".InputfieldToggle label:not(.InputfieldHeader)",function(event){if(isClick)return false;var $label=$(this);var $input=getInputFromLabel($label);if(!$input.length)return;isClick=true;toggleInputEvent($input);setTimeout(function(){isClick=false},200);if($input.closest(".InputfieldToggleGroup").length)return false})}function initColors(){var $button=$(".InputfieldToggleHelper > button");var $input=$(".InputfieldToggleHelper > input");if(!$button.length)$button=$(".InputfieldForm button.ui-priority-secondary:eq(0)");if(!$button.length)$button=$(".InputfieldForm button.ui-button:eq(0)");if(!$button.length)$button=$(".InputfieldForm button[type=submit]");if(!$input.length)$input=$(".InputfieldForm input[type=text]:eq(0)");if(!$button.length||!$input.length)return;InputfieldToggleSetColors({onBg:$button.css("background-color"),on:$button.css("color"),offBg:$input.css("background-color"),off:$input.css("color"),border:$input.css("border-bottom-color")})}initEvents();initColors()}function InputfieldToggleSetColors(customColors){var colors={on:"",onBg:"",off:"",offBg:"",border:"",hoverBg:"",hover:""};$.extend(colors,customColors);if(!colors.hoverBg&&colors.onBg){colors.hoverBg=colors.onBg.replace("rgb(","rgba(").replace(")",",.2)");if(!colors.hover)colors.hover=colors.off}var style="<style type='text/css'>"+".InputfieldToggleGroup label { "+(colors.offBg?"background-color: "+colors.offBg+"; ":"")+(colors.off?"color: "+colors.off+";":"")+(colors.border?"border-color: "+colors.border+";":"")+"} "+".InputfieldToggleGroup label.InputfieldToggleCurrent, "+".InputfieldToggleGroup input:checked + label { "+(colors.onBg?"background-color: "+colors.onBg+"; ":"")+(colors.on?"color: "+colors.on+";":"")+(colors.onBg?"border-color: "+colors.onBg+"; ":"")+"} "+".InputfieldToggleGroup label:not(.InputfieldToggleCurrent):hover,"+".InputfieldToggleGroup input:not(:checked) + label:not(.InputfieldToggleCurrent):hover { "+(colors.hoverBg?"background-color: "+colors.hoverBg+"; ":"")+(colors.hover?"color: "+colors.hover+"; ":"")+"}"+"</style>";$("head").append(style)}jQuery(document).ready(function($){InputfieldToggleInit()});
|
||||
function InputfieldToggleInit(){var isClick=false;var inputCheckedClass="InputfieldToggleChecked";var labelCheckedClass="InputfieldToggleCurrent";function getLabelFromInput($input){var $label=$input.next("label");if(!$label.length)$label=$input.parent("label");if(!$label.length)$label=$("label[for="+$input.attr("id")+"]");return $label}function getInputFromLabel($label){var $input=$label.prev("input");if(!$input.length)$input=$label.find("input");if(!$input.length)$input=$("input[id="+$label.attr("for")+"]");return $input}function toggleInputEvent($input){var $label=getLabelFromInput($input);var $prevInput=$input.closest(".Inputfield").find("input."+inputCheckedClass);var $prevLabel=$prevInput.length?getLabelFromInput($prevInput):null;if($prevInput.length&&$prevInput.attr("id")!=$input.attr("id")){$prevInput.removeClass(inputCheckedClass).prop("checked",false);if($prevLabel)$prevLabel.removeClass(labelCheckedClass)}if($input.hasClass(inputCheckedClass)&&$input.closest(".InputfieldToggleUseDeselect").length){$input.prop("checked",false).removeClass(inputCheckedClass);$label.removeClass(labelCheckedClass);setTimeout(function(){$input.prop("checked",false).trigger("change")},100)}else{$input.prop("checked",true);$input.addClass(inputCheckedClass);$label.addClass(labelCheckedClass);$input.trigger("change")}}function initEvents(){$(document).on("change",".InputfieldToggle input",function(){if(isClick)return false;toggleInputEvent($(this))}).on("click",".InputfieldToggle label:not(.InputfieldHeader)",function(event){if(isClick)return false;var $label=$(this);var $input=getInputFromLabel($label);if(!$input.length)return;isClick=true;toggleInputEvent($input);setTimeout(function(){isClick=false},200);if($input.closest(".InputfieldToggleGroup").length)return false})}function initColors(){var $button=$(".InputfieldToggleHelper > button");var $input=$(".InputfieldToggleHelper > input");if(!$button.length)$button=$(".InputfieldForm button.ui-priority-secondary:eq(0)");if(!$button.length)$button=$(".InputfieldForm button.ui-button:eq(0)");if(!$button.length)$button=$(".InputfieldForm button[type=submit]");if(!$input.length)$input=$(".InputfieldForm input[type=text]:eq(0)");if(!$button.length||!$input.length)return;InputfieldToggleSetColors({onBg:$button.css("background-color"),on:$button.css("color"),offBg:$input.css("background-color"),off:$input.css("color"),border:$input.css("border-bottom-color")})}initEvents();initColors()}function InputfieldToggleSetColors(customColors){var colors={on:"",onBg:"",off:"",offBg:"",border:"",hoverBg:"",hover:""};$.extend(colors,customColors);if(!colors.hoverBg&&colors.onBg){colors.hoverBg=colors.onBg.replace("rgb(","rgba(").replace(")",",.2)");if(!colors.hover)colors.hover=colors.off}var style="<style type='text/css'>"+".InputfieldToggleGroup label { "+(colors.offBg?"background-color: "+colors.offBg+"; ":"")+(colors.off?"color: "+colors.off+";":"")+(colors.border?"border-color: "+colors.border+";":"")+"} "+".InputfieldToggleGroup label.InputfieldToggleCurrent, "+".InputfieldToggleGroup input:checked + label { "+(colors.onBg?"background-color: "+colors.onBg+"; ":"")+(colors.on?"color: "+colors.on+";":"")+(colors.onBg?"border-color: "+colors.onBg+"; ":"")+"} "+".InputfieldToggleGroup label:not(.InputfieldToggleCurrent):hover,"+".InputfieldToggleGroup input:not(:checked) + label:not(.InputfieldToggleCurrent):hover { "+(colors.hoverBg?"background-color: "+colors.hoverBg+"; ":"")+(colors.hover?"color: "+colors.hover+"; ":"")+"}"+"</style>";$("head").append(style)}jQuery(document).ready(function($){InputfieldToggleInit()});
|
@@ -154,9 +154,11 @@ function pwModalWindowSettings(name) {
|
||||
*/
|
||||
function pwModalWindow(href, options, size) {
|
||||
|
||||
var $iframe, url;
|
||||
|
||||
// destory any existing pw-modals that aren't currently open
|
||||
for(var n = 0; n <= pwModalWindows.length; n++) {
|
||||
var $iframe = pwModalWindows[n];
|
||||
$iframe = pwModalWindows[n];
|
||||
if($iframe == null) continue;
|
||||
if($iframe.dialog('isOpen')) continue;
|
||||
$iframe.dialog('destroy').remove();
|
||||
@@ -164,15 +166,15 @@ function pwModalWindow(href, options, size) {
|
||||
}
|
||||
|
||||
if(href.indexOf('modal=') > 0) {
|
||||
var url = href;
|
||||
url = href;
|
||||
} else {
|
||||
var url = href + (href.indexOf('?') > -1 ? '&' : '?') + 'modal=1';
|
||||
url = href + (href.indexOf('?') > -1 ? '&' : '?') + 'modal=1';
|
||||
}
|
||||
var $iframe = jQuery('<iframe class="pw-modal-window" frameborder="0" src="' + url + '"></iframe>');
|
||||
$iframe = jQuery('<iframe class="pw-modal-window" frameborder="0" src="' + url + '"></iframe>');
|
||||
$iframe.attr('id', 'pw-modal-window-' + (pwModalWindows.length+1));
|
||||
pwModalWindows[pwModalWindows.length] = $iframe;
|
||||
|
||||
if(typeof size == "undefined" || size.length == 0) var size = 'large';
|
||||
if(typeof size == "undefined" || size.length == 0) size = 'large';
|
||||
var settings = pwModalWindowSettings(size);
|
||||
|
||||
if(settings == null) {
|
||||
|
2
wire/modules/Jquery/JqueryUI/modal.min.js
vendored
2
wire/modules/Jquery/JqueryUI/modal.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -19,7 +19,8 @@ var AdminDataTable = {
|
||||
if(e.shiftKey) {
|
||||
var start = $checkboxes.index(this);
|
||||
var end = $checkboxes.index(lastChecked);
|
||||
$checkboxes.slice(Math.min(start,end), Math.max(start,end)+ 1).attr('checked', lastChecked.checked);
|
||||
// $checkboxes.slice(Math.min(start,end), Math.max(start,end)+ 1).attr('checked', lastChecked.checked); // JQM
|
||||
$checkboxes.slice(Math.min(start,end), Math.max(start,end)+ 1).prop('checked', lastChecked.checked ? true : false);
|
||||
}
|
||||
lastChecked = this;
|
||||
});
|
||||
|
@@ -1 +1 @@
|
||||
var AdminDataTable={ready:false,tables:[],isMobileSize:function(){return $(window).width()<=767},setupShiftClick:function(b){var a=null;b.on("click","input[type=checkbox]",function(f){var d=$(this).closest("table").find("input[type=checkbox]");if(!a){a=this;return}if(f.shiftKey){var g=d.index(this);var c=d.index(a);d.slice(Math.min(g,c),Math.max(g,c)+1).attr("checked",a.checked)}a=this})},setupMobile:function(a){if(a.hasClass("AdminDataTableMobile")){return}if(!a.hasClass("AdminDataTableResponsive")){return}a.addClass("AdminDataTableMobile");var c=[];var b="";a.children("thead").children("tr").each(function(){$(this).find("th").each(function(f){var e=$(this);if(!b.length){b=e.css("color")}if(e.children().length){if(e.children(".tablesorter-header-inner").length){e=e.children()}var d=e.clone();d.children().remove();if(d.text().length){e=d}}c[f]=e.html()})});a.children("tbody").children("tr").each(function(){$(this).children("td").each(function(f){var e=$(this);if(typeof c[f]=="undefined"){return}var d=$("<div class='th'></div>").append(c[f]).css("color",b);if(e.children(".td").length==0){e.wrapInner("<div class='td'></div>")}e.prepend(d).addClass("ui-helper-clearfix");d.css("line-height",e.css("line-height"))})})},undoMobile:function(a){if(a.hasClass("AdminDataTableMobile")){a.removeClass("AdminDataTableMobile");a.children("tbody").find("td").each(function(){var b=$(this);b.find(".th").remove();b.find(".td").removeClass("td");b.removeClass("ui-helper-clearfix")})}},resize:function(){var b=$("table.AdminDataTableResponsive");var a=AdminDataTable.isMobileSize();b.each(function(){var c=$(this);if(a){AdminDataTable.setupMobile(c)}else{if(c.hasClass("AdminDataTableMobile")){AdminDataTable.undoMobile(c)}}})},initTable:function(a){if(AdminDataTable.ready){if(AdminDataTable.isMobileSize()){AdminDataTable.setupMobile(a)}}else{AdminDataTable.tables.push(a)}if(a.find("input[type=checkbox]").length>1){AdminDataTable.setupShiftClick(a)}},init:function(){AdminDataTable.ready=true;$("table.AdminDataTableSortable").each(function(){var d=$(this);var c={};if(d.hasClass("AdminDataTableResizable")){c={widgets:["resizable"],widgetOptions:{resizable:true}}}if(jQuery().tablesorter){d.tablesorter(c)}});$("table.AdminDataTableResizable").each(function(){var c=$(this);if(c.hasClass("AdminDataTableSortable")){return}c.find("th").data("sorter",false);if(jQuery().tablesorter){c.tablesorter({widgets:["resizable"],widgetOptions:{resizable:true}})}});var a=null;$(window).resize(function(){if(a){clearTimeout(a)}a=setTimeout(function(){AdminDataTable.resize()},500)});if(AdminDataTable.tables.length){for(var b=0;b<AdminDataTable.tables.length;b++){AdminDataTable.initTable(AdminDataTable.tables[b])}}}};$(document).ready(function(){AdminDataTable.init()});
|
||||
var AdminDataTable={ready:false,tables:[],isMobileSize:function(){return $(window).width()<=767},setupShiftClick:function($table){var lastChecked=null;$table.on("click","input[type=checkbox]",function(e){var $checkboxes=$(this).closest("table").find("input[type=checkbox]");if(!lastChecked){lastChecked=this;return}if(e.shiftKey){var start=$checkboxes.index(this);var end=$checkboxes.index(lastChecked);$checkboxes.slice(Math.min(start,end),Math.max(start,end)+1).prop("checked",lastChecked.checked?true:false)}lastChecked=this})},setupMobile:function($table){if($table.hasClass("AdminDataTableMobile"))return;if(!$table.hasClass("AdminDataTableResponsive"))return;$table.addClass("AdminDataTableMobile");var labels=[];var thcolor="";$table.children("thead").children("tr").each(function(){$(this).find("th").each(function(n){var $th=$(this);if(!thcolor.length)thcolor=$th.css("color");if($th.children().length){if($th.children(".tablesorter-header-inner").length)$th=$th.children();var $th2=$th.clone();$th2.children().remove();if($th2.text().length)$th=$th2}labels[n]=$th.html()})});$table.children("tbody").children("tr").each(function(){$(this).children("td").each(function(n){var $td=$(this);if(typeof labels[n]=="undefined")return;var $th=$("<div class='th'></div>").append(labels[n]).css("color",thcolor);if($td.children(".td").length==0)$td.wrapInner("<div class='td'></div>");$td.prepend($th).addClass("ui-helper-clearfix");$th.css("line-height",$td.css("line-height"))})})},undoMobile:function($table){if($table.hasClass("AdminDataTableMobile")){$table.removeClass("AdminDataTableMobile");$table.children("tbody").find("td").each(function(){var $td=$(this);$td.find(".th").remove();$td.find(".td").removeClass("td");$td.removeClass("ui-helper-clearfix")})}},resize:function(){var $tables=$("table.AdminDataTableResponsive");var isMobile=AdminDataTable.isMobileSize();$tables.each(function(){var $table=$(this);if(isMobile){AdminDataTable.setupMobile($table)}else if($table.hasClass("AdminDataTableMobile")){AdminDataTable.undoMobile($table)}})},initTable:function($table){if(AdminDataTable.ready){if(AdminDataTable.isMobileSize())AdminDataTable.setupMobile($table)}else{AdminDataTable.tables.push($table)}if($table.find("input[type=checkbox]").length>1){AdminDataTable.setupShiftClick($table)}},init:function(){AdminDataTable.ready=true;$("table.AdminDataTableSortable").each(function(){var $table=$(this);var options={};if($table.hasClass("AdminDataTableResizable")){options={widgets:["resizable"],widgetOptions:{resizable:true}}}if(jQuery().tablesorter){$table.tablesorter(options)}});$("table.AdminDataTableResizable").each(function(){var $table=$(this);if($table.hasClass("AdminDataTableSortable"))return;$table.find("th").data("sorter",false);if(jQuery().tablesorter)$table.tablesorter({widgets:["resizable"],widgetOptions:{resizable:true}})});var resizeTimeout=null;$(window).resize(function(){if(resizeTimeout)clearTimeout(resizeTimeout);resizeTimeout=setTimeout(function(){AdminDataTable.resize()},500)});if(AdminDataTable.tables.length){for(var n=0;n<AdminDataTable.tables.length;n++){AdminDataTable.initTable(AdminDataTable.tables[n])}}}};$(document).ready(function(){AdminDataTable.init()});
|
@@ -76,9 +76,11 @@ $(document).ready(function() {
|
||||
$("#CommentCheckAll").click(function() {
|
||||
var $items = $(".CommentCheckbox");
|
||||
if($(this).is(":checked")) {
|
||||
$items.attr('checked', 'checked');
|
||||
// $items.attr('checked', 'checked'); // JQM
|
||||
$items.prop('checked', true);
|
||||
} else {
|
||||
$items.removeAttr('checked');
|
||||
// $items.removeAttr('checked'); // JQM
|
||||
$items.prop('checked', false);
|
||||
}
|
||||
$items.each(function() {
|
||||
commentCheckboxClicked($(this));
|
||||
|
@@ -1 +1 @@
|
||||
$(document).ready(function(){var ready=false;$(document).on("click",".WireTabs a",function($event){if(ready)window.location.href=$(this).attr("href");return false});$(".WireTabs").css("opacity",1);$(".WireTabs a.on").parent("li").click();$("a.CommentTextEdit").click(function(){var $textarea=$("<textarea></textarea>");var $parent=$(this).closest(".CommentTextEditable");$parent.parent(".CommentText").removeClass("CommentTextOverflow");$textarea.attr("name",$parent.attr("id"));$textarea.addClass($parent.attr("data-textarea-class"));$(this).remove();$textarea.val($parent.text());$parent.after($textarea);$parent.remove();return false});$(".CommentText").click(function(){$(this).find("a.CommentTextEdit").click();return false});$(".CommentItem").each(function(){var $item=$(this);var $table=$item.find(".CommentItemInfo");var height=$table.height()+30;var $text=$item.find(".CommentText");if($text.height()>height){$text.addClass("CommentTextOverflow")}});$("#CommentLimitSelect").change(function(){window.location="./?limit="+parseInt($(this).val())});$("#CommentListSort").change(function(){window.location="./?sort="+$(this).val()});function commentCheckboxClicked($checkbox){var $item=$checkbox.closest(".CommentItem");if($checkbox.is(":checked")){$item.addClass("CommentChecked")}else{$item.removeClass("CommentChecked")}}$(".CommentCheckbox").click(function(){commentCheckboxClicked($(this))});$("#CommentCheckAll").click(function(){var $items=$(".CommentCheckbox");if($(this).is(":checked")){$items.attr("checked","checked")}else{$items.removeAttr("checked")}$items.each(function(){commentCheckboxClicked($(this))})});$("#CommentActions").change(function(){var val=$(this).val();if(!val.length)return;var $checkedItems=$(".CommentChecked");if($checkedItems.length){$checkedItems.each(function(){if(val=="reset-upvotes"){$(this).find(".CommentUpvotes > input").val(0).change()}else if(val=="reset-downvotes"){$(this).find(".CommentDownvotes > input").val(0).change()}else{$(this).find(".CommentStatus > input[value='"+val+"']").click()}});$checkedItems.effect("highlight",500)}else{ProcessWire.alert($(this).attr("data-nochecked"))}$(this).val("")});$(document).on("change",".CommentItem :input",function(){var $this=$(this);if($this.is("[type='checkbox']"))return;$(this).closest(".CommentItem").addClass("CommentItemChanged")});$("#CommentListForm").submit(function(){$(this).addClass("CommentListFormSubmitted")});window.addEventListener("beforeunload",function(e){if($(".CommentListFormSubmitted").length)return;var $changes=$(".CommentItemChanged");if($changes.length==0)return;var msg=$("#CommentListForm").attr("data-unsaved");(e||window.event).returnValue=msg;return msg});var color=$(".WireTabs a.on").css("border-top-color");$("#CommentListHeader").css("border-top-color",color);ready=true});
|
||||
$(document).ready(function(){var ready=false;$(document).on("click",".WireTabs a",function($event){if(ready)window.location.href=$(this).attr("href");return false});$(".WireTabs").css("opacity",1);$(".WireTabs a.on").parent("li").click();$("a.CommentTextEdit").click(function(){var $textarea=$("<textarea></textarea>");var $parent=$(this).closest(".CommentTextEditable");$parent.parent(".CommentText").removeClass("CommentTextOverflow");$textarea.attr("name",$parent.attr("id"));$textarea.addClass($parent.attr("data-textarea-class"));$(this).remove();$textarea.val($parent.text());$parent.after($textarea);$parent.remove();return false});$(".CommentText").click(function(){$(this).find("a.CommentTextEdit").click();return false});$(".CommentItem").each(function(){var $item=$(this);var $table=$item.find(".CommentItemInfo");var height=$table.height()+30;var $text=$item.find(".CommentText");if($text.height()>height){$text.addClass("CommentTextOverflow")}});$("#CommentLimitSelect").change(function(){window.location="./?limit="+parseInt($(this).val())});$("#CommentListSort").change(function(){window.location="./?sort="+$(this).val()});function commentCheckboxClicked($checkbox){var $item=$checkbox.closest(".CommentItem");if($checkbox.is(":checked")){$item.addClass("CommentChecked")}else{$item.removeClass("CommentChecked")}}$(".CommentCheckbox").click(function(){commentCheckboxClicked($(this))});$("#CommentCheckAll").click(function(){var $items=$(".CommentCheckbox");if($(this).is(":checked")){$items.prop("checked",true)}else{$items.prop("checked",false)}$items.each(function(){commentCheckboxClicked($(this))})});$("#CommentActions").change(function(){var val=$(this).val();if(!val.length)return;var $checkedItems=$(".CommentChecked");if($checkedItems.length){$checkedItems.each(function(){if(val=="reset-upvotes"){$(this).find(".CommentUpvotes > input").val(0).change()}else if(val=="reset-downvotes"){$(this).find(".CommentDownvotes > input").val(0).change()}else{$(this).find(".CommentStatus > input[value='"+val+"']").click()}});$checkedItems.effect("highlight",500)}else{ProcessWire.alert($(this).attr("data-nochecked"))}$(this).val("")});$(document).on("change",".CommentItem :input",function(){var $this=$(this);if($this.is("[type='checkbox']"))return;$(this).closest(".CommentItem").addClass("CommentItemChanged")});$("#CommentListForm").submit(function(){$(this).addClass("CommentListFormSubmitted")});window.addEventListener("beforeunload",function(e){if($(".CommentListFormSubmitted").length)return;var $changes=$(".CommentItemChanged");if($changes.length==0)return;var msg=$("#CommentListForm").attr("data-unsaved");(e||window.event).returnValue=msg;return msg});var color=$(".WireTabs a.on").css("border-top-color");$("#CommentListHeader").css("border-top-color",color);ready=true});
|
@@ -108,7 +108,8 @@ $(document).ready(function() {
|
||||
// setup access control tab
|
||||
$("#viewRoles_37").click(function() {
|
||||
// if guest has view, then all have view
|
||||
if($(this).is(":checked")) $("input.viewRoles").attr('checked', 'checked');
|
||||
// if($(this).is(":checked")) $("input.viewRoles").attr('checked', 'checked'); // JQM
|
||||
if($(this).is(":checked")) $("input.viewRoles").prop('checked', true);
|
||||
});
|
||||
$("input.viewRoles:not(#viewRoles_37)").click(function() {
|
||||
// prevent unchecking 'view' for other roles when 'guest' role is checked
|
||||
@@ -118,7 +119,8 @@ $(document).ready(function() {
|
||||
$("input.editRoles:not(:disabled)").click(function() {
|
||||
if($(this).is(":checked")) {
|
||||
// if editable is checked, then viewable must also be checked
|
||||
$(this).closest('tr').find("input.viewRoles").attr('checked', 'checked');
|
||||
// $(this).closest('tr').find("input.viewRoles").attr('checked', 'checked'); // JQM
|
||||
$(this).closest('tr').find("input.viewRoles").prop('checked', true);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -126,10 +128,12 @@ $(document).ready(function() {
|
||||
$(".override-select-all").click(function() {
|
||||
var $checkboxes = $(this).closest('table').find("input[type=checkbox]");
|
||||
if($(this).hasClass('override-checked')) {
|
||||
$checkboxes.removeAttr('checked');
|
||||
// $checkboxes.removeAttr('checked'); // JQM
|
||||
$checkboxes.prop('checked', false);
|
||||
$(this).removeClass('override-checked');
|
||||
} else {
|
||||
$checkboxes.attr('checked', 'checked');
|
||||
// $checkboxes.attr('checked', 'checked'); // JQM
|
||||
$checkboxes.prop('checked', true);
|
||||
$(this).addClass('override-checked');
|
||||
}
|
||||
return false;
|
||||
|
@@ -1 +1 @@
|
||||
$(document).ready(function(){var fieldFilterFormChange=function(){$("#field_filter_form").submit()};$("#templates_id").change(fieldFilterFormChange);$("#fieldtype").change(fieldFilterFormChange);$("#wrap_show_system input").click(fieldFilterFormChange);var $asmListItemStatus=$("#asmListItemStatus");var $columnWidth=$("#columnWidth");function setAsmListItemStatus(){var tpl=$asmListItemStatus.attr("data-tpl");if(!tpl)return;var showIf=$("#Inputfield_showIf").val();var required=$("#Inputfield_required").is(":checked")?true:false;if(showIf&&showIf.length>0)tpl="<i class='fa fa-question-circle'></i>"+tpl;if(required)tpl="<i class='fa fa-asterisk'></i>"+tpl;var w=parseInt($columnWidth.val());if(w==100)w=0;if(w>0)w=w+"%";else w="";tpl=tpl.replace("%",w);$asmListItemStatus.val(tpl)}$("#Inputfield_showIf").change(setAsmListItemStatus);$("#Inputfield_required").change(setAsmListItemStatus);setAsmListItemStatus();if($columnWidth.length>0){var $slider=$("<div class='InputfieldColumnWidthSlider'></div>");var columnWidthVal=parseInt($("#columnWidth").val());$columnWidth.val(columnWidthVal+"%");$columnWidth.after($slider);$slider.slider({range:"min",min:10,max:100,value:parseInt($columnWidth.val()),slide:function(e,ui){var val=ui.value+"%";$columnWidth.val(val).trigger("change");setAsmListItemStatus()}});$columnWidth.change(function(){var val=parseInt($(this).val());if(val>100)val=100;if(val<10)val=10;$(this).val(val+"%");$slider.slider("option","value",val)})}var $fieldEdit=$("#ProcessFieldEdit");if($fieldEdit.length>0&&$("li.WireTab").length>1){$fieldEdit.find("script").remove();$fieldEdit.WireTabs({items:$(".Inputfields li.WireTab"),id:"FieldEditTabs",skipRememberTabIDs:["delete"]})}$("#fieldgroupContextSelect").change(function(){var field_id=$("#Inputfield_id").val();var fieldgroup_id=$(this).val();var href="./edit?id="+field_id;if(fieldgroup_id>0)href+="&fieldgroup_id="+fieldgroup_id;window.location=href});$("a.fieldFlag").click(function(){return false});$("#export_data").click(function(){$(this).select()});$(".import_toggle input[type=radio]").change(function(){var $table=$(this).parents("p.import_toggle").next("table");var $fieldset=$(this).closest(".InputfieldFieldset");if($(this).is(":checked")&&$(this).val()==0){$table.hide();$fieldset.addClass("ui-priority-secondary")}else{$table.show();$fieldset.removeClass("ui-priority-secondary")}}).change();$("#wrap_Inputfield_send_templates").find(":input").change(function(){$("#_send_templates_changed").val("changed")});$("#viewRoles_37").click(function(){if($(this).is(":checked"))$("input.viewRoles").attr("checked","checked")});$("input.viewRoles:not(#viewRoles_37)").click(function(){if($("#viewRoles_37").is(":checked"))return false;return true});$("input.editRoles:not(:disabled)").click(function(){if($(this).is(":checked")){$(this).closest("tr").find("input.viewRoles").attr("checked","checked")}});$(".override-select-all").click(function(){var $checkboxes=$(this).closest("table").find("input[type=checkbox]");if($(this).hasClass("override-checked")){$checkboxes.removeAttr("checked");$(this).removeClass("override-checked")}else{$checkboxes.attr("checked","checked");$(this).addClass("override-checked")}return false});$(document).on("pw-modal-closed","a",function(e,ui){if(!$("#tab-overrides").is(":visible"))return;Inputfields.reload("#Inputfield_overrides_table")})});
|
||||
$(document).ready(function(){var fieldFilterFormChange=function(){$("#field_filter_form").submit()};$("#templates_id").change(fieldFilterFormChange);$("#fieldtype").change(fieldFilterFormChange);$("#wrap_show_system input").click(fieldFilterFormChange);var $asmListItemStatus=$("#asmListItemStatus");var $columnWidth=$("#columnWidth");function setAsmListItemStatus(){var tpl=$asmListItemStatus.attr("data-tpl");if(!tpl)return;var showIf=$("#Inputfield_showIf").val();var required=$("#Inputfield_required").is(":checked")?true:false;if(showIf&&showIf.length>0)tpl="<i class='fa fa-question-circle'></i>"+tpl;if(required)tpl="<i class='fa fa-asterisk'></i>"+tpl;var w=parseInt($columnWidth.val());if(w==100)w=0;if(w>0)w=w+"%";else w="";tpl=tpl.replace("%",w);$asmListItemStatus.val(tpl)}$("#Inputfield_showIf").change(setAsmListItemStatus);$("#Inputfield_required").change(setAsmListItemStatus);setAsmListItemStatus();if($columnWidth.length>0){var $slider=$("<div class='InputfieldColumnWidthSlider'></div>");var columnWidthVal=parseInt($("#columnWidth").val());$columnWidth.val(columnWidthVal+"%");$columnWidth.after($slider);$slider.slider({range:"min",min:10,max:100,value:parseInt($columnWidth.val()),slide:function(e,ui){var val=ui.value+"%";$columnWidth.val(val).trigger("change");setAsmListItemStatus()}});$columnWidth.change(function(){var val=parseInt($(this).val());if(val>100)val=100;if(val<10)val=10;$(this).val(val+"%");$slider.slider("option","value",val)})}var $fieldEdit=$("#ProcessFieldEdit");if($fieldEdit.length>0&&$("li.WireTab").length>1){$fieldEdit.find("script").remove();$fieldEdit.WireTabs({items:$(".Inputfields li.WireTab"),id:"FieldEditTabs",skipRememberTabIDs:["delete"]})}$("#fieldgroupContextSelect").change(function(){var field_id=$("#Inputfield_id").val();var fieldgroup_id=$(this).val();var href="./edit?id="+field_id;if(fieldgroup_id>0)href+="&fieldgroup_id="+fieldgroup_id;window.location=href});$("a.fieldFlag").click(function(){return false});$("#export_data").click(function(){$(this).select()});$(".import_toggle input[type=radio]").change(function(){var $table=$(this).parents("p.import_toggle").next("table");var $fieldset=$(this).closest(".InputfieldFieldset");if($(this).is(":checked")&&$(this).val()==0){$table.hide();$fieldset.addClass("ui-priority-secondary")}else{$table.show();$fieldset.removeClass("ui-priority-secondary")}}).change();$("#wrap_Inputfield_send_templates").find(":input").change(function(){$("#_send_templates_changed").val("changed")});$("#viewRoles_37").click(function(){if($(this).is(":checked"))$("input.viewRoles").prop("checked",true)});$("input.viewRoles:not(#viewRoles_37)").click(function(){if($("#viewRoles_37").is(":checked"))return false;return true});$("input.editRoles:not(:disabled)").click(function(){if($(this).is(":checked")){$(this).closest("tr").find("input.viewRoles").prop("checked",true)}});$(".override-select-all").click(function(){var $checkboxes=$(this).closest("table").find("input[type=checkbox]");if($(this).hasClass("override-checked")){$checkboxes.prop("checked",false);$(this).removeClass("override-checked")}else{$checkboxes.prop("checked",true);$(this).addClass("override-checked")}return false});$(document).on("pw-modal-closed","a",function(e,ui){if(!$("#tab-overrides").is(":visible"))return;Inputfields.reload("#Inputfield_overrides_table")})});
|
@@ -17,7 +17,7 @@ $(document).ready(function() {
|
||||
var val = $t.val();
|
||||
var showPublish = false;
|
||||
if($t.is("select")) {
|
||||
var $option = $t.find("option[value=" + val + "]");
|
||||
var $option = $t.find("option[value='" + val + "']");
|
||||
if($option.attr('data-publish') === '1') showPublish = true;
|
||||
} else {
|
||||
showPublish = $t.attr('data-publish') === '1';
|
||||
@@ -75,7 +75,7 @@ $(document).ready(function() {
|
||||
// we hide language tabs/inputs when such a template is selected
|
||||
if($(".langTabs").length) {
|
||||
$("#template").change(function() {
|
||||
var $option = $(this).find("option[value=" + $(this).val() + "]");
|
||||
var $option = $(this).find("option[value='" + $(this).val() + "']");
|
||||
if(parseInt($option.attr('data-nolang')) > 0) {
|
||||
hideLanguageTabs();
|
||||
} else {
|
||||
@@ -87,7 +87,8 @@ $(document).ready(function() {
|
||||
$(".InputfieldPageName .LanguageSupport input[type=text]").on('blur', function() {
|
||||
if($(this).val().length == 0) return;
|
||||
var $checkbox = $(this).next('label').children('input');
|
||||
if(!$checkbox.is(":checked")) $checkbox.attr('checked', 'checked');
|
||||
// if(!$checkbox.is(":checked")) $checkbox.attr('checked', 'checked'); // JQM
|
||||
if(!$checkbox.is(":checked")) $checkbox.prop('checked', true);
|
||||
});
|
||||
|
||||
});
|
||||
|
@@ -1 +1 @@
|
||||
$(document).ready(function(){$("#select_parent_submit").hide();$("#select_parent_id").change(function(){var k=$(this).val();if(k>0){$("#select_parent_submit").click()}});var g=false;$("#ProcessPageAdd").submit(function(){if(g){return false}g=true});$("#template").change(function(){var p=$(this);var n=p.val();var o=false;if(p.is("select")){var m=p.find("option[value="+n+"]");if(m.attr("data-publish")==="1"){o=true}}else{o=p.attr("data-publish")==="1"}var l=$("#submit_publish").closest(".Inputfield");if(l.length){var k=$("#submit_publish_add").closest(".Inputfield");if(o){l.fadeIn();k.fadeIn()}else{l.fadeOut();k.fadeOut()}}}).change();var e=null;var b="";var f=$("#Inputfield__pw_page_name");var d=$("#wrap_Inputfield__pw_page_name");var j=f.closest("form");var a=j.attr("data-ajax-url");var c=$("<p class='notes'>"+j.attr("data-dup-note")+"</p>");var i=$("<span id='ProcessPageAddStatus'></span>");d.children(".InputfieldHeader").append(i.hide());f.after(c.hide());function h(){var l=$("#Inputfield_parent_id").val();var k=f.val();if(b==k){return}if(l&&k.length>0){b=k;$.get(a+"exists?parent_id="+l+"&name="+k,function(m){i.html(" "+m).css("display","inline");if($(m).hasClass("taken")){f.addClass("ui-state-error-text");c.fadeIn("fast")}else{f.removeClass("ui-state-error-text");c.hide()}})}}$("#Inputfield_title, #Inputfield__pw_page_name").keyup(function(k){if(e){clearTimeout(e)}e=setTimeout(function(){h()},250)});if($(".langTabs").length){$("#template").change(function(){var k=$(this).find("option[value="+$(this).val()+"]");if(parseInt(k.attr("data-nolang"))>0){hideLanguageTabs()}else{unhideLanguageTabs()}}).change()}$(".InputfieldPageName .LanguageSupport input[type=text]").on("blur",function(){if($(this).val().length==0){return}var k=$(this).next("label").children("input");if(!k.is(":checked")){k.attr("checked","checked")}})});
|
||||
$(document).ready(function(){$("#select_parent_submit").hide();$("#select_parent_id").change(function(){var val=$(this).val();if(val>0)$("#select_parent_submit").click()});var submitted=false;$("#ProcessPageAdd").submit(function(){if(submitted)return false;submitted=true});$("#template").change(function(){var $t=$(this);var val=$t.val();var showPublish=false;if($t.is("select")){var $option=$t.find("option[value='"+val+"']");if($option.attr("data-publish")==="1")showPublish=true}else{showPublish=$t.attr("data-publish")==="1"}var $button=$("#submit_publish").closest(".Inputfield");if($button.length){var $button2=$("#submit_publish_add").closest(".Inputfield");if(showPublish){$button.fadeIn();$button2.fadeIn()}else{$button.fadeOut();$button2.fadeOut()}}}).change();var existsTimer=null;var existsName="";var $nameInput=$("#Inputfield__pw_page_name");var $nameWrap=$("#wrap_Inputfield__pw_page_name");var $form=$nameInput.closest("form");var ajaxURL=$form.attr("data-ajax-url");var $dupNote=$("<p class='notes'>"+$form.attr("data-dup-note")+"</p>");var $status=$("<span id='ProcessPageAddStatus'></span>");$nameWrap.children(".InputfieldHeader").append($status.hide());$nameInput.after($dupNote.hide());function checkExists(){var parent_id=$("#Inputfield_parent_id").val();var name=$nameInput.val();if(existsName==name)return;if(parent_id&&name.length>0){existsName=name;$.get(ajaxURL+"exists?parent_id="+parent_id+"&name="+name,function(data){$status.html(" "+data).css("display","inline");if($(data).hasClass("taken")){$nameInput.addClass("ui-state-error-text");$dupNote.fadeIn("fast")}else{$nameInput.removeClass("ui-state-error-text");$dupNote.hide()}})}}$("#Inputfield_title, #Inputfield__pw_page_name").keyup(function(e){if(existsTimer)clearTimeout(existsTimer);existsTimer=setTimeout(function(){checkExists()},250)});if($(".langTabs").length){$("#template").change(function(){var $option=$(this).find("option[value='"+$(this).val()+"']");if(parseInt($option.attr("data-nolang"))>0){hideLanguageTabs()}else{unhideLanguageTabs()}}).change()}$(".InputfieldPageName .LanguageSupport input[type=text]").on("blur",function(){if($(this).val().length==0)return;var $checkbox=$(this).next("label").children("input");if(!$checkbox.is(":checked"))$checkbox.prop("checked",true)})});
|
@@ -59,9 +59,11 @@ function setupExecuteVariations() {
|
||||
|
||||
$(document).on('click', 'input#delete_all', function(event) {
|
||||
if($(this).is(":checked")) {
|
||||
$("input.delete").attr('checked', 'checked');
|
||||
// $("input.delete").attr('checked', 'checked'); // JQM
|
||||
$("input.delete").prop('checked', true);
|
||||
} else {
|
||||
$("input.delete").removeAttr('checked');
|
||||
// $("input.delete").removeAttr('checked'); // JQM
|
||||
$("input.delete").prop('checked', false);
|
||||
}
|
||||
event.stopPropagation();
|
||||
});
|
||||
@@ -118,13 +120,15 @@ function setupSelectedImage() {
|
||||
if((h >= maxHeight || w >= maxWidth) && $form.hasClass('croppable')) {
|
||||
w = maxWidth;
|
||||
h = maxHeight;
|
||||
$("#selected_image_link").removeAttr('checked');
|
||||
// $("#selected_image_link").removeAttr('checked'); // JQM
|
||||
$("#selected_image_link").prop('checked', false);
|
||||
$link.hide();
|
||||
} else {
|
||||
if(!$link.is(":visible")) {
|
||||
$link.fadeIn();
|
||||
if($link.attr('data-was-checked') == 1) {
|
||||
$link.attr('checked', 'checked');
|
||||
// $link.attr('checked', 'checked'); // JQM
|
||||
$link.prop('checked', true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -171,8 +175,10 @@ function setupSelectedImage() {
|
||||
if(!$form.hasClass('rte')) {
|
||||
var $resizeYes = $("#selected_image_resize_yes");
|
||||
if (!$resizeYes.is(":checked")) {
|
||||
$resizeYes.attr('checked', 'checked');
|
||||
$("#selected_image_resize_no").removeAttr('checked');
|
||||
// $resizeYes.attr('checked', 'checked'); // JQM
|
||||
$resizeYes.prop('checked', true);
|
||||
// $("#selected_image_resize_no").removeAttr('checked'); // JQM
|
||||
$("#selected_image_resize_no").prop('checked', false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
File diff suppressed because one or more lines are too long
@@ -51,6 +51,8 @@ $(document).ready(function() {
|
||||
url = url.replace(/[^.\/]/g, '');
|
||||
return url;
|
||||
}
|
||||
|
||||
var url;
|
||||
|
||||
if(path === ProcessWire.config.ProcessPageEditLink.pageUrl) {
|
||||
// account for the link to self
|
||||
@@ -64,7 +66,7 @@ $(document).ready(function() {
|
||||
|
||||
} else if(ProcessWire.config.ProcessPageEditLink.pageUrl.indexOf(path) === 0) {
|
||||
// linking to a parent of the current page
|
||||
var url = ProcessWire.config.ProcessPageEditLink.pageUrl.substring(path.length);
|
||||
url = ProcessWire.config.ProcessPageEditLink.pageUrl.substring(path.length);
|
||||
if(url.indexOf('/') != -1) {
|
||||
url = slashesToRelative(url);
|
||||
} else {
|
||||
@@ -73,7 +75,7 @@ $(document).ready(function() {
|
||||
path = url;
|
||||
} else if(path.indexOf(ProcessWire.config.ProcessPageEditLink.rootParentUrl) === 0) {
|
||||
// linking to a sibling or other page in same branch (but not a child)
|
||||
var url = path.substring(ProcessWire.config.ProcessPageEditLink.rootParentUrl.length);
|
||||
url = path.substring(ProcessWire.config.ProcessPageEditLink.rootParentUrl.length);
|
||||
var url2 = url;
|
||||
url = slashesToRelative(url) + url2;
|
||||
path = url;
|
||||
@@ -81,7 +83,7 @@ $(document).ready(function() {
|
||||
} else if(ProcessWire.config.ProcessPageEditLink.urlType == 2) { // 2=relative for all
|
||||
// page in a different tree than current
|
||||
// traverse back to root
|
||||
var url = ProcessWire.config.ProcessPageEditLink.pageUrl.substring(config.urls.root.length);
|
||||
url = ProcessWire.config.ProcessPageEditLink.pageUrl.substring(config.urls.root.length);
|
||||
url = slashesToRelative(url);
|
||||
path = path.substring(ProcessWire.config.urls.root.length);
|
||||
path = url + path;
|
||||
@@ -179,6 +181,8 @@ $(document).ready(function() {
|
||||
var slashespos = val.indexOf('//');
|
||||
var hasScheme = slashespos > -1 && slashespos < dotpos;
|
||||
var slashpos = (slashespos > -1 ? val.indexOf('/', slashespos + 2) : val.indexOf('/'));
|
||||
var httpHost;
|
||||
var n;
|
||||
|
||||
if(dotpos > -1 && val.indexOf('..') == -1 && val.indexOf('./') == -1 && (
|
||||
(slashpos > dotpos && !hasScheme) ||
|
||||
@@ -215,7 +219,7 @@ $(document).ready(function() {
|
||||
|
||||
if(hasScheme) {
|
||||
if (slashpos == -1) slashpos = val.length;
|
||||
var httpHost = (slashespos > -1 ? val.substring(slashespos + 2, slashpos) : val.substring(0, slashpos));
|
||||
httpHost = (slashespos > -1 ? val.substring(slashespos + 2, slashpos) : val.substring(0, slashpos));
|
||||
$this.attr('data-httphost', httpHost);
|
||||
} else {
|
||||
$this.removeAttr('data-httphost');
|
||||
@@ -227,10 +231,10 @@ $(document).ready(function() {
|
||||
}
|
||||
|
||||
var external = false;
|
||||
var httpHost = $this.attr('data-httphost');
|
||||
httpHost = $this.attr('data-httphost');
|
||||
if(httpHost && httpHost.length) {
|
||||
external = true;
|
||||
for(var n = 0; n < ProcessWire.config.httpHosts; n++) {
|
||||
for(n = 0; n < ProcessWire.config.httpHosts; n++) {
|
||||
if(ProcessWire.config.httpHosts[n] == httpHost) {
|
||||
external = false;
|
||||
break;
|
||||
@@ -259,8 +263,9 @@ $(document).ready(function() {
|
||||
var extLinkClass = ProcessWire.config.ProcessPageEditLink.extLinkClass;
|
||||
if (extLinkClass.length > 0) {
|
||||
extLinkClass = extLinkClass.split(' ');
|
||||
for (var n = 0; n < extLinkClass.length; n++) {
|
||||
$("#link_class_" + extLinkClass[n]).attr('checked', 'checked');
|
||||
for(n = 0; n < extLinkClass.length; n++) {
|
||||
// $("#link_class_" + extLinkClass[n]).attr('checked', 'checked'); // JQM
|
||||
$("#link_class_" + extLinkClass[n]).prop('checked', true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
File diff suppressed because one or more lines are too long
@@ -57,7 +57,7 @@ var ProcessLister = {
|
||||
});
|
||||
|
||||
$("#ProcessListerActionsForm").find('script').remove(); // to prevent from running twice after being WireTabbed
|
||||
if(ProcessLister.lister.size() > 0) ProcessLister.lister.WireTabs({ items: $(".WireTab") });
|
||||
if(ProcessLister.lister.length > 0) ProcessLister.lister.WireTabs({ items: $(".WireTab") });
|
||||
|
||||
|
||||
$("#_ProcessListerRefreshTab").html("<i class='fa fa-fw fa-refresh ui-priority-secondary'></i>")
|
||||
|
File diff suppressed because one or more lines are too long
@@ -37,7 +37,8 @@ function ProcessRoleUpdatePermissions(init, $checkbox) {
|
||||
}
|
||||
|
||||
} else {
|
||||
$children.find("input.global-permission:not(:disabled)").removeAttr('checked');
|
||||
// $children.find("input.global-permission:not(:disabled)").removeAttr('checked'); // JQM
|
||||
$children.find("input.global-permission:not(:disabled)").prop('checked', false);
|
||||
init ? $children.hide() : $children.fadeOut();
|
||||
$row.removeClass('permission-checked');
|
||||
if($row.hasClass('permission-page-edit')) {
|
||||
@@ -52,18 +53,23 @@ function ProcessRoleUpdatePermissions(init, $checkbox) {
|
||||
$(document).ready(function() {
|
||||
|
||||
var $pageView = $("#Inputfield_permissions_36");
|
||||
if(!$pageView.is(":checked")) $pageView.attr('checked', 'checked');
|
||||
if(!$pageView.is(":checked")) {
|
||||
// $pageView.attr('checked', 'checked'); // JQM
|
||||
$pageView.prop('checked', true);
|
||||
}
|
||||
|
||||
ProcessRoleUpdatePermissions(true, null);
|
||||
|
||||
$("#wrap_Inputfield_permissions").on("click", "input.global-permission, label.checkbox-disabled", function(e) {
|
||||
|
||||
var $label, $checkbox;
|
||||
|
||||
if($(this).is("label")) {
|
||||
var $label = $(this);
|
||||
var $checkbox = $label.children("input");
|
||||
$label = $(this);
|
||||
$checkbox = $label.children("input");
|
||||
} else {
|
||||
var $checkbox = $(this);
|
||||
var $label = $checkbox.parent();
|
||||
$checkbox = $(this);
|
||||
$label = $checkbox.parent();
|
||||
}
|
||||
|
||||
var alertText = $label.attr('data-alert');
|
||||
@@ -79,7 +85,7 @@ $(document).ready(function() {
|
||||
}
|
||||
|
||||
if($(this).is("input")) {
|
||||
var $checkbox = $(this);
|
||||
$checkbox = $(this);
|
||||
setTimeout(function() {
|
||||
ProcessRoleUpdatePermissions(false, $checkbox);
|
||||
}, 100);
|
||||
|
@@ -1 +1 @@
|
||||
function ProcessRoleUpdatePermissions(g,e){var d=$("#wrap_Inputfield_permissions");var f=e==null?d.find("input.global-permission"):e;if(g){f.each(function(){var j=$(this);var i=j.closest("label");var h=j.closest("tr");h.addClass(i.attr("class"))})}f.each(function(){var n=$(this);var i=n.closest("label");var h=n.closest("tr");var l=$("#"+i.attr("data-parent"));var k=i.text();var m=parseInt(i.attr("data-level"));var j=h.nextAll(".parent-"+i.attr("id"));h.addClass(i.attr("id"));if(n.is(":checked")){j=j.filter(".level"+(m+1));g?j.show():j.fadeIn();h.addClass("permission-checked");if(h.hasClass("permission-page-edit")){if(!h.find(".template-permissions-open").length){h.find(".toggle-template-permissions").click()}}}else{j.find("input.global-permission:not(:disabled)").removeAttr("checked");g?j.hide():j.fadeOut();h.removeClass("permission-checked");if(h.hasClass("permission-page-edit")){if(h.find(".template-permissions-open").length){h.find(".toggle-template-permissions").click()}}}})}$(document).ready(function(){var d=$("#Inputfield_permissions_36");if(!d.is(":checked")){d.attr("checked","checked")}ProcessRoleUpdatePermissions(true,null);$("#wrap_Inputfield_permissions").on("click","input.global-permission, label.checkbox-disabled",function(i){if($(this).is("label")){var f=$(this);var g=f.children("input")}else{var g=$(this);var f=g.parent()}var j=f.attr("data-alert");var h=f.attr("data-confirm");if(typeof j!="undefined"&&j.length){ProcessWire.alert(j);return false}else{if(typeof h!="undefined"&&h.length){if(g.is(":checked")){if(!confirm(h)){return false}}}}if($(this).is("input")){var g=$(this);setTimeout(function(){ProcessRoleUpdatePermissions(false,g)},100)}});$(".toggle-template-permissions").click(function(){var f=$(this).closest("tr").find(".template-permissions");if(f.hasClass("template-permissions-open")){f.fadeOut("fast",function(){f.removeClass("template-permissions-open")})}else{f.fadeIn("fast",function(){f.addClass("template-permissions-open")})}var e=$(this).find("i");e.toggleClass(e.attr("data-toggle"));return false});$(".template-permissions-click").each(function(){$(this).closest("tr").find(".toggle-template-permissions").click();$(this).removeClass("template-permissions-click")});$(".permission-title").click(function(){$(this).closest("tr").find(".toggle-template-permissions").click()});a=$("input.global-permission:eq(0)");b=$("<div />").addClass(a.attr("class")).removeClass("permission permission-checked global-permission");c=$("input.template-permission").addClass(b.attr("class"))});
|
||||
function ProcessRoleUpdatePermissions(init,$checkbox){var $inputfield=$("#wrap_Inputfield_permissions");var $checkboxes=$checkbox==null?$inputfield.find("input.global-permission"):$checkbox;if(init){$checkboxes.each(function(){var $input=$(this);var $label=$input.closest("label");var $row=$input.closest("tr");$row.addClass($label.attr("class"))})}$checkboxes.each(function(){var $input=$(this);var $label=$input.closest("label");var $row=$input.closest("tr");var $parent=$("#"+$label.attr("data-parent"));var name=$label.text();var level=parseInt($label.attr("data-level"));var $children=$row.nextAll(".parent-"+$label.attr("id"));$row.addClass($label.attr("id"));if($input.is(":checked")){$children=$children.filter(".level"+(level+1));init?$children.show():$children.fadeIn();$row.addClass("permission-checked");if($row.hasClass("permission-page-edit")){if(!$row.find(".template-permissions-open").length){$row.find(".toggle-template-permissions").click()}}}else{$children.find("input.global-permission:not(:disabled)").prop("checked",false);init?$children.hide():$children.fadeOut();$row.removeClass("permission-checked");if($row.hasClass("permission-page-edit")){if($row.find(".template-permissions-open").length){$row.find(".toggle-template-permissions").click()}}}})}$(document).ready(function(){var $pageView=$("#Inputfield_permissions_36");if(!$pageView.is(":checked")){$pageView.prop("checked",true)}ProcessRoleUpdatePermissions(true,null);$("#wrap_Inputfield_permissions").on("click","input.global-permission, label.checkbox-disabled",function(e){var $label,$checkbox;if($(this).is("label")){$label=$(this);$checkbox=$label.children("input")}else{$checkbox=$(this);$label=$checkbox.parent()}var alertText=$label.attr("data-alert");var confirmText=$label.attr("data-confirm");if(typeof alertText!="undefined"&&alertText.length){ProcessWire.alert(alertText);return false}else if(typeof confirmText!="undefined"&&confirmText.length){if($checkbox.is(":checked")){if(!confirm(confirmText))return false}}if($(this).is("input")){$checkbox=$(this);setTimeout(function(){ProcessRoleUpdatePermissions(false,$checkbox)},100)}});$(".toggle-template-permissions").click(function(){var $div=$(this).closest("tr").find(".template-permissions");if($div.hasClass("template-permissions-open")){$div.fadeOut("fast",function(){$div.removeClass("template-permissions-open")})}else{$div.fadeIn("fast",function(){$div.addClass("template-permissions-open")})}var $icon=$(this).find("i");$icon.toggleClass($icon.attr("data-toggle"));return false});$(".template-permissions-click").each(function(){$(this).closest("tr").find(".toggle-template-permissions").click();$(this).removeClass("template-permissions-click")});$(".permission-title").click(function(){$(this).closest("tr").find(".toggle-template-permissions").click()});a=$("input.global-permission:eq(0)");b=$("<div />").addClass(a.attr("class")).removeClass("permission permission-checked global-permission");c=$("input.template-permission").addClass(b.attr("class"))});
|
@@ -388,7 +388,7 @@ function ProcessTemplate() {
|
||||
function setupAccessTab() {
|
||||
|
||||
var redirectLoginClick = function() {
|
||||
if($("#redirectLogin_-1:checked").size() > 0) $("#wrap_redirectLoginURL").slideDown();
|
||||
if($("#redirectLogin_-1:checked").length > 0) $("#wrap_redirectLoginURL").slideDown();
|
||||
else $("#wrap_redirectLoginURL").hide();
|
||||
}
|
||||
|
||||
@@ -408,7 +408,8 @@ function ProcessTemplate() {
|
||||
}
|
||||
});
|
||||
|
||||
$("input.viewRoles").attr('checked', 'checked');
|
||||
// $("input.viewRoles").attr('checked', 'checked'); // JQM
|
||||
$('input.viewRoles').prop('checked', true);
|
||||
|
||||
} else {
|
||||
|
||||
@@ -431,14 +432,15 @@ function ProcessTemplate() {
|
||||
$("#wrap_guestSearchable").hide();
|
||||
$("#useRolesYes").slideDown();
|
||||
$("#wrap_useRoles > label").click();
|
||||
$("input.viewRoles").attr('checked', 'checked');
|
||||
// $("input.viewRoles").attr('checked', 'checked'); // JQM
|
||||
$("input.viewRoles").prop('checked', true);
|
||||
} else {
|
||||
$("#useRolesYes").slideUp();
|
||||
$("#accessOverrides:visible").slideUp();
|
||||
}
|
||||
});
|
||||
|
||||
if($("#useRoles_0:checked").size() > 0) {
|
||||
if($("#useRoles_0:checked").length > 0) {
|
||||
$("#useRolesYes").hide();
|
||||
$("#accessOverrides").hide();
|
||||
}
|
||||
@@ -466,9 +468,11 @@ function ProcessTemplate() {
|
||||
|
||||
if($t.is(":checked")) {
|
||||
numChecked++;
|
||||
$createRoles.removeAttr('disabled');
|
||||
// $createRoles.removeAttr('disabled'); // JQM
|
||||
$createRoles.prop('disabled', false);
|
||||
} else {
|
||||
$createRoles.removeAttr('checked').attr('disabled', 'disabled');
|
||||
// $createRoles.removeAttr('checked').attr('disabled', 'disabled'); // JQM
|
||||
$createRoles.prop('checked', false).prop('disabled', true);
|
||||
}
|
||||
});
|
||||
|
||||
|
File diff suppressed because one or more lines are too long
@@ -5,13 +5,15 @@ $(document).ready(function() {
|
||||
// hide fields that aren't necessary ehre
|
||||
$("#wrap_Inputfield_pass").hide();
|
||||
$("#wrap_Inputfield_email").hide();
|
||||
$("#wrap_Inputfield_roles input").attr('disabled', 'disabled');
|
||||
// $("#wrap_Inputfield_roles input").attr('disabled', 'disabled'); // JQM
|
||||
$("#wrap_Inputfield_roles input").prop('disabled', true);
|
||||
//$("#wrap_submit_save").remove();
|
||||
}
|
||||
|
||||
var $guestRole = $("#Inputfield_roles_37");
|
||||
if($guestRole.size() > 0 && !$guestRole.is(":checked")) {
|
||||
$guestRole.attr('checked', 'checked');
|
||||
if($guestRole.length > 0 && !$guestRole.is(":checked")) {
|
||||
// $guestRole.attr('checked', 'checked'); // JQM
|
||||
$guestRole.prop('checked', true);
|
||||
}
|
||||
|
||||
$("#wrap_Inputfield_roles").find("input[type=checkbox]").each(function() {
|
||||
|
@@ -1 +1 @@
|
||||
$(document).ready(function(){if($("#Inputfield_id").val()==40){$("#wrap_Inputfield_pass").hide();$("#wrap_Inputfield_email").hide();$("#wrap_Inputfield_roles input").attr("disabled","disabled")}var a=$("#Inputfield_roles_37");if(a.size()>0&&!a.is(":checked")){a.attr("checked","checked")}$("#wrap_Inputfield_roles").find("input[type=checkbox]").each(function(){if($.inArray(parseInt($(this).val()),ProcessWire.config.ProcessUser.editableRoles)==-1){$(this).closest("label").addClass("ui-priority-secondary").click(function(){var b=$(this).find(".ui-state-error-text");if(b.length==0){b=$("<span class='ui-state-error-text'> ("+ProcessWire.config.ProcessUser.notEditableAlert+")</span>");$(this).append(b);setTimeout(function(){b.fadeOut("normal",function(){b.remove()})},2000)}else{b.remove()}return false})}})});
|
||||
$(document).ready(function(){if($("#Inputfield_id").val()==40){$("#wrap_Inputfield_pass").hide();$("#wrap_Inputfield_email").hide();$("#wrap_Inputfield_roles input").prop("disabled",true)}var $guestRole=$("#Inputfield_roles_37");if($guestRole.length>0&&!$guestRole.is(":checked")){$guestRole.prop("checked",true)}$("#wrap_Inputfield_roles").find("input[type=checkbox]").each(function(){if($.inArray(parseInt($(this).val()),ProcessWire.config.ProcessUser.editableRoles)==-1){$(this).closest("label").addClass("ui-priority-secondary").click(function(){var $alert=$(this).find(".ui-state-error-text");if($alert.length==0){$alert=$("<span class='ui-state-error-text'> ("+ProcessWire.config.ProcessUser.notEditableAlert+")</span>");$(this).append($alert);setTimeout(function(){$alert.fadeOut("normal",function(){$alert.remove()})},2e3)}else{$alert.remove()}return false})}})});
|
Reference in New Issue
Block a user