Current File : /pages/54/47/d0016649/home/htdocs/cd24/wp-content/themes/dreier/cloudfw/js/functions.js |
function cloudfw_jqueried(a,b){"use strict";return"undefined"==typeof b?!0:jQuery.data(b,a)===!0?!0:(jQuery.data(b,a,!0),!1)}function cloudfw_reset_elements(a,b){"use strict";var c=[];"undefined"==typeof b&&(b=!0);var d=a.find(":input");d.length&&d.each(function(){var a=jQuery(this),b=a[0].tagName,d=a.attr("data-reset");if("undefined"!=typeof d){if("INPUT"==b||"TEXTAREA"==b)a.val(d),a.hasClass("randomizer")&&a.val(cloudfw_randomizer(a.attr("data-length"),a.attr("data-prefix"),a.attr("data-chars")));else if("SELECT"==b){var e=a.find("option");e.attr("selected",!1),e.each(function(){var a=jQuery(this).val();a==d&&jQuery(this).attr("selected",!0)})}c.push(a)}}),b&&(cloudfw_main(a),c.length&&jQuery.each(c,function(){jQuery(this).change(),jQuery(this).keyup()}))}function cloudfw_stop_form(a){"use strict";jQuery("#publish").removeClass("button-primary-disabled"),jQuery("#ajax-loading").css({visibility:"hidden"}),jQuery("#publishing-action .spinner").css({visibility:"hidden"}),a.preventDefault()}function cloudfw_error_message_js(a){"use strict";cloudfw_dialog("Error",a,"error",0)}function cloudfw_destroy(){"use strict";jQuery(document).trigger("destroyTheFG"),jQuery(".tipsy").remove();var a=setInterval(function(){cloudfw_fixed_submit(),jQuery.scrollTo("+=1px"),jQuery.scrollTo("-=1px"),clearInterval(a)},100);jQuery(".qq-upload-drop-area").hide()}function cloudfw_get_value(a){"use strict";var c,d,b=typeof a;return"string"==b&&(a=jQuery(a)),"object"==typeof a&&a.length&&(d=a.attr("id"),c="onoff"==jQuery("#is_defined_"+d).val()?a.is(":checked")?1:0:a.val()),cloudfw_check_undefined(c)}function cloudfw_check_undefined(a){return"undefined"==typeof a||"undefined"===a?"":a}function cloudfw_sync_elements(a,b){"use strict";for(var c=a.find("textarea"),d=b.find("textarea"),e=0,f=c.length;f>e;++e)jQuery(d[e]).val(jQuery(c[e]).val()).text(jQuery(c[e]).val());for(var g=a.find("select"),h=b.find("select"),i=0,j=g.length;j>i;++i){var k=jQuery(g[i]).find(":selected");if(k.length>0){var l=jQuery(g[i]).children("optgroup");jQuery(h[i]).children("optgroup");if(l.length)l.each(function(a){jQuery(this).attr("opid",a);var b=jQuery(this).children("option"),c=jQuery(h[i]).children("optgroup").eq(a).children("option");c.attr("selected",!1),b.each(function(a){jQuery(this).attr("selected")&&c.eq(a).attr("id",a).attr("selected",!0)})});else{var n=jQuery(h[i]).children("option");n.attr("selected",!1),k.each(function(){var a=jQuery(this).index();n.eq(a).attr("selected",!0)})}}else jQuery(h[i]).children("option").attr("selected",!1)}return b}function cloudfw_global_loading(a){"use strict";var b=jQuery("#spinner");"show"==a?b.stop(1).fadeIn():b.stop(1).fadeOut()}function cloudfw_dialog(a,b,c,d){"use strict";var e={};if(d="undefined"!=typeof d?d:1e4,a?e.title=a:(e.title=b,b=""),b){var b=jQuery("<div/>").html(b).text();e.content=b}e.showTime=!1,e.type=c,e.border=!1,e.timeout=parseInt(d),"error"==c?(e.timeout=0,e.type="cancel"):"notice"==c&&(e.timeout=0),jQuery.notification(e)}function cloudfw_ui_onoff(a){"use strict";var b=jQuery(".cloudfw-ui-label-check"),c=jQuery(".cloudfw-ui-label-radio");b.length&&(b.each(function(){var a=jQuery(this);a.children("input").is(":checked")?a.addClass("c_on"):a.removeClass("c_on")}),b.find("input:checked").each(function(){jQuery(this).parent("label").addClass("c_on")})),c.length&&(c.removeClass("r_on"),c.find("input:checked").each(function(){jQuery(this).parent("label").addClass("r_on")}))}function cloudfw_tab_loaded(){"use strict";var a=jQuery("#cloudfw-tabs-loading"),b=jQuery("#cloudfw_content, .cloudfw-ui-tabs");a.hide(),b.show()}function cloudfw_tabkey(){"use strict";jQuery(".tabtext").unbind("keydown.wpevent_InsertTab").bind("keydown.wpevent_InsertTab",function(a){if(9!=a.keyCode)return!0;var f,g,b=a.target,c=b.selectionStart,d=b.selectionEnd,e=b.value;try{this.lastKey=9}catch(h){}document.selection?(b.focus(),g=document.selection.createRange(),g.text=" "):c>=0&&(f=this.scrollTop,b.value=e.substring(0,c).concat(" ",e.substring(d)),b.selectionStart=b.selectionEnd=c+1,this.scrollTop=f),a.stopPropagation&&a.stopPropagation(),a.preventDefault&&a.preventDefault()})}function cloudfw_randomizer(a,b,c){"use strict";if("undefined"==typeof c)var c="all";if("undefined"==typeof a)var a=8;if("09"==c)var d="0123456789";else if("AZ"==c)var d="ABCDEFGHIJKLMNOPQRSTUVWXTZ";else if("az"==c)var d="abcdefghiklmnopqrstuvwxyz";else if("09-az"==c)var d="0123456789abcdefghiklmnopqrstuvwxyz";else if("AZ-az"==c)var d="ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";else var d="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";for(var e="",f=0;a>f;f++){var g=Math.floor(Math.random()*d.length);e+=d.substring(g,g+1)}return"undefined"!=typeof b&&(e=b+e),e}function cloudfw_make_timer(a,b,c){"use strict";if(a.find("span").html()!=b){var d=jQuery("<div />");a.show();var e=Number(a.find("span").text());d.css("text-indent",e),d.stop(),d.animate({"text-indent":b+"px"},{duration:c,step:function(b,c){a.find("span").text(Math.round(b))}})}}function cloudfw_panel_height(){"use strict";var a=jQuery("#cloudfw_navigation"),b=jQuery("#framework"),c=parseInt(a.height()),d=parseInt(a.css("top"));b.css("min-height",parseInt(c+d))}function cloudfw_fixed_submit(){"use strict";jQuery(".submit-helper").each(function(){var a=jQuery(this),c=(a.parents(".framework_container").first(),a.children().first()),d=!1;return c.hasClass("fixed")&&(c.removeClass("fixed"),d=!0),a.is(":visible")&&(c.attr("data-width",a.parents(".framework_container").first().width()-50),a.css("min-height",a.find(".fixed-submit").height())),d&&c.addClass("fixed"),cloudfw_jqueried("cloudfw-submit-fixer",a)?!0:void a.bind("inview",function(b,d){1==d?(a.find(".fixed-submit").removeClass("fixed").stop(1,1).show(),c.css("width","auto")):(0==d||"undefined"==d)&&(jQuery(this).find(".fixed-submit").addClass("fixed").show(),c.css("width",a.parents(".framework_container").first().width()-52))}).trigger("inview")})}function resetInview(){"use strict";var a=[];jQuery.each(jQuery.cache,function(){this.events&&this.events.inview&&a.push(this.handle.elem)}),a.length&&jQuery(a).each(function(){jQuery(this).removeData("inviewed")})}function cloudfw_add_dynamics_menu_item(a){"use strict";var b=jQuery.extend({},{title:"",link:"#",id:"","class":"",icon:"",seq:!1},a);if(""==b.title||null==b.title)return!0;var c=jQuery("#cloudfw_navigation"),d=c.children("#"+b.id).length,e=jQuery("<li/>").addClass("dynamic").attr("id",b.id).addClass(b["class"]),f=jQuery("<a/>").attr("href",b.link).addClass("cl_nav"),g=jQuery("<span/>").attr("id",b.icon).addClass("cloudfw_navigation_icon"),h=jQuery("<span/>").addClass("cloudfw_navigation_title").html(b.title),i=e.append(f.append(g).append(h));return d?!0:(cloudfw_destroy_dynamics_menu_item("#"+b.id),"number"==typeof b.seq?c.children().eq(b.seq).before(i):c.append(i),i.hide().slideDown(),void cloudfw_panel_height())}function cloudfw_select_dynamics_menu_item(a){"use strict";jQuery("#cloudfw_navigation").children("li.cloudfw_active_tab").removeClass("cloudfw_active_tab").addClass("toReset"),jQuery("#cloudfw_navigation").children("li"+a).addClass("cloudfw_active_tab")}function cloudfw_reset_selection_for_dynamics_menu(){"use strict";jQuery("#cloudfw_navigation").children("li.cloudfw_active_tab").removeClass("cloudfw_active_tab"),jQuery("#cloudfw_navigation").children("li.toReset").removeClass("toReset").first().addClass("cloudfw_active_tab")}function cloudfw_destroy_dynamics_menu_item(a){"use strict";jQuery("#cloudfw_navigation").children("li.dynamic").filter(a).remove(),cloudfw_panel_height(),cloudfw_destroy()}function cloudfw_ui_hide_container(a,b){"use strict";var c={action:"cloudfw_hide_container",nonce:CloudFwOp.cloudfw_nonce,key:a.key,title:a.title,message:a.message};jQuery.ajax({url:CloudFwOp.ajaxUrl,cache:!1,type:"POST",data:jQuery.param(c,!0),success:function(a){try{var c=jQuery.parseJSON(a);cloudfw_dialog(c.messageTitle,c.messageText,c.messageCase),CloudFw_UI.call(b)}catch(d){cloudfw_dialog("Fatal Error","There was an error when the action in proccess.","error"),alert(a)}}})}function cloudfw_image_resize(a,b,c,d,e){"use strict";var f={action:"cloudfw_resize_image",url:a,width:b,height:c,nonce:CloudFwOp.cloudfw_nonce};jQuery.ajax({url:CloudFwOp.ajaxUrl,cache:!1,type:"POST",data:f,success:function(b){try{var c=jQuery.parseJSON(b);if(c.success)return CloudFw_UI.call(d,[c.url]),c.url;CloudFw_UI.call(e,[a])}catch(f){CloudFw_UI.call(e,[a])}}})}window.log=function(){log.history=log.history||[],log.history.push(arguments),this.console&&console.log(Array.prototype.slice.call(arguments))};