concerto_frontend 0.2.0 → 0.3.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8a5adb1892b3d9eb81fc06cdf4193a289be02c0e
4
- data.tar.gz: 70f239f1ef20f54af9235b7136923aef9ce233c7
3
+ metadata.gz: 85eed53786694c839ee00381dd02ee8864a11871
4
+ data.tar.gz: 8f253dfda5a8ef3b25e5408dcf6438d73f69737f
5
5
  SHA512:
6
- metadata.gz: 054b35afaab35486551fe6a6d8db53b787f019c0dcfe95bdbddeaa79b4f09d28a12c7f86bbccd30b15ccdcee709949474d3be7bc673a1609c68afca26d785799
7
- data.tar.gz: b13eeb0c98d416ecb9c7e8e15712eff21d536df91a666af21ab305b2d90b63bdeecc353812d7465af273c76e6906db7a9fefd6ff54a85d07ef7b7b3727bbe3b1
6
+ metadata.gz: ab7831b55811a95a744678102776ac87aa8ea498ebe432a08ff4b8f68dc87e8a39706c7a49283a4bc39ce340c6981a23b147331b970f4a58d62953b2d5f0220c
7
+ data.tar.gz: ee78eaa4cd50e3d55d867a980380e99374ccdf0e36597f05af453f9f1a0c8e9871a505b9ef85840def58bd65ada709803de0a42367f6b706892a49f90b2186ec
@@ -8379,6 +8379,22 @@ if (!window.Promise) {
8379
8379
  return base + url;
8380
8380
  },
8381
8381
 
8382
+ /**
8383
+ * Prepends a base to a path if not already prefixed with it
8384
+ *
8385
+ * Does not care about absolute URLs.
8386
+ */
8387
+ prefixWithBase: function(path, base) {
8388
+ bl = base.length;
8389
+ pl = path.length;
8390
+ if (pl > bl && bl != 0 && path.substring(0, bl) == base)
8391
+ {
8392
+ return path;
8393
+ }
8394
+ return base + path;
8395
+ },
8396
+
8397
+
8382
8398
  /**
8383
8399
  * Use iterative binary search to find optimal content font size given
8384
8400
  * the element's dimensions as constraints.
@@ -8645,7 +8661,7 @@ if (!window.Promise) {
8645
8661
  },
8646
8662
 
8647
8663
  _graphicSrc: function(baseUrl, path) {
8648
- this.$.graphic.src = baseUrl + path;
8664
+ this.$.graphic.src = this.prefixWithBase(path, baseUrl);
8649
8665
  },
8650
8666
 
8651
8667
  created: function (){
@@ -9280,7 +9296,7 @@ if (!window.Promise) {
9280
9296
 
9281
9297
  backgroundImage: function(path) {
9282
9298
  /* background-image style for annotated attribute binding */
9283
- var url = this.resolveURL(path, this.baseUrl);
9299
+ var url = this.prefixWithBase(path, this.baseUrl);
9284
9300
  return "background-image: url('" + url + "');";
9285
9301
  },
9286
9302
 
@@ -9298,9 +9314,8 @@ if (!window.Promise) {
9298
9314
  this.template = data.template;
9299
9315
  this.timezone = data.time_zone;
9300
9316
 
9301
- var key = response.xhr.getResponseHeader('etag');
9302
- if (key != null) {
9303
- key = key.replace(/"/g, '');
9317
+ var key = response.xhr.getResponseHeader('X-Concerto-Frontend-Setup-Key');
9318
+ if (key) {
9304
9319
  this.cacheKey = key;
9305
9320
  }
9306
9321
 
@@ -9309,7 +9324,7 @@ if (!window.Promise) {
9309
9324
  var css_link = document.createElement("link");
9310
9325
  css_link.type = "text/css";
9311
9326
  css_link.rel = "stylesheet";
9312
- css_link.href = this.resolveURL(this.template.css_path, this.baseUrl);
9327
+ css_link.href = this.prefixWithBase(this.template.css_path, this.baseUrl);
9313
9328
  document.head.appendChild(css_link);
9314
9329
  }
9315
9330
  },
@@ -7,5 +7,5 @@
7
7
  <% end %>
8
8
 
9
9
  <!-- from concerto-frontend -->
10
- <concerto-screen screen-id="<%= params[:id] %>" preview="<%= @preview %>"></concerto-screen>
10
+ <concerto-screen screen-id="<%= params[:id] %>" preview="<%= @preview %>" base-url="<%= Rails.application.config.relative_url_root %>"></concerto-screen>
11
11
  <!-- end from concerto-frontend -->
@@ -1,3 +1,3 @@
1
1
  module ConcertoFrontend
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: concerto_frontend
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabriel Perez
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-30 00:00:00.000000000 Z
11
+ date: 2015-12-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -76,7 +76,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
76
76
  version: '0'
77
77
  requirements: []
78
78
  rubyforge_project:
79
- rubygems_version: 2.2.3
79
+ rubygems_version: 2.4.5.1
80
80
  signing_key:
81
81
  specification_version: 4
82
82
  summary: Concerto Frontend