Best JavaScript code snippet using cypress
rev_admin.js
Source:rev_admin.js
...5 /**6 * init "slider" view functionality7 */8 var initSaveSliderButton = function(ajaxAction){9 jQuery("#button_save_slider,#button_save_slider_t").click(function(){10 //collect data11 var data = {12 params: RevSliderSettings.getSettingsObject("form_slider_params"),13 main: RevSliderSettings.getSettingsObject("form_slider_main"),14 template: jQuery('#revslider_template').val() //determinate if we are a template slider or not15 };16 17 //add slider id to the data18 if(ajaxAction == "update_slider"){19 data.sliderid = jQuery("#sliderid").val();20 data.params.custom_css = rev_cm_custom_css.getValue();21 data.params.custom_javascript = rev_cm_custom_js.getValue();22 UniteAdminRev.setAjaxLoaderID("loader_update, #loader_update_t");23 UniteAdminRev.setAjaxHideButtonID("button_save_slider,button_save_slider_t");24 UniteAdminRev.setSuccessMessageID("update_slider_success,#update_slider_success_t");25 }26 UniteAdminRev.ajaxRequest(ajaxAction ,data);27 });28 }29 30 31 t.initLayerPreview = function(){32 //preview slider actions33 jQuery("#button_preview_slider-tb").click(function(){34 var sliderID = jQuery("#sliderid").val();35 openPreviewSliderDialog(sliderID);36 });37 }38 /**39 * update shortcode from alias value.40 */41 var updateShortcode = function(){42 var alias = jQuery("#alias").val();43 var shortcode = '[rev_slider alias="'+alias+'"]';44 if(alias == "")45 shortcode = rev_lang.wrong_alias;46 jQuery("#shortcode").val(shortcode);47 }48 49 /**50 * change fields of the slider view51 */52 var enableSliderViewResponsitiveFields = function(enableRes,enableAuto,enableFullScreen,textMode){53 jQuery('input[name="width"]').attr('disabled', false);54 jQuery('input[name="height"]').attr('disabled', false);55 if(textMode == 'normal' || textMode == 'full'){56 jQuery('#layout-preshow').removeClass('lp-fullscreenalign');57 }58 59 //enable / disable responsitive fields60 if(enableRes){61 jQuery("#responsitive_row").removeClass("disabled");62 jQuery("#responsitive_row input").prop("disabled","");63 }else{64 jQuery("#responsitive_row").addClass("disabled");65 jQuery("#responsitive_row input").prop("disabled","disabled");66 }67 if(enableAuto){68 jQuery("#auto_height_row").removeClass("disabled");69 jQuery('#layout-preshow').removeClass('lp-fullscreenalign');70 }else{71 jQuery("#auto_height_row").addClass("disabled");72 }73 74 if(textMode == 'normal' && enableRes == false && enableAuto == false && enableFullScreen == false){75 jQuery('.rs-hide-on-fixed').hide();76 }else{77 jQuery('.rs-hide-on-fixed').show();78 }79 80 if(enableFullScreen){81 jQuery('.rs-show-on-fullscreen').show();82 jQuery('.rs-hide-on-fullscreen').hide();83 84 if(jQuery('input[name="full_screen_align_force"]:checked').val() == 'on') jQuery('#layout-preshow').addClass('lp-fullscreenalign');85 jQuery("#full_screen_align_force_row").removeClass("disabled");86 jQuery("#fullscreen_offset_container_row").removeClass("disabled");87 }else{88 jQuery('.rs-show-on-fullscreen').hide();89 jQuery('.rs-hide-on-fullscreen').show();90 91 jQuery("#full_screen_align_force_row").addClass("disabled");92 jQuery("#fullscreen_offset_container_row").addClass("disabled");93 }94 if(enableFullScreen || enableAuto){95 jQuery("#force_full_width_row").removeClass("disabled");96 }else{97 jQuery("#force_full_width_row").addClass("disabled");98 }99 jQuery('#layout-preshow').removeClass('lp-fixed');100 jQuery('#layout-preshow').removeClass('lp-custom'); //responsitive101 jQuery('#layout-preshow').removeClass('lp-autoresponsive'); //fullwidth102 jQuery('#layout-preshow').removeClass('lp-fullscreen');103 if(enableRes){104 jQuery('#layout-preshow').addClass('lp-custom');105 }else if(enableAuto){106 jQuery('#layout-preshow').addClass('lp-autoresponsive');107 }else if(enableFullScreen){108 jQuery('#layout-preshow').addClass('lp-fullscreen');109 }else{110 jQuery('#layout-preshow').addClass('lp-fixed');111 }112 113 }114 /**115 * init slider view custom controls fields.116 */117 var initSliderViewCustomControls = function(){118 //fixed119 jQuery("#slider_type_1").click(function(){120 enableSliderViewResponsitiveFields(false,false,false,"normal");121 });122 //responsitive123 jQuery("#slider_type_2").click(function(){124 enableSliderViewResponsitiveFields(true,false,false,"normal");125 });126 //full width127 jQuery("#slider_type_3").click(function(){128 enableSliderViewResponsitiveFields(false,true,false,"full");129 });130 //full screen131 jQuery("#slider_type_4").click(function(){132 enableSliderViewResponsitiveFields(false,false,true,"screen");133 });134 jQuery('input[name="full_screen_align_force"]').click(function(){135 if(jQuery(this).val() == 'on'){136 jQuery('#layout-preshow').addClass('lp-fullscreenalign');137 }else{138 jQuery('#layout-preshow').removeClass('lp-fullscreenalign');139 }140 });141 jQuery('input[name="auto_height"]').click(function(){142 if(jQuery(this).val() == "on")143 jQuery('#layout-preshow').addClass('lp-autoheight');144 else145 jQuery('#layout-preshow').removeClass('lp-autoheight');146 });147 jQuery('input[name="force_full_width"]').click(function(){148 if(jQuery(this).val() == "on")149 jQuery('#layout-preshow').addClass('lp-fullwidth');150 else151 jQuery('#layout-preshow').removeClass('lp-fullwidth');152 });153 jQuery('input[name="full_screen_align_force"]:checked').click();154 jQuery('input[name="auto_height"]:checked').click();155 jQuery('input[name="force_full_width"]:checked').click();156 }157 /**158 *159 * update category by post types160 */161 var updateCatByPostTypes = function(typeSettingName,catSettingName){162 jQuery("#"+typeSettingName).change(function(){163 var arrTypes = jQuery(this).val();164 //replace the categories in multi select165 var mysel = [];166 jQuery("#"+catSettingName+' option').each(function(){167 if(jQuery(this).prop('selected') == true){168 mysel.push(jQuery(this).val());169 }170 });171 172 jQuery("#"+catSettingName).empty();173 jQuery(arrTypes).each(function(index,postType){174 var objCats = g_postTypesWithCats[postType];175 //var flagFirst = true;176 for(var catIndex in objCats){177 var catTitle = objCats[catIndex];178 //add option to cats select179 var opt = new Option(catTitle, catIndex);180 if(catIndex.indexOf("option_disabled") == 0){181 jQuery(opt).prop("disabled","disabled");182 }else{183 //select first option:184 //if(flagFirst == true){185 if(jQuery.inArray(jQuery(opt).val(),mysel) !== -1){186 jQuery(opt).prop("selected","selected");187 }188 //flagFirst = false;189 //}190 }191 jQuery("#"+catSettingName).append(opt);192 }193 });194 });195 jQuery("#"+typeSettingName).change();196 }197 /**198 * init common functionality of the slider view.199 */200 var initSliderViewCommon = function(){201 initShortcode();202 initSliderViewCustomControls();203 g_postTypesWithCats = jQuery.parseJSON(g_jsonTaxWithCats);204 updateCatByPostTypes("post_types","post_category");205 updateCatByPostTypes("product_types","product_category");206 jQuery("input[name='source_type']").click(function(){ //check for post click207 if(jQuery(this).val() == 'posts'){ //jQuery(this).val() == 'specific_posts' ||208 jQuery('#toolbox_wrapper').hide();209 //hide more elements210 jQuery('#slider_type_row').hide();211 jQuery('#slider_type_row').prev().hide();212 jQuery('#fullscreen_offset_container_row').hide();213 jQuery('#full_screen_align_force_row').hide();214 jQuery('#slider_size_row').hide();215 jQuery('#auto_height_row').hide();216 jQuery('#force_full_width_row').hide();217 jQuery('#responsitive_row').hide();218 jQuery('#responsitive_row').next().hide();219 }else{220 jQuery('.settings_panel_right').show();221 jQuery('#toolbox_wrapper').show();222 //show more elements223 jQuery('#slider_type_row').show();224 jQuery('#slider_type_row').prev().show();225 jQuery('#fullscreen_offset_container_row').show();226 jQuery('#full_screen_align_force_row').show();227 jQuery('#slider_size_row').show();228 jQuery('#auto_height_row').show();229 jQuery('#force_full_width_row').show();230 jQuery('#responsitive_row').show();231 jQuery('#responsitive_row').next().show();232 jQuery('#layout-preshow').show();233 234 }235 236 jQuery('.rs-settings-wrapper').hide();237 if(jQuery(this).val() == 'posts' || jQuery(this).val() == 'specific_posts' || jQuery(this).val() == 'woocommerce'){238 jQuery('#rs-post-settings-wrapper').show();239 jQuery('.rs-specific-posts-wrap').hide();240 jQuery('.rs-woocommerce-product-wrap').hide();241 jQuery('.rs-post-types-wrapper').hide();242 jQuery('.rs-show-for-wc').hide();243 jQuery('.rs-hide-for-wc').show();244 if(jQuery(this).val() == 'posts'){245 jQuery('.rs-post-types-wrapper').show();246 jQuery('.rs-specific-posts-wrap').hide();247 }else if(jQuery(this).val() == 'specific_posts'){248 jQuery('.rs-post-types-wrapper').hide();249 jQuery('.rs-specific-posts-wrap').show();250 }else if(jQuery(this).val() == 'woocommerce'){251 jQuery('.rs-woocommerce-product-wrap').show();252 jQuery('.rs-show-for-wc').show();253 jQuery('.rs-hide-for-wc').hide();254 }255 }else{256 jQuery('#rs-post-settings-wrapper').hide();257 jQuery('#rs-'+jQuery(this).val()+'-settings-wrapper').show();258 if(jQuery(this).val()=="facebook"){259 jQuery('select[name="facebook-type-source"]').change();260 }261 if(jQuery("select[name=flickr-type]").val()=='photosets' && jQuery('input[name=source_type]:checked').val()=="flickr") jQuery('input[name=flickr-user-url]').change();262 if(jQuery('input[name=source_type]:checked').val()=="youtube" && jQuery("select[name='youtube-type-source']").val()=='playlist') jQuery('input[name=youtube-channel-id]').change();263 }264 });265 266 jQuery('.rs-settings-wrapper').hide();267 if(jQuery("#source_type_1").is(':checked') || jQuery("#source_type_2").is(':checked')){268 jQuery('#rs-post-settings-wrapper').show();269 if(jQuery("#source_type_1").is(':checked')){270 jQuery('.rs-post-types-wrapper').show();271 jQuery('.rs-specific-posts-wrap').hide();272 }else{273 jQuery('.rs-post-types-wrapper').hide();274 jQuery('.rs-specific-posts-wrap').show();275 }276 }277 else{278 jQuery('#rs-post-settings-wrapper').hide();279 jQuery('input[name=source_type]:checked').click();280 }281 282 if(jQuery("#source_type_1").is(':checked')){283 jQuery('#toolbox_wrapper').hide();284 //hide more elements285 jQuery('#slider_type_row').hide();286 jQuery('#slider_type_row').prev().hide();287 jQuery('#fullscreen_offset_container_row').hide();288 jQuery('#full_screen_align_force_row').hide();289 jQuery('#slider_size_row').hide();290 jQuery('#auto_height_row').hide();291 jQuery('#force_full_width_row').hide();292 jQuery('#responsitive_row').hide();293 jQuery('#responsitive_row').next().hide();294 }295 jQuery(document).ready(function(){296 jQuery('input[name="slider_type"]:checked').click();297 jQuery('select[name="navigation_style"]').change(function(){298 switch(jQuery(this).val()){299 case 'preview1':300 case 'preview2':301 case 'preview3':302 case 'preview4':303 jQuery('#leftarrow_align_hor_row').hide();304 jQuery('#leftarrow_align_vert_row').hide();305 jQuery('#leftarrow_offset_hor_row').hide();306 jQuery('#leftarrow_offset_vert_row').hide();307 jQuery('#rightarrow_align_hor_row').hide();308 jQuery('#rightarrow_align_vert_row').hide();309 jQuery('#rightarrow_offset_hor_row').hide();310 jQuery('#rightarrow_offset_vert_row').hide();311 jQuery('#navigation_arrows_row').hide();312 break;313 default:314 jQuery('#navigaion_type').change();315 jQuery('#navigation_arrows').change();316 break;317 }318 });319 jQuery('#navigation_arrows').on("change",function() {320 switch(jQuery(this).val()){ 321 case 'nexttobullets': 322 case 'solo':323 var nsval = jQuery('select[name="navigation_style"]').val();324 if ( nsval!="preview1" && nsval!="preview2" && nsval!="preview3" && nsval!="preview4") {325 jQuery('#leftarrow_align_hor_row').show();326 jQuery('#leftarrow_align_vert_row').show();327 jQuery('#leftarrow_offset_hor_row').show();328 jQuery('#leftarrow_offset_vert_row').show();329 jQuery('#rightarrow_align_hor_row').show();330 jQuery('#rightarrow_align_vert_row').show();331 jQuery('#rightarrow_offset_hor_row').show();332 jQuery('#rightarrow_offset_vert_row').show();333 } 334 break;335 default: 336 jQuery('#leftarrow_align_hor_row').hide();337 jQuery('#leftarrow_align_vert_row').hide();338 jQuery('#leftarrow_offset_hor_row').hide();339 jQuery('#leftarrow_offset_vert_row').hide();340 jQuery('#rightarrow_align_hor_row').hide();341 jQuery('#rightarrow_align_vert_row').hide();342 jQuery('#rightarrow_offset_hor_row').hide();343 jQuery('#rightarrow_offset_vert_row').hide(); 344 break;345 }346 })347 348 jQuery('select[name="navigation_style"] option:selected').change();349 350 jQuery('#navigation_type').change(function(){351 switch(jQuery(this).val()){352 case 'bullet':353 case 'thumb':354 var nsval = jQuery('select[name="navigation_style"]').val();355 if ( nsval!="preview1" && nsval!="preview2" && nsval!="preview3" && nsval!="preview4") {356 jQuery('#navigation_arrows_row').show();357 }358 break;359 default:360 jQuery('#navigation_arrows_row').hide();361 break;362 }363 }); 364 jQuery('#navigation_style').change();365 });366 /**367 * Facebook Type368 */369 jQuery('body').on('change','select[name="facebook-type-source"]',function(){370 var set = jQuery(this).val();371 if(set == 'timeline'){372 jQuery('#facebook-album-wrap').hide();373 jQuery('#facebook-timeline-wrap').show();374 }375 else{376 jQuery('#facebook-timeline-wrap').hide();377 jQuery('#facebook-album-wrap').show();378 jQuery('input[name=facebook-page-url]').change();379 }380 });381 if(jQuery('input[name=source_type]:checked').val()=="facebook") jQuery('select[name="facebook-type-source"]').change();382 jQuery('input[name=facebook-page-url]').change(function(){383 if(jQuery("select[name='facebook-type-source']").val()=='album'){384 var data = {385 url : jQuery('input[name=facebook-page-url]').val(),386 album : jQuery('input[name=facebook-album]').val(),387 app_id : jQuery('input[name=facebook-app-id]').val(),388 app_secret : jQuery('input[name=facebook-app-secret]').val(),389 };390 if(jQuery('input[name=facebook-page-url]').val()!=""){391 UniteAdminRev.ajaxRequest("get_facebook_photosets", data,function(response){392 jQuery("select[name=facebook-album-select]").html(response.html);393 jQuery('select[name=facebook-album-select]').change();394 }); 395 }396 else{397 jQuery("select[name=facebook-album-select]").html('');398 jQuery('select[name=facebook-album-select]').change();399 }400 }401 });402 if(jQuery('input[name=source_type]:checked').val()=="facebook") jQuery('input[name=facebook-page-url]').change();403 /**404 * Same Value Facebook Album Select / Hidden Input405 */406 jQuery('select[name=facebook-album-select]').change(function(){407 jQuery('input[name=facebook-album]').val(jQuery('select[name=facebook-album-select]').val());408 });409 /**410 * Change flickr Stream Type411 */412 jQuery('select[name=flickr-type]').change(function(){413 var set = jQuery(this).val();414 switch(set){415 case 'publicphotos':416 jQuery('#flickr-photosets-wrap,#flickr-gallery-url-wrap,#flickr-group-url-wrap').hide();417 jQuery('#flickr-publicphotos-url-wrap').show();418 break;419 case 'gallery':420 jQuery('#flickr-publicphotos-url-wrap,#flickr-photosets-wrap,#flickr-group-url-wrap').hide();421 jQuery('#flickr-gallery-url-wrap').show();422 break;423 case 'photosets':424 jQuery('#flickr-gallery-url-wrap,#flickr-group-url-wrap').hide();425 jQuery('#flickr-publicphotos-url-wrap,#flickr-photosets-wrap').show();426 break;427 case 'group':428 jQuery('#flickr-publicphotos-url-wrap,#flickr-photosets-wrap,#flickr-gallery-url-wrap').hide();429 jQuery('#flickr-group-url-wrap').show();430 break;431 }432 });433 jQuery('select[name=flickr-type]').change();434 /**435 * Show/Hide flickr Photosets436 */437 jQuery('input[name=flickr-user-url],select[name=flickr-type]').change(function(){438 if(jQuery("select[name=flickr-type]").val()=='photosets'){439 if(jQuery('input[name=flickr-user-url]').val()!="" && jQuery('input[name=flickr-api-key]').val()!=""){440 var data = {441 url : jQuery('input[name=flickr-user-url]').val(),442 key : jQuery('input[name=flickr-api-key]').val(),443 count : jQuery('input[name=flickr-count]').val(),444 set : jQuery('input[name=flickr-photoset]').val()445 };446 UniteAdminRev.ajaxRequest("get_flickr_photosets", data, function(response){447 jQuery("select[name=flickr-photoset-select]").html(response.data.html);448 jQuery('select[name=flickr-photoset-select]').change();449 }); 450 } 451 else{452 jQuery("select[name=flickr-photoset-select]").html(response.data.html);453 jQuery('input[name=flickr-photoset]').val('');454 }455 }456 });457 if(jQuery("select[name=flickr-type]").val()=='photosets' && jQuery('input[name=source_type]:checked').val()=="flickr") jQuery('input[name=flickr-user-url]').change();458 /**459 * Same Value flickr photoset Select / Hidden Input460 */461 jQuery('select[name=flickr-photoset-select]').change(function(){462 jQuery('input[name=flickr-photoset]').val(jQuery('select[name=flickr-photoset-select]').val());463 });464 /**465 * Same Value YouTube Playlist Select / Hidden Input466 */467 jQuery('select[name=youtube-playlist-select]').change(function(){468 jQuery('input[name=youtube-playlist]').val(jQuery('select[name=youtube-playlist-select]').val());469 });470 /**471 * Show/Hide YouTube Playlists472 */473 jQuery('input[name=youtube-channel-id]').change(function(){474 if(jQuery("select[name='youtube-type-source']").val()=='playlist'){475 var data = {476 api: jQuery('input[name=youtube-api]').val(),477 id : jQuery('input[name=youtube-channel-id]').val(),478 playlist : jQuery('input[name=youtube-playlist]').val()479 };480 if(jQuery('input[name=youtube-channel-id]').val()!=""){481 UniteAdminRev.ajaxRequest("get_youtube_playlists", data,function(response){482 jQuery("select[name=youtube-playlist-select]").html(response.data.html);483 jQuery('select[name=youtube-playlist-select]').change();484 }); 485 }486 else{487 jQuery("select[name=youtube-playlist-select]").html('');488 }489 }490 });491 /**492 * Change YouTube Stream Type493 */494 jQuery('select[name=youtube-type-source]').change(function(){495 var set = jQuery(this).val();496 if(set != 'playlist'){497 jQuery('#youtube-playlist-wrap').hide();498 }499 else{500 jQuery('#youtube-playlist-wrap').show();501 if(jQuery('input[name=source_type]:checked').val()=="youtube" && jQuery('input[name=youtube-channel-id]').val()!="" && jQuery('select[name="youtube-type-source"]').val() == 'playlist'){502 jQuery('input[name=youtube-channel-id]').change(); 503 }504 }505 });506 jQuery('select[name=youtube-type-source]').change();507 /**508 * Show Vimeo Source Type specific Inputs509 */510 jQuery('select[name=vimeo-type-source]').change(function(){511 var set = jQuery(this).val();512 jQuery(".source-vimeo").hide();513 jQuery("#vimeo-"+set+"-wrap").show();514 });515 jQuery('select[name=vimeo-type-source]').change();516 /**517 * Set bullet type and navigation arrows to none if loop_slide is set to off518 */519 jQuery('body').on('click', 'input[name="loop_slide"]', function(){520 if(jQuery(this).val() == 'noloop'){521 jQuery('#navigaion_type option[value="none"]').attr('selected', true);522 jQuery('#navigation_arrows option[value="none"]').attr('selected', true);523 jQuery('#navigaion_type').change();524 jQuery('#navigation_arrows').change();525 UniteAdminRev.showInfo({type: 'info', hideon: '', event: '', content: rev_lang.nav_bullet_arrows_to_none, hidedelay: 3});526 }527 });528 529 530 /**531 * Enables the Advanced Responsive Sizes feature532 */533 jQuery('#enable_advanced_sizes').click(function(){534 jQuery('.rev-advanced-sizes-wrap').show();535 jQuery('#rev-enable-advanced-sizes').hide();536 jQuery('input[name="advanced-responsive-sizes"]').val('true');537 jQuery('.rev-desktop-naming').html('Desktop');538 539 });540 /**541 * Disable the Advanced Responsive Sizes feature542 */543 jQuery('#disable_advanced_sizes').click(function(){544 jQuery('.rev-advanced-sizes-wrap').hide();545 jQuery('#rev-enable-advanced-sizes').show();546 jQuery('input[name="advanced-responsive-sizes"]').val('false');547 jQuery('.rev-desktop-naming').html('');548 });549 }550 /**551 Init Slider Spinner Admin View552 **/553 this.initSpinnerAdmin = function() {554 jQuery('#use_spinner_row').parent().prepend('<div id="spinner_preview"></div>');555 var spin = jQuery('#spinner_preview');556 var sel = jQuery('#use_spinner');557 var col = jQuery('#spinner_color');558 var oldcol = col.val();559 resetSpin(spin);560 sel.on("change",function() {561 resetSpin(spin,true);562 });563 setInterval(function() {564 if (oldcol!=col.val()) {565 spinnerColorChange();566 oldocl=col.val();567 }568 },300)569 }570 /**571 CHANGE SPINNER COLOR ON CALL BACK572 **/573 function spinnerColorChange() {574 var col = jQuery('#spinner_color').val();575 var sel = jQuery('#use_spinner');576 if (sel.val()==0 || sel.val()==5) col ="#ffffff";577 var spin = jQuery('#spinner_preview .tp-loader.tp-demo');578 if (spin.hasClass("spinner0") || spin.hasClass("spinner1") || spin.hasClass("spinner2")) {579 spin.css({'backgroundColor':col});580 } else {581 spin.find('div').css({'backgroundColor':col});582 }583 };584 /**585 RESET SPINNER DEMO586 **/587 function resetSpin(spin,remove) {588 var sel = jQuery('#use_spinner');589 spin.find('.tp-loader').remove();590 spin.append('<div class="tp-loader tp-demo">'+591 '<div class="dot1"></div>'+592 '<div class="dot2"></div>'+593 '<div class="bounce1"></div>'+594 '<div class="bounce2"></div>'+595 '<div class="bounce3"></div>'+596 '</div>');597 spin.find('.tp-demo').addClass("spinner"+sel.val());598 if (sel.val()=='-1' || sel.val()==0 || sel.val()==5) {599 //jQuery('#spinner_color').val("#ffffff");600 jQuery('#spinner_color_row').css({display:"none"});601 } else {602 jQuery('#spinner_color_row').css({display:"block"});603 }604 spinnerColorChange();605 };606 /**607 * init "slider->add" view.608 */609 this.initAddSliderView = function(){610 initSliderViewCommon();611 jQuery("#title").focus();612 initSaveSliderButton("create_slider");613 enableSliderViewResponsitiveFields(false,false,false,"normal"); //show grid settings for fixed614 this.initSpinnerAdmin();615 }616 617 /**618 * init "slider->edit" view.619 */620 this.initEditSliderView = function(){621 initSliderViewCommon();622 initSaveSliderButton("update_slider");623 //delete slider action624 jQuery("#button_delete_slider, #button_delete_slider_t").click(function(){625 if(confirm(rev_lang.really_want_to_delete+" '"+jQuery("#title").val()+"' ?") == false)626 return(true);627 var data = {sliderid: jQuery("#sliderid").val()}628 UniteAdminRev.ajaxRequest("delete_slider" ,data);629 });630 631 //api inputs functionality:632 jQuery("#api_wrapper .api-input").click(function(){633 jQuery(this).select().focus();634 });635 //api button functions:636 jQuery("#link_show_api").click(function(){637 jQuery("#api_wrapper").show();638 jQuery("#link_show_api").addClass("button-selected");639 jQuery("#toolbox_wrapper").hide();640 jQuery("#link_show_toolbox").removeClass("button-selected");641 });642 jQuery("#link_show_toolbox").click(function(){643 jQuery("#toolbox_wrapper").show();644 jQuery("#link_show_toolbox").addClass("button-selected");645 jQuery("#api_wrapper").hide();646 jQuery("#link_show_api").removeClass("button-selected");647 });648 //export slider action649 jQuery("#button_export_slider").click(function(){650 var sliderID = jQuery("#sliderid").val();651 var useDummy = jQuery('input[name="export_dummy_images"]').is(':checked');652 var urlAjaxExport = ajaxurl+"?action="+g_uniteDirPlugin+"_ajax_action&client_action=export_slider&dummy="+useDummy+"&nonce=" + g_revNonce;653 urlAjaxExport += "&sliderid=" + sliderID;654 location.href = urlAjaxExport;655 });656 //preview slider actions657 jQuery("#button_preview_slider, #button_preview_slider_t").click(function(){658 var sliderID = jQuery("#sliderid").val();659 openPreviewSliderDialog(sliderID);660 });661 //replace url662 jQuery("#button_replace_url").click(function(){663 if(confirm(rev_lang.sure_to_replace_urls) == false)664 return(false);665 var data = {666 sliderid: jQuery("#sliderid").val(),667 url_from:jQuery("#replace_url_from").val(),668 url_to:jQuery("#replace_url_to").val()669 };670 //some ajax beautifyer671 UniteAdminRev.setAjaxLoaderID("loader_replace_url");672 UniteAdminRev.setAjaxHideButtonID("button_replace_url");673 UniteAdminRev.setSuccessMessageID("replace_url_success");674 UniteAdminRev.ajaxRequest("replace_image_urls" ,data);675 });676 jQuery('input[name="slider_type"]').each(function(){ if(jQuery(this).is(':checked')) jQuery(this).click(); }); //show grid settings for choosen setting677 jQuery('#reset_slide_button').click(function(){678 if(jQuery(this).css('opacity') == '0.5') return false;679 680 if(confirm(rev_lang.set_settings_on_all_slider) == false)681 return(false);682 683 var data = {sliderid: jQuery("#sliderid").val()};684 685 if(jQuery('input[name="reset-slide_transition"]').is(':checked')) data['slide_transition'] = jQuery('select[name="def-slide_transition"] option:selected').val();686 if(jQuery('input[name="reset-transition_duration"]').is(':checked')) data['transition_duration'] = jQuery('input[name="def-transition_duration"]').val();687 if(jQuery('input[name="reset-image_source_type"]').is(':checked')) data['image_source_type'] = jQuery('select[name="def-image_source_type"] option:selected').val(); 688 if(jQuery('input[name="reset-background_fit"]').is(':checked')){689 data['bg_fit'] = jQuery('#def-background_fit option:selected').val();690 if(data['bg_fit'] == 'percentage'){691 data['bg_fit_x'] = jQuery('input[name="def-bg_fit_x"]').val();692 data['bg_fit_y'] = jQuery('input[name="def-bg_fit_y"]').val();693 }694 }695 if(jQuery('input[name="reset-bg_position"]').is(':checked')){696 data['bg_position'] = jQuery('select[name="def-bg_position"] option:selected').val();697 if(data['bg_position'] == 'percentage'){698 data['bg_position_x'] = jQuery('input[name="def-bg_position_x"]').val();699 data['bg_position_y'] = jQuery('input[name="def-bg_position_y"]').val();700 }701 }702 if(jQuery('input[name="reset-bg_repeat"]').is(':checked')) data['bg_repeat'] = jQuery('select[name="def-bg_repeat"] option:selected').val();703 704 if(jQuery('input[name="reset-kenburn_effect"]').is(':checked')) data['kenburn_effect'] = (jQuery('input[name="def-kenburn_effect"]').is(':checked')) ? 'on' : 'off';705 if(jQuery('input[name="reset-kb_start_fit"]').is(':checked')) data['kb_start_fit'] = jQuery('input[name="def-kb_start_fit"]').val();706 if(jQuery('input[name="reset-kb_easing"]').is(':checked')) data['kb_easing'] = jQuery('select[name="def-kb_easing"] option:selected').val();707 if(jQuery('input[name="reset-kb_end_fit"]').is(':checked')) data['kb_end_fit'] = jQuery('input[name="def-kb_end_fit"]').val();708 if(jQuery('input[name="reset-kb_duration"]').is(':checked')) data['kb_duration'] = jQuery('input[name="def-kb_duration"]').val();709 710 711 if(jQuery('input[name="reset-kb_start_offset_x"]').is(':checked')) data['kb_start_offset_x'] = jQuery('input[name="def-kb_start_offset_x"]').val();712 if(jQuery('input[name="reset-kb_start_offset_y"]').is(':checked')) data['kb_start_offset_y'] = jQuery('input[name="def-kb_start_offset_y"]').val();713 714 if(jQuery('input[name="reset-kb_end_offset_x"]').is(':checked')) data['kb_end_offset_x'] = jQuery('input[name="def-kb_end_offset_x"]').val();715 if(jQuery('input[name="reset-kb_end_offset_y"]').is(':checked')) data['kb_end_offset_y'] = jQuery('input[name="def-kb_end_offset_y"]').val();716 if(jQuery('input[name="reset-kb_start_rotate"]').is(':checked')) data['kb_start_rotate'] = jQuery('input[name="def-kb_start_rotate"]').val();717 if(jQuery('input[name="reset-kb_end_rotate"]').is(':checked')) data['kb_end_rotate'] = jQuery('input[name="def-kb_end_rotate"]').val();718 719 UniteAdminRev.ajaxRequest('reset_slide_settings', data);720 });721 722 jQuery('.rs-reset-slide-setting').change(function(){723 jQuery('#reset_slide_button').css('opacity', '0.5');724 jQuery('.rs-reset-slide-setting').each(function(){725 if(jQuery(this).is(':checked')){726 727 jQuery('#reset_slide_button').css('opacity', '1');728 729 return true;730 }731 });732 });733 734 jQuery('.rs-reset-slide-setting').change();735 736 jQuery('.tp-moderncheckbox').each(function(){737 RevSliderSettings.onoffStatus(jQuery(this));738 });739 this.initSpinnerAdmin();740 }741 /**742 * init shortcode functionality in the slider new and slider edit views.743 */744 var initShortcode = function(){745 //select shortcode text when click on it.746 jQuery("#shortcode").focus(function(){747 this.select();748 });749 jQuery("#shortcode").click(function(){750 this.select();751 });752 //update shortcode753 jQuery("#alias").change(function(){754 updateShortcode();755 });756 jQuery("#alias").keyup(function(){757 updateShortcode();758 });759 updateShortcode();760 }761 /**762 * update slides order763 */764 var updateSlidesOrder = function(sliderID){765 var arrSlideHtmlIDs = jQuery( "#list_slides" ).sortable("toArray");766 //get slide id's from html (li) id's767 var arrIDs = [];768 var orderCounter = 0;769 jQuery(arrSlideHtmlIDs).each(function(index,value){770 var slideID = value.replace("slidelist_item_","");771 arrIDs.push(slideID);772 //update order visually773 orderCounter++;774 jQuery("#slidelist_item_"+slideID+" .order-text").text(orderCounter);775 });776 //save order777 var data = {arrIDs:arrIDs,sliderID:sliderID};778 jQuery("#saving_indicator").show();779 UniteAdminRev.ajaxRequest("update_slides_order" ,data,function(){780 jQuery("#saving_indicator").hide();781 });782 jQuery("#select_sortby").val("menu_order");783 }784 785 this.initNewsletterRoutine = function(){786 jQuery('#subscribe-to-newsletter').click(function(){787 var data = {788 email: jQuery('input[name="rs-email"]').val()789 }790 UniteAdminRev.ajaxRequest("subscribe_to_newsletter", data); //, '#subscribe-to-newsletter'791 });792 793 794 jQuery('#activate-unsubscribe').click(function(){795 jQuery('.subscribe-newsletter-wrap').hide();796 jQuery('#activate-unsubscribe').hide();797 jQuery('.unsubscribe-newsletter-wrap').show();798 jQuery('#unsubscribe-text').show();799 jQuery('#subscribe-text').hide();800 });801 jQuery('#cancel-unsubscribe').click(function(){802 jQuery('.subscribe-newsletter-wrap').show();803 jQuery('#activate-unsubscribe').show();804 jQuery('.unsubscribe-newsletter-wrap').hide();805 jQuery('#unsubscribe-text').hide();806 jQuery('#subscribe-text').show();807 });808 809 jQuery('#unsubscribe-to-newsletter').click(function(){810 var data = {811 email: jQuery('input[name="rs-email"]').val()812 }813 UniteAdminRev.ajaxRequest("unsubscribe_to_newsletter", data); //, '#unsubscribe-to-newsletter'814 });815 816 }817 818 /**819 * init "sliders list" view820 */821 this.initSlidersListView = function(){822 823 jQuery('body').on('click', '.rs-reload-shop', function(){824 showWaitAMinute({fadeIn:300,text:rev_lang.please_wait_a_moment});825 826 location.href = window.location.href+'&update_shop';827 });828 829 /**830 * add Template Slider through Import. Check for zip name831 **/832 jQuery('body').on('click', '.template_slider_item_import', function(){833 834 if(jQuery(this).hasClass('deny_download')){835 alert(rev_lang.this_template_requires_version+' '+jQuery(this).data('versionneed')+' '+rev_lang.of_slider_revolution);836 return false;837 }838 839 //modify the dialog with some informations 840 jQuery('.rs-zip-name').text(jQuery(this).data('zipname'));841 jQuery('.rs-uid').val(jQuery(this).data('uid'));842 843 //from server or from local file844 845 jQuery("#dialog_import_template_slider_from").dialog({846 modal:true,847 resizable:false,848 buttons:{849 "Local":function(){850 jQuery(".input_import_slider").val('');851 jQuery('.rs-import-slider-button').hide();852 853 jQuery("#dialog_import_template_slider").dialog({854 modal:true,855 resizable:false,856 width:600,857 height:350,858 closeOnEscape:true,859 dialogClass:"tpdialogs",860 buttons:{861 "Close":function(){862 jQuery(this).dialog("close");863 }864 },865 }); //dialog end866 867 868 jQuery(this).dialog("close");869 },870 "Online":function(){871 if(rs_plugin_validated){872 //show please wait873 showWaitAMinute({fadeIn:300,text:rev_lang.please_wait_a_moment});874 875 //get from server876 jQuery('#rs-import-template-from-server').submit();877 878 jQuery(this).dialog("close");879 }else{880 alert(rev_lang.this_feature_only_if_activated);881 }882 }883 }884 });885 886 jQuery('#close-template').click();887 888 });889 890 891 /**892 * add Template Slider893 **/894 jQuery('body').on('click', '.template_slider_item', function(){895 var slider_id = jQuery(this).data('sliderid');896 897 898 jQuery('#dialog_duplicate_slider').dialog({899 modal:true,900 resizable:false,901 title:'Import',902 width:250,903 height:200,904 closeOnEscape:true,905 dialogClass:"tpdialogs",906 buttons:{907 'Close':function(){908 jQuery(this).dialog("close");909 },910 'Import':function(){911 if(jQuery('#rs-duplicate-animation').val() == '') return false;912 913 UniteAdminRev.ajaxRequest('duplicate_slider', {sliderid:slider_id,title:jQuery('#rs-duplicate-animation').val()}, function(response){914 jQuery('#close-template').click();915 });916 }917 }918 });919 });920 921 jQuery(".input_import_slider").change(function(){922 if(jQuery(this).val() !== ''){923 jQuery('.rev-import-slider-button').show();924 }else{925 jQuery('.rev-import-slider-button').hide();926 }927 });928 929 jQuery("#button_import_template_slider").click(function(){930 jQuery('#template_area').addClass("show");931 return true;932 });933 934 //import slide dialog935 jQuery("#button_import_slider").click(function(){936 jQuery('.rev-import-slider-button').hide();937 938 jQuery(".input_import_slider").val('');939 940 jQuery("#dialog_import_slider").dialog({941 modal:true,942 resizable:false,943 width:600,944 height:350,945 closeOnEscape:true,946 dialogClass:"tpdialogs",947 buttons:{948 "Close":function(){949 jQuery(this).dialog("close");950 }951 },952 }); //dialog end953 });954 jQuery(".button_delete_slider").click(function(){955 956 var sliderID = this.id.replace("button_delete_","");957 var sliderTitle = jQuery("#slider_title_"+sliderID).text();958 if(confirm(rev_lang.really_want_to_delete+" '"+sliderTitle+"' ?") == false)959 return(false);960 UniteAdminRev.ajaxRequest("delete_slider_stay" ,{sliderid:sliderID}, function(){961 jQuery('li[data-id="'+sliderID+'"]').remove();962 });963 });964 //duplicate slider action965 jQuery('.button_duplicate_slider').click(function(){966 var sliderID = this.id.replace('button_duplicate_', '');967 968 jQuery('#dialog_duplicate_slider').dialog({969 modal:true,970 resizable:false,971 width:250,972 height:200,973 closeOnEscape:true,974 dialogClass:"tpdialogs",975 buttons:{976 'Close':function(){977 jQuery(this).dialog("close");978 },979 'Duplicate':function(){980 if(jQuery('#rs-duplicate-animation').val() == '') return false;981 982 UniteAdminRev.ajaxRequest('duplicate_slider' ,{sliderid:sliderID,title:jQuery('#rs-duplicate-animation').val()}, function(response){983 984 });985 }986 }987 });988 989 990 });991 //toggle Slider Favorite992 jQuery(".rev-toogle-fav").click(function(){993 var sliderID = this.id.replace('reg-toggle-id-','');994 UniteAdminRev.ajaxRequest('toggle_favorite' ,{id:sliderID},function(){995 var mi = jQuery('#reg-toggle-id-'+sliderID).find('i');996 if(mi.hasClass('eg-icon-star-empty')){997 mi.removeClass('eg-icon-star-empty');998 mi.addClass('eg-icon-star');999 }else{1000 mi.removeClass('eg-icon-star');1001 mi.addClass('eg-icon-star-empty');1002 }1003 });1004 });1005 //preview slider action1006 jQuery(".button_slider_preview").click(function(){1007 var sliderID = this.id.replace("button_preview_","");1008 openPreviewSliderDialog(sliderID);1009 });1010 //export slider action on slider overview1011 jQuery(".export_slider_overview").click(function(){1012 var sliderID = this.id.replace("export_slider_","");1013 var useDummy = false;//jQuery('input[name="export_dummy_images"]').is(':checked');1014 var urlAjaxExport = ajaxurl+"?action="+g_uniteDirPlugin+"_ajax_action&client_action=export_slider&dummy="+useDummy+"&nonce=" + g_revNonce;1015 urlAjaxExport += "&sliderid=" + sliderID;1016 location.href = urlAjaxExport;1017 1018 });1019 1020 1021 jQuery('body').on('click', '.rs-embed-slider', function(){1022 1023 var use_alias = jQuery(this).closest('li.tls-slide').find('.tls-alias').text();1024 1025 jQuery('.rs-dialog-embed-slider').find('.rs-example-alias').text(use_alias);1026 jQuery('.rs-dialog-embed-slider').find('.rs-example-alias-1').text('[rev_slider alias="'+use_alias+'"]');1027 1028 jQuery('.rs-dialog-embed-slider').dialog({1029 modal: true,1030 resizable:false,1031 minWidth:750,1032 minHeight:300,1033 closeOnEscape:true1034 });1035 });1036 1037 jQuery(".export_slider_standalone").click(function(){1038 1039 var sliderID = this.id.replace("export_slider_standalone_","");1040 var useDummy = false;//jQuery('input[name="export_dummy_images"]').is(':checked');1041 var urlAjaxExport = ajaxurl+"?action="+g_uniteDirPlugin+"_ajax_action&client_action=preview_slider&only_markup=true&dummy="+useDummy+"&nonce=" + g_revNonce;1042 urlAjaxExport += "&sliderid=" + sliderID;1043 location.href = urlAjaxExport;1044 1045 });1046 }1047 /**1048 * open preview slider dialog1049 */1050 var openPreviewSliderDialog = function(sliderID){1051 var rs_form = jQuery('#rs-preview-form');1052 1053 //set action and data1054 jQuery("#rs-client-action").val('preview_slider');1055 jQuery("#preview_sliderid").val(sliderID);1056 jQuery("#preview_slider_markup").val('false');1057 1058 rs_form.submit();1059 1060 jQuery('#rs-preview-wrapper').show();1061 1062 jQuery(window).trigger('resize');1063 }1064 /**1065 * get language array from the language list1066 */1067 var getLangsFromLangList = function(objList){1068 var arrLangs = [];1069 objList.find(".icon_slide_lang").each(function(){1070 var lang = jQuery(this).data("lang");1071 arrLangs.push(lang);1072 });1073 return(arrLangs);1074 }1075 /**1076 * filter langs float menu by the list of icons1077 * show only languages in the float menu that not exists in the icons list1078 * return number of available languages1079 */1080 var filterFloatMenuByListIcons = function(objList,operation){1081 var arrLangs = getLangsFromLangList(objList);1082 var numIcons = 0;1083 jQuery("#langs_float_wrapper li.item_lang").each(function(){1084 var objItem = jQuery(this);1085 var lang = objItem.data("lang");1086 var found = jQuery.inArray(lang,arrLangs);1087 if(operation != "add")1088 jQuery("#langs_float_wrapper li.operation_sap").hide();1089 if(jQuery.inArray(lang,arrLangs) == -1){1090 numIcons++;1091 objItem.show();1092 if(operation != "add")1093 jQuery("#langs_float_wrapper li.operation_sap").show();1094 }1095 else1096 objItem.hide();1097 });1098 return(numIcons);1099 }1100 /**1101 *1102 * init slides view posts related functions1103 */1104 t.initSlidesListViewPosts = function(sliderID){1105 initSlideListGlobals(sliderID);1106 //init sortby1107 jQuery("#select_sortby").change(function(){1108 jQuery("#slides_top_loader").show();1109 var data = {};1110 data.sliderID = sliderID;1111 data.sortby = jQuery(this).val();1112 UniteAdminRev.ajaxRequest("update_posts_sortby" ,data,function(){1113 jQuery("#slides_top_loader").html("Updated, reloading page...");1114 location.reload(true);1115 });1116 });1117 // delete single slide1118 jQuery(".button_delete_slide").click(function(){1119 var postID = jQuery(this).data("slideid");1120 var data = {slideID:postID,sliderID:sliderID};1121 if(confirm(g_messageDeleteSlide) == false)1122 return(false);1123 UniteAdminRev.ajaxRequest("delete_slide" ,data);1124 });1125 }1126 /**1127 * init slide list global functions1128 */1129 var initSlideListGlobals = function(sliderID){1130 //set the slides sortable, init save order1131 jQuery("#list_slides").sortable({1132 axis:"y",1133 handle:'.col-handle',1134 update:function(){updateSlidesOrder(sliderID)}1135 });1136 //publish / unpublish item1137 jQuery("#list_slides .icon_state").click(function(){1138 var objIcon = jQuery(this);1139 var objLoader = objIcon.siblings(".state_loader");1140 var slideID = objIcon.data("slideid");1141 var data = {slider_id:sliderID,slide_id:slideID};1142 objIcon.hide();1143 objLoader.show();1144 UniteAdminRev.ajaxRequest("toggle_slide_state" ,data,function(response){1145 objIcon.show();1146 objLoader.hide();1147 var currentState = response.state;1148 if(currentState == "published"){1149 objIcon.removeClass("state_unpublished").addClass("state_published").prop("title","Unpublish Slide");1150 }else{1151 objIcon.removeClass("state_published").addClass("state_unpublished").prop("title","Publish Slide");1152 }1153 });1154 });1155 //change image1156 jQuery(".col-image .slide_image").click(function(){1157 var slideID = this.id.replace("slide_image_","");1158 UniteAdminRev.openAddImageDialog(g_messageChangeImage,function(urlImage,imageID){1159 var data = {slider_id:sliderID,slide_id:slideID,url_image:urlImage,image_id:imageID};1160 UniteAdminRev.ajaxRequest("change_slide_image" ,data);1161 });1162 }).tipsy({1163 gravity:"s",1164 delayIn: 701165 });1166 }1167 /**1168 * init "slides list" view1169 */1170 t.initSlidesListView = function(sliderID){1171 initSlideListGlobals(sliderID);1172 //new slide1173 jQuery("#button_new_slide, #button_new_slide_top").click(function(){1174 var dialogTitle = jQuery("#button_new_slide").data("dialogtitle");1175 UniteAdminRev.openAddImageDialog(dialogTitle, function(obj){1176 var data = {sliderid:sliderID,obj:obj};1177 UniteAdminRev.ajaxRequest("add_slide" ,data);1178 },true); //allow multiple selection1179 });1180 //new transparent slide1181 jQuery("#button_new_slide_transparent, #button_new_slide_transparent_top").click(function(){1182 jQuery(this).hide();1183 jQuery(".new_trans_slide_loader").show();1184 var data = {sliderid:sliderID};1185 UniteAdminRev.ajaxRequest("add_slide" ,data);1186 });1187 //duplicate slide1188 jQuery(".button_duplicate_slide").click(function(){1189 var slideID = this.id.replace("button_duplicate_slide_","");1190 var data = {slideID:slideID,sliderID:sliderID};1191 UniteAdminRev.ajaxRequest("duplicate_slide" ,data);1192 });1193 //copy / move slides1194 jQuery(".button_copy_slide").click(function(){1195 if(jQuery(this).hasClass("button-disabled"))1196 return(false);1197 var dialogCopy = jQuery("#dialog_copy_move");1198 var textClose = dialogCopy.data("textclose");1199 var textUpdate = dialogCopy.data("textupdate");1200 var objButton = jQuery(this);1201 var buttons = {};1202 buttons[textUpdate] = function(){1203 var slideID = objButton.attr("id").replace("button_copy_slide_","");1204 var targetSliderID = jQuery("#selectSliders").val();1205 var operation = "copy";1206 if(jQuery("#radio_move").prop("checked") == "checked")1207 operation = "move";1208 var data = {slideID:slideID,1209 sliderID:sliderID,1210 targetSliderID:targetSliderID,1211 operation:operation};1212 var objLoader = objButton.siblings(".loader_copy");1213 objButton.hide();1214 objLoader.show();1215 UniteAdminRev.ajaxRequest("copy_move_slide" ,data);1216 jQuery(this).dialog("close");1217 };1218 jQuery("#dialog_copy_move").dialog({1219 modal:true,1220 resizable:false,1221 width:400,1222 height:300,1223 closeOnEscape:true,1224 dialogClass:"tpdialogs",1225 buttons:buttons1226 }); //dialog end1227 });1228 // delete single slide1229 jQuery(".button_delete_slide").click(function(){1230 var slideID = jQuery(this).data("slideid");1231 var data = {slideID:slideID,sliderID:sliderID};1232 if(confirm("Delete this slide?") == false)1233 return(false);1234 var objButton = jQuery(this);1235 var objLoader = objButton.siblings(".loader_delete");1236 objButton.hide();1237 objLoader.show();1238 UniteAdminRev.ajaxRequest("delete_slide" ,data);1239 });1240 //preview slide from the slides list:1241 jQuery("#list_slides .icon_slide_preview").click(function(){1242 var slideID = jQuery(this).data("slideid");1243 openPreviewSlideDialog(slideID,false);1244 });1245 }1246 t.saveEditSlide = function(slideID, isDemo){1247 if(!isDemo)1248 isDemo = false;1249 1250 var layers = UniteLayersRev.getLayers();1251 if(JSON && JSON.stringify)1252 layers = JSON.stringify(layers);1253 var data = {1254 slideid:slideID,1255 layers:layers1256 };1257 if(!isDemo){ //demo means static captions. This has1258 data.params = RevSliderSettings.getSettingsObject("form_slide_params");1259 data.params.slide_bg_color = jQuery("#slide_bg_color").val();1260 data.params.slide_bg_external = jQuery("#slide_bg_external").val();1261 data.params.bg_fit = jQuery("#slide_bg_fit").val();1262 data.params.bg_fit_x = jQuery("input[name='bg_fit_x']").val();1263 data.params.bg_fit_y = jQuery("input[name='bg_fit_y']").val();1264 data.params.bg_repeat = jQuery("#slide_bg_repeat").val();1265 data.params.bg_position = jQuery("#slide_bg_position").val();1266 data.params.bg_position_x = jQuery("input[name='bg_position_x']").val();1267 data.params.bg_position_y = jQuery("input[name='bg_position_y']").val();1268 data.params.bg_end_position_x = jQuery("input[name='bg_end_position_x']").val();1269 data.params.bg_end_position_y = jQuery("input[name='bg_end_position_y']").val();1270 var slideBgSetting = getSlideBgSettings(); //get new background options1271 if(typeof slideBgSetting === 'object' && !jQuery.isEmptyObject(slideBgSetting)){ //add new background options1272 for(key in slideBgSetting){1273 data.params[key] = slideBgSetting[key];1274 }1275 }1276 1277 //kenburns & pan zoom1278 data.params.kenburn_effect = (jQuery("input[name='kenburn_effect']").is(':checked')) ? 'on' : 'off';1279 //data.params.kb_rotation_start = jQuery("input[name='kb_rotation_start']").val();1280 //data.params.kb_rotation_end = jQuery("input[name='kb_rotation_end']").val();1281 data.params.kb_start_fit = jQuery("input[name='kb_start_fit']").val();1282 data.params.kb_end_fit = jQuery("input[name='kb_end_fit']").val();1283 data.params.bg_end_position = jQuery("select[name='bg_end_position']").val();1284 data.params.kb_duration = jQuery("input[name='kb_duration']").val();1285 data.params.kb_easing = jQuery("select[name='kb_easing']").val();1286 1287 data.params.slide_transition = [];1288 data.params.slot_amount = [];1289 data.params.transition_rotation = [];1290 data.params.transition_duration = [];1291 data.params.transition_ease_in = [];1292 data.params.transition_ease_out = [];1293 jQuery('.slide-trans-cur-ul li').each(function(){1294 data.params.slide_transition.push(jQuery(this).data('animval'));1295 data.params.slot_amount.push(jQuery(this).data('slot'));1296 data.params.transition_rotation.push(jQuery(this).data('rotation'));1297 data.params.transition_duration.push(jQuery(this).data('duration'));1298 data.params.transition_ease_in.push(jQuery(this).data('ease_in'));1299 data.params.transition_ease_out.push(jQuery(this).data('ease_out'));1300 });1301 1302 var csel = jQuery('.bgsrcchanger:checked').val();1303 1304 if(csel == 'vimeo' || csel == 'html5' || csel == 'youtube'){ //check for cover image, if not set, deny the saving1305 if(typeof(data.params.image_id) === 'undefined' || parseInt(data.params.image_id) == 0 || data.params.image_id == ''){1306 alert(rev_lang.cover_image_needs_to_be_set);1307 return false;1308 }1309 }1310 1311 1312 //remove image_url if we are a stream1313 var gallery_type = jQuery('input[name="rs-gallery-type"]').val();1314 switch(gallery_type){1315 case 'gallery':1316 break;1317 case 'posts':1318 case 'woocommerce':1319 case 'facebook':1320 case 'twitter':1321 case 'instagram':1322 case 'flickr':1323 case 'youtube':1324 case 'vimeo':1325 data.params.image_url = '';1326 break;1327 }1328 1329 //console.log(tinyMCE.get('slide_description').getContent());1330 //data.params.slide_description = 1331 1332 }1333 1334 1335 //new part, settings that can be saved in slides1336 data.settings = {};1337 1338 /**1339 * Add Horizontal/Vetical Lines1340 */1341 var hor_lines = [];1342 jQuery('#hor-css-linear .helplines').each(function(){1343 hor_lines.push(jQuery(this).css('left'));1344 });1345 1346 var ver_lines = [];1347 jQuery('#ver-css-linear .helplines').each(function(){1348 ver_lines.push(jQuery(this).css('top'));1349 });1350 1351 data.settings['hor_lines'] = hor_lines;1352 data.settings['ver_lines'] = ver_lines;1353 if(!isDemo){1354 UniteAdminRev.setAjaxHideButtonID("button_save_slide,button_save_slide-tb");1355 UniteAdminRev.setAjaxLoaderID("loader_update");1356 UniteAdminRev.setSuccessMessageID("update_slide_success");1357 UniteAdminRev.ajaxRequest("update_slide", data);1358 }else{1359 UniteAdminRev.setAjaxHideButtonID("button_save_static_slide,button_save_static_slide-tb");1360 UniteAdminRev.setAjaxLoaderID("loader_update");1361 UniteAdminRev.setSuccessMessageID("update_slide_success");1362 UniteAdminRev.ajaxRequest("update_static_slide", data);1363 }1364 }1365 1366 1367 /**1368 * init "edit slide" view1369 */1370 this.initEditSlideView = function(slideID,sliderID,is_static){1371 1372 jQuery('body').on('click', '.rs-reload-shop', function(){1373 if(confirm(rev_lang.unsaved_data_will_be_lost_proceed)){1374 showWaitAMinute({fadeIn:300,text:rev_lang.please_wait_a_moment});1375 1376 location.href = window.location.href+'&update_shop';1377 }1378 });1379 1380 /**1381 * add Template Slider through Import, then add specific slide to current Slider and open it. Check for zip name1382 **/1383 jQuery('body').on('click', '.template_slide_item_import', function(){1384 var data = jQuery(this).find('.template_slide_item_img');1385 1386 if(data.hasClass('deny_download')){1387 alert(rev_lang.this_template_requires_version+' '+data.data('versionneed')+' '+rev_lang.of_slider_revolution);1388 return false;1389 }1390 1391 if(confirm(rev_lang.unsaved_data_will_be_lost_proceed)){1392 1393 //modify the dialog with some informations 1394 jQuery('.rs-zip-name').text(data.data('zipname'));1395 jQuery('.rs-uid').val(data.data('uid'));1396 jQuery('.rs-slide-number').val(data.data('slidenumber'));1397 jQuery('.rs-slider-id').val(sliderID);1398 if(is_static){1399 jQuery('.rs-slide-id').val('static_'+sliderID);1400 }else{1401 jQuery('.rs-slide-id').val(slideID);1402 }1403 1404 jQuery("#dialog_import_template_slide_from").dialog({1405 modal:true,1406 resizable:false,1407 buttons:{1408 "Local":function(){1409 jQuery(".input_import_slider").val('');1410 jQuery('.rs-import-slider-button').hide();1411 1412 jQuery("#dialog_import_template_slide").dialog({1413 modal:true,1414 resizable:false,1415 width:600,1416 height:350,1417 closeOnEscape:true,1418 dialogClass:"tpdialogs",1419 buttons:{1420 "Close":function(){1421 jQuery(this).dialog("close");1422 }1423 },1424 }); //dialog end1425 },1426 "Online":function(){1427 if(rs_plugin_validated){1428 //show please wait1429 showWaitAMinute({fadeIn:300,text:rev_lang.please_wait_a_moment});1430 1431 //get from server1432 jQuery('#rs-import-slide-template-from-server').submit();1433 1434 jQuery(this).dialog("close");1435 }else{1436 alert(rev_lang.this_feature_only_if_activated);1437 }1438 }1439 }1440 });1441 1442 jQuery('#close-template').click();1443 }1444 });1445 1446 1447 1448 // TOGGLE SOME ACCORDION1449 jQuery('.tp-accordion').click(function() {1450 var tpacc=jQuery(this);1451 if (tpacc.hasClass("tpa-closed")) {1452 tpacc.parent().parent().parent().find('.tp-closeifotheropen').each(function() {1453 jQuery(this).slideUp(300);1454 jQuery(this).parent().find('.tp-accordion').addClass("tpa-closed").addClass("box_closed").find('.postbox-arrow2').html("+");1455 });1456 tpacc.parent().find('.toggled-content').slideDown(300);1457 tpacc.removeClass("tpa-closed").removeClass("box_closed");1458 tpacc.find('.postbox-arrow2').html("-");1459 } else {1460 tpacc.parent().find('.toggled-content').slideUp(300);1461 tpacc.addClass("tpa-closed").addClass("box_closed");1462 tpacc.find('.postbox-arrow2').html("+");1463 }1464 })1465 // MAKE MAX WIDTH OF CONTAINERS.1466 jQuery('.mw960').each(function() {1467 var newmw = jQuery('#divLayers').width();1468 if (newmw<960) newmw=960;1469 jQuery(this).css({maxWidth:newmw+"px"});1470 })1471 // SORTING AND DEPTH SELECTOR1472 jQuery('#button_sort_depth').on('click',function() {1473 jQuery('.layer_sortbox').addClass("depthselected");1474 jQuery('.layer_sortbox').removeClass("timeselected");1475 });1476 jQuery('#button_sort_time').on('click',function() {1477 jQuery('.layer_sortbox').removeClass("depthselected");1478 jQuery('.layer_sortbox').addClass("timeselected");1479 });1480 //add slide top link1481 jQuery("#link_add_slide").click(function(){1482 var data = { sliderid:sliderID };1483 1484 jQuery("#loader_add_slide").show();1485 UniteAdminRev.ajaxRequest("add_slide_fromslideview", data);1486 });1487 1488 //add bulk slide top link1489 jQuery("#link_add_bulk_slide").click(function(){1490 UniteAdminRev.openAddImageDialog(rev_lang.add_bulk_slides, function(obj){1491 var data = {sliderid:sliderID,obj:obj};1492 UniteAdminRev.ajaxRequest("add_bulk_slide", data);1493 1494 },true); //allow multiple selection1495 });1496 1497 jQuery('body').on('click', '.template_item', function(){ 1498 if(confirm(rev_lang.unsaved_data_will_be_lost_proceed)){1499 var data = { slider_id:sliderID };1500 1501 data['slide_id'] = jQuery(this).data('slideid');1502 if(is_static){1503 data['redirect_id'] = 'static_'+sliderID;1504 }else{1505 data['redirect_id'] = slideID; //is set in slide.php1506 }1507 1508 UniteAdminRev.ajaxRequest('copy_slide_to_slider', data, function(){1509 jQuery('#close-template').click();1510 });1511 }1512 });1513 1514 //save slide actions1515 jQuery("#button_save_slide").click(function(){1516 t.saveEditSlide(slideID);1517 });1518 jQuery("#button_save_slide-tb").click(function(){1519 t.saveEditSlide(slideID);1520 });1521 //save slide actions1522 jQuery("#button_save_static_slide").click(function(){1523 t.saveEditSlide(slideID, true);1524 });1525 jQuery("#button_save_static_slide-tb").click(function(){1526 t.saveEditSlide(slideID, true);1527 });1528 //change image actions1529 jQuery("#button_change_image").click(function(){1530 UniteAdminRev.openAddImageDialog(rev_lang.select_slide_img,function(urlImage,imageID){1531 if(imageID == undefined)1532 imageID = "";1533 //set visual image1534 jQuery("#divbgholder").css("background-image","url("+urlImage+")");1535 jQuery('#slide_selector .list_slide_links li.selected .slide-media-container ').css("background-image","url("+urlImage+")")1536 //update setting input1537 jQuery("#image_url").val(urlImage);1538 jQuery("#image_id").val(imageID);1539 1540 UniteLayersRev.changeSlotBGs();1541 1542 jQuery('.bgsrcchanger:checked').click();1543 if(jQuery('input[name="kenburn_effect"]').is(':checked')){1544 jQuery('input[name="kb_start_fit"]').change();1545 }1546 }); //dialog1547 }); //change image click.1548 1549 1550 //change image actions1551 jQuery('.button_change_video').click(function(){1552 1553 var the_target = jQuery(this).data('inptarget');1554 1555 UniteAdminRev.openAddVideoDialog(rev_lang.select_slide_video,function(urlVideo,videoID){1556 //set URL to the input fields1557 jQuery('input[name="'+the_target+'"]').val(urlVideo);1558 1559 jQuery('#html5_url_ogv, #html5_url_webm, #html5_url_mp4').change();1560 }); //dialog1561 }); //change image click.1562 1563 // slide options hide / show1564 jQuery("#link_hide_options").click(function(){1565 if(jQuery("#slide_params_holder").is(":visible") == true){1566 jQuery("#slide_params_holder").hide("slow");1567 jQuery(this).text(rev_lang.show_slide_opt).addClass("link-selected");1568 }else{1569 jQuery("#slide_params_holder").show("slow");1570 jQuery(this).text(rev_lang.hide_slide_opt).removeClass("link-selected");1571 }1572 });1573 //preview slide actions - open preveiw dialog1574 jQuery("#button_preview_slide").click(function(){1575 openPreviewSlideDialog(slideID,true);1576 });1577 //preview slide actions - open preveiw dialog1578 jQuery("#button_preview_slide-tb").click(function(){1579 openPreviewSlideDialog(slideID,true);1580 });1581 //init background options1582 jQuery("#radio_back_image, #radio_back_trans, #radio_back_solid, #radio_back_external, #radio_back_youtube, #radio_back_htmlvideo").click(function(){1583 var currentType = jQuery("#background_type").val();1584 var bgType = jQuery(this).data("bgtype");1585 if(currentType == bgType)1586 return(true);1587 //disable image button1588 if(bgType == "image")1589 jQuery("#button_change_image").removeClass("button-disabled");1590 else1591 jQuery("#button_change_external").addClass("button-disabled");1592 if(bgType == "solid")1593 jQuery("#slide_bg_color").removeClass("disabled").prop("disabled","");1594 else1595 jQuery("#slide_bg_color").addClass("disabled").prop("disabled","disabled");1596 if(bgType == "external"){1597 jQuery("#slide_bg_external").removeClass("disabled").prop("disabled","");1598 jQuery("#button_change_image").removeClass("button-disabled");1599 jQuery("#button_change_external").removeClass("button-disabled");1600 }else{1601 jQuery("#slide_bg_external").addClass("disabled").prop("disabled","disabled");1602 jQuery("#button_change_external").addClass("button-disabled");1603 }1604 1605 jQuery("#background_type").val(bgType);1606 1607 setSlideBGByType(bgType);1608 });1609 jQuery("#button_change_external").click(function(){1610 var bgType = jQuery("#radio_back_external:checked").data("bgtype");1611 if(bgType == "external"){1612 jQuery("#slide_bg_external").removeClass("disabled").prop("disabled","");1613 jQuery("#button_change_image").removeClass("button-disabled");1614 setSlideBGByType(bgType);1615 1616 if(jQuery('input[name="kenburn_effect"]').is(':checked')){1617 jQuery('input[name="kb_start_fit"]').change();1618 }1619 1620 UniteLayersRev.changeSlotBGs();1621 }1622 });1623 //on change bg color event1624 UniteAdminRev.setColorPickerCallback(function(){1625 var bgType = jQuery("#background_type").val();1626 if(bgType == "solid"){1627 var bgColor = jQuery("#slide_bg_color").val();1628 jQuery("#divbgholder").css("background-color",bgColor);1629 jQuery('#slide_selector .list_slide_links li.selected .slide-media-container ').css({backgroundColor:bgColor});1630 } 1631 });1632 //on change title event1633 jQuery("#title").on('input',function(e){1634 jQuery(".slide_title").text(jQuery("#title").val());1635 });1636 jQuery(".list_slide_links").sortable({1637 items: "li:not(.eg-drag-disabled)",1638 update:function(){updateSlidesOrderEdit(sliderID)}1639 });1640 /**1641 * update slides order in slide edit1642 */1643 var updateSlidesOrderEdit = function(sliderID){1644 var arrSlideHtmlIDs = jQuery( ".list_slide_links" ).sortable("toArray");1645 //get slide id's from html (li) id's1646 var arrIDs = [];1647 jQuery(arrSlideHtmlIDs).each(function(index,value){1648 var slideID = value.replace("slidelist_item_","");1649 arrIDs.push(slideID);1650 });1651 //save order1652 var data = {arrIDs:arrIDs,sliderID:sliderID};1653 jQuery("#loader_add_slide").show();1654 UniteAdminRev.ajaxRequest("update_slides_order" ,data,function(){1655 jQuery("#loader_add_slide").hide();1656 });1657 }1658 jQuery('.inputDatePicker').datepicker({1659 dateFormat : 'dd-mm-yy 00:00'1660 });1661 // delete single slide1662 jQuery("#button_delete_slide").click(function(){1663 var data = {slideID:slideID,sliderID:sliderID};1664 if(confirm(g_messageDeleteSlide) == false)1665 return(false);1666 UniteAdminRev.ajaxRequest("delete_slide" ,data);1667 });1668 if(jQuery('input[name="load_googlefont"]:checked').val() == 'false'){1669 jQuery('#load_googlefont_row').siblings('.spanSettingsStaticText').remove();1670 jQuery('#load_googlefont_row').remove();1671 jQuery('#google_font_row').remove();1672 jQuery('#load_googlefont').closest('.postbox.unite-postbox').hide();1673 }1674 1675 1676 // delete single slide1677 jQuery('body').on('click', '.slide-remove', function(){1678 var slideID = jQuery(this).closest('li').attr("id").replace('slidelist_item_', '');1679 var data = {slideID:slideID,sliderID:sliderID};1680 1681 if(confirm("Delete this slide?") == false)1682 return(false);1683 var objButton = jQuery(this);1684 var objLoader = objButton.siblings(".loader_delete");1685 1686 objButton.hide();1687 objLoader.show();1688 1689 var curlayer = jQuery(this).closest('li');1690 1691 var do_request = (curSlideID == slideID) ? 'delete_slide' : 'delete_slide_stay';1692 1693 UniteAdminRev.ajaxRequest(do_request, data, function(response){1694 curlayer.remove();1695 });1696 });1697 1698 jQuery('body').on('click', '.slide-published.pubclickable, .slide-unpublished.pubclickable', function(){1699 var li = jQuery(this).closest('li'),1700 theslideID = li.attr("id").replace('slidelist_item_', ''),1701 data = {slider_id:sliderID,slide_id:theslideID};1702 objButton = jQuery(this);1703 1704 li.find('.slide-published').fadeOut(200);1705 li.find('.slide-unpublished').fadeOut(200);1706 UniteAdminRev.ajaxRequest("toggle_slide_state" ,data,function(response){1707 1708 var currentState = response.state;1709 if(currentState == 'published'){1710 li.find('.slide-published').removeClass("pubclickable").fadeIn(200);1711 li.find('.slide-unpublished').addClass("pubclickable").fadeIn(200);1712 if(curSlideID == theslideID) jQuery('select[name="state"] option[value="published"]').attr('selected', true);1713 }else{1714 li.find('.slide-published').addClass("pubclickable").fadeIn(200);1715 li.find('.slide-unpublished').removeClass("pubclickable").fadeIn(200);1716 if(curSlideID == theslideID) jQuery('select[name="state"] option[value="unpublished"]').attr('selected', true);1717 }1718 });1719 return false;1720 });1721 1722 1723 jQuery('body').on('click', '.slide-hero-unpublished.pubclickable', function(){1724 var li = jQuery(this).closest('li'),1725 ul = jQuery(this).closest('ul'),1726 theslideID = li.attr("id").replace('slidelist_item_', ''),1727 data = {slider_id:sliderID,slide_id:theslideID};1728 objButton = jQuery(this);1729 1730 UniteAdminRev.ajaxRequest("toggle_hero_slide", data,function(response){1731 1732 ul.find('.slide-hero-published').removeClass('slide-hero-published').addClass('slide-hero-unpublished').addClass('pubclickable');1733 li.find('.slide-hero-unpublished').removeClass("pubclickable").removeClass('slide-hero-unpublished').addClass('slide-hero-published');1734 1735 });1736 return false;1737 });1738 1739 1740 jQuery('body').on('click', '.slide-duplicate', function(){1741 var cont = jQuery(this).closest('li');1742 var slideID = cont.attr("id").replace('slidelist_item_', '');1743 var data = {slider_id:sliderID,slide_id:slideID};1744 1745 var objButton = jQuery(this);1746 objButton.hide();1747 1748 var data = {slideID:slideID,sliderID:sliderID};1749 UniteAdminRev.ajaxRequest("duplicate_slide_stay", data, function(response){1750 objButton.show();1751 1752 if(response.success == true){1753 var new_ele = cont.clone(true).insertAfter(cont);1754 1755 new_ele.attr('id', 'slidelist_item_'+response.id);1756 1757 if(new_ele.hasClass('selected')){ //current slide duplicated1758 new_ele.removeClass('selected');1759 jQuery('<a href="#" class="slide-link-toolbar-button slide-moveto"><span class=""><i class="eg-icon-forward"></i><span>'+rev_lang.copy_move+'</span></span></a>').insertAfter(new_ele.find('.slide-remove'));1760 }1761 1762 var ahref = new_ele.find('a').first().attr('href');1763 if(ahref == 'javascript:void(0)'){1764 ahref = '?page=revslider&view=slide&id='+ response.id;1765 }else{1766 ahref.replace(slideID, response.id);1767 }1768 1769 new_ele.find('a').first().attr('href', ahref);1770 1771 var num = 0;1772 jQuery('.list_slide_links li').each(function(){1773 jQuery(this).find('.slide-link-nr').text('#'+num);1774 num++;1775 });1776 1777 }1778 });1779 1780 });1781 1782 1783 jQuery('body').on('click', '.slide-moveto', function(){1784 var cont = jQuery(this).closest('li');1785 1786 var data = {slider_id:sliderID,slide_id:slideID};1787 1788 var objButton = jQuery(this);1789 var dialogCopy = jQuery("#dialog_copy_move");1790 var textClose = dialogCopy.data("textclose");1791 var textUpdate = dialogCopy.data("textupdate");1792 var objButton = jQuery(this);1793 var buttons = {};1794 buttons[textUpdate] = function(){1795 var slideID = cont.attr("id").replace('slidelist_item_', '');1796 var targetSliderID = jQuery("#selectSliders").val();1797 var operation = "copy";1798 1799 1800 if(jQuery("#radio_move").prop("checked") == "checked" || jQuery("#radio_move").prop("checked") == true)1801 operation = "move";1802 1803 var data = {slideID:slideID,1804 sliderID:sliderID,1805 targetSliderID:targetSliderID,1806 operation:operation};1807 var objLoader = objButton.siblings(".loader_copy");1808 objButton.hide();1809 UniteAdminRev.ajaxRequest("copy_move_slide_stay", data, function(response){1810 objButton.show();1811 1812 if(operation == 'move'){1813 cont.remove();1814 }1815 });1816 jQuery(this).dialog("close");1817 };1818 jQuery("#dialog_copy_move").dialog({1819 modal:true,1820 resizable:false,1821 width:400,1822 height:300,1823 closeOnEscape:true,1824 dialogClass:"tpdialogs",1825 buttons:buttons1826 }); //dialog end1827 1828 });1829 1830 1831 jQuery('body').on('click', '.slide-add-as-template', function(){1832 1833 if(confirm(rev_lang.unsaved_changes_will_not_be_added)){1834 var cont = jQuery(this).closest('li');1835 var title = prompt(rev_lang.please_enter_a_slide_title, cont.find('.slidetitleinput').val());1836 var slider_width = jQuery('input[name="rs-grid-width"]').val();1837 var slider_height = jQuery('input[name="rs-grid-height"]').val();1838 var slideID = cont.attr("id").replace('slidelist_item_', '');1839 1840 var settings = {'width': slider_width,'height': slider_height};1841 1842 if (title != null) {1843 var objButton = jQuery(this);1844 objButton.hide();1845 1846 var data = {'slideID':slideID,'title':title,'settings':settings};1847 1848 UniteAdminRev.ajaxRequest('add_slide_to_template', data, function(response){1849 objButton.show();1850 1851 //reload template Slider1852 jQuery('#template_area').replaceWith( response.HTML );1853 1854 templateSelectorHandling();1855 });1856 }1857 }1858 1859 });1860 1861 1862 //quick lang change by lang icon1863 jQuery("#rev_lang_list").delegate(".icon_slide_lang, .icon_slide_lang_add","click",function(event){1864 event.stopPropagation()1865 var pos = UniteAdminRev.getAbsolutePos(this);1866 var posLeft = pos[0] - 135;1867 var posTop = pos[1] - 60;1868 var objIcon = jQuery(this);1869 var operation = objIcon.data("operation");1870 var isParent = objIcon.data("isparent");1871 if(operation == "add")1872 jQuery("#langs_float_wrapper .item_operation").hide();1873 else{1874 jQuery("#langs_float_wrapper .item_operation").show();1875 if(isParent == true)1876 jQuery("#langs_float_wrapper .item_operation.operation_delete").hide();1877 }1878 var objList = objIcon.parents(".list_slide_icons");1879 filterFloatMenuByListIcons(objList,operation);1880 jQuery("#langs_float_wrapper").show().css({left:posLeft,top:posTop});1881 jQuery("#langs_float_wrapper").data("iconid",this.id);1882 });1883 jQuery("body").click(function(){1884 jQuery("#langs_float_wrapper").hide();1885 });1886 //switch the language1887 jQuery("#slides_langs_float li a").click(function(){1888 var obj = jQuery(this);1889 var lang = obj.data("lang");1890 var iconID = jQuery("#langs_float_wrapper").data("iconid");1891 if(!iconID)1892 return(true);1893 var objIcon = jQuery("#"+iconID);1894 var objList = objIcon.parents(".list_slide_icons");1895 //set operation1896 var operation = obj.data("operation");1897 if(operation == undefined || !operation)1898 operation = objIcon.data("operation");1899 if(operation == undefined || !operation)1900 operation = "update";1901 var currentLang = objIcon.data("lang");1902 var slideID = objIcon.data("slideid");1903 var realSlideID = objIcon.data("origid");1904 if(currentLang == lang)1905 return(true);1906 //show the loader1907 if(operation != "preview"){1908 objIcon.siblings(".icon_lang_loader").show();1909 objIcon.hide();1910 }1911 if(operation == "edit"){1912 var urlSlide = g_patternViewSlide.replace("[slideid]",slideID);1913 location.href = urlSlide;1914 return(true);1915 }1916 if(operation == "preview"){1917 openPreviewSliderDialog(sliderID);1918 //openPreviewSlideDialog(slideID,false);1919 return(true);1920 }1921 1922 if(operation == 'delete' || operation == 'update') realSlideID = slideID;1923 1924 var data = {sliderid:sliderID,slideid:realSlideID,lang:lang,operation:operation};1925 1926 UniteAdminRev.ajaxRequest("slide_lang_operation", data,function(response){1927 objIcon.siblings(".icon_lang_loader").hide();1928 //nandle after response1929 switch(response.operation){1930 case "update":1931 objIcon.attr("src",response.url_icon);1932 objIcon.attr("title",response.title);1933 objIcon.data("lang",lang);1934 objIcon.show();1935 break;1936 case "add":1937 objIcon.show();1938 objIcon.parent().before(response.html);1939 //hide the add icon if all langs included1940 if(response.isAll == true)1941 objList.find(".icon_slide_lang_add").hide();1942 break;1943 case "delete":1944 objIcon.parent().remove();1945 //show the add icon1946 objList.find(".icon_slide_lang_add").show();1947 break;1948 }1949 });1950 });1951 1952 RevSliderSettings.onoffStatus(jQuery('input[name="stream_do_cover"]'));1953 RevSliderSettings.onoffStatus(jQuery('input[name="stream_do_cover_both"]'));1954 RevSliderSettings.onoffStatus(jQuery('input[name="kenburn_effect"]'));1955 RevSliderSettings.onoffStatus(jQuery('input[name="save_performance"]'));1956 RevSliderSettings.onoffStatus(jQuery('input[name="video_force_cover"]'));1957 RevSliderSettings.onoffStatus(jQuery('input[name="video_nextslide"]'));1958 RevSliderSettings.onoffStatus(jQuery('input[name="video_allowfullscreen"]'));1959 RevSliderSettings.onoffStatus(jQuery('input[name="video_force_rewind"]'));1960 RevSliderSettings.onoffStatus(jQuery('input[name="video_mute"]'));1961 RevSliderSettings.onoffStatus(jQuery('input[name="thumb_for_admin"]'));1962 1963 jQuery('#video_force_cover').change(function(){1964 if(jQuery(this).is(':checked')){1965 jQuery('#video_dotted_overlay_wrap').show();1966 }else{1967 jQuery('#video_dotted_overlay_wrap').hide();1968 }1969 });1970 jQuery('#video_force_cover').change();1971 }//init slide view1972 /**1973 * open preview slide dialog1974 */1975 var openPreviewSlideDialog = function(slideID,useParams){1976 if(useParams === undefined)1977 useParams = true;1978 var rs_form = jQuery('#rs-preview-form');1979 1980 //set action and data1981 1982 var objData = { slideid:slideID };1983 1984 if(useParams == true){1985 objData.params = RevSliderSettings.getSettingsObject("form_slide_params"),1986 objData.params.slide_bg_color = jQuery("#slide_bg_color").val();1987 objData.params.slide_bg_external = jQuery("#slide_bg_external").val();1988 objData.params.bg_fit = jQuery("#slide_bg_fit").val();1989 objData.params.bg_fit_x = jQuery("input[name='bg_fit_x']").val();1990 objData.params.bg_fit_y = jQuery("input[name='bg_fit_y']").val();1991 objData.params.bg_repeat = jQuery("#slide_bg_repeat").val();1992 objData.params.bg_position = jQuery("#slide_bg_position").val();1993 objData.params.bg_position_x = jQuery("input[name='bg_position_x']").val();1994 objData.params.bg_position_y = jQuery("input[name='bg_position_y']").val();1995 objData.params.bg_end_position_x = jQuery("input[name='bg_end_position_x']").val();1996 objData.params.bg_end_position_y = jQuery("input[name='bg_end_position_y']").val();1997 //kenburns & pan zoom1998 objData.params.kenburn_effect = (jQuery("input[name='kenburn_effect']").is(':checked')) ? 'on' : 'off';1999 objData.params.kb_start_fit = jQuery("input[name='kb_start_fit']").val();2000 objData.params.kb_end_fit = jQuery("input[name='kb_end_fit']").val();2001 objData.params.bg_end_position = jQuery("select[name='bg_end_position']").val();2002 objData.params.kb_duration = jQuery("input[name='kb_duration']").val();2003 objData.params.kb_easing = jQuery("select[name='kb_easing']").val();2004 objData.layers = UniteLayersRev.getLayers();2005 2006 }2007 var jsonData = JSON.stringify(objData);2008 2009 jQuery("#preview-slide-data").val(jsonData);2010 jQuery("#rs-client-action").val('preview_slide');2011 2012 rs_form.submit();2013 2014 jQuery('#rs-preview-wrapper').show();2015 2016 jQuery(window).trigger('resize');2017 }2018 2019 2020 /**2021 * set slide background by type (image, solid, bg).2022 */2023 var setSlideBGByType = function(bgType){2024 switch(bgType){2025 case "image":2026 var urlImage = jQuery("#image_url").val();2027 jQuery("#divbgholder").css("background-image","url('"+urlImage+"')");2028 jQuery("#divbgholder").css("background-color","transparent");2029 jQuery("#divbgholder").removeClass("trans_bg");2030 if(jQuery('input[name="kenburn_effect"]').is(':checked')){2031 jQuery('input[name="kb_start_fit"]').change();2032 }2033 break;2034 case "trans":2035 jQuery("#divbgholder").css("background-image","none");2036 jQuery("#divbgholder").css("background-color","transparent");2037 jQuery("#divbgholder").addClass("trans_bg");2038 break;2039 case "solid":2040 jQuery("#divbgholder").css("background-image","none");2041 jQuery("#divbgholder").removeClass("trans_bg");2042 var bgColor = jQuery("#slide_bg_color").val();2043 jQuery("#divbgholder").css("background-color",bgColor);2044 jQuery('#slide_selector .list_slide_links li.selected .slide-media-container ').css({backgroundColor:bgColor});2045 break;2046 case "external":2047 var urlImage = jQuery("#slide_bg_external").val();2048 jQuery("#divbgholder").css("background-image","url('"+urlImage+"')");2049 jQuery("#divbgholder").css("background-color","transparent");2050 jQuery("#divbgholder").removeClass("trans_bg");2051 if(jQuery('input[name="kenburn_effect"]').is(':checked')){2052 jQuery('input[name="kb_start_fit"]').change();2053 }2054 break;2055 case "youtube":2056 var urlImage = jQuery("#image_url").val();2057 jQuery('#divbgholder').css("background-image","url('"+urlImage+"')");2058 jQuery('#divbgholder').css("background-color","transparent");2059 jQuery('#divbgholder').removeClass("trans_bg");2060 2061 break;2062 case "html5":2063 var urlImage = jQuery("#image_url").val();2064 jQuery("#divbgholder").css("background-image","url('"+urlImage+"')");2065 jQuery("#divbgholder").css("background-color","transparent");2066 jQuery("#divbgholder").removeClass("trans_bg");2067 break;2068 }2069 }2070 var getSlideBgSettings = function(){2071 var retParams = new Object;2072 retParams['bg_fit'] = jQuery('#slide_bg_fit').val();2073 if(retParams['bg_fit'] == 'percentage'){2074 retParams['bg_fit_x'] = jQuery('input[name="bg_fit_x"]').val();2075 retParams['bg_fit_y'] = jQuery('input[name="bg_fit_y"]').val();2076 }2077 retParams['bg_position'] = jQuery('#slide_bg_position').val();2078 if(retParams['bg_position'] == 'percentage'){2079 retParams['bg_position_x'] = jQuery('input[name="bg_position_x"]').val();2080 retParams['bg_position_y'] = jQuery('input[name="bg_position_y"]').val();2081 }2082 retParams['bg_end_position'] = jQuery('#slide_bg_end_position').val();2083 if(retParams['bg_end_position'] == 'percentage'){2084 retParams['bg_end_position_x'] = jQuery('input[name="bg_end_position_x"]').val();2085 retParams['bg_end_position_y'] = jQuery('input[name="bg_end_position_y"]').val();2086 }2087 retParams['bg_repeat'] = jQuery('#slide_bg_repeat').val();2088 return retParams;2089 }2090 /**2091 * global style part2092 */2093 var g_codemirrorCssDynamic = null;2094 var g_codemirrorCssStatic = null;2095 var staticStyles = null;2096 var urlStaticCssCaptions = null;2097 /**2098 * set static captions url for refreshing when needed2099 */2100 t.setStaticCssCaptionsUrl = function(url){2101 urlStaticCssCaptions = url;2102 }2103 /**2104 * get static captions url for refreshing when needed2105 */2106 t.getUrlStaticCssCaptions = function(){2107 return urlStaticCssCaptions;2108 }2109 t.initGlobalStyles = function(){2110 initGlobalCssAccordion();2111 initGlobalCssEditor();2112 }2113 t.setCodeMirrorStaticEditor = function(){2114 g_codemirrorCssStatic = CodeMirror.fromTextArea(document.getElementById("textarea_edit_static"), { lineNumbers: true });2115 }2116 t.setCodeMirrorDynamicEditor = function(){2117 g_codemirrorCssDynamic = CodeMirror.fromTextArea(document.getElementById("textarea_show_dynamic_styles"), {2118 lineNumbers: true,2119 readOnly: true2120 });2121 }2122 var initGlobalCssAccordion = function(){2123 jQuery("#css-static-accordion").accordion({2124 heightStyle: "content",2125 activate: function(event, ui){2126 if(g_codemirrorCssStatic != null) g_codemirrorCssStatic.refresh();2127 if(g_codemirrorCssDynamic != null) g_codemirrorCssDynamic.refresh();2128 }2129 });2130 }2131 var initGlobalCssEditor = function(){2132 jQuery('#button_edit_css_global').click(function(){2133 //if(!UniteLayersRev.getLayerGeneralParamsStatus()) return false; //false if fields are disabled2134 jQuery("#css-static-accordion").accordion({ active: 1 });2135 UniteAdminRev.ajaxRequest("get_static_css","",function(response){2136 var cssData = response.data;2137 if(g_codemirrorCssStatic != null)2138 g_codemirrorCssStatic.setValue(cssData);2139 else{2140 jQuery("#textarea_edit_static").val(cssData);2141 setTimeout('RevSliderAdmin.setCodeMirrorStaticEditor()',500);2142 }2143 });2144 UniteAdminRev.ajaxRequest("get_dynamic_css","",function(response){2145 var cssData = response.data;2146 if(g_codemirrorCssDynamic != null)2147 g_codemirrorCssDynamic.setValue(cssData);2148 else{2149 jQuery("#textarea_show_dynamic_styles").val(cssData);2150 setTimeout('RevSliderAdmin.setCodeMirrorDynamicEditor()',500);2151 }2152 });2153 jQuery("#css_static_editor_wrap").dialog({2154 modal:true,2155 resizable:false,2156 title:rev_lang.global_styles_editor,2157 minWidth:700,2158 minHeight:500,2159 closeOnEscape:true,2160 open:function () {2161 jQuery(this).closest(".ui-dialog")2162 .find(".ui-button").each(function(i) {2163 var cl;2164 if (i==0) cl="revgray";2165 if (i==1) cl="revgreen";2166 if (i==2) cl="revred";2167 jQuery(this).addClass(cl).addClass("button-primary").addClass("rev-uibuttons");2168 })2169 },2170 buttons:{2171 Save:function(){2172 if(!confirm(rev_lang.really_update_global_styles)){2173 return false;2174 }2175 UniteAdminRev.setErrorMessageID("dialog_error_message");2176 var data;2177 if(g_codemirrorCssStatic != null)2178 data = g_codemirrorCssStatic.getValue();2179 else2180 data = jQuery("#textarea_edit_static").val();2181 UniteAdminRev.ajaxRequest("update_static_css",data,function(response){2182 if(g_codemirrorCssStatic != null)2183 g_codemirrorCssStatic.setValue(response.css);2184 else2185 jQuery("#textarea_edit_static").val(css);2186 });2187 //if(urlStaticCssCaptions)2188 // setTimeout('UniteAdminRev.loadCssFile(RevSliderAdmin.getUrlStaticCssCaptions(),"rs-plugin-static-css");',1000);2189 jQuery(this).dialog("close");2190 },2191 "Cancel":function(){2192 jQuery(this).dialog("close");2193 }2194 }2195 });2196 });2197 }...
master.js
Source:master.js
1// On window load. This waits until images have loaded which is essential2/*global jQuery:false, my_ajax:false, on_resize:false */3/*jshint unused:false */4jQuery(window).load(function() {5 "use strict";6 jQuery('.wpb_thumbnails-fluid').isotope();7 jQuery('.overlay-hide').hide();8 jQuery('#vh_loading_effect').addClass( 'hide' ).delay(500).queue(function(next){9 jQuery(this).hide();10 next();11 });12 if ( jQuery(window).width() > 1200 ) {13 jQuery(window).scroll(function (event) {14 if ( jQuery(window).width() > 1200 ) {15 var scroll = $(window).scrollTop();16 if ( scroll > 700 ) {17 jQuery('.videoplayer.open_video.player').addClass('sidebar');18 setTimeout(function() {19 jQuery('.videoplayer.open_video.player').addClass('animation-ended');20 }, 500);21 setTimeout(function() {22 jQuery('.videoplayer.open_video.player').addClass('show-video');23 }, 300);24 } else {25 jQuery('.videoplayer.open_video.player').removeClass('sidebar');26 jQuery('.videoplayer.open_video.player').removeClass('animation-ended');27 jQuery('.videoplayer.open_video.player').removeClass('show-video');28 }29 }30 });31 32 jQuery('.videoplayer.open_video.player #flashplayer, .video-fade-effect').css('right', Math.ceil(jQuery('.page-wrapper').offset().left+15));33 };34 jQuery(window).bind("debouncedresize", function() {35 if ( jQuery(window).width() > 1200 ) {36 jQuery('.videoplayer.open_video.player #flashplayer, .video-fade-effect').css('right', Math.ceil(jQuery('.page-wrapper').offset().left+15));37 } else {38 jQuery('.videoplayer.open_video.player').removeClass('sidebar');39 jQuery('.videoplayer.open_video.player').removeClass('animation-ended');40 jQuery('.videoplayer.open_video.player').removeClass('show-video');41 }42 });43});44/*45Plugin: jQuery Parallax46Version 1.1.347Author: Ian Lunn48Twitter: @IanLunn49Author URL: http://www.ianlunn.co.uk/50Plugin URL: http://www.ianlunn.co.uk/plugins/jquery-parallax/51Dual licensed under the MIT and GPL licenses:52http://www.opensource.org/licenses/mit-license.php53http://www.gnu.org/licenses/gpl.html54*/55jQuery(document).ready(function($) {56 "use strict";57 if ( jQuery('#buy-now-ribbon').length && window.self === window.top ) {58 jQuery('#buy-now-ribbon').show();59 };60 if ( !jQuery("body").hasClass("vc_responsive") ) {61 jQuery("body").addClass("vc_responsive");62 }63 // Fix top slider tap issue (mobile)64 if ( jQuery('#video_carousel li').length ) {65 var touch_startX = '0';66 var touch_startY = '0';67 jQuery('#video_carousel li').on('touchstart', function(e) {68 touch_startX = e.originalEvent.touches[0].pageX;69 touch_startY = e.originalEvent.touches[0].pageY;70 }).on('touchend', function(e) {71 var touch_endX = e.originalEvent.changedTouches[0].pageX;72 var touch_endY = e.originalEvent.changedTouches[0].pageY;73 // if ( ( touch_startX == touch_endX ) && ( touch_startY == touch_endY ) ) {74 e.preventDefault();75 window.location = jQuery(this).find('a').attr('href');76 // }77 });78 };79 if ( jQuery('.imgSidethumb, .video-block .video_image_container').length ) {80 var touch_startX = '0';81 var touch_startY = '0';82 jQuery('.imgSidethumb, .video-block .video_image_container').on('touchstart', function(e) {83 touch_startX = e.originalEvent.touches[0].pageX;84 touch_startY = e.originalEvent.touches[0].pageY;85 }).on('touchend', function(e) {86 var touch_endX = e.originalEvent.changedTouches[0].pageX;87 var touch_endY = e.originalEvent.changedTouches[0].pageY;88 if ( ( touch_startX == touch_endX ) && ( touch_startY == touch_endY ) ) {89 e.preventDefault();90 window.location = jQuery(this).find('a.view_more').attr('href');91 }92 });93 };94 $.event.special.tap = {95 setup: function(data, namespaces) {96 var $elem = $(this);97 $elem.bind('touchstart', $.event.special.tap.handler)98 .bind('touchmove', $.event.special.tap.handler)99 .bind('touchend', $.event.special.tap.handler);100 },101 teardown: function(namespaces) {102 var $elem = $(this);103 $elem.unbind('touchstart', $.event.special.tap.handler)104 .unbind('touchmove', $.event.special.tap.handler)105 .unbind('touchend', $.event.special.tap.handler);106 },107 handler: function(event) {108 // event.preventDefault();109 var $elem = $(this);110 $elem.data(event.type, 1);111 if (event.type === 'touchend' && !$elem.data('touchmove')) {112 event.type = 'tap';113 $.event.handle.apply(this, arguments);114 } else if ($elem.data('touchend')) {115 $elem.removeData('touchstart touchmove touchend');116 }117 }118 };119 // jQuery("body.shadows .video_c_player.default .video_module .imgSidethumb .video_image_container.sdimg").realshadow({120 // followMouse: false, // default: true121 // // pageX: x, // x coordinate of the light source122 // // pageY: y, // y coordinate of the light source123 // color: '94, 94, 94', // shadow color, rgb 0..255, default: '0,0,0'124 // // type: 'drop' // shadow type125 // angle: 5.5,126 // length: 10,127 // style: 'flat',128 // opacity: 0.2129 // });130 jQuery('.video_container a.video_play, .video-block-container a.video_play').click(function(e) {131 e.preventDefault();132 var top_css = '';133 jQuery('.vh_wrapper').addClass('blur');134 jQuery('.overlay-hide').css({'background-color': 'rgba(0, 0, 0, 0.5)'}).show();135 jQuery(this).parent().find('#video_iframe').attr('src', jQuery(this).parent().find('.iframe_url').val());136 jQuery(this).parent().find('#video_dialog').dialog({ 137 modal: true, 138 width: 640,139 resizable: false,140 dialogClass: "spotlight",141 position: { my: "center center", at: "center center" },142 close: function() {143 jQuery(this).dialog('destroy');144 jQuery('.vh_wrapper').removeClass('blur');145 //jQuery('#video_dialog').remove();146 jQuery('.overlay-hide').removeAttr('style').hide();147 } 148 });149 });150 // Perform AJAX login on form submit151 jQuery('form#login').on('submit', function(e) {152 jQuery('form#login p.status').show().text(ajax_login_object.loadingmessage);153 jQuery.ajax({154 type: 'POST',155 dataType: 'json',156 url: ajax_login_object.ajaxurl,157 data: { 158 'action': 'ajaxlogin', //calls wp_ajax_nopriv_ajaxlogin159 'username': jQuery('form#login #username').val(), 160 'password': jQuery('form#login #password').val(), 161 'security': jQuery('form#login #security').val()162 },163 success: function(data) {164 jQuery('form#login p.status').text(data.message);165 if (data.loggedin == true) {166 document.location.href = ajax_login_object.redirecturl;167 }168 }169 });170 e.preventDefault();171 });172 jQuery('.morph-button button').on('click', function(e) {173 jQuery('.morph-content, .morph-button').addClass('active');174 });175 // Perform AJAX login on button click176 jQuery(document).on('click', '#login_button', function(e) {177 jQuery('.morph-content').addClass('login_error');178 jQuery('.content-style-form p.status').show().text(ajax_login_object.loadingmessage);179 jQuery.ajax({180 type: 'POST',181 dataType: 'json',182 url: ajax_login_object.ajaxurl,183 data: { 184 'action': 'ajaxlogin', //calls wp_ajax_nopriv_ajaxlogin185 'username': jQuery('.content-style-form #username').val(), 186 'password': jQuery('.content-style-form #password').val(), 187 'security': jQuery('.content-style-form #security').val()188 },189 success: function(data) {190 jQuery('.content-style-form p.status').text(data.message);191 if (data.loggedin == true) {192 document.location.href = ajax_login_object.redirecturl;193 }194 }195 });196 e.preventDefault();197 });198 // Generate register form199 jQuery(document).on('click', '#register_button_form, #login_button_form', function() {200 jQuery('.content-style-form').addClass('loading');201 jQuery.ajax({202 type: 'POST',203 url: my_ajax.ajaxurl,204 data: {"action": "snaptube_generate_form", form_type: jQuery(this).attr('id') },205 success: function(response) {206 jQuery('.content-style-form').html(response);207 jQuery('.content-style-form').removeClass('loading login_form');208 jQuery('.content-style-form').addClass('register_form');209 jQuery('.morph-content').removeClass('login_error register_error');210 return false;211 }212 });213 });214 jQuery(document).on('click', '#register_button', function() {215 jQuery('.morph-content').addClass('register_error');216 jQuery('.content-style-form .status').show().text(ajax_login_object.loadingmessage);217 jQuery.ajax({218 type: 'POST',219 dataType: 'json',220 url: my_ajax.ajaxurl,221 data: { 222 'action': 'ajax_register',223 'email': jQuery('.content-style-form #email').val(),224 'fullname': jQuery('.content-style-form #username').val(),225 'regsecurity': jQuery('.content-style-form #regsecurity').val()226 },227 success: function(data) {228 jQuery('.content-style-form .status').show().text(data.message);229 if ( data.for_input == "main" ) {230 jQuery('.content-style-form input[type="text"]').val('');231 }232 }233 });234 });235 var $isotope_container = jQuery(".blog .wpb_thumbnails");236 $isotope_container.isotope({ straightAcross : true });237 // update columnWidth on window resize238 jQuery(window).bind("debouncedresize", function() {239 $isotope_container.isotope({240 // update columnWidth to a percentage of container width241 masonry: { columnWidth: $isotope_container.width() / 2 }242 });243 if ( jQuery(window).width() <= 767 ) {244 jQuery(".video-module-title").each(function(i, val) {245 if (jQuery(this).val() == ' ') {246 jQuery(this).hide();247 }248 });249 }250 });251 jQuery("ul.video_module li .video_container").hover(function() {252 jQuery(this).find(".imgSidethumb").animate({'background-size':'80px 80px'}, 250);253 });254 jQuery(".scroll-to-top").click(function() {255 jQuery("html, body").animate({ scrollTop: 0 }, "slow");256 return false;257 });258 if ( jQuery('body').hasClass('search-results') ) {259 jQuery(window).bind("debouncedresize", function() {260 jQuery('.wpb_thumbnails').isotope();261 });262 };263 jQuery('.package_button').click(function(e) {264 e.preventDefault();265 jQuery(this).parent().parent().find('input:radio').prop('checked', true);266 jQuery('#job_package_selection').submit();267 });268 (function() {269 var docElem = window.document.documentElement, didScroll, scrollPosition;270 // trick to prevent scrolling when opening/closing button271 function noScrollFn() {272 window.scrollTo( scrollPosition ? scrollPosition.x : 0, scrollPosition ? scrollPosition.y : 0 );273 }274 function noScroll() {275 window.removeEventListener( 'scroll', scrollHandler );276 window.addEventListener( 'scroll', noScrollFn );277 }278 function scrollFn() {279 window.addEventListener( 'scroll', scrollHandler );280 }281 function canScroll() {282 window.removeEventListener( 'scroll', noScrollFn );283 scrollFn();284 }285 function scrollHandler() {286 if( !didScroll ) {287 didScroll = true;288 setTimeout( function() { scrollPage(); }, 60 );289 }290 };291 function scrollPage() {292 scrollPosition = { x : window.pageXOffset || docElem.scrollLeft, y : window.pageYOffset || docElem.scrollTop };293 didScroll = false;294 };295 scrollFn();296 [].slice.call( document.querySelectorAll( '.morph-button' ) ).forEach( function( bttn ) {297 new UIMorphingButton( bttn, {298 closeEl : '.icon-close',299 onBeforeOpen : function() {300 // don't allow to scroll301 jQuery('.header-icon').first().find('a').css('border-right', '1px solid #eaeaea');302 noScroll();303 },304 onAfterOpen : function() {305 // can scroll again306 canScroll();307 },308 onBeforeClose : function() {309 // don't allow to scroll310 noScroll();311 },312 onAfterClose : function() {313 // can scroll again314 jQuery('.morph-content').removeClass('login_error');315 jQuery('p.status').hide();316 jQuery('.header-icon').first().find('a').css('border-right', 'transparent')317 canScroll();318 }319 } );320 } );321 // for demo purposes only322 [].slice.call( document.querySelectorAll( 'form button' ) ).forEach( function( bttn ) { 323 bttn.addEventListener( 'click', function( ev ) { ev.preventDefault(); } );324 } );325 })();326 jQuery('.icon-user.user-icon').click(function(e) {327 e.preventDefault();328 });329 var baseurl;330 baseurl = '<?php echo $site_url; ?>';331 function currentVideo(vid,videoids){332 for(var i = 0; i < videoids.length; i++){333 if(videoids[i]!=vid){334 var prev_fragment = document.getElementById('nav-fragment-'+videoids[i])335 prev_fragment.className = "ui-tabs-nav-item" ;336 }337 }338 var fragment = document.getElementById('nav-fragment-'+vid)339 fragment.className += " ui-tabs-selected" ;340 }341 jQuery('.switch_featured_video').click(function(e) {342 e.preventDefault();343 jQuery(".lof-snleft").animate({opacity: 0}, 0);344 var vid = jQuery(this).attr('id');345 var lt=false;346 sourceCode = document.getElementById(vid).innerHTML;347 embedCode = sourceCode.replace('embecontus','embed');348 embedCode = embedCode.replace('iframcontus','iframe');349 embedCode = embedCode.replace('videcontus','video');350 if(lt==true){351 embedCode = sourceCode.replace('EMBECONTUS','EMBED');352 embedCode = embedCode.replace('IFRAMCONTUS','IFRAME');353 embedCode = embedCode.replace('VIDECONTUS','IFRAME');354 }355 document.getElementById("nav-"+vid).className = 'ui-tabs-nav-item ui-tabs-selected';356 var removeSelectItem = document.getElementById("activeCSS").value;357 document.getElementById("nav-"+removeSelectItem).className = 'ui-tabs-nav-item';358 document.getElementById('videoPlay').innerHTML = embedCode;359 document.getElementById("activeCSS").value = vid;360 setTimeout(function() {361 jQuery(".lof-snleft").animate({opacity: 1}, 300);362 }, 400);363 });364 header_size();365 jQuery("#allowEmbed").click(function() {366 jQuery(this).toggleClass("embed-open");367 var embedFlag = document.getElementById("flagembed").value;368 if( embedFlag != 1 ) {369 jQuery("#embedcode").slideToggle();370 document.getElementById("flagembed").value = "1";371 } else {372 jQuery("#embedcode").slideToggle();373 document.getElementById("flagembed").value = "0";374 }375 });376 // if (!jQuery('.video_player.vid_thumbnail .video-module-title').attr('class').length) {377 // jQuery('.video_player.vid_thumbnail').css('margin-top', '37px');378 // };379 jQuery(".post-grid-item-wrapper").each(function(){380 if ( jQuery(this).children().first().hasClass('post-title') ) {381 jQuery(this).addClass('top_title');382 };383 });384 jQuery('.video-cat-thumb .vc_separator').click(function() {385 if ( !jQuery('.video-page-desc-wrapper').hasClass('active') ) {386 jQuery('.video-page-desc-wrapper').css("max-height", "none");387 var height = jQuery('.video-page-desc').height();388 jQuery('.video-page-desc-wrapper').css("max-height", "75px");389 jQuery('.video-page-desc-wrapper').animate({390 "max-height": height391 }, {392 duration: 200,393 easing: 'linear',394 queue: false,395 complete: function(){ 396 jQuery('.video-page-desc-wrapper').addClass('active');397 jQuery('.open_video_more').html(follow_button_text.showless);398 jQuery('.open_video_more').removeClass('icon-angle-down');399 jQuery('.open_video_more').addClass('icon-angle-up');400 }401 });402 } else {403 jQuery('.video-page-desc-wrapper').removeClass('active'); 404 jQuery('.video-page-desc-wrapper').animate({405 "max-height": "75px"406 }, {407 duration: 200,408 easing: 'linear',409 queue: false,410 complete: function(){ 411 jQuery('.open_video_more').html(follow_button_text.showmore);412 jQuery('.open_video_more').removeClass('icon-angle-up');413 jQuery('.open_video_more').addClass('icon-angle-down');414 }415 });416 }417 });418 jQuery('.video-page-desc #allowReport').click(function() {419 if ( !jQuery(this).hasClass('active') ) {420 var initialheight = jQuery('.video-page-desc').height();421 jQuery('#reportform').show();422 jQuery('.video-page-desc-wrapper').css("max-height", "none");423 var height = jQuery('.video-page-desc').height();424 jQuery('.video-page-desc-wrapper').css("max-height", initialheight);425 jQuery('.video-page-desc-wrapper').animate({426 "max-height": height427 }, {428 duration: 200,429 easing: 'linear',430 queue: false,431 complete: function(){ 432 jQuery('.video-page-desc-wrapper').addClass('active');433 jQuery('.open_video_more').html('Show less');434 jQuery('.open_video_more').removeClass('icon-angle-down');435 jQuery('.open_video_more').addClass('icon-angle-up');436 }437 });438 } else {439 // jQuery('.video-page-desc-wrapper').removeClass('active'); 440 // jQuery('.video-page-desc-wrapper').animate({441 // "max-height": "75px"442 // }, {443 // duration: 200,444 // easing: 'linear',445 // queue: false,446 // complete: function(){ 447 // jQuery('.open_video_more').html('Show more');448 // jQuery('.open_video_more').removeClass('icon-angle-up');449 // jQuery('.open_video_more').addClass('icon-angle-down');450 // }451 // });452 }453 });454 jQuery(".open_video_likes span").click(function() {455 if (!jQuery('.open_video_likes span').hasClass('liked')) {456 jQuery(".open_video_likes_count").text(parseInt(jQuery(".open_video_likes_count").text())+1)457 };458 jQuery(".open_video_likes span").addClass('liked');459 jQuery(".open_video_likes span").text(follow_button_text.youlikeit);460 });461 jQuery(".open_video_share .open-share-buttons").click(function() {462 jQuery(".video-socialshare").toggle("slide");463 });464 if (jQuery.cookie('vh_open_video_carousel') == null) {465 jQuery.cookie('vh_open_video_carousel', '1', { path: '/' });466 };467 if (jQuery.cookie('vh_open_video_carousel') == 0) {468 jQuery(".single-videogallery #video_jcarousel").slideToggle(1);469 jQuery(".single-videogallery .page-wrapper.video").addClass('closed');470 jQuery(".single-videogallery .video_carousel_button").addClass('icon-angle-down');471 };472 jQuery(".single-videogallery .video_carousel_button").click(function() {473 jQuery("#video_jcarousel").slideToggle(200);474 jQuery(".single-videogallery .video_carousel_button").toggleClass('icon-angle-down');475 jQuery(".page-wrapper.video").toggleClass('closed');476 if (jQuery.cookie('vh_open_video_carousel') == 0) {477 jQuery.cookie('vh_open_video_carousel', '1', { path: '/' });478 } else {479 jQuery.cookie('vh_open_video_carousel', '0', { path: '/' });480 };481 });482 // Contacts page arrow (open/close map)483 if (jQuery.cookie('vh_open_map') == null) {484 jQuery.cookie('vh_open_map', '1', { path: '/' });485 };486 if (jQuery.cookie('vh_open_map') == 0) {487 jQuery("#map").slideToggle(1);488 jQuery(".page-wrapper").addClass('closed');489 jQuery(".page-template-template-contacts-php .video_carousel_button").addClass('icon-angle-down');490 };491 jQuery(".page-template-template-contacts-php .video_carousel_button").click(function() {492 jQuery("#map").slideToggle(200);493 jQuery(".page-template-template-contacts-php .video_carousel_button").toggleClass('icon-angle-down');494 jQuery(".page-wrapper").toggleClass('closed');495 if (jQuery.cookie('vh_open_map') == 0) {496 jQuery.cookie('vh_open_map', '1', { path: '/' });497 } else {498 jQuery.cookie('vh_open_map', '0', { path: '/' });499 };500 });501 jQuery( function() {502 var containers = jQuery('#video_carousel').isotope({503 itemSelector: '.item',504 layoutMode: 'masonryHorizontal'505 })506 });507 if ( jQuery('#video_carousel').length != 0 ) {508 if ( jQuery('#video_carousel li').length == 0 ) {509 jQuery('.video_carousel_container').hide();510 jQuery('.page-wrapper').removeClass('video');511 };512 jQuery("#video_jcarousel").smoothDivScroll({513 mousewheelScrolling: true,514 autoScrollingMode: "onStart",515 touchScrolling: true516 });517 jQuery("#video_jcarousel").bind("mouseover", function(){518 jQuery("#video_jcarousel").smoothDivScroll("stopAutoScrolling");519 });520 // Mouse out521 jQuery("#video_jcarousel").bind("mouseout", function(){522 jQuery("#video_jcarousel").smoothDivScroll("startAutoScrolling");523 });524 }525 if ( jQuery('.featured-videos-slider').length != 0 ) {526 if ( jQuery('#video_carousel li').length == 0 ) {527 jQuery('.video_carousel_container').hide();528 jQuery('.page-wrapper').removeClass('video');529 };530 jQuery("#video_jcarousel").smoothDivScroll({531 touchScrolling: true532 });533 }534 jQuery('.follow-category').click(function() {535 vh_update_categories(jQuery(this).parent().find('input[type="hidden"]').val(), 'add', jQuery(this), my_ajax.ajaxurl)536 });537 jQuery('.unfollow-category').click(function() {538 vh_update_categories(jQuery(this).parent().find('input[type="hidden"]').val(), 'delete', jQuery(this), my_ajax.ajaxurl)539 });540 function vh_update_categories(id,action,button,ajaxurl) {541 jQuery.ajax({542 type: 'POST',543 url: ajaxurl,544 data: {"action": "followed_categories", category_id: id, follow_action: action},545 success: function(response) {546 if ( button.hasClass('follow-category') ) {547 button.removeClass('follow-category');548 button.removeClass('icon-plus-circled');549 button.addClass('unfollow-category');550 button.addClass('icon-minus-circled');551 button.html(follow_button_text.unfollow);552 } else {553 button.removeClass('unfollow-category');554 button.removeClass('icon-minus-circled');555 button.addClass('follow-category');556 button.addClass('icon-plus-circled');557 button.html(follow_button_text.follow);558 }559 return false;560 }561 });562 }563 jQuery( function() {564 var $container_follow = jQuery('.video-block-container.followed');565 var $container = jQuery('.video-block-container.open-video:not(.followed)');566 if ( $container.hasClass('follow') ) {567 $container_follow.isotope({568 itemSelector: '.video-block',569 layoutMode: 'fitRows',570 transformsEnabled: true,571 animationOptions: {572 duration: 250,573 easing: 'swing',574 queue: true575 },576 animationEngine : "jquery"577 });578 } else {579 $container.isotope({580 itemSelector: '.video-block',581 layoutMode: 'fitRows',582 transformsEnabled: true,583 getSortData: {584 title: function ( elem ) {585 return jQuery(elem).find('.videoHname.title').text();586 },587 date: function ( elem ) {588 var some_date = jQuery(elem).find('.v_date').val();589 var date_string = some_date.split(' ');590 var date_parts = date_string['0'].split('-');591 var time_parts = date_string['1'].split(':');592 var ts = new Date(date_parts['0'], date_parts['1'], date_parts['2'], time_parts['0'], time_parts['1'], time_parts['2']);593 return Date.parse(ts);594 },595 views: function ( elem ) {596 return parseFloat( jQuery(elem).find('.video_info .video_views').text());597 },598 likes: function ( elem ) {599 return parseFloat( jQuery(elem).find('.video_info .video_likes').text());600 }601 },602 sortBy: 'date',603 sortAscending: false,604 animationOptions: {605 duration: 250,606 easing: 'swing',607 queue: true608 },609 animationEngine : "jquery"610 });611 }612 jQuery(".category_layout_container .layout.list").click(function() {613 if (!jQuery(this).hasClass('clicked')) {614 jQuery('.category_layout_container .layout.table').removeClass('clicked');615 jQuery(this).addClass('clicked');616 jQuery(".video-block-container-wrapper").fadeTo( 100, 0, function() {617 jQuery.cookie('vh_category_layout', 'list', { path: '/' });618 jQuery(".video-block").addClass('new_style');619 setTimeout(function() {620 $container.isotope();621 $container_follow.isotope();622 jQuery(".video-block-container-wrapper").fadeTo( 400, 1 );623 }, 400);624 });625 }626 });627 jQuery(".category_layout_container .layout.table").click(function() {628 if (!jQuery(this).hasClass('clicked')) {629 jQuery('.category_layout_container .layout.list').removeClass('clicked');630 jQuery(this).addClass('clicked');631 jQuery(".video-block-container-wrapper").fadeTo( 100, 0, function() {632 jQuery.cookie('vh_category_layout', 'table', { path: '/' });633 jQuery(".video-block").removeClass('new_style');634 setTimeout(function() {635 $container.isotope();636 $container_follow.isotope();637 jQuery(".video-block-container-wrapper").fadeTo( 400, 1 );638 }, 400);639 });640 }641 });642 // bind sort button click643 jQuery('#sorts').on( 'click', 'div:not(.sort_by)', function() {644 var sortValue = jQuery(this).attr('data-sort-value');645 if (sortValue == 'views' || sortValue == 'date' || sortValue == 'likes' ) {646 $container.isotope({647 sortBy: sortValue,648 sortAscending: false649 });650 } else {651 $container.isotope({652 sortBy: sortValue,653 sortAscending: true654 });655 }656 if ( sortValue == 'views' ) {657 jQuery.cookie('vh_category_sorting', 'views', { path: '/' });658 } else if ( sortValue == 'date' ) {659 jQuery.cookie('vh_category_sorting', 'date', { path: '/' });660 } else if ( sortValue == 'title' ) {661 jQuery.cookie('vh_category_sorting', 'title', { path: '/' });662 } else if ( sortValue == 'likes' ) {663 jQuery.cookie('vh_category_sorting', 'likes', { path: '/' });664 }665 });666 jQuery('.category_sort_container').each( function( i, divGroup ) {667 var divGroup = jQuery( divGroup );668 divGroup.on( 'click', 'div:not(.sort_by)', function() {669 divGroup.find('.clicked').removeClass('clicked');670 jQuery( this ).addClass('clicked');671 });672 });673 });674 jQuery( function() {675 var container = jQuery('.video-block-container.open-video');676 var sortValue = jQuery.cookie('vh_category_sorting');677 if ( sortValue == null ) {678 jQuery.cookie('vh_category_sorting', 'date', { path: '/' });679 } else if ( sortValue == 'date' || sortValue == 'views' || sortValue == 'likes' ) {680 if ( !container.hasClass('followed') ) {681 jQuery('.video-block-container.open-video').isotope({682 sortBy: sortValue,683 sortAscending: false684 });685 } else {686 jQuery('.video-block-container.open-video').isotope();687 }688 } else if ( sortValue == 'title' ) {689 if ( !container.hasClass('followed') ) {690 jQuery('.video-block-container.open-video').isotope({691 sortBy: sortValue,692 sortAscending: true693 });694 } else {695 jQuery('.video-block-container.open-video').isotope();696 }697 }698 if ( sortValue == 'date' ) {699 jQuery('.sort_param').removeClass('clicked');700 jQuery('.sort_param.date').addClass('clicked');701 } else if ( sortValue == 'views' ) {702 jQuery('.sort_param').removeClass('clicked');703 jQuery('.sort_param.views').addClass('clicked');704 } else if ( sortValue == 'title' ) {705 jQuery('.sort_param').removeClass('clicked');706 jQuery('.sort_param.title').addClass('clicked');707 } else if ( sortValue == 'likes' ) {708 jQuery('.sort_param').removeClass('clicked');709 jQuery('.sort_param.likes').addClass('clicked');710 }711 if ( jQuery.cookie('vh_category_layout') == 'list' ) {712 jQuery('.category_layout_container .layout.table').removeClass('clicked');713 jQuery('.category_layout_container .layout.list').addClass('clicked');714 jQuery(".category-videos .video-block").addClass('new_style');715 setTimeout(function() {716 jQuery('.category-videos.video-block-container.open-video').isotope();717 }, 500);718 } else if ( jQuery.cookie('vh_category_layout') == 'table' ) {719 jQuery('.category_layout_container .layout.list').removeClass('clicked');720 jQuery('.category_layout_container .layout.table').addClass('clicked');721 jQuery(".category-videos .video-block").removeClass('new_style');722 setTimeout(function() {723 jQuery('.category-videos.video-block-container.open-video').isotope();724 }, 500);725 }726 });727 jQuery( function() {728 setTimeout(function() {729 var $home_container = jQuery('.video-block-container.video-home').isotope({730 itemSelector: '.video-block',731 layoutMode: 'fitRows',732 transformsEnabled: true,733 animationOptions: {734 duration: 250,735 easing: 'swing',736 queue: true737 },738 animationEngine : "jquery"739 });740 }, 100);741 });742 jQuery(".tagcloud").each(function(index){743 var otags_a = jQuery(this).find("a"),744 otags_number = otags_a.length,745 otags_increment = 1 / otags_number,746 otags_opacity = "";747 jQuery(otags_a.get().reverse()).each(function(i,el) {748 el.id = i + 1;749 otags_opacity = el.id / otags_number - otags_increment;750 if (otags_opacity < 0.2)751 otags_opacity = 0.2;752 jQuery(this).css({ backgroundColor: 'rgba(150,150,150,'+otags_opacity+')' });753 });754 });755 if ( jQuery(window).width() >= 767 ) {756 jQuery("a.menu-trigger").click(function() {757 jQuery(".mp-menu").css({top: jQuery(document).scrollTop() });758 return false;759 });760 }761 jQuery(".fixed_menu .social-container").css({ 'top' : (jQuery(window).height()) - ( jQuery(".fixed_menu .social-container").height() + 60 ) });762 jQuery(".gallery-icon a").attr('rel', 'prettyphoto');763 jQuery("a[rel^='prettyPhoto']").prettyPhoto();764 jQuery(".hover_bottom_top")765 .mouseenter(function(){766 jQuery(this).animate({ bottom: "10px", opacity: "0.8" }, 300, function() {767 768 });769 }).mouseleave(function(){770 jQuery(this).animate({ bottom: "0px", opacity: "1" }, 300, function() {771 772 });773 });774 jQuery(".hover_top_to_bottom")775 .mouseenter(function(){776 jQuery(this).animate({ top: "3px", opacity: "0.8" }, 200, function() {777 778 });779 }).mouseleave(function(){780 jQuery(this).animate({ top: "0px", opacity: "1" }, 200, function() {781 782 });783 });784 jQuery(".snaptube-recentpostsplus.widget .news-item").last().css({"background":"transparent", "padding":"0", "marginBottom":"0"});785 jQuery(".snaptube-twitter.widget .tweet_list li").last().css({"background":"transparent", "padding":"0", "marginBottom":"0"});786 // Opacity hover effect787 jQuery(".opacity_hover").mouseenter(function() {788 var social = this;789 jQuery(social).animate({ opacity: "0.8" }, 80, function() {790 jQuery(social).animate({ opacity: "1.0" }, 80);791 });792 });793 var $window = $(window);794 var windowHeight = $window.height();795 $window.resize(function () {796 windowHeight = $window.height();797 jQuery(".fixed_menu .social-container").css({ 'top' : (jQuery(window).height()) - ( jQuery(".fixed_menu .social-container").height() + 60 ) });798 });799 /**800 * jQuery.LocalScroll - Animated scrolling navigation, using anchors.801 * Copyright (c) 2007-2009 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com802 * Dual licensed under MIT and GPL.803 * Date: 3/11/2009804 * @author Ariel Flesler805 * @version 1.2.7806 **/807 ;(function($){var l=location.href.replace(/#.*/,'');var g=$.localScroll=function(a){$('body').localScroll(a)};g.defaults={duration:1e3,axis:'y',event:'click',stop:true,target:window,reset:true};g.hash=function(a){if(location.hash){a=$.extend({},g.defaults,a);a.hash=false;if(a.reset){var e=a.duration;delete a.duration;$(a.target).scrollTo(0,a);a.duration=e}i(0,location,a)}};$.fn.localScroll=function(b){b=$.extend({},g.defaults,b);return b.lazy?this.bind(b.event,function(a){var e=$([a.target,a.target.parentNode]).filter(d)[0];if(e)i(a,e,b)}):this.find('a,area').filter(d).bind(b.event,function(a){i(a,this,b)}).end().end();function d(){return!!this.href&&!!this.hash&&this.href.replace(this.hash,'')==l&&(!b.filter||$(this).is(b.filter))}};function i(a,e,b){var d=e.hash.slice(1),f=document.getElementById(d)||document.getElementsByName(d)[0];if(!f)return;if(a)a.preventDefault();var h=$(b.target);if(b.lock&&h.is(':animated')||b.onBefore&&b.onBefore.call(b,a,f,h)===false)return;if(b.stop)h.stop(true);if(b.hash){var j=f.id==d?'id':'name',k=$('<a> </a>').attr(j,d).css({position:'absolute',top:$(window).scrollTop(),left:$(window).scrollLeft()});f[j]='';$('body').prepend(k);location=e.hash;k.remove();f[j]=d}h.scrollTo(f,b).trigger('notify.serialScroll',[f])}})(jQuery);808});809function header_size() {810 jQuery(window).on('touchmove', function(event) {811 set_height();812 });813 var win = jQuery(window),814 header = jQuery('.header .top-header'),815 logo = jQuery('.header .top-header .logo img'),816 elements = jQuery('.header, .top-header .header-social-icons div a, .top-header .logo, .top-header .header_search, .header_search .search .gray-form .footer_search_input, .top-header .menu-btn.icon-menu-1, .morph-button'),817 el_height = jQuery(elements).filter(':first').height(),818 isMobile = 'ontouchstart' in document.documentElement,819 set_height = function() {820 var st = win.scrollTop(), newH = 0;821 if(st < el_height/2) {822 newH = el_height - st;823 header.removeClass('header-small');824 } else {825 newH = el_height/2;826 header.addClass('header-small');827 }828 jQuery('.morph-button style').html('.morph-content.active{height: '+newH+'px;}.morph-button.active{height: '+newH+'px !important;}');829 elements.css({'height': newH + 'px', 'line-height': newH + 'px'});830 logo.css({'max-height': newH + 'px'});831 }832 if(!header.length) {833 return false;834 }835 win.scroll(set_height);836 set_height();837}838// debulked onresize handler839function on_resize(c,t){840 "use strict";841 var onresize=function(){clearTimeout(t);t=setTimeout(c,100);};return c;842}843function clearInput (input, inputValue) {844 "use strict";845 if (input.value === inputValue) {846 input.value = '';847 }848}849// function moveOffset() {850// if( jQuery(".full-width").length ) {851// var offset = jQuery(".full-width").position().left;852// jQuery(".full-width").css({853// width: jQuery('.main').width(),854// marginLeft: -offset855// });856// };857// };858jQuery(document).ready(function() {859 "use strict";860 // Top menu861 if( jQuery(".header .sf-menu").length ) {862 var menuOptions = {863 speed: 'fast',864 speedOut: 'fast',865 hoverClass: 'sfHover',866 }867 // initialise plugin868 var menu = jQuery('.header .sf-menu').superfish(menuOptions);869 }870 // !Top menu871 872 jQuery(".sidebar_menu ul.primary-menu > li.menu-item").mouseover(function(){873 var isHovered = !!jQuery(this).find('ul li').filter(function(){874 return jQuery(this).is(":hover");875 }).length;876 if (isHovered == false) {877 //jQuery(this).children('a').css({'padding-right': '44px'});878 jQuery(this).addClass('before-css');879 }880 }).mouseout(function() {881 //jQuery(this).children('a').css({'padding-right': '40px'});882 jQuery(this).removeClass('before-css');883 });884 jQuery(".sidebar_menu ul.primary-menu > li ul li.menu-item").hover(function(){885 // jQuery(this).children('a').css({'padding-right': '45px'});886 jQuery(this).addClass('before-css');887 }, function() {888 // jQuery(this).children('a').css({'padding-right': '40px'});889 jQuery(this).removeClass('before-css');890 });891 // Search widget892 jQuery('.search.widget .sb-icon-search').click(function(el){893 el.preventDefault();894 jQuery('.search.widget form').submit();895 });896 // !Seaarch widget897 // Search widget898 jQuery('.search-no-results .main-inner .sb-icon-search').click(function(el){899 el.preventDefault();900 jQuery('.search-no-results .main-inner .search form').submit();901 });902 // !Seaarch widget903 904 // Social icons hover effect905 jQuery(".social_links li a").mouseenter(function() {906 var social = this;907 jQuery(social).animate({ opacity: "0.5" }, 250, function() {908 jQuery(social).animate({ opacity: "1.0" }, 100);909 });910 });911 // !Social icons hover effect912 // Widget contact form - send913 jQuery("#contact_form").submit(function() {914 jQuery("#contact_form").parent().find("#error, #success").hide();915 var str = jQuery(this).serialize();916 jQuery.ajax({917 type: "POST",918 url: my_ajax.ajaxurl,919 data: 'action=contact_form&' + str,920 success: function(msg) {921 if(msg === 'sent') {922 jQuery("#contact_form").parent().find("#success").fadeIn("slow");923 } else {924 jQuery("#contact_form").parent().find("#error").fadeIn("slow");925 }926 }927 });928 return false;929 });930 // !Widget contact form - send931 /* Merge gallery */932 jQuery('.merge-gallery div').mouseenter(function() {933 jQuery(this).find('.gallery-caption').animate({934 bottom: jQuery(this).find('img').height()935 },250);936 }).mouseleave(function() {937 jQuery(this).find('.gallery-caption').animate({938 bottom: jQuery(this).find('img').height() + 150939 },250);940 });...
Gruntfile.js
Source:Gruntfile.js
1module.exports = function( grunt ) {2"use strict";3var4 // files5 coreFiles = [6 "core.js",7 "widget.js",8 "mouse.js",9 "draggable.js",10 "droppable.js",11 "resizable.js",12 "selectable.js",13 "sortable.js",14 "effect.js"15 ],16 uiFiles = coreFiles.map(function( file ) {17 return "ui/" + file;18 }).concat( expandFiles( "ui/*.js" ).filter(function( file ) {19 return coreFiles.indexOf( file.substring( 3 ) ) === -1;20 }) ),21 allI18nFiles = expandFiles( "ui/i18n/*.js" ),22 cssFiles = [23 "core",24 "accordion",25 "autocomplete",26 "button",27 "checkboxradio",28 "controlgroup",29 "datepicker",30 "dialog",31 "draggable",32 "menu",33 "progressbar",34 "resizable",35 "selectable",36 "selectmenu",37 "sortable",38 "slider",39 "spinner",40 "tabs",41 "tooltip",42 "theme"43 ].map(function( component ) {44 return "themes/base/" + component + ".css";45 }),46 // minified files47 minify = {48 options: {49 preserveComments: false50 },51 main: {52 options: {53 banner: createBanner( uiFiles )54 },55 files: {56 "dist/jquery-ui.min.js": "dist/jquery-ui.js"57 }58 },59 i18n: {60 options: {61 banner: createBanner( allI18nFiles )62 },63 files: {64 "dist/i18n/jquery-ui-i18n.min.js": "dist/i18n/jquery-ui-i18n.js"65 }66 }67 },68 compareFiles = {69 all: [70 "dist/jquery-ui.js",71 "dist/jquery-ui.min.js"72 ]73 },74 component = grunt.option( "component" ) || "**",75 htmllintBad = [76 "demos/tabs/ajax/content*.html",77 "demos/tooltip/ajax/content*.html",78 "tests/unit/core/core.html",79 "tests/unit/tabs/data/test.html"80 ];81function mapMinFile( file ) {82 return "dist/" + file.replace( /ui\//, "minified/" );83}84function expandFiles( files ) {85 return grunt.util._.pluck( grunt.file.expandMapping( files ), "src" ).map(function( values ) {86 return values[ 0 ];87 });88}89uiFiles.concat( allI18nFiles ).forEach(function( file ) {90 minify[ file ] = {91 options: {92 banner: createBanner()93 },94 files: {}95 };96 minify[ file ].files[ mapMinFile( file ) ] = file;97});98uiFiles.forEach(function( file ) {99 // TODO this doesn't do anything until https://github.com/rwldrn/grunt-compare-size/issues/13100 compareFiles[ file ] = [ file, mapMinFile( file ) ];101});102// grunt plugins103require( "load-grunt-tasks" )( grunt );104// local testswarm and build tasks105grunt.loadTasks( "build/tasks" );106function stripDirectory( file ) {107 return file.replace( /.+\/(.+?)>?$/, "$1" );108}109function createBanner( files ) {110 // strip folders111 var fileNames = files && files.map( stripDirectory );112 return "/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - " +113 "<%= grunt.template.today('isoDate') %>\n" +114 "<%= pkg.homepage ? '* ' + pkg.homepage + '\\n' : '' %>" +115 (files ? "* Includes: " + fileNames.join(", ") + "\n" : "") +116 "* Copyright <%= pkg.author.name %>;" +117 " Licensed <%= _.pluck(pkg.licenses, 'type').join(', ') %> */\n";118}119grunt.initConfig({120 pkg: grunt.file.readJSON( "package.json" ),121 files: {122 dist: "<%= pkg.name %>-<%= pkg.version %>"123 },124 compare_size: compareFiles,125 concat: {126 css: {127 options: {128 banner: createBanner( cssFiles ),129 stripBanners: {130 block: true131 }132 },133 src: cssFiles,134 dest: "dist/jquery-ui.css"135 }136 },137 requirejs: {138 js: {139 options: {140 baseUrl: "./",141 paths: {142 jquery: "./external/jquery/jquery",143 external: "./external/"144 },145 preserveLicenseComments: false,146 optimize: "none",147 findNestedDependencies: true,148 skipModuleInsertion: true,149 exclude: [ "jquery" ],150 include: expandFiles( [ "ui/**/*.js", "!ui/core.js", "!ui/i18n/*" ] ),151 out: "dist/jquery-ui.js",152 wrap: {153 start: createBanner( uiFiles ),154 }155 }156 }157 },158 jscs: {159 ui: {160 options: {161 config: true162 },163 files: {164 src: [ "demos/**/*.js", "build/**/*.js", "ui/**/*.js" ]165 }166 },167 tests: {168 options: {169 config: true,170 maximumLineLength: null171 },172 files: {173 src: [ "tests/**/*.js" ]174 }175 }176 },177 uglify: minify,178 htmllint: {179 good: {180 options: {181 ignore: [182 /The text content of element âscriptâ was not in the required format: Expected space, tab, newline, or slash but found â.â instead/183 ] },184 src: [ "demos/**/*.html", "tests/**/*.html" ].concat( htmllintBad.map( function( file ) {185 return "!" + file;186 } ) )187 },188 bad: {189 options: {190 ignore: [191 /Start tag seen without seeing a doctype first/,192 /Element âheadâ is missing a required instance of child element âtitleâ/,193 /Element âobjectâ is missing one or more of the following/,194 /The âcodebaseâ attribute on the âobjectâ element is obsolete/195 ]196 },197 src: htmllintBad198 }199 },200 qunit: {201 files: expandFiles( "tests/unit/" + component + "/*.html" ).filter(function( file ) {202 return !( /(all|index|test)\.html$/ ).test( file );203 }),204 options: {205 inject: false,206 page: {207 viewportSize: { width: 700, height: 500 }208 }209 }210 },211 jshint: {212 options: {213 jshintrc: true214 },215 all: [216 "ui/*.js",217 "Gruntfile.js",218 "build/**/*.js",219 "tests/unit/**/*.js",220 "tests/lib/**/*.js",221 "demos/**/*.js"222 ]223 },224 csslint: {225 base_theme: {226 src: "themes/base/*.css",227 options: {228 csslintrc: ".csslintrc"229 }230 }231 },232 bowercopy: {233 all: {234 options: {235 clean: true,236 ignore: [ "jquery" ],237 destPrefix: "external"238 },239 files: {240 "qunit/qunit.js": "qunit/qunit/qunit.js",241 "qunit/qunit.css": "qunit/qunit/qunit.css",242 "qunit/LICENSE.txt": "qunit/LICENSE.txt",243 "qunit-assert-classes/qunit-assert-classes.js": "qunit-assert-classes/qunit-assert-classes.js",244 "qunit-assert-classes/LICENSE.txt": "qunit-assert-classes/LICENSE",245 "qunit-assert-close/qunit-assert-close.js": "qunit-assert-close/qunit-assert-close.js",246 "qunit-assert-close/MIT-LICENSE.txt": "qunit-assert-close/MIT-LICENSE.txt",247 "qunit-composite/qunit-composite.js": "qunit-composite/qunit-composite.js",248 "qunit-composite/qunit-composite.css": "qunit-composite/qunit-composite.css",249 "qunit-composite/LICENSE.txt": "qunit-composite/LICENSE.txt",250 "requirejs/require.js": "requirejs/require.js",251 "jquery-mousewheel/jquery.mousewheel.js": "jquery-mousewheel/jquery.mousewheel.js",252 "jquery-mousewheel/LICENSE.txt": "jquery-mousewheel/LICENSE.txt",253 "jquery-simulate/jquery.simulate.js": "jquery-simulate/jquery.simulate.js",254 "jquery-simulate/LICENSE.txt": "jquery-simulate/LICENSE.txt",255 "jshint/jshint.js": "jshint/dist/jshint.js",256 "jshint/LICENSE": "jshint/LICENSE",257 "jquery/jquery.js": "jquery-1.x/dist/jquery.js",258 "jquery/LICENSE.txt": "jquery-1.x/LICENSE.txt",259 "jquery-1.7.0/jquery.js": "jquery-1.7.0/jquery.js",260 "jquery-1.7.0/MIT-LICENSE.txt": "jquery-1.7.0/MIT-LICENSE.txt",261 "jquery-1.7.1/jquery.js": "jquery-1.7.1/jquery.js",262 "jquery-1.7.1/MIT-LICENSE.txt": "jquery-1.7.1/MIT-LICENSE.txt",263 "jquery-1.7.2/jquery.js": "jquery-1.7.2/jquery.js",264 "jquery-1.7.2/MIT-LICENSE.txt": "jquery-1.7.2/MIT-LICENSE.txt",265 "jquery-1.8.0/jquery.js": "jquery-1.8.0/jquery.js",266 "jquery-1.8.0/MIT-LICENSE.txt": "jquery-1.8.0/MIT-LICENSE.txt",267 "jquery-1.8.1/jquery.js": "jquery-1.8.1/jquery.js",268 "jquery-1.8.1/MIT-LICENSE.txt": "jquery-1.8.1/MIT-LICENSE.txt",269 "jquery-1.8.2/jquery.js": "jquery-1.8.2/jquery.js",270 "jquery-1.8.2/MIT-LICENSE.txt": "jquery-1.8.2/MIT-LICENSE.txt",271 "jquery-1.8.3/jquery.js": "jquery-1.8.3/jquery.js",272 "jquery-1.8.3/MIT-LICENSE.txt": "jquery-1.8.3/MIT-LICENSE.txt",273 "jquery-1.9.0/jquery.js": "jquery-1.9.0/jquery.js",274 "jquery-1.9.0/MIT-LICENSE.txt": "jquery-1.9.0/MIT-LICENSE.txt",275 "jquery-1.9.1/jquery.js": "jquery-1.9.1/jquery.js",276 "jquery-1.9.1/MIT-LICENSE.txt": "jquery-1.9.1/MIT-LICENSE.txt",277 "jquery-1.10.0/jquery.js": "jquery-1.10.0/jquery.js",278 "jquery-1.10.0/MIT-LICENSE.txt": "jquery-1.10.0/MIT-LICENSE.txt",279 "jquery-1.10.1/jquery.js": "jquery-1.10.1/jquery.js",280 "jquery-1.10.1/MIT-LICENSE.txt": "jquery-1.10.1/MIT-LICENSE.txt",281 "jquery-1.10.2/jquery.js": "jquery-1.10.2/jquery.js",282 "jquery-1.10.2/MIT-LICENSE.txt": "jquery-1.10.2/MIT-LICENSE.txt",283 "jquery-1.11.0/jquery.js": "jquery-1.11.0/dist/jquery.js",284 "jquery-1.11.0/MIT-LICENSE.txt": "jquery-1.11.0/MIT-LICENSE.txt",285 "jquery-1.11.1/jquery.js": "jquery-1.11.1/dist/jquery.js",286 "jquery-1.11.1/MIT-LICENSE.txt": "jquery-1.11.1/MIT-LICENSE.txt",287 "jquery-1.11.2/jquery.js": "jquery-1.11.2/dist/jquery.js",288 "jquery-1.11.2/MIT-LICENSE.txt": "jquery-1.11.2/MIT-LICENSE.txt",289 "jquery-1.11.3/jquery.js": "jquery-1.11.3/dist/jquery.js",290 "jquery-1.11.3/MIT-LICENSE.txt": "jquery-1.11.3/MIT-LICENSE.txt",291 "jquery-1.12.0/jquery.js": "jquery-1.12.0/dist/jquery.js",292 "jquery-1.12.0/LICENSE.txt": "jquery-1.12.0/LICENSE.txt",293 "jquery-1.12.1/jquery.js": "jquery-1.12.1/dist/jquery.js",294 "jquery-1.12.1/LICENSE.txt": "jquery-1.12.1/LICENSE.txt",295 "jquery-1.12.2/jquery.js": "jquery-1.12.2/dist/jquery.js",296 "jquery-1.12.2/LICENSE.txt": "jquery-1.12.2/LICENSE.txt",297 "jquery-1.12.3/jquery.js": "jquery-1.12.3/dist/jquery.js",298 "jquery-1.12.3/LICENSE.txt": "jquery-1.12.3/LICENSE.txt",299 "jquery-1.12.4/jquery.js": "jquery-1.12.4/dist/jquery.js",300 "jquery-1.12.4/LICENSE.txt": "jquery-1.12.4/LICENSE.txt",301 "jquery-2.0.0/jquery.js": "jquery-2.0.0/jquery.js",302 "jquery-2.0.0/MIT-LICENSE.txt": "jquery-2.0.0/MIT-LICENSE.txt",303 "jquery-2.0.1/jquery.js": "jquery-2.0.1/jquery.js",304 "jquery-2.0.1/MIT-LICENSE.txt": "jquery-2.0.1/MIT-LICENSE.txt",305 "jquery-2.0.2/jquery.js": "jquery-2.0.2/jquery.js",306 "jquery-2.0.2/MIT-LICENSE.txt": "jquery-2.0.2/MIT-LICENSE.txt",307 "jquery-2.0.3/jquery.js": "jquery-2.0.3/jquery.js",308 "jquery-2.0.3/MIT-LICENSE.txt": "jquery-2.0.3/MIT-LICENSE.txt",309 "jquery-2.1.0/jquery.js": "jquery-2.1.0/dist/jquery.js",310 "jquery-2.1.0/MIT-LICENSE.txt": "jquery-2.1.0/MIT-LICENSE.txt",311 "jquery-2.1.1/jquery.js": "jquery-2.1.1/dist/jquery.js",312 "jquery-2.1.1/MIT-LICENSE.txt": "jquery-2.1.1/MIT-LICENSE.txt",313 "jquery-2.1.2/jquery.js": "jquery-2.1.2/dist/jquery.js",314 "jquery-2.1.2/MIT-LICENSE.txt": "jquery-2.1.2/MIT-LICENSE.txt",315 "jquery-2.1.3/jquery.js": "jquery-2.1.3/dist/jquery.js",316 "jquery-2.1.3/MIT-LICENSE.txt": "jquery-2.1.3/MIT-LICENSE.txt",317 "jquery-2.1.4/jquery.js": "jquery-2.1.4/dist/jquery.js",318 "jquery-2.1.4/MIT-LICENSE.txt": "jquery-2.1.4/MIT-LICENSE.txt",319 "jquery-2.2.0/jquery.js": "jquery-2.2.0/dist/jquery.js",320 "jquery-2.2.0/LICENSE.txt": "jquery-2.2.0/LICENSE.txt",321 "jquery-2.2.1/jquery.js": "jquery-2.2.1/dist/jquery.js",322 "jquery-2.2.1/LICENSE.txt": "jquery-2.2.1/LICENSE.txt",323 "jquery-2.2.2/jquery.js": "jquery-2.2.2/dist/jquery.js",324 "jquery-2.2.2/LICENSE.txt": "jquery-2.2.2/LICENSE.txt",325 "jquery-2.2.3/jquery.js": "jquery-2.2.3/dist/jquery.js",326 "jquery-2.2.3/LICENSE.txt": "jquery-2.2.3/LICENSE.txt",327 "jquery-2.2.4/jquery.js": "jquery-2.2.4/dist/jquery.js",328 "jquery-2.2.4/LICENSE.txt": "jquery-2.2.4/LICENSE.txt",329 "jquery-3.0.0/jquery.js": "jquery-3.0.0/dist/jquery.js",330 "jquery-3.0.0/LICENSE.txt": "jquery-3.0.0/LICENSE.txt",331 "jquery-3.1.0/jquery.js": "jquery-3.1.0/dist/jquery.js",332 "jquery-3.1.0/LICENSE.txt": "jquery-3.1.0/LICENSE.txt"333 }334 }335 },336 authors: {337 prior: [338 "Paul Bakaus <paul.bakaus@gmail.com>",339 "Richard Worth <rdworth@gmail.com>",340 "Yehuda Katz <wycats@gmail.com>",341 "Sean Catchpole <sean@sunsean.com>",342 "John Resig <jeresig@gmail.com>",343 "Tane Piper <piper.tane@gmail.com>",344 "Dmitri Gaskin <dmitrig01@gmail.com>",345 "Klaus Hartl <klaus.hartl@gmail.com>",346 "Stefan Petre <stefan.petre@gmail.com>",347 "Gilles van den Hoven <gilles@webunity.nl>",348 "Micheil Bryan Smith <micheil@brandedcode.com>",349 "Jörn Zaefferer <joern.zaefferer@gmail.com>",350 "Marc Grabanski <m@marcgrabanski.com>",351 "Keith Wood <kbwood@iinet.com.au>",352 "Brandon Aaron <brandon.aaron@gmail.com>",353 "Scott González <scott.gonzalez@gmail.com>",354 "Eduardo Lundgren <eduardolundgren@gmail.com>",355 "Aaron Eisenberger <aaronchi@gmail.com>",356 "Joan Piedra <theneojp@gmail.com>",357 "Bruno Basto <b.basto@gmail.com>",358 "Remy Sharp <remy@leftlogic.com>",359 "Bohdan Ganicky <bohdan.ganicky@gmail.com>"360 ]361 }362});363grunt.registerTask( "update-authors", function() {364 var getAuthors = require( "grunt-git-authors" ).getAuthors,365 done = this.async();366 getAuthors({367 priorAuthors: grunt.config( "authors.prior" )368 }, function( error, authors ) {369 if ( error ) {370 grunt.log.error( error );371 return done( false );372 }373 authors = authors.map(function( author ) {374 if ( author.match( /^Jacek JÄdrzejewski </ ) ) {375 return "Jacek JÄdrzejewski (http://jacek.jedrzejewski.name)";376 } else if ( author.match( /^Pawel Maruszczyk </ ) ) {377 return "Pawel Maruszczyk (http://hrabstwo.net)";378 } else {379 return author;380 }381 });382 grunt.file.write( "AUTHORS.txt",383 "Authors ordered by first contribution\n" +384 "A list of current team members is available at http://jqueryui.com/about\n\n" +385 authors.join( "\n" ) + "\n" );386 done();387 });388});389grunt.registerTask( "default", [ "lint", "requirejs", "test" ]);390grunt.registerTask( "jenkins", [ "default", "concat" ]);391grunt.registerTask( "lint", [ "asciilint", "jshint", "jscs", "csslint", "htmllint" ]);392grunt.registerTask( "test", [ "qunit" ]);393grunt.registerTask( "sizer", [ "requirejs:js", "uglify:main", "compare_size:all" ]);394grunt.registerTask( "sizer_all", [ "requirejs:js", "uglify", "compare_size" ]);...
optimizer.js
Source:optimizer.js
...7 * 8 * @since Optimizer 1.09 */1011jQuery(window).ready(function() {121314 /*CHECK IF TOUCH ENABLED DEVICE*/15 function is_touch_device() {16 return (('ontouchstart' in window)17 || (navigator.MaxTouchPoints > 0)18 || (navigator.msMaxTouchPoints > 0));19 }20 2122 if (is_touch_device()) {23 jQuery('body').addClass('touchon');24 }2526 //MENU Animation27 if (jQuery(window).width() > 768) {28 29 jQuery('#topmenu ul > li').not('#topmenu ul > li.mega-menu-item').hoverIntent(function(){30 jQuery(this).find('.sub-menu, ul.children').not('.sub-menu .sub-menu, ul.children ul.children').removeClass('animated fadeOut').addClass('animated fadeInUp menushow');31 }, function(){32 jQuery(this).find('.sub-menu, ul.children').not('.sub-menu .sub-menu, ul.children ul.children').addClass('animated fadeOut').delay(300).queue(function(next){ jQuery(this).removeClass("animated fadeInUp menushow");next();});33 });34 35 jQuery('#topmenu ul li ul li').not('#topmenu ul li.mega-menu-item ul.mega-sub-menu li').hoverIntent(function(){36 jQuery(this).find('.sub-menu, ul.children').removeClass('animated fadeOut').addClass('animated fadeInUp menushow');37 }, function(){38 jQuery(this).find('.sub-menu, ul.children').addClass('animated fadeOut').delay(300).queue(function(next){39 jQuery(this).removeClass("animated fadeInUp menushow");next();});40 });41 42 jQuery('#topmenu ul li').not('#topmenu ul li.mega-menu-item, #topmenu ul li ul li').hover(function(){43 jQuery(this).addClass('menu_hover');44 }, function(){45 jQuery(this).removeClass('menu_hover'); 46 });47 jQuery('#topmenu li').has("ul").addClass('zn_parent_menu');48 jQuery('.zn_parent_menu > a').append('<span class="menu_arrow"><i class="fa-angle-down"></i></span>');49 50 }5152 //BLOCKS Equal height53 jQuery('.midrow_blocks_wrap').each(function(index, element) {54 jQuery(this).waitForImages(function() {55 jQuery(this).find('.midrow_block').matchHeight({ property: 'min-height'});56 });57 });5859 60 //Layout1 Animation61 jQuery(".lay1").each(function(index, element) {62 var divs = jQuery(this).find(".hentry");63 for(var i = 0; i < divs.length; i+=3) {64 divs.slice(i, i+3).wrapAll("<div class='ast_row'></div>");65 }66 if (jQuery(window).width() < 1200) {67 var flaywidth = jQuery(this).find(".hentry").width();68 jQuery(this).find('.post_image').css({"maxHeight":(flaywidth * 66)/100});69 }70 });71 72 jQuery('.lay1 .postitle a:empty').closest("h2").addClass('no_title');73 jQuery('.no_title').css({"padding":"0"});74 75 jQuery('.lay1 h2.postitle a').each(function() {76 if(jQuery(this).height() >80){ jQuery(this).parent().parent().parent().addClass('lowreadmo'); }77 });78 jQuery('.lts_layout1 .listing-item h2').each(function() {79 if(jQuery(this).outerHeight() >76){ jQuery(this).parent().addClass('lowreadmo'); }80 });81 82 // TO_TOP83 jQuery(window).bind("scroll", function() {84 if (jQuery(this).scrollTop() > 800) {85 jQuery(".to_top").fadeIn('slow');86 } else {87 jQuery(".to_top").fadeOut('fast');88 }89 });90 jQuery(".to_top").click(function() {91 jQuery("html, body").animate({ scrollTop: 0 }, "slow");92 return false;93 });949596 //STATIC SLIDER IMAGE FIXED97 jQuery('.stat_has_img').waitForImages(function() {98 var statimg = jQuery(".stat_has_img .stat_bg_img").attr('src');99 var statimgheight = jQuery(".stat_has_img .stat_bg_img").height() + jQuery(".header").height();100 var hheight = jQuery(".header").height();101 jQuery("body.home").prepend('<div class="stat_bg" style="height:'+statimgheight+'px"><img src="'+statimg+'" /></div><div class="stat_bg_overlay overlay_off" style="height:'+statimgheight+'px" />');102 jQuery('#slidera').css({"minHeight":"initial"});103 jQuery('.home .stat_has_img .stat_bg_img').css('opacity', 0);104105 //Static Slider Overlay on scroll106 overlayon = jQuery(".home .stat_has_img");107 overlayon.waypoint({ handler: function(direction) { jQuery('.home .stat_bg_overlay').removeClass("overlay_off").addClass("overlay_on"); }, offset: '-170px' });108 109 overlayoff = jQuery(".home .stat_has_img");110 overlayoff.waypoint({ handler: function(direction) { jQuery('.home .stat_bg_overlay').removeClass("overlay_on").addClass("overlay_off");; }, offset: '-90px' });111112 113 }); 114 115 jQuery('.stat_has_img').waitForImages(function() {116 var resizeTimer;117 jQuery(window).bind("load resize", function() {118 clearTimeout(resizeTimer);119 resizeTimer = setTimeout(function() {120 var body_size = jQuery('.stat_has_img .stat_content_inner .center').height() + 120;121 jQuery('#stat_img, .stat_bg img, .stat_bg_overlay').css('min-height',body_size);122 }, 50);123 });124 });125126 127 128jQuery(window).bind("load resize", function() {129 if (jQuery(window).width() <= 480) { 130 jQuery(".stat_bg_img").css({"opacity":"0"});131 jQuery('.stat_content_inner').waitForImages(function() { jQuery("#stat_img").height(jQuery(".stat_content_inner").height()); });132 var statbg = jQuery(".stat_bg_img").attr('src');133 jQuery(".stat_has_img").css({"background":"url("+statbg+")", "background-repeat":"no-repeat", "background-size":"cover"});134 }135 if (jQuery(window).width() <= 960 <= 480) { 136 var statbg = jQuery(".stat_bg_img").attr('src');137 jQuery(".stat_has_img").css({"background":"url("+statbg+") top center", "background-repeat":"no-repeat", "background-size":"cover"});138 jQuery('.has_trans_header .stat_content_inner, .has_trans_header .header').waitForImages(function() { 139 var mhheight = jQuery(".has_trans_header .header").height();140 jQuery(".has_trans_header .stat_content_inner").css({"paddingTop":mhheight});141 142 });143 }144});145//WAYPOINT ANIMATIONS146if (jQuery(window).width() > 480) { 147 148 jQuery('.home #zn_nivo, .home #accordion').waitForImages(function() {149 //Header color on scroll150 var sliderheight = jQuery('.home #zn_nivo, .home #accordion').height();151 jQuery('.home #zn_nivo, .home #accordion').waypoint(function() {152 jQuery(".is-sticky .header").addClass("headcolor");153 }, { offset: '-'+sliderheight/2+'px' }); 154 155 jQuery('.home #zn_nivo, .home #accordion').waypoint(function() {156 jQuery(".is-sticky .header").removeClass("headcolor");157 }, { offset: '-90px' });158 }); 159 160 161 //BLOCKS Animation162 jQuery('.block_type2 .midrow_blocks .midrow_block').css({"opacity":"0"});163 jQuery('.block_type1 .midrow_blocks').waypoint(function() {164 jQuery(this).addClass('animated bounceIn');165 }, { offset: '90%' });166 jQuery('.block_type2 .midrow_blocks .midrow_block').waypoint(function() {167 jQuery(this).addClass('animated fadeInUp');168 }, { offset: '90%' });169 170 //WELCOME Animation171 jQuery('.welcmblock .text_block_wrap').css({"opacity":"0"});172 jQuery('.welcmblock .text_block_wrap').waypoint(function() {173 jQuery(this).addClass('animated fadeIn');174 }, { offset: '90%' });175 176 //Posts Animation177 jQuery('.home .postsblck .center').css({"opacity":"0"});178 jQuery('.home .postsblck .center').waypoint(function() {179 jQuery(this).addClass('animated fadeInUp');180 }, { offset: '85%' });181182}183184185186//Next Previous post button Link187 var link = jQuery('.ast-next > a').attr('href');188 jQuery('.right_arro').attr('href', link);189190 var link = jQuery('.ast-prev > a').attr('href');191 jQuery('.left_arro').attr('href', link);192193 //Gallery Template194 jQuery("#sidebar .widget_pages ul li a, #sidebar .widget_meta ul li a, #sidebar .widget_nav_menu ul li a, #sidebar .widget_categories ul li a, #sidebar .widget_recent_entries ul li a, #sidebar .widget_recent_comments ul li, #sidebar .widget_archive ul li, #sidebar .widget_rss ul li").prepend('<i class="fa-double-angle-right"></i> ');195 jQuery('#sidebar .fa-double-angle-right').css({"opacity":"0.5"});196197198199//Mobile Menu200 var padmenu = jQuery("#simple-menu").html();201 jQuery('#simple-menu').sidr({202 name: 'sidr-main',203 source: '#topmenu',204 side: 'right'205 });206 jQuery(".sidr").prepend("<div class='pad_menutitle'>"+padmenu+"<span><i class='fa-times'></i></span></div>");207 208 jQuery(".pad_menutitle span").click(function() {209 jQuery.sidr('close', 'sidr-main')210 preventDefaultEvents: false;211 212 });213 //If the topmenu is empty remove it214 if (jQuery(window).width() < 1025) {215 if(jQuery("#topmenu:has(ul)").length == 0){216 jQuery('#simple-menu').addClass('hide_mob_menu');217 }218 }219220221//NivoSlider Navigation Bug Fix222if (jQuery(window).width() < 480) {223 jQuery(".nivo-control").text('');224}225226 //slider porgressbar loader227 jQuery(function () {228 var n = 0,229 $imgs = jQuery('.slider-wrapper .sldimg'),230 val = 100 / $imgs.length,231 $bar = jQuery('#astbar');232 $progrssn = jQuery('.progrssn');233 234 $imgs.load(function () {235 n = n + val;236 // for displaying purposes237 $progrssn.css({"bottom":n + '%'});238 var numTruncated = parseFloat(n).toFixed(0);239 $bar.text(numTruncated+'%');240 });241 242 });243 jQuery('.slider-wrapper').waitForImages(function() {244 jQuery("#zn_nivo, .nivo-controlNav, #slide_acord, .nivoinner").css({"display":"block"});245 jQuery(".pbar_wrap").fadeOut();246 });247 248 //HEADER SWITCH249 jQuery('#slidera').has('#stat_img').addClass('selected_stat');250 jQuery('#slidera').has('.slide_wrap').addClass('selected_slide');251252253 if (jQuery(window).width() < 1025) {254 jQuery('.dlthref').removeAttr("href");255 }256257 //WIDGET BORDER258 jQuery("#sidebar .widget .widgettitle, .related_h3, h3#comments, #reply-title").after("<span class='widget_border' />");259 260 //Rearragnge comment form box261 jQuery(".comm_wrap").insertAfter(".comment-form-comment");262 jQuery(".comm_wrap input").placeholder();263 264 //404 class is not being added in body265 jQuery('body').has('.error_msg').addClass('error404');266 267 //Next-Previous Post Image Check268 jQuery(".nav-box.ast-prev, .nav-box.ast-next").not(":has(img)").addClass('navbox-noimg');269270 271 //Make sure the footer always stays to the bottom of the page when the page is short272 var docHeight = jQuery(window).height();273 var footerHeight = jQuery('#footer').height();274 var footerTop = jQuery('#footer').position().top + footerHeight;275 276 if (footerTop < docHeight) { jQuery('#footer').css('margin-top', 1 + (docHeight - footerTop) + 'px'); }277278 279 //Woocommerce280 jQuery('.lay1.optimposts, .lay4.optimposts').each(function(index, element) { jQuery(this).waitForImages(function() { jQuery(this).find('.type-product').matchHeight({property: 'min-height'}); }); });281 jQuery('.lay1.optimposts .type-product').each(function(index, element) {282 if (jQuery(window).width() >= 960) { jQuery(this).find('.button.add_to_cart_button').prependTo(jQuery(this).find('.imgwrap')); }283 jQuery(this).find('span.price').prependTo(jQuery(this).find('.post_image '));284 });285286});287288 jQuery(window).on('load scroll', function() {289 var scrollTop = jQuery(this).scrollTop();290 291 var hheight = jQuery(".header").height() + jQuery('.admin-bar #wpadminbar').height() + jQuery('#customizer_topbar').height();292 293 if ( !scrollTop ) {294 jQuery('body:not(.has_trans_header) .stat_bg img').css({"top":hheight+"px"});295 jQuery('body:not(.has_trans_header) .stat_bg').css({"background-position-y":hheight+"px"});296 }else{297 jQuery('body:not(.has_trans_header) .stat_bg img').css({"top":"0px"});298 jQuery('body:not(.has_trans_header) .stat_bg').css({"background-position-y":"0px"});299 }300 301 });302 303//Check If IOS & SAFARI304function getMobileOperatingSystem() {305 var userAgent = navigator.userAgent || navigator.vendor || window.opera;306 if( userAgent.match( /iPad/i ) || userAgent.match( /iPhone/i ) || userAgent.match( /iPod/i ) )307 { return 'iOS'; }308}309var isSafari = !!navigator.userAgent.match(/Version\/[\d\.]+.*Safari/);310311//IF iOS, Hide the video slider:312if(getMobileOperatingSystem() == 'iOS'){313 jQuery('body').addClass('is-ios');314}else{315 jQuery('body').addClass('not-ios');316}317318//Check If Safari319if(isSafari == true){320 jQuery('body').addClass('is_safari');
...
channelvideo.js
Source:channelvideo.js
1jQuery(document).ready(function(){2jQuery('.playerContainer').hide();3jQuery('.subscripeContainer').hide();4jQuery('.mysubscriptionContainer').hide();5jQuery('.aboutContainer').hide();6var totalChild = jQuery('.notificationParent').children().length;7var totalChildHeight = 0;8if(totalChild >= 4) {9jQuery('.notificationParent').children().each(function(c){10 if(c==3) {11 return false;12 }13totalChildHeight += this.offsetHeight;14}); 15notificationContainerHeight = totalChildHeight + 31;16notificationRowHeight = totalChildHeight;17//jQuery('.notificationContainers').css('height',notificationContainerHeight+'px');18jQuery('.notificationRows').css('max-height',notificationRowHeight+'px');19}20/*else if( totalChild > 0 && totalChild < 4) {21jQuery('.notificationParent').children().each(function(c){22totalChildHeight += this.offsetHeight;23}); 24notificationContainerHeight = totalChildHeight;25notificationRowHeight = totalChildHeight;26}27else {28 notificationContainerHeight = 0;29 notificationRowHeight = 0;30}31jQuery('.notificationContainers').css('height',notificationContainerHeight+'px');32jQuery('.notificationRows').css('height',notificationRowHeight+'px');*/33jQuery('.notificationContainers').mouseleave(function(){34 jQuery(this).hide();35});36jQuery('body').click(function(e){37 if(e.target.className != 'notificationLink' && e.target.className != 'notificationLis' ) {38 jQuery('.notificationContainers').hide();39 }40 });41jQuery('.notificationContainers').hide();42jQuery('.notificationContainer').hide();43jQuery('.searchChannelButton').show();44jQuery('.thumbImage').click(function(){45 var vid,cid;46 vid = jQuery(this).parent().find('.vid').val();47 cid = jQuery(this).parent().find('.pid').val();48 videoPlayer(vid,cid);49 50});51jQuery('.subscriberVideosButton').click(function(){52 /*jQuery('.searchButton').show();*/53 jQuery('.searchChannelButton').show();54 jQuery('.loadingBar').css('width','0%');55 jQuery('.search').val('');56 jQuery('.aboutContainer').hide();57 jQuery('.subscripeContainer').hide();58 jQuery('.mysubscriptionContainer').hide();59 jQuery('.notificationContainer').hide();60 jQuery('.videoContainer').show();61 jQuery('.channelMenuContainer p').css('left','0px');62 jQuery('.channelMenuContainer p').css('color','rgb(89, 85, 85)');63 jQuery('.channelMenuContainer p').css('background','rgb(252, 193, 179)');64 jQuery(this).css('color','white');65 channelMyVideos('subscriberVideosButton','','');66});67if(jQuery('.subscriberVideosButton').length > 0 ) {68 jQuery('.subscriberVideosButton').trigger('click');69}70jQuery('.searchButton').click(function(){71 var searchName;72 jQuery('.aboutContainer').hide();73 jQuery('.subscripeContainer').hide();74 jQuery('.mysubscriptionContainer').hide();75 jQuery('.notificationContainer').hide();76 jQuery('.videoContainer').show();77 searchName = jQuery('.search').val();78 jQuery('.channelMenuContainer p').css('left','0px');79 jQuery('.channelMenuContainer p').css('color','rgb(89, 85, 85)');80 jQuery('.channelMenuContainer p').css('background','rgb(252, 193, 179)'); 81 channelMyVideos(jQuery(this).attr('class'),'','');82});83jQuery('.aboutButton').click(function(){84 jQuery('.searchButton').show();85 jQuery('.searchChannelButton').show();86 jQuery('.search').val('');87 jQuery('.videoContainer').hide();88 jQuery('.subscripeContainer').hide();89 jQuery('.notificationContainer').hide();90 jQuery('.mysubscriptionContainer').hide();91 jQuery('.aboutContainer').show();92 jQuery('.channelMenuContainer p').css('left','0px');93 jQuery('.channelMenuContainer p').css('color','rgb(89, 85, 85)');94 jQuery('.channelMenuContainer p').css('background','rgb(252, 193, 179)');95 jQuery(this).css('left','10px');96 jQuery(this).css('color','white');97 jQuery(this).css('background','rgb(250, 118, 87)');98});99jQuery('.saveDescription').click(function(){100 channelMyVideos(jQuery(this).attr('class'),'','');101 });102jQuery('.browseChannelButton').click(function(){103 jQuery('.search').val('');104 jQuery('.searchButton').hide();105 jQuery('.searchChannelButton').show();106 jQuery('.videoContainer').hide();107 jQuery('.aboutContainer').hide();108 jQuery('.mysubscriptionContainer').hide();109 jQuery('.channelMenuContainer p').css('left','0px');110 jQuery('.channelMenuContainer p').css('color','rgb(89, 85, 85)');111 jQuery('.channelMenuContainer p').css('background','rgb(252, 193, 179)');112 jQuery('.notificationContainer').hide();113 jQuery('.subscripeContainer').show();114});115jQuery('.searchChannelButton').click(function(){116 var currentElement = document.getElementsByClassName('searchChannelButton')[0];117 if(document.body.dataset !== undefined ) {118 currentElement.dataset.setaction = 'searched';119 }120 else {121 currentElement.setAttribute('data-setaction','searched');122 }123 jQuery('.videoContainer').hide();124 jQuery('.aboutContainer').hide();125 jQuery('.mysubscriptionContainer').hide();126 jQuery('.notificationContainer').hide();127 jQuery('.channelMenuContainer p').css('left','0px');128 jQuery('.channelMenuContainer p').css('color','rgb(89, 85, 85)');129 jQuery('.channelMenuContainer p').css('background','rgb(252, 193, 179)');130 jQuery('.subscripeContainer').show(); 131 channelMyVideos(jQuery(this).attr('class'),'','');132});133jQuery('.browseChannelButton').click(function(){134 var currentElement = document.getElementsByClassName('searchChannelButton')[0];135 if(document.body.dataset !== undefined ) {136 currentElement.dataset.setaction = '';137 }138 else {139 currentElement.setAttribute('data-setaction','');140 }141 channelMyVideos(jQuery(this).attr('class'),'','');142 });143jQuery('.mySubscriptionButton').click(function(){144 jQuery('.searchButton').show();145 jQuery('.searchChannelButton').show();146 jQuery('.notificationContainer').hide();147 jQuery('.search').val('');148 jQuery('.videoContainer').hide();149 jQuery('.aboutContainer').hide();150 jQuery('.subscripeContainer').hide();151 jQuery('.channelMenuContainer p').css('left','0px');152 jQuery('.channelMenuContainer p').css('color','rgb(89, 85, 85)');153 jQuery('.channelMenuContainer p').css('background','rgb(252, 193, 179)');154 jQuery(this).css('left','10px');155 jQuery(this).css('color','white');156 jQuery(this).css('background','rgb(250, 118, 87)');157 channelMyVideos(jQuery(this).attr('class'),'','');158});159 /* jQuery('.notifi').click(function(){160 jQuery('.searchButton').show();161 jQuery('.searchChannelButton').hide();162 jQuery('.notificationContainer').show();163 });*/164//temporary script165jQuery('.notificationLink').click(function(){166 jQuery('.searchButton').show();167 jQuery('.searchChannelButton').show();168 jQuery('.notificationContainers').show();169});170jQuery('.subButton').click(function(){171 172 notificationId = jQuery(this).parent().find('.subscriperId').val();173 channelMyVideos(jQuery(this).attr('class'),notificationId,jQuery(this));174});175jQuery('.subDeleteButton').click(function(){176 177 notificationId = jQuery(this).parent().find('.subscriperId').val();178 channelMyVideos(jQuery(this).attr('class'),notificationId,jQuery(this));179});180jQuery('.seeMoreLink').click(function(){181 jQuery('.notificationContainer').show();182 jQuery('.searchChannelButton').show();183 jQuery('.search').val('');184 jQuery('.videoContainer').hide();185 jQuery('.aboutContainer').hide();186 jQuery('.subscripeContainer').hide();187 jQuery('.mysubscriptionContainer').hide();188 jQuery('.channelMenuContainer p').css('left','0px');189 jQuery('.channelMenuContainer p').css('color','rgb(89, 85, 85)');190 jQuery('.channelMenuContainer p').css('background','rgb(252, 193, 179)');191 192});193//temporary scrip end194 jQuery('.cancelNotification').click(function(){195 jQuery('.notificationContainer').hide();196 jQuery('.myVideosButton').click();197 });198 199 jQuery('.deleteNotification').click(function(){200 channelMyVideos(jQuery(this).attr('class'),'','');201 });202 203 jQuery('.uploadButton').click(function(){204 205 });206});207function closePlayer() {208 jQuery('.player').html('');209 jQuery('.playerContainer').hide();210}211function saveSubscriper(e) {212 subscriperId = jQuery(e).parent().find('.subscriperId').val();213 channelMyVideos(jQuery(e).attr('class'),subscriperId,'');214}215function flashPlayer(ele) {216 var vid,cid;217 vid = jQuery(ele).parent().find('.vid').val();218 cid = jQuery(ele).parent().find('.pid').val();219 videoPlayer(vid,cid); 220}221function closemysubscripers(e) {222 if(confirm('Are you sure want to delete?')) {223 msid = jQuery(e).parent().find('.msid').val();224 channelMyVideos(jQuery(e).attr('class'),msid,'');225 }226}227 function playerHeight() {228 jQuery('.player').css('height','448px');...
config.lazyload.js
Source:config.lazyload.js
1// lazyload config2var MODULE_CONFIG = {3 easyPieChart: [ '../libs/jquery/jquery.easy-pie-chart/dist/jquery.easypiechart.fill.js' ],4 sparkline: [ '../libs/jquery/jquery.sparkline/dist/jquery.sparkline.retina.js' ],5 plot: [ '../libs/jquery/flot/jquery.flot.js',6 '../libs/jquery/flot/jquery.flot.resize.js',7 '../libs/jquery/flot/jquery.flot.pie.js',8 '../libs/jquery/flot.tooltip/js/jquery.flot.tooltip.min.js',9 '../libs/jquery/flot-spline/js/jquery.flot.spline.min.js',10 '../libs/jquery/flot.orderbars/js/jquery.flot.orderBars.js'],11 vectorMap: [ '../libs/jquery/bower-jvectormap/jquery-jvectormap-1.2.2.min.js',12 '../libs/jquery/bower-jvectormap/jquery-jvectormap.css', 13 '../libs/jquery/bower-jvectormap/jquery-jvectormap-world-mill-en.js',14 '../libs/jquery/bower-jvectormap/jquery-jvectormap-us-aea-en.js' ],15 dataTable: [16 '../libs/jquery/datatables/media/js/jquery.dataTables.min.js',17 '../libs/jquery/plugins/integration/bootstrap/3/dataTables.bootstrap.js',18 '../libs/jquery/plugins/integration/bootstrap/3/dataTables.bootstrap.css'],19 footable: [20 '../libs/jquery/footable/dist/footable.all.min.js',21 '../libs/jquery/footable/css/footable.core.css'22 ],23 screenfull: [24 '../libs/jquery/screenfull/dist/screenfull.min.js'25 ],26 sortable: [27 '../libs/jquery/html.sortable/dist/html.sortable.min.js'28 ],29 nestable: [30 '../libs/jquery/nestable/jquery.nestable.css',31 '../libs/jquery/nestable/jquery.nestable.js'32 ],33 summernote: [34 '../libs/jquery/summernote/dist/summernote.css',35 '../libs/jquery/summernote/dist/summernote.js'36 ],37 parsley: [38 '../libs/jquery/parsleyjs/dist/parsley.css',39 '../libs/jquery/parsleyjs/dist/parsley.min.js'40 ],41 select2: [42 '../libs/jquery/select2/dist/css/select2.min.css',43 '../libs/jquery/select2-bootstrap-theme/dist/select2-bootstrap.min.css',44 '../libs/jquery/select2-bootstrap-theme/dist/select2-bootstrap.4.css',45 '../libs/jquery/select2/dist/js/select2.min.js'46 ],47 datetimepicker: [48 '../libs/jquery/eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.css',49 '../libs/jquery/eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.dark.css',50 '../libs/js/moment/moment.js',51 '../libs/jquery/eonasdan-bootstrap-datetimepicker/build/js/bootstrap-datetimepicker.min.js'52 ],53 chart: [54 '../libs/js/echarts/build/dist/echarts-all.js',55 '../libs/js/echarts/build/dist/theme.js',56 '../libs/js/echarts/build/dist/jquery.echarts.js'57 ],58 bootstrapWizard:[59 '../libs/jquery/twitter-bootstrap-wizard/jquery.bootstrap.wizard.min.js'60 ],61 fullCalendar: [62 '../libs/jquery/moment/moment.js',63 '../libs/jquery/fullcalendar/dist/fullcalendar.min.js',64 '../libs/jquery/fullcalendar/dist/fullcalendar.css',65 '../libs/jquery/fullcalendar/dist/fullcalendar.theme.css',66 'scripts/plugins/calendar.js'67 ],68 dropzone: [69 '../libs/js/dropzone/dist/min/dropzone.min.js',70 '../libs/js/dropzone/dist/min/dropzone.min.css'71 ]...
require.config.js
Source:require.config.js
1/**2 * Bootstrap require with the needed config, then load the app.js module.3 */4require.config({5 baseUrl: 'app',6 // urlArgs: 'r=@REV@',7 paths: {8 config: '../config',9 settings: 'components/settings',10 kbn: 'components/kbn',11 vendor: '../vendor',12 css: '../vendor/require/css',13 text: '../vendor/require/text',14 moment: '../vendor/moment',15 blob: '../vendor/blob',16 filesaver: '../vendor/filesaver',17 chromath: '../vendor/chromath',18 angular: '../vendor/angular/angular',19 'angular-cookies': '../vendor/angular/angular-cookies',20 'angular-dragdrop': '../vendor/angular/angular-dragdrop',21 'angular-strap': '../vendor/angular/angular-strap',22 'angular-sanitize': '../vendor/angular/angular-sanitize',23 timepicker: '../vendor/angular/timepicker',24 datepicker: '../vendor/angular/datepicker',25 bindonce: '../vendor/angular/bindonce',26 lodash: 'components/lodash.extended',27 'lodash-src': '../vendor/lodash',28 bootstrap: '../vendor/bootstrap/bootstrap',29 jquery: '../vendor/jquery/jquery-1.8.0',30 'jquery-ui': '../vendor/jquery/jquery-ui-1.10.3',31 'extend-jquery': 'components/extend-jquery',32 'jquery.flot': '../vendor/jquery/jquery.flot',33 'jquery.flot.pie': '../vendor/jquery/jquery.flot.pie',34 'jquery.flot.events': '../vendor/jquery/jquery.flot.events',35 'jquery.flot.selection': '../vendor/jquery/jquery.flot.selection',36 'jquery.flot.stack': '../vendor/jquery/jquery.flot.stack',37 'jquery.flot.stackpercent':'../vendor/jquery/jquery.flot.stackpercent',38 'jquery.flot.time': '../vendor/jquery/jquery.flot.time',39 'jquery.flot.byte': '../vendor/jquery/jquery.flot.byte',40 modernizr: '../vendor/modernizr-2.6.1',41 numeral: '../vendor/numeral',42 jsonpath: '../vendor/jsonpath',43 elasticjs: '../vendor/elasticjs/elastic-angular-client',44 },45 shim: {46 angular: {47 deps: ['jquery','config'],48 exports: 'angular'49 },50 bootstrap: {51 deps: ['jquery']52 },53 modernizr: {54 exports: 'Modernizr'55 },56 jsonpath: {57 exports: 'jsonPath'58 },59 jquery: {60 exports: 'jQuery'61 },62 // simple dependency declaration63 //64 'jquery-ui': ['jquery'],65 'jquery.flot': ['jquery'],66 'jquery.flot.byte': ['jquery', 'jquery.flot'],67 'jquery.flot.pie': ['jquery', 'jquery.flot'],68 'jquery.flot.events': ['jquery', 'jquery.flot'],69 'jquery.flot.selection':['jquery', 'jquery.flot'],70 'jquery.flot.stack': ['jquery', 'jquery.flot'],71 'jquery.flot.stackpercent':['jquery', 'jquery.flot'],72 'jquery.flot.time': ['jquery', 'jquery.flot'],73 'angular-sanitize': ['angular'],74 'angular-cookies': ['angular'],75 'angular-dragdrop': ['jquery','jquery-ui','angular'],76 'angular-loader': ['angular'],77 'angular-mocks': ['angular'],78 'angular-resource': ['angular'],79 'angular-route': ['angular'],80 'angular-touch': ['angular'],81 'bindonce': ['angular'],82 'angular-strap': ['angular', 'bootstrap','timepicker', 'datepicker'],83 timepicker: ['jquery', 'bootstrap'],84 datepicker: ['jquery', 'bootstrap'],85 elasticjs: ['angular', '../vendor/elasticjs/elastic']86 },87 waitSeconds: 60,...
jquery-ui.js
Source:jquery-ui.js
1//= require jquery-ui/core2//= require jquery-ui/data3//= require jquery-ui/disable-selection4//= require jquery-ui/effect5//= require jquery-ui/escape-selector6//= require jquery-ui/focusable7//= require jquery-ui/form-reset-mixin8//= require jquery-ui/form9//= require jquery-ui/ie10//= require jquery-ui/jquery-1-711//= require jquery-ui/keycode12//= require jquery-ui/labels13//= require jquery-ui/plugin14//= require jquery-ui/position15//= require jquery-ui/safe-active-element16//= require jquery-ui/safe-blur17//= require jquery-ui/scroll-parent18//= require jquery-ui/tabbable19//= require jquery-ui/unique-id20//= require jquery-ui/version21//= require jquery-ui/widget22//= require jquery-ui/effects/effect-blind23//= require jquery-ui/effects/effect-bounce24//= require jquery-ui/effects/effect-clip25//= require jquery-ui/effects/effect-drop26//= require jquery-ui/effects/effect-explode27//= require jquery-ui/effects/effect-fade28//= require jquery-ui/effects/effect-fold29//= require jquery-ui/effects/effect-highlight30//= require jquery-ui/effects/effect-puff31//= require jquery-ui/effects/effect-pulsate32//= require jquery-ui/effects/effect-scale33//= require jquery-ui/effects/effect-shake34//= require jquery-ui/effects/effect-size35//= require jquery-ui/effects/effect-slide36//= require jquery-ui/effects/effect-transfer37//= require jquery-ui/widgets/accordion38//= require jquery-ui/widgets/autocomplete39//= require jquery-ui/widgets/button40//= require jquery-ui/widgets/checkboxradio41//= require jquery-ui/widgets/controlgroup42//= require jquery-ui/widgets/datepicker43//= require jquery-ui/widgets/dialog44//= require jquery-ui/widgets/draggable45//= require jquery-ui/widgets/droppable46//= require jquery-ui/widgets/menu47//= require jquery-ui/widgets/mouse48//= require jquery-ui/widgets/progressbar49//= require jquery-ui/widgets/resizable50//= require jquery-ui/widgets/selectable51//= require jquery-ui/widgets/selectmenu52//= require jquery-ui/widgets/slider53//= require jquery-ui/widgets/sortable54//= require jquery-ui/widgets/spinner55//= require jquery-ui/widgets/tabs...
Using AI Code Generation
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('
Using AI Code Generation
1describe('My First Test', function() {2 it('Does not do much!', function() {3 expect(true).to.equal(false)4 })5})6describe('My First Test', () => {7 it('Does not do much!', () => {8 expect(true).to.equal(false)9 })10})11describe('My First Test', function() {12 it('Does not do much!', function() {13 expect(true).to.equal(false)14 })15})16describe('My First Test', () => {17 it('Does not do much!', () => {18 expect(true).to.equal(false)19 })20})21describe('My First Test', function() {22 it('Does not do much!', function() {23 expect(true).to.equal(false)24 })25})26describe('My First Test', () => {27 it('Does not do much!', () => {28 expect(true).to.equal(false)29 })30})31describe('My First Test', function() {32 it('Does not do much!', function() {33 expect(true).to.equal(false)34 })35})36describe('My First Test', () => {37 it('Does not do much!', () => {38 expect(true).to.equal(false)39 })40})41describe('My First Test', function() {42 it('Does not do much!', function() {43 expect(true).to.equal(false)44 })45})46describe('My First Test', () => {47 it('Does not do much!', () => {48 expect(true).to.equal(false)49 })50})51describe('My First Test', function() {52 it('Does not do much!', function() {53 expect(true).to.equal(false)54 })55})56describe('My First Test', () => {57 it('Does not do much!', () => {58 expect(true).to.equal(false)
Using AI Code Generation
1describe('My First Test Suite', function() 2{3 it('My First Test case', function() {4 cy.get('.search-keyword').type('ca')5 cy.wait(2000)6 cy.get('.product:visible').should('have.length', 4)7 cy.get('.products').find('.product').eq(2).contains('ADD TO CART').click()8 cy.get('.products').find('.product').eq(3).contains('ADD TO CART').click()9 cy.get('.cart-icon > img').click()10 cy.get('.cart-preview.active').find('.cart-item').should('have.length', 2)11 cy.contains('PROCEED TO CHECKOUT').click()12 cy.get('.cart-preview.active').find('.cart-item').eq(0).contains('Cashews')13 cy.get('.cart-preview.active').find('.cart-item').eq(1).contains('Raspberry')14 cy.contains('Place Order').click()15 cy.get('#country').type('Ind')16 cy.get('.suggestions > ul > li > a').click()17 cy.get('#checkbox2').click({force: true})18 cy.get('input[type="submit"]').click()19 cy.get('.alert').should('have.text', 'Success! Thank you! Your order will be delivered in next few weeks :-).')20 })21})
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.
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.
Watch this 3 hours of complete tutorial to learn the basics of Cypress and various Cypress commands with the Cypress testing at LambdaTest.
Get 100 minutes of automation test minutes FREE!!