Import legacy nurinda.co.id website
This commit is contained in:
1 parent
3f59bb9038
commit
6e21646ac4
13389 files changed
+3246690
No files matched your search
@@ -0,0 +1,10 @@
|
||||
jQuery( document ).on( 'acf/setup_fields', function ( e, el ) {
|
||||
// Redeclare active editor.
|
||||
setTimeout( function () {
|
||||
if ( 'tinymce' === getUserSetting( 'editor' ) ) {
|
||||
jQuery( '#content-tmce' ).trigger( 'click' );
|
||||
} else {
|
||||
jQuery( '#content-html' ).trigger( 'click' );
|
||||
}
|
||||
}, 10 );
|
||||
} );
|
||||
@@ -0,0 +1,60 @@
|
||||
(function ( $ ) {
|
||||
$( '#content-html' ).on( 'click', function () {
|
||||
window.setTimeout( function () {
|
||||
window.wpActiveEditor = 'qtrans_textarea_content';
|
||||
}, 10 );
|
||||
} );
|
||||
|
||||
$( window ).ready( function () {
|
||||
var activeLang = qtrans_get_active_language(),
|
||||
$langs = $( '#vc_vendor_qtranslate_langs' );
|
||||
|
||||
$( 'option', $langs ).each( function () {
|
||||
var $el = $( this );
|
||||
if ( $el.val() == activeLang ) {
|
||||
$el.prop( 'selected', true );
|
||||
}
|
||||
$( '#qtrans_select_' + $el.val() ).on( 'click', function () {
|
||||
$el.prop( 'selected', true );
|
||||
} );
|
||||
} );
|
||||
|
||||
$langs.on( 'change', function () {
|
||||
$( '#qtrans_select_' + $( this ).val() ).trigger( 'click' );
|
||||
var link = $( ":selected", this ).attr( 'link' );
|
||||
$( '.wpb_switch-to-front-composer' ).each( function () {
|
||||
$( this ).attr( 'href', link );
|
||||
} );
|
||||
$( '#wpb-edit-inline' ).attr( 'href', link );
|
||||
vc.shortcodes.fetch( { reset: true } );
|
||||
} );
|
||||
|
||||
$langs.show();
|
||||
|
||||
if ( ! window.vc ) {
|
||||
window.vc = {};
|
||||
}
|
||||
vc.QtransResetContent = function () {
|
||||
$( '#content-html' ).trigger( 'click' );
|
||||
$( '#qtrans_textarea_content' ).css( 'minHeight', '300px' );
|
||||
window.wpActiveEditor = 'qtrans_textarea_content';
|
||||
};
|
||||
|
||||
vc.Storage.prototype.getContent = function () {
|
||||
var content;
|
||||
vc.QtransResetContent();
|
||||
content = $( '#qtrans_textarea_content' ).val();
|
||||
if ( vc.gridItemEditor && ! content.length ) {
|
||||
content = vcDefaultGridItemContent;
|
||||
}
|
||||
return content;
|
||||
};
|
||||
|
||||
vc.Storage.prototype.setContent = function ( content ) {
|
||||
$( '#content-html' ).trigger( 'click' );
|
||||
$( '#qtrans_textarea_content' ).val( content );
|
||||
vc.QtransResetContent();
|
||||
};
|
||||
|
||||
} );
|
||||
})( window.jQuery );
|
||||
@@ -0,0 +1,23 @@
|
||||
(function ( $ ) {
|
||||
$( '#vc_vendor_qtranslate_langs_front' ).change( function () {
|
||||
vc.closeActivePanel();
|
||||
$( '#vc_logo' ).addClass( 'vc_ui-wp-spinner' );
|
||||
window.location.href = $( this ).val();
|
||||
} );
|
||||
|
||||
vc.ShortcodesBuilder.prototype.getContent = function () {
|
||||
var output,
|
||||
$postContent = $( '#vc_vendor_qtranslate_postcontent' ),
|
||||
lang = $postContent.attr( 'data-lang' ),
|
||||
content = $postContent.val();
|
||||
vc.shortcodes.sort();
|
||||
output = this.modelsToString( vc.shortcodes.where( { parent_id: false } ) );
|
||||
return qtrans_integrate( lang, output, content );
|
||||
};
|
||||
vc.ShortcodesBuilder.prototype.getTitle = function () {
|
||||
var $titleContent = $( '#vc_vendor_qtranslate_posttitle' ),
|
||||
lang = $titleContent.attr( 'data-lang' ),
|
||||
content = $titleContent.val();
|
||||
return qtrans_integrate( lang, vc.title, content );
|
||||
};
|
||||
})( window.jQuery );
|
||||
@@ -0,0 +1,17 @@
|
||||
(function ( $ ) {
|
||||
$( function () {
|
||||
var Manager = qTranslateConfig.js.get_qtx();
|
||||
|
||||
Manager.addLanguageSwitchListener( hookLanguageSwitch );
|
||||
} );
|
||||
|
||||
function hookLanguageSwitch( activeLang ) {
|
||||
var $inlineHref = $( '.wpb_switch-to-front-composer' );
|
||||
if ( ! $inlineHref.data( 'raw-url' ) ) {
|
||||
$inlineHref.data( 'raw-url', $inlineHref.attr( 'href' ) );
|
||||
}
|
||||
var newUrl = $inlineHref.data( 'raw-url' ) + '&lang=' + activeLang;
|
||||
$inlineHref.attr( 'href', newUrl );
|
||||
vc.shortcodes.fetch( { reset: true } );
|
||||
}
|
||||
})( window.jQuery );
|
||||
@@ -0,0 +1,15 @@
|
||||
(function ( $ ) {
|
||||
$( '#vc_vendor_qtranslatex_langs_front' ).change( function () {
|
||||
vc.closeActivePanel();
|
||||
$( '#vc_logo' ).addClass( 'vc_ui-wp-spinner' );
|
||||
window.location.href = $( this ).val();
|
||||
} );
|
||||
|
||||
var nativeGetContent = vc.ShortcodesBuilder.prototype.getContent;
|
||||
vc.ShortcodesBuilder.prototype.getContent = function () {
|
||||
var content = nativeGetContent();
|
||||
jQuery( '#content' ).val( content );
|
||||
return content;
|
||||
};
|
||||
|
||||
})( window.jQuery );
|
||||
@@ -0,0 +1,18 @@
|
||||
window.jQuery( document ).ready( function ( $ ) {
|
||||
$( 'body' ).on( 'adding_to_cart', function ( event, $button, data ) {
|
||||
$button && $button.hasClass( 'vc_gitem-link' ) && $button
|
||||
.addClass( 'vc-gitem-add-to-cart-loading-btn' )
|
||||
.parents( '.vc_grid-item-mini' )
|
||||
.addClass( 'vc-woocommerce-add-to-cart-loading' )
|
||||
.append( $( '<div class="vc_wc-load-add-to-loader-wrapper"><div class="vc_wc-load-add-to-loader"></div></div>' ) );
|
||||
} ).on( 'added_to_cart', function ( event, fragments, cart_hash, $button ) {
|
||||
if ( 'undefined' === typeof($button) ) {
|
||||
$button = $( '.vc-gitem-add-to-cart-loading-btn' );
|
||||
}
|
||||
$button && $button.hasClass( 'vc_gitem-link' ) && $button
|
||||
.removeClass( 'vc-gitem-add-to-cart-loading-btn' )
|
||||
.parents( '.vc_grid-item-mini' )
|
||||
.removeClass( 'vc-woocommerce-add-to-cart-loading' )
|
||||
.find( '.vc_wc-load-add-to-loader-wrapper' ).remove();
|
||||
} );
|
||||
} );
|
||||
@@ -0,0 +1,41 @@
|
||||
if ( ! window.ajaxurl ) {
|
||||
window.ajaxurl = window.location.href;
|
||||
}
|
||||
var vcWoocommerceProductAttributeFilterDependencyCallback;
|
||||
|
||||
vcWoocommerceProductAttributeFilterDependencyCallback = function () {
|
||||
(function ( $, that ) {
|
||||
var $filterDropdown, $empty;
|
||||
|
||||
$filterDropdown = $( '[data-vc-shortcode-param-name="filter"]', that.$content );
|
||||
$filterDropdown.removeClass( 'vc_dependent-hidden' );
|
||||
$empty = $( '#filter-empty', $filterDropdown );
|
||||
if ( $empty.length ) {
|
||||
$empty.parent().remove();
|
||||
$( '.edit_form_line',
|
||||
$filterDropdown ).prepend( $( '<div class="vc_checkbox-label"><span>No values found</span></div>' ) );
|
||||
}
|
||||
$( 'select[name="attribute"]', that.$content ).change( function () {
|
||||
$( '.vc_checkbox-label', $filterDropdown ).remove();
|
||||
$filterDropdown.removeClass( 'vc_dependent-hidden' );
|
||||
|
||||
$.ajax( {
|
||||
type: 'POST',
|
||||
dataType: 'json',
|
||||
url: window.ajaxurl,
|
||||
data: {
|
||||
action: 'vc_woocommerce_get_attribute_terms',
|
||||
attribute: this.value,
|
||||
_vcnonce: window.vcAdminNonce
|
||||
}
|
||||
} ).done( function ( data ) {
|
||||
if ( 0 < data.length ) {
|
||||
$( '.edit_form_line', $filterDropdown ).prepend( $( data ) );
|
||||
} else {
|
||||
$( '.edit_form_line',
|
||||
$filterDropdown ).prepend( $( '<div class="vc_checkbox-label"><span>No values found</span></div>' ) );
|
||||
}
|
||||
} );
|
||||
} );
|
||||
}( window.jQuery, this ));
|
||||
};
|
||||
@@ -0,0 +1,93 @@
|
||||
/* global vc, YoastSEO, _, jQuery */
|
||||
jQuery( window ).on( 'YoastSEO:ready', function () {
|
||||
'use strict';
|
||||
var imageEventString, vcYoast, relevantData = {}, pluginName = 'vcVendorYoast', eventsList = [
|
||||
'sync',
|
||||
'add',
|
||||
'update'
|
||||
];
|
||||
var contentModification = function ( data ) {
|
||||
data = _.reduce( relevantData, function ( memo, value, key ) {
|
||||
if ( value.html ) {
|
||||
memo = memo.replace( '"' + value.text + '"', value.html );
|
||||
}
|
||||
if ( value.image && value.param ) {
|
||||
var i, imagesString = '', attachment;
|
||||
for ( i = 0;
|
||||
value.image.length > i;
|
||||
i ++ ) {
|
||||
attachment = window.wp.media.model.Attachment.get( value.image[ i ] );
|
||||
if ( attachment.get( 'url' ) ) {
|
||||
imagesString += '<img src=\'' + attachment.get( 'url' ) + '\' alt=\'' +
|
||||
( attachment.get( 'alt' ) || attachment.get( 'caption' ) || attachment.get( 'title' ) ) + '\'>';
|
||||
}
|
||||
}
|
||||
memo += imagesString;
|
||||
}
|
||||
return memo;
|
||||
}, data );
|
||||
return data;
|
||||
};
|
||||
|
||||
function getImageEventString( e ) {
|
||||
return ' shortcodes:' + e + ':param:type:attach_image' +
|
||||
' shortcodes:' + e + ':param:type:attach_images';
|
||||
}
|
||||
|
||||
// add relevant data for images
|
||||
imageEventString = _.reduce( eventsList, function ( memo, e ) {
|
||||
return memo + getImageEventString( e );
|
||||
}, '' );
|
||||
vc.events.on( imageEventString, function ( model, param, settings ) {
|
||||
if ( param && param.length > 0 ) {
|
||||
var ids = param.split( /\s*,\s*/ );
|
||||
_.each( ids, function ( id ) {
|
||||
var attachment = window.wp.media.model.Attachment.get( id );
|
||||
if ( ! attachment.get( 'url' ) ) {
|
||||
attachment.once( 'sync', function () {
|
||||
YoastSEO.app.pluginReloaded( pluginName );
|
||||
} );
|
||||
attachment.fetch();
|
||||
}
|
||||
} );
|
||||
relevantData[ model.get( 'id' ) + settings.param_name ] = {
|
||||
image: ids,
|
||||
paramName: settings.param_name,
|
||||
param: param
|
||||
};
|
||||
}
|
||||
} );
|
||||
vc.events.on( getImageEventString( 'destroy' ), function ( model, param, settings ) {
|
||||
delete relevantData[ model.get( 'id' ) + settings.param_name ];
|
||||
} );
|
||||
// Add relevant data to headings
|
||||
vc.events.on( 'shortcodes:vc_custom_heading', function ( model, event ) {
|
||||
var params, tagSearch;
|
||||
params = model.get( 'params' )
|
||||
params = _.extend( {}, vc.getDefaults( model.get( 'shortcode' ) ), params );
|
||||
|
||||
if ( 'destroy' === event ) {
|
||||
delete relevantData[ model.get( 'id' ) ];
|
||||
}
|
||||
else if ( params.text && params.font_container ) {
|
||||
tagSearch = params.font_container.match( /tag:([^\|]+)/ );
|
||||
if ( tagSearch[ 1 ] ) {
|
||||
relevantData[ model.get( 'id' ) ] = {
|
||||
html: '<' + tagSearch[ 1 ] + '>' +
|
||||
params.text + '</' + tagSearch[ 1 ] + '>',
|
||||
text: params.text
|
||||
};
|
||||
}
|
||||
}
|
||||
} );
|
||||
|
||||
var VcVendorYoast = function () {
|
||||
// init
|
||||
YoastSEO.app.registerPlugin( pluginName, { status: 'ready' } );
|
||||
YoastSEO.app.pluginReady( pluginName );
|
||||
YoastSEO.app.registerModification( 'content', contentModification, pluginName, 5 );
|
||||
};
|
||||
|
||||
vcYoast = new VcVendorYoast();
|
||||
|
||||
} );
|
||||
Reference in new issue
Block a user