Skip to content

Commit

Permalink
fixed pasting with woofmark include, updated deps (#34)
Browse files Browse the repository at this point in the history
* fixed pasting with woofmark include, updated deps

* fixed horsey version
  • Loading branch information
jywarren authored Aug 15, 2016
1 parent 556022a commit 3d4808a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 15 deletions.
15 changes: 1 addition & 14 deletions dist/PublicLab.Editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -33688,25 +33688,12 @@ function handleModeChange (state, e) {
}
}

function handlePaste (state, e) {
console.log(state,state.inputState, state.inputState.text, state.surface.read(state.inputMode), state.refreshing)
function handlePaste (state) {
if (state.inputState && state.inputState.text !== state.surface.read(state.inputMode) && state.refreshing === null) {
var pastedText;
if (window.clipboardData && window.clipboardData.getData) { // IE
pastedText = window.clipboardData.getData('Text');
} else if (e.clipboardData && e.clipboardData.getData) {
pastedText = e.clipboardData.getData('text/plain');
}
var chunks = state.inputState.getChunks();
pastedText = pastedText.replace(/(\A<br\s?\/?\w?>)|(<br\s?\/?\w?>\z)/g, '');
chunks.before += pastedText;
state.inputState.setChunks(chunks);
console.log(state);
state.historyMode = 'paste';
state.saveState();
state.refreshState();
}
return false;
}

function preventCtrlYZ (e) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "publiclab-editor",
"version": "0.1.1",
"version": "0.1.3",
"description": "PublicLab.Editor is a general purpose, JavaScript/Bootstrap UI framework for rich text posting, which provides an author-friendly, minimal, mobile/desktop (fluid) interface for creating blog-like content, designed for PublicLab.org",
"main": "dist/PublicLab.Editor.js",
"scripts": {
Expand Down

0 comments on commit 3d4808a

Please sign in to comment.