From dd5114395ad56ac7a7142c9c3463a1867120e326 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rafa=C3=ABl=20Blais=20Masson?=
Date: Wed, 11 Apr 2012 20:16:44 -0400
Subject: [PATCH 01/46] Missing semi-colons
---
public/js/lib/views/arrow_configuration_view.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/public/js/lib/views/arrow_configuration_view.js b/public/js/lib/views/arrow_configuration_view.js
index ae36bca..0f92710 100644
--- a/public/js/lib/views/arrow_configuration_view.js
+++ b/public/js/lib/views/arrow_configuration_view.js
@@ -97,10 +97,10 @@ if (!('CSSArrowPlease' in window)) window.CSSArrowPlease = {};
var target = $(ev.currentTarget),
val = parseInt(target.val()),
increment = ev.keyCode == 38 ? 1 : -1,
- multiply = ev.shiftKey ? 10 : 1
+ multiply = ev.shiftKey ? 10 : 1;
target.val(val + increment * multiply);
- this._updateModel(ev)
+ this._updateModel(ev);
}
};
From 766a0567b82835f102466644ef450e885fc0fa49 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rafa=C3=ABl=20Blais=20Masson?=
Date: Wed, 11 Apr 2012 20:24:25 -0400
Subject: [PATCH 02/46] =?UTF-8?q?Don=E2=80=99t=20allow=20negative=20values?=
=?UTF-8?q?=20for=20Size=20and=20Border=20width?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/js/lib/views/arrow_configuration_view.js | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/public/js/lib/views/arrow_configuration_view.js b/public/js/lib/views/arrow_configuration_view.js
index 0f92710..1d48470 100644
--- a/public/js/lib/views/arrow_configuration_view.js
+++ b/public/js/lib/views/arrow_configuration_view.js
@@ -97,9 +97,12 @@ if (!('CSSArrowPlease' in window)) window.CSSArrowPlease = {};
var target = $(ev.currentTarget),
val = parseInt(target.val()),
increment = ev.keyCode == 38 ? 1 : -1,
- multiply = ev.shiftKey ? 10 : 1;
+ multiply = ev.shiftKey ? 10 : 1
+ newVal = val + increment * multiply;
- target.val(val + increment * multiply);
+ if (newVal < 0) newVal = 0;
+
+ target.val(newVal);
this._updateModel(ev);
}
From 9d6f6dd952108739ff393d775ba3aa55038a6ea9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rafa=C3=ABl=20Blais=20Masson?=
Date: Wed, 11 Apr 2012 20:44:34 -0400
Subject: [PATCH 03/46] Spec for preventing negative values for Size and Border
width
---
public/js/spec/views/arrow_configuration_view_spec.js | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/public/js/spec/views/arrow_configuration_view_spec.js b/public/js/spec/views/arrow_configuration_view_spec.js
index a6388dc..70731d6 100644
--- a/public/js/spec/views/arrow_configuration_view_spec.js
+++ b/public/js/spec/views/arrow_configuration_view_spec.js
@@ -87,12 +87,15 @@ describe("CSSArrowPlease.ArrowConfigurationView", function () {
arrowAttr = object.arrowAttr;
$.each(keystrokes, function (i, keystroke) {
- var keydown = $.Event('keydown')
+ var keydown = $.Event('keydown'),
+ expectedVal = defaultVal + keystroke.increment;
keydown.keyCode = keystroke.key;
keydown.shiftKey = keystroke.shift;
elem.val(defaultVal).trigger(keydown);
- expect( arrow.get(arrowAttr) ).toEqual(defaultVal + keystroke.increment);
+
+ if (expectedVal < 0) expectedVal = 0;
+ expect( arrow.get(arrowAttr) ).toEqual(expectedVal);
});
});
});
From a76930ce50f405e217a243f4fce678e3cacc3baf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rafa=C3=ABl=20Blais=20Masson?=
Date: Thu, 12 Apr 2012 10:25:17 -0400
Subject: [PATCH 04/46] Missing comma
---
public/js/lib/views/arrow_configuration_view.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/public/js/lib/views/arrow_configuration_view.js b/public/js/lib/views/arrow_configuration_view.js
index 1d48470..eb45e04 100644
--- a/public/js/lib/views/arrow_configuration_view.js
+++ b/public/js/lib/views/arrow_configuration_view.js
@@ -97,7 +97,7 @@ if (!('CSSArrowPlease' in window)) window.CSSArrowPlease = {};
var target = $(ev.currentTarget),
val = parseInt(target.val()),
increment = ev.keyCode == 38 ? 1 : -1,
- multiply = ev.shiftKey ? 10 : 1
+ multiply = ev.shiftKey ? 10 : 1,
newVal = val + increment * multiply;
if (newVal < 0) newVal = 0;
From f28a8c4ba590b347ebec3740c780617963cc4be0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Peter=20M=C3=BCller?=
Date: Fri, 13 Apr 2012 16:26:36 +0200
Subject: [PATCH 05/46] Optimized frontend performance by delaying google and
twitter scripts till after the application is loaded
---
public/index.html | 26 +++++++++++++++++++++-----
1 file changed, 21 insertions(+), 5 deletions(-)
diff --git a/public/index.html b/public/index.html
index 79fcfde..ffa2060 100644
--- a/public/index.html
+++ b/public/index.html
@@ -67,7 +67,6 @@ Arrow configuration
-
@@ -88,11 +87,28 @@ Arrow configuration
_gaq.push(['_trackPageview']);
(function() {
- var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
- ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
- var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
- })();
+ var defer = (function (document, script) {
+ var urls = [],
+ firstScript = document.getElementsByTagName(script)[0];
+
+ return function (url, callback) {
+ var inc;
+ if (url && urls.indexOf(url) === -1) {
+ inc = document.createElement(script);
+ inc.async = true;
+ inc.src = url;
+ inc.onload = callback || function () {};
+ firstScript.parentNode.insertBefore(inc, firstScript);
+ }
+ }
+ }(document, 'script'));
+
+ window.onload = function () {
+ defer(('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js');
+ defer('//platform.twitter.com/widgets.js');
+ };
+ })();