Ignore:
Timestamp:
03/13/13 17:07:58 (12 years ago)
Author:
hendrikvanantwerpen
Message:

Added grunt tasks and code cleanup.

Added grunt for less and jshint procesing.
Cleanup of code to pass jshint (one bug found :).

Location:
Dev/trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • Dev/trunk

    • Property svn:ignore
      •  

        old new  
        11data
        22nbproject
         3node_modules
  • Dev/trunk/client

    • Property svn:externals
      •  

        old new  
        1 dojo http://svn.dojotoolkit.org/src/tags/release-1.8.0/dojo
        2 dijit http://svn.dojotoolkit.org/src/tags/release-1.8.0/dijit
        3 dojox http://svn.dojotoolkit.org/src/tags/release-1.8.0/dojox
        4 util http://svn.dojotoolkit.org/src/tags/release-1.8.0/util
         1dojo http://svn.dojotoolkit.org/src/tags/release-1.8.3/dojo
         2dijit http://svn.dojotoolkit.org/src/tags/release-1.8.3/dijit
         3dojox http://svn.dojotoolkit.org/src/tags/release-1.8.3/dojox
         4util http://svn.dojotoolkit.org/src/tags/release-1.8.3/util
  • Dev/trunk/client/qed/widgets/LineWithActionsWidget.js

    r417 r426  
    4242                        title: this.actions[action].properties.tooltip,
    4343                        onClick: lang.hitch(this, function(action, e){
    44                             action.callback && action.callback(e);
     44                            if ( action.callback ) { action.callback(e); }
    4545                            event.stop(e);
    4646                            return false;
     
    5656                        title: this.actions[action].properties.tooltip,
    5757                        onClick: lang.hitch(this, function(action, e){
    58                             action.callback && action.callback(e);
     58                            if ( action.callback ) { action.callback(e); }
    5959                            event.stop(e);
    6060                            return false;
     
    7575            return !preventDefault;
    7676        },
    77         onClick: function(e) {
     77        onClick: function(/*e*/) {
    7878        },
    7979        _setTitleAttr: function(value){
  • Dev/trunk/client/qed/widgets/MultipleChoiceWidget.js

    r417 r426  
    33    'dijit/_TemplatedMixin','dijit/_WidgetsInTemplateMixin','dijit/_Container',
    44    'dojo/text!./templates/MultipleChoiceWidget.html',
    5     'dijit/form/RadioButton','dijit/form/CheckBox','dijit/form/TextBox','dijit/form/Button'],
    6     function(declare,array,lang,domConstruct,registry,_WidgetBase,_TemplatedMixin,
    7         _WidgetsInTemplateMixin,_Container,
    8         templateString,RadioButton,CheckBox,TextBox,Button){
    9         return declare([_WidgetBase,_TemplatedMixin,_WidgetsInTemplateMixin,_Container],{
    10             templateString: templateString,
    11             multiple: true,
    12             baseClass: 'rftMultipleChoiceWidget',
    13            
    14             allowMultiple: false,
    15             name: '',
    16             value: null,
    17            
    18             _widgetCache: null,
    19             constuctor: function() {
    20                 this.inherited(arguments);
    21                 this.value = [];
    22                 this._widgetCache = {};
    23             },
    24             _setValueAttr: function(value) {
    25                 this.reset();
    26                 this.value = value;
    27                 array.forEach(this.value,lang.hitch(this,function(val){
    28                     this._addRow(val);
    29                 }));
    30             },
    31             _getValueAttr: function() {
    32                 var value = [];
    33                 registry.findWidgets(this.domNode).forEach(function(w){
    34                     w.isInstanceOf(TextBox) && value.push(w.get('value'));
    35                 });
    36                 this.value = value;
    37                 return value;
    38             },
    39             reset: function() {
    40                 this._removeWidgetsBelowNode(this.rows);
    41                 domConstruct.empty(this.rows);
    42             },
    43             _onAddRow: function() {
    44                 this._addRow();
    45             },
    46             _addRow: function(value,tagRow,pos) {
    47                 var row = domConstruct.create('div',{'class':'row'});
    48                 if ( this.allowMultiple ) {
    49                     new CheckBox({
    50                         name:this.name,
    51                         'class':'rowBox',
    52                         disabled: this.mode == 'edit'
    53                     }).placeAt(row);
    54                 } else {
    55                     new RadioButton({
    56                         name:this.name,
    57                         'class':'rowBox',
    58                         disabled: this.mode == 'edit'
    59                     }).placeAt(row);
    60                 }
    61                 new TextBox({
     5    'dijit/form/RadioButton','dijit/form/CheckBox','dijit/form/TextBox','dijit/form/Button'
     6], function(declare,array,lang,domConstruct,registry,_WidgetBase,_TemplatedMixin,
     7    _WidgetsInTemplateMixin,_Container, templateString,RadioButton,CheckBox,TextBox,Button){
     8    return declare([_WidgetBase,_TemplatedMixin,_WidgetsInTemplateMixin,_Container],{
     9        templateString: templateString,
     10        multiple: true,
     11        baseClass: 'rftMultipleChoiceWidget',
     12       
     13        allowMultiple: false,
     14        name: '',
     15        value: null,
     16       
     17        _widgetCache: null,
     18        constuctor: function() {
     19            this.inherited(arguments);
     20            this.value = [];
     21            this._widgetCache = {};
     22        },
     23        _setValueAttr: function(value) {
     24            this.reset();
     25            this.value = value;
     26            array.forEach(this.value,lang.hitch(this,function(val){
     27                this._addRow(val);
     28            }));
     29        },
     30        _getValueAttr: function() {
     31            var value = [];
     32            registry.findWidgets(this.domNode).forEach(function(w){
     33                if ( w.isInstanceOf(TextBox) ) { value.push(w.get('value')); }
     34            });
     35            this.value = value;
     36            return value;
     37        },
     38        reset: function() {
     39            this._removeWidgetsBelowNode(this.rows);
     40            domConstruct.empty(this.rows);
     41        },
     42        _onAddRow: function() {
     43            this._addRow();
     44        },
     45        _addRow: function(value,tagRow,pos) {
     46            var row = domConstruct.create('div',{'class':'row'});
     47            if ( this.allowMultiple ) {
     48                new CheckBox({
    6249                    name:this.name,
    63                     value:value || '',
    64                     'class':'rowText'
     50                    'class':'rowBox',
     51                    disabled: this.mode === 'edit'
    6552                }).placeAt(row);
    66                 new Button({
    67                     label:'-',
    68                     'class':'rowBtn',
    69                     onClick:lang.hitch(this,'_removeNodeWithWidgets',row)
     53            } else {
     54                new RadioButton({
     55                    name:this.name,
     56                    'class':'rowBox',
     57                    disabled: this.mode === 'edit'
    7058                }).placeAt(row);
    71                 new Button({
    72                     label:'+',
    73                     'class':'rowBtn',
    74                     onClick:lang.hitch(this,'_addRow','',row,'before')
    75                 }).placeAt(row);
    76                 domConstruct.place(row,tagRow || this.rows,pos||'last');
    77             },
    78             _removeNodeWithWidgets: function(node) {
    79                 this._removeWidgetsBelowNode(node);
    80                 domConstruct.destroy(node);
    81             },
    82             _removeWidgetsBelowNode: function(node) {
    83                 registry.findWidgets(node).forEach(function(w){
    84                     w.destroyRecursive();
    85                 });
    86             },
    87             _onRowChange: function(row) {
    88                
    8959            }
    90         });
     60            new TextBox({
     61                name:this.name,
     62                value:value || '',
     63                'class':'rowText'
     64            }).placeAt(row);
     65            new Button({
     66                label:'-',
     67                'class':'rowBtn',
     68                onClick:lang.hitch(this,'_removeNodeWithWidgets',row)
     69            }).placeAt(row);
     70            new Button({
     71                label:'+',
     72                'class':'rowBtn',
     73                onClick:lang.hitch(this,'_addRow','',row,'before')
     74            }).placeAt(row);
     75            domConstruct.place(row,tagRow || this.rows,pos||'last');
     76        },
     77        _removeNodeWithWidgets: function(node) {
     78            this._removeWidgetsBelowNode(node);
     79            domConstruct.destroy(node);
     80        },
     81        _removeWidgetsBelowNode: function(node) {
     82            registry.findWidgets(node).forEach(function(w){
     83                w.destroyRecursive();
     84            });
     85        },
     86        _onRowChange: function(/*row*/) {}
    9187    });
     88});
  • Dev/trunk/client/qed/widgets/ObjectBox.js

    r417 r426  
    4343                line3Actions[action] = {
    4444                    callback: lang.hitch(this, function(callback){
    45                         this.value && callback(this.value);
     45                        if ( this.value ) { callback(this.value); }
    4646                    }, this.actions[action]),
    4747                    properties: {
     
    5454            return line3Actions;
    5555        },
    56         _showInfoBox: function() {
    57             alert(this.value.description);
    58         },
     56        _showInfoBox: function() {},
    5957        _setValueAttr: function(value) {
    6058            this.value = value;
  • Dev/trunk/client/qed/widgets/Selector.js

    r417 r426  
    7070                                        action.callback),
    7171                        properties: {
    72                              blockButton: true,
    73                              label: action.title || actionName,
    74                              icon: action.icon,
    75                              tooltip: action.description
    76                          }
     72                            blockButton: true,
     73                            label: action.title || actionName,
     74                            icon: action.icon,
     75                            tooltip: action.description
     76                        }
    7777
    7878                    };
     
    145145                this._folded = true;
    146146            }
    147             evt && event.stop(evt);
     147            if ( evt ) { event.stop(evt); }
    148148            return false;
    149149        },
     
    174174        },
    175175
    176         onSelect: function(item) {}
     176        onSelect: function(/*item*/) {}
    177177    });
    178178});
  • Dev/trunk/client/qed/widgets/ThresholdFilteringSelect.js

    r417 r426  
    44], function(declare, FilteringSelect) {
    55    return declare(FilteringSelect, {
    6          // custom min input character count to trigger search
    7          minKeyCount: 3,
     6        // custom min input character count to trigger search
     7        minKeyCount: 3,
    88
    9          // override search method, count the input length
    10          _startSearch: function (/*String*/key) {
    11              if (!key || key.length < this.minKeyCount) {
    12                  this.closeDropDown();
    13                  return;
    14              }
    15              this.inherited(arguments);
    16          }
     9        // override search method, count the input length
     10        _startSearch: function (/*String*/key) {
     11            if (!key || key.length < this.minKeyCount) {
     12                this.closeDropDown();
     13                return;
     14            }
     15            this.inherited(arguments);
     16        }
    1717    });
    1818});
  • Dev/trunk/client/qed/widgets/list/List.js

    r420 r426  
    5252            };
    5353        },
    54         _createListNode: function(item) {},
    55         _createAvatarNode: function(item) {},
     54        _createListNode: function(/*item*/) {},
     55        _createAvatarNode: function(/*item*/) {},
    5656
    5757        appendItem: function(item) {
     
    8686            .forEach(lang.hitch(this,function(node){
    8787                registry.byNode(node).destroyRecursive();
    88                 this.removeCallback && this.removeCallback(item);
     88                if ( this.removeCallback ) { this.removeCallback(item); }
    8989            }));
    9090            this.source.sync();
  • Dev/trunk/client/qed/widgets/list/OrderedList.js

    r407 r426  
    55    './List',
    66    'dojo/text!./templates/OrderedList.html'
    7     ],function(
    8         declare,
    9         lang,
    10         Button,
    11         List,
    12         templateString
    13         ){
    14         return declare([List],{
    15             templateString: templateString,
    16             baseClass: 'rftLineListView',
     7],function(
     8    declare,
     9    lang,
     10    Button,
     11    List,
     12    templateString
     13    ){
     14    return declare([List],{
     15        templateString: templateString,
     16        baseClass: 'rftLineListView',
    1717
    18             startup: function() {
    19                 if ( this._started ){ return; }
    20                 this.inherited(arguments);
     18        startup: function() {
     19            if ( this._started ){ return; }
     20            this.inherited(arguments);
    2121
    22                 new Button({
    23                     label: "Move up",
    24                     showLabel: false,
    25                     iconClass: "rftIcon rftIconFullArrowUp",
    26                     baseClass: "rftBlockButton",
    27                     'class': "trans",
    28                     onClick: lang.hitch(this, function() {
    29                         this._moveSelectedItem("up");
    30                     })
    31                 }, this.btnListMoveUp).startup();
     22            new Button({
     23                label: "Move up",
     24                showLabel: false,
     25                iconClass: "rftIcon rftIconFullArrowUp",
     26                baseClass: "rftBlockButton",
     27                'class': "trans",
     28                onClick: lang.hitch(this, function() {
     29                    this._moveSelectedItem("up");
     30                })
     31            }, this.btnListMoveUp).startup();
    3232
    33                 new Button({
    34                     label: "Move down",
    35                     showLabel: false,
    36                     iconClass: "rftIcon rftIconFullArrowDown",
    37                     baseClass: "rftBlockButton",
    38                     'class': "trans",
    39                     onClick: lang.hitch(this, function() {
    40                         this._moveSelectedItem("down");
    41                     })
    42                 }, this.btnListMoveDown).startup();
    43             },
     33            new Button({
     34                label: "Move down",
     35                showLabel: false,
     36                iconClass: "rftIcon rftIconFullArrowDown",
     37                baseClass: "rftBlockButton",
     38                'class': "trans",
     39                onClick: lang.hitch(this, function() {
     40                    this._moveSelectedItem("down");
     41                })
     42            }, this.btnListMoveDown).startup();
     43        },
    4444
    45             _moveSelectedItem: function(dir) {
    46                 var node = this.source.getSelectedNodes()[0];
    47                 if (node) {
    48                     if (dir === "up") {
    49                         if (node.previousSibling) {
    50                             return node.parentNode.insertBefore(node, node.previousSibling);
    51                         } else {
    52                             return false;
    53                         }
     45        _moveSelectedItem: function(dir) {
     46            var node = this.source.getSelectedNodes()[0];
     47            if (node) {
     48                if (dir === "up") {
     49                    if (node.previousSibling) {
     50                        return node.parentNode.insertBefore(node, node.previousSibling);
     51                    } else {
     52                        return false;
     53                    }
    5454
    55                     } else if (dir === "down") {
    56                         if (node.nextSibling) {
    57                             return node.parentNode.insertBefore(node.nextSibling, node);
    58                         } else {
    59                             return false;
    60                         }
     55                } else if (dir === "down") {
     56                    if (node.nextSibling) {
     57                        return node.parentNode.insertBefore(node.nextSibling, node);
    6158                    } else {
    62                         throw "Invalid move direction passed!";
     59                        return false;
    6360                    }
    6461                } else {
    65                     return false;
     62                    throw "Invalid move direction passed!";
    6663                }
    67             },
     64            } else {
     65                return false;
     66            }
     67        },
    6868
    69             insertItem: function(item) {
    70                 var anchor = this.source.getSelectedNodes()[0];
    71                 if (anchor) {
    72                     this.source.insertNodes(false,[item], false, anchor);
    73                 } else {
    74                     this.appendItem(item);
    75                 }
     69        insertItem: function(item) {
     70            var anchor = this.source.getSelectedNodes()[0];
     71            if (anchor) {
     72                this.source.insertNodes(false,[item], false, anchor);
     73            } else {
     74                this.appendItem(item);
    7675            }
     76        }
    7777
    78         });
    7978    });
     79});
  • Dev/trunk/client/qed/widgets/list/_EditableListMixin.js

    r407 r426  
    99            .map(function(node){
    1010                var value = registry.byId(node.id).get('value');
    11                 this.source.setItem(node.id, value)
     11                this.source.setItem(node.id, value);
    1212                return value;
    1313            },this);
Note: See TracChangeset for help on using the changeset viewer.