How to use parents method in Cypress

Best JavaScript code snippet using cypress

admin.js

Source:admin.js Github

copy

Full Screen

...28 var sandboxmode = 'sandbox';29 } else {30 var sandboxmode = 'production';31 }32 $('.std,.api,.live,.sandbox,.sandbox_warning, .accelerated_onboarding').parents('.control-group').hide();33 $('.get_sandbox_credentials').hide();34 $('.get_paypal_credentials').hide();35 // $('.authentication').hide();36 $('.authentication').parents('.control-group').hide();37 if (paypalproduct == 'std' && sandboxmode == 'production') {38 $('.std.live').parents('.control-group').show();39 $('.get_paypal_credentials').show();40 $('#params_paypal_merchant_email').addClass("required");41 } else if (paypalproduct == 'std' && sandboxmode == 'sandbox') {42 $('.std.sandbox').parents('.control-group').show();43 $('.get_sandbox_credentials').show();44 $('#params_sandbox_merchant_email').addClass("required");45 } else if (paypalproduct == 'api' && sandboxmode == 'production') {46 $('.api.live').parents('.control-group').show();47 $('.get_paypal_credentials').show();48 $('#params_paypal_merchant_email').removeClass("required");49 } else if (paypalproduct == 'api' && sandboxmode == 'sandbox') {50 $('.api.sandbox').parents('.control-group').show();51 $('.get_sandbox_credentials').show();52 $('#params_sandbox_merchant_email').removeClass("required");53 } else if (paypalproduct == 'exp' && sandboxmode == 'production') {54 $('.api.live').parents('.control-group').show();55 $('.exp.live').parents('.control-group').show();56 $('.accelerated_onboarding').parents('.control-group').show();57 $('.get_paypal_credentials').show();58 $('#params_paypal_merchant_email').removeClass("required");59 //$('.authentication.live.certificate').parents('.control-group').show();60 } else if (paypalproduct == 'exp' && sandboxmode == 'sandbox') {61 $('.api.sandbox').parents('.control-group').show();62 $('.exp.sandbox').parents('.control-group').show();63 $('.accelerated_onboarding').parents('.control-group').show();64 $('.get_sandbox_credentials').show();65 $('#params_sandbox_merchant_email').removeClass("required");66 // $('.sandbox.authentication').show();67 } else if (paypalproduct == 'hosted' && sandboxmode == 'production') {68 $('.api.live').parents('.control-group').show();69 $('.hosted.live').parents('.control-group').show();70 $('.get_paypal_credentials').show();71 $('#params_paypal_merchant_email').removeClass("required");72 } else if (paypalproduct == 'hosted' && sandboxmode == 'sandbox') {73 $('.api.sandbox').parents('.control-group').show();74 $('.hosted.sandbox').parents('.control-group').show();75 $('.get_sandbox_credentials').show();76 $('#params_sandbox_merchant_email').removeClass("required");77 }78 if (sandboxmode == 'sandbox') {79 $('.sandbox_warning').parents('.control-group').show();80 }81 }82 handlePaymentType = function () {83 var paypalproduct = $('#params_paypalproduct').val();84 var currentval = $('#params_payment_type').val();85 $('.payment_type').parents('.control-group').hide();86 $('.check_ips').parents('.control-group').hide();87 if (paypalproduct == 'std') {88 $('.payment_type').parents('.control-group').show();89 }90 if (paypalproduct == 'std' || paypalproduct == 'hosted') {91 $('.check_ips').parents('.control-group').show();92 }93 if (paypalproduct == 'exp' || paypalproduct == 'api' || paypalproduct == 'hosted') {94 $('#params_payment_type option[value=_cart]').attr('disabled', '');95 $('#params_payment_type option[value=_oe-gift-certificate]').attr('disabled', '');96 $('#params_payment_type option[value=_donations]').attr('disabled', '');97 $('#params_payment_type option[value=_xclick-auto-billing]').attr('disabled', '');98 if (currentval == '_cart' || currentval == '_oe-gift-certificate' || currentval == '_donations' || currentval == '_xclick-auto-billing') {99 $('#params_payment_type').val('_xclick');100 }101 } else {102 $('#params_payment_type option[value=_cart]').removeAttr('disabled');103 $('#params_payment_type option[value=_oe-gift-certificate]').removeAttr('disabled');104 $('#params_payment_type option[value=_donations]').removeAttr('disabled');105 $('#params_payment_type option[value=_xclick-auto-billing]').removeAttr('disabled');106 }107 $('#params_payment_type').trigger("liszt:updated");108 }109 handleCreditCard = function () {110 var paypalproduct = $('#params_paypalproduct').val();111 $('.creditcard').parents('.control-group').hide();112 $('.cvv_required').parents('.control-group').hide();113 if (paypalproduct == 'api') {114 $('.creditcard').parents('.control-group').show();115 $('.cvv_required').parents('.control-group').show();116 }117 }118 handleRefundOnCancel = function () {119 var paypalproduct = $('#params_paypalproduct').val();120 $('.paypal_vm').parents('.control-group').show();121 if (paypalproduct == 'std') {122 $('.paypal_vm').parents('.control-group').hide();123 }124 }125 handleCapturePayment = function () {126 var paypalproduct = $('#params_paypalproduct').val();127 var payment_action = $('#params_payment_action').val();128 $('.capture').parents('.control-group').hide();129 if (paypalproduct == 'hosted' && payment_action == 'Authorization') {130 $('.capture').parents('.control-group').show();131 }132 }133 handleTemplate = function () {134 var paypalproduct = $('#params_paypalproduct').val();135 $('.paypaltemplate').parents('.control-group').hide();136 if (paypalproduct == 'hosted') {137 $('.paypaltemplate').parents('.control-group').show();138 }139 }140 handleTemplateParams = function () {141 var paypaltemplate = $('#params_template').val();142 var paypalproduct = $('#params_paypalproduct').val();143 $('.hosted.templateA,.hosted.templateB,.hosted.templateC,.hosted.template_warning').parents('.control-group').hide();144 if (paypalproduct == 'hosted' && paypaltemplate == 'templateA') {145 $('.hosted.templateA,.hosted.template_warning').parents('.control-group').show();146 }147 if (paypalproduct == 'hosted' && paypaltemplate == 'templateB') {148 $('.hosted.templateB,.hosted.template_warning').parents('.control-group').show();149 }150 if (paypalproduct == 'hosted' && paypaltemplate == 'templateC') {151 $('.hosted.templateC,.hosted.template_warning').parents('.control-group').show();152 }153 }154 handlePaymentAction = function () {155 var paymenttype = $('#params_payment_type').val();156 //var currentval = $('#params_payment_action').val();157 if (paymenttype == '_xclick-subscriptions' || paymenttype == '_xclick-payment-plan' || paymenttype == '_xclick-auto-billing') {158 $('#params_payment_action').val('Sale');159 $('#params_payment_action').parents('.control-group').hide();160 $('#params_payment_action').trigger("liszt:updated");161 } else {162 $('#params_payment_action').parents('.control-group').show();163 }164 }165 handleLayout = function () {166 var paypalproduct = $('#params_paypalproduct').val();167 $('.paypallayout').parents('.control-group').hide();168 $('.stdlayout').parents('.control-group').hide();169 $('.explayout').parents('.control-group').hide();170 // $('.hosted.paypallayout').parents('.control-group').hide();171 if (paypalproduct == 'std' || paypalproduct == 'exp' || paypalproduct == 'hosted') {172 $('.paypallayout').parents('.control-group').show();173 }174 if (paypalproduct == 'std') {175 $('.stdlayout').parents('.control-group').show();176 }177 if (paypalproduct == 'exp') {178 $('.explayout').parents('.control-group').show();179 }180 }181 handleAuthentication = function () {182 var paypalAuthentication = $('#params_authentication').val();183 var sandbox = $("input[name='params[sandbox]']:checked").val();184 if (sandbox == 1) {185 var sandboxmode = 'sandbox';186 } else {187 var sandboxmode = 'production';188 }189 var paypalproduct = $('#params_paypalproduct').val();190 $('.authentication').parents('.control-group').hide();191 if (paypalproduct != 'std') {192 if (sandboxmode == 'sandbox') {193 $('.authentication.sandbox.select').parents('.control-group').show();194 if (paypalAuthentication == 'certificate') {195 $('.authentication.sandbox.certificate').parents('.control-group').show();196 } else {197 $('.authentication.sandbox.signature').parents('.control-group').show();198 }199 }200 else if (sandboxmode == 'production') {201 // $('.authentication.live.certificate').parents('.control-group').show();202 $('.authentication.live.select').parents('.control-group').show();203 if (paypalAuthentication == 'certificate') {204 $('.authentication.live.certificate').parents('.control-group').show();205 } else {206 $('.authentication.live.signature').parents('.control-group').show();207 }208 }209 }210 }211 handleExpectedMaxAmount = function () {212 var paypalproduct = $('#params_paypalproduct').val();213 $('.expected_maxamount').parents('.control-group').hide();214 if (paypalproduct == 'exp') {215 $('.expected_maxamount').parents('.control-group').show();216 }217 }218 handleWarningAuthorizeStd = function () {219 var paypalproduct = $('#params_paypalproduct').val();220 var payment_action = $('#params_payment_action').val();221 $('.warning_std_authorize').parents('.control-group').hide();222 if (paypalproduct == 'std' && payment_action == 'Authorization') {223 $('.warning_std_authorize').parents('.control-group').show();224 }225 }226 handleWarningHeaderImage = function () {227 var headerimage = $('#paramheaderimg').val();228 $('.warning_headerimg').parents('.control-group').hide();229 if (headerimage != '-1') {230 $('.warning_headerimg').parents('.control-group').show();231 }232 }233 handlePaymentTypeDetails = function () {234 var selectedMode = $('#params_payment_type').val();235 $('.xclick').parents('.control-group').hide();236 $('.cart').parents('.control-group').hide();237 $('.subscribe').parents('.control-group').hide();238 $('.plan').parents('.control-group').hide();239 $('.billing').parents('.control-group').hide();240 var paypalproduct = $('#params_paypalproduct').val();241 if (paypalproduct == 'std') {242 switch (selectedMode) {243 case '_xclick':244 $('.xclick').parents('.control-group').show();245 $('.cart').parents('.control-group').hide();246 $('.subscribe').parents('.control-group').hide();247 $('.plan').parents('.control-group').hide();248 $('.billing').parents('.control-group').hide();249 break;250 case '_cart':251 $('.xclick').parents('.control-group').hide();252 $('.cart').parents('.control-group').show();253 $('.subscribe').parents('.control-group').hide();254 $('.plan').parents('.control-group').hide();255 $('.billing').parents('.control-group').hide();256 break;257 case '_oe-gift-certificate':258 $('.cart').parents('.control-group').hide();259 $('.subscribe').parents('.control-group').hide();260 $('.plan').parents('.control-group').hide();261 $('.billing').parents('.control-group').hide();262 break;263 case '_xclick-subscriptions':264 $('.cart').parents('.control-group').hide();265 $('.subscribe').parents('.control-group').show();266 $('.plan').parents('.control-group').hide();267 $('#params_subcription_trials').trigger('change');268 $('.billing').parents('.control-group').hide();269 handleSubscriptionTrials();270 break;271 case '_xclick-auto-billing':272 $('.cart').parents('.control-group').hide();273 $('.subscribe').parents('.control-group').hide();274 $('.plan').parents('.control-group').hide();275 $('.billing').parents('.control-group').show();276 handleMaxAmountType();277 break;278 case '_xclick-payment-plan':279 $('.cart').parents('.control-group').hide();280 $('.subscribe').parents('.control-group').hide();281 $('.plan').parents('.control-group').show();282 $('.billing').parents('.control-group').hide();283 handlePaymentPlanDefer();284 break;285 case '_donations':286 $('.cart').parents('.control-group').hide();287 $('.subscribe').parents('.control-group').hide();288 $('.plan').parents('.control-group').hide();289 $('.billing').parents('.control-group').hide();290 break;291 }292 }293 }294 handleSubscriptionTrials = function () {295 var nbTrials = $('#params_subcription_trials').val();296 switch (nbTrials) {297 case '0':298 $('.trial1').parents('.control-group').hide();299 //$('.trial2').parents('.control-group').hide();300 break;301 case '1':302 $('.trial1').parents('.control-group').show();303 //$('.trial2').parents('.control-group').hide();304 break;305 //case '2':306 // $('.trial1').parents('.control-group').show();307 // $('.trial2').parents('.control-group').show();308 // break;309 }310 }311 handlePaymentPlanDefer = function () {312 var doDefer = $('#params_payment_plan_defer').val();313 var paypalproduct = $('#params_paypalproduct').val();314 $('.defer').parents('.control-group').hide();315 if (doDefer == 1) {316 if (paypalproduct == 'std') {317 $('.defer_std').parents('.control-group').show();318 } else {319 $('.defer_api').parents('.control-group').show();320 }321 }322 }323 handleMaxAmountType = function () {324 var max_amount_type = $('#params_billing_max_amount_type').val();325 switch (max_amount_type) {326 case 'cart':327 case 'cust':328 $('.billing_max_amount').parents('.control-group').hide();329 break;330 case 'value':331 case 'perc':332 $('.billing_max_amount').parents('.control-group').show();333 break;334 }335 }336 handlePaymentFeesWarning = function () {337 var paypalproduct = $('#params_paypalproduct').val();338 var selectedMode = $('#params_payment_type').val();339 if ((paypalproduct == 'api' || paypalproduct == 'exp') && (selectedMode == '_xclick-subscriptions' || selectedMode == '_xclick-payment-plan')) {340 $('.warning_transaction_cost').parents('.control-group').show();341 } else {342 $('.warning_transaction_cost').parents('.control-group').hide();343 }344 }345 handleProductPricesApi = function () {346 var paypalproduct = $('#params_paypalproduct').val();347 var add_prices_api = $('#params_add_prices_api').val();348 if (paypalproduct == 'api' || paypalproduct == 'exp') {349 $('.add_prices_api').parents('.control-group').show();350 } else {351 $('.add_prices_api').parents('.control-group').hide();352 }353 }354 /**********/355 /* Events */356 /**********/357 $("input[name='params[sandbox]']").change(function () {358 handleCredentials();359 handleAuthentication();360 });361 $('#params_paypalproduct').change(function () {362 handleCredentials();363 handleAuthentication();364 handleExpectedMaxAmount();365 handleTemplateParams();...

Full Screen

Full Screen

cmsmasters-theme-settings-toggle.js

Source:cmsmasters-theme-settings-toggle.js Github

copy

Full Screen

...11 "use strict";12 13 /* General 'General' Tab Fields Load */14 if ($('input[id^="' + cmsmasters_settings.shortname + '_logo_type"]:checked').val() === 'image') {15 $('#' + cmsmasters_settings.shortname + '_logo_title').parents('tr').hide();16 $('#' + cmsmasters_settings.shortname + '_logo_subtitle').parents('tr').hide();17 $('#' + cmsmasters_settings.shortname + '_logo_custom_color').parents('tr').hide();18 $('#' + cmsmasters_settings.shortname + '_logo_title_color').parents('tr').hide();19 $('#' + cmsmasters_settings.shortname + '_logo_subtitle_color').parents('tr').hide();20 } else if ($('input[id^="' + cmsmasters_settings.shortname + '_logo_type"]:checked').val() === 'text') {21 $('#' + cmsmasters_settings.shortname + '_logo_url').parents('tr').hide();22 $('#' + cmsmasters_settings.shortname + '_logo_url_retina').parents('tr').hide();23 24 if ($('#' + cmsmasters_settings.shortname + '_logo_custom_color').is(':not(:checked)')) {25 $('#' + cmsmasters_settings.shortname + '_logo_title_color').parents('tr').hide();26 $('#' + cmsmasters_settings.shortname + '_logo_subtitle_color').parents('tr').hide();27 }28 }29 30 /* General 'General' Tab 'Logo Type' Field Change */31 $('input[id^="' + cmsmasters_settings.shortname + '_logo_type"]').on('change', function () { 32 if ($(this).is(':checked') && $(this).val() === 'image') {33 $('#' + cmsmasters_settings.shortname + '_logo_url').parents('tr').show();34 $('#' + cmsmasters_settings.shortname + '_logo_url_retina').parents('tr').show();35 36 $('#' + cmsmasters_settings.shortname + '_logo_title').parents('tr').hide();37 $('#' + cmsmasters_settings.shortname + '_logo_subtitle').parents('tr').hide();38 $('#' + cmsmasters_settings.shortname + '_logo_custom_color').parents('tr').hide();39 $('#' + cmsmasters_settings.shortname + '_logo_title_color').parents('tr').hide();40 $('#' + cmsmasters_settings.shortname + '_logo_subtitle_color').parents('tr').hide();41 } else if ($(this).is(':checked') && $(this).val() === 'text') {42 $('#' + cmsmasters_settings.shortname + '_logo_title').parents('tr').show();43 $('#' + cmsmasters_settings.shortname + '_logo_subtitle').parents('tr').show();44 $('#' + cmsmasters_settings.shortname + '_logo_custom_color').parents('tr').show();45 46 if ($('#' + cmsmasters_settings.shortname + '_logo_custom_color').is(':checked')) {47 $('#' + cmsmasters_settings.shortname + '_logo_title_color').parents('tr').show();48 $('#' + cmsmasters_settings.shortname + '_logo_subtitle_color').parents('tr').show();49 }50 51 $('#' + cmsmasters_settings.shortname + '_logo_url').parents('tr').hide();52 $('#' + cmsmasters_settings.shortname + '_logo_url_retina').parents('tr').hide();53 }54 } );55 56 /* General 'General' Tab 'Custom Text Colors' Field Change */57 $('#' + cmsmasters_settings.shortname + '_logo_custom_color').on('change', function () { 58 if ($(this).is(':checked')) {59 $('#' + cmsmasters_settings.shortname + '_logo_title_color').parents('tr').show();60 $('#' + cmsmasters_settings.shortname + '_logo_subtitle_color').parents('tr').show();61 } else {62 $('#' + cmsmasters_settings.shortname + '_logo_title_color').parents('tr').hide();63 $('#' + cmsmasters_settings.shortname + '_logo_subtitle_color').parents('tr').hide();64 }65 } );66 67 68 69 /* General 'Background' Tab Fields Load */70 if ($('#' + cmsmasters_settings.shortname + '_bg_img_enable').is(':not(:checked)')) {71 $('#' + cmsmasters_settings.shortname + '_bg_img').parents('tr').hide();72 $('label[for="' + cmsmasters_settings.shortname + '_bg_rep"]').parents('tr').hide();73 $('label[for="' + cmsmasters_settings.shortname + '_bg_pos"]').parents('tr').hide();74 $('label[for="' + cmsmasters_settings.shortname + '_bg_att"]').parents('tr').hide();75 $('label[for="' + cmsmasters_settings.shortname + '_bg_size"]').parents('tr').hide();76 }77 78 /* General 'Background' Tab Fields Change */79 $('#' + cmsmasters_settings.shortname + '_bg_img_enable').on('change', function () { 80 if ($('#' + cmsmasters_settings.shortname + '_bg_img_enable').is(':checked')) {81 $('#' + cmsmasters_settings.shortname + '_bg_img').parents('tr').show();82 $('label[for="' + cmsmasters_settings.shortname + '_bg_rep"]').parents('tr').show();83 $('label[for="' + cmsmasters_settings.shortname + '_bg_pos"]').parents('tr').show();84 $('label[for="' + cmsmasters_settings.shortname + '_bg_att"]').parents('tr').show();85 $('label[for="' + cmsmasters_settings.shortname + '_bg_size"]').parents('tr').show();86 } else {87 $('#' + cmsmasters_settings.shortname + '_bg_img').parents('tr').hide();88 $('label[for="' + cmsmasters_settings.shortname + '_bg_rep"]').parents('tr').hide();89 $('label[for="' + cmsmasters_settings.shortname + '_bg_pos"]').parents('tr').hide();90 $('label[for="' + cmsmasters_settings.shortname + '_bg_att"]').parents('tr').hide();91 $('label[for="' + cmsmasters_settings.shortname + '_bg_size"]').parents('tr').hide();92 }93 } );94 95 96 97 /* General 'Header' Tab Fields Load */98 if ($('#' + cmsmasters_settings.shortname + '_header_top_line').is(':not(:checked)')) {99 $('#' + cmsmasters_settings.shortname + '_header_top_scheme').parents('tr').hide();100 $('#' + cmsmasters_settings.shortname + '_header_top_height').parents('tr').hide();101 $('#' + cmsmasters_settings.shortname + '_header_top_line_short_info').parents('tr').hide();102 $('input[name*="' + cmsmasters_settings.shortname + '_header_top_line_add_cont"]').parents('tr').hide();103 }104 105 106 if ($('input[name*="' + cmsmasters_settings.shortname + '_header_styles"]:checked').val() === 'default') {107 $('#' + cmsmasters_settings.shortname + '_header_bot_height').parents('tr').hide();108 $('input[name*="' + cmsmasters_settings.shortname + '_header_add_cont"]').parents('tr').hide();109 $('#' + cmsmasters_settings.shortname + '_header_add_cont_cust_html').parents('tr').hide();110 }111 112 if ($('input[name*="' + cmsmasters_settings.shortname + '_header_styles"]:checked').val() === 'c_nav') {113 $('#' + cmsmasters_settings.shortname + '_header_search').parents('tr').hide();114 $('input[name*="' + cmsmasters_settings.shortname + '_header_add_cont"]').parents('tr').hide();115 $('#' + cmsmasters_settings.shortname + '_header_add_cont_cust_html').parents('tr').hide();116 }117 118 if ($('input[name*="' + cmsmasters_settings.shortname + '_header_add_cont"]:checked').val() !== 'cust_html') {119 $('#' + cmsmasters_settings.shortname + '_header_add_cont_cust_html').parents('tr').hide();120 }121 122 123 /* General 'Header' Tab Fields Change */124 $('#' + cmsmasters_settings.shortname + '_header_top_line').on('change', function () { 125 if ($('#' + cmsmasters_settings.shortname + '_header_top_line').is(':checked')) {126 $('#' + cmsmasters_settings.shortname + '_header_top_scheme').parents('tr').show();127 $('#' + cmsmasters_settings.shortname + '_header_top_height').parents('tr').show();128 $('#' + cmsmasters_settings.shortname + '_header_top_line_short_info').parents('tr').show();129 $('input[name*="' + cmsmasters_settings.shortname + '_header_top_line_add_cont"]').parents('tr').show();130 } else {131 $('#' + cmsmasters_settings.shortname + '_header_top_scheme').parents('tr').hide();132 $('#' + cmsmasters_settings.shortname + '_header_top_height').parents('tr').hide();133 $('#' + cmsmasters_settings.shortname + '_header_top_line_short_info').parents('tr').hide();134 $('input[name*="' + cmsmasters_settings.shortname + '_header_top_line_add_cont"]').parents('tr').hide();135 }136 } );137 138 139 $('input[name*="' + cmsmasters_settings.shortname + '_header_styles"]').on('change', function () { 140 if ($('input[name*="' + cmsmasters_settings.shortname + '_header_styles"]:checked').val() === 'default') {141 $('#' + cmsmasters_settings.shortname + '_header_bot_height').parents('tr').hide();142 $('#' + cmsmasters_settings.shortname + '_header_search').parents('tr').show();143 $('input[name*="' + cmsmasters_settings.shortname + '_header_add_cont"]').parents('tr').hide();144 $('#' + cmsmasters_settings.shortname + '_header_add_cont_cust_html').parents('tr').hide();145 } else if ($('input[name*="' + cmsmasters_settings.shortname + '_header_styles"]:checked').val() === 'c_nav') {146 $('#' + cmsmasters_settings.shortname + '_header_bot_height').parents('tr').show();147 $('#' + cmsmasters_settings.shortname + '_header_search').parents('tr').hide();148 $('input[name*="' + cmsmasters_settings.shortname + '_header_add_cont"]').parents('tr').hide();149 $('#' + cmsmasters_settings.shortname + '_header_add_cont_cust_html').parents('tr').hide();150 } else {151 $('#' + cmsmasters_settings.shortname + '_header_bot_height').parents('tr').show();152 $('#' + cmsmasters_settings.shortname + '_header_search').parents('tr').show();153 $('input[name*="' + cmsmasters_settings.shortname + '_header_add_cont"]').parents('tr').show();154 155 if ($('input[name*="' + cmsmasters_settings.shortname + '_header_add_cont"]:checked').val() === 'cust_html') {156 $('#' + cmsmasters_settings.shortname + '_header_add_cont_cust_html').parents('tr').show();157 }158 }159 } );160 161 $('input[name*="' + cmsmasters_settings.shortname + '_header_add_cont"]').on('change', function () { 162 if ($('input[name*="' + cmsmasters_settings.shortname + '_header_add_cont"]:checked').val() === 'cust_html') {163 $('#' + cmsmasters_settings.shortname + '_header_add_cont_cust_html').parents('tr').show();164 } else {165 $('#' + cmsmasters_settings.shortname + '_header_add_cont_cust_html').parents('tr').hide();166 }167 } );168 169 170 171 /* General 'Content' Tab Fields Load */172 if ($('#' + cmsmasters_settings.shortname + '_heading_bg_image_enable').is(':not(:checked)')) {173 $('#' + cmsmasters_settings.shortname + '_heading_bg_image').parents('tr').hide();174 $('label[for="' + cmsmasters_settings.shortname + '_heading_bg_repeat"]').parents('tr').hide();175 $('label[for="' + cmsmasters_settings.shortname + '_heading_bg_attachment"]').parents('tr').hide();176 $('label[for="' + cmsmasters_settings.shortname + '_heading_bg_size"]').parents('tr').hide();177 }178 179 /* General 'Content' Tab Fields Change */180 $('#' + cmsmasters_settings.shortname + '_heading_bg_image_enable').on('change', function () { 181 if ($('#' + cmsmasters_settings.shortname + '_heading_bg_image_enable').is(':checked')) {182 $('#' + cmsmasters_settings.shortname + '_heading_bg_image').parents('tr').show();183 $('label[for="' + cmsmasters_settings.shortname + '_heading_bg_repeat"]').parents('tr').show();184 $('label[for="' + cmsmasters_settings.shortname + '_heading_bg_attachment"]').parents('tr').show();185 $('label[for="' + cmsmasters_settings.shortname + '_heading_bg_size"]').parents('tr').show();186 } else {187 $('#' + cmsmasters_settings.shortname + '_heading_bg_image').parents('tr').hide();188 $('label[for="' + cmsmasters_settings.shortname + '_heading_bg_repeat"]').parents('tr').hide();189 $('label[for="' + cmsmasters_settings.shortname + '_heading_bg_attachment"]').parents('tr').hide();190 $('label[for="' + cmsmasters_settings.shortname + '_heading_bg_size"]').parents('tr').hide();191 }192 } );193 194 195 196 /* General 'Footer' Tab Fields Load */197 if ($('input[name*="' + cmsmasters_settings.shortname + '_footer_type"]:checked').val() !== 'small') {198 $('input[name*="' + cmsmasters_settings.shortname + '_footer_additional_content"]').parents('tr').hide();199 $('#' + cmsmasters_settings.shortname + '_footer_html').parents('tr').show();200 $('#' + cmsmasters_settings.shortname + '_footer_logo').parents('tr').show();201 202 203 if ($('#' + cmsmasters_settings.shortname + '_footer_logo').is(':not(:checked)')) {204 $('#' + cmsmasters_settings.shortname + '_footer_logo_url').parents('tr').hide();205 $('#' + cmsmasters_settings.shortname + '_footer_logo_url_retina').parents('tr').hide();206 }207 } else {208 $('input[name*="' + cmsmasters_settings.shortname + '_footer_additional_content"]').parents('tr').show();209 210 $('#' + cmsmasters_settings.shortname + '_footer_logo').parents('tr').hide();211 $('#' + cmsmasters_settings.shortname + '_footer_logo_url').parents('tr').hide();212 $('#' + cmsmasters_settings.shortname + '_footer_logo_url_retina').parents('tr').hide();213 $('#' + cmsmasters_settings.shortname + '_footer_nav').parents('tr').hide();214 $('#' + cmsmasters_settings.shortname + '_footer_social').parents('tr').hide();215 216 if ($('input[name*="' + cmsmasters_settings.shortname + '_footer_additional_content"]:checked').val() !== 'text') {217 $('#' + cmsmasters_settings.shortname + '_footer_html').parents('tr').hide();218 }219 }220 221 222 /* General 'Footer' Tab Fields Change */223 $('input[name*="' + cmsmasters_settings.shortname + '_footer_type"]').on('change', function () { 224 if ($('input[name*="' + cmsmasters_settings.shortname + '_footer_type"]:checked').val() === 'small') {225 $('input[name*="' + cmsmasters_settings.shortname + '_footer_additional_content"]').parents('tr').show();226 227 $('#' + cmsmasters_settings.shortname + '_footer_logo').parents('tr').hide();228 $('#' + cmsmasters_settings.shortname + '_footer_logo_url').parents('tr').hide();229 $('#' + cmsmasters_settings.shortname + '_footer_logo_url_retina').parents('tr').hide();230 $('#' + cmsmasters_settings.shortname + '_footer_nav').parents('tr').hide();231 $('#' + cmsmasters_settings.shortname + '_footer_social').parents('tr').hide();232 233 234 if ($('input[name*="' + cmsmasters_settings.shortname + '_footer_additional_content"]:checked').val() === 'text') {235 $('#' + cmsmasters_settings.shortname + '_footer_html').parents('tr').show();236 } else {237 $('#' + cmsmasters_settings.shortname + '_footer_html').parents('tr').hide();238 }239 } else {240 $('input[name*="' + cmsmasters_settings.shortname + '_footer_additional_content"]').parents('tr').hide();241 242 $('#' + cmsmasters_settings.shortname + '_footer_logo').parents('tr').show();243 $('#' + cmsmasters_settings.shortname + '_footer_logo_url').parents('tr').show();244 $('#' + cmsmasters_settings.shortname + '_footer_logo_url_retina').parents('tr').show();245 $('#' + cmsmasters_settings.shortname + '_footer_nav').parents('tr').show();246 $('#' + cmsmasters_settings.shortname + '_footer_social').parents('tr').show();247 $('#' + cmsmasters_settings.shortname + '_footer_html').parents('tr').show();248 249 250 if ($('#' + cmsmasters_settings.shortname + '_footer_logo').is(':not(:checked)')) {251 $('#' + cmsmasters_settings.shortname + '_footer_logo_url').parents('tr').hide();252 $('#' + cmsmasters_settings.shortname + '_footer_logo_url_retina').parents('tr').hide();253 }254 }255 } );256 257 258 /* General 'Footer' Tab 'Footer Logo' Field Change */259 $('#' + cmsmasters_settings.shortname + '_footer_logo').on('change', function () { 260 if ($(this).is(':checked')) {261 $('#' + cmsmasters_settings.shortname + '_footer_logo_url').parents('tr').show();262 $('#' + cmsmasters_settings.shortname + '_footer_logo_url_retina').parents('tr').show();263 } else if ($(this).is(':not(:checked)')) {264 $('#' + cmsmasters_settings.shortname + '_footer_logo_url').parents('tr').hide();265 $('#' + cmsmasters_settings.shortname + '_footer_logo_url_retina').parents('tr').hide();266 }267 } );268 269 270 /* General 'Footer' Tab 'Additional Content' Change */271 $('input[name*="' + cmsmasters_settings.shortname + '_footer_additional_content"]').on('change', function () { 272 if ($('input[name*="' + cmsmasters_settings.shortname + '_footer_type"]:checked').val() === 'small') {273 if ($('input[name*="' + cmsmasters_settings.shortname + '_footer_additional_content"]:checked').val() === 'text') {274 $('#' + cmsmasters_settings.shortname + '_footer_html').parents('tr').show();275 } else {276 $('#' + cmsmasters_settings.shortname + '_footer_html').parents('tr').hide();277 }278 }279 } );280 281 282 283 /* Elements '404' Tab Fields Load */284 if ($('#' + cmsmasters_settings.shortname + '_error_sitemap_button').is(':not(:checked)')) {285 $('#' + cmsmasters_settings.shortname + '_error_sitemap_link').parents('tr').hide();286 }287 288 if ($('#' + cmsmasters_settings.shortname + '_error_bg_img_enable').is(':not(:checked)')) {289 $('#' + cmsmasters_settings.shortname + '_error_bg_image').parents('tr').hide();290 $('label[for="' + cmsmasters_settings.shortname + '_error_bg_rep"]').parents('tr').hide();291 $('label[for="' + cmsmasters_settings.shortname + '_error_bg_pos"]').parents('tr').hide();292 $('label[for="' + cmsmasters_settings.shortname + '_error_bg_att"]').parents('tr').hide();293 $('label[for="' + cmsmasters_settings.shortname + '_error_bg_size"]').parents('tr').hide();294 }295 296 /* Elements '404' Tab Fields Change */297 $('#' + cmsmasters_settings.shortname + '_error_sitemap_button').on('change', function () { 298 if ($(this).is(':checked')) {299 $('#' + cmsmasters_settings.shortname + '_error_sitemap_link').parents('tr').show();300 } else {301 $('#' + cmsmasters_settings.shortname + '_error_sitemap_link').parents('tr').hide();302 }303 } );304 305 $('#' + cmsmasters_settings.shortname + '_error_bg_img_enable').on('change', function () { 306 if ($('#' + cmsmasters_settings.shortname + '_error_bg_img_enable').is(':checked')) {307 $('#' + cmsmasters_settings.shortname + '_error_bg_image').parents('tr').show();308 $('label[for="' + cmsmasters_settings.shortname + '_error_bg_rep"]').parents('tr').show();309 $('label[for="' + cmsmasters_settings.shortname + '_error_bg_pos"]').parents('tr').show();310 $('label[for="' + cmsmasters_settings.shortname + '_error_bg_att"]').parents('tr').show();311 $('label[for="' + cmsmasters_settings.shortname + '_error_bg_size"]').parents('tr').show();312 } else {313 $('#' + cmsmasters_settings.shortname + '_error_bg_image').parents('tr').hide();314 $('label[for="' + cmsmasters_settings.shortname + '_error_bg_rep"]').parents('tr').hide();315 $('label[for="' + cmsmasters_settings.shortname + '_error_bg_pos"]').parents('tr').hide();316 $('label[for="' + cmsmasters_settings.shortname + '_error_bg_att"]').parents('tr').hide();317 $('label[for="' + cmsmasters_settings.shortname + '_error_bg_size"]').parents('tr').hide();318 }319 } );320 321 322 323 /* Single Posts 'Project' Tab Fields Load */324 if ($('#' + cmsmasters_settings.shortname + '_portfolio_project_link').is(':not(:checked)')) {325 $('#' + cmsmasters_settings.shortname + '_portfolio_project_link_text').parents('tr').hide();326 }327 328 /* Single Posts 'Project' Tab 'Project Link' Field Change */329 $('#' + cmsmasters_settings.shortname + '_portfolio_project_link').on('change', function () { 330 if ($(this).is(':checked')) {331 $('#' + cmsmasters_settings.shortname + '_portfolio_project_link_text').parents('tr').show();332 } else {333 $('#' + cmsmasters_settings.shortname + '_portfolio_project_link_text').parents('tr').hide();334 }335 } );...

Full Screen

Full Screen

cmsms-theme-settings-toggle.js

Source:cmsms-theme-settings-toggle.js Github

copy

Full Screen

...9 */10(function ($) { 11 /* General 'General' Tab Fields Load */12 if ($('#' + cmsms_settings.shortname + '_preload').is(':not(:checked)')) {13 $('#' + cmsms_settings.shortname + '_preload_bg').parents('tr').hide();14 $('#' + cmsms_settings.shortname + '_preload_color').parents('tr').hide();15 $('#' + cmsms_settings.shortname + '_preload_effect').parents('tr').hide();16 $('#' + cmsms_settings.shortname + '_preload_percentage').parents('tr').hide();17 }18 19 if ($('#' + cmsms_settings.shortname + '_preload_effect').val() !== 'grow' && $('#' + cmsms_settings.shortname + '_preload_effect').val() !== 'fade') {20 $('#' + cmsms_settings.shortname + '_preload_percentage').parents('tr').hide();21 }22 23 /* General 'General' Tab Fields Change */24 $('#' + cmsms_settings.shortname + '_preload').bind('change', function () { 25 if ($(this).is(':checked')) {26 $('#' + cmsms_settings.shortname + '_preload_bg').parents('tr').show();27 $('#' + cmsms_settings.shortname + '_preload_color').parents('tr').show();28 $('#' + cmsms_settings.shortname + '_preload_effect').parents('tr').show();29 30 if ($('#' + cmsms_settings.shortname + '_preload_effect').val() === 'grow' || $('#' + cmsms_settings.shortname + '_preload_effect').val() === 'fade') {31 $('#' + cmsms_settings.shortname + '_preload_percentage').parents('tr').show();32 }33 } else {34 $('#' + cmsms_settings.shortname + '_preload_bg').parents('tr').hide();35 $('#' + cmsms_settings.shortname + '_preload_color').parents('tr').hide();36 $('#' + cmsms_settings.shortname + '_preload_effect').parents('tr').hide();37 $('#' + cmsms_settings.shortname + '_preload_percentage').parents('tr').hide();38 }39 } );40 41 $('#' + cmsms_settings.shortname + '_preload_effect').bind('change', function () { 42 if ($(this).val() === 'grow' || $(this).val() === 'fade') {43 $('#' + cmsms_settings.shortname + '_preload_percentage').parents('tr').show();44 } else {45 $('#' + cmsms_settings.shortname + '_preload_percentage').parents('tr').hide();46 }47 } );48 49 50 51 /* General '404' Tab Fields Load */52 if ($('#' + cmsms_settings.shortname + '_error_sitemap_button').is(':not(:checked)')) {53 $('#' + cmsms_settings.shortname + '_error_sitemap_link').parents('tr').hide();54 }55 56 /* General '404' Tab Fields Change */57 $('#' + cmsms_settings.shortname + '_error_sitemap_button').bind('change', function () { 58 if ($(this).is(':checked')) {59 $('#' + cmsms_settings.shortname + '_error_sitemap_link').parents('tr').show();60 } else {61 $('#' + cmsms_settings.shortname + '_error_sitemap_link').parents('tr').hide();62 }63 } );64 65 66 67 /* Appearance 'Logo' Tab Fields Load */68 if ($('input[id^="' + cmsms_settings.shortname + '_logo_type"]:checked').val() === 'image') {69 $('#' + cmsms_settings.shortname + '_logo_title').parents('tr').hide();70 $('#' + cmsms_settings.shortname + '_logo_subtitle').parents('tr').hide();71 $('#' + cmsms_settings.shortname + '_logo_custom_color').parents('tr').hide();72 $('#' + cmsms_settings.shortname + '_logo_title_color').parents('tr').hide();73 $('#' + cmsms_settings.shortname + '_logo_subtitle_color').parents('tr').hide();74 } else if ($('input[id^="' + cmsms_settings.shortname + '_logo_type"]:checked').val() === 'text') {75 $('#' + cmsms_settings.shortname + '_logo_url').parents('tr').hide();76 $('#' + cmsms_settings.shortname + '_logo_url_retina').parents('tr').hide();77 $('#' + cmsms_settings.shortname + '_logo_resp_url').parents('tr').hide();78 $('#' + cmsms_settings.shortname + '_logo_resp_url_retina').parents('tr').hide();79 80 if ($('#' + cmsms_settings.shortname + '_logo_custom_color').is(':not(:checked)')) {81 $('#' + cmsms_settings.shortname + '_logo_title_color').parents('tr').hide();82 $('#' + cmsms_settings.shortname + '_logo_subtitle_color').parents('tr').hide();83 }84 }85 86 /* Appearance 'Logo' Tab 'Logo Type' Field Change */87 $('input[id^="' + cmsms_settings.shortname + '_logo_type"]').bind('change', function () { 88 if ($(this).is(':checked') && $(this).val() === 'image') {89 $('#' + cmsms_settings.shortname + '_logo_url').parents('tr').show();90 $('#' + cmsms_settings.shortname + '_logo_url_retina').parents('tr').show();91 $('#' + cmsms_settings.shortname + '_logo_resp_url').parents('tr').show();92 $('#' + cmsms_settings.shortname + '_logo_resp_url_retina').parents('tr').show();93 94 $('#' + cmsms_settings.shortname + '_logo_title').parents('tr').hide();95 $('#' + cmsms_settings.shortname + '_logo_subtitle').parents('tr').hide();96 $('#' + cmsms_settings.shortname + '_logo_custom_color').parents('tr').hide();97 $('#' + cmsms_settings.shortname + '_logo_title_color').parents('tr').hide();98 $('#' + cmsms_settings.shortname + '_logo_subtitle_color').parents('tr').hide();99 } else if ($(this).is(':checked') && $(this).val() === 'text') {100 $('#' + cmsms_settings.shortname + '_logo_title').parents('tr').show();101 $('#' + cmsms_settings.shortname + '_logo_subtitle').parents('tr').show();102 $('#' + cmsms_settings.shortname + '_logo_custom_color').parents('tr').show();103 104 if ($('#' + cmsms_settings.shortname + '_logo_custom_color').is(':checked')) {105 $('#' + cmsms_settings.shortname + '_logo_title_color').parents('tr').show();106 $('#' + cmsms_settings.shortname + '_logo_subtitle_color').parents('tr').show();107 }108 109 $('#' + cmsms_settings.shortname + '_logo_url').parents('tr').hide();110 $('#' + cmsms_settings.shortname + '_logo_url_retina').parents('tr').hide();111 $('#' + cmsms_settings.shortname + '_logo_resp_url').parents('tr').hide();112 $('#' + cmsms_settings.shortname + '_logo_resp_url_retina').parents('tr').hide();113 }114 } );115 116 /* Appearance 'Logo' Tab 'Custom Text Colors' Field Change */117 $('#' + cmsms_settings.shortname + '_logo_custom_color').bind('change', function () { 118 if ($(this).is(':checked')) {119 $('#' + cmsms_settings.shortname + '_logo_title_color').parents('tr').show();120 $('#' + cmsms_settings.shortname + '_logo_subtitle_color').parents('tr').show();121 } else {122 $('#' + cmsms_settings.shortname + '_logo_title_color').parents('tr').hide();123 $('#' + cmsms_settings.shortname + '_logo_subtitle_color').parents('tr').hide();124 }125 } );126 127 /* Appearance 'Favicon' Tab Fields Load */128 if ($('#' + cmsms_settings.shortname + '_favicon').is(':not(:checked)')) {129 $('#' + cmsms_settings.shortname + '_favicon_url').parents('tr').hide();130 }131 132 /* Appearance 'Favicon' Tab Fields Change */133 $('#' + cmsms_settings.shortname + '_favicon').bind('change', function () { 134 if ($(this).is(':checked')) {135 $('#' + cmsms_settings.shortname + '_favicon_url').parents('tr').show();136 } else {137 $('#' + cmsms_settings.shortname + '_favicon_url').parents('tr').hide();138 }139 } );140 141 142 143 /* Appearance 'Background' Tab Fields Load */144 if ($('#' + cmsms_settings.shortname + '_bg_img_enable').is(':not(:checked)')) {145 $('#' + cmsms_settings.shortname + '_bg_img').parents('tr').hide();146 $('label[for="' + cmsms_settings.shortname + '_bg_rep"]').parents('tr').hide();147 $('label[for="' + cmsms_settings.shortname + '_bg_pos"]').parents('tr').hide();148 $('label[for="' + cmsms_settings.shortname + '_bg_att"]').parents('tr').hide();149 $('label[for="' + cmsms_settings.shortname + '_bg_size"]').parents('tr').hide();150 }151 152 /* Appearance 'Background' Tab Fields Change */153 $('#' + cmsms_settings.shortname + '_bg_img_enable').bind('change', function () { 154 if ($('#' + cmsms_settings.shortname + '_bg_img_enable').is(':checked')) {155 $('#' + cmsms_settings.shortname + '_bg_img').parents('tr').show();156 $('label[for="' + cmsms_settings.shortname + '_bg_rep"]').parents('tr').show();157 $('label[for="' + cmsms_settings.shortname + '_bg_pos"]').parents('tr').show();158 $('label[for="' + cmsms_settings.shortname + '_bg_att"]').parents('tr').show();159 $('label[for="' + cmsms_settings.shortname + '_bg_size"]').parents('tr').show();160 } else {161 $('#' + cmsms_settings.shortname + '_bg_img').parents('tr').hide();162 $('label[for="' + cmsms_settings.shortname + '_bg_rep"]').parents('tr').hide();163 $('label[for="' + cmsms_settings.shortname + '_bg_pos"]').parents('tr').hide();164 $('label[for="' + cmsms_settings.shortname + '_bg_att"]').parents('tr').hide();165 $('label[for="' + cmsms_settings.shortname + '_bg_size"]').parents('tr').hide();166 }167 } );168 169 170 171 /* Appearance 'Header' Tab Fields Load */172 if ($('#' + cmsms_settings.shortname + '_header_top_line').is(':not(:checked)')) {173 $('#' + cmsms_settings.shortname + '_header_top_scheme').parents('tr').hide();174 $('#' + cmsms_settings.shortname + '_header_top_height').parents('tr').hide();175 $('#' + cmsms_settings.shortname + '_header_top_line_short_info').parents('tr').hide();176 $('input[name*="' + cmsms_settings.shortname + '_header_top_line_add_cont"]').parents('tr').hide();177 }178 179 180 /* Appearance 'Header' Tab Fields Change */181 $('#' + cmsms_settings.shortname + '_header_top_line').bind('change', function () { 182 if ($('#' + cmsms_settings.shortname + '_header_top_line').is(':checked')) {183 $('#' + cmsms_settings.shortname + '_header_top_scheme').parents('tr').show();184 $('#' + cmsms_settings.shortname + '_header_top_height').parents('tr').show();185 $('#' + cmsms_settings.shortname + '_header_top_line_short_info').parents('tr').show();186 $('input[name*="' + cmsms_settings.shortname + '_header_top_line_add_cont"]').parents('tr').show();187 } else {188 $('#' + cmsms_settings.shortname + '_header_top_scheme').parents('tr').hide();189 $('#' + cmsms_settings.shortname + '_header_top_height').parents('tr').hide();190 $('#' + cmsms_settings.shortname + '_header_top_line_short_info').parents('tr').hide();191 $('input[name*="' + cmsms_settings.shortname + '_header_top_line_add_cont"]').parents('tr').hide();192 }193 } );194 195 196 /* Appearance 'Content' Tab Fields Load */197 if ($('#' + cmsms_settings.shortname + '_heading_bg_image_enable').is(':not(:checked)')) {198 $('#' + cmsms_settings.shortname + '_heading_bg_image').parents('tr').hide();199 $('label[for="' + cmsms_settings.shortname + '_heading_bg_repeat"]').parents('tr').hide();200 $('label[for="' + cmsms_settings.shortname + '_heading_bg_attachment"]').parents('tr').hide();201 $('label[for="' + cmsms_settings.shortname + '_heading_bg_size"]').parents('tr').hide();202 }203 204 /* Appearance 'Content' Tab Fields Change */205 $('#' + cmsms_settings.shortname + '_heading_bg_image_enable').bind('change', function () { 206 if ($('#' + cmsms_settings.shortname + '_heading_bg_image_enable').is(':checked')) {207 $('#' + cmsms_settings.shortname + '_heading_bg_image').parents('tr').show();208 $('label[for="' + cmsms_settings.shortname + '_heading_bg_repeat"]').parents('tr').show();209 $('label[for="' + cmsms_settings.shortname + '_heading_bg_attachment"]').parents('tr').show();210 $('label[for="' + cmsms_settings.shortname + '_heading_bg_size"]').parents('tr').show();211 } else {212 $('#' + cmsms_settings.shortname + '_heading_bg_image').parents('tr').hide();213 $('label[for="' + cmsms_settings.shortname + '_heading_bg_repeat"]').parents('tr').hide();214 $('label[for="' + cmsms_settings.shortname + '_heading_bg_attachment"]').parents('tr').hide();215 $('label[for="' + cmsms_settings.shortname + '_heading_bg_size"]').parents('tr').hide();216 }217 } );218 219 220 221 /* Appearance 'Footer' Tab Fields Load */222 if ($('input[name*="' + cmsms_settings.shortname + '_footer_type"]:checked').val() === 'default') {223 $('input[name*="' + cmsms_settings.shortname + '_footer_additional_content"]').parents('tr').hide();224 $('#' + cmsms_settings.shortname + '_footer_html').parents('tr').show();225 } else {226 $('input[name*="' + cmsms_settings.shortname + '_footer_additional_content"]').parents('tr').show();227 228 $('#' + cmsms_settings.shortname + '_fixed_footer').parents('tr').hide();229 $('#' + cmsms_settings.shortname + '_footer_height').parents('tr').hide();230 $('#' + cmsms_settings.shortname + '_footer_logo').parents('tr').hide();231 $('#' + cmsms_settings.shortname + '_footer_logo_url').parents('tr').hide();232 $('#' + cmsms_settings.shortname + '_footer_logo_url_retina').parents('tr').hide();233 $('#' + cmsms_settings.shortname + '_footer_nav').parents('tr').hide();234 $('#' + cmsms_settings.shortname + '_footer_social').parents('tr').hide();235 }236 237 /* Appearance 'Footer' Tab Fields Change */238 $('input[name*="' + cmsms_settings.shortname + '_footer_type"]').bind('change', function () { 239 if ($('input[name*="' + cmsms_settings.shortname + '_footer_type"]:checked').val() === 'small') {240 $('input[name*="' + cmsms_settings.shortname + '_footer_additional_content"]').parents('tr').show();241 242 $('#' + cmsms_settings.shortname + '_fixed_footer').parents('tr').hide();243 $('#' + cmsms_settings.shortname + '_footer_height').parents('tr').hide();244 $('#' + cmsms_settings.shortname + '_footer_logo').parents('tr').hide();245 $('#' + cmsms_settings.shortname + '_footer_logo_url').parents('tr').hide();246 $('#' + cmsms_settings.shortname + '_footer_logo_url_retina').parents('tr').hide();247 $('#' + cmsms_settings.shortname + '_footer_nav').parents('tr').hide();248 $('#' + cmsms_settings.shortname + '_footer_social').parents('tr').hide();249 250 251 if ($('input[name*="' + cmsms_settings.shortname + '_footer_additional_content"]:checked').val() === 'text') {252 $('#' + cmsms_settings.shortname + '_footer_html').parents('tr').show();253 } else {254 $('#' + cmsms_settings.shortname + '_footer_html').parents('tr').hide();255 }256 } else {257 $('input[name*="' + cmsms_settings.shortname + '_footer_additional_content"]').parents('tr').hide();258 259 $('#' + cmsms_settings.shortname + '_fixed_footer').parents('tr').show();260 $('#' + cmsms_settings.shortname + '_footer_height').parents('tr').show();261 $('#' + cmsms_settings.shortname + '_footer_logo').parents('tr').show();262 $('#' + cmsms_settings.shortname + '_footer_logo_url').parents('tr').show();263 $('#' + cmsms_settings.shortname + '_footer_logo_url_retina').parents('tr').show();264 $('#' + cmsms_settings.shortname + '_footer_nav').parents('tr').show();265 $('#' + cmsms_settings.shortname + '_footer_social').parents('tr').show();266 $('#' + cmsms_settings.shortname + '_footer_html').parents('tr').show();267 }268 } );269 270 271 /* Appearance 'Footer' Tab 'Additional Content' Load */272 if ($('input[name*="' + cmsms_settings.shortname + '_footer_type"]:checked').val() === 'small') {273 if ($('input[name*="' + cmsms_settings.shortname + '_footer_additional_content"]:checked').val() !== 'text') {274 $('#' + cmsms_settings.shortname + '_footer_html').parents('tr').hide();275 } else {276 $('#' + cmsms_settings.shortname + '_footer_html').parents('tr').show();277 }278 }279 280 /* Appearance 'Footer' Tab 'Additional Content' Change */281 $('input[name*="' + cmsms_settings.shortname + '_footer_additional_content"]').bind('change', function () { 282 if ($('input[name*="' + cmsms_settings.shortname + '_footer_type"]:checked').val() === 'small') {283 if ($('input[name*="' + cmsms_settings.shortname + '_footer_additional_content"]:checked').val() === 'text') {284 $('#' + cmsms_settings.shortname + '_footer_html').parents('tr').show();285 } else {286 $('#' + cmsms_settings.shortname + '_footer_html').parents('tr').hide();287 }288 }289 } );290 291 292 /* Appearance 'Footer' Tab 'Footer Logo' Field Load */293 if ($('input[name*="' + cmsms_settings.shortname + '_footer_type"]:checked').val() === 'default') {294 if ($('#' + cmsms_settings.shortname + '_footer_logo').is(':not(:checked)')) {295 $('#' + cmsms_settings.shortname + '_footer_logo_url').parents('tr').hide();296 $('#' + cmsms_settings.shortname + '_footer_logo_url_retina').parents('tr').hide();297 } else {298 $('#' + cmsms_settings.shortname + '_footer_logo_url').parents('tr').show();299 $('#' + cmsms_settings.shortname + '_footer_logo_url_retina').parents('tr').show();300 }301 }302 303 /* Appearance 'Footer' Tab 'Footer Logo' Field Change */304 $('#' + cmsms_settings.shortname + '_footer_logo').bind('change', function () { 305 if ($(this).is(':checked')) {306 $('#' + cmsms_settings.shortname + '_footer_logo_url').parents('tr').show();307 $('#' + cmsms_settings.shortname + '_footer_logo_url_retina').parents('tr').show();308 } else if ($(this).is(':not(:checked)')) {309 $('#' + cmsms_settings.shortname + '_footer_logo_url').parents('tr').hide();310 $('#' + cmsms_settings.shortname + '_footer_logo_url_retina').parents('tr').hide();311 }312 } );313 314 315 /* Single Posts 'Project' Tab Fields Load */316 if ($('#' + cmsms_settings.shortname + '_portfolio_project_link').is(':not(:checked)')) {317 $('#' + cmsms_settings.shortname + '_portfolio_project_link_text').parents('tr').hide();318 }319 320 /* Single Posts 'Project' Tab 'Project Link' Field Change */321 $('#' + cmsms_settings.shortname + '_portfolio_project_link').bind('change', function () { 322 if ($(this).is(':checked')) {323 $('#' + cmsms_settings.shortname + '_portfolio_project_link_text').parents('tr').show();324 } else {325 $('#' + cmsms_settings.shortname + '_portfolio_project_link_text').parents('tr').hide();326 }327 } );...

Full Screen

Full Screen

index.js

Source:index.js Github

copy

Full Screen

1/* */ 2'use strict';3var acorn = require('acorn');4var walk = require('acorn/dist/walk');5function isScope(node) {6 return node.type === 'FunctionExpression' || node.type === 'FunctionDeclaration' || node.type === 'ArrowFunctionExpression' || node.type === 'Program';7}8function isBlockScope(node) {9 return node.type === 'BlockStatement' || isScope(node);10}11function declaresArguments(node) {12 return node.type === 'FunctionExpression' || node.type === 'FunctionDeclaration';13}14function declaresThis(node) {15 return node.type === 'FunctionExpression' || node.type === 'FunctionDeclaration';16}17function reallyParse(source) {18 try {19 return acorn.parse(source, {20 ecmaVersion: 6,21 allowReturnOutsideFunction: true,22 allowImportExportEverywhere: true,23 allowHashBang: true24 });25 } catch (ex) {26 return acorn.parse(source, {27 ecmaVersion: 5,28 allowReturnOutsideFunction: true,29 allowImportExportEverywhere: true,30 allowHashBang: true31 });32 }33}34module.exports = findGlobals;35module.exports.parse = reallyParse;36function findGlobals(source) {37 var globals = [];38 var ast;39 // istanbul ignore else40 if (typeof source === 'string') {41 ast = reallyParse(source);42 } else {43 ast = source;44 }45 // istanbul ignore if46 if (!(ast && typeof ast === 'object' && ast.type === 'Program')) {47 throw new TypeError('Source must be either a string of JavaScript or an acorn AST');48 }49 var declareFunction = function (node) {50 var fn = node;51 fn.locals = fn.locals || {};52 node.params.forEach(function (node) {53 declarePattern(node, fn);54 });55 if (node.id) {56 fn.locals[node.id.name] = true;57 }58 }59 var declarePattern = function (node, parent) {60 switch (node.type) {61 case 'Identifier':62 parent.locals[node.name] = true;63 break;64 case 'ObjectPattern':65 node.properties.forEach(function (node) {66 declarePattern(node.value, parent);67 });68 break;69 case 'ArrayPattern':70 node.elements.forEach(function (node) {71 if (node) declarePattern(node, parent);72 });73 break;74 case 'RestElement':75 declarePattern(node.argument, parent);76 break;77 case 'AssignmentPattern':78 declarePattern(node.left, parent);79 break;80 // istanbul ignore next81 default:82 throw new Error('Unrecognized pattern type: ' + node.type);83 }84 }85 var declareModuleSpecifier = function (node, parents) {86 ast.locals = ast.locals || {};87 ast.locals[node.local.name] = true;88 }89 walk.ancestor(ast, {90 'VariableDeclaration': function (node, parents) {91 var parent = null;92 for (var i = parents.length - 1; i >= 0 && parent === null; i--) {93 if (node.kind === 'var' ? isScope(parents[i]) : isBlockScope(parents[i])) {94 parent = parents[i];95 }96 }97 parent.locals = parent.locals || {};98 node.declarations.forEach(function (declaration) {99 declarePattern(declaration.id, parent);100 });101 },102 'FunctionDeclaration': function (node, parents) {103 var parent = null;104 for (var i = parents.length - 2; i >= 0 && parent === null; i--) {105 if (isScope(parents[i])) {106 parent = parents[i];107 }108 }109 parent.locals = parent.locals || {};110 parent.locals[node.id.name] = true;111 declareFunction(node);112 },113 'Function': declareFunction,114 'ClassDeclaration': function (node, parents) {115 var parent = null;116 for (var i = parents.length - 2; i >= 0 && parent === null; i--) {117 if (isScope(parents[i])) {118 parent = parents[i];119 }120 }121 parent.locals = parent.locals || {};122 parent.locals[node.id.name] = true;123 },124 'TryStatement': function (node) {125 if (node.handler === null) return;126 node.handler.body.locals = node.handler.body.locals || {};127 node.handler.body.locals[node.handler.param.name] = true;128 },129 'ImportDefaultSpecifier': declareModuleSpecifier,130 'ImportSpecifier': declareModuleSpecifier,131 'ImportNamespaceSpecifier': declareModuleSpecifier132 });133 function identifier(node, parents) {134 var name = node.name;135 if (name === 'undefined') return;136 for (var i = 0; i < parents.length; i++) {137 if (name === 'arguments' && declaresArguments(parents[i])) {138 return;139 }140 if (parents[i].locals && name in parents[i].locals) {141 return;142 }143 }144 if (145 parents[parents.length - 2] &&146 parents[parents.length - 2].type === 'TryStatement' &&147 parents[parents.length - 2].handler &&148 node === parents[parents.length - 2].handler.param149 ) {150 return;151 }152 node.parents = parents;153 globals.push(node);154 }155 walk.ancestor(ast, {156 'VariablePattern': identifier,157 'Identifier': identifier,158 'ThisExpression': function (node, parents) {159 for (var i = 0; i < parents.length; i++) {160 if (declaresThis(parents[i])) {161 return;162 }163 }164 node.parents = parents;165 globals.push(node);166 }167 });168 var groupedGlobals = {};169 globals.forEach(function (node) {170 groupedGlobals[node.name] = (groupedGlobals[node.name] || []);171 groupedGlobals[node.name].push(node);172 });173 return Object.keys(groupedGlobals).sort().map(function (name) {174 return {name: name, nodes: groupedGlobals[name]};175 });...

Full Screen

Full Screen

ParentsTest.js

Source:ParentsTest.js Github

copy

Full Screen

...32 var cParents = function (startPath, rootPath) {33 return Chain.mapper(function (structure) {34 var startNode = Hierarchy.follow(structure, startPath).getOrDie();35 var rootNode = Hierarchy.follow(structure, rootPath).getOrDie();36 return Parents.parents(startNode, rootNode);37 });38 };39 var cParentsAndSelf = function (startPath, rootPath) {40 return Chain.mapper(function (structure) {41 var startNode = Hierarchy.follow(structure, startPath).getOrDie();42 var rootNode = Hierarchy.follow(structure, rootPath).getOrDie();43 return Parents.parentsAndSelf(startNode, rootNode);44 });45 };46 var cAssertElementNames = function (expectedNames) {47 return Chain.mapper(function (parents) {48 var names = Arr.map(parents, Node.name);49 Assertions.assertEq('Should be expected names', expectedNames, names);50 return {};...

Full Screen

Full Screen

yith-wcwl.js

Source:yith-wcwl.js Github

copy

Full Screen

2 /* === COLORS TAB === */3 $('input#yith_wcwl_frontend_css').on('change',function () {4 if ($(this).is(':checked')) {5 $('#yith_wcwl_styles_colors').hide();6 $('#yith_wcwl_rounded_corners').parents('tr').hide();7 $('#yith_wcwl_add_to_wishlist_icon').parents('tr').hide();8 $('#yith_wcwl_add_to_cart_icon').parents('tr').hide();9 } else {10 $('#yith_wcwl_styles_colors').show();11 if ($('#yith_wcwl_use_button').is(':checked')) {12 $('#yith_wcwl_rounded_corners').parents('tr').show();13 $('#yith_wcwl_add_to_wishlist_icon').parents('tr').show();14 $('#yith_wcwl_add_to_cart_icon').parents('tr').show();15 }16 }17 }).change();18 $('input#yith_wcwl_use_button').on('change',function () {19 if ($(this).is(':checked') && !$('#yith_wcwl_frontend_css').is(':checked')) {20 $('#yith_wcwl_rounded_corners').parents('tr').show();21 $('#yith_wcwl_add_to_wishlist_icon').parents('tr').show();22 $('#yith_wcwl_add_to_cart_icon').parents('tr').show();23 } else {24 $('#yith_wcwl_rounded_corners').parents('tr').hide();25 $('#yith_wcwl_add_to_wishlist_icon').parents('tr').hide();26 $('#yith_wcwl_add_to_cart_icon').parents('tr').hide();27 }28 }).change();29 $('#yith_wcwl_multi_wishlist_enable').on('change', function () {30 if ($(this).is(':checked')) {31 $('#yith_wcwl_wishlist_create_title').parents('tr').show();32 $('#yith_wcwl_wishlist_manage_title').parents('tr').show();33 }34 else{35 $('#yith_wcwl_wishlist_create_title').parents('tr').hide();36 $('#yith_wcwl_wishlist_manage_title').parents('tr').hide();37 }38 }).change();39 /* === SETTINGS TAB === */40 $('input#yith_wcwl_disable_wishlist_for_unauthenticated_users').on('change',function () {41 if ($(this).is(':checked')) {42 $('#yith_wcwl_show_login_notice').parents('tr').hide();43 $('#yith_wcwl_login_anchor_text').parents('tr').hide();44 }45 else{46 $('#yith_wcwl_show_login_notice').parents('tr').show();47 $('#yith_wcwl_login_anchor_text').parents('tr').show();48 }49 }).change();50 $('input#yith_wcwl_show_estimate_button').on('change',function () {51 if ($(this).is(':checked')) {52 var additional_info = $('#yith_wcwl_show_additional_info_textarea');53 additional_info.parents('tr').show();54 additional_info.on( 'change', function(){55 if ($(this).is(':checked')) {56 $('#yith_wcwl_additional_info_textarea_label').parents('tr').show()57 }58 else{59 $('#yith_wcwl_additional_info_textarea_label').parents('tr').hide()60 }61 }).change();62 }63 else{64 $('#yith_wcwl_show_additional_info_textarea').parents('tr').hide();65 $('#yith_wcwl_additional_info_textarea_label').parents('tr').hide()66 }67 }).change();...

Full Screen

Full Screen

G.parents.test.js

Source:G.parents.test.js Github

copy

Full Screen

...13`14test('$.parents: simple code', () => {15 expect(()=>{16 const G = $('var a = 1;');17 G.parents();18 }).not.toThrow();19})20test('$.parents: this[0] is null', () => {21 expect(()=>{22 const G = $('var a = 1;');23 G[0] = null24 G.parents();25 }).not.toThrow();26})27test('$.parents: parents find', () => {28 expect(()=>{29 const G = $(CODE).find('let $_$ = $_$;');30 const parents = G.parents();31 const psCode = parents.generate();32 }).not.toThrow();33})34test('$.parents: parents find', () => {35 expect(()=>{36 const G = $(CODE).find('let $_$ = \'$_$\';');37 G.parents();38 }).not.toThrow();39})40test('$.parents: simple1 html code', () => {41 expect(() => {42 const G = $(hc1, config.html);43 G.parents();44 }).not.toThrow();45})46test('$.parents: simple2 code parents find result should be ok', () => {47 const G = $(jc2).find('this.render()');48 const parent = G.parents();49 const psCode = parent.eq(1).generate();50 expect(psCode).toBe(51`{52 this.render()53}`54 );55})56test('$.parents: simple1 html code result should be ok', () => {57 const G = $(hc1, config.html);58 const parent = G.parents();59 expect(!parent[0]).toBeTruthy();60})61test('$.parents: simple1 html code use find result should be ok', () => {62 const G = $(hc1, config.html);63 const parent = G.find('<title>title</title>').parents();64 const psCode = parent.generate();65 expect(psCode.indexOf('<head>' > -1)).toBeTruthy();...

Full Screen

Full Screen

multi-index.js

Source:multi-index.js Github

copy

Full Screen

...15 newSet.indexKeys = indexKeys16 this.sets.add(newSet)17 return newSet18 }19 _parents(keys, create=false) {20 const parents = []21 let parent = this.root22 parents.push(parent)23 for (let i = 0; i < keys.length; i++) {24 if (!(parent.has(keys[i]))) {25 if (!create) return []26 const newColl = (i === keys.length-1) ? this._createSet(keys) : new Map()27 parent.set(keys[i], newColl)28 }29 parent = parent.get(keys[i])30 parents.push(parent)31 }32 return parents33 }34 _delete(keys, id) {35 const parents = this._parents(keys)36 if (parents.length === 0) return37 if (typeof id !== 'undefined')38 parents[parents.length-1].delete(id)39 for (let i = keys.length - 1; i >= 0; i--) {40 if (parents[i].size > 0) break41 if (this.sets.has(parents[i]))42 this.sets.delete(parents[i])43 parents[i-1].delete(keys[i])44 }45 }46 unindex(id) {47 this.sets.forEach(set => {48 if (set.has(id)) this._delete(set.indexKeys, id)49 })50 }51 index(keys, id) {52 if (!(Array.isArray(keys))) keys = [keys]53 const parents = this._parents(keys, true)54 return parents[parents.length-1].add(id)55 }56 get(keys) {57 if (!(Array.isArray(keys))) keys = [keys]58 const parents = this._parents(keys)59 return parents[parents.length-1] || EMPTY_SET60 }...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1describe('My First Test', function() {2 it('Does not do much!', function() {3 cy.contains('type').click()4 cy.url().should('include', '/commands/actions')5 cy.get('.action-email')6 .type('

Full Screen

Using AI Code Generation

copy

Full Screen

1describe('My First Test', function() {2 it('Does not do much!', function() {3 cy.contains('type').click()4 cy.url().should('include', '/commands/actions')5 cy.get('.action-email')6 .type('

Full Screen

Using AI Code Generation

copy

Full Screen

1Cypress.Commands.add('parents', { prevSubject: 'element' }, (subject, selector) => {2 return subject.parents(selector)3})4Cypress.Commands.add('children', { prevSubject: 'element' }, (subject, selector) => {5 return subject.children(selector)6})7Cypress.Commands.add('parentsUntil', { prevSubject: 'element' }, (subject, selector, filter) => {8 return subject.parentsUntil(selector, filter)9})10Cypress.Commands.add('childrenUntil', { prevSubject: 'element' }, (subject, selector, filter) => {11 return subject.childrenUntil(selector, filter)12})13Cypress.Commands.add('siblings', { prevSubject: 'element' }, (subject, selector) => {14 return subject.siblings(selector)15})16Cypress.Commands.add('next', { prevSubject: 'element' }, (subject, selector) => {17 return subject.next(selector)18})19Cypress.Commands.add('nextAll', { prevSubject: 'element' }, (subject, selector) => {20 return subject.nextAll(selector)21})22Cypress.Commands.add('nextUntil', { prevSubject: 'element' }, (subject, selector, filter) => {23 return subject.nextUntil(selector, filter)24})25Cypress.Commands.add('prev', { prevSubject: 'element' }, (subject, selector) => {26 return subject.prev(selector)27})28Cypress.Commands.add('prevAll', { prevSubject: 'element' }, (subject, selector) => {29 return subject.prevAll(selector)30})31Cypress.Commands.add('prevUntil', { prevSubject: 'element' }, (subject, selector, filter) => {32 return subject.prevUntil(selector, filter)33})34Cypress.Commands.add('closest', { prevSubject: 'element' }, (subject, selector) => {35 return subject.closest(selector)36})37Cypress.Commands.add('find', {

Full Screen

Using AI Code Generation

copy

Full Screen

1Cypress.Commands.add('parent', { prevSubject: 'element' }, (subject, selector) => {2 return cy.wrap(subject.parent(selector));3});4Cypress.Commands.add('parent', { prevSubject: 'element' }, (subject, selector) => {5 return cy.wrap(subject.parent(selector));6});7Cypress.Commands.add('parent', { prevSubject: 'element' }, (subject, selector) => {8 return cy.wrap(subject.parent(selector));9});10Cypress.Commands.add('parent', { prevSubject: 'element' }, (subject, selector) => {11 return cy.wrap(subject.parent(selector));12});13Cypress.Commands.add('parent', { prevSubject: 'element' }, (subject, selector) => {14 return cy.wrap(subject.parent(selector));15});16Cypress.Commands.add('parent', { prevSubject: 'element' }, (subject, selector) => {17 return cy.wrap(subject.parent(selector));18});19Cypress.Commands.add('parent', { prevSubject: 'element' }, (subject, selector) => {20 return cy.wrap(subject.parent(selector));21});22Cypress.Commands.add('parent', { prevSubject: 'element' }, (subject, selector) => {23 return cy.wrap(subject.parent(selector));24});25Cypress.Commands.add('parent', { prevSubject: 'element' }, (subject, selector) => {26 return cy.wrap(subject.parent(selector));27});28Cypress.Commands.add('parent', { prevSubject: 'element' }, (subject, selector) => {29 return cy.wrap(subject.parent(selector));30});31Cypress.Commands.add('parent', { prevSubject: 'element' }, (subject, selector) => {32 return cy.wrap(subject.parent(selector));33});

Full Screen

Using AI Code Generation

copy

Full Screen

1require("cypress-xpath")2describe('My First Test', function() {3 it('Does not do much!', function() {4 cy.contains('type').click()5 cy.url().should('include', '/commands/actions')6 cy.get('.action-email')7 .type('

Full Screen

Using AI Code Generation

copy

Full Screen

1describe('Parent', () => {2 it('Validate whether the child element exists within the parent element', () => {3 cy.get('#mousehover').invoke('show')4 cy.contains('Top').click()5 cy.url().should('include', 'top')6 cy.go('back')7 cy.get('#mousehover').parent().as('parent')8 cy.get('@parent').find('a').first().click()9 cy.url().should('include', 'top')10 })11})12describe('Parent', () => {13 it('Validate whether the child element exists within the parent element', () => {14 cy.get('#mousehover').invoke('show')15 cy.contains('Top').click()16 cy.url().should('include', 'top')17 cy.go('back')18 cy.get('#mousehover').parent().as('parent')19 cy.get('@parent').find('a').first().click()20 cy.url().should('include', 'top')21 })22})23describe('Parent', () => {24 it('Validate whether the child element exists within the parent element', () => {25 cy.get('#mousehover').invoke('show')26 cy.contains('Top').click()27 cy.url().should('include', 'top')28 cy.go('back')29 cy.get('#mousehover').parent().as('parent')30 cy.get('@parent').find('a').first().click()31 cy.url().should('include', 'top')32 })33})34describe('Parent', () => {35 it('Validate whether the child element exists within the parent element', () => {36 cy.get('#mousehover').invoke('show')37 cy.contains('Top').click()38 cy.url().should('include', 'top')39 cy.go('back')40 cy.get('#mousehover').parent().as('parent')

Full Screen

Using AI Code Generation

copy

Full Screen

1it('Verify the parent of the element', function() {2 cy.get('.ico-login').parents().should('have.class', 'header-menu')3 cy.get('.ico-login').parents().parents().should('have.class', 'header')4 cy.get('.ico-login').parents().parents().parents().should('have.class', 'header-container')5 cy.get('.ico-login').parents().parents().parents().parents().should('have.class', 'master-wrapper-page')6 cy.get('.ico-login').parents().parents().parents().parents().parents().should('have.class', 'page home-page')7})8it('Verify the parent of the element', function() {9 cy.get('.ico-login').parentsUntil('.page').should('have.class', 'header-menu')10 cy.get('.ico-login').parentsUntil('.header-container').should('have.class', 'header')11 cy.get('.ico-login').parentsUntil('.master-wrapper-page').should('have.class', 'header-container')12 cy.get('.ico-login').parentsUntil('.home-page').should('have.class', 'master-wrapper-page')13 cy.get('.ico-login').parentsUntil('body').should('have.class', 'page home-page')14})15it('Verify the sibling of the element', function() {16 cy.get('.ico-login').siblings().should('have.class', 'ico-register')17 cy.get('.ico-login').siblings().siblings().should('have.class', 'ico-wishlist')18 cy.get('.ico-login').siblings().siblings().siblings().should('have.class', 'ico-shopping-cart')19 cy.get('.ico-login').siblings().siblings().siblings().siblings().should('have.class', 'ico-compare')20})21it('Verify the next of the element', function() {22 cy.get('.ico-login').next().should('have.class', 'ico-register')23 cy.get('.ico-login').next().next().should('have.class', 'ico-wishlist')

Full Screen

Using AI Code Generation

copy

Full Screen

1it('Test', () => {2 cy.get('.action-parent').find('.action-child')3 .should('have.text', 'Child')4 .parent().should('have.class', 'action-parent')5 cy.get('.action-parent').find('.action-child')6 .should('have.text', 'Child')7 .parents().should('have.class', 'action-parent')8 cy.get('.action-parent').find('.action-child')9 .should('have.text', 'Child')10 .parents('div').should('have.class', 'action-parent')11 cy.get('.action-parent').find('.action-child')12 .should('have.text', 'Child')13 .parents('body').should('have.class', 'action-parent')14 cy.get('.action-parent').find('.action-child')15 .should('have.text', 'Child')16 .parents('.action-parent').should('have.class', 'action-parent')17 cy.get('.action-parent').find('.action-child')18 .should('have.text', 'Child')19 .parents('.action-parent').should('have.class', 'action-parent')20 cy.get('.action-parent').find('.action-child')21 .should('have.text', 'Child')22 .parents('div').should('have.class', 'action-parent')23 cy.get('.action-parent').find('.action-child')24 .should('have.text', 'Child')25 .parents('div').should('have.class', 'action-parent')26 cy.get('.action-parent').find('.action-child')27 .should('have.text', 'Child')28 .parents('div').should('have.class', 'action-parent')29 cy.get('.action-parent').find('.action-child')30 .should('have.text', 'Child')31 .parents('div').should('have.class', 'action-parent')32 cy.get('.action-parent').find('.action-child')33 .should('have.text', 'Child')34 .parents('div').should('have.class', 'action-parent')35})

Full Screen

Cypress Tutorial

Cypress is a renowned Javascript-based open-source, easy-to-use end-to-end testing framework primarily used for testing web applications. Cypress is a relatively new player in the automation testing space and has been gaining much traction lately, as evidenced by the number of Forks (2.7K) and Stars (42.1K) for the project. LambdaTest’s Cypress Tutorial covers step-by-step guides that will help you learn from the basics till you run automation tests on LambdaTest.

Chapters:

  1. What is Cypress? -
  2. Why Cypress? - Learn why Cypress might be a good choice for testing your web applications.
  3. Features of Cypress Testing - Learn about features that make Cypress a powerful and flexible tool for testing web applications.
  4. Cypress Drawbacks - Although Cypress has many strengths, it has a few limitations that you should be aware of.
  5. Cypress Architecture - Learn more about Cypress architecture and how it is designed to be run directly in the browser, i.e., it does not have any additional servers.
  6. Browsers Supported by Cypress - Cypress is built on top of the Electron browser, supporting all modern web browsers. Learn browsers that support Cypress.
  7. Selenium vs Cypress: A Detailed Comparison - Compare and explore some key differences in terms of their design and features.
  8. Cypress Learning: Best Practices - Take a deep dive into some of the best practices you should use to avoid anti-patterns in your automation tests.
  9. How To Run Cypress Tests on LambdaTest? - Set up a LambdaTest account, and now you are all set to learn how to run Cypress tests.

Certification

You can elevate your expertise with end-to-end testing using the Cypress automation framework and stay one step ahead in your career by earning a Cypress certification. Check out our Cypress 101 Certification.

YouTube

Watch this 3 hours of complete tutorial to learn the basics of Cypress and various Cypress commands with the Cypress testing at LambdaTest.

Run Cypress automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful