Merge remote-tracking branch 'refs/remotes/origin/master' into destroy-module

# Conflicts:
#	codex-editor.js
#	codex-editor.js.map
#	whatwg-fetch.js.map
This commit is contained in:
George Berezhnoy 2017-02-10 20:19:24 +03:00
commit 4962d27c22
10 changed files with 64 additions and 39 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -184,35 +184,36 @@
}
},
data : {
// items: [
// {
// type : 'paragraph',
// data : {
// text : 'Привет от CodeX'
// }
// },
// {
// type : 'tweet',
// data : {
// "media" : true,
// "conversation" : false,
// "user" : null,
// "id" : 12312312312,
// "text" : null,
// "created_at" : null,
// "status_url" : 'ertertert',
// "caption" : null
// },
// cover : false
// },
// {
// type : 'paragraph',
// data : {
// text : 'Пишите нам на team@ifmo.su'
// }
// },
// ],
// count: 2
items: [
{
type : 'paragraph',
data : {
text : 'Привет от CodeX'
}
},
{
type : 'tweet',
data : {
"media" : true,
"conversation" : false,
"user" : null,
"id" : 12312312312,
"text" : null,
"created_at" : null,
"status_url" : 'ertertert',
"caption" : null
},
cover : false
},
{
type : 'paragraph',
data : {
text : 'Пишите нам на team@ifmo.su'
},
anchor: 'Update',
},
],
count: 2
}
});
</script>

View file

@ -12,8 +12,6 @@ module.exports = function (anchors) {
anchors.input = null;
anchors.currentNode = null;
const blockWithAnchorClassName = 'ce-block--anchor';
anchors.settingsOpened = function (currentBlock) {
anchors.currentNode = currentBlock;
@ -29,11 +27,11 @@ module.exports = function (anchors) {
if (newAnchor.trim() !== '') {
anchors.currentNode.classList.add(blockWithAnchorClassName);
anchors.currentNode.classList.add(editor.ui.className.BLOCK_WITH_ANCHOR);
} else {
anchors.currentNode.classList.remove(blockWithAnchorClassName);
anchors.currentNode.classList.remove(editor.ui.className.BLOCK_WITH_ANCHOR);
}

View file

@ -195,6 +195,12 @@ module.exports = (function (content) {
}
if (targetBlock.classList.contains(editor.ui.className.BLOCK_WITH_ANCHOR)) {
newBlock.classList.add(editor.ui.className.BLOCK_WITH_ANCHOR);
}
/**
* Saving anchor
*/
@ -249,6 +255,12 @@ module.exports = (function (content) {
}
if (anchor) {
newBlock.classList.add(editor.ui.className.BLOCK_WITH_ANCHOR);
}
if (workingBlock) {
editor.core.insertAfter(workingBlock, newBlock);

View file

@ -150,7 +150,7 @@ module.exports = (function (renderer) {
var block,
tool = toolData.tool,
pluginName = tool.type,
anchor = toolData.anchor,
anchor = tool.anchor,
cover = tool.cover;
/** Get first key of object that stores plugin name */

View file

@ -38,6 +38,15 @@ module.exports = (function () {
}
/**
* If no one passed plugins requires preparation, finish prepare() and go ahead
*/
if (!pluginsRequiresPreparation.length) {
resolve_();
}
return pluginsRequiresPreparation;
})

View file

@ -39,6 +39,11 @@ module.exports = (function (ui) {
*/
BLOCK_IN_FEED_MODE : 'ce-block--feed-mode',
/**
* @const {String} - Block with anchor
*/
BLOCK_WITH_ANCHOR : 'ce-block--anchor',
/**
* @const {String} - for all default settings
*/

View file

@ -1,6 +1,6 @@
{
"name": "codex.editor",
"version": "1.4.6",
"version": "1.4.8",
"description": "Codex Editor. Native JS, based on API and Open Source",
"main": "index.js",
"scripts": {

File diff suppressed because one or more lines are too long