peteshow 0.8.1 → 0.8.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "peteshow",
3
- "version": "0.8.1",
3
+ "version": "0.8.2",
4
4
  "description": "Plugin for filling out forms with fake data for testing purposes",
5
5
  "keywords": [
6
6
  "filler",
data/src/peteshow-core.js CHANGED
@@ -228,11 +228,14 @@
228
228
  }
229
229
 
230
230
  getDomain = function() {
231
- var i = 0, d = document.domain, p = d.split('.')
232
- while(i < (p.length - 1)){
233
- d = p.slice(-1-(++i)).join('.');
234
- }
235
- return d == 'localhost' ? '' : d;
231
+ // http://rossscrivener.co.uk/blog/javascript-get-domain-exclude-subdomain
232
+ var i=0, domain=document.domain, p=domain.split('.'), s='_gd'+(new Date()).getTime();
233
+ while(i<(p.length-1) && document.cookie.indexOf(s+'='+s)==-1){
234
+ domain = p.slice(-1-(++i)).join('.');
235
+ document.cookie = s+"="+s+";domain="+domain+";";
236
+ }
237
+ document.cookie = s+"=;expires=Thu, 01 Jan 1970 00:00:01 GMT;domain="+domain+";";
238
+ return domain;
236
239
  }
237
240
 
238
241
  Peteshow.clearSaved = function() {
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: peteshow
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.8.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-08-06 00:00:00.000000000 Z
12
+ date: 2014-08-07 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Javascript plugin for filling out forms with fake data for testing purposes
15
15
  email: brousapg@gmail.com