Commits

Ginés Martínez Sánchez committed c3792ff Draft

router back way done?!

  • Participants
  • Parent commits 11f5795

Comments (0)

Files changed (8)

File ginsfsm/examples/inter_event/README.txt

 This examples shows how interchange events between gaplics.
+
+To test the application, go to http://localhost:8001
+

File ginsfsm/examples/inter_event/ap1_banco/banco/pyramid_app/static/cliente.js

         /*--------------------------------*
          *      Set DOM events
          *--------------------------------*/
+
+        /*
+         *  Get our DOM elements
+         */
+        self.$registro_nombre = $('#registro_nombre');
+        self.$registro_button = $('#registro_button');
+        self.$registro_resultado = $('#registro_resultado');
+
+        self.$prestamo_cantidad = $('#prestamo_cantidad');
+        self.$prestamo_button = $('#prestamo_button');
+        self.$prestamo_total = $('#prestamo_total');
+
+        self.$acciones_cantidad = $('#acciones_cantidad');
+        self.$acciones_button = $('#acciones_button');
+        self.$acciones_total = $('#acciones_total');
+
+        self.$saldo_total = $('#saldo_total');
+
+        /*
+         *  Configure events
+         */
+        self.$registro_button.on("click", self, function(event){
+            event.stopPropagation();
+            var self = event.data;
+            var kw = {
+                user_name: self.$registro_nombre.val()
+            };
+            self.send_event(self, 'EV_REGISTER_USER', kw);
+        });
+
+
 /*
         self.$outer_box.hover(function() {
             self.$outer_box.addClass(self.config.extra_clickable_hover_cls);
         ],
         'state_list': [
             'ST_INIT',                       /* Estado inicial */
-            'ST_NORMAL',                     /* button normal */
+            'ST_REGISTERED',                 /* Usuario registrado */
             ],
         'machine': {
             'ST_INIT':
                 ['EV_PAINT',        ac_paint,           undefined],
                 ['EV_SETTEXT',      ac_setcontent,      undefined],
             ],
-            'ST_NORMAL':
+            'ST_REGISTERED':
             [
                 ['EV_PAINT',        ac_paint,           undefined],
                 ['EV_SETTEXT',      ac_setcontent,      undefined],
         //  start_up
         //**********************************
         var self = this;
-
+        configure_item_events(self);
 
         /*-------------------------------------------------*
          *  Initial paint
         /*---------------------------------*
          *      Build jquery link list.
          *---------------------------------*/
-        //self.build_jquery_link_list();
+        self.build_jquery_link_list();
     }
 
     /*--------------------------------------*

File ginsfsm/examples/inter_event/ap1_banco/banco/pyramid_app/static/gaplic.js

+../../../../../../../../jsfsm/src/gaplic.js

File ginsfsm/examples/inter_event/ap1_banco/banco/pyramid_app/static/gobj.js

+../../../../../../../../jsfsm/src/gobj.js

File ginsfsm/examples/inter_event/ap1_banco/banco/pyramid_app/static/router.js

+../../../../../../../../jsfsm/src/router.js

File ginsfsm/examples/inter_event/ap1_banco/banco/pyramid_app/static/smachine.js

+../../../../../../../../jsfsm/src/smachine.js

File ginsfsm/examples/inter_event/ap1_banco/banco/pyramid_app/static/utils.js

+../../../../../../../../jsfsm/src/utils.js

File ginsfsm/examples/inter_event/ap1_banco/banco/pyramid_app/templates/mytemplate.pt

   <![endif]-->
   <script src="${request.static_url('banco:pyramid_app/static/jquery.js')}"></script>
   <script src="${request.static_url('banco:pyramid_app/static/sockjs.js')}"></script>
+
+  <!-- uncomment in production
   <script src="${request.static_url('banco:pyramid_app/static/jsfsm.js')}"></script>
+  -->
+
+  <script src="${request.static_url('banco:pyramid_app/static/utils.js')}"></script>
+  <script src="${request.static_url('banco:pyramid_app/static/smachine.js')}"></script>
+  <script src="${request.static_url('banco:pyramid_app/static/gobj.js')}"></script>
+  <script src="${request.static_url('banco:pyramid_app/static/router.js')}"></script>
+  <script src="${request.static_url('banco:pyramid_app/static/gaplic.js')}"></script>
+
   <script src="${request.static_url('banco:pyramid_app/static/cliente.js')}"></script>
   <script>
     SMachine.set_machine_trace(false);  // global trace
         }
     );
 
-    var cliente_options = {
-    };
-    var cliente = gaplic.create_gobj(
-        '',
-        Cliente,
-        gaplic,
-        cliente_options
-    );
-    cliente.set_machine_trace(true);
+    $(function(){
+        var cliente_options = {
+        };
+        cliente = gaplic.create_gobj(
+            '',
+            Cliente,
+            gaplic,
+            cliente_options
+        );
+        cliente.set_machine_trace(true);
+    });
 
   </script>
 </head>