├── .DS_Store ├── .versions ├── LICENSE.txt ├── README.md ├── editable-text-wysiwyg-tests.js ├── lib ├── .DS_Store ├── editable_text_wysiwyg_bootstrap_3.css ├── editable_text_wysiwyg_bootstrap_3.html └── editable_text_wysiwyg_bootstrap_3.js └── package.js /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackAdams/meteor-editable-text-wysiwyg-bootstrap-3/9ca783214a3a362c994a1335dfd470f7a1d2b898/.DS_Store -------------------------------------------------------------------------------- /.versions: -------------------------------------------------------------------------------- 1 | allow-deny@1.1.1 2 | babel-compiler@7.9.0 3 | babel-runtime@1.5.1 4 | babrahams:editable-text@0.9.18 5 | babrahams:editable-text-wysiwyg@0.6.22 6 | babrahams:editable-text-wysiwyg-bootstrap-3@0.6.22 7 | base64@1.0.12 8 | binary-heap@1.0.11 9 | blaze@2.3.4 10 | blaze-tools@1.0.10 11 | boilerplate-generator@1.7.1 12 | caching-compiler@1.2.2 13 | caching-html-compiler@1.1.2 14 | callback-hook@1.4.0 15 | check@1.3.2 16 | dburles:mongo-collection-instances@0.3.5 17 | ddp@1.4.1 18 | ddp-client@2.6.1 19 | ddp-common@1.4.0 20 | ddp-server@2.6.0 21 | deps@1.0.12 22 | diff-sequence@1.1.2 23 | dynamic-import@0.7.2 24 | ecmascript@0.16.3 25 | ecmascript-runtime@0.8.0 26 | ecmascript-runtime-client@0.12.1 27 | ecmascript-runtime-server@0.11.0 28 | ejson@1.1.3 29 | fetch@0.1.2 30 | geojson-utils@1.0.11 31 | gwendall:body-events@0.1.7 32 | html-tools@1.0.11 33 | htmljs@1.0.11 34 | id-map@1.1.1 35 | inter-process-messaging@0.1.1 36 | jquery@1.11.11 37 | lai:collection-extensions@0.2.1_1 38 | local-test:babrahams:editable-text-wysiwyg-bootstrap-3@0.6.22 39 | logging@1.3.1 40 | meteor@1.10.2 41 | minimongo@1.9.0 42 | modern-browsers@0.1.9 43 | modules@0.19.0 44 | modules-runtime@0.13.1 45 | mongo@1.16.1 46 | mongo-decimal@0.1.3 47 | mongo-dev-server@1.1.0 48 | mongo-id@1.0.8 49 | npm-mongo@4.11.0 50 | observe-sequence@1.0.16 51 | ordered-dict@1.1.0 52 | promise@0.12.1 53 | random@1.2.1 54 | react-fast-refresh@0.2.3 55 | reactive-var@1.0.12 56 | reload@1.3.1 57 | retry@1.1.0 58 | routepolicy@1.1.1 59 | socket-stream-client@0.5.0 60 | spacebars@1.0.15 61 | spacebars-compiler@1.1.2 62 | templating@1.3.2 63 | templating-compiler@1.3.3 64 | templating-runtime@1.3.2 65 | templating-tools@1.1.2 66 | tinytest@1.2.1 67 | tracker@1.2.1 68 | underscore@1.0.11 69 | webapp@1.13.2 70 | webapp-hashing@1.1.1 71 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015-2016 Brent Abrahams 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | WYSIWYG extension for babrahams:editable-text package 2 | ----------------------------------------------------- 3 | 4 | This package provides a wysiwyg widget for editing text in-place. It is for apps that use bootstrap-3. 5 | 6 | Example app: [http://editable-text-demo.taonova.com](http://editable-text-demo.taonova.com) 7 | 8 | Example app repo: [https://github.com/JackAdams/editable-text-demo](https://github.com/JackAdams/editable-text-demo) 9 | 10 | Minimal example app on meteorpad: [http://meteorpad.com/pad/2YdGJmZ9LthGZaLao/editable-text-wysiwyg-bootstrap-3](http://meteorpad.com/pad/2YdGJmZ9LthGZaLao/editable-text-wysiwyg-bootstrap-3) 11 | 12 | #### Quick Start 13 | 14 | If your project does not already use bootstrap-3 and fontawesome: 15 | 16 | meteor add fortawesome:fontawesome 17 | meteor add twbs:bootstrap-noglyph 18 | 19 | This package requires fontawesome and bootstrap-3 to work, but the choice of the particular fontawesome and bootstrap-3 packages is left to the individual - they are not added automatically by this package. Once those are included in your project: 20 | 21 | meteor add babrahams:editable-text-wysiwyg-bootstrap-3 22 | 23 | You can then drop an editable text widget into any Blaze template with `wysiwyg=true`: 24 | 25 | {{> editableText collection="posts" field="body" wysiwyg=true}} 26 | 27 | where "posts" is the name of the mongo collection and "body" is the name of a document field for the `posts` collection. 28 | 29 | `collection` and `field` are mandatory fields. 30 | 31 | Note: The widget assumes that the data context is that of a single document from the `posts` collection (with _id value included). 32 | 33 | You can also set the data context explicitly as follows: 34 | 35 | {{> editableText context=singlePostDocument collection="posts" field="body"}} 36 | 37 | where `singlePostDocument` can be a single post document already set in the current context, or provided by a template helper from the template that the widget was dropped into. 38 | 39 | (You can use `document`, `doc`, `object`, `obj`, `data` or `dataContext` instead of `context` - go with whichever you prefer.) 40 | 41 | #### Documentation 42 | 43 | If you have `wysiwyg=true`, you can also set `toolbarPosition=top` (instead of the default which is at the bottom) and `showToolbar=true` (instead of the default where the toolbar is initially concealed). 44 | 45 | Read the [full documentation](https://github.com/JackAdams/meteor-editable-text#editable-text-for-meteor) for the `babrahams:editable-text` package at [https://github.com/JackAdams/meteor-editable-text](https://github.com/JackAdams/meteor-editable-text). -------------------------------------------------------------------------------- /editable-text-wysiwyg-tests.js: -------------------------------------------------------------------------------- 1 | // Write your tests here! 2 | // Here is an example. 3 | Tinytest.add('example', function (test) { 4 | test.equal(true, true); 5 | }); 6 | -------------------------------------------------------------------------------- /lib/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackAdams/meteor-editable-text-wysiwyg-bootstrap-3/9ca783214a3a362c994a1335dfd470f7a1d2b898/lib/.DS_Store -------------------------------------------------------------------------------- /lib/editable_text_wysiwyg_bootstrap_3.css: -------------------------------------------------------------------------------- 1 | .wysiwyg { 2 | min-height: 20px; 3 | max-height: 250px; 4 | background-color: white; 5 | border-collapse: separate; 6 | border: 1px solid rgb(204, 204, 204); 7 | padding: 4px; 8 | margin: 0; 9 | box-sizing: content-box; 10 | -webkit-box-shadow: rgba(0, 0, 0, 0.0745098) 0px 1px 1px 0px inset; 11 | box-shadow: rgba(0, 0, 0, 0.0745098) 0px 1px 1px 0px inset; 12 | border-top-right-radius: 3px; border-bottom-right-radius: 3px; 13 | border-bottom-left-radius: 3px; border-top-left-radius: 3px; 14 | overflow: auto; 15 | outline: none; 16 | } 17 | 18 | .wysiwyg-toolbar { 19 | min-width:84px; 20 | } 21 | 22 | .dropdown-menu a { 23 | cursor: pointer; 24 | } 25 | 26 | .wysiwyg-tools .btn { 27 | } 28 | 29 | .wysiwyg-tools .btn-group:not(.dropdown-menu) { 30 | margin-top: 2px; 31 | } 32 | 33 | .wysiwyg-container { 34 | padding: 0px 0px 2px 0px; 35 | margin-bottom: 0px; 36 | width: 100%; 37 | border-radius: 3px; 38 | padding: 2px; 39 | border: 1px dashed #ccc; 40 | background: #eee; 41 | display: inline-block; 42 | } 43 | 44 | .wysiwyg ul, .wysiwyg-content ul { 45 | list-style: disc inside none; 46 | } 47 | 48 | .wysiwyg a, .wysiwyg-content a { 49 | text-decoration: underline; 50 | color: #336699; 51 | } 52 | 53 | .wysiwyg a:hover, .wysiwyg-content a:hover { 54 | color: #6699cc; 55 | } 56 | 57 | .wysiwyg-container .btn-toolbar { 58 | margin: 0 0 2px 0; 59 | } 60 | 61 | .wysiwyg-container .wysiwyg + .wysiwyg-toolbar { 62 | margin: 2px 0 0 0; 63 | } 64 | 65 | .wysiwyg-container .btn-group + .btn-group { 66 | margin-left: 2px; 67 | } 68 | 69 | .wysiwyg-container .input-append { 70 | padding: 5px 5px 2px 5px; 71 | min-width: 202px; 72 | } 73 | 74 | .wysiwyg-container .input-append .btn { 75 | padding: 0px 4px; 76 | margin-bottom: 3px; 77 | height: 28px; 78 | } 79 | 80 | .wysiwyg-container .input-append input { 81 | width: 150px; 82 | } 83 | 84 | .wysiwyg sup { 85 | vertical-align: super !important; 86 | } 87 | 88 | .wysiwyg sub { 89 | vertical-align: sub !important; 90 | } 91 | 92 | .et-wysiwyg-color:hover { 93 | background: #000 !important; 94 | border-radius: 3px !important; 95 | } -------------------------------------------------------------------------------- /lib/editable_text_wysiwyg_bootstrap_3.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib/editable_text_wysiwyg_bootstrap_3.js: -------------------------------------------------------------------------------- 1 | // Without this, the editableText widget will fall back to a textarea: 2 | EditableText.wysiwyg = true; 3 | 4 | Template.wysiwyg_toolbar.helpers({ 5 | colors: function () { return EditableText._wysiwygColors(); }, 6 | editingHTML : function () { 7 | var tmpl = EditableText._findWysiwygInstance(Template.instance()); 8 | return tmpl && tmpl.editHTML && tmpl.editHTML.get(); 9 | }, 10 | customButtons : function (position) { 11 | return EditableText._customButtons(this, position, Template.instance()); 12 | }, 13 | showButton : function () { 14 | return (_.isFunction(this.show)) ? this.show.call(Template.instance().data, this) : true; 15 | } 16 | }); -------------------------------------------------------------------------------- /package.js: -------------------------------------------------------------------------------- 1 | Package.describe({ 2 | name: 'babrahams:editable-text-wysiwyg-bootstrap-3', 3 | summary: 'Extends the babrahams:editable-text package to include a wysiwyg editor that uses bootstrap-3', 4 | version: '0.6.22', 5 | git: 'https://github.com/jackadams/meteor-editable-text-wysiwyg-bootstrap-3.git' 6 | }); 7 | 8 | Package.onUse(function (api) { 9 | 10 | api.versionsFrom(['1.8.2', '2.3']); 11 | 12 | api.use('babrahams:editable-text@0.9.18', ['client', 'server']); 13 | api.imply('babrahams:editable-text'); 14 | api.use('babrahams:editable-text-wysiwyg@0.6.22', 'client'); 15 | api.use(['templating@1.3.2', 'blaze@2.3.4', 'spacebars@1.0.15', 'jquery@1.11.11'], 'client'); 16 | 17 | api.addFiles('lib/editable_text_wysiwyg_bootstrap_3.css', 'client'); 18 | api.addFiles('lib/editable_text_wysiwyg_bootstrap_3.html', 'client'); 19 | api.addFiles('lib/editable_text_wysiwyg_bootstrap_3.js', 'client'); 20 | 21 | }); 22 | 23 | Package.onTest(function (api) { 24 | api.use('tinytest'); 25 | api.use('babrahams:editable-text-wysiwyg'); 26 | api.addFiles('editable-text-wysiwyg-tests.js'); 27 | }); --------------------------------------------------------------------------------