Ignore:
Timestamp:
03/15/14 01:00:23 (11 years ago)
Author:
hendrikvanantwerpen
Message:
  • Support different environments with QED_ENV. If dev, run against qed-dev database, if production, run against qed database. The UI indicates if we are running in anything but production mode.
  • Return undefined if we allow page leaves, because null is treated as a value.
  • Changed format of design docs, so it can work for different databases.
  • Use correct design documents in configCouch, so server now actually updates them when it starts.
Location:
Dev/trunk/src/client/qed-client
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • Dev/trunk/src/client/qed-client/app/Router.js

    r515 r519  
    2929            this._handleHashChange(hash());
    3030            window.onbeforeunload = function(evt) {
    31                 var msg = Content.isDirty() ?
    32                         "Unsaved changes, leave anyway?" :
    33                         null;
    34                 evt.returnValue = msg;
     31                var msg;
     32                if ( Content.isDirty() ) {
     33                    msg = "Unsaved changes, leave anyway?";
     34                    evt.returnValue = msg;
     35                }
    3536                return msg;
    3637            };
  • Dev/trunk/src/client/qed-client/css/ui/topbar.less

    r443 r519  
    66        float: left;
    77        clear: left;
     8    }
     9   
     10    #qedModeNode {
     11        float: left;
     12        margin-top: 28px;
    813    }
    914   
  • Dev/trunk/src/client/qed-client/index.js

    r472 r519  
    55    "./ui/MainMenu",
    66    "dojo/_base/array",
     7    "dojo/_base/xhr",
     8    "dojo/dom",
    79    "dojo/parser",
    810    "./stddeps",
    911    "dojo/domReady!"
    10 ], function(Router, routes, session, MainMenu, array, parser) {
     12], function(Router, routes, session, MainMenu, array, xhr, dom, parser) {
    1113
    1214    parser.parse();
    1315
    1416    new MainMenu({},"menu").startup();
     17
     18    xhr("GET", {
     19        url: 'api/mode',
     20        handleAs: 'json'
     21    }).then(function(result){
     22        var node = dom.byId('qedModeNode');
     23        if ( result.mode !== 'production' ) {
     24            node.innerHTML = "Running in "+result.mode+" mode";
     25        }
     26    });
    1527
    1628    array.forEach(routes,function(route){
  • Dev/trunk/src/client/qed-client/pages/surveyRun.js

    r506 r519  
    4747            .then(lang.hitch(this,function(allResponses){
    4848                array.forEach(allResponses, function(response){
    49                     var actions = {
    50                         view: {
    51                             callback: function(){},
     49                    var actions = {};
     50                    if ( !response.publicationDate ) {
     51                        actions.Delete = {
     52                            callback: function(){
     53                                responses.remove(response)
     54                                .then(function(){
     55                                    w.destroy();
     56                                });
     57                            },
    5258                            properties: {
    53                                 title: "View response"
    54                             }
    55                         }
    56                     };
    57                     if ( !response.publicationDate ) {
    58                         actions.remove = {
    59                             callback: function(){},
    60                             properties: {
    61                                 title: "Remove response"
     59                                icon: 'Delete',
     60                                title: "Delete response"
    6261                            }
    6362                        };
Note: See TracChangeset for help on using the changeset viewer.