From bd0adda73f6851ef0613d3c49fb12d9cecef33b4 Mon Sep 17 00:00:00 2001 From: jdescottes Date: Tue, 11 Feb 2014 22:04:44 +0100 Subject: [PATCH] Various bug fixes - Added missing files from previous commit - Fixed move cursor that would remain after using a Selection tool - Switched to mousedown for Tool Selection to avoid missed clicks --- img/local-storage-icon.png | Bin 0 -> 1308 bytes js/controller/ToolController.js | 3 +- .../settings/LocalStorageController.js | 70 ++++++++++++++++++ js/drawingtools/Move.js | 4 +- js/drawingtools/selectiontools/BaseSelect.js | 2 +- templates/settings/localstorage.html | 18 +++++ 6 files changed, 94 insertions(+), 3 deletions(-) create mode 100644 img/local-storage-icon.png create mode 100644 js/controller/settings/LocalStorageController.js create mode 100644 templates/settings/localstorage.html diff --git a/img/local-storage-icon.png b/img/local-storage-icon.png new file mode 100644 index 0000000000000000000000000000000000000000..d9b757e71ec3f63780eb22004e05e4273b441ec1 GIT binary patch literal 1308 zcmV+%1>^dOP)w2&Iy*JbKg<)p8URV8jKYms9ud42WEX$1HIxNLPTz~=f@(3QSxs6H1z^EW6<7wQ} z<@W!=x!BX?cKepW(ce$%z8EkI5A>kjzGWcGvTN{G4`WC!8N(p%?r{vWaDR_u=o<#I zEc*r*_Bf8@l2HaRzt=$sF1fGQLG%Ly*|>Rc57{laWN(k-=qZD(KhiZ$mBy03atO&K zedQ2>OBy|v^qWIyxJ&v`5ZHh(dL2Xrd+-^)#6O)>)USd}Rt{hVR<>I~5~Lnp#chcG zZu@OepDHZEz3tqX98w?qF$V`@Zb}ZRkC|8yd(-hX1QN@y*wyPGYT~Te8@esX2-f36 zd_DTJyUQ{3HQf^AFjnC){M4m3CnenwWE~#FjxMw{>8X2Ae;7+7F-lXHLo#8J@VT1m zpR&{;$PrE6kqqSR{#2md*I33PE00yeqb>g8G}n8migCy%O)`Tt8b_YEQe8 zt@&Hn?%mhvm-W4TF$m8pCNawKny|{z@fWswg0j?Im1phIKRW5MG9mZanNxO|uwa&G z%`Rc@{a-qB$UE}IfT0fRZ5r#1ia}?B3>REK5qES@Z_`*a_MdhI*@ukGE_VpDKn4ZeJ#Ww2-51^9K!|Ir{k`;m>NyX z?usDDwh77)2-Dp>ZpLYmK{b^TCG)gFd^$n-Mj;{0V<;}BM)QV}kADy13B?KDaKZIC zxIQ|p=2EJ=A_($>@I=#ib_k1!c`Vi+Z-JN${3$r36h~)SD{(9S7*m#Vk80Q;j3K2M z7?*~ej;nDwo|Qk{U4YL!2(W2ffe*@lc)TEGct*otR2ji`AsH-9?0(2JDffusm{TRK zh!x}}oDthdgQ;DRv{X`_kA&6TC}ISejT>ScXfV<4AWo3Q(!-l&IgA(Ex$!^e!Wti+ SDG+1;0000 k2.date) {return -1;} + return 0; + }); + + keys.forEach((function (key) { + var date = new Date(key.date); + var formattedDate = pskl.utils.Template.replace("{{Y}}/{{M}}/{{D}} {{H}}:{{m}}", { + Y : date.getFullYear(), + M : pad(date.getMonth() + 1), + D : pad(date.getDate()), + H : pad(date.getHours()), + m : pad(date.getMinutes()) + }); + html += pskl.utils.Template.replace(this.localStorageItemTemplate_, {name : key.name, date : formattedDate}); + }).bind(this)); + + var tableBody_ = this.piskelsList.get(0).tBodies[0]; + tableBody_.innerHTML = html; + }; + +})(); \ No newline at end of file diff --git a/js/drawingtools/Move.js b/js/drawingtools/Move.js index 1635e0cf..0ff49857 100644 --- a/js/drawingtools/Move.js +++ b/js/drawingtools/Move.js @@ -7,7 +7,7 @@ var ns = $.namespace("pskl.drawingtools"); ns.Move = function() { - this.toolId = "tool-move"; + this.toolId = ns.Move.TOOL_ID; this.helpText = "Move tool"; // Stroke's first point coordinates (set in applyToolAt) @@ -15,6 +15,8 @@ this.startRow = null; }; + ns.Move.TOOL_ID = "tool-move"; + pskl.utils.inherit(ns.Move, ns.BaseTool); /** diff --git a/js/drawingtools/selectiontools/BaseSelect.js b/js/drawingtools/selectiontools/BaseSelect.js index b5ca0da1..b6cb3b0b 100644 --- a/js/drawingtools/selectiontools/BaseSelect.js +++ b/js/drawingtools/selectiontools/BaseSelect.js @@ -7,7 +7,7 @@ var ns = $.namespace("pskl.drawingtools"); ns.BaseSelect = function() { - this.secondaryToolId = "tool-move"; + this.secondaryToolId = pskl.drawingtools.Move.TOOL_ID; this.BodyRoot = $('body'); // Select's first point coordinates (set in applyToolAt) diff --git a/templates/settings/localstorage.html b/templates/settings/localstorage.html new file mode 100644 index 00000000..524cb15e --- /dev/null +++ b/templates/settings/localstorage.html @@ -0,0 +1,18 @@ +
+
+ Browse Local Piskels +
+
+ + +
+
+ +
\ No newline at end of file