oxen_media 0.0.6 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/components/dropzone.js.jsx.coffee +298 -0
- data/app/assets/javascripts/components/photocard.js.jsx.coffee +77 -0
- data/app/assets/javascripts/components/photos.js.jsx.coffee +68 -0
- data/app/assets/javascripts/oxen_media.js +1 -3
- data/app/assets/stylesheets/oxen_media/drop_zone.css +86 -0
- data/app/assets/stylesheets/oxen_media.css +3 -0
- data/app/controllers/photos_controller.rb +26 -0
- data/app/models/ox_photo.rb +17 -0
- data/app/policies/ox_photo_policy.rb +3 -0
- data/app/uploaders/photo_uploader.rb +53 -0
- data/app/views/photos/_photo.html.haml +11 -0
- data/app/views/photos/create.js.haml +1 -0
- data/app/views/photos/index.json.jbuilder +5 -0
- data/lib/oxen_media/version.rb +1 -1
- data/lib/oxen_media.rb +1 -1
- data/oxen_media.gemspec +4 -4
- metadata +15 -86
- data/app/assets/javascripts/jsrender.min.js +0 -4
- data/app/assets/javascripts/jsrender.min.js.map +0 -463
- data/app/assets/javascripts/oxen_media/carrier_wave_cropper.js.coffee +0 -22
- data/app/assets/javascripts/oxen_media/media.js.coffee +0 -469
- data/app/assets/javascripts/oxen_media/medium_pane.js.coffee +0 -107
- data/app/assets/javascripts/templates/selected_files.html +0 -35
- data/app/assets/stylesheets/media.css +0 -10
- data/app/assets/stylesheets/scaffold.css +0 -56
- data/app/controllers/media_controller.rb +0 -106
- data/app/helpers/media_helper.rb +0 -2
- data/app/models/medium.rb +0 -25
- data/app/policies/oxen_medium_policy.rb +0 -12
- data/app/uploaders/medium_uploader.rb +0 -153
- data/app/views/media/_fields.html.haml +0 -42
- data/app/views/media/_form.html.haml +0 -48
- data/app/views/media/_media.html.haml +0 -18
- data/app/views/media/_medium.html.haml +0 -25
- data/app/views/media/_medium_fields.html.haml +0 -4
- data/app/views/media/create.js.haml +0 -2
- data/app/views/media/crop.html.haml +0 -3
- data/app/views/media/edit.html.haml +0 -2
- data/app/views/media/index.html.haml +0 -29
- data/app/views/media/index.json.jbuilder +0 -4
- data/app/views/media/new.html.erb +0 -5
- data/app/views/media/show.html.haml +0 -21
- data/app/views/media/show.json.jbuilder +0 -1
- data/app/views/media/update_crop.js.haml +0 -1
- /data/app/assets/javascripts/{oxen_media/.keep → components/.gitkeep} +0 -0
data/oxen_media.gemspec
CHANGED
@@ -27,10 +27,10 @@ Gem::Specification.new do |s|
|
|
27
27
|
s.add_dependency "rails", "~> 4.2.1"
|
28
28
|
s.add_dependency "pundit" #, "~> 0.3.0"
|
29
29
|
s.add_dependency 'mini_magick'
|
30
|
-
s.add_dependency 'carrierwave'
|
31
|
-
s.add_dependency 'carrierwave-crop'
|
32
|
-
s.add_dependency 'carrierwave-processing'
|
33
|
-
s.add_dependency 'fog'
|
30
|
+
# s.add_dependency 'carrierwave'
|
31
|
+
# s.add_dependency 'carrierwave-crop'
|
32
|
+
# s.add_dependency 'carrierwave-processing'
|
33
|
+
# s.add_dependency 'fog'
|
34
34
|
#
|
35
35
|
# s.add_dependency "sweetalert-rails"
|
36
36
|
# s.add_dependency("responders")
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: oxen_media
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Walther H Diechmann
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-03-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -52,62 +52,6 @@ dependencies:
|
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: carrierwave
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - ">="
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
62
|
-
type: :runtime
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - ">="
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '0'
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: carrierwave-crop
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - ">="
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: '0'
|
76
|
-
type: :runtime
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - ">="
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '0'
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: carrierwave-processing
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - ">="
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: '0'
|
90
|
-
type: :runtime
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - ">="
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: '0'
|
97
|
-
- !ruby/object:Gem::Dependency
|
98
|
-
name: fog
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
100
|
-
requirements:
|
101
|
-
- - ">="
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
version: '0'
|
104
|
-
type: :runtime
|
105
|
-
prerelease: false
|
106
|
-
version_requirements: !ruby/object:Gem::Requirement
|
107
|
-
requirements:
|
108
|
-
- - ">="
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
version: '0'
|
111
55
|
- !ruby/object:Gem::Dependency
|
112
56
|
name: minitest-reporters
|
113
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -295,42 +239,27 @@ files:
|
|
295
239
|
- README.rdoc
|
296
240
|
- Rakefile
|
297
241
|
- app/assets/images/oxen_media/.keep
|
298
|
-
- app/assets/javascripts/
|
299
|
-
- app/assets/javascripts/
|
242
|
+
- app/assets/javascripts/components/.gitkeep
|
243
|
+
- app/assets/javascripts/components/dropzone.js.jsx.coffee
|
244
|
+
- app/assets/javascripts/components/photocard.js.jsx.coffee
|
245
|
+
- app/assets/javascripts/components/photos.js.jsx.coffee
|
300
246
|
- app/assets/javascripts/oxen_media.js
|
301
|
-
- app/assets/
|
302
|
-
- app/assets/javascripts/oxen_media/carrier_wave_cropper.js.coffee
|
303
|
-
- app/assets/javascripts/oxen_media/media.js.coffee
|
304
|
-
- app/assets/javascripts/oxen_media/medium_pane.js.coffee
|
305
|
-
- app/assets/javascripts/templates/selected_files.html
|
306
|
-
- app/assets/stylesheets/media.css
|
247
|
+
- app/assets/stylesheets/oxen_media.css
|
307
248
|
- app/assets/stylesheets/oxen_media/.keep
|
308
|
-
- app/assets/stylesheets/
|
249
|
+
- app/assets/stylesheets/oxen_media/drop_zone.css
|
309
250
|
- app/controllers/.keep
|
310
|
-
- app/controllers/
|
251
|
+
- app/controllers/photos_controller.rb
|
311
252
|
- app/helpers/.keep
|
312
|
-
- app/helpers/media_helper.rb
|
313
253
|
- app/mailers/.keep
|
314
254
|
- app/models/.keep
|
315
255
|
- app/models/concerns/roleable.rb
|
316
|
-
- app/models/
|
317
|
-
- app/policies/
|
318
|
-
- app/uploaders/
|
256
|
+
- app/models/ox_photo.rb
|
257
|
+
- app/policies/ox_photo_policy.rb
|
258
|
+
- app/uploaders/photo_uploader.rb
|
319
259
|
- app/views/.keep
|
320
|
-
- app/views/
|
321
|
-
- app/views/
|
322
|
-
- app/views/
|
323
|
-
- app/views/media/_medium.html.haml
|
324
|
-
- app/views/media/_medium_fields.html.haml
|
325
|
-
- app/views/media/create.js.haml
|
326
|
-
- app/views/media/crop.html.haml
|
327
|
-
- app/views/media/edit.html.haml
|
328
|
-
- app/views/media/index.html.haml
|
329
|
-
- app/views/media/index.json.jbuilder
|
330
|
-
- app/views/media/new.html.erb
|
331
|
-
- app/views/media/show.html.haml
|
332
|
-
- app/views/media/show.json.jbuilder
|
333
|
-
- app/views/media/update_crop.js.haml
|
260
|
+
- app/views/photos/_photo.html.haml
|
261
|
+
- app/views/photos/create.js.haml
|
262
|
+
- app/views/photos/index.json.jbuilder
|
334
263
|
- config/initializers/backtrace_silencers.rb
|
335
264
|
- config/initializers/carrier_wave.rb
|
336
265
|
- config/initializers/simple_form.rb
|
@@ -1,4 +0,0 @@
|
|
1
|
-
/*! JsRender v1.0.0-beta: http://www.jsviews.com/#jsrender
|
2
|
-
informal pre V1.0 commit counter: 64*/
|
3
|
-
!function(e){if("function"==typeof define&&define.amd)define(e);else if("object"==typeof exports){var t=module.exports=e(!0,require("fs"));t.renderFile=t.__express=function(e,n,r){var i=t.templates("@"+e).render(n);return r&&r(null,i),i}}else e(!1)}(function(e,t){"use strict";function n(e,t){return function(){var n,r=this,i=r.base;return r.base=e,n=t.apply(r,arguments),r.base=i,n}}function r(e,t){return jt(t)&&(t=n(e?e._d?e:n(s,e):s,t),t._d=1),t}function i(e,t){for(var n in t.props)ct.test(n)&&(e[n]=r(e[n],t.props[n]))}function a(e){return e}function s(){return""}function o(e){try{throw"dbg breakpoint"}catch(t){}return this.base?this.baseApply(arguments):e}function l(e){Nt._dbgMode=e!==!1}function p(e){this.name=(G.link?"JsViews":"JsRender")+" Error",this.message=e||this.name}function d(e,t){var n;for(n in t)e[n]=t[n];return e}function u(e,t,n){return(0!==this||e)&&(W=e?e.charAt(0):W,X=e?e.charAt(1):X,Y=t?t.charAt(0):Y,et=t?t.charAt(1):et,tt=n||tt,e="\\"+W+"(\\"+tt+")?\\"+X,t="\\"+Y+"\\"+et,q="(?:(?:(\\w+(?=[\\/\\s\\"+Y+"]))|(?:(\\w+)?(:)|(>)|!--((?:[^-]|-(?!-))*)--|(\\*)))\\s*((?:[^\\"+Y+"]|\\"+Y+"(?!\\"+et+"))*?)",$t.rTag=q+")",q=new RegExp(e+q+"(\\/)?|(?:\\/(\\w+)))"+t,"g"),H=new RegExp("<.*>|([^\\\\]|^)[{}]|"+e+".*"+t)),[W,X,Y,et,tt]}function c(e,t){t||(t=e,e=void 0);var n,r,i,a,s=this,o=!t||"root"===t;if(e){if(a=s.type===t?s:void 0,!a)if(n=s.views,s._.useKey){for(r in n)if(a=n[r].get(e,t))break}else for(r=0,i=n.length;!a&&i>r;r++)a=n[r].get(e,t)}else if(o)for(;s.parent.parent;)a=s=s.parent;else for(;s&&!a;)a=s.type===t?s:void 0,s=s.parent;return a}function f(){var e=this.get("item");return e?e.index:void 0}function g(){return this.index}function v(e){var t,n=this,r=n.linkCtx,i=(n.ctx||{})[e];return void 0===i&&r&&r.ctx&&(i=r.ctx[e]),void 0===i&&(i=Mt[e]),i&&jt(i)&&!i._wrp&&(t=function(){return i.apply(this&&this!==z?this:n,arguments)},t._wrp=!0,d(t,i)),t||i}function m(e,t,n,r){var a,s,o="number"==typeof n&&t.tmpl.bnds[n-1],l=t.linkCtx;return void 0!==r?n=r={props:{},args:[r]}:o&&(n=o(t.data,t,kt)),s=n.args[0],(e||o)&&(a=l&&l.tag,a||(a=d(new $t._tg,{_:{inline:!l,bnd:o,unlinked:!0},tagName:":",cvt:e,flow:!0,tagCtx:n}),l&&(l.tag=a,a.linkCtx=l),n.ctx=J(n.ctx,(l?l.view:t).ctx)),a._er=r&&s,i(a,n),n.view=t,a.ctx=n.ctx||{},n.ctx=void 0,t._.tag=a,s=a.cvtArgs(a.convert||"true"!==e&&e)[0],s=o&&t._.onRender?t._.onRender(s,t,o):s,t._.tag=void 0),void 0!=s?s:""}function h(e){var t=this,n=t.tagCtx,r=n.view,i=n.args;return e=t.convert||e,e=e&&(""+e===e?r.getRsc("converters",e)||V("Unknown converter: '"+e+"'"):e),i=i.length||n.index?e?i.slice():i:[r.data],e&&(e.depends&&(t.depends=$t.getDeps(t.depends,t,e.depends,e)),i[0]=e.apply(t,i)),i}function w(e,t){for(var n,r,i=this;void 0===n&&i;)r=i.tmpl&&i.tmpl[e],n=r&&r[t],i=i.parent;return n||kt[e][t]}function x(e,t,n,r,a,s){t=t||D;var o,l,p,d,u,c,f,g,v,m,h,w,x,b,_,y,k,C,j="",A=t.linkCtx||0,T=t.ctx,M=n||t.tmpl,$="number"==typeof r&&t.tmpl.bnds[r-1];for("tag"===e._is?(o=e,e=o.tagName,r=o.tagCtxs,p=o.template):(l=t.getRsc("tags",e)||V("Unknown tag: {{"+e+"}} "),p=l.template),void 0!==s?(j+=s,r=s=[{props:{},args:[]}]):$&&(r=$(t.data,t,kt)),g=r.length,f=0;g>f;f++)m=r[f],(!A||!A.tag||f&&!A.tag._.inline||o._er)&&((w=m.tmpl)&&(w=m.content=M.tmpls[w-1]),m.index=f,m.tmpl=p||w,m.render=R,m.view=t,m.ctx=J(m.ctx,T)),(n=m.props.tmpl)&&(n=""+n===n?t.getRsc("templates",n)||Tt(n):n,m.tmpl=n),o||(o=new l._ctr,x=!!o.init,o.parent=c=T&&T.tag,o.tagCtxs=r,A&&(o._.inline=!1,A.tag=o,o.linkCtx=A),(o._.bnd=$||A.fn)?o._.arrVws={}:o.dataBoundOnly&&V("{^{"+e+"}} tag must be data-bound")),m.tag=o,o.dataMap&&o.tagCtxs&&(m.map=o.tagCtxs[f].map),o.flow||(h=m.ctx=m.ctx||{},d=o.parents=h.parentTags=T&&J(h.parentTags,T.parentTags)||{},c&&(d[c.tagName]=c),d[o.tagName]=h.tag=o);if(($||A)&&(t._.tag=o),!(o._er=s)){for(i(o,r[0]),o.rendering={},f=0;g>f;f++)m=o.tagCtx=o.tagCtxs[f],k=m.props,y=o.cvtArgs(),(b=k.dataMap||o.dataMap)&&(y.length||k.dataMap)&&(_=m.map,(!_||_.src!==y[0]||a)&&(_&&_.src&&_.unmap(),_=m.map=b.map(y[0],k)),y=[_.tgt]),o.ctx=m.ctx,f||(x&&(C=o.template,o.init(m,A,o.ctx),x=void 0,o.template!==C&&(o._.tmpl=o.template)),A&&(A.attr=o.attr=A.attr||o.attr),u=o.attr,o._.noVws=u&&u!==ht),v=void 0,o.render&&(v=o.render.apply(o,y)),y.length||(y=[t]),void 0===v&&(v=m.render(y.length?y[0]:t,!0)||(a?void 0:"")),j=j?j+(v||""):v;o.rendering=void 0}return o.tagCtx=o.tagCtxs[0],o.ctx=o.tagCtx.ctx,o._.noVws&&o._.inline&&(j="text"===u?Rt.html(j):""),$&&t._.onRender?t._.onRender(j,t,$):j}function b(e,t,n,r,i,a,s,o){var l,p,d,u,c=this,g="array"===t;c.content=s,c.views=g?[]:{},c.parent=n,c.type=t||"top",c.data=r,c.tmpl=i,u=c._={key:0,useKey:g?0:1,id:""+vt++,onRender:o,bnds:{}},c.linked=!!o,n?(l=n.views,p=n._,p.useKey?(l[u.key="_"+p.useKey++]=c,c.index=bt,c.getIndex=f,d=p.tag,u.bnd=g&&(!d||!!d._.bnd&&d)):l.length===(u.key=c.index=a)?l.push(c):l.splice(a,0,c),c.ctx=e||n.ctx):c.ctx=e}function _(e){var t,n,r,i,a,s,o;for(t in yt)if(a=yt[t],(s=a.compile)&&(n=e[t+"s"]))for(r in n)i=n[r]=s(r,n[r],e,0),i._is=t,i&&(o=$t.onStore[t])&&o(r,i,s)}function y(e,t,n){function i(){var t=this;t._={inline:!0,unlinked:!0},t.tagName=e}var a,s,o,l=new $t._tg;if(jt(t)?t={depends:t.depends,render:t}:""+t===t&&(t={template:t}),s=t.baseTag){t.flow=!!t.flow,t.baseTag=s=""+s===s?n&&n.tags[s]||Vt[s]:s,l=d(l,s);for(o in t)l[o]=r(s[o],t[o])}else l=d(l,t);return void 0!==(a=l.template)&&(l.template=""+a===a?Tt[a]||Tt(a):a),l.init!==!1&&((i.prototype=l).constructor=l._ctr=i),n&&(l._parentTmpl=n),l}function k(e){return this.base.apply(this,e)}function C(e,n,r,i){function a(n){var a;if(""+n===n||n.nodeType>0&&(s=n)){if(!s)if("@"===n.charAt(0))t?n=Tt[e=e||(n=t.realpathSync(n.slice(1)))]=Tt[e]||C(e,t.readFileSync(n,"utf8"),r,i):s=P.getElementById(n);else if(G.fn&&!H.test(n))try{s=G(P).find(n)[0]}catch(o){}s&&(i?n=s.innerHTML:((a=s.getAttribute(xt))&&(n=Tt[a])&&e!==a&&delete Tt[a],e=e||a||"_"+gt++,a||(n=C(e,s.innerHTML,r,i)),s.setAttribute(xt,e),Tt[n.tmplName=e]=n),s=void 0)}else n.fn||(n=void 0);return n}var s,o,l=n=n||"";return 0===i&&(i=void 0,l=a(l)),i=i||(n.markup?n:{}),i.tmplName=e,r&&(i._parentTmpl=r),!l&&n.markup&&(l=a(n.markup))&&l.fn&&(l=l.markup),void 0!==l?(l.fn||n.fn?l.fn&&(o=l):(n=A(l,i),N(l.replace(st,"\\$&"),n)),o||(_(i),o=d(function(){return n.render.apply(n,arguments)},n)),e&&!r&&(_t[e]=o),o):void 0}function j(e){function t(t,n){this.tgt=e.getTgt(t,n)}return jt(e)&&(e={getTgt:e}),e.baseMap&&(e=d(d({},e.baseMap),e)),e.map=function(e,n){return new t(e,n)},e}function A(e,t){var n,r=Nt.wrapMap||{},i=d({tmpls:[],links:{},bnds:[],_is:"template",render:R},t);return i.markup=e,t.htmlTag||(n=pt.exec(e),i.htmlTag=n?n[1].toLowerCase():""),n=r[i.htmlTag],n&&n!==r.div&&(i.markup=G.trim(i.markup)),i}function T(e,t){function n(i,a,s){var o,l,p,d;if(i&&typeof i===wt&&!i.nodeType&&!i.markup&&!i.getTgt){for(p in i)n(p,i[p],a);return kt}return void 0===a&&(a=i,i=void 0),i&&""+i!==i&&(s=a,a=i,i=void 0),d=s?s[r]=s[r]||{}:n,l=t.compile,null===a?i&&delete d[i]:(a=l?l(i,a,s,0):a,i&&(d[i]=a)),l&&a&&(a._is=e),a&&(o=$t.onStore[e])&&o(i,a,l),a}var r=e+"s";kt[r]=n}function R(e,t,n,r,i,a){var s,o,l,p,d,u,c,f,g=r,v="";if(t===!0?(n=t,t=void 0):typeof t!==wt&&(t=void 0),(l=this.tag)?(d=this,p=l._.tmpl||d.tmpl,g=g||d.view,arguments.length||(e=g)):p=this,p){if(!g&&e&&"view"===e._is&&(g=e),g&&e===g&&(e=g.data),p.fn||(p=l._.tmpl=Tt[p]||Tt(p)),Q=Q||(u=!g),g||((t=t||{}).root=e),!Q||p.useViews)v=M(p,e,t,n,g,i,a,l);else{if(g?(c=g.data,f=g.index,g.index=bt):(g=D,g.data=e,g.ctx=t),At(e)&&!n)for(s=0,o=e.length;o>s;s++)g.index=s,g.data=e[s],v+=p.fn(e[s],g,kt);else v+=p.fn(e,g,kt);g.data=c,g.index=f}u&&(Q=void 0)}return v}function M(e,t,n,r,i,a,s,o){function l(e){_=d({},n),_[x]=e}var p,u,c,f,g,v,m,h,w,x,_,y,k="";if(o&&(w=o.tagName,y=o.tagCtx,n=n?J(n,o.ctx):o.ctx,m=y.content,y.props.link===!1&&(n=n||{},n.link=!1),(x=y.props.itemVar)&&("~"!==x.charAt(0)&&$("Use itemVar='~myItem'"),x=x.slice(1))),i&&(m=m||i.content,s=s||i._.onRender,n=n||i.ctx),a===!0&&(v=!0,a=0),s&&(n&&n.link===!1||o&&o._.noVws)&&(s=void 0),h=s,s===!0&&(h=void 0,s=i._.onRender),n=e.helpers?J(e.helpers,n):n,_=n,At(t)&&!r)for(c=v?i:void 0!==a&&i||new b(n,"array",i,t,e,a,m,s),x&&(c.it=x),x=c.it,p=0,u=t.length;u>p;p++)x&&l(t[p]),f=new b(_,"item",c,t[p],e,(a||0)+p,m,s),g=e.fn(t[p],f,kt),k+=c._.onRender?c._.onRender(g,f):g;else x&&l(t),c=v?i:new b(_,w||"data",i,t,e,a,m,s),o&&!o.flow&&(c.tag=o),k+=e.fn(t,c,kt);return h?h(k,c):k}function V(e,t,n){var r=Nt.onError(e,t,n);if(""+e===e)throw new $t.Err(r);return!t.linkCtx&&t.linked?Rt.html(r):r}function $(e){V("Syntax error\n"+e)}function N(e,t,n,r,i){function a(t){t-=f,t&&v.push(e.substr(f,t).replace(it,"\\n"))}function s(t,n){t&&(t+="}}",$((n?"{{"+n+"}} block has {{/"+t+" without {{"+t:"Unmatched or missing {{/"+t)+", in template:\n"+e))}function o(o,l,c,h,w,x,b,_,y,k,C,j){x&&(w=":",h=ht),k=k||n&&!i;var A=(l||n)&&[[]],T="",R="",M="",V="",N="",E="",S="",U="",J=!k&&!w&&!b;c=c||(y=y||"#data",w),a(j),f=j+o.length,_?u&&v.push(["*","\n"+y.replace(/^:/,"ret+= ").replace(at,"$1")+";\n"]):c?("else"===c&&(lt.test(y)&&$('for "{{else if expr}}" use "{{else expr}}"'),A=m[7]&&[[]],m[8]=e.substring(m[8],j),m=g.pop(),v=m[2],J=!0),y&&I(y.replace(it," "),A,t).replace(ot,function(e,t,n,r,i,a,s,o){return r="'"+i+"':",s?(R+=a+",",V+="'"+o+"',"):n?(M+=r+a+",",E+=r+"'"+o+"',"):t?S+=a:("trigger"===i&&(U+=a),T+=r+a+",",N+=r+"'"+o+"',",d=d||ct.test(i)),""}).slice(0,-1),A&&A[0]&&A.pop(),p=[c,h||!!r||d||"",J&&[],F(V,N,E),F(R,T,M),S,U,A||0],v.push(p),J&&(g.push(m),m=p,m[8]=f)):C&&(s(C!==m[0]&&"else"!==m[0]&&C,m[0]),m[8]=e.substring(m[8],j),m=g.pop()),s(!m&&C),v=m[2]}var l,p,d,u=Nt.allowCode||t&&t.allowCode,c=[],f=0,g=[],v=c,m=[,,c];return u&&(t.allowCode=u),n&&(e=W+e+et),s(g[0]&&g[0][2].pop()[0]),e.replace(q,o),a(e.length),(f=c[c.length-1])&&s(""+f!==f&&+f[8]===f[8]&&f[0]),n?(l=U(c,e,n),E(l,[c[0][7]])):l=U(c,t),l}function E(e,t){var n,r,i=0,a=t.length;for(e.deps=[];a>i;i++){r=t[i];for(n in r)"_jsvto"!==n&&r[n].length&&(e.deps=e.deps.concat(r[n]))}e.paths=r}function F(e,t,n){return[e.slice(0,-1),t.slice(0,-1),n.slice(0,-1)]}function S(e,t){return"\n "+(t?t+":{":"")+"args:["+e[0]+"]"+(e[1]||!t?",\n props:{"+e[1]+"}":"")+(e[2]?",\n ctx:{"+e[2]+"}":"")}function I(e,t,n){function r(r,h,w,x,b,_,y,k,C,j,A,T,R,M,V,E,F,S,I,U){function J(e,n,r,s,o,l,u,c){var f="."===r;if(r&&(b=b.slice(n.length),f||(e=(s?'view.hlp("'+s+'")':o?"view":"data")+(c?(l?"."+l:s?"":o?"":"."+r)+(u||""):(c=s?"":o?l||"":r,"")),e+=c?"."+c:"",e=n+("view.data"===e.slice(0,9)?e.slice(5):e)),p)){if(B="linkTo"===i?a=t._jsvto=t._jsvto||[]:d.bd,L=f&&B[B.length-1]){if(L._jsv){for(;L.sb;)L=L.sb;L.bnd&&(b="^"+b.slice(1)),L.sb=b,L.bnd=L.bnd||"^"===b.charAt(0)}}else B.push(b);m[g]=I+(f?1:0)}return e}x=p&&x,x&&!k&&(b=x+b),_=_||"",w=w||h||T,b=b||C,j=j||F||"";var K,O,B,L,q;if(!y||l||o){if(p&&E&&!l&&!o&&(!i||s||a)&&(K=m[g-1],U.length-1>I-(K||0))){if(K=U.slice(K,I+r.length),O!==!0)if(B=a||u[g-1].bd,L=B[B.length-1],L&&L.prm){for(;L.sb&&L.sb.prm;)L=L.sb;q=L.sb={path:L.sb,bnd:L.bnd}}else B.push(q={path:B.pop()});E=X+":"+K+" onerror=''"+Y,O=f[E],O||(f[E]=!0,f[E]=O=N(E,n,!0)),O!==!0&&q&&(q._jsv=O,q.prm=d.bd,q.bnd=q.bnd||q.path&&q.path.indexOf("^")>=0)}return l?(l=!R,l?r:T+'"'):o?(o=!M,o?r:T+'"'):(w?(m[g]=I++,d=u[++g]={bd:[]},w):"")+(S?g?"":(c=U.slice(c,I),(i?(i=s=a=!1,"\b"):"\b,")+c+(c=I+r.length,p&&t.push(d.bd=[]),"\b")):k?(g&&$(e),p&&t.pop(),i=b,s=x,c=I+r.length,x&&(p=d.bd=t[i]=[]),b+":"):b?b.split("^").join(".").replace(nt,J)+(j?(d=u[++g]={bd:[]},v[g]=!0,j):_):_?_:V?(v[g]=!1,d=u[--g],V+(j?(d=u[++g],v[g]=!0,j):"")):A?(v[g]||$(e),","):h?"":(l=R,o=M,'"'))}$(e)}var i,a,s,o,l,p=t&&t[0],d={bd:p},u={0:d},c=0,f=n?n.links:p&&(p.links=p.links||{}),g=0,v={},m={};return(e+(n?" ":"")).replace(rt,r)}function U(e,t,n){var r,i,a,s,o,l,p,d,u,c,f,g,v,m,h,w,x,b,_,y,k,C,j,T,R,M,V,N,F,I,J=0,K=t.useViews||t.tags||t.templates||t.helpers||t.converters,O="",B={},L=e.length;for(""+t===t?(b=n?'data-link="'+t.replace(it," ").slice(1,-1)+'"':t,t=0):(b=t.tmplName||"unnamed",t.allowCode&&(B.allowCode=!0),t.debug&&(B.debug=!0),f=t.bnds,x=t.tmpls),r=0;L>r;r++)if(i=e[r],""+i===i)O+='\n+"'+i+'"';else if(a=i[0],"*"===a)O+=";\n"+i[1]+"\nret=ret";else{if(s=i[1],k=!n&&i[2],o=S(i[3],"params")+"},"+S(v=i[4]),N=i[5],I=i[6],C=i[8]&&i[8].replace(at,"$1"),(R="else"===a)?g&&g.push(i[7]):(J=0,f&&(g=i[7])&&(g=[g],J=f.push(1))),K=K||v[1]||v[2]||g||/view.(?!index)/.test(v[0]),(M=":"===a)?s&&(a=s===ht?">":s+a):(k&&(_=A(C,B),_.tmplName=b+"/"+a,_.useViews=_.useViews||K,U(k,_),K=_.useViews,x.push(_)),R||(y=a,K=K||a&&(!Vt[a]||!Vt[a].flow),T=O,O=""),j=e[r+1],j=j&&"else"===j[0]),F=N?";\ntry{\nret+=":"\n+",m="",h="",M&&(g||I||s&&s!==ht)){if(V="return {"+o+"};",w='c("'+s+'",view,',V=new Function("data,view,j,u"," // "+b+" "+J+" "+a+"\n"+V),V._er=N,m=w+J+",",h=")",V._tag=a,n)return V;E(V,g),c=!0}if(O+=M?(n?(N?"\ntry{\n":"")+"return ":F)+(c?(c=void 0,K=u=!0,w+(g?(f[J-1]=V,J):"{"+o+"}")+")"):">"===a?(p=!0,"h("+v[0]+")"):(d=!0,"((v="+(v[0]||"data")+')!=null?v:"")')):(l=!0,"\n{view:view,tmpl:"+(k?x.length:"0")+","+o+"},"),y&&!j){if(O="["+O.slice(0,-1)+"]",w='t("'+y+'",view,this,',n||g){if(O=new Function("data,view,j,u"," // "+b+" "+J+" "+y+"\nreturn "+O+";"),O._er=N,O._tag=y,g&&E(f[J-1]=O,g),n)return O;m=w+J+",undefined,",h=")"}O=T+F+w+(J||O)+")",g=0,y=0}N&&(K=!0,O+=";\n}catch(e){ret"+(n?"urn ":"+=")+m+"j._err(e,view,"+N+")"+h+";}\n"+(n?"":"ret=ret"))}O="// "+b+"\nvar v"+(l?",t=j._tag":"")+(u?",c=j._cnvt":"")+(p?",h=j.converters.html":"")+(n?";\n":',ret=""\n')+(B.debug?"debugger;":"")+O+(n?"\n":";\nreturn ret;"),Nt._dbgMode&&(O="try {\n"+O+"\n}catch(e){\nreturn j._err(e, view);\n}");try{O=new Function("data,view,j,u",O)}catch(q){$("Compiled template code:\n\n"+O+'\n: "'+q.message+'"')}return t&&(t.fn=O,t.useViews=!!K),O}function J(e,t){return e&&e!==t?t?d(d({},t),e):e:t&&d({},t)}function K(e){return mt[e]||(mt[e]="&#"+e.charCodeAt(0)+";")}function O(e){var t,n,r=[];if(typeof e===wt)for(t in e)n=e[t],n&&n.toJSON&&!n.toJSON()||jt(n)||r.push({key:t,prop:n});return r}function B(e){return void 0!=e?ut.test(e)&&(""+e).replace(ft,K)||e:""}e=e===!0;var L,q,H,D,Q,Z="v1.0.0-beta",z=(0,eval)("this"),G=z.jQuery,P=z.document,W="{",X="{",Y="}",et="}",tt="^",nt=/^(!*?)(?:null|true|false|\d[\d.]*|([\w$]+|\.|~([\w$]+)|#(view|([\w$]+))?)([\w$.^]*?)(?:[.[^]([\w$]+)\]?)?)$/g,rt=/(\()(?=\s*\()|(?:([([])\s*)?(?:(\^?)(!*?[#~]?[\w$.^]+)?\s*((\+\+|--)|\+|-|&&|\|\||===|!==|==|!=|<=|>=|[<>%*:?\/]|(=))\s*|(!*?[#~]?[\w$.^]+)([([])?)|(,\s*)|(\(?)\\?(?:(')|("))|(?:\s*(([)\]])(?=\s*[.^]|\s*$|[^\(\[])|[)\]])([([]?))|(\s+)/g,it=/[ \t]*(\r\n|\n|\r)/g,at=/\\(['"])/g,st=/['"\\]/g,ot=/(?:\x08|^)(onerror:)?(?:(~?)(([\w$_\.]+):)?([^\x08]+))\x08(,)?([^\x08]+)/gi,lt=/^if\s/,pt=/<(\w+)[>\s]/,dt=/[\x00`><"'&]/g,ut=/[\x00`><\"'&]/,ct=/^on[A-Z]|^convert(Back)?$/,ft=dt,gt=0,vt=0,mt={"&":"&","<":"<",">":">","\x00":"�","'":"'",'"':""","`":"`"},ht="html",wt="object",xt="data-jsv-tmpl",bt="For #index in nested block use #getIndex().",_t={},yt={template:{compile:C},tag:{compile:y},helper:{},converter:{}},kt={jsviews:Z,settings:function(e){d(Nt,e),l(Nt._dbgMode),Nt.jsv&&Nt.jsv()},sub:{View:b,Err:p,tmplFn:N,parse:I,extend:d,syntaxErr:$,onStore:{},_ths:i,_tg:function(){}},map:j,_cnvt:m,_tag:x,_err:V},Ct=z.jsviews;(p.prototype=new Error).constructor=p,f.depends=function(){return[this.get("item"),"index"]},g.depends="index",b.prototype={get:c,getIndex:g,getRsc:w,hlp:v,_is:"view"};for(L in yt)T(L,yt[L]);var jt,At,Tt=kt.templates,Rt=kt.converters,Mt=kt.helpers,Vt=kt.tags,$t=kt.sub,Nt=kt.settings;return $t._tg.prototype={baseApply:k,cvtArgs:h},D=$t.topView=new b,G?(G.fn.render=function(e,t,n){var r=this.jquery&&(this[0]||V('Unknown template: "'+this.selector+'"')),i=r.getAttribute(xt);return R.call(i?Tt[i]:Tt(r),e,t,n)},G.observable&&(d($t,G.views.sub),kt.map=G.views.map)):(G={},e||(z.jsviews=G),G.isFunction=function(e){return"function"==typeof e},G.isArray=Array.isArray||function(e){return"[object Array]"===G.toString.call(e)},G.noConflict=function(){return z.jsviews===G&&(z.jsviews=Ct),G}),jt=G.isFunction,At=G.isArray,G.render=_t,G.views=kt,G.templates=Tt=kt.templates,kt.compile=function(e,t){return t=t||{},t.markup=e,Tt(t)},Nt({debugMode:l,delimiters:u,onError:function(e,t,n){return t&&(e=void 0===n?"{Error: "+(e.message||e)+"}":jt(n)?n(e,t):n),void 0==e?"":e},_dbgMode:!1}),Vt({"if":{render:function(e){var t=this,n=t.tagCtx,r=t.rendering.done||!e&&(arguments.length||!n.index)?"":(t.rendering.done=!0,t.selected=n.index,n.render(n.view,!0));return r},flow:!0},"for":{render:function(e){var t,n=!arguments.length,r=this,i=r.tagCtx,a="",s=0;return r.rendering.done||(t=n?i.view.data:e,void 0!==t&&(a+=i.render(t,n),s+=At(t)?t.length:1),(r.rendering.done=s)&&(r.selected=i.index)),a},flow:!0},props:{baseTag:"for",dataMap:j(O),flow:!0},include:{flow:!0},"*":{render:a,flow:!0},":*":{render:a,flow:!0},dbg:Mt.dbg=Rt.dbg=o}),Rt({html:B,attr:B,url:function(e){return void 0!=e?encodeURI(""+e):null===e?e:""}}),u(),kt});
|
4
|
-
//# sourceMappingURL=jsrender.min.js.map
|