Ignore:
Timestamp:
02/14/12 18:22:25 (13 years ago)
Author:
hendrikvanantwerpen
Message:
  • Clear LoginDialog? on show (in case of re-show).
  • Allow to link nodes/widgets to rft.ui.Page members with data-rft-attach-point attribute.
  • Allow arguments to a page to be passed with data-rft-props argument. Content loader rft.content sets this argument on the top node of a loaded page.
  • Have longer cookie-lifetime and update cookie when session is restored. Allow session restore in API and client code.
  • Moved startup Javascript to rft/run.js.
Location:
Dev/branches/rest-dojo-ui/client/rft/ui
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • Dev/branches/rest-dojo-ui/client/rft/ui/LoginDialog.html

    r256 r260  
    66        </span>
    77    </div>
    8     <form data-dojo-type="dijit.form.Form" data-dojo-attach-point="loginForm">
    9         <fieldset>
    10             <label for="username" class="loginLabel">Email</label>
    11             <input data-dojo-type="dijit.form.TextBox" name="username" type="text" class="loginInput" />
    12             <label for="password" class="loginLabel">Password</label>
    13             <input data-dojo-type="dijit.form.TextBox" name="password" type="password" class="loginInput" />
    14         </fieldset>
    15     </form>
    16     <button type="button" data-dojo-type="dijit.form.Button" data-dojo-attach-event="onClick:onLogin">Login</button>
    17     <button type="button" data-dojo-type="dijit.form.Button" data-dojo-attach-event="onClick:onCancel">Cancel</button>
    18     <div data-dojo-attach-point="loginErrors"></div>
    19     <div data-dojo-attach-point="containerNode"></div>
     8    <div data-dojo-attach-point="containerNode">
     9        <form data-dojo-type="dijit.form.Form" data-dojo-attach-point="loginForm">
     10            <fieldset>
     11                <label for="username" class="loginLabel">Email</label>
     12                <input data-dojo-type="dijit.form.TextBox" name="username" type="text" class="loginInput" />
     13                <label for="password" class="loginLabel">Password</label>
     14                <input data-dojo-type="dijit.form.TextBox" name="password" type="password" class="loginInput" />
     15            </fieldset>
     16        </form>
     17        <button type="button" data-dojo-type="dijit.form.Button" data-dojo-attach-event="onClick:onLogin">Login</button>
     18        <button type="button" data-dojo-type="dijit.form.Button" data-dojo-attach-event="onClick:onCancel">Cancel</button>
     19        <div data-dojo-attach-point="loginErrors"></div>
     20    </div>
    2021</div>
  • Dev/branches/rest-dojo-ui/client/rft/ui/LoginDialog.js

    r256 r260  
    88            title: "Login",
    99            baseClass: "rftLoginDialog",
     10            show: function() {
     11                this.loginErrors.innerHTML = '';
     12                this.loginForm.reset();
     13                this.inherited(arguments);
     14            },
    1015            onLogin: function() {
    1116                this.loginErrors.innerHTML = '';
     
    1520                .then(function() {
    1621                    hide();
    17                     content.initial("sessions");
     22                    content.initial();
    1823                },function() {
    1924                    this.loginErrors.innerHTML = 'Login failed.';
  • Dev/branches/rest-dojo-ui/client/rft/ui/Page.js

    r257 r260  
    1 define(['dojo/_base/declare','dijit/_WidgetBase','dijit/_Container'],
    2 function(declare,_WidgetBase,_Container){
    3     return declare('rft.ui.Page',[_WidgetBase,_Container],{
    4         init: function(args){
    5         }
     1define(['dojo/_base/declare','dojo/query','dojo/_base/json','dojo/dom-attr','dojo/_base/lang','dijit/registry','dijit/_WidgetBase','dijit/_Container'],
     2    function(declare,query,json,attr,lang,registry,_WidgetBase,_Container){
     3        return declare('rft.ui.Page',[_WidgetBase,_Container],{
     4            postCreate: function() {
     5                this.inherited(arguments);
     6                this.args = {};
     7                var props = attr.get(this.domNode,'data-rft-props');
     8                if ( props ) {
     9                    props = json.fromJson.call(this,'{'+props+'}');
     10                    lang.mixin(this.args,props);
     11                }
     12            },
     13            startup: function() {
     14                this.inherited(arguments);
     15                query('[data-rft-attach-point]').forEach(lang.hitch(this,function(node){
     16                    var name = attr.get(node,'data-rft-attach-point');
     17                    this[name] = registry.byNode(node) || node;
     18                }));
     19                this.init();
     20            },
     21            init: function(){}
     22        });
    623    });
    7 });
Note: See TracChangeset for help on using the changeset viewer.