Last active
February 4, 2025 18:33
Revisions
-
pavelthq revised this gist
Nov 22, 2017 . 2 changed files with 24 additions and 22 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,9 +1,10 @@ (function($) { window.VcCustomElementView = vc.shortcode_view.extend( { elementTemplate: false, $wrapper: false, changeShortcodeParams: function ( model ) { var params; window.VcCustomElementView.__super__.changeShortcodeParams.call( this, model ); params = _.extend( {}, model.get( 'params' ) ); if ( ! this.elementTemplate ) { @@ -13,8 +14,9 @@ window.VcCustomElementView = vc.shortcode_view.extend( { this.$wrapper = this.$el.find( '.wpb_element_wrapper' ); } if ( _.isObject( params ) ) { var template = vc.template( this.elementTemplate, vc.templateOptions.custom ); this.$wrapper.find( '.vc_custom-element-container' ).html( template( { params: params } ) ); } } } ); })(window.jQuery) This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,28 +1,28 @@ <?php vc_map(array( 'name' => __( 'Custom Markup', 'js_composer' ), 'base' => 'vc_custom_markup', 'category' => array( __( 'Content', 'js_composer' ), ), 'description' => __( 'Custom markup element', 'js_composer' ), 'params' => array( array( 'type' => 'textfield', 'param_name' => 'style', 'value' => 'custom style!', 'heading' => 'Style', ), array( 'type' => 'textfield', 'param_name' => 'color', 'value' => 'custom color!', 'heading' => 'Color', ), array( 'type' => 'textfield', 'param_name' => 'title', 'value' => 'custom title!', 'heading' => 'Title', ), ), -
pavelthq created this gist
Feb 16, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ window.VcCustomElementView = vc.shortcode_view.extend( { elementTemplate: false, $wrapper: false, changeShortcodeParams: function ( model ) { var params; window.VcCustomElementView.__super__.changeShortcodeParams.call( this, model ); params = _.extend( {}, model.get( 'params' ) ); if ( ! this.elementTemplate ) { this.elementTemplate = this.$el.find( '.vc_custom-element-container' ).html(); } if ( ! this.$wrapper ) { this.$wrapper = this.$el.find( '.wpb_element_wrapper' ); } if ( _.isObject( params ) ) { var $element = $( _.template( this.elementTemplate, { params: params }, vc.templateOptions.custom ) ); this.$wrapper.find( '.vc_custom-element-container' ).html( $element ); } } } ); This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,32 @@ <?php vc_map(array( 'name' => __( 'Custom Markup', 'js_composer' ), 'base' => 'vc_custom_markup', 'category' => array( __( 'Content', 'js_composer' ), ), 'description' => __( 'Custom markup element', 'js_composer' ), 'params' => array( array( 'type' => 'textfield', 'name' => 'style', 'value' => 'custom style!' 'heading' => 'Style', ), array( 'type' => 'textfield', 'name' => 'color', 'value' => 'custom color!' 'heading' => 'Color', ), array( 'type' => 'textfield', 'name' => 'title', 'value' => 'custom title!' 'heading' => 'Title', ), ), 'js_view' => 'VcCustomElementView', 'custom_markup' => '<div class="vc_custom-element-container">Style: "{{ params.style }}", Color: "{{ params.color }}", Title: "{{{ params.title }}}"</div>', ) );