Skip to content

Commit

Permalink
Remove deprecated Post#cloneRange Editor#registerExpansion, Editor#on
Browse files Browse the repository at this point in the history
  • Loading branch information
bantic committed Jul 21, 2016
1 parent 1784346 commit 272a2c7
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 60 deletions.
27 changes: 1 addition & 26 deletions src/js/editor/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import DOMParser from '../parsers/dom';
import Renderer from 'mobiledoc-kit/renderers/editor-dom';
import RenderTree from 'mobiledoc-kit/models/render-tree';
import mobiledocRenderers from '../renderers/mobiledoc';
import { MOBILEDOC_VERSION } from 'mobiledoc-kit/renderers/mobiledoc';
import { mergeWithOptions } from '../utils/merge';
import { clearChildNodes, addClassName } from '../utils/dom-utils';
import { forEach, filter, contains, values } from '../utils/array-utils';
Expand All @@ -17,7 +18,6 @@ import Range from '../utils/cursor/range';
import Position from '../utils/cursor/position';
import PostNodeBuilder from '../models/post-node-builder';
import { DEFAULT_TEXT_INPUT_HANDLERS } from './text-input-handlers';
import { convertExpansiontoHandler } from './text-expansion-handler';
import {
DEFAULT_KEY_COMMANDS, buildKeyCommand, findKeyCommands, validateKeyCommand
} from './key-commands';
Expand All @@ -26,7 +26,6 @@ import { detect } from '../utils/array-utils';
import assert from '../utils/assert';
import deprecate from '../utils/deprecate';
import MutationHandler from 'mobiledoc-kit/editor/mutation-handler';
import { MOBILEDOC_VERSION } from 'mobiledoc-kit/renderers/mobiledoc';
import EditHistory from 'mobiledoc-kit/editor/edit-history';
import EventManager from 'mobiledoc-kit/editor/event-manager';
import EditState from 'mobiledoc-kit/editor/edit-state';
Expand Down Expand Up @@ -267,21 +266,6 @@ class Editor {
return this._keyCommands;
}

/**
* Prefer {@link Editor#onTextInput} to `registerExpansion`.
* @param {Object} expansion
* @param {String} expansion.text
* @param {Function} expansion.run This callback will be invoked with an `editor` argument
* @param {Number} [expansion.trigger] The keycode (e.g. 32 for `<space>`) that will trigger the expansion after the text is entered
* @deprecated since v0.9.3
* @public
*/
registerExpansion(expansion) {
deprecate('Use `Editor#onTextInput` instead of `registerExpansion`');
let handler = convertExpansiontoHandler(expansion);
this.onTextInput(handler);
}

/**
* @param {Object} keyCommand The key command to register. It must specify a
* modifier key (meta, ctrl, etc), a string representing the ascii key, and
Expand Down Expand Up @@ -1019,15 +1003,6 @@ class Editor {
}
this._callbacks.runCallbacks(...args);
}

/**
* @deprecated since 0.9.1
*/
on(eventName, callback) {
deprecate('`on` is deprecated. Use `postDidChange(callback)` instead to handle post changes');
assert('Cannot add listener for event other than "update"', eventName === 'update');
this.postDidChange(callback);
}
}

export default Editor;
24 changes: 0 additions & 24 deletions src/js/editor/text-expansion-handler.js

This file was deleted.

10 changes: 0 additions & 10 deletions src/js/models/post.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ import { POST_TYPE } from './types';
import LinkedList from 'mobiledoc-kit/utils/linked-list';
import { forEach, compact } from 'mobiledoc-kit/utils/array-utils';
import Set from 'mobiledoc-kit/utils/set';
import mobiledocRenderers from 'mobiledoc-kit/renderers/mobiledoc';
import Range from 'mobiledoc-kit/utils/cursor/range';
import Position from 'mobiledoc-kit/utils/cursor/position';
import deprecate from 'mobiledoc-kit/utils/deprecate';

/**
* The Post is an in-memory representation of an editor's document.
Expand Down Expand Up @@ -254,14 +252,6 @@ class Post {
}
}

/**
* @deprecated since 0.9.1
*/
cloneRange(range) {
deprecate('post#cloneRange is deprecated. See post#trimTo(range) and editor#serializePost');
return mobiledocRenderers.render(this.trimTo(range));
}

/**
* @param {Range} range
* @return {Post} A new post, constrained to {range}
Expand Down

0 comments on commit 272a2c7

Please sign in to comment.