forked from ckeditor/ckeditor4-presets
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
moved around plugin setup so that plugins are added externally to build
- Loading branch information
1 parent
6f40ba5
commit ef8e9e9
Showing
18 changed files
with
1,289 additions
and
1,163 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes
File renamed without changes.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-468 Bytes
(97%)
build/touchpoint/ckeditor/skins/moono-lisa/icons_hidpi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
"use strict"; | ||
|
||
CKEDITOR.plugins.add('ddf', { | ||
icons: 'ddf', | ||
init: function init(editor) { | ||
if (editor.element.hasClass("ddf")) { | ||
editor.addCommand('ddf', new CKEDITOR.dialogCommand('ddfDialog')); | ||
editor.ui.addButton('DDF', { | ||
label: 'Insert Dymanic Data', | ||
command: 'ddf', | ||
toolbar: 'insert' | ||
}); | ||
editor.addMenuGroup('ddfGroup'); | ||
editor.addMenuItem('ddfItem', { | ||
label: 'Edit Dymanic Data', | ||
icon: this.path + 'icons/ddf.png', | ||
command: 'ddf', | ||
group: 'ddfGroup' | ||
}); | ||
|
||
if (editor.contextMenu != null) { | ||
editor.contextMenu.addListener(function (element) { | ||
if (element.getAscendant('x-ddf', true)) { | ||
return { | ||
ddfItem: CKEDITOR.TRISTATE_OFF | ||
}; | ||
} | ||
}); | ||
} | ||
|
||
return editor.on('doubleclick', function (evt) { | ||
var element = evt.data.element; | ||
|
||
if (element.is('x-ddf')) { | ||
return evt.data.dialog = 'ddfDialog'; | ||
} | ||
}); | ||
} | ||
}, | ||
onLoad: function onLoad() { | ||
return CKEDITOR.addCss("x-ddf::before { content: \"<\"; }\nx-ddf::after { content: \">\"; }"); | ||
} | ||
}); | ||
CKEDITOR.on('dialogDefinition', function (evt) { | ||
if (evt.data.name === 'image' && evt.editor.element.hasClass("ddf")) { | ||
var imageTab = evt.data.definition.getContents('info'); | ||
return imageTab.elements.splice(1, 0, { | ||
type: 'select', | ||
id: 'field', | ||
label: 'DDF', | ||
width: 'auto; display: block', | ||
items: window.ddFields && [[], ['Attendee Photo', 'viewer.photo_url']], | ||
setup: function setup(type, element) { | ||
return this.setValue(element.getAttribute("data-field")); | ||
}, | ||
commit: function commit(type, element) { | ||
var value = this.getValue(); | ||
|
||
if (value !== '') { | ||
return element.setAttribute('data-field', value); | ||
} else { | ||
return element.removeAttribute('data-field'); | ||
} | ||
}, | ||
onChange: function onChange() { | ||
var iconPath = this.getDialog().getParentEditor().plugins.ddf.path + 'icons/ddf.png'; | ||
return this.getDialog().getContentElement('info', 'txtUrl').setValue(this.getValue() !== '' ? iconPath : ''); | ||
} | ||
}); | ||
} | ||
}); | ||
CKEDITOR.dialog.add('ddfDialog', function (editor) { | ||
return { | ||
title: 'Dymanic Data Field', | ||
minWidth: 200, | ||
minHeight: 80, | ||
contents: [{ | ||
id: 'tab-basic', | ||
label: 'Basic Settings', | ||
elements: [{ | ||
type: 'select', | ||
id: 'field', | ||
width: 'auto; display: block', | ||
items: window.ddFields || [], | ||
validate: CKEDITOR.dialog.validate.notEmpty("Data field must be selected."), | ||
setup: function setup(element) { | ||
return this.setValue(element.getAttribute("data-field")); | ||
}, | ||
commit: function commit(element) { | ||
var select = this.getInputElement().$; | ||
var label = select.options[select.selectedIndex].text; | ||
element.setText(label); | ||
return element.setAttribute("data-field", this.getValue()); | ||
} | ||
}] | ||
}], | ||
onOk: function onOk() { | ||
this.commitContent(this.element); | ||
|
||
if (this.insertMode) { | ||
return editor.insertElement(this.element); | ||
} | ||
}, | ||
onShow: function onShow() { | ||
var selection = editor.getSelection(); | ||
this.element = selection.getStartElement(); | ||
|
||
if (this.element) { | ||
this.element = this.element.getAscendant('x-ddf', true); | ||
} | ||
|
||
if (!this.element || this.element.getName() !== 'x-ddf') { | ||
this.element = editor.document.createElement('x-ddf'); | ||
this.insertMode = true; | ||
} else { | ||
this.insertMode = false; | ||
} | ||
|
||
if (!this.insertMode) { | ||
return this.setupContent(this.element); | ||
} | ||
} | ||
}; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,7 +71,6 @@ var CKBUILDER_CONFIG = { | |
uploadimage: 1, | ||
wsc: 1, | ||
wysiwygarea: 1, | ||
ddf: 1, | ||
scayt: 1 | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters