Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- $(document).on("pagecreate", "#page1", function()
- {
- $('#mydate').bind('change', function() {
- var mytime = $('#mydate').datebox('getTheDate');
- });
- });
- $(document).on("pagecreate", "#page1", function(event)
- {
- showTodo();
- });
- function Item(name, note, date, value, vibration, volume)
- {
- this.name = name;
- this.note = note;
- this.date = date;
- this.value = value;
- this.vibration = vibration;
- this.volume = volume;
- }
- function saveTodo()
- {
- var indx = localStorage.length;
- var todoText = $("#taskName").val();
- var newItem = new Item(todoText, "gr", "rg", "wd", "ad", "wd");
- var stringObject = JSON.stringify(newItem);
- if (todoText.length)
- {
- localStorage.setItem('task_' + indx, stringObject);//['task_' + indx] = stringObject;
- //localStorage.setItem('task_'+indx,todoText);
- indx++;
- }
- showTodo();
- }
- /*
- <div data-role="collapsible" id="set1" data-collapsed="true">
- <h3>Section 1</h3>
- <p>I'm the collapsible content.</p>
- </div>
- */
- function clearTodo()
- {
- localStorage.clear();
- indx = localStorage.length;
- $("#todoList").empty();
- }
- function showTodo()
- {
- //$('.list').collapsible({refresh: true});
- var todoText;
- var content = "pico";
- $("#todoList").empty();
- for (var i = 0; i < localStorage.length; i++)
- {
- todoText = localStorage.getItem('task_' + i);
- var item = JSON.parse(todoText);
- $("#todoList").append("<div data-role=\"collapsible\" id=\"set1\" data-collapsed=\"true\" class='items'>" + "<h3>" + item.name + "</h3>" +
- "<p>" + content + "</p></div>");
- }
- $('.items').collapsible({refresh: true});
- }
Advertisement
Add Comment
Please, Sign In to add comment