visage-app 0.2.2 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/AUTHORS ADDED
@@ -0,0 +1,9 @@
1
+ Visage was written by
2
+ =====================
3
+ Lindsay Holmwood <lindsay@holmwood.id.au>
4
+
5
+ Contributors include
6
+ --------------------
7
+ Jeffrey Lim <jfs.world@gmail.com>
8
+ Andrew Harvey <andrew@mootpointer.com>
9
+ Xavier Mehrenberger <xavier.mehrenberger@gmail.com>
data/Rakefile CHANGED
@@ -33,7 +33,7 @@ rescue LoadError
33
33
  end
34
34
 
35
35
  desc "push gem"
36
- task :push do
36
+ task :push => :lintian do
37
37
  filenames = Dir.glob("pkg/*.gem")
38
38
  filenames_with_times = filenames.map do |filename|
39
39
  [filename, File.mtime(filename)]
@@ -45,3 +45,12 @@ task :push do
45
45
  command = "gem push #{newest_filename}"
46
46
  system(command)
47
47
  end
48
+
49
+ task :lintian do
50
+ require 'pathname'
51
+ @root = Pathname.new(File.dirname(__FILE__)).expand_path
52
+ javascripts_path = @root.join('lib/visage/public/javascripts')
53
+
54
+ count = `grep -c 'console.log' #{javascripts_path.join('graph.js')}`.strip.to_i
55
+ abort("#{count} instances of console.log found in graph.js!") if count > 0
56
+ end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.2
1
+ 0.2.3
@@ -32,6 +32,8 @@ module Visage
32
32
  get '/profiles/:url' do
33
33
  @profile = Visage::Profile.get(params[:url])
34
34
  raise Sinatra::NotFound unless @profile
35
+ @start = params[:start]
36
+ @finish = params[:finish]
35
37
  haml :profile
36
38
  end
37
39
 
@@ -31,6 +31,7 @@ Raphael.fn.g.linechart = function (x, y, width, height, valuesx, valuesy, opts)
31
31
  if (!this.raphael.is(valuesy[0], "array")) {
32
32
  valuesy = [valuesy];
33
33
  }
34
+
34
35
  var allx = Array.prototype.concat.apply([], valuesx),
35
36
  ally = Array.prototype.concat.apply([], valuesy),
36
37
  xdim = this.g.snapEnds(Math.min.apply(Math, allx), Math.max.apply(Math, allx), valuesx[0].length - 1),
@@ -46,7 +46,15 @@ var visageBase = new Class({
46
46
  if (!url[0].match(/http\:\/\//)) {
47
47
  url[0] = '/' + url[0]
48
48
  }
49
- return url.join('/')
49
+ var timeRange = []
50
+ // If a start time has been given
51
+ if ($chk(this.options.start)) {
52
+ timeRange.push('start=' + this.options.start)
53
+ }
54
+ if ($chk(this.options.finish)) {
55
+ timeRange.push('finish=' + this.options.finish)
56
+ }
57
+ return [url.join('/'), timeRange.join('&')].join('?')
50
58
  },
51
59
  getData: function() {
52
60
  this.request = new Request.JSONP({
@@ -270,7 +278,6 @@ var visageGraph = new Class({
270
278
  var graph = this.graph;
271
279
  /*
272
280
  graph.hoverColumn(function () {
273
- console.log([this.axis])
274
281
  });
275
282
  */
276
283
  },
@@ -4,7 +4,7 @@
4
4
  * Copyright (c) 2010 Dmitry Baranovskiy (http://raphaeljs.com)
5
5
  * Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license.
6
6
  */
7
-
7
+
8
8
  Raphael = (function () {
9
9
  function R() {
10
10
  if (R.is(arguments[0], array)) {
@@ -241,7 +241,7 @@ Raphael = (function () {
241
241
  }
242
242
  return newf;
243
243
  }
244
-
244
+
245
245
  R.getRGB = cacher(function (colour) {
246
246
  if (!colour || !!((colour = colour + E).indexOf("-") + 1)) {
247
247
  return {r: -1, g: -1, b: -1, hex: "none", error: 1};
@@ -379,7 +379,7 @@ Raphael = (function () {
379
379
  return {x: 0, y: 0, width: 0, height: 0};
380
380
  }
381
381
  path = path2curve(path);
382
- var x = 0,
382
+ var x = 0,
383
383
  y = 0,
384
384
  X = [],
385
385
  Y = [],
@@ -506,6 +506,7 @@ Raphael = (function () {
506
506
  mx = 0,
507
507
  my = 0,
508
508
  start = 0;
509
+ console.log(pathArray)
509
510
  if (pathArray[0][0] == "M") {
510
511
  x = +pathArray[0][1];
511
512
  y = +pathArray[0][2];
@@ -939,7 +940,7 @@ Raphael = (function () {
939
940
  };
940
941
  },
941
942
  radial_gradient = /^r(?:\(([^,]+?)\s*,\s*([^\)]+?)\))?/;
942
-
943
+
943
944
  // SVG
944
945
  if (R.svg) {
945
946
  Paper[proto].svgns = "http://www.w3.org/2000/svg";
@@ -1015,7 +1016,7 @@ Raphael = (function () {
1015
1016
  var id = o.getAttribute(fillString);
1016
1017
  id = id.match(/^url\(#(.*)\)$/);
1017
1018
  id && SVG.defs.removeChild(doc.getElementById(id[1]));
1018
-
1019
+
1019
1020
  var el = $(type + "Gradient");
1020
1021
  el.id = "r" + (R._id++)[toString](36);
1021
1022
  $(el, type == "radial" ? {fx: fx, fy: fy} : {x1: vector[0], y1: vector[1], x2: vector[2], y2: vector[3]});
@@ -1230,7 +1231,7 @@ Raphael = (function () {
1230
1231
  $(ig, {x: 0, y: 0});
1231
1232
  ig.setAttributeNS(o.paper.xlink, "href", isURL[1]);
1232
1233
  el[appendChild](ig);
1233
-
1234
+
1234
1235
  var img = doc.createElement("img");
1235
1236
  img.style.cssText = "position:absolute;left:-9999em;top-9999em";
1236
1237
  img.onload = function () {
@@ -1294,7 +1295,7 @@ Raphael = (function () {
1294
1295
  }
1295
1296
  }
1296
1297
  }
1297
-
1298
+
1298
1299
  tuneText(o, params);
1299
1300
  if (rotxy) {
1300
1301
  o.rotate(rotxy.join(S));
@@ -1310,7 +1311,7 @@ Raphael = (function () {
1310
1311
  var a = el.attrs,
1311
1312
  node = el.node,
1312
1313
  fontSize = node.firstChild ? toInt(doc.defaultView.getComputedStyle(node.firstChild, E).getPropertyValue("font-size"), 10) : 10;
1313
-
1314
+
1314
1315
  if (params[has]("text")) {
1315
1316
  a.text = params.text;
1316
1317
  while (node.firstChild) {
@@ -1712,7 +1713,7 @@ Raphael = (function () {
1712
1713
  }
1713
1714
  return res[join](S);
1714
1715
  };
1715
-
1716
+
1716
1717
  R[toString] = function () {
1717
1718
  return "Your browser doesn\u2019t support SVG. Falling down to VML.\nYou are running Rapha\xebl " + this.version;
1718
1719
  };
@@ -1746,7 +1747,7 @@ Raphael = (function () {
1746
1747
  xy,
1747
1748
  newpath = (params.x != a.x || params.y != a.y || params.width != a.width || params.height != a.height || params.r != a.r) && o.type == "rect",
1748
1749
  res = o;
1749
-
1750
+
1750
1751
  for (var par in params) if (params[has](par)) {
1751
1752
  a[par] = params[par];
1752
1753
  }
@@ -1817,7 +1818,7 @@ Raphael = (function () {
1817
1818
  params["font-size"] && (s.fontSize = params["font-size"]);
1818
1819
  params["font-weight"] && (s.fontWeight = params["font-weight"]);
1819
1820
  params["font-style"] && (s.fontStyle = params["font-style"]);
1820
- if (params.opacity != null ||
1821
+ if (params.opacity != null ||
1821
1822
  params["stroke-width"] != null ||
1822
1823
  params.fill != null ||
1823
1824
  params.stroke != null ||
@@ -1881,7 +1882,7 @@ Raphael = (function () {
1881
1882
  params["stroke-width"] && (stroke.weight = width);
1882
1883
  width && width < 1 && (opacity *= width) && (stroke.weight = 1);
1883
1884
  stroke.opacity = opacity;
1884
-
1885
+
1885
1886
  params["stroke-linejoin"] && (stroke.joinstyle = params["stroke-linejoin"] || "miter");
1886
1887
  stroke.miterlimit = params["stroke-miterlimit"] || 8;
1887
1888
  params["stroke-linecap"] && (stroke.endcap = params["stroke-linecap"] == "butt" ? "flat" : params["stroke-linecap"] == "square" ? "square" : "round");
@@ -1914,7 +1915,7 @@ Raphael = (function () {
1914
1915
  res.H = a.h = res.paper.span.offsetHeight;
1915
1916
  res.X = a.x;
1916
1917
  res.Y = a.y + round(res.H / 2);
1917
-
1918
+
1918
1919
  // text-anchor emulationm
1919
1920
  switch (a["text-anchor"]) {
1920
1921
  case "start":
@@ -2273,7 +2274,7 @@ Raphael = (function () {
2273
2274
  delete this.attrs.blur;
2274
2275
  }
2275
2276
  };
2276
-
2277
+
2277
2278
  theCircle = function (vml, x, y, r) {
2278
2279
  var g = createNode("group"),
2279
2280
  o = createNode("oval"),
@@ -2463,7 +2464,7 @@ Raphael = (function () {
2463
2464
  return true;
2464
2465
  };
2465
2466
  }
2466
-
2467
+
2467
2468
  // rest
2468
2469
  // Safari or Chrome (WebKit) rendering bug workaround method
2469
2470
  if ((/^Apple|^Google/).test(win.navigator.vendor) && (!(win.navigator.userAgent.indexOf("Version/4.0") + 1) || win.navigator.platform.slice(0, 2) == "iP")) {
@@ -2474,7 +2475,7 @@ Raphael = (function () {
2474
2475
  } else {
2475
2476
  Paper[proto].safari = function () {};
2476
2477
  }
2477
-
2478
+
2478
2479
  // Events
2479
2480
  var preventDefault = function () {
2480
2481
  this.returnValue = false;
@@ -3180,7 +3181,7 @@ Raphael = (function () {
3180
3181
  return "Rapha\xebl\u2019s object";
3181
3182
  };
3182
3183
  R.ae = animationElements;
3183
-
3184
+
3184
3185
  // Set
3185
3186
  var Set = function (items) {
3186
3187
  this.items = [];
@@ -12,7 +12,9 @@
12
12
  gridHeight: 200,
13
13
  shade: false,
14
14
  pluginInstance: '#{graph.instances.join(',')}',
15
- name: '#{graph.plugin} on #{graph.host}'
15
+ name: '#{graph.plugin} on #{graph.host}',
16
+ start: '#{@start}',
17
+ finish: '#{@finish}'
16
18
  });
17
19
  });
18
20
 
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 2
8
- - 2
9
- version: 0.2.2
8
+ - 3
9
+ version: 0.2.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - Lindsay Holmwood
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-07-06 00:00:00 +10:00
17
+ date: 2010-07-15 00:00:00 +10:00
18
18
  default_executable: visage
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -96,6 +96,7 @@ extra_rdoc_files:
96
96
  - README.md
97
97
  files:
98
98
  - .gitignore
99
+ - AUTHORS
99
100
  - README.md
100
101
  - Rakefile
101
102
  - VERSION