├── .eslintignore ├── js └── tinymce │ ├── skins │ └── lightgray │ │ ├── Radio.less │ │ ├── Spacer.less │ │ ├── fonts │ │ ├── readme.md │ │ ├── tinymce.eot │ │ ├── tinymce.ttf │ │ ├── tinymce.woff │ │ ├── tinymce-small.eot │ │ ├── tinymce-small.ttf │ │ └── tinymce-small.woff │ │ ├── StackLayout.less │ │ ├── img │ │ ├── anchor.gif │ │ ├── loader.gif │ │ ├── object.gif │ │ └── trans.gif │ │ ├── Content.Inline.less │ │ ├── Iframe.less │ │ ├── ColorBox.less │ │ ├── SelectBox.less │ │ ├── FitLayout.less │ │ ├── Animations.less │ │ ├── Container.less │ │ ├── Panel.less │ │ ├── FieldSet.less │ │ ├── AbsoluteLayout.less │ │ ├── ResizeHandle.less │ │ ├── Throbber.less │ │ ├── ImagePanel.less │ │ ├── ListBox.less │ │ ├── Content.less │ │ ├── Label.less │ │ ├── Slider.less │ │ ├── MenuButton.less │ │ ├── Progress.less │ │ ├── MenuBar.less │ │ ├── Path.less │ │ ├── FlowLayout.less │ │ ├── Scrollable.less │ │ ├── TabPanel.less │ │ ├── ComboBox.less │ │ ├── Menu.less │ │ ├── Reset.less │ │ ├── TextBox.less │ │ ├── SplitButton.less │ │ ├── Checkbox.less │ │ ├── CropRect.less │ │ ├── InfoBox.less │ │ ├── ColorButton.less │ │ ├── FloatPanel.less │ │ ├── ButtonGroup.less │ │ └── Mixins.less │ ├── themes │ └── inlite │ │ ├── config │ │ ├── bolt │ │ │ ├── atomic.js │ │ │ ├── prod.js │ │ │ ├── demo.js │ │ │ └── browser.js │ │ └── dent │ │ │ └── depend.js │ │ └── src │ │ ├── test │ │ ├── .eslintrc │ │ └── js │ │ │ ├── atomic │ │ │ ├── alien │ │ │ │ ├── ArrTest.js │ │ │ │ └── UuidTest.js │ │ │ └── core │ │ │ │ ├── ConvertTest.js │ │ │ │ ├── MatcherTest.js │ │ │ │ └── UrlTypeTest.js │ │ │ └── browser │ │ │ ├── core │ │ │ └── PredicateIdTest.js │ │ │ ├── file │ │ │ ├── ConversionsTest.js │ │ │ └── SelectionMatcher.js │ │ │ └── alien │ │ │ └── UnlinkTest.js │ │ ├── demo │ │ ├── css │ │ │ └── demo.css │ │ └── js │ │ │ └── tinymce │ │ │ └── inlite │ │ │ └── Demo.js │ │ └── main │ │ └── js │ │ └── tinymce │ │ └── inlite │ │ ├── alien │ │ ├── Arr.js │ │ └── Uuid.js │ │ ├── core │ │ ├── UrlType.js │ │ ├── PredicateId.js │ │ ├── Convert.js │ │ ├── Matcher.js │ │ ├── SkinLoader.js │ │ ├── ElementMatcher.js │ │ ├── SelectionMatcher.js │ │ └── Measure.js │ │ └── file │ │ ├── Conversions.js │ │ └── Picker.js │ ├── plugins │ ├── compat3x │ │ └── img │ │ │ ├── icons.gif │ │ │ ├── items.gif │ │ │ ├── tabs.gif │ │ │ ├── buttons.png │ │ │ ├── progress.gif │ │ │ ├── menu_arrow.gif │ │ │ └── menu_check.gif │ ├── media │ │ └── moxieplayer.swf │ ├── visualblocks │ │ └── img │ │ │ ├── dl.gif │ │ │ ├── h1.gif │ │ │ ├── h2.gif │ │ │ ├── h3.gif │ │ │ ├── h4.gif │ │ │ ├── h5.gif │ │ │ ├── h6.gif │ │ │ ├── ol.gif │ │ │ ├── p.gif │ │ │ ├── ul.gif │ │ │ ├── div.gif │ │ │ ├── pre.gif │ │ │ ├── address.gif │ │ │ ├── article.gif │ │ │ ├── aside.gif │ │ │ ├── figure.gif │ │ │ ├── hgroup.gif │ │ │ ├── section.gif │ │ │ └── blockquote.gif │ ├── emoticons │ │ ├── img │ │ │ ├── smiley-cry.gif │ │ │ ├── smiley-cool.gif │ │ │ ├── smiley-frown.gif │ │ │ ├── smiley-kiss.gif │ │ │ ├── smiley-smile.gif │ │ │ ├── smiley-wink.gif │ │ │ ├── smiley-yell.gif │ │ │ ├── smiley-innocent.gif │ │ │ ├── smiley-laughing.gif │ │ │ ├── smiley-sealed.gif │ │ │ ├── smiley-embarassed.gif │ │ │ ├── smiley-surprised.gif │ │ │ ├── smiley-tongue-out.gif │ │ │ ├── smiley-undecided.gif │ │ │ ├── smiley-foot-in-mouth.gif │ │ │ └── smiley-money-mouth.gif │ │ └── plugin.js │ ├── imagetools │ │ ├── config │ │ │ └── bolt │ │ │ │ ├── atomic.js │ │ │ │ ├── browser.js │ │ │ │ ├── demo.js │ │ │ │ └── prod.js │ │ └── src │ │ │ ├── demo │ │ │ └── html │ │ │ │ └── demo.html │ │ │ └── main │ │ │ └── js │ │ │ ├── UndoStack.js │ │ │ ├── ImageSize.js │ │ │ └── Utils.js │ ├── example │ │ ├── dialog.html │ │ └── plugin.js │ ├── print │ │ └── plugin.js │ ├── hr │ │ └── plugin.js │ ├── codesample │ │ └── classes │ │ │ └── Utils.js │ ├── example_dependency │ │ └── plugin.js │ ├── nonbreaking │ │ └── plugin.js │ ├── anchor │ │ └── plugin.js │ ├── table │ │ └── classes │ │ │ └── Utils.js │ ├── directionality │ │ └── plugin.js │ ├── code │ │ └── plugin.js │ └── wordcount │ │ └── plugin.js │ ├── langs │ └── readme.md │ └── classes │ ├── dom │ ├── Sizzle.jQuery.js │ ├── NodePath.js │ └── Dimensions.js │ ├── ui │ ├── Radio.js │ ├── MenuBar.js │ ├── StackLayout.js │ ├── Spacer.js │ ├── FlowLayout.js │ ├── Toolbar.js │ ├── FitLayout.js │ ├── FormItem.js │ ├── FieldSet.js │ ├── Panel.js │ ├── ButtonGroup.js │ ├── ColorBox.js │ ├── AbsoluteLayout.js │ ├── Resizable.js │ ├── Tooltip.js │ ├── Progress.js │ ├── ResizeHandle.js │ └── ElementPath.js │ ├── text │ └── Zwsp.js │ ├── Register.js │ ├── util │ ├── Uuid.js │ ├── JSONP.js │ ├── VK.js │ └── Fun.js │ ├── fmt │ └── Hooks.js │ ├── file │ ├── UploadStatus.js │ └── BlobCache.js │ ├── data │ └── Binding.js │ └── LegacyInput.js ├── tests ├── tinymce │ ├── util │ │ ├── json_rpc_ok.js │ │ ├── test.xml │ │ ├── json_rpc_error.js │ │ ├── Tools.js │ │ ├── Promise.js │ │ ├── XHR.js │ │ ├── JSON.js │ │ ├── Observable.js │ │ ├── Color.js │ │ ├── JSONRequest.js │ │ ├── Fun.js │ │ └── I18n.js │ ├── ui │ │ ├── img │ │ │ └── raster.gif │ │ ├── css │ │ │ └── ui-overrides.css │ │ ├── AbsoluteLayout.js │ │ ├── TextBox.js │ │ ├── Panel.js │ │ └── FitLayout.js │ ├── text │ │ ├── ExtendingChar.js │ │ └── Zwsp.js │ ├── file │ │ ├── Conversions.js │ │ ├── UploadStatus.js │ │ └── ImageScanner.js │ ├── caret │ │ └── LineUtils.js │ ├── WindowManager.js │ ├── dom │ │ ├── NodePath.js │ │ └── Dimensions.js │ ├── data │ │ └── ObservableObject.js │ ├── InsertList.js │ ├── html │ │ └── Serializer.js │ ├── AddOnManager.js │ └── fmt │ │ └── Hooks.js ├── manual │ ├── css │ │ ├── gecko_caret.css │ │ ├── custom_theme_content.css │ │ ├── noneditable_manual.css │ │ ├── development.css │ │ └── content_editable.css │ ├── img │ │ └── dogleft.jpg │ ├── tests.js │ ├── jquery.html │ ├── dirty.html │ └── index.html ├── .eslintrc ├── js │ ├── tinymce_loader.js │ ├── module_loader.js │ └── qunit │ │ └── QUnit.LICENSE ├── coverage │ ├── js │ │ └── reporter.js │ └── index.html ├── plugins │ ├── jquery_initialization.js │ ├── noneditable.js │ └── charmap.js └── .jshintrc ├── .travis.yml ├── .editorconfig ├── .gitattributes ├── tools ├── docs │ ├── tinymce.ProgressStateEvent.js │ ├── tinymce.CommandEvent.js │ ├── tinymce.FocusEvent.js │ ├── tinymce.ResizeEvent.js │ ├── tinymce.ContentEvent.js │ └── tinymce.Event.js └── tasks │ ├── amdlc.js │ └── bundle.js ├── .gitignore ├── package.json └── .eslintrc /.eslintignore: -------------------------------------------------------------------------------- 1 | **/bolt/*.js 2 | -------------------------------------------------------------------------------- /js/tinymce/skins/lightgray/Radio.less: -------------------------------------------------------------------------------- 1 | // Radio - not implemented yet 2 | -------------------------------------------------------------------------------- /tests/tinymce/util/json_rpc_ok.js: -------------------------------------------------------------------------------- 1 | {"result": "Hello JSON-RPC", "error": null, "id": 1} -------------------------------------------------------------------------------- /tests/manual/css/gecko_caret.css: -------------------------------------------------------------------------------- 1 | *[contentEditable]:focus { 2 | outline: 1px solid red; 3 | } -------------------------------------------------------------------------------- /tests/tinymce/util/test.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tes/tinymce/master/tests/tinymce/util/test.xml -------------------------------------------------------------------------------- /tests/manual/img/dogleft.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tes/tinymce/master/tests/manual/img/dogleft.jpg -------------------------------------------------------------------------------- /js/tinymce/skins/lightgray/Spacer.less: -------------------------------------------------------------------------------- 1 | // Spacer 2 | 3 | .@{prefix}-spacer { 4 | visibility: hidden; 5 | } 6 | -------------------------------------------------------------------------------- /js/tinymce/skins/lightgray/fonts/readme.md: -------------------------------------------------------------------------------- 1 | Icons are generated and provided by the http://icomoon.io service. 2 | -------------------------------------------------------------------------------- /tests/tinymce/ui/img/raster.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tes/tinymce/master/tests/tinymce/ui/img/raster.gif -------------------------------------------------------------------------------- /tests/tinymce/util/json_rpc_error.js: -------------------------------------------------------------------------------- 1 | {"result": null, "error": {"message":"General failure","code":42}, "id": 1} -------------------------------------------------------------------------------- /js/tinymce/themes/inlite/config/bolt/atomic.js: -------------------------------------------------------------------------------- 1 | configure({ 2 | configs: [ 3 | './prod.js' 4 | ] 5 | }); 6 | -------------------------------------------------------------------------------- /js/tinymce/plugins/compat3x/img/icons.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tes/tinymce/master/js/tinymce/plugins/compat3x/img/icons.gif -------------------------------------------------------------------------------- /js/tinymce/plugins/compat3x/img/items.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tes/tinymce/master/js/tinymce/plugins/compat3x/img/items.gif -------------------------------------------------------------------------------- /js/tinymce/plugins/compat3x/img/tabs.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tes/tinymce/master/js/tinymce/plugins/compat3x/img/tabs.gif -------------------------------------------------------------------------------- /js/tinymce/plugins/media/moxieplayer.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tes/tinymce/master/js/tinymce/plugins/media/moxieplayer.swf -------------------------------------------------------------------------------- /js/tinymce/plugins/visualblocks/img/dl.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tes/tinymce/master/js/tinymce/plugins/visualblocks/img/dl.gif -------------------------------------------------------------------------------- /js/tinymce/plugins/visualblocks/img/h1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tes/tinymce/master/js/tinymce/plugins/visualblocks/img/h1.gif -------------------------------------------------------------------------------- /js/tinymce/plugins/visualblocks/img/h2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tes/tinymce/master/js/tinymce/plugins/visualblocks/img/h2.gif -------------------------------------------------------------------------------- /js/tinymce/plugins/visualblocks/img/h3.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tes/tinymce/master/js/tinymce/plugins/visualblocks/img/h3.gif -------------------------------------------------------------------------------- /js/tinymce/plugins/visualblocks/img/h4.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tes/tinymce/master/js/tinymce/plugins/visualblocks/img/h4.gif -------------------------------------------------------------------------------- /js/tinymce/plugins/visualblocks/img/h5.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tes/tinymce/master/js/tinymce/plugins/visualblocks/img/h5.gif -------------------------------------------------------------------------------- /js/tinymce/plugins/visualblocks/img/h6.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tes/tinymce/master/js/tinymce/plugins/visualblocks/img/h6.gif -------------------------------------------------------------------------------- /js/tinymce/plugins/visualblocks/img/ol.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tes/tinymce/master/js/tinymce/plugins/visualblocks/img/ol.gif -------------------------------------------------------------------------------- /js/tinymce/plugins/visualblocks/img/p.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tes/tinymce/master/js/tinymce/plugins/visualblocks/img/p.gif -------------------------------------------------------------------------------- /js/tinymce/plugins/visualblocks/img/ul.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tes/tinymce/master/js/tinymce/plugins/visualblocks/img/ul.gif -------------------------------------------------------------------------------- /js/tinymce/skins/lightgray/StackLayout.less: -------------------------------------------------------------------------------- 1 | // StackLayout 2 | 3 | .@{prefix}-stack-layout-item { 4 | display: block; 5 | } 6 | -------------------------------------------------------------------------------- /js/tinymce/skins/lightgray/img/anchor.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tes/tinymce/master/js/tinymce/skins/lightgray/img/anchor.gif -------------------------------------------------------------------------------- /js/tinymce/skins/lightgray/img/loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tes/tinymce/master/js/tinymce/skins/lightgray/img/loader.gif -------------------------------------------------------------------------------- /js/tinymce/skins/lightgray/img/object.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tes/tinymce/master/js/tinymce/skins/lightgray/img/object.gif -------------------------------------------------------------------------------- /js/tinymce/skins/lightgray/img/trans.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tes/tinymce/master/js/tinymce/skins/lightgray/img/trans.gif -------------------------------------------------------------------------------- /js/tinymce/plugins/compat3x/img/buttons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tes/tinymce/master/js/tinymce/plugins/compat3x/img/buttons.png -------------------------------------------------------------------------------- /js/tinymce/plugins/compat3x/img/progress.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tes/tinymce/master/js/tinymce/plugins/compat3x/img/progress.gif -------------------------------------------------------------------------------- /js/tinymce/plugins/visualblocks/img/div.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tes/tinymce/master/js/tinymce/plugins/visualblocks/img/div.gif -------------------------------------------------------------------------------- /js/tinymce/plugins/visualblocks/img/pre.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tes/tinymce/master/js/tinymce/plugins/visualblocks/img/pre.gif -------------------------------------------------------------------------------- /js/tinymce/skins/lightgray/fonts/tinymce.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tes/tinymce/master/js/tinymce/skins/lightgray/fonts/tinymce.eot -------------------------------------------------------------------------------- /js/tinymce/skins/lightgray/fonts/tinymce.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tes/tinymce/master/js/tinymce/skins/lightgray/fonts/tinymce.ttf -------------------------------------------------------------------------------- /tests/manual/css/custom_theme_content.css: -------------------------------------------------------------------------------- 1 | body, div, h1 { font-family: 'trebuchet ms', verdana, arial } 2 | body {font-size: 10pt; } 3 | -------------------------------------------------------------------------------- /js/tinymce/plugins/compat3x/img/menu_arrow.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tes/tinymce/master/js/tinymce/plugins/compat3x/img/menu_arrow.gif -------------------------------------------------------------------------------- /js/tinymce/plugins/compat3x/img/menu_check.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tes/tinymce/master/js/tinymce/plugins/compat3x/img/menu_check.gif -------------------------------------------------------------------------------- /js/tinymce/plugins/emoticons/img/smiley-cry.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tes/tinymce/master/js/tinymce/plugins/emoticons/img/smiley-cry.gif -------------------------------------------------------------------------------- /js/tinymce/plugins/imagetools/config/bolt/atomic.js: -------------------------------------------------------------------------------- 1 | configure({ 2 | configs: [ 3 | './test.js', 4 | './prod.js' 5 | ] 6 | }); 7 | -------------------------------------------------------------------------------- /js/tinymce/plugins/imagetools/config/bolt/browser.js: -------------------------------------------------------------------------------- 1 | configure({ 2 | configs: [ 3 | './test.js', 4 | './prod.js' 5 | ] 6 | }); 7 | -------------------------------------------------------------------------------- /js/tinymce/plugins/visualblocks/img/address.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tes/tinymce/master/js/tinymce/plugins/visualblocks/img/address.gif -------------------------------------------------------------------------------- /js/tinymce/plugins/visualblocks/img/article.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tes/tinymce/master/js/tinymce/plugins/visualblocks/img/article.gif -------------------------------------------------------------------------------- /js/tinymce/plugins/visualblocks/img/aside.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tes/tinymce/master/js/tinymce/plugins/visualblocks/img/aside.gif -------------------------------------------------------------------------------- /js/tinymce/plugins/visualblocks/img/figure.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tes/tinymce/master/js/tinymce/plugins/visualblocks/img/figure.gif -------------------------------------------------------------------------------- /js/tinymce/plugins/visualblocks/img/hgroup.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tes/tinymce/master/js/tinymce/plugins/visualblocks/img/hgroup.gif -------------------------------------------------------------------------------- /js/tinymce/plugins/visualblocks/img/section.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tes/tinymce/master/js/tinymce/plugins/visualblocks/img/section.gif -------------------------------------------------------------------------------- /js/tinymce/skins/lightgray/fonts/tinymce.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tes/tinymce/master/js/tinymce/skins/lightgray/fonts/tinymce.woff -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "4.2" 4 | - "5.1" 5 | before_script: 6 | - npm install -g grunt-cli 7 | script: "grunt" 8 | -------------------------------------------------------------------------------- /js/tinymce/plugins/emoticons/img/smiley-cool.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tes/tinymce/master/js/tinymce/plugins/emoticons/img/smiley-cool.gif -------------------------------------------------------------------------------- /js/tinymce/plugins/emoticons/img/smiley-frown.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tes/tinymce/master/js/tinymce/plugins/emoticons/img/smiley-frown.gif -------------------------------------------------------------------------------- /js/tinymce/plugins/emoticons/img/smiley-kiss.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tes/tinymce/master/js/tinymce/plugins/emoticons/img/smiley-kiss.gif -------------------------------------------------------------------------------- /js/tinymce/plugins/emoticons/img/smiley-smile.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tes/tinymce/master/js/tinymce/plugins/emoticons/img/smiley-smile.gif -------------------------------------------------------------------------------- /js/tinymce/plugins/emoticons/img/smiley-wink.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tes/tinymce/master/js/tinymce/plugins/emoticons/img/smiley-wink.gif -------------------------------------------------------------------------------- /js/tinymce/plugins/emoticons/img/smiley-yell.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tes/tinymce/master/js/tinymce/plugins/emoticons/img/smiley-yell.gif -------------------------------------------------------------------------------- /js/tinymce/skins/lightgray/Content.Inline.less: -------------------------------------------------------------------------------- 1 | /* Content.Inline.less */ 2 | 3 | @import "Mixins.less"; 4 | @import "Content.Objects.less"; 5 | -------------------------------------------------------------------------------- /js/tinymce/plugins/emoticons/img/smiley-innocent.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tes/tinymce/master/js/tinymce/plugins/emoticons/img/smiley-innocent.gif -------------------------------------------------------------------------------- /js/tinymce/plugins/emoticons/img/smiley-laughing.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tes/tinymce/master/js/tinymce/plugins/emoticons/img/smiley-laughing.gif -------------------------------------------------------------------------------- /js/tinymce/plugins/emoticons/img/smiley-sealed.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tes/tinymce/master/js/tinymce/plugins/emoticons/img/smiley-sealed.gif -------------------------------------------------------------------------------- /js/tinymce/plugins/visualblocks/img/blockquote.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tes/tinymce/master/js/tinymce/plugins/visualblocks/img/blockquote.gif -------------------------------------------------------------------------------- /js/tinymce/skins/lightgray/fonts/tinymce-small.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tes/tinymce/master/js/tinymce/skins/lightgray/fonts/tinymce-small.eot -------------------------------------------------------------------------------- /js/tinymce/skins/lightgray/fonts/tinymce-small.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tes/tinymce/master/js/tinymce/skins/lightgray/fonts/tinymce-small.ttf -------------------------------------------------------------------------------- /js/tinymce/skins/lightgray/fonts/tinymce-small.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tes/tinymce/master/js/tinymce/skins/lightgray/fonts/tinymce-small.woff -------------------------------------------------------------------------------- /tests/manual/css/noneditable_manual.css: -------------------------------------------------------------------------------- 1 | .mceNonEditable { 2 | background: #ffadad; 3 | } 4 | 5 | .mceEditable { 6 | background: #adffad; 7 | } 8 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*.{js,css,html}] 4 | charset = utf-8 5 | indent_style = tab 6 | trim_trailing_whitespace = true 7 | end_of_line = lf 8 | -------------------------------------------------------------------------------- /js/tinymce/plugins/emoticons/img/smiley-embarassed.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tes/tinymce/master/js/tinymce/plugins/emoticons/img/smiley-embarassed.gif -------------------------------------------------------------------------------- /js/tinymce/plugins/emoticons/img/smiley-surprised.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tes/tinymce/master/js/tinymce/plugins/emoticons/img/smiley-surprised.gif -------------------------------------------------------------------------------- /js/tinymce/plugins/emoticons/img/smiley-tongue-out.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tes/tinymce/master/js/tinymce/plugins/emoticons/img/smiley-tongue-out.gif -------------------------------------------------------------------------------- /js/tinymce/plugins/emoticons/img/smiley-undecided.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tes/tinymce/master/js/tinymce/plugins/emoticons/img/smiley-undecided.gif -------------------------------------------------------------------------------- /js/tinymce/skins/lightgray/Iframe.less: -------------------------------------------------------------------------------- 1 | // Iframe 2 | 3 | .@{prefix}-iframe { 4 | border: 0 solid @iframe-border; 5 | width: 100%; height: 100%; 6 | } 7 | -------------------------------------------------------------------------------- /js/tinymce/plugins/emoticons/img/smiley-foot-in-mouth.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tes/tinymce/master/js/tinymce/plugins/emoticons/img/smiley-foot-in-mouth.gif -------------------------------------------------------------------------------- /js/tinymce/plugins/emoticons/img/smiley-money-mouth.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tes/tinymce/master/js/tinymce/plugins/emoticons/img/smiley-money-mouth.gif -------------------------------------------------------------------------------- /js/tinymce/skins/lightgray/ColorBox.less: -------------------------------------------------------------------------------- 1 | // ColorBox 2 | 3 | .@{prefix}-colorbox i { 4 | border: 1px solid @textbox-border; 5 | width: 14px; height: 14px; 6 | } 7 | -------------------------------------------------------------------------------- /js/tinymce/skins/lightgray/SelectBox.less: -------------------------------------------------------------------------------- 1 | // SelectBox 2 | 3 | .@{prefix}-selectbox { 4 | background: @selectbox-bg; 5 | border: 1px solid @selectbox-border; 6 | } 7 | -------------------------------------------------------------------------------- /js/tinymce/themes/inlite/config/bolt/prod.js: -------------------------------------------------------------------------------- 1 | configure({ 2 | sources: [ 3 | source('amd', 'tinymce/inlite', '../../src/main/js', mapper.hierarchical) 4 | ] 5 | }); 6 | -------------------------------------------------------------------------------- /js/tinymce/langs/readme.md: -------------------------------------------------------------------------------- 1 | This is where language files should be placed. 2 | 3 | Please DO NOT translate these directly use this service: https://www.transifex.com/projects/p/tinymce/ 4 | -------------------------------------------------------------------------------- /js/tinymce/skins/lightgray/FitLayout.less: -------------------------------------------------------------------------------- 1 | // FitLayout 2 | 3 | .@{prefix}-fit-layout { 4 | .inline-block(); 5 | } 6 | 7 | .@{prefix}-fit-layout-item { 8 | position: absolute; 9 | } 10 | -------------------------------------------------------------------------------- /js/tinymce/skins/lightgray/Animations.less: -------------------------------------------------------------------------------- 1 | // Animations 2 | 3 | .@{prefix}-fade { 4 | opacity: 0; 5 | .transition(opacity .15s linear); 6 | 7 | &.@{prefix}-in { 8 | opacity: 1; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /js/tinymce/skins/lightgray/Container.less: -------------------------------------------------------------------------------- 1 | // Container 2 | 3 | .@{prefix}-container, .@{prefix}-container-body { 4 | display: block; 5 | } 6 | 7 | .@{prefix}-autoscroll { 8 | overflow: hidden; 9 | } 10 | -------------------------------------------------------------------------------- /js/tinymce/themes/inlite/config/bolt/demo.js: -------------------------------------------------------------------------------- 1 | configure({ 2 | configs: [ 3 | './prod.js' 4 | ], 5 | sources: [ 6 | source('amd', 'tinymce/inlite/Demo', '../../src/demo/js', mapper.hierarchical) 7 | ] 8 | }); 9 | -------------------------------------------------------------------------------- /js/tinymce/plugins/example/dialog.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 |a12
'); 16 | 17 | deepEqual(NodePath.create(getRoot(), getRoot().firstChild), [0]); 18 | deepEqual(NodePath.create(getRoot(), getRoot().firstChild.firstChild), [0, 0]); 19 | deepEqual(NodePath.create(getRoot(), getRoot().firstChild.lastChild.lastChild), [1, 1, 0]); 20 | }); 21 | 22 | test("resolve", function() { 23 | setupHtml('a12
'); 24 | 25 | deepEqual(NodePath.resolve(getRoot(), NodePath.create(getRoot(), getRoot().firstChild)), getRoot().firstChild); 26 | deepEqual(NodePath.resolve(getRoot(), NodePath.create(getRoot(), getRoot().firstChild.firstChild)), getRoot().firstChild.firstChild); 27 | deepEqual(NodePath.resolve(getRoot(), NodePath.create(getRoot(), getRoot().firstChild.lastChild.lastChild)), getRoot().firstChild.lastChild.lastChild); 28 | }); 29 | }); -------------------------------------------------------------------------------- /tests/tinymce/util/JSON.js: -------------------------------------------------------------------------------- 1 | module("tinymce.util.JSON"); 2 | 3 | test('serialize', 2, function() { 4 | equal( 5 | tinymce.util.JSON.serialize({ 6 | arr1 : [1, 2, 3, [1, 2, 3]], 7 | bool1 : true, 8 | float1: 3.14, 9 | int1 : 123, 10 | null1 : null, 11 | obj1 : {key1 : "val1", key2 : "val2"}, str1 : '\"\'abc\u00C5123\\'} 12 | ), 13 | '{"arr1":[1,2,3,[1,2,3]],"bool1":true,"float1":3.14,"int1":123,"null1":null,"obj1":{"key1":"val1","key2":"val2"},"str1":"\\"\'abc\\u00c5123\\\\"}' 14 | ); 15 | 16 | equal( 17 | tinymce.util.JSON.serialize({ 18 | arr1 : [1, 2, 3, [1, 2, 3]], 19 | bool1 : true, 20 | float1: 3.14, 21 | int1 : 123, 22 | null1 : null, 23 | obj1 : {key1 : "val1", key2 : "val2"}, str1 : '\"\'abc\u00C5123'}, "'" 24 | ), 25 | "{'arr1':[1,2,3,[1,2,3]],'bool1':true,'float1':3.14,'int1':123,'null1':null,'obj1':{'key1':'val1','key2':'val2'},'str1':'\\\"\\'abc\\u00c5123'}" 26 | ); 27 | }); 28 | 29 | test('parse', 1, function() { 30 | equal(tinymce.util.JSON.parse('{"arr1":[1,2,3,[1,2,3]],"bool1":true,"float1":3.14,"int1":123,"null1":null,"obj1":{"key1":"val1","key2":"val2"},"str1":"abc\\u00c5123"}').str1, 'abc\u00c5123'); 31 | }); 32 | -------------------------------------------------------------------------------- /js/tinymce/themes/inlite/src/test/js/atomic/core/MatcherTest.js: -------------------------------------------------------------------------------- 1 | test('browser/atomic/MatcherTest', [ 2 | 'tinymce/inlite/core/Matcher' 3 | ], function (Matcher) { 4 | var testMatch = function (mockEditor, matches, expectedResult) { 5 | var result; 6 | 7 | result = Matcher.match(mockEditor, matches); 8 | assert.eq(expectedResult, result); 9 | }; 10 | 11 | var match = function (key) { 12 | return function (editor) { 13 | return editor[key]; 14 | }; 15 | }; 16 | 17 | var testMatcher = function () { 18 | var mockEditor = { 19 | success1: 'success1', 20 | success2: 'success2', 21 | failure: null 22 | }; 23 | 24 | testMatch(mockEditor, [ 25 | match('success1') 26 | ], 'success1'); 27 | 28 | testMatch(mockEditor, [ 29 | match(null), 30 | match('success2') 31 | ], 'success2'); 32 | 33 | testMatch(mockEditor, [ 34 | match('success1'), 35 | match('success2') 36 | ], 'success1'); 37 | 38 | testMatch(mockEditor, [ 39 | match(null) 40 | ], null); 41 | 42 | testMatch(mockEditor, [ 43 | match(null), 44 | match(null) 45 | ], null); 46 | 47 | testMatch(mockEditor, [], null); 48 | }; 49 | 50 | testMatcher(); 51 | }); 52 | -------------------------------------------------------------------------------- /js/tinymce/themes/inlite/src/main/js/tinymce/inlite/core/SkinLoader.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SkinLoader.js 3 | * 4 | * Released under LGPL License. 5 | * Copyright (c) 1999-2016 Ephox Corp. All rights reserved 6 | * 7 | * License: http://www.tinymce.com/license 8 | * Contributing: http://www.tinymce.com/contributing 9 | */ 10 | 11 | define('tinymce/inlite/core/SkinLoader', [ 12 | 'global!tinymce.EditorManager', 13 | 'global!tinymce.DOM' 14 | ], function (EditorManager, DOM) { 15 | var fireSkinLoaded = function (editor, callback) { 16 | var done = function () { 17 | editor.fire('SkinLoaded'); 18 | callback(); 19 | }; 20 | 21 | if (editor.initialized) { 22 | done(); 23 | } else { 24 | editor.on('init', done); 25 | } 26 | }; 27 | 28 | var load = function (editor, skin, callback) { 29 | var baseUrl = EditorManager.baseURL; 30 | var skinUrl = baseUrl + '/skins/' + skin; 31 | 32 | var done = function () { 33 | fireSkinLoaded(editor, callback); 34 | }; 35 | 36 | DOM.styleSheetLoader.load(skinUrl + '/skin.min.css', done); 37 | editor.contentCSS.push(skinUrl + '/content.inline.min.css'); 38 | }; 39 | 40 | return { 41 | load: load 42 | }; 43 | }); 44 | 45 | 46 | -------------------------------------------------------------------------------- /js/tinymce/plugins/imagetools/src/main/js/UndoStack.js: -------------------------------------------------------------------------------- 1 | /** 2 | * UndoStack.js 3 | * 4 | * Released under LGPL License. 5 | * Copyright (c) 1999-2016 Ephox Corp. All rights reserved 6 | * 7 | * License: http://www.tinymce.com/license 8 | * Contributing: http://www.tinymce.com/contributing 9 | */ 10 | 11 | define("tinymce/imagetoolsplugin/UndoStack", [ 12 | ], function() { 13 | return function() { 14 | var data = [], index = -1; 15 | 16 | function add(state) { 17 | var removed; 18 | 19 | removed = data.splice(++index); 20 | data.push(state); 21 | 22 | return { 23 | state: state, 24 | removed: removed 25 | }; 26 | } 27 | 28 | function undo() { 29 | if (canUndo()) { 30 | return data[--index]; 31 | } 32 | } 33 | 34 | function redo() { 35 | if (canRedo()) { 36 | return data[++index]; 37 | } 38 | } 39 | 40 | function canUndo() { 41 | return index > 0; 42 | } 43 | 44 | function canRedo() { 45 | return index != -1 && index < data.length - 1; 46 | } 47 | 48 | return { 49 | data: data, 50 | add: add, 51 | undo: undo, 52 | redo: redo, 53 | canUndo: canUndo, 54 | canRedo: canRedo 55 | }; 56 | }; 57 | }); 58 | -------------------------------------------------------------------------------- /js/tinymce/classes/dom/NodePath.js: -------------------------------------------------------------------------------- 1 | /** 2 | * NodePath.js 3 | * 4 | * Released under LGPL License. 5 | * Copyright (c) 1999-2015 Ephox Corp. All rights reserved 6 | * 7 | * License: http://www.tinymce.com/license 8 | * Contributing: http://www.tinymce.com/contributing 9 | */ 10 | 11 | /** 12 | * Handles paths of nodes within an element. 13 | * 14 | * @private 15 | * @class tinymce.dom.NodePath 16 | */ 17 | define("tinymce/dom/NodePath", [ 18 | "tinymce/dom/DOMUtils" 19 | ], function(DOMUtils) { 20 | function create(rootNode, targetNode, normalized) { 21 | var path = []; 22 | 23 | for (; targetNode && targetNode != rootNode; targetNode = targetNode.parentNode) { 24 | path.push(DOMUtils.nodeIndex(targetNode, normalized)); 25 | } 26 | 27 | return path; 28 | } 29 | 30 | function resolve(rootNode, path) { 31 | var i, node, children; 32 | 33 | for (node = rootNode, i = path.length - 1; i >= 0; i--) { 34 | children = node.childNodes; 35 | 36 | if (path[i] > children.length - 1) { 37 | return null; 38 | } 39 | 40 | node = children[path[i]]; 41 | } 42 | 43 | return node; 44 | } 45 | 46 | return { 47 | create: create, 48 | resolve: resolve 49 | }; 50 | }); -------------------------------------------------------------------------------- /js/tinymce/skins/lightgray/SplitButton.less: -------------------------------------------------------------------------------- 1 | // SplitButton 2 | 3 | .@{prefix}-splitbtn .@{prefix}-open { 4 | border-left: 1px solid transparent; 5 | } 6 | 7 | .@{prefix}-splitbtn:hover .@{prefix}-open { 8 | border-left-color: darken(@btn-bg, 20%); 9 | } 10 | 11 | .@{prefix}-splitbtn button when (@has-button-borders = false) { 12 | padding-right: 6px; 13 | padding-left: 6px; 14 | } 15 | 16 | .@{prefix}-splitbtn button when (@has-button-borders = true) { 17 | padding-right: 4px; 18 | padding-left: 8px; 19 | } 20 | 21 | .@{prefix}-splitbtn .@{prefix}-open { 22 | padding-right: 4px; 23 | padding-left: 4px; 24 | } 25 | 26 | .@{prefix}-splitbtn .@{prefix}-open.@{prefix}-active { 27 | .vertical-gradient(darken(@btn-bg, 10%), darken(@btn-bg-hlight, 5%)); 28 | outline: 1px solid darken(@btn-bg, 20%); 29 | } 30 | 31 | .@{prefix}-splitbtn.@{prefix}-btn-small .@{prefix}-open { 32 | padding: 0 3px 0 3px; 33 | } 34 | 35 | // RTL 36 | 37 | .@{prefix}-rtl .@{prefix}-splitbtn { 38 | direction: rtl; 39 | text-align: right; 40 | } 41 | 42 | .@{prefix}-rtl .@{prefix}-splitbtn button { 43 | padding-right: 4px; 44 | padding-left: 4px; 45 | } 46 | 47 | .@{prefix}-rtl .@{prefix}-splitbtn .@{prefix}-open { 48 | border-left: 0; 49 | } 50 | -------------------------------------------------------------------------------- /js/tinymce/classes/ui/FlowLayout.js: -------------------------------------------------------------------------------- 1 | /** 2 | * FlowLayout.js 3 | * 4 | * Released under LGPL License. 5 | * Copyright (c) 1999-2015 Ephox Corp. All rights reserved 6 | * 7 | * License: http://www.tinymce.com/license 8 | * Contributing: http://www.tinymce.com/contributing 9 | */ 10 | 11 | /** 12 | * This layout manager will place the controls by using the browsers native layout. 13 | * 14 | * @-x-less FlowLayout.less 15 | * @class tinymce.ui.FlowLayout 16 | * @extends tinymce.ui.Layout 17 | */ 18 | define("tinymce/ui/FlowLayout", [ 19 | "tinymce/ui/Layout" 20 | ], function(Layout) { 21 | return Layout.extend({ 22 | Defaults: { 23 | containerClass: 'flow-layout', 24 | controlClass: 'flow-layout-item', 25 | endClass: 'break' 26 | }, 27 | 28 | /** 29 | * Recalculates the positions of the controls in the specified container. 30 | * 31 | * @method recalc 32 | * @param {tinymce.ui.Container} container Container instance to recalc. 33 | */ 34 | recalc: function(container) { 35 | container.items().filter(':visible').each(function(ctrl) { 36 | if (ctrl.recalc) { 37 | ctrl.recalc(); 38 | } 39 | }); 40 | }, 41 | 42 | isNative: function() { 43 | return true; 44 | } 45 | }); 46 | }); -------------------------------------------------------------------------------- /tests/tinymce/dom/Dimensions.js: -------------------------------------------------------------------------------- 1 | ModuleLoader.require([ 2 | "tinymce/util/Arr", 3 | "tinymce/dom/Dimensions" 4 | ], function(Arr, Dimensions) { 5 | module("tinymce.dom.Dimensions"); 6 | 7 | function setupHtml(html) { 8 | var viewElm; 9 | 10 | viewElm = document.getElementById('view'); 11 | viewElm.innerHTML = html; 12 | 13 | return viewElm; 14 | } 15 | 16 | test('getClientRects', function() { 17 | var viewElm = setupHtml('abc123'); 18 | 19 | strictEqual(Dimensions.getClientRects(viewElm.firstChild).length, 1); 20 | strictEqual(Dimensions.getClientRects(viewElm.lastChild).length, 1); 21 | strictEqual(Dimensions.getClientRects(viewElm.firstChild)[0].node, viewElm.firstChild); 22 | strictEqual(Dimensions.getClientRects(viewElm.firstChild)[0].left > 3, true); 23 | strictEqual(Dimensions.getClientRects(viewElm.lastChild)[0].left > 3, true); 24 | }); 25 | 26 | test('getClientRects from array', function() { 27 | var viewElm = setupHtml('ab'), 28 | clientRects = Dimensions.getClientRects(Arr.toArray(viewElm.childNodes)); 29 | 30 | strictEqual(clientRects.length, 2); 31 | strictEqual(clientRects[0].node, viewElm.childNodes[0]); 32 | strictEqual(clientRects[1].node, viewElm.childNodes[1]); 33 | }); 34 | }); 35 | -------------------------------------------------------------------------------- /tests/tinymce/util/Observable.js: -------------------------------------------------------------------------------- 1 | module("tinymce.util.Observable"); 2 | 3 | test("Event bubbling/removed state", function() { 4 | var lastName, lastState, data = ''; 5 | 6 | function Class(parentObj) { 7 | this.toggleNativeEvent = function(name, state) { 8 | lastName = name; 9 | lastState = state; 10 | }; 11 | 12 | this.parent = function() { 13 | return parentObj; 14 | }; 15 | } 16 | 17 | tinymce.util.Tools.extend(Class.prototype, tinymce.util.Observable); 18 | 19 | var inst1 = new Class(); 20 | 21 | inst1.on('click', function() { data += 'a'; }); 22 | strictEqual(lastName, 'click'); 23 | strictEqual(lastState, true); 24 | 25 | lastName = lastState = null; 26 | inst1.on('click', function() { data += 'b'; }); 27 | strictEqual(lastName, null); 28 | strictEqual(lastState, null); 29 | 30 | var inst2 = new Class(inst1); 31 | inst2.on('click', function() { data += 'c'; }); 32 | 33 | inst2.fire('click'); 34 | strictEqual(data, 'cab'); 35 | 36 | inst2.on('click', function(e) { e.stopPropagation(); }); 37 | 38 | inst2.fire('click'); 39 | strictEqual(data, 'cabc'); 40 | 41 | inst1.on('remove', function() { data += 'r'; }); 42 | inst1.removed = true; 43 | inst1.fire('click'); 44 | inst1.fire('remove'); 45 | strictEqual(data, 'cabcr'); 46 | }); 47 | -------------------------------------------------------------------------------- /js/tinymce/classes/ui/Toolbar.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Toolbar.js 3 | * 4 | * Released under LGPL License. 5 | * Copyright (c) 1999-2015 Ephox Corp. All rights reserved 6 | * 7 | * License: http://www.tinymce.com/license 8 | * Contributing: http://www.tinymce.com/contributing 9 | */ 10 | 11 | /** 12 | * Creates a new toolbar. 13 | * 14 | * @class tinymce.ui.Toolbar 15 | * @extends tinymce.ui.Container 16 | */ 17 | define("tinymce/ui/Toolbar", [ 18 | "tinymce/ui/Container" 19 | ], function(Container) { 20 | "use strict"; 21 | 22 | return Container.extend({ 23 | Defaults: { 24 | role: 'toolbar', 25 | layout: 'flow' 26 | }, 27 | 28 | /** 29 | * Constructs a instance with the specified settings. 30 | * 31 | * @constructor 32 | * @param {Object} settings Name/value object with settings. 33 | */ 34 | init: function(settings) { 35 | var self = this; 36 | 37 | self._super(settings); 38 | self.classes.add('toolbar'); 39 | }, 40 | 41 | /** 42 | * Called after the control has been rendered. 43 | * 44 | * @method postRender 45 | */ 46 | postRender: function() { 47 | var self = this; 48 | 49 | self.items().each(function(ctrl) { 50 | ctrl.classes.add('toolbar-item'); 51 | }); 52 | 53 | return self._super(); 54 | } 55 | }); 56 | }); -------------------------------------------------------------------------------- /js/tinymce/themes/inlite/src/test/js/browser/file/ConversionsTest.js: -------------------------------------------------------------------------------- 1 | asynctest('atomic/core/ConvertTest', [ 2 | 'ephox/tinymce', 3 | 'tinymce/inlite/file/Conversions', 4 | 'ephox.agar.api.Step', 5 | 'ephox.agar.api.Pipeline', 6 | 'ephox.agar.api.Assertions' 7 | ], function (tinymce, Conversions, Step, Pipeline, Assertions) { 8 | var success = arguments[arguments.length - 2]; 9 | var failure = arguments[arguments.length - 1]; 10 | 11 | var base64ToBlob = function (base64, type) { 12 | var buff = atob(base64); 13 | var bytes = new Uint8Array(buff.length); 14 | 15 | for (var i = 0; i < bytes.length; i++) { 16 | bytes[i] = buff.charCodeAt(i); 17 | } 18 | 19 | return new Blob([bytes], {type: type}); 20 | }; 21 | 22 | var sBlobToBase64 = function () { 23 | return Step.async(function (next) { 24 | var base64 = 'R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7'; 25 | var blob = base64ToBlob(base64, 'image/gif'); 26 | 27 | Conversions.blobToBase64(blob).then(function (convertedBase64) { 28 | Assertions.assertEq('Not the correct base64', base64, convertedBase64); 29 | next(); 30 | }); 31 | }); 32 | }; 33 | 34 | Pipeline.async({}, [ 35 | sBlobToBase64() 36 | ], function () { 37 | success(); 38 | }, function () { 39 | failure(); 40 | }); 41 | }); 42 | -------------------------------------------------------------------------------- /js/tinymce/themes/inlite/src/test/js/atomic/core/UrlTypeTest.js: -------------------------------------------------------------------------------- 1 | test('atomic/core/UrlTypeTest', [ 2 | 'tinymce/inlite/core/UrlType' 3 | ], function (UrlType) { 4 | var testIsDomainLike = function () { 5 | var mostUsedTopLevelDomains = [ 6 | 'com', 'org', 'edu', 'gov', 'uk', 'net', 'ca', 'de', 'jp', 7 | 'fr', 'au', 'us', 'ru', 'ch', 'it', 'nl', 'se', 'no', 'es', 'mil' 8 | ]; 9 | 10 | assert.eq(UrlType.isDomainLike('www.site.com'), true); 11 | assert.eq(UrlType.isDomainLike('www.site.xyz'), true); 12 | assert.eq(UrlType.isDomainLike(' www.site.xyz'), true); 13 | assert.eq(UrlType.isDomainLike('site.xyz'), false); 14 | 15 | mostUsedTopLevelDomains.forEach(function (tld) { 16 | assert.eq(UrlType.isDomainLike('site.' + tld), true); 17 | assert.eq(UrlType.isDomainLike(' site.' + tld), true); 18 | assert.eq(UrlType.isDomainLike('site.' + tld + ' '), true); 19 | }); 20 | 21 | assert.eq(UrlType.isDomainLike('/a/b'), false); 22 | }; 23 | 24 | var testIsAbsoluteUrl = function () { 25 | assert.eq(UrlType.isAbsolute('http://www.site.com'), true); 26 | assert.eq(UrlType.isAbsolute('https://www.site.com'), true); 27 | assert.eq(UrlType.isAbsolute('www.site.com'), false); 28 | assert.eq(UrlType.isAbsolute('file.gif'), false); 29 | }; 30 | 31 | testIsDomainLike(); 32 | testIsAbsoluteUrl(); 33 | }); 34 | -------------------------------------------------------------------------------- /tests/tinymce/util/Color.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | module("tinymce.util.Color"); 3 | 4 | var Color = tinymce.util.Color; 5 | 6 | test("Constructor", function() { 7 | equal(new Color().toHex(), '#000000'); 8 | equal(new Color('#faebcd').toHex(), '#faebcd'); 9 | }); 10 | 11 | test("parse method", function() { 12 | var color = new Color(); 13 | 14 | equal(color.parse('#faebcd').toHex(), '#faebcd'); 15 | equal(color.parse('#ccc').toHex(), '#cccccc'); 16 | equal(color.parse(' #faebcd ').toHex(), '#faebcd'); 17 | equal(color.parse('rgb(255,254,253)').toHex(), '#fffefd'); 18 | equal(color.parse(' rgb ( 255 , 254 , 253 ) ').toHex(), '#fffefd'); 19 | equal(color.parse({r: 255, g: 254, b: 253}).toHex(), '#fffefd'); 20 | equal(color.parse({h: 359, s: 50, v: 50}).toHex(), '#804041'); 21 | equal(color.parse({r: 700, g: 700, b: 700}).toHex(), '#ffffff'); 22 | equal(color.parse({r: -1, g: -10, b: -20}).toHex(), '#000000'); 23 | }); 24 | 25 | test("toRgb method", function() { 26 | deepEqual(new Color('#faebcd').toRgb(), {r: 250, g: 235, b: 205}); 27 | }); 28 | 29 | test("toHsv method", function() { 30 | deepEqual(new Color('#804041').toHsv(), {h: 359, s: 50, v: 50}); 31 | }); 32 | 33 | test("toHex method", function() { 34 | equal(new Color({r: 255, g: 254, b: 253}).toHex(), '#fffefd'); 35 | }); 36 | })(); 37 | -------------------------------------------------------------------------------- /js/tinymce/skins/lightgray/Checkbox.less: -------------------------------------------------------------------------------- 1 | // Checkbox 2 | 3 | .@{prefix}-checkbox { 4 | cursor: pointer; 5 | } 6 | 7 | i.@{prefix}-i-checkbox { 8 | margin: 0 3px 0 0; 9 | border: 1px solid @checkbox-border; 10 | .border-radius(3px); 11 | .box-shadow(@checkbox-box-shadow); 12 | .vertical-gradient(@checkbox-bg, @checkbox-bg-hlight); 13 | text-indent: -10em; 14 | *font-size: 0; 15 | *line-height: 0; 16 | *text-indent: 0; 17 | overflow: hidden; 18 | } 19 | 20 | .@{prefix}-checked i.@{prefix}-i-checkbox { 21 | color: @btn-text; 22 | font-size: 16px; 23 | line-height: 16px; 24 | text-indent: 0; 25 | } 26 | 27 | .@{prefix}-checkbox:focus i.@{prefix}-i-checkbox, .@{prefix}-checkbox.@{prefix}-focus i.@{prefix}-i-checkbox { 28 | border: 1px solid @checkbox-border-focus; 29 | .box-shadow(inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px fadeout(@checkbox-border-focus, 15%)); 30 | } 31 | 32 | .@{prefix}-checkbox.@{prefix}-disabled .@{prefix}-label, .@{prefix}-checkbox.@{prefix}-disabled i.@{prefix}-i-checkbox { 33 | color: mix(@text, @panel-bg, 40%); 34 | } 35 | 36 | .@{prefix}-checkbox .@{prefix}-label { 37 | vertical-align: middle; 38 | } 39 | 40 | // RTL 41 | 42 | .@{prefix}-rtl .@{prefix}-checkbox { 43 | direction: rtl; 44 | text-align: right; 45 | } 46 | 47 | .@{prefix}-rtl i.@{prefix}-i-checkbox { 48 | margin: 0 0 0 3px; 49 | } 50 | -------------------------------------------------------------------------------- /tests/tinymce/file/UploadStatus.js: -------------------------------------------------------------------------------- 1 | ModuleLoader.require([ 2 | "tinymce/file/UploadStatus" 3 | ], function(UploadStatus) { 4 | module("tinymce.file.UploadStatus"); 5 | 6 | QUnit.test("hasBlobUri/markPending", function() { 7 | var status = new UploadStatus(); 8 | 9 | strictEqual(status.hasBlobUri("nonexisting_uri"), false); 10 | status.markPending("existing_uri"); 11 | strictEqual(status.isPending("existing_uri"), true); 12 | strictEqual(status.isUploaded("existing_uri"), false); 13 | strictEqual(status.hasBlobUri("existing_uri"), true); 14 | 15 | status.markUploaded("existing_uri", "uri"); 16 | strictEqual(status.isPending("existing_uri"), false); 17 | strictEqual(status.isUploaded("existing_uri"), true); 18 | strictEqual(status.hasBlobUri("existing_uri"), true); 19 | strictEqual(status.getResultUri("existing_uri"), "uri"); 20 | 21 | status.markUploaded("existing_uri2", "uri2"); 22 | strictEqual(status.isPending("existing_uri"), false); 23 | strictEqual(status.isUploaded("existing_uri"), true); 24 | strictEqual(status.hasBlobUri("existing_uri2"), true); 25 | strictEqual(status.getResultUri("existing_uri2"), "uri2"); 26 | 27 | status.markPending("existing_uri"); 28 | strictEqual(status.hasBlobUri("existing_uri"), true); 29 | status.removeFailed("existing_uri"); 30 | strictEqual(status.hasBlobUri("existing_uri"), false); 31 | }); 32 | }); -------------------------------------------------------------------------------- /tests/tinymce/util/JSONRequest.js: -------------------------------------------------------------------------------- 1 | if (location.protocol != "file:") { 2 | module("tinymce.util.JSONRequest"); 3 | 4 | asyncTest("Successful request - send method", function() { 5 | expect(1); 6 | 7 | new tinymce.util.JSONRequest({}).send({ 8 | type : 'GET', 9 | url : 'tinymce/util/json_rpc_ok.js', 10 | success: function(data) { 11 | equal(data, 'Hello JSON-RPC'); 12 | start(); 13 | } 14 | }); 15 | }); 16 | 17 | asyncTest("Successful request - sendRPC static method", function() { 18 | expect(1); 19 | 20 | tinymce.util.JSONRequest.sendRPC({ 21 | type : 'GET', 22 | url : 'tinymce/util/json_rpc_ok.js', 23 | success: function(data) { 24 | equal(data, 'Hello JSON-RPC'); 25 | start(); 26 | } 27 | }); 28 | }); 29 | 30 | asyncTest("Error request - send method", function() { 31 | expect(1); 32 | 33 | new tinymce.util.JSONRequest({}).send({ 34 | type : 'GET', 35 | url : 'tinymce/util/json_rpc_error.js', 36 | error: function(error) { 37 | equal(error.code, 42); 38 | start(); 39 | } 40 | }); 41 | }); 42 | 43 | asyncTest("Error request - sendRPC static method", function() { 44 | expect(1); 45 | 46 | tinymce.util.JSONRequest.sendRPC({ 47 | type : 'GET', 48 | url : 'tinymce/util/json_rpc_error.js', 49 | error: function(error) { 50 | equal(error.code, 42); 51 | start(); 52 | } 53 | }); 54 | }); 55 | } 56 | -------------------------------------------------------------------------------- /js/tinymce/skins/lightgray/CropRect.less: -------------------------------------------------------------------------------- 1 | // CropRect 2 | 3 | .@{prefix}-croprect-container { 4 | position: absolute; 5 | top: 0; 6 | left: 0; 7 | } 8 | 9 | .@{prefix}-croprect-handle { 10 | position: absolute; 11 | top: 0; left: 0; 12 | width: 20px; height: 20px; 13 | border: 2px solid white; 14 | } 15 | 16 | .@{prefix}-croprect-handle-nw { 17 | border-width: 2px 0 0 2px; 18 | margin: -2px 0 0 -2px; 19 | cursor: nw-resize; 20 | top: 100px; left: 100px; 21 | } 22 | 23 | .@{prefix}-croprect-handle-ne { 24 | border-width: 2px 2px 0 0; 25 | margin: -2px 0 0 -20px; 26 | cursor: ne-resize; 27 | top: 100px; left: 200px; 28 | } 29 | 30 | .@{prefix}-croprect-handle-sw { 31 | border-width: 0 0 2px 2px; 32 | margin: -20px 2px 0 -2px; 33 | cursor: sw-resize; 34 | top: 200px; left: 100px; 35 | } 36 | 37 | .@{prefix}-croprect-handle-se { 38 | border-width: 0 2px 2px 0; 39 | margin: -20px 0 0 -20px; 40 | cursor: se-resize; 41 | top: 200px; left: 200px; 42 | } 43 | 44 | .@{prefix}-croprect-handle-move { 45 | position: absolute; 46 | cursor: move; 47 | border: 0; 48 | } 49 | 50 | .@{prefix}-croprect-block { 51 | .opacity(@window-modalblock-opacity); 52 | position: absolute; 53 | background: black; 54 | } 55 | 56 | .@{prefix}-croprect-handle:focus { 57 | border-color: @textbox-border-focus; 58 | } 59 | 60 | .@{prefix}-croprect-handle-move:focus { 61 | outline: 1px solid @textbox-border-focus; 62 | } 63 | -------------------------------------------------------------------------------- /js/tinymce/skins/lightgray/InfoBox.less: -------------------------------------------------------------------------------- 1 | // InfoBox 2 | 3 | .@{prefix}-infobox { 4 | .inline-block(); 5 | text-shadow: @text-shadow; 6 | overflow: hidden; 7 | border: 1px solid red; 8 | 9 | div { 10 | display: block; 11 | margin: 5px; 12 | 13 | button { 14 | position: absolute; 15 | top: 50%; right: 4px; 16 | cursor: pointer; 17 | margin-top: -8px; 18 | display: none; 19 | } 20 | 21 | button:focus { 22 | outline: 2px solid @btn-border-hover; 23 | } 24 | } 25 | } 26 | 27 | .@{prefix}-infobox.@{prefix}-has-help { 28 | div { 29 | margin-right: 25px; 30 | } 31 | 32 | button { 33 | display: block; 34 | } 35 | } 36 | 37 | .@{prefix}-infobox.@{prefix}-success { 38 | background: @infobox-success-bg; 39 | border-color: @infobox-success-border; 40 | 41 | div { 42 | color: @infobox-success-text; 43 | } 44 | } 45 | 46 | .@{prefix}-infobox.@{prefix}-warning { 47 | background: @infobox-warning-bg; 48 | border-color: @infobox-warning-border; 49 | 50 | div { 51 | color: @infobox-warning-text; 52 | } 53 | } 54 | 55 | .@{prefix}-infobox.@{prefix}-error { 56 | background: @infobox-error-bg; 57 | border-color: @infobox-error-border; 58 | 59 | div { 60 | color: @infobox-error-text; 61 | } 62 | } 63 | 64 | // RTL 65 | 66 | .@{prefix}-rtl .@{prefix}-infobox { 67 | div { 68 | text-align: right; 69 | direction: rtl; 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /js/tinymce/plugins/nonbreaking/plugin.js: -------------------------------------------------------------------------------- 1 | /** 2 | * plugin.js 3 | * 4 | * Released under LGPL License. 5 | * Copyright (c) 1999-2015 Ephox Corp. All rights reserved 6 | * 7 | * License: http://www.tinymce.com/license 8 | * Contributing: http://www.tinymce.com/contributing 9 | */ 10 | 11 | /*global tinymce:true */ 12 | 13 | tinymce.PluginManager.add('nonbreaking', function(editor) { 14 | var setting = editor.getParam('nonbreaking_force_tab'); 15 | 16 | editor.addCommand('mceNonBreaking', function() { 17 | editor.insertContent( 18 | (editor.plugins.visualchars && editor.plugins.visualchars.state) ? 19 | ' ' : ' ' 20 | ); 21 | 22 | editor.dom.setAttrib(editor.dom.select('span.mce-nbsp'), 'data-mce-bogus', '1'); 23 | }); 24 | 25 | editor.addButton('nonbreaking', { 26 | title: 'Nonbreaking space', 27 | cmd: 'mceNonBreaking' 28 | }); 29 | 30 | editor.addMenuItem('nonbreaking', { 31 | text: 'Nonbreaking space', 32 | cmd: 'mceNonBreaking', 33 | context: 'insert' 34 | }); 35 | 36 | if (setting) { 37 | var spaces = +setting > 1 ? +setting : 3; // defaults to 3 spaces if setting is true (or 1) 38 | 39 | editor.on('keydown', function(e) { 40 | if (e.keyCode == 9) { 41 | 42 | if (e.shiftKey) { 43 | return; 44 | } 45 | 46 | e.preventDefault(); 47 | for (var i = 0; i < spaces; i++) { 48 | editor.execCommand('mceNonBreaking'); 49 | } 50 | } 51 | }); 52 | } 53 | }); 54 | -------------------------------------------------------------------------------- /js/tinymce/classes/ui/FitLayout.js: -------------------------------------------------------------------------------- 1 | /** 2 | * FitLayout.js 3 | * 4 | * Released under LGPL License. 5 | * Copyright (c) 1999-2015 Ephox Corp. All rights reserved 6 | * 7 | * License: http://www.tinymce.com/license 8 | * Contributing: http://www.tinymce.com/contributing 9 | */ 10 | 11 | /** 12 | * This layout manager will resize the control to be the size of it's parent container. 13 | * In other words width: 100% and height: 100%. 14 | * 15 | * @-x-less FitLayout.less 16 | * @class tinymce.ui.FitLayout 17 | * @extends tinymce.ui.AbsoluteLayout 18 | */ 19 | define("tinymce/ui/FitLayout", [ 20 | "tinymce/ui/AbsoluteLayout" 21 | ], function(AbsoluteLayout) { 22 | "use strict"; 23 | 24 | return AbsoluteLayout.extend({ 25 | /** 26 | * Recalculates the positions of the controls in the specified container. 27 | * 28 | * @method recalc 29 | * @param {tinymce.ui.Container} container Container instance to recalc. 30 | */ 31 | recalc: function(container) { 32 | var contLayoutRect = container.layoutRect(), paddingBox = container.paddingBox; 33 | 34 | container.items().filter(':visible').each(function(ctrl) { 35 | ctrl.layoutRect({ 36 | x: paddingBox.left, 37 | y: paddingBox.top, 38 | w: contLayoutRect.innerW - paddingBox.right - paddingBox.left, 39 | h: contLayoutRect.innerH - paddingBox.top - paddingBox.bottom 40 | }); 41 | 42 | if (ctrl.recalc) { 43 | ctrl.recalc(); 44 | } 45 | }); 46 | } 47 | }); 48 | }); -------------------------------------------------------------------------------- /tools/docs/tinymce.ContentEvent.js: -------------------------------------------------------------------------------- 1 | /** 2 | * This class is the event object send when the content events occurs such as GetContent/SetContent. 3 | * 4 | * @class tinymce.ContentEvent 5 | * @extends tinymce.Event 6 | * @example 7 | * tinymce.activeEditor.on('GetContent', function(e) { 8 | * console.log(e.content); 9 | * }); 10 | */ 11 | 12 | /** 13 | * Optional state gets added for the load event then it's set to true. 14 | * 15 | * @property {Boolean} load 16 | */ 17 | 18 | /** 19 | * Optional state gets added for the save event then it's set to true. 20 | * 21 | * @property {Boolean} save 22 | */ 23 | 24 | /** 25 | * Optional state gets added for the getContent event then it's set to true. 26 | * 27 | * @property {Boolean} set 28 | */ 29 | 30 | /** 31 | * Optional state gets added for the setContent event then it's set to true. 32 | * 33 | * @property {Boolean} get 34 | */ 35 | 36 | /** 37 | * Optional element that the load/save event is for. This element is the textarea/div element that the 38 | * contents gets parsed from or serialized to. 39 | * 40 | * @property {DOMElement} element 41 | */ 42 | 43 | /** 44 | * Editor contents to be set or the content that was returned from the editor. 45 | * 46 | * @property {String} content HTML contents from the editor or to be put into the editor. 47 | */ 48 | 49 | /** 50 | * Format of the contents normally "html". 51 | * 52 | * @property {String} format Format of the contents normally "html". 53 | */ 54 | -------------------------------------------------------------------------------- /tests/tinymce/data/ObservableObject.js: -------------------------------------------------------------------------------- 1 | ModuleLoader.require(["tinymce/data/ObservableObject"], function(ObservableObject) { 2 | module("tinymce.data.ObservableObject"); 3 | 4 | test("Constructor", function(assert) { 5 | var obj; 6 | 7 | obj = new ObservableObject(); 8 | assert.ok(!obj.has('a')); 9 | 10 | obj = new ObservableObject({a: 1, b: 2}); 11 | assert.strictEqual(obj.get('a'), 1); 12 | assert.strictEqual(obj.get('b'), 2); 13 | }); 14 | 15 | test("set/get and observe all", function(assert) { 16 | var obj = new ObservableObject(), events = []; 17 | 18 | obj.on('change', function(e) { 19 | events.push(e); 20 | }); 21 | 22 | obj.set('a', 'a'); 23 | obj.set('a', 'a2'); 24 | obj.set('a', 'a3'); 25 | obj.set('b', 'b'); 26 | assert.strictEqual(obj.get('a'), 'a3'); 27 | 28 | equal(events[0].type, 'change'); 29 | equal(events[0].value, 'a'); 30 | equal(events[1].type, 'change'); 31 | equal(events[1].value, 'a2'); 32 | equal(events[2].type, 'change'); 33 | equal(events[2].value, 'a3'); 34 | equal(events[3].type, 'change'); 35 | equal(events[3].value, 'b'); 36 | }); 37 | 38 | test("set/get and observe specific", function(assert) { 39 | var obj = new ObservableObject(), events = []; 40 | 41 | obj.on('change:a', function(e) { 42 | events.push(e); 43 | }); 44 | 45 | obj.set('a', 'a'); 46 | obj.set('b', 'b'); 47 | equal(events[0].type, 'change'); 48 | equal(events[0].value, 'a'); 49 | equal(events.length, 1); 50 | }); 51 | }); 52 | -------------------------------------------------------------------------------- /js/tinymce/themes/inlite/src/main/js/tinymce/inlite/core/ElementMatcher.js: -------------------------------------------------------------------------------- 1 | /** 2 | * ElementMatcher.js 3 | * 4 | * Released under LGPL License. 5 | * Copyright (c) 1999-2016 Ephox Corp. All rights reserved 6 | * 7 | * License: http://www.tinymce.com/license 8 | * Contributing: http://www.tinymce.com/contributing 9 | */ 10 | 11 | define('tinymce/inlite/core/ElementMatcher', [ 12 | 'tinymce/inlite/core/Matcher', 13 | 'tinymce/inlite/core/Measure' 14 | ], function (Matcher, Measure) { 15 | // element :: Element, [PredicateId] -> (Editor -> Matcher.result | Null) 16 | var element = function (element, predicateIds) { 17 | return function (editor) { 18 | for (var i = 0; i < predicateIds.length; i++) { 19 | if (predicateIds[i].predicate(element)) { 20 | return Matcher.result(predicateIds[i].id, Measure.getElementRect(editor, element)); 21 | } 22 | } 23 | 24 | return null; 25 | }; 26 | }; 27 | 28 | // parent :: [Elements], [PredicateId] -> (Editor -> Matcher.result | Null) 29 | var parent = function (elements, predicateIds) { 30 | return function (editor) { 31 | for (var i = 0; i < elements.length; i++) { 32 | for (var x = 0; x < predicateIds.length; x++) { 33 | if (predicateIds[x].predicate(elements[i])) { 34 | return Matcher.result(predicateIds[x].id, Measure.getElementRect(editor, elements[i])); 35 | } 36 | } 37 | } 38 | 39 | return null; 40 | }; 41 | }; 42 | 43 | return { 44 | element: element, 45 | parent: parent 46 | }; 47 | }); 48 | -------------------------------------------------------------------------------- /js/tinymce/plugins/anchor/plugin.js: -------------------------------------------------------------------------------- 1 | /** 2 | * plugin.js 3 | * 4 | * Released under LGPL License. 5 | * Copyright (c) 1999-2015 Ephox Corp. All rights reserved 6 | * 7 | * License: http://www.tinymce.com/license 8 | * Contributing: http://www.tinymce.com/contributing 9 | */ 10 | 11 | /*global tinymce:true */ 12 | 13 | tinymce.PluginManager.add('anchor', function(editor) { 14 | function showDialog() { 15 | var selectedNode = editor.selection.getNode(), name = ''; 16 | var isAnchor = selectedNode.tagName == 'A' && editor.dom.getAttrib(selectedNode, 'href') === ''; 17 | 18 | if (isAnchor) { 19 | name = selectedNode.name || selectedNode.id || ''; 20 | } 21 | 22 | editor.windowManager.open({ 23 | title: 'Anchor', 24 | body: {type: 'textbox', name: 'name', size: 40, label: 'Name', value: name}, 25 | onsubmit: function(e) { 26 | var id = e.data.name; 27 | 28 | if (isAnchor) { 29 | selectedNode.id = id; 30 | } else { 31 | editor.selection.collapse(true); 32 | editor.execCommand('mceInsertContent', false, editor.dom.createHTML('a', { 33 | id: id 34 | })); 35 | } 36 | } 37 | }); 38 | } 39 | 40 | editor.addCommand('mceAnchor', showDialog); 41 | 42 | editor.addButton('anchor', { 43 | icon: 'anchor', 44 | tooltip: 'Anchor', 45 | onclick: showDialog, 46 | stateSelector: 'a:not([href])' 47 | }); 48 | 49 | editor.addMenuItem('anchor', { 50 | icon: 'anchor', 51 | text: 'Anchor', 52 | context: 'insert', 53 | onclick: showDialog 54 | }); 55 | }); -------------------------------------------------------------------------------- /tests/tinymce/ui/FitLayout.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | var panel; 3 | 4 | module("tinymce.ui.FitLayout", { 5 | setup: function() { 6 | document.getElementById('view').innerHTML = ''; 7 | }, 8 | 9 | teardown: function() { 10 | tinymce.dom.Event.clean(document.getElementById('view')); 11 | } 12 | }); 13 | 14 | function createFitPanel(settings) { 15 | return tinymce.ui.Factory.create(tinymce.extend({ 16 | type: 'panel', 17 | layout: 'fit', 18 | width: 200, 19 | height: 200, 20 | border: 1 21 | }, settings)).renderTo(document.getElementById('view')).reflow(); 22 | } 23 | 24 | test("fit with spacer inside", function() { 25 | panel = createFitPanel({ 26 | items: [ 27 | {type: 'spacer', classes: 'red'} 28 | ] 29 | }); 30 | 31 | deepEqual(Utils.rect(panel), [0, 0, 200, 200]); 32 | deepEqual(Utils.rect(panel.find('spacer')[0]), [1, 1, 198, 198]); 33 | }); 34 | 35 | test("fit with padding and spacer inside", function() { 36 | panel = createFitPanel({ 37 | padding: 3, 38 | items: [ 39 | {type: 'spacer', classes: 'red'} 40 | ] 41 | }); 42 | 43 | deepEqual(Utils.rect(panel), [0, 0, 200, 200]); 44 | deepEqual(Utils.rect(panel.find('spacer')[0]), [4, 4, 192, 192]); 45 | }); 46 | 47 | test("fit with panel inside", function() { 48 | panel = createFitPanel({ 49 | items: [ 50 | {type: 'panel', border: 1} 51 | ] 52 | }); 53 | 54 | deepEqual(Utils.rect(panel), [0, 0, 200, 200]); 55 | deepEqual(Utils.rect(panel.find('panel')[0]), [1, 1, 198, 198]); 56 | }); 57 | })(); -------------------------------------------------------------------------------- /js/tinymce/plugins/table/classes/Utils.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Utils.js 3 | * 4 | * Released under LGPL License. 5 | * Copyright (c) 1999-2015 Ephox Corp. All rights reserved 6 | * 7 | * License: http://www.tinymce.com/license 8 | * Contributing: http://www.tinymce.com/contributing 9 | */ 10 | 11 | /** 12 | * Various utility functions. 13 | * 14 | * @class tinymce.tableplugin.Utils 15 | * @private 16 | */ 17 | define("tinymce/tableplugin/Utils", [ 18 | "tinymce/Env" 19 | ], function(Env) { 20 | var setSpanVal = function (name) { 21 | return function (td, val) { 22 | if (td) { 23 | val = parseInt(val, 10); 24 | 25 | if (val === 1 || val === 0) { 26 | td.removeAttribute(name, 1); 27 | } else { 28 | td.setAttribute(name, val, 1); 29 | } 30 | } 31 | }; 32 | }; 33 | 34 | var getSpanVal = function (name) { 35 | return function (td) { 36 | return parseInt(td.getAttribute(name) || 1, 10); 37 | }; 38 | }; 39 | 40 | function paddCell(cell) { 41 | if (!Env.ie || Env.ie > 9) { 42 | if (!cell.hasChildNodes()) { 43 | cell.innerHTML = 'abc
'); 29 | equal(editor.dom.select('span')[0].contentEditable, "false"); 30 | }); 31 | 32 | test('editable class', function() { 33 | editor.setContent('abc
'); 34 | equal(editor.dom.select('span')[0].contentEditable, "true"); 35 | }); 36 | 37 | test('noneditable regexp', function() { 38 | editor.setContent('{test1}{test2}
'); 39 | 40 | equal(editor.dom.select('span').length, 2); 41 | equal(editor.dom.select('span')[0].contentEditable, "false"); 42 | equal(editor.dom.select('span')[1].contentEditable, "false"); 43 | equal(editor.getContent(), '{test1}{test2}
'); 44 | }); 45 | } -------------------------------------------------------------------------------- /tests/tinymce/InsertList.js: -------------------------------------------------------------------------------- 1 | ModuleLoader.require([ 2 | "tinymce/InsertList", 3 | "tinymce/html/Node", 4 | "tinymce/html/DomParser", 5 | "tinymce/dom/DOMUtils" 6 | ], function(InsertList, Node, DomParser, DOMUtils) { 7 | module("tinymce.InsertList", {}); 8 | 9 | var createFragment = function(html) { 10 | var parser = new DomParser({validate: false}); 11 | var fragment = parser.parse(html); 12 | 13 | return fragment; 14 | }; 15 | 16 | var createDomFragment = function(html) { 17 | return DOMUtils.DOM.createFragment(html); 18 | }; 19 | 20 | test('isListFragment', function() { 21 | equal(InsertList.isListFragment(createFragment('
')), 'text
');
10 | equal(serializer.serialize(new tinymce.html.DomParser().parse('')), '');
11 | equal(serializer.serialize(new tinymce.html.DomParser().parse('')), '');
12 | equal(serializer.serialize(new tinymce.html.DomParser().parse('')), '');
13 | equal(serializer.serialize(new tinymce.html.DomParser().parse('')), '');
14 | });
15 |
16 | test('Sorting of attributes', function() {
17 | var serializer = new tinymce.html.Serializer();
18 |
19 | expect(1);
20 |
21 | equal(serializer.serialize(new tinymce.html.DomParser().parse('x')), 'x');
22 | });
23 |
24 | test('Serialize with validate: true, when parsing with validate:false bug', function() {
25 | var schema = new tinymce.html.Schema({valid_elements: 'b'});
26 | var serializer = new tinymce.html.Serializer({}, schema);
27 |
28 | equal(
29 | serializer.serialize(new tinymce.html.DomParser({validate: false}, schema).parse('ab')),
30 | 'ab'
31 | );
32 | });
33 |
--------------------------------------------------------------------------------
/tests/tinymce/AddOnManager.js:
--------------------------------------------------------------------------------
1 | module("tinymce.AddOnManager", {
2 | teardown: function() {
3 | Utils.unpatch(tinymce.dom.ScriptLoader.ScriptLoader);
4 | tinymce.AddOnManager.languageLoad = true;
5 | tinymce.AddOnManager.language = 'en';
6 | }
7 | });
8 |
9 | test('requireLangPack', function() {
10 | var languagePackUrl;
11 |
12 | Utils.patch(tinymce.dom.ScriptLoader.ScriptLoader, 'add', function(origFunc, url) {
13 | languagePackUrl = url;
14 | });
15 |
16 | function getLanguagePackUrl(language, languages) {
17 | languagePackUrl = null;
18 | tinymce.AddOnManager.language = language;
19 | tinymce.AddOnManager.PluginManager.requireLangPack('plugin', languages);
20 | return languagePackUrl;
21 | }
22 |
23 | tinymce.AddOnManager.PluginManager.urls.plugin = '/root';
24 |
25 | equal(getLanguagePackUrl('sv_SE'), '/root/langs/sv_SE.js');
26 | equal(getLanguagePackUrl('sv_SE', 'sv,en,us'), '/root/langs/sv.js');
27 | equal(getLanguagePackUrl('sv_SE', 'sv_SE,en_US'), '/root/langs/sv_SE.js');
28 | equal(getLanguagePackUrl('sv'), '/root/langs/sv.js');
29 | equal(getLanguagePackUrl('sv', 'sv'), '/root/langs/sv.js');
30 | equal(getLanguagePackUrl('sv', 'sv,en,us'), '/root/langs/sv.js');
31 | equal(getLanguagePackUrl('sv', 'en,sv,us'), '/root/langs/sv.js');
32 | equal(getLanguagePackUrl('sv', 'en,us,sv'), '/root/langs/sv.js');
33 | strictEqual(getLanguagePackUrl('sv', 'en,us'), null);
34 | strictEqual(getLanguagePackUrl(null, 'en,us'), null);
35 | strictEqual(getLanguagePackUrl(null), null);
36 |
37 | tinymce.AddOnManager.languageLoad = false;
38 | strictEqual(getLanguagePackUrl('sv', 'sv'), null);
39 | });
40 |
--------------------------------------------------------------------------------
/js/tinymce/themes/inlite/src/test/js/browser/file/SelectionMatcher.js:
--------------------------------------------------------------------------------
1 | /**
2 | * SelectionMatcher.js
3 | *
4 | * Released under LGPL License.
5 | * Copyright (c) 1999-2016 Ephox Corp. All rights reserved
6 | *
7 | * License: http://www.tinymce.com/license
8 | * Contributing: http://www.tinymce.com/contributing
9 | */
10 |
11 | define('tinymce/inlite/core/SelectionMatcher', [
12 | 'tinymce/inlite/core/Matcher',
13 | 'tinymce/inlite/core/Measure'
14 | ], function (Matcher, Measure) {
15 | // textSelection :: String -> (Editor -> Matcher.result | Null)
16 | var textSelection = function (id) {
17 | return function (editor) {
18 | if (!editor.selection.isCollapsed()) {
19 | return Matcher.result(id, Measure.getSelectionRect(editor));
20 | }
21 |
22 | return null;
23 | };
24 | };
25 |
26 | // emptyTextBlock :: [Elements], String -> (Editor -> Matcher.result | Null)
27 | var emptyTextBlock = function (elements, id) {
28 | return function (editor) {
29 | var i, textBlockElementsMap = editor.schema.getTextBlockElements();
30 |
31 | for (i = 0; i < elements.length; i++) {
32 | if (elements[i].nodeName === 'TABLE') {
33 | return null;
34 | }
35 | }
36 |
37 | for (i = 0; i < elements.length; i++) {
38 | if (elements[i].nodeName in textBlockElementsMap) {
39 | if (editor.dom.isEmpty(elements[i])) {
40 | return Matcher.result(id, Measure.getSelectionRect(editor));
41 | }
42 |
43 | return null;
44 | }
45 | }
46 |
47 | return null;
48 | };
49 | };
50 |
51 | return {
52 | textSelection: textSelection,
53 | emptyTextBlock: emptyTextBlock
54 | };
55 | });
56 |
--------------------------------------------------------------------------------
/js/tinymce/themes/inlite/src/main/js/tinymce/inlite/core/SelectionMatcher.js:
--------------------------------------------------------------------------------
1 | /**
2 | * SelectionMatcher.js
3 | *
4 | * Released under LGPL License.
5 | * Copyright (c) 1999-2016 Ephox Corp. All rights reserved
6 | *
7 | * License: http://www.tinymce.com/license
8 | * Contributing: http://www.tinymce.com/contributing
9 | */
10 |
11 | define('tinymce/inlite/core/SelectionMatcher', [
12 | 'tinymce/inlite/core/Matcher',
13 | 'tinymce/inlite/core/Measure'
14 | ], function (Matcher, Measure) {
15 | // textSelection :: String -> (Editor -> Matcher.result | Null)
16 | var textSelection = function (id) {
17 | return function (editor) {
18 | if (!editor.selection.isCollapsed()) {
19 | return Matcher.result(id, Measure.getSelectionRect(editor));
20 | }
21 |
22 | return null;
23 | };
24 | };
25 |
26 | // emptyTextBlock :: [Elements], String -> (Editor -> Matcher.result | Null)
27 | var emptyTextBlock = function (elements, id) {
28 | return function (editor) {
29 | var i, textBlockElementsMap = editor.schema.getTextBlockElements();
30 |
31 | for (i = 0; i < elements.length; i++) {
32 | if (elements[i].nodeName === 'TABLE') {
33 | return null;
34 | }
35 | }
36 |
37 | for (i = 0; i < elements.length; i++) {
38 | if (elements[i].nodeName in textBlockElementsMap) {
39 | if (editor.dom.isEmpty(elements[i])) {
40 | return Matcher.result(id, Measure.getSelectionRect(editor));
41 | }
42 |
43 | return null;
44 | }
45 | }
46 |
47 | return null;
48 | };
49 | };
50 |
51 | return {
52 | textSelection: textSelection,
53 | emptyTextBlock: emptyTextBlock
54 | };
55 | });
56 |
--------------------------------------------------------------------------------
/.eslintrc:
--------------------------------------------------------------------------------
1 | {
2 | "env": {
3 | "browser": true,
4 | "amd": true
5 | },
6 |
7 | "globals": {
8 | "escape": true,
9 | "unescape": true,
10 | "Uint8Array": true
11 | },
12 |
13 | "rules": {
14 | "camelcase": 0,
15 | "strict": 0,
16 | "eqeqeq": 0,
17 | "no-underscore-dangle": 0,
18 | "consistent-return": 0,
19 | "no-shadow": 0,
20 | "no-use-before-define": 0,
21 | "brace-style": [2, "1tbs"],
22 | "guard-for-in": 0,
23 | "no-floating-decimal": 2,
24 | "no-nested-ternary": 2,
25 | "radix": 2,
26 | "wrap-iife": [2, "inside"],
27 | "consistent-this": [2, "self"],
28 | "no-bitwise": 2,
29 | "max-params": [2, 50],
30 | "max-depth": [1, 8],
31 | "max-statements": [2, 150],
32 | "max-len": [1, 140, 4],
33 | "eol-last": 0,
34 | "quotes": 0,
35 | "no-trailing-spaces": 2,
36 | "comma-spacing": [2, {"before": false, "after": true}],
37 | "space-in-parens": [2, "never"],
38 | "space-infix-ops": [2, {"int32Hint": false}],
39 | "keyword-spacing": 2,
40 | "space-unary-ops": [1, { "words": true, "nonwords": false }],
41 | "space-before-blocks": [2, "always"],
42 | "no-multiple-empty-lines": [1, {max: 2}],
43 | "object-curly-spacing": [2, "never"],
44 | "operator-linebreak": [2, "after"],
45 | "semi": [2, "always"],
46 | "indent": 0,
47 | "curly": [2, "all"],
48 | "dot-notation": [2, {"allowKeywords": false}],
49 | "no-else-return": 2,
50 | "no-eval": 2,
51 | "no-implied-eval": 2,
52 | "no-loop-func": 2,
53 | "no-multi-str": 2,
54 | "no-multi-spaces": 2,
55 | "no-sequences": 2,
56 | "no-new": 2,
57 | "no-caller": 2
58 | },
59 |
60 | "extends": "eslint:recommended"
61 | }
62 |
--------------------------------------------------------------------------------
/js/tinymce/classes/ui/FormItem.js:
--------------------------------------------------------------------------------
1 | /**
2 | * FormItem.js
3 | *
4 | * Released under LGPL License.
5 | * Copyright (c) 1999-2015 Ephox Corp. All rights reserved
6 | *
7 | * License: http://www.tinymce.com/license
8 | * Contributing: http://www.tinymce.com/contributing
9 | */
10 |
11 | /**
12 | * This class is a container created by the form element with
13 | * a label and control item.
14 | *
15 | * @class tinymce.ui.FormItem
16 | * @extends tinymce.ui.Container
17 | * @setting {String} label Label to display for the form item.
18 | */
19 | define("tinymce/ui/FormItem", [
20 | "tinymce/ui/Container"
21 | ], function(Container) {
22 | "use strict";
23 |
24 | return Container.extend({
25 | Defaults: {
26 | layout: 'flex',
27 | align: 'center',
28 | defaults: {
29 | flex: 1
30 | }
31 | },
32 |
33 | /**
34 | * Renders the control as a HTML string.
35 | *
36 | * @method renderHtml
37 | * @return {String} HTML representing the control.
38 | */
39 | renderHtml: function() {
40 | var self = this, layout = self._layout, prefix = self.classPrefix;
41 |
42 | self.classes.add('formitem');
43 | layout.preRender(self);
44 |
45 | return (
46 | 'a
'), 32 | sAssertUnlink('ab
', [0, 0, 0], 0, [0, 1], 1, 'ab
'), 33 | sAssertUnlink('b', [0, 0, 0], 0, [0, 0, 0], 1, '
a
\n'), 34 | sAssertUnlink('b', [0, 0, 0], 0, [1, 0, 0], 1, '
a
\nb
') 35 | ], onSuccess, onFailure); 36 | }, { 37 | }, success, failure); 38 | }); 39 | -------------------------------------------------------------------------------- /js/tinymce/classes/ui/Panel.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Panel.js 3 | * 4 | * Released under LGPL License. 5 | * Copyright (c) 1999-2015 Ephox Corp. All rights reserved 6 | * 7 | * License: http://www.tinymce.com/license 8 | * Contributing: http://www.tinymce.com/contributing 9 | */ 10 | 11 | /** 12 | * Creates a new panel. 13 | * 14 | * @-x-less Panel.less 15 | * @class tinymce.ui.Panel 16 | * @extends tinymce.ui.Container 17 | * @mixes tinymce.ui.Scrollable 18 | */ 19 | define("tinymce/ui/Panel", [ 20 | "tinymce/ui/Container", 21 | "tinymce/ui/Scrollable" 22 | ], function(Container, Scrollable) { 23 | "use strict"; 24 | 25 | return Container.extend({ 26 | Defaults: { 27 | layout: 'fit', 28 | containerCls: 'panel' 29 | }, 30 | 31 | Mixins: [Scrollable], 32 | 33 | /** 34 | * Renders the control as a HTML string. 35 | * 36 | * @method renderHtml 37 | * @return {String} HTML representing the control. 38 | */ 39 | renderHtml: function() { 40 | var self = this, layout = self._layout, innerHtml = self.settings.html; 41 | 42 | self.preRender(); 43 | layout.preRender(self); 44 | 45 | if (typeof innerHtml == "undefined") { 46 | innerHtml = ( 47 | '