Skip to content

Commit

Permalink
refactor: remove fancybox outelement span
Browse files Browse the repository at this point in the history
  • Loading branch information
whyour committed Sep 29, 2019
1 parent 51b6c4f commit 41966e3
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 26 deletions.
2 changes: 1 addition & 1 deletion dist/quill.bubble.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Quill Editor v2.0.12
* Quill Editor v2.0.14
* https://quilljs.com/
* Copyright (c) 2014, Jason Chen
* Copyright (c) 2013, salesforce.com
Expand Down
2 changes: 1 addition & 1 deletion dist/quill.core.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Quill Editor v2.0.12
* Quill Editor v2.0.14
* https://quilljs.com/
* Copyright (c) 2014, Jason Chen
* Copyright (c) 2013, salesforce.com
Expand Down
4 changes: 2 additions & 2 deletions dist/quill.core.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions dist/quill.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/quill.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/quill.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/quill.snow.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Quill Editor v2.0.12
* Quill Editor v2.0.14
* https://quilljs.com/
* Copyright (c) 2014, Jason Chen
* Copyright (c) 2013, salesforce.com
Expand Down
6 changes: 3 additions & 3 deletions dist/unit.js

Large diffs are not rendered by default.

16 changes: 6 additions & 10 deletions formats/image.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,20 @@ const ATTRIBUTES = ['alt', 'height', 'width'];
class Image extends EmbedBlot {
static create(value) {
const node = super.create(value);
const span = document.createElement('span');
if (typeof value === 'string') {
node.setAttribute('src', this.sanitize(value));
span.setAttribute('href', this.sanitize(value));
span.setAttribute('data-fancybox-href', this.sanitize(value));
node.setAttribute('data-fancybox-href', this.sanitize(value));
}
if (value.thumbUrl) {
node.setAttribute('src', this.sanitize(value.thumbUrl));
}
if (value.originUrl) {
span.setAttribute('href', this.sanitize(value.originUrl));
span.setAttribute('data-fancybox-href', this.sanitize(value.originUrl));
node.setAttribute('data-fancybox-href', this.sanitize(value.originUrl));
}
span.setAttribute('data-fancybox-type', 'image');
span.setAttribute('data-fancybox-group', 'editor');
span.classList.add('fancybox');
span.appendChild(node);
return span;
node.setAttribute('data-fancybox-type', 'image');
node.setAttribute('data-fancybox-group', 'editor');
node.classList.add('fancybox');
return node;
}

static formats(domNode) {
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "quill",
"version": "2.0.12",
"version": "2.0.14",
"description": "Your powerful, rich text editor",
"author": "Jason Chen <[email protected]>",
"homepage": "http://quilljs.com",
Expand Down Expand Up @@ -155,7 +155,8 @@
"test:functional": "./_develop/scripts/puppeteer.sh",
"test:unit": "npm run build; karma start _develop/karma.config.js",
"test:coverage": "webpack --env.coverage --config _develop/webpack.config.js; karma start _develop/karma.config.js --reporters coverage",
"travis": "npm run lint && karma start _develop/karma.config.js --reporters dots,saucelabs"
"travis": "npm run lint && karma start _develop/karma.config.js --reporters dots,saucelabs",
"copy-to-editor": "npm run build && cp \"./dist/quill.js\" ../ngx-tethys-editor/node_modules/quill/dist"
},
"keywords": [
"editor",
Expand Down

0 comments on commit 41966e3

Please sign in to comment.