From 334142bbdfb8f78927d7ddb3add1316fe84668a4 Mon Sep 17 00:00:00 2001 From: benweet Date: Fri, 22 Aug 2014 00:14:58 +0100 Subject: [PATCH] Fixed IE11 compatibility --- bower.json | 2 +- public/res/editor.js | 6 +++--- public/res/extensions/umlDiagrams.js | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/bower.json b/bower.json index 96a1c20f..e2df3834 100644 --- a/bower.json +++ b/bower.json @@ -29,7 +29,7 @@ "jsondiffpatch": "https://github.com/benweet/jsondiffpatch.git#fb9dddf7cd076d8ec89d376c0e9de9223e9888f9", "hammerjs": "~1.0.10", "raphael": "~2.1.2", - "js-sequence-diagrams": "https://github.com/benweet/js-sequence-diagrams.git#7b157daa2deaf5b46b320673cc2ddabe6f013725", + "js-sequence-diagrams": "https://github.com/benweet/js-sequence-diagrams.git#d60c973aa0ff148dc588c7ceee0b41e59dff3f9f", "flowchart": "https://github.com/adrai/flowchart.js.git#~1.2.10", "monetizejs": "~0.2.0" } diff --git a/public/res/editor.js b/public/res/editor.js index 1c2da95f..e9342dc9 100644 --- a/public/res/editor.js +++ b/public/res/editor.js @@ -275,7 +275,7 @@ define([ } if(selectionStart === selectionEnd && selectionStart > textContent.length) { // In Firefox cursor can be after the trailingLfNode - selection.nativeSelection.modify("move", "backward", "character"); + selection.nativeSelection.modify && selection.nativeSelection.modify("move", "backward", "character"); selectionStart = --selectionEnd; } } @@ -644,10 +644,10 @@ define([ eventMgr.addListener('onCommentsChanged', onComment); var triggerSpellCheck = _.debounce(function() { - if(!selectionMgr.hasFocus || selectionMgr.selectionStart !== selectionMgr.selectionEnd) { + var selection = window.getSelection(); + if(!selectionMgr.hasFocus || selectionMgr.selectionStart !== selectionMgr.selectionEnd || !selection.modify) { return; } - var selection = window.getSelection(); // Hack for Chrome to trigger the spell checker if(selectionMgr.selectionStart) { selection.modify("move", "backward", "character"); diff --git a/public/res/extensions/umlDiagrams.js b/public/res/extensions/umlDiagrams.js index ccf3150f..f1d5f3ec 100644 --- a/public/res/extensions/umlDiagrams.js +++ b/public/res/extensions/umlDiagrams.js @@ -6,9 +6,9 @@ define([ "classes/Extension", "text!html/umlDiagramsSettingsBlock.html", 'crel', - 'sequence-diagram', + 'Diagram', 'flow-chart' -], function($, _, utils, logger, Extension, umlDiagramsSettingsBlockHTML, crel, sequenceDiagram, flowChart) { +], function($, _, utils, logger, Extension, umlDiagramsSettingsBlockHTML, crel, Diagram, flowChart) { var umlDiagrams = new Extension("umlDiagrams", "UML Diagrams", true); umlDiagrams.settingsBlock = umlDiagramsSettingsBlockHTML; @@ -18,7 +18,7 @@ define([ editor.hooks.chain("onPreviewRefresh", function() { _.each(previewContentsElt.querySelectorAll('.prettyprint > .language-sequence'), function(elt) { try { - var diagram = sequenceDiagram.parse(elt.textContent); + var diagram = Diagram.parse(elt.textContent); var preElt = elt.parentNode; var containerElt = crel('div', { class: 'sequence-diagram'