=== modified file 'src/com/goldencode/p2j/ui/client/chui/driver/web/res/p2j.clipboard_helpers.js' --- src/com/goldencode/p2j/ui/client/chui/driver/web/res/p2j.clipboard_helpers.js 2015-05-18 20:48:28 +0000 +++ src/com/goldencode/p2j/ui/client/chui/driver/web/res/p2j.clipboard_helpers.js 2015-07-31 12:09:20 +0000 @@ -10,10 +10,12 @@ ** ** -#- -I- --Date-- ------------------------------Description---------------------------------- ** 001 GES 20150324 First version, with refactored content moved from tty.clipboard.js. +** 002 SBI 20150729 Applied "use strict" directive, fixed undeclared variables. */ p2j.clipboard_helpers = (function() { + "use strict"; /** Clipboard helper object which will be returned from this initialization function. */ var me = {}; @@ -71,8 +73,8 @@ */ me.mouseDown = function(e) { - var x = (e.pageX - this.offsetLeft) | 0; - var y = (e.pageY - this.offsetTop) | 0; + var x = (e.pageX - canvas.offsetLeft) | 0; + var y = (e.pageY - canvas.offsetTop) | 0; cells.startX = (x / charWidth) | 0; cells.startY = (y / charHeight) | 0; rect.startX = cells.startX * charWidth; @@ -87,8 +89,8 @@ */ me.mouseMove = function(e) { - var x = (e.pageX - this.offsetLeft | 0); - var y = (e.pageY - this.offsetTop | 0); + var x = (e.pageX - canvas.offsetLeft) | 0; + var y = (e.pageY - canvas.offsetTop) | 0; cells.startX1 = (x / charWidth) | 0; cells.startY1 = (y / charHeight) | 0; === modified file 'src/com/goldencode/p2j/ui/client/chui/driver/web/res/p2j.screen.js' --- src/com/goldencode/p2j/ui/client/chui/driver/web/res/p2j.screen.js 2015-05-18 20:48:28 +0000 +++ src/com/goldencode/p2j/ui/client/chui/driver/web/res/p2j.screen.js 2015-07-31 12:09:20 +0000 @@ -19,10 +19,13 @@ ** 007 MAG 20140821 Extended color palette. ** 008 GES 20150325 Renamed objects to match the more generic web client approach (not just ** ChUI). Moved some logic to common code locations. +** 009 SBI 20150729 Applied "use strict" directive, fixed undeclared variables, +** added end-lines on copy. */ p2j.screen = (function() { + "use strict"; /** Screen object which will be returned from this initialization function. */ var me = {}; @@ -76,10 +79,10 @@ { me.color = color; memo = new Array(rows); - for (i = 0; i < rows; i++) + for (var i = 0; i < rows; i++) { memo[i] = new Array(cols); - for (j = 0; j < cols; j++) + for (var j = 0; j < cols; j++) { var cell = {'c': ' ', 'f': 'white', 'b': 'black', 'a': 0, 'k': 0}; cell.f = color.f; @@ -97,9 +100,9 @@ */ me.clear = function(rows, cols) { - for (i = 0; i < rows; i++) + for (var i = 0; i < rows; i++) { - for (j = 0; j < cols; j++) + for (var j = 0; j < cols; j++) { var v = memo[i][j]; v.c = ' '; @@ -156,14 +159,17 @@ */ me.copy = function(begRow, endRow, begCol, endCol) { - var text = ""; - for (i = begRow; i <= endRow; i++) + var text = ""; + for (var i = begRow; i <= endRow; i++) { - for (j = begCol; j <= endCol; j++) + for (var j = begCol; j <= endCol; j++) { text += memo[i][j].c; } - } + if (i < endRow) { + text += "\n";//add end of line + } + } return text; }; === modified file 'src/com/goldencode/p2j/ui/client/driver/web/index.html' --- src/com/goldencode/p2j/ui/client/driver/web/index.html 2015-05-18 20:48:28 +0000 +++ src/com/goldencode/p2j/ui/client/driver/web/index.html 2015-07-31 12:09:20 +0000 @@ -4,7 +4,6 @@ P2J ${client_title} Web Client - @@ -17,11 +16,12 @@ -