ko-archetype/src/main/resources/archetype-resources/src/main/resources/index.html
author Jaroslav Tulach <jaroslav.tulach@apidesign.org>
Mon, 13 May 2013 16:31:21 +0200
changeset 1205 1901da93f3f2
parent 1202 5f04bdbc6ee1
child 1209 bf622f485775
permissions -rw-r--r--
Better description and use substitution to generate the correct package, artifactId and version
     1 <?xml version="1.0" encoding="UTF-8"?>
     2 
     3 <!--
     4     Copied from knockout.js Twitter example:
     5     http://knockoutjs.com/examples/twitter.html
     6 -->
     7 
     8 <!DOCTYPE html>
     9 <html xmlns="http://www.w3.org/1999/xhtml">
    10     <head>
    11         <title>Bck2Brwsr's Twitter</title>
    12     </head>
    13     <body>
    14         <link href='twitterExample.css' rel='Stylesheet' ></link>
    15         
    16         <style type='text/css'>
    17            .liveExample select { height: 1.7em; }
    18            .liveExample button { height: 2em; }
    19         </style>
    20         
    21         
    22         <h2>Bck2Brwsr's Twitter</h2>
    23         
    24         <p>
    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.The Java source code has about 190 lines 
    30         - in fact it may even be more dense than the original JavaScript model.
    31         </p>
    32         <p>
    33         The project has two profiles. Either it executes in real Java virtual
    34         machine and renders using JavaFX's WebView (use <code>fxbrwsr</code> profile
    35         - the default). It can also run directly in a browser via
    36         <a href="http://bck2brwsr.apidesign.org">Bck2Brwsr</a> virtual machine
    37         (use <code>bck2brwsr</code> profile).
    38         </p>
    39         
    40         <div class='liveExample'>
    41             <div class='configuration'>
    42                 <div class='listChooser'>
    43                     <button data-bind='click: deleteList, enable: activeTweetersName'>Delete</button>
    44                     <button data-bind='click: saveChanges, enable: hasUnsavedChanges'>Save</button> 
    45                     <select data-bind='options: savedLists, optionsValue: "name", value: activeTweetersName'> </select>
    46                 </div>
    47 
    48                 <p>Currently viewing <span data-bind='text: activeTweetersCount'> </span> user(s):</p>
    49                 <div class='currentUsers' >
    50                     <ul data-bind='foreach: activeTweeters'>
    51                         <li>
    52                             <button data-bind='click: $root.removeUser'>Remove</button>
    53                             <div data-bind='text: $data'> </div>
    54                         </li>
    55                     </ul>
    56                 </div>
    57 
    58                 <form data-bind='submit: addUser'>
    59                     <label>Add user:</label>
    60                     <input data-bind='value: userNameToAdd, valueUpdate: "keyup", css: { invalid: !userNameToAddIsValid() }' />
    61                     <button data-bind='enable: userNameToAddIsValid' type='submit'>Add</button>
    62                 </form>
    63             </div>
    64             <div class='tweets'>
    65                 <div class='loadingIndicator'>Loading...</div>
    66                 <table data-bind='foreach: currentTweets' width='100%'>
    67                     <tr>
    68                         <td><img data-bind='attr: { src: profile_image_url }' /></td>
    69                         <td>
    70                             <a class='twitterUser' data-bind='attr: { href: userUrl }, text: from_user'> </a>
    71                             <span data-bind='html: html'> </span>
    72                             <div class='tweetInfo' data-bind='text: created_at'> </div>
    73                         </td>
    74                     </tr>
    75                 </table>
    76             </div>
    77         </div>
    78         
    79         <script src="bck2brwsr.js"></script>
    80         <script type="text/javascript">
    81             var vm = bck2brwsr('${artifactId}-${version}.jar');
    82             vm.loadClass('${package}.TwitterClient');
    83         </script>
    84 
    85 
    86     </body>
    87 </html>