From ac574b4ad6a1da78ef0842762325bdecf6726df7 Mon Sep 17 00:00:00 2001 From: Cyril Michel HANSEN Date: Tue, 28 Feb 2012 09:20:15 +0100 Subject: [PATCH] keycode changes impose the use of noVNC keyboard event system in all variant. Fixed broken demos, both GWT mode and stand alone mode are now possible --- build/scripts/version.compile.pack.sh | 5 +++++ build/scripts/version.compile.sh | 4 ++++ documentation/demos/demo20/text_editor_org.html | 4 ++-- src/model/mouseevent.js | 7 +++++-- src/modules/TextInput/TextInput.js | 14 ++++++++++++-- 5 files changed, 28 insertions(+), 6 deletions(-) diff --git a/build/scripts/version.compile.pack.sh b/build/scripts/version.compile.pack.sh index b499e6c8..1934974d 100755 --- a/build/scripts/version.compile.pack.sh +++ b/build/scripts/version.compile.pack.sh @@ -36,6 +36,9 @@ echo -e "Created on:" >> "${FILE_CAAT}" date "+DATE: %Y-%m-%d%nTIME: %H:%M:%S" >> "${FILE_CAAT}" echo -e "*/\n\n" >> "${FILE_CAAT}" + +more $CAAT_SRC_DIR/modules/TextInput/noVNC_Util.js >> "${FILE_CAAT}" +more $CAAT_SRC_DIR/modules/TextInput/noVNC_Input.js >> "${FILE_CAAT}" more $CAAT_SRC_DIR/CAAT.js >> "${FILE_CAAT}" more $CAAT_SRC_DIR/core/class.js >> "${FILE_CAAT}" more $CAAT_SRC_DIR/math/affinetransform2D.js >> "${FILE_CAAT}" @@ -94,6 +97,8 @@ echo -e "Created on:" >> "${FILE_CAAT_CSS}" date "+DATE: %Y-%m-%d%nTIME: %H:%M:%S" >> "${FILE_CAAT_CSS}" echo -e "*/\n\n" >> "${FILE_CAAT_CSS}" +more $CAAT_SRC_DIR/modules/TextInput/noVNC_Util.js >> "${FILE_CAAT_CSS}" +more $CAAT_SRC_DIR/modules/TextInput/noVNC_Input.js >> "${FILE_CAAT_CSS}" more $CAAT_SRC_DIR/CAAT.js >> "${FILE_CAAT_CSS}" echo -e "CAAT.__CSS__=1;" >> "${FILE_CAAT_CSS}" more $CAAT_SRC_DIR/core/class.js >> "${FILE_CAAT_CSS}" diff --git a/build/scripts/version.compile.sh b/build/scripts/version.compile.sh index 0bdd0352..46793be7 100755 --- a/build/scripts/version.compile.sh +++ b/build/scripts/version.compile.sh @@ -113,6 +113,8 @@ echo -e "*/\n\n" >> "${FILE_CAAT_TEXTINPUT}" # echo -e "\nCreating CAAT canvas/webGL" $JAVA -jar $CLOSURE_COMPILER_JAR --compilation_level "${COMPILATION_LEVEL}" \ + --js "${SOURCE_DIR}"/modules/TextInput/noVNC_Util.js \ + --js "${SOURCE_DIR}"/modules/TextInput/noVNC_Input.js \ --js "${SOURCE_DIR}"/CAAT.js \ --js "${SOURCE_DIR}"/core/browserdetect.js \ --js "${SOURCE_DIR}"/core/class.js \ @@ -162,6 +164,8 @@ $JAVA -jar $CLOSURE_COMPILER_JAR --compilation_level "${COMPILATION_LEVEL}" --js echo "Creating CAAT CSS" echo -e "CAAT.__CSS__=1;" >> /tmp/__css.js $JAVA -jar $CLOSURE_COMPILER_JAR --compilation_level "${COMPILATION_LEVEL}" \ + --js "${SOURCE_DIR}"/modules/TextInput/noVNC_Util.js \ + --js "${SOURCE_DIR}"/modules/TextInput/noVNC_Input.js \ --js "${SOURCE_DIR}"/CAAT.js \ --js /tmp/__css.js \ --js "${SOURCE_DIR}"/core/browserdetect.js \ diff --git a/documentation/demos/demo20/text_editor_org.html b/documentation/demos/demo20/text_editor_org.html index 49238929..a2b0e4cd 100644 --- a/documentation/demos/demo20/text_editor_org.html +++ b/documentation/demos/demo20/text_editor_org.html @@ -63,7 +63,7 @@

Text input

- + @@ -326,4 +326,4 @@

Text input

- \ No newline at end of file + diff --git a/src/model/mouseevent.js b/src/model/mouseevent.js index c7cb139b..e211c399 100644 --- a/src/model/mouseevent.js +++ b/src/model/mouseevent.js @@ -369,7 +369,10 @@ CAAT.GlobalEnableEvents= function __GlobalEnableEvents() { this.GlobalEventsEnabled= true; // Setup and activation of NoVNC key events library - keyboard = new Keyboard({'target': MAINDOC, + if (typeof(CAAT_EVT_SRC)=='undefined') { + CAAT_EVT_SRC = window; + } + keyboard = new Keyboard({'target': CAAT_EVT_SRC, 'onKeyPress': function(keysym, down, evt) { if (down) { @@ -444,7 +447,7 @@ CAAT.GlobalEnableEvents= function __GlobalEnableEvents() { - MAINDOC.addEventListener('resize', + CAAT_EVT_SRC.addEventListener('resize', function(evt) { for( var i=0; i