mirror of
https://github.com/processwire/processwire.git
synced 2025-08-13 02:04:35 +02:00
Additional .js file updates for newer jQuery
This commit is contained in:
@@ -3,9 +3,10 @@ $(document).ready(function() {
|
|||||||
var fieldFilterFormChange = function() {
|
var fieldFilterFormChange = function() {
|
||||||
$("#field_filter_form").submit();
|
$("#field_filter_form").submit();
|
||||||
};
|
};
|
||||||
$("#templates_id").change(fieldFilterFormChange);
|
|
||||||
$("#fieldtype").change(fieldFilterFormChange);
|
$("#templates_id").on('change', fieldFilterFormChange);
|
||||||
$("#wrap_show_system input").click(fieldFilterFormChange);
|
$("#fieldtype").on('change', fieldFilterFormChange);
|
||||||
|
$("#wrap_show_system input").on('click', fieldFilterFormChange);
|
||||||
|
|
||||||
var $asmListItemStatus = $("#asmListItemStatus");
|
var $asmListItemStatus = $("#asmListItemStatus");
|
||||||
|
|
||||||
@@ -29,8 +30,8 @@ $(document).ready(function() {
|
|||||||
$asmListItemStatus.val(tpl);
|
$asmListItemStatus.val(tpl);
|
||||||
}
|
}
|
||||||
|
|
||||||
$("#Inputfield_showIf").change(setAsmListItemStatus);
|
$("#Inputfield_showIf").on('change', setAsmListItemStatus);
|
||||||
$("#Inputfield_required").change(setAsmListItemStatus);
|
$("#Inputfield_required").on('change', setAsmListItemStatus);
|
||||||
setAsmListItemStatus();
|
setAsmListItemStatus();
|
||||||
|
|
||||||
$('.columnWidthInput').each(function() {
|
$('.columnWidthInput').each(function() {
|
||||||
@@ -56,7 +57,7 @@ $(document).ready(function() {
|
|||||||
// $("#asmListItemStatus").val($columnWidth.val());
|
// $("#asmListItemStatus").val($columnWidth.val());
|
||||||
|
|
||||||
// update the slider if the columnWidth field is changed manually
|
// update the slider if the columnWidth field is changed manually
|
||||||
$columnWidth.change(function() {
|
$columnWidth.on('change', function() {
|
||||||
var val = parseInt($(this).val());
|
var val = parseInt($(this).val());
|
||||||
if(val > 100) val = 100;
|
if(val > 100) val = 100;
|
||||||
if(val < 10) val = 10;
|
if(val < 10) val = 10;
|
||||||
@@ -73,11 +74,11 @@ $(document).ready(function() {
|
|||||||
items: $(".Inputfields li.WireTab"),
|
items: $(".Inputfields li.WireTab"),
|
||||||
id: 'FieldEditTabs',
|
id: 'FieldEditTabs',
|
||||||
skipRememberTabIDs: ['delete']
|
skipRememberTabIDs: ['delete']
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// change fieldgroup context
|
// change fieldgroup context
|
||||||
$("#fieldgroupContextSelect").change(function() {
|
$("#fieldgroupContextSelect").on('change', function() {
|
||||||
var field_id = $("#Inputfield_id").val();
|
var field_id = $("#Inputfield_id").val();
|
||||||
var fieldgroup_id = $(this).val();
|
var fieldgroup_id = $(this).val();
|
||||||
var href = './edit?id=' + field_id;
|
var href = './edit?id=' + field_id;
|
||||||
@@ -85,14 +86,14 @@ $(document).ready(function() {
|
|||||||
window.location = href;
|
window.location = href;
|
||||||
});
|
});
|
||||||
|
|
||||||
$("a.fieldFlag").click(function() {
|
$("a.fieldFlag").on('click', function() {
|
||||||
if($(this).attr('href') === '#') return false;
|
if($(this).attr('href') === '#') return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#export_data").click(function() { $(this).select(); });
|
$("#export_data").on('click', function() { $(this).select(); });
|
||||||
|
|
||||||
// export and import functions
|
// export and import functions
|
||||||
$(".import_toggle input[type=radio]").change(function() {
|
$(".import_toggle input[type=radio]").on('change', function() {
|
||||||
var $table = $(this).parents('p.import_toggle').next('table');
|
var $table = $(this).parents('p.import_toggle').next('table');
|
||||||
var $fieldset = $(this).closest('.InputfieldFieldset');
|
var $fieldset = $(this).closest('.InputfieldFieldset');
|
||||||
if($(this).is(":checked") && $(this).val() == 0) {
|
if($(this).is(":checked") && $(this).val() == 0) {
|
||||||
@@ -102,25 +103,25 @@ $(document).ready(function() {
|
|||||||
$table.show();
|
$table.show();
|
||||||
$fieldset.removeClass('ui-priority-secondary');
|
$fieldset.removeClass('ui-priority-secondary');
|
||||||
}
|
}
|
||||||
}).change();
|
}).trigger('change');
|
||||||
|
|
||||||
// allow processInput to ignore this field when applicable
|
// allow processInput to ignore this field when applicable
|
||||||
$("#wrap_Inputfield_send_templates").find(":input").change(function() {
|
$("#wrap_Inputfield_send_templates").find(":input").on('change', function() {
|
||||||
$("#_send_templates_changed").val('changed');
|
$("#_send_templates_changed").val('changed');
|
||||||
});
|
});
|
||||||
|
|
||||||
// setup access control tab
|
// setup access control tab
|
||||||
$("#viewRoles_37").click(function() {
|
$("#viewRoles_37").on('click', function() {
|
||||||
// if guest has view, then all have view
|
// if guest has view, then all have view
|
||||||
// if($(this).is(":checked")) $("input.viewRoles").attr('checked', 'checked'); // JQM
|
// if($(this).is(":checked")) $("input.viewRoles").attr('checked', 'checked'); // JQM
|
||||||
if($(this).is(":checked")) $("input.viewRoles").prop('checked', true);
|
if($(this).is(":checked")) $("input.viewRoles").prop('checked', true);
|
||||||
});
|
});
|
||||||
$("input.viewRoles:not(#viewRoles_37)").click(function() {
|
$("input.viewRoles:not(#viewRoles_37)").on('click', function() {
|
||||||
// prevent unchecking 'view' for other roles when 'guest' role is checked
|
// prevent unchecking 'view' for other roles when 'guest' role is checked
|
||||||
if($("#viewRoles_37").is(":checked")) return false;
|
if($("#viewRoles_37").is(":checked")) return false;
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
$("input.editRoles:not(:disabled)").click(function() {
|
$("input.editRoles:not(:disabled)").on('click', function() {
|
||||||
if($(this).is(":checked")) {
|
if($(this).is(":checked")) {
|
||||||
// if editable is checked, then viewable must also be checked
|
// if editable is checked, then viewable must also be checked
|
||||||
// $(this).closest('tr').find("input.viewRoles").attr('checked', 'checked'); // JQM
|
// $(this).closest('tr').find("input.viewRoles").attr('checked', 'checked'); // JQM
|
||||||
@@ -129,7 +130,7 @@ $(document).ready(function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// select-all link for overrides tab
|
// select-all link for overrides tab
|
||||||
$(".override-select-all").click(function() {
|
$(".override-select-all").on('click', function() {
|
||||||
var $checkboxes = $(this).closest('table').find("input[type=checkbox]");
|
var $checkboxes = $(this).closest('table').find("input[type=checkbox]");
|
||||||
if($(this).hasClass('override-checked')) {
|
if($(this).hasClass('override-checked')) {
|
||||||
// $checkboxes.removeAttr('checked'); // JQM
|
// $checkboxes.removeAttr('checked'); // JQM
|
||||||
|
@@ -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();$(".columnWidthInput").each(function(){var $columnWidth=$(this);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");if($columnWidth.prop("id")==="columnWidth")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(){if($(this).attr("href")==="#")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")})});
|
$(document).ready(function(){var fieldFilterFormChange=function(){$("#field_filter_form").submit()};$("#templates_id").on("change",fieldFilterFormChange);$("#fieldtype").on("change",fieldFilterFormChange);$("#wrap_show_system input").on("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").on("change",setAsmListItemStatus);$("#Inputfield_required").on("change",setAsmListItemStatus);setAsmListItemStatus();$(".columnWidthInput").each(function(){var $columnWidth=$(this);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");if($columnWidth.prop("id")==="columnWidth")setAsmListItemStatus()}});$columnWidth.on("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").on("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").on("click",function(){if($(this).attr("href")==="#")return false});$("#export_data").on("click",function(){$(this).select()});$(".import_toggle input[type=radio]").on("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")}}).trigger("change");$("#wrap_Inputfield_send_templates").find(":input").on("change",function(){$("#_send_templates_changed").val("changed")});$("#viewRoles_37").on("click",function(){if($(this).is(":checked"))$("input.viewRoles").prop("checked",true)});$("input.viewRoles:not(#viewRoles_37)").on("click",function(){if($("#viewRoles_37").is(":checked"))return false;return true});$("input.editRoles:not(:disabled)").on("click",function(){if($(this).is(":checked")){$(this).closest("tr").find("input.viewRoles").prop("checked",true)}});$(".override-select-all").on("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")})});
|
@@ -1,6 +1,6 @@
|
|||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
|
||||||
$(".not_installed").parent("a").css('opacity', 0.6).click(function() {
|
$(".not_installed").parent("a").css('opacity', 0.6).on('click', function() {
|
||||||
|
|
||||||
var name = $(this).children(".not_installed").attr('data-name');
|
var name = $(this).children(".not_installed").attr('data-name');
|
||||||
var $btn = $(".install_" + name + ":visible");
|
var $btn = $(".install_" + name + ":visible");
|
||||||
@@ -19,7 +19,7 @@ $(document).ready(function() {
|
|||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
$("button.ProcessModuleSettings").click(function() {
|
$("button.ProcessModuleSettings").on('click', function() {
|
||||||
var $a = $(this).parents('tr').find('.ConfigurableModule').parent('a');
|
var $a = $(this).parents('tr').find('.ConfigurableModule').parent('a');
|
||||||
window.location.href = $a.attr('href') + '&collapse_info=1';
|
window.location.href = $a.attr('href') + '&collapse_info=1';
|
||||||
});
|
});
|
||||||
@@ -31,7 +31,7 @@ $(document).ready(function() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
$("select.modules_section_select").change(function() {
|
$("select.modules_section_select").on('change', function() {
|
||||||
var section = $(this).val();
|
var section = $(this).val();
|
||||||
var $sections = $(this).parent('p').siblings('.modules_section')
|
var $sections = $(this).parent('p').siblings('.modules_section')
|
||||||
if(section == '') {
|
if(section == '') {
|
||||||
@@ -42,7 +42,7 @@ $(document).ready(function() {
|
|||||||
}
|
}
|
||||||
document.cookie = $(this).attr('name') + '=' + section;
|
document.cookie = $(this).attr('name') + '=' + section;
|
||||||
return true;
|
return true;
|
||||||
}).change();
|
}).trigger('change');
|
||||||
|
|
||||||
|
|
||||||
$(document).on('click', '#head_button a', function() {
|
$(document).on('click', '#head_button a', function() {
|
||||||
@@ -51,8 +51,8 @@ $(document).ready(function() {
|
|||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#Inputfield_new_seconds").change(function() {
|
$("#Inputfield_new_seconds").on('change', function() {
|
||||||
$('#submit_check').removeAttr('hidden').click();
|
$('#submit_check').removeAttr('hidden').trigger('click');
|
||||||
$(this).closest('form').submit();
|
$(this).closest('form').submit();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -1 +1 @@
|
|||||||
$(document).ready(function(){$(".not_installed").parent("a").css("opacity",.6).click(function(){var name=$(this).children(".not_installed").attr("data-name");var $btn=$(".install_"+name+":visible");var disabled=$btn.attr("disabled");if($btn.length){$btn.effect("highlight",1e3)}else{var color=$(this).css("color");$(this).closest("tr").find(".requires").attr("data-color",$(this).css("color")).css("color",color).effect("highlight",1e3)}return false});$("button.ProcessModuleSettings").click(function(){var $a=$(this).parents("tr").find(".ConfigurableModule").parent("a");window.location.href=$a.attr("href")+"&collapse_info=1"});if($("#modules_form").length>0){$("#modules_form").WireTabs({items:$(".Inputfields li.WireTab"),rememberTabs:true})}$("select.modules_section_select").change(function(){var section=$(this).val();var $sections=$(this).parent("p").siblings(".modules_section");if(section==""){$sections.show()}else{$sections.hide();$sections.filter(".modules_"+section).show()}document.cookie=$(this).attr("name")+"="+section;return true}).change();$(document).on("click","#head_button a",function(){document.cookie="WireTabs=tab_new_modules";return true});$("#Inputfield_new_seconds").change(function(){$("#submit_check").removeAttr("hidden").click();$(this).closest("form").submit()});$("#wrap_upload_module").removeClass("InputfieldItemList")});
|
$(document).ready(function(){$(".not_installed").parent("a").css("opacity",.6).on("click",function(){var name=$(this).children(".not_installed").attr("data-name");var $btn=$(".install_"+name+":visible");var disabled=$btn.attr("disabled");if($btn.length){$btn.effect("highlight",1e3)}else{var color=$(this).css("color");$(this).closest("tr").find(".requires").attr("data-color",$(this).css("color")).css("color",color).effect("highlight",1e3)}return false});$("button.ProcessModuleSettings").on("click",function(){var $a=$(this).parents("tr").find(".ConfigurableModule").parent("a");window.location.href=$a.attr("href")+"&collapse_info=1"});if($("#modules_form").length>0){$("#modules_form").WireTabs({items:$(".Inputfields li.WireTab"),rememberTabs:true})}$("select.modules_section_select").on("change",function(){var section=$(this).val();var $sections=$(this).parent("p").siblings(".modules_section");if(section==""){$sections.show()}else{$sections.hide();$sections.filter(".modules_"+section).show()}document.cookie=$(this).attr("name")+"="+section;return true}).trigger("change");$(document).on("click","#head_button a",function(){document.cookie="WireTabs=tab_new_modules";return true});$("#Inputfield_new_seconds").on("change",function(){$("#submit_check").removeAttr("hidden").trigger("click");$(this).closest("form").submit()});$("#wrap_upload_module").removeClass("InputfieldItemList")});
|
@@ -1,18 +1,18 @@
|
|||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
|
||||||
$("#select_parent_submit").hide();
|
$("#select_parent_submit").hide();
|
||||||
$("#select_parent_id").change(function() {
|
$("#select_parent_id").on('change', function() {
|
||||||
var val = $(this).val();
|
var val = $(this).val();
|
||||||
if(val > 0) $("#select_parent_submit").click();
|
if(val > 0) $("#select_parent_submit").trigger('click');
|
||||||
});
|
});
|
||||||
|
|
||||||
var submitted = false;
|
var submitted = false;
|
||||||
$("#ProcessPageAdd").submit(function() {
|
$("#ProcessPageAdd").on('submit', function() {
|
||||||
if(submitted) return false;
|
if(submitted) return false;
|
||||||
submitted = true;
|
submitted = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#template").change(function() {
|
$("#template").on('change', function() {
|
||||||
var $t = $(this);
|
var $t = $(this);
|
||||||
var val = $t.val();
|
var val = $t.val();
|
||||||
var showPublish = false;
|
var showPublish = false;
|
||||||
@@ -33,7 +33,7 @@ $(document).ready(function() {
|
|||||||
$button2.fadeOut();
|
$button2.fadeOut();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}).change();
|
}).trigger('change');
|
||||||
|
|
||||||
var existsTimer = null;
|
var existsTimer = null;
|
||||||
var existsName = '';
|
var existsName = '';
|
||||||
@@ -66,7 +66,7 @@ $(document).ready(function() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$("#Inputfield_title, #Inputfield__pw_page_name").keyup(function(e) {
|
$("#Inputfield_title, #Inputfield__pw_page_name").on('keyup', function(e) {
|
||||||
if(existsTimer) clearTimeout(existsTimer);
|
if(existsTimer) clearTimeout(existsTimer);
|
||||||
existsTimer = setTimeout(function() { checkExists(); }, 250);
|
existsTimer = setTimeout(function() { checkExists(); }, 250);
|
||||||
});
|
});
|
||||||
@@ -75,7 +75,7 @@ $(document).ready(function() {
|
|||||||
// we hide language tabs/inputs when such a template is selected
|
// we hide language tabs/inputs when such a template is selected
|
||||||
if($(".langTabs").length) {
|
if($(".langTabs").length) {
|
||||||
var $template = $('#template');
|
var $template = $('#template');
|
||||||
$template.change(function() {
|
$template.on('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) {
|
if(parseInt($option.attr('data-nolang')) > 0) {
|
||||||
hideLanguageTabs();
|
hideLanguageTabs();
|
||||||
|
@@ -1 +1 @@
|
|||||||
$(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){var $template=$("#template");$template.change(function(){var $option=$(this).find("option[value='"+$(this).val()+"']");if(parseInt($option.attr("data-nolang"))>0){hideLanguageTabs()}else{unhideLanguageTabs()}}).change();var noLang=$template.attr("data-nolang");if(typeof noLang!=="undefined"&&parseInt(noLang)>0){hideLanguageTabs()}}$(".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)})});
|
$(document).ready(function(){$("#select_parent_submit").hide();$("#select_parent_id").on("change",function(){var val=$(this).val();if(val>0)$("#select_parent_submit").trigger("click")});var submitted=false;$("#ProcessPageAdd").on("submit",function(){if(submitted)return false;submitted=true});$("#template").on("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()}}}).trigger("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").on("keyup",function(e){if(existsTimer)clearTimeout(existsTimer);existsTimer=setTimeout(function(){checkExists()},250)});if($(".langTabs").length){var $template=$("#template");$template.on("change",function(){var $option=$(this).find("option[value='"+$(this).val()+"']");if(parseInt($option.attr("data-nolang"))>0){hideLanguageTabs()}else{unhideLanguageTabs()}}).change();var noLang=$template.attr("data-nolang");if(typeof noLang!=="undefined"&&parseInt(noLang)>0){hideLanguageTabs()}}$(".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)})});
|
@@ -11,7 +11,7 @@ ProcessPageSearch = {
|
|||||||
$('#ProcessPageSearchLiveResults').load(ProcessWire.config.urls.admin + 'page/search/', { q: query }, function(data) {
|
$('#ProcessPageSearchLiveResults').load(ProcessWire.config.urls.admin + 'page/search/', { q: query }, function(data) {
|
||||||
var numResults = parseInt($('#search_num_results').hide().text());
|
var numResults = parseInt($('#search_num_results').hide().text());
|
||||||
if(numResults) {
|
if(numResults) {
|
||||||
$('#search_results').fadeIn("fast").find("a").click(function() {
|
$('#search_results').fadeIn("fast").find("a").on('click', function() {
|
||||||
// reduces time that horiz scrollbar shows in FF
|
// reduces time that horiz scrollbar shows in FF
|
||||||
$("#search_results").css("overflow", "hidden");
|
$("#search_results").css("overflow", "hidden");
|
||||||
});
|
});
|
||||||
@@ -34,18 +34,17 @@ ProcessPageSearch = {
|
|||||||
this.lastQuery = this.defaultLabel;
|
this.lastQuery = this.defaultLabel;
|
||||||
$('#container').append('<div id="search_container"></div><div id="search_status"></div>');
|
$('#container').append('<div id="search_container"></div><div id="search_status"></div>');
|
||||||
|
|
||||||
$('#search_form').unbind().submit(function() {
|
$('#search_form').off().on('submit', function() {
|
||||||
return this.search();
|
return this.search();
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#search_query').attr('autocomplete', 'off').focus(function() {
|
$('#search_query').attr('autocomplete', 'off').on('focus', function() {
|
||||||
$(this).keyup(function() {
|
$(this).on('keyup', function() {
|
||||||
if($(this).val().length < 4) return;
|
if($(this).val().length < 4) return;
|
||||||
if(this.t) clearTimeout(this.t);
|
if(this.t) clearTimeout(this.t);
|
||||||
this.t = setTimeout("liveSearch.search()", 500);
|
this.t = setTimeout("liveSearch.search()", 500);
|
||||||
});
|
});
|
||||||
|
}).on('blur', function() {
|
||||||
}).blur(function() {
|
|
||||||
setTimeout("liveSearch.hide()", 250);
|
setTimeout("liveSearch.hide()", 250);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@@ -1 +1 @@
|
|||||||
ProcessPageSearch={t:0,defaultLabel:"Search",lastQuery:"",search:function(){var query=$("#ProcessPageSearchQuery").val();if(query==this.lastQuery)return false;$("#ProcessPageSearchStatus").text("Searching");$("#ProcessPageSearchLiveResults").load(ProcessWire.config.urls.admin+"page/search/",{q:query},function(data){var numResults=parseInt($("#search_num_results").hide().text());if(numResults){$("#search_results").fadeIn("fast").find("a").click(function(){$("#search_results").css("overflow","hidden")});$("#search_status").text(numResults+" matches")}else{$("#search_status").text("No matches")}});this.lastQuery=query;return false},hide:function(){$("#search_results").fadeOut("fast",function(){$(this).remove()});$("#search_status").text("");$("#search_query").val(this.defaultLabel)},init:function(){this.lastQuery=this.defaultLabel;$("#container").append('<div id="search_container"></div><div id="search_status"></div>');$("#search_form").unbind().submit(function(){return this.search()});$("#search_query").attr("autocomplete","off").focus(function(){$(this).keyup(function(){if($(this).val().length<4)return;if(this.t)clearTimeout(this.t);this.t=setTimeout("liveSearch.search()",500)})}).blur(function(){setTimeout("liveSearch.hide()",250)})}};$(document).ready(function(){});
|
ProcessPageSearch={t:0,defaultLabel:"Search",lastQuery:"",search:function(){var query=$("#ProcessPageSearchQuery").val();if(query==this.lastQuery)return false;$("#ProcessPageSearchStatus").text("Searching");$("#ProcessPageSearchLiveResults").load(ProcessWire.config.urls.admin+"page/search/",{q:query},function(data){var numResults=parseInt($("#search_num_results").hide().text());if(numResults){$("#search_results").fadeIn("fast").find("a").on("click",function(){$("#search_results").css("overflow","hidden")});$("#search_status").text(numResults+" matches")}else{$("#search_status").text("No matches")}});this.lastQuery=query;return false},hide:function(){$("#search_results").fadeOut("fast",function(){$(this).remove()});$("#search_status").text("");$("#search_query").val(this.defaultLabel)},init:function(){this.lastQuery=this.defaultLabel;$("#container").append('<div id="search_container"></div><div id="search_status"></div>');$("#search_form").off().on("submit",function(){return this.search()});$("#search_query").attr("autocomplete","off").on("focus",function(){$(this).on("keyup",function(){if($(this).val().length<4)return;if(this.t)clearTimeout(this.t);this.t=setTimeout("liveSearch.search()",500)})}).on("blur",function(){setTimeout("liveSearch.hide()",250)})}};$(document).ready(function(){});
|
@@ -389,8 +389,11 @@ function ProcessTemplate() {
|
|||||||
function setupAccessTab() {
|
function setupAccessTab() {
|
||||||
|
|
||||||
var redirectLoginClick = function() {
|
var redirectLoginClick = function() {
|
||||||
if($("#redirectLogin_-1:checked").length > 0) $("#wrap_redirectLoginURL").slideDown();
|
if($("#redirectLogin_-1:checked").length > 0) {
|
||||||
else $("#wrap_redirectLoginURL").hide();
|
$("#wrap_redirectLoginURL").slideDown();
|
||||||
|
} else {
|
||||||
|
$("#wrap_redirectLoginURL").hide();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var adjustAccessFields = function() {
|
var adjustAccessFields = function() {
|
||||||
@@ -409,7 +412,6 @@ function ProcessTemplate() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// $("input.viewRoles").attr('checked', 'checked'); // JQM
|
|
||||||
$('input.viewRoles').prop('checked', true);
|
$('input.viewRoles').prop('checked', true);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@@ -419,7 +421,7 @@ function ProcessTemplate() {
|
|||||||
if($item.is(":visible")) return;
|
if($item.is(":visible")) return;
|
||||||
$item.slideDown("fast", function() {
|
$item.slideDown("fast", function() {
|
||||||
if(!$item.is(".InputfieldStateCollapsed")) return;
|
if(!$item.is(".InputfieldStateCollapsed")) return;
|
||||||
$item.find(".InputfieldStateToggle").click();
|
$item.find(".InputfieldStateToggle").trigger('click');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
redirectLoginClick();
|
redirectLoginClick();
|
||||||
@@ -427,12 +429,11 @@ function ProcessTemplate() {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
$("#wrap_useRoles input").click(function() {
|
$("#wrap_useRoles input").on('click', function() {
|
||||||
if($("#useRoles_1:checked").length > 0) {
|
if($("#useRoles_1:checked").length > 0) {
|
||||||
$("#wrap_redirectLogin").hide();
|
$("#wrap_redirectLogin").hide();
|
||||||
$("#wrap_guestSearchable").hide();
|
$("#wrap_guestSearchable").hide();
|
||||||
$("#useRolesYes").slideDown(400, function(){ $(this).css('overflow','visible') });
|
$("#useRolesYes").slideDown(400, function(){ $(this).css('overflow','visible') });
|
||||||
// $("#wrap_useRoles > label").click();
|
|
||||||
$("input.viewRoles").prop('checked', true);
|
$("input.viewRoles").prop('checked', true);
|
||||||
} else {
|
} else {
|
||||||
$("#useRolesYes").slideUp();
|
$("#useRolesYes").slideUp();
|
||||||
@@ -446,8 +447,8 @@ function ProcessTemplate() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$("#roles_37").click(adjustAccessFields);
|
$("#roles_37").on('click', adjustAccessFields);
|
||||||
$("input.viewRoles:not(#roles_37)").click(function() {
|
$("input.viewRoles:not(#roles_37)").on('click', function() {
|
||||||
// prevent unchecking 'view' for other roles when 'guest' role is checked
|
// prevent unchecking 'view' for other roles when 'guest' role is checked
|
||||||
var $t = $(this);
|
var $t = $(this);
|
||||||
if($("#roles_37").is(":checked")) return false;
|
if($("#roles_37").is(":checked")) return false;
|
||||||
@@ -468,10 +469,8 @@ function ProcessTemplate() {
|
|||||||
|
|
||||||
if($t.is(":checked")) {
|
if($t.is(":checked")) {
|
||||||
numChecked++;
|
numChecked++;
|
||||||
// $createRoles.removeAttr('disabled'); // JQM
|
|
||||||
$createRoles.prop('disabled', false);
|
$createRoles.prop('disabled', false);
|
||||||
} else {
|
} else {
|
||||||
// $createRoles.removeAttr('checked').attr('disabled', 'disabled'); // JQM
|
|
||||||
$createRoles.prop('checked', false).prop('disabled', true);
|
$createRoles.prop('checked', false).prop('disabled', true);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -496,13 +495,13 @@ function ProcessTemplate() {
|
|||||||
numChecked > 0 ? $("#wrap_noInherit").slideDown() : $("#wrap_noInherit").hide();
|
numChecked > 0 ? $("#wrap_noInherit").slideDown() : $("#wrap_noInherit").hide();
|
||||||
};
|
};
|
||||||
|
|
||||||
$("#roles_editor input.editRoles").click(editRolesClick);
|
$("#roles_editor input.editRoles").on('click', editRolesClick);
|
||||||
$("#roles_editor input.editRoles, #roles_editor input.addRoles").click(editOrAddClick);
|
$("#roles_editor input.editRoles, #roles_editor input.addRoles").on('click', editOrAddClick);
|
||||||
|
|
||||||
editRolesClick();
|
editRolesClick();
|
||||||
editOrAddClick();
|
editOrAddClick();
|
||||||
|
|
||||||
$("#wrap_redirectLogin input").click(redirectLoginClick);
|
$("#wrap_redirectLogin input").on('click', redirectLoginClick);
|
||||||
|
|
||||||
adjustAccessFields();
|
adjustAccessFields();
|
||||||
redirectLoginClick();
|
redirectLoginClick();
|
||||||
@@ -513,9 +512,9 @@ function ProcessTemplate() {
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function setupImportExport() {
|
function setupImportExport() {
|
||||||
$("#export_data").click(function() { $(this).select(); });
|
$("#export_data").on('click', function() { $(this).select(); });
|
||||||
|
|
||||||
$(".import_toggle input[type=radio]").change(function() {
|
$(".import_toggle input[type=radio]").on('change', function() {
|
||||||
var $table = $(this).parents('p.import_toggle').next('table');
|
var $table = $(this).parents('p.import_toggle').next('table');
|
||||||
var $fieldset = $(this).closest('.InputfieldFieldset');
|
var $fieldset = $(this).closest('.InputfieldFieldset');
|
||||||
if($(this).is(":checked") && $(this).val() == 0) {
|
if($(this).is(":checked") && $(this).val() == 0) {
|
||||||
@@ -525,7 +524,7 @@ function ProcessTemplate() {
|
|||||||
$table.show();
|
$table.show();
|
||||||
$fieldset.removeClass('ui-priority-secondary');
|
$fieldset.removeClass('ui-priority-secondary');
|
||||||
}
|
}
|
||||||
}).change();
|
}).trigger('change');
|
||||||
|
|
||||||
$("#import_form table td:not(:first-child)").each(function() {
|
$("#import_form table td:not(:first-child)").each(function() {
|
||||||
var html = $(this).html();
|
var html = $(this).html();
|
||||||
@@ -544,11 +543,11 @@ function ProcessTemplate() {
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function init() {
|
function init() {
|
||||||
$("#wrap_filter_system input").click(function() {
|
$("#wrap_filter_system input").on('click', function() {
|
||||||
$(this).parents("form").submit();
|
$(this).parents("form").submit();
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#filter_field").change(function() {
|
$("#filter_field").on('change', function() {
|
||||||
$(this).parents("form").submit();
|
$(this).parents("form").submit();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -567,7 +566,7 @@ function ProcessTemplate() {
|
|||||||
|
|
||||||
setupImportExport();
|
setupImportExport();
|
||||||
|
|
||||||
$("#fieldgroup_fields").change(function() {
|
$("#fieldgroup_fields").on('change', function() {
|
||||||
$("#_fieldgroup_fields_changed").val('changed');
|
$("#_fieldgroup_fields_changed").val('changed');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
File diff suppressed because one or more lines are too long
@@ -5,7 +5,7 @@ function TemplateFieldAddDialog() {
|
|||||||
var fieldReady = false;
|
var fieldReady = false;
|
||||||
var $iframe = pwModalWindow($a.attr('href'), {}, 'large');
|
var $iframe = pwModalWindow($a.attr('href'), {}, 'large');
|
||||||
|
|
||||||
$iframe.load(function() {
|
$iframe.on('load', function() {
|
||||||
|
|
||||||
var $button;
|
var $button;
|
||||||
var buttons = [];
|
var buttons = [];
|
||||||
@@ -29,7 +29,7 @@ function TemplateFieldAddDialog() {
|
|||||||
'text': text,
|
'text': text,
|
||||||
'class': ($button.hasClass('ui-priority-secondary') ? 'ui-priority-secondary' : ''),
|
'class': ($button.hasClass('ui-priority-secondary') ? 'ui-priority-secondary' : ''),
|
||||||
'click': function() {
|
'click': function() {
|
||||||
$button.click();
|
$button.trigger('click');
|
||||||
fieldReady = true;
|
fieldReady = true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -80,5 +80,5 @@ function TemplateFieldAddDialog() {
|
|||||||
|
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
$('#wrap_fieldgroup_fields p.description a').click(TemplateFieldAddDialog);
|
$('#wrap_fieldgroup_fields p.description a').on('click', TemplateFieldAddDialog);
|
||||||
});
|
});
|
||||||
|
@@ -1 +1 @@
|
|||||||
function TemplateFieldAddDialog(){var b=$(this);var a=false;var c=pwModalWindow(b.attr("href"),{},"large");c.load(function(){var e;var d=[];var f=c.contents();var g=0;f.find("#breadcrumbs ul.nav, #Inputfield_submit_save_field_copy").hide();f.find("#content form button.ui-button[type=submit]").each(function(){var k=$(this).text();var j=false;e=$(this);for(var h=0;h<d.length;h++){if(d[h].text==k||k.length<1){j=true}}if(!j){d[g]={text:k,"class":(e.hasClass("ui-priority-secondary")?"ui-priority-secondary":""),click:function(){e.click();a=true}};g++}e.hide()});if(a){d[g]={text:$("#fieldgroup_fields").attr("data-closeAddLabel"),"class":(e&&e.hasClass("ui-priority-secondary")?"ui-priority-secondary":""),click:function(){setTimeout(function(){var j=f.find("#Inputfield_id:last").val();c.dialog("close");var h=$("#fieldgroup_fields option");var i=h.length;h.eq(1).before($("<option></option>").val(j).text(f.find("#Inputfield_name").val()));$('#fieldgroup_fields option[value="'+j+'"]').attr("id","asm0option"+i).attr("data-desc",(f.find("#field_label").val())).attr("data-status",(f.find("#Inputfield_type option:selected").text()));$("#asmSelect0 option").eq(1).before($("<option></option>").val(j).text(f.find("#Inputfield_name").val()));$("#asmSelect0").find("option:selected").removeAttr("selected");$('#asmSelect0 option[value="'+j+'"]').attr("rel","asm0option"+i).attr("selected","selected").addClass("asmOptionDisabled").attr("disabled","disabled").trigger("change").removeAttr("selected")},500)}}}c.setButtons(d)});return false}$(document).ready(function(){$("#wrap_fieldgroup_fields p.description a").click(TemplateFieldAddDialog)});
|
function TemplateFieldAddDialog(){var $a=$(this);var fieldReady=false;var $iframe=pwModalWindow($a.attr("href"),{},"large");$iframe.on("load",function(){var $button;var buttons=[];var $icontents=$iframe.contents();var n=0;$icontents.find("#breadcrumbs ul.nav, #Inputfield_submit_save_field_copy").hide();$icontents.find("#content form button.ui-button[type=submit]").each(function(){var text=$(this).text();var skip=false;$button=$(this);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.hasClass("ui-priority-secondary")?"ui-priority-secondary":"",click:function(){$button.trigger("click");fieldReady=true}};n++}$button.hide()});if(fieldReady){buttons[n]={text:$("#fieldgroup_fields").attr("data-closeAddLabel"),class:$button&&$button.hasClass("ui-priority-secondary")?"ui-priority-secondary":"",click:function(){setTimeout(function(){var newFieldId=$icontents.find("#Inputfield_id:last").val();$iframe.dialog("close");var $options=$("#fieldgroup_fields option");var numOptions=$options.length;$options.eq(1).before($("<option></option>").val(newFieldId).text($icontents.find("#Inputfield_name").val()));$('#fieldgroup_fields option[value="'+newFieldId+'"]').attr("id","asm0option"+numOptions).attr("data-desc",$icontents.find("#field_label").val()).attr("data-status",$icontents.find("#Inputfield_type option:selected").text());$("#asmSelect0 option").eq(1).before($("<option></option>").val(newFieldId).text($icontents.find("#Inputfield_name").val()));$("#asmSelect0").find("option:selected").removeAttr("selected");$('#asmSelect0 option[value="'+newFieldId+'"]').attr("rel","asm0option"+numOptions).attr("selected","selected").addClass("asmOptionDisabled").attr("disabled","disabled").trigger("change").removeAttr("selected")},500)}}}$iframe.setButtons(buttons)});return false}$(document).ready(function(){$("#wrap_fieldgroup_fields p.description a").on("click",TemplateFieldAddDialog)});
|
Reference in New Issue
Block a user