Removing references to bck2brwsr as in this form the project can't run in bck2brwsr mode
1 <?xml version="1.0" encoding="UTF-8"?>
6 Copyright (C) 2013 Jaroslav Tulach <jaroslav.tulach@apidesign.org>
8 Permission is hereby granted, free of charge, to any person obtaining a copy
9 of this software and associated documentation files (the "Software"), to deal
10 in the Software without restriction, including without limitation the rights
11 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 copies of the Software, and to permit persons to whom the Software is
13 furnished to do so, subject to the following conditions:
15 The above copyright notice and this permission notice shall be included in
16 all copies or substantial portions of the Software.
18 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
29 Copied from knockout.js Twitter example:
30 http://knockoutjs.com/examples/twitter.html
34 <html xmlns="http://www.w3.org/1999/xhtml">
36 <title>Twitter in Java and HTML</title>
39 <link href='twitterExample.css' rel='Stylesheet' ></link>
41 <style type='text/css'>
42 .liveExample select { height: 1.7em; }
43 .liveExample button { height: 2em; }
47 <h2>Twitter in Java and HTML</h2>
50 This code is based on original <a href="http://knockoutjs.com/examples/twitter.html">knockout.js Twitter example</a> and
51 uses almost unmodified HTML page. It just changes the model and executes
52 it via HotSpot virtual machine. The Java source code has about 190 lines and is available
53 <a href="http://source.apidesign.org/hg/bck2brwsr/file/7fc6b7e9c982/javaquery/demo-twitter/src/main/java/org/apidesign/bck2brwsr/demo/twitter/TwitterClient.java">here</a>
54 - in fact it may even be more dense than the original JavaScript model.
57 <div class='liveExample'>
58 <div class='configuration'>
59 <div class='listChooser'>
60 <button data-bind='click: deleteList, enable: activeTweetersName'>Delete</button>
61 <button data-bind='click: saveChanges, enable: hasUnsavedChanges'>Save</button>
62 <select data-bind='options: savedLists, optionsValue: "name", value: activeTweetersName'> </select>
65 <p>Currently viewing <span data-bind='text: activeTweetersCount'> </span> user(s):</p>
66 <div class='currentUsers' >
67 <ul data-bind='foreach: activeTweeters'>
69 <button data-bind='click: $root.removeUser'>Remove</button>
70 <div data-bind='text: $data'> </div>
75 <form data-bind='submit: addUser'>
76 <label>Add user:</label>
77 <input data-bind='value: userNameToAdd, valueUpdate: "keyup", css: { invalid: !userNameToAddIsValid() }' />
78 <button data-bind='enable: userNameToAddIsValid' type='submit'>Add</button>
82 <div class='loadingIndicator' data-bind="visible: loading">Loading...</div>
83 <table data-bind='foreach: currentTweets' width='100%'>
85 <td><img data-bind='attr: { src: imageUrl }' /></td>
87 <a class='twitterUser' data-bind='attr: { href: userUrl }, text: from_user'> </a>
88 <span data-bind='html: html'> </span>
89 <div class='tweetInfo' data-bind='text: created_at'> </div>