picky-generators 4.12.6 → 4.12.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,6 @@
1
+ /**
2
+ * History.js jQuery Adapter
3
+ * @author Benjamin Arthur Lupton
4
+ * @copyright 2010-2011 Benjamin Arthur Lupton
5
+ * @license New BSD License - http://creativecommons.org/licenses/BSD/
6
+ */(function(a,b,c){b.History=b.History||{};var d=b.History||{},e=b.history;if(typeof d.Adapter!=="undefined")throw new Error("History.js Adapter has already been loaded...");d.Adapter={bind:function(b,c,d){return a(b).bind(c,d)},trigger:function(b,c){return a(b).trigger(c)},onDomLoad:function(a){jQuery(a)}},typeof d.initHtml5!=="undefined"&&d.initHtml5(),typeof d.initHtml4!=="undefined"&&d.initHtml4()})(jQuery,window)
@@ -11,8 +11,8 @@ p(b,n)};var o=w?h:a,e,q=function(){var b=c.text();d("live",b,o,{});clearInterval
11
11
  c=a.enclosingSelector||".picky";var i=a.formSelector||c+" form";a.form=$(i);a.input=$(a.inputSelector||i+" input[type=search]");a.reset=$(a.resetSelector||i+" div.reset");a.button=$(a.buttonSelector||i+" input[type=button]");a.counter=$(a.counterSelector||i+" div.status");a.results=$(a.resultsSelector||c+" div.results");a.noResults=$(a.noResultsSelector||c+" div.no_results");a.moreSelector=a.moreSelector||c+" div.results div.addination:last";a.allocations=$(a.allocationsSelector||c+" .allocations");
12
12
  a.shownAllocations=a.allocations.find(".shown");a.showMoreAllocations=a.allocations.find(".more");a.hiddenAllocations=a.allocations.find(".hidden");a.maxSuggestions=a.maxSuggestions||3;a.results=$(a.resultsSelector||c+" div.results");a.resultsDivider=a.resultsDivider||"";a.nonPartial=a.nonPartial||[];a.wrapResults=a.wrapResults||"<ol></ol>";var g=a.controller&&new a.controller(a)||new PickyController(a);var j=this.insert=function(k,p,r){g.insert(k,p||{},r||true)};this.resend=g.resend;this.insertFromURL=
13
13
  function(k){if(k)j(k);else(k=g.lastFullQuery())&&j(k)}};var PickyAddination=function(a,c){this.remove=function(){c.find(".addination").remove()};this.render=function(i){var g=i.total,j,k=i.renderedAmount();j=i.offset+k;k=j+k;i=i.total;if(i<k)k=i;j={offset:j,start:j+1,end:k};if(j.offset<g){g=$("<div class='addination'>"+t("results.addination.more")+"</div>");g.bind("click",{offset:j.offset},a.addinationClicked);return g}else return""}};var PickyResultsRenderer=function(a,c){var i=c.locale,g=c.explanations||{},j=c.explanation_delimiters||{},k=c.resultsDivider,p=c.wrapResults,r=c.nonPartial,w=function(d){var h=d[d.length-1];if(h===undefined)return[];d=d.slice(0,d.length-1);if(d==[])d=[d];if(!r.include(h[0]))if(h[1].match(/[^\*~]$/))h[1]+="*";d.push(h);return d};this.asteriskifyLastToken=w;var v=function(d){for(var h=g[i]||{},m=[],o,e=0,q=d.length;e<q;e++){o=d[e];var u=o[0];u=h[u]||u;m.push([u,o[1]])}return m};this.explainCategory=
14
- v;var s=function(d,h){return[d.replace(/([\w\s\u00c4\u00e4\u00d6\u00f6\u00dc\u00fc\u00e9\u00e8\u00e0\,]+)/,"<strong>$1</strong>"),h].join(" ")};this.strongify=s;var y=function(d,h){var m=j[i],o="",e=[],q=[];v(w(h)).each(function(u,b){var n=b[0],A=b[1];A=A.replace(/[\w,]+:(.+)/,"$1");if(o==""||n==o){e.push(A);o=n}else{var x=s(o,e.join(" "));e=[];e.push(A);o=n;q.push(x)}});q.push(s(o,e.join(" ")));q=q.join(" "+m+" ");return q='<span class="explanation">'+d+" "+q+"</span>"};this.explain=y;var f=function(d,
15
- h){var m='<div class="header">';m+=y(h.type,h.combination);if(d.offset>0)m+='<div class="tothetop"><a href="#" onclick="javascript:$(\'body\').animate({scrollTop: 0}, 500);">&uarr;</a></div>';m+="</div>";return m};this.renderHeader=f;this.render=function(d,h){h.allocations.each(function(m,o){if(o.entries.length>0){d.append(f(h,o)).append(o.entries.join(k));d.children("li").wrapAll(p)}});d.append(a.render(h))}};function AllocationRenderer(a){function c(f){var d={},h={},m={},o=[],e;e=0;for(l=f.length;e<l;e++){var q=f[e][0];if(q in d){d[q].push(f[e][1]);h[q].push(f[e][2]);o.push(e)}else{d[q]=[f[e][1]];h[q]=[f[e][2]];m[e]=q}}for(e in m){f[e][1]=d[m[e]];f[e][2]=h[m[e]]}for(e=o.length-1;e>=0;e--)f.remove(o[e]);return f}function i(f){f.map(function(d){return"%"+(d+1)+"$s"});return f.join(" ")}function g(f){if(f.length==0)return"";f=c(f);f.sort(function(u,b){return u[0]<b[0]?-1:1});for(var d=[],h=0,m=f.length;h<
14
+ v;var s=function(d,h){return["<strong>"+d+"</strong>",h].join(" ")};this.strongify=s;var y=function(d,h){var m=j[i],o="",e=[],q=[];v(w(h)).each(function(u,b){var n=b[0],A=b[1];A=A.replace(/[\w,]+:(.+)/,"$1");if(o==""||n==o){e.push(A);o=n}else{var x=s(o,e.join(" "));e=[];e.push(A);o=n;q.push(x)}});q.push(s(o,e.join(" ")));q=q.join(" "+m+" ");return q='<span class="explanation">'+d+" "+q+"</span>"};this.explain=y;var f=function(d,h){var m='<div class="header">';m+=y(h.type,h.combination);if(d.offset>
15
+ 0)m+='<div class="tothetop"><a href="#" onclick="javascript:$(\'body\').animate({scrollTop: 0}, 500);">&uarr;</a></div>';m+="</div>";return m};this.renderHeader=f;this.render=function(d,h){h.allocations.each(function(m,o){if(o.entries.length>0){d.append(f(h,o)).append(o.entries.join(k));d.children("li").wrapAll(p)}});d.append(a.render(h))}};function AllocationRenderer(a){function c(f){var d={},h={},m={},o=[],e;e=0;for(l=f.length;e<l;e++){var q=f[e][0];if(q in d){d[q].push(f[e][1]);h[q].push(f[e][2]);o.push(e)}else{d[q]=[f[e][1]];h[q]=[f[e][2]];m[e]=q}}for(e in m){f[e][1]=d[m[e]];f[e][2]=h[m[e]]}for(e=o.length-1;e>=0;e--)f.remove(o[e]);return f}function i(f){f.map(function(d){return"%"+(d+1)+"$s"});return f.join(" ")}function g(f){if(f.length==0)return"";f=c(f);f.sort(function(u,b){return u[0]<b[0]?-1:1});for(var d=[],h=0,m=f.length;h<
16
16
  m;h++)d.push(f[h][0]);var o=d.length==1,e=s[d.join(",")];if(e===undefined)e=s[d]=i(d);if(typeof e==="string"){s[d]={format:e,ignoreSingle:true};e=s[d]}var q=e.format;f.each(function(u,b){var n=b[0],A=b[1],x=b[2];x.map(function(z,B){var C=A[z];if(C.charAt(C.length-1)=="*")B+="...";return B});e.filter&&x.map(function(z,B){return e.filter(B)});if(o&&!(e&&e.ignoreSingle)){n=w[n]||n;return q=x.join("&nbsp;")+"&nbsp;("+n+")"}x.map(function(z,B){return B.replace(/[\w,]+:(.+)/,"$1")});q=q.replace(RegExp("%"+
17
17
  (u+1)+"\\$s","g"),x.join("&nbsp;"))});return q}function j(f){for(var d=[],h=0,m=v.length;h<m;h++)d.push([]);d.push([]);h=0;for(m=f.length;h<m;h++){for(var o=f[h],e=o[0],q=false,u=0,b=v.length;u<b;u++)if(v[u].include(e)){d[u].push(o);q=true;break}q||d[d.length-1].push(o)}var n;for(f=d.length-1;f>=0;f--){n=d[f];if(n.length>0)break}n=n[n.length-1];y.include(n[0])||(n[1]=n[1].valueOf()+"*");return d}function k(f){var d=[];j(f).each(function(h,m){var o=g(m);o&&d.push(o)});return d.join(" ")}var p=a.locale,
18
18
  r=a.qualifiers&&a.qualifiers[p]||{},w=a.explanations&&a.explanations[p]||{},v=a.groups||[],s=a.choices&&a.choices[p]||{},y=a.nonPartial||[];this.explanation=this.query=this.text="";this.contract=c;this.makeUpMissingFormat=i;this.rendered=g;this.groupify=j;this.querify=function(f){var d=[],h,m,o;for(o in f){h=f[o][0];h=r[h]||h;m=(m=f[o][1])||"";m=m.charAt(m.length-1)=="*"?"*":"";d[o]=h+":"+f[o][2]+m}return d.join(" ")};this.suggestify=k;this.render=function(f){return k(f.combination)}};var PickyAllocationsCloud=function(a,c){var i=c.allocations,g=c.shownAllocations,j=c.showMoreAllocations,k=c.hiddenAllocations,p=c.maxSuggestions,r=function(){i.hide()},w=function(f){r();a.allocationChosen(f)},v=new AllocationRenderer(c),s=function(f){var d=[];f.each(function(h,m){var o=v.querify(m.combination),e=v.render(m);e=$('<li><div class="text">'+e+'</div><div class="count">'+m.count+"</div></li>");e.bind("click",{query:o},w);d.push(e)});return d},y=function(f){if(f.length==0)return i.hide();
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: picky-generators
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.12.6
4
+ version: 4.12.7
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: 2013-01-02 00:00:00.000000000 Z
12
+ date: 2013-01-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
@@ -34,7 +34,7 @@ dependencies:
34
34
  requirements:
35
35
  - - ~>
36
36
  - !ruby/object:Gem::Version
37
- version: 4.12.6
37
+ version: 4.12.7
38
38
  type: :runtime
39
39
  prerelease: false
40
40
  version_requirements: !ruby/object:Gem::Requirement
@@ -42,7 +42,7 @@ dependencies:
42
42
  requirements:
43
43
  - - ~>
44
44
  - !ruby/object:Gem::Version
45
- version: 4.12.6
45
+ version: 4.12.7
46
46
  - !ruby/object:Gem::Dependency
47
47
  name: picky-client
48
48
  requirement: !ruby/object:Gem::Requirement
@@ -50,7 +50,7 @@ dependencies:
50
50
  requirements:
51
51
  - - ~>
52
52
  - !ruby/object:Gem::Version
53
- version: 4.12.6
53
+ version: 4.12.7
54
54
  type: :runtime
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
@@ -58,7 +58,7 @@ dependencies:
58
58
  requirements:
59
59
  - - ~>
60
60
  - !ruby/object:Gem::Version
61
- version: 4.12.6
61
+ version: 4.12.7
62
62
  description: Generators for Picky.
63
63
  email: florian.hanke+picky-generators@gmail.com
64
64
  executables:
@@ -94,6 +94,7 @@ files:
94
94
  - prototypes/shared/client/book.rb
95
95
  - prototypes/shared/client/images/picky.png
96
96
  - prototypes/shared/client/javascripts/application.js
97
+ - prototypes/shared/client/javascripts/history.adapter.jquery.min.js
97
98
  - prototypes/shared/client/javascripts/history.min.js
98
99
  - prototypes/shared/client/javascripts/jquery-1.5.0.min.js
99
100
  - prototypes/shared/client/javascripts/picky.min.js