Commits

carkraus  committed 53c9666

init

  • Participants

Comments (0)

Files changed (6)

+closure-lib
+nbproject
+.jar
+.idea
+.DS_Store

File etc/all_tests.html

+<!doctype html>
+<html>
+    <head>
+      <title>goox.ui.View et al</title>
+      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+      <link rel="stylesheet" href="style.css" />
+    </head>
+    <body>
+        <header>
+            <h1>goox.ui.View & friends example</h1>
+        </header>
+        
+        <h2>TemplateView</h2>
+        <div class="views">
+          <div id="ex1"></div>
+          <div id="ex2"></div>
+          <div>
+            <div id="ex3" class="goox-view">
+              <h1><small>VIEW</small> Simple decorated view</h1>
+              <p><strong>Description:</strong></p>
+              <p>Lorem ipsum dolor...</p>
+            </div>
+          </div>
+          <div>
+            <div id="ex4" class="goox-template-view"></div>
+          </div>
+        </div>
+        
+        <h2>TemplateView /w components</h2>
+        <div class="views">
+          <div id="ex5"></div>
+          <div id="ex6"></div>
+        </div>
+
+        <footer>
+            <section id="tools">
+              <h1>Tools:</h1>
+              <div id="btnChangeModel" class="btn">Change model of #1</div>
+            </section>
+            <section class="log msgLog">
+                <header><h1>Message Log</h1></header>
+                <div id="log"></div>
+            </section>
+        </footer>
+        
+        <script type="text/javascript"
+          src="http://localhost:9810/compile?id=app&mode=raw&level=verbose"></script>
+        <!--<script type="text/javascript" src="compiled/app.js"></script>-->
+        </body>
+</html>

File etc/plovr.json

+{
+    "id": "app",
+    "paths":["../goox", "."],
+    "inputs":["app.js"],
+    "mode":"advanced",
+    "level":"verbose"
+   ,"disambiguate-properties":true
+//   ,"ambiguate-properties":true
+//  , "debug":true
+//  , "pretty-print":true
+}   

File etc/testing_requirements.js

+/**
+ * @fileoverview Usage example.
+ * @author Carsten Kraus <carsten.kraus@gmail.com>
+ */
+goog.require('goog.dom');
+goog.require('example.DecoratorView');
+goog.require('example.ExampleView1');
+goog.require('example.MinimalPITAView');
+goog.require('goog.ui.Button');
+
+// Silence dumb compilation warnings
+goog.addDependency('', [
+  'goog.Uri',
+  'goog.net.XhrLite',
+  'goog.debug.ErrorHandler',
+  'goog.ui.Control'
+], []);
+
+// Example entry point
+(function() {
+  var $ = goog.dom.getElement;
+
+  var view1 = new example.ExampleView1();
+  view1.setModel({'title': 'Example1', 'descr': 'Lorem ipsum dolor...'});
+  view1.render($('ex1'));
+
+  var miniPITAView = new example.MinimalPITAView();
+  miniPITAView.setModel({'title': 'Minimal PITA!', 'descr': 'Spam, Foo, Eggs...'});
+  miniPITAView.render($('ex2'));
+
+  var decoratedSimpleView = new goox.ui.View();
+  decoratedSimpleView.events_ = [
+    ['h1', 'click', function(e) {
+      console.log('decoratedSimpleView click setup', e.target);
+    }],
+    ['p', ['mouseover', 'mouseout'], function(e) {
+      goog.dom.classes.toggle(e.target, 'hover');
+    }]
+  ];
+  decoratedSimpleView.decorate($('ex3'));
+
+  var decoratedTmplView = new example.MinimalPITAView();
+  decoratedTmplView.setModel({'title': 'Decorated template view', 'descr': 'Spam, Foo, Eggs...'});
+  decoratedTmplView.decorate($('ex4'));
+
+  
+  /**
+   * Using components...
+   */
+  var componentView = new example.MinimalPITAView();
+  componentView.components_ = {
+    'div.btn':goog.ui.Button
+  };
+  componentView.setModel({'title': 'Component example', 'descr': 'Spam, <div class="btn">Foo</div>, Eggs...'});
+  componentView.render($('ex5'));
+  
+  var decoView = new example.DecoratorView();
+  decoView.setModel({'title': 'Example /w decorated components'});
+  decoView.render($('ex6'));
+  
+  // Tools
+  goog.events.listen($('tools'), 'click', function(e) {
+    switch(e.target.id) {
+      case 'btnChangeModel':
+        miniPITAView.setModel({'title': 'Minimally changed PITA!', 'descr': 'Foo, Bar, Eggs?'})
+        break;
+    }
+  });
+})();
+

File src/bar.js

Empty file added.

File src/foo.js

Empty file added.