Advertisement
Adam_Martin

Untitled

May 19th, 2012
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var $_widgetName = 'tab_panel';
  2.  
  3. widgetControls[ $_widgetName ] =
  4. {
  5.  
  6.     tab_panel :
  7.     {
  8.         actions :
  9.         {
  10.             init          : function( )
  11.             {
  12.                 var self = this,
  13.                     __obj = self.param;
  14.  
  15.                 var getParam = function ( __obj ) {
  16.                     var _param = {};
  17.                     $( __obj ).find( 'span._param' ).each(
  18.                         function() {
  19.                             var val = $( this ).html();
  20.                             with(this) {
  21.                                 _param = eval( '_param = ' + val );
  22.                             }
  23.                         }
  24.                     )
  25.                     return _param;
  26.                 }
  27.  
  28.                 var param = getParam( __obj );
  29.  
  30.                 with ( param ) {
  31.                     var key;
  32.  
  33.                     for( key in buttons ) {
  34.                         var title  = key
  35.                            ,source = buttons[ key ]
  36.  
  37.                         var widget = self.wc.buildWidget( 'button', {id:title} );
  38.                         $(self.get( 'pager:editor_pager/pager__bar' )).append(widget)
  39.  
  40.                         //self.get( 'pager:editor_pager' ).create_shortcut( title, source, source);
  41.                     }
  42.  
  43.                     for( key in system ) {
  44.                         switch ( key ) {
  45.                             case 'source':
  46.                                 var val = system[ key ];
  47.                                 $.getJSON(
  48.                                     '/get-all/' + val
  49.                                    ,''
  50.                                    ,function ( data ){
  51.                                        alert(val)
  52.                                        cache[ '/get-html/' + val ] = data.html_code;
  53.                                        cache[ '/get-css/' + val ] = data.css_code;
  54.                                        cache[ '/get-js/' + val ] = data.js_code;
  55.                                        $('.widget_name').val( data.name )
  56.                                     }
  57.                                 ) // get JSON data
  58.                                 break; // source
  59.                             case 'active':
  60.                                 self.widget_data.active_item = $('');
  61.                                 break; // active
  62.                             default:
  63.                                 break; // default
  64.                         } //  switch
  65.                     }
  66.                 }
  67.             }
  68.             ,after          : function(  )
  69.             {
  70.                 this.widget_data.active_item.doActive();
  71.             }
  72.  
  73.         }
  74.     }
  75.     ,tab_panel__content :
  76.     {
  77.         events :
  78.         {
  79.             click : function() {
  80.             }
  81.         }
  82.     }
  83.     ,tab_panel__content_container :
  84.     {
  85.         subs :
  86.         {
  87.             'tab_panel/pager:editor_pager/pager_bar/button' :
  88.             {
  89.                 tab_selected: function ( param )
  90.                 {
  91.                     //$( this.get('tab_panel__content_container') ).val( cache[ param ] );
  92.                     alert(4)
  93.                 }
  94.             }
  95.         }
  96.         ,events :
  97.         {
  98.             click : function() {
  99.  
  100.             },
  101.             keyup : function() {
  102.  
  103.                 this.get('list_selector:bricks_listing')
  104.                     .pub(
  105.                         'createListing',
  106.                         getMe(getClasses())
  107.                      );
  108.  
  109. //            console.log( $(this) )
  110.  
  111.  
  112. //                var source = this.get('pager:editor_pager').widget_data.active_source;
  113. //                cache[ source ] = $( this ).val();
  114. //                if ( $( '.start_on_button' ).prop( 'checked' ) ) {
  115. //                    doIt2();
  116. //                }
  117.  
  118.             }
  119.         }
  120.     }
  121. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement