From a0aa2eaab932ea202cff4e14e39a9d12d8e737d3 Mon Sep 17 00:00:00 2001 From: Blake Grotewold Date: Tue, 1 Apr 2014 19:25:59 -0500 Subject: [PATCH 1/2] Add disableSelection to stop highlighting --- script/engine.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/script/engine.js b/script/engine.js index 032e976..bbb8b64 100644 --- a/script/engine.js +++ b/script/engine.js @@ -85,6 +85,8 @@ var Engine = { if(Engine.isMobile()) { window.location = 'mobileWarning.html'; } + + Engine.disableSelection(); if(this.options.state != null) { window.State = this.options.state; @@ -565,6 +567,11 @@ var Engine = { Engine.activeModule.swipeDown(e); } }, + + disableSelection: function() { + document.onselectstart = function() {return false;} // this is for IE + document.onmousedown = function() {return false;} // this is for the rest + }, handleStateUpdates: function(e){ From e4b56f64c1f25871e354042eb47c9b9005270bbc Mon Sep 17 00:00:00 2001 From: Blake Grotewold Date: Wed, 2 Apr 2014 00:22:30 -0500 Subject: [PATCH 2/2] Create enableSelection function, Make selection available during export --- script/engine.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/script/engine.js b/script/engine.js index bbb8b64..0b69928 100644 --- a/script/engine.js +++ b/script/engine.js @@ -250,6 +250,7 @@ var Engine = { string64 = string64.replace(/\s/g, ''); string64 = string64.replace(/\./g, ''); string64 = string64.replace(/\n/g, ''); + Engine.enableSelection(); Events.startEvent({ title: 'Export', scenes: { @@ -259,7 +260,8 @@ var Engine = { buttons: { 'done': { text: 'got it', - nextScene: 'end' + nextScene: 'end', + onChoose: Engine.disableSelection } } } @@ -572,6 +574,11 @@ var Engine = { document.onselectstart = function() {return false;} // this is for IE document.onmousedown = function() {return false;} // this is for the rest }, + + enableSelection: function() { + document.onselectstart = function() {return true;} + document.onmousedown = function() {return true;} + }, handleStateUpdates: function(e){