Changeset 204


Ignore:
Timestamp:
Feb 18, 2010, 10:41:10 AM (13 years ago)
Author:
duh
Message:
  • temporary commit
Location:
trunk
Files:
5 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/controllers/dbnp/studycapturing/WizardController.groovy

    r195 r204  
    8787                                                researchQuestion: "",
    8888                                                description: "",
    89                                                 startDate: new Date().format("d/M/yyyy")
     89                                                startDate: new Date()
    9090                                        )
    9191                                }
    92 /*
    93 flow.study.getProperties().constraints.each() { key, value ->
    94         println key
    95         value.getProperties().each() {
    96                 println it
    97         }
    98 }
    99 */
     92
    10093                                // assign template to study
    10194                                flow.study.template = Template.findByName(params.get('template'));
  • trunk/grails-app/views/wizard/pages/_groups.gsp

    r180 r204  
    2222                </g:each>
    2323        </div>
     24        <div class="middle">
     25                <div class="actions">
     26                        <div class="add"></div>
     27                        <div class="remove"></div>
     28                </div>
     29        </div>
    2430        <div class="right">
    2531                <div class="form">
     
    3238                                <div class="label">${group.name}</div>
    3339                                <div class="subjects">
    34                                         <div class="subject">test subject 1</div>
    35                                         <div class="subject">test subject 2</div>
    36                                         <div class="subject">test subject 3</div>
    3740                                </div>
    3841                        </div>
  • trunk/web-app/css/wizard.css

    r192 r204  
    234234    height: 14px;
    235235}
     236.wizard .grouping .middle {
     237    display: inline-block;
     238    float: left;
     239}
     240.wizard .grouping .add {
     241    background: url(../images/wizard/add.png) no-repeat left top;
     242    width: 149px;
     243    height: 29px;
     244    margin-top: 10px;
     245    margin-left: 14px;
     246}
     247.wizard .grouping .add-hover {
     248    background: url(../images/wizard/add-hover.png) no-repeat left top;
     249}
     250.wizard .grouping .remove {
     251    background: url(../images/wizard/remove.png) no-repeat left top;
     252    width: 149px;
     253    height: 29px;
     254    margin-top: 10px;
     255}
     256.wizard .grouping .remove-hover {
     257    background: url(../images/wizard/remove-hover.png) no-repeat left top;   
     258}
    236259.wizard .grouping .right {
    237260    display: inline-block;
     
    245268    border: 1px solid black;
    246269    height: auto;
     270}
     271.wizard .grouping .ui-selected {
     272    border: 4px solid red;
    247273}
    248274.wizard .grouping .group .label {
  • trunk/web-app/js/grouping.js

    r192 r204  
    1919    groupsIdentifier:   null,
    2020    groupIdentifier:    null,
    21 
    22     init: function(itemsIdentifier, itemIdentifier, groupsIdentifier, groupIdentifier) {
     21    addIdentifier:      null,
     22    removeIdentifier:   null,
     23
     24    init: function(itemsIdentifier, itemIdentifier, groupsIdentifier, groupIdentifier, addIdentifier, removeIdentifier) {
    2325        var that = this;
    2426
     
    2729        this.groupsIdentifier   = groupsIdentifier;
    2830        this.groupIdentifier    = groupIdentifier;
    29 
     31        this.addIdentifier      = addIdentifier;
     32        this.removeIdentifier   = removeIdentifier;
     33
     34        this.initAdd();
     35        this.initRemove();
    3036        this.initItems();
    3137        this.initGroupItems();
     
    3642    },
    3743
     44    initAdd: function() {
     45        var that = this;
     46        var add = $(this.addIdentifier);
     47
     48        add.bind('mouseenter mouseleave',function() {
     49            $(this).toggleClass('add-hover');
     50        })
     51
     52        add.bind('click',function() {
     53            that.addSelectedItemsToSelectedGroup();
     54        });
     55    },
     56
     57    addSelectedItemsToSelectedGroup: function() {
     58        var that = this;
     59        var groups = $(this.groupIdentifier, $(this.groupsIdentifier))
     60        var group = $('.ui-selected', groups)
     61        console.log(groups)
     62        console.log(group)
     63    },
     64
     65    initRemove: function() {
     66        var that = this;
     67        var remove = $(this.removeIdentifier);
     68
     69        remove.bind('mouseenter mouseleave',function() {
     70            $(this).toggleClass('remove-hover');
     71        })
     72
     73        remove.bind('click',function() {
     74            console.log('removveeeee!!!!');
     75        })
     76    },
     77
    3878    initItems: function() {
    3979        var that = this;
    40        
     80        console.log($(this.itemsIdentifier).first());
    4181        //$(this.itemsIdentifier).
    4282        $(this.itemsIdentifier).first().selectable({
     
    5090
    5191    initGroups: function() {
     92        var that = this;
     93
     94        // init group items
    5295        this.initGroupItems();
     96       
     97        // init groups
     98        $(this.itemsIdentifier).first().selectable({
     99            filter: that.groupIdentifier,
     100            stop: function() {
     101
     102            }
     103        })
    53104    },
    54105
     
    57108
    58109        $(this.groupsIdentifier).selectable({
    59             filter: that.itemIdentifier
     110            filter: that.groupIdentifier
    60111        })
    61112    }
     
    182233}
    183234*/
    184 
    185 // for debugging purposes this is here
    186 // TODO: to be be migrated to wizard.js....
    187 $(document).ready(function() {
    188     new Grouping().init('div.subjects', 'div.subject', 'div.groups', 'div.group');
    189 });
  • trunk/web-app/js/wizard.js

    r192 r204  
    4343   
    4444    // GROUPING PAGE
    45     //new Grouping().init('div.subjects', 'div.subject', 'div.groups', 'div.group');
     45    new Grouping().init('div.subjects', 'div.subject', 'div.groups', 'div.group','div.add','div.remove');
    4646}
    4747
Note: See TracChangeset for help on using the changeset viewer.