├── .gitignore ├── .jscsrc ├── .jshintrc ├── .travis.yml ├── LICENSE.txt ├── README.md ├── bower.json ├── build ├── jqm.editable.listview.css ├── jqm.editable.listview.js ├── jqm.editable.listview.min.css └── jqm.editable.listview.min.js ├── css └── editable-listview.css ├── demo ├── demo.css └── index.html ├── editable-listview.png ├── gulpfile.js ├── js └── editable-listview.js ├── package.json └── tests ├── functional ├── casper.spec.js └── simple.html └── index.html /.gitignore: -------------------------------------------------------------------------------- 1 | bower_components/**/* 2 | node_modules/**/* 3 | wiki/**/* -------------------------------------------------------------------------------- /.jscsrc: -------------------------------------------------------------------------------- 1 | { 2 | "preset": "jquery" 3 | } 4 | -------------------------------------------------------------------------------- /.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "maxerr" : 100, // {int} maximum amount of warnings JSHint will produce before giving up. Default: 50. 3 | "regexp" : true, // ? 4 | 5 | // Enforcing 6 | "bitwise" : true, // true: Prohibit bitwise operators (&, |, ^, etc.) 7 | "curly" : true, // true: Require {} for every new block or scope 8 | "eqeqeq" : true, // true: Require triple equals (===) for comparison 9 | "forin" : true, // true: Require filtering for..in loops with obj.hasOwnProperty() 10 | "freeze" : true, // true: prohibits overwriting prototypes of native objects such as Array, Date etc. 11 | "latedef" : true, // true: Require variables/functions to be defined before being used 12 | "noarg" : true, // true: Prohibit use of `arguments.caller` and `arguments.callee` 13 | "nonbsp" : true, // true: Prohibit "non-breaking whitespace" characters. 14 | "nonew" : true, // true: Prohibit use of constructors for side-effects (without assignment) 15 | "plusplus" : false, // true: Prohibit use of `++` & `--` 16 | "undef" : true, // true: Require all non-global variables to be declared (prevents global leaks) 17 | "unused" : true, // true Require all defined variables be used 18 | // "vars" to only check for variables, not function parameters, 19 | // "strict" to check all variables and parameters. 20 | "strict" : true, // true: Requires all functions run in ES5 Strict Mode 21 | "maxparams" : false, // {int} Max number of formal params allowed per function 22 | "maxdepth" : false, // {int} Max depth of nested blocks (within functions) 23 | "maxstatements" : false, // {int} Max number statements per function 24 | "maxcomplexity" : false, // {int} Max cyclomatic complexity per function 25 | 26 | // Relaxing 27 | "asi" : false, // true: Tolerate Automatic Semicolon Insertion (no semicolons) 28 | "boss" : true, // true: Tolerate assignments where comparisons would be expected 29 | "debug" : false, // true: Allow debugger statements e.g. browser breakpoints. 30 | "eqnull" : true, // true: Tolerate use of `== null` 31 | "es5" : false, // true: Allow ES5 syntax (ex: getters and setters) 32 | "esnext" : false, // true: Allow ES.next (ES6) syntax (ex: `const`) 33 | "moz" : false, // true: Allow Mozilla specific syntax (extends and overrides esnext features) 34 | // (ex: `for each`, multiple try/catch, function expression…) 35 | "evil" : false, // true: Tolerate use of `eval` and `new Function()` 36 | "expr" : true, // true: Tolerate `ExpressionStatement` as Programs 37 | "funcscope" : false, // true: Tolerate defining variables inside control statements 38 | "globalstrict" : false, // true: Allow global "use strict" (also enables 'strict') 39 | "iterator" : false, // true: Tolerate using the `__iterator__` property 40 | "lastsemic" : false, // true: Tolerate omitting a semicolon for the last statement of a 1-line block 41 | "laxbreak" : false, // true: Tolerate possibly unsafe line breakings 42 | "laxcomma" : false, // true: Tolerate comma-first style coding 43 | "loopfunc" : false, // true: Tolerate functions being defined in loops 44 | "multistr" : false, // true: Tolerate multi-line strings 45 | "noyield" : false, // true: Tolerate generator functions with no yield statement in them. 46 | "notypeof" : false, // true: Tolerate invalid typeof operator values 47 | "proto" : false, // true: Tolerate using the `__proto__` property 48 | "scripturl" : false, // true: Tolerate script-targeted URLs 49 | "shadow" : false, // true: Allows re-define variables later in code e.g. `var x=1; x=2;` 50 | "sub" : false, // true: Tolerate using `[]` notation when it can still be expressed in dot notation 51 | "supernew" : false, // true: Tolerate `new function () { ... };` and `new Object;` 52 | "validthis" : false, // true: Tolerate using this in a non-constructor function 53 | 54 | // Environments 55 | "browser" : true, // Web Browser (window, document, etc) 56 | "browserify" : false, // Browserify (node.js code in the browser) 57 | "couch" : false, // CouchDB 58 | "devel" : true, // Development/debugging (alert, confirm, etc) 59 | "dojo" : false, // Dojo Toolkit 60 | "jasmine" : false, // Jasmine 61 | "jquery" : true, // jQuery 62 | "mocha" : true, // Mocha 63 | "mootools" : false, // MooTools 64 | "node" : true, // Node.js 65 | "nonstandard" : false, // Widely adopted globals (escape, unescape, etc) 66 | "prototypejs" : false, // Prototype and Scriptaculous 67 | "qunit" : false, // QUnit 68 | "rhino" : false, // Rhino 69 | "shelljs" : false, // ShellJS 70 | "worker" : false, // Web Workers 71 | "wsh" : false, // Windows Scripting Host 72 | "yui" : false, // Yahoo User Interface 73 | 74 | "onecase" : false, // ? 75 | "regexdash" : false, // ? 76 | 77 | // Custom Globals 78 | // additional predefined global variables 79 | "globals" : { 80 | "require": false, 81 | "define": false 82 | }, 83 | 84 | "quotmark": "double", 85 | "immed": true 86 | } 87 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "0.12" 4 | - "iojs" 5 | - "iojs-v1.0.4" 6 | before_install: 7 | - git clone git://github.com/n1k0/casperjs.git ~/casperjs 8 | - cd ~/casperjs 9 | - git checkout tags/1.0.2 10 | - export PATH=$PATH:`pwd`/bin 11 | - cd - 12 | before_script: 13 | - phantomjs --version 14 | - casperjs --version 15 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Wasif Hasan Baig 4 | 5 | https://github.com/baig/jquerymobile-editablelistview 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in 15 | all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | THE SOFTWARE. 24 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Editable Listview (jQuery Mobile Plugin) 2 | ======================================== 3 | A customized version of the [jQuery Mobile Listview Widget](http://demos.jquerymobile.com/1.4.2/listview/) that supports insertion of new list items and removal of existing list items out of the box. 4 | 5 |  6 | 7 | ## Why 8 | Many a times, you come across a situation where you want to allow editing of list items. To do this simple task, you have to build extra functionality around the Listview widget to allow for insertion of new list items and removal of existing list items. **Editable Listview** plugin is designed to take the pain out of this situaiton by having all this functionality baked-in. 9 | 10 | ## Features 11 | 12 | 1. Allows insertion of new list items right in the Listview. 13 | 2. Allows easy removal of existing list items. 14 | 15 | ## Installation 16 | 1. Pick any one of the following way. 17 | 18 | * Download and unzip the package into your project folder (Scroll up and you will see the "Download ZIP" button on the right side). 19 | 20 | * Install using bower. 21 | 22 | `bower install jqm-editable-istview` 23 | 24 | * Use the CDN hosted version. 25 | 26 | __js:__ `//cdn.jsdelivr.net/jquery.editable-listview/x.y.z/jqm.editable.listview.min.js` 27 | __css:__ `//cdn.jsdelivr.net/jquery.editable-listview/x.y.z/jqm.editable.listview.min.css` 28 | 29 | where `x.y.z` is the version number. 30 | 31 | 2. Include the javascript file after the jQuery Mobile javascript file. Similarly include the stylesheet after the jQuery Mobile stylesheet 32 | 33 | ## How to Use it? 34 | The listview comes in two flavors: __simple__ and __complex__. Their usage is described below. 35 | 36 | ### Simple Type 37 | Use the following HTML/DOM structure 38 | 39 | ```H 40 |
Shape: round
59 |Color: red
60 | 61 |Shape: oval
66 |Color: yellow
67 | 68 |Shape: round
73 |Color: orange
74 | 75 |Delete "Orange" from the following list of "Fruits"
27 |Add "Running" and "Surfing" in the following list
37 |Delete "Orange" from the following list of "Fruits"
47 |Press the button below to programmatically insert a list item
54 | 55 | 56 |An example of Complex Editable Listview
59 |Shape: round
64 |Color: red
65 | 66 |Shape: oval
71 |Color: yellow
72 | 73 |Shape: round
78 |Color: orange
79 | 80 |