reminder.html (Case Conflict 1)
资源名称:ext-3.0.0.zip [点击查看]
上传用户:shuoshiled
上传日期:2018-01-28
资源大小:10124k
文件大小:1k
源码类别:
中间件编程
开发平台:
JavaScript
- <html>
- <head>
- <title>The source code</title>
- <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
- <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
- </head>
- <body onload="prettyPrint();">
- <pre class="prettyprint lang-js">tx.ReminderManager = function(){
- var table;
- var run = function(){
- var rs = table.selectBy('where completed = 0 AND reminder <> '' AND reminder <= ?', [new Date()]);
- for(var i = 0, len = rs.length; i < len; i++){
- showReminder.defer(10, window, [rs[i]]);
- }
- };
- var showReminder = function(task){
- var o;
- if (o = tx.data.tasks.getById(task.taskId)) { // if currently loaded
- o.set('reminder', '');
- }
- else { // else update db directly
- table.update({
- taskId: task.taskId,
- reminder: ''
- });
- }
- Ext.air.NativeWindowManager.getReminderWindow(task.taskId);
- }
- return {
- init : function(){
- table = tx.data.conn.getTable('task', 'taskId');
- setInterval(run, 10000);
- }
- }
- }();
- </pre>
- </body>
- </html>