├── .gitignore ├── CHANGELOG.txt ├── Gruntfile.js ├── LICENSE-MIT ├── Package.nuspec ├── README.md ├── bower.json ├── composer.json ├── dist ├── CHANGELOG.txt ├── LICENSE-MIT ├── README.md ├── bootstrap-editable │ ├── css │ │ └── bootstrap-editable.css │ ├── img │ │ ├── clear.png │ │ └── loading.gif │ └── js │ │ ├── bootstrap-editable.js │ │ └── bootstrap-editable.min.js ├── bootstrap3-editable │ ├── css │ │ └── bootstrap-editable.css │ ├── img │ │ ├── clear.png │ │ └── loading.gif │ └── js │ │ ├── bootstrap-editable.js │ │ └── bootstrap-editable.min.js ├── inputs-ext │ ├── address │ │ ├── address.css │ │ └── address.js │ ├── typeaheadjs │ │ ├── lib │ │ │ ├── typeahead.js │ │ │ └── typeahead.js-bootstrap.css │ │ └── typeaheadjs.js │ └── wysihtml5 │ │ ├── bootstrap-wysihtml5-0.0.2 │ │ ├── bootstrap-wysihtml5-0.0.2.css │ │ ├── bootstrap-wysihtml5-0.0.2.js │ │ ├── bootstrap-wysihtml5-0.0.2.min.js │ │ ├── wysihtml5-0.3.0.js │ │ ├── wysihtml5-0.3.0.min.js │ │ └── wysiwyg-color.css │ │ └── wysihtml5.js ├── jquery-editable │ ├── css │ │ └── jquery-editable.css │ ├── img │ │ ├── clear.png │ │ └── loading.gif │ ├── jquery-ui-datepicker │ │ ├── css │ │ │ └── redmond │ │ │ │ ├── images │ │ │ │ ├── animated-overlay.gif │ │ │ │ ├── ui-bg_flat_0_aaaaaa_40x100.png │ │ │ │ ├── ui-bg_flat_55_fbec88_40x100.png │ │ │ │ ├── ui-bg_glass_75_d0e5f5_1x400.png │ │ │ │ ├── ui-bg_glass_85_dfeffc_1x400.png │ │ │ │ ├── ui-bg_glass_95_fef1ec_1x400.png │ │ │ │ ├── ui-bg_gloss-wave_55_5c9ccc_500x100.png │ │ │ │ ├── ui-bg_inset-hard_100_f5f8f9_1x100.png │ │ │ │ ├── ui-bg_inset-hard_100_fcfdfd_1x100.png │ │ │ │ ├── ui-icons_217bc0_256x240.png │ │ │ │ ├── ui-icons_2e83ff_256x240.png │ │ │ │ ├── ui-icons_469bdd_256x240.png │ │ │ │ ├── ui-icons_6da8d5_256x240.png │ │ │ │ ├── ui-icons_cd0a0a_256x240.png │ │ │ │ ├── ui-icons_d8e7f3_256x240.png │ │ │ │ └── ui-icons_f9bd01_256x240.png │ │ │ │ ├── jquery-ui-1.10.3.custom.css │ │ │ │ └── jquery-ui-1.10.3.custom.min.css │ │ └── js │ │ │ ├── jquery-ui-1.10.3.custom.js │ │ │ └── jquery-ui-1.10.3.custom.min.js │ └── js │ │ ├── jquery-editable-poshytip.js │ │ └── jquery-editable-poshytip.min.js └── jqueryui-editable │ ├── css │ └── jqueryui-editable.css │ ├── img │ ├── clear.png │ └── loading.gif │ └── js │ ├── jqueryui-editable.js │ └── jqueryui-editable.min.js ├── package.json ├── src ├── containers │ ├── editable-container.css │ ├── editable-container.js │ ├── editable-inline.js │ ├── editable-popover.js │ ├── editable-popover3.js │ ├── editable-poshytip.js │ └── editable-tooltip.js ├── editable-form │ ├── editable-form-bootstrap.js │ ├── editable-form-bootstrap3.js │ ├── editable-form-jqueryui.js │ ├── editable-form-utils.js │ ├── editable-form.css │ └── editable-form.js ├── element │ ├── editable-element.css │ └── editable-element.js ├── img │ ├── clear.png │ └── loading.gif ├── inputs-ext │ ├── address │ │ ├── address.css │ │ └── address.js │ ├── slider │ │ └── slider.js │ ├── typeaheadjs │ │ ├── lib │ │ │ ├── typeahead.js │ │ │ └── typeahead.js-bootstrap.css │ │ └── typeaheadjs.js │ └── wysihtml5 │ │ ├── bootstrap-wysihtml5-0.0.2 │ │ ├── bootstrap-wysihtml5-0.0.2.css │ │ ├── bootstrap-wysihtml5-0.0.2.js │ │ ├── bootstrap-wysihtml5-0.0.2.min.js │ │ ├── wysihtml5-0.3.0.js │ │ ├── wysihtml5-0.3.0.min.js │ │ └── wysiwyg-color.css │ │ └── wysihtml5.js └── inputs │ ├── abstract.js │ ├── checklist.js │ ├── combodate │ ├── combodate.js │ └── lib │ │ ├── combodate.js │ │ ├── moment.min.1.7.2.js │ │ └── moment.min.js │ ├── date │ ├── bootstrap-datepicker │ │ ├── css │ │ │ └── datepicker.css │ │ └── js │ │ │ └── bootstrap-datepicker.js │ ├── date.js │ └── datefield.js │ ├── datetime │ ├── bootstrap-datetimepicker │ │ ├── css │ │ │ └── datetimepicker.css │ │ └── js │ │ │ └── bootstrap-datetimepicker.js │ ├── datetime.js │ └── datetimefield.js │ ├── dateui │ ├── dateui.js │ ├── dateuifield.js │ └── jquery-ui-datepicker │ │ ├── css │ │ └── redmond │ │ │ ├── images │ │ │ ├── animated-overlay.gif │ │ │ ├── ui-bg_flat_0_aaaaaa_40x100.png │ │ │ ├── ui-bg_flat_55_fbec88_40x100.png │ │ │ ├── ui-bg_glass_75_d0e5f5_1x400.png │ │ │ ├── ui-bg_glass_85_dfeffc_1x400.png │ │ │ ├── ui-bg_glass_95_fef1ec_1x400.png │ │ │ ├── ui-bg_gloss-wave_55_5c9ccc_500x100.png │ │ │ ├── ui-bg_inset-hard_100_f5f8f9_1x100.png │ │ │ ├── ui-bg_inset-hard_100_fcfdfd_1x100.png │ │ │ ├── ui-icons_217bc0_256x240.png │ │ │ ├── ui-icons_2e83ff_256x240.png │ │ │ ├── ui-icons_469bdd_256x240.png │ │ │ ├── ui-icons_6da8d5_256x240.png │ │ │ ├── ui-icons_cd0a0a_256x240.png │ │ │ ├── ui-icons_d8e7f3_256x240.png │ │ │ └── ui-icons_f9bd01_256x240.png │ │ │ ├── jquery-ui-1.10.1.custom.css │ │ │ ├── jquery-ui-1.10.1.custom.min.css │ │ │ ├── jquery-ui-1.10.2.custom.css │ │ │ ├── jquery-ui-1.10.2.custom.min.css │ │ │ ├── jquery-ui-1.10.3.custom.css │ │ │ ├── jquery-ui-1.10.3.custom.min.css │ │ │ ├── jquery-ui-1.9.1.custom.css │ │ │ └── jquery-ui-1.9.1.custom.min.css │ │ └── js │ │ ├── jquery-ui-1.10.1.custom.js │ │ ├── jquery-ui-1.10.1.custom.min.js │ │ ├── jquery-ui-1.10.2.custom.js │ │ ├── jquery-ui-1.10.2.custom.min.js │ │ ├── jquery-ui-1.10.3.custom.js │ │ ├── jquery-ui-1.10.3.custom.min.js │ │ ├── jquery-ui-1.9.1.custom.js │ │ └── jquery-ui-1.9.1.custom.min.js │ ├── html5types.js │ ├── list.js │ ├── select.js │ ├── select2 │ ├── lib │ │ ├── select2-bootstrap.css │ │ ├── select2-spinner.gif │ │ ├── select2.css │ │ ├── select2.js │ │ ├── select2.min.js │ │ ├── select2.png │ │ └── select2x2.png │ └── select2.js │ ├── text.js │ ├── textarea.js │ └── typeahead.js └── test ├── coverage ├── index.html ├── libs ├── bootstrap221 │ ├── css │ │ ├── bootstrap-responsive.css │ │ ├── bootstrap-responsive.min.css │ │ ├── bootstrap.css │ │ └── bootstrap.min.css │ ├── img │ │ ├── glyphicons-halflings-white.png │ │ └── glyphicons-halflings.png │ └── js │ │ ├── bootstrap.js │ │ └── bootstrap.min.js ├── bootstrap222 │ ├── css │ │ ├── bootstrap-responsive.css │ │ ├── bootstrap-responsive.min.css │ │ ├── bootstrap.css │ │ └── bootstrap.min.css │ ├── img │ │ ├── glyphicons-halflings-white.png │ │ └── glyphicons-halflings.png │ └── js │ │ ├── bootstrap.js │ │ └── bootstrap.min.js ├── bootstrap231 │ ├── css │ │ ├── bootstrap-responsive.css │ │ ├── bootstrap-responsive.min.css │ │ ├── bootstrap.css │ │ └── bootstrap.min.css │ ├── img │ │ ├── glyphicons-halflings-white.png │ │ └── glyphicons-halflings.png │ └── js │ │ ├── bootstrap.js │ │ └── bootstrap.min.js ├── bootstrap232 │ ├── css │ │ ├── bootstrap-responsive.css │ │ ├── bootstrap-responsive.min.css │ │ ├── bootstrap.css │ │ └── bootstrap.min.css │ ├── img │ │ ├── glyphicons-halflings-white.png │ │ └── glyphicons-halflings.png │ └── js │ │ ├── bootstrap.js │ │ └── bootstrap.min.js ├── bootstrap300 │ ├── css │ │ ├── bootstrap-theme.css │ │ ├── bootstrap-theme.min.css │ │ ├── bootstrap.css │ │ └── bootstrap.min.css │ ├── fonts │ │ ├── glyphicons-halflings-regular.eot │ │ ├── glyphicons-halflings-regular.svg │ │ ├── glyphicons-halflings-regular.ttf │ │ └── glyphicons-halflings-regular.woff │ └── js │ │ ├── bootstrap.js │ │ └── bootstrap.min.js ├── jquery-ui-1.10.1.custom │ ├── css │ │ └── redmond │ │ │ ├── images │ │ │ ├── animated-overlay.gif │ │ │ ├── ui-bg_flat_0_aaaaaa_40x100.png │ │ │ ├── ui-bg_flat_55_fbec88_40x100.png │ │ │ ├── ui-bg_glass_75_d0e5f5_1x400.png │ │ │ ├── ui-bg_glass_85_dfeffc_1x400.png │ │ │ ├── ui-bg_glass_95_fef1ec_1x400.png │ │ │ ├── ui-bg_gloss-wave_55_5c9ccc_500x100.png │ │ │ ├── ui-bg_inset-hard_100_f5f8f9_1x100.png │ │ │ ├── ui-bg_inset-hard_100_fcfdfd_1x100.png │ │ │ ├── ui-icons_217bc0_256x240.png │ │ │ ├── ui-icons_2e83ff_256x240.png │ │ │ ├── ui-icons_469bdd_256x240.png │ │ │ ├── ui-icons_6da8d5_256x240.png │ │ │ ├── ui-icons_cd0a0a_256x240.png │ │ │ ├── ui-icons_d8e7f3_256x240.png │ │ │ └── ui-icons_f9bd01_256x240.png │ │ │ ├── jquery-ui-1.10.1.custom.css │ │ │ └── jquery-ui-1.10.1.custom.min.css │ └── js │ │ ├── jquery-1.9.1.js │ │ ├── jquery-ui-1.10.1.custom.js │ │ └── jquery-ui-1.10.1.custom.min.js ├── jquery-ui-1.10.2.custom │ ├── css │ │ └── redmond │ │ │ ├── images │ │ │ ├── animated-overlay.gif │ │ │ ├── ui-bg_flat_0_aaaaaa_40x100.png │ │ │ ├── ui-bg_flat_55_fbec88_40x100.png │ │ │ ├── ui-bg_glass_75_d0e5f5_1x400.png │ │ │ ├── ui-bg_glass_85_dfeffc_1x400.png │ │ │ ├── ui-bg_glass_95_fef1ec_1x400.png │ │ │ ├── ui-bg_gloss-wave_55_5c9ccc_500x100.png │ │ │ ├── ui-bg_inset-hard_100_f5f8f9_1x100.png │ │ │ ├── ui-bg_inset-hard_100_fcfdfd_1x100.png │ │ │ ├── ui-icons_217bc0_256x240.png │ │ │ ├── ui-icons_2e83ff_256x240.png │ │ │ ├── ui-icons_469bdd_256x240.png │ │ │ ├── ui-icons_6da8d5_256x240.png │ │ │ ├── ui-icons_cd0a0a_256x240.png │ │ │ ├── ui-icons_d8e7f3_256x240.png │ │ │ └── ui-icons_f9bd01_256x240.png │ │ │ ├── jquery-ui-1.10.2.custom.css │ │ │ └── jquery-ui-1.10.2.custom.min.css │ └── js │ │ ├── jquery-1.9.1.js │ │ ├── jquery-ui-1.10.2.custom.js │ │ └── jquery-ui-1.10.2.custom.min.js ├── jquery-ui-1.10.3.custom │ ├── css │ │ └── redmond │ │ │ ├── images │ │ │ ├── animated-overlay.gif │ │ │ ├── ui-bg_diagonals-thick_18_b81900_40x40.png │ │ │ ├── ui-bg_diagonals-thick_20_666666_40x40.png │ │ │ ├── ui-bg_flat_10_000000_40x100.png │ │ │ ├── ui-bg_glass_100_f6f6f6_1x400.png │ │ │ ├── ui-bg_glass_100_fdf5ce_1x400.png │ │ │ ├── ui-bg_glass_65_ffffff_1x400.png │ │ │ ├── ui-bg_gloss-wave_35_f6a828_500x100.png │ │ │ ├── ui-bg_highlight-soft_100_eeeeee_1x100.png │ │ │ ├── ui-bg_highlight-soft_75_ffe45c_1x100.png │ │ │ ├── ui-icons_222222_256x240.png │ │ │ ├── ui-icons_228ef1_256x240.png │ │ │ ├── ui-icons_ef8c08_256x240.png │ │ │ ├── ui-icons_ffd27a_256x240.png │ │ │ └── ui-icons_ffffff_256x240.png │ │ │ ├── jquery-ui-1.10.3.custom.css │ │ │ └── jquery-ui-1.10.3.custom.min.css │ └── js │ │ ├── jquery-1.9.1.js │ │ ├── jquery-ui-1.10.3.custom.js │ │ └── jquery-ui-1.10.3.custom.min.js ├── jquery-ui-1.9.1.custom │ ├── css │ │ ├── redmond │ │ │ ├── images │ │ │ │ ├── ui-bg_flat_0_aaaaaa_40x100.png │ │ │ │ ├── ui-bg_flat_55_fbec88_40x100.png │ │ │ │ ├── ui-bg_glass_75_d0e5f5_1x400.png │ │ │ │ ├── ui-bg_glass_85_dfeffc_1x400.png │ │ │ │ ├── ui-bg_glass_95_fef1ec_1x400.png │ │ │ │ ├── ui-bg_gloss-wave_55_5c9ccc_500x100.png │ │ │ │ ├── ui-bg_inset-hard_100_f5f8f9_1x100.png │ │ │ │ ├── ui-bg_inset-hard_100_fcfdfd_1x100.png │ │ │ │ ├── ui-icons_217bc0_256x240.png │ │ │ │ ├── ui-icons_2e83ff_256x240.png │ │ │ │ ├── ui-icons_469bdd_256x240.png │ │ │ │ ├── ui-icons_6da8d5_256x240.png │ │ │ │ ├── ui-icons_cd0a0a_256x240.png │ │ │ │ ├── ui-icons_d8e7f3_256x240.png │ │ │ │ └── ui-icons_f9bd01_256x240.png │ │ │ ├── jquery-ui-1.9.1.custom.css │ │ │ └── jquery-ui-1.9.1.custom.min.css │ │ └── smoothness │ │ │ ├── images │ │ │ ├── ui-bg_flat_0_aaaaaa_40x100.png │ │ │ ├── ui-bg_flat_75_ffffff_40x100.png │ │ │ ├── ui-bg_glass_55_fbf9ee_1x400.png │ │ │ ├── ui-bg_glass_65_ffffff_1x400.png │ │ │ ├── ui-bg_glass_75_dadada_1x400.png │ │ │ ├── ui-bg_glass_75_e6e6e6_1x400.png │ │ │ ├── ui-bg_glass_95_fef1ec_1x400.png │ │ │ ├── ui-bg_highlight-soft_75_cccccc_1x100.png │ │ │ ├── ui-icons_222222_256x240.png │ │ │ ├── ui-icons_2e83ff_256x240.png │ │ │ ├── ui-icons_454545_256x240.png │ │ │ ├── ui-icons_888888_256x240.png │ │ │ └── ui-icons_cd0a0a_256x240.png │ │ │ ├── jquery-ui-1.9.1.custom.css │ │ │ └── jquery-ui-1.9.1.custom.min.css │ ├── jquery.ui.datepicker-ru.js │ └── js │ │ ├── jquery-1.8.2.js │ │ ├── jquery-ui-1.9.1.custom.js │ │ └── jquery-ui-1.9.1.custom.min.js ├── jquery │ ├── jquery-1.8.2.js │ ├── jquery-1.8.2.min.js │ ├── jquery-1.9.0.min.js │ ├── jquery-1.9.1.js │ └── jquery-1.9.1.min.js ├── mockjax │ └── jquery.mockjax.js ├── poshytip │ ├── jquery.poshytip.js │ ├── jquery.poshytip.min.js │ └── tip-yellowsimple │ │ ├── tip-yellowsimple.css │ │ └── tip-yellowsimple_arrows.gif └── qunit │ ├── qunit-1.10.0.css │ ├── qunit-1.10.0.js │ ├── qunit-1.12.0.css │ └── qunit-1.12.0.js ├── loader.js ├── main.js ├── mocks.js ├── require.js ├── style.css └── unit ├── api.js ├── checklist.js ├── combodate.js ├── common.js ├── date.js ├── datefield.js ├── datetime.js ├── datetimefield.js ├── dateui.js ├── dateuifield.js ├── select.js ├── select2.js ├── text.js ├── textarea.js ├── typeahead.js ├── typeaheadjs.js └── wysihtml5.js /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | test/instrumented/ 3 | *.nupkg -------------------------------------------------------------------------------- /LICENSE-MIT: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 Vitaliy Potapov 2 | 3 | Permission is hereby granted, free of charge, to any person 4 | obtaining a copy of this software and associated documentation 5 | files (the "Software"), to deal in the Software without 6 | restriction, including without limitation the rights to use, 7 | copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the 9 | Software is furnished to do so, subject to the following 10 | conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 17 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 19 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /Package.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | x-editable 5 | 1.5.1 6 | Vitaliy Potapov 7 | Vitaliy Potapov 8 | https://github.com/vitalets/x-editable/blob/master/LICENSE-MIT 9 | http://vitalets.github.com/x-editable 10 | false 11 | In-place editing with Twitter Bootstrap, jQuery UI or pure jQuery 12 | Date and select2 minor fixes 13 | Copyright 2012-2013 14 | edit-in-place editable click-to-edit bootstrap jquery 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # X-editable 2 | In-place editing with Twitter Bootstrap, jQuery UI or pure jQuery. 3 | 4 | > ### :warning: Deprecation notice 5 | > 6 | > This library is **deprecated** and will no longer receive any updates or support. 7 | > Please consider migrating to alternative solutions. See [#610](https://github.com/vitalets/x-editable/issues/610) for details. 8 | 9 | ## Live Demo 10 | **http://vitalets.github.io/x-editable/demo.html** 11 | 12 | ## Pull Requests 13 | Please submit all Pull Requests to the `develop` branch: https://github.com/vitalets/x-editable/tree/develop 14 | 15 | ## Issue Tracker 16 | Please report all issues here: https://github.com/vitalets/x-editable/issues 17 | 18 | ## Documentation 19 | **http://vitalets.github.io/x-editable** 20 | 21 | ## Project Status 22 | Actively maintained 23 | 24 | ## How to get it 25 | 26 | ### Manual download 27 | Use **http://vitalets.github.io/x-editable** main page. 28 | 29 | ### Bower 30 | ```` 31 | bower install x-editable 32 | ```` 33 | 34 | ### CDN 35 | Bootstrap 3 build: 36 | ````html 37 | 38 | 39 | ```` 40 | 41 | Bootstrap 2 build: 42 | ````html 43 | 44 | 45 | ```` 46 | 47 | jQuery UI build: 48 | ````html 49 | 50 | 51 | ```` 52 | 53 | jQuery only build: 54 | ````html 55 | 56 | 57 | ```` 58 | 59 | 60 | ## Reporting issues 61 | Please **provide jsFiddle** when creating issues! 62 | It's really saves much time. Use these as template: 63 | 1. [jsFiddle Bootstrap 3](http://jsfiddle.net/xBB5x/2265/) 64 | 2. [jsFiddle Bootstrap 2](http://jsfiddle.net/xBB5x/1817/) 65 | 3. [jsFiddle jQuery-ui](http://jsfiddle.net/xBB5x/2511/) 66 | 4. [jsFiddle jQuery](http://jsfiddle.net/xBB5x/197) 67 | Your feedback is very appreciated! 68 | 69 | ## Contribution 70 | A few steps how to start contributing. 71 | Assuming you have [Node.js](http://nodejs.org/) already installed. 72 | 73 | 1.Fork *X-editable* on github and clone it to your local mashine: 74 | ```` 75 | git clone https://github.com//x-editable.git -b dev 76 | ```` 77 | 2.Install *grunt-cli* globally (if not yet): 78 | ```` 79 | npm i -g grunt-cli 80 | ```` 81 | 3.Install dependencies: 82 | ```` 83 | cd x-editable 84 | npm i 85 | ```` 86 | 4.Make your changes: 87 | ```` 88 | vim editable-form.js 89 | ```` 90 | 5.Write some tests for your changes: 91 | ```` 92 | vim /test/unit/*.js 93 | ```` 94 | 6.Run tests in cli: 95 | ```` 96 | grunt test 97 | ```` 98 | or directly in browser: 99 | ```` 100 | grunt server 101 | ```` 102 | and open http://127.0.0.1:8000/test 103 | By default test run on bootstrap 3 popup version, but you can test any other build: 104 | 105 | * bootstrap 3 106 | * popup: http://127.0.0.1:8000/test/?f=bootstrap3&c=popup 107 | * inline: http://127.0.0.1:8000/test/?f=bootstrap3&c=inline 108 | * bootstrap 2 109 | * popup: http://127.0.0.1:8000/test/?f=bootstrap2&c=popup 110 | * inline: http://127.0.0.1:8000/test/?f=bootstrap2&c=inline 111 | * jquery-ui 112 | * popup: http://127.0.0.1:8000/test/?f=jqueryui&c=popup 113 | * inline: http://127.0.0.1:8000/test/?f=jqueryui&c=inline 114 | * jquery + poshytip 115 | * popup: http://127.0.0.1:8000/test/?f=plain&c=popup 116 | * inline: http://127.0.0.1:8000/test/?f=plain&c=inline 117 | 118 | 7.Commit and push back on github: 119 | ```` 120 | git add . 121 | git commit -m'refactor editable form, fix #123' 122 | git push origin 123 | ```` 124 | 8.Make pull request on github (to `dev` branch). 125 | 126 | Thanks for your support! 127 | 128 | ### Local build 129 | To build x-editable locally please run: 130 | ```` 131 | grunt build 132 | ```` 133 | Result will appear in `dist` directory. 134 | 135 | ## License 136 | Copyright (c) 2012 Vitaliy Potapov 137 | Licensed under the MIT license. 138 | -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "x-editable", 3 | "ignore": [ 4 | "CHANGELOG.txt", 5 | "Gruntfile.js", 6 | "LICENSE-MIT", 7 | "Package.nuspec", 8 | "README.md", 9 | "composer.json", 10 | "package.json", 11 | "node_modules", 12 | "components", 13 | "src", 14 | "test" 15 | ], 16 | "dependencies": { 17 | "jquery": "~1.11" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vitalets/x-editable", 3 | "description": "In-place editing with Twitter Bootstrap, jQuery UI or pure jQuery.", 4 | "version": "1.5.1", 5 | "homepage": "http://github.com/vitalets/x-editable", 6 | "authors": [ 7 | { 8 | "name": "Vitaliy Potapov", 9 | "email": "noginsk@rambler.ru", 10 | "role": "Developer" 11 | } 12 | ], 13 | "keywords": [ 14 | "bootstrap", 15 | "x-editable", 16 | "table", 17 | "editable" 18 | ], 19 | "repositories": [ 20 | { 21 | "type": "vcs", 22 | "url": "https://github.com/vitalets/x-editable.git" 23 | } 24 | ], 25 | "support": { 26 | "issues": "https://github.com/vitalets/x-editable/issues", 27 | "source": "http://vitalets.github.io/x-editable", 28 | "wiki": "http://vitalets.github.io/x-editable" 29 | }, 30 | "license": [ 31 | "MIT" 32 | ], 33 | "require": { 34 | 35 | }, 36 | "require-dev": { 37 | "grunt": "~0.3.11", 38 | "grunt-contrib": "0.1.1" 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /dist/LICENSE-MIT: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 Vitaliy Potapov 2 | 3 | Permission is hereby granted, free of charge, to any person 4 | obtaining a copy of this software and associated documentation 5 | files (the "Software"), to deal in the Software without 6 | restriction, including without limitation the rights to use, 7 | copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the 9 | Software is furnished to do so, subject to the following 10 | conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 17 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 19 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /dist/README.md: -------------------------------------------------------------------------------- 1 | # X-editable 2 | 3 | In-place editing with Twitter Bootstrap, jQuery UI or pure jQuery. 4 | 5 | ## Live demo 6 | **http://vitalets.github.io/x-editable/demo.html** 7 | 8 | ## Documentation 9 | **http://vitalets.github.io/x-editable** 10 | 11 | ## How to get it 12 | 13 | ### Manual download 14 | Use **http://vitalets.github.io/x-editable** main page. 15 | 16 | ### Bower 17 | ```` 18 | bower install x-editable 19 | ```` 20 | 21 | ### CDN 22 | Bootstrap 3 build: 23 | ````js 24 | 25 | 26 | ```` 27 | 28 | Bootstrap 2 build: 29 | ````js 30 | 31 | 32 | ```` 33 | 34 | jQuery UI build: 35 | ````js 36 | 37 | 38 | ```` 39 | 40 | jQuery only build: 41 | ````js 42 | 43 | 44 | ```` 45 | 46 | 47 | ## Reporting issues 48 | Please **provide jsFiddle** when creating issues! 49 | It's really saves much time. Use these as template: 50 | 1. [jsFiddle Bootstrap 3](http://jsfiddle.net/xBB5x/2265/) 51 | 2. [jsFiddle Bootstrap 2](http://jsfiddle.net/xBB5x/1817/) 52 | 3. [jsFiddle jQuery-ui](http://jsfiddle.net/xBB5x/2511/) 53 | 4. [jsFiddle jQuery](http://jsfiddle.net/xBB5x/197) 54 | Your feedback is very appreciated! 55 | 56 | ## Contribution 57 | A few steps how to start contributing. 58 | Assuming you have [Node.js](http://nodejs.org/) already installed. 59 | 60 | 1.Fork *X-editable* on github and clone it to your local mashine: 61 | ```` 62 | git clone https://github.com//x-editable.git -b dev 63 | ```` 64 | 2.Install *grunt-cli* globally (if not yet): 65 | ```` 66 | npm i -g grunt-cli 67 | ```` 68 | 3.Install dependencies: 69 | ```` 70 | cd x-editable 71 | npm i 72 | ```` 73 | 4.Make your changes: 74 | ```` 75 | vim editable-form.js 76 | ```` 77 | 5.Write some tests for your changes: 78 | ```` 79 | vim /test/unit/*.js 80 | ```` 81 | 6.Run tests in cli: 82 | ```` 83 | grunt test 84 | ```` 85 | or directly in browser: 86 | ```` 87 | grunt server 88 | ```` 89 | and open http://127.0.0.1:8000/test 90 | By default test run on bootstrap 3 popup version, but you can test any other build: 91 | 92 | * bootstrap 3 93 | * popup: http://127.0.0.1:8000/test/?f=bootstrap3&c=popup 94 | * inline: http://127.0.0.1:8000/test/?f=bootstrap3&c=inline 95 | * bootstrap 2 96 | * popup: http://127.0.0.1:8000/test/?f=bootstrap2&c=popup 97 | * inline: http://127.0.0.1:8000/test/?f=bootstrap2&c=inline 98 | * jquery-ui 99 | * popup: http://127.0.0.1:8000/test/?f=jqueryui&c=popup 100 | * inline: http://127.0.0.1:8000/test/?f=jqueryui&c=inline 101 | * jquery + poshytip 102 | * popup: http://127.0.0.1:8000/test/?f=plain&c=popup 103 | * inline: http://127.0.0.1:8000/test/?f=plain&c=inline 104 | 105 | 7.Commit and push back on github: 106 | ```` 107 | git add . 108 | git commit -m'refactor editable form, fix #123' 109 | git push origin 110 | ```` 111 | 8.Make pull request on github (to `dev` branch). 112 | 113 | Thanks for your support! 114 | 115 | ### Local build 116 | To build x-editable locally please run: 117 | ```` 118 | grunt build 119 | ```` 120 | Result will appear in `dist` directory. 121 | 122 | ## License 123 | Copyright (c) 2012 Vitaliy Potapov 124 | Licensed under the MIT license. -------------------------------------------------------------------------------- /dist/bootstrap-editable/img/clear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vitalets/x-editable/ce55af42caf789b8e5494d0fb31a6abf2435b633/dist/bootstrap-editable/img/clear.png -------------------------------------------------------------------------------- /dist/bootstrap-editable/img/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vitalets/x-editable/ce55af42caf789b8e5494d0fb31a6abf2435b633/dist/bootstrap-editable/img/loading.gif -------------------------------------------------------------------------------- /dist/bootstrap3-editable/img/clear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vitalets/x-editable/ce55af42caf789b8e5494d0fb31a6abf2435b633/dist/bootstrap3-editable/img/clear.png -------------------------------------------------------------------------------- /dist/bootstrap3-editable/img/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vitalets/x-editable/ce55af42caf789b8e5494d0fb31a6abf2435b633/dist/bootstrap3-editable/img/loading.gif -------------------------------------------------------------------------------- /dist/inputs-ext/address/address.css: -------------------------------------------------------------------------------- 1 | .editable-address { 2 | display: block; 3 | margin-bottom: 5px; 4 | } 5 | 6 | .editable-address span { 7 | width: 70px; 8 | display: inline-block; 9 | } -------------------------------------------------------------------------------- /dist/inputs-ext/address/address.js: -------------------------------------------------------------------------------- 1 | /** 2 | Address editable input. 3 | Internally value stored as {city: "Moscow", street: "Lenina", building: "15"} 4 | 5 | @class address 6 | @extends abstractinput 7 | @final 8 | @example 9 | awesome 10 | 23 | **/ 24 | (function ($) { 25 | "use strict"; 26 | 27 | var Address = function (options) { 28 | this.init('address', options, Address.defaults); 29 | }; 30 | 31 | //inherit from Abstract input 32 | $.fn.editableutils.inherit(Address, $.fn.editabletypes.abstractinput); 33 | 34 | $.extend(Address.prototype, { 35 | /** 36 | Renders input from tpl 37 | 38 | @method render() 39 | **/ 40 | render: function() { 41 | this.$input = this.$tpl.find('input'); 42 | }, 43 | 44 | /** 45 | Default method to show value in element. Can be overwritten by display option. 46 | 47 | @method value2html(value, element) 48 | **/ 49 | value2html: function(value, element) { 50 | if(!value) { 51 | $(element).empty(); 52 | return; 53 | } 54 | var html = $('
').text(value.city).html() + ', ' + $('
').text(value.street).html() + ' st., bld. ' + $('
').text(value.building).html(); 55 | $(element).html(html); 56 | }, 57 | 58 | /** 59 | Gets value from element's html 60 | 61 | @method html2value(html) 62 | **/ 63 | html2value: function(html) { 64 | /* 65 | you may write parsing method to get value by element's html 66 | e.g. "Moscow, st. Lenina, bld. 15" => {city: "Moscow", street: "Lenina", building: "15"} 67 | but for complex structures it's not recommended. 68 | Better set value directly via javascript, e.g. 69 | editable({ 70 | value: { 71 | city: "Moscow", 72 | street: "Lenina", 73 | building: "15" 74 | } 75 | }); 76 | */ 77 | return null; 78 | }, 79 | 80 | /** 81 | Converts value to string. 82 | It is used in internal comparing (not for sending to server). 83 | 84 | @method value2str(value) 85 | **/ 86 | value2str: function(value) { 87 | var str = ''; 88 | if(value) { 89 | for(var k in value) { 90 | str = str + k + ':' + value[k] + ';'; 91 | } 92 | } 93 | return str; 94 | }, 95 | 96 | /* 97 | Converts string to value. Used for reading value from 'data-value' attribute. 98 | 99 | @method str2value(str) 100 | */ 101 | str2value: function(str) { 102 | /* 103 | this is mainly for parsing value defined in data-value attribute. 104 | If you will always set value by javascript, no need to overwrite it 105 | */ 106 | return str; 107 | }, 108 | 109 | /** 110 | Sets value of input. 111 | 112 | @method value2input(value) 113 | @param {mixed} value 114 | **/ 115 | value2input: function(value) { 116 | if(!value) { 117 | return; 118 | } 119 | this.$input.filter('[name="city"]').val(value.city); 120 | this.$input.filter('[name="street"]').val(value.street); 121 | this.$input.filter('[name="building"]').val(value.building); 122 | }, 123 | 124 | /** 125 | Returns value of input. 126 | 127 | @method input2value() 128 | **/ 129 | input2value: function() { 130 | return { 131 | city: this.$input.filter('[name="city"]').val(), 132 | street: this.$input.filter('[name="street"]').val(), 133 | building: this.$input.filter('[name="building"]').val() 134 | }; 135 | }, 136 | 137 | /** 138 | Activates input: sets focus on the first field. 139 | 140 | @method activate() 141 | **/ 142 | activate: function() { 143 | this.$input.filter('[name="city"]').focus(); 144 | }, 145 | 146 | /** 147 | Attaches handler to submit form in case of 'showbuttons=false' mode 148 | 149 | @method autosubmit() 150 | **/ 151 | autosubmit: function() { 152 | this.$input.keydown(function (e) { 153 | if (e.which === 13) { 154 | $(this).closest('form').submit(); 155 | } 156 | }); 157 | } 158 | }); 159 | 160 | Address.defaults = $.extend({}, $.fn.editabletypes.abstractinput.defaults, { 161 | tpl: '
'+ 162 | '
'+ 163 | '
', 164 | 165 | inputclass: '' 166 | }); 167 | 168 | $.fn.editabletypes.address = Address; 169 | 170 | }(window.jQuery)); -------------------------------------------------------------------------------- /dist/inputs-ext/typeaheadjs/lib/typeahead.js-bootstrap.css: -------------------------------------------------------------------------------- 1 | .twitter-typeahead .tt-query, 2 | .twitter-typeahead .tt-hint { 3 | margin-bottom: 0; 4 | } 5 | 6 | .tt-dropdown-menu { 7 | min-width: 160px; 8 | margin-top: 2px; 9 | padding: 5px 0; 10 | background-color: #fff; 11 | border: 1px solid #ccc; 12 | border: 1px solid rgba(0,0,0,.2); 13 | *border-right-width: 2px; 14 | *border-bottom-width: 2px; 15 | -webkit-border-radius: 6px; 16 | -moz-border-radius: 6px; 17 | border-radius: 6px; 18 | -webkit-box-shadow: 0 5px 10px rgba(0,0,0,.2); 19 | -moz-box-shadow: 0 5px 10px rgba(0,0,0,.2); 20 | box-shadow: 0 5px 10px rgba(0,0,0,.2); 21 | -webkit-background-clip: padding-box; 22 | -moz-background-clip: padding; 23 | background-clip: padding-box; 24 | } 25 | 26 | .tt-suggestion { 27 | display: block; 28 | padding: 3px 20px; 29 | } 30 | 31 | .tt-suggestion.tt-is-under-cursor { 32 | color: #fff; 33 | background-color: #0081c2; 34 | background-image: -moz-linear-gradient(top, #0088cc, #0077b3); 35 | background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0077b3)); 36 | background-image: -webkit-linear-gradient(top, #0088cc, #0077b3); 37 | background-image: -o-linear-gradient(top, #0088cc, #0077b3); 38 | background-image: linear-gradient(to bottom, #0088cc, #0077b3); 39 | background-repeat: repeat-x; 40 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0077b3', GradientType=0) 41 | } 42 | 43 | .tt-suggestion.tt-is-under-cursor a { 44 | color: #fff; 45 | } 46 | 47 | .tt-suggestion p { 48 | margin: 0; 49 | } 50 | -------------------------------------------------------------------------------- /dist/inputs-ext/typeaheadjs/typeaheadjs.js: -------------------------------------------------------------------------------- 1 | /** 2 | Typeahead.js input, based on [Twitter Typeahead](http://twitter.github.io/typeahead.js). 3 | It is mainly replacement of typeahead in Bootstrap 3. 4 | 5 | 6 | @class typeaheadjs 7 | @extends text 8 | @since 1.5.0 9 | @final 10 | @example 11 | 12 | 30 | **/ 31 | (function ($) { 32 | "use strict"; 33 | 34 | var Constructor = function (options) { 35 | this.init('typeaheadjs', options, Constructor.defaults); 36 | }; 37 | 38 | $.fn.editableutils.inherit(Constructor, $.fn.editabletypes.text); 39 | 40 | $.extend(Constructor.prototype, { 41 | render: function() { 42 | this.renderClear(); 43 | this.setClass(); 44 | this.setAttr('placeholder'); 45 | this.$input.typeahead(this.options.typeahead); 46 | 47 | // copy `input-sm | input-lg` classes to placeholder input 48 | if($.fn.editableform.engine === 'bs3') { 49 | if(this.$input.hasClass('input-sm')) { 50 | this.$input.siblings('input.tt-hint').addClass('input-sm'); 51 | } 52 | if(this.$input.hasClass('input-lg')) { 53 | this.$input.siblings('input.tt-hint').addClass('input-lg'); 54 | } 55 | } 56 | } 57 | }); 58 | 59 | Constructor.defaults = $.extend({}, $.fn.editabletypes.list.defaults, { 60 | /** 61 | @property tpl 62 | @default 63 | **/ 64 | tpl:'', 65 | /** 66 | Configuration of typeahead itself. 67 | [Full list of options](https://github.com/twitter/typeahead.js#dataset). 68 | 69 | @property typeahead 70 | @type object 71 | @default null 72 | **/ 73 | typeahead: null, 74 | /** 75 | Whether to show `clear` button 76 | 77 | @property clear 78 | @type boolean 79 | @default true 80 | **/ 81 | clear: true 82 | }); 83 | 84 | $.fn.editabletypes.typeaheadjs = Constructor; 85 | 86 | }(window.jQuery)); -------------------------------------------------------------------------------- /dist/inputs-ext/wysihtml5/bootstrap-wysihtml5-0.0.2/bootstrap-wysihtml5-0.0.2.css: -------------------------------------------------------------------------------- 1 | ul.wysihtml5-toolbar { 2 | margin: 0; 3 | padding: 0; 4 | display: block; 5 | } 6 | 7 | ul.wysihtml5-toolbar::after { 8 | clear: both; 9 | display: table; 10 | content: ""; 11 | } 12 | 13 | ul.wysihtml5-toolbar > li { 14 | float: left; 15 | display: list-item; 16 | list-style: none; 17 | margin: 0 5px 10px 0; 18 | } 19 | 20 | ul.wysihtml5-toolbar a[data-wysihtml5-command=bold] { 21 | font-weight: bold; 22 | } 23 | 24 | ul.wysihtml5-toolbar a[data-wysihtml5-command=italic] { 25 | font-style: italic; 26 | } 27 | 28 | ul.wysihtml5-toolbar a[data-wysihtml5-command=underline] { 29 | text-decoration: underline; 30 | } 31 | 32 | ul.wysihtml5-toolbar a.btn.wysihtml5-command-active { 33 | background-image: none; 34 | -webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15),0 1px 2px rgba(0, 0, 0, 0.05); 35 | -moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15),0 1px 2px rgba(0, 0, 0, 0.05); 36 | box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15),0 1px 2px rgba(0, 0, 0, 0.05); 37 | background-color: #E6E6E6; 38 | background-color: #D9D9D9; 39 | outline: 0; 40 | } 41 | 42 | ul.wysihtml5-commands-disabled .dropdown-menu { 43 | display: none !important; 44 | } 45 | 46 | ul.wysihtml5-toolbar div.wysihtml5-colors { 47 | display:block; 48 | width: 50px; 49 | height: 20px; 50 | margin-top: 2px; 51 | margin-left: 5px; 52 | position: absolute; 53 | pointer-events: none; 54 | } 55 | 56 | ul.wysihtml5-toolbar a.wysihtml5-colors-title { 57 | padding-left: 70px; 58 | } 59 | 60 | ul.wysihtml5-toolbar div[data-wysihtml5-command-value="black"] { 61 | background: black !important; 62 | } 63 | 64 | ul.wysihtml5-toolbar div[data-wysihtml5-command-value="silver"] { 65 | background: silver !important; 66 | } 67 | 68 | ul.wysihtml5-toolbar div[data-wysihtml5-command-value="gray"] { 69 | background: gray !important; 70 | } 71 | 72 | ul.wysihtml5-toolbar div[data-wysihtml5-command-value="maroon"] { 73 | background: maroon !important; 74 | } 75 | 76 | ul.wysihtml5-toolbar div[data-wysihtml5-command-value="red"] { 77 | background: red !important; 78 | } 79 | 80 | ul.wysihtml5-toolbar div[data-wysihtml5-command-value="purple"] { 81 | background: purple !important; 82 | } 83 | 84 | ul.wysihtml5-toolbar div[data-wysihtml5-command-value="green"] { 85 | background: green !important; 86 | } 87 | 88 | ul.wysihtml5-toolbar div[data-wysihtml5-command-value="olive"] { 89 | background: olive !important; 90 | } 91 | 92 | ul.wysihtml5-toolbar div[data-wysihtml5-command-value="navy"] { 93 | background: navy !important; 94 | } 95 | 96 | ul.wysihtml5-toolbar div[data-wysihtml5-command-value="blue"] { 97 | background: blue !important; 98 | } 99 | 100 | ul.wysihtml5-toolbar div[data-wysihtml5-command-value="orange"] { 101 | background: orange !important; 102 | } 103 | -------------------------------------------------------------------------------- /dist/inputs-ext/wysihtml5/bootstrap-wysihtml5-0.0.2/wysiwyg-color.css: -------------------------------------------------------------------------------- 1 | .wysiwyg-color-black { 2 | color: black; 3 | } 4 | 5 | .wysiwyg-color-silver { 6 | color: silver; 7 | } 8 | 9 | .wysiwyg-color-gray { 10 | color: gray; 11 | } 12 | 13 | .wysiwyg-color-white { 14 | color: white; 15 | } 16 | 17 | .wysiwyg-color-maroon { 18 | color: maroon; 19 | } 20 | 21 | .wysiwyg-color-red { 22 | color: red; 23 | } 24 | 25 | .wysiwyg-color-purple { 26 | color: purple; 27 | } 28 | 29 | .wysiwyg-color-fuchsia { 30 | color: fuchsia; 31 | } 32 | 33 | .wysiwyg-color-green { 34 | color: green; 35 | } 36 | 37 | .wysiwyg-color-lime { 38 | color: lime; 39 | } 40 | 41 | .wysiwyg-color-olive { 42 | color: olive; 43 | } 44 | 45 | .wysiwyg-color-yellow { 46 | color: yellow; 47 | } 48 | 49 | .wysiwyg-color-navy { 50 | color: navy; 51 | } 52 | 53 | .wysiwyg-color-blue { 54 | color: blue; 55 | } 56 | 57 | .wysiwyg-color-teal { 58 | color: teal; 59 | } 60 | 61 | .wysiwyg-color-aqua { 62 | color: aqua; 63 | } 64 | 65 | .wysiwyg-color-orange { 66 | color: orange; 67 | } -------------------------------------------------------------------------------- /dist/inputs-ext/wysihtml5/wysihtml5.js: -------------------------------------------------------------------------------- 1 | /** 2 | Bootstrap wysihtml5 editor. Based on [bootstrap-wysihtml5](https://github.com/jhollingworth/bootstrap-wysihtml5). 3 | You should include **manually** distributives of `wysihtml5` and `bootstrap-wysihtml5`: 4 | 5 | 6 | 7 | 8 | 9 | And also include `wysihtml5.js` from `inputs-ext` directory of x-editable: 10 | 11 | 12 | 13 | **Note:** It's better to use fresh bootstrap-wysihtml5 from it's [master branch](https://github.com/jhollingworth/bootstrap-wysihtml5/tree/master/src) as there is update for correct image insertion. 14 | 15 | @class wysihtml5 16 | @extends abstractinput 17 | @final 18 | @since 1.4.0 19 | @example 20 |

awesome

comment!
21 | 29 | **/ 30 | (function ($) { 31 | "use strict"; 32 | 33 | var Wysihtml5 = function (options) { 34 | this.init('wysihtml5', options, Wysihtml5.defaults); 35 | 36 | //extend wysihtml5 manually as $.extend not recursive 37 | this.options.wysihtml5 = $.extend({}, Wysihtml5.defaults.wysihtml5, options.wysihtml5); 38 | }; 39 | 40 | $.fn.editableutils.inherit(Wysihtml5, $.fn.editabletypes.abstractinput); 41 | 42 | $.extend(Wysihtml5.prototype, { 43 | render: function () { 44 | var deferred = $.Deferred(), 45 | msieOld; 46 | 47 | //generate unique id as it required for wysihtml5 48 | this.$input.attr('id', 'textarea_'+(new Date()).getTime()); 49 | 50 | this.setClass(); 51 | this.setAttr('placeholder'); 52 | 53 | //resolve deffered when widget loaded 54 | $.extend(this.options.wysihtml5, { 55 | events: { 56 | load: function() { 57 | deferred.resolve(); 58 | } 59 | } 60 | }); 61 | 62 | this.$input.wysihtml5(this.options.wysihtml5); 63 | 64 | /* 65 | In IE8 wysihtml5 iframe stays on the same line with buttons toolbar (inside popover). 66 | The only solution I found is to add
. If you fine better way, please send PR. 67 | */ 68 | msieOld = /msie\s*(8|7|6)/.test(navigator.userAgent.toLowerCase()); 69 | if(msieOld) { 70 | this.$input.before('

'); 71 | } 72 | 73 | return deferred.promise(); 74 | }, 75 | 76 | value2html: function(value, element) { 77 | $(element).html(value); 78 | }, 79 | 80 | html2value: function(html) { 81 | return html; 82 | }, 83 | 84 | value2input: function(value) { 85 | this.$input.data("wysihtml5").editor.setValue(value, true); 86 | }, 87 | 88 | activate: function() { 89 | this.$input.data("wysihtml5").editor.focus(); 90 | }, 91 | 92 | isEmpty: function($element) { 93 | if($.trim($element.html()) === '') { 94 | return true; 95 | } else if($.trim($element.text()) !== '') { 96 | return false; 97 | } else { 98 | //e.g. '', '
', '

' 99 | return !$element.height() || !$element.width(); 100 | } 101 | } 102 | }); 103 | 104 | Wysihtml5.defaults = $.extend({}, $.fn.editabletypes.abstractinput.defaults, { 105 | /** 106 | @property tpl 107 | @default 108 | **/ 109 | tpl:'', 110 | /** 111 | @property inputclass 112 | @default editable-wysihtml5 113 | **/ 114 | inputclass: 'editable-wysihtml5', 115 | /** 116 | Placeholder attribute of input. Shown when input is empty. 117 | 118 | @property placeholder 119 | @type string 120 | @default null 121 | **/ 122 | placeholder: null, 123 | /** 124 | Wysihtml5 default options. 125 | See https://github.com/jhollingworth/bootstrap-wysihtml5#options 126 | 127 | @property wysihtml5 128 | @type object 129 | @default {stylesheets: false} 130 | **/ 131 | wysihtml5: { 132 | stylesheets: false //see https://github.com/jhollingworth/bootstrap-wysihtml5/issues/183 133 | } 134 | }); 135 | 136 | $.fn.editabletypes.wysihtml5 = Wysihtml5; 137 | 138 | }(window.jQuery)); 139 | -------------------------------------------------------------------------------- /dist/jquery-editable/css/jquery-editable.css: -------------------------------------------------------------------------------- 1 | /*! X-editable - v1.5.1 2 | * In-place editing with Twitter Bootstrap, jQuery UI or pure jQuery 3 | * http://github.com/vitalets/x-editable 4 | * Copyright (c) 2013 Vitaliy Potapov; Licensed MIT */ 5 | .editableform { 6 | margin-bottom: 0; /* overwrites bootstrap margin */ 7 | } 8 | 9 | .editableform .control-group { 10 | margin-bottom: 0; /* overwrites bootstrap margin */ 11 | white-space: nowrap; /* prevent wrapping buttons on new line */ 12 | line-height: 20px; /* overwriting bootstrap line-height. See #133 */ 13 | } 14 | 15 | /* 16 | BS3 width:1005 for inputs breaks editable form in popup 17 | See: https://github.com/vitalets/x-editable/issues/393 18 | */ 19 | .editableform .form-control { 20 | width: auto; 21 | } 22 | 23 | .editable-buttons { 24 | display: inline-block; /* should be inline to take effect of parent's white-space: nowrap */ 25 | vertical-align: top; 26 | margin-left: 7px; 27 | /* inline-block emulation for IE7*/ 28 | zoom: 1; 29 | *display: inline; 30 | } 31 | 32 | .editable-buttons.editable-buttons-bottom { 33 | display: block; 34 | margin-top: 7px; 35 | margin-left: 0; 36 | } 37 | 38 | .editable-input { 39 | vertical-align: top; 40 | display: inline-block; /* should be inline to take effect of parent's white-space: nowrap */ 41 | width: auto; /* bootstrap-responsive has width: 100% that breakes layout */ 42 | white-space: normal; /* reset white-space decalred in parent*/ 43 | /* display-inline emulation for IE7*/ 44 | zoom: 1; 45 | *display: inline; 46 | } 47 | 48 | .editable-buttons .editable-cancel { 49 | margin-left: 7px; 50 | } 51 | 52 | /*for jquery-ui buttons need set height to look more pretty*/ 53 | .editable-buttons button.ui-button-icon-only { 54 | height: 24px; 55 | width: 30px; 56 | } 57 | 58 | .editableform-loading { 59 | background: url('../img/loading.gif') center center no-repeat; 60 | height: 25px; 61 | width: auto; 62 | min-width: 25px; 63 | } 64 | 65 | .editable-inline .editableform-loading { 66 | background-position: left 5px; 67 | } 68 | 69 | .editable-error-block { 70 | max-width: 300px; 71 | margin: 5px 0 0 0; 72 | width: auto; 73 | white-space: normal; 74 | } 75 | 76 | /*add padding for jquery ui*/ 77 | .editable-error-block.ui-state-error { 78 | padding: 3px; 79 | } 80 | 81 | .editable-error { 82 | color: red; 83 | } 84 | 85 | /* ---- For specific types ---- */ 86 | 87 | .editableform .editable-date { 88 | padding: 0; 89 | margin: 0; 90 | float: left; 91 | } 92 | 93 | /* move datepicker icon to center of add-on button. See https://github.com/vitalets/x-editable/issues/183 */ 94 | .editable-inline .add-on .icon-th { 95 | margin-top: 3px; 96 | margin-left: 1px; 97 | } 98 | 99 | 100 | /* checklist vertical alignment */ 101 | .editable-checklist label input[type="checkbox"], 102 | .editable-checklist label span { 103 | vertical-align: middle; 104 | margin: 0; 105 | } 106 | 107 | .editable-checklist label { 108 | white-space: nowrap; 109 | } 110 | 111 | /* set exact width of textarea to fit buttons toolbar */ 112 | .editable-wysihtml5 { 113 | width: 566px; 114 | height: 250px; 115 | } 116 | 117 | /* clear button shown as link in date inputs */ 118 | .editable-clear { 119 | clear: both; 120 | font-size: 0.9em; 121 | text-decoration: none; 122 | text-align: right; 123 | } 124 | 125 | /* IOS-style clear button for text inputs */ 126 | .editable-clear-x { 127 | background: url('../img/clear.png') center center no-repeat; 128 | display: block; 129 | width: 13px; 130 | height: 13px; 131 | position: absolute; 132 | opacity: 0.6; 133 | z-index: 100; 134 | 135 | top: 50%; 136 | right: 6px; 137 | margin-top: -6px; 138 | 139 | } 140 | 141 | .editable-clear-x:hover { 142 | opacity: 1; 143 | } 144 | 145 | .editable-pre-wrapped { 146 | white-space: pre-wrap; 147 | } 148 | .editable-container.editable-popup { 149 | max-width: none !important; /* without this rule poshytip/tooltip does not stretch */ 150 | } 151 | 152 | .editable-container.popover { 153 | width: auto; /* without this rule popover does not stretch */ 154 | } 155 | 156 | .editable-container.editable-inline { 157 | display: inline-block; 158 | vertical-align: middle; 159 | width: auto; 160 | /* inline-block emulation for IE7*/ 161 | zoom: 1; 162 | *display: inline; 163 | } 164 | 165 | .editable-container.ui-widget { 166 | font-size: inherit; /* jqueryui widget font 1.1em too big, overwrite it */ 167 | z-index: 9990; /* should be less than select2 dropdown z-index to close dropdown first when click */ 168 | } 169 | .editable-click, 170 | a.editable-click, 171 | a.editable-click:hover { 172 | text-decoration: none; 173 | border-bottom: dashed 1px #0088cc; 174 | } 175 | 176 | .editable-click.editable-disabled, 177 | a.editable-click.editable-disabled, 178 | a.editable-click.editable-disabled:hover { 179 | color: #585858; 180 | cursor: default; 181 | border-bottom: none; 182 | } 183 | 184 | .editable-empty, .editable-empty:hover, .editable-empty:focus{ 185 | font-style: italic; 186 | color: #DD1144; 187 | /* border-bottom: none; */ 188 | text-decoration: none; 189 | } 190 | 191 | .editable-unsaved { 192 | font-weight: bold; 193 | } 194 | 195 | .editable-unsaved:after { 196 | /* content: '*'*/ 197 | } 198 | 199 | .editable-bg-transition { 200 | -webkit-transition: background-color 1400ms ease-out; 201 | -moz-transition: background-color 1400ms ease-out; 202 | -o-transition: background-color 1400ms ease-out; 203 | -ms-transition: background-color 1400ms ease-out; 204 | transition: background-color 1400ms ease-out; 205 | } 206 | 207 | /*see https://github.com/vitalets/x-editable/issues/139 */ 208 | .form-horizontal .editable 209 | { 210 | padding-top: 5px; 211 | display:inline-block; 212 | } 213 | 214 | -------------------------------------------------------------------------------- /dist/jquery-editable/img/clear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vitalets/x-editable/ce55af42caf789b8e5494d0fb31a6abf2435b633/dist/jquery-editable/img/clear.png -------------------------------------------------------------------------------- /dist/jquery-editable/img/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vitalets/x-editable/ce55af42caf789b8e5494d0fb31a6abf2435b633/dist/jquery-editable/img/loading.gif -------------------------------------------------------------------------------- /dist/jquery-editable/jquery-ui-datepicker/css/redmond/images/animated-overlay.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vitalets/x-editable/ce55af42caf789b8e5494d0fb31a6abf2435b633/dist/jquery-editable/jquery-ui-datepicker/css/redmond/images/animated-overlay.gif -------------------------------------------------------------------------------- /dist/jquery-editable/jquery-ui-datepicker/css/redmond/images/ui-bg_flat_0_aaaaaa_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vitalets/x-editable/ce55af42caf789b8e5494d0fb31a6abf2435b633/dist/jquery-editable/jquery-ui-datepicker/css/redmond/images/ui-bg_flat_0_aaaaaa_40x100.png -------------------------------------------------------------------------------- /dist/jquery-editable/jquery-ui-datepicker/css/redmond/images/ui-bg_flat_55_fbec88_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vitalets/x-editable/ce55af42caf789b8e5494d0fb31a6abf2435b633/dist/jquery-editable/jquery-ui-datepicker/css/redmond/images/ui-bg_flat_55_fbec88_40x100.png -------------------------------------------------------------------------------- /dist/jquery-editable/jquery-ui-datepicker/css/redmond/images/ui-bg_glass_75_d0e5f5_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vitalets/x-editable/ce55af42caf789b8e5494d0fb31a6abf2435b633/dist/jquery-editable/jquery-ui-datepicker/css/redmond/images/ui-bg_glass_75_d0e5f5_1x400.png -------------------------------------------------------------------------------- /dist/jquery-editable/jquery-ui-datepicker/css/redmond/images/ui-bg_glass_85_dfeffc_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vitalets/x-editable/ce55af42caf789b8e5494d0fb31a6abf2435b633/dist/jquery-editable/jquery-ui-datepicker/css/redmond/images/ui-bg_glass_85_dfeffc_1x400.png -------------------------------------------------------------------------------- /dist/jquery-editable/jquery-ui-datepicker/css/redmond/images/ui-bg_glass_95_fef1ec_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vitalets/x-editable/ce55af42caf789b8e5494d0fb31a6abf2435b633/dist/jquery-editable/jquery-ui-datepicker/css/redmond/images/ui-bg_glass_95_fef1ec_1x400.png -------------------------------------------------------------------------------- /dist/jquery-editable/jquery-ui-datepicker/css/redmond/images/ui-bg_gloss-wave_55_5c9ccc_500x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vitalets/x-editable/ce55af42caf789b8e5494d0fb31a6abf2435b633/dist/jquery-editable/jquery-ui-datepicker/css/redmond/images/ui-bg_gloss-wave_55_5c9ccc_500x100.png -------------------------------------------------------------------------------- /dist/jquery-editable/jquery-ui-datepicker/css/redmond/images/ui-bg_inset-hard_100_f5f8f9_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vitalets/x-editable/ce55af42caf789b8e5494d0fb31a6abf2435b633/dist/jquery-editable/jquery-ui-datepicker/css/redmond/images/ui-bg_inset-hard_100_f5f8f9_1x100.png -------------------------------------------------------------------------------- /dist/jquery-editable/jquery-ui-datepicker/css/redmond/images/ui-bg_inset-hard_100_fcfdfd_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vitalets/x-editable/ce55af42caf789b8e5494d0fb31a6abf2435b633/dist/jquery-editable/jquery-ui-datepicker/css/redmond/images/ui-bg_inset-hard_100_fcfdfd_1x100.png -------------------------------------------------------------------------------- /dist/jquery-editable/jquery-ui-datepicker/css/redmond/images/ui-icons_217bc0_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vitalets/x-editable/ce55af42caf789b8e5494d0fb31a6abf2435b633/dist/jquery-editable/jquery-ui-datepicker/css/redmond/images/ui-icons_217bc0_256x240.png -------------------------------------------------------------------------------- /dist/jquery-editable/jquery-ui-datepicker/css/redmond/images/ui-icons_2e83ff_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vitalets/x-editable/ce55af42caf789b8e5494d0fb31a6abf2435b633/dist/jquery-editable/jquery-ui-datepicker/css/redmond/images/ui-icons_2e83ff_256x240.png -------------------------------------------------------------------------------- /dist/jquery-editable/jquery-ui-datepicker/css/redmond/images/ui-icons_469bdd_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vitalets/x-editable/ce55af42caf789b8e5494d0fb31a6abf2435b633/dist/jquery-editable/jquery-ui-datepicker/css/redmond/images/ui-icons_469bdd_256x240.png -------------------------------------------------------------------------------- /dist/jquery-editable/jquery-ui-datepicker/css/redmond/images/ui-icons_6da8d5_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vitalets/x-editable/ce55af42caf789b8e5494d0fb31a6abf2435b633/dist/jquery-editable/jquery-ui-datepicker/css/redmond/images/ui-icons_6da8d5_256x240.png -------------------------------------------------------------------------------- /dist/jquery-editable/jquery-ui-datepicker/css/redmond/images/ui-icons_cd0a0a_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vitalets/x-editable/ce55af42caf789b8e5494d0fb31a6abf2435b633/dist/jquery-editable/jquery-ui-datepicker/css/redmond/images/ui-icons_cd0a0a_256x240.png -------------------------------------------------------------------------------- /dist/jquery-editable/jquery-ui-datepicker/css/redmond/images/ui-icons_d8e7f3_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vitalets/x-editable/ce55af42caf789b8e5494d0fb31a6abf2435b633/dist/jquery-editable/jquery-ui-datepicker/css/redmond/images/ui-icons_d8e7f3_256x240.png -------------------------------------------------------------------------------- /dist/jquery-editable/jquery-ui-datepicker/css/redmond/images/ui-icons_f9bd01_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vitalets/x-editable/ce55af42caf789b8e5494d0fb31a6abf2435b633/dist/jquery-editable/jquery-ui-datepicker/css/redmond/images/ui-icons_f9bd01_256x240.png -------------------------------------------------------------------------------- /dist/jqueryui-editable/css/jqueryui-editable.css: -------------------------------------------------------------------------------- 1 | /*! X-editable - v1.5.1 2 | * In-place editing with Twitter Bootstrap, jQuery UI or pure jQuery 3 | * http://github.com/vitalets/x-editable 4 | * Copyright (c) 2013 Vitaliy Potapov; Licensed MIT */ 5 | .editableform { 6 | margin-bottom: 0; /* overwrites bootstrap margin */ 7 | } 8 | 9 | .editableform .control-group { 10 | margin-bottom: 0; /* overwrites bootstrap margin */ 11 | white-space: nowrap; /* prevent wrapping buttons on new line */ 12 | line-height: 20px; /* overwriting bootstrap line-height. See #133 */ 13 | } 14 | 15 | /* 16 | BS3 width:1005 for inputs breaks editable form in popup 17 | See: https://github.com/vitalets/x-editable/issues/393 18 | */ 19 | .editableform .form-control { 20 | width: auto; 21 | } 22 | 23 | .editable-buttons { 24 | display: inline-block; /* should be inline to take effect of parent's white-space: nowrap */ 25 | vertical-align: top; 26 | margin-left: 7px; 27 | /* inline-block emulation for IE7*/ 28 | zoom: 1; 29 | *display: inline; 30 | } 31 | 32 | .editable-buttons.editable-buttons-bottom { 33 | display: block; 34 | margin-top: 7px; 35 | margin-left: 0; 36 | } 37 | 38 | .editable-input { 39 | vertical-align: top; 40 | display: inline-block; /* should be inline to take effect of parent's white-space: nowrap */ 41 | width: auto; /* bootstrap-responsive has width: 100% that breakes layout */ 42 | white-space: normal; /* reset white-space decalred in parent*/ 43 | /* display-inline emulation for IE7*/ 44 | zoom: 1; 45 | *display: inline; 46 | } 47 | 48 | .editable-buttons .editable-cancel { 49 | margin-left: 7px; 50 | } 51 | 52 | /*for jquery-ui buttons need set height to look more pretty*/ 53 | .editable-buttons button.ui-button-icon-only { 54 | height: 24px; 55 | width: 30px; 56 | } 57 | 58 | .editableform-loading { 59 | background: url('../img/loading.gif') center center no-repeat; 60 | height: 25px; 61 | width: auto; 62 | min-width: 25px; 63 | } 64 | 65 | .editable-inline .editableform-loading { 66 | background-position: left 5px; 67 | } 68 | 69 | .editable-error-block { 70 | max-width: 300px; 71 | margin: 5px 0 0 0; 72 | width: auto; 73 | white-space: normal; 74 | } 75 | 76 | /*add padding for jquery ui*/ 77 | .editable-error-block.ui-state-error { 78 | padding: 3px; 79 | } 80 | 81 | .editable-error { 82 | color: red; 83 | } 84 | 85 | /* ---- For specific types ---- */ 86 | 87 | .editableform .editable-date { 88 | padding: 0; 89 | margin: 0; 90 | float: left; 91 | } 92 | 93 | /* move datepicker icon to center of add-on button. See https://github.com/vitalets/x-editable/issues/183 */ 94 | .editable-inline .add-on .icon-th { 95 | margin-top: 3px; 96 | margin-left: 1px; 97 | } 98 | 99 | 100 | /* checklist vertical alignment */ 101 | .editable-checklist label input[type="checkbox"], 102 | .editable-checklist label span { 103 | vertical-align: middle; 104 | margin: 0; 105 | } 106 | 107 | .editable-checklist label { 108 | white-space: nowrap; 109 | } 110 | 111 | /* set exact width of textarea to fit buttons toolbar */ 112 | .editable-wysihtml5 { 113 | width: 566px; 114 | height: 250px; 115 | } 116 | 117 | /* clear button shown as link in date inputs */ 118 | .editable-clear { 119 | clear: both; 120 | font-size: 0.9em; 121 | text-decoration: none; 122 | text-align: right; 123 | } 124 | 125 | /* IOS-style clear button for text inputs */ 126 | .editable-clear-x { 127 | background: url('../img/clear.png') center center no-repeat; 128 | display: block; 129 | width: 13px; 130 | height: 13px; 131 | position: absolute; 132 | opacity: 0.6; 133 | z-index: 100; 134 | 135 | top: 50%; 136 | right: 6px; 137 | margin-top: -6px; 138 | 139 | } 140 | 141 | .editable-clear-x:hover { 142 | opacity: 1; 143 | } 144 | 145 | .editable-pre-wrapped { 146 | white-space: pre-wrap; 147 | } 148 | .editable-container.editable-popup { 149 | max-width: none !important; /* without this rule poshytip/tooltip does not stretch */ 150 | } 151 | 152 | .editable-container.popover { 153 | width: auto; /* without this rule popover does not stretch */ 154 | } 155 | 156 | .editable-container.editable-inline { 157 | display: inline-block; 158 | vertical-align: middle; 159 | width: auto; 160 | /* inline-block emulation for IE7*/ 161 | zoom: 1; 162 | *display: inline; 163 | } 164 | 165 | .editable-container.ui-widget { 166 | font-size: inherit; /* jqueryui widget font 1.1em too big, overwrite it */ 167 | z-index: 9990; /* should be less than select2 dropdown z-index to close dropdown first when click */ 168 | } 169 | .editable-click, 170 | a.editable-click, 171 | a.editable-click:hover { 172 | text-decoration: none; 173 | border-bottom: dashed 1px #0088cc; 174 | } 175 | 176 | .editable-click.editable-disabled, 177 | a.editable-click.editable-disabled, 178 | a.editable-click.editable-disabled:hover { 179 | color: #585858; 180 | cursor: default; 181 | border-bottom: none; 182 | } 183 | 184 | .editable-empty, .editable-empty:hover, .editable-empty:focus{ 185 | font-style: italic; 186 | color: #DD1144; 187 | /* border-bottom: none; */ 188 | text-decoration: none; 189 | } 190 | 191 | .editable-unsaved { 192 | font-weight: bold; 193 | } 194 | 195 | .editable-unsaved:after { 196 | /* content: '*'*/ 197 | } 198 | 199 | .editable-bg-transition { 200 | -webkit-transition: background-color 1400ms ease-out; 201 | -moz-transition: background-color 1400ms ease-out; 202 | -o-transition: background-color 1400ms ease-out; 203 | -ms-transition: background-color 1400ms ease-out; 204 | transition: background-color 1400ms ease-out; 205 | } 206 | 207 | /*see https://github.com/vitalets/x-editable/issues/139 */ 208 | .form-horizontal .editable 209 | { 210 | padding-top: 5px; 211 | display:inline-block; 212 | } 213 | 214 | -------------------------------------------------------------------------------- /dist/jqueryui-editable/img/clear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vitalets/x-editable/ce55af42caf789b8e5494d0fb31a6abf2435b633/dist/jqueryui-editable/img/clear.png -------------------------------------------------------------------------------- /dist/jqueryui-editable/img/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vitalets/x-editable/ce55af42caf789b8e5494d0fb31a6abf2435b633/dist/jqueryui-editable/img/loading.gif -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "X-editable", 3 | "title": "X-editable", 4 | "description": "In-place editing with Twitter Bootstrap, jQuery UI or pure jQuery", 5 | "version": "1.5.1", 6 | "homepage": "http://github.com/vitalets/x-editable", 7 | "author": { 8 | "name": "Vitaliy Potapov", 9 | "email": "noginsk@rambler.ru" 10 | }, 11 | "repository": { 12 | "type": "git", 13 | "url": "git://github.com/vitalets/x-editable.git" 14 | }, 15 | "bugs": { 16 | "url": "https://github.com/vitalets/x-editable/issues" 17 | }, 18 | "licenses": [ 19 | { 20 | "type": "MIT", 21 | "url": "https://github.com/vitalets/x-editable/blob/master/LICENSE-MIT" 22 | } 23 | ], 24 | "dependencies": {}, 25 | "devDependencies": { 26 | "grunt": "~0.4.1", 27 | "grunt-contrib-clean": "~0.5.0", 28 | "grunt-contrib-concat": "~0.3.0", 29 | "grunt-contrib-uglify": "~0.2.2", 30 | "grunt-contrib-qunit": "~0.2.2", 31 | "grunt-contrib-connect": "~0.3.0", 32 | "grunt-contrib-jshint": "~0.6.4", 33 | "grunt-contrib-copy": "~0.4.1", 34 | "grunt-contrib-requirejs": "~0.4.1" 35 | }, 36 | "keywords": [] 37 | } 38 | -------------------------------------------------------------------------------- /src/containers/editable-container.css: -------------------------------------------------------------------------------- 1 | .editable-container.editable-popup { 2 | max-width: none !important; /* without this rule poshytip/tooltip does not stretch */ 3 | } 4 | 5 | .editable-container.popover { 6 | width: auto; /* without this rule popover does not stretch */ 7 | } 8 | 9 | .editable-container.editable-inline { 10 | display: inline-block; 11 | vertical-align: middle; 12 | width: auto; 13 | /* inline-block emulation for IE7*/ 14 | zoom: 1; 15 | *display: inline; 16 | } 17 | 18 | .editable-container.ui-widget { 19 | font-size: inherit; /* jqueryui widget font 1.1em too big, overwrite it */ 20 | z-index: 9990; /* should be less than select2 dropdown z-index to close dropdown first when click */ 21 | } -------------------------------------------------------------------------------- /src/containers/editable-inline.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Editable Inline 3 | * --------------------- 4 | */ 5 | (function ($) { 6 | "use strict"; 7 | 8 | //copy prototype from EditableContainer 9 | //extend methods 10 | $.extend($.fn.editableContainer.Inline.prototype, $.fn.editableContainer.Popup.prototype, { 11 | containerName: 'editableform', 12 | innerCss: '.editable-inline', 13 | containerClass: 'editable-container editable-inline', //css class applied to container element 14 | 15 | initContainer: function(){ 16 | //container is element 17 | this.$tip = $(''); 18 | 19 | //convert anim to miliseconds (int) 20 | if(!this.options.anim) { 21 | this.options.anim = 0; 22 | } 23 | }, 24 | 25 | splitOptions: function() { 26 | //all options are passed to form 27 | this.containerOptions = {}; 28 | this.formOptions = this.options; 29 | }, 30 | 31 | tip: function() { 32 | return this.$tip; 33 | }, 34 | 35 | innerShow: function () { 36 | this.$element.hide(); 37 | this.tip().insertAfter(this.$element).show(); 38 | }, 39 | 40 | innerHide: function () { 41 | this.$tip.hide(this.options.anim, $.proxy(function() { 42 | this.$element.show(); 43 | this.innerDestroy(); 44 | }, this)); 45 | }, 46 | 47 | innerDestroy: function() { 48 | if(this.tip()) { 49 | this.tip().empty().remove(); 50 | } 51 | } 52 | }); 53 | 54 | }(window.jQuery)); -------------------------------------------------------------------------------- /src/containers/editable-tooltip.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Editable jQuery UI Tooltip 3 | * --------------------- 4 | * requires jquery ui 1.9.x 5 | */ 6 | (function ($) { 7 | "use strict"; 8 | 9 | //extend methods 10 | $.extend($.fn.editableContainer.Popup.prototype, { 11 | containerName: 'tooltip', //jQuery method, aplying the widget 12 | //object name in element's .data() 13 | containerDataName: 'ui-tooltip', 14 | innerCss: '.ui-tooltip-content', 15 | defaults: $.ui.tooltip.prototype.options, 16 | 17 | //split options on containerOptions and formOptions 18 | splitOptions: function() { 19 | this.containerOptions = {}; 20 | this.formOptions = {}; 21 | 22 | //check that jQueryUI build contains tooltip widget 23 | if(!$.ui[this.containerName]) { 24 | $.error('Please use jQueryUI with "tooltip" widget! http://jqueryui.com/download'); 25 | return; 26 | } 27 | 28 | //defaults for tooltip 29 | for(var k in this.options) { 30 | if(k in this.defaults) { 31 | this.containerOptions[k] = this.options[k]; 32 | } else { 33 | this.formOptions[k] = this.options[k]; 34 | } 35 | } 36 | }, 37 | 38 | initContainer: function(){ 39 | this.handlePlacement(); 40 | $.extend(this.containerOptions, { 41 | items: '*', 42 | content: ' ', 43 | track: false, 44 | open: $.proxy(function() { 45 | //disable events hiding tooltip by default 46 | this.container()._on(this.container().element, { 47 | mouseleave: function(e){ e.stopImmediatePropagation(); }, 48 | focusout: function(e){ e.stopImmediatePropagation(); } 49 | }); 50 | }, this) 51 | }); 52 | 53 | this.call(this.containerOptions); 54 | 55 | //disable standart triggering tooltip events 56 | this.container()._off(this.container().element, 'mouseover focusin'); 57 | }, 58 | 59 | tip: function() { 60 | return this.container() ? this.container()._find(this.container().element) : null; 61 | }, 62 | 63 | innerShow: function() { 64 | this.call('open'); 65 | var label = this.options.title || this.$element.data( "ui-tooltip-title") || this.$element.data( "originalTitle"); 66 | this.tip().find(this.innerCss).empty().append($('