├── src ├── tools │ ├── template.js │ ├── types.js │ ├── node.js │ ├── persist.js │ └── string.js ├── plugins │ ├── snippet-menu │ │ ├── templates │ │ │ └── item.html │ │ ├── templates.js │ │ ├── document-snippet.png │ │ └── snippet-menu.scss │ ├── tag-menu │ │ ├── templates │ │ │ └── item.html │ │ ├── edit.png │ │ ├── templates.js │ │ └── tag-menu.scss │ ├── class-menu │ │ ├── templates │ │ │ └── item.html │ │ ├── templates.js │ │ ├── palette-paint-brush.png │ │ └── class-menu.scss │ ├── special-characters │ │ ├── templates │ │ │ ├── tab-content.html │ │ │ ├── tab-li.html │ │ │ ├── dialog.html │ │ │ └── tab-button.html │ │ ├── edit-symbol.png │ │ ├── special-characters.scss │ │ └── templates.js │ ├── close │ │ ├── cross.png │ │ ├── close.scss │ │ └── close.js │ ├── link │ │ ├── chain.png │ │ ├── chain-unchain.png │ │ ├── templates │ │ │ ├── label.html │ │ │ ├── error.html │ │ │ ├── dialog.html │ │ │ ├── email.html │ │ │ ├── document.html │ │ │ ├── internal.html │ │ │ ├── external.html │ │ │ └── file-url.html │ │ ├── link-remove.js │ │ ├── link-open.js │ │ └── link-type-document.js │ ├── logo │ │ ├── raptor.png │ │ ├── logo.scss │ │ └── logo.js │ ├── cancel │ │ ├── cross.png │ │ ├── cancel.scss │ │ └── cancel.js │ ├── embed │ │ ├── youtube.png │ │ ├── templates.js │ │ ├── templates │ │ │ └── dialog.html │ │ └── embed.scss │ ├── font-family │ │ ├── templates │ │ │ └── menu-item.html │ │ ├── templates.js │ │ ├── font-family.scss │ │ └── font-family-front-end.scss │ ├── guides │ │ ├── guide.png │ │ ├── guides.scss │ │ └── guides.js │ ├── hr │ │ ├── edit-rule.png │ │ ├── hr.scss │ │ └── hr-create.js │ ├── list │ │ ├── edit-list.png │ │ ├── edit-list-order.png │ │ ├── list.scss │ │ ├── list-ordered.js │ │ └── list-unordered.js │ ├── tool-tip │ │ ├── tip.png │ │ ├── tool-tip.js │ │ └── tool-tip.scss │ ├── float │ │ ├── edit-image.png │ │ ├── edit-image-none.png │ │ ├── edit-image-right.png │ │ ├── float-front-end.scss │ │ ├── float.scss │ │ ├── float-left.js │ │ ├── float-none.js │ │ └── float-right.js │ ├── save │ │ ├── disk-black.png │ │ └── save.scss │ ├── clean-block │ │ ├── broom.png │ │ ├── clean-block.png │ │ ├── clean-block.scss │ │ └── clean-block.js │ ├── history │ │ ├── arrow-curve.png │ │ ├── arrow-curve-180-left.png │ │ ├── history.scss │ │ ├── history-undo.js │ │ └── history-redo.js │ ├── image-swap │ │ ├── images.png │ │ ├── image-swap.scss │ │ └── image-swap.js │ ├── insert-file │ │ ├── image.png │ │ ├── insert-file.scss │ │ ├── templates.js │ │ └── templates │ │ │ └── dialog.html │ ├── statistics │ │ ├── dashboard.png │ │ ├── templates.js │ │ ├── templates │ │ │ └── dialog.html │ │ └── statistics.scss │ ├── view-source │ │ ├── edit-code.png │ │ ├── templates │ │ │ └── dialog.html │ │ ├── templates.js │ │ ├── view-source.scss │ │ └── view-source.js │ ├── language-menu │ │ ├── flags │ │ │ ├── ae.png │ │ │ ├── bg.png │ │ │ ├── ca.png │ │ │ ├── cn.png │ │ │ ├── cz.png │ │ │ ├── de.png │ │ │ ├── dk.png │ │ │ ├── ee.png │ │ │ ├── en.png │ │ │ ├── es.png │ │ │ ├── fi.png │ │ │ ├── fr.png │ │ │ ├── gr.png │ │ │ ├── ht.png │ │ │ ├── hu.png │ │ │ ├── id.png │ │ │ ├── il.png │ │ │ ├── in.png │ │ │ ├── ir.png │ │ │ ├── it.png │ │ │ ├── jp.png │ │ │ ├── kr.png │ │ │ ├── lt.png │ │ │ ├── lv.png │ │ │ ├── my.png │ │ │ ├── nl.png │ │ │ ├── nl_1.png │ │ │ ├── no.png │ │ │ ├── pk.png │ │ │ ├── pl.png │ │ │ ├── pt.png │ │ │ ├── ro.png │ │ │ ├── ru.png │ │ │ ├── se.png │ │ │ ├── si.png │ │ │ ├── sk.png │ │ │ ├── th.png │ │ │ ├── tr.png │ │ │ ├── ua.png │ │ │ ├── vn.png │ │ │ ├── zh.png │ │ │ └── other.png │ │ ├── templates │ │ │ └── item.html │ │ ├── templates.js │ │ └── language-menu.scss │ ├── table │ │ ├── style │ │ │ ├── images │ │ │ │ ├── table.png │ │ │ │ ├── table-join.png │ │ │ │ ├── table-split.png │ │ │ │ ├── table-delete-row.png │ │ │ │ ├── table-insert-row.png │ │ │ │ ├── table-delete-column.png │ │ │ │ └── table-insert-column.png │ │ │ ├── table-support.scss │ │ │ └── table.scss │ │ ├── table-merge-cells.js │ │ ├── table-split-cells.js │ │ ├── table-insert-row.js │ │ ├── table-insert-column.js │ │ ├── templates.js │ │ ├── table-cell-button.js │ │ ├── table-delete-row.js │ │ ├── table-delete-column.js │ │ └── templates │ │ │ └── create-menu.html │ ├── click-button-to-edit │ │ ├── templates │ │ │ └── button.html │ │ ├── pencil.png │ │ ├── templates.js │ │ ├── click-button-to-edit.scss │ │ └── click-button-to-edit.js │ ├── dock │ │ ├── application-dock-090.png │ │ ├── application-dock-tab.png │ │ ├── dock.scss │ │ ├── dock-to-element.js │ │ ├── dock-to-screen.js │ │ └── dock-to-screen.scss │ ├── image-resize │ │ ├── image-resize.png │ │ ├── templates.js │ │ ├── templates │ │ │ └── dialog.html │ │ └── image-resize.scss │ ├── clear-formatting │ │ ├── clear-formatting.png │ │ ├── clear-formatting.scss │ │ └── clear-formatting.js │ ├── text-style │ │ ├── style │ │ │ ├── images │ │ │ │ ├── edit-bold.png │ │ │ │ ├── edit-italic.png │ │ │ │ ├── edit-size-up.png │ │ │ │ ├── edit-strike.png │ │ │ │ ├── edit-quotation.png │ │ │ │ ├── edit-size-down.png │ │ │ │ ├── edit-subscript.png │ │ │ │ ├── edit-underline.png │ │ │ │ └── edit-superscript.png │ │ │ ├── bold-front-end.scss │ │ │ ├── italic-front-end.scss │ │ │ ├── strike-front-end.scss │ │ │ ├── bold.scss │ │ │ ├── underline-front-end.scss │ │ │ ├── italic.scss │ │ │ ├── strike.scss │ │ │ ├── sub.scss │ │ │ ├── block-quote.scss │ │ │ ├── super.scss │ │ │ ├── underline.scss │ │ │ └── text-size.scss │ │ ├── sub.js │ │ ├── strike.js │ │ ├── super.js │ │ ├── bold.js │ │ ├── italic.js │ │ ├── underline.js │ │ ├── block-quote.js │ │ ├── size-decrease.js │ │ └── size-increase.js │ ├── text-align │ │ ├── style │ │ │ ├── images │ │ │ │ ├── edit-alignment.png │ │ │ │ ├── edit-alignment-right.png │ │ │ │ ├── edit-alignment-center.png │ │ │ │ └── edit-alignment-justify.png │ │ │ ├── text-align-front-end.scss │ │ │ └── text-align.scss │ │ ├── left.js │ │ ├── right.js │ │ ├── center.js │ │ ├── justify.js │ │ └── text-align-button.js │ ├── color-menu-basic │ │ ├── templates │ │ │ ├── item.html │ │ │ └── automatic.html │ │ ├── templates.js │ │ ├── color-menu-basic-front-end.scss │ │ └── color-menu-basic.scss │ ├── unsaved-edit-warning │ │ ├── templates │ │ │ └── warning.html │ │ ├── templates.js │ │ └── unsaved-edit-warning.scss │ ├── paste │ │ ├── paste.scss │ │ ├── templates.js │ │ └── templates │ │ │ └── dialog.html │ └── no-break │ │ └── no-break.js ├── style │ ├── loading-small.png │ ├── diagonal-lines.png │ ├── config.rb │ ├── raptor.scss │ ├── variables.scss │ ├── z-index.scss │ ├── mixins.scss │ ├── support.scss │ └── style.scss ├── presets │ ├── build.js │ ├── micro.js │ └── inline.js ├── components │ ├── layout.js │ ├── ui │ │ ├── menu.scss │ │ ├── dialog-toggle-button.js │ │ ├── menu-button.js │ │ ├── custom-menu.js │ │ ├── preview-toggle-button.js │ │ ├── toggle-button.js │ │ ├── select-menu.scss │ │ └── css-class-applier-button.js │ ├── layout │ │ ├── hover-panel.scss │ │ └── toolbar.scss │ └── plugin.js ├── templates.js ├── init.js └── templates │ └── unsupported.html ├── tests ├── scss │ ├── base.scss │ ├── table.scss │ ├── style.scss │ └── diff.scss ├── backup │ ├── toggle-wrapper-1 │ │ ├── test.js │ │ └── output │ │ │ ├── selection-single.html │ │ │ ├── selection-single-group.html │ │ │ ├── selection-single-part.html │ │ │ ├── selection-single-multiline.html │ │ │ ├── selection-single-start-to-end-e.html │ │ │ └── selection-single-start-to-end-p.html │ └── break │ │ ├── output │ │ ├── selection-single-multiblock.html │ │ ├── selection-single-shift-enter.html │ │ ├── selection-single-multiline.html │ │ └── selection-single-link.html │ │ └── input │ │ ├── selection-single-multiblock.html │ │ ├── selection-single-multiline.html │ │ ├── selection-single-shift-enter.html │ │ └── selection-single-link.html ├── images │ ├── raptor.png │ └── spinner.gif ├── js │ ├── non-functional-test.js │ ├── code-mirror.js │ └── reorder-attributes.js ├── css │ ├── style.css │ ├── table.css │ └── diff.css ├── bin │ └── convert.php ├── include.php ├── cases │ ├── placeholder │ │ └── placeholder.php │ ├── format-html │ │ └── test.html │ ├── table │ │ └── create-table.html │ ├── block-quote │ │ └── table.html │ ├── custom-tags │ │ └── tag.js │ ├── list │ │ └── toggle-5.html │ ├── applier │ │ └── test-link-image.php │ ├── image-resize │ │ └── cancel-resize.php │ ├── links │ │ └── disable-button.php │ └── dock │ │ └── dock-to-screen-button.php └── templates │ ├── base.html │ ├── selection-single.html │ ├── selection-single-group.html │ ├── selection-single-part.html │ ├── selection-single-multiline.html │ ├── selection-single-start-to-end-e.html │ └── selection-single-start-to-end-p.html ├── bin ├── jscoverws.bat └── prepare-gh-pages.sh ├── php ├── functions │ ├── example │ │ ├── head.php │ │ └── load-content.php │ └── load-raptor.php └── include.php ├── .gitignore ├── package.json ├── composer.json ├── scripts ├── functions.php ├── list-plugins.php ├── expose.php ├── create-build.php ├── list-files.php ├── filelist.php └── convert-bind.php ├── TOP ├── LEGAL_NOTICE └── THIRD_PARTY_COMPONENTS_AND_LIBRARIES /src/tools/template.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/scss/base.scss: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/plugins/snippet-menu/templates/item.html: -------------------------------------------------------------------------------- 1 |
  • {{name}}
  • -------------------------------------------------------------------------------- /src/plugins/tag-menu/templates/item.html: -------------------------------------------------------------------------------- 1 |
  • {{name}}
  • 2 | -------------------------------------------------------------------------------- /src/plugins/class-menu/templates/item.html: -------------------------------------------------------------------------------- 1 |
  • {{label}}
  • 2 | -------------------------------------------------------------------------------- /tests/backup/toggle-wrapper-1/test.js: -------------------------------------------------------------------------------- 1 | $.ui.editor.instances[0].uiObjects.textBold.ui.click(); 2 | -------------------------------------------------------------------------------- /src/plugins/special-characters/templates/tab-content.html: -------------------------------------------------------------------------------- 1 |
    2 | -------------------------------------------------------------------------------- /tests/images/raptor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/tests/images/raptor.png -------------------------------------------------------------------------------- /tests/images/spinner.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/tests/images/spinner.gif -------------------------------------------------------------------------------- /tests/js/non-functional-test.js: -------------------------------------------------------------------------------- 1 | window.testResults = { 2 | tests: [], 3 | finished: true 4 | }; 5 | -------------------------------------------------------------------------------- /src/plugins/close/cross.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/close/cross.png -------------------------------------------------------------------------------- /src/plugins/link/chain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/link/chain.png -------------------------------------------------------------------------------- /src/plugins/logo/raptor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/logo/raptor.png -------------------------------------------------------------------------------- /src/plugins/special-characters/templates/tab-li.html: -------------------------------------------------------------------------------- 1 |
  • {{name}}
  • 2 | -------------------------------------------------------------------------------- /src/style/loading-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/style/loading-small.png -------------------------------------------------------------------------------- /src/plugins/cancel/cross.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/cancel/cross.png -------------------------------------------------------------------------------- /src/plugins/embed/youtube.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/embed/youtube.png -------------------------------------------------------------------------------- /src/plugins/font-family/templates/menu-item.html: -------------------------------------------------------------------------------- 1 |
  • {{fontTitle}}
  • -------------------------------------------------------------------------------- /src/plugins/guides/guide.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/guides/guide.png -------------------------------------------------------------------------------- /src/plugins/hr/edit-rule.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/hr/edit-rule.png -------------------------------------------------------------------------------- /src/plugins/list/edit-list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/list/edit-list.png -------------------------------------------------------------------------------- /src/plugins/tag-menu/edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/tag-menu/edit.png -------------------------------------------------------------------------------- /src/plugins/tag-menu/templates.js: -------------------------------------------------------------------------------- 1 | templateRegister("tag-menu.item", "
  • {{name}}
  • "); -------------------------------------------------------------------------------- /src/plugins/tool-tip/tip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/tool-tip/tip.png -------------------------------------------------------------------------------- /src/style/diagonal-lines.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/style/diagonal-lines.png -------------------------------------------------------------------------------- /src/plugins/float/edit-image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/float/edit-image.png -------------------------------------------------------------------------------- /src/plugins/save/disk-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/save/disk-black.png -------------------------------------------------------------------------------- /src/plugins/class-menu/templates.js: -------------------------------------------------------------------------------- 1 | templateRegister("class-menu.item", "
  • {{label}}
  • "); -------------------------------------------------------------------------------- /src/plugins/clean-block/broom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/clean-block/broom.png -------------------------------------------------------------------------------- /src/plugins/history/arrow-curve.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/history/arrow-curve.png -------------------------------------------------------------------------------- /src/plugins/image-swap/images.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/image-swap/images.png -------------------------------------------------------------------------------- /src/plugins/insert-file/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/insert-file/image.png -------------------------------------------------------------------------------- /src/plugins/link/chain-unchain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/link/chain-unchain.png -------------------------------------------------------------------------------- /src/plugins/snippet-menu/templates.js: -------------------------------------------------------------------------------- 1 | templateRegister("snippet-menu.item", "
  • {{name}}
  • "); -------------------------------------------------------------------------------- /src/plugins/float/edit-image-none.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/float/edit-image-none.png -------------------------------------------------------------------------------- /src/plugins/list/edit-list-order.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/list/edit-list-order.png -------------------------------------------------------------------------------- /src/plugins/statistics/dashboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/statistics/dashboard.png -------------------------------------------------------------------------------- /src/plugins/view-source/edit-code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/view-source/edit-code.png -------------------------------------------------------------------------------- /src/plugins/view-source/templates/dialog.html: -------------------------------------------------------------------------------- 1 |
    2 | 3 |
    4 | -------------------------------------------------------------------------------- /src/plugins/clean-block/clean-block.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/clean-block/clean-block.png -------------------------------------------------------------------------------- /src/plugins/float/edit-image-right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/float/edit-image-right.png -------------------------------------------------------------------------------- /src/plugins/language-menu/flags/ae.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/language-menu/flags/ae.png -------------------------------------------------------------------------------- /src/plugins/language-menu/flags/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/language-menu/flags/bg.png -------------------------------------------------------------------------------- /src/plugins/language-menu/flags/ca.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/language-menu/flags/ca.png -------------------------------------------------------------------------------- /src/plugins/language-menu/flags/cn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/language-menu/flags/cn.png -------------------------------------------------------------------------------- /src/plugins/language-menu/flags/cz.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/language-menu/flags/cz.png -------------------------------------------------------------------------------- /src/plugins/language-menu/flags/de.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/language-menu/flags/de.png -------------------------------------------------------------------------------- /src/plugins/language-menu/flags/dk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/language-menu/flags/dk.png -------------------------------------------------------------------------------- /src/plugins/language-menu/flags/ee.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/language-menu/flags/ee.png -------------------------------------------------------------------------------- /src/plugins/language-menu/flags/en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/language-menu/flags/en.png -------------------------------------------------------------------------------- /src/plugins/language-menu/flags/es.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/language-menu/flags/es.png -------------------------------------------------------------------------------- /src/plugins/language-menu/flags/fi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/language-menu/flags/fi.png -------------------------------------------------------------------------------- /src/plugins/language-menu/flags/fr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/language-menu/flags/fr.png -------------------------------------------------------------------------------- /src/plugins/language-menu/flags/gr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/language-menu/flags/gr.png -------------------------------------------------------------------------------- /src/plugins/language-menu/flags/ht.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/language-menu/flags/ht.png -------------------------------------------------------------------------------- /src/plugins/language-menu/flags/hu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/language-menu/flags/hu.png -------------------------------------------------------------------------------- /src/plugins/language-menu/flags/id.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/language-menu/flags/id.png -------------------------------------------------------------------------------- /src/plugins/language-menu/flags/il.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/language-menu/flags/il.png -------------------------------------------------------------------------------- /src/plugins/language-menu/flags/in.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/language-menu/flags/in.png -------------------------------------------------------------------------------- /src/plugins/language-menu/flags/ir.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/language-menu/flags/ir.png -------------------------------------------------------------------------------- /src/plugins/language-menu/flags/it.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/language-menu/flags/it.png -------------------------------------------------------------------------------- /src/plugins/language-menu/flags/jp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/language-menu/flags/jp.png -------------------------------------------------------------------------------- /src/plugins/language-menu/flags/kr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/language-menu/flags/kr.png -------------------------------------------------------------------------------- /src/plugins/language-menu/flags/lt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/language-menu/flags/lt.png -------------------------------------------------------------------------------- /src/plugins/language-menu/flags/lv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/language-menu/flags/lv.png -------------------------------------------------------------------------------- /src/plugins/language-menu/flags/my.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/language-menu/flags/my.png -------------------------------------------------------------------------------- /src/plugins/language-menu/flags/nl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/language-menu/flags/nl.png -------------------------------------------------------------------------------- /src/plugins/language-menu/flags/nl_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/language-menu/flags/nl_1.png -------------------------------------------------------------------------------- /src/plugins/language-menu/flags/no.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/language-menu/flags/no.png -------------------------------------------------------------------------------- /src/plugins/language-menu/flags/pk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/language-menu/flags/pk.png -------------------------------------------------------------------------------- /src/plugins/language-menu/flags/pl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/language-menu/flags/pl.png -------------------------------------------------------------------------------- /src/plugins/language-menu/flags/pt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/language-menu/flags/pt.png -------------------------------------------------------------------------------- /src/plugins/language-menu/flags/ro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/language-menu/flags/ro.png -------------------------------------------------------------------------------- /src/plugins/language-menu/flags/ru.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/language-menu/flags/ru.png -------------------------------------------------------------------------------- /src/plugins/language-menu/flags/se.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/language-menu/flags/se.png -------------------------------------------------------------------------------- /src/plugins/language-menu/flags/si.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/language-menu/flags/si.png -------------------------------------------------------------------------------- /src/plugins/language-menu/flags/sk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/language-menu/flags/sk.png -------------------------------------------------------------------------------- /src/plugins/language-menu/flags/th.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/language-menu/flags/th.png -------------------------------------------------------------------------------- /src/plugins/language-menu/flags/tr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/language-menu/flags/tr.png -------------------------------------------------------------------------------- /src/plugins/language-menu/flags/ua.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/language-menu/flags/ua.png -------------------------------------------------------------------------------- /src/plugins/language-menu/flags/vn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/language-menu/flags/vn.png -------------------------------------------------------------------------------- /src/plugins/language-menu/flags/zh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/language-menu/flags/zh.png -------------------------------------------------------------------------------- /src/plugins/table/style/images/table.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/table/style/images/table.png -------------------------------------------------------------------------------- /src/plugins/click-button-to-edit/templates/button.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/plugins/dock/application-dock-090.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/dock/application-dock-090.png -------------------------------------------------------------------------------- /src/plugins/dock/application-dock-tab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/dock/application-dock-tab.png -------------------------------------------------------------------------------- /src/plugins/image-resize/image-resize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/image-resize/image-resize.png -------------------------------------------------------------------------------- /src/plugins/language-menu/flags/other.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/language-menu/flags/other.png -------------------------------------------------------------------------------- /src/plugins/special-characters/templates/dialog.html: -------------------------------------------------------------------------------- 1 |
    2 | tr('specialCharactersHelp') 3 |
    4 | 5 |
    6 | -------------------------------------------------------------------------------- /src/plugins/click-button-to-edit/pencil.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/click-button-to-edit/pencil.png -------------------------------------------------------------------------------- /src/plugins/history/arrow-curve-180-left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/history/arrow-curve-180-left.png -------------------------------------------------------------------------------- /src/plugins/snippet-menu/document-snippet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/snippet-menu/document-snippet.png -------------------------------------------------------------------------------- /src/plugins/table/style/images/table-join.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/table/style/images/table-join.png -------------------------------------------------------------------------------- /src/plugins/class-menu/palette-paint-brush.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/class-menu/palette-paint-brush.png -------------------------------------------------------------------------------- /src/plugins/font-family/templates.js: -------------------------------------------------------------------------------- 1 | templateRegister("font-family.menu-item", "
  • {{fontTitle}}
  • "); -------------------------------------------------------------------------------- /src/plugins/language-menu/templates/item.html: -------------------------------------------------------------------------------- 1 |
  • {{label}}
  • 2 | -------------------------------------------------------------------------------- /src/plugins/special-characters/edit-symbol.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/special-characters/edit-symbol.png -------------------------------------------------------------------------------- /src/plugins/table/style/images/table-split.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/table/style/images/table-split.png -------------------------------------------------------------------------------- /src/plugins/view-source/templates.js: -------------------------------------------------------------------------------- 1 | templateRegister("view-source.dialog", "
    "); -------------------------------------------------------------------------------- /bin/jscoverws.bat: -------------------------------------------------------------------------------- 1 | jscover -ws --branch --document-root=. --report-dir=jscover --no-instrument=src/dependencies --no-instrument=tests --no-instrument=codemirror -------------------------------------------------------------------------------- /php/functions/example/head.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | {{label}} 4 | 5 | -------------------------------------------------------------------------------- /src/plugins/table/style/images/table-delete-row.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/table/style/images/table-delete-row.png -------------------------------------------------------------------------------- /src/plugins/table/style/images/table-insert-row.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/table/style/images/table-insert-row.png -------------------------------------------------------------------------------- /src/plugins/text-style/style/images/edit-italic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/text-style/style/images/edit-italic.png -------------------------------------------------------------------------------- /src/plugins/text-style/style/images/edit-size-up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/text-style/style/images/edit-size-up.png -------------------------------------------------------------------------------- /src/plugins/text-style/style/images/edit-strike.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/text-style/style/images/edit-strike.png -------------------------------------------------------------------------------- /src/plugins/table/style/images/table-delete-column.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/table/style/images/table-delete-column.png -------------------------------------------------------------------------------- /src/plugins/table/style/images/table-insert-column.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/table/style/images/table-insert-column.png -------------------------------------------------------------------------------- /src/plugins/text-align/style/images/edit-alignment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/text-align/style/images/edit-alignment.png -------------------------------------------------------------------------------- /src/plugins/text-style/style/images/edit-quotation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/text-style/style/images/edit-quotation.png -------------------------------------------------------------------------------- /src/plugins/text-style/style/images/edit-size-down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/text-style/style/images/edit-size-down.png -------------------------------------------------------------------------------- /src/plugins/text-style/style/images/edit-subscript.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/text-style/style/images/edit-subscript.png -------------------------------------------------------------------------------- /src/plugins/text-style/style/images/edit-underline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/text-style/style/images/edit-underline.png -------------------------------------------------------------------------------- /src/plugins/text-style/style/images/edit-superscript.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/text-style/style/images/edit-superscript.png -------------------------------------------------------------------------------- /src/plugins/text-align/style/images/edit-alignment-right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/text-align/style/images/edit-alignment-right.png -------------------------------------------------------------------------------- /src/plugins/click-button-to-edit/templates.js: -------------------------------------------------------------------------------- 1 | templateRegister("click-button-to-edit.button", ""); -------------------------------------------------------------------------------- /src/plugins/text-align/style/images/edit-alignment-center.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/text-align/style/images/edit-alignment-center.png -------------------------------------------------------------------------------- /src/plugins/text-align/style/images/edit-alignment-justify.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PANmedia/raptor-editor/HEAD/src/plugins/text-align/style/images/edit-alignment-justify.png -------------------------------------------------------------------------------- /src/plugins/language-menu/templates.js: -------------------------------------------------------------------------------- 1 | templateRegister("language-menu.item", "
  • {{label}}
  • "); -------------------------------------------------------------------------------- /src/plugins/special-characters/templates/tab-button.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/plugins/close/close.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Close plugin. 3 | * 4 | * @author David Neilsen 5 | */ 6 | .raptor-ui-close { 7 | @include button-icon('cross.png'); 8 | } 9 | -------------------------------------------------------------------------------- /src/plugins/color-menu-basic/templates/item.html: -------------------------------------------------------------------------------- 1 |
  • {{label}}
  • 2 | -------------------------------------------------------------------------------- /src/plugins/save/save.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Save plugin. 3 | * 4 | * @author David Neilsen 5 | */ 6 | .raptor-ui-save { 7 | @include button-icon('disk-black.png'); 8 | } 9 | -------------------------------------------------------------------------------- /src/plugins/cancel/cancel.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Cancel plugin. 3 | * 4 | * @author David Neilsen 5 | */ 6 | .raptor-ui-cancel { 7 | @include button-icon('cross.png'); 8 | } 9 | -------------------------------------------------------------------------------- /src/plugins/color-menu-basic/templates/automatic.html: -------------------------------------------------------------------------------- 1 |
  • tr('colorMenuBasicAutomatic')
  • 2 | -------------------------------------------------------------------------------- /src/plugins/text-style/style/bold-front-end.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Bold formatting styles. 3 | * 4 | * @author David Neilsen 5 | */ 6 | .cms-bold { 7 | font-weight: bold; 8 | } 9 | -------------------------------------------------------------------------------- /src/plugins/hr/hr.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Horizontal rule plugin 3 | * 4 | * @author David Neilsen 5 | */ 6 | .raptor-ui-hr-create { 7 | @include button-icon('edit-rule.png'); 8 | } 9 | -------------------------------------------------------------------------------- /src/plugins/tag-menu/tag-menu.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Tag menu plugin 3 | * 4 | * @author David Neilsen 5 | */ 6 | .raptor-ui-tag-menu { 7 | @include button-icon('edit.png'); 8 | } 9 | -------------------------------------------------------------------------------- /src/style/config.rb: -------------------------------------------------------------------------------- 1 | http_path = "/" 2 | css_dir = "." 3 | sass_dir = "." 4 | images_dir = "images/" 5 | http_images_path = "/" 6 | 7 | output_style = :expanded 8 | 9 | line_comments = true 10 | -------------------------------------------------------------------------------- /src/plugins/text-style/style/italic-front-end.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Italic formatting styles. 3 | * 4 | * @author David Neilsen 5 | */ 6 | .cms-italic { 7 | font-style: italic; 8 | } 9 | -------------------------------------------------------------------------------- /src/plugins/unsaved-edit-warning/templates/warning.html: -------------------------------------------------------------------------------- 1 |
    2 | 3 | tr('unsavedEditWarningText') 4 |
    5 | -------------------------------------------------------------------------------- /src/plugins/image-swap/image-swap.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Image swap button. 3 | * 4 | * @author David Neilsen 5 | */ 6 | .raptor-ui-image-swap { 7 | @include button-icon('images.png'); 8 | } 9 | -------------------------------------------------------------------------------- /src/plugins/insert-file/insert-file.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Insert file plugin 3 | * 4 | * @author David Neilsen 5 | */ 6 | .raptor-ui-insert-file { 7 | @include button-icon('image.png'); 8 | } 9 | -------------------------------------------------------------------------------- /src/plugins/text-style/style/strike-front-end.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Strike formatting styles. 3 | * 4 | * @author David Neilsen 5 | */ 6 | .cms-strike { 7 | text-decoration: line-through; 8 | } 9 | -------------------------------------------------------------------------------- /src/plugins/clean-block/clean-block.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Clean block plugin styles. 3 | * 4 | * @author David Neilsen 5 | */ 6 | .raptor-ui-clean-block { 7 | @include button-icon('broom.png'); 8 | } 9 | -------------------------------------------------------------------------------- /src/plugins/text-style/style/bold.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Bold text style plugin. 3 | * 4 | * @author David Neilsen 5 | */ 6 | .raptor-ui-text-bold { 7 | @include button-icon('edit-bold.png'); 8 | } 9 | -------------------------------------------------------------------------------- /src/plugins/text-style/style/underline-front-end.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Underline formatting styles. 3 | * 4 | * @author David Neilsen 5 | */ 6 | .cms-underline { 7 | text-decoration: underline; 8 | } 9 | -------------------------------------------------------------------------------- /src/plugins/class-menu/class-menu.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Snippet menu plugin. 3 | * 4 | * @author David Neilsen 5 | */ 6 | .raptor-ui-class-menu { 7 | @include button-icon('palette-paint-brush.png'); 8 | } 9 | -------------------------------------------------------------------------------- /src/plugins/text-style/style/italic.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Italic text style plugin. 3 | * 4 | * @author David Neilsen 5 | */ 6 | .raptor-ui-text-italic { 7 | @include button-icon('edit-italic.png'); 8 | } 9 | -------------------------------------------------------------------------------- /src/plugins/text-style/style/strike.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * strike text style plugin. 3 | * 4 | * @author David Neilsen 5 | */ 6 | .raptor-ui-text-strike { 7 | @include button-icon('edit-strike.png'); 8 | } 9 | -------------------------------------------------------------------------------- /src/plugins/text-style/style/sub.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Sub script text style plugin. 3 | * 4 | * @author David Neilsen 5 | */ 6 | .raptor-ui-text-sub { 7 | @include button-icon('edit-subscript.png'); 8 | } 9 | -------------------------------------------------------------------------------- /src/plugins/statistics/templates.js: -------------------------------------------------------------------------------- 1 | templateRegister("statistics.dialog", "
    "); -------------------------------------------------------------------------------- /src/plugins/unsaved-edit-warning/templates.js: -------------------------------------------------------------------------------- 1 | templateRegister("unsaved-edit-warning.warning", "
    tr('unsavedEditWarningText')
    "); -------------------------------------------------------------------------------- /src/plugins/snippet-menu/snippet-menu.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Snippet menu plugin. 3 | * 4 | * @author Melissa Richards 5 | */ 6 | .raptor-ui-snippet-menu { 7 | @include button-icon('document-snippet.png'); 8 | } 9 | -------------------------------------------------------------------------------- /src/plugins/text-style/style/block-quote.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Block quote plugin. 3 | * 4 | * @author David Neilsen 5 | */ 6 | .raptor-ui-text-block-quote { 7 | @include button-icon('edit-quotation.png'); 8 | } 9 | -------------------------------------------------------------------------------- /src/plugins/text-style/style/super.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Super script text style plugin. 3 | * 4 | * @author David Neilsen 5 | */ 6 | .raptor-ui-text-super { 7 | @include button-icon('edit-superscript.png'); 8 | } 9 | -------------------------------------------------------------------------------- /src/plugins/text-style/style/underline.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Underline text style plugin. 3 | * 4 | * @author David Neilsen 5 | */ 6 | .raptor-ui-text-underline { 7 | @include button-icon('edit-underline.png'); 8 | } 9 | -------------------------------------------------------------------------------- /src/plugins/clear-formatting/clear-formatting.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Clear formatting style plugin. 3 | * 4 | * @author David Neilsen 5 | */ 6 | .raptor-ui-clear-formatting { 7 | @include button-icon('clear-formatting.png'); 8 | } 9 | -------------------------------------------------------------------------------- /src/plugins/special-characters/special-characters.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Special Characters plugin 3 | * 4 | * @author Michael Robinson 5 | */ 6 | .raptor-ui-special-characters { 7 | @include button-icon('edit-symbol.png'); 8 | } 9 | -------------------------------------------------------------------------------- /src/style/raptor.scss: -------------------------------------------------------------------------------- 1 | /* Libraries */ 2 | @import 'susy'; 3 | @import 'compass'; 4 | 5 | /* Non styles */ 6 | @import 'variables'; 7 | @import 'z-index'; 8 | @import 'mixins'; 9 | 10 | /* Base style */ 11 | @import 'style'; 12 | @import 'support'; 13 | -------------------------------------------------------------------------------- /src/style/variables.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Style global variables 3 | * 4 | * @author David Neilsen 5 | */ 6 | $spacing: 5px; 7 | $font-size: 13px; 8 | $border-width: 1px; 9 | $border-style: solid; 10 | $border-color: #c1c1c1; 11 | -------------------------------------------------------------------------------- /src/plugins/float/float-front-end.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Float plugin default colors. 3 | * 4 | * @author David Neilsen 5 | */ 6 | .cms-float-left { 7 | float: left; 8 | } 9 | 10 | .cms-float-right { 11 | float: right; 12 | } 13 | -------------------------------------------------------------------------------- /src/plugins/statistics/templates/dialog.html: -------------------------------------------------------------------------------- 1 |
    2 |
      3 |
    • 4 |
    • 5 |
    • 6 |
    • 7 |
    8 |
    9 | -------------------------------------------------------------------------------- /src/style/z-index.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Z index variables 3 | * 4 | * @author David Neilsen 5 | */ 6 | $z-hover-panel-basic: 1100; 7 | $z-path-bar: 1290; 8 | $z-toolbar: 1300; 9 | $z-unsaved-edit-warning: 1500; 10 | $z-menu: 1600; 11 | -------------------------------------------------------------------------------- /src/plugins/statistics/statistics.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Statistics plugin 3 | * 4 | * @author David Neilsen 5 | * @author Micharl Robinson 6 | */ 7 | .raptor-ui-statistics { 8 | @include button-icon('dashboard.png'); 9 | } 10 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.sass-cache* 2 | *.swp 3 | js-doc 4 | tagging 5 | plugins-extra.manifest 6 | addons-extra.manifest 7 | translation-status.html 8 | /nbproject/ 9 | /src/plugins-extra/ 10 | /vendor/ 11 | /composer.lock 12 | /jscover/ 13 | /temp/ 14 | /packages/ 15 | /node_modules/ 16 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "raptor", 3 | "description": "An HTML5 WYSIWYG content editor.", 4 | "homepage": "http://www.raptor-editor.com/", 5 | "version": "1.1.4", 6 | "dependencies": { 7 | "uglify-js": "2.3.6", 8 | "clean-css": "1.0.10" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /php/functions/load-raptor.php: -------------------------------------------------------------------------------- 1 | 5 | */ 6 | .raptor-ui-guides { 7 | @include button-icon('guide.png'); 8 | } 9 | 10 | .raptor-ui-guides-visible * { 11 | outline: 1px dashed rgba(0, 0, 0, 0.5); 12 | } 13 | -------------------------------------------------------------------------------- /src/plugins/list/list.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * List plugin 3 | * 4 | * @author David Neilsen 5 | */ 6 | .raptor-ui-list-unordered { 7 | @include button-icon('edit-list.png'); 8 | } 9 | 10 | .raptor-ui-list-ordered { 11 | @include button-icon('edit-list-order.png'); 12 | } 13 | -------------------------------------------------------------------------------- /src/plugins/click-button-to-edit/click-button-to-edit.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Click to edit plugin 3 | * 4 | * @author Michael Robinson 5 | * @author David Neilsen 6 | */ 7 | .raptor-ui-click-button-to-edit { 8 | @include button-icon('pencil.png'); 9 | } 10 | -------------------------------------------------------------------------------- /tests/js/code-mirror.js: -------------------------------------------------------------------------------- 1 | function applyCodeMirror(node, html) { 2 | if (typeof CodeMirror !== 'undefined') { 3 | CodeMirror(node, { 4 | value: style_html($.trim(html)), 5 | mode: 'htmlmixed' 6 | }); 7 | } else { 8 | $(node).text(html); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/plugins/history/history.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * History plugin 3 | * 4 | * @author David Neilsen 5 | */ 6 | .raptor-ui-history-undo { 7 | @include button-icon('arrow-curve-180-left.png'); 8 | } 9 | 10 | .raptor-ui-history-redo { 11 | @include button-icon('arrow-curve.png'); 12 | } 13 | -------------------------------------------------------------------------------- /src/plugins/link/templates/error.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /php/include.php: -------------------------------------------------------------------------------- 1 | 5 | */ 6 | .raptor-ui-text-size-increase { 7 | @include button-icon('edit-size-up.png'); 8 | } 9 | 10 | .raptor-ui-text-size-decrease { 11 | @include button-icon('edit-size-down.png'); 12 | } 13 | -------------------------------------------------------------------------------- /src/plugins/close/close.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileOverview Contains the close panel code. 3 | * @license http://www.raptor-editor.com/license 4 | * 5 | * @author David Neilsen 6 | */ 7 | Raptor.registerUi(new Button({ 8 | name: 'close', 9 | 10 | click: function() { 11 | this.layout.close(); 12 | } 13 | })); 14 | -------------------------------------------------------------------------------- /php/functions/example/load-content.php: -------------------------------------------------------------------------------- 1 | 5 | */ 6 | .cms-center { 7 | text-align: center; 8 | } 9 | 10 | .cms-left { 11 | text-align: left; 12 | } 13 | 14 | .cms-right { 15 | text-align: right; 16 | } 17 | 18 | .cms-justify { 19 | text-align: justify; 20 | } 21 | -------------------------------------------------------------------------------- /tests/scss/table.scss: -------------------------------------------------------------------------------- 1 | 2 | .test-input, 3 | .test-expected, 4 | .test-output { 5 | table { 6 | border-collapse: separate; 7 | } 8 | } 9 | 10 | .test-input, 11 | .test-expected, 12 | .test-output { 13 | table, td, th { 14 | white-space: normal; 15 | border: 1px dotted #777; 16 | margin: 5px; 17 | padding: 5px; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/plugins/link/templates/dialog.html: -------------------------------------------------------------------------------- 1 | 10 | -------------------------------------------------------------------------------- /bin/prepare-gh-pages.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 3 | TEMP_DIRECTORY=$1 4 | 5 | if [[ -z $TEMP_DIRECTORY ]]; then 6 | echo "usage: $0 TEMP_DIRECTORY" 7 | exit 1; 8 | fi 9 | 10 | mkdir -p $TEMP_DIRECTORY 11 | 12 | for SUBDIR in "example" "packages" 13 | do 14 | cp -rp "$DIR/$SUBDIR" "$TEMP_DIRECTORY/" 15 | done 16 | 17 | exit 1 18 | -------------------------------------------------------------------------------- /src/plugins/table/style/table-support.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Table plugin. 3 | * 4 | * @author David Neilsen 5 | */ 6 | 7 | .raptor-plugin-table-support-selected ::selection, 8 | .raptor-plugin-table-support-selected ::-moz-selection { 9 | background: transparent; 10 | } 11 | 12 | .raptor-plugin-table-support-cell-selected { 13 | background-color: Highlight; 14 | } 15 | -------------------------------------------------------------------------------- /src/plugins/float/float.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Float block plugin 3 | * 4 | * @author David Neilsen 5 | */ 6 | .raptor-ui-float-left { 7 | @include button-icon('edit-image.png'); 8 | } 9 | 10 | .raptor-ui-float-none { 11 | @include button-icon('edit-image-none.png'); 12 | } 13 | 14 | .raptor-ui-float-right { 15 | @include button-icon('edit-image-right.png'); 16 | } 17 | -------------------------------------------------------------------------------- /src/components/layout.js: -------------------------------------------------------------------------------- 1 | function RaptorLayout(name) { 2 | this.name = name; 3 | } 4 | 5 | RaptorLayout.prototype.init = function() { 6 | }; 7 | 8 | RaptorLayout.prototype.destruct = function() { 9 | }; 10 | 11 | RaptorLayout.prototype.isVisible = function() { 12 | return false; 13 | }; 14 | 15 | RaptorLayout.prototype.show = function() { 16 | }; 17 | 18 | RaptorLayout.prototype.hide = function() { 19 | }; 20 | -------------------------------------------------------------------------------- /src/plugins/color-menu-basic/templates.js: -------------------------------------------------------------------------------- 1 | templateRegister("color-menu-basic.automatic", "
  • tr('colorMenuBasicAutomatic')
  • "); 2 | templateRegister("color-menu-basic.item", "
  • {{label}}
  • "); -------------------------------------------------------------------------------- /src/plugins/image-swap/image-swap.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileOverview Contains the image swap button code. 3 | * @author David Neilsen 4 | */ 5 | Raptor.registerUi(new Button({ 6 | name: 'imageSwap', 7 | chooser: null, 8 | click: function() { 9 | selectionSelectOuter(this.layout.target); 10 | this.raptor.getPlugin(this.options.chooser).action(this.layout.target); 11 | } 12 | })); 13 | -------------------------------------------------------------------------------- /tests/css/style.css: -------------------------------------------------------------------------------- 1 | .test-input table, 2 | .test-expected table, 3 | .test-output table { 4 | border-collapse: separate; } 5 | 6 | .test-input table, .test-input td, .test-input th, 7 | .test-expected table, 8 | .test-expected td, 9 | .test-expected th, 10 | .test-output table, 11 | .test-output td, 12 | .test-output th { 13 | white-space: normal; 14 | border: 1px dotted #777777; 15 | margin: 5px; 16 | padding: 5px; } 17 | -------------------------------------------------------------------------------- /src/components/ui/menu.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Select menu UI widget styles 3 | * 4 | * @author David Neilsen 5 | */ 6 | .raptor-menu { 7 | z-index: $z-menu; 8 | padding: 6px; 9 | } 10 | 11 | .raptor-menu .ui-menu-item:before { 12 | display: none; 13 | } 14 | 15 | .raptor-menu .ui-menu-item a, 16 | .raptor-menu .ui-menu-item a:hover { 17 | white-space: pre; 18 | padding: 3px 10px; 19 | } 20 | 21 | -------------------------------------------------------------------------------- /src/plugins/insert-file/templates.js: -------------------------------------------------------------------------------- 1 | templateRegister("insert-file.dialog", "
    "); -------------------------------------------------------------------------------- /src/plugins/dock/dock.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Dock plugin. 3 | * 4 | * @author David Neilsen 5 | */ 6 | 7 | %raptor-plugin-dock-path { 8 | .raptor-layout-toolbar-path { 9 | display: none; 10 | } 11 | } 12 | 13 | .raptor-plugin-dock-docked { 14 | line-height: 0; 15 | } 16 | 17 | .raptor-plugin-dock-visible { 18 | display: block; 19 | } 20 | 21 | .raptor-plugin-dock-hidden { 22 | display: none; 23 | } 24 | -------------------------------------------------------------------------------- /tests/css/table.css: -------------------------------------------------------------------------------- 1 | 2 | .test-input table, 3 | .test-expected table, 4 | .test-output table { 5 | border-collapse: separate; 6 | } 7 | 8 | .test-input table, 9 | .test-expected table, 10 | .test-output table, 11 | .test-input td, 12 | .test-expected td, 13 | .test-output td, 14 | .test-input th, 15 | .test-expected th, 16 | .test-output th { 17 | white-space: normal; 18 | border: 1px dotted #777; 19 | margin: 5px; 20 | padding: 5px; 21 | } 22 | -------------------------------------------------------------------------------- /src/plugins/insert-file/templates/dialog.html: -------------------------------------------------------------------------------- 1 |
    2 |
    3 | 4 | 5 |
    6 |
    7 | 8 | 9 |
    10 |
    11 | -------------------------------------------------------------------------------- /src/plugins/click-button-to-edit/click-button-to-edit.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileOverview Contains the click button to edit code. 3 | * @license http://www.raptor-editor.com/license 4 | * 5 | * @author David Neilsen 6 | * @author Michael Robinson 7 | * @author Melissa Richards 8 | */ 9 | Raptor.registerUi(new Button({ 10 | name: 'clickButtonToEdit', 11 | action: function() { 12 | this.raptor.enableEditing(); 13 | } 14 | })); 15 | -------------------------------------------------------------------------------- /src/components/layout/hover-panel.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Hover panel layout. 3 | * 4 | * @author Michael Robinson 5 | * @author David Neilsen 6 | */ 7 | .raptor-layout-hover-panel { 8 | z-index: $z-hover-panel-basic; 9 | position: absolute; 10 | } 11 | 12 | .raptor-layout-hover-panel .raptor-layout-toolbar-group:last-child { 13 | margin-right: 0; 14 | } 15 | 16 | .raptor-layout-hover-panel .raptor-layout-toolbar-group .ui-button { 17 | margin-bottom: 0; 18 | } 19 | -------------------------------------------------------------------------------- /src/plugins/special-characters/templates.js: -------------------------------------------------------------------------------- 1 | templateRegister("special-characters.dialog", "
    tr('specialCharactersHelp')
      "); 2 | templateRegister("special-characters.tab-button", ""); 3 | templateRegister("special-characters.tab-content", "
      "); 4 | templateRegister("special-characters.tab-li", "
    • {{name}}
    • "); -------------------------------------------------------------------------------- /tests/bin/convert.php: -------------------------------------------------------------------------------- 1 | isDir() || $file->getExtension() == 'php'; 6 | }); 7 | $iterator = new RecursiveIteratorIterator($filter); 8 | foreach ($iterator as $file) { 9 | $html = escapeshellarg(substr($file, 0, -4) . '.html'); 10 | $file = escapeshellarg($file); 11 | echo `php $file > $html` . PHP_EOL; 12 | } -------------------------------------------------------------------------------- /tests/include.php: -------------------------------------------------------------------------------- 1 | 6 | * @author Michael Robinson 7 | * @author Melissa Richards 8 | */ 9 | 10 | /** 11 | * Creates a button to merge the selected cells of a table. 12 | */ 13 | Raptor.registerUi(new Button({ 14 | name: 'tableMergeCells', 15 | action: function() { 16 | } 17 | })); 18 | -------------------------------------------------------------------------------- /src/plugins/table/table-split-cells.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileOverview Contains the split cells button code. 3 | * @license http://www.raptor-editor.com/license 4 | * 5 | * @author David Neilsen 6 | * @author Michael Robinson 7 | * @author Melissa Richards 8 | */ 9 | 10 | /** 11 | * Creates a button to split the selected cell of a table. 12 | */ 13 | Raptor.registerUi(new Button({ 14 | name: 'tableSplitCells', 15 | action: function() { 16 | } 17 | })); 18 | -------------------------------------------------------------------------------- /src/plugins/text-align/left.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileOverview Contains the left align button code. 3 | * @license http://www.raptor-editor.com/license 4 | * 5 | * @author David Neilsen 6 | * @author Michael Robinson 7 | * @author Melissa Richards 8 | */ 9 | 10 | /** 11 | * Creates a text align button to align text left. 12 | */ 13 | Raptor.registerUi(new TextAlignButton({ 14 | name: 'alignLeft', 15 | getClass: function() { 16 | return this.options.cssPrefix + 'left'; 17 | } 18 | })); 19 | -------------------------------------------------------------------------------- /src/plugins/text-align/style/text-align.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Text alignment plugin 3 | * 4 | * @author David Neilsen 5 | */ 6 | @import 'compass/css3/opacity'; 7 | 8 | .raptor-ui-align-left { 9 | @include button-icon('edit-alignment.png'); 10 | } 11 | 12 | .raptor-ui-align-right { 13 | @include button-icon('edit-alignment-right.png'); 14 | } 15 | 16 | .raptor-ui-align-center { 17 | @include button-icon('edit-alignment-center.png'); 18 | } 19 | 20 | .raptor-ui-align-justify { 21 | @include button-icon('edit-alignment-justify.png'); 22 | } 23 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "panmedia/raptor", 3 | "description": "An HTML5 WYSIWYG content editor.", 4 | "keywords": ["HTML5", "WYSIWYG"], 5 | "homepage": "http://www.raptor-editor.com/", 6 | "type": "library", 7 | "authors": [ 8 | { 9 | "name": "David Neilsen", 10 | "email": "david@panmedia.co.nz" 11 | }, 12 | { 13 | "name": "Michael Robinson", 14 | "email": "michael@panmedia.co.nz" 15 | } 16 | ], 17 | "minimum-stability": "dev", 18 | "require": { 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/plugins/text-align/right.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileOverview Contains the right align button code. 3 | * @license http://www.raptor-editor.com/license 4 | * 5 | * @author David Neilsen 6 | * @author Michael Robinson 7 | * @author Melissa Richards 8 | */ 9 | 10 | /** 11 | * Creates a text align button to align text right. 12 | */ 13 | Raptor.registerUi(new TextAlignButton({ 14 | name: 'alignRight', 15 | getClass: function() { 16 | return this.options.cssPrefix + 'right'; 17 | } 18 | })); 19 | -------------------------------------------------------------------------------- /src/plugins/text-style/sub.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileOverview Contains the subscript button code. 3 | * @license http://www.raptor-editor.com/license 4 | * 5 | * @author David Neilsen 6 | * @author Michael Robinson 7 | * @author Melissa Richards 8 | */ 9 | 10 | /** 11 | * Creates an instance of the CSS applier button to apply the subscript class to 12 | * a selection. 13 | */ 14 | Raptor.registerUi(new CSSClassApplierButton({ 15 | name: 'textSub', 16 | tag: 'sub', 17 | classes: ['sub'] 18 | })); 19 | -------------------------------------------------------------------------------- /src/plugins/text-align/center.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileOverview Contains the center align button code. 3 | * @license http://www.raptor-editor.com/license 4 | * 5 | * @author David Neilsen 6 | * @author Michael Robinson 7 | * @author Melissa Richards 8 | */ 9 | 10 | /** 11 | * Creates a text align button to align text center. 12 | */ 13 | Raptor.registerUi(new TextAlignButton({ 14 | name: 'alignCenter', 15 | getClass: function() { 16 | return this.options.cssPrefix + 'center'; 17 | } 18 | })); 19 | -------------------------------------------------------------------------------- /src/plugins/text-align/justify.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileOverview Contains the justify text button code. 3 | * @license http://www.raptor-editor.com/license 4 | * 5 | * @author David Neilsen 6 | * @author Michael Robinson 7 | * @author Melissa Richards 8 | */ 9 | 10 | /** 11 | * Creates a text align button to justify text. 12 | */ 13 | Raptor.registerUi(new TextAlignButton({ 14 | name: 'alignJustify', 15 | getClass: function() { 16 | return this.options.cssPrefix + 'justify'; 17 | } 18 | })); 19 | -------------------------------------------------------------------------------- /src/plugins/text-style/strike.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileOverview Contains the strike button code. 3 | * @license http://www.raptor-editor.com/license 4 | * 5 | * @author David Neilsen 6 | * @author Michael Robinson 7 | * @author Melissa Richards 8 | */ 9 | 10 | /** 11 | * Creates an instance of the CSS applier button to apply the strike class to a 12 | * selection. 13 | */ 14 | Raptor.registerUi(new CSSClassApplierButton({ 15 | name: 'textStrike', 16 | tag: 'del', 17 | classes: ['strike'] 18 | })); 19 | -------------------------------------------------------------------------------- /src/plugins/view-source/view-source.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * View source plugin 3 | * 4 | * @author Michael Robinson 5 | * @author David Neilsen 6 | */ 7 | @import 'compass/css3/box-sizing'; 8 | 9 | .raptor-ui-view-source { 10 | @include button-icon('edit-code.png'); 11 | } 12 | 13 | .raptor-ui-view-source-dialog .ui-dialog-content { 14 | overflow: visible; 15 | } 16 | 17 | .raptor-ui-view-source-dialog textarea, 18 | .raptor-ui-view-source-inner-wrapper { 19 | width: 100%; 20 | height: 100%; 21 | min-height: 200px; 22 | } 23 | -------------------------------------------------------------------------------- /src/plugins/link/templates/email.html: -------------------------------------------------------------------------------- 1 |

      tr('linkTypeEmailHeader')

      2 |
      3 | 4 | 5 |
      6 |
      7 | 8 | 9 |
      10 | -------------------------------------------------------------------------------- /src/plugins/text-style/super.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileOverview Contains the superscript button code. 3 | * @license http://www.raptor-editor.com/license 4 | * 5 | * @author David Neilsen 6 | * @author Michael Robinson 7 | * @author Melissa Richards 8 | */ 9 | 10 | /** 11 | * Creates an instance of the CSS applier button to apply the superscript class 12 | * to a selection. 13 | */ 14 | Raptor.registerUi(new CSSClassApplierButton({ 15 | name: 'textSuper', 16 | tag: 'sup', 17 | classes: ['sup'] 18 | })); 19 | -------------------------------------------------------------------------------- /src/plugins/text-style/bold.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileOverview Contains the bold button code. 3 | * @license http://www.raptor-editor.com/license 4 | * 5 | * @author David Neilsen 6 | * @author Michael Robinson 7 | * @author Melissa Richards 8 | */ 9 | 10 | /** 11 | * Creates an instance of the CSS applier button to apply the bold class to a selection. 12 | */ 13 | Raptor.registerUi(new CSSClassApplierButton({ 14 | name: 'textBold', 15 | hotkey: 'ctrl+b', 16 | tag: 'strong', 17 | classes: ['bold'] 18 | })); 19 | -------------------------------------------------------------------------------- /src/plugins/color-menu-basic/color-menu-basic-front-end.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Basic color menu plugin default colors. 3 | * 4 | * @author David Neilsen 5 | */ 6 | .cms-white { 7 | color: #ffffff; 8 | } 9 | 10 | .cms-black { 11 | color: #000000; 12 | } 13 | 14 | .cms-blue { 15 | color: #4f81bd; 16 | } 17 | 18 | .cms-red { 19 | color: #c0504d; 20 | } 21 | 22 | .cms-green { 23 | color: #9bbb59; 24 | } 25 | 26 | .cms-purple { 27 | color: #8064a2; 28 | } 29 | 30 | .cms-orange { 31 | color: #f79646; 32 | } 33 | 34 | .cms-grey { 35 | color: #999; 36 | } 37 | -------------------------------------------------------------------------------- /src/plugins/list/list-ordered.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileOverview Contains the ordered list button code. 3 | * @license http://www.raptor-editor.com/license 4 | * 5 | * @author David Neilsen 6 | * @author Michael Robinson 7 | * @author Melissa Richards 8 | */ 9 | 10 | /** 11 | * Creates a new instance of the preview toggle button to create ordered lists. 12 | */ 13 | Raptor.registerUi(new Button({ 14 | name: 'listOrdered', 15 | action: function() { 16 | document.execCommand('insertOrderedList'); 17 | } 18 | })); 19 | -------------------------------------------------------------------------------- /src/plugins/text-style/italic.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileOverview Contains the italic button code. 3 | * @license http://www.raptor-editor.com/license 4 | * 5 | * @author David Neilsen 6 | * @author Michael Robinson 7 | * @author Melissa Richards 8 | */ 9 | 10 | /** 11 | * Creates an instance of the CSS applier button to apply the italic class to a 12 | * selection. 13 | */ 14 | Raptor.registerUi(new CSSClassApplierButton({ 15 | name: 'textItalic', 16 | hotkey: 'ctrl+i', 17 | tag: 'em', 18 | classes: ['italic'] 19 | })); 20 | -------------------------------------------------------------------------------- /src/plugins/color-menu-basic/color-menu-basic.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Basic color menu plugin. 3 | * 4 | * @author David Neilsen 5 | */ 6 | .raptor-ui-color-menu-basic-menu > div { 7 | min-width: 100px; 8 | } 9 | 10 | .raptor-ui-color-menu-basic-menu span { 11 | padding-left: 2px; 12 | } 13 | 14 | 15 | .raptor-ui-color-menu-basic-swatch, 16 | .raptor-ui-color-menu-basic .ui-icon-swatch { 17 | width: 16px; 18 | height: 16px; 19 | background-image: none; 20 | border: 1px solid rgba(0, 0, 0, 0.35); 21 | } 22 | 23 | .raptor-ui-color-menu-basic-swatch { 24 | float: left; 25 | } -------------------------------------------------------------------------------- /src/plugins/text-style/underline.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileOverview Contains the underline button code. 3 | * @license http://www.raptor-editor.com/license 4 | * 5 | * @author David Neilsen 6 | * @author Michael Robinson 7 | * @author Melissa Richards 8 | */ 9 | 10 | /** 11 | * Creates an instance of the CSS applier button to apply the underline class to a selection. 12 | */ 13 | Raptor.registerUi(new CSSClassApplierButton({ 14 | name: 'textUnderline', 15 | hotkey: 'ctrl+u', 16 | tag: 'u', 17 | classes: ['underline'] 18 | })); 19 | -------------------------------------------------------------------------------- /scripts/functions.php: -------------------------------------------------------------------------------- 1 | 6 | * @author Michael Robinson 7 | * @author Melissa Richards 8 | */ 9 | 10 | /** 11 | * Creates an instance of the preview toggle button to insert a block quote. 12 | */ 13 | Raptor.registerUi(new Button({ 14 | name: 'textBlockQuote', 15 | action: function() { 16 | document.execCommand('formatBlock', false, '
      '); 17 | } 18 | })); 19 | -------------------------------------------------------------------------------- /src/plugins/logo/logo.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Logo plugin 3 | * 4 | * @author David Neilsen 5 | */ 6 | @import 'compass/css3/box-shadow'; 7 | 8 | .raptor-ui-logo { 9 | border: none !important; 10 | background: transparent !important; 11 | @include box-shadow(none !important); 12 | } 13 | 14 | .raptor-ui-logo .ui-icon { 15 | background: inline-image('raptor.png') 0 0; 16 | background-repeat: no-repeat; 17 | width: 35px !important; 18 | height: 35px !important; 19 | left: 0 !important; 20 | top: 0 !important; 21 | margin: 0 !important; 22 | padding: 0 !important; 23 | } 24 | -------------------------------------------------------------------------------- /src/plugins/hr/hr-create.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileOverview Contains the hr button code. 3 | * @license http://www.raptor-editor.com/license 4 | * 5 | * @author David Neilsen 6 | * @author Michael Robinson 7 | * @author Melissa Richards 8 | */ 9 | 10 | /** 11 | * Creates an instance of the preview button to insert a hr at the selection. 12 | * 13 | * @todo param details? 14 | * @param {type} param 15 | */ 16 | Raptor.registerUi(new PreviewButton({ 17 | name: 'hrCreate', 18 | action: function() { 19 | selectionReplace('
      '); 20 | } 21 | })); 22 | -------------------------------------------------------------------------------- /src/plugins/font-family/font-family.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Basic font-family menu plugin. 3 | * 4 | * @author David Neilsen 5 | */ 6 | .raptor-ui-color-menu-basic-menu > div { 7 | min-width: 100px; 8 | } 9 | 10 | .raptor-ui-color-menu-basic-menu span { 11 | padding-left: 2px; 12 | } 13 | 14 | .raptor-ui-color-menu-basic-swatch { 15 | width: 16px; 16 | height: 16px; 17 | float: left; 18 | margin-top: 2px; 19 | border: 1px solid rgba(0, 0, 0, 0.2); 20 | } 21 | 22 | .raptor-ui-color-menu-basic .ui-icon-swatch { 23 | background-image: none; 24 | border: 1px solid rgba(0, 0, 0, 0.35); 25 | } 26 | -------------------------------------------------------------------------------- /src/plugins/list/list-unordered.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileOverview Contains the unordered list button code. 3 | * @license http://www.raptor-editor.com/license 4 | * 5 | * @author David Neilsen 6 | * @author Michael Robinson 7 | * @author Melissa Richards 8 | */ 9 | 10 | /** 11 | * Creates a new instance of the preview toggle button to create unordered lists. 12 | * 13 | * @todo param details? 14 | * @param {type} param 15 | */ 16 | Raptor.registerUi(new Button({ 17 | name: 'listUnordered', 18 | action: function() { 19 | document.execCommand('insertUnorderedList'); 20 | } 21 | })); 22 | -------------------------------------------------------------------------------- /TOP: -------------------------------------------------------------------------------- 1 | /** 2 | * Raptor Editor HTML5 WYSIWYG Editor 3 | * http://www.raptor-editor.com 4 | * 5 | * Copyright 2011-2013, PAN Media Limited. All rights reserved. 6 | * http://www.panmedia.co.nz 7 | * 8 | * Released under the GPL license. 9 | * See LICENSE for more information. 10 | * 11 | * All other components and libraries redistributed in this package are subject 12 | * to their respective copyright notices and licenses. 13 | * See THIRD-PARTY COMPONENTS AND LIBRARIES for more information. 14 | * All images and icons redistributed in this package are subject 15 | * to their respective copyright notices and licenses. 16 | * See IMAGES AND ICONS for more information. 17 | */ 18 | -------------------------------------------------------------------------------- /scripts/list-plugins.php: -------------------------------------------------------------------------------- 1 | '; 5 | exit; 6 | } 7 | $directory = $_SERVER['argv'][1]; 8 | 9 | $result = []; 10 | $files = glob_recursive($directory . '/*.*'); 11 | foreach ($files as $i => $file) { 12 | if (preg_match('/\.js$/', $file)) { 13 | $contents = file_get_contents($file); 14 | if (preg_match("/^\s+name:\s'(.*)'/m", $contents, $matches)) { 15 | $result[] = $matches[1]; 16 | } else { 17 | } 18 | } 19 | } 20 | 21 | sort($result); 22 | echo implode(PHP_EOL, $result); 23 | -------------------------------------------------------------------------------- /src/plugins/dock/dock-to-element.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileOverview Contains the dock to element button code. 3 | * @author David Neilsen 4 | * @author Michael Robinson 5 | * @author Melissa Richards 6 | */ 7 | 8 | /** 9 | * Creates an instance of the dock to element button for use in the raptor UI. 10 | * 11 | * @todo not sure how to document this one. 12 | * @param {type} param 13 | */ 14 | Raptor.registerUi(new Button({ 15 | name: 'dockToElement', 16 | action: function() { 17 | this.raptor.unify(function(raptor) { 18 | raptor.plugins.dock.toggleDockToElement(); 19 | }); 20 | } 21 | })); 22 | -------------------------------------------------------------------------------- /src/style/mixins.scss: -------------------------------------------------------------------------------- 1 | @import 'compass/css3/opacity'; 2 | 3 | @mixin pointer-events($events) { 4 | -webkit-pointer-events: $events; 5 | -moz-pointer-events: $events; 6 | pointer-events: $events; 7 | } 8 | 9 | %button-icon .ui-icon { 10 | width: 16px; 11 | height: 16px; 12 | display: block; 13 | @include opacity(0.85); 14 | } 15 | 16 | %button-icon .ui-icon:before { 17 | display: none; 18 | } 19 | 20 | %button-icon:hover .ui-icon { 21 | @include opacity(1); 22 | } 23 | 24 | @mixin button-icon($icon) { 25 | @extend %button-icon; 26 | .ui-icon, 27 | &.ui-state-hover .ui-icon { 28 | background: inline-image($icon) 0 0 !important; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/plugins/embed/templates.js: -------------------------------------------------------------------------------- 1 | templateRegister("embed.dialog", "

      tr('embedDialogTabCodeContent')

      tr('embedDialogTabPreviewContent')

      "); -------------------------------------------------------------------------------- /src/plugins/table/table-insert-row.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileOverview Contains the insert row button code. 3 | * @license http://www.raptor-editor.com/license 4 | * 5 | * @author David Neilsen 6 | * @author Michael Robinson 7 | * @author Melissa Richards 8 | */ 9 | 10 | /** 11 | * Creates a table cell button to insert a row into a table. 12 | */ 13 | Raptor.registerUi(new TableCellButton({ 14 | name: 'tableInsertRow', 15 | applyToElement: function(cell) { 16 | tableInsertRow(cell.parentNode.parentNode.parentNode, tableGetCellIndex(cell).y + 1, { 17 | placeHolder: ' ' 18 | }); 19 | } 20 | })); 21 | -------------------------------------------------------------------------------- /src/plugins/link/templates/document.html: -------------------------------------------------------------------------------- 1 |

      tr('linkTypeDocumentHeader')

      2 |
      3 | 4 | 5 |
      6 |

      tr('linkTypeDocumentNewWindowHeader')

      7 |
      8 | 12 |
      13 | tr('linkTypeDocumentInfo') 14 | -------------------------------------------------------------------------------- /src/plugins/link/templates/internal.html: -------------------------------------------------------------------------------- 1 |

      tr('linkTypeInternalHeader')

      2 |
      3 | 4 | 5 |
      6 |

      tr('linkTypeInternalNewWindowHeader')

      7 |
      8 | 12 |
      13 | tr('linkTypeInternalInfo') 14 | -------------------------------------------------------------------------------- /src/plugins/table/table-insert-column.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileOverview Contains the insert column button code. 3 | * @license http://www.raptor-editor.com/license 4 | * 5 | * @author David Neilsen 6 | * @author Michael Robinson 7 | * @author Melissa Richards 8 | */ 9 | 10 | /** 11 | * Creates a table cell button to insert a column into a table. 12 | */ 13 | Raptor.registerUi(new TableCellButton({ 14 | name: 'tableInsertColumn', 15 | applyToElement: function(cell) { 16 | tableInsertColumn(cell.parentNode.parentNode.parentNode, tableGetCellIndex(cell).x + 1, { 17 | placeHolder: ' ' 18 | }); 19 | } 20 | })); 21 | -------------------------------------------------------------------------------- /src/plugins/link/templates/external.html: -------------------------------------------------------------------------------- 1 |

      tr('linkTypeExternalHeader')

      2 |
      3 | 4 | 5 |
      6 |

      tr('linkTypeExternalNewWindowHeader')

      7 |
      8 | 12 |
      13 | tr('linkTypeExternalInfo') 14 | -------------------------------------------------------------------------------- /src/plugins/dock/dock-to-screen.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileOverview Contains the dock to screen button code. 3 | * @license http://www.raptor-editor.com/license 4 | * 5 | * @author David Neilsen 6 | * @author Michael Robinson 7 | * @author Melissa Richards 8 | */ 9 | 10 | /** 11 | * Creates an instance of the dock to screen button for use in the Raptor UI. 12 | * 13 | * @todo des and type for the param. 14 | * @param {type} param 15 | */ 16 | Raptor.registerUi(new Button({ 17 | name: 'dockToScreen', 18 | action: function() { 19 | this.raptor.unify(function(raptor) { 20 | raptor.plugins.dock.toggleDockToScreen(); 21 | }); 22 | } 23 | })); 24 | -------------------------------------------------------------------------------- /src/templates.js: -------------------------------------------------------------------------------- 1 | templateRegister("unsupported", "
      It has been detected that you a using a browser that is not supported by Raptor, please use one of the following browsers:
      "); -------------------------------------------------------------------------------- /tests/scss/style.scss: -------------------------------------------------------------------------------- 1 | body { 2 | font-family: Arial, Helvetica, sans-serif; 3 | font-size: 12px; 4 | } 5 | 6 | del { 7 | background-color: #FFE6E6; 8 | } 9 | 10 | ins { 11 | background-color: #E6FFE6; 12 | } 13 | 14 | hr { 15 | margin: 20px; 16 | } 17 | 18 | h2 { 19 | font-size: 18px; 20 | } 21 | 22 | p, h2 { 23 | padding: 0 5px; 24 | } 25 | 26 | nav a { 27 | display: block; 28 | } 29 | 30 | li { 31 | padding-bottom: 5px; 32 | } 33 | 34 | aside { 35 | width: 18%; 36 | float: left; 37 | } 38 | 39 | .iframes { 40 | width: 78%; 41 | float: left; 42 | } 43 | 44 | iframe { 45 | border: 0; 46 | width: 100%; 47 | margin: 0; 48 | padding: 0; 49 | vertical-align: bottom; 50 | } 51 | -------------------------------------------------------------------------------- /src/plugins/dock/dock-to-screen.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Dock to screen plugin. 3 | * 4 | * @author David Neilsen 5 | */ 6 | @import 'compass/css3/box'; 7 | 8 | .raptor-ui-dock-to-screen { 9 | @include button-icon('application-dock-090.png'); 10 | } 11 | 12 | .raptor-plugin-dock-docked { 13 | .raptor-layout-toolbar-inner { 14 | @include display-box(); 15 | @include box-pack(center); 16 | @include box-align(center); 17 | // Firefox width fix 18 | width: 100%; 19 | } 20 | 21 | .raptor-layout-toolbar-toolbar { 22 | text-align: center; 23 | } 24 | 25 | } 26 | 27 | .raptor-plugin-dock-docked, 28 | .raptor-ios .raptor-plugin-dock-docked { 29 | @extend %raptor-plugin-dock-path; 30 | } 31 | -------------------------------------------------------------------------------- /src/init.js: -------------------------------------------------------------------------------- 1 | var $ = jQuery; 2 | 3 | $(function() { 4 | // Initialise rangy 5 | if (!rangy.initialized) { 6 | rangy.init(); 7 | } 8 | 9 | // Add helper method to rangy 10 | if (!$.isFunction(rangy.rangePrototype.insertNodeAtEnd)) { 11 | rangy.rangePrototype.insertNodeAtEnd = function(node) { 12 | var range = this.cloneRange(); 13 | range.collapse(false); 14 | range.insertNode(node); 15 | range.detach(); 16 | this.setEndAfter(node); 17 | }; 18 | } 19 | }); 20 | 21 | // Select menu close event (triggered when clicked off) 22 | $('html').click(function(event) { 23 | $('.ui-editor-selectmenu-visible') 24 | .removeClass('ui-editor-selectmenu-visible'); 25 | }); 26 | -------------------------------------------------------------------------------- /src/plugins/image-resize/templates.js: -------------------------------------------------------------------------------- 1 | templateRegister("image-resize.dialog", "
      Constrain proportions
      "); -------------------------------------------------------------------------------- /src/plugins/embed/templates/dialog.html: -------------------------------------------------------------------------------- 1 |
      2 | 6 |
      7 |

      tr('embedDialogTabCodeContent')

      8 | 9 |
      10 | 14 |
      15 | -------------------------------------------------------------------------------- /src/plugins/font-family/font-family-front-end.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Basic font-family menu plugin default fonts. 3 | * 4 | * @author Nikolay Rodionov 5 | */ 6 | .cms-font-arial { 7 | font-family: Arial, Helvetica, sans-serif; 8 | } 9 | 10 | .cms-font-palatino { 11 | font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif; 12 | } 13 | 14 | .cms-font-georgia { 15 | font-family: Georgia, serif; 16 | } 17 | 18 | .cms-font-times { 19 | font-family: "Times New Roman", Times, serif; 20 | } 21 | 22 | .cms-font-comic-sans { 23 | font-family: "Comic Sans MS", cursive, sans-serif; 24 | } 25 | 26 | .cms-font-impact { 27 | font-family: Impact, Charcoal, sans-serif; 28 | } 29 | 30 | .cms-font-courier { 31 | font-family: "Courier New", Courier, monospace; 32 | } 33 | -------------------------------------------------------------------------------- /src/plugins/tool-tip/tool-tip.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileOverview Stylised tooltip plugin. 3 | * @license http://www.raptor-editor.com/license 4 | * 5 | * @author David Neilsen david@panmedia.co.nz 6 | */ 7 | function ToolTipPlugin(name, overrides) { 8 | RaptorPlugin.call(this, name || 'toolTip', overrides); 9 | } 10 | 11 | ToolTipPlugin.prototype = Object.create(RaptorPlugin.prototype); 12 | 13 | ToolTipPlugin.prototype.init = function() { 14 | this.raptor.bind('layoutReady', function(node) { 15 | $(node) 16 | .on('mouseover', '[title]', function(event) { 17 | $(this) 18 | .attr('data-title', $(this).attr('title')) 19 | .removeAttr('title'); 20 | }); 21 | }); 22 | }; 23 | 24 | Raptor.registerPlugin(new ToolTipPlugin()); 25 | -------------------------------------------------------------------------------- /src/plugins/table/templates.js: -------------------------------------------------------------------------------- 1 | templateRegister("table.create-menu", "
      "); -------------------------------------------------------------------------------- /src/tools/types.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileOverview Type checking functions. 3 | * @license http://www.raptor-editor.com/license 4 | * 5 | * @author Michael Robinson michael@panmedia.co.nz 6 | * @author David Neilsen david@panmedia.co.nz 7 | */ 8 | 9 | /** 10 | * Determines whether object is a rangy range. 11 | * 12 | * @param {mixed} object The object to be tested. 13 | * @returns {Boolean} True if the object is a rangy range. 14 | */ 15 | function typeIsRange(object) { 16 | return object instanceof rangy.WrappedRange; 17 | } 18 | 19 | /** 20 | * Determines whether object is a rangy selection. 21 | * 22 | * @param {mixed} object The object to be tested. 23 | * @returns {Boolean} True if the object is a rangy selection. 24 | */ 25 | function typeIsSelection(object) { 26 | return object instanceof rangy.WrappedSelection; 27 | } 28 | -------------------------------------------------------------------------------- /src/style/support.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Unsupported warning styles 3 | * 4 | * @author David Neilsen 5 | */ 6 | @import 'compass/css3/opacity'; 7 | 8 | .raptor-unsupported { 9 | position: relative; 10 | } 11 | 12 | .raptor-unsupported-overlay { 13 | position: fixed; 14 | top: 0; 15 | left: 0; 16 | bottom: 0; 17 | right: 0; 18 | background-color: black; 19 | @include opacity(0.5); 20 | } 21 | 22 | .raptor-unsupported-content { 23 | position: fixed; 24 | top: 50%; 25 | left: 50%; 26 | margin: -200px 0 0 -300px; 27 | width: 600px; 28 | height: 400px; 29 | } 30 | 31 | .raptor-unsupported-input { 32 | position: absolute; 33 | bottom: 10px; 34 | } 35 | 36 | .raptor-unsupported-content { 37 | padding: 10px; 38 | background-color: white; 39 | border: 1px solid #777; 40 | } 41 | -------------------------------------------------------------------------------- /src/templates/unsupported.html: -------------------------------------------------------------------------------- 1 |
      2 |
      3 | It has been detected that you a using a browser that is not supported by Raptor, please 4 | use one of the following browsers: 5 | 6 | 11 | 12 |
      13 | 14 | 15 | 16 |
      17 |
      -------------------------------------------------------------------------------- /src/plugins/clear-formatting/clear-formatting.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileOverview Contains the clear formatting button code. 3 | * @license http://www.raptor-editor.com/license 4 | * 5 | * @author David Neilsen 6 | * @author Michael Robinson 7 | * @author Melissa Richards 8 | */ 9 | 10 | /** 11 | * Creates an instance of the preview button that clears the 12 | * formatting on a selection. 13 | */ 14 | Raptor.registerUi(new PreviewButton({ 15 | name: 'clearFormatting', 16 | action: function() { 17 | selectionClearFormatting(this.raptor.getElement().get(0)); 18 | cleanEmptyElements(this.raptor.getElement(), [ 19 | 'a', 'b', 'i', 'sub', 'sup', 'strong', 'em', 'big', 'small', 'p' 20 | ]); 21 | cleanWrapTextNodes(this.raptor.getElement()[0], 'p'); 22 | } 23 | })); 24 | -------------------------------------------------------------------------------- /src/plugins/image-resize/templates/dialog.html: -------------------------------------------------------------------------------- 1 |
      2 |
      3 | 4 | 5 |
      6 |
      7 | 8 | 9 |
      10 |
      11 | 12 | Constrain proportions 13 | 14 | 15 |
      16 |
      17 | -------------------------------------------------------------------------------- /src/components/ui/dialog-toggle-button.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileOverview Contains the dialog toggle button class code. 3 | * @license http://www.raptor-editor.com/license 4 | * 5 | * @author David Neilsen 6 | * @author Michael Robinson 7 | * @author Melissa Richards 8 | */ 9 | 10 | /** 11 | * @class 12 | * 13 | * @constructor 14 | * @augments DialogButton 15 | * @augments ToggleButton 16 | * 17 | * @param {type} options 18 | */ 19 | function DialogToggleButton(options) { 20 | DialogButton.call(this, options); 21 | ToggleButton.call(this, options); 22 | } 23 | 24 | DialogToggleButton.prototype = Object.create(DialogButton.prototype); 25 | 26 | DialogToggleButton.prototype.init = ToggleButton.prototype.init; 27 | 28 | DialogToggleButton.prototype.selectionChange = ToggleButton.prototype.selectionChange; 29 | -------------------------------------------------------------------------------- /tests/backup/break/output/selection-single-multiblock.html: -------------------------------------------------------------------------------- 1 | 4 |
      5 |
      6 |

      7 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas 8 | convallis

      {}faucibus orci luctus et ultrices posuere cubilia Curae; 9 | Pellentesque tincidunt eros quis tellus laoreet ac dignissim turpis 10 | luctus. Integer nunc est, pulvinar ac tempor ac, pretium ut odio. 11 |

      12 |

      13 | Pellentesque in arcu sit amet odio scelerisque tincidunt. Lorem ipsum 14 | dolor sit amet, consectetur adipiscing elit. Pellentesque habitant morbi 15 | tristique senectus et netus et malesuada fames ac turpis egestas. 16 |

      17 |
      18 |
      19 | -------------------------------------------------------------------------------- /src/components/plugin.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileOverview Contains the raptor plugin class code. 3 | * @license http://www.raptor-editor.com/license 4 | * 5 | * @author David Neilsen 6 | * @author Michael Robinson 7 | * @author Melissa Richards 8 | */ 9 | 10 | /** 11 | * @class The raptor plugin class. 12 | * 13 | * @todo type and desc for name. 14 | * @param {type} name 15 | * @param {Object} overrides Options hash. 16 | * @returns {RaptorPlugin} 17 | */ 18 | function RaptorPlugin(name, overrides) { 19 | this.name = name; 20 | for (var key in overrides) { 21 | this[key] = overrides[key]; 22 | } 23 | } 24 | 25 | /** 26 | * Initialize the raptor plugin. 27 | */ 28 | RaptorPlugin.prototype.init = function() {}; 29 | 30 | /** 31 | * Enable the raptor plugin. 32 | */ 33 | RaptorPlugin.prototype.enable = function() {}; 34 | -------------------------------------------------------------------------------- /src/plugins/paste/paste.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Paste plugin 3 | * 4 | * @author David Neilsen 5 | * @author Michael Robinson 6 | */ 7 | .raptor-plugin-paste-panel-tabs { 8 | width: 100%; 9 | height: 100%; 10 | } 11 | 12 | .raptor-plugin-paste .ui-tabs a { 13 | outline: none; 14 | } 15 | 16 | .raptor-plugin-paste-panel-tabs .raptor-plugin-paste-tab { 17 | border-top: none; 18 | border: 1px solid #c2c2c2; 19 | overflow: scroll; 20 | height: 80%; 21 | } 22 | 23 | .raptor-plugin-paste-panel-tabs .raptor-plugin-paste-area { 24 | background-color: #fff; 25 | border: none; 26 | min-height: 300px; 27 | min-width: 90%; 28 | padding: 2px; 29 | } 30 | 31 | .raptor-plugin-paste-dialog .ui-dialog-content { 32 | overflow: hidden; 33 | width: 100% !important; 34 | height: 100%; 35 | @include box-sizing(border-box); 36 | } 37 | -------------------------------------------------------------------------------- /tests/scss/diff.scss: -------------------------------------------------------------------------------- 1 | @import "compass/css3"; 2 | 3 | table { 4 | border-collapse: collapse; 5 | width:100%; 6 | font-family: 'Bitstream Vera Sans Mono', Courier, monospace; 7 | border: 1px solid #CCC; 8 | } 9 | 10 | thead tr { 11 | font-weight: normal; 12 | text-aling: left; 13 | height: 2em; 14 | border-bottom: 1px solid #DDD; 15 | background-color: #ECECEC; 16 | @include background(linear-gradient(#FAFAFA, #ECECEC)); 17 | } 18 | 19 | td { 20 | padding: 1px 2px; 21 | 22 | &.bredecode { 23 | width: 100%; 24 | padding-left: 4px; 25 | } 26 | &.codekolom { 27 | text-align: right; 28 | min-width: 3em; 29 | background-color: #ECECEC; 30 | border-right: 1px solid #DDD; 31 | color: #AAA; 32 | } 33 | } 34 | 35 | tr.add { 36 | background: #DFD; 37 | } 38 | 39 | tr.del { 40 | background: #FDD; 41 | } 42 | -------------------------------------------------------------------------------- /src/plugins/link/link-remove.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Link remove plugin. 3 | * 4 | * @plugin PreviewToggleButton linkRemove 5 | * @license http://www.raptor-editor.com/license 6 | * 7 | * @author David Neilsen 8 | * @author Michael Robinson 9 | * @author Melissa Richards 10 | */ 11 | Raptor.registerUi(new PreviewToggleButton({ 12 | name: 'linkRemove', 13 | disable: true, 14 | 15 | action: function() { 16 | this.raptor.actionApply(function() { 17 | document.execCommand('unlink'); 18 | }.bind(this)); 19 | }, 20 | 21 | selectionToggle: function() { 22 | var element = selectionGetElement(); 23 | if (!element) { 24 | return false; 25 | } 26 | if (element.closest('a').length) { 27 | return true; 28 | } 29 | return false; 30 | } 31 | })); 32 | -------------------------------------------------------------------------------- /src/plugins/link/link-open.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileOverview Contains the link open class code. 3 | * @license http://www.raptor-editor.com/license 4 | * 5 | * @author David Neilsen 6 | */ 7 | 8 | /** 9 | * The link open plugin class. 10 | * 11 | * @constructor 12 | * @augments RaptorPlugin 13 | * 14 | * @param {String} name 15 | * @param {Object} overrides Options hash. 16 | */ 17 | function LinkOpen(name, overrides) { 18 | RaptorPlugin.call(this, name || 'linkOpen', overrides); 19 | } 20 | 21 | LinkOpen.prototype = Object.create(RaptorPlugin.prototype); 22 | 23 | LinkOpen.prototype.enable = function() { 24 | this.raptor.getElement().on('click.raptor', 'a', this.openLink); 25 | }; 26 | 27 | LinkOpen.prototype.openLink = function(event) { 28 | if (event.ctrlKey && this.href) { 29 | window.open(this.href, '_blank'); 30 | } 31 | }; 32 | 33 | Raptor.registerPlugin(new LinkOpen()); 34 | -------------------------------------------------------------------------------- /src/plugins/clean-block/clean-block.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @license http://www.raptor-editor.com/license 3 | * 4 | * @author David Neilsen 5 | */ 6 | 7 | Raptor.registerUi(new PreviewButton({ 8 | name: 'cleanBlock', 9 | action: function() { 10 | var element = this.raptor.getElement(); 11 | cleanRemoveAttributes(element, [ 12 | 'style' 13 | ]); 14 | cleanRemoveElements(element, [ 15 | 'font', 16 | 'span:not([class])', 17 | '.cms-color:has(.cms-color)', 18 | ':header strong', 19 | ':header b', 20 | ':header strong' 21 | ]); 22 | cleanEmptyElements(element, [ 23 | 'b', 24 | 'big', 25 | 'em', 26 | 'i', 27 | 'small', 28 | 'span', 29 | 'strong', 30 | ':not(:visible)' 31 | ]); 32 | } 33 | })); 34 | -------------------------------------------------------------------------------- /src/plugins/text-style/size-decrease.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileOverview Contains the text size decrease button code. 3 | * @license http://www.raptor-editor.com/license 4 | * 5 | * @author David Neilsen 6 | * @author Michael Robinson 7 | * @author Melissa Richards 8 | */ 9 | 10 | /** 11 | * Creates an instance of the preview button to apply the text size decrease 12 | * class to a selection. 13 | */ 14 | Raptor.registerUi(new PreviewButton({ 15 | name: 'textSizeDecrease', 16 | action: function() { 17 | selectionExpandToWord(); 18 | this.raptor.selectionConstrain(); 19 | selectionInverseWrapWithTagClass('small', this.options.cssPrefix + 'small', 'big', this.options.cssPrefix + 'big'); 20 | this.raptor.getElement().find('small.' + this.options.cssPrefix + 'small:empty, big.' + this.options.cssPrefix + 'big:empty').remove(); 21 | } 22 | })); 23 | -------------------------------------------------------------------------------- /src/plugins/text-style/size-increase.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileOverview Contains the text size increase button code. 3 | * @license http://www.raptor-editor.com/license 4 | * 5 | * @author David Neilsen 6 | * @author Michael Robinson 7 | * @author Melissa Richards 8 | */ 9 | 10 | /** 11 | * Creates an instance of the preview button to apply the text size increase 12 | * class to a selection. 13 | */ 14 | Raptor.registerUi(new PreviewButton({ 15 | name: 'textSizeIncrease', 16 | action: function() { 17 | selectionExpandToWord(); 18 | this.raptor.selectionConstrain(); 19 | selectionInverseWrapWithTagClass('big', this.options.cssPrefix + 'big', 'small', this.options.cssPrefix + 'small'); 20 | this.raptor.getElement().find('small.' + this.options.cssPrefix + 'small:empty, big.' + this.options.cssPrefix + 'big:empty').remove(); 21 | } 22 | })); 23 | -------------------------------------------------------------------------------- /src/plugins/link/templates/file-url.html: -------------------------------------------------------------------------------- 1 |

      tr('Link to a document or other file')

      2 |
      3 | 4 | 5 |
      6 |

      tr('New window')

      7 |
      8 | 12 |
      13 |

      tr('Not sure what to put in the box above?')

      14 |
        15 |
      1. tr('Ensure the file has been uploaded to your website')
      2. 16 |
      3. tr('Open the uploaded file in your browser')
      4. 17 |
      5. tr("Copy the file's URL from your browser's address bar and paste it into the box above")
      6. 18 |
      19 | -------------------------------------------------------------------------------- /src/style/style.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Main editor styles 3 | * 4 | * @author David Neilsen 5 | * @author Michael Robinson 6 | */ 7 | .raptor-editing { 8 | outline: none; 9 | } 10 | 11 | .raptor-editable-block-hover:not(.raptor-editing), 12 | .raptor-editable-block:hover:not(.raptor-editing) { 13 | background: inline-image('diagonal-lines.png') 0 0; 14 | } 15 | 16 | .raptor-editing-inline { 17 | width: 600px; 18 | min-height: 150px; 19 | padding: 5px !important; 20 | background-color: #fff; 21 | border: $border-width $border-style $border-color !important; 22 | border-top: none !important; 23 | color: #333; 24 | font-size: 1em; 25 | text-shadow: none; 26 | } 27 | 28 | .raptor-editing-inline * { 29 | text-shadow: inherit; 30 | } 31 | 32 | .raptor-editing-inline *:not(.cms-color) { 33 | color: inherit; 34 | } 35 | 36 | @media print { 37 | .raptor-ui { 38 | display: none; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/plugins/float/float-left.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileOverview Contains the float left button code. 3 | * @license http://www.raptor-editor.com/license 4 | * 5 | * @author David Neilsen 6 | * @author Michael Robinson 7 | * @author Melissa Richards 8 | */ 9 | 10 | /** 11 | * Creates an instance of a filtered preview button to float an image left. 12 | * 13 | * @todo des and type for the param. 14 | * @param {type} param 15 | */ 16 | Raptor.registerUi(new FilteredPreviewButton({ 17 | name: 'floatLeft', 18 | applyToElement: function(element) { 19 | element.removeClass(this.options.cssPrefix + 'float-right'); 20 | element.toggleClass(this.options.cssPrefix + 'float-left'); 21 | cleanEmptyAttributes(element, ['class']); 22 | }, 23 | getElement: function(range) { 24 | var images = $(range.commonAncestorContainer).find('img'); 25 | return images.length ? images : null; 26 | } 27 | })); 28 | -------------------------------------------------------------------------------- /src/plugins/float/float-none.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileOverview Contains the float none button class code. 3 | * @license http://www.raptor-editor.com/license 4 | * 5 | * @author David Neilsen 6 | * @author Michael Robinson 7 | * @author Melissa Richards 8 | */ 9 | 10 | /** 11 | * Creates an instance of a filtered preview button to remove the float an image. 12 | * 13 | * @todo des and type for the param. 14 | * @param {type} param 15 | */ 16 | Raptor.registerUi(new FilteredPreviewButton({ 17 | name: 'floatNone', 18 | applyToElement: function(element) { 19 | element.removeClass(this.options.cssPrefix + 'float-right'); 20 | element.removeClass(this.options.cssPrefix + 'float-left'); 21 | cleanEmptyAttributes(element, ['class']); 22 | }, 23 | getElement: function(range) { 24 | var images = $(range.commonAncestorContainer).find('img'); 25 | return images.length ? images : null; 26 | } 27 | })); 28 | -------------------------------------------------------------------------------- /src/plugins/float/float-right.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileOverview Contains the float right button class code. 3 | * @license http://www.raptor-editor.com/license 4 | * 5 | * @author David Neilsen 6 | * @author Michael Robinson 7 | * @author Melissa Richards 8 | */ 9 | 10 | /** 11 | * Creates an instance of a filtered preview button to float an image right. 12 | * 13 | * @todo des and type for the param. 14 | * @param {type} param 15 | */ 16 | Raptor.registerUi(new FilteredPreviewButton({ 17 | name: 'floatRight', 18 | applyToElement: function(element) { 19 | element.removeClass(this.options.cssPrefix + 'float-left'); 20 | element.toggleClass(this.options.cssPrefix + 'float-right'); 21 | cleanEmptyAttributes(element, ['class']); 22 | }, 23 | getElement: function(range) { 24 | var images = $(range.commonAncestorContainer).find('img'); 25 | return images.length ? images : null; 26 | } 27 | })); 28 | -------------------------------------------------------------------------------- /LEGAL_NOTICE: -------------------------------------------------------------------------------- 1 | Raptor Editor HTML5 WYSIWYG Editor 2 | http://www.raptor-editor.com 3 | 4 | Copyright 2011-2013, PAN Media Limited. All rights reserved. 5 | http://www.panmedia.co.nz 6 | 7 | Raptor Editor is a trademark of PAN Media Limited. 8 | All other brand and product names are trademarks, registered 9 | trademarks or service marks of their respective holders. 10 | 11 | Raptor Editor is free software: you can redistribute it and/or modify 12 | it under the terms of the GNU General Public License as published by 13 | the Free Software Foundation, either version 3 of the License, or 14 | (at your option) any later version. 15 | 16 | Raptor Editor is distributed in the hope that it will be useful, 17 | but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | GNU General Public License for more details. 20 | 21 | You should have received a copy of the GNU General Public License 22 | along with Raptor Editor. If not, see . 23 | -------------------------------------------------------------------------------- /src/plugins/table/style/table.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Table plugin. 3 | * 4 | * @author David Neilsen 5 | */ 6 | .raptor-ui-table-create-menu td { 7 | width: 14px; 8 | height: 14px; 9 | border: 1px solid #000; 10 | } 11 | 12 | .raptor-ui-table-create-menu .raptor-ui-table-create-menu-hover { 13 | border: 1px solid #f00; 14 | } 15 | 16 | .raptor-ui-table-create { 17 | @include button-icon('table.png'); 18 | } 19 | 20 | .raptor-ui-table-insert-row { 21 | @include button-icon('table-insert-row.png'); 22 | } 23 | 24 | .raptor-ui-table-insert-column { 25 | @include button-icon('table-insert-column.png'); 26 | } 27 | 28 | .raptor-ui-table-delete-row { 29 | @include button-icon('table-delete-row.png'); 30 | } 31 | 32 | .raptor-ui-table-delete-column { 33 | @include button-icon('table-delete-column.png'); 34 | } 35 | 36 | .raptor-ui-table-merge-cells { 37 | @include button-icon('table-join.png'); 38 | } 39 | 40 | .raptor-ui-table-split-cells { 41 | @include button-icon('table-split.png'); 42 | } 43 | -------------------------------------------------------------------------------- /tests/css/diff.css: -------------------------------------------------------------------------------- 1 | table { 2 | border-collapse: collapse; 3 | width: 100%; 4 | font-family: "Bitstream Vera Sans Mono", Courier, monospace; 5 | border: 1px solid #cccccc; } 6 | 7 | thead tr { 8 | font-weight: normal; 9 | text-aling: left; 10 | height: 2em; 11 | border-bottom: 1px solid #dddddd; 12 | background-color: #ECECEC; 13 | background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #fafafa), color-stop(100%, #ececec)); 14 | background: -webkit-linear-gradient(#fafafa, #ececec); 15 | background: -moz-linear-gradient(#fafafa, #ececec); 16 | background: -o-linear-gradient(#fafafa, #ececec); 17 | background: linear-gradient(#fafafa, #ececec); } 18 | 19 | td { 20 | padding: 1px 2px; } 21 | td.bredecode { 22 | width: 100%; 23 | padding-left: 4px; } 24 | td.codekolom { 25 | text-align: right; 26 | min-width: 3em; 27 | background-color: #ECECEC; 28 | border-right: 1px solid #dddddd; 29 | color: #AAA; } 30 | 31 | tr.add { 32 | background: #DFD; } 33 | 34 | tr.del { 35 | background: #FDD; } 36 | -------------------------------------------------------------------------------- /src/plugins/logo/logo.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileOverview Contains the logo button code. 3 | * @license http://www.raptor-editor.com/license 4 | * 5 | * @author David Neilsen 6 | * @author Michael Robinson 7 | * @author Melissa Richards 8 | */ 9 | 10 | /** 11 | * Creates a new instance of the button class to display the raptor logo and 12 | * link to the raptor version page. 13 | */ 14 | Raptor.registerUi(new Button({ 15 | name: 'logo', 16 | // 17 | init: function() { 18 | var button = Button.prototype.init.apply(this, arguments); 19 | button.find('.ui-button-icon-primary').css({ 20 | 'background-image': 'url(//www.raptor-editor.com/logo/VERSION?json=' + 21 | encodeURIComponent(JSON.stringify(this.raptor.options)) + ')' 22 | }); 23 | return button; 24 | }, 25 | // 26 | action: function() { 27 | window.open('http://www.raptor-editor.com/about/VERSION', '_blank'); 28 | } 29 | })); 30 | -------------------------------------------------------------------------------- /src/plugins/cancel/cancel.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileOverview Contains the cancel editing dialog code. 3 | * @license http://www.raptor-editor.com/license 4 | * 5 | * @author David Neilsen 6 | * @author Michael Robinson 7 | * @author Melissa Richards 8 | */ 9 | 10 | /** 11 | * Creates an instance of a cancel dialog. 12 | * 13 | * @todo needs checking and not sure what to put in for the param stuff. 14 | * @param {type} param 15 | */ 16 | Raptor.registerUi(new DialogButton({ 17 | name: 'cancel', 18 | hotkey: 'esc', 19 | dialogOptions: { 20 | width: 500 21 | }, 22 | 23 | action: function() { 24 | if (this.raptor.isDirty()) { 25 | DialogButton.prototype.action.call(this); 26 | } else { 27 | this.applyAction(); 28 | } 29 | }, 30 | 31 | applyAction: function() { 32 | this.raptor.cancelEditing(); 33 | }, 34 | 35 | getDialogTemplate: function() { 36 | return $('
      ').html(tr('cancelDialogContent')); 37 | } 38 | })); 39 | -------------------------------------------------------------------------------- /scripts/expose.php: -------------------------------------------------------------------------------- 1 | 31 | $result 32 | window.Raptor = Raptor; 33 | // 34 | "; 35 | -------------------------------------------------------------------------------- /tests/cases/placeholder/placeholder.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 11 |
      12 |

      Placeholder 1: Empty content replacement

      13 |
      14 |
      15 | 16 |
      17 |
      18 |
      19 |
      20 |

      21 | [Your content here] 22 |

      23 |
      24 |
      25 |
      26 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /src/plugins/link/link-type-document.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileOverview Contains the document link class code. 3 | * @license http://www.raptor-editor.com/license 4 | * 5 | * @author David Neilsen 6 | * @author Michael Robinson 7 | * @author Melissa Richards 8 | */ 9 | 10 | /** 11 | * @class The internal link class. 12 | * 13 | * @constructor 14 | * @param {Raptor} raptor 15 | */ 16 | function LinkTypeDocument(linkCreate) { 17 | this.linkCreate = linkCreate; 18 | this.label = tr('linkTypeDocumentLabel'); 19 | } 20 | 21 | LinkTypeDocument.prototype = Object.create(LinkTypeExternal.prototype); 22 | 23 | LinkTypeDocument.prototype.resetInputs = function(panel) { 24 | panel.find('[name=location]').val('http://'); 25 | panel.find('[name=blank]').prop('checked', false); 26 | }; 27 | 28 | /** 29 | * @return {String} The document link panel content. 30 | */ 31 | LinkTypeDocument.prototype.getContent = function() { 32 | return this.linkCreate.raptor.getTemplate('link.document', this.linkCreate.raptor.options); 33 | }; 34 | -------------------------------------------------------------------------------- /src/presets/micro.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileOverview Contains the micro options preset. 3 | * @license http://www.raptor-editor.com/license 4 | * @author David Neilsen 5 | */ 6 | 7 | /** 8 | * @namespace Micro options for Raptor. 9 | */ 10 | Raptor.registerPreset({ 11 | name: 'micro', 12 | layouts: { 13 | toolbar: { 14 | uiOrder: [ 15 | ['logo'], 16 | ['save', 'cancel'], 17 | ['dockToScreen', 'dockToElement'], 18 | ['historyUndo', 'historyRedo'], 19 | ['specialCharacters'], 20 | ['languageMenu'], 21 | ['statistics'] 22 | ] 23 | }, 24 | hoverPanel: { 25 | uiOrder: [ 26 | ['clickButtonToEdit', 'revisions'] 27 | ] 28 | } 29 | }, 30 | plugins: { 31 | placeholder: false, 32 | paste: { 33 | panels: [ 34 | 'plain-text' 35 | ] 36 | }, 37 | noBreak: { 38 | enabled: true 39 | } 40 | } 41 | }); 42 | -------------------------------------------------------------------------------- /src/plugins/unsaved-edit-warning/unsaved-edit-warning.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Unsaved edit warning plugin 3 | * 4 | * @author Michael Robinson 5 | * @author David Neilsen 6 | */ 7 | @import 'compass/css3/images'; 8 | @import 'compass/css3/opacity'; 9 | @import 'compass/css3/transition'; 10 | 11 | .raptor-plugin-unsaved-edit-warning { 12 | position: fixed; 13 | bottom: 0; 14 | right: 0; 15 | height: 30px; 16 | line-height: 30px; 17 | border: 1px solid #D4D4D4; 18 | padding-right: 7px; 19 | @include background(linear-gradient(top, rgba(255, 255, 242, 1), rgba(237, 236, 189, 1))); 20 | @include transition(opacity 0.5s); 21 | @include opacity(0); 22 | 23 | .ui-icon { 24 | display: inline-block; 25 | float: left; 26 | margin: 8px 5px 0 5px; 27 | } 28 | } 29 | 30 | .raptor-plugin-unsaved-edit-warning-visible { 31 | @include opacity(1); 32 | } 33 | 34 | .raptor-plugin-unsaved-edit-warning-dirty { 35 | outline: 1px dotted #aaa; 36 | background-image: inline-image('diagonal-lines.png') !important; 37 | } 38 | -------------------------------------------------------------------------------- /src/plugins/table/table-cell-button.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileOverview Contains the table cell button class code. 3 | * @license http://www.raptor-editor.com/license 4 | * 5 | * @author David Neilsen 6 | * @author Michael Robinson 7 | * @author Melissa Richards 8 | */ 9 | 10 | /** 11 | * The table cell button class. 12 | * 13 | * @constructor 14 | * @augments FilteredPreviewButton 15 | * 16 | * @param {Object} options Options hash. 17 | */ 18 | function TableCellButton(options) { 19 | FilteredPreviewButton.call(this, options); 20 | } 21 | 22 | TableCellButton.prototype = Object.create(FilteredPreviewButton.prototype); 23 | 24 | /** 25 | * @todo 26 | * 27 | * @param {RangySelection} range The selection to get the cell from. 28 | * @returns {Element|null} 29 | */ 30 | TableCellButton.prototype.getElement = function(range) { 31 | var cell = $(range.commonAncestorContainer.parentNode).closest('td, th'); 32 | if (cell.length && !cell.find(this.raptor.getElement()).length) { 33 | return cell[0]; 34 | } 35 | return null; 36 | }; 37 | -------------------------------------------------------------------------------- /src/components/ui/menu-button.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileOverview Contains the menu button class code. 3 | * @license http://www.raptor-editor.com/license 4 | * 5 | * @author David Neilsen 6 | * @author Michael Robinson 7 | * @author Melissa Richards 8 | */ 9 | 10 | /** 11 | * @constructor 12 | * @augments Button 13 | * 14 | * @param {Menu} menu The menu to create the menu button for. 15 | * @param {Object} options 16 | */ 17 | function MenuButton(menu, options) { 18 | this.menu = menu; 19 | this.name = menu.name; 20 | this.raptor = menu.raptor; 21 | this.options = menu.options; 22 | Button.call(this, options); 23 | } 24 | 25 | MenuButton.prototype = Object.create(Button.prototype); 26 | 27 | /** 28 | * Shows the menu when button is clicked. 29 | * 30 | * @param {Event} event The click event. 31 | */ 32 | MenuButton.prototype.click = function(event) { 33 | if (this.menu.getMenu().is(':visible')) { 34 | $('.raptor-menu').hide(); 35 | } else { 36 | this.menu.show(); 37 | } 38 | event.preventDefault(); 39 | }; 40 | -------------------------------------------------------------------------------- /src/plugins/history/history-undo.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileOverview Contains the history undo code. 3 | * @license http://www.raptor-editor.com/license 4 | * 5 | * @author David Neilsen 6 | * @author Michael Robinson 7 | * @author Melissa Richards 8 | */ 9 | 10 | /** 11 | * Creates an instance of the button class to undo an action. 12 | * 13 | * @todo param details? 14 | * @param {type} param 15 | */ 16 | Raptor.registerUi(new Button({ 17 | name: 'historyUndo', 18 | hotkey: 'ctrl+z', 19 | 20 | action: function() { 21 | this.raptor.historyBack(); 22 | }, 23 | 24 | init: function () { 25 | this.raptor.bind('historyChange', this.historyChange.bind(this)); 26 | Button.prototype.init.apply(this, arguments); 27 | aButtonDisable(this.button); 28 | return this.button; 29 | }, 30 | 31 | historyChange: function() { 32 | if (this.raptor.present === 0) { 33 | aButtonDisable(this.button); 34 | } else { 35 | aButtonEnable(this.button); 36 | } 37 | } 38 | })); 39 | -------------------------------------------------------------------------------- /src/presets/inline.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileOverview Contains the inline preset. 3 | * @license http://www.raptor-editor.com/license 4 | * 5 | * @author David Neilsen 6 | */ 7 | 8 | /** 9 | * @namespace Inline preset for Raptor. 10 | */ 11 | Raptor.registerPreset({ 12 | name: 'inline', 13 | classes: 'raptor-editing-inline', 14 | autoEnable: true, 15 | draggable: false, 16 | unify: false, 17 | unloadWarning: false, 18 | reloadOnDisable: true, 19 | plugins: { 20 | unsavedEditWarning: false, 21 | dock: { 22 | dockToElement: true, 23 | docked: true, 24 | persist: false 25 | } 26 | }, 27 | layouts: { 28 | toolbar: { 29 | uiOrder: [ 30 | ['textBold', 'textItalic', 'textUnderline', 'textStrike'], 31 | ['colorMenuBasic'], 32 | ['textBlockQuote'], 33 | ['listOrdered', 'listUnordered'], 34 | ['textSizeDecrease', 'textSizeIncrease'], 35 | ['linkCreate', 'linkRemove'] 36 | ] 37 | } 38 | } 39 | }); 40 | -------------------------------------------------------------------------------- /scripts/create-build.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 10 |
      11 |

      Clear Formatting 1: Basic

      12 |
      13 |
      14 |

      Test link inside a paragraph

      15 |
        16 |
      • This is a list
      • 17 |
      • This is a list
      • 18 |
      • This is a list
      • 19 |
      20 |
      21 |
      22 |
      23 |

      Test link inside a paragraph

      24 |
        25 |
      • This is a list
      • 26 |
      • This is a list
      • 27 |
      • This is a list
      • 28 |
      29 |
      30 |
      31 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /tests/cases/table/create-table.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |
      8 |

      Create Table

      9 |
      10 |
      11 |
      12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 |
      CellCellCell
      CellCellCell
      CellCellCell
      29 |
      30 |
      31 | 38 | 39 | -------------------------------------------------------------------------------- /src/plugins/embed/embed.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Embed plugin 3 | * 4 | * @author David Neilsen 5 | */ 6 | @import 'compass/css3/box'; 7 | @import 'compass/css3/box-sizing'; 8 | 9 | .raptor-ui-embed { 10 | @include button-icon('youtube.png'); 11 | } 12 | 13 | .raptor-ui-embed-panel-tabs { 14 | height: 100%; 15 | width: 100%; 16 | 17 | @include display-box(); 18 | @include box-orient(vertical); 19 | @include box-flex(1); 20 | 21 | .raptor-ui-embed-code-tab, 22 | .raptor-ui-embed-preview-tab { 23 | @include display-box(); 24 | @include box-orient(vertical); 25 | @include box-flex(1); 26 | @include box-sizing(border-box); 27 | 28 | p { 29 | padding-top: 10px; 30 | } 31 | 32 | textarea { 33 | @include display-box(); 34 | @include box-flex(4); 35 | } 36 | } 37 | } 38 | 39 | .raptor-ui-embed-dialog .ui-dialog-content { 40 | display: -webkit-box !important; 41 | display: -moz-box !important; 42 | display: box !important; 43 | width: 100% !important; 44 | overflow: hidden; 45 | @include box-sizing(border-box); 46 | } 47 | -------------------------------------------------------------------------------- /src/plugins/history/history-redo.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileOverview Contains the history redo code. 3 | * @license http://www.raptor-editor.com/license 4 | * 5 | * @author David Neilsen 6 | * @author Michael Robinson 7 | * @author Melissa Richards 8 | */ 9 | 10 | /** 11 | * Creates an instance of the button class to redo an action. 12 | * 13 | * @todo param details? 14 | * @param {type} param 15 | */ 16 | Raptor.registerUi(new Button({ 17 | name: 'historyRedo', 18 | hotkey: ['ctrl+y', 'ctrl+shift+z'], 19 | 20 | action: function() { 21 | this.raptor.historyForward(); 22 | }, 23 | 24 | init: function () { 25 | this.raptor.bind('historyChange', this.historyChange.bind(this)); 26 | Button.prototype.init.apply(this, arguments); 27 | aButtonDisable(this.button); 28 | return this.button; 29 | }, 30 | 31 | historyChange: function() { 32 | if (this.raptor.present < this.raptor.history.length - 1) { 33 | aButtonEnable(this.button); 34 | } else { 35 | aButtonDisable(this.button); 36 | } 37 | } 38 | })); 39 | -------------------------------------------------------------------------------- /src/components/ui/custom-menu.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileOverview Contains the custom menu class code. 3 | * @license http://www.raptor-editor.com/license 4 | * 5 | * @author David Neilsen 6 | * @author Michael Robinson 7 | * @author Melissa Richards 8 | */ 9 | 10 | /** 11 | * @class The custom menu class. 12 | * 13 | * @constructor 14 | * @augments Menu 15 | * 16 | * Prepares and returns the custom menu Element to be used in the Raptor UI. 17 | * 18 | * @returns {Element} 19 | */ 20 | Menu.prototype.getMenu = function() { 21 | if (!this.menu) { 22 | this.menu = $('
      ') 23 | .addClass('raptor-ui ui-menu ui-widget ui-widget-content ui-corner-all ' + this.options.baseClass + '-menu ' + this.raptor.options.baseClass + '-menu') 24 | .html(this.menuContent) 25 | .css('position', 'fixed') 26 | .hide() 27 | .appendTo('body') 28 | .mousedown(function(event) { 29 | // Prevent losing the selection on the editor target 30 | event.preventDefault(); 31 | }); 32 | } 33 | return this.menu; 34 | }; 35 | 36 | -------------------------------------------------------------------------------- /tests/cases/block-quote/table.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 10 |
      11 |

      List 1: table

      12 |
      13 | 14 | 15 | 16 | 17 |
      {}Cell
      18 |
      19 |
      20 | 21 | 22 | 27 | 28 |
      23 |
      24 |

      Cell

      25 |
      26 |
      29 |
      30 |
      31 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /tests/cases/custom-tags/tag.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileOverview Tag helper functions. 3 | * @license http://www.raptor-editor.com/license 4 | * 5 | * @author David Neilsen david@panmedia.co.nz 6 | * @author Michael Robinson michael@panmedia.co.nz 7 | */ 8 | 9 | 10 | 11 | /** 12 | * Applies a tag to a selection based on a class name. 13 | * 14 | * @param {type} tag The tag that is to be applied to the selection. 15 | * @param {type} className The class name that is to have the tag applied to it within the selection. 16 | */ 17 | function tagCustomApplyToSelection(tag, className) { 18 | var applier = rangy.createCssClassApplier(className, { 19 | elementTagName: tag 20 | }); 21 | applier.applyToSelection(); 22 | } 23 | 24 | /** 25 | * Removes a tag from a selection based on a class name. 26 | * 27 | * @param {type} tag The tag that is to be removed from the selection. 28 | * @param {type} className The class name that is to have the tag removed from it within the selection. 29 | */ 30 | function tagCustomRemoveFromSelection(tag, className) { 31 | var applier = rangy.createCssClassApplier(className, { 32 | elementTagName: tag 33 | }); 34 | applier.undoToSelection(); 35 | } 36 | -------------------------------------------------------------------------------- /src/plugins/table/table-delete-row.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileOverview Contains the delete column button code. 3 | * @license http://www.raptor-editor.com/license 4 | * 5 | * @author David Neilsen 6 | * @author Michael Robinson 7 | * @author Melissa Richards 8 | */ 9 | 10 | /** 11 | * Creates a table cell button to delete a row from a table. 12 | */ 13 | Raptor.registerUi(new TableCellButton({ 14 | name: 'tableDeleteRow', 15 | applyToElement: function(cell) { 16 | var position = tableGetCellIndex(cell), 17 | table = cell.parentNode.parentNode.parentNode, 18 | nextCell; 19 | tableDeleteRow(cell.parentNode.parentNode.parentNode, position.y); 20 | if (tableIsEmpty(table)) { 21 | table.parentNode.removeChild(table); 22 | return; 23 | } 24 | nextCell = tableGetCellByIndex(table, position); 25 | if (!nextCell && position.y > 0) { 26 | nextCell = tableGetCellByIndex(table, { 27 | x: position.x, 28 | y: position.y - 1 29 | }); 30 | } 31 | selectionSelectInner(nextCell); 32 | } 33 | })); 34 | -------------------------------------------------------------------------------- /src/plugins/table/table-delete-column.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileOverview Contains the delete column button code. 3 | * @license http://www.raptor-editor.com/license 4 | * 5 | * @author David Neilsen 6 | * @author Michael Robinson 7 | * @author Melissa Richards 8 | */ 9 | 10 | /** 11 | * Creates a table cell button to delete a column from a table. 12 | */ 13 | Raptor.registerUi(new TableCellButton({ 14 | name: 'tableDeleteColumn', 15 | applyToElement: function(cell) { 16 | var position = tableGetCellIndex(cell), 17 | table = cell.parentNode.parentNode.parentNode, 18 | nextCell; 19 | tableDeleteColumn(cell.parentNode.parentNode.parentNode, position.x); 20 | if (tableIsEmpty(table)) { 21 | table.parentNode.removeChild(table); 22 | return; 23 | } 24 | nextCell = tableGetCellByIndex(table, position); 25 | if (!nextCell && position.x > 0) { 26 | nextCell = tableGetCellByIndex(table, { 27 | x: position.x - 1, 28 | y: position.y 29 | }); 30 | } 31 | selectionSelectInner(nextCell); 32 | } 33 | })); 34 | -------------------------------------------------------------------------------- /THIRD_PARTY_COMPONENTS_AND_LIBRARIES: -------------------------------------------------------------------------------- 1 | THIRD-PARTY COMPONENTS AND LIBRARIES 2 | 3 | The following components/libraries are redistributed with Raptor Editor and are 4 | subject to their respective licenses and copyright notices. 5 | 6 | jQuery (MIT) 7 | Copyright 2005, 2012 jQuery Foundation, Inc. and other contributors. 8 | http://jquery.com 9 | 10 | jQuery UI (MIT) 11 | Copyright 2013 jQuery Foundation and other contributors. 12 | http://jqueryui.com 13 | 14 | jQuery Hotkeys (MIT/GPL2) 15 | Copyright 2010, John Resig. 16 | https://github.com/jeresig/jquery.hotkeys 17 | 18 | Rangy (MIT) 19 | Copyright 2013, Tim Down. 20 | http://code.google.com/p/rangy 21 | 22 | GoogTable (Apache 2.0) 23 | Copyright 2008 The Closure Library Authors. All Rights Reserved. 24 | http://code.google.com/p/closure-library/source/browse/trunk/closure/goog/editor/table.js 25 | 26 | ResizeTable JS (New BSD 3) 27 | http://code.google.com/p/resizetable-js 28 | 29 | Diff Match and Patch (Apache 2.0) 30 | Copyright 2006 Google Inc. 31 | http://code.google.com/p/google-diff-match-patch/ 32 | 33 | Images and Icons 34 | All images and icons redistributed in this package are subject to their 35 | respective licenses and copyright notices, see IMAGES_AND_ICONS for more 36 | information. 37 | -------------------------------------------------------------------------------- /tests/templates/base.html: -------------------------------------------------------------------------------- 1 |
      2 |

      3 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas 4 | convallis dui id erat pellentesque et rhoncus nunc semper. Suspendisse 5 | malesuada hendrerit velit nec tristique. Aliquam gravida mauris at 6 | ligula venenatis rhoncus. Suspendisse interdum, nisi nec consectetur 7 | pulvinar, lorem augue ornare felis, vel lacinia erat nibh in velit. 8 |

      9 |

      10 | Hendrerit, felis ac fringilla lobortis, massa ligula aliquet justo, sit 11 | amet tincidunt enim quam sollicitudin nisi. Maecenas ipsum augue, 12 | commodo sit amet aliquet ut, laoreet ut nunc. Vestibulum ante ipsum 13 | primis in faucibus orci luctus et ultrices posuere cubilia Curae; 14 | Pellentesque tincidunt eros quis tellus laoreet ac dignissim turpis 15 | luctus. Integer nunc est, pulvinar ac tempor ac, pretium ut odio. 16 |

      17 |

      18 | Pellentesque in arcu sit amet odio scelerisque tincidunt. Lorem ipsum 19 | dolor sit amet, consectetur adipiscing elit. Pellentesque habitant morbi 20 | tristique senectus et netus et malesuada fames ac turpis egestas. 21 |

      22 |
      23 | -------------------------------------------------------------------------------- /scripts/list-files.php: -------------------------------------------------------------------------------- 1 | '; 5 | exit; 6 | } 7 | $directory = $_SERVER['argv'][1]; 8 | 9 | $files = glob_recursive($directory . '/*.*'); 10 | foreach ($files as $i => $file) { 11 | $files[$i] = realpath($file); 12 | } 13 | 14 | usort($files, function($a, $b) { 15 | if (dirname($a) != dirname($b)) { 16 | return strcmp(dirname($a), dirname($b)); 17 | } 18 | $ae = substr($a, strpos($a, '.') + 1); 19 | $be = substr($b, strpos($b, '.') + 1); 20 | if ($ae === $be) { 21 | return strcmp($a, $b); 22 | } 23 | return strcmp($ae, $be); 24 | }); 25 | 26 | $root = realpath(__DIR__ . '/..') . '/'; 27 | $last_path = null; 28 | foreach ($files as $i => $file) { 29 | if ($last_path === null) { 30 | $last_path = dirname($file); 31 | } elseif ($last_path !== dirname($file) && !preg_match('/[\/\\\\]templates[\/\\\\]/', $file)) { 32 | echo PHP_EOL; 33 | $last_path = dirname($file); 34 | } 35 | $file = substr($file, strlen($root)); 36 | $file = str_replace('\\', '/', $file); 37 | echo $file . PHP_EOL; 38 | } 39 | -------------------------------------------------------------------------------- /src/tools/node.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileOverview Find node parent helper function. 3 | * @license http://www.raptor-editor.com/license 4 | * 5 | * @author David Neilsen david@panmedia.co.nz 6 | * @author Michael Robinson michael@panmedia.co.nz 7 | */ 8 | 9 | 10 | /** 11 | * Find the first parent of a node that is not a text node. 12 | * 13 | * @param {Node} node 14 | * @returns {Node} 15 | */ 16 | function nodeFindParent(node) { 17 | while (node.nodeType === Node.TEXT_NODE) { 18 | node = node.parentNode; 19 | } 20 | return node; 21 | } 22 | 23 | function nodeFindTextNodes(node) { 24 | var textNodes = [], whitespace = /^\s*$/; 25 | for (var i = 0, l = node.childNodes.length; i < l; i++) { 26 | if (node.childNodes[i].nodeType == Node.TEXT_NODE) { 27 | if (!whitespace.test(node.childNodes[i].nodeValue)) { 28 | textNodes.push(node.childNodes[i]); 29 | } 30 | } 31 | } 32 | return textNodes; 33 | } 34 | 35 | function nodeIsChildOf(child, parent) { 36 | var node = child.parentNode; 37 | while (node != null) { 38 | if (node == parent) { 39 | return true; 40 | } 41 | node = node.parentNode; 42 | } 43 | return false; 44 | } 45 | -------------------------------------------------------------------------------- /src/plugins/tool-tip/tool-tip.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Basic text style plugin 3 | * 4 | * @author David Neilsen 5 | */ 6 | @import 'compass/css3/images'; 7 | @import 'compass/css3/transition'; 8 | 9 | .raptor-layout [data-title]:after { 10 | opacity: 0; 11 | content: attr(data-title); 12 | display: block; 13 | position: absolute; 14 | top: 100%; 15 | font-size: 12px; 16 | font-weight: normal; 17 | color: white; 18 | padding: 11px 16px 7px; 19 | white-space: nowrap; 20 | text-shadow: none; 21 | overflow: visible; 22 | @include pointer-events(none); 23 | @include transition(opacity 0.23s 0s); 24 | @include background( 25 | linear-gradient(rgba(40, 40, 40, 0) 5px, rgba(40, 40, 40, 1) 6px, rgba(40, 40, 40, 1)), 26 | inline-image('tip.png') no-repeat 10px 0 27 | ); 28 | } 29 | 30 | .raptor-layout [data-title]:hover:after { 31 | opacity: 1; 32 | } 33 | 34 | .raptor-layout .raptor-select-element { 35 | position: relative; 36 | } 37 | 38 | .raptor-layout .raptor-select-element:after { 39 | @include background( 40 | linear-gradient(rgba(40, 40, 40, 0) 5px, rgba(40, 40, 40, 1) 6px, rgba(40, 40, 40, 1)), 41 | inline-image('tip.png') no-repeat 3px 0 42 | ); 43 | } -------------------------------------------------------------------------------- /tests/cases/list/toggle-5.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 10 |
      11 |

      List 21: Editing element empty

      12 |
      13 |
      14 |
      15 | 22 |
      23 |

      List 22: Empty selection between wrapper and first element

      24 |
      {}

      First element

      25 |
      {}

      First element

      26 |
      27 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /src/plugins/text-align/text-align-button.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileOverview Contains the text align button class code. 3 | * @license http://www.raptor-editor.com/license 4 | * 5 | * @author David Neilsen 6 | * @author Michael Robinson 7 | * @author Melissa Richards 8 | */ 9 | 10 | /** 11 | * The text align button class. 12 | * 13 | * @constructor 14 | * @augments PreviewToggleButton 15 | * 16 | * @param {Object} options Options hash. 17 | */ 18 | function TextAlignButton(options) { 19 | PreviewToggleButton.call(this, options); 20 | } 21 | 22 | TextAlignButton.prototype = Object.create(PreviewToggleButton.prototype); 23 | 24 | TextAlignButton.prototype.action = function() { 25 | selectionToggleBlockClasses([ 26 | this.getClass() 27 | ], [ 28 | this.options.cssPrefix + 'center', 29 | this.options.cssPrefix + 'left', 30 | this.options.cssPrefix + 'right', 31 | this.options.cssPrefix + 'justify' 32 | ], this.raptor.getElement(), 'span'); 33 | this.selectionChange(); 34 | }; 35 | 36 | TextAlignButton.prototype.selectionToggle = function() { 37 | return rangy.getSelection().getAllRanges().length > 0 && 38 | selectionContains('.' + this.getClass(), this.raptor.getElement()); 39 | }; -------------------------------------------------------------------------------- /tests/cases/applier/test-link-image.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 14 | 15 | 16 | 19 |
      20 |

      Rangy Applier: Link Image

      21 |
      22 | {} 23 |
      24 |
      25 | 26 | 27 | 28 |
      29 |
      30 | 42 | 43 | -------------------------------------------------------------------------------- /tests/templates/selection-single.html: -------------------------------------------------------------------------------- 1 | 4 |
      5 |

      6 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas 7 | convallis dui id erat pellentesque et rhoncus nunc semper. Suspendisse 8 | malesuada hendrerit velit nec tristique. Aliquam gravida mauris at 9 | ligula venenatis rhoncus. Suspendisse interdum, nisi nec consectetur 10 | pulvinar, lorem augue ornare felis, vel lacinia erat nibh in velit. 11 |

      12 |

      13 | Hendrerit, felis ac fringilla lobortis, massa ligula aliquet justo, sit 14 | amet tincidunt enim quam {sollicitudin} nisi. Maecenas ipsum augue, 15 | commodo sit amet aliquet ut, laoreet ut nunc. Vestibulum ante ipsum 16 | primis in faucibus orci luctus et ultrices posuere cubilia Curae; 17 | Pellentesque tincidunt eros quis tellus laoreet ac dignissim turpis 18 | luctus. Integer nunc est, pulvinar ac tempor ac, pretium ut odio. 19 |

      20 |

      21 | Pellentesque in arcu sit amet odio scelerisque tincidunt. Lorem ipsum 22 | dolor sit amet, consectetur adipiscing elit. Pellentesque habitant morbi 23 | tristique senectus et netus et malesuada fames ac turpis egestas. 24 |

      25 |
      26 | -------------------------------------------------------------------------------- /src/components/ui/preview-toggle-button.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileOverview Contains the preview toggle button class code. 3 | * @license http://www.raptor-editor.com/license 4 | * 5 | * @author David Neilsen 6 | * @author Michael Robinson 7 | * @author Melissa Richards 8 | */ 9 | 10 | /** 11 | * @class the preview toggle button class. 12 | * 13 | * @constructor 14 | * @augments PreviewButton 15 | * 16 | * @param {Object} options 17 | */ 18 | function PreviewToggleButton(options) { 19 | PreviewButton.call(this, options); 20 | } 21 | 22 | PreviewToggleButton.prototype = Object.create(PreviewButton.prototype); 23 | 24 | /** 25 | * Initialize the toggle preview button. 26 | * 27 | * @returns {Element} 28 | */ 29 | PreviewToggleButton.prototype.init = function() { 30 | this.raptor.bind('selectionChange', this.selectionChange.bind(this)); 31 | return PreviewButton.prototype.init.apply(this, arguments); 32 | }; 33 | 34 | /** 35 | * Sets the state of the button to active when preview is enabled. 36 | */ 37 | PreviewToggleButton.prototype.selectionChange = function() { 38 | if (this.selectionToggle()) { 39 | if (!this.isPreviewing()) { 40 | aButtonActive(this.button); 41 | } 42 | } else { 43 | aButtonInactive(this.button); 44 | } 45 | }; 46 | -------------------------------------------------------------------------------- /tests/templates/selection-single-group.html: -------------------------------------------------------------------------------- 1 | 4 |
      5 |

      6 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas 7 | convallis {dui id erat pellentesque et rhoncus} nunc semper. Suspendisse 8 | malesuada hendrerit velit nec tristique. Aliquam gravida mauris at 9 | ligula venenatis rhoncus. Suspendisse interdum, nisi nec consectetur 10 | pulvinar, lorem augue ornare felis, vel lacinia erat nibh in velit. 11 |

      12 |

      13 | Hendrerit, felis ac fringilla lobortis, massa ligula aliquet justo, sit 14 | amet tincidunt enim quam sollicitudin nisi. Maecenas ipsum augue, 15 | commodo sit amet aliquet ut, laoreet ut nunc. Vestibulum ante ipsum 16 | primis in faucibus orci luctus et ultrices posuere cubilia Curae; 17 | Pellentesque tincidunt eros quis tellus laoreet ac dignissim turpis 18 | luctus. Integer nunc est, pulvinar ac tempor ac, pretium ut odio. 19 |

      20 |

      21 | Pellentesque in arcu sit amet odio scelerisque tincidunt. Lorem ipsum 22 | dolor sit amet, consectetur adipiscing elit. Pellentesque habitant morbi 23 | tristique senectus et netus et malesuada fames ac turpis egestas. 24 |

      25 |
      26 | -------------------------------------------------------------------------------- /tests/templates/selection-single-part.html: -------------------------------------------------------------------------------- 1 | 4 |
      5 |

      6 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas 7 | convallis dui id erat pellentesque et rhoncus nunc semper. Suspendisse 8 | malesuada hendrerit velit nec tristique. Aliquam gravida mauris at 9 | ligula venenatis rhoncus. Suspendisse interdum, nisi nec consectetur 10 | pulvinar, lorem augue ornare felis, vel lacinia erat nibh in velit. 11 |

      12 |

      13 | Hendrerit, felis ac fringilla lobortis, massa ligula aliquet justo, sit 14 | amet tincidunt enim quam sollicitudin nisi. Maecenas ipsum augue, 15 | commodo sit amet aliquet ut, laoreet ut nunc. Vestibulum ante ipsum 16 | primis in fa{ucib}us orci luctus et ultrices posuere cubilia Curae; 17 | Pellentesque tincidunt eros quis tellus laoreet ac dignissim turpis 18 | luctus. Integer nunc est, pulvinar ac tempor ac, pretium ut odio. 19 |

      20 |

      21 | Pellentesque in arcu sit amet odio scelerisque tincidunt. Lorem ipsum 22 | dolor sit amet, consectetur adipiscing elit. Pellentesque habitant morbi 23 | tristique senectus et netus et malesuada fames ac turpis egestas. 24 |

      25 |
      26 | -------------------------------------------------------------------------------- /tests/templates/selection-single-multiline.html: -------------------------------------------------------------------------------- 1 | 4 |
      5 |

      6 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas 7 | convallis dui id erat pellentesque et rhoncus nunc semper. Suspendisse 8 | malesuada hendrerit velit nec tristique. Aliquam gravida mauris at 9 | ligula venenatis rhoncus. Suspendisse interdum, nisi nec consectetur 10 | pulvinar, lorem augue ornare felis, vel lacinia erat nibh in velit. 11 |

      12 |

      13 | Hendrerit, felis ac fringilla lobortis, massa ligula aliquet justo, sit 14 | amet {tincidunt enim quam sollicitudin nisi. Maecenas ipsum augue, 15 | commodo sit amet aliquet ut, laoreet ut nunc. Vestibulum ante ipsum 16 | primis in faucibus orci luctus et ultrices posuere cubilia Curae; 17 | Pellentesque tincidunt eros quis tellus laoreet ac dignissim turpis 18 | luctus. Integer nunc est, pulvinar ac tempor ac, pretium} ut odio. 19 |

      20 |

      21 | Pellentesque in arcu sit amet odio scelerisque tincidunt. Lorem ipsum 22 | dolor sit amet, consectetur adipiscing elit. Pellentesque habitant morbi 23 | tristique senectus et netus et malesuada fames ac turpis egestas. 24 |

      25 |
      26 | -------------------------------------------------------------------------------- /tests/backup/toggle-wrapper-1/output/selection-single.html: -------------------------------------------------------------------------------- 1 | 4 |
      5 |

      6 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas 7 | convallis dui id erat pellentesque et rhoncus nunc semper. Suspendisse 8 | malesuada hendrerit velit nec tristique. Aliquam gravida mauris at 9 | ligula venenatis rhoncus. Suspendisse interdum, nisi nec consectetur 10 | pulvinar, lorem augue ornare felis, vel lacinia erat nibh in velit. 11 |

      12 |

      13 | Hendrerit, felis ac fringilla lobortis, massa ligula aliquet justo, sit 14 | amet tincidunt enim quam sollicitudin nisi. Maecenas ipsum augue, 15 | commodo sit amet aliquet ut, laoreet ut nunc. Vestibulum ante ipsum 16 | primis in faucibus orci luctus et ultrices posuere cubilia Curae; 17 | Pellentesque tincidunt eros quis tellus laoreet ac dignissim turpis 18 | luctus. Integer nunc est, pulvinar ac tempor ac, pretium ut odio. 19 |

      20 |

      21 | Pellentesque in arcu sit amet odio scelerisque tincidunt. Lorem ipsum 22 | dolor sit amet, consectetur adipiscing elit. Pellentesque habitant morbi 23 | tristique senectus et netus et malesuada fames ac turpis egestas. 24 |

      25 |
      26 | -------------------------------------------------------------------------------- /tests/templates/selection-single-start-to-end-e.html: -------------------------------------------------------------------------------- 1 | 4 |
      5 |

      6 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas 7 | convallis dui id erat pellentesque et rhoncus nunc semper. Suspendisse 8 | malesuada hendrerit velit nec tristique. Aliquam gravida mauris at 9 | ligula venenatis rhoncus. Suspendisse interdum, nisi nec consectetur 10 | pulvinar, lorem augue ornare felis, vel lacinia erat nibh in velit. 11 |

      12 |

      13 | Hendrerit, felis ac fringilla lobortis, massa ligula aliquet justo, sit 14 | amet tincidunt enim quam sollicitudin nisi. Maecenas ipsum augue, 15 | commodo sit amet aliquet ut, laoreet ut nunc. Vestibulum ante ipsum 16 | primis in faucibus orci luctus et ultrices posuere cubilia Curae; 17 | Pellentesque tincidunt eros quis tellus laoreet ac dignissim turpis 18 | luctus. Integer nunc est, pulvinar ac tempor ac, pretium ut odio. 19 |

      20 |

      { 21 | Pellentesque in arcu sit amet odio scelerisque tincidunt. Lorem ipsum 22 | dolor sit amet, consectetur adipiscing elit. Pellentesque habitant morbi 23 | tristique senectus et netus et malesuada fames ac turpis egestas. 24 | }

      25 |
      26 | -------------------------------------------------------------------------------- /tests/templates/selection-single-start-to-end-p.html: -------------------------------------------------------------------------------- 1 | 4 |
      5 |

      6 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas 7 | convallis dui id erat pellentesque et rhoncus nunc semper. Suspendisse 8 | malesuada hendrerit velit nec tristique. Aliquam gravida mauris at 9 | ligula venenatis rhoncus. Suspendisse interdum, nisi nec consectetur 10 | pulvinar, lorem augue ornare felis, vel lacinia erat nibh in velit. 11 |

      12 |

      13 | Hendrerit, felis ac fringilla lobortis, massa ligula aliquet justo, sit 14 | amet tincidunt enim quam sollicitudin nisi. Maecenas ipsum augue, 15 | commodo sit amet aliquet ut, laoreet ut nunc. Vestibulum ante ipsum 16 | primis in faucibus orci luctus et ultrices posuere cubilia Curae; 17 | Pellentesque tincidunt eros quis tellus laoreet ac dignissim turpis 18 | luctus. Integer nunc est, pulvinar ac tempor ac, pretium ut odio. 19 |

      20 |

      21 | {Pellentesque in arcu sit amet odio scelerisque tincidunt. Lorem ipsum 22 | dolor sit amet, consectetur adipiscing elit. Pellentesque habitant morbi 23 | tristique senectus et netus et malesuada fames ac turpis egestas.} 24 |

      25 |
      26 | -------------------------------------------------------------------------------- /tests/backup/toggle-wrapper-1/output/selection-single-group.html: -------------------------------------------------------------------------------- 1 | 4 |
      5 |

      6 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas 7 | convallis dui id erat pellentesque et rhoncus nunc semper. Suspendisse 8 | malesuada hendrerit velit nec tristique. Aliquam gravida mauris at 9 | ligula venenatis rhoncus. Suspendisse interdum, nisi nec consectetur 10 | pulvinar, lorem augue ornare felis, vel lacinia erat nibh in velit. 11 |

      12 |

      13 | Hendrerit, felis ac fringilla lobortis, massa ligula aliquet justo, sit 14 | amet tincidunt enim quam sollicitudin nisi. Maecenas ipsum augue, 15 | commodo sit amet aliquet ut, laoreet ut nunc. Vestibulum ante ipsum 16 | primis in faucibus orci luctus et ultrices posuere cubilia Curae; 17 | Pellentesque tincidunt eros quis tellus laoreet ac dignissim turpis 18 | luctus. Integer nunc est, pulvinar ac tempor ac, pretium ut odio. 19 |

      20 |

      21 | Pellentesque in arcu sit amet odio scelerisque tincidunt. Lorem ipsum 22 | dolor sit amet, consectetur adipiscing elit. Pellentesque habitant morbi 23 | tristique senectus et netus et malesuada fames ac turpis egestas. 24 |

      25 |
      26 | -------------------------------------------------------------------------------- /tests/backup/toggle-wrapper-1/output/selection-single-part.html: -------------------------------------------------------------------------------- 1 | 4 |
      5 |

      6 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas 7 | convallis dui id erat pellentesque et rhoncus nunc semper. Suspendisse 8 | malesuada hendrerit velit nec tristique. Aliquam gravida mauris at 9 | ligula venenatis rhoncus. Suspendisse interdum, nisi nec consectetur 10 | pulvinar, lorem augue ornare felis, vel lacinia erat nibh in velit. 11 |

      12 |

      13 | Hendrerit, felis ac fringilla lobortis, massa ligula aliquet justo, sit 14 | amet tincidunt enim quam sollicitudin nisi. Maecenas ipsum augue, 15 | commodo sit amet aliquet ut, laoreet ut nunc. Vestibulum ante ipsum 16 | primis in faucibus orci luctus et ultrices posuere cubilia Curae; 17 | Pellentesque tincidunt eros quis tellus laoreet ac dignissim turpis 18 | luctus. Integer nunc est, pulvinar ac tempor ac, pretium ut odio. 19 |

      20 |

      21 | Pellentesque in arcu sit amet odio scelerisque tincidunt. Lorem ipsum 22 | dolor sit amet, consectetur adipiscing elit. Pellentesque habitant morbi 23 | tristique senectus et netus et malesuada fames ac turpis egestas. 24 |

      25 |
      26 | -------------------------------------------------------------------------------- /src/components/ui/toggle-button.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileOverview Contains the core button class code. 3 | * @license http://www.raptor-editor.com/license 4 | * 5 | * @author David Neilsen 6 | * @author Michael Robinson 7 | * @author Melissa Richards 8 | */ 9 | 10 | /** 11 | * The toggle button class. 12 | * 13 | * @constructor 14 | * @augments Button 15 | * 16 | * @param {Object} options 17 | */ 18 | function ToggleButton(options) { 19 | this.disable = false; 20 | Button.call(this, options); 21 | } 22 | 23 | ToggleButton.prototype = Object.create(Button.prototype); 24 | 25 | /** 26 | * Initialize the toggle button. 27 | * 28 | * @returns {Element} 29 | */ 30 | ToggleButton.prototype.init = function() { 31 | this.raptor.bind('selectionChange', this.selectionChange.bind(this)); 32 | return Button.prototype.init.apply(this, arguments); 33 | }; 34 | 35 | /** 36 | * Changes the state of the button depending on whether it is active or not. 37 | */ 38 | ToggleButton.prototype.selectionChange = function() { 39 | if (this.selectionToggle()) { 40 | aButtonActive(this.button); 41 | if (this.disable) { 42 | aButtonEnable(this.button); 43 | } 44 | } else { 45 | aButtonInactive(this.button); 46 | if (this.disable) { 47 | aButtonDisable(this.button); 48 | } 49 | } 50 | }; 51 | -------------------------------------------------------------------------------- /tests/js/reorder-attributes.js: -------------------------------------------------------------------------------- 1 | // http://stackoverflow.com/questions/13752904/sort-html-attributes-with-javascript 2 | // http://stackoverflow.com/questions/979256/how-to-sort-an-array-of-javascript-objects 3 | function sortAttributesBy(field, reverse, primer) { 4 | var key = function(x) { 5 | return primer ? primer(x[field]) : x[field]; 6 | }; 7 | 8 | return function(a, b) { 9 | var A = key(a), 10 | B = key(b); 11 | return ((A < B) ? -1 : (A > B) ? +1 : 0) * [-1, 1][+ !! reverse]; 12 | } 13 | }; 14 | 15 | function sortAttributes(elements) { 16 | for (var j = 0; j < elements.length; j++) { 17 | var attributes = []; 18 | for (var i = 0; i < elements[j].attributes.length; i++) { 19 | attributes.push({ 20 | name: elements[j].attributes[i].name, 21 | value: elements[j].attributes[i].value 22 | }); 23 | } 24 | 25 | var sortedAttributes = attributes.sort(sortAttributesBy('name', true, function(a) { 26 | return a.toUpperCase(); 27 | })); 28 | 29 | for (var i = 0; i < sortedAttributes.length; i++) { 30 | $(elements[j]).removeAttr(sortedAttributes[i]['name']); 31 | } 32 | 33 | for (var i = 0; i < sortedAttributes.length; i++) { 34 | $(elements[j]).attr(sortedAttributes[i]['name'], sortedAttributes[i]['value']); 35 | } 36 | } 37 | }; 38 | -------------------------------------------------------------------------------- /tests/backup/toggle-wrapper-1/output/selection-single-multiline.html: -------------------------------------------------------------------------------- 1 | 4 |
      5 |

      6 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas 7 | convallis dui id erat pellentesque et rhoncus nunc semper. Suspendisse 8 | malesuada hendrerit velit nec tristique. Aliquam gravida mauris at 9 | ligula venenatis rhoncus. Suspendisse interdum, nisi nec consectetur 10 | pulvinar, lorem augue ornare felis, vel lacinia erat nibh in velit. 11 |

      12 |

      13 | Hendrerit, felis ac fringilla lobortis, massa ligula aliquet justo, sit 14 | amet tincidunt enim quam sollicitudin nisi. Maecenas ipsum augue, 15 | commodo sit amet aliquet ut, laoreet ut nunc. Vestibulum ante ipsum 16 | primis in faucibus orci luctus et ultrices posuere cubilia Curae; 17 | Pellentesque tincidunt eros quis tellus laoreet ac dignissim turpis 18 | luctus. Integer nunc est, pulvinar ac tempor ac, pretium ut odio. 19 |

      20 |

      21 | Pellentesque in arcu sit amet odio scelerisque tincidunt. Lorem ipsum 22 | dolor sit amet, consectetur adipiscing elit. Pellentesque habitant morbi 23 | tristique senectus et netus et malesuada fames ac turpis egestas. 24 |

      25 |
      26 | -------------------------------------------------------------------------------- /tests/backup/toggle-wrapper-1/output/selection-single-start-to-end-e.html: -------------------------------------------------------------------------------- 1 | 4 |
      5 |

      6 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas 7 | convallis dui id erat pellentesque et rhoncus nunc semper. Suspendisse 8 | malesuada hendrerit velit nec tristique. Aliquam gravida mauris at 9 | ligula venenatis rhoncus. Suspendisse interdum, nisi nec consectetur 10 | pulvinar, lorem augue ornare felis, vel lacinia erat nibh in velit. 11 |

      12 |

      13 | Hendrerit, felis ac fringilla lobortis, massa ligula aliquet justo, sit 14 | amet tincidunt enim quam sollicitudin nisi. Maecenas ipsum augue, 15 | commodo sit amet aliquet ut, laoreet ut nunc. Vestibulum ante ipsum 16 | primis in faucibus orci luctus et ultrices posuere cubilia Curae; 17 | Pellentesque tincidunt eros quis tellus laoreet ac dignissim turpis 18 | luctus. Integer nunc est, pulvinar ac tempor ac, pretium ut odio. 19 |

      20 |

      21 | Pellentesque in arcu sit amet odio scelerisque tincidunt. Lorem ipsum 22 | dolor sit amet, consectetur adipiscing elit. Pellentesque habitant morbi 23 | tristique senectus et netus et malesuada fames ac turpis egestas. 24 |

      25 |
      26 | -------------------------------------------------------------------------------- /tests/backup/toggle-wrapper-1/output/selection-single-start-to-end-p.html: -------------------------------------------------------------------------------- 1 | 4 |
      5 |

      6 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas 7 | convallis dui id erat pellentesque et rhoncus nunc semper. Suspendisse 8 | malesuada hendrerit velit nec tristique. Aliquam gravida mauris at 9 | ligula venenatis rhoncus. Suspendisse interdum, nisi nec consectetur 10 | pulvinar, lorem augue ornare felis, vel lacinia erat nibh in velit. 11 |

      12 |

      13 | Hendrerit, felis ac fringilla lobortis, massa ligula aliquet justo, sit 14 | amet tincidunt enim quam sollicitudin nisi. Maecenas ipsum augue, 15 | commodo sit amet aliquet ut, laoreet ut nunc. Vestibulum ante ipsum 16 | primis in faucibus orci luctus et ultrices posuere cubilia Curae; 17 | Pellentesque tincidunt eros quis tellus laoreet ac dignissim turpis 18 | luctus. Integer nunc est, pulvinar ac tempor ac, pretium ut odio. 19 |

      20 |

      21 | Pellentesque in arcu sit amet odio scelerisque tincidunt. Lorem ipsum 22 | dolor sit amet, consectetur adipiscing elit. Pellentesque habitant morbi 23 | tristique senectus et netus et malesuada fames ac turpis egestas. 24 |

      25 |
      26 | -------------------------------------------------------------------------------- /tests/backup/break/input/selection-single-multiblock.html: -------------------------------------------------------------------------------- 1 | 4 |
      5 |
      6 |

      7 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas 8 | convallis {dui id erat pellentesque et rhoncus nunc semper. Suspendisse 9 | malesuada hendrerit velit nec tristique. Aliquam gravida mauris at 10 | ligula venenatis rhoncus. Suspendisse interdum, nisi nec consectetur 11 | pulvinar, lorem augue ornare felis, vel lacinia erat nibh in velit. 12 |

      13 |

      14 | Hendrerit, felis ac fringilla lobortis, massa ligula aliquet justo, sit 15 | amet tincidunt enim quam sollicitudin nisi. Maecenas ipsum augue, 16 | commodo sit amet aliquet ut, laoreet ut nunc. Vestibulum ante ipsum 17 | primis in }faucibus orci luctus et ultrices posuere cubilia Curae; 18 | Pellentesque tincidunt eros quis tellus laoreet ac dignissim turpis 19 | luctus. Integer nunc est, pulvinar ac tempor ac, pretium ut odio. 20 |

      21 |

      22 | Pellentesque in arcu sit amet odio scelerisque tincidunt. Lorem ipsum 23 | dolor sit amet, consectetur adipiscing elit. Pellentesque habitant morbi 24 | tristique senectus et netus et malesuada fames ac turpis egestas. 25 |

      26 |
      27 |
      28 | -------------------------------------------------------------------------------- /tests/backup/break/input/selection-single-multiline.html: -------------------------------------------------------------------------------- 1 | 4 |
      5 |
      6 |

      7 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas 8 | convallis dui id erat pellentesque et rhoncus nunc semper. Suspendisse 9 | malesuada hendrerit velit nec tristique. Aliquam gravida mauris at 10 | ligula venenatis rhoncus. Suspendisse interdum, nisi nec consectetur 11 | pulvinar, lorem augue ornare felis, vel lacinia erat nibh in velit. 12 |

      13 |

      14 | Hendrerit, felis ac fringilla lobortis, massa ligula aliquet justo, sit 15 | amet {}tincidunt enim quam sollicitudin nisi. Maecenas ipsum augue, 16 | commodo sit amet aliquet ut, laoreet ut nunc. Vestibulum ante ipsum 17 | primis in faucibus orci luctus et ultrices posuere cubilia Curae; 18 | Pellentesque tincidunt eros quis tellus laoreet ac dignissim turpis 19 | luctus. Integer nunc est, pulvinar ac tempor ac, pretium ut odio. 20 |

      21 |

      22 | Pellentesque in arcu sit amet odio scelerisque tincidunt. Lorem ipsum 23 | dolor sit amet, consectetur adipiscing elit. Pellentesque habitant morbi 24 | tristique senectus et netus et malesuada fames ac turpis egestas. 25 |

      26 |
      27 |
      28 | -------------------------------------------------------------------------------- /tests/backup/break/input/selection-single-shift-enter.html: -------------------------------------------------------------------------------- 1 | 4 |
      5 |
      6 |

      7 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas 8 | convallis dui id erat pellentesque et rhoncus nunc semper. Suspendisse 9 | malesuada hendrerit velit nec tristique. Aliquam gravida mauris at 10 | ligula venenatis rhoncus. Suspendisse interdum, nisi nec consectetur 11 | pulvinar, lorem augue ornare felis, vel lacinia erat nibh in velit. 12 |

      13 |

      14 | Hendrerit, felis ac fringilla lobortis, massa ligula aliquet justo, sit 15 | amet {}tincidunt enim quam sollicitudin nisi. Maecenas ipsum augue, 16 | commodo sit amet aliquet ut, laoreet ut nunc. Vestibulum ante ipsum 17 | primis in faucibus orci luctus et ultrices posuere cubilia Curae; 18 | Pellentesque tincidunt eros quis tellus laoreet ac dignissim turpis 19 | luctus. Integer nunc est, pulvinar ac tempor ac, pretium ut odio. 20 |

      21 |

      22 | Pellentesque in arcu sit amet odio scelerisque tincidunt. Lorem ipsum 23 | dolor sit amet, consectetur adipiscing elit. Pellentesque habitant morbi 24 | tristique senectus et netus et malesuada fames ac turpis egestas. 25 |

      26 |
      27 |
      28 | -------------------------------------------------------------------------------- /tests/backup/break/output/selection-single-shift-enter.html: -------------------------------------------------------------------------------- 1 | 4 |
      5 |
      6 |

      7 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas 8 | convallis dui id erat pellentesque et rhoncus nunc semper. Suspendisse 9 | malesuada hendrerit velit nec tristique. Aliquam gravida mauris at 10 | ligula venenatis rhoncus. Suspendisse interdum, nisi nec consectetur 11 | pulvinar, lorem augue ornare felis, vel lacinia erat nibh in velit. 12 |

      13 |

      14 | Hendrerit, felis ac fringilla lobortis, massa ligula aliquet justo, sit 15 | amet
      tincidunt enim quam sollicitudin nisi. Maecenas ipsum augue, 16 | commodo sit amet aliquet ut, laoreet ut nunc. Vestibulum ante ipsum 17 | primis in faucibus orci luctus et ultrices posuere cubilia Curae; 18 | Pellentesque tincidunt eros quis tellus laoreet ac dignissim turpis 19 | luctus. Integer nunc est, pulvinar ac tempor ac, pretium ut odio. 20 |

      21 |

      22 | Pellentesque in arcu sit amet odio scelerisque tincidunt. Lorem ipsum 23 | dolor sit amet, consectetur adipiscing elit. Pellentesque habitant morbi 24 | tristique senectus et netus et malesuada fames ac turpis egestas. 25 |

      26 |
      27 |
      28 | -------------------------------------------------------------------------------- /tests/cases/image-resize/cancel-resize.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 11 | 12 |
      13 |

      Cancel Resize Image 1: Cancel resize.

      14 |
      15 |
      16 | raptor logo 17 |
      18 |
      19 |
      20 |
      21 | raptor logo 22 |
      23 |
      24 |
      25 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /tests/backup/break/output/selection-single-multiline.html: -------------------------------------------------------------------------------- 1 | 4 |
      5 |
      6 |

      7 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas 8 | convallis dui id erat pellentesque et rhoncus nunc semper. Suspendisse 9 | malesuada hendrerit velit nec tristique. Aliquam gravida mauris at 10 | ligula venenatis rhoncus. Suspendisse interdum, nisi nec consectetur 11 | pulvinar, lorem augue ornare felis, vel lacinia erat nibh in velit. 12 |

      13 |

      14 | Hendrerit, felis ac fringilla lobortis, massa ligula aliquet justo, sit 15 | amet

      {}tincidunt enim quam sollicitudin nisi. Maecenas ipsum augue, 16 | commodo sit amet aliquet ut, laoreet ut nunc. Vestibulum ante ipsum 17 | primis in faucibus orci luctus et ultrices posuere cubilia Curae; 18 | Pellentesque tincidunt eros quis tellus laoreet ac dignissim turpis 19 | luctus. Integer nunc est, pulvinar ac tempor ac, pretium ut odio. 20 |

      21 |

      22 | Pellentesque in arcu sit amet odio scelerisque tincidunt. Lorem ipsum 23 | dolor sit amet, consectetur adipiscing elit. Pellentesque habitant morbi 24 | tristique senectus et netus et malesuada fames ac turpis egestas. 25 |

      26 |
      27 |
      28 | -------------------------------------------------------------------------------- /tests/backup/break/input/selection-single-link.html: -------------------------------------------------------------------------------- 1 | 4 |
      5 |
      6 |

      7 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas 8 | convallis dui id erat pellentesque et rhoncus nunc semper. Suspendisse 9 | malesuada hendrerit velit nec tristique. Aliquam gravida mauris at 10 | ligula venenatis rhoncus. Suspendisse interdum, nisi nec consectetur 11 | pulvinar, lorem augue ornare felis, vel lacinia erat nibh in velit. 12 |

      13 |

      14 | Hendrerit, felis ac fringilla lobortis, massa ligula aliquet justo, sit 15 | amet google.{}comtincidunt enim quam sollicitudin nisi. Maecenas ipsum augue, 16 | commodo sit amet aliquet ut, laoreet ut nunc. Vestibulum ante ipsum 17 | primis in faucibus orci luctus et ultrices posuere cubilia Curae; 18 | Pellentesque tincidunt eros quis tellus laoreet ac dignissim turpis 19 | luctus. Integer nunc est, pulvinar ac tempor ac, pretium ut odio. 20 |

      21 |

      22 | Pellentesque in arcu sit amet odio scelerisque tincidunt. Lorem ipsum 23 | dolor sit amet, consectetur adipiscing elit. Pellentesque habitant morbi 24 | tristique senectus et netus et malesuada fames ac turpis egestas. 25 |

      26 |
      27 |
      28 | -------------------------------------------------------------------------------- /src/tools/persist.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileOverview Storage helper functions. 3 | * @license http://www.raptor-editor.com/license 4 | * 5 | * @author David Neilsen david@panmedia.co.nz 6 | * @author Michael Robinson michael@panmedia.co.nz 7 | */ 8 | 9 | /** 10 | * Stores key-value data. 11 | * If local storage is already configured, retrieve what is stored and convert it to an array, otherwise create a blank array. 12 | * The value is then set in the array based on the key and the array is saved into local storage. 13 | * @todo desc and type for returns 14 | * @param {type} key The key for the data to be stored at 15 | * @param {type} value The data to be stored at the key. 16 | * @returns {persistSet} ?? 17 | */ 18 | function persistSet(key, value) { 19 | if (localStorage) { 20 | var storage; 21 | if (localStorage.raptor) { 22 | storage = JSON.parse(localStorage.raptor); 23 | } else { 24 | storage = {}; 25 | } 26 | storage[key] = value; 27 | localStorage.raptor = JSON.stringify(storage); 28 | } 29 | } 30 | 31 | /** 32 | * Gets the data stored at the supplied key. 33 | * 34 | * @param {type} key The key to get the stored data from. 35 | * @returns {Object} The data stored at the key. 36 | */ 37 | function persistGet(key) { 38 | if (localStorage) { 39 | var storage; 40 | if (localStorage.raptor) { 41 | storage = JSON.parse(localStorage.raptor); 42 | } else { 43 | storage = {}; 44 | } 45 | return storage[key]; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /tests/backup/break/output/selection-single-link.html: -------------------------------------------------------------------------------- 1 | 4 |
      5 |
      6 |

      7 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas 8 | convallis dui id erat pellentesque et rhoncus nunc semper. Suspendisse 9 | malesuada hendrerit velit nec tristique. Aliquam gravida mauris at 10 | ligula venenatis rhoncus. Suspendisse interdum, nisi nec consectetur 11 | pulvinar, lorem augue ornare felis, vel lacinia erat nibh in velit. 12 |

      13 |

      14 | Hendrerit, felis ac fringilla lobortis, massa ligula aliquet justo, sit 15 | amet google.

      {}comtincidunt enim quam sollicitudin nisi. Maecenas ipsum augue, 16 | commodo sit amet aliquet ut, laoreet ut nunc. Vestibulum ante ipsum 17 | primis in faucibus orci luctus et ultrices posuere cubilia Curae; 18 | Pellentesque tincidunt eros quis tellus laoreet ac dignissim turpis 19 | luctus. Integer nunc est, pulvinar ac tempor ac, pretium ut odio. 20 |

      21 |

      22 | Pellentesque in arcu sit amet odio scelerisque tincidunt. Lorem ipsum 23 | dolor sit amet, consectetur adipiscing elit. Pellentesque habitant morbi 24 | tristique senectus et netus et malesuada fames ac turpis egestas. 25 |

      26 |
      27 |
      28 | -------------------------------------------------------------------------------- /src/components/ui/select-menu.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Select menu UI widget styles 3 | * 4 | * @author David Neilsen 5 | */ 6 | .raptor-selectmenu { 7 | overflow: visible; 8 | position: relative; 9 | } 10 | 11 | .raptor-selectmenu-button { 12 | text-align: left; 13 | padding: 3px 18px 5px 5px !important; 14 | 15 | // Pervent floated buttons breaking menu position 16 | float: none !important; 17 | 18 | .ui-icon { 19 | position: absolute; 20 | right: 1px; 21 | top: 8px; 22 | } 23 | .raptor-selectmenu-text { 24 | font-size: $font-size; 25 | } 26 | } 27 | 28 | .raptor-selectmenu-wrapper { 29 | position: relative; 30 | } 31 | 32 | .raptor-selectmenu-button .ui-button-text { 33 | padding: 0 25px 0 5px; 34 | } 35 | .raptor-selectmenu-button .ui-icon { 36 | background-repeat: no-repeat; 37 | } 38 | 39 | .raptor-selectmenu-menu { 40 | position: absolute; 41 | top: 100%; 42 | left: 0; 43 | right: auto; 44 | display: none; 45 | margin-top: -1px !important; 46 | } 47 | 48 | .raptor-selectmenu-visible .raptor-selectmenu-menu { 49 | display: block; 50 | z-index: 1; 51 | } 52 | 53 | .raptor-selectmenu-menu-item { 54 | padding: 5px; 55 | margin: 3px; 56 | z-index: 1; 57 | text-align: left; 58 | font-size: $font-size; 59 | font-weight: normal !important; 60 | border: 1px solid transparent; 61 | cursor: pointer; 62 | background-color: inherit; 63 | } 64 | 65 | .raptor-selectmenu-button { 66 | background: #f5f5f5; 67 | border: 1px solid #ccc; 68 | } 69 | -------------------------------------------------------------------------------- /tests/cases/links/disable-button.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 23 |
      24 |

      Test remove link button is disabled

      25 |
      26 |
      27 |

      28 | This {is a paragraph}. 29 |

      30 |
      31 |
      32 |
      33 |
      34 |

      35 | This {is a paragraph}. 36 |

      37 |
      38 |
      39 |
      40 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /src/plugins/paste/templates.js: -------------------------------------------------------------------------------- 1 | templateRegister("paste.dialog", ""); -------------------------------------------------------------------------------- /src/components/layout/toolbar.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Toolbar layout. 3 | * 4 | * @author David Neilsen 5 | */ 6 | @import 'compass/css3/box-sizing'; 7 | @import 'compass/css3/user-interface'; 8 | 9 | .raptor-layout-toolbar-outer { 10 | overflow: visible; 11 | position: fixed; 12 | font-size: 12px; 13 | z-index: $z-toolbar; 14 | @include user-select(none); 15 | @include background(linear-gradient(darken(#fff, 3%), darken(#fff, 2%))); 16 | 17 | * { 18 | @include user-select(none); 19 | } 20 | } 21 | 22 | .raptor-layout-toolbar-inner { 23 | border: $border-width $border-style $border-color; 24 | border-top: none; 25 | } 26 | 27 | .raptor-layout-toolbar-toolbar { 28 | padding: 6px 0 0 5px; 29 | overflow: visible; 30 | } 31 | 32 | .raptor-layout-toolbar-path { 33 | padding: $spacing; 34 | } 35 | 36 | .raptor-layout-toolbar-group { 37 | float: left; 38 | margin-right: $spacing; 39 | } 40 | 41 | .raptor-layout-toolbar-group .ui-button { 42 | padding: 0; 43 | margin-top: 0; 44 | margin-left: -1px; 45 | margin-bottom: $spacing; 46 | margin-right: 0; 47 | height: 32px; 48 | float: left; 49 | @include box-sizing(border-box); 50 | } 51 | 52 | .raptor-layout-toolbar-group .ui-button:hover { 53 | z-index: 1; 54 | } 55 | 56 | .raptor-layout-toolbar-group .ui-button-icon-only { 57 | width: 32px; 58 | } 59 | 60 | .raptor-layout-toolbar-group .ui-button-text-only .ui-button-text { 61 | padding: 8px 16px 10px 16px; 62 | } 63 | .raptor-layout-toolbar-group .ui-button-text-icon-primary .ui-button-text { 64 | padding: 8px 16px 10px 32px; 65 | } -------------------------------------------------------------------------------- /tests/cases/dock/dock-to-screen-button.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 11 |
      12 |

      Dock to Screen Button 1: Dock Toolbar to screen

      13 |
      14 |
      15 |

      16 | Some Content. 17 |

      18 |
      19 |
      20 |
      21 |
      22 |

      23 | Some Content. 24 |

      25 |
      26 |
      27 |
      28 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /src/plugins/view-source/view-source.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileOverview Contains the view source dialog code. 3 | * @license http://www.raptor-editor.com/license 4 | * 5 | * @author David Neilsen 6 | * @author Michael Robinson 7 | * @author Melissa Richards 8 | */ 9 | 10 | /** 11 | * Creates an instance of the dialog button to open the view source dialog. 12 | */ 13 | Raptor.registerUi(new DialogButton({ 14 | name: 'viewSource', 15 | dialogOptions: { 16 | width: 600, 17 | height: 400, 18 | minWidth: 400, 19 | minHeight: 400 20 | }, 21 | 22 | /** 23 | * Replace the editing element's content with the HTML from the dialog's textarea 24 | * 25 | * @param {Element} dialog 26 | */ 27 | applyAction: function(dialog) { 28 | var html = dialog.find('textarea').val(); 29 | this.raptor.actionApply(function() { 30 | this.raptor.setHtml(html); 31 | selectionSelectStart(this.raptor.getElement().first()); 32 | this.raptor.checkSelectionChange(); 33 | }.bind(this)); 34 | }, 35 | 36 | /** 37 | * Update the dialog's text area with the current HTML. 38 | */ 39 | openDialog: function() { 40 | var textarea = this.getDialog().find('textarea'); 41 | textarea.val(this.raptor.getHtml()); 42 | DialogButton.prototype.openDialog.call(this); 43 | textarea.select(); 44 | }, 45 | 46 | /** 47 | * @return {Element} 48 | */ 49 | getDialogTemplate: function() { 50 | return $('
      ').html(this.raptor.getTemplate('view-source.dialog', this.options)); 51 | } 52 | })); 53 | -------------------------------------------------------------------------------- /src/plugins/table/templates/create-menu.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 |
      83 | -------------------------------------------------------------------------------- /src/plugins/guides/guides.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileOverview Contains the guides button class code. 3 | * @license http://www.raptor-editor.com/license 4 | * 5 | * @author David Neilsen 6 | * @author Michael Robinson 7 | * @author Melissa Richards 8 | */ 9 | 10 | /** 11 | * Creates an instance of a preview button to show the guides of the elements. 12 | * 13 | * @todo des and type for the param. 14 | * @param {type} param 15 | */ 16 | Raptor.registerUi(new PreviewButton({ 17 | name: 'guides', 18 | 19 | action: function() { 20 | this.raptor.getElement().toggleClass(this.getClassName()); 21 | this.updateButtonState(); 22 | }, 23 | 24 | updateButtonState: function() { 25 | if (this.raptor.getElement().hasClass(this.getClassName())) { 26 | aButtonActive(this.button); 27 | } else { 28 | aButtonInactive(this.button); 29 | } 30 | }, 31 | 32 | init: function() { 33 | this.raptor.bind('cancel', this.removeClass.bind(this)); 34 | this.raptor.bind('saved', this.removeClass.bind(this)); 35 | return PreviewButton.prototype.init.call(this); 36 | }, 37 | 38 | removeClass: function() { 39 | this.raptor.getElement().removeClass(this.getClassName()); 40 | }, 41 | 42 | getClassName: function() { 43 | return this.options.baseClass + '-visible'; 44 | }, 45 | 46 | mouseEnter: function() { 47 | PreviewButton.prototype.mouseEnter.call(this); 48 | this.updateButtonState(); 49 | }, 50 | 51 | mouseLeave: function() { 52 | PreviewButton.prototype.mouseLeave.call(this); 53 | this.updateButtonState(); 54 | } 55 | })); 56 | -------------------------------------------------------------------------------- /scripts/filelist.php: -------------------------------------------------------------------------------- 1 | sizeof($bp)) { 9 | return 1; 10 | } elseif (sizeof($ap) < sizeof($bp)) { 11 | return -1; 12 | } 13 | $i = 0; 14 | while (strcmp($ap[$i], $bp[$i]) === 0) { 15 | $i++; 16 | } 17 | return strcmp($ap[$i], $bp[$i]); 18 | }); 19 | 20 | //$files = glob_recursive(__DIR__ . '/../src/*.js'); 21 | //foreach ($files as $i => $file) { 22 | // $files[$i] = trim(substr(realpath($file), strlen(realpath(__DIR__ . '/../src'))), DIRECTORY_SEPARATOR); 23 | // $files[$i] = str_replace('\\', '/', $files[$i]); 24 | //} 25 | //echo implode(PHP_EOL, $files); 26 | // 27 | //$files = glob_recursive(__DIR__ . '/../src/*.css'); 28 | //foreach ($files as $i => $file) { 29 | // $files[$i] = trim(substr(realpath($file), strlen(realpath(__DIR__ . '/../src'))), DIRECTORY_SEPARATOR); 30 | // $files[$i] = str_replace('\\', '/', $files[$i]); 31 | //} 32 | //echo implode(PHP_EOL, $files); 33 | // 34 | //$files = glob_recursive(__DIR__ . '/../src/*.png'); 35 | //foreach ($files as $i => $file) { 36 | // $files[$i] = trim(substr(realpath($file), strlen(realpath(__DIR__ . '/../src'))), DIRECTORY_SEPARATOR); 37 | // $files[$i] = str_replace('\\', '/', $files[$i]); 38 | //} 39 | //echo implode(PHP_EOL, $files); 40 | 41 | $files = glob_recursive(__DIR__ . '/../src/*.html'); 42 | foreach ($files as $i => $file) { 43 | $files[$i] = trim(substr(realpath($file), strlen(realpath(__DIR__ . '/../src'))), DIRECTORY_SEPARATOR); 44 | $files[$i] = str_replace('\\', '/', $files[$i]); 45 | } 46 | echo implode(PHP_EOL, $files); 47 | -------------------------------------------------------------------------------- /src/plugins/language-menu/language-menu.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Language menu plugin 3 | * 4 | * @author David Neilsen 5 | */ 6 | .raptor-ui-language-menu .ui-icon, 7 | .raptor-ui-language-menu-menu .ui-icon { 8 | background-repeat: no-repeat; 9 | width: 16px; 10 | height: 16px; 11 | } 12 | 13 | .raptor-ui-language-menu .ui-icon { 14 | background-position: 0 3px; 15 | } 16 | 17 | .raptor-ui-language-menu-menu .ui-icon { 18 | float: left; 19 | background-repeat: no-repeat; 20 | background-position: 0 5px; 21 | margin-right: $spacing; 22 | } 23 | 24 | .raptor-ui-language-menu, 25 | .raptor-ui-language-menu-menu { 26 | $flags: 27 | ar ae, 28 | bg bg, 29 | ca ca, 30 | cs cz, 31 | da dk, 32 | de de, 33 | el gr, 34 | en en, 35 | es es, 36 | et ee, 37 | fa ir, 38 | fi fi, 39 | fr fr, 40 | he il, 41 | hi in, 42 | ht ht, 43 | hu hu, 44 | id id, 45 | it it, 46 | ja jp, 47 | ko kr, 48 | lt lt, 49 | lv lv, 50 | ms my, 51 | mww other, 52 | nl nl, 53 | no no, 54 | pl pl, 55 | pt pt, 56 | ro ro, 57 | ru ru, 58 | sk sk, 59 | sl si, 60 | sv se, 61 | th th, 62 | tr tr, 63 | uk ua, 64 | ur pk, 65 | vi vn, 66 | zh-chs cn, 67 | zh-cht cn; 68 | 69 | @each $flag in $flags { 70 | $image: nth($flag, 2); 71 | $flag: nth($flag, 1); 72 | .ui-icon-flag-#{$flag}, 73 | .ui-state-hover .ui-icon-flag-#{$flag} { 74 | background-image: inline-image('#{$image}.png'); 75 | } 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /src/components/ui/css-class-applier-button.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileOverview Contains the CSS class applier button class code. 3 | * @license http://www.raptor-editor.com/license 4 | * 5 | * @author David Neilsen 6 | * @author Michael Robinson 7 | * @author Melissa Richards 8 | */ 9 | 10 | /** 11 | * @class The CSS class applier button. 12 | * 13 | * @constructor 14 | * @augments PreviewToggleButton 15 | * @param {Object} options 16 | */ 17 | function CSSClassApplierButton(options) { 18 | PreviewToggleButton.call(this, options); 19 | } 20 | 21 | CSSClassApplierButton.prototype = Object.create(PreviewToggleButton.prototype); 22 | 23 | /** 24 | * Applies the class from the button to a selection. 25 | */ 26 | CSSClassApplierButton.prototype.action = function() { 27 | selectionExpandToWord(); 28 | this.raptor.selectionConstrain(); 29 | for (var i = 0, l = this.classes.length; i < l; i++) { 30 | var applier = rangy.createCssClassApplier(this.options.cssPrefix + this.classes[i], { 31 | elementTagName: this.tag || 'span' 32 | }); 33 | applier.toggleSelection(); 34 | } 35 | }; 36 | 37 | /** 38 | * Checks whether a class has been applied to a selection. 39 | * 40 | * @returns {Boolean} True if the css has been applied to the selection, false otherwise. 41 | */ 42 | CSSClassApplierButton.prototype.selectionToggle = function() { 43 | for (var i = 0, l = this.classes.length; i < l; i++) { 44 | var applier = rangy.createCssClassApplier(this.options.cssPrefix + this.classes[i], { 45 | elementTagName: this.tag || 'span' 46 | }); 47 | if (!applier.isAppliedToSelection()) { 48 | return false; 49 | } 50 | } 51 | return true; 52 | }; 53 | -------------------------------------------------------------------------------- /src/plugins/paste/templates/dialog.html: -------------------------------------------------------------------------------- 1 |
      2 |
      3 | 9 | 12 | 15 | 18 | 21 |
      22 |
      23 | -------------------------------------------------------------------------------- /scripts/convert-bind.php: -------------------------------------------------------------------------------- 1 | '; 6 | exit; 7 | } 8 | $file = realpath($_SERVER['argv'][1]); 9 | echo 'Reading: ' . $file . PHP_EOL; 10 | 11 | $content = file_get_contents($file); 12 | $offset = 0; 13 | do { 14 | $pos = strpos($content, '}.bind(this)', $offset); 15 | $offset = $pos + 1; 16 | if ($pos !== false) { 17 | $content = substr($content, 0, $pos + 1) . ', this)' . substr($content, $pos + strlen('}.bind(this)')); 18 | $i = $pos; 19 | $code = ''; 20 | $braces = 0; 21 | do { 22 | $char = $content[$i--]; 23 | if ($char == '}') { 24 | $braces++; 25 | } 26 | if ($char == '{') { 27 | $braces--; 28 | } 29 | $code = $char . $code; 30 | } while ($braces > 0); 31 | while ($char != '(') { 32 | $char = $content[$i--]; 33 | $code = $char . $code; 34 | } 35 | while ($char != 'f') { 36 | $char = $content[$i--]; 37 | $code = $char . $code; 38 | } 39 | // echo('-------------------------------------------' . PHP_EOL); 40 | // echo $code . PHP_EOL; 41 | // die(); 42 | $content = substr($content, 0, $i + 1) . '$.proxy(' . substr($content, $i + 1); 43 | // $pos + strlen('$.proxy(') 44 | } 45 | } while ($pos !== false); 46 | $content = preg_replace('/this\.([a-zA-Z0-9.]+)\.bind\(this\)/', '$.proxy(this.$1, this)', $content); 47 | $content = preg_replace('/Raptor\.([a-zA-Z0-9.]+)\.bind\(Raptor\)/', '$.proxy(Raptor.$1, Raptor)', $content); 48 | echo 'Writing: ' . $file . PHP_EOL; 49 | file_put_contents($file, $content); 50 | -------------------------------------------------------------------------------- /src/tools/string.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileOverview String helper functions. 3 | * @license http://www.raptor-editor.com/license 4 | * 5 | * @author David Neilsen david@panmedia.co.nz 6 | * @author Michael Robinson michael@panmedia.co.nz 7 | */ 8 | 9 | /** 10 | * Modification of strip_tags from PHP JS - http://phpjs.org/functions/strip_tags:535. 11 | * @param {string} content HTML containing tags to be stripped 12 | * @param {Array} allowedTags Array of tags that should not be stripped 13 | * @return {string} HTML with all tags not present allowedTags array. 14 | */ 15 | function stringStripTags(content, allowedTags) { 16 | // making sure the allowed arg is a string containing only tags in lowercase () 17 | allowed = []; 18 | for (var allowedTagsIndex = 0; allowedTagsIndex < allowedTags.length; allowedTagsIndex++) { 19 | if (allowedTags[allowedTagsIndex].match(/[a-z][a-z0-9]{0,}/g)) { 20 | allowed.push(allowedTags[allowedTagsIndex]); 21 | } 22 | } 23 | // making sure the allowed arg is a string containing only tags in lowercase () 24 | var tags = /<\/?([a-z][a-z0-9]*)\b[^>]*\/?>/gi, 25 | commentsAndPhpTags = /|<\?(?:php)?[\s\S]*?\?>/gi; 26 | 27 | return content.replace(commentsAndPhpTags, '').replace(tags, function ($0, $1) { 28 | return allowed.indexOf($1.toLowerCase()) > -1 ? $0 : ''; 29 | }); 30 | } 31 | 32 | /** 33 | * Checks if an html string is empty. 34 | * 35 | * @param {Element} element The element to be checked. 36 | * @returns {Element} 37 | */ 38 | function stringHtmlStringIsEmpty(html) { 39 | // 40 | if (!typeIsString(html)) { 41 | handleInvalidArgumentError('Parameter 1 to stringHtmlStringIsEmpty must be a string', html); 42 | return; 43 | } 44 | // 45 | return $($.parseHTML(html)).is(':empty'); 46 | } 47 | -------------------------------------------------------------------------------- /src/plugins/no-break/no-break.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileOverview No break plugin. 3 | * @license http://www.raptor-editor.com/license 4 | * 5 | * @author David Neilsen david@panmedia.co.nz 6 | */ 7 | 8 | function NoBreakPlugin(name, overrides) { 9 | RaptorPlugin.call(this, name || 'noBreak', overrides); 10 | } 11 | 12 | NoBreakPlugin.prototype = Object.create(RaptorPlugin.prototype); 13 | 14 | NoBreakPlugin.prototype.init = function() { 15 | this.raptor.getElement().on('keypress.raptor', this.preventReturn.bind(this)); 16 | this.raptor.getElement().on('drop.raptor', this.preventDrop.bind(this)); 17 | }; 18 | 19 | NoBreakPlugin.prototype.preventReturn = function(event) { 20 | if (this.options.enabled && event.which === 13) { 21 | return false; 22 | } 23 | }; 24 | 25 | NoBreakPlugin.prototype.preventDrop = function(event) { 26 | return this.options.enabled; 27 | // Attempt to allow dropping of plain text (not working) 28 | // 29 | // console.log(event.originalEvent); 30 | // var range = rangy.getSelection().getRangeAt(0).cloneRange(); 31 | // console.log(range); 32 | // console.log(range.startOffset); 33 | // console.log(range.endOffset); 34 | // for (var i = 0, l = event.originalEvent.dataTransfer.items.length; i < l; i++) { 35 | // console.log(event.originalEvent); 36 | // if (event.originalEvent.dataTransfer.items[i].type == 'text/plain' && 37 | // event.originalEvent.dataTransfer.items[i].kind == 'string') { 38 | // event.originalEvent.dataTransfer.items[i].getAsString(function(content) { 39 | // this.raptor.actionApply(function() { 40 | // rangeReplace(range, content); 41 | //// selectionReplace(content); 42 | // }) 43 | // }.bind(this)); 44 | // } 45 | // } 46 | // return false; 47 | }; 48 | 49 | Raptor.registerPlugin(new NoBreakPlugin()); 50 | -------------------------------------------------------------------------------- /src/plugins/image-resize/image-resize.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Image resize button. 3 | * 4 | * @author David Neilsen 5 | */ 6 | .raptor-ui-image-resize { 7 | @include button-icon('image-resize.png'); 8 | } 9 | 10 | .raptor-resize-image { 11 | position: relative; 12 | min-width: 300px; 13 | .form-text { 14 | width: 40%; 15 | } 16 | label { 17 | width: 35%; 18 | display: inline-block; 19 | } 20 | .form-text, label { 21 | @include box-sizing(border-box); 22 | } 23 | div { 24 | margin-bottom: 1.25em; 25 | z-index: 10; 26 | position: relative; 27 | } 28 | .raptor-ui-image-resize-lock-proportions-container { 29 | position: absolute; 30 | z-index: 0; 31 | } 32 | } 33 | 34 | .raptor-ui-image-resize-lock-proportions-container { 35 | right: 16%; 36 | top: 19px; 37 | height: 54px; 38 | width: 40%; 39 | border: { 40 | color: #ccc; 41 | width: 1px 1px 1px 0; 42 | style: solid solid solid none; 43 | } 44 | } 45 | 46 | .raptor-ui-image-resize-lock-proportions { 47 | $lock-size: 26px; 48 | 49 | position: absolute; 50 | right: -21px; 51 | top: 50%; 52 | margin-top: -21px; 53 | height: $lock-size; 54 | width: $lock-size; 55 | border: 8px solid #ddd; 56 | @include border-radius($lock-size * 1.5); 57 | @include box-shadow(0 0 0 1px #fff inset); 58 | @include background(linear-gradient(darken(#f7f7f7, 5%), lighten(#f7f7f7, 5%))); 59 | 60 | .ui-button-text { 61 | display: none; 62 | } 63 | 64 | .ui-icon { 65 | margin-left: -8px; 66 | margin-top: -8px; 67 | left: 50%; 68 | top: 50%; 69 | position: absolute; 70 | background-repeat: no-repeat; 71 | } 72 | 73 | &.ui-state-hover { 74 | cursor: pointer; 75 | border-width: 8px; 76 | } 77 | } 78 | 79 | --------------------------------------------------------------------------------