ko-archetype/src/main/resources/archetype-resources/src/main/resources/index.html
1 <?xml version="1.0" encoding="UTF-8"?>
4 Copied from knockout.js Twitter example:
5 http://knockoutjs.com/examples/twitter.html
9 <html xmlns="http://www.w3.org/1999/xhtml">
11 <title>Bck2Brwsr's Twitter</title>
14 <link href='twitterExample.css' rel='Stylesheet' ></link>
16 <style type='text/css'>
17 .liveExample select { height: 1.7em; }
18 .liveExample button { height: 2em; }
22 <h2>Bck2Brwsr's Twitter</h2>
25 This code is based on original
26 <a href="http://knockoutjs.com/examples/twitter.html">knockout.js
27 Twitter example</a> and
28 uses almost unmodified HTML page. It just changes the model. The model
29 is written in Java language with the help of
30 <a href="http://bck2brwsr.apidesign.org/javadoc/net.java.html.json/">
31 Knockout/Java binding library
32 </a>. The Java source code has about 180 lines and seems more
33 dense and shorter than the original JavaScript model.
36 The project has two profiles. Either it executes in real Java virtual
37 machine and renders using JavaFX's WebView (use <code>fxbrwsr</code> profile
38 - the default). It can also run directly in a browser via
39 <a href="http://bck2brwsr.apidesign.org">Bck2Brwsr</a> virtual machine
40 (use <code>bck2brwsr</code> profile).
43 <div class='liveExample'>
44 <div class='configuration'>
45 <div class='listChooser'>
46 <button data-bind='click: deleteList, enable: activeTweetersName'>Delete</button>
47 <button data-bind='click: saveChanges, enable: hasUnsavedChanges'>Save</button>
48 <select data-bind='options: savedLists, optionsValue: "name", value: activeTweetersName'> </select>
51 <p>Currently viewing <span data-bind='text: activeTweetersCount'> </span> user(s):</p>
52 <div class='currentUsers' >
53 <ul data-bind='foreach: activeTweeters'>
55 <button data-bind='click: $root.removeUser'>Remove</button>
56 <div data-bind='text: $data'> </div>
61 <form data-bind='submit: addUser'>
62 <label>Add user:</label>
63 <input data-bind='value: userNameToAdd, valueUpdate: "keyup", css: { invalid: !userNameToAddIsValid() }' />
64 <button data-bind='enable: userNameToAddIsValid' type='submit'>Add</button>
68 <div class='loadingIndicator' data-bind="visible: loading">Loading...</div>
69 <table data-bind='foreach: currentTweets' width='100%'>
71 <td><img data-bind='attr: { src: profile_image_url }' /></td>
73 <a class='twitterUser' data-bind='attr: { href: userUrl }, text: from_user'> </a>
74 <span data-bind='html: html'> </span>
75 <div class='tweetInfo' data-bind='text: created_at'> </div>
82 <script src="bck2brwsr.js"></script>
83 <script type="text/javascript">
84 var vm = bck2brwsr('${artifactId}-${version}.jar');
85 vm.loadClass('${package}.TwitterClient');