searchViz 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,3 @@
1
1
  module SearchViz
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
@@ -1,46 +1,46 @@
1
1
  // Copyright (c) 2012 Fms-shintomon
2
2
 
3
- var AjaxGet, AjaxPut, searchViz, searchVizCookie, hashUrlParse, OnHashDataLoad;
3
+ var AjaxGet, AjaxPut, searchViz, searchVizCookie, hashUrlParse, OnHashDataLoad, HashDataLoad;
4
4
 
5
5
 
6
- searchVizHashRemove = function(urlReplaceH) {
6
+ searchVizHashRemove = function(urlrpeplaceH) {
7
7
  window.location.hash = '';
8
8
  };
9
9
 
10
- searchVizCookie = function(urlReplaceR,urlReplaceH,opt) {
10
+ searchVizCookie = function(urlrpeplaceRP,urlrpeplaceH,opt) {
11
11
  try {
12
12
  if (opt=='R') {
13
- history.replaceState(null, document.title, urlReplaceR);
13
+ history.replaceState(null, document.title, urlrpeplaceRP);
14
14
  }
15
15
 
16
16
  else if (opt=='P') {
17
- history.pushState(null, document.title, urlReplaceR);
17
+ history.pushState(null, document.title, urlrpeplaceRP);
18
18
  }
19
19
  else if (opt=='H'){
20
- window.location.hash = urlReplaceH;
20
+ window.location.hash = urlrpeplaceH;
21
21
  }
22
22
  else if (opt=='RtH') {
23
23
  try {
24
- history.pushState(null, document.title, urlReplaceR);
24
+ history.pushState(null, document.title, urlrpeplaceRP);
25
25
  }
26
26
  catch(err){
27
- window.location.hash = urlReplaceH;
27
+ window.location.hash = urlrpeplaceH;
28
28
  }
29
29
  }
30
30
  else if (opt=='PtH') {
31
31
  try {
32
- history.replaceState(null, document.title, urlReplaceR);
32
+ history.replaceState(null, document.title, urlrpeplaceRP);
33
33
  }
34
34
  catch(err){
35
- window.location.hash = urlReplaceH;
35
+ window.location.hash = urlrpeplaceH;
36
36
  }
37
37
  }
38
38
  else {
39
- window.location.href= urlReplaceR;
39
+ window.location.href= urlrpeplaceRP;
40
40
  }
41
41
  }
42
42
  catch(err) {
43
- window.location.href= urlReplaceR;
43
+ window.location.href= urlrpeplaceRP;
44
44
  }
45
45
  };
46
46
 
@@ -48,16 +48,24 @@ OnHashDataLoad = function(blk_id, page_id, q, opt) {
48
48
  if(opt=="H") {
49
49
  hash = window.location.hash.substring(1);
50
50
  path = window.location.pathname;
51
- url = path + "?q=" + q + "&page_id=" + page_id + "&" + hash + "&trigger_call=svZ";
52
- urlr = path + "?q=" + q + "&page_id=" + page_id + "&" + hash;
53
- urlh = "?q=" + q + "&page_id=" + page_id + "&" + hash;
51
+ url = path + hash + "&trigger_call=svZ";
52
+ urlrp = path + hash;
53
+ urlh = hash;
54
54
  $.get(url, function(data, status, xhr) {
55
55
  $("#" + blk_id).html(data);
56
- return searchVizCookie(urlr, urlh, "H");
56
+ return searchVizCookie(urlrp, urlh, "H");
57
57
  });
58
58
  }
59
59
  };
60
60
 
61
+ HashDataLoad = function(path, hash_data, blk_id, page_id, q, opt) {
62
+ if(opt=="H") {
63
+ urlrp = path + "?q=" + q + "&page_id=" + page_id + hash_data;
64
+ urlh = "?q=" + q + "&page_id=" + page_id + hash_data;
65
+ return searchVizCookie(urlrp, urlh, "H");
66
+ }
67
+ };
68
+
61
69
  hashUrlParse = function(args) {
62
70
  var i, key, output;
63
71
  output = {};
@@ -81,13 +89,13 @@ hashUrlParse = function(args) {
81
89
 
82
90
 
83
91
  searchViz = function(searchVizForm, e, callback) {
84
- var action, formData, urlGet, urlReplace;
92
+ var action, formData, urlGet, urlrpeplace;
85
93
  e.preventDefault();
86
94
  action = $(searchVizForm).attr("action");
87
95
  formData = $(searchVizForm).serialize();
88
96
  urlGet = action + "?" + formData;
89
- urlReplace = "?" + formData;
90
- searchVizCookie(urlGet, urlReplace, 'B');
97
+ urlrpeplace = "?" + formData;
98
+ searchVizCookie(urlGet, urlrpeplace, 'B');
91
99
  return $.ajax("http://" + window.location.host + "/" + urlGet, {
92
100
  type: "GET",
93
101
  dataType: "json",
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: searchViz
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: