Import legacy nurinda.co.id website

This commit is contained in:
dirga committed 2026-10-01 14:27:19 +07:00
1 parent 3f59bb9038
commit 6e21646ac4
13389 files changed
+3246690

No files matched your search

@@ -0,0 +1 @@
if(!window.vc)var vc={};!function($){var ListenerHelper=vc.events={};_.extend(ListenerHelper,Backbone.Events),ListenerHelper.triggerShortcodeEvents=function(eventType,shortcodeModel){var shortcodeTag;shortcodeTag=shortcodeModel.get("shortcode"),this.trigger("shortcodes",shortcodeModel,eventType),this.trigger("shortcodes:"+shortcodeTag,shortcodeModel,eventType),this.trigger("shortcodes:"+eventType,shortcodeModel),this.trigger("shortcodes:"+shortcodeTag+":"+eventType,shortcodeModel),this.trigger("shortcodes:"+shortcodeTag+":"+eventType+":parent:"+shortcodeModel.get("parent_id"),shortcodeModel),this.triggerParamsEvents(eventType,shortcodeModel)},ListenerHelper.triggerParamsEvents=function(eventType,shortcodeModel){var shortcodeTag,params,settings;shortcodeTag=shortcodeModel.get("shortcode"),params=_.extend({},shortcodeModel.get("params")),settings=vc.map[shortcodeTag],_.isArray(settings.params)&&_.each(settings.params,function(paramSettings){this.trigger("shortcodes:"+eventType+":param",shortcodeModel,params[paramSettings.param_name],paramSettings),this.trigger("shortcodes:"+shortcodeTag+":"+eventType+":param",shortcodeModel,params[paramSettings.param_name],paramSettings),this.trigger("shortcodes:"+eventType+":param:type:"+paramSettings.type,shortcodeModel,params[paramSettings.param_name],paramSettings),this.trigger("shortcodes:"+shortcodeTag+":"+eventType+":param:type:"+paramSettings.type,shortcodeModel,params[paramSettings.param_name],paramSettings),this.trigger("shortcodes:"+eventType+":param:name:"+paramSettings.param_name,shortcodeModel,params[paramSettings.param_name],paramSettings),this.trigger("shortcodes:"+shortcodeTag+":"+eventType+":param:name:"+paramSettings.param_name,shortcodeModel,params[paramSettings.param_name],paramSettings)},this)}}(window.jQuery),function($){vc.AccessPolicyConstructor=function(){this.accessPolicy={},vc.events.trigger("vc:access:initialize",this)},vc.AccessPolicyConstructor.prototype={accessPolicy:{},add:function(part,grant){grant=!!_.isUndefined(grant)||!!grant,this.accessPolicy[part]=grant},can:function(part){return!!this.accessPolicy[part]}},$(function(){vc.accessPolicy=new vc.AccessPolicyConstructor})}(window.jQuery),function($){vc.events.on("vc:access:initialize",function(access){access.add("be_editor",vc_user_access().editor("backend_editor")),access.add("fe_editor",window.vc_frontend_enabled&&vc_user_access().editor("frontend_editor")),access.add("classic_editor",!vc_user_access().check("backend_editor","disabled_ce_editor",void 0,!0)),!window.vc.gridItemEditor&&vc.events.trigger("vc:access:backend:ready",access)}),vc.events.on("vc:access:backend:ready",function(access){var $buttonsContainer,front,back,gutenberg,$titleDiv,gutenbergEditor;gutenberg=back=front="",$titleDiv=$("div#titlediv"),gutenbergEditor=document.getElementById("editor"),$titleDiv.length?(access.can("fe_editor")&&(front='<a class="wpb_switch-to-front-composer" href="'+$("#wpb-edit-inline").attr("href")+'">'+window.i18nLocale.main_button_title_frontend_editor+"</a>"),access.can("classic_editor")?access.can("be_editor")&&(back='<a class="wpb_switch-to-composer" href="javascript:;">'+window.i18nLocale.main_button_title_backend_editor+"</a>"):($("#postdivrich").addClass("vc-disable-editor"),access.can("be_editor")&&_.defer(function(){vc.events.trigger("vc:backend_editor:show")})),window.wpbIsGutenberg&&(gutenberg='<a class="wpb_switch-to-gutenberg" href="'+window.wpbGutenbergEditorSWitchUrl+'">'+window.i18nLocale.main_button_title_gutenberg+"</a>"),(front||back||gutenberg)&&($buttonsContainer=$titleDiv.length?$('<div class="composer-switch"><span class="logo-icon"></span>'+back+front+gutenberg+"</div>").insertAfter($titleDiv):$('<div class="composer-switch"><span class="logo-icon"></span>'+back+front+gutenberg+"</div>").prependTo("#post-body-content"),access.can("classic_editor")&&$buttonsContainer.find(".wpb_switch-to-composer").click(function(e){vc.events.trigger("vc:backend_editor:switch")}))):gutenbergEditor&&(console.log(back),setTimeout(function(){back='<a class="wpb_switch-to-composer" href="'+window.wpbGutenbergEditorClassicSWitchUrl+'">'+window.i18nLocale.main_button_title+"</a>";var gutenbergEditorHeader=gutenbergEditor.querySelector(".edit-post-header-toolbar");gutenbergEditorHeader&&($buttonsContainer=$('<div class="composer-switch"><span class="logo-icon"></span>'+back+"</div>").appendTo(gutenbergEditorHeader))},1))})}(window.jQuery);
@@ -0,0 +1 @@
if(!window.vc)var vc={};function vc_toTitleCase(str){return str.replace(/\w\S*/g,function(txt){return txt.charAt(0).toUpperCase()+txt.substr(1).toLowerCase()})}function vc_convert_column_size(width){var numbers=width?width.split("/"):[1,1],range=_.range(1,13),num=!_.isUndefined(numbers[0])&&0<=_.indexOf(range,parseInt(numbers[0],10))&&parseInt(numbers[0],10),dev=!_.isUndefined(numbers[1])&&0<=_.indexOf(range,parseInt(numbers[1],10))&&parseInt(numbers[1],10);return!1!==num&&!1!==dev?"vc_col-sm-"+12*num/dev:"vc_col-sm-12"}function vc_convert_column_span_size(width){return"span12"===(width=width.replace(/^vc_/,""))?"1/1":"span11"===width?"11/12":"span10"===width?"5/6":"span9"===width?"3/4":"span8"===width?"2/3":"span7"===width?"7/12":"span6"===width?"1/2":"span5"===width?"5/12":"span4"===width?"1/3":"span3"===width?"1/4":"span2"===width?"1/6":"span1"===width&&"1/12"}function vc_get_column_mask(cells){var i,columns=cells.split("_"),columns_count=columns.length,numbers_sum=0;for(i in columns)if(!isNaN(parseFloat(columns[i]))&&isFinite(columns[i])){var sp=columns[i].match(/(\d{1,2})(\d{1,2})/);numbers_sum=_.reduce(sp.slice(1),function(memo,num){return memo+parseInt(num,10)},numbers_sum)}return columns_count+""+numbers_sum}function vc_guid(){return VCS4()+VCS4()+"-"+VCS4()}function VCS4(){return(65536*(1+Math.random())|0).toString(16).substring(1)}function vc_button_param_target_callback(){var $=jQuery,$link_target=this.$content.find("[name=target]").parents('[data-vc-ui-element="panel-shortcode-param"]:first'),$link_field=$(".wpb-edit-form [name=href]"),key_up_callback=_.debounce(function(){var val=$(this).val();0<val.length&&"http://"!==val&&"https://"!==val?$link_target.show():$link_target.hide()},300);$link_field.keyup(key_up_callback).trigger("keyup")}function vc_cta_button_param_target_callback(){var $=jQuery,$link_target=this.$content.find("[name=target]").parents('[data-vc-ui-element="panel-shortcode-param"]:first'),$link_field=$(".wpb-edit-form [name=href]"),key_up_callback=_.debounce(function(){var val=$(this).val();0<val.length&&"http://"!==val&&"https://"!==val?$link_target.show():$link_target.hide()},300);$link_field.keyup(key_up_callback).trigger("keyup")}function vc_grid_exclude_dependency_callback(){var $=jQuery,exclude_obj=$(".wpb_vc_param_value[name=exclude]",this.$content).data("vc-param-object");if(void 0===exclude_obj)return!1;var post_type_object=$('select.wpb_vc_param_value[name="post_type"]',this.$content),val=post_type_object.val();exclude_obj.source_data=function(request,response){return{query:{query:val,term:request.term}}},exclude_obj.source_data_val=val,post_type_object.change(function(){val=$(this).val(),exclude_obj.source_data_val!=val&&(exclude_obj.source_data=function(request,response){return{query:{query:val,term:request.term}}},exclude_obj.$el.data("uiAutocomplete").destroy(),exclude_obj.$sortable_wrapper.find(".vc_data").remove(),exclude_obj.render(),exclude_obj.source_data_val=val)})}function vcGridFilterExcludeCallBack(){var $filterBy,$exclude,autocomplete,defaultValue,$=jQuery;if($filterBy=$(".wpb_vc_param_value[name=filter_source]",this.$content),defaultValue=$filterBy.val(),$exclude=$(".wpb_vc_param_value[name=exclude_filter]",this.$content),void 0===(autocomplete=$exclude.data("vc-param-object")))return!1;$filterBy.change(function(){var $this=$(this);defaultValue!==$this.val()&&autocomplete.clearValue(),autocomplete.source_data=function(){return{vc_filter_by:$this.val()}}}).trigger("change")}function vcChartCustomColorDependency(){var $,$masterEl,$content;$masterEl=($=jQuery)(".wpb_vc_param_value[name=style]",this.$content),$content=this.$content,$masterEl.on("change",function(){var masterValue;masterValue=$(this).val(),$content.toggleClass("vc_chart-edit-form-custom-color","custom"===masterValue)}),$masterEl.trigger("change")}function vc_wpnop(html){if(html=void 0!==html?html+"":"",window.switchEditors&&void 0!==window.switchEditors.pre_wpautop)return html=(html=window.switchEditors.pre_wpautop(html)).replace(/<p>(<!--(?:.*)-->)<\/p>/g,"$1");if(!html)return"";var blocklist="blockquote|ul|ol|li|dl|dt|dd|table|thead|tbody|tfoot|tr|th|td|h[1-6]|fieldset|figure",blocklist1=blocklist+"|div|p",blocklist2=blocklist+"|pre",preserve_linebreaks=!1,preserve_br=!1,preserve=[];return-1===html.indexOf("<script")&&-1===html.indexOf("<style")||(html=html.replace(/<(script|style)[^>]*>[\s\S]*?<\/\1>/g,function(match){return preserve.push(match),"<wp-preserve>"})),-1!==html.indexOf("<pre")&&(preserve_linebreaks=!0,html=html.replace(/<pre[^>]*>[\s\S]+?<\/pre>/g,function(a){return(a=(a=a.replace(/<br ?\/?>(\r\n|\n)?/g,"<wp-line-break>")).replace(/<\/?p( [^>]*)?>(\r\n|\n)?/g,"<wp-line-break>")).replace(/\r?\n/g,"<wp-line-break>")})),-1!==html.indexOf("[caption")&&(preserve_br=!0,html=html.replace(/\[caption[\s\S]+?\[\/caption\]/g,function(a){return a.replace(/<br([^>]*)>/g,"<wp-temp-br$1>").replace(/[\r\n\t]+/,"")})),-1!==(html=(html=(html=(html=(html=(html=(html=(html=(html=(html=(html=(htmLine truncated
@@ -0,0 +1 @@
if(_.isUndefined(window.vc))var vc={atts:{}};if(function($){var VcColumnOffsetParam=Backbone.View.extend({events:{},$lg_offset_placeholder_value:!1,$lg_size_placeholder_value:!1,initialize:function(){_.bindAll(this,"setLgPlaceholders")},render:function(){return this},save:function(){var data=[];return this.$el.find(".vc_column_offset_field").each(function(){var $field=$(this);$field.is(":checkbox:checked")?data.push($field.attr("name")):$field.is("select")&&""!==$field.val()&&data.push($field.val())}),data},setLgPlaceholders:function(){var offset=this.$lg_offset_placeholder_value.val().replace(/[^\d]/g,"");this.$lg_size.find("option:first").text(VcI8nColumnOffsetParam.inherit_default),this.$lg_offset.find("option:first").text(offset?VcI8nColumnOffsetParam.inherit+offset:"")}});vc.atts.column_offset={parse:function(param){return this.content().find("input.wpb_vc_param_value."+param.param_name).data("vcColumnOffset").save().join(" ")},init:function(param,$field){$('[data-column-offset="true"]',$field).each(function(){var $this=$(this);$this.find(".wpb_vc_param_value").data("vcColumnOffset",new VcColumnOffsetParam({el:$this}).render())})}}}(window.jQuery),_.isUndefined(window.vc))vc={atts:{}};if(function($){var VcCssEditor,media=wp.media,preloaderUrl=ajaxurl.replace(/admin\-ajax\.php/,"images/wpspin_light.gif");media.controller.VcCssSingleImage=media.controller.VcSingleImage.extend({setCssEditor:function(view){return view&&(this._css_editor=view),this},updateSelection:function(){var attachments,selection=this.get("selection"),ids=this._css_editor.getBackgroundImage();void 0!==ids&&""!==ids&&-1!==ids&&(attachments=_.map(ids.toString().split(/,/),function(id){var attachment=wp.media.model.Attachment.get(id);return attachment.fetch(),attachment})),selection.reset(attachments)}}),VcCssEditor=vc.CssEditor=Backbone.View.extend({attrs:{},layouts:["margin","border-width","padding"],positions:["top","right","bottom","left"],$field:!1,simplify:!1,$simplify:!1,events:{"click .vc_icon-remove":"removeImage","click .vc_add-image":"addBackgroundImage","change .vc_simplify":"changeSimplify"},initialize:function(){_.bindAll(this,"setSimplify")},render:function(value){return this.attrs={},this.$simplify=this.$el.find(".vc_simplify"),_.isString(value)&&this.parse(value),this},parse:function(value){var data_split=value.split(/\s*(\.[^\{]+)\s*\{\s*([^\}]+)\s*\}\s*/g);data_split[2]&&this.parseAtts(data_split[2].replace(/\s+!important/g,""))},addBackgroundImage:function(e){if(e.preventDefault(),window.vc_selectedFilters={},this.image_media)return this.image_media.open("vc_editor");this.image_media=media({state:"vc_single-image",states:[(new media.controller.VcCssSingleImage).setCssEditor(this)]}),this.image_media.on("toolbar:create:vc_single-image",function(toolbar){this.createSelectToolbar(toolbar,{text:window.i18nLocale.set_image})},this.image_media),this.image_media.state("vc_single-image").on("select",this.setBgImage),this.image_media.open("vc_editor")},setBgImage:function(){!function(selection,obj){var ids;ids=[],$(".media-modal").addClass("processing-media"),selection.each(function(model){ids.push(model.get("id"))}),function(ids,callback){$.ajax({dataType:"json",type:"POST",url:window.ajaxurl,data:{action:"vc_media_editor_add_image",filters:window.vc_selectedFilters,ids:ids,vc_inline:!0,_vcnonce:window.vcAdminNonce}}).done(function(response){var attachments,attachment,promises,i;if("function"==typeof callback){for(attachments=[],promises=[],i=0;i<response.data.ids.length;i++)attachment=wp.media.model.Attachment.get(response.data.ids[i]),promises.push(attachment.fetch()),attachments.push(attachment);$.when.apply($,promises).done(function(){callback(attachments)})}}).fail(function(response){$(".media-modal-close").click(),window.vc&&window.vc.active_panel&&window.i18nLocale&&window.i18nLocale.error_while_saving_image_filtered&&vc.active_panel.showMessage(window.i18nLocale.error_while_saving_image_filtered,"error"),window.console&&window.console.error&&window.console.error(response)}).always(function(){$(".media-modal").removeClass("processing-media")})}(ids,function(newAttachments){if(!window.vc||!window.vc.active_panel)return!1;var attachments,objects;attachments=_.map(newAttachments,function(newAttachment){return newAttachment.attributes}),selection.reset(attachments),objects=_.map(selection.models,function(model){return model.attributes});var template=vc.template($("#vc_css-editor-image-block").html(),_.defaults({},{variable:"img"},vc.templateOptions.custom));obj._css_editor.$el.find(".vc_background-image .vc_image").html(template(objects[0])),$(".media-modal").removeClass("processing-media")})}(this.get("selection"),this)},setCurrentBgImage:function(value){var image_split,template,image_regexp=/([^\?]+)(\?id=\d+){0,1}/,url="",id="";value.match(/^\d+$/)?(template=vc.template($("#vc_css-editor-image-block").html(),_.defaults({},{variable:"img"},vc.templateOptions.custom)),this.$el.find(".vc_background-image .vc_image").html(tLine truncated
@@ -0,0 +1 @@
if(!window.vc)var vc={};if(function(){vc.templateOptions={default:{evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g},custom:{evaluate:/<#([\s\S]+?)#>/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g}};var noMatch=/(.)^/,escapes={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},escapeRegExp=/\\|'|\r|\n|\u2028|\u2029/g,escapeChar=function(match){return"\\"+escapes[match]};vc.template=function(text,settings){settings=_.defaults({},settings,vc.templateOptions.default);var render,matcher=RegExp([(settings.escape||noMatch).source,(settings.interpolate||noMatch).source,(settings.evaluate||noMatch).source].join("|")+"|$","g"),index=0,source="__p+='";text.replace(matcher,function(match,escape,interpolate,evaluate,offset){return source+=text.slice(index,offset).replace(escapeRegExp,escapeChar),index=offset+match.length,escape?source+="'+\n((__t=("+escape+"))==null?'':_.escape(__t))+\n'":interpolate?source+="'+\n((__t=("+interpolate+"))==null?'':__t)+\n'":evaluate&&(source+="';\n"+evaluate+"\n__p+='"),match}),source+="';\n",settings.variable||(source="with(obj||{}){\n"+source+"}\n"),source="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+source+"return __p;\n";try{render=new Function(settings.variable||"obj","_",source)}catch(e){throw e.source=source,e}var template=function(data){return render.call(this,data,_)},argument=settings.variable||"obj";return template.source="function("+argument+"){\n"+source+"}",template}}(),function($){"use strict";var TabsLine,Plugin,old;(TabsLine=function(element,options){var _this=this;this.options=options,this.$element=$(element),this.$dropdownContainer=this.$element.find(this.options.dropdownContainerSelector),this.$dropdown=this.$dropdownContainer.find(this.options.dropdownSelector),this.options.delayInit?(_this.$element.addClass(this.options.initializingClass),setTimeout(function(){_this.options.autoRefresh||_this.refresh(),_this.moveTabs(),_this.$element.removeClass(_this.options.initializingClass)},_this.options.delayInitTime)):(this.options.autoRefresh||this.refresh(),this.moveTabs()),$(window).on("resize",$.proxy(this.moveTabs,this)),this.$dropdownContainer.on("click.vc.tabsLine",$.proxy(this.checkDropdownContainerActive,this))}).DEFAULTS={initializingClass:"vc_initializing",delayInit:!1,delayInitTime:1e3,activeClass:"vc_active",visibleClass:"vc_visible",dropdownContainerSelector:'[data-vc-ui-element="panel-tabs-line-toggle"]',dropdownSelector:'[data-vc-ui-element="panel-tabs-line-dropdown"]',tabSelector:'>li:not([data-vc-ui-element="panel-tabs-line-toggle"])',dropdownTabSelector:"li",freeSpaceOffset:5,autoRefresh:!1,showDevInfo:!1},TabsLine.prototype.refresh=function(){var addClick,_this=this;return _this.tabs=[],_this.dropdownTabs=[],_this.$element.find(_this.options.tabSelector).each(function(){_this.tabs.push({$tab:$(this),width:$(this).outerWidth()})}),_this.$dropdown.find(_this.options.dropdownTabSelector).each(function(){var $tempElement=$(this).clone().css({visibility:"hidden",position:"fixed"});$tempElement.appendTo(_this.$element),_this.dropdownTabs.push({$tab:$(this),width:$tempElement.outerWidth()}),$tempElement.remove(),$(this).on("click",_this.options.onTabClick)}),"function"==typeof this.options.onTabClick&&(addClick=function(el){void 0===el.$tab.data("tabClickSet")&&(el.$tab.on("click",$.proxy(_this.options.onTabClick,el.$tab)),el.$tab.data("tabClickSet",!0))},_this.tabs.map(addClick),_this.dropdownTabs.map(addClick)),this},TabsLine.prototype.moveLastToDropdown=function(){var $element;return this.tabs.length&&(($element=this.tabs.pop()).$tab.prependTo(this.$dropdown),this.dropdownTabs.unshift($element)),this.checkDropdownContainer(),this},TabsLine.prototype.moveFirstToContainer=function(){var $element;return this.dropdownTabs.length&&(($element=this.dropdownTabs.shift()).$tab.appendTo(this.$element),this.tabs.push($element)),this.checkDropdownContainer(),this},TabsLine.prototype.getTabsWidth=function(){var tabsWidth=0;return this.tabs.forEach(function(entry){tabsWidth+=entry.width}),tabsWidth},TabsLine.prototype.isDropdownContainerVisible=function(){return this.$dropdownContainer.hasClass(this.options.visibleClass)},TabsLine.prototype.getFreeSpace=function(){var freeSpace=this.$element.width()-this.getTabsWidth()-this.options.freeSpaceOffset;return this.isDropdownContainerVisible()&&(freeSpace-=this.$dropdownContainer.outerWidth(),1===this.dropdownTabs.length&&0<=freeSpace-this.dropdownTabs[0].width+this.$dropdownContainer.outerWidth()&&(freeSpace+=this.$dropdownContainer.outerWidth())),freeSpace},TabsLine.prototype.moveTabsToDropdown=function(){for(var i=this.tabs.length-1;0<=i;i--){if(!(this.getFreeSpace()<0))return this;this.moveLastToDropdown()}return this},TabsLine.prototype.moveDropdownToTabs=function(){for(var dropdownTabsCount=this.dropdownTabs.length,i=0;i<dropdownTabsCount;i++){if(!(0<=this.getFreeSpace()-this.dropdownTabs[0].widLine truncated
@@ -0,0 +1 @@
window.jQuery,vc.events.on("vc:access:initialize",function(access){access.add("be_editor",vc_user_access().editor("grid_builder")),access.add("classic_editor",!1),vc.events.trigger("vc:access:grid_builder:ready",access)}),function($){vc.gridItemEditor=!0,vc.Storage.prototype.getContent=function(){var content;return _.isObject(window.tinymce)&&tinymce.editors.content&&tinymce.editors.content.save(),(content=window.vc_wpnop($("#content").val())).length?content:vcDefaultGridItemContent},vc.visualComposerView.prototype.rowSortableSelector="> [data-element_type]",vc.visualComposerView.prototype.events={"click #vc_templates-editor-button":"openTemplatesWindow",'click [data-vc-navbar-control="edit"]':"openVcGitemEditForm",'click [data-vc-navbar-control="preview"]':"renderGitemPreview",'change [data-vc-navbar-control="preview_width"]':"setPreviewItemWidth","click #wpb-save-post":"save",'change [data-vc-navbar-control="animation"]':"changeAnimation"},vc.visualComposerView.previewActivated=!1,vc.visualComposerView.prototype.renderGitemPreview=function(e){e&&e.preventDefault(),this.previewActivated?this.hidePreview():(vc.showSpinner(),this.sendDataGitemPreview())},vc.visualComposerView.prototype.sendDataGitemPreview=function(){var $form;$('[data-vc-grid-item="preview"]').html('<iframe name="vc_gitem-preview-iframe"></iframe>').addClass("vc_visible"),($form=$('<form id="vc_gitem-preview-form" action="'+encodeURI(ajaxurl)+'" method="post" target="vc_gitem-preview-iframe" style="position: absolute;visibility: hidden;right: 0; bottom:0"><input type="hidden" name="action" value="vc_gitem_preview"><input type="hidden" id="vc_gitem-preview-form-shortcode-string" name="shortcodes_string"><input type="hidden" name="post_id"><input type="hidden" name="_vcnonce" value="'+window.vcAdminNonce+'"><input type="submit" name="submit">').prependTo("body")).find('[name="post_id"]').val($("#post_ID").val()),$form.find('[name="shortcodes_string"]').val(vc.storage.getContent()),$form.find('[type="submit"]').trigger("click"),$form.remove()},vc.visualComposerView.prototype.showPreview=function(e){$("#visual_composer_content").hide(),$('[data-vc-grid-item="preview"]').addClass("vc_visible"),_.isString(e)&&$('[data-vc-grid-item="navbar_preview_width"] select').val(e),$('[data-vc-grid-item="navbar_preview_width"]').addClass("vc_visible"),vc.hideSpinner(),$('[data-vc-navbar-control="preview"]').text(i18nLocaleGItem.builder),this.previewActivated=!0},vc.visualComposerView.prototype.hidePreview=function(){$("#visual_composer_content").show(),$('[data-vc-grid-item="preview"]').removeClass("vc_visible").empty(),$('[data-vc-grid-item="navbar_preview_width"]').removeClass("vc_visible"),this.previewActivated=!1,$('[data-vc-navbar-control="preview"]').text(i18nLocaleGItem.preview)},vc.visualComposerView.prototype.setPreviewItemWidth=function(e){var iframeWindow=$("#vc_gitem-preview iframe").get(0).contentWindow;_.isString(e)?$('[data-vc-grid-item="navbar_preview_width"] select').val(e):e&&e.currentTarget&&iframeWindow.vcSetItemWidth($(e.currentTarget).val())},vc.visualComposerView.prototype.openVcGitemEditForm=function(e){e&&e.preventDefault();var vcGitemModel=vc.shortcodes.findWhere({shortcode:"vc_gitem"});this.previewActivated&&this.hidePreview(),vcGitemModel&&vc.edit_element_block_view.render(vcGitemModel)},vc.visualComposerView.prototype.setSortable=function(){return $(".wpb_column_container").sortable({forcePlaceholderSize:!0,forceHelperSize:!1,connectWith:".wpb_column_container",placeholder:"vc_placeholder",items:"> .wpb_sortable.wpb_content_element,> .wpb_content_element.vc-non-draggable",cancel:".vc-non-draggable",helper:this.renderPlaceholder,distance:3,scroll:!0,scrollSensitivity:70,cursor:"move",cursorAt:{top:20,left:16},tolerance:"intersect",start:function(){$("#visual_composer_content").addClass("vc_sorting-started"),$(".vc_not_inner_content").addClass("dragging_in")},stop:function(event,ui){$("#visual_composer_content").removeClass("vc_sorting-started"),$(".dragging_in").removeClass("dragging_in");var tag=ui.item.data("element_type"),parent_tag=ui.item.parent().closest("[data-element_type]").data("element_type"),allowed_container_element=!!_.isUndefined(vc.map[parent_tag].allowed_container_element)||vc.map[parent_tag].allowed_container_element;vc.check_relevance(parent_tag,tag)||$(this).sortable("cancel"),_.isObject(vc.map[tag])&&(_.isBoolean(vc.map[tag].is_container)&&!0===vc.map[tag].is_container||!_.isEmpty(vc.map[tag].as_parent))&&!0!==allowed_container_element&&allowed_container_element!==ui.item.data("element_type").replace(/_inner$/,"")&&$(this).sortable("cancel"),$(".vc_sorting-empty-container").removeClass("vc_sorting-empty-container")},update:this.updateElementsSorting,over:function(event,ui){var tag=ui.item.data("element_type"),parent_tag=ui.placeholder.closest("[data-element_type]").data("element_type"),allowed_container_element=!!_.isUndefined(vc.map[parent_tag].allowed_container_element)||vc.map[parent_tag].allowed_containerLine truncated
@@ -0,0 +1 @@
function vc_js(){vc_toggleBehaviour(),vc_tabsBehaviour(),vc_accordionBehaviour(),vc_teaserGrid(),vc_carouselBehaviour(),vc_slidersBehaviour(),vc_prettyPhoto(),vc_googleplus(),vc_pinterest(),vc_progress_bar(),vc_plugin_flexslider(),vc_google_fonts(),vc_gridBehaviour(),vc_rowBehaviour(),vc_prepareHoverBox(),vc_googleMapsPointer(),vc_ttaActivation(),jQuery(document).trigger("vc_js"),window.setTimeout(vc_waypoints,500)}document.documentElement.className+=" js_active ",document.documentElement.className+="ontouchstart"in document.documentElement?" vc_mobile ":" vc_desktop ",function(){for(var prefix=["-webkit-","-moz-","-ms-","-o-",""],i=0;i<prefix.length;i++)prefix[i]+"transform"in document.documentElement.style&&(document.documentElement.className+=" vc_transform ")}(),"function"!=typeof window.vc_plugin_flexslider&&(window.vc_plugin_flexslider=function($parent){($parent?$parent.find(".wpb_flexslider"):jQuery(".wpb_flexslider")).each(function(){var this_element=jQuery(this),sliderTimeout=1e3*parseInt(this_element.attr("data-interval")),sliderFx=this_element.attr("data-flex_fx"),slideshow=!0;0===sliderTimeout&&(slideshow=!1),this_element.is(":visible")&&this_element.flexslider({animation:sliderFx,slideshow:slideshow,slideshowSpeed:sliderTimeout,sliderSpeed:800,smoothHeight:!0})})}),"function"!=typeof window.vc_googleplus&&(window.vc_googleplus=function(){0<jQuery(".wpb_googleplus").length&&function(){var po=document.createElement("script");po.type="text/javascript",po.async=!0,po.src="https://apis.google.com/js/plusone.js";var s=document.getElementsByTagName("script")[0];s.parentNode.insertBefore(po,s)}()}),"function"!=typeof window.vc_pinterest&&(window.vc_pinterest=function(){0<jQuery(".wpb_pinterest").length&&function(){var po=document.createElement("script");po.type="text/javascript",po.async=!0,po.src="https://assets.pinterest.com/js/pinit.js";var s=document.getElementsByTagName("script")[0];s.parentNode.insertBefore(po,s)}()}),"function"!=typeof window.vc_progress_bar&&(window.vc_progress_bar=function(){void 0!==jQuery.fn.waypoint&&jQuery(".vc_progress_bar").waypoint(function(){jQuery(this).find(".vc_single_bar").each(function(index){var bar=jQuery(this).find(".vc_bar"),val=bar.data("percentage-value");setTimeout(function(){bar.css({width:val+"%"})},200*index)})},{offset:"85%"})}),"function"!=typeof window.vc_waypoints&&(window.vc_waypoints=function(){void 0!==jQuery.fn.waypoint&&jQuery(".wpb_animate_when_almost_visible:not(.wpb_start_animation)").waypoint(function(){jQuery(this).addClass("wpb_start_animation animated")},{offset:"85%"})}),"function"!=typeof window.vc_toggleBehaviour&&(window.vc_toggleBehaviour=function($el){function event(e){e&&e.preventDefault&&e.preventDefault();var element=jQuery(this).closest(".vc_toggle"),content=element.find(".vc_toggle_content");element.hasClass("vc_toggle_active")?content.slideUp({duration:300,complete:function(){element.removeClass("vc_toggle_active")}}):content.slideDown({duration:300,complete:function(){element.addClass("vc_toggle_active")}})}$el?$el.hasClass("vc_toggle_title")?$el.unbind("click").click(event):$el.find(".vc_toggle_title").unbind("click").click(event):jQuery(".vc_toggle_title").unbind("click").on("click",event)}),"function"!=typeof window.vc_tabsBehaviour&&(window.vc_tabsBehaviour=function($tab){if(jQuery.ui){var $call=$tab||jQuery(".wpb_tabs, .wpb_tour"),ver=jQuery.ui&&jQuery.ui.version?jQuery.ui.version.split("."):"1.10",old_version=1===parseInt(ver[0])&&parseInt(ver[1])<9;$call.each(function(index){var $tabs,interval=jQuery(this).attr("data-interval"),tabs_array=[];if($tabs=jQuery(this).find(".wpb_tour_tabs_wrapper").tabs({show:function(event,ui){wpb_prepare_tab_content(event,ui)},beforeActivate:function(event,ui){1!==ui.newPanel.index()&&ui.newPanel.find(".vc_pie_chart:not(.vc_ready)")},activate:function(event,ui){wpb_prepare_tab_content(event,ui)}}),interval&&0<interval)try{$tabs.tabs("rotate",1e3*interval)}catch(e){window.console&&window.console.warn&&console.warn(e)}jQuery(this).find(".wpb_tab").each(function(){tabs_array.push(this.id)}),jQuery(this).find(".wpb_tabs_nav li").click(function(e){return e.preventDefault(),old_version?$tabs.tabs("select",jQuery("a",this).attr("href")):$tabs.tabs("option","active",jQuery(this).index()),!1}),jQuery(this).find(".wpb_prev_slide a, .wpb_next_slide a").click(function(e){if(e.preventDefault(),old_version){var index=$tabs.tabs("option","selected");jQuery(this).parent().hasClass("wpb_next_slide")?index++:index--,index<0?index=$tabs.tabs("length")-1:index>=$tabs.tabs("length")&&(index=0),$tabs.tabs("select",index)}else{index=$tabs.tabs("option","active");var length=$tabs.find(".wpb_tab").length;index=jQuery(this).parent().hasClass("wpb_next_slide")?length<=index+1?0:index+1:index-1<0?length-1:index-1,$tabs.tabs("option","active",index)}})})}}),"function"!=typeof window.vc_accordionBehaviour&&(window.vc_accordionBehaviour=function(){jQuery(".wpb_accordion").each(function(index){var $tabs,$this=jQuery(thLine truncated
@@ -0,0 +1 @@
var vcPointerMessage,vc_iframe={scripts_to_wait:0,time_to_call:!1,ajax:!1,activities_list:[],scripts_to_load:!1,loaded_script:{},loaded_styles:{},inline_scripts:[],inline_scripts_body:[]};!function($){vc_iframe.showNoContent=function(show){var $vc_no_content_helper_el=$("#vc_no-content-helper");!1===show&&$vc_no_content_helper_el.addClass("vc_not-empty")||$vc_no_content_helper_el.removeClass("vc_not-empty")},vc_iframe.scrollTo=function(id){var $el,el_height,position_y,position,window_height=$(window).height(),window_scroll_top=$(window).scrollTop();if(id&&($el=$("[data-model-id="+id+"]"))){if(!1===(position_y=!!(position=$el.offset())&&position.top))return!1;el_height=$el.height(),(window_scroll_top+window_height<position_y||position_y+el_height<window_scroll_top)&&$.scrollTo($el,500,{offset:-50})}},vc_iframe.startSorting=function(){$("body").addClass("vc_sorting")},vc_iframe.stopSorting=function(){$("body").removeClass("vc_sorting")},vc_iframe.initDroppable=function(){$("body").addClass("vc_dragging"),$(".vc_container-block").bind("mouseenter.vcDraggable",function(){$(this).addClass("vc_catcher")}).bind("mouseout.vcDraggable",function(){$(this).removeClass("vc_catcher")})},vc_iframe.killDroppable=function(){$("body").removeClass("vc_dragging"),$(".vc_container-block").unbind("mouseover.vcDraggable mouseleave.vcDraggable")},vc_iframe.addActivity=function(callback){this.activities_list.push(callback)},vc_iframe.renderPlaceholder=function(event,element){var tag=$(element).data("tag"),is_container=parent.vc.map[tag]===Object(parent.vc.map[tag])&&((!0===parent.vc.map[tag].is_container||!1===parent.vc.map[tag].is_container||"[object Boolean]"===toString.call(parent.vc.map[tag].is_container))&&!0===parent.vc.map[tag].is_container||null!=parent.vc.map[tag].as_parent&&"[object Array]"===Object.prototype.toString.call(parent.vc.map[tag].as_parent)&&0!=parent.vc.map[tag].as_parent);return $('<div class="vc_helper vc_helper-'+tag+'"><i class="vc_general vc_element-icon'+(parent.vc.map[tag].icon?" "+parent.vc.map[tag].icon:"")+'"'+(is_container?' data-is-container="true"':"")+"></i> "+parent.vc.map[tag].name+"</div>").prependTo("body")},vc_iframe.setSortable=function(app){var setSectionSortable,setRowSortable,setElementsSortable,$rowSortable,$elementsSortable,_this=this;parent.vc.$page.addClass("vc-main-sortable-container");var $sectionSortables,$main=$(parent.vc.$page);$main.sortable({forcePlaceholderSize:!1,connectWith:!1,items:"> [data-tag=vc_row], > [data-tag=vc_section]",handle:" > .vc_row .vc_move-vc_row, > .vc_controls .vc_element-move",cursor:"move",cursorAt:{top:20,left:16},placeholder:"vc_placeholder-row",cancel:".vc-non-draggable-row",helper:_this.renderPlaceholder,start:function(event,ui){vc_iframe.startSorting(),ui.placeholder.height(30),"vc_section"==ui.item.data("tag")?($sectionSortables&&$sectionSortables.sortable("destroy"),$rowSortable&&$rowSortable.sortable("destroy"),$elementsSortable&&$elementsSortable.sortable("destroy"),$main.sortable("option","connectWith",!1)):$main.sortable("option","connectWith",['[data-tag="vc_section"] > .vc_element-container']),$main.sortable("refresh")},stop:function(event,ui){var tag,vc_map,parent_tag,allowed_container_element,trig_changed;(_this.stopSorting(),"vc_section"==(tag=ui.item.data("tag"))&&(setSectionSortable(),setRowSortable(),setElementsSortable()),$main.sortable("option","connectWith",!1),$main.sortable("refresh"),vc_map=window.parent.vc.map||!1,trig_changed=!0,parent_tag=ui.item.parents("[data-tag]:first").data("tag"))&&(allowed_container_element=!vc_map[parent_tag].allowed_container_element||vc_map[parent_tag].allowed_container_element,window.parent.vc.checkRelevance(parent_tag,tag)||(ui.placeholder.removeClass("vc_hidden-placeholder"),$(this).sortable("cancel"),trig_changed=!1),vc_map[tag]===Object(vc_map[tag])&&((!0===vc_map[tag].is_container||!1===vc_map[tag].is_container||"[object Boolean]"===toString.call(vc_map[tag].is_container))&&!0===vc_map[tag].is_container||null!=vc_map[tag].as_parent&&"[object Array]"===Object.prototype.toString.call(vc_map[tag].as_parent)&&0!=vc_map[tag].as_parent)&&!0!==allowed_container_element&&allowed_container_element!==tag.replace(/_inner$/,"")&&(ui.placeholder.removeClass("vc_hidden-placeholder"),$(this).sortable("cancel"),trig_changed=!1));trig_changed&&parent.vc.shortcodes.get(ui.item.data("modelId")).view.parentChanged()},tolerance:"pointer",update:function(event,ui){parent.vc.app.saveRowOrder(event,ui)}}),setElementsSortable=function(){$elementsSortable=$(".vc_element-container:not(.vc_section)").sortable({forcePlaceholderSize:!0,helper:this.renderPlaceholder,distance:3,scroll:!0,scrollSensitivity:70,cursor:"move",cursorAt:{top:20,left:16},connectWith:".vc_element-container:not(.vc_section)",items:"> [data-model-id]",cancel:".vc-non-draggable",handle:".vc_element-move",start:this.startSorting,update:app.saveElementOrder,change:function(event,ui){ui.placeholder.height(30),ui.placeholder.width(ui.placeholder.parent(Line truncated
@@ -0,0 +1 @@
if(!window.vc)var vc={};if(function(){vc.templateOptions={default:{evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g},custom:{evaluate:/<#([\s\S]+?)#>/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g}};var noMatch=/(.)^/,escapes={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},escapeRegExp=/\\|'|\r|\n|\u2028|\u2029/g,escapeChar=function(match){return"\\"+escapes[match]};vc.template=function(text,settings){settings=_.defaults({},settings,vc.templateOptions.default);var render,matcher=RegExp([(settings.escape||noMatch).source,(settings.interpolate||noMatch).source,(settings.evaluate||noMatch).source].join("|")+"|$","g"),index=0,source="__p+='";text.replace(matcher,function(match,escape,interpolate,evaluate,offset){return source+=text.slice(index,offset).replace(escapeRegExp,escapeChar),index=offset+match.length,escape?source+="'+\n((__t=("+escape+"))==null?'':_.escape(__t))+\n'":interpolate?source+="'+\n((__t=("+interpolate+"))==null?'':__t)+\n'":evaluate&&(source+="';\n"+evaluate+"\n__p+='"),match}),source+="';\n",settings.variable||(source="with(obj||{}){\n"+source+"}\n"),source="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+source+"return __p;\n";try{render=new Function(settings.variable||"obj","_",source)}catch(e){throw e.source=source,e}var template=function(data){return render.call(this,data,_)},argument=settings.variable||"obj";return template.source="function("+argument+"){\n"+source+"}",template}}(),function($){"use strict";_.isUndefined(window.vc)&&(window.vc={}),window.Vc_postSettingsEditor=Backbone.View.extend({$editor:!1,sel:"wpb_csseditor",ace_enabled:!1,initialize:function(sel){sel&&0<sel.length&&(this.sel=sel),this.ace_enabled=!0},aceEnabled:function(){return this.ace_enabled&&window.ace&&window.ace.edit},setEditor:function(value){return this.aceEnabled()?this.setEditorAce(value):this.setEditorTextarea(value),this.$editor},focus:function(){if(this.aceEnabled()){this.$editor.focus();var count=this.$editor.session.getLength();this.$editor.gotoLine(count,this.$editor.session.getLine(count-1).length)}else this.$editor.focus()},setEditorAce:function(value){this.$editor||(this.$editor=ace.edit(this.sel),this.$editor.getSession().setMode("ace/mode/css"),this.$editor.setTheme("ace/theme/chrome")),this.$editor.setValue(value),this.$editor.clearSelection(),this.$editor.focus();var count=this.$editor.getSession().getLength();return this.$editor.gotoLine(count,this.$editor.getSession().getLine(count-1).length),this.$editor},setEditorTextarea:function(value){return this.$editor||(this.$editor=$("<textarea></textarea>").css({width:"100%",height:"100%",minHeight:"300px"}),$("#"+this.sel).empty().append(this.$editor).css({overflowLeft:"hidden",width:"100%",height:"100%"})),this.$editor.val(value),this.$editor.focus(),this.$editor.parent().css({overflow:"auto"}),this.$editor},setSize:function(){var height=$(window).height()-380;this.aceEnabled()?$("#"+this.sel).css({height:height,minHeight:height}):(this.$editor.parent().css({height:height,minHeight:height}),this.$editor.css({height:"98%",width:"98%"}))},setSizeResizable:function(){var height,editorPositionTop,$editor=$("#"+this.sel);editorPositionTop=$editor.offset().top,height=vc.active_panel.$el.find('[data-vc-ui-element="panel-footer"]').offset().top-editorPositionTop-70,this.aceEnabled()?$editor.css({height:height,minHeight:height}):(this.$editor.parent().css({height:height,minHeight:height}),this.$editor.css({height:"98%",width:"98%"}))},getEditor:function(){return this.$editor},getValue:function(){return this.aceEnabled()?this.$editor.getValue():this.$editor.val()}})}(window.jQuery),function($){"use strict";$(function(){var $form=$('[data-vc-roles="form"]');$('[data-vc-roles="part-state"]').click(function(){var $this=$(this);$this.data("vcCustomSelector",$this.find(":selected").data("vcCustomSelector")||"")}).change(function(){var value,part,$customBlock,$this,customSelector;if(part=($this=$(this)).data("vcRolePart"),"*"===($customBlock=$('[data-vc-role-related-part="'+part+'"]')).data("vcRolePartState"))return!1;value=$this.val(),customSelector=$this.data("vcCustomSelector")||"",$customBlock.data("vcRolePartState").toString()===value?($customBlock.addClass("vc_visible"),customSelector.length&&$customBlock.find($this.data("vcCustomSelector")).prop("checked",!0)):$customBlock.removeClass("vc_visible")}),$form.submit(function(e){var $submitButton,data={};e.preventDefault(),($submitButton=$("#submit_btn")).attr("disabled",!0),$("#vc_wp-spinner").show(),data.action=$("#vc_settings-roles-action").val(),data.vc_nonce_field=$("#vc_nonce_field").val(),data.vc_roles={},$("[data-vc-role]").each(function(){var $this=$(this),role=$this.data("vcRole"),roleData={};$this.find("select").each(function(){var $this=$(this),part=$this.data("vcPart");void 0===roleData[part]&&(roleData[part]={}),roleData[part][$this.data("vcName")]=$this.val()}),$thLine truncated
@@ -0,0 +1 @@
var vcGridStyleAll;!function($){(vcGridStyleAll=function(grid){this.grid=grid,this.settings=grid.settings,this.filterValue=null,this.$el=!1,this.$content=!1,this.isLoading=!1,this.$loader=$('<div class="vc_grid-loading"></div>'),this.init()}).prototype.init=function(){_.bindAll(this,"addItems","showItems","setIsLoading")},vcGridStyleAll.prototype.render=function(){this.$el=this.grid.$el,this.$content=this.$el,this.$content.find(".vc_grid-item").length?(this.grid.initFilter(),this.filter(),this.showItems(),this.filterValue=-1,window.vc_prettyPhoto()):(_.defer(this.setIsLoading),this.grid.ajax({},this.addItems))},vcGridStyleAll.prototype.setIsLoading=function(){this.$content.append(this.$loader),this.isLoading=!0},vcGridStyleAll.prototype.unsetIsLoading=function(){this.isLoading=!1,this.$loader&&this.$loader.remove()},vcGridStyleAll.prototype.filter=function(filter){if(filter=_.isUndefined(filter)||"*"===filter?"":filter,this.filterValue==filter)return!1;var animation=this.$content.closest(".vc_grid-container").data("initial-loading-animation");vcGridSettings.addItemsAnimation=animation,this.$content.find(".vc_visible-item").removeClass("vc_visible-item "+vcGridSettings.addItemsAnimation+" animated"),this.filterValue=filter,_.defer(this.showItems)},vcGridStyleAll.prototype.showItems=function(){var $els=this.$content.find(".vc_grid-item"+this.filterValue);this.setIsLoading();var animation=this.$content.closest(".vc_grid-container").data("initial-loading-animation");vcGridSettings.addItemsAnimation=animation,$els.addClass("vc_visible-item "+("none"!==vcGridSettings.addItemsAnimation?vcGridSettings.addItemsAnimation+" animated":"")),this.unsetIsLoading(),$(window).trigger("grid:items:added",this.$el)},vcGridStyleAll.prototype.addItems=function(html){if(html&&html.length){var els=$(html);this.$el.html(els),this.unsetIsLoading(),this.$content=els.find('[data-vc-grid-content="true"]'),this.grid.initFilter(),this.filter(),window.vc_prettyPhoto()}}}(window.jQuery);var vcGridStyleLoadMore=null;!function($){(vcGridStyleLoadMore=function(grid){this.grid=grid,this.settings=grid.settings,this.$loadMoreBtn=!1,this.$el=!1,this.filterValue=null,this.$content=!1,this.isLoading=!1,this.$loader=$('<div class="vc_grid-loading"></div>'),this.init()}).prototype.setIsLoading=function(){this.$loadMoreBtn&&this.$loadMoreBtn.hide(),this.isLoading=!0},vcGridStyleLoadMore.prototype.unsetIsLoading=function(){this.isLoading=!1,this.setLoadMoreBtn()},vcGridStyleLoadMore.prototype.init=function(){_.bindAll(this,"addItems")},vcGridStyleLoadMore.prototype.render=function(){this.$el=this.grid.$el,this.$content=this.$el,this.grid.initFilter(),this.filter(),this.showItems(),this.filterValue=-1,window.vc_prettyPhoto(),this.$content.append(this.$loader),this.grid.ajax({},this.addItems)},vcGridStyleLoadMore.prototype.showItems=function(){var $els=this.$content.find(".vc_grid_filter-item:not(.vc_visible-item):lt("+this.settings.items_per_page+")");this.setIsLoading();var animation=this.$content.closest(".vc_grid-container").data("initial-loading-animation");vcGridSettings.addItemsAnimation=animation,$els.addClass("vc_visible-item "+vcGridSettings.addItemsAnimation+" animated"),this.unsetIsLoading(),$(window).trigger("grid:items:added",this.$el)},vcGridStyleLoadMore.prototype.filter=function(filter){if(filter=_.isUndefined(filter)||"*"===filter?"":filter,this.filterValue==filter)return!1;this.$content.closest(".vc_grid-container").data("initial-loading-animation");this.$content.find(".vc_visible-item, .vc_grid_filter-item").removeClass("vc_visible-item vc_grid_filter-item "),this.filterValue=filter,this.$content.find(".vc_grid-item"+this.filterValue).addClass("vc_grid_filter-item"),this.showItems()},vcGridStyleLoadMore.prototype.addItems=function(html){if(html&&html.length){var els=$(html);this.$el.html(els),this.unsetIsLoading(),this.$content=els.find('[data-vc-grid-content="true"]'),this.$loadMoreBtn=els.find('[data-vc-grid-load-more-btn="true"] .vc_btn3'),this.$loadMoreBtn.length||(this.$loadMoreBtn=els.find('[data-vc-grid-load-more-btn="true"] .vc_btn'));var self=this;this.$loadMoreBtn.click(function(e){e.preventDefault(),self.showItems()}),this.$loadMoreBtn.hide(),this.grid.initFilter(),this.filter(),this.$loader.remove(),window.vc_prettyPhoto()}},vcGridStyleLoadMore.prototype.setLoadMoreBtn=function(){$('.vc_grid_filter-item:not(".vc_visible-item")',this.$content).length&&$(".vc_grid_filter-item",this.$content).length?this.$loadMoreBtn&&this.$loadMoreBtn.show():this.$loadMoreBtn&&this.$loadMoreBtn.hide()}}(window.jQuery);var vcGridStyleLazy=null;!function($){$.waypoints("extendFn","vc_grid-infinite",function(options){var opts;return"auto"===(opts=$.extend({},$.fn.waypoint.defaults,{container:"auto",items:".infinite-item",offset:"bottom-in-view",handle:{load:function(opts){}}},options)).container?this:$(opts.container,this),opts.handler=function(direction){"down"!==direction&&"right"!==direction||($(this).waypoint("destroy"),opts.handle.load.caLine truncated
@@ -0,0 +1,175 @@
/* =========================================================
* templates-preview.js v1.0.0
* =========================================================
* Copyright 2015 WPBakery
*
* WPBakery Page Builder template preview
* ========================================================= */
/* global vc */
(function ( $ ) {
'use strict';
if ( window.vc && vc.visualComposerView ) {
// unset Draggable
vc.visualComposerView.prototype.setDraggable = function () {
};
// unset Sortable
vc.visualComposerView.prototype.setSortable = function () {
};
// unset Sortable
vc.visualComposerView.prototype.setSorting = function () {
};
// unset save
vc.visualComposerView.prototype.save = function () {
};
// unset controls checks for scroll
vc.visualComposerView.prototype.navOnScroll = function () {
};
vc.visualComposerView.prototype.addElement = function ( e ) {
e && e.preventDefault && e.preventDefault();
};
vc.visualComposerView.prototype.addTextBlock = function ( e ) {
e && e.preventDefault && e.preventDefault();
};
vc.shortcode_view.prototype.events = {};
vc.shortcode_view.prototype.editElement = function ( e ) {
e && e.preventDefault && e.preventDefault();
};
vc.shortcode_view.prototype.clone = function ( e ) {
e && e.preventDefault && e.preventDefault();
};
vc.shortcode_view.prototype.addElement = function ( e ) {
e && e.preventDefault && e.preventDefault();
};
vc.shortcode_view.prototype.deleteShortcode = function ( e ) {
e && e.preventDefault && e.preventDefault();
};
vc.shortcode_view.prototype.setEmpty = function () {
};
vc.visualComposerView.prototype.events = {};
//vc.shortcode_view.prototype.designHelpersSelector = '[data-js-handler-design-helper]';
// update backend getView
vc.visualComposerView.prototype.getView = function ( model ) {
var view;
if ( _.isObject( vc.map[ model.get( 'shortcode' ) ] ) && _.isString( vc.map[ model.get( 'shortcode' ) ].js_view ) && vc.map[ model.get( 'shortcode' ) ].js_view.length && ! _.isUndefined( window[ window.vc.map[ model.get( 'shortcode' ) ].js_view ] ) ) {
try {
var viewConstructor = window[ window.vc.map[ model.get( 'shortcode' ) ].js_view ];
viewConstructor.prototype.events = {};
viewConstructor.prototype.setSortable = function () {
};
viewConstructor.prototype.setSorting = function () {
};
viewConstructor.prototype.setDropable = function () {
};
viewConstructor.prototype.editElement = function ( e ) {
e && e.preventDefault && e.preventDefault();
};
viewConstructor.prototype.clone = function ( e ) {
e && e.preventDefault && e.preventDefault();
};
viewConstructor.prototype.addElement = function ( e ) {
e && e.preventDefault && e.preventDefault();
};
viewConstructor.prototype.deleteShortcode = function ( e ) {
e && e.preventDefault && e.preventDefault();
};
viewConstructor.prototype.setEmpty = function () {
};
viewConstructor.prototype.events = {};
// viewConstructor.prototype.designHelpersSelector = '[data-js-handler-design-helper]';
view = new viewConstructor( { model: model } );
} catch ( e ) {
window.console && window.console.error && window.console.error( e );
}
} else {
vc.shortcode_view.prototype.events = {};
view = new vc.shortcode_view( { model: model } );
}
model.set( { view: view } );
return view;
};
}
// unset sortable,draggable,droppable - removed due to issues of return types
/*jQuery.fn.sortable = function () {
}
jQuery.fn.draggable = function () {
}
jQuery.fn.droppable = function () {
}*/
if ( window.VcGitemView ) {
window.VcGitemView.prototype.setDropable = function () {
};
window.VcGitemView.prototype.setDraggable = function () {
};
window.VcGitemView.prototype.setDraggableC = function () {
};
}
if ( window.vc && window.vc.events ) {
window.vc.events.on( 'shortcodeView:ready', function ( view ) {
if ( window.VcGitemView ) {
// and do more complex for grid builder
/*var goodShortcodes = [
'vc_gitem',
'vc_gitem_animated_block',
'vc_gitem_zone_a',
'vc_gitem_row',
'vc_gitem_col',
'vc_gitem_zone_c',
'vc_gitem_zone_b'
];
if ( view.$control_buttons && _.indexOf( goodShortcodes, view.model.get( 'shortcode' ) ) !== - 1 ) {
// view.$controls_buttons.remove(); // do this for normal case BE
}
view.$el.find( '.vc_control.column_edit' ).remove();
view.$el.find( '.vc_control.column_add' ).remove();
view.$el.find( '.vc_control.column_delete' ).remove();
view.$el.find( '.vc_control.column_clone' ).remove();
view.$el.find( '.vc_control.column_move' ).remove();
view.$el.find( '.vc_color-helper' ).css( 'right', '0' );*/
view.$el.find( '.vc_control-btn.vc_element-name.vc_element-move .vc_btn-content' ).attr( 'style',
'cursor:pointer !important;' +
'padding-left: 10px !important;' );
view.$el.find( '.vc_control-btn.vc_element-name.vc_element-move .vc_btn-content .vc-c-icon-dragndrop' ).hide();
//view.$el.find( '.vc_controls.vc_controls-visible.bottom-controls' ).remove();
if ( 'vc_gitem' === view.model.get( 'shortcode' ) ) {
view.$el.find( '.vc_gitem-add-c-col:not(.vc_zone-added)' ).remove()
}
} else {
//view.$control_buttons && view.$controls_buttons.remove(); // do this for normal case BE
//view.$el.find( '.vc_controls' ).remove(); // do this for normal case BE
}
if ( view.$el ) {
// remove TTA section append
view.$el.find( '.vc_tta-section-append' ).remove();
// remove old TTA tour append
view.$el.find( '.add_tab_block' ).remove();
view.$el.find( '.tab_controls' ).remove();
// remove single image "add-image" link
view.$el.find( '.column_edit_trigger' ).remove();
}
} );
}
vc.visualComposerView.prototype.initializeAccessPolicy = function () {
this.accessPolicy = {
be_editor: true,
fe_editor: false,
classic_editor: false
};
};
vc.events.on( 'app.addAll', function () {
if ( parent && parent.vc ) {
parent.vc.templates_panel_view.setTemplatePreviewSize();
}
} );
$(window ).resize(function(){
parent.vc.templates_panel_view.setTemplatePreviewSize();
});
})( window.jQuery );
@@ -0,0 +1,27 @@
(function ( $ ) {
window.InlineShortcodeView_vc_line_chart = window.InlineShortcodeView.extend( {
render: function () {
var model_id = this.model.get( 'id' );
window.InlineShortcodeView_vc_line_chart.__super__.render.call( this );
vc.frame_window.vc_iframe.addActivity( function () {
this.vc_line_charts( model_id );
} );
return this;
},
parentChanged: function () {
var modelId = this.model.get( 'id' );
window.InlineShortcodeView_vc_line_chart.__super__.parentChanged.call( this );
_.defer( function () {
vc.frame_window.vc_line_charts( modelId );
} );
return this;
},
remove: function () {
var id = this.$el.find( '.vc_line-chart' ).data( 'vcChartId' );
window.InlineShortcodeView_vc_line_chart.__super__.remove.call( this );
if ( id && undefined !== vc.frame_window.Chart.instances[ id ] ) {
delete vc.frame_window.Chart.instances[ id ];
}
}
} );
})( window.jQuery );
@@ -0,0 +1,24 @@
(function ( $ ) {
window.InlineShortcodeView_vc_pie = window.InlineShortcodeView.extend( {
render: function () {
_.bindAll( this, 'parentChanged' );
window.InlineShortcodeView_vc_pie.__super__.render.call( this );
this.unbindResize();
vc.frame_window.vc_iframe.addActivity( function () {
this.vc_iframe.vc_pieChart();
} );
return this;
},
unbindResize: function () {
vc.frame_window.jQuery( vc.frame_window ).unbind( 'resize.vcPieChartEditable' );
},
parentChanged: function () {
this.$el.find( '.vc_pie_chart' ).removeClass( 'vc_ready' );
vc.frame_window.vc_pieChart();
},
rowsColumnsConverted: function () {
window.setTimeout( this.parentChanged, 200 );
this.parentChanged();
}
} );
})( window.jQuery );
@@ -0,0 +1,27 @@
(function ( $ ) {
window.InlineShortcodeView_vc_round_chart = window.InlineShortcodeView.extend( {
render: function () {
var model_id = this.model.get( 'id' );
window.InlineShortcodeView_vc_round_chart.__super__.render.call( this );
vc.frame_window.vc_iframe.addActivity( function () {
this.vc_round_charts( model_id );
} );
return this;
},
parentChanged: function () {
var modelId = this.model.get( 'id' );
window.InlineShortcodeView_vc_round_chart.__super__.parentChanged.call( this );
_.defer( function () {
vc.frame_window.vc_round_charts( modelId );
} );
return this;
},
remove: function () {
var id = this.$el.find( '.vc_round-chart' ).data( 'vcChartId' );
window.InlineShortcodeView_vc_round_chart.__super__.remove.call( this );
if ( id && undefined !== vc.frame_window.Chart.instances[ id ] ) {
delete vc.frame_window.Chart.instances[ id ];
}
}
} );
})( window.jQuery );
@@ -0,0 +1,131 @@
(function ( $ ) {
vc.events.on( 'shortcodeView:updated', function ( model ) {
var modelId, settings;
settings = vc.map[ model.get( 'shortcode' ) ] || false;
if ( true === settings.is_container ) {
modelId = model.get( 'id' );
vc.frame_window.vc_iframe.updateChildGrids( modelId );
}
} );
window.InlineShortcodeViewContainer = window.InlineShortcodeView.extend( {
controls_selector: '#vc_controls-template-container',
events: {
'click > .vc_controls .vc_element .vc_control-btn-delete': 'destroy',
'click > .vc_controls .vc_element .vc_control-btn-edit': 'edit',
'click > .vc_controls .vc_element .vc_control-btn-clone': 'clone',
'click > .vc_controls .vc_element .vc_control-btn-prepend': 'prependElement',
'click > .vc_controls .vc_control-btn-append': 'appendElement',
'click > .vc_empty-element': 'appendElement',
'mouseenter': 'resetActive',
'mouseleave': 'holdActive'
},
hold_active: false,
parent_view: false,
initialize: function ( params ) {
_.bindAll( this, 'holdActive' );
window.InlineShortcodeViewContainer.__super__.initialize.call( this, params );
if ( this.model.get( 'parent_id' ) ) {
this.parent_view = vc.shortcodes.get( this.model.get( 'parent_id' ) ).view;
}
},
resetActive: function ( e ) {
this.hold_active && window.clearTimeout( this.hold_active );
},
holdActive: function ( e ) {
this.resetActive();
this.$el.addClass( 'vc_hold-active' );
var view = this;
this.hold_active = window.setTimeout( function () {
view.hold_active && window.clearTimeout( view.hold_active );
view.hold_active = false;
view.$el.removeClass( 'vc_hold-active' );
}, 700 );
},
content: function () {
if ( false === this.$content ) {
this.$content = this.$el.find( '.vc_container-anchor:first' ).parent();
this.$el.find( '.vc_container-anchor:first' ).remove();
}
return this.$content;
},
render: function () {
window.InlineShortcodeViewContainer.__super__.render.call( this );
this.content().addClass( 'vc_element-container' );
this.$el.addClass( 'vc_container-block' );
return this;
},
changed: function () {
if ( this.allowAddControlOnEmpty() ) {
(0 === this.$el.find( '.vc_element[data-tag]' ).length && this.$el.addClass( 'vc_empty' ).find(
'> :first' ).addClass( 'vc_empty-element' ))
|| this.$el.removeClass( 'vc_empty' ).find( '> .vc_empty-element' ).removeClass( 'vc_empty-element' );
}
},
prependElement: function ( e ) {
_.isObject( e ) && e.preventDefault();
this.prepend = true;
vc.add_element_block_view.render( this.model, true );
},
appendElement: function ( e ) {
_.isObject( e ) && e.preventDefault();
vc.add_element_block_view.render( this.model );
},
addControls: function () {
var shortcodeTag, parentShortcodeTag, allAccess, moveAccess, editAccess, parentAllAccess, parentEditAccess, template, parent, data;
shortcodeTag = this.model.get( 'shortcode' );
template = $( this.controls_selector ).html();
var parentName;
parent = vc.shortcodes.get( this.model.get( 'parent_id' ) );
if ( parent ) {
parentName = vc.getMapped( parent.get( 'shortcode' ) ).name;
parentShortcodeTag = parent.get( 'shortcode' );
}
allAccess = vc_user_access().shortcodeAll( shortcodeTag );
editAccess = vc_user_access().shortcodeEdit( shortcodeTag );
parentAllAccess = vc_user_access().shortcodeAll( parentShortcodeTag );
parentEditAccess = vc_user_access().shortcodeEdit( parentShortcodeTag );
moveAccess = vc_user_access().partAccess('dragndrop');
data = {
name: vc.getMapped( shortcodeTag ).name,
tag: shortcodeTag,
parent_name: parentName,
parent_tag: parentShortcodeTag,
can_edit: editAccess,
can_all: allAccess,
moveAccess: moveAccess,
parent_can_edit: parentEditAccess,
parent_can_all: parentAllAccess,
state: vc_user_access().getState( 'shortcodes' ),
allowAdd: this.allowAddControl(),
switcherPrefix: ! parentAllAccess || ! allAccess ? '-disable-switcher' : ''
};
var compiledTemplate = vc.template( _.unescape( template ),
_.extend( {}, vc.templateOptions.custom, { evaluate: /\{#([\s\S]+?)#}/g } ) );
this.$controls = $( compiledTemplate( data ).trim() ).addClass( 'vc_controls' );
this.$controls.appendTo( this.$el );
},
allowAddControl: function () {
return vc_user_access().getState( 'shortcodes' ) !== 'edit';
},
multi_edit: function ( e ) {
var models = [], parent, children;
_.isObject( e ) && e.preventDefault();
if ( this.model.get( 'parent_id' ) ) {
parent = vc.shortcodes.get( this.model.get( 'parent_id' ) );
}
if ( parent ) {
models.push( parent );
children = vc.shortcodes.where( { parent_id: parent.get( 'id' ) } );
vc.multi_edit_element_block_view.render( models.concat( children ), this.model.get( 'id' ) );
} else {
vc.edit_element_block_view.render( this.model );
}
},
allowAddControlOnEmpty: function () {
return vc_user_access().getState( 'shortcodes' ) !== 'edit';
}
} );
})( window.jQuery );
@@ -0,0 +1,56 @@
(function ( $ ) {
window.InlineShortcodeViewContainerWithParent = window.InlineShortcodeViewContainer.extend( {
controls_selector: '#vc_controls-template-container-with-parent',
events: {
'click > .vc_controls .vc_element .vc_control-btn-delete': 'destroy',
'click > .vc_controls .vc_element .vc_control-btn-edit': 'edit',
'click > .vc_controls .vc_element .vc_control-btn-clone': 'clone',
'click > .vc_controls .vc_element .vc_control-btn-prepend': 'prependElement',
'click > .vc_controls .vc_control-btn-append': 'appendElement',
'click > .vc_controls .vc_parent .vc_control-btn-delete': 'destroyParent',
'click > .vc_controls .vc_parent .vc_control-btn-edit': 'editParent',
'click > .vc_controls .vc_parent .vc_control-btn-clone': 'cloneParent',
'click > .vc_controls .vc_parent .vc_control-btn-prepend': 'addSibling',
'click > .vc_controls .vc_parent .vc_control-btn-layout': 'changeLayout',
'click > .vc_empty-element': 'appendElement',
'click > .vc_controls .vc_control-btn-switcher': 'switchControls',
'mouseenter': 'resetActive',
'mouseleave': 'holdActive'
},
destroyParent: function ( e ) {
e && e.preventDefault();
this.parent_view.destroy( e );
},
cloneParent: function ( e ) {
e && e.preventDefault();
this.parent_view.clone( e );
},
editParent: function ( e ) {
e && e.preventDefault();
this.parent_view.edit( e );
},
addSibling: function ( e ) {
e && e.preventDefault();
this.parent_view.addElement( e );
},
changeLayout: function ( e ) {
e && e.preventDefault();
this.parent_view.changeLayout( e );
},
switchControls: function ( e ) {
e && e.preventDefault();
vc.unsetHoldActive();
var $control = $( e.currentTarget ),
$parent = $control.parent(),
$current;
// $parentAdvanced = $parent.find( '.vc_advanced' );
//$parentAdvanced.width( 30 * $parentAdvanced.find( '.vc_control-btn' ).length );
$parent.addClass( 'vc_active' );
$current = $parent.siblings( '.vc_active' );
//$current.find( '.vc_advanced' ).width( 0 );
$current.removeClass( 'vc_active' );
! $current.hasClass( 'vc_element' ) && window.setTimeout( this.holdActive, 500 );
}
} );
})( window.jQuery );
@@ -0,0 +1,124 @@
(function ( $ ) {
window.InlineShortcodeView_vc_column = window.InlineShortcodeViewContainerWithParent.extend( {
controls_selector: '#vc_controls-template-vc_column',
resizeDomainName: 'columnSize',
_x: 0,
css_width: 12,
prepend: false,
initialize: function ( params ) {
window.InlineShortcodeView_vc_column.__super__.initialize.call( this, params );
_.bindAll( this, 'startChangeSize', 'stopChangeSize', 'resize' );
},
render: function () {
var width;
window.InlineShortcodeView_vc_column.__super__.render.call( this );
this.prepend = false;
// Here goes width logic
$( '<div class="vc_resize-bar"></div>' )
.appendTo( this.$el )
.mousedown( this.startChangeSize );
this.setColumnClasses();
this.customCssClassReplace();
return this;
},
destroy: function ( e ) {
var parent_id = this.model.get( 'parent_id' );
window.InlineShortcodeView_vc_column.__super__.destroy.call( this, e );
if ( ! vc.shortcodes.where( { parent_id: parent_id } ).length ) {
vc.shortcodes.get( parent_id ).destroy();
}
},
customCssClassReplace: function () {
var css_classes, css_regex, class_match;
css_classes = this.$el.find( '.wpb_column' ).attr( 'class' );
css_regex = /.*(vc_custom_\d+).*/;
class_match = css_classes && css_classes.match ? css_classes.match( css_regex ) : false;
if ( class_match && class_match[ 1 ] ) {
this.$el.addClass( class_match[ 1 ] );
this.$el.find( '.wpb_column' ).attr( 'class', css_classes.replace( class_match[ 1 ], '' ).trim() );
}
},
setColumnClasses: function () {
var offset, width, $content;
offset = this.getParam( 'offset' ) || '';
width = this.getParam( 'width' ) || '1/1';
$content = this.$el.find( '> .wpb_column' );
this.css_class_width = this.convertSize( width );
if ( this.css_class_width !== width ) {
this.css_class_width = this.css_class_width.replace( /[^\d]/g, '' );
}
$content.removeClass( 'vc_col-sm-' + this.css_class_width );
if ( ! offset.match( /vc_col\-sm\-\d+/ ) ) {
this.$el.addClass( 'vc_col-sm-' + this.css_class_width );
}
if ( vc.responsive_disabled ) {
offset = offset.replace( /vc_col\-(lg|md|xs)[^\s]*/g, '' );
}
if ( ! _.isEmpty( offset ) ) {
$content.removeClass( offset );
this.$el.addClass( offset );
}
},
startChangeSize: function ( e ) {
var width = this.getParam( width ) || 12;
this._grid_step = this.parent_view.$el.width() / width;
vc.frame_window.jQuery( 'body' ).addClass( 'vc_column-dragging' ).disableSelection();
this._x = parseInt( e.pageX );
vc.$page.bind( 'mousemove.' + this.resizeDomainName, this.resize );
$( vc.frame_window.document ).mouseup( this.stopChangeSize );
},
stopChangeSize: function () {
this._x = 0;
vc.frame_window.jQuery( 'body' ).removeClass( 'vc_column-dragging' ).enableSelection();
vc.$page.unbind( 'mousemove.' + this.resizeDomainName );
},
resize: function ( e ) {
var width, old_width, diff, params = this.model.get( 'params' );
diff = e.pageX - this._x;
if ( Math.abs( diff ) < this._grid_step ) {
return;
}
this._x = parseInt( e.pageX );
old_width = '' + this.css_class_width;
if ( 0 < diff ) {
this.css_class_width += 1;
} else if ( 0 > diff ) {
this.css_class_width -= 1;
}
if ( 12 < this.css_class_width ) {
this.css_class_width = 12;
}
if ( 1 > this.css_class_width ) {
this.css_class_width = 1;
}
params.width = vc.getColumnSize( this.css_class_width );
this.model.save( { params: params }, { silent: true } );
this.$el.removeClass( 'vc_col-sm-' + old_width ).addClass( 'vc_col-sm-' + this.css_class_width );
},
convertSize: function ( width ) {
var prefix, numbers, range, num, dev;
prefix = 'vc_col-sm-';
numbers = width ? width.split( '/' ) : [
1,
1
];
range = _.range( 1, 13 );
num = ! _.isUndefined( numbers[ 0 ] ) && 0 <= _.indexOf( range,
parseInt( numbers[ 0 ], 10 ) ) ? parseInt( numbers[ 0 ], 10 ) : false;
dev = ! _.isUndefined( numbers[ 1 ] ) && 0 <= _.indexOf( range,
parseInt( numbers[ 1 ], 10 ) ) ? parseInt( numbers[ 1 ], 10 ) : false;
// Custom fix for 5 columns grid
if ( '5' === numbers[ 1 ] ) {
return width;
}
if ( false !== num && false !== dev ) {
return prefix + (12 * num / dev);
}
return prefix + '12';
},
allowAddControl: function () {
return vc_user_access().shortcodeAll( 'vc_column' );
}
} );
})( window.jQuery );
@@ -0,0 +1,3 @@
(function ( $ ) {
window.InlineShortcodeView_vc_column_inner = window.InlineShortcodeView_vc_column.extend( {} );
})( window.jQuery );
@@ -0,0 +1,145 @@
(function ( $ ) {
window.InlineShortcodeView_vc_row = window.InlineShortcodeView.extend( {
column_tag: 'vc_column',
events: {
'mouseenter': 'removeHoldActive'
},
layout: 1,
addControls: function () {
this.$controls = $( '<div class="no-controls"></div>' );
this.$controls.appendTo( this.$el );
return this;
},
render: function () {
var $content = this.content();
if ( $content && $content.hasClass( 'vc_row-has-fill' ) ) {
$content.removeClass( 'vc_row-has-fill' );
this.$el.addClass( 'vc_row-has-fill' );
}
window.InlineShortcodeView_vc_row.__super__.render.call( this );
return this;
},
removeHoldActive: function () {
vc.unsetHoldActive();
},
addColumn: function () {
vc.builder.create( {
shortcode: this.column_tag,
parent_id: this.model.get( 'id' )
} ).render();
},
addElement: function ( e ) {
e && e.preventDefault();
this.addColumn();
},
changeLayout: function ( e ) {
e && e.preventDefault();
this.layoutEditor().render( this.model ).show();
},
layoutEditor: function () {
if ( _.isUndefined( vc.row_layout_editor ) ) {
vc.row_layout_editor = new vc.RowLayoutUIPanelFrontendEditor( { el: $( '#vc_ui-panel-row-layout' ) } );
}
return vc.row_layout_editor;
},
convertToWidthsArray: function ( string ) {
return _.map( string.split( /_/ ), function ( c ) {
var w = c.split( '' );
w.splice( Math.floor( c.length / 2 ), 0, '/' );
return w.join( '' );
} );
},
changed: function () {
window.InlineShortcodeView_vc_row.__super__.changed.call( this );
this.addLayoutClass();
},
content: function () {
if ( false === this.$content ) {
this.$content = this.$el.find( '.vc_container-anchor:first' ).parent();
}
this.$el.find( '.vc_container-anchor:first' ).remove();
return this.$content;
},
addLayoutClass: function () {
this.$el.removeClass( 'vc_layout_' + this.layout );
this.layout = _.reject( vc.shortcodes.where( { parent_id: this.model.get( 'id' ) } ), function ( model ) {
return model.get( 'deleted' )
} ).length;
this.$el.addClass( 'vc_layout_' + this.layout );
},
convertRowColumns: function ( layout, builder ) {
if ( ! layout ) {
return false;
}
var column_params, new_model, columns_contents, columns;
columns_contents = [];
columns = this.convertToWidthsArray( layout );
vc.layout_change_shortcodes = [];
vc.layout_old_columns = vc.shortcodes.where( { parent_id: this.model.get( 'id' ) } );
_.each( vc.layout_old_columns, function ( column ) {
column.set( 'deleted', true );
columns_contents.push( {
shortcodes: vc.shortcodes.where( { parent_id: column.get( 'id' ) } ),
params: column.get( 'params' )
} );
} );
_.each( columns, function ( column ) {
var prev_settings = columns_contents.shift();
if ( _.isObject( prev_settings ) ) {
new_model = builder.create( {
shortcode: this.column_tag,
parent_id: this.model.get( 'id' ),
order: vc.shortcodes.nextOrder(),
params: _.extend( {}, prev_settings.params, { width: column } )
} ).last();
_.each( prev_settings.shortcodes, function ( shortcode ) {
shortcode.save( {
parent_id: new_model.get( 'id' ),
order: vc.shortcodes.nextOrder()
},
{ silent: true } );
vc.layout_change_shortcodes.push( shortcode );
}, this );
} else {
column_params = { width: column };
new_model = builder.create( {
shortcode: this.column_tag,
parent_id: this.model.get( 'id' ),
order: vc.shortcodes.nextOrder(),
params: column_params
} ).last();
}
}, this );
_.each( columns_contents, function ( column ) {
_.each( column.shortcodes, function ( shortcode ) {
shortcode.save( {
parent_id: new_model.get( 'id' ),
order: vc.shortcodes.nextOrder()
},
{ silent: true } );
vc.layout_change_shortcodes.push( shortcode );
shortcode.view.rowsColumnsConverted && shortcode.view.rowsColumnsConverted()
}, this );
}, this );
builder.render( function () {
_.each( vc.layout_change_shortcodes, function ( shortcode ) {
shortcode.trigger( 'change:parent_id' );
shortcode.view.rowsColumnsConverted && shortcode.view.rowsColumnsConverted();
} );
_.each( vc.layout_old_columns, function ( column ) {
column.destroy();
} );
vc.layout_old_columns = [];
vc.layout_change_shortcodes = [];
} );
return columns;
},
allowAddControl: function () {
return vc_user_access().getState( 'shortcodes' ) !== 'edit';
},
allowAddControlOnEmpty: function () {
return vc_user_access().getState( 'shortcodes' ) !== 'edit';
}
} );
})( window.jQuery );
@@ -0,0 +1,5 @@
(function ( $ ) {
window.InlineShortcodeView_vc_row_inner = window.InlineShortcodeView_vc_row.extend( {
column_tag: 'vc_column_inner'
} );
})( window.jQuery );
@@ -0,0 +1,26 @@
(function ( $ ) {
window.InlineShortcodeView_vc_section = window.InlineShortcodeViewContainer.extend( {
controls_selector: '#vc_controls-template-container',
initialize: function () {
_.bindAll( this, 'checkSectionWidth' );
window.InlineShortcodeView_vc_section.__super__.initialize.call( this );
vc.frame_window.jQuery( vc.frame_window.document ).off( 'vc-full-width-row-single',
this.checkSectionWidth );
vc.frame_window.jQuery( vc.frame_window.document ).on( 'vc-full-width-row-single', this.checkSectionWidth );
},
checkSectionWidth: function ( e, data ) {
if ( data.el.hasClass( 'vc_section' ) && data.el.attr( 'data-vc-stretch-content' ) ) {
data.el.siblings( '.vc_controls' ).find( '.vc_controls-out-tl' ).css( { left: data.offset - 17 } );
}
},
render: function () {
var $content = this.content();
if ( $content && $content.hasClass( 'vc_row-has-fill' ) ) {
$content.removeClass( 'vc_row-has-fill' );
this.$el.addClass( 'vc_row-has-fill' );
}
return window.InlineShortcodeView_vc_section.__super__.render.call( this );
}
} );
})( window.jQuery );
@@ -0,0 +1,21 @@
(function ( $ ) {
window.InlineShortcodeView_vc_column_text = window.InlineShortcodeView.extend( {
initialize: function ( options ) {
window.InlineShortcodeView_vc_column_text.__super__.initialize.call( this, options );
_.bindAll( this, 'setupEditor', 'updateContent' );
},
render: function () {
window.InlineShortcodeView_vc_column_text.__super__.render.call( this );
// Here
return this;
},
setupEditor: function ( ed ) {
ed.on( 'keyup', this.updateContent )
},
updateContent: function () {
var params = this.model.get( 'params' );
params.content = tinyMCE.activeEditor.getContent();
this.model.save( { params: params }, { silent: true } );
}
} );
})( window.jQuery );
@@ -0,0 +1,12 @@
(function ( $ ) {
window.InlineShortcodeView_vc_flickr = window.InlineShortcodeView.extend( {
render: function () {
window.InlineShortcodeView_vc_flickr.__super__.render.call( this );
var $placeholder = this.$el.find( '.vc_flickr-inline-placeholder' );
vc.frame_window.vc_iframe.addActivity( function () {
this.vc_iframe.vc_Flickr( $placeholder );
} );
return this;
}
} );
})( window.jQuery );
@@ -0,0 +1,12 @@
(function ( $ ) {
window.InlineShortcodeView_vc_posts_slider = window.InlineShortcodeView.extend( {
render: function () {
var model_id = this.model.get( 'id' );
window.InlineShortcodeView_vc_posts_slider.__super__.render.call( this );
vc.frame_window.vc_iframe.addActivity( function () {
this.vc_iframe.vc_postsSlider( model_id );
} );
return this;
}
} );
})( window.jQuery );
@@ -0,0 +1,10 @@
(function ( $ ) {
window.InlineShortcodeView_vc_raw_js = window.InlineShortcodeView.extend( {
render: function () {
window.InlineShortcodeView_vc_raw_js.__super__.render.call( this );
var script = this.$el.find( '.vc_js_inline_holder' ).val();
this.$el.find( '.wpb_wrapper' ).html( script );
return this;
}
} );
})( window.jQuery );
@@ -0,0 +1,12 @@
(function ( $ ) {
window.InlineShortcodeView_vc_toggle = window.InlineShortcodeView.extend( {
render: function () {
var model_id = this.model.get( 'id' );
window.InlineShortcodeView_vc_toggle.__super__.render.call( this );
vc.frame_window.vc_iframe.addActivity( function () {
this.vc_iframe.vc_toggle( model_id );
} );
return this;
}
} );
})( window.jQuery );
@@ -0,0 +1,57 @@
(function ( $ ) {
window.InlineShortcodeView_vc_accordion = window.InlineShortcodeView_vc_row.extend( {
events: {
'click > .wpb_accordion > .vc_empty-element': 'addElement'
},
render: function () {
_.bindAll( this, 'stopSorting' );
this.$accordion = this.$el.find( '> .wpb_accordion' );
window.InlineShortcodeView_vc_accordion.__super__.render.call( this );
return this;
},
changed: function () {
if ( this.allowAddControlOnEmpty() && 0 === this.$el.find( '.vc_element[data-tag]' ).length ) {
this.$el.addClass( 'vc_empty' ).find( '> :first' ).addClass( 'vc_empty-element' );
} else {
this.allowAddControlOnEmpty() && this.$el.removeClass( 'vc_empty' ).find( '> .vc_empty-element' ).removeClass(
'vc_empty-element' );
this.setSorting();
}
},
buildAccordion: function ( active_model ) {
var active = false;
if ( active_model ) {
active = this.$accordion.find( '[data-model-id=' + active_model.get( 'id' ) + ']' ).index();
}
vc.frame_window.vc_iframe.buildAccordion( this.$accordion, active );
},
setSorting: function () {
vc.frame_window.vc_iframe.setAccordionSorting( this );
},
beforeUpdate: function () {
this.$el.find( '.wpb_accordion_heading' ).remove();
window.InlineShortcodeView_vc_accordion.__super__.beforeUpdate.call( this );
},
stopSorting: function () {
this.$accordion.find( '> .wpb_accordion_wrapper > .vc_element[data-tag]' ).each( function () {
var model = vc.shortcodes.get( $( this ).data( 'modelId' ) );
model.save( { order: $( this ).index() }, { silent: true } );
} );
},
addElement: function ( e ) {
e && e.preventDefault();
new vc.ShortcodesBuilder()
.create( {
shortcode: 'vc_accordion_tab',
params: { title: window.i18nLocale.section },
parent_id: this.model.get( 'id' )
} )
.render();
},
rowsColumnsConverted: function () {
_.each( vc.shortcodes.where( { parent_id: this.model.get( 'id' ) } ), function ( model ) {
model.view.rowsColumnsConverted && model.view.rowsColumnsConverted();
} );
}
} );
})( window.jQuery );
@@ -0,0 +1,51 @@
(function ( $ ) {
window.InlineShortcodeView_vc_accordion_tab = window.InlineShortcodeView_vc_tab.extend( {
events: {
'click > .vc_controls .vc_element .vc_control-btn-delete': 'destroy',
'click > .vc_controls .vc_element .vc_control-btn-edit': 'edit',
'click > .vc_controls .vc_element .vc_control-btn-clone': 'clone',
'click > .vc_controls .vc_element .vc_control-btn-prepend': 'prependElement',
'click > .vc_controls .vc_control-btn-append': 'appendElement',
'click > .vc_controls .vc_parent .vc_control-btn-delete': 'destroyParent',
'click > .vc_controls .vc_parent .vc_control-btn-edit': 'editParent',
'click > .vc_controls .vc_parent .vc_control-btn-clone': 'cloneParent',
'click > .vc_controls .vc_parent .vc_control-btn-prepend': 'addSibling',
'click > .wpb_accordion_section > .vc_empty-element': 'appendElement',
'click > .vc_controls .vc_control-btn-switcher': 'switchControls',
'mouseenter': 'resetActive',
'mouseleave': 'holdActive'
},
changed: function () {
if ( this.allowAddControlOnEmpty() && 0 === this.$el.find( '.vc_element[data-tag]' ).length ) {
this.$el.addClass( 'vc_empty' );
this.content().addClass( 'vc_empty-element' );
} else {
this.$el.removeClass( 'vc_empty' );
this.content().removeClass( 'vc_empty-element' );
}
},
render: function () {
window.InlineShortcodeView_vc_tab.__super__.render.call( this );
if ( ! this.content().find( '.vc_element[data-tag]' ).length ) {
this.content().empty();
}
this.parent_view.buildAccordion( ! this.model.get( 'from_content' ) && ! this.model.get( 'default_content' ) ? this.model : false );
return this;
},
rowsColumnsConverted: function () {
_.each( vc.shortcodes.where( { parent_id: this.model.get( 'id' ) } ), function ( model ) {
model.view.rowsColumnsConverted && model.view.rowsColumnsConverted();
} );
},
destroy: function ( e ) {
var parent_id = this.model.get( 'parent_id' );
window.InlineShortcodeView_vc_accordion_tab.__super__.destroy.call( this, e );
if ( ! vc.shortcodes.where( { parent_id: parent_id } ).length ) {
vc.shortcodes.get( parent_id ).destroy();
}
},
allowAddControl: function () {
return vc_user_access().shortcodeAll( 'vc_accordion_tab' );
}
} );
})( window.jQuery );
@@ -0,0 +1,81 @@
(function ( $ ) {
window.InlineShortcodeView_vc_tab = window.InlineShortcodeViewContainerWithParent.extend( {
controls_selector: '#vc_controls-template-vc_tab',
render: function () {
var tab_id, active, params;
params = this.model.get( 'params' );
window.InlineShortcodeView_vc_tab.__super__.render.call( this );
this.$tab = this.$el.find( '> :first' );
/**
* @deprecated 4.4.3
* @see composer-atts.js vc.atts.tab_id.addShortcode
*/
if ( _.isEmpty( params.tab_id ) ) {
params.tab_id = vc_guid() + '-' + Math.floor( Math.random() * 11 );
this.model.save( 'params', params );
tab_id = 'tab-' + params.tab_id;
this.$tab.attr( 'id', tab_id );
} else {
tab_id = this.$tab.attr( 'id' );
}
this.$el.attr( 'id', tab_id );
this.$tab.attr( 'id', tab_id + '-real' );
if ( ! this.$tab.find( '.vc_element[data-tag]' ).length ) {
this.$tab.empty();
}
this.$el.addClass( 'ui-tabs-panel wpb_ui-tabs-hide' );
this.$tab.removeClass( 'ui-tabs-panel wpb_ui-tabs-hide' );
if ( this.parent_view && this.parent_view.addTab ) {
if ( ! this.parent_view.addTab( this.model ) ) {
this.$el.removeClass( 'wpb_ui-tabs-hide' );
}
}
active = this.doSetAsActive();
this.parent_view.buildTabs( active );
return this;
},
allowAddControl: function () {
return vc_user_access().shortcodeAll( 'vc_tab' );
},
doSetAsActive: function () {
var active_before_cloned = this.model.get( 'active_before_cloned' );
if ( ! this.model.get( 'from_content' ) && ! this.model.get( 'default_content' ) && _.isUndefined(
active_before_cloned ) ) {
return this.model;
} else if ( ! _.isUndefined( active_before_cloned ) ) {
this.model.unset( 'active_before_cloned' );
if ( true === active_before_cloned ) {
return this.model;
}
}
return false;
},
removeView: function ( model ) {
window.InlineShortcodeView_vc_tab.__super__.removeView.call( this, model );
if ( this.parent_view && this.parent_view.removeTab ) {
this.parent_view.removeTab( model );
}
},
clone: function ( e ) {
_.isObject( e ) && e.preventDefault() && e.stopPropagation();
vc.clone_index /= 10;
var clone = this.model.clone(),
params = clone.get( 'params' ),
builder = new vc.ShortcodesBuilder();
var newmodel = vc.CloneModel( builder, this.model, this.model.get( 'parent_id' ) );
var active_model = this.parent_view.active_model_id;
var that = this;
builder.render( function () {
if ( that.parent_view.cloneTabAfter ) {
that.parent_view.cloneTabAfter( newmodel );
}
} );
},
rowsColumnsConverted: function () {
_.each( vc.shortcodes.where( { parent_id: this.model.get( 'id' ) } ), function ( model ) {
model.view.rowsColumnsConverted && model.view.rowsColumnsConverted();
} );
}
} );
})( window.jQuery );
@@ -0,0 +1,180 @@
(function ( $ ) {
vc.cloneMethod_vc_tab = function ( data, model ) {
data.params = _.extend( {}, data.params );
data.params.tab_id = vc_guid() + '-cl';
if ( ! _.isUndefined( model.get( 'active_before_cloned' ) ) ) {
data.active_before_cloned = model.get( 'active_before_cloned' );
}
return data;
};
window.InlineShortcodeView_vc_tabs = window.InlineShortcodeView_vc_row.extend( {
events: {
'click > :first > .vc_empty-element': 'addElement',
'click > :first > .wpb_wrapper > .ui-tabs-nav > li': 'setActiveTab'
},
already_build: false,
active_model_id: false,
$tabsNav: false,
active: 0,
render: function () {
_.bindAll( this, 'stopSorting' );
this.$tabs = this.$el.find( '> .wpb_tabs' );
window.InlineShortcodeView_vc_tabs.__super__.render.call( this );
this.buildNav();
return this;
},
buildNav: function () {
var $nav = this.tabsControls();
this.$tabs.find( '> .wpb_wrapper > .vc_element[data-tag="vc_tab"]' ).each( function ( key ) {
$( 'li:eq(' + key + ')', $nav ).attr( 'data-m-id', $( this ).data( 'model-id' ) );
} );
},
changed: function () {
if ( this.allowAddControlOnEmpty() && 0 === this.$el.find( '.vc_element[data-tag]' ).length ) {
this.$el.addClass( 'vc_empty' ).find( '> :first > div' ).addClass( 'vc_empty-element' );
} else {
this.$el.removeClass( 'vc_empty' ).find( '> :first > div' ).removeClass( 'vc_empty-element' );
}
this.setSorting();
},
setActiveTab: function ( e ) {
var $tab = $( e.currentTarget );
this.active_model_id = $tab.data( 'm-id' );
},
tabsControls: function () {
return this.$tabsNav ? this.$tabsNav : this.$tabsNav = this.$el.find( '.wpb_tabs_nav' );
},
buildTabs: function ( active_model ) {
if ( active_model ) {
this.active_model_id = active_model.get( 'id' );
this.active = this.tabsControls().find( '[data-m-id=' + this.active_model_id + ']' ).index();
}
if ( false === this.active_model_id ) {
var active_el = this.tabsControls().find( 'li:first' );
this.active = active_el.index();
this.active_model_id = active_el.data( 'm-id' );
}
if ( ! this.checkCount() ) {
vc.frame_window.vc_iframe.buildTabs( this.$tabs, this.active );
}
},
checkCount: function () {
return this.$tabs.find( '> .wpb_wrapper > .vc_element[data-tag="vc_tab"]' ).length != this.$tabs.find(
'> .wpb_wrapper > .vc_element.vc_vc_tab' ).length;
},
beforeUpdate: function () {
this.$tabs.find( '.wpb_tabs_heading' ).remove();
vc.frame_window.vc_iframe.destroyTabs( this.$tabs );
},
updated: function () {
window.InlineShortcodeView_vc_tabs.__super__.updated.call( this );
this.$tabs.find( '.wpb_tabs_nav:first' ).remove();
this.buildNav();
vc.frame_window.vc_iframe.buildTabs( this.$tabs );
this.setSorting();
},
rowsColumnsConverted: function () {
_.each( vc.shortcodes.where( { parent_id: this.model.get( 'id' ) } ), function ( model ) {
model.view.rowsColumnsConverted && model.view.rowsColumnsConverted();
} );
},
addTab: function ( model ) {
if ( this.updateIfExistTab( model ) ) {
return false;
}
var $control = this.buildControlHtml( model ),
$cloned_tab;
if ( model.get( 'cloned' ) && ($cloned_tab = this.tabsControls().find( '[data-m-id=' + model.get(
'cloned_from' ).id + ']' )).length ) {
if ( ! model.get( 'cloned_appended' ) ) {
$control.appendTo( this.tabsControls() );
model.set( 'cloned_appended', true );
}
} else {
$control.appendTo( this.tabsControls() );
}
this.changed();
return true;
},
cloneTabAfter: function ( model ) {
this.$tabs.find( '> .wpb_wrapper > .wpb_tabs_nav > div' ).remove();
this.buildTabs( model );
},
updateIfExistTab: function ( model ) {
var $tab = this.tabsControls().find( '[data-m-id=' + model.get( 'id' ) + ']' );
if ( $tab.length ) {
$tab.attr( 'aria-controls', 'tab-' + model.getParam( 'tab_id' ) )
.find( 'a' )
.attr( 'href', '#tab-' + model.getParam( 'tab_id' ) )
.text( model.getParam( 'title' ) );
return true;
}
return false;
},
buildControlHtml: function ( model ) {
var params = model.get( 'params' ),
$tab = $( '<li data-m-id="' + model.get( 'id' ) + '"><a href="#tab-' + model.getParam( 'tab_id' ) + '"></a></li>' );
$tab.data( 'model', model );
$tab.find( '> a' ).text( model.getParam( 'title' ) );
return $tab;
},
addElement: function ( e ) {
e && e.preventDefault();
new vc.ShortcodesBuilder()
.create( {
shortcode: 'vc_tab',
params: {
tab_id: vc_guid() + '-' + this.tabsControls().find( 'li' ).length,
title: this.getDefaultTabTitle()
},
parent_id: this.model.get( 'id' )
} )
.render();
},
getDefaultTabTitle: function () {
return window.i18nLocale.tab;
},
setSorting: function () {
if ( this.hasUserAccess() ) {
vc.frame_window.vc_iframe.setTabsSorting( this );
}
},
stopSorting: function ( event, ui ) {
this.tabsControls().find( '> li' ).each( function ( key, value ) {
var model = $( this ).data( 'model' );
model.save( { order: key }, { silent: true } );
} );
},
placeElement: function ( $view, activity ) {
var model = vc.shortcodes.get( $view.data( 'modelId' ) );
if ( model && model.get( 'place_after_id' ) ) {
$view.insertAfter( vc.$page.find( '[data-model-id=' + model.get( 'place_after_id' ) + ']' ) );
model.unset( 'place_after_id' );
} else {
$view.insertAfter( this.tabsControls() );
}
this.changed();
},
removeTab: function ( model ) {
if ( 1 === vc.shortcodes.where( { parent_id: this.model.get( 'id' ) } ).length ) {
return this.model.destroy();
}
var $tab = this.tabsControls().find( '[data-m-id=' + model.get( 'id' ) + ']' ),
index = $tab.index();
if ( this.tabsControls().find( '[data-m-id]:eq(' + (index + 1) + ')' ).length ) {
vc.frame_window.vc_iframe.setActiveTab( this.$tabs, (index + 1) );
} else if ( this.tabsControls().find( '[data-m-id]:eq(' + (index - 1) + ')' ).length ) {
vc.frame_window.vc_iframe.setActiveTab( this.$tabs, (index - 1) );
} else {
vc.frame_window.vc_iframe.setActiveTab( this.$tabs, 0 );
}
$tab.remove();
},
clone: function ( e ) {
_.each( vc.shortcodes.where( { parent_id: this.model.get( 'id' ) } ), function ( model ) {
model.set( 'active_before_cloned', this.active_model_id === model.get( 'id' ) );
}, this );
window.InlineShortcodeView_vc_tabs.__super__.clone.call( this, e );
}
} );
})( window.jQuery );
@@ -0,0 +1,19 @@
(function ( $ ) {
window.InlineShortcodeView_vc_tour = window.InlineShortcodeView_vc_tabs.extend( {
render: function () {
_.bindAll( this, 'stopSorting' );
this.$tabs = this.$el.find( '> .wpb_tour' );
window.InlineShortcodeView_vc_tabs.__super__.render.call( this );
this.buildNav();
return this;
},
beforeUpdate: function () {
this.$tabs.find( '.wpb_tour_heading,.wpb_tour_next_prev_nav' ).remove();
vc.frame_window.vc_iframe.destroyTabs( this.$tabs );
},
updated: function () {
this.$tabs.find( '.wpb_tour_next_prev_nav' ).appendTo( this.$tabs );
window.InlineShortcodeView_vc_tour.__super__.updated.call( this );
}
} );
})( window.jQuery );
@@ -0,0 +1,3 @@
(function ( $ ) {
window.InlineShortcodeView_vc_carousel = window.InlineShortcodeView_vc_images_carousel.extend( {} );
})( window.jQuery );
@@ -0,0 +1,30 @@
(function ( $ ) {
window.InlineShortcodeView_vc_basic_grid = vc.shortcode_view.extend( {
render: function ( e ) {
window.InlineShortcodeView_vc_basic_grid.__super__.render.call( this, e );
this.initGridJs( true );
return this;
},
parentChanged: function () {
window.InlineShortcodeView_vc_basic_grid.__super__.parentChanged.call( this );
this.initGridJs();
},
initGridJs: function ( useAddActivity ) {
var model = this.model;
if ( true === model.get( 'grid_activity' ) ) {
return false;
}
model.set( 'grid_activity', true );
if ( true === useAddActivity ) {
vc.frame_window.vc_iframe.addActivity( function () {
this.vc_iframe.gridInit( model.get( 'id' ) );
model.set( 'grid_activity', false );
} );
} else {
vc.frame_window.vc_iframe.gridInit( model.get( 'id' ) );
model.set( 'grid_activity', false );
}
}
} );
})( window.jQuery );
@@ -0,0 +1,3 @@
(function ( $ ) {
window.InlineShortcodeView_vc_masonry_grid = window.InlineShortcodeView_vc_basic_grid.extend();
})( window.jQuery );
@@ -0,0 +1,3 @@
(function ( $ ) {
window.InlineShortcodeView_vc_masonry_media_grid = window.InlineShortcodeView_vc_basic_grid.extend();
})( window.jQuery );
@@ -0,0 +1,3 @@
(function ( $ ) {
window.InlineShortcodeView_vc_media_grid = window.InlineShortcodeView_vc_basic_grid.extend();
})( window.jQuery );
@@ -0,0 +1,16 @@
(function ( $ ) {
window.InlineShortcodeView_vc_gallery = window.InlineShortcodeView.extend( {
render: function () {
var model_id = this.model.get( 'id' );
window.InlineShortcodeView_vc_gallery.__super__.render.call( this );
vc.frame_window.vc_iframe.addActivity( function () {
this.vc_iframe.vc_gallery( model_id );
} );
return this;
},
parentChanged: function () {
window.InlineShortcodeView_vc_gallery.__super__.parentChanged.call( this );
vc.frame_window.vc_iframe.vc_gallery( this.model.get( 'id' ) );
}
} );
})( window.jQuery );
@@ -0,0 +1,12 @@
(function ( $ ) {
window.InlineShortcodeView_vc_images_carousel = window.InlineShortcodeView.extend( {
render: function () {
var model_id = this.model.get( 'id' );
window.InlineShortcodeView_vc_images_carousel.__super__.render.call( this );
vc.frame_window.vc_iframe.addActivity( function () {
this.vc_iframe.vc_imageCarousel( model_id );
} );
return this;
}
} );
})( window.jQuery );
@@ -0,0 +1,25 @@
(function ( $ ) {
window.InlineShortcodeView_vc_single_image = window.InlineShortcodeView.extend( {
render: function () {
var model_id = this.model.get( 'id' );
window.InlineShortcodeView_vc_single_image.__super__.render.call( this );
vc.frame_window.vc_iframe.addActivity( function () {
if ( 'undefined' !== typeof(this.vc_image_zoom) ) {
this.vc_image_zoom( model_id );
}
} );
return this;
},
parentChanged: function () {
var modelId = this.model.get( 'id' );
window.InlineShortcodeView_vc_single_image.__super__.parentChanged.call( this );
if ( 'undefined' !== typeof(vc.frame_window.vc_image_zoom) ) {
_.defer( function () {
vc.frame_window.vc_image_zoom( modelId );
} );
}
return this;
}
} );
})( window.jQuery );
@@ -0,0 +1,36 @@
(function ( $ ) {
function ttaMapChildEvents( model ) {
var childTag = 'vc_tta_section';
vc.events.on(
'shortcodes:' + childTag + ':add:parent:' + model.get( 'id' ),
function ( model ) {
var activeTabIndex, models, parentModel;
parentModel = vc.shortcodes.get( model.get( 'parent_id' ) );
activeTabIndex = parseInt( parentModel.getParam( 'active_section' ) );
if ( 'undefined' === typeof(activeTabIndex) ) {
activeTabIndex = 1;
}
models = _.pluck( _.sortBy( vc.shortcodes.where( { parent_id: parentModel.get( 'id' ) } ),
function ( model ) {
return model.get( 'order' );
} ), 'id' );
if ( models.indexOf( model.get( 'id' ) ) === activeTabIndex - 1 ) {
model.set( 'isActiveSection', true );
}
return model;
}
);
vc.events.on(
'shortcodes:' + childTag + ':clone:parent:' + model.get( 'id' ),
function ( model ) {
vc.ttaSectionActivateOnClone && model.set( 'isActiveSection', true );
vc.ttaSectionActivateOnClone = false;
}
);
}
vc.events.on( 'shortcodes:vc_tta_accordion:add', ttaMapChildEvents );
vc.events.on( 'shortcodes:vc_tta_tabs:add', ttaMapChildEvents );
vc.events.on( 'shortcodes:vc_tta_tour:add', ttaMapChildEvents );
vc.events.on( 'shortcodes:vc_tta_pageable:add', ttaMapChildEvents );
})( window.jQuery );
@@ -0,0 +1,203 @@
(function ( $ ) {
window.InlineShortcodeView_vc_tta_accordion = window.InlineShortcodeViewContainer.extend( {
events: {},
childTag: 'vc_tta_section',
activeClass: 'vc_active',
// controls_selector: '#vc_controls-template-vc_tta_accordion',
defaultSectionTitle: window.i18nLocale.section,
initialize: function () {
_.bindAll( this, 'buildSortable', 'updateSorting' );
window.InlineShortcodeView_vc_tta_accordion.__super__.initialize.call( this );
},
render: function () {
window.InlineShortcodeViewContainer.__super__.render.call( this );
this.content(); // just to remove span inline-container anchor..
this.buildPagination();
return this;
},
addControls: function () {
this.$controls = $( '<div class="no-controls"></div>' );
this.$controls.appendTo( this.$el );
return this;
},
/**
* Add new element to Accordion.
* @param e
*/
addElement: function ( e ) {
e && e.preventDefault();
this.addSection( 'parent.prepend' === $( e.currentTarget ).data( 'vcControl' ) );
},
appendElement: function ( e ) {
return this.addElement( e );
},
prependElement: function ( e ) {
return this.addElement( e );
},
addSection: function ( prepend ) {
var shortcode, params, i;
shortcode = this.childTag;
params = {
shortcode: shortcode,
parent_id: this.model.get( 'id' ),
isActiveSection: true,
params: {
title: this.defaultSectionTitle
}
};
if ( prepend ) {
vc.activity = 'prepend';
params.order = this.getSiblingsFirstPositionIndex();
}
vc.builder.create( params );
// extend default params with settings presets if there are any
for ( i = vc.builder.models.length - 1;
i >= 0;
i -- ) {
shortcode = vc.builder.models[ i ].get( 'shortcode' );
}
vc.builder.render();
},
getSiblingsFirstPositionIndex: function () {
var order,
shortcodeFirst;
order = 0;
shortcodeFirst = vc.shortcodes.sort().findWhere( { parent_id: this.model.get( 'id' ) } );
if ( shortcodeFirst ) {
order = shortcodeFirst.get( 'order' ) - 1;
}
return order;
},
changed: function () {
vc.frame_window.vc_iframe.buildTTA();
window.InlineShortcodeView_vc_tta_accordion.__super__.changed.call( this );
_.defer( this.buildSortable );
this.buildPagination();
},
updated: function () {
window.InlineShortcodeView_vc_tta_accordion.__super__.updated.call( this );
_.defer( this.buildSortable );
this.buildPagination();
},
buildSortable: function () {
if ( ! vc_user_access().shortcodeEdit( this.model.get( 'shortcode' ) ) ) {
return
}
if ( this.$el ) {
this.$el.find( '.vc_tta-panels' ).sortable( {
forcePlaceholderSize: true,
placeholder: 'vc_placeholder-row', // TODO: fix placeholder
start: this.startSorting,
over: function ( event, ui ) {
ui.placeholder.css( { maxWidth: ui.placeholder.parent().width() } );
ui.placeholder.removeClass( 'vc_hidden-placeholder' );
},
items: '> .vc_element',
handle: '.vc_tta-panel-heading, .vc_child-element-move',// TODO: change vc_column to vc_tta_section
update: this.updateSorting
} );
}
},
startSorting: function ( event, ui ) {
ui.placeholder.width( ui.item.width() );
},
updateSorting: function ( event, ui ) {
var self = this;
this.getPanelsList().find( '> .vc_element' ).each( function () {
var shortcode, modelId, $this;
$this = $( this );
modelId = $this.data( 'modelId' );
shortcode = vc.shortcodes.get( modelId );
shortcode.save( { 'order': self.getIndex( $this ) }, { silent: true } );
} );
// re-render pagination
this.buildPagination();
},
getIndex: function ( $element ) {
return $element.index();
},
getPanelsList: function () {
return this.$el.find( '.vc_tta-panels' );
},
parentChanged: function () {
window.InlineShortcodeView_vc_tta_accordion.__super__.parentChanged.call( this );
if ( 'undefined' !== typeof(vc.frame_window.vc_round_charts) ) {
vc.frame_window.vc_round_charts( this.model.get( 'id' ) );
}
if ( 'undefined' !== typeof(vc.frame_window.vc_line_charts) ) {
vc.frame_window.vc_line_charts( this.model.get( 'id' ) );
}
},
buildPagination: function () {
},
removePagination: function () {
this.$el.find( '.vc_tta-panels-container' ).find( ' > .vc_pagination' ).remove(); // TODO: check this
},
getPaginationList: function () {
var $accordions,
classes,
styleChunks,
that,
html,
params;
params = this.model.get( 'params' );
if ( ! _.isUndefined( params.pagination_style ) && params.pagination_style.length ) {
$accordions = this.$el.find( '[data-vc-accordion]' );
classes = [];
classes.push( 'vc_general' );
classes.push( 'vc_pagination' );
styleChunks = params.pagination_style.split( '-' );
classes.push( 'vc_pagination-style-' + styleChunks[ 0 ] );
classes.push( 'vc_pagination-shape-' + styleChunks[ 1 ] );
if ( ! _.isUndefined( params.pagination_color ) && params.pagination_color.length ) {
classes.push( 'vc_pagination-color-' + params.pagination_color );
}
html = [];
html.push( '<ul class="' + classes.join( ' ' ) + '">' );
that = this;
$accordions.each( function () {
var sectionClasses,
activeSection,
$this,
$closestPanel,
selector,
aHtml;
$this = $( this );
$closestPanel = $this.closest( '.vc_tta-panel' );
activeSection = $closestPanel.hasClass( that.activeClass );
sectionClasses = [ 'vc_pagination-item' ];
if ( activeSection ) {
sectionClasses.push( that.activeClass );
}
selector = $this.attr( 'href' );
if ( 0 !== selector.indexOf( '#' ) ) {
selector = '';
}
if ( $this.attr( 'data-vc-target' ) ) {
selector = $this.attr( 'data-vc-target' );
}
aHtml = '<a href="javascript:;" data-vc-target="' + selector + '" class="vc_pagination-trigger" data-vc-tabs data-vc-container=".vc_tta"></a>';
html.push( '<li class="' + sectionClasses.join( ' ' ) + '" data-vc-tab>' + aHtml + '</li>' );
} );
html.push( '</ul>' );
return $( html.join( '' ) );
}
return null;
}
} );
})( window.jQuery );
@@ -0,0 +1,3 @@
(function ( $ ) {
window.InlineShortcodeView_vc_tta_pageable = window.InlineShortcodeView_vc_tta_tour.extend( {} );
})( window.jQuery );
@@ -0,0 +1,138 @@
(function ( $ ) {
vc.ttaSectionActivateOnClone = false;
window.InlineShortcodeView_vc_tta_section = window.InlineShortcodeViewContainerWithParent.extend( {
events: {
'click > .vc_controls [data-vc-control="destroy"]': 'destroy',
'click > .vc_controls [data-vc-control="edit"]': 'edit',
'click > .vc_controls [data-vc-control="clone"]': 'clone',
'click > .vc_controls [data-vc-control="prepend"]': 'prependElement',
'click > .vc_controls [data-vc-control="append"]': 'appendElement',
'click > .vc_controls [data-vc-control="parent.destroy"]': 'destroyParent',
'click > .vc_controls [data-vc-control="parent.edit"]': 'editParent',
'click > .vc_controls [data-vc-control="parent.clone"]': 'cloneParent',
'click > .vc_controls [data-vc-control="parent.append"]': 'addSibling',
'click .vc_tta-panel-body > [data-js-panel-body].vc_empty-element': 'appendElement',
'click > .vc_controls .vc_control-btn-switcher': 'switchControls',
'mouseenter': 'resetActive',
'mouseleave': 'holdActive'
},
controls_selector: '#vc_controls-template-vc_tta_section',
previousClasses: false,
activeClass: 'vc_active',
render: function () {
var model = this.model;
window.InlineShortcodeView_vc_tta_section.__super__.render.call( this );
_.bindAll( this, 'bindAccordionEvents' );
this.refreshContent();
this.moveClasses();
_.defer( this.bindAccordionEvents );
if ( this.isAsActiveSection() ) {
window.vc.frame_window.vc_iframe.addActivity( function () {
var $accordion = window.vc.frame_window.jQuery(
'[data-vc-accordion][data-vc-target="[data-model-id=' + model.get( 'id' ) + ']"]' );
$accordion.trigger( 'click' );
} );
}
return this;
},
allowAddControl: function () {
return vc_user_access().shortcodeAll( 'vc_tta_section' );
},
clone: function ( e ) {
vc.ttaSectionActivateOnClone = true;
window.InlineShortcodeView_vc_tta_section.__super__.clone.call( this, e );
},
addSibling: function ( e ) {
window.InlineShortcodeView_vc_tta_section.__super__.addSibling.call( this, e );
},
parentChanged: function () {
window.InlineShortcodeView_vc_tta_section.__super__.parentChanged.call( this );
this.refreshContent( true );
return this;
},
changed: function () {
if ( this.allowAddControlOnEmpty() && 0 === this.$el.find( '.vc_element[data-tag]' ).length ) {
this.$el.addClass( 'vc_empty' ).find( '.vc_tta-panel-body > [data-js-panel-body]' ).addClass(
'vc_empty-element' );
} else {
this.$el.removeClass( 'vc_empty' ).find( '.vc_tta-panel-body > [data-js-panel-body].vc_empty-element' ).removeClass(
'vc_empty-element' );
}
},
moveClasses: function () {
var panelClassName;
if ( this.previousClasses ) {
this.$el.get( 0 ).className = this.$el.get( 0 ).className.replace( this.previousClasses, "" );
}
panelClassName = this.$el.find( '.vc_tta-panel' ).get( 0 ).className;
this.$el.attr( 'data-vc-content', this.$el.find( '.vc_tta-panel' ).data( 'vcContent' ) );
this.previousClasses = panelClassName;
this.$el.find( '.vc_tta-panel' ).get( 0 ).className = "";
this.$el.get( 0 ).className = this.$el.get( 0 ).className + " " + this.previousClasses;
// Fix data-vc-target for accordions:
this.$el.find( '.vc_tta-panel-title [data-vc-target]' ).attr( 'data-vc-target',
'[data-model-id=' + this.model.get( 'id' ) + ']' );
},
refreshContent: function ( noSectionUpdate ) {
var $controlsIcon, $controlsIconsPositionEl, parentModel, parentParams, paramsMap, parentLayout;
parentModel = vc.shortcodes.get( this.model.get( 'parent_id' ) );
if ( _.isObject( parentModel ) ) {
paramsMap = vc.getDefaultsAndDependencyMap( parentModel.get( 'shortcode' ) );
parentParams = _.extend( {}, paramsMap.defaults, parentModel.get( 'params' ) );
$controlsIcon = this.$el.find( '.vc_tta-controls-icon' );
if ( parentParams && ! _.isUndefined( parentParams.c_icon ) && 0 < parentParams.c_icon.length ) {
if ( $controlsIcon.length ) {
$controlsIcon.attr( 'data-vc-tta-controls-icon', parentParams.c_icon );
} else {
this.$el.find( '[data-vc-tta-controls-icon-wrapper]' ).append(
$( '<i class="vc_tta-controls-icon" data-vc-tta-controls-icon="' + parentParams.c_icon + '"></i>' )
);
}
if ( ! _.isUndefined( parentParams.c_position ) && 0 < parentParams.c_position.length ) {
$controlsIconsPositionEl = this.$el.find( '[data-vc-tta-controls-icon-position]' );
if ( $controlsIconsPositionEl.length ) {
$controlsIconsPositionEl.attr( 'data-vc-tta-controls-icon-position',
parentParams.c_position );
}
}
} else {
$controlsIcon.remove();
this.$el.find( '[data-vc-tta-controls-icon-position]' ).attr( 'data-vc-tta-controls-icon-position',
'' );
}
if ( true !== noSectionUpdate && parentModel.view && parentModel.view.sectionUpdated ) {
parentModel.view.sectionUpdated( this.model );
}
}
},
setAsActiveSection: function ( isActive ) {
this.model.set( 'isActiveSection', ! ! isActive );
},
isAsActiveSection: function () {
return ! ! this.model.get( 'isActiveSection' );
},
bindAccordionEvents: function () {
var that = this;
window.vc.frame_window.jQuery( '[data-vc-target="[data-model-id=' + this.model.get( 'id' ) + ']"]' )
.on( 'show.vc.accordion hide.vc.accordion',
function ( e ) {
that.setAsActiveSection( 'show' === e.type );
} );
},
destroy: function ( e ) {
var parentModel, parentId;
parentId = this.model.get( 'parent_id' );
window.InlineShortcodeView_vc_tta_section.__super__.destroy.call( this, e );
parentModel = vc.shortcodes.get( parentId );
if ( ! vc.shortcodes.where( { parent_id: parentId } ).length ) {
parentModel.destroy();
} else {
parentModel.view && parentModel.view.removeSection && parentModel.view.removeSection( this.model.get(
'id' ) );
}
}
} );
})( window.jQuery );
@@ -0,0 +1,199 @@
(function ( $ ) {
window.InlineShortcodeView_vc_tta_tabs = window.InlineShortcodeView_vc_tta_accordion.extend( {
render: function () {
window.InlineShortcodeView_vc_tta_tabs.__super__.render.call( this );
_.bindAll( this, 'buildSortableNavigation', 'updateSortingNavigation' );
this.createTabs();
_.defer( this.buildSortableNavigation );
return this;
},
createTabs: function () {
var models = _.sortBy( vc.shortcodes.where( { parent_id: this.model.get( 'id' ) } ),
function ( model ) {
return model.get( 'order' );
} );
_.each( models, function ( model ) {
this.sectionUpdated( model, true );
}, this );
},
defaultSectionTitle: window.i18nLocale.tab,
addIcon: function ( model, html ) {
var icon, iconClass, iconHtml;
if ( 'true' === model.getParam( 'add_icon' ) ) {
icon = model.getParam( 'i_icon_' + model.getParam( 'i_type' ) );
if ( ! _.isUndefined( icon ) ) {
iconClass = 'vc_tta-icon' + ' ' + icon;
iconHtml = '<i class="' + iconClass + '"></i>';
}
if ( 'right' === model.getParam( 'i_position' ) ) {
html += iconHtml;
} else {
html = iconHtml + html;
}
}
return html;
},
/**
*
* @param {Backbone.Model}model
*/
sectionUpdated: function ( model, justAppend ) {
// update builded tabs, remove/add check orders and title/target
var $tabEl,
$navigation,
sectionId,
html, title, models, index, tabAdded;
tabAdded = false;
sectionId = model.get( 'id' );
$navigation = this.$el.find( '.vc_tta-tabs-container .vc_tta-tabs-list' );
$tabEl = $navigation.find( '[data-vc-target="[data-model-id=' + sectionId + ']"]' );
title = model.getParam( 'title' );
if ( $tabEl.length ) {
html = '<span class="vc_tta-title-text">' + title + '</span>';
html = this.addIcon( model, html );
$tabEl.html( html );
} else {
var $element;
html = '<span class="vc_tta-title-text">' + title + '</span>';
html = this.addIcon( model, html );
$element = $( '<li class="vc_tta-tab" data-vc-target-model-id="' + sectionId + '" data-vc-tab><a href="javascript:;" data-vc-use-cache="false" data-vc-tabs data-vc-target="[data-model-id=' + sectionId + ']" data-vc-container=".vc_tta">' + html + '</a></li>' );
if ( true !== justAppend ) {
models = _.pluck( _.sortBy( vc.shortcodes.where( { parent_id: this.model.get( 'id' ) } ),
function ( childModel ) {
return childModel.get( 'order' );
} ), 'id' );
index = models.indexOf( model.get( 'id' ) ) - 1;
if ( index > - 1 && $navigation.find( '[data-vc-tab]:eq(' + index + ')' ).length ) {
$element.insertAfter( $navigation.find( '[data-vc-tab]:eq(' + index + ')' ) );
tabAdded = true;
}
}
! tabAdded && $element.appendTo( $navigation );
if ( model.get( 'isActiveSection' ) ) {
$element.addClass( this.activeClass );
}
}
this.buildPagination();
},
getNextTab: function ( $viewTab ) {
var lastIndex, viewTabIndex, $nextTab, $navigationSections;
$navigationSections = this.$el.find( '.vc_tta-tabs-container .vc_tta-tabs-list' ).children();
lastIndex = $navigationSections.length - 1; // -1 because length starts from 1
viewTabIndex = $viewTab.index();
if ( viewTabIndex !== lastIndex ) {
$nextTab = $navigationSections.eq( viewTabIndex + 1 );
} else {
// If we are the last tab in in navigation lets make active previous
$nextTab = $navigationSections.eq( viewTabIndex - 1 );
}
return $nextTab;
},
removeSection: function ( modelId ) {
var $viewTab, $nextTab, tabIsActive;
$viewTab = this.$el.find( '.vc_tta-tabs-container .vc_tta-tabs-list [data-vc-target="[data-model-id=' + modelId + ']"]' ).parent();
tabIsActive = $viewTab.hasClass( this.activeClass );
// Make next tab active if needed
if ( tabIsActive ) {
$nextTab = this.getNextTab( $viewTab );
vc.frame_window.jQuery( $nextTab ).find( '[data-vc-target]' ).trigger( 'click' );
}
// Remove tab from navigation
$viewTab.remove();
this.buildPagination();
},
buildSortableNavigation: function () {
if ( ! vc_user_access().shortcodeEdit( this.model.get( 'shortcode' ) ) ) {
return
}
// this should be called when new tab added/removed/changed.
this.$el.find( '.vc_tta-tabs-container .vc_tta-tabs-list' ).sortable( {
items: '.vc_tta-tab',
forcePlaceholderSize: true,
placeholder: 'vc_tta-tab vc_placeholder-tta-tab',
helper: this.renderSortingHelper,
start: function ( event, ui ) {
ui.placeholder.width( ui.item.width() );
},
over: function ( event, ui ) {
ui.placeholder.css( { maxWidth: ui.placeholder.parent().width() } );
ui.placeholder.removeClass( 'vc_hidden-placeholder' );
},
update: this.updateSortingNavigation
} );
},
updateSorting: function ( event, ui ) {
window.InlineShortcodeView_vc_tta_tabs.__super__.updateSorting.call( this, event, ui );
this.updateTabsPositions( this.getPanelsList() );
},
updateSortingNavigation: function () {
var $tabs, self;
self = this;
$tabs = this.$el.find( '.vc_tta-tabs-list' );
// we are sorting a tabs navigation
$tabs.find( '> .vc_tta-tab' ).each( function () {
var shortcode, modelId, $li;
$li = $( this ).removeAttr( 'style' ); // TODO: Attensiton maybe e need to create method with filter
modelId = $li.data( 'vcTargetModelId' );
shortcode = vc.shortcodes.get( modelId );
shortcode.save( { 'order': self.getIndex( $li ) }, { silent: true } );
// now we need to sort panels
} );
this.updatePanelsPositions( $tabs );
},
updateTabsPositions: function ( $panels ) {
var $tabs, $elements, tabSortableData;
$tabs = this.$el.find( '.vc_tta-tabs-list' );
if ( $tabs.length ) {
$elements = [];
tabSortableData = $panels.sortable( 'toArray', { attribute: 'data-model-id' } );
_.each( tabSortableData, function ( value ) {
$elements.push( $tabs.find( '[data-vc-target-model-id="' + value + '"]' ) );
}, this );
$tabs.prepend( $elements );
}
this.buildPagination();
},
updatePanelsPositions: function ( $tabs ) {
var $elements, tabSortableData, $panels;
$panels = this.getPanelsList();
$elements = [];
tabSortableData = $tabs.sortable( 'toArray', { attribute: 'data-vc-target-model-id' } );
_.each( tabSortableData, function ( value ) {
$elements.push( $panels.find( '[data-model-id="' + value + '"]' ) );
}, this );
$panels.prepend( $elements );
this.buildPagination();
},
renderSortingHelper: function ( event, currentItem ) {
var helper, currentItemWidth, currentItemHeight;
helper = currentItem;
currentItemWidth = currentItem.width() + 1;
currentItemHeight = currentItem.height();
helper.width( currentItemWidth );
helper.height( currentItemHeight );
return helper;
},
buildPagination: function () {
var params;
this.removePagination();
// If tap-pos top append:
params = this.model.get( 'params' );
if ( ! _.isUndefined( params.pagination_style ) && params.pagination_style.length ) {
if ( 'top' === params.tab_position ) {
this.$el.find( '.vc_tta-panels-container' ).append( this.getPaginationList() );
} else {
this.getPaginationList().insertBefore( this.$el.find( '.vc_tta-container .vc_tta-panels' ) ); // TODO: change this
}
}
}
} );
})( window.jQuery );
@@ -0,0 +1,12 @@
(function ( $ ) {
window.InlineShortcodeView_vc_tta_tour = window.InlineShortcodeView_vc_tta_tabs.extend( {
defaultSectionTitle: window.i18nLocale.section,
buildPagination: function () {
this.removePagination();
var params = this.model.get( 'params' );
if ( ! _.isUndefined( params.pagination_style ) && params.pagination_style.length ) {
this.$el.find( '.vc_tta-panels-container' ).append( this.getPaginationList() ); // TODO: change this
}
}
} );
})( window.jQuery );
@@ -0,0 +1,26 @@
(function ( $ ) {
var minHeight = '340px';
function vc_jwplayer_resize( target ) {
jwplayer( target ).onReady( function () {
$( this.container ).css( 'min-height', minHeight );
} );
$( jwplayer( target ).container ).css( 'min-height', minHeight );
}
$( document ).on( 'ready', function () {
$( "div" ).filter( function () {
return this.id.match( /^jwplayer\-\d+$/ );
} ).each( function () {
vc_jwplayer_resize( this )
} );
} );
$( window ).on( 'vc_reload', function () {
$( "div" ).filter( function () {
return this.id.match( /^jwplayer\-\d+$/ );
} ).each( function () {
vc_jwplayer_resize( this )
} );
} );
})( jQuery );
@@ -0,0 +1,10 @@
jQuery( document ).on( 'acf/setup_fields', function ( e, el ) {
// Redeclare active editor.
setTimeout( function () {
if ( 'tinymce' === getUserSetting( 'editor' ) ) {
jQuery( '#content-tmce' ).trigger( 'click' );
} else {
jQuery( '#content-html' ).trigger( 'click' );
}
}, 10 );
} );
@@ -0,0 +1,60 @@
(function ( $ ) {
$( '#content-html' ).on( 'click', function () {
window.setTimeout( function () {
window.wpActiveEditor = 'qtrans_textarea_content';
}, 10 );
} );
$( window ).ready( function () {
var activeLang = qtrans_get_active_language(),
$langs = $( '#vc_vendor_qtranslate_langs' );
$( 'option', $langs ).each( function () {
var $el = $( this );
if ( $el.val() == activeLang ) {
$el.prop( 'selected', true );
}
$( '#qtrans_select_' + $el.val() ).on( 'click', function () {
$el.prop( 'selected', true );
} );
} );
$langs.on( 'change', function () {
$( '#qtrans_select_' + $( this ).val() ).trigger( 'click' );
var link = $( ":selected", this ).attr( 'link' );
$( '.wpb_switch-to-front-composer' ).each( function () {
$( this ).attr( 'href', link );
} );
$( '#wpb-edit-inline' ).attr( 'href', link );
vc.shortcodes.fetch( { reset: true } );
} );
$langs.show();
if ( ! window.vc ) {
window.vc = {};
}
vc.QtransResetContent = function () {
$( '#content-html' ).trigger( 'click' );
$( '#qtrans_textarea_content' ).css( 'minHeight', '300px' );
window.wpActiveEditor = 'qtrans_textarea_content';
};
vc.Storage.prototype.getContent = function () {
var content;
vc.QtransResetContent();
content = $( '#qtrans_textarea_content' ).val();
if ( vc.gridItemEditor && ! content.length ) {
content = vcDefaultGridItemContent;
}
return content;
};
vc.Storage.prototype.setContent = function ( content ) {
$( '#content-html' ).trigger( 'click' );
$( '#qtrans_textarea_content' ).val( content );
vc.QtransResetContent();
};
} );
})( window.jQuery );
@@ -0,0 +1,23 @@
(function ( $ ) {
$( '#vc_vendor_qtranslate_langs_front' ).change( function () {
vc.closeActivePanel();
$( '#vc_logo' ).addClass( 'vc_ui-wp-spinner' );
window.location.href = $( this ).val();
} );
vc.ShortcodesBuilder.prototype.getContent = function () {
var output,
$postContent = $( '#vc_vendor_qtranslate_postcontent' ),
lang = $postContent.attr( 'data-lang' ),
content = $postContent.val();
vc.shortcodes.sort();
output = this.modelsToString( vc.shortcodes.where( { parent_id: false } ) );
return qtrans_integrate( lang, output, content );
};
vc.ShortcodesBuilder.prototype.getTitle = function () {
var $titleContent = $( '#vc_vendor_qtranslate_posttitle' ),
lang = $titleContent.attr( 'data-lang' ),
content = $titleContent.val();
return qtrans_integrate( lang, vc.title, content );
};
})( window.jQuery );
@@ -0,0 +1,17 @@
(function ( $ ) {
$( function () {
var Manager = qTranslateConfig.js.get_qtx();
Manager.addLanguageSwitchListener( hookLanguageSwitch );
} );
function hookLanguageSwitch( activeLang ) {
var $inlineHref = $( '.wpb_switch-to-front-composer' );
if ( ! $inlineHref.data( 'raw-url' ) ) {
$inlineHref.data( 'raw-url', $inlineHref.attr( 'href' ) );
}
var newUrl = $inlineHref.data( 'raw-url' ) + '&lang=' + activeLang;
$inlineHref.attr( 'href', newUrl );
vc.shortcodes.fetch( { reset: true } );
}
})( window.jQuery );
@@ -0,0 +1,15 @@
(function ( $ ) {
$( '#vc_vendor_qtranslatex_langs_front' ).change( function () {
vc.closeActivePanel();
$( '#vc_logo' ).addClass( 'vc_ui-wp-spinner' );
window.location.href = $( this ).val();
} );
var nativeGetContent = vc.ShortcodesBuilder.prototype.getContent;
vc.ShortcodesBuilder.prototype.getContent = function () {
var content = nativeGetContent();
jQuery( '#content' ).val( content );
return content;
};
})( window.jQuery );
@@ -0,0 +1,18 @@
window.jQuery( document ).ready( function ( $ ) {
$( 'body' ).on( 'adding_to_cart', function ( event, $button, data ) {
$button && $button.hasClass( 'vc_gitem-link' ) && $button
.addClass( 'vc-gitem-add-to-cart-loading-btn' )
.parents( '.vc_grid-item-mini' )
.addClass( 'vc-woocommerce-add-to-cart-loading' )
.append( $( '<div class="vc_wc-load-add-to-loader-wrapper"><div class="vc_wc-load-add-to-loader"></div></div>' ) );
} ).on( 'added_to_cart', function ( event, fragments, cart_hash, $button ) {
if ( 'undefined' === typeof($button) ) {
$button = $( '.vc-gitem-add-to-cart-loading-btn' );
}
$button && $button.hasClass( 'vc_gitem-link' ) && $button
.removeClass( 'vc-gitem-add-to-cart-loading-btn' )
.parents( '.vc_grid-item-mini' )
.removeClass( 'vc-woocommerce-add-to-cart-loading' )
.find( '.vc_wc-load-add-to-loader-wrapper' ).remove();
} );
} );
@@ -0,0 +1,41 @@
if ( ! window.ajaxurl ) {
window.ajaxurl = window.location.href;
}
var vcWoocommerceProductAttributeFilterDependencyCallback;
vcWoocommerceProductAttributeFilterDependencyCallback = function () {
(function ( $, that ) {
var $filterDropdown, $empty;
$filterDropdown = $( '[data-vc-shortcode-param-name="filter"]', that.$content );
$filterDropdown.removeClass( 'vc_dependent-hidden' );
$empty = $( '#filter-empty', $filterDropdown );
if ( $empty.length ) {
$empty.parent().remove();
$( '.edit_form_line',
$filterDropdown ).prepend( $( '<div class="vc_checkbox-label"><span>No values found</span></div>' ) );
}
$( 'select[name="attribute"]', that.$content ).change( function () {
$( '.vc_checkbox-label', $filterDropdown ).remove();
$filterDropdown.removeClass( 'vc_dependent-hidden' );
$.ajax( {
type: 'POST',
dataType: 'json',
url: window.ajaxurl,
data: {
action: 'vc_woocommerce_get_attribute_terms',
attribute: this.value,
_vcnonce: window.vcAdminNonce
}
} ).done( function ( data ) {
if ( 0 < data.length ) {
$( '.edit_form_line', $filterDropdown ).prepend( $( data ) );
} else {
$( '.edit_form_line',
$filterDropdown ).prepend( $( '<div class="vc_checkbox-label"><span>No values found</span></div>' ) );
}
} );
} );
}( window.jQuery, this ));
};
@@ -0,0 +1,93 @@
/* global vc, YoastSEO, _, jQuery */
jQuery( window ).on( 'YoastSEO:ready', function () {
'use strict';
var imageEventString, vcYoast, relevantData = {}, pluginName = 'vcVendorYoast', eventsList = [
'sync',
'add',
'update'
];
var contentModification = function ( data ) {
data = _.reduce( relevantData, function ( memo, value, key ) {
if ( value.html ) {
memo = memo.replace( '"' + value.text + '"', value.html );
}
if ( value.image && value.param ) {
var i, imagesString = '', attachment;
for ( i = 0;
value.image.length > i;
i ++ ) {
attachment = window.wp.media.model.Attachment.get( value.image[ i ] );
if ( attachment.get( 'url' ) ) {
imagesString += '<img src=\'' + attachment.get( 'url' ) + '\' alt=\'' +
( attachment.get( 'alt' ) || attachment.get( 'caption' ) || attachment.get( 'title' ) ) + '\'>';
}
}
memo += imagesString;
}
return memo;
}, data );
return data;
};
function getImageEventString( e ) {
return ' shortcodes:' + e + ':param:type:attach_image' +
' shortcodes:' + e + ':param:type:attach_images';
}
// add relevant data for images
imageEventString = _.reduce( eventsList, function ( memo, e ) {
return memo + getImageEventString( e );
}, '' );
vc.events.on( imageEventString, function ( model, param, settings ) {
if ( param && param.length > 0 ) {
var ids = param.split( /\s*,\s*/ );
_.each( ids, function ( id ) {
var attachment = window.wp.media.model.Attachment.get( id );
if ( ! attachment.get( 'url' ) ) {
attachment.once( 'sync', function () {
YoastSEO.app.pluginReloaded( pluginName );
} );
attachment.fetch();
}
} );
relevantData[ model.get( 'id' ) + settings.param_name ] = {
image: ids,
paramName: settings.param_name,
param: param
};
}
} );
vc.events.on( getImageEventString( 'destroy' ), function ( model, param, settings ) {
delete relevantData[ model.get( 'id' ) + settings.param_name ];
} );
// Add relevant data to headings
vc.events.on( 'shortcodes:vc_custom_heading', function ( model, event ) {
var params, tagSearch;
params = model.get( 'params' )
params = _.extend( {}, vc.getDefaults( model.get( 'shortcode' ) ), params );
if ( 'destroy' === event ) {
delete relevantData[ model.get( 'id' ) ];
}
else if ( params.text && params.font_container ) {
tagSearch = params.font_container.match( /tag:([^\|]+)/ );
if ( tagSearch[ 1 ] ) {
relevantData[ model.get( 'id' ) ] = {
html: '<' + tagSearch[ 1 ] + '>' +
params.text + '</' + tagSearch[ 1 ] + '>',
text: params.text
};
}
}
} );
var VcVendorYoast = function () {
// init
YoastSEO.app.registerPlugin( pluginName, { status: 'ready' } );
YoastSEO.app.pluginReady( pluginName );
YoastSEO.app.registerModification( 'content', contentModification, pluginName, 5 );
};
vcYoast = new VcVendorYoast();
} );