X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/ee06f37b0f6f6d94cd05a6ffae556660f7c4a2bc..c930e9176a5a85509c5b0230e2bff5c22a591432:/docs/source/reminder.html diff --git a/docs/source/reminder.html b/docs/source/reminder.html new file mode 100644 index 00000000..7beaac7d --- /dev/null +++ b/docs/source/reminder.html @@ -0,0 +1,66 @@ + + + The source code + + + + +
Ext.onReady(function(){
+	var win = window.nativeWindow;
+	var opener = Ext.air.NativeWindow.getRootHtmlWindow();
+	var taskId = String(window.location).split('=')[1];
+	
+	var store = opener.tx.data.tasks;
+	var task = store.lookup(taskId);
+	
+	win.title = 'Reminder - ' + Ext.util.Format.ellipsis(task.data.title, 40);
+	
+	bulkUpdate({
+		'task-title' : Ext.util.Format.ellipsis(task.data.title, 80),
+		'task-due' : task.data.dueDate ? task.data.dueDate.format('F d, Y') : 'None'
+	});
+	
+	function bulkUpdate(o){
+		for(var id in o){
+			Ext.fly(id).update(o[id]);
+		}
+	}
+		
+	var dismiss = new Ext.Button({
+		text: 'Dismiss',
+		minWidth: 80,
+		renderTo: 'btns',
+		handler: function(){
+			win.close();
+		}
+	});
+	
+	var snooze = new Ext.Button({
+		text: 'Snooze',
+		minWidth: 80,
+		renderTo: 'btns',
+		handler: function(){
+			var min = parseInt(Ext.get('snooze-time').getValue(), 10);
+			var reminder = new Date().add('mi', min);
+			var o = store.getById(taskId);
+			if(o){
+				o.set('reminder', reminder);
+			}else{
+				store.proxy.table.updateBy({reminder: reminder}, 'where taskId = ?', [taskId]);
+			}
+			win.close();
+		}
+	});
+	
+	win.visible = true;
+	win.activate();
+	win.notifyUser('informational');
+	
+	Ext.air.Sound.play('beep.mp3', 10500);
+});
+
+    
+
+
+ + \ No newline at end of file