From 5244904e8f7db709b6c2a18e51557e65f6e83737 Mon Sep 17 00:00:00 2001 From: Greg Roach Date: Fri, 13 Jan 2017 09:32:32 +0000 Subject: Use $() instead of jQuery() --- assets/js-1.7.9/admin.js | 38 ++++++++++++++++----------------- assets/js-1.7.9/webtrees.js | 52 ++++++++++++++++++++++----------------------- 2 files changed, 45 insertions(+), 45 deletions(-) (limited to 'assets') diff --git a/assets/js-1.7.9/admin.js b/assets/js-1.7.9/admin.js index 196c66468b..cc6612da7e 100644 --- a/assets/js-1.7.9/admin.js +++ b/assets/js-1.7.9/admin.js @@ -23,14 +23,14 @@ * @param access true or false */ function setPrivacyFeedback(sel, who, access) { - var form_group = jQuery(sel).closest(".form-group"); + var form_group = $(sel).closest(".form-group"); if (access) { - jQuery("." + who, form_group).addClass("label-success").removeClass("label-default"); - jQuery("." + who + " i", form_group).addClass("fa-check").removeClass("fa-times"); + $("." + who, form_group).addClass("label-success").removeClass("label-default"); + $("." + who + " i", form_group).addClass("fa-check").removeClass("fa-times"); } else { - jQuery("." + who, form_group).addClass("label-default").removeClass("label-success"); - jQuery("." + who + " i", form_group).addClass("fa-times").removeClass("fa-check"); + $("." + who, form_group).addClass("label-default").removeClass("label-success"); + $("." + who + " i", form_group).addClass("fa-times").removeClass("fa-check"); } } @@ -38,11 +38,11 @@ function setPrivacyFeedback(sel, who, access) { * Update all the privacy feedback labels. */ function updatePrivacyFeedback() { - var require_authentication = parseInt(jQuery("[name=REQUIRE_AUTHENTICATION]").val(), 10); - var show_dead_people = parseInt(jQuery("[name=SHOW_DEAD_PEOPLE]").val(), 10); - var hide_live_people = parseInt(jQuery("[name=HIDE_LIVE_PEOPLE]").val(), 10); - var show_living_names = parseInt(jQuery("[name=SHOW_LIVING_NAMES]").val(), 10); - var show_private_relationships = parseInt(jQuery("[name=SHOW_PRIVATE_RELATIONSHIPS]").val(), 10); + var require_authentication = parseInt($("[name=REQUIRE_AUTHENTICATION]").val(), 10); + var show_dead_people = parseInt($("[name=SHOW_DEAD_PEOPLE]").val(), 10); + var hide_live_people = parseInt($("[name=HIDE_LIVE_PEOPLE]").val(), 10); + var show_living_names = parseInt($("[name=SHOW_LIVING_NAMES]").val(), 10); + var show_private_relationships = parseInt($("[name=SHOW_PRIVATE_RELATIONSHIPS]").val(), 10); setPrivacyFeedback("[name=REQUIRE_AUTHENTICATION]", "visitors", require_authentication === 0); setPrivacyFeedback("[name=REQUIRE_AUTHENTICATION]", "members", true); @@ -63,9 +63,9 @@ function updatePrivacyFeedback() { // Onsubmit validation for the import/upload GEDCOM form function checkGedcomImportForm(message) { - var old_file = jQuery("#gedcom_filename").val(); - var method = jQuery("input[name=action]:checked").val(); - var new_file = method === "replace_import" ? jQuery("#import-server-file").val() : jQuery("#import-computer-file").val(); + var old_file = $("#gedcom_filename").val(); + var method = $("input[name=action]:checked").val(); + var new_file = method === "replace_import" ? $("#import-server-file").val() : $("#import-computer-file").val(); // Some browsers include c:\fakepath\ in the filename. new_file = new_file.replace(/.*[\/\\]/, ''); @@ -79,18 +79,18 @@ function checkGedcomImportForm(message) { /** * Add handlers to various screen elements */ -jQuery(document).ready(function() { +$(document).ready(function() { // Activate the privacy feedback labels. updatePrivacyFeedback(); - jQuery("[name=REQUIRE_AUTHENTICATION], [name=HIDE_LIVE_PEOPLE], [name=SHOW_DEAD_PEOPLE], [name=SHOW_LIVING_NAMES], [name=SHOW_PRIVATE_RELATIONSHIPS]").on("change", function () { + $("[name=REQUIRE_AUTHENTICATION], [name=HIDE_LIVE_PEOPLE], [name=SHOW_DEAD_PEOPLE], [name=SHOW_LIVING_NAMES], [name=SHOW_PRIVATE_RELATIONSHIPS]").on("change", function () { updatePrivacyFeedback(); }); // Import from file on server/computer - jQuery("#import-server-file").on("focus", function () { - jQuery("#import-server").prop("checked", true); + $("#import-server-file").on("focus", function () { + $("#import-server").prop("checked", true); }); - jQuery("#import-computer-file").on("focus", function () { - jQuery("#import-computer").prop("checked", true); + $("#import-computer-file").on("focus", function () { + $("#import-computer").prop("checked", true); }); }); diff --git a/assets/js-1.7.9/webtrees.js b/assets/js-1.7.9/webtrees.js index 11c7d4e39a..e7dcd4a7aa 100644 --- a/assets/js-1.7.9/webtrees.js +++ b/assets/js-1.7.9/webtrees.js @@ -30,7 +30,7 @@ var fam_nav_specs = 'width=350,height=550,left=25,top=75,resizable=1,scrollbars= var pastefield, nameElement, remElement; // Elements to paste to // "rtl" on right-to-left pages. -var textDirection = jQuery('html').attr('dir'); +var textDirection = $('html').attr('dir'); // Get a help message. function helpDialog(topic, module) { @@ -41,7 +41,7 @@ function helpDialog(topic, module) { // Create a modal dialog to display notes & help function modalNotes(content, title) { - jQuery('
') + $('
') .html(content) .dialog({ modal: true, @@ -49,8 +49,8 @@ function modalNotes(content, title) { open: function () { // Close the window when we click outside it. var self = this; - jQuery('.ui-widget-overlay').on('click', function () { - jQuery(self).dialog('close'); + $('.ui-widget-overlay').on('click', function () { + $(self).dialog('close'); }); } }); @@ -70,9 +70,9 @@ function closePopupAndReloadParent(url) { } function expand_layer(sid) { - jQuery("#" + sid + "_img").toggleClass("icon-plus icon-minus"); - jQuery('#' + sid).slideToggle("fast"); - jQuery('#' + sid + '-alt').toggle(); // hide something when we show the layer - and vice-versa + $("#" + sid + "_img").toggleClass("icon-plus icon-minus"); + $('#' + sid).slideToggle("fast"); + $('#' + sid + '-alt').toggle(); // hide something when we show the layer - and vice-versa return false; } @@ -116,7 +116,7 @@ function edit_note(xref) { } function add_record(xref, fact_field) { - var fact = jQuery('#' + fact_field).val(); + var fact = $('#' + fact_field).val(); if (fact) { if (fact === "OBJE") { window.open('addmedia.php?action=showmediaform&linkid=' + encodeURIComponent(xref) + '&ged=' + encodeURIComponent(WT_GEDCOM), '_blank', edit_window_specs); @@ -322,7 +322,7 @@ function paste_fact(xref, element) { jQuery.post('action.php', { action: 'paste-fact', xref: xref, - fact_id: jQuery(element).val(), // element is the containing the option ged: WT_GEDCOM, csrf: WT_CSRF_TOKEN }, @@ -1059,14 +1059,14 @@ function activate_colorbox(config) { } // Trigger an event when we click on an (any) image - jQuery('body').on('click', 'a.gallery', function () { + $('body').on('click', 'a.gallery', function () { // Remove colorbox from hidden media (e.g. on other tabs) // (not needed unless we add :visible to our selectors - which may not // work on all browsers?) //jQuery.colorbox.remove(); // Enable colorbox for images - jQuery('a[type^=image].gallery').colorbox({ + $('a[type^=image].gallery').colorbox({ photo: true, maxWidth: '95%', maxHeight: '95%', @@ -1075,17 +1075,17 @@ function activate_colorbox(config) { slideshowAuto: false, // Add wheelzoom to the displayed image onComplete: function () { - jQuery('.cboxPhoto').wheelzoom(); + $('.cboxPhoto').wheelzoom(); } }); // Enable colorbox for audio using , where supported - //jQuery('html.video a[type^=video].gallery').colorbox({ + //$('html.video a[type^=video].gallery').colorbox({ // rel: 'nofollow' // Slideshows are just for images //}); // Enable colorbox for video using , where supported - //jQuery('html.audio a[type^=audio].gallery').colorbox({ + //$('html.audio a[type^=audio].gallery').colorbox({ // rel: 'nofollow', // Slideshows are just for images //}); @@ -1099,26 +1099,26 @@ function autocomplete(selector) { selector = "input[data-autocomplete-type]"; } - jQuery(selector).each(function () { - var type = jQuery(this).data("autocomplete-type"); // What type of field - var ged = jQuery(this).data("autocomplete-ged"); // Which family tree + $(selector).each(function () { + var type = $(this).data("autocomplete-type"); // What type of field + var ged = $(this).data("autocomplete-ged"); // Which family tree if (typeof(type) === "undefined") { alert("Missing data-autocomplete-type attribute"); } // Default to the current tree if (typeof(ged) === "undefined") { - jQuery(this).data("autocomplete-ged", WT_GEDCOM); + $(this).data("autocomplete-ged", WT_GEDCOM); } - var self = jQuery(this); + var self = $(this); self.autocomplete({ // Cannot use a simple URL, as the data-autocomplete-xxxx parameters may change. source: function (request, response) { // Some autocomplete fields require the current value of an earlier field var extra = null; if (self.data("autocomplete-extra")) { - extra = jQuery(self.data("autocomplete-extra")).val(); + extra = $(self.data("autocomplete-extra")).val(); } jQuery.getJSON("autocomplete.php", { @@ -1158,12 +1158,12 @@ jQuery.widget("ui.dialog", jQuery.ui.dialog, { } // address interaction issues with dialog window - if (jQuery(event.target).closest(".cke_dialog").length) { + if ($(event.target).closest(".cke_dialog").length) { return true; } // address interaction issues with iframe based drop downs in IE - if (jQuery(event.target).closest(".cke").length) { + if ($(event.target).closest(".cke").length) { return true; } }, @@ -1179,11 +1179,11 @@ jQuery.widget("ui.dialog", jQuery.ui.dialog, { }); /* Show / Hide event data for boxes used on charts and elsewhere */ -jQuery('body').on ('click', '.iconz', function (e) { +$('body').on ('click', '.iconz', function (e) { "use strict"; e.stopPropagation (); - var wrapper = jQuery(this).closest (".person_box_template"), + var wrapper = $(this).closest (".person_box_template"), inout = wrapper.find (".inout"), inout2 = wrapper.find (".inout2"), namedef = wrapper.find (".namedef"), @@ -1230,7 +1230,7 @@ jQuery('body').on ('click', '.iconz', function (e) { }); // Activate the langauge selection menu. -jQuery(".menu-language").on("click", "li a", function () { +$(".menu-language").on("click", "li a", function () { jQuery.post("action.php", { action: "language", language: $(this).data("language"), @@ -1241,7 +1241,7 @@ jQuery(".menu-language").on("click", "li a", function () { }); // Activate the theme selection menu. -jQuery(".menu-theme").on("click", "li a", function () { +$(".menu-theme").on("click", "li a", function () { jQuery.post("action.php", { action: "theme", theme: $(this).data("theme"), -- cgit v1.3