Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds support for TinyMCE 4.x.x (Removes support from 3.x.x) #105

Closed
wants to merge 20 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
15 changes: 9 additions & 6 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ module.exports = function(grunt) {

uglify: {
options: {
beautify : {
ascii_only : true
} ,
preserveComments: false,
banner: '//\n' +
'// <%= pkg.name %> - v<%= pkg.version %>\n' +
Expand All @@ -64,7 +67,7 @@ module.exports = function(grunt) {
},
ice: {
files: {
'dist/ice.min.js': ['lib/rangy/rangy-core.js', 'src/polyfills.js', 'src/ice.js', 'src/dom.js', 'src/bookmark.js', 'src/selection.js', 'src/icePlugin.js', 'src/icePluginManager.js', 'src/plugins/IceAddTitlePlugin/IceAddTitlePlugin.js', 'src/plugins/IceCopyPastePlugin/IceCopyPastePlugin.js', 'src/plugins/IceSmartQuotesPlugin/IceSmartQuotesPlugin.js', 'src/plugins/IceEmdashPlugin/IceEmdashPlugin.js']
'dist/ice.min.js': ['dist/ice.js']
}
},
icemaster: {
Expand All @@ -76,17 +79,17 @@ module.exports = function(grunt) {
'//\n'
},
files: {
'ice-master.min.js': ['lib/rangy/rangy-core.js', 'src/polyfills.js', 'src/ice.js', 'src/dom.js', 'src/bookmark.js', 'src/selection.js', 'src/icePlugin.js', 'src/icePluginManager.js', 'src/plugins/IceAddTitlePlugin/IceAddTitlePlugin.js', 'src/plugins/IceCopyPastePlugin/IceCopyPastePlugin.js', 'src/plugins/IceSmartQuotesPlugin/IceSmartQuotesPlugin.js', 'src/plugins/IceEmdashPlugin/IceEmdashPlugin.js']
'ice-master.min.js': ['dist/ice.js']
}
},
tinyice: {
files: {
'dist/ice_editor_plugin.js': 'lib/tinymce/jscripts/tiny_mce/plugins/ice/editor_plugin.js'
'dist/ice_editor_plugin.js': 'lib/tinymce/js/tinymce/plugins/ice/plugin.min.js'
}
},
tinysr: {
files: {
'dist/sr_editor_plugin.js': 'lib/tinymce/jscripts/tiny_mce/plugins/icesearchreplace/editor_plugin.js'
'dist/sr_editor_plugin.js': 'lib/tinymce/js/tinymce/plugins/icesearchreplace/plugin.min.js'
}
}
},
Expand Down Expand Up @@ -125,7 +128,7 @@ module.exports = function(grunt) {

grunt.registerTask('test', ['connect', 'qunit']);

grunt.registerTask('build', ['clean:build', 'uglify:ice', 'uglify:icemaster', 'concat', 'compress:gz', 'cp', 'compress:zip']);
grunt.registerTask('build', ['clean:build', 'concat', 'uglify:ice', 'uglify:icemaster', 'compress:gz', 'cp', 'compress:zip']);

grunt.registerTask('cp', function() {
cpTinyDir('ice');
Expand All @@ -136,7 +139,7 @@ module.exports = function(grunt) {
});

var cpTinyDir = function(dir) {
grunt.file.recurse('lib/tinymce/jscripts/tiny_mce/plugins/' + dir + '/', function(abspath, rootdir, subdir, filename) {
grunt.file.recurse('lib/tinymce/js/tinymce/plugins/' + dir + '/', function(abspath, rootdir, subdir, filename) {
grunt.file.copy(rootdir + '/' + (subdir ? subdir + '/' : '') + filename,'dist/tinymce/plugins/' + dir + '/' + (subdir ? subdir + '/' : '') + '/' + filename);
});
};
Expand Down
25 changes: 15 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# ice.js

Ice is a track changes implementation, built in javascript, for anything that is `contenteditable` on the web. Conceived by the CMS Group at The New York Times, ice has been piloting successfully for articles written in the newsroom.
Ice is a track changes implementation, built in javascript, for anything that is `contenteditable` on the web. Conceived by the CMS Group at The New York Times, ice is powering the editor used for writing articles in the newsroom.

## Demo

[Check it out!](http://NYTimes.github.com/ice/demo/)
[Try it](http://NYTimes.github.com/ice/demo/)

## Download

[v0.4.2](http://nytimes.github.com/ice/downloads/ice_0.4.2.zip)
[v0.5.0](http://nytimes.github.com/ice/downloads/ice_0.5.0.zip)

## Features

Expand Down Expand Up @@ -111,17 +111,22 @@ Additional options:
```
***

**_Wordpress initialization_**
## Limitations/Dependencies

In testing - more to come soon.
- ice needs to be initialized after the DOM ready event fires.
- Wordpress support is limited. We need contribution from any willing WordPress developers.
- Browser support is limited to Firefox (5+) and Webkit browsers, and minimal support for IE8+.

***
## Changelog

## Limitations/Dependencies
### Master

- ice needs to be initialized after the DOM ready event fires.
- ice was originally created for the simple markup behind nytimes.com articles (`p`, `a`, `em`, `strong`). As such, it requires that all text editing takes place in a common root block element, and that there are no other blocks found in the editor. Any type of inline elements are ok, inside of the common root blocks.
- Unfortunately, we haven't been able to test this across all browsers and versions. We know that it tests well in modern Firefox (5+) and Webkit browsers, and "seems to work" in IE7+. We intend to do more testing and get a better idea about what ice can support across browsers.
- Fixes bug where Webkit browsers were throwing errors when the letter "v" was pressed.

### 0.5.0

- Fixes cut, copy, paste for Firefox and Webkit browsers.
- Fixes delete tracking in webkit browsers.

## License

Expand Down
4 changes: 2 additions & 2 deletions demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<script type="text/javascript" src='../src/plugins/IceCopyPastePlugin/IceCopyPastePlugin.js'></script>
<script type="text/javascript" src='../src/plugins/IceEmdashPlugin/IceEmdashPlugin.js'></script>
<script type="text/javascript" src='../src/plugins/IceSmartQuotesPlugin/IceSmartQuotesPlugin.js'></script>
<script type="text/javascript" src="../lib/tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript" src="../lib/tinymce/js/tinymce/tinymce.js"></script>

</head>

Expand Down Expand Up @@ -182,7 +182,7 @@ <h3>Tinymce Plugin</h3>
tinymce.init({
mode: "exact",
elements: "tinymce",
theme: "advanced",
theme: "modern",
plugins: 'ice,icesearchreplace',
theme_advanced_buttons1: "bold,italic,underline,|,bullist,numlist,|,undo,redo,code,|,search,replace,|,ice_togglechanges,ice_toggleshowchanges,iceacceptall,icerejectall,iceaccept,icereject",
theme_advanced_buttons2: "",
Expand Down
Empty file added demo/js/main.js
Empty file.
66 changes: 66 additions & 0 deletions demo/js/require-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
var require = {
"paths": {
"jquery": "http://code.jquery.com/jquery-1.9.1.min",
'tinymce': "tinymce/js/tinymce/tinymce",
"tinymce.jquery": "tinymce/js/tinymce/jquery.tinymce.min",
// "rangy": "rangy/rangy-core",
// "ice": "ice/ice",
// "icePluginManager": "ice/icePluginManager",
// "IceAddTitlePlugin":'ice/plugins/IceAddTitlePlugin/IceAddTitlePlugin',
// "IceCopyPastePlugin":'ice/plugins/IceCopyPastePlugin/IceCopyPastePlugin.js',
// "IceEmdashPlugin":'ice/plugins/IceEmdashPlugin/IceEmdashPlugin.js',
// "IceSmartQuotesPlugin":'ice/plugins/IceSmartQuotesPlugin/IceSmartQuotesPlugin.js',

"jquery1.9": "http://code.jquery.com/jquery-1.9.1.min",
"jquery-migrate" : "http://code.jquery.com/jquery-migrate-1.0.0",
"rangy-core": "../../lib/rangy/rangy-core",
"polyfills": "../../src/polyfills",
"ice":"../../src/ice",
"dom":"../../src/dom",
"icePlugin":"../../src/icePlugin",
"icePluginManager":"../../src/icePluginManager",
"bookmark":"../../src/bookmark",
"selection":"../../src/selection",
"IceAddTitlePlugin":"../../src/plugins/IceAddTitlePlugin/IceAddTitlePlugin",
"IceCopyPastePlugin":"../../src/plugins/IceCopyPastePlugin/IceCopyPastePlugin",
"IceEmdashPlugin":"../../src/plugins/IceEmdashPlugin/IceEmdashPlugin",
"IceSmartQuotesPlugin":"../../src/plugins/IceSmartQuotesPlugin/IceSmartQuotesPlugin",
"tinymce":"../../lib/tinymce/jscripts/tinymce4/tinymce",
},
"shim": {
"jquery1.9": {
exports: "$"
},
"rangy-core": {
exports: "window.rangy"
},
"dom": {
deps:['ice'],
exports: "dom"
},
"selection" : {
exports: "Selection"
},
"bookmark": {
exports: "Bookmark"
},
"ice" : {
exports: "ice"
},
"icePluginManager": {deps: ['ice'] },
"IceAddTitlePlugin":{ deps: ['icePluginManager']},
"IceCopyPastePlugin":{ deps: ['icePluginManager']},
"IceEmdashPlugin":{ deps: ['icePluginManager']},
"IceSmartQuotesPlugin":{ deps: ['icePluginManager']},
"tinymce": {
exports: "tinymce",
init: function() {
this.tinymce.DOM.events.domLoaded = true;
return this.tinymce;
}
},
"tinymce.jquery" :{
deps: ['jquery']
}
}
};
Loading