Ignore:
Timestamp:
12/09/12 16:49:22 (12 years ago)
Author:
hendrikvanantwerpen
Message:

Put all model dependent code in one place. More separation of general and domain code.

Location:
Dev/branches/rest-dojo-ui/client/rft/pages
Files:
1 added
8 edited
8 moved

Legend:

Unmodified
Added
Removed
  • Dev/branches/rest-dojo-ui/client/rft/pages/index.js

    r410 r417  
    33    '../app/Router',
    44    '../app/Page',
    5     'dojo/text!./index.html'
     5    'dojo/text!./templates/index.html'
    66],function(declare,Router,Page,template){
    77    return declare([Page],{
  • Dev/branches/rest-dojo-ui/client/rft/pages/question.js

    r415 r417  
    88    '../app/Router',
    99    '../app/Page',
    10     '../ui/QuestionEditorPreview',
    11     '../ui/QuestionEditorToolkit',
    12     'dojo/text!./question.html'
     10    '../model/widgets/QuestionEditorPreview',
     11    '../model/widgets/QuestionEditorToolkit',
     12    'dojo/text!./templates/question.html'
    1313],function(declare, Deferred, event, lang, store, Content, Router, Page, QuestionEditorPreview, QuestionEditorToolkit, template){
    1414    return declare([Page], {
  • Dev/branches/rest-dojo-ui/client/rft/pages/questions.js

    r415 r417  
    88    '../app/Router',
    99    '../app/Page',
    10     '../ui/TabbedQuestionBrowser',
    11     'dojo/text!./questions.html'
     10    '../model/widgets/TabbedQuestionBrowser',
     11    'dojo/text!./templates/questions.html'
    1212],function(declare,Deferred,event,lang,store,Content,Router,Page,TabbedQuestionBrowser,template) {
    1313    return declare([Page],{
  • Dev/branches/rest-dojo-ui/client/rft/pages/session.js

    r416 r417  
    99    '../app/Page',
    1010    '../app/Router',
    11     '../ui/ThresholdFilteringSelect',
    12     '../ui/lists/AccountListView',
    13     'dojo/text!./session.html'
     11    '../widgets/ThresholdFilteringSelect',
     12    '../model/widgets/AccountListView',
     13    'dojo/text!./templates/session.html'
    1414],function(array,declare,Deferred,event,lang,search,store,Page,Router,ThresholdFilteringSelect,AccountListView,template){
    1515    return declare([Page],{
  • Dev/branches/rest-dojo-ui/client/rft/pages/sessions.js

    r416 r417  
    66    '../app/Router',
    77    '../app/Page',
    8     '../ui/ObjectBox',
    9     'dojo/text!./sessions.html'
     8    '../widgets/ObjectBox',
     9    'dojo/text!./templates/sessions.html'
    1010],function(declare,lang,dateStamp,store,Router,Page,ObjectBox,template){
    1111    return declare([Page],{
  • Dev/branches/rest-dojo-ui/client/rft/pages/survey.js

    r416 r417  
    88    '../store',
    99    '../app/Page',
    10     '../ui/lists/QuestionListView',
    11     '../ui/TabbedQuestionBrowser',
    12     'dojo/text!./survey.html'
     10    '../model/widgets/QuestionListView',
     11    '../model/widgets/TabbedQuestionBrowser',
     12    'dojo/text!./templates/survey.html'
    1313],function(array,declare,Deferred,event,lang,Router,store,Page,
    1414         QuestionListView,TabbedQuestionBrowser,template){
     
    8181        refresh: function() {
    8282            this.titleNode.innerHTML = this.survey.title || "(set title in properties)";
    83             this.propertiesForm.set('value',this.survey);
     83            this.propertiesDialog.set('value',this.survey);
    8484        },
    8585        _onShowProperties: function(evt) {
     
    8888        _onPropertiesOk: function(evt) {
    8989            this.propertiesDialog.hide();
    90             lang.mixin(this.survey, this.propertiesForm.get('value'));
     90            lang.mixin(this.survey, this.propertiesDialog.get('value'));
    9191            this.refresh();
    9292            event.stop(evt);
     
    9595        _onPropertiesCancel: function(evt) {
    9696            this.propertiesDialog.hide();
    97             this.propertiesForm.set('value',this.survey);
     97            this.propertiesDialog.reset('value',this.survey);
    9898            event.stop(evt);
    9999            return false;
  • Dev/branches/rest-dojo-ui/client/rft/pages/surveys.js

    r416 r417  
    44    'dojo/_base/lang',
    55    'dojo/when',
     6    'rx/rx.dojo',
    67    '../store',
    78    '../app/Content',
    89    '../app/Page',
    910    '../app/Router',
    10     '../ui/LineWithActionsWidget',
    11     'dojo/text!./surveys.html'
    12 ],function(array,declare,lang,when,store,Content,Page,Router,LineWithActionsWidget,template){
     11    '../widgets/LineWithActionsWidget',
     12    'dojo/text!./templates/surveys.html'
     13],function(array,declare,lang,when,Rx,store,Content,Page,Router,LineWithActionsWidget,template){
    1314    return declare([Page],{
    1415        templateString: template,
     
    4748        },
    4849        _onRunSurvey:function(survey){
     50            this.surveyRun = {
     51                type: 'SurveyRun',
     52                surveyId: store.getIdentity(survey),
     53                publicationDate: store.timestamp()
     54            };
     55            this.surveyRunDialog.set('value',this.surveyRun);
    4956            this.surveyRunDialog.show();
     57        },
     58        _onSurveyRunOk: function() {
     59            var surveyRun = lang.mixin(lang.clone(this.surveyRun),this.surveyRunDialog.get('value'));
     60            store.put(surveyRun)
     61            .then(lang.hitch(this,function(){
     62                this.surveyRunDialog.hide();
     63                this.refreshRuns();
     64            }),function(err){
     65                Content.notify(err);
     66            });
     67        },
     68        _onSurveyRunCancel: function() {
     69            this.surveyRunDialog.hide();
    5070        },
    5171        refresh: function() {
     
    131151                array.forEach(surveyRuns,function(surveyRun){
    132152                    var w = new LineWithActionsWidget({
    133                         title: survey.title,
     153                        title: surveyRun.title+" (from "+surveyRun.startDate+" to "+surveyRun.endDate+")",
    134154                        actions:[{
    135155                            callback: lang.hitch(this,'_onCloseRun',surveyRun),
  • Dev/branches/rest-dojo-ui/client/rft/pages/templates/survey.html

    r415 r417  
    3939         data-dojo-attach-point="propertiesDialog"
    4040         data-dojo-attach-event="onSubmit:_onPropertiesOk">
    41 
    42         <div data-dojo-type="rft/ui/model/SurveyForm"
    43               data-dojo-attach-point="propertiesForm"></div>
    44            
    45         <div>
    46             <button data-dojo-type="dijit/form/Button"
    47                     type="submit"
    48                     data-dojo-attach-event="onClick:_onPropertiesOk">
    49                 OK</button>
    50             <button data-dojo-type="dijit/form/Button"
    51                     type="button"
    52                     data-dojo-attach-event="onClick:_onPropertiesCancel">
    53                 Cancel</button>
    54         </div>
    55 
     41        <fieldset data-dojo-type="rft/model/widgets/SurveyFieldset"></fieldset>
     42        <button data-dojo-type="dijit/form/Button"
     43                type="submit"
     44                data-dojo-attach-event="onClick:_onPropertiesOk">
     45            OK</button>
     46        <button data-dojo-type="dijit/form/Button"
     47                type="button"
     48                data-dojo-attach-event="onClick:_onPropertiesCancel">
     49            Cancel</button>
    5650    </div>
    5751
  • Dev/branches/rest-dojo-ui/client/rft/pages/templates/surveys.html

    r415 r417  
    3939         title="SurveyRun properties"
    4040         data-dojo-attach-point="surveyRunDialog">
    41         <form data-dojo-type="rft/ui/model/SurveyRunForm" data-dojo-attach-point="surveyRunForm">
    42             <button data-dojo-type="dijit/form/Button">OK</button>
    43             <button data-dojo-type="dijit/form/Button">Cancel</button>
    44         </form>
     41        <fieldset data-dojo-type="rft/model/widgets/SurveyRunFieldset"></fieldset>
     42        <button data-dojo-type="dijit/form/Button" data-dojo-attach-event="onClick:_onSurveyRunOk">OK</button>
     43        <button data-dojo-type="dijit/form/Button" data-dojo-attach-event="onClick:_onSurveyRunCancel">Cancel</button>
    4544    </div>
    4645
  • Dev/branches/rest-dojo-ui/client/rft/pages/viewSurvey.js

    r415 r417  
    77    '../store',
    88    '../app/Page',
    9     '../ui/model/QuestionWidgetFactory',
    10     'dojo/text!./viewSurvey.html'
     9    '../model/widgets/QuestionWidgetFactory',
     10    'dojo/text!./templates/viewSurvey.html'
    1111],function(array,declare,Deferred,event,lang,store,Page,QuestionWidgetFactory,template){
    1212    return declare([Page],{
Note: See TracChangeset for help on using the changeset viewer.