~cdparra/gelee/trunk

« back to all changes in this revision

Viewing changes to webui/ecosystem/workspace/extjs/docs/source/reminder.html

  • Committer: parra
  • Date: 2010-03-15 15:56:56 UTC
  • Revision ID: svn-v4:ac5bba68-f036-4e09-846e-8f32731cc928:trunk/gelee:1448
merged gelee at svn

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<html>
 
2
<head>
 
3
  <title>The source code</title>
 
4
    <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
 
5
    <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
 
6
</head>
 
7
<body  onload="prettyPrint();">
 
8
    <pre class="prettyprint lang-js">Ext.onReady(function(){
 
9
        var win = window.nativeWindow;
 
10
        var opener = Ext.air.NativeWindow.getRootHtmlWindow();
 
11
        var taskId = String(window.location).split('=')[1];
 
12
        
 
13
        var store = opener.tx.data.tasks;
 
14
        var task = store.lookup(taskId);
 
15
        
 
16
        win.title = 'Reminder - ' + Ext.util.Format.ellipsis(task.data.title, 40);
 
17
        
 
18
        bulkUpdate({
 
19
                'task-title' : Ext.util.Format.ellipsis(task.data.title, 80),
 
20
                'task-due' : task.data.dueDate ? task.data.dueDate.format('F d, Y') : 'None'
 
21
        });
 
22
        
 
23
        function bulkUpdate(o){
 
24
                for(var id in o){
 
25
                        Ext.fly(id).update(o[id]);
 
26
                }
 
27
        }
 
28
                
 
29
        var dismiss = new Ext.Button({
 
30
                text: 'Dismiss',
 
31
                minWidth: 80,
 
32
                renderTo: 'btns',
 
33
                handler: function(){
 
34
                        win.close();
 
35
                }
 
36
        });
 
37
        
 
38
        var snooze = new Ext.Button({
 
39
                text: 'Snooze',
 
40
                minWidth: 80,
 
41
                renderTo: 'btns',
 
42
                handler: function(){
 
43
                        var min = parseInt(Ext.get('snooze-time').getValue(), 10);
 
44
                        var reminder = new Date().add('mi', min);
 
45
                        var o = store.getById(taskId);
 
46
                        if(o){
 
47
                                o.set('reminder', reminder);
 
48
                        }else{
 
49
                                store.proxy.table.updateBy({reminder: reminder}, 'where taskId = ?', [taskId]);
 
50
                        }
 
51
                        win.close();
 
52
                }
 
53
        });
 
54
        
 
55
        win.visible = true;
 
56
        win.activate();
 
57
        win.notifyUser('informational');
 
58
        
 
59
        Ext.air.Sound.play('beep.mp3', 10500);
 
60
});
 
61
 
 
62
    
 
63
 
 
64
</pre>    
 
65
</body>
 
66
</html>
 
 
b'\\ No newline at end of file'