Best JavaScript code snippet using cypress
builder-elements.js
Source:builder-elements.js
1jQuery(document).ready(function(jQuery) {2 var elementOptions = jQuery("#builder-elements>div.builder-element"),3 elementType = jQuery("#ts-element-type");4 // Elements Editor -> Change Element Type5 jQuery(document).on("change", "#ts-element-type", function(event) {6 var selected = jQuery(this).val();7 makeSelected(elementOptions, selected);8 });9 // Lists Portfolios -> How to display10 jQuery(document).on("change", "#list-portfolios-display-mode", function(event) {11 var selected = 'list-portfolios-' + jQuery(this).val();12 makeSelected(jQuery('#list-portfolios-display-mode-options>div'), selected);13 });14 // Lists Posts -> How to display15 jQuery(document).on("change", "#last-posts-display-mode", function(event) {16 var selected = 'last-posts-' + jQuery(this).val();17 makeSelected(jQuery('#last-posts-display-mode-options>div'), selected);18 });19 jQuery(document).on("change", "#list-galleries-display-mode", function(event) {20 var selected = 'list-galleries-' + jQuery(this).val();21 makeSelected(jQuery('#list-galleries-display-mode-options>div'), selected);22 });23 jQuery(document).on("change", "#latest-custom-posts-display-mode", function(event) {24 var selected = 'latest-custom-posts-' + jQuery(this).val();25 makeSelected(jQuery('#latest-custom-posts-display-mode-options>div'), selected);26 });27 // List Videos -> How to display28 jQuery(document).on("change", "#list-videos-display-mode", function(event) {29 var selected = 'list-videos-' + jQuery(this).val();30 makeSelected(jQuery('#list-videos-display-mode-options>div'), selected);31 });32 /**33 * Retrive data from builder element34 */35 jQuery(document).on('click', 'input#builder-save', function(event) {36 event.preventDefault();37 setTimeout(function(){38 jQuery('#ts-builder-elements-modal').css('opacity',1);39 }, 500);40 41 var elementType, elements, dataAttr, gridMode, listMode, thumbnailsMode, galleryMode, superPostMode, timelineMode;42 elementType = jQuery('#builder-elements').attr('data-element-type');43 elementName = jQuery('#builder-elements .element-title').text();44 if (elementType === 'logo') {45 46 dataAttr = {};47 dataAttr['element-type'] = 'logo';48 elements = jQuery("#builder-elements> .logo");49 dataAttr['logo-align'] = elements.find("#logo-align").val();50 } else if (elementType === 'featured-article') {51 52 dataAttr = {};53 elements = jQuery("#builder-elements>.featured-article");54 dataAttr['element-type'] = 'featured-article';55 dataAttr['post-id'] = elements.find('input[name=postID]:checked').val();56 dataAttr['post-title'] = elements.find('label[for="' + elements.find('input[name=postID]:checked').attr('id') + '"]').text();57 dataAttr['showImage'] = elements.find('#featured-article-showImage').val();58 dataAttr['showMeta'] = elements.find('#featured-article-showMeta').val();59 } else if (elementType === 'user') {60 61 dataAttr = {};62 elements = jQuery("#builder-elements>.user");63 dataAttr['element-type'] = 'user';64 dataAttr['align'] = elements.find("#user-align").val();65 } else if (elementType === 'cart') {66 dataAttr = {};67 dataAttr['element-type'] = 'cart';68 elements = jQuery("#builder-elements>.cart");69 dataAttr['cart-align'] = elements.find("#cart-align").val();70 } else if (elementType === 'breadcrumbs') {71 72 dataAttr = {};73 dataAttr['element-type'] = 'breadcrumbs';74 elements = jQuery("#builder-elements>.breadcrumbs");75 } else if (elementType === 'social-buttons') {76 dataAttr = {};77 dataAttr['element-type'] = 'social-buttons';78 elements = jQuery("#builder-elements>.social-buttons");79 items_array = '[';80 81 jQuery('#social_items > li').each(function(){82 if ( jQuery(this).index() + 1 < jQuery('#social_items > li').length ) { var comma = ','}else{var comma = ''};83 item_image = jQuery(this).find('[data-role="media-url"]').val().replace(/"/g, '--quote--');84 item_id = jQuery(this).find('[data-builder-name="item_id"]').val();85 item_url = jQuery(this).find('[data-builder-name="url"]').val().replace(/"/g, '--quote--');86 item_color = jQuery(this).find('[data-builder-name="color"]').val().replace(/"/g, '--quote--');87 items_array = items_array + '{"id":' + '"' + item_id + '"' + ',"image":' + '"' + item_image + '"' + ',"color":' + '"' + item_color + '"' + ',"url":' + '"' + item_url + '"' + '}' + comma;88 89 });90 items_array = items_array + ']';91 jQuery('#social_content').val(items_array);92 dataAttr['social-settings'] = elements.find('#social_content').val();93 dataAttr['admin-label'] = elements.find('#social-buttons-admin-label').val();94 dataAttr['social-align'] = elements.find('#social-align').val();95 dataAttr['social-style'] = elements.find('#social-style').val();96 if( elements.find('#social-buttons-admin-label').val().length > 0 ){97 elementName = elements.find('#social-buttons-admin-label').val(); 98 }99 100 } else if (elementType === 'searchbox') {101 102 elements = jQuery("#builder-elements>.searchbox");103 dataAttr = {};104 dataAttr['element-type'] = 'searchbox';105 dataAttr['align'] = elements.find("#searchbox-align").val();106 dataAttr['design'] = elements.find("#searchbox-design").val();107 } else if (elementType === 'menu') {108 elements = jQuery("#builder-elements>.menu");109 dataAttr = {};110 dataAttr['element-type'] = 'menu';111 dataAttr['element-style'] = elements.find("#menu-styles option:selected").val();112 dataAttr['menu-custom'] = elements.find("#menu-custom").val();113 dataAttr['menu-bg-color'] = elements.find("#menu-element-bg-color").val();114 dataAttr['menu-text-color'] = elements.find("#menu-element-text-color").val();115 dataAttr['menu-bg-color-hover'] = elements.find("#menu-element-bg-color-hover").val();116 dataAttr['menu-text-color-hover'] = elements.find("#menu-element-text-color-hover").val();117 dataAttr['submenu-bg-color'] = elements.find("#menu-element-submenu-bg-color").val();118 dataAttr['submenu-text-color'] = elements.find("#menu-element-submenu-text-color").val();119 dataAttr['submenu-bg-color-hover'] = elements.find("#menu-element-submenu-bg-color-hover").val();120 dataAttr['submenu-text-color-hover'] = elements.find("#menu-element-submenu-text-color-hover").val();121 dataAttr['menu-text-align'] = elements.find("#menu-text-align").val();122 dataAttr['admin-label'] = elements.find("#menu-admin-label").val();123 dataAttr['uppercase'] = elements.find("#menu-uppercase").val();124 dataAttr['name'] = elements.find("#menu-name").val();125 dataAttr['icons'] = elements.find("#menu-icons").val();126 dataAttr['description'] = elements.find("#menu-description").val();127 dataAttr['font-type'] = elements.find("#menu-font-type").val();128 dataAttr['font-name'] = elements.find("#fontchanger-menu").val();129 dataAttr['font-weight'] = elements.find("#ts-menu-font-weight").val();130 dataAttr['font-style'] = elements.find("#ts-menu-font-style").val();131 dataAttr['font-size'] = elements.find("#ts-menu-font-size").val();132 dataAttr['font-demo'] = elements.find("#menu-demo").val();133 if( dataAttr['font-type'] == 'google' ){134 var subsets = '',135 inputs = jQuery('.menu-font-subsets').find('input:checked').length - 1;136 jQuery('.menu-font-subsets').find('input:checked').each(function(i, v){137 if( i == inputs ){138 subsets += jQuery(this).val();139 }else{140 subsets += jQuery(this).val() + ',';141 }142 });143 dataAttr['font-subsets'] = subsets;144 }145 if( elements.find('#menu-admin-label').val().length > 0 ){146 elementName = elements.find('#menu-admin-label').val(); 147 }148 } else if (elementType === 'skills') {149 elements = jQuery("#builder-elements>.skills");150 items_array = '[';151 jQuery('#skills_items > li').each(function(){152 if ( jQuery(this).index() + 1 < jQuery('#skills_items > li').length ) { var comma = ','}else{var comma = ''};153 item_id = jQuery(this).find('[data-builder-name="item_id"]').val();154 item_title = jQuery(this).find('[data-builder-name="title"]').val().replace(/"/g, '--quote--');155 item_percentage = jQuery(this).find('[data-builder-name="percentage"]').val();156 item_color = jQuery(this).find('[data-builder-name="color"]').val();157 158 items_array = items_array + '{"id":' + '"' + item_id + '"' + ',"title":' + '"' + item_title + '"' + ',"percentage":' + '"' + item_percentage + '"' + ',"color":' + '"' + item_color + '"' + '}' + comma;159 160 });161 162 items_array = items_array + ']';163 jQuery('#skills_content').val(items_array);164 165 dataAttr = {};166 dataAttr['element-type'] = 'skills';167 dataAttr['admin-label'] = elements.find("#skills-admin-label").val();168 dataAttr['display-mode'] = elements.find("#skills-display-mode").val();169 dataAttr['skills'] = elements.find('#skills_content').val();170 if( elements.find('#skills-admin-label').val().length > 0 ){171 elementName = elements.find('#skills-admin-label').val(); 172 }173 174 } else if (elementType === 'image-carousel') {175 elements = jQuery("#builder-elements>.image-carousel");176 dataAttr = {};177 dataAttr['element-type'] = 'image-carousel';178 dataAttr['carousel-height'] = elements.find("#carousel_height").val();179 dataAttr['images'] = elements.find("#carousel_image_gallery").val();180 dataAttr['admin-label'] = elements.find("#image-carousel-admin-label").val();181 182 } else if (elementType === 'sidebar') {183 elements = jQuery("#builder-elements>.sidebar");184 dataAttr = {};185 dataAttr['element-type'] = 'sidebar';186 dataAttr['sidebar-id'] = elements.find("#ts_sidebar_sidebars option:selected").val();187 dataAttr['sidebar-sticky'] = elements.find("#sidebar-sticky option:selected").val();188 dataAttr['admin-label'] = elements.find("#sidebar-admin-label").val();189 if( elements.find('#sidebar-admin-label').val().length > 0 ){190 elementName = elements.find('#sidebar-admin-label').val(); 191 } 192 } else if (elementType === 'slider') {193 194 elements = jQuery("#builder-elements>.slider");195 dataAttr = {};196 dataAttr['element-type'] = 'slider';197 dataAttr['slider-id'] = elements.find("#slider-name option:selected").val();198 dataAttr['admin-label'] = elements.find("#slider-admin-label").val();199 200 if( elements.find('#slider-admin-label').val().length > 0 ){201 elementName = elements.find('#slider-admin-label').val(); 202 } 203 } else if (elementType === 'boca' || elementType === 'nona') {204 elements = jQuery("#builder-elements>." + elementType);205 postType = elements.find("#" + elementType + "-custom-post").val();206 dataAttr = {};207 dataAttr['element-type'] = elementType;208 dataAttr['admin-label'] = elements.find("#" + elementType + "-admin-label").val();209 dataAttr['custom-post'] = postType;210 dataAttr['category'] = elements.find("#" + elementType + "-categories-" + postType).val();211 dataAttr['orderby'] = elements.find("#" + elementType + "-orderby").val();212 dataAttr['order'] = elements.find("#" + elementType + "-order").val();213 dataAttr['featured'] = elements.find("#" + elementType + "-featured").val();214 dataAttr['posts_per_page'] = elements.find("#" + elementType + "-posts_per_page").val();215 if( elements.find('#'+ elementType +'-admin-label').val().length > 0 ){216 elementName = elements.find('#'+ elementType +'-admin-label').val(); 217 } 218 } else if (elementType === 'list-portfolios') {219 220 elements = jQuery("#builder-elements>.list-portfolios");221 dataAttr = {};222 dataAttr['element-type'] = 'list-portfolios';223 dataAttr['category'] = elements.find('select#list-portfolios-category').val();224 dataAttr['display-mode'] = elements.find('select#list-portfolios-display-mode').val();225 dataAttr['admin-label'] = elements.find("#list-portfolios-admin-label").val();226 227 if( elements.find('#list-portfolios-admin-label').val().length > 0 ){228 elementName = elements.find('#list-portfolios-admin-label').val(); 229 } 230 if (dataAttr['display-mode'] === 'grid') {231 gridMode = elements.find("#list-portfolios-display-mode-options>.list-portfolios-grid");232 dataAttr['behavior'] = gridMode.find('#list-portfolios-grid-behavior').val();233 dataAttr['display-title'] = gridMode.find('#list-portfolios-grid-title').val();234 dataAttr['show-meta'] = gridMode.find('#list-portfolios-grid-show-meta-y').attr('checked') ? 'y' : 'n';235 dataAttr['elements-per-row'] = gridMode.find('#list-portfolios-grid-el-per-row').val();236 dataAttr['posts-limit'] = gridMode.find('#list-portfolios-grid-el-per-row').val();237 dataAttr['elements-per-row'] = gridMode.find('#list-portfolios-grid-el-per-row').val();238 dataAttr['posts-limit'] = gridMode.find('#list-portfolios-grid-nr-of-posts').val();239 dataAttr['order-by'] = gridMode.find('#list-portfolios-grid-order-by').val();240 dataAttr['order-direction'] = gridMode.find('#list-portfolios-grid-order-direction').val();241 dataAttr['special-effects'] = gridMode.find('#list-portfolios-grid-special-effects').val();242 } else if (dataAttr['display-mode'] === 'list') {243 listMode = elements.find("#list-portfolios-display-mode-options>.list-portfolios-list");244 dataAttr['display-title'] = listMode.find('#list-portfolios-list-title').val();245 dataAttr['show-meta'] = listMode.find('#list-portfolios-list-show-meta-y').attr('checked') ? 'y' : 'n';246 dataAttr['posts-limit'] = listMode.find('#list-portfolios-list-nr-of-posts').val();247 dataAttr['image-split'] = listMode.find('#list-portfolios-list-image-split').val();248 dataAttr['content-split'] = listMode.find('#list-portfolios-list-content-split').val();249 dataAttr['order-by'] = listMode.find('#list-portfolios-list-order-by').val();250 dataAttr['order-direction'] = listMode.find('#list-portfolios-list-order-direction').val();251 dataAttr['related-posts'] = listMode.find('#list-portfolios-list-show-related-y').attr('checked') ? 'y' : 'n';252 dataAttr['special-effects'] = listMode.find('#list-portfolios-list-special-effects').val();253 } else if (dataAttr['display-mode'] === 'thumbnails') {254 thumbnailsMode = elements.find("#list-portfolios-display-mode-options>.list-portfolios-thumbnails");255 dataAttr['display-title'] = thumbnailsMode.find('#list-portfolios-thumbnail-title').val();256 dataAttr['behavior'] = thumbnailsMode.find('#list-portfolios-thumbnail-behavior').val();257 dataAttr['elements-per-row'] = thumbnailsMode.find("#list-portfolios-thumbnail-posts-per-row").val();258 dataAttr['posts-limit'] = thumbnailsMode.find("#list-portfolios-thumbnail-limit").val();259 dataAttr['order-by'] = thumbnailsMode.find('#list-portfolios-thumbnail-order-by').val();260 dataAttr['order-direction'] = thumbnailsMode.find('#list-portfolios-thumbnail-order-direction').val();261 dataAttr['special-effects'] = thumbnailsMode.find('#list-portfolios-thumbnail-special-effects').val();262 dataAttr['gutter'] = thumbnailsMode.find('#list-portfolios-thumbnail-gutter').val();263 } else if (dataAttr['display-mode'] === 'big-post') {264 bigPostMode = elements.find("#list-portfolios-display-mode-options>.list-portfolios-big-post");265 dataAttr['show-meta'] = bigPostMode.find('#list-portfolios-big-post-show-meta-y').attr('checked') ? 'y' : 'n';266 dataAttr['posts-limit'] = bigPostMode.find('#list-portfolios-big-post-nr-of-posts').val();267 dataAttr['image-split'] = bigPostMode.find('#list-portfolios-big-post-image-split').val();268 dataAttr['order-by'] = bigPostMode.find('#list-portfolios-big-post-order-by').val();269 dataAttr['order-direction'] = bigPostMode.find('#list-portfolios-big-post-order-direction').val();270 dataAttr['related-posts'] = bigPostMode.find('#list-portfolios-big-post-show-related-y').attr('checked') ? 'y' : 'n';271 dataAttr['special-effects'] = bigPostMode.find('#list-portfolios-big-post-special-effects').val();272 } else if (dataAttr['display-mode'] === 'super-post') {273 superPostMode = elements.find("#list-portfolios-display-mode-options>.list-portfolios-super-post");274 dataAttr['elements-per-row'] = superPostMode.find("#list-portfolios-super-post-posts-per-row").val();275 dataAttr['posts-limit'] = superPostMode.find('#list-portfolios-super-post-limit').val();276 dataAttr['order-by'] = superPostMode.find('#list-portfolios-super-post-order-by').val();277 dataAttr['order-direction'] = superPostMode.find('#list-portfolios-super-post-order-direction').val();278 dataAttr['related-posts'] = superPostMode.find('#list-portfolios-super-post-show-related-y').attr('checked') ? 'y' : 'n';279 dataAttr['special-effects'] = superPostMode.find('#list-portfolios-super-post-special-effects').val();280 } else if (dataAttr['display-mode'] === 'mosaic') {281 mosaicMode = elements.find("#list-portfolios-display-mode-options>.list-portfolios-mosaic");282 dataAttr['order-by'] = mosaicMode.find('#list-portfolios-mosaic-order-by').val();283 dataAttr['order-direction'] = mosaicMode.find('#list-portfolios-mosaic-order-direction').val();284 dataAttr['effects-scroll'] = mosaicMode.find('#list-portfolios-mosaic-effects').val();285 dataAttr['gutter'] = mosaicMode.find('#list-portfolios-mosaic-gutter').val();286 dataAttr['layout'] = mosaicMode.find('#list-portfolios-mosaic-layout').val();287 dataAttr['rows'] = mosaicMode.find('#list-portfolios-mosaic-rows').val();288 dataAttr['scroll'] = mosaicMode.find('#list-portfolios-mosaic-scroll').val();289 dataAttr['pagination'] = mosaicMode.find('#list-portfolios-mosaic-pagination').val();290 if( dataAttr['layout'] == 'rectangles' ){291 dataAttr['posts-limit'] = mosaicMode.find("#list-portfolios-mosaic-post-limit-rows-" + dataAttr['rows'] + "").val();292 }else{293 dataAttr['posts-limit'] = mosaicMode.find("#list-portfolios-mosaic-post-limit-rows-squares").val();294 }295 }296 } else if (elementType === 'testimonials') {297 298 elements = jQuery("#builder-elements>.testimonials");299 items_array = '[';300 jQuery('#testimonials_items > li').each(function(){301 if ( jQuery(this).index() + 1 < jQuery('#testimonials_items > li').length ) { var comma = ','}else{var comma = ''};302 item_id = jQuery(this).find('[data-builder-name="item_id"]').val();303 item_image = jQuery(this).find('[data-role="media-url"]').val().replace(/"/g, '--quote--');304 item_text = jQuery(this).find('[data-builder-name="text"]').val().replace(/"/g, '--quote--').replace(/\r?\n/g, '<br />');305 item_name = jQuery(this).find('[data-builder-name="name"]').val().replace(/"/g, '--quote--');306 item_company = jQuery(this).find('[data-builder-name="company"]').val().replace(/"/g, '--quote--');307 item_url = jQuery(this).find('[data-builder-name="url"]').val().replace(/"/g, '--quote--');308 309 items_array = items_array + '{"id":' + '"' + item_id + '"' + ',"image":' + '"' + item_image + '"' + ',"text":' + '"' + item_text + '"' + ',"name":' + '"' + item_name + '"' + ',"company":' + '"' + item_company + '"' + ',"url":' + '"' + item_url + '"' + '}' + comma;310 311 });312 items_array = items_array + ']';313 jQuery('#testimonials_content').val(items_array);314 dataAttr = {};315 316 dataAttr['elements-per-row'] = isNaN(parseInt(elements.find('#testimonials-row').val(), 10)) ? 3 : parseInt(elements.find('#testimonials-row').val(), 10);317 dataAttr['enable-carousel'] = elements.find('#testimonials-enable-carousel').val();318 dataAttr['element-type'] = 'testimonials';319 dataAttr['testimonials'] = elements.find('#testimonials_content').val();320 dataAttr['admin-label'] = elements.find("#testimonials-admin-label").val();321 if( elements.find('#testimonials-admin-label').val().length > 0 ){322 elementName = elements.find('#testimonials-admin-label').val(); 323 }324 } else if (elementType === 'tab') {325 326 elements = jQuery("#builder-elements>.tab");327 items_array = '[';328 jQuery('#tab_items > li').each(function(){329 if ( jQuery(this).index() + 1 < jQuery('#tab_items > li').length ) { var comma = ','}else{var comma = ''};330 item_id = jQuery(this).find('[data-builder-name="item_id"]').val();331 item_title = jQuery(this).find('[data-builder-name="title"]').val().replace(/"/g, '--quote--');332 item_text = jQuery(this).find('[data-builder-name="text"]').val().replace(/"/g, '--quote--').replace(/\r?\n/g, '<br />');333 334 items_array = items_array + '{"id":' + '"' + item_id + '"' + ',"title":' + '"' + item_title + '"' + ',"text":' + '"' + item_text + '"' + '}' + comma;335 336 });337 items_array = items_array + ']';338 jQuery('#tab_content').val(items_array);339 dataAttr = {};340 341 dataAttr['element-type'] = 'tab';342 dataAttr['tab'] = elements.find('#tab_content').val();343 dataAttr['admin-label'] = elements.find("#tab-admin-label").val();344 dataAttr['mode'] = elements.find("#tab-mode").val();345 if( elements.find('#tab-admin-label').val().length > 0 ){346 elementName = elements.find('#tab-admin-label').val(); 347 }348 } else if (elementType === 'video-carousel') {349 350 elements = jQuery("#builder-elements>.video-carousel");351 items_array = '[';352 jQuery('#video-carousel_items > li').each(function(){353 if ( jQuery(this).index() + 1 < jQuery('#video-carousel_items > li').length ) { var comma = ','}else{var comma = ''};354 item_id = jQuery(this).find('[data-builder-name="item_id"]').val();355 item_title = jQuery(this).find('[data-builder-name="title"]').val().replace(/"/g, '--quote--');356 item_url = jQuery(this).find('[data-builder-name="url"]').val().replace(/"/g, '--quote--');357 item_embed = jQuery(this).find('[data-builder-name="embed"]').val().replace(/"/g, '--quote--');358 item_text = jQuery(this).find('[data-builder-name="text"]').val().replace(/"/g, '--quote--').replace(/\r?\n/g, '<br />');359 360 items_array = items_array + '{"id":' + '"' + item_id + '"' + ',"title":' + '"' + item_title + '"' + ',"text":' + '"' + item_text + '"' + ',"url":' + '"' + item_url + '"' + ',"embed":' + '"' + item_embed + '"' + '}' + comma;361 362 });363 items_array = items_array + ']';364 jQuery('#video-carousel_content').val(items_array);365 dataAttr = {};366 367 dataAttr['element-type'] = 'video-carousel';368 dataAttr['video-carousel'] = elements.find('#video-carousel_content').val();369 dataAttr['admin-label'] = elements.find("#video-carousel-admin-label").val();370 dataAttr['source'] = elements.find("#video-carousel-source").val();371 if( elements.find('#video-carousel-admin-label').val().length > 0 ){372 elementName = elements.find('#video-carousel-admin-label').val(); 373 }374 } else if (elementType === 'count-down') {375 376 elements = jQuery("#builder-elements>.count-down");377 dataAttr = {};378 379 dataAttr['element-type'] = 'count-down';380 dataAttr['admin-label'] = elements.find("#count-down-admin-label").val();381 dataAttr['title'] = elements.find("#count-down-title").val();382 dataAttr['date'] = elements.find("#count-down-date").val();383 dataAttr['hours'] = elements.find("#count-down-hours").val();384 dataAttr['style'] = elements.find("#count-down-style").val();385 if( elements.find('#count-down-admin-label').val().length > 0 ){386 elementName = elements.find('#count-down-admin-label').val(); 387 }388 } else if (elementType === 'list-products') {389 390 elements = jQuery("#builder-elements>.list-products");391 dataAttr = {};392 dataAttr['element-type'] = 'list-products';393 dataAttr['category'] = elements.find('select#list-products-category').val();394 dataAttr['admin-label'] = elements.find("#list-products-admin-label").val();395 if( elements.find('#list-products-admin-label').val().length > 0 ){396 elementName = elements.find('#list-products-admin-label').val(); 397 }398 399 gridMode = elements.find("#list-products-options>.list-products");400 dataAttr['behavior'] = gridMode.find('#list-products-behavior').val();401 dataAttr['elements-per-row'] = gridMode.find('#list-products-el-per-row').val();402 dataAttr['posts-limit'] = gridMode.find('#list-products-el-per-row').val();403 dataAttr['elements-per-row'] = gridMode.find('#list-products-el-per-row').val();404 dataAttr['posts-limit'] = gridMode.find('#list-products-nr-of-posts').val();405 dataAttr['order-by'] = gridMode.find('#list-products-order-by').val();406 dataAttr['order-direction'] = gridMode.find('#list-products-order-direction').val();407 dataAttr['special-effects'] = gridMode.find('#list-products-special-effects').val();408 } else if (elementType === 'last-posts') {409 410 elements = jQuery("#builder-elements>.last-posts");411 dataAttr = {};412 dataAttr['element-type'] = 'last-posts';413 dataAttr['category'] = elements.find('select#last-posts-category').val();414 dataAttr['display-mode'] = elements.find('select#last-posts-display-mode').val();415 dataAttr['id-exclude'] = elements.find('#last-posts-exclude').val();416 dataAttr['exclude-first'] = elements.find('#last-posts-exclude-first').val();417 dataAttr['admin-label'] = elements.find("#last-posts-admin-label").val();418 dataAttr['featured'] = elements.find("#last-posts-featured").val();419 if( elements.find('#last-posts-admin-label').val().length > 0 ){420 elementName = elements.find('#last-posts-admin-label').val(); 421 }422 if (dataAttr['display-mode'] === 'grid') {423 gridMode = elements.find("#last-posts-display-mode-options>.last-posts-grid");424 dataAttr['behavior'] = gridMode.find('#last-posts-grid-behavior').val();425 dataAttr['display-title'] = gridMode.find('#last-posts-grid-title').val();426 dataAttr['show-meta'] = gridMode.find('#last-posts-grid-show-meta-y').attr('checked') ? 'y' : 'n';427 dataAttr['elements-per-row'] = gridMode.find('#last-posts-grid-el-per-row').val();428 dataAttr['posts-limit'] = gridMode.find('#last-posts-grid-el-per-row').val();429 dataAttr['elements-per-row'] = gridMode.find('#last-posts-grid-el-per-row').val();430 dataAttr['posts-limit'] = gridMode.find('#last-posts-grid-nr-of-posts').val();431 dataAttr['order-by'] = gridMode.find('#last-posts-grid-order-by').val();432 dataAttr['order-direction'] = gridMode.find('#last-posts-grid-order-direction').val();433 dataAttr['special-effects'] = gridMode.find('#last-posts-grid-special-effects').val();434 dataAttr['pagination'] = gridMode.find('#last-posts-grid-pagination').val();435 dataAttr['related-posts'] = gridMode.find('#last-posts-grid-related').val();436 dataAttr['show-image'] = gridMode.find('#last-posts-grid-image').val();437 } else if (dataAttr['display-mode'] === 'list') {438 listMode = elements.find("#last-posts-display-mode-options>.last-posts-list");439 dataAttr['display-title'] = listMode.find('#last-posts-list-title').val();440 dataAttr['show-meta'] = listMode.find('#last-posts-list-show-meta-y').attr('checked') ? 'y' : 'n';441 dataAttr['posts-limit'] = listMode.find('#last-posts-list-nr-of-posts').val();442 dataAttr['image-split'] = listMode.find('#last-posts-list-image-split').val();443 dataAttr['content-split'] = listMode.find('#last-posts-list-content-split').val();444 dataAttr['order-by'] = listMode.find('#last-posts-list-order-by').val();445 dataAttr['order-direction'] = listMode.find('#last-posts-list-order-direction').val();446 dataAttr['related-posts'] = listMode.find('#last-posts-list-show-related-y').attr('checked') ? 'y' : 'n';447 dataAttr['special-effects'] = listMode.find('#last-posts-list-special-effects').val();448 dataAttr['pagination'] = listMode.find('#last-posts-list-pagination').val();449 dataAttr['show-image'] = listMode.find('#last-posts-list-image').val();450 } else if (dataAttr['display-mode'] === 'thumbnails') {451 thumbnailsMode = elements.find("#last-posts-display-mode-options>.last-posts-thumbnails");452 dataAttr['display-title'] = thumbnailsMode.find('#last-posts-thumbnail-title').val();453 dataAttr['behavior'] = thumbnailsMode.find('#last-posts-thumbnails-behavior').val();454 dataAttr['elements-per-row'] = thumbnailsMode.find("#last-posts-thumbnail-posts-per-row").val();455 dataAttr['posts-limit'] = thumbnailsMode.find("#last-posts-thumbnail-limit").val();456 dataAttr['order-by'] = thumbnailsMode.find('#last-posts-thumbnail-order-by').val();457 dataAttr['order-direction'] = thumbnailsMode.find('#last-posts-thumbnails-order-direction').val();458 dataAttr['special-effects'] = thumbnailsMode.find('#last-posts-thumbnail-special-effects').val();459 dataAttr['gutter'] = thumbnailsMode.find('#last-posts-thumbnail-gutter').val();460 dataAttr['meta-thumbnail'] = thumbnailsMode.find('#last-posts-thumbnail-show-meta-y').attr('checked') ? 'y' : 'n';461 dataAttr['pagination'] = thumbnailsMode.find('#last-posts-thumbnails-pagination').val();462 } else if (dataAttr['display-mode'] === 'big-post') {463 bigPostMode = elements.find("#last-posts-display-mode-options>.last-posts-big-post");464 dataAttr['show-meta'] = bigPostMode.find('#last-posts-big-post-show-meta-y').attr('checked') ? 'y' : 'n';465 dataAttr['posts-limit'] = bigPostMode.find('#last-posts-big-post-nr-of-posts').val();466 dataAttr['image-split'] = bigPostMode.find('#last-posts-big-post-image-split').val();467 dataAttr['order-by'] = bigPostMode.find('#last-posts-big-post-order-by').val();468 dataAttr['order-direction'] = bigPostMode.find('#last-posts-big-post-order-direction').val();469 dataAttr['related-posts'] = bigPostMode.find('#last-posts-big-post-related').val();470 dataAttr['special-effects'] = bigPostMode.find('#last-posts-big-post-special-effects').val();471 dataAttr['pagination'] = bigPostMode.find('#last-posts-big-post-pagination').val();472 dataAttr['image-position'] = bigPostMode.find('#last-posts-big-post-image-position').val();473 dataAttr['excerpt'] = bigPostMode.find('#last-posts-big-post-excerpt').val();474 dataAttr['carousel'] = bigPostMode.find('#last-posts-big-post-carousel').val();475 dataAttr['show-image'] = bigPostMode.find('#last-posts-big-post-image').val();476 } else if (dataAttr['display-mode'] === 'timeline') {477 timelineMode = elements.find("#last-posts-display-mode-options>.last-posts-timeline");478 dataAttr['display-title'] = timelineMode.find('#last-posts-timeline-title').val();479 dataAttr['show-meta'] = timelineMode.find('#last-posts-timeline-show-meta-y').attr('checked') ? 'y' : 'n';480 dataAttr['posts-limit'] = timelineMode.find('#last-posts-timeline-post-limit').val();481 dataAttr['image'] = timelineMode.find('#last-posts-timeline-image').val();482 dataAttr['order-by'] = timelineMode.find('#last-posts-timeline-order-by').val();483 dataAttr['order-direction'] = timelineMode.find('#last-posts-timeline-order-direction').val();484 dataAttr['pagination'] = timelineMode.find('#last-posts-timeline-pagination').val();485 } else if (dataAttr['display-mode'] === 'mosaic') {486 mosaicMode = elements.find("#last-posts-display-mode-options>.last-posts-mosaic");487 dataAttr['order-by'] = mosaicMode.find('#last-posts-mosaic-order-by').val();488 dataAttr['order-direction'] = mosaicMode.find('#last-posts-mosaic-order-direction').val();489 dataAttr['effects-scroll'] = mosaicMode.find('#last-posts-mosaic-effects').val();490 dataAttr['gutter'] = mosaicMode.find('#last-posts-mosaic-gutter').val();491 dataAttr['layout'] = mosaicMode.find('#last-posts-mosaic-layout').val();492 dataAttr['rows'] = mosaicMode.find('#last-posts-mosaic-rows').val();493 dataAttr['scroll'] = mosaicMode.find('#last-posts-mosaic-scroll').val();494 dataAttr['pagination'] = mosaicMode.find('#last-posts-mosaic-pagination').val();495 if( dataAttr['layout'] == 'rectangles' ){496 dataAttr['posts-limit'] = mosaicMode.find("#last-posts-mosaic-post-limit-rows-" + dataAttr['rows'] + "").val();497 }else{498 dataAttr['posts-limit'] = mosaicMode.find("#last-posts-mosaic-post-limit-rows-squares").val();499 }500 } else if (dataAttr['display-mode'] === 'super-post') {501 superPostMode = elements.find("#last-posts-display-mode-options>.last-posts-super-post");502 dataAttr['elements-per-row'] = superPostMode.find("#last-posts-super-post-posts-per-row").val();503 dataAttr['posts-limit'] = superPostMode.find('#last-posts-super-post-limit').val();504 dataAttr['order-by'] = superPostMode.find('#last-posts-super-post-order-by').val();505 dataAttr['order-direction'] = superPostMode.find('#last-posts-super-post-order-direction').val();506 dataAttr['related-posts'] = superPostMode.find('#last-posts-super-post-show-related-y').attr('checked') ? 'y' : 'n';507 dataAttr['special-effects'] = superPostMode.find('#last-posts-super-post-special-effects').val();508 dataAttr['pagination'] = superPostMode.find('#last-posts-super-post-pagination').val();509 }510 } else if (elementType === 'list-galleries') {511 512 elements = jQuery("#builder-elements>.list-galleries");513 dataAttr = {};514 dataAttr['element-type'] = 'list-galleries';515 dataAttr['category'] = elements.find('select#list-galleries-category').val();516 dataAttr['display-mode'] = elements.find('select#list-galleries-display-mode').val();517 dataAttr['id-exclude'] = elements.find('#list-galleries-exclude').val();518 dataAttr['exclude-first'] = elements.find('#list-galleries-exclude-first').val();519 dataAttr['admin-label'] = elements.find("#list-galleries-admin-label").val();520 dataAttr['featured'] = elements.find("#list-galleries-featured").val();521 if( elements.find('#list-galleries-admin-label').val().length > 0 ){522 elementName = elements.find('#list-galleries-admin-label').val(); 523 }524 if (dataAttr['display-mode'] === 'grid') {525 gridMode = elements.find("#list-galleries-display-mode-options>.list-galleries-grid");526 dataAttr['behavior'] = gridMode.find('#list-galleries-grid-behavior').val();527 dataAttr['display-title'] = gridMode.find('#list-galleries-grid-title').val();528 dataAttr['show-meta'] = gridMode.find('#list-galleries-grid-show-meta-y').attr('checked') ? 'y' : 'n';529 dataAttr['elements-per-row'] = gridMode.find('#list-galleries-grid-el-per-row').val();530 dataAttr['posts-limit'] = gridMode.find('#list-galleries-grid-el-per-row').val();531 dataAttr['elements-per-row'] = gridMode.find('#list-galleries-grid-el-per-row').val();532 dataAttr['posts-limit'] = gridMode.find('#list-galleries-grid-nr-of-posts').val();533 dataAttr['order-by'] = gridMode.find('#list-galleries-grid-order-by').val();534 dataAttr['order-direction'] = gridMode.find('#list-galleries-grid-order-direction').val();535 dataAttr['special-effects'] = gridMode.find('#list-galleries-grid-special-effects').val();536 dataAttr['pagination'] = gridMode.find('#list-galleries-grid-pagination').val();537 dataAttr['related-posts'] = gridMode.find('#list-galleries-grid-related').val();538 dataAttr['show-image'] = gridMode.find('#list-galleries-grid-image').val();539 } else if (dataAttr['display-mode'] === 'list') {540 listMode = elements.find("#list-galleries-display-mode-options>.list-galleries-list");541 dataAttr['display-title'] = listMode.find('#list-galleries-list-title').val();542 dataAttr['show-meta'] = listMode.find('#list-galleries-list-show-meta-y').attr('checked') ? 'y' : 'n';543 dataAttr['posts-limit'] = listMode.find('#list-galleries-list-nr-of-posts').val();544 dataAttr['image-split'] = listMode.find('#list-galleries-list-image-split').val();545 dataAttr['content-split'] = listMode.find('#list-galleries-list-content-split').val();546 dataAttr['order-by'] = listMode.find('#list-galleries-list-order-by').val();547 dataAttr['order-direction'] = listMode.find('#list-galleries-list-order-direction').val();548 dataAttr['related-posts'] = listMode.find('#list-galleries-list-show-related-y').attr('checked') ? 'y' : 'n';549 dataAttr['special-effects'] = listMode.find('#list-galleries-list-special-effects').val();550 dataAttr['pagination'] = listMode.find('#list-galleries-list-pagination').val();551 dataAttr['show-image'] = listMode.find('#list-galleries-list-image').val();552 } else if (dataAttr['display-mode'] === 'thumbnails') {553 thumbnailsMode = elements.find("#list-galleries-display-mode-options>.list-galleries-thumbnails");554 dataAttr['display-title'] = thumbnailsMode.find('#list-galleries-thumbnail-title').val();555 dataAttr['behavior'] = thumbnailsMode.find('#list-galleries-thumbnails-behavior').val();556 dataAttr['elements-per-row'] = thumbnailsMode.find("#list-galleries-thumbnail-posts-per-row").val();557 dataAttr['posts-limit'] = thumbnailsMode.find("#list-galleries-thumbnail-limit").val();558 dataAttr['order-by'] = thumbnailsMode.find('#list-galleries-thumbnail-order-by').val();559 dataAttr['order-direction'] = thumbnailsMode.find('#list-galleries-thumbnails-order-direction').val();560 dataAttr['special-effects'] = thumbnailsMode.find('#list-galleries-thumbnail-special-effects').val();561 dataAttr['gutter'] = thumbnailsMode.find('#list-galleries-thumbnail-gutter').val();562 dataAttr['meta-thumbnail'] = thumbnailsMode.find('#list-galleries-thumbnail-show-meta-y').attr('checked') ? 'y' : 'n';563 dataAttr['pagination'] = thumbnailsMode.find('#list-galleries-thumbnails-pagination').val();564 } else if (dataAttr['display-mode'] === 'big-post') {565 bigPostMode = elements.find("#list-galleries-display-mode-options>.list-galleries-big-post");566 dataAttr['show-meta'] = bigPostMode.find('#list-galleries-big-post-show-meta-y').attr('checked') ? 'y' : 'n';567 dataAttr['posts-limit'] = bigPostMode.find('#list-galleries-big-post-nr-of-posts').val();568 dataAttr['image-split'] = bigPostMode.find('#list-galleries-big-post-image-split').val();569 dataAttr['order-by'] = bigPostMode.find('#list-galleries-big-post-order-by').val();570 dataAttr['order-direction'] = bigPostMode.find('#list-galleries-big-post-order-direction').val();571 dataAttr['related-posts'] = bigPostMode.find('#list-galleries-big-post-related').val();572 dataAttr['special-effects'] = bigPostMode.find('#list-galleries-big-post-special-effects').val();573 dataAttr['pagination'] = bigPostMode.find('#list-galleries-big-post-pagination').val();574 dataAttr['image-position'] = bigPostMode.find('#list-galleries-big-post-image-position').val();575 dataAttr['excerpt'] = bigPostMode.find('#list-galleries-big-post-excerpt').val();576 dataAttr['carousel'] = bigPostMode.find('#list-galleries-big-post-carousel').val();577 dataAttr['show-image'] = bigPostMode.find('#list-galleries-big-post-image').val();578 } else if (dataAttr['display-mode'] === 'timeline') {579 timelineMode = elements.find("#list-galleries-display-mode-options>.list-galleries-timeline");580 dataAttr['display-title'] = timelineMode.find('#list-galleries-timeline-title').val();581 dataAttr['show-meta'] = timelineMode.find('#list-galleries-timeline-show-meta-y').attr('checked') ? 'y' : 'n';582 dataAttr['posts-limit'] = timelineMode.find('#list-galleries-timeline-post-limit').val();583 dataAttr['image'] = timelineMode.find('#list-galleries-timeline-image').val();584 dataAttr['order-by'] = timelineMode.find('#list-galleries-timeline-order-by').val();585 dataAttr['order-direction'] = timelineMode.find('#list-galleries-timeline-order-direction').val();586 dataAttr['pagination'] = timelineMode.find('#list-galleries-timeline-pagination').val();587 } else if (dataAttr['display-mode'] === 'mosaic') {588 mosaicMode = elements.find("#list-galleries-display-mode-options>.list-galleries-mosaic");589 dataAttr['posts-limit'] = mosaicMode.find("#list-galleries-mosaic-post-limit").val();590 dataAttr['order-by'] = mosaicMode.find('#list-galleries-mosaic-order-by').val();591 dataAttr['order-direction'] = mosaicMode.find('#list-galleries-mosaic-order-direction').val();592 dataAttr['effects-scroll'] = mosaicMode.find('#list-galleries-mosaic-effects').val();593 dataAttr['gutter'] = mosaicMode.find('#list-galleries-mosaic-gutter').val();594 dataAttr['layout'] = mosaicMode.find('#list-galleries-mosaic-layout').val();595 dataAttr['rows'] = mosaicMode.find('#list-galleries-mosaic-rows').val();596 dataAttr['scroll'] = mosaicMode.find('#list-galleries-mosaic-scroll').val();597 dataAttr['pagination'] = mosaicMode.find('#list-galleries-mosaic-pagination').val();598 if( dataAttr['layout'] == 'rectangles' ){599 dataAttr['posts-limit'] = mosaicMode.find("#list-galleries-mosaic-post-limit-rows-" + dataAttr['rows'] + "").val();600 }else{601 dataAttr['posts-limit'] = mosaicMode.find("#list-galleries-mosaic-post-limit-rows-squares").val();602 }603 } else if (dataAttr['display-mode'] === 'super-post') {604 superPostMode = elements.find("#list-galleries-display-mode-options>.list-galleries-super-post");605 dataAttr['elements-per-row'] = superPostMode.find("#list-galleries-super-post-posts-per-row").val();606 dataAttr['posts-limit'] = superPostMode.find('#list-galleries-super-post-limit').val();607 dataAttr['order-by'] = superPostMode.find('#list-galleries-super-post-order-by').val();608 dataAttr['order-direction'] = superPostMode.find('#list-galleries-super-post-order-direction').val();609 dataAttr['related-posts'] = superPostMode.find('#list-galleries-super-post-show-related-y').attr('checked') ? 'y' : 'n';610 dataAttr['special-effects'] = superPostMode.find('#list-galleries-super-post-special-effects').val();611 dataAttr['pagination'] = superPostMode.find('#list-galleries-super-post-pagination').val();612 }613 } else if (elementType === 'accordion') {614 615 elements = jQuery("#builder-elements>.accordion");616 dataAttr = {};617 dataAttr['element-type'] = 'accordion';618 dataAttr['admin-label'] = elements.find("#accordion-admin-label").val();619 dataAttr['posts-type'] = elements.find('#accordion-posts-type').val();620 dataAttr['featured'] = elements.find('#accordion-featured').val();621 dataAttr['nr-of-posts'] = elements.find("#accordion-nr-of-posts").val();622 dataAttr['order-by'] = elements.find("#accordion-order-by").val();623 dataAttr['order-direction'] = elements.find("#accordion-order-direction").val();624 dataAttr['category'] = '';625 var arrayCategories = elements.find('#accordion-' + dataAttr['posts-type'] + '-category').val();626 if( typeof(arrayCategories) !== 'undefined' ){627 for(index in arrayCategories){628 dataAttr['category'] = dataAttr['category'] + arrayCategories[index] + ',';629 } 630 }631 if( elements.find('#accordion-admin-label').val().length > 0 ){632 elementName = elements.find('#accordion-admin-label').val(); 633 }634 }else if (elementType === 'latest-custom-posts') {635 636 elements = jQuery("#builder-elements>.latest-custom-posts");637 dataAttr = {};638 dataAttr['element-type'] = 'latest-custom-posts';639 dataAttr['post-type'] = elements.find('select#latest-custom-posts-type').val();640 dataAttr['display-mode'] = elements.find('select#latest-custom-posts-display-mode').val();641 dataAttr['id-exclude'] = elements.find('#latest-custom-posts-exclude').val();642 dataAttr['exclude-first'] = elements.find('#latest-custom-posts-exclude-first').val();643 dataAttr['admin-label'] = elements.find("#latest-custom-posts-admin-label").val();644 dataAttr['featured'] = elements.find("#latest-custom-posts-featured").val();645 dataAttr['category'] = '';646 for(key in dataAttr['post-type']){647 var arrayCategories = elements.find('#latest-custom-posts-category-' + dataAttr['post-type'][key]).val();648 if( typeof(arrayCategories) !== 'undefined' ){649 for(index in arrayCategories){650 dataAttr['category'] = dataAttr['category'] + arrayCategories[index] + ',';651 } 652 }653 }654 if( elements.find('#latest-custom-posts-admin-label').val().length > 0 ){655 elementName = elements.find('#latest-custom-posts-admin-label').val(); 656 }657 if (dataAttr['display-mode'] === 'grid') {658 gridMode = elements.find("#latest-custom-posts-display-mode-options>.latest-custom-posts-grid");659 dataAttr['behavior'] = gridMode.find('#latest-custom-posts-grid-behavior').val();660 dataAttr['display-title'] = gridMode.find('#latest-custom-posts-grid-title').val();661 dataAttr['show-meta'] = gridMode.find('#latest-custom-posts-grid-show-meta-y').attr('checked') ? 'y' : 'n';662 dataAttr['elements-per-row'] = gridMode.find('#latest-custom-posts-grid-el-per-row').val();663 dataAttr['posts-limit'] = gridMode.find('#latest-custom-posts-grid-el-per-row').val();664 dataAttr['elements-per-row'] = gridMode.find('#latest-custom-posts-grid-el-per-row').val();665 dataAttr['posts-limit'] = gridMode.find('#latest-custom-posts-grid-nr-of-posts').val();666 dataAttr['order-by'] = gridMode.find('#latest-custom-posts-grid-order-by').val();667 dataAttr['order-direction'] = gridMode.find('#latest-custom-posts-grid-order-direction').val();668 dataAttr['special-effects'] = gridMode.find('#latest-custom-posts-grid-special-effects').val();669 dataAttr['pagination'] = gridMode.find('#latest-custom-posts-grid-pagination').val();670 dataAttr['related-posts'] = gridMode.find('#latest-custom-posts-grid-related').val();671 dataAttr['show-image'] = gridMode.find('#latest-custom-posts-grid-image').val();672 } else if (dataAttr['display-mode'] === 'list') {673 listMode = elements.find("#latest-custom-posts-display-mode-options>.latest-custom-posts-list");674 dataAttr['display-title'] = listMode.find('#latest-custom-posts-list-title').val();675 dataAttr['show-meta'] = listMode.find('#latest-custom-posts-list-show-meta-y').attr('checked') ? 'y' : 'n';676 dataAttr['posts-limit'] = listMode.find('#latest-custom-posts-list-nr-of-posts').val();677 dataAttr['image-split'] = listMode.find('#latest-custom-posts-list-image-split').val();678 dataAttr['content-split'] = listMode.find('#latest-custom-posts-list-content-split').val();679 dataAttr['order-by'] = listMode.find('#latest-custom-posts-list-order-by').val();680 dataAttr['order-direction'] = listMode.find('#latest-custom-posts-list-order-direction').val();681 dataAttr['related-posts'] = listMode.find('#latest-custom-posts-list-show-related-y').attr('checked') ? 'y' : 'n';682 dataAttr['special-effects'] = listMode.find('#latest-custom-posts-list-special-effects').val();683 dataAttr['pagination'] = listMode.find('#latest-custom-posts-list-pagination').val();684 dataAttr['show-image'] = listMode.find('#latest-custom-posts-list-image').val();685 } else if (dataAttr['display-mode'] === 'thumbnails') {686 thumbnailsMode = elements.find("#latest-custom-posts-display-mode-options>.latest-custom-posts-thumbnails");687 dataAttr['display-title'] = thumbnailsMode.find('#latest-custom-posts-thumbnail-title').val();688 dataAttr['behavior'] = thumbnailsMode.find('#latest-custom-posts-thumbnails-behavior').val();689 dataAttr['elements-per-row'] = thumbnailsMode.find("#latest-custom-posts-thumbnail-posts-per-row").val();690 dataAttr['posts-limit'] = thumbnailsMode.find("#latest-custom-posts-thumbnail-limit").val();691 dataAttr['order-by'] = thumbnailsMode.find('#latest-custom-posts-thumbnail-order-by').val();692 dataAttr['order-direction'] = thumbnailsMode.find('#latest-custom-posts-thumbnails-order-direction').val();693 dataAttr['special-effects'] = thumbnailsMode.find('#latest-custom-posts-thumbnail-special-effects').val();694 dataAttr['gutter'] = thumbnailsMode.find('#latest-custom-posts-thumbnail-gutter').val();695 dataAttr['meta-thumbnail'] = thumbnailsMode.find('#latest-custom-posts-thumbnail-show-meta-y').attr('checked') ? 'y' : 'n';696 dataAttr['pagination'] = thumbnailsMode.find('#latest-custom-posts-thumbnails-pagination').val();697 } else if (dataAttr['display-mode'] === 'big-post') {698 bigPostMode = elements.find("#latest-custom-posts-display-mode-options>.latest-custom-posts-big-post");699 dataAttr['show-meta'] = bigPostMode.find('#latest-custom-posts-big-post-show-meta-y').attr('checked') ? 'y' : 'n';700 dataAttr['posts-limit'] = bigPostMode.find('#latest-custom-posts-big-post-nr-of-posts').val();701 dataAttr['image-split'] = bigPostMode.find('#latest-custom-posts-big-post-image-split').val();702 dataAttr['order-by'] = bigPostMode.find('#latest-custom-posts-big-post-order-by').val();703 dataAttr['order-direction'] = bigPostMode.find('#latest-custom-posts-big-post-order-direction').val();704 dataAttr['related-posts'] = bigPostMode.find('#latest-custom-posts-big-post-related').val();705 dataAttr['special-effects'] = bigPostMode.find('#latest-custom-posts-big-post-special-effects').val();706 dataAttr['pagination'] = bigPostMode.find('#latest-custom-posts-big-post-pagination').val();707 dataAttr['image-position'] = bigPostMode.find('#latest-custom-posts-big-post-image-position').val();708 dataAttr['excerpt'] = bigPostMode.find('#latest-custom-posts-big-post-excerpt').val();709 dataAttr['carousel'] = bigPostMode.find('#latest-custom-posts-big-post-carousel').val();710 dataAttr['show-image'] = bigPostMode.find('#latest-custom-posts-big-post-image').val();711 } else if (dataAttr['display-mode'] === 'timeline') {712 timelineMode = elements.find("#latest-custom-posts-display-mode-options>.latest-custom-posts-timeline");713 dataAttr['display-title'] = timelineMode.find('#latest-custom-posts-timeline-title').val();714 dataAttr['show-meta'] = timelineMode.find('#latest-custom-posts-timeline-show-meta-y').attr('checked') ? 'y' : 'n';715 dataAttr['posts-limit'] = timelineMode.find('#latest-custom-posts-timeline-post-limit').val();716 dataAttr['image'] = timelineMode.find('#latest-custom-posts-timeline-image').val();717 dataAttr['order-by'] = timelineMode.find('#latest-custom-posts-timeline-order-by').val();718 dataAttr['order-direction'] = timelineMode.find('#latest-custom-posts-timeline-order-direction').val();719 dataAttr['pagination'] = timelineMode.find('#latest-custom-posts-timeline-pagination').val();720 } else if (dataAttr['display-mode'] === 'mosaic') {721 mosaicMode = elements.find("#latest-custom-posts-display-mode-options>.latest-custom-posts-mosaic");722 dataAttr['order-by'] = mosaicMode.find('#latest-custom-posts-mosaic-order-by').val();723 dataAttr['order-direction'] = mosaicMode.find('#latest-custom-posts-mosaic-order-direction').val();724 dataAttr['effects-scroll'] = mosaicMode.find('#latest-custom-posts-mosaic-effects').val();725 dataAttr['gutter'] = mosaicMode.find('#latest-custom-posts-mosaic-gutter').val();726 dataAttr['layout'] = mosaicMode.find('#latest-custom-posts-mosaic-layout').val();727 dataAttr['rows'] = mosaicMode.find('#latest-custom-posts-mosaic-rows').val();728 dataAttr['scroll'] = mosaicMode.find('#latest-custom-posts-mosaic-scroll').val();729 dataAttr['pagination'] = mosaicMode.find('#latest-custom-posts-mosaic-pagination').val();730 if( dataAttr['layout'] == 'rectangles' ){731 dataAttr['posts-limit'] = mosaicMode.find("#latest-custom-posts-mosaic-post-limit-rows-" + dataAttr['rows'] + "").val();732 }else{733 dataAttr['posts-limit'] = mosaicMode.find("#latest-custom-posts-mosaic-post-limit-rows-squares").val();734 }735 } else if (dataAttr['display-mode'] === 'super-post') {736 superPostMode = elements.find("#latest-custom-posts-display-mode-options>.latest-custom-posts-super-post");737 dataAttr['elements-per-row'] = superPostMode.find("#latest-custom-posts-super-post-posts-per-row").val();738 dataAttr['posts-limit'] = superPostMode.find('#latest-custom-posts-super-post-limit').val();739 dataAttr['order-by'] = superPostMode.find('#latest-custom-posts-super-post-order-by').val();740 dataAttr['order-direction'] = superPostMode.find('#latest-custom-posts-super-post-order-direction').val();741 dataAttr['related-posts'] = superPostMode.find('#latest-custom-posts-super-post-show-related-y').attr('checked') ? 'y' : 'n';742 dataAttr['special-effects'] = superPostMode.find('#latest-custom-posts-super-post-special-effects').val();743 dataAttr['pagination'] = superPostMode.find('#latest-custom-posts-super-post-pagination').val();744 }745 } else if (elementType === 'callaction') {746 elements = jQuery("#builder-elements>.callaction");747 dataAttr = {};748 dataAttr['element-type'] = 'callaction';749 dataAttr['callaction-text'] = elements.find('#callaction-text').val();750 dataAttr['callaction-link'] = elements.find('#callaction-link').val();751 dataAttr['callaction-button-text'] = elements.find('#callaction-button-text').val();752 dataAttr['admin-label'] = elements.find("#callaction-admin-label").val();753 if( elements.find('#callaction-admin-label').val().length > 0 ){754 elementName = elements.find('#callaction-admin-label').val(); 755 }756 } else if (elementType === 'teams') {757 758 elements = jQuery("#builder-elements>.teams");759 dataAttr = {};760 dataAttr['element-type'] = 'teams';761 dataAttr['elements-per-row'] = isNaN(parseInt(elements.find('#teams-elements-per-row').val(), 10)) ? 3 : parseInt(elements.find('#teams-elements-per-row').val(), 10);762 dataAttr['remove-gutter'] = elements.find('#teams-remove-gutter').val();763 dataAttr['enable-carousel'] = elements.find('#teams-enable-carousel').val();764 dataAttr['posts-limit'] = isNaN(parseInt(elements.find('#teams-post-limit').val(), 10)) ? 3 : parseInt(elements.find('#teams-post-limit').val(), 10);765 dataAttr['category'] = elements.find('#teams-category').val();766 dataAttr['admin-label'] = elements.find("#teams-admin-label").val();767 dataAttr['effect'] = elements.find("#teams-effect").val();768 dataAttr['delay'] = elements.find("#teams-delay").val();769 if( elements.find('#teams-admin-label').val().length > 0 ){770 elementName = elements.find('#teams-admin-label').val(); 771 }772 } else if (elementType === 'pricing-tables') {773 774 elements = jQuery("#builder-elements>.pricing-tables");775 dataAttr = {};776 dataAttr['element-type'] = 'pricing-tables';777 dataAttr['elements-per-row'] = isNaN(parseInt(elements.find('#pricing-tables-elements-per-row').val(), 10)) ? 3 : parseInt(elements.find('#pricing-tables-elements-per-row').val(), 10);778 dataAttr['remove-gutter'] = elements.find('#pricing-tables-remove-gutter').val();779 dataAttr['posts-limit'] = isNaN(parseInt(elements.find('#pricing-tables-post-limit').val(), 10)) ? 3 : parseInt(elements.find('#pricing-tables-post-limit').val(), 10);780 dataAttr['category'] = elements.find('#pricing-tables-category').val();781 dataAttr['admin-label'] = elements.find("#pricing-tables-admin-label").val();782 dataAttr['effect'] = elements.find("#pricing-tables-effect").val();783 dataAttr['delay'] = elements.find("#pricing-tables-delay").val();784 if( elements.find('#pricing-tables-admin-label').val().length > 0 ){785 elementName = elements.find('#pricing-tables-admin-label').val(); 786 }787 } else if (elementType === 'advertising') {788 789 elements = jQuery("#builder-elements>.advertising");790 dataAttr = {};791 dataAttr['element-type'] = 'advertising';792 dataAttr['advertising'] = elements.find('#advertising').val();793 dataAttr['admin-label'] = elements.find("#advertising-admin-label").val();794 if( elements.find('#advertising-admin-label').val().length > 0 ){795 elementName = elements.find('#advertising-admin-label').val(); 796 }797 } else if (elementType === 'empty') {798 dataAttr = {};799 dataAttr['element-type'] = 'empty';800 } else if (elementType === 'delimiter') {801 elements = jQuery("#builder-elements>.delimiter");802 803 dataAttr = {};804 dataAttr['element-type'] = 'delimiter';805 dataAttr['delimiter-type'] = elements.find('#delimiter-type').val();806 dataAttr['delimiter-color'] = elements.find('#delimiter-color').val();807 dataAttr['admin-label'] = elements.find("#delimiter-admin-label").val();808 if( elements.find('#delimiter-admin-label').val().length > 0 ){809 elementName = elements.find('#delimiter-admin-label').val(); 810 }811 } else if (elementType === 'title') {812 elements = jQuery("#builder-elements>.title");813 814 dataAttr = {};815 dataAttr['element-type'] = 'title';816 dataAttr['title'] = elements.find('#title-title').val();817 dataAttr['title-color'] = elements.find('#builder-element-title-color').val();818 dataAttr['title-icon'] = elements.find('#builder-element-title-icon').val();819 dataAttr['subtitle'] = elements.find('#title-subtitle').val();820 dataAttr['subtitle-color'] = elements.find('#builder-element-title-subtitle-color').val();821 dataAttr['style'] = elements.find('#title-style').val();822 dataAttr['size'] = elements.find('#title-size').val();823 dataAttr['admin-label'] = elements.find("#title-admin-label").val();824 dataAttr['link'] = elements.find("#title-link").val();825 dataAttr['target'] = elements.find("#title-target").val();826 dataAttr['effect'] = elements.find("#title-effect").val();827 dataAttr['delay'] = elements.find("#title-delay").val();828 dataAttr['letter-spacer'] = elements.find("#title-letter-spacing").val();829 if( elements.find('#title-admin-label').val().length > 0 ){830 elementName = elements.find('#title-admin-label').val(); 831 }832 } else if (elementType === 'video') {833 elements = jQuery("#builder-elements>.video");834 835 dataAttr = {};836 dataAttr['element-type'] = 'video';837 dataAttr['embed'] = elements.find('#video-embed').val();838 dataAttr['admin-label'] = elements.find("#video-admin-label").val();839 dataAttr['lightbox'] = elements.find("#video-lightbox").val();840 dataAttr['title'] = elements.find("#video-title").val();841 if( elements.find('#video-admin-label').val().length > 0 ){842 elementName = elements.find('#video-admin-label').val(); 843 }844 } else if (elementType === 'facebook-block') {845 elements = jQuery("#builder-elements>.facebook-block");846 847 dataAttr = {};848 dataAttr['element-type'] = 'facebook-block';849 dataAttr['facebook-url'] = elements.find('#facebook-url').val();850 dataAttr['cover'] = elements.find('#facebook-cover').val();851 } else if (elementType === 'image') {852 elements = jQuery("#builder-elements>.image");853 854 dataAttr = {};855 dataAttr['element-type'] = 'image';856 dataAttr['image-url'] = elements.find('#image_url').val();857 dataAttr['forward-url'] = elements.find('#forward-image-url').val();858 dataAttr['image-target'] = elements.find('#image-target').val();859 dataAttr['admin-label'] = elements.find("#image-admin-label").val();860 dataAttr['retina'] = elements.find("#image-retina").val();861 dataAttr['align'] = elements.find("#image-align").val();862 dataAttr['effect'] = elements.find("#image-effect").val();863 dataAttr['delay'] = elements.find("#image-delay").val();864 if( elements.find('#image-admin-label').val().length > 0 ){865 elementName = elements.find('#image-admin-label').val(); 866 }867 } else if (elementType === 'instance') {868 elements = jQuery("#builder-elements>.instance");869 870 dataAttr = {};871 dataAttr['element-type'] = 'instance';872 dataAttr['admin-label'] = elements.find("#instance-admin-label").val();873 dataAttr['title'] = elements.find('#instance-title').val();874 dataAttr['image'] = elements.find('#instance-image-url').val();875 dataAttr['align'] = elements.find("#instance-align").val();876 dataAttr['button-url'] = elements.find('#instance-button-url').val();877 dataAttr['button-target'] = elements.find('#instance-button-target').val();878 dataAttr['button-text'] = elements.find('#instance-button-text').val();879 dataAttr['content'] = elements.find("#instance-content").val();880 if( elements.find('#instance-admin-label').val().length > 0 ){881 elementName = elements.find('#instance-admin-label').val(); 882 }883 } else if (elementType === 'powerlink') {884 elements = jQuery("#builder-elements>.powerlink");885 886 dataAttr = {};887 dataAttr['element-type'] = 'powerlink';888 dataAttr['admin-label'] = elements.find("#powerlink-admin-label").val();889 dataAttr['title'] = elements.find("#powerlink-title").val();890 dataAttr['image'] = elements.find('#image-powerlink-url').val();891 dataAttr['button-url'] = elements.find('#powerlink-button-url').val();892 dataAttr['button-text'] = elements.find('#powerlink-button-text').val();893 if( elements.find('#powerlink-admin-label').val().length > 0 ){894 elementName = elements.find('#powerlink-admin-label').val(); 895 }896 } else if (elementType === 'filters') {897 898 elements = jQuery("#builder-elements>.filters");899 900 dataAttr = {};901 dataAttr['element-type'] = 'filters';902 dataAttr['post-type'] = elements.find('#filters-post-type').val();903 if( jQuery('#filters-' + dataAttr['post-type'] + '-category').val() !== null && jQuery('#filters-' + dataAttr['post-type'] + '-category').val() !== 'undefined' ){904 dataAttr['categories'] = jQuery('#filters-' + dataAttr['post-type'] + '-category').val().join();905 }else{906 dataAttr['categories'] = '';907 }908 dataAttr['posts-limit'] = elements.find('#filters-posts-limit').val();909 dataAttr['elements-per-row'] = elements.find('#filters-elements-per-row').val();910 dataAttr['order-by'] = elements.find('#filters-order-by').val();911 dataAttr['direction'] = elements.find('#filters-order-direction').val();912 dataAttr['special-effects'] = elements.find('#filters-special-effects').val();913 dataAttr['gutter'] = elements.find('#filters-gutter').val();914 dataAttr['admin-label'] = elements.find("#filters-admin-label").val();915 dataAttr['meta-thumbnail'] = elements.find("#filters-meta").val();916 if( elements.find('#filters-admin-label').val().length > 0 ){917 elementName = elements.find('#filters-admin-label').val(); 918 }919 } else if (elementType === 'toggle') {920 elements = jQuery("#builder-elements>.toggle");921 922 dataAttr = {};923 dataAttr['element-type'] = 'toggle';924 dataAttr['toggle-title'] = elements.find('#toggle-title').val();925 dataAttr['toggle-description'] = elements.find('#toggle-description').val();926 dataAttr['toggle-state'] = elements.find('#toggle-state').val();927 dataAttr['admin-label'] = elements.find("#toggle-admin-label").val();928 if( elements.find('#toggle-admin-label').val().length > 0 ){929 elementName = elements.find('#toggle-admin-label').val(); 930 }931 932 933 } else if (elementType === 'timeline') {934 elements = jQuery("#builder-elements>.timeline");935 items_array = '[';936 jQuery('#timeline_items > li').each(function(){937 if ( jQuery(this).index() + 1 < jQuery('#timeline_items > li').length ) { var comma = ','}else{var comma = ''};938 item_id = jQuery(this).find('[data-builder-name="item_id"]').val();939 item_image = jQuery(this).find('[data-role="media-url"]').val().replace(/"/g, '--quote--');940 item_text = jQuery(this).find('[data-builder-name="text"]').val().replace(/"/g, '--quote--').replace(/\r?\n/g, '<br />');941 item_title = jQuery(this).find('[data-builder-name="title"]').val().replace(/"/g, '--quote--');942 item_align = jQuery(this).find('[data-builder-name="align"]').val();943 item_effect = jQuery(this).find('[data-builder-name="effect"]').val();944 item_delay = jQuery(this).find('[data-builder-name="delay"]').val();945 items_array = items_array + '{"id":' + '"' + item_id + '"' + ',"image":' + '"' + item_image + '"' + ',"text":' + '"' + item_text + '"' + ',"title":' + '"' + item_title + '"' + ',"align":' + '"' + item_align + '"' + ',"effect":' + '"' + item_effect + '"' + ',"delay":' + '"' + item_delay + '"' + '}' + comma;946 947 });948 items_array = items_array + ']';949 jQuery('#timeline_content').val(items_array);950 dataAttr = {};951 dataAttr['timeline'] = elements.find('#timeline_content').val();952 953 dataAttr['element-type'] = 'timeline';954 dataAttr['admin-label'] = elements.find("#timeline-admin-label").val();955 if( elements.find('#timeline-admin-label').val().length > 0 ){956 elementName = elements.find('#timeline-admin-label').val(); 957 }958 959 960 } else if (elementType === 'banner') {961 elements = jQuery("#builder-elements>.banner");962 963 dataAttr = {};964 dataAttr['element-type'] = 'banner';965 dataAttr['banner-image'] = elements.find('#image-banner-url').val();966 dataAttr['banner-title'] = elements.find('#banner-title').val();967 dataAttr['banner-subtitle'] = elements.find('#banner-subtitle').val();968 dataAttr['banner-button-title'] = elements.find('#banner-button-title').val();969 dataAttr['banner-button-url'] = elements.find('#banner-button-url').val();970 dataAttr['banner-button-background'] = elements.find('#banner-button-background').val();971 dataAttr['banner-font-color'] = elements.find('#banner-font-color').val();972 dataAttr['banner-text-align'] = elements.find('#banner-text-align').val();973 dataAttr['banner-height'] = elements.find('#banner-height').val();974 dataAttr['admin-label'] = elements.find("#banner-admin-label").val();975 dataAttr['button-text-color'] = elements.find("#banner-button-text-color").val();976 if( elements.find('#banner-admin-label').val().length > 0 ){977 elementName = elements.find('#banner-admin-label').val(); 978 }979 980 } else if (elementType === 'map') {981 elements = jQuery("#builder-elements>.map");982 983 dataAttr = {};984 dataAttr['element-type'] = 'map';985 dataAttr['admin-label'] = elements.find("#map-admin-label").val();986 dataAttr['map-address'] = elements.find('#map-address').val();987 dataAttr['map-width'] = elements.find('#map-width').val();988 dataAttr['map-height'] = elements.find('#map-height').val();989 dataAttr['map-latitude'] = elements.find('#map-latitude').val();990 dataAttr['map-longitude'] = elements.find('#map-longitude').val();991 dataAttr['map-type'] = elements.find('#map-type').val();992 dataAttr['map-style'] = elements.find('#map-style').val();993 dataAttr['map-zoom'] = elements.find('#map-zoom').val();994 dataAttr['map-type-control'] = elements.find('#map-type-control').val();995 dataAttr['map-zoom-control'] = elements.find('#map-zoom-control').val();996 dataAttr['map-scale-control'] = elements.find('#map-scale-control').val();997 dataAttr['map-scroll-wheel'] = elements.find('#map-scroll-wheel').val();998 dataAttr['map-draggable-direction'] = elements.find('#map-draggable-direction').val();999 dataAttr['map-marker-icon'] = elements.find('#map-marker-icon').val();1000 dataAttr['map-marker-img'] = elements.find('#map-marker-attachment').val();1001 if( elements.find('#map-admin-label').val().length > 0 ){1002 elementName = elements.find('#map-admin-label').val(); 1003 }1004 setTimeout(function(){1005 initialize();1006 },100)1007 1008 } else if (elementType === 'counters') {1009 elements = jQuery("#builder-elements>.counters");1010 1011 dataAttr = {};1012 dataAttr['element-type'] = 'counters';1013 dataAttr['counters-text'] = elements.find('#counters-text').val();1014 if( !isNaN(elements.find('#counters-precents').val()) ) {1015 dataAttr['counters-precents'] = elements.find('#counters-precents').val();1016 }1017 dataAttr['admin-label'] = elements.find("#counters-admin-label").val();1018 dataAttr['counters-text-color'] = elements.find('#counters-text-color').val();1019 dataAttr['track-bar'] = elements.find('#counters-track-bar').val();1020 dataAttr['track-bar-color'] = elements.find('#counters-track-bar-color').val();1021 dataAttr['track-bar-icon'] = elements.find('#counters-icon').val();1022 dataAttr['effect'] = elements.find('#counters-special-effect').val();1023 dataAttr['delay'] = elements.find('#counters-delay').val();1024 if( elements.find('#counters-admin-label').val().length > 0 ){1025 elementName = elements.find('#counters-admin-label').val(); 1026 }1027 1028 } else if (elementType === 'alert') {1029 elements = jQuery("#builder-elements>.alert");1030 1031 dataAttr = {};1032 dataAttr['element-type'] = 'alert';1033 dataAttr['admin-label'] = elements.find("#alert-admin-label").val();1034 dataAttr['icon'] = elements.find('#alert-icon').val();1035 dataAttr['title'] = elements.find('#alert-title').val();1036 dataAttr['text'] = elements.find('#alert-text').val().replace(/\r?\n/g, '<br />');1037 dataAttr['background-color'] = elements.find('#alert-background-color').val();1038 dataAttr['text-color'] = elements.find('#alert-text-color').val();1039 if( elements.find('#alert-admin-label').val().length > 0 ){1040 elementName = elements.find('#alert-admin-label').val(); 1041 }1042 1043 } else if (elementType === 'spacer') {1044 elements = jQuery("#builder-elements>.spacer");1045 1046 dataAttr = {};1047 dataAttr['element-type'] = 'spacer';1048 dataAttr['height'] = elements.find('#spacer-height').val();1049 dataAttr['admin-label'] = elements.find("#spacer-admin-label").val();1050 if( elements.find('#spacer-admin-label').val().length > 0 ){1051 elementName = elements.find('#spacer-admin-label').val(); 1052 }1053 } else if (elementType === 'icon') {1054 elements = jQuery("#builder-elements>.icon");1055 1056 dataAttr = {};1057 dataAttr['element-type'] = 'icon';1058 dataAttr['icon'] = elements.find('#builder-element-icon').val();1059 dataAttr['icon-align'] = elements.find('#builder-element-icon-align').val();1060 dataAttr['icon-color'] = elements.find('#builder-element-icon-color').val();1061 dataAttr['icon-size'] = elements.find('#builder-element-icon-size').val();1062 dataAttr['admin-label'] = elements.find("#icon-admin-label").val();1063 if( elements.find('#icon-admin-label').val().length > 0 ){1064 elementName = elements.find('#icon-admin-label').val(); 1065 }1066 } else if (elementType === 'clients') {1067 elements = jQuery("#builder-elements>.clients");1068 items_array = '[';1069 jQuery('#clients_items > li').each(function(){1070 if ( jQuery(this).index() + 1 < jQuery('#clients_items > li').length ) { var comma = ','}else{var comma = ''};1071 item_image = jQuery(this).find('[data-role="media-url"]').val().replace(/"/g, '--quote--');1072 item_id = jQuery(this).find('[data-builder-name="item_id"]').val();1073 item_title = jQuery(this).find('[data-builder-name="title"]').val().replace(/"/g, '--quote--');1074 item_url = jQuery(this).find('[data-builder-name="url"]').val().replace(/"/g, '--quote--');1075 items_array = items_array + '{"id":' + '"' + item_id + '"' + ',"image":' + '"' + item_image + '"' + ',"title":' + '"' + item_title + '"' + ',"url":' + '"' + item_url + '"' + '}' + comma;1076 1077 });1078 items_array = items_array + ']';1079 jQuery('#clients_content').val(items_array);1080 dataAttr = {};1081 dataAttr['element-type'] = 'clients';1082 dataAttr['enable-carousel'] = elements.find('#clients-enable-carousel-y').attr('checked') ? 'y' : 'n';1083 dataAttr['elements-per-row'] = isNaN(parseInt(elements.find('#clients-row').val(), 10)) ? 3 : parseInt(elements.find('#clients-row').val(), 10);1084 1085 dataAttr['clients'] = elements.find('#clients_content').val();1086 dataAttr['admin-label'] = elements.find("#clients-admin-label").val();1087 if( elements.find('#clients-admin-label').val().length > 0 ){1088 elementName = elements.find('#clients-admin-label').val(); 1089 }1090 } else if (elementType === 'features-block') {1091 elements = jQuery("#builder-elements>.features-block");1092 items_array = '[';1093 jQuery('#features-block_items > li').each(function(){1094 if ( jQuery(this).index() + 1 < jQuery('#features-block_items > li').length ) { var comma = ','}else{var comma = ''};1095 item_icon = jQuery(this).find('[data-builder-name="icon"]').val();1096 item_title = jQuery(this).find('[data-builder-name="title"]').val().replace(/"/g, '--quote--');1097 item_text = jQuery(this).find('[data-builder-name="text"]').val().replace(/"/g, '--quote--').replace(/\r?\n/g, '<br />');1098 item_id = jQuery(this).find('[data-builder-name="item_id"]').val();1099 item_url = jQuery(this).find('[data-builder-name="url"]').val().replace(/"/g, '--quote--');1100 item_background = jQuery(this).find('[data-builder-name="background"]').val().replace(/"/g, '--quote--');1101 item_font = jQuery(this).find('[data-builder-name="font"]').val().replace(/"/g, '--quote--');1102 item_effect = jQuery(this).find('[data-builder-name="effect"]').val();1103 item_delay = jQuery(this).find('[data-builder-name="delay"]').val();1104 items_array = items_array + '{"id":' + '"' + item_id + '"' + ',"icon":' + '"' + item_icon + '"' + ',"title":' + '"' + item_title + '"' + ',"text":' + '"' + item_text + '"' + ',"url":' + '"' + item_url + '"' + ',"background":' + '"' + item_background + '"' + ',"font":' + '"' + item_font + '"' + ',"effect":' + '"' + item_effect + '"' + ',"delay":' + '"' + item_delay + '"' + '}' + comma;1105 1106 });1107 items_array = items_array + ']';1108 jQuery('#features-block_content').val(items_array);1109 dataAttr = {};1110 dataAttr['style'] = elements.find('#features-block-style').val();1111 dataAttr['elements-per-row'] = isNaN(parseInt(elements.find('#features-block-row').val(), 10)) ? 3 : parseInt(elements.find('#features-block-row').val(), 10);1112 dataAttr['element-type'] = 'features-block';1113 dataAttr['features-block'] = elements.find('#features-block_content').val();1114 dataAttr['admin-label'] = elements.find("#features-block-admin-label").val();1115 dataAttr['gutter'] = elements.find("#features-block-gutter").val();1116 if( elements.find('#features-block-admin-label').val().length > 0 ){1117 elementName = elements.find('#features-block-admin-label').val(); 1118 }1119 } else if (elementType === 'listed-features') {1120 elements = jQuery("#builder-elements>.listed-features");1121 items_array = '[';1122 jQuery('#listed-features_items > li').each(function(){1123 if ( jQuery(this).index() + 1 < jQuery('#listed-features_items > li').length ) { var comma = ','}else{var comma = ''};1124 item_icon = jQuery(this).find('[data-builder-name="icon"]').val();1125 item_title = jQuery(this).find('[data-builder-name="title"]').val().replace(/"/g, '--quote--');1126 item_text = jQuery(this).find('[data-builder-name="text"]').val().replace(/"/g, '--quote--').replace(/\r?\n/g, '<br />');1127 item_id = jQuery(this).find('[data-builder-name="item_id"]').val().replace(/"/g, '--quote--');1128 item_icon_color = jQuery(this).find('[data-builder-name="iconcolor"]').val().replace(/"/g, '--quote--');1129 item_border_color = jQuery(this).find('[data-builder-name="bordercolor"]').val().replace(/"/g, '--quote--');1130 item_background_color = jQuery(this).find('[data-builder-name="backgroundcolor"]').val().replace(/"/g, '--quote--');1131 item_url = jQuery(this).find('[data-builder-name="url"]').val().replace(/"/g, '--quote--');1132 items_array = items_array + '{"id":' + '"' + item_id + '"'+',"icon":' + '"' + item_icon + '"' + ',"title":' + '"' + item_title + '"' + ', "text":' + '"' + item_text + '"' + ',"iconcolor":' + '"' + item_icon_color + '"' + ',"bordercolor":' + '"' + item_border_color + '"' + ',"backgroundcolor":' + '"' + item_background_color + '"' + ',"url":' + '"' + item_url + '"' + '}' + comma;1133 });1134 items_array = items_array + ']';1135 jQuery('#listed-features_content').val(items_array);1136 dataAttr = {};1137 dataAttr['element-type'] = 'listed-features';1138 dataAttr['features'] = elements.find('#listed-features_content').val();1139 dataAttr['features-align'] = elements.find('#listed-features-align').val();1140 dataAttr['color-style'] = elements.find('#listed-features-color-style').val();1141 dataAttr['admin-label'] = elements.find("#listed-features-admin-label").val();1142 if( elements.find('#listed-features-admin-label').val().length > 0 ){1143 elementName = elements.find('#listed-features-admin-label').val(); 1144 }1145 } else if (elementType === 'page') {1146 elements = jQuery("#builder-elements>.page");1147 dataAttr = {};1148 dataAttr['element-type'] = 'page';1149 dataAttr['post-id'] = elements.find('input[name=pageID]:checked').val();1150 dataAttr['search'] = elements.find('#search-page').val();1151 dataAttr['criteria'] = elements.find('#search-page-criteria').val();1152 dataAttr['order-by'] = elements.find('#search-page-order-by').val();1153 dataAttr['direction'] = elements.find('#search-page-direction').val();1154 } else if (elementType === 'post') {1155 1156 elements = jQuery("#builder-elements>.post");1157 1158 dataAttr = {};1159 dataAttr['element-type'] = 'post';1160 dataAttr['post-id'] = elements.find('input[name=postID]:checked').val();1161 dataAttr['search'] = elements.find('#search-post').val();1162 dataAttr['criteria'] = elements.find('#search-post-criteria').val();1163 dataAttr['order-by'] = elements.find('#search-post-order-by').val();1164 dataAttr['direction'] = elements.find('#search-post-direction').val();1165 } else if (elementType === 'buttons') {1166 1167 var buttons = jQuery("#builder-elements>.buttons");1168 dataAttr = {};1169 dataAttr['element-type'] = 'buttons';1170 dataAttr['button-icon'] = buttons.find('#builder-element-button-icon').val();1171 dataAttr['text'] = buttons.find('#button-text').val();1172 dataAttr['icon-align'] = buttons.find('#button-icon-align').val();1173 dataAttr['size'] = buttons.find('#button-size').val();1174 dataAttr['target'] = buttons.find('#button-target').val();1175 dataAttr['text-color'] = buttons.find('#button-text-color').val();1176 dataAttr['bg-color'] = buttons.find('#button-background-color').val();1177 dataAttr['url'] = buttons.find('#button-url').val();1178 dataAttr['button-align'] = buttons.find('#button-align').val();1179 dataAttr['admin-label'] = buttons.find("#buttons-admin-label").val();1180 dataAttr['mode-display'] = buttons.find("#button-mode-display").val();1181 dataAttr['border-color'] = buttons.find('#button-border-color').val();1182 dataAttr['effect'] = buttons.find('#button-effect').val();1183 dataAttr['delay'] = buttons.find('#button-delay').val();1184 dataAttr['text-hover-color'] = buttons.find('#button-text-hover-color').val();1185 dataAttr['border-hover-color'] = buttons.find('#button-border-hover-color').val();1186 dataAttr['bg-hover-color'] = buttons.find('#button-background-hover-color').val();1187 if( buttons.find('#buttons-admin-label').val().length > 0 ){1188 elementName = buttons.find('#buttons-admin-label').val(); 1189 }1190 } else if (elementType === 'ribbon') {1191 1192 var ribbon = jQuery("#builder-elements>.ribbon");1193 dataAttr = {};1194 dataAttr['element-type'] = 'ribbon';1195 dataAttr['admin-label'] = ribbon.find("#ribbon-admin-label").val();1196 dataAttr['title'] = ribbon.find("#ribbon-title").val();1197 dataAttr['text'] = ribbon.find("#ribbon-text").val();1198 dataAttr['text-color'] = ribbon.find('#ribbon-text-color').val();1199 dataAttr['background'] = ribbon.find('#ribbon-background-color').val();1200 dataAttr['align'] = ribbon.find('#ribbon-align').val();1201 dataAttr['image'] = ribbon.find('#ribbon-attachment').val();1202 dataAttr['button-icon'] = ribbon.find('#builder-element-ribbon-icon').val();1203 dataAttr['button-text'] = ribbon.find('#ribbon-button-text').val();1204 dataAttr['button-size'] = ribbon.find('#ribbon-button-size').val();1205 dataAttr['button-target'] = ribbon.find('#ribbon-button-target').val();1206 dataAttr['button-background-color'] = ribbon.find('#ribbon-button-background-color').val();1207 dataAttr['button-url'] = ribbon.find('#ribbon-button-url').val();1208 dataAttr['button-align'] = ribbon.find('#ribbon-button-align').val();1209 dataAttr['button-mode-display'] = ribbon.find("#ribbon-button-mode-display").val();1210 dataAttr['button-border-color'] = ribbon.find('#ribbon-button-border-color').val();1211 dataAttr['button-text-color'] = ribbon.find('#ribbon-button-text-color').val();1212 if( ribbon.find('#ribbon-admin-label').val().length > 0 ){1213 elementName = ribbon.find('#ribbon-admin-label').val(); 1214 }1215 } else if (elementType === 'contact-form') {1216 var form = jQuery("#builder-elements>.contact-form");1217 dataAttr = {};1218 dataAttr['element-type'] = 'contact-form';1219 dataAttr['hide-icon'] = form.find('#contact-form-hide-icon').attr('checked') ? '1' : '0';1220 dataAttr['hide-subject'] = form.find('#contact-form-hide-subject').attr('checked') ? '1' : '0';1221 dataAttr['admin-label'] = form.find("#contact-form-admin-label").val();1222 items_array = '[';1223 jQuery('#contact-form_items > li').each(function(){1224 if ( jQuery(this).index() + 1 < jQuery('#contact-form_items > li').length ) { var comma = ','}else{var comma = ''};1225 item_id = jQuery(this).find('[data-builder-name="item_id"]').val();1226 item_title = jQuery(this).find('[data-builder-name="title"]').val().replace(/"/g, '--quote--');1227 item_type = jQuery(this).find('[data-builder-name="type"]').val().replace(/"/g, '--quote--');1228 item_require = jQuery(this).find('[data-builder-name="require"]').val().replace(/"/g, '--quote--');1229 item_options = jQuery(this).find('[data-builder-name="options"]').val().replace(/"/g, '--quote--');1230 1231 items_array = items_array + '{"id":' + '"' + item_id + '"' + ',"title":' + '"' + item_title + '"' + ',"type":' + '"' + item_type + '"' + ',"require":' + '"' + item_require + '"' + ',"options":' + '"' + item_options + '"' + '}' + comma;1232 1233 });1234 items_array = items_array + ']';1235 jQuery('#contact-form_content').val(items_array);1236 dataAttr['contact-form'] = form.find('#contact-form_content').val();1237 if( form.find('#contact-form-admin-label').val().length > 0 ){1238 elementName = form.find('#contact-form-admin-label').val(); 1239 }1240 } else if (elementType === 'featured-area') {1241 var featuredArea = jQuery("#builder-elements>.featured-area");1242 dataAttr = {};1243 dataAttr['element-type'] = 'featured-area';1244 postType = featuredArea.find("#featured-area-custom-post").val();1245 dataAttr['category'] = featuredArea.find("#featured-area-categories-" + postType).val();1246 1247 dataAttr['admin-label'] = featuredArea.find("#featured-area-admin-label").val();1248 dataAttr['custom-post'] = featuredArea.find("#featured-area-custom-post").val();1249 dataAttr['exclude-first'] = featuredArea.find("#featured-area-exclude-first").val();1250 dataAttr['order-by'] = featuredArea.find("#featured-area-order-by").val();1251 dataAttr['order-direction'] = featuredArea.find("#featured-area-order-direction").val();1252 dataAttr['play'] = featuredArea.find("#featured-area-play").val();1253 dataAttr['posts-per-page'] = featuredArea.find("#featured-area-posts-per-page").val();1254 if( featuredArea.find('#featured-area-admin-label').val().length > 0 ){1255 elementName = featuredArea.find('#featured-area-admin-label').val(); 1256 }1257 } else if (elementType === 'shortcodes') {1258 var shortcodes = jQuery("#builder-elements>.shortcodes");1259 dataAttr = {};1260 dataAttr['element-type'] = 'shortcodes';1261 dataAttr['shortcodes'] = shortcodes.find('#ts-shortcodes').val();1262 dataAttr['admin-label'] = shortcodes.find("#shortcodes-admin-label").val();1263 dataAttr['paddings'] = shortcodes.find("#shortcodes-paddings").val();1264 if( shortcodes.find('#shortcodes-admin-label').val().length > 0 ){1265 elementName = shortcodes.find('#shortcodes-admin-label').val(); 1266 }1267 } else if (elementType === 'text') {1268 var text = jQuery("#ts-builder-elements-modal-editor");1269 dataAttr = {};1270 dataAttr['element-type'] = 'text';1271 dataAttr['admin-label'] = text.find("#text-admin-label").val();1272 dataAttr['effect'] = text.find("#text-effect").val();1273 dataAttr['delay'] = text.find("#text-delay").val();1274 if( text.find('#text-admin-label').val().length > 0 ){1275 elementName = text.find('#text-admin-label').val(); 1276 }1277 1278 jQuery('#wp-ts_editor_id-wrap').find('#ts_editor_id-tmce').trigger('click');1279 dataAttr['text'] = tinymce.get('ts_editor_id').getContent().replace(/"/g, '--quote--');1280 setTimeout(function(){1281 tinymce.get('ts_editor_id').setContent('');1282 },500);1283 } else if (elementType === 'list-videos') {1284 1285 elements = jQuery("#builder-elements>.list-videos");1286 dataAttr = {};1287 dataAttr['element-type'] = 'list-videos';1288 dataAttr['category'] = elements.find('select#list-videos-category').val();1289 dataAttr['display-mode'] = elements.find('select#list-videos-display-mode').val();1290 dataAttr['id-exclude'] = elements.find('#list-videos-exclude').val();1291 dataAttr['exclude-first'] = elements.find('#list-videos-exclude-first').val();1292 dataAttr['admin-label'] = elements.find("#list-videos-admin-label").val();1293 dataAttr['featured'] = elements.find("#list-videos-featured").val();1294 dataAttr['play'] = elements.find("#list-videos-play").val();1295 if( elements.find('#list-videos-admin-label').val().length > 0 ){1296 elementName = elements.find('#list-videos-admin-label').val(); 1297 }1298 if (dataAttr['display-mode'] === 'grid') {1299 gridMode = elements.find("#list-videos-display-mode-options>.list-videos-grid");1300 dataAttr['behavior'] = gridMode.find('#list-videos-grid-behavior').val();1301 dataAttr['display-title'] = gridMode.find('#list-videos-grid-title').val();1302 dataAttr['show-meta'] = gridMode.find('#list-videos-grid-show-meta-y').attr('checked') ? 'y' : 'n';1303 dataAttr['elements-per-row'] = gridMode.find('#list-videos-grid-el-per-row').val();1304 dataAttr['posts-limit'] = gridMode.find('#list-videos-grid-el-per-row').val();1305 dataAttr['elements-per-row'] = gridMode.find('#list-videos-grid-el-per-row').val();1306 dataAttr['posts-limit'] = gridMode.find('#list-videos-grid-nr-of-posts').val();1307 dataAttr['order-by'] = gridMode.find('#list-videos-grid-order-by').val();1308 dataAttr['order-direction'] = gridMode.find('#list-videos-grid-order-direction').val();1309 dataAttr['special-effects'] = gridMode.find('#list-videos-grid-special-effects').val();1310 dataAttr['pagination'] = gridMode.find('#list-videos-grid-pagination').val();1311 dataAttr['related-posts'] = gridMode.find('#list-videos-grid-related').val();1312 dataAttr['show-image'] = gridMode.find('#list-videos-grid-image').val();1313 } else if (dataAttr['display-mode'] === 'list') {1314 listMode = elements.find("#list-videos-display-mode-options>.list-videos-list");1315 dataAttr['display-title'] = listMode.find('#list-videos-list-title').val();1316 dataAttr['show-meta'] = listMode.find('#list-videos-list-show-meta-y').attr('checked') ? 'y' : 'n';1317 dataAttr['posts-limit'] = listMode.find('#list-videos-list-nr-of-posts').val();1318 dataAttr['image-split'] = listMode.find('#list-videos-list-image-split').val();1319 dataAttr['content-split'] = listMode.find('#list-videos-list-content-split').val();1320 dataAttr['order-by'] = listMode.find('#list-videos-list-order-by').val();1321 dataAttr['order-direction'] = listMode.find('#list-videos-list-order-direction').val();1322 dataAttr['related-posts'] = listMode.find('#list-videos-list-show-related-y').attr('checked') ? 'y' : 'n';1323 dataAttr['special-effects'] = listMode.find('#list-videos-list-special-effects').val();1324 dataAttr['pagination'] = listMode.find('#list-videos-list-pagination').val();1325 dataAttr['show-image'] = listMode.find('#list-videos-list-image').val();1326 } else if (dataAttr['display-mode'] === 'thumbnails') {1327 thumbnailsMode = elements.find("#list-videos-display-mode-options>.list-videos-thumbnails");1328 dataAttr['display-title'] = thumbnailsMode.find('#list-videos-thumbnails-title').val();1329 dataAttr['behavior'] = thumbnailsMode.find('#list-videos-thumbnails-behavior').val();1330 dataAttr['elements-per-row'] = thumbnailsMode.find("#list-videos-thumbnail-posts-per-row").val();1331 dataAttr['posts-limit'] = thumbnailsMode.find("#list-videos-thumbnail-limit").val();1332 dataAttr['order-by'] = thumbnailsMode.find('#list-videos-thumbnail-order-by').val();1333 dataAttr['order-direction'] = thumbnailsMode.find('#list-videos-thumbnails-order-direction').val();1334 dataAttr['special-effects'] = thumbnailsMode.find('#list-videos-thumbnail-special-effects').val();1335 dataAttr['gutter'] = thumbnailsMode.find('#list-videos-thumbnail-gutter').val();1336 dataAttr['meta-thumbnail'] = thumbnailsMode.find('#list-videos-thumbnail-show-meta-y').attr('checked') ? 'y' : 'n';1337 dataAttr['pagination'] = thumbnailsMode.find('#list-videos-thumbnails-pagination').val();1338 } else if (dataAttr['display-mode'] === 'big-post') {1339 bigPostMode = elements.find("#list-videos-display-mode-options>.list-videos-big-post");1340 dataAttr['show-meta'] = bigPostMode.find('#list-videos-big-post-show-meta-y').attr('checked') ? 'y' : 'n';1341 dataAttr['posts-limit'] = bigPostMode.find('#list-videos-big-post-nr-of-posts').val();1342 dataAttr['image-split'] = bigPostMode.find('#list-videos-big-post-image-split').val();1343 dataAttr['order-by'] = bigPostMode.find('#list-videos-big-post-order-by').val();1344 dataAttr['order-direction'] = bigPostMode.find('#list-videos-big-post-order-direction').val();1345 dataAttr['related-posts'] = bigPostMode.find('#list-videos-big-post-related').val();1346 dataAttr['special-effects'] = bigPostMode.find('#list-videos-big-post-special-effects').val();1347 dataAttr['pagination'] = bigPostMode.find('#list-videos-big-post-pagination').val();1348 dataAttr['image-position'] = bigPostMode.find('#list-videos-big-post-image-position').val();1349 dataAttr['excerpt'] = bigPostMode.find('#list-videos-big-post-excerpt').val();1350 dataAttr['carousel'] = bigPostMode.find('#list-videos-big-post-carousel').val();1351 dataAttr['show-image'] = bigPostMode.find('#list-videos-big-post-image').val();1352 } else if (dataAttr['display-mode'] === 'timeline') {1353 timelineMode = elements.find("#list-videos-display-mode-options>.list-videos-timeline");1354 dataAttr['display-title'] = timelineMode.find('#list-videos-timeline-title').val();1355 dataAttr['show-meta'] = timelineMode.find('#list-videos-timeline-show-meta-y').attr('checked') ? 'y' : 'n';1356 dataAttr['posts-limit'] = timelineMode.find('#list-videos-timeline-post-limit').val();1357 dataAttr['image'] = timelineMode.find('#list-videos-timeline-image').val();1358 dataAttr['order-by'] = timelineMode.find('#list-videos-timeline-order-by').val();1359 dataAttr['order-direction'] = timelineMode.find('#list-videos-timeline-order-direction').val();1360 dataAttr['pagination'] = timelineMode.find('#list-videos-timeline-pagination').val();1361 } else if (dataAttr['display-mode'] === 'mosaic') {1362 mosaicMode = elements.find("#list-videos-display-mode-options>.list-videos-mosaic");1363 dataAttr['order-by'] = mosaicMode.find('#list-videos-mosaic-order-by').val();1364 dataAttr['order-direction'] = mosaicMode.find('#list-videos-mosaic-order-direction').val();1365 dataAttr['effects-scroll'] = mosaicMode.find('#list-videos-mosaic-effects').val();1366 dataAttr['gutter'] = mosaicMode.find('#list-videos-mosaic-gutter').val();1367 dataAttr['layout'] = mosaicMode.find('#list-videos-mosaic-layout').val();1368 dataAttr['rows'] = mosaicMode.find('#list-videos-mosaic-rows').val();1369 dataAttr['scroll'] = mosaicMode.find('#list-videos-mosaic-scroll').val();1370 dataAttr['pagination'] = mosaicMode.find('#list-videos-mosaic-pagination').val();1371 if( dataAttr['layout'] == 'rectangles' ){1372 dataAttr['posts-limit'] = mosaicMode.find("#list-videos-mosaic-post-limit-rows-" + dataAttr['rows'] + "").val();1373 }else{1374 dataAttr['posts-limit'] = mosaicMode.find("#list-videos-mosaic-post-limit-rows-squares").val();1375 }1376 } else if (dataAttr['display-mode'] === 'super-post') {1377 superPostMode = elements.find("#list-videos-display-mode-options>.list-videos-super-post");1378 dataAttr['elements-per-row'] = superPostMode.find("#list-videos-super-post-posts-per-row").val();1379 dataAttr['posts-limit'] = superPostMode.find('#list-videos-super-post-limit').val();1380 dataAttr['order-by'] = superPostMode.find('#list-videos-super-post-order-by').val();1381 dataAttr['order-direction'] = superPostMode.find('#list-videos-super-post-order-direction').val();1382 dataAttr['related-posts'] = superPostMode.find('#list-videos-super-post-show-related-y').attr('checked') ? 'y' : 'n';1383 dataAttr['special-effects'] = superPostMode.find('#list-videos-super-post-special-effects').val();1384 dataAttr['pagination'] = superPostMode.find('#list-videos-super-post-pagination').val();1385 }1386 } else if (elementType === 'events') {1387 1388 elements = jQuery("#builder-elements>.events");1389 dataAttr = {};1390 dataAttr['element-type'] = 'events';1391 dataAttr['admin-label'] = elements.find("#events-admin-label").val();1392 dataAttr['category'] = elements.find('select#events-category').val();1393 dataAttr['id-exclude'] = elements.find('#events-exclude').val();1394 dataAttr['exclude-first'] = elements.find('#events-exclude-first').val();1395 dataAttr['posts-limit'] = elements.find('#events-nr-of-posts').val();1396 dataAttr['order-by'] = elements.find('#events-order-by').val();1397 dataAttr['order-direction'] = elements.find('#events-order-direction').val();1398 dataAttr['special-effects'] = elements.find('#events-special-effects').val();1399 dataAttr['pagination'] = elements.find('#events-pagination').val();1400 if( elements.find('#events-admin-label').val().length > 0 ){1401 elementName = elements.find('#events-admin-label').val(); 1402 }1403 } else if (elementType === 'calendar') {1404 elements = jQuery("#builder-elements>.calendar");1405 1406 dataAttr = {};1407 dataAttr['element-type'] = 'calendar';1408 dataAttr['admin-label'] = elements.find("#calendar-admin-label").val();1409 dataAttr['size'] = elements.find("#calendar-size").val();1410 1411 if( elements.find('#calendar-admin-label').val().length > 0 ){1412 elementName = elements.find('#calendar-admin-label').val(); 1413 } 1414 1415 } else if (elementType === 'gallery') {1416 elements = jQuery("#builder-elements>.gallery");1417 1418 dataAttr = {};1419 dataAttr['element-type'] = 'gallery';1420 dataAttr['admin-label'] = elements.find("#gallery-admin-label").val();1421 dataAttr['images'] = elements.find("#gallery_image_gallery").val();1422 1423 if( elements.find('#gallery-admin-label').val().length > 0 ){1424 elementName = elements.find('#gallery-admin-label').val(); 1425 } 1426 1427 } else if (elementType === 'chart') {1428 dataAttr = {};1429 dataAttr['element-type'] = 'chart';1430 elements = jQuery("#builder-elements>.chart");1431 items_array = '[';1432 1433 jQuery('#chart_line_items > li').each(function(){1434 if ( jQuery(this).index() + 1 < jQuery('#chart_line_items > li').length ) { var comma = ','}else{var comma = ''};1435 item_id = jQuery(this).find('[data-option-name="item_id"]').val();1436 item_title = jQuery(this).find('[data-option-name="title"]').val().replace(/"/g, '--quote--');1437 item_fillColor = jQuery(this).find('[data-option-name="fillColor"]').val().replace(/"/g, '--quote--');1438 item_strokeColor = jQuery(this).find('[data-option-name="strokeColor"]').val().replace(/"/g, '--quote--');1439 item_pointColor = jQuery(this).find('[data-option-name="pointColor"]').val().replace(/"/g, '--quote--');1440 item_pointStrokeColor = jQuery(this).find('[data-option-name="pointStrokeColor"]').val().replace(/"/g, '--quote--');1441 item_pointHighlightFill = jQuery(this).find('[data-option-name="pointHighlightFill"]').val().replace(/"/g, '--quote--');1442 item_pointHighlightStroke = jQuery(this).find('[data-option-name="pointHighlightStroke"]').val().replace(/"/g, '--quote--');1443 item_data = jQuery(this).find('[data-option-name="data"]').val().replace(/"/g, '--quote--');1444 items_array = items_array + '{"id":' + '"' + item_id + '"' + ',"title":' + '"' + item_title + '"' + ',"fillColor":' + '"' + item_fillColor + '"' + ',"strokeColor":' + '"' + item_strokeColor + '"' + ',"pointColor":' + '"' + item_pointColor + '"' + ',"pointStrokeColor":' + '"' + item_pointStrokeColor + '"' + ',"pointHighlightFill":' + '"' + item_pointHighlightFill + '"' + ',"pointHighlightStroke":' + '"' + item_pointHighlightStroke + '"' + ',"data":' + '"' + item_data + '"' + '}' + comma;1445 1446 });1447 items_array = items_array + ']';1448 jQuery('#chart_line_content').val(items_array);1449 dataAttr['chart_line'] = elements.find('#chart_line_content').val();1450 items_array = '[';1451 1452 jQuery('#chart_pie_items > li').each(function(){1453 if ( jQuery(this).index() + 1 < jQuery('#chart_pie_items > li').length ) { var comma = ','}else{var comma = ''};1454 item_id = jQuery(this).find('[data-option-name="item_id"]').val();1455 item_title = jQuery(this).find('[data-option-name="title"]').val().replace(/"/g, '--quote--');1456 item_value = jQuery(this).find('[data-option-name="value"]').val().replace(/"/g, '--quote--');1457 item_color = jQuery(this).find('[data-option-name="color"]').val().replace(/"/g, '--quote--');1458 item_highlight = jQuery(this).find('[data-option-name="highlight"]').val().replace(/"/g, '--quote--');1459 items_array = items_array + '{"id":' + '"' + item_id + '"' + ',"title":' + '"' + item_title + '"' + ',"value":' + '"' + item_value + '"' + ',"color":' + '"' + item_color + '"' + ',"highlight":' + '"' + item_highlight + '"' + '}' + comma;1460 1461 });1462 items_array = items_array + ']';1463 jQuery('#chart_pie_content').val(items_array);1464 dataAttr['chart_pie'] = elements.find('#chart_pie_content').val();1465 dataAttr['admin-label'] = elements.find('#chart-admin-label').val();1466 dataAttr['mode'] = elements.find('#chart-mode').val();1467 dataAttr['title'] = elements.find('#chart-title').val();1468 dataAttr['label'] = elements.find('#chart-label').val();1469 dataAttr['scaleShowGridLines'] = elements.find('#chart-scaleShowGridLines').val();1470 dataAttr['scaleGridLineColor'] = elements.find('#chart-scaleGridLineColor').val();1471 dataAttr['scaleGridLineWidth'] = elements.find('#chart-scaleGridLineWidth').val();1472 dataAttr['scaleShowHorizontalLines'] = elements.find('#chart-scaleShowHorizontalLines').val();1473 dataAttr['scaleShowVerticalLines'] = elements.find('#chart-scaleShowVerticalLines').val();1474 dataAttr['bezierCurve'] = elements.find('#chart-bezierCurve').val();1475 dataAttr['bezierCurveTension'] = elements.find('#chart-bezierCurveTension').val();1476 dataAttr['pointDot'] = elements.find('#chart-pointDot').val();1477 dataAttr['pointDotRadius'] = elements.find('#chart-pointDotRadius').val();1478 dataAttr['pointDotStrokeWidth'] = elements.find('#chart-pointDotStrokeWidth').val();1479 dataAttr['pointHitDetectionRadius'] = elements.find('#chart-pointHitDetectionRadius').val();1480 dataAttr['datasetStroke'] = elements.find('#chart-datasetStroke').val();1481 dataAttr['datasetStrokeWidth'] = elements.find('#chart-datasetStrokeWidth').val();1482 dataAttr['datasetFill'] = elements.find('#chart-datasetFill').val();1483 dataAttr['scaleShowLabelBackdrop'] = elements.find('#chart-scaleShowLabelBackdrop').val();1484 dataAttr['segmentShowStroke'] = elements.find('#chart-segmentShowStroke').val();1485 dataAttr['segmentStrokeColor'] = elements.find('#chart-segmentStrokeColor').val();1486 dataAttr['segmentStrokeWidth'] = elements.find('#chart-segmentStrokeWidth').val();1487 dataAttr['percentageInnerCutout'] = elements.find('#chart-percentageInnerCutout').val();1488 dataAttr['animationSteps'] = elements.find('#chart-animationSteps').val();1489 dataAttr['animateRotate'] = elements.find('#chart-animateRotate').val();1490 dataAttr['animateScale'] = elements.find('#chart-animateScale').val();1491 if( elements.find('#chart-admin-label').val().length > 0 ){1492 elementName = elements.find('#chart-admin-label').val(); 1493 }1494 1495 } else {1496 dataAttr = {};1497 }1498 removePreviousOptions(currentEditedElement);1499 1500 jQuery.each(dataAttr, function(attr, value) {1501 currentEditedElement.attr('data-' + attr, value);1502 });1503 currentEditedElement.find(".element-name").text(elementName);1504 currentEditedElement.find('.element-icon').attr('class', 'element-icon ' + element_icon(dataAttr['element-type']));1505 1506 });1507 1508 jQuery(document).on('click', 'input#builder-save', function(event){1509 elementType = jQuery('#builder-elements').attr('data-element-type');1510 if( elementType == 'list-portfolios' ||1511 elementType == 'last-posts' || 1512 elementType == 'pricing-tables' || 1513 elementType == 'list-videos' || 1514 elementType == 'latest-custom-posts' || 1515 elementType == 'events' || 1516 elementType == 'accordion' || 1517 elementType == 'list-galleries' || 1518 elementType == 'filters' ){1519 1520 var selectedValue = false;1521 1522 jQuery('.' + elementType).find('select.ts-custom-select-input').each(function(){1523 var inputId = jQuery(this).attr('id');1524 if( inputId !== 'latest-custom-posts-type' && jQuery.isArray(jQuery(this).val()) ){1525 selectedValue = true;1526 }1527 });1528 if( selectedValue == false ){1529 noty({1530 layout: 'bottomCenter',1531 type: 'error',1532 timeout: 4000,1533 text: 'No category has been selected !'1534 });1535 }else{1536 jQuery('#ts-builder-elements-modal button.close').trigger('click');1537 }1538 }else{1539 jQuery('#ts-builder-elements-modal button.close').trigger('click'); 1540 }1541 });1542 function removePreviousOptions (element) {1543 var elementType = element.attr('data-element-type'),1544 attributes;1545 if (elementType === 'logo') {1546 attributes = ['element-type', 'logo-align'];1547 } else if (elementType === 'featured-article') {1548 attributes = ['element-type', 'featured-article', 'title'];1549 1550 } else if (elementType === 'user') {1551 attributes = ['element-type', 'align'];1552 1553 } else if (elementType === 'social-buttons') {1554 attributes = ['element-type', 'social-settings', 'social-align', 'social-style' ,'admin-label', 'showMeta', 'showImage'];1555 1556 } else if (elementType === 'cart') {1557 attributes = ['element-type', 'cart-align'];1558 } else if (elementType === 'breadcrumbs') {1559 attributes = ['element-type'];1560 1561 } else if (elementType === 'searchbox') {1562 attributes = ['element-type', 'align', 'design'];1563 1564 } else if (elementType === 'menu') {1565 attributes = ['element-type', 'element-style', 'name', 'menu-custom', 'menu-bg-color', 'menu-bg-color-hover', 'menu-text-color', 'menu-text-color-hover', 'submenu-bg-color', 'submenu-text-color-hover', 'submenu-bg-color-hover', 'submenu-text-color', 'menu-text-align', 'admin-label', 'uppercase', 'icons', 'description', 'font-type', 'font-name', 'font-subsets', 'font-weight', 'font-style', 'font-size', 'font-demo'];1566 1567 } else if (elementType === 'sidebar') {1568 attributes = ['element-type', 'sidebar-id', 'sidebar-sticky'];1569 } else if (elementType === 'boca' || elementType === 'nona') {1570 attributes = ['element-type', 'custom-post', 'category', 'orderby', 'admin-label', 'order', 'featured', 'posts_per_page'];1571 } else if (elementType === 'slider') {1572 attributes = ['element-type', 'slider-id'];1573 } else if (elementType === 'list-portfolios') {1574 attributes = ['element-type', 'category', 'display-mode', 'enable-carousel', 'display-title', 'show-meta', 'elements-per-row', 'posts-limit', 'order-by', 'order-direction', 'image-split', 'content-split', 'related-posts', 'show-label', 'special-effects', 'gutter', 'admin-label', 'admin-label', 'effects-scroll', 'layout', 'rows', 'scroll', 'pagination'];1575 } else if (elementType === 'list-products') {1576 attributes = ['element-type', 'category', 'behavior', 'elements-per-row', 'posts-limit', 'order-by', 'order-direction', 'special-effects', 'gutter', 'admin-label'];1577 } else if (elementType === 'last-posts') {1578 attributes = ['element-type', 'category', 'display-mode', 'behavior', 'display-title', 'show-meta', 'elements-per-row', 'posts-limit', 'order-by', 'order-direction', 'image-split', 'content-split', 'related-posts', 'show-label', 'special-effects', 'gutter', 'id-exclude', 'exclude-first', 'meta-thumbnail', 'pagination', 'admin-label', 'image', 'scroll', 'rows', 'effects-scroll', 'layout', 'featured', 'image-position', 'excerpt', 'carousel', 'show-image'];1579 } else if (elementType === 'list-galleries') {1580 attributes = ['element-type', 'category', 'display-mode', 'behavior', 'display-title', 'show-meta', 'elements-per-row', 'posts-limit', 'order-by', 'order-direction', 'image-split', 'content-split', 'related-posts', 'show-label', 'special-effects', 'gutter', 'id-exclude', 'exclude-first', 'meta-thumbnail', 'pagination', 'admin-label', 'image', 'scroll', 'rows', 'effects-scroll', 'layout', 'featured', 'image-position', 'excerpt', 'carousel', 'show-image'];1581 } else if (elementType === 'latest-custom-posts') {1582 attributes = ['element-type', 'post-type', 'category', 'display-mode', 'behavior', 'display-title', 'show-meta', 'elements-per-row', 'posts-limit', 'order-by', 'order-direction', 'image-split', 'content-split', 'related-posts', 'show-label', 'special-effects', 'gutter', 'id-exclude', 'exclude-first', 'meta-thumbnail', 'pagination', 'admin-label', 'image', 'scroll', 'rows', 'effects-scroll', 'layout', 'featured', 'excerpt', 'carousel', 'show-image'];1583 } else if (elementType === 'callaction') {1584 attributes = ['element-type', 'callaction-text', 'callaction-link', 'callaction-button-text', 'admin-label'];1585 } else if (elementType === 'accordion') {1586 attributes = ['element-type', 'admin-label', 'category', 'featured', 'order-by', 'order-direction', 'nr-of-posts', 'posts-type'];1587 } else if (elementType === 'image-carousel') {1588 attributes = ['element-type', 'images', 'carousel-height', 'admin-label'];1589 } else if (elementType === 'teams') {1590 attributes = ['element-type', 'elements-per-row', 'posts-limit', 'remove-gutter', 'enable-carousel', 'admin-label', 'effect', 'delay'];1591 } else if (elementType === 'pricing-tables') {1592 attributes = ['element-type', 'elements-per-row', 'posts-limit', 'remove-gutter', 'admin-label', 'effect', 'delay'];1593 } else if (elementType === 'advertising') {1594 attributes = ['element-type', 'advertising', 'admin-label'];1595 } else if (elementType === 'empty') {1596 attributes = ['element-type'];1597 } else if (elementType === 'delimiter') {1598 attributes = ['element-type', 'delimiter-type', 'delimiter-color', 'admin-label'];1599 } else if (elementType === 'title') {1600 attributes = ['title-icon', 'element-type', 'title', 'subtitle', 'style', 'size', 'admin-label', 'target', 'link', 'effect', 'delay', 'letter-spacer'];1601 } else if (elementType === 'video') {1602 attributes = ['element-type', 'embed', 'admin-label', 'lightbox', 'title'];1603 } else if (elementType === 'icon') {1604 attributes = ['element-type', 'icon', 'icon-size', 'icon-color', 'icon-align', 'admin-label'];1605 } else if (elementType === 'clients') {1606 attributes = ['element-type', 'clients', 'enable-carousel', 'elements-per-row', 'admin-label'];1607 } else if (elementType === 'features-block') {1608 attributes = ['element-type', 'features-block', 'elements-per-row', 'style', 'admin-label' ,'gutter'];1609 } else if (elementType === 'listed-features') {1610 attributes = ['element-type', 'features', 'features-align', 'color-style', 'admin-label'];1611 } else if (elementType === 'facebook-block') {1612 attributes = ['element-type', 'facebook-url', 'cover'];1613 } else if (elementType === 'image') {1614 attributes = ['element-type', 'image-url', 'image-target', 'forward-url', 'admin-label', 'retina', 'align', 'effect', 'delay'];1615 } else if (elementType === 'instance') {1616 attributes = ['element-type', 'image', 'button-target', 'button-url', 'button-text', 'admin-label', 'content', 'align', 'title'];1617 } else if (elementType === 'powerlink') {1618 attributes = ['element-type', 'image', 'button-text', 'button-title', 'admin-label', 'title'];1619 } else if (elementType === 'filters') {1620 attributes = ['element-type', 'categories', 'posts-limit', 'elements-per-row', 'order-by', 'direction', 'admin-label', 'meta-thumbnail'];1621 } else if (elementType === 'spacer') {1622 attributes = ['element-type', 'height', 'admin-label'];1623 } else if (elementType === 'counters') {1624 attributes = ['element-type', 'counters-text', 'counters-precents', 'counters-text-color', 'admin-label', 'track-bar-color', 'track-bar', 'track-bar-icon', 'effect', 'delay'];1625 } else if (elementType === 'alert') {1626 attributes = ['element-type', 'admin-label', 'icon', 'title', 'text', 'background-color', 'text-color'];1627 } else if (elementType === 'page') {1628 attributes = ['element-type', 'post-id', 'search', 'criteria', 'order-by', 'direction'];1629 } else if (elementType === 'post') {1630 1631 attributes = ['element-type', 'post-id', 'search', 'criteria', 'order-by', 'direction'];1632 } else if (elementType === 'timeline') {1633 1634 attributes = ['element-type', 'admin-label', 'timeline'];1635 } else if (elementType === 'toggle') {1636 1637 attributes = ['element-type', 'admin-label', 'toggle-title', 'toggle-description', 'toggle-state', 'align-image'];1638 } else if (elementType === 'buttons') {1639 1640 attributes = ['element-type', 'button-icon', 'text', 'icon-align', 'size', 'target', 'text-color', 'bg-color', 'url', 'button-align', 'admin-label', 'mode-display', 'border-color', 'effect', 'delay', 'text-hover-color', 'border-hover-color', 'bg-hover-color'];1641 } else if (elementType === 'ribbon') {1642 1643 attributes = ['element-type', 'text', 'title', 'background', 'align', 'button-icon', 'button-text', 'button-size', 'button-target', 'text-color', 'button-background-color', 'button-url', 'button-button-align', 'admin-label', 'button-mode-display', 'button-border-color', 'image', 'button-text-color'];1644 } else if (elementType === 'contact-form') {1645 1646 attributes = ['element-type', 'hide-icon', 'hide-subject', 'admin-label', 'contact-form'];1647 } else if (elementType === 'featured-area') {1648 1649 attributes = ['element-type', 'category', 'exclude-first', 'admin-label', 'custom-post', 'order-by', 'order-direction', 'play', 'posts-per-page'];1650 } else if (elementType === 'shortcodes') {1651 1652 attributes = ['element-type', 'shortcodes', 'admin-label', 'paddings'];1653 } else if (elementType === 'tab') {1654 1655 attributes = ['element-type', 'admin-label', 'tab', 'mode'];1656 } else if (elementType === 'video-carousel') {1657 1658 attributes = ['element-type', 'admin-label', 'video-carousel', 'source'];1659 } else if (elementType === 'count-down') {1660 1661 attributes = ['element-type', 'admin-label', 'title', 'date', 'hours', 'style'];1662 } else if (elementType === 'testimonials') {1663 1664 attributes = ['element-type', 'testimonials', 'elements-per-row', 'enable-carousel', 'admin-label'];1665 } else if (elementType === 'map') {1666 1667 attributes = ['element-type', 'map-address', 'map-width', 'map-height', 'map-longitude', 'map-latitude', 'map-type', 'map-style', 1668 'map-zoom', 'map-type-control', 'map-zoom-control', 'map-scale-control', 'map-scroll-wheel', 1669 'map-draggable-direction', 'map-marker-icon', 'map-marker-img', 'admin-label'];1670 } else if (elementType === 'banner') {1671 1672 attributes = ['element-type', 'banner-image', 'banner-title', 'banner-subtitle', 'banner-button-title', 'banner-button-url', 'banner-button-background', 'banner-font-color', 'banner-text-align', 'banner-height', 'admin-label', 'button-text-color'];1673 } else if (elementType === 'text') {1674 1675 attributes = ['element-type', 'text', 'admin-label', 'effect'];1676 } else if (elementType === 'list-videos') {1677 attributes = ['element-type', 'category', 'display-mode', 'behavior', 'display-title', 'show-meta', 'elements-per-row', 'posts-limit', 'order-by', 'order-direction', 'image-split', 'content-split', 'related-posts', 'show-label', 'special-effects', 'gutter', 'id-exclude', 'exclude-first', 'meta-thumbnail', 'pagination', 'admin-label', 'image', 'scroll', 'rows', 'effects-scroll', 'layout', 'excerpt', 'carousel', 'show-image', 'play'];1678 } else if (elementType === 'events') {1679 attributes = ['element-type', 'category', 'posts-limit', 'order-by', 'order-direction', 'special-effects', 'id-exclude', 'exclude-first', 'pagination', 'admin-label'];1680 } else if (elementType === 'calendar') {1681 1682 attributes = ['element-type', 'admin-label', 'size'];1683 } else if (elementType === 'gallery') {1684 1685 attributes = ['element-type', 'admin-label', 'images'];1686 } else if (elementType === 'skills') {1687 1688 attributes = ['element-type', 'admin-label', 'display-mode', 'skills'];1689 } else if (elementType === 'chart') {1690 attributes = ['element-type', 'admin-label', 'mode', 'label', 'title', 'scaleShowGridLines', 'scaleGridLineColor', 'scaleGridLineWidth', 'scaleShowHorizontalLines', 'scaleShowVerticalLines', 'bezierCurve', 'bezierCurveTension', 'pointDot', 'pointDotRadius', 'pointDotStrokeWidth', 'pointHitDetectionRadius', 'datasetStroke', 'datasetStrokeWidth', 'datasetFill', 'chart_line', 'segmentShowStroke', 'segmentStrokeColor', 'segmentStrokeWidth', 'percentageInnerCutout', 'animationSteps', 'animateRotate', 'animateScale', 'chart_pie'];1691 1692 } else {1693 attributes = [];1694 }1695 if( !jQuery.isEmptyObject(attributes) ) {1696 jQuery.each(attributes, function(index, attribute) {1697 element.removeAttr('data-' + attribute);1698 });1699 }1700 }1701 jQuery(document).on('click', '#last-posts-display-mode-selector li img', function(e){1702 var mode_display = jQuery(this).attr('data-option');1703 ts_show_post_exclude_first('last-posts', mode_display);1704 jQuery('#last-posts-' + mode_display + '-order-direction option[value=desc]').attr({'selected':'selected'});1705 });1706 jQuery(document).on('click', '#list-galleries-display-mode-selector li img', function(e){1707 var mode_display = jQuery(this).attr('data-option');1708 ts_show_post_exclude_first('list-galleries', mode_display);1709 jQuery('#list-galleries-' + mode_display + '-order-direction option[value=desc]').attr({'selected':'selected'});1710 }); 1711 jQuery(document).on('click', '#latest-custom-posts-display-mode-selector li img', function(e){1712 var mode_display = jQuery(this).attr('data-option');1713 ts_show_post_exclude_first('latest-custom-posts', mode_display);1714 jQuery('#latest-custom-posts-' + mode_display + '-order-direction option[value=desc]').attr({'selected':'selected'});1715 }); 1716 jQuery(document).on('click', '[data-value="list-videos"]', function(e){1717 display_mode = jQuery('#list-videos-display-mode-selector').find('li.selected img').attr('data-option');1718 ts_show_post_exclude_first('list-videos', display_mode);1719 }); 1720 jQuery(document).on('click', '[data-value="last-posts"]', function(e){1721 display_mode = jQuery('#last-posts-display-mode-selector').find('li.selected img').attr('data-option');1722 ts_show_post_exclude_first('last-posts', display_mode);1723 });1724 jQuery(document).on('click', '[data-value="list-galleries"]', function(e){1725 display_mode = jQuery('#list-galleries-display-mode-selector').find('li.selected img').attr('data-option');1726 ts_show_post_exclude_first('list-galleries', display_mode);1727 });1728 jQuery(document).on('click', '[data-value="latest-custom-posts"]', function(e){1729 display_mode = jQuery('#latest-custom-posts-display-mode-selector').find('li.selected img').attr('data-option');1730 ts_show_post_exclude_first('latest-custom-posts', display_mode);1731 });1732 jQuery(document).on('click', '#list-videos-display-mode-selector li img', function(e){1733 var mode_display = jQuery(this).attr('data-option');1734 ts_show_post_exclude_first('list-videos', mode_display);1735 jQuery('#list-videos-' + mode_display + '-order-direction option[value=desc]').attr({'selected':'selected'});1736 });1737});1738jQuery(document).on('change', '.ts-mosaic-layout', function(e){1739 if( jQuery(this).val() == 'rectangles' ){1740 jQuery(this).closest('table').find('.ts-mosaic-post-limit-squares').css('display', 'none');1741 jQuery(this).closest('table').find('.ts-mosaic-rows').closest('tr').css('display', '');1742 if( jQuery(this).closest('table').find('.ts-mosaic-rows').val() == '2' ){1743 jQuery(this).closest('table').find('.ts-mosaic-post-limit-rows-2').css('display', '');1744 jQuery(this).closest('table').find('.ts-mosaic-post-limit-rows-3').css('display', 'none');1745 }else{1746 jQuery(this).closest('table').find('.ts-mosaic-post-limit-rows-3').css('display', '');1747 jQuery(this).closest('table').find('.ts-mosaic-post-limit-rows-2').css('display', 'none');1748 }1749 }else{1750 jQuery(this).closest('table').find('.ts-mosaic-post-limit-squares').css('display', '');1751 jQuery(this).closest('table').find('.ts-mosaic-post-limit-rows-3').css('display', 'none');1752 jQuery(this).closest('table').find('.ts-mosaic-post-limit-rows-2').css('display', 'none');1753 jQuery(this).closest('table').find('.ts-mosaic-rows').closest('tr').css('display', 'none');1754 }1755});1756jQuery(document).on('change', '.ts-mosaic-rows', function(e){1757 jQuery(this).closest('table').find('.ts-mosaic-post-limit-squares').css('display', 'none');1758 if( jQuery(this).val() == '2' ){1759 jQuery(this).closest('table').find('.ts-mosaic-post-limit-rows-2').css('display', '');1760 jQuery(this).closest('table').find('.ts-mosaic-post-limit-rows-3').css('display', 'none');1761 }else{1762 jQuery(this).closest('table').find('.ts-mosaic-post-limit-rows-3').css('display', '');1763 jQuery(this).closest('table').find('.ts-mosaic-post-limit-rows-2').css('display', 'none');1764 }1765});1766jQuery(document).on('change', '#filters-post-type', function(e){1767 var customPost = jQuery(this).val();1768 jQuery(this).find('option').each(function(){1769 jQuery('#' + jQuery(this).val() + '-categories').addClass('hidden');1770 jQuery('#' + jQuery(this).val() + '-categories').find('li.select2-search-choice').remove();1771 jQuery('#' + jQuery(this).val() + '-categories').find('option').removeAttr('selected');1772 });1773 jQuery('#' + customPost + '-categories').removeClass('hidden');1774});1775jQuery(document).on('change', '#accordion-posts-type', function(e){1776 jQuery('.ts-accordion-category').each(function(){1777 jQuery(this).addClass('hidden');1778 });1779 jQuery('.ts-accordion-category option').removeAttr('selected');1780 jQuery('.ts-custom-select-input li.select2-search-choice').remove();1781 jQuery('.ts-accordion-category-' + jQuery(this).val()).removeClass('hidden');1782});1783jQuery(document).on('change', '.ts-select-animation select', function(){1784 if( jQuery(this).val() !== 'none' ){1785 jQuery(this).closest('table').find('.ts-select-delay').css('display', '');1786 }else{1787 jQuery(this).closest('table').find('.ts-select-delay').css('display', 'none');1788 }1789});1790jQuery(document).on('change', '#video-lightbox', function(){1791 if( jQuery(this).val() == 'n' ){1792 jQuery('.ts-video-title').css('display', 'none');1793 }else{1794 jQuery('.ts-video-title').css('display', '');1795 }1796});1797jQuery(document).on('change', '.contact-form-type', function(){1798 if( jQuery(this).val() == 'select' ){1799 jQuery(this).parent().parent().parent().find('.contact-form-options').css('display','');1800 }else{1801 jQuery(this).parent().parent().parent().find('.contact-form-options').css('display','none');1802 }1803});1804function tsToggleOptionsCustomPost(elem) {1805 jQuery(document).on('change', '#'+ elem +'-custom-post', function(){1806 if( jQuery(this).val() == 'video' ){1807 jQuery('.select2-choices li:not(.select2-search-field)').remove();1808 jQuery('.'+ elem +'-ts-gallery').css('display','none').find('option').removeAttr('selected');1809 jQuery('.'+ elem +'-post').css('display','none').find('option').removeAttr('selected');1810 jQuery('.'+ elem +'-video').css('display','');1811 }else if( jQuery(this).val() == 'ts-gallery' ){1812 jQuery('.select2-choices li:not(.select2-search-field)').remove();1813 jQuery('.'+ elem +'-post').css('display','none').find('option').removeAttr('selected');1814 jQuery('.'+ elem +'-video').css('display','none').find('option').removeAttr('selected');1815 jQuery('.'+ elem +'-ts-gallery').css('display','');1816 }else if( jQuery(this).val() == 'post' ){1817 jQuery('.select2-choices li:not(.select2-search-field)').remove();1818 jQuery('.'+ elem +'-post').css('display','');1819 jQuery('.'+ elem +'-video').css('display','none').find('option').removeAttr('selected');1820 jQuery('.'+ elem +'-ts-gallery').css('display','none').find('option').removeAttr('selected');1821 }1822 });1823}1824tsToggleOptionsCustomPost('featured-area');1825tsToggleOptionsCustomPost('boca');1826tsToggleOptionsCustomPost('nona');1827jQuery(document).on('change', '#counters-track-bar', function(){1828 if( jQuery(this).val() == 'with-track-bar' ){1829 jQuery('.ts-counters-track-bar-color').css('display', '');1830 jQuery('.ts-counters-icons').css('display', 'none');1831 }else{1832 jQuery('.ts-counters-track-bar-color').css('display', 'none');1833 jQuery('.ts-counters-icons').css('display', '');1834 }1835});1836jQuery(document).on('change', '#video-carousel-source', function(){1837 if( jQuery(this).val() == "custom-slides" ){1838 jQuery(".ts-video-carousel-custom").css("display", "");1839 }else{1840 jQuery(".ts-video-carousel-custom").css("display", "none");1841 }1842});1843jQuery(document).on('change', '#chart-mode', function(){1844 if( jQuery(this).val() == 'pie' ){1845 jQuery('.chart-line-options').css('display', 'none');1846 jQuery('.chart-pie-options').css('display', '');1847 }else{1848 jQuery('.chart-line-options').css('display', '');1849 jQuery('.chart-pie-options').css('display', 'none');1850 }1851});1852// search post and pages1853jQuery(document).on('click', '.search-posts-buttons', function(event) {1854 event.preventDefault();1855 var search,1856 serverResponse = '';1857 search = jQuery('#featured-article-search-post').val();1858 jQuery.post(ajaxurl + '?action=vdf_search_content', {1859 search: search1860 1861 }).done(function(data) {1862 if (data.length) {1863 var checked = '';1864 jQuery.each(data, function(index, post) {1865 1866 checked = (window.rtSelectPostInSearchResults == post.id ) ? 'checked="checked"' : '';1867 1868 serverResponse += '<tr><td><input id="postID-' + post.id + '" type="radio" name="postID" value="' + post.id + '" ' + checked + '/></td><td><label for="postID-' + post.id + '">' + post.title + '</label></td></tr>';1869 });1870 } else {1871 serverResponse = 'No posts found.';1872 }1873 }).fail(function(){1874 serverResponse = 'Error. Please try again!';1875 }).always(function(){1876 jQuery('#search-text-results').css('display', '');1877 jQuery('#search-posts-results').html(serverResponse);1878 });...
lgx-owl-carousel-public.js
Source:lgx-owl-carousel-public.js
1(function() {2 'use strict';3 /**4 * All of the code for your public-facing JavaScript source5 * should reside in this file.6 *7 * Note: It has been assumed you will write jQuery code here, so the8 * $ function reference has been prepared for usage within the scope9 * of this function.10 *11 * This enables you to define handlers, for when the DOM is ready:12 *13 * $(function() {14 *15 * });16 *17 * When the window is loaded:18 *19 * $( window ).load(function() {20 *21 * });22 *23 * ...and/or other possibilities.24 *25 * Ideally, it is not considered best practise to attach more than a26 * single DOM-ready or window-load handler for a particular page.27 * Although scripts in the WordPress core, Plugins and Themes may be28 * practising this, we should strive to set a better example in our own work.29 */30 jQuery(document).ready(function($) {31 $('.lgx-carousel').each(function(){32 var $item = $(this);33 var dataAttr = $item.data();34 //console.log(dataAttr.navlarge);35 var carouselParams = {36 //items:dataAttr.item,37 loop:dataAttr.loop,38 dots:dataAttr.dots,39 autoplay:dataAttr.autoplay,40 lazyLoad: dataAttr.lazyload,41 autoplayTimeout:dataAttr.autoplaytimeout,42 margin:dataAttr.margin,43 nav:dataAttr.nav,44 addClassActive:dataAttr.addclassactive,45 autoplayHoverPause:dataAttr.autoplayhoverPause,46 video:dataAttr.video,47 animateOut:dataAttr.animateout,48 animateIn:dataAttr.animatein,49 navText :['<img src="'+lgxcarousel.owl_navigationTextL+'" alt="Left"/>','<img src="'+lgxcarousel.owl_navigationTextR+'" alt="Right"/>'],50 videoHeight: dataAttr.videoheight,51 videoWidth: dataAttr.videowidth,52 smartSpeed:dataAttr.smartspeed,53 slideSpeed : dataAttr.slidespeed,54 paginationSpeed : dataAttr.paginationspeed,55 rewindSpeed : dataAttr.rewindspeed,56 responsiveClass:true,57 responsive:{58 // Item in Mobile Devices (Less than 768px)59 0:{60 items:dataAttr.itemmobile,61 nav:dataAttr.navmobile62 },63 // Item in Tablets Devices (768px and Up)64 768:{65 items:dataAttr.itemtablet,66 nav:dataAttr.navtablet67 },68 // Item in Desktops Devices (Desktops 992px)69 992:{70 items:dataAttr.itemdesk,71 nav:dataAttr.navdesk72 },73 // Item in Large Desktops Devices (1200px and Up)74 1200:{75 items:dataAttr.itemlarge,76 nav:dataAttr.navlarge77 }78 }79 };80 $item.owlCarousel(carouselParams);81 //82 });83 });...
cpstest.js
Source:cpstest.js
...10elem.classList.remove('popup');11elem.classList.add('futurePopup')12 },8500)13}14function dataAttr(str,i = null){15 16 return i === null ? document.querySelectorAll('[data-'+str+']') : document.querySelectorAll('[data-'+str+']')[i]17}18if('banned' in localStorage){19 close()20}21 dataAttr('click',0).onclick = function(e){22 e.target.onclick = null23 24 var clicks = 0;25 26 var time = 427 28 let int = setInterval(() => {29 if(time > 1){30 dataAttr('time',0).textContent = time+' seconds left.'31 time--32 }33 else if(time > 0){34 dataAttr('time',0).textContent = '1 second left.'35 time--36 }37 else{38 if(dataAttr('time',0)){39 dataAttr('time',0).parentElement.remove()40 }41 }42 },1000)43 44 function handleClick(){45 clicks++46 47 dataAttr('num',0).textContent = 'Clicks: '+clicks48dataAttr('click',0).onkeyup = function(e){49 if(e.code.toLowerCase() === 'space'){50 clicks--51 }52 }53 }54 setTimeout(() => {55dataAttr('click',0).removeEventListener('click',handleClick)56 dataAttr('click',0).textContent = 'Time\'s Up!'57 58dataAttr('future',0).textContent = 'Done!'59 60 summonPopup(dataAttr('future',0))61let CPS = clicks/562if(CPS >= 10){63 localStorage.setItem('banned',true)64 dataAttr('future',0).textContent = 'You\'re a cheater!'65 66 summonPopup(dataAttr('future',0))67 68 close()69}70 71if('highscore' in localStorage){72 if(+localStorage.getItem('highscore') >= 10){73 localStorage.setItem('banned',true);74 dataAttr('future',0).textContent = 'I see that you cheated to get your highscore #banned.'75 76 summonPopup(dataAttr('future',0))77 78 close()79 }80 else if(CPS > +localStorage.getItem('highscore')){81 localStorage.setItem('highscore',CPS)82 dataAttr('future',0).textContent = 'New Highscore: '+CPS83 84 summonPopup(dataAttr('future',0))85 86 document.body.innerHTML += "<br/><br/><button id='refresh' onclick='location.reload()'>Refresh the Page!</button>"87}88 else{89 dataAttr('future',0).textContent = 'Your score is '+CPS90 91 summonPopup(dataAttr('future',0))92 document.body.innerHTML += "<br/><br/><button id='refresh' onclick='location.reload()'>Refresh the Page!</button>"93 }94}95else{96 dataAttr('future',0).textContent = 'Your score is '+CPS97 98 summonPopup(dataAttr('future',0));99 100 localStorage.setItem('highscore',CPS)101 document.body.innerHTML += "<br/><br/><button id='refresh' onclick='location.reload()'>Refresh the Page!</button>"102}103},5000)104 dataAttr('click',0).addEventListener('click',handleClick)105document.addEventListener('keypress',function(e){106 if((e.code.toLowerCase() === 'space' || e.code.toLowerCase() === 'enter') && !e.altKey && !e.ctrlKey && !e.shiftKey && !e.metaKey){107 e.preventDefault()108 } 109})...
logo-slider-wp-public.js
Source:logo-slider-wp-public.js
1(function() {2 'use strict';34 /**5 * All of the code for your public-facing JavaScript source6 * should reside in this file.7 *8 * Note: It has been assumed you will write jQuery code here, so the9 * $ function reference has been prepared for usage within the scope10 * of this function.11 *12 * This enables you to define handlers, for when the DOM is ready:13 *14 * $(function() {15 *16 * });17 *18 * When the window is loaded:19 *20 * $( window ).load(function() {21 *22 * });23 *24 * ...and/or other possibilities.25 *26 * Ideally, it is not considered best practise to attach more than a27 * single DOM-ready or window-load handler for a particular page.28 * Although scripts in the WordPress core, Plugins and Themes may be29 * practising this, we should strive to set a better example in our own work.30 */313233 jQuery(document).ready(function($) {3435 $('.lgx-logo-carousel').each(function(){36 var $logoitem = $(this);37 var dataAttr = $logoitem.data();38 //console.log(dataAttr.autoplayhoverpause);39 var logocarouselParams = {40 addClassActive:true,41 loop:dataAttr.loop,42 dots:dataAttr.dots,43 autoplay:dataAttr.autoplay,44 lazyLoad: dataAttr.lazyload,45 autoplayTimeout:dataAttr.autoplaytimeout,46 margin:dataAttr.margin,47 autoplayHoverPause:dataAttr.autoplayhoverpause,48 navText :['<img src="'+logosliderwp.owl_navigationTextL+'" alt="Left"/>','<img src="'+logosliderwp.owl_navigationTextR+'" alt="Right"/>'],49 smartSpeed:dataAttr.smartspeed,50 slideSpeed : dataAttr.slidespeed,51 paginationSpeed : dataAttr.paginationspeed,52 rewindSpeed : dataAttr.rewindspeed,53 responsiveClass:true,54 responsive:{55 // Item in Mobile Devices (Less than 768px)56 0:{57 items:dataAttr.itemmobile,58 nav:dataAttr.navmobile59 },60 // Item in Tablets Devices (768px and Up)61 768:{62 items:dataAttr.itemtablet,63 nav:dataAttr.navtablet64 },65 // Item in Desktops Devices (Desktops 992px)6667 992:{68 items:dataAttr.itemdesk,69 nav:dataAttr.navdesk70 },71 // Item in Large Desktops Devices (1200px and Up)72 1200:{73 items:dataAttr.itemlarge,74 nav:dataAttr.navlarge75 }76 }7778 };79 $logoitem.owlCarousel(logocarouselParams);80 //81 });8283 });848586
...
Using AI Code Generation
1describe('My First Test', function() {2 it('Does not do much!', function() {3 cy.contains('type').click()4 cy.url().should('include', '/commands/actions')5 cy.get('.action-email')6 .type('
Using AI Code Generation
1describe('My First Test', () => {2 it('Does not do much!', () => {3 expect(true).to.equal(true)4 })5})6describe('My First Test', () => {7 it('Does not do much!', () => {8 expect(true).to.equal(true)9 })10})11describe('My First Test', () => {12 it('Does not do much!', () => {13 expect(true).to.equal(true)14 })15})16describe('My First Test', () => {17 it('Does not do much!', () => {18 expect(true).to.equal(true)19 })20})21describe('My First Test', () => {22 it('Does not do much!', () => {23 expect(true).to.equal(true)24 })25})26describe('My First Test', () => {27 it('Does not do much!', () => {28 expect(true).to.equal(true)29 })30})31describe('My First Test', () => {32 it('Does not do much!', () => {33 expect(true).to.equal(true)34 })35})36describe('My First Test', () => {37 it('Does not do much!', () => {38 expect(true).to.equal(true)39 })40})41describe('My First Test', () => {42 it('Does not do much!', () => {43 expect(true).to.equal(true)44 })45})46describe('My First Test', () => {47 it('Does not do much!', () => {48 expect(true).to.equal(true)49 })50})51describe('My First Test', () => {52 it('Does not do much!', () => {53 expect(true).to.equal(true)54 })55})56describe('My First Test', () => {57 it('Does not do much!', () => {58 expect(true).to.equal(true)59 })60})61describe('My First Test', ()
Cypress is a renowned Javascript-based open-source, easy-to-use end-to-end testing framework primarily used for testing web applications. Cypress is a relatively new player in the automation testing space and has been gaining much traction lately, as evidenced by the number of Forks (2.7K) and Stars (42.1K) for the project. LambdaTest’s Cypress Tutorial covers step-by-step guides that will help you learn from the basics till you run automation tests on LambdaTest.
You can elevate your expertise with end-to-end testing using the Cypress automation framework and stay one step ahead in your career by earning a Cypress certification. Check out our Cypress 101 Certification.
Watch this 3 hours of complete tutorial to learn the basics of Cypress and various Cypress commands with the Cypress testing at LambdaTest.
Get 100 minutes of automation test minutes FREE!!