Ignore:
Timestamp:
03/23/14 22:58:54 (11 years ago)
Author:
hendrikvanantwerpen
Message:
  • Added grey icons for better highlighting, synced block and large buttons.
  • Introduced extra color for text, now disabled/inactive/hovered -> it's not very clear though.
  • Added confirmation on irrevertable actions.
  • Added support for query string in our new request implementation.
Location:
Dev/trunk/src/client/qed-client/pages
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • Dev/trunk/src/client/qed-client/pages/questions.js

    r495 r529  
    5050        },
    5151        onDeleteQuestion: function(question) {
     52            if ( !confirm("Are you sure you want to delete this question?") ) {
     53                return;
     54            }
    5255            questions.remove(question)
    5356            .then(lang.hitch(this,function(){
     
    6265        },
    6366        onPublishQuestion: function(question) {
     67            if ( !confirm("After publication the question cannot be modified anymore, are you sure?") ) {
     68                return;
     69            }
    6470            question.publicationDate = new Date();
    6571            questions.save(question)
  • Dev/trunk/src/client/qed-client/pages/surveyRun.js

    r519 r529  
    4747            .then(lang.hitch(this,function(allResponses){
    4848                array.forEach(allResponses, function(response){
    49                     var actions = {};
     49                    var actions = {}, w;
    5050                    if ( !response.publicationDate ) {
    5151                        actions.Delete = {
    52                             callback: function(){
    53                                 responses.remove(response)
    54                                 .then(function(){
    55                                     w.destroy();
    56                                 });
    57                             },
     52                            callback: lang.hitch(this,function(){
     53                                // We cannot bind _onDeleteResponse
     54                                // directly, because of the
     55                                // initialization problem with w. We
     56                                // need it in the handler, but we need
     57                                // to pass the handler as an argument
     58                                // on the creation of w.
     59                                this._onDeleteResponse(response,w);
     60                            }),
    5861                            properties: {
    5962                                icon: 'Delete',
     
    6265                        };
    6366                    }
    64                     var w = new LineWithActionsWidget({
     67                    w = new LineWithActionsWidget({
    6568                        actions: actions
    6669                    });
     
    7073                }, this);
    7174            }));
     75        },
     76        _onDeleteResponse: function(response,w) {
     77            if ( !confirm("Are you sure you want to delete this survey response?") ) {
     78                return;
     79            }
     80            responses.remove(response)
     81            .then(function(){
     82                w.destroy();
     83            });
    7284        },
    7385        _handlePropChange: function(e) {
  • Dev/trunk/src/client/qed-client/pages/surveys.js

    r508 r529  
    1616            if ( this._started ) { return; }
    1717            this.inherited(arguments);
     18            this.draftsTab.set('title','Drafts (<span class="qedLoading"></span>)');
     19            this.publishedTab.set('title','Published (<span class="qedLoading"></span>)');
     20            this.runsTab.set('title','Runs (<span class="qedLoading"></span>)');
    1821            this.refresh();
    1922        },
     
    2225        },
    2326        _onPublishSurvey:function(survey){
    24             var self = this;
     27            if ( !confirm("After publication the survey cannot be modified anymore, are you sure?") ) {
     28                return;
     29            }
    2530            survey.publicationDate = new Date();
    2631            surveys.save(survey)
    27             .then(function(){
    28                 self.refreshDrafts();
    29                 self.refreshPublished();
    30             },lang.hitch(this,function(err){
     32            .then(lang.hitch(this,function(){
     33                this.refreshDrafts();
     34                this.refreshPublished();
     35            }),lang.hitch(this,function(err){
    3136                this.notify(err.error,'error');
    3237            }));
    3338        },
    3439        _onDeleteSurvey:function(survey){
    35             var self = this;
     40            if ( !confirm("Are you sure you want to delete this draft survey?") ) {
     41                return;
     42            }
    3643            surveys.remove(survey)
    37             .then(function(){
    38                 self.refreshDrafts();
    39             },lang.hitch(this,function(err){
     44            .then(lang.hitch(this,function(){
     45                this.refreshDrafts();
     46            }),lang.hitch(this,function(err){
    4047                this.notify(err.error,'error');
    4148            }));
     
    6269        },
    6370        _onRunDelete: function(surveyRun) {
     71            if ( !confirm("Are you sure you want to delete this survey run?") ) {
     72                return;
     73            }
    6474            surveyRuns.remove(surveyRun)
    6575            .then(lang.hitch(this,function(){
     
    135145                                label: 'Run',
    136146                                tooltip: 'Run survey',
    137                                 icon: 'Run'
     147                                icon: 'Forward'
    138148                            }
    139149                        }]
  • Dev/trunk/src/client/qed-client/pages/templates/surveys.html

    r443 r529  
    88    </div>
    99
    10     <div data-dojo-attach-point="tabContainer" data-dojo-type="dijit/layout/TabContainer" class="blue" data-dojo-props="tabPosition:'left-h',region:'center'">
     10    <div data-dojo-attach-point="tabContainer"
     11         data-dojo-type="dijit/layout/TabContainer"
     12         class="blue" data-dojo-props="tabPosition:'left-h',region:'center'">
    1113
    12         <div data-dojo-type="dijit/layout/BorderContainer" title="Drafts" data-dojo-attach-point="draftsTab">
     14        <div data-dojo-type="dijit/layout/BorderContainer"
     15             title="Drafts"
     16             data-dojo-attach-point="draftsTab">
    1317            <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region: 'center'" data-dojo-attach-point="draftsContainer">
    1418            </div>
     
    1721        </div>
    1822
    19         <div data-dojo-type="dijit/layout/BorderContainer" title="Published" data-dojo-attach-point="publishedTab">
    20             <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region: 'center'" data-dojo-attach-point="publishedContainer">
     23        <div data-dojo-type="dijit/layout/BorderContainer"
     24             title="Published"
     25             data-dojo-attach-point="publishedTab">
     26            <div data-dojo-type="dijit/layout/ContentPane"
     27                 data-dojo-props="region: 'center'"
     28                 data-dojo-attach-point="publishedContainer">
    2129            </div>
    22             <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region: 'bottom'" style="height: 40px;">
     30            <div data-dojo-type="dijit/layout/ContentPane"
     31                 data-dojo-props="region: 'bottom'"
     32                 style="height: 40px;">
    2333            </div>
    2434        </div>
    2535
    26         <div data-dojo-type="dijit/layout/BorderContainer" title="Runs" data-dojo-attach-point="runsTab">
    27             <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region: 'center'" data-dojo-attach-point="runsContainer">
     36        <div data-dojo-type="dijit/layout/BorderContainer"
     37             title="Runs"
     38             data-dojo-attach-point="runsTab">
     39            <div data-dojo-type="dijit/layout/ContentPane"
     40                 data-dojo-props="region: 'center'"
     41                 data-dojo-attach-point="runsContainer">
    2842            </div>
    29             <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region: 'bottom'" style="height: 40px;">
     43            <div data-dojo-type="dijit/layout/ContentPane"
     44                 data-dojo-props="region: 'bottom'"
     45                 style="height: 40px;">
    3046            </div>
    3147        </div>
    3248    </div>
    3349
    34     <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region: 'bottom'" style="height: 40px;">
    35         <button data-dojo-type="dijit/form/Button" class="blue" data-dojo-props="baseClass: 'rftBlockButton', iconClass: 'rftIcon rftIconNew'" data-dojo-attach-event="onClick:_onNewSurvey">New survey</button>
     50    <div data-dojo-type="dijit/layout/ContentPane"
     51         data-dojo-props="region: 'bottom'"
     52         style="height: 40px;">
     53        <button data-dojo-type="dijit/form/Button"
     54                class="blue"
     55                data-dojo-props="baseClass: 'rftLargeButton', iconClass: 'rftIcon rftIconNew'"
     56                data-dojo-attach-event="onClick:_onNewSurvey">New survey</button>
    3657    </div>
    3758
Note: See TracChangeset for help on using the changeset viewer.