├── .gitattributes
├── .gitignore
├── LICENSE
├── README.md
├── demo.html
└── screen.nw
├── css
├── normalize.css
└── style.css
├── images
├── LICENSE-PHOTOS.txt
├── demo1.jpg
├── demo2.jpg
├── demo3.jpg
├── demo4.jpg
└── demo5.jpg
├── index.html
├── js
├── app.js
├── background-blur.0.1.3.min.js
├── exif.js
├── grade.1.0.10.min.js
├── imagesloaded.pkgd.min.js
├── jquery-imagefill.js
└── jquery.3.1.1.min.js
└── package.json
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
4 | # Custom for Visual Studio
5 | *.cs diff=csharp
6 | *.sln merge=union
7 | *.csproj merge=union
8 | *.vbproj merge=union
9 | *.fsproj merge=union
10 | *.dbproj merge=union
11 |
12 | # Standard to msysgit
13 | *.doc diff=astextplain
14 | *.DOC diff=astextplain
15 | *.docx diff=astextplain
16 | *.DOCX diff=astextplain
17 | *.dot diff=astextplain
18 | *.DOT diff=astextplain
19 | *.pdf diff=astextplain
20 | *.PDF diff=astextplain
21 | *.rtf diff=astextplain
22 | *.RTF diff=astextplain
23 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | #################
2 | ## Eclipse
3 | #################
4 |
5 | *.pydevproject
6 | .project
7 | .metadata
8 | bin/
9 | tmp/
10 | *.tmp
11 | *.bak
12 | *.swp
13 | *~.nib
14 | local.properties
15 | .classpath
16 | .settings/
17 | .loadpath
18 |
19 | # External tool builders
20 | .externalToolBuilders/
21 |
22 | # Locally stored "Eclipse launch configurations"
23 | *.launch
24 |
25 | # CDT-specific
26 | .cproject
27 |
28 | # PDT-specific
29 | .buildpath
30 |
31 |
32 | #################
33 | ## Visual Studio
34 | #################
35 |
36 | ## Ignore Visual Studio temporary files, build results, and
37 | ## files generated by popular Visual Studio add-ons.
38 |
39 | # User-specific files
40 | *.suo
41 | *.user
42 | *.sln.docstates
43 |
44 | # Build results
45 |
46 | [Dd]ebug/
47 | [Rr]elease/
48 | x64/
49 | build/
50 | [Bb]in/
51 | [Oo]bj/
52 |
53 | # MSTest test Results
54 | [Tt]est[Rr]esult*/
55 | [Bb]uild[Ll]og.*
56 |
57 | *_i.c
58 | *_p.c
59 | *.ilk
60 | *.meta
61 | *.obj
62 | *.pch
63 | *.pdb
64 | *.pgc
65 | *.pgd
66 | *.rsp
67 | *.sbr
68 | *.tlb
69 | *.tli
70 | *.tlh
71 | *.tmp
72 | *.tmp_proj
73 | *.log
74 | *.vspscc
75 | *.vssscc
76 | .builds
77 | *.pidb
78 | *.log
79 | *.scc
80 |
81 | # Visual C++ cache files
82 | ipch/
83 | *.aps
84 | *.ncb
85 | *.opensdf
86 | *.sdf
87 | *.cachefile
88 |
89 | # Visual Studio profiler
90 | *.psess
91 | *.vsp
92 | *.vspx
93 |
94 | # Guidance Automation Toolkit
95 | *.gpState
96 |
97 | # ReSharper is a .NET coding add-in
98 | _ReSharper*/
99 | *.[Rr]e[Ss]harper
100 |
101 | # TeamCity is a build add-in
102 | _TeamCity*
103 |
104 | # DotCover is a Code Coverage Tool
105 | *.dotCover
106 |
107 | # NCrunch
108 | *.ncrunch*
109 | .*crunch*.local.xml
110 |
111 | # Installshield output folder
112 | [Ee]xpress/
113 |
114 | # DocProject is a documentation generator add-in
115 | DocProject/buildhelp/
116 | DocProject/Help/*.HxT
117 | DocProject/Help/*.HxC
118 | DocProject/Help/*.hhc
119 | DocProject/Help/*.hhk
120 | DocProject/Help/*.hhp
121 | DocProject/Help/Html2
122 | DocProject/Help/html
123 |
124 | # Click-Once directory
125 | publish/
126 |
127 | # Publish Web Output
128 | *.Publish.xml
129 | *.pubxml
130 |
131 | # NuGet Packages Directory
132 | ## TODO: If you have NuGet Package Restore enabled, uncomment the next line
133 | #packages/
134 |
135 | # Windows Azure Build Output
136 | csx
137 | *.build.csdef
138 |
139 | # Windows Store app package directory
140 | AppPackages/
141 |
142 | # Others
143 | sql/
144 | *.Cache
145 | ClientBin/
146 | [Ss]tyle[Cc]op.*
147 | ~$*
148 | *~
149 | *.dbmdl
150 | *.[Pp]ublish.xml
151 | *.pfx
152 | *.publishsettings
153 |
154 | # RIA/Silverlight projects
155 | Generated_Code/
156 |
157 | # Backup & report files from converting an old project file to a newer
158 | # Visual Studio version. Backup files are not needed, because we have git ;-)
159 | _UpgradeReport_Files/
160 | Backup*/
161 | UpgradeLog*.XML
162 | UpgradeLog*.htm
163 |
164 | # SQL Server files
165 | App_Data/*.mdf
166 | App_Data/*.ldf
167 |
168 | #############
169 | ## Windows detritus
170 | #############
171 |
172 | # Windows image file caches
173 | Thumbs.db
174 | ehthumbs.db
175 |
176 | # Folder config file
177 | Desktop.ini
178 |
179 | # Recycle Bin used on file shares
180 | $RECYCLE.BIN/
181 |
182 | # Mac crap
183 | .DS_Store
184 |
185 |
186 | #############
187 | ## Python
188 | #############
189 |
190 | *.py[co]
191 |
192 | # Packages
193 | *.egg
194 | *.egg-info
195 | dist/
196 | build/
197 | eggs/
198 | parts/
199 | var/
200 | sdist/
201 | develop-eggs/
202 | .installed.cfg
203 |
204 | # Installer logs
205 | pip-log.txt
206 |
207 | # Unit test / coverage reports
208 | .coverage
209 | .tox
210 |
211 | #Translations
212 | *.mo
213 |
214 | #Mr Developer
215 | .mr.developer.cfg
216 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2017 Marco Krage http://marco.mit-license.org/
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # html5-screensaver-node-webkit
2 |
3 | > Screensaver made with HTML5, CSS, Javascript and NodeJS driven by [nwjs](https://github.com/nwjs/nw.js) (node-webkit)
4 |
5 | Demo: https://sinky.github.io/html5-screensaver-node-webkit/demo.html
6 |
7 | ## Usage
8 | Download [node-webkit](http://nwjs.io/) and rename the folder to nwjs and move it into the same folder where the ``screen.nw`` folder is located.
9 |
10 | Run ``.\nwjs\nw.exe screen.nw`` from within this directory to test the screensaver.
11 |
12 | Folder structure:
13 | |- screen.nw/
14 | |- nwjs/
15 |
16 |
17 | ## Windows Screensaver
18 | Use "runscreensaver" as an Windows Screensaver. "runscreensaver" can be configured to run a command as screensaver.
19 | https://github.com/sinky/runscreensaver
20 |
21 |
22 | ## License
23 | MIT http://marco.mit-license.org/
24 |
--------------------------------------------------------------------------------
/demo.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Screensaver Demo
7 |
8 |
9 |
10 |
63 |
64 |
65 |
66 |
75 |
76 |
77 |
--------------------------------------------------------------------------------
/screen.nw/css/normalize.css:
--------------------------------------------------------------------------------
1 | /*! normalize.css v2.1.0 | MIT License | git.io/normalize */
2 |
3 | /* ==========================================================================
4 | HTML5 display definitions
5 | ========================================================================== */
6 |
7 | /**
8 | * Correct `block` display not defined in IE 8/9.
9 | */
10 |
11 | article,
12 | aside,
13 | details,
14 | figcaption,
15 | figure,
16 | footer,
17 | header,
18 | hgroup,
19 | main,
20 | nav,
21 | section,
22 | summary {
23 | display: block;
24 | }
25 |
26 | /**
27 | * Correct `inline-block` display not defined in IE 8/9.
28 | */
29 |
30 | audio,
31 | canvas,
32 | video {
33 | display: inline-block;
34 | }
35 |
36 | /**
37 | * Prevent modern browsers from displaying `audio` without controls.
38 | * Remove excess height in iOS 5 devices.
39 | */
40 |
41 | audio:not([controls]) {
42 | display: none;
43 | height: 0;
44 | }
45 |
46 | /**
47 | * Address styling not present in IE 8/9.
48 | */
49 |
50 | [hidden] {
51 | display: none;
52 | }
53 |
54 | /* ==========================================================================
55 | Base
56 | ========================================================================== */
57 |
58 | /**
59 | * 1. Set default font family to sans-serif.
60 | * 2. Prevent iOS text size adjust after orientation change, without disabling
61 | * user zoom.
62 | */
63 |
64 | html {
65 | font-family: sans-serif; /* 1 */
66 | -webkit-text-size-adjust: 100%; /* 2 */
67 | -ms-text-size-adjust: 100%; /* 2 */
68 | }
69 |
70 | /**
71 | * Remove default margin.
72 | */
73 |
74 | body {
75 | margin: 0;
76 | }
77 |
78 | /* ==========================================================================
79 | Links
80 | ========================================================================== */
81 |
82 | /**
83 | * Address `outline` inconsistency between Chrome and other browsers.
84 | */
85 |
86 | a:focus {
87 | outline: thin dotted;
88 | }
89 |
90 | /**
91 | * Improve readability when focused and also mouse hovered in all browsers.
92 | */
93 |
94 | a:active,
95 | a:hover {
96 | outline: 0;
97 | }
98 |
99 | /* ==========================================================================
100 | Typography
101 | ========================================================================== */
102 |
103 | /**
104 | * Address variable `h1` font-size and margin within `section` and `article`
105 | * contexts in Firefox 4+, Safari 5, and Chrome.
106 | */
107 |
108 | h1 {
109 | font-size: 2em;
110 | margin: 0.67em 0;
111 | }
112 |
113 | /**
114 | * Address styling not present in IE 8/9, Safari 5, and Chrome.
115 | */
116 |
117 | abbr[title] {
118 | border-bottom: 1px dotted;
119 | }
120 |
121 | /**
122 | * Address style set to `bolder` in Firefox 4+, Safari 5, and Chrome.
123 | */
124 |
125 | b,
126 | strong {
127 | font-weight: bold;
128 | }
129 |
130 | /**
131 | * Address styling not present in Safari 5 and Chrome.
132 | */
133 |
134 | dfn {
135 | font-style: italic;
136 | }
137 |
138 | /**
139 | * Address differences between Firefox and other browsers.
140 | */
141 |
142 | hr {
143 | -moz-box-sizing: content-box;
144 | box-sizing: content-box;
145 | height: 0;
146 | }
147 |
148 | /**
149 | * Address styling not present in IE 8/9.
150 | */
151 |
152 | mark {
153 | background: #ff0;
154 | color: #000;
155 | }
156 |
157 | /**
158 | * Correct font family set oddly in Safari 5 and Chrome.
159 | */
160 |
161 | code,
162 | kbd,
163 | pre,
164 | samp {
165 | font-family: monospace, serif;
166 | font-size: 1em;
167 | }
168 |
169 | /**
170 | * Improve readability of pre-formatted text in all browsers.
171 | */
172 |
173 | pre {
174 | white-space: pre-wrap;
175 | }
176 |
177 | /**
178 | * Set consistent quote types.
179 | */
180 |
181 | q {
182 | quotes: "\201C" "\201D" "\2018" "\2019";
183 | }
184 |
185 | /**
186 | * Address inconsistent and variable font size in all browsers.
187 | */
188 |
189 | small {
190 | font-size: 80%;
191 | }
192 |
193 | /**
194 | * Prevent `sub` and `sup` affecting `line-height` in all browsers.
195 | */
196 |
197 | sub,
198 | sup {
199 | font-size: 75%;
200 | line-height: 0;
201 | position: relative;
202 | vertical-align: baseline;
203 | }
204 |
205 | sup {
206 | top: -0.5em;
207 | }
208 |
209 | sub {
210 | bottom: -0.25em;
211 | }
212 |
213 | /* ==========================================================================
214 | Embedded content
215 | ========================================================================== */
216 |
217 | /**
218 | * Remove border when inside `a` element in IE 8/9.
219 | */
220 |
221 | img {
222 | border: 0;
223 | }
224 |
225 | /**
226 | * Correct overflow displayed oddly in IE 9.
227 | */
228 |
229 | svg:not(:root) {
230 | overflow: hidden;
231 | }
232 |
233 | /* ==========================================================================
234 | Figures
235 | ========================================================================== */
236 |
237 | /**
238 | * Address margin not present in IE 8/9 and Safari 5.
239 | */
240 |
241 | figure {
242 | margin: 0;
243 | }
244 |
245 | /* ==========================================================================
246 | Forms
247 | ========================================================================== */
248 |
249 | /**
250 | * Define consistent border, margin, and padding.
251 | */
252 |
253 | fieldset {
254 | border: 1px solid #c0c0c0;
255 | margin: 0 2px;
256 | padding: 0.35em 0.625em 0.75em;
257 | }
258 |
259 | /**
260 | * 1. Correct `color` not being inherited in IE 8/9.
261 | * 2. Remove padding so people aren't caught out if they zero out fieldsets.
262 | */
263 |
264 | legend {
265 | border: 0; /* 1 */
266 | padding: 0; /* 2 */
267 | }
268 |
269 | /**
270 | * 1. Correct font family not being inherited in all browsers.
271 | * 2. Correct font size not being inherited in all browsers.
272 | * 3. Address margins set differently in Firefox 4+, Safari 5, and Chrome.
273 | */
274 |
275 | button,
276 | input,
277 | select,
278 | textarea {
279 | font-family: inherit; /* 1 */
280 | font-size: 100%; /* 2 */
281 | margin: 0; /* 3 */
282 | }
283 |
284 | /**
285 | * Address Firefox 4+ setting `line-height` on `input` using `!important` in
286 | * the UA stylesheet.
287 | */
288 |
289 | button,
290 | input {
291 | line-height: normal;
292 | }
293 |
294 | /**
295 | * Address inconsistent `text-transform` inheritance for `button` and `select`.
296 | * All other form control elements do not inherit `text-transform` values.
297 | * Correct `button` style inheritance in Chrome, Safari 5+, and IE 8+.
298 | * Correct `select` style inheritance in Firefox 4+ and Opera.
299 | */
300 |
301 | button,
302 | select {
303 | text-transform: none;
304 | }
305 |
306 | /**
307 | * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`
308 | * and `video` controls.
309 | * 2. Correct inability to style clickable `input` types in iOS.
310 | * 3. Improve usability and consistency of cursor style between image-type
311 | * `input` and others.
312 | */
313 |
314 | button,
315 | html input[type="button"], /* 1 */
316 | input[type="reset"],
317 | input[type="submit"] {
318 | -webkit-appearance: button; /* 2 */
319 | cursor: pointer; /* 3 */
320 | }
321 |
322 | /**
323 | * Re-set default cursor for disabled elements.
324 | */
325 |
326 | button[disabled],
327 | html input[disabled] {
328 | cursor: default;
329 | }
330 |
331 | /**
332 | * 1. Address box sizing set to `content-box` in IE 8/9.
333 | * 2. Remove excess padding in IE 8/9.
334 | */
335 |
336 | input[type="checkbox"],
337 | input[type="radio"] {
338 | box-sizing: border-box; /* 1 */
339 | padding: 0; /* 2 */
340 | }
341 |
342 | /**
343 | * 1. Address `appearance` set to `searchfield` in Safari 5 and Chrome.
344 | * 2. Address `box-sizing` set to `border-box` in Safari 5 and Chrome
345 | * (include `-moz` to future-proof).
346 | */
347 |
348 | input[type="search"] {
349 | -webkit-appearance: textfield; /* 1 */
350 | -moz-box-sizing: content-box;
351 | -webkit-box-sizing: content-box; /* 2 */
352 | box-sizing: content-box;
353 | }
354 |
355 | /**
356 | * Remove inner padding and search cancel button in Safari 5 and Chrome
357 | * on OS X.
358 | */
359 |
360 | input[type="search"]::-webkit-search-cancel-button,
361 | input[type="search"]::-webkit-search-decoration {
362 | -webkit-appearance: none;
363 | }
364 |
365 | /**
366 | * Remove inner padding and border in Firefox 4+.
367 | */
368 |
369 | button::-moz-focus-inner,
370 | input::-moz-focus-inner {
371 | border: 0;
372 | padding: 0;
373 | }
374 |
375 | /**
376 | * 1. Remove default vertical scrollbar in IE 8/9.
377 | * 2. Improve readability and alignment in all browsers.
378 | */
379 |
380 | textarea {
381 | overflow: auto; /* 1 */
382 | vertical-align: top; /* 2 */
383 | }
384 |
385 | /* ==========================================================================
386 | Tables
387 | ========================================================================== */
388 |
389 | /**
390 | * Remove most spacing between table cells.
391 | */
392 |
393 | table {
394 | border-collapse: collapse;
395 | border-spacing: 0;
396 | }
397 |
--------------------------------------------------------------------------------
/screen.nw/css/style.css:
--------------------------------------------------------------------------------
1 | * { cursor: none; }
2 |
3 | html, body , #slides, .photo, .image {
4 | height: 100%;
5 | width: 100%;
6 | margin: 0;
7 | padding: 0;
8 | overflow: hidden;
9 | }
10 |
11 | body {
12 | background: #000;
13 | }
14 |
15 | #statusPause {
16 | position: absolute;
17 | z-index: 100;
18 | display: inline-block;
19 | font-weight: bold;
20 | font-size: 30px;
21 | letter-spacing: 5px;
22 | color: #fff;
23 | text-shadow: 0 0 5px #000;
24 | padding: 0 5px 0 8px;
25 | margin: 5px;
26 | background: rgba(255,255,255,0.3);
27 | border-radius: 3px;
28 | }
29 |
30 | .hide {
31 | display: none!important;
32 | }
33 |
34 | #debug {
35 | position: absolute;
36 | top: 0;
37 | z-index: 9999;
38 | }
39 |
40 | #slides {
41 | text-align: center;
42 | }
43 |
44 | .photo {
45 | opacity: 0;
46 | position: absolute;
47 | /* CSS animation defined in JS */
48 | }
49 |
50 | .photo .bg-css3blur,
51 | .photo .bg-svgblur {
52 | position: absolute;
53 | top: 0;
54 | left: 0;
55 | z-index: -1;
56 | }
57 |
58 | .photo .bg-css3blur {
59 | background-size: cover;
60 | background-position: 50% 50%;
61 | filter: blur(20px) opacity(0.5);
62 | height: 100%;
63 | width: 100%;
64 | transform: scale(1.05);
65 | }
66 |
67 | .photo .bg-svgblur {
68 | filter: opacity(0.5);
69 | }
70 |
71 | .photo.portrait .image img {
72 | height: 100%;
73 | }
74 |
75 | .photo .exif {
76 | position: absolute;
77 | bottom: 0;
78 | left: 0;
79 | color: #fff;
80 | background: rgba(0,0,0,0.5);
81 | padding: 5px 8px;
82 | opacity: .5;
83 | font-size: 80%;
84 | }
85 |
86 | .photo .map {
87 | position: absolute;
88 | bottom: 0;
89 | right: 0;
90 | z-index: 100;
91 | }
92 |
93 | .photo .map img {
94 | vertical-align: middle;
95 | }
96 |
97 | .visible {
98 | opacity: 1;
99 | }
100 |
101 | .fadeIn {
102 | opacity: 1;
103 | z-index: 10;
104 | }
--------------------------------------------------------------------------------
/screen.nw/images/LICENSE-PHOTOS.txt:
--------------------------------------------------------------------------------
1 | Images by http://unsplash.com/
2 | Free (http://creativecommons.org/choose/zero/) hi-resolution photos.
3 |
--------------------------------------------------------------------------------
/screen.nw/images/demo1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sinky/html5-screensaver-node-webkit/bfb9358f99593442d1946332f95e1d5d9796e6d9/screen.nw/images/demo1.jpg
--------------------------------------------------------------------------------
/screen.nw/images/demo2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sinky/html5-screensaver-node-webkit/bfb9358f99593442d1946332f95e1d5d9796e6d9/screen.nw/images/demo2.jpg
--------------------------------------------------------------------------------
/screen.nw/images/demo3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sinky/html5-screensaver-node-webkit/bfb9358f99593442d1946332f95e1d5d9796e6d9/screen.nw/images/demo3.jpg
--------------------------------------------------------------------------------
/screen.nw/images/demo4.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sinky/html5-screensaver-node-webkit/bfb9358f99593442d1946332f95e1d5d9796e6d9/screen.nw/images/demo4.jpg
--------------------------------------------------------------------------------
/screen.nw/images/demo5.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sinky/html5-screensaver-node-webkit/bfb9358f99593442d1946332f95e1d5d9796e6d9/screen.nw/images/demo5.jpg
--------------------------------------------------------------------------------
/screen.nw/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Screensaver
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | II
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/screen.nw/js/app.js:
--------------------------------------------------------------------------------
1 | var debug = false;
2 | var scr = {
3 | imageDir: 'images/',
4 | random: true,
5 | animation: {
6 | duration: 6000,
7 | fade: 3000
8 | },
9 | portraitBackground: 'css3blur', // Options: svgblur, css3blur or gradient
10 | exif: {
11 | showData: true,
12 | showMap: false
13 | }
14 | };
15 | var googleStaticMapsURL = 'http://maps.googleapis.com/maps/api/staticmap?center={{center}}&zoom=2&scale=1&size=350x150&maptype=roadmap&format=png&visual_refresh=true&markers=size:tiny%7Ccolor:0x019cef%7Clabel:%7C{{center}}';
16 |
17 | var slideInterval, playing;
18 | var mouseDelta = {};
19 |
20 | var isNode = (typeof process !== "undefined" && typeof require !== "undefined");
21 | var isNodeWebkit = (function() {
22 | if(isNode) {
23 | try {
24 | return (typeof require('nw.gui') !== "undefined");
25 | } catch(e) {
26 | return false;
27 | }
28 | }else{
29 | return false;
30 | }
31 | })();
32 |
33 | if(isNodeWebkit) {
34 | var win = nw.Window.get();
35 | var app = nw.App;
36 |
37 | // debug
38 | if(app.fullArgv.indexOf('--debug') != -1){
39 | debug = true;
40 | win.leaveKioskMode();
41 | win.showDevTools();
42 | console.log('win', win);
43 | }
44 |
45 | // Try to get files vom scr.imageDir with nodejs
46 | try {
47 | var fs = require('fs');
48 | scr.images = fs.readdirSync("./"+scr.imageDir);
49 | console.log("Readdir", scr.images);
50 | // filter only images
51 | scr.images = scr.images.filter(function(el){
52 | return checkExtension(el, 'jpg,jpeg,png,gif');
53 | });
54 |
55 | // Prepend imageDir Path
56 | scr.images = scr.images.map(function(e) {
57 | return scr.imageDir + e;
58 | });
59 |
60 | console.log("Readdir filtered", scr.images);
61 | }catch(e) {
62 | alert(e);
63 | }
64 | }else{
65 | // no NWSJ using demo images
66 | scr.images = [
67 | 'images/demo1.jpg',
68 | 'images/demo2.jpg',
69 | 'images/demo3.jpg',
70 | 'images/demo4.jpg',
71 | 'images/demo5.jpg'
72 | ];
73 | }
74 |
75 | if(scr.images.length < 1) {
76 | alert('Keine Fotos im Ordner ' + './' + scr.imageDir + ' gefunden.');
77 | }
78 |
79 | jQuery(function($){
80 | // Add Transition CSS dynamicly
81 | $('').text('.photo { transition: opacity ' + scr.animation.fade + 'ms cubic-bezier(.3,.8,.5,1); }').appendTo('head');
82 |
83 | // Hide exif or map if localstorage setting is (String)true
84 | if(localStorage.getItem("screensaver.hideExif") == "true") {
85 | $('').text('.photo .exif { display: none; }').appendTo('head');
86 | }
87 | if(localStorage.getItem("screensaver.hideMap") == "true") {
88 | $('').text('.photo .map { display: none; }').appendTo('head');
89 | }
90 |
91 | // Randomize images
92 | if(scr.random) {
93 | console.log('shuffle');
94 | shuffle(scr.images);
95 | }
96 |
97 | // Clone Array
98 | var images = scr.images.slice();
99 |
100 | // Create DOM Elements, one after the other
101 | // processImage calls itself on image load event
102 | var processImage = function() {
103 | if(!images.length) { return false; }
104 |
105 | var imgPath = images.shift();
106 |
107 | //console.log(imgPath);
108 |
109 | // Wrapper
110 | var $photo = $("").addClass('photo').appendTo('#slides');
111 | var $image = $("").addClass('image').appendTo($photo);
112 |
113 | // Image
114 | var $img = $('
')
115 | .attr('src', imgPath)
116 | .appendTo($image)
117 | .on('load', function() {
118 | var $this = $(this);
119 |
120 | // portrait orientation check
121 | if($this.width() < $this.height()) {
122 | // is portrait
123 | $this.parents('.photo').addClass('portrait');
124 |
125 | if(scr.portraitBackground == 'css3blur') {
126 | // background css3 blur
127 | $("").addClass('bg-css3blur').css('background-image', 'url('+imgPath+')').appendTo($this.parents('.photo'));
128 | }else if(scr.portraitBackground == 'svgblur') {
129 | // background svg blur
130 | // TODO: add onResize
131 | $this.parents('.photo').backgroundBlur({
132 | imageURL : $this.attr('src'),
133 | blurAmount : 20,
134 | imageClass : 'bg-svgblur'
135 | });
136 | }else if(scr.portraitBackground == 'gradient') {
137 | // background gradient
138 | Grade($this.parents('.photo').get(0));
139 | }
140 |
141 | }else{
142 | // is landscape
143 | // Fit image
144 | $this.parent().imagefill({throttle: 200});
145 | }
146 |
147 | // Exif Data
148 | if(scr.exif.showData || exif.showMap) {
149 | try{
150 | EXIF.getData($this.get(0), function() {
151 |
152 | var exif = EXIF.getAllTags(this);
153 | var lat = exif.GPSLatitude;
154 | var lon = exif.GPSLongitude;
155 |
156 | console.log(exif);
157 |
158 | // show exif data
159 | if(scr.exif.showData) {
160 | var data = [];
161 | data.push(exif.Make + " " + exif.Model);
162 |
163 | data.push(exif.FocalLength.numerator / exif.FocalLength.denominator + "mm");
164 |
165 | data.push("f/" + exif.FNumber.numerator / exif.FNumber.denominator);
166 | data.push(exif.ExposureTime.numerator + "/" + exif.ExposureTime.denominator + "s");
167 | data.push("ISO " + exif.ISOSpeedRatings);
168 |
169 | if(typeof exif.ImageDescription != 'undefined'){
170 | if(exif.ImageDescription.trim()) {
171 | data.push(exif.ImageDescription.trim());
172 | }
173 | }
174 |
175 | $('').addClass('exif').html(data.join(' - ')).appendTo($this.parents('.photo'));
176 | }
177 |
178 | // show exif Map
179 | if(scr.exif.showMap && exif['GPSLatitude'] && exif['GPSLongitude']) {
180 | var lat = to_decimal(exif['GPSLatitude'][0], exif['GPSLatitude'][1], exif['GPSLatitude'][2], exif['GPSLatitudeRef']);
181 | var lng = to_decimal(exif['GPSLongitude'][0], exif['GPSLongitude'][1], exif['GPSLongitude'][2], exif['GPSLongitudeRef']);
182 | //console.log(imgPath, lat +','+lng);
183 |
184 | var mapImgURL = googleStaticMapsURL.replace(/{{center}}/g, lat + ',' + lng);
185 | var $mapImg = $('
').attr('src', mapImgURL)
186 | $('').addClass('map').append($mapImg).appendTo($this.parents('.photo'));
187 | }
188 | });
189 | }catch(e){
190 | console.error('EXIF', e);
191 | }
192 | }
193 |
194 | // Load Next Image
195 | processImage();
196 | });
197 | };
198 | processImage();
199 |
200 | // Set Event Listeners for "exit on input"
201 | setEvents();
202 |
203 | // Start Slideshow
204 | initSlide();
205 |
206 | }); // jQuery End
207 |
208 |
209 | function initSlide() {
210 | // show first image when loaded
211 | $('#slides .photo:first-child img').on('load', function() {
212 | changePhoto();
213 | });
214 |
215 | // Start interval
216 | startSlide();
217 | }
218 |
219 | function startSlide() {
220 | // Stop running Slideshow
221 | stopSlide();
222 |
223 | // Set Interval to variable
224 | slideInterval = setInterval(function() {
225 | changePhoto();
226 | }, scr.animation.fade + scr.animation.duration);
227 | playing = true;
228 | }
229 |
230 | function stopSlide() {
231 | // Stop Intervall
232 | clearInterval(slideInterval);
233 | slideInterval = false;
234 | playing = false;
235 | }
236 | function resetSlideInterval() {
237 | // reset Intervall
238 | if(slideInterval) {
239 | stopSlide();
240 | startSlide();
241 | }
242 | }
243 |
244 | function changePhoto(backward) {
245 | var $current = $('#slides .visible').removeClass('visible');
246 | var $nextPhoto;
247 |
248 | // get the next image acccording direction
249 | if(backward) {
250 | $nextPhoto = $current.prev();
251 | if( $nextPhoto.length === 0 ) {
252 | $nextPhoto = $('#slides .photo').last();
253 | }
254 | }else{
255 | $nextPhoto = $current.next();
256 | if( $nextPhoto.length === 0 ) {
257 | $nextPhoto = $('#slides .photo').first();
258 | }
259 | }
260 |
261 | // in case of first call $current is empty
262 | if(!$nextPhoto.length) {
263 | $nextPhoto = $('#slides .photo').first();
264 | }
265 |
266 | $nextPhoto.addClass('visible');
267 | }
268 |
269 |
270 |
271 | function setEvents() {
272 | $(window).mousemove(function(e) {
273 | if(!mouseDelta.x) {
274 | mouseDelta.x = e.pageX;
275 | mouseDelta.y = e.pageY;
276 | return false;
277 | }
278 |
279 | var deltax = Math.abs(e.pageX - mouseDelta.x);
280 | var deltay = Math.abs(e.pageY - mouseDelta.y);
281 | if(deltax > 20 || deltay > 20){
282 | endScreensaver(e);
283 | }
284 | });
285 |
286 | $(window).on("mousedown keydown", function(e){
287 | console.log("Event: mousedown||keydown", e);
288 | if(e.keyCode == 37) { // Prev
289 | console.log("keydown", "prev");
290 | changePhoto(true);
291 | resetSlideInterval();
292 | return false;
293 | }else if(e.keyCode == 39) { // Next
294 | console.log("keydown", "next");
295 | changePhoto();
296 | resetSlideInterval();
297 | return false;
298 | }else if(e.keyCode == 32) { // Play/Pause
299 | if(playing){
300 | console.log("keydown", "stop");
301 | stopSlide();
302 | $('#statusPause').removeClass('hide');
303 | playing = false;
304 | }else{
305 | console.log("keydown", "start");
306 | startSlide();
307 | $('#statusPause').addClass('hide');
308 | playing = true;
309 | }
310 | return false;
311 | }else if(e.keyCode == 69) { // e
312 | $('.photo .exif').fadeToggle();
313 | localStorage.setItem("screensaver.hideExif", $('.photo .exif').is(":not(:visible)"));
314 | }else if(e.keyCode == 77) { // m
315 | $('.photo .map').fadeToggle();
316 | localStorage.setItem("screensaver.hideMap", $('.photo .map').is(":not(:visible)"));
317 | }
318 | if(!debug){
319 | e.preventDefault();
320 | }
321 | endScreensaver(e);
322 | });
323 | }
324 |
325 | function endScreensaver(e) {
326 | if(isNodeWebkit && !debug){ // don't close on debug-mode
327 | win.close();
328 | }
329 | }
330 |
331 | function shuffle(array) { // http://bost.ocks.org/mike/shuffle/
332 | var m = array.length, t, i;
333 |
334 | while (m) {
335 | i = Math.floor(Math.random() * m--);
336 | t = array[m];
337 | array[m] = array[i];
338 | array[i] = t;
339 | }
340 |
341 | return array;
342 | }
343 |
344 | function checkExtension(str, ext) {
345 | var extArray = ext.split(',');
346 |
347 | for(var i=0; i < extArray.length; i++) {
348 | if(str.toLowerCase().split('.').pop() == extArray[i]) {
349 | return true;
350 | }
351 | }
352 | return false;
353 | }
354 |
355 | function to_decimal($deg, $min, $sec, $hem){
356 | $d = $deg + (($min/60) + ($sec/3600));
357 | return ($hem =='S' || $hem=='W') ? $d*=-1 : $d;
358 | }
--------------------------------------------------------------------------------
/screen.nw/js/background-blur.0.1.3.min.js:
--------------------------------------------------------------------------------
1 | !function(t){"use strict";function e(e){return this.each(function(){var i=t(this),n=i.data("plugin.backgroundBlur"),o=t.extend({},r.DEFAULTS,i.data(),"object"==typeof e&&e);n||i.data("plugin.backgroundBlur",n=new r(this,o)),"fadeIn"===e?n.fadeIn():"fadeOut"===e?n.fadeOut():"string"==typeof e&&n.generateBlurredImage(e)})}var i=function(){for(var t,e=3,i=document.createElement("div"),n=i.getElementsByTagName("i");i.innerHTML="",n[0];);return e>4?e:t}(),n=function(){return"_"+Math.random().toString(36).substr(2,9)},o={svgns:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",createElement:function(t,e){var i=document.createElementNS(o.svgns,t);return e&&o.setAttr(i,e),i},setAttr:function(t,e){for(var i in e)"href"===i?t.setAttributeNS(o.xlink,i,e[i]):t.setAttribute(i,e[i]);return t}},r=function(e,i){this.internalID=n(),this.$element=t(e),this.$width=this.$element.width(),this.$height=this.$element.height(),this.element=e,this.options=t.extend({},r.DEFAULTS,i),this.$overlayEl=this.createOverlay(),this.$blurredImage={},this.useVelocity=this.detectVelocity(),this.attachListeners(),this.generateBlurredImage(this.options.imageURL)};r.VERSION="0.1.1",r.DEFAULTS={imageURL:"",blurAmount:10,imageClass:"",overlayClass:"",duration:!1,opacity:1},r.prototype.detectVelocity=function(){return!!window.jQuery.Velocity},r.prototype.attachListeners=function(){this.$element.on("ui.blur.loaded",t.proxy(this.fadeIn,this)),this.$element.on("ui.blur.unload",t.proxy(this.fadeOut,this))},r.prototype.fadeIn=function(){this.options.duration&&this.options.duration>0&&(this.useVelocity?this.$blurredImage.velocity({opacity:this.options.opacity},{duration:this.options.duration}):this.$blurredImage.animate({opacity:this.options.opacity},{duration:this.options.duration}))},r.prototype.fadeOut=function(){this.options.duration&&this.options.duration>0?this.useVelocity?this.$blurredImage.velocity({opacity:0},{duration:this.options.duration}):this.$blurredImage.animate({opacity:0},{duration:this.options.duration}):this.$blurredImage.css({opacity:0})},r.prototype.generateBlurredImage=function(t){var e=this.$blurredImage;this.internalID=n(),e.length>0&&(this.options.duration&&this.options.duration>0?this.useVelocity?e.first().velocity({opacity:0},{duration:this.options.duration,complete:function(){e.remove()}}):e.first().animate({opacity:0},{duration:this.options.duration,complete:function(){e.remove()}}):e.remove()),i?this.$blurredImage=this.createIMG(t,this.$width,this.$height):this.$blurredImage=this.createSVG(t,this.$width,this.$height)},r.prototype.createOverlay=function(){return this.options.overlayClass&&""!==this.options.overlayClass?t("").prependTo(this.$element).addClass(this.options.overlayClass):!1},r.prototype.createSVG=function(e,i,n){var r=this,s=o.createElement("svg",{xmlns:o.svgns,version:"1.1",width:i,height:n,id:"blurred"+this.internalID,"class":this.options.imageClass,viewBox:"0 0 "+i+" "+n,preserveAspectRatio:"none"}),a="blur"+this.internalID,u=o.createElement("filter",{id:a}),l=o.createElement("feGaussianBlur",{"in":"SourceGraphic",stdDeviation:this.options.blurAmount}),h=o.createElement("image",{x:0,y:0,width:i,height:n,externalResourcesRequired:"true",href:e,style:"filter:url(#"+a+")",preserveAspectRatio:"none"});h.addEventListener("load",function(){r.$element.trigger("ui.blur.loaded")},!0),h.addEventListener("SVGLoad",function(){r.$element.trigger("ui.blur.loaded")},!0),u.appendChild(l),s.appendChild(u),s.appendChild(h);var d=t(s);return r.options.duration&&r.options.duration>0&&(d.css({opacity:0}),window.setTimeout(function(){"0"===d.css("opacity")&&d.css({opacity:1})},this.options.duration+100)),this.element.insertBefore(s,this.element.firstChild),d},r.prototype.createIMG=function(t,e,i){var n=this,o=this.prependImage(t),r=2*this.options.blurAmount>100?100:2*this.options.blurAmount;return o.css({filter:"progid:DXImageTransform.Microsoft.Blur(pixelradius="+r+") ",top:2.5*-this.options.blurAmount,left:2.5*-this.options.blurAmount,width:e+2.5*this.options.blurAmount,height:i+2.5*this.options.blurAmount}).attr("id","blurred"+this.internalID),o.load(function(){n.$element.trigger("ui.blur.loaded")}),this.options.duration&&this.options.duration>0&&window.setTimeout(function(){"0"===o.css("opacity")&&o.css({opacity:1})},this.options.duration+100),o},r.prototype.prependImage=function(e){var i,n=t('
');return i=this.$overlayEl?n.insertBefore(this.$overlayEl).attr("id",this.internalID).addClass(this.options.imageClass):n.prependTo(this.$element).attr("id",this.internalID).addClass(this.options.imageClass)};var s=t.fn.backgroundBlur;t.fn.backgroundBlur=e,t.fn.backgroundBlur.Constructor=r,t.fn.backgroundBlur.noConflict=function(){return t.fn.backgroundBlur=s,this}}(jQuery);
--------------------------------------------------------------------------------
/screen.nw/js/exif.js:
--------------------------------------------------------------------------------
1 | (function() {
2 |
3 | var debug = false;
4 |
5 | var root = this;
6 |
7 | var EXIF = function(obj) {
8 | if (obj instanceof EXIF) return obj;
9 | if (!(this instanceof EXIF)) return new EXIF(obj);
10 | this.EXIFwrapped = obj;
11 | };
12 |
13 | if (typeof exports !== 'undefined') {
14 | if (typeof module !== 'undefined' && module.exports) {
15 | exports = module.exports = EXIF;
16 | }
17 | exports.EXIF = EXIF;
18 | } else {
19 | root.EXIF = EXIF;
20 | }
21 |
22 | var ExifTags = EXIF.Tags = {
23 |
24 | // version tags
25 | 0x9000 : "ExifVersion", // EXIF version
26 | 0xA000 : "FlashpixVersion", // Flashpix format version
27 |
28 | // colorspace tags
29 | 0xA001 : "ColorSpace", // Color space information tag
30 |
31 | // image configuration
32 | 0xA002 : "PixelXDimension", // Valid width of meaningful image
33 | 0xA003 : "PixelYDimension", // Valid height of meaningful image
34 | 0x9101 : "ComponentsConfiguration", // Information about channels
35 | 0x9102 : "CompressedBitsPerPixel", // Compressed bits per pixel
36 |
37 | // user information
38 | 0x927C : "MakerNote", // Any desired information written by the manufacturer
39 | 0x9286 : "UserComment", // Comments by user
40 |
41 | // related file
42 | 0xA004 : "RelatedSoundFile", // Name of related sound file
43 |
44 | // date and time
45 | 0x9003 : "DateTimeOriginal", // Date and time when the original image was generated
46 | 0x9004 : "DateTimeDigitized", // Date and time when the image was stored digitally
47 | 0x9290 : "SubsecTime", // Fractions of seconds for DateTime
48 | 0x9291 : "SubsecTimeOriginal", // Fractions of seconds for DateTimeOriginal
49 | 0x9292 : "SubsecTimeDigitized", // Fractions of seconds for DateTimeDigitized
50 |
51 | // picture-taking conditions
52 | 0x829A : "ExposureTime", // Exposure time (in seconds)
53 | 0x829D : "FNumber", // F number
54 | 0x8822 : "ExposureProgram", // Exposure program
55 | 0x8824 : "SpectralSensitivity", // Spectral sensitivity
56 | 0x8827 : "ISOSpeedRatings", // ISO speed rating
57 | 0x8828 : "OECF", // Optoelectric conversion factor
58 | 0x9201 : "ShutterSpeedValue", // Shutter speed
59 | 0x9202 : "ApertureValue", // Lens aperture
60 | 0x9203 : "BrightnessValue", // Value of brightness
61 | 0x9204 : "ExposureBias", // Exposure bias
62 | 0x9205 : "MaxApertureValue", // Smallest F number of lens
63 | 0x9206 : "SubjectDistance", // Distance to subject in meters
64 | 0x9207 : "MeteringMode", // Metering mode
65 | 0x9208 : "LightSource", // Kind of light source
66 | 0x9209 : "Flash", // Flash status
67 | 0x9214 : "SubjectArea", // Location and area of main subject
68 | 0x920A : "FocalLength", // Focal length of the lens in mm
69 | 0xA20B : "FlashEnergy", // Strobe energy in BCPS
70 | 0xA20C : "SpatialFrequencyResponse", //
71 | 0xA20E : "FocalPlaneXResolution", // Number of pixels in width direction per FocalPlaneResolutionUnit
72 | 0xA20F : "FocalPlaneYResolution", // Number of pixels in height direction per FocalPlaneResolutionUnit
73 | 0xA210 : "FocalPlaneResolutionUnit", // Unit for measuring FocalPlaneXResolution and FocalPlaneYResolution
74 | 0xA214 : "SubjectLocation", // Location of subject in image
75 | 0xA215 : "ExposureIndex", // Exposure index selected on camera
76 | 0xA217 : "SensingMethod", // Image sensor type
77 | 0xA300 : "FileSource", // Image source (3 == DSC)
78 | 0xA301 : "SceneType", // Scene type (1 == directly photographed)
79 | 0xA302 : "CFAPattern", // Color filter array geometric pattern
80 | 0xA401 : "CustomRendered", // Special processing
81 | 0xA402 : "ExposureMode", // Exposure mode
82 | 0xA403 : "WhiteBalance", // 1 = auto white balance, 2 = manual
83 | 0xA404 : "DigitalZoomRation", // Digital zoom ratio
84 | 0xA405 : "FocalLengthIn35mmFilm", // Equivalent foacl length assuming 35mm film camera (in mm)
85 | 0xA406 : "SceneCaptureType", // Type of scene
86 | 0xA407 : "GainControl", // Degree of overall image gain adjustment
87 | 0xA408 : "Contrast", // Direction of contrast processing applied by camera
88 | 0xA409 : "Saturation", // Direction of saturation processing applied by camera
89 | 0xA40A : "Sharpness", // Direction of sharpness processing applied by camera
90 | 0xA40B : "DeviceSettingDescription", //
91 | 0xA40C : "SubjectDistanceRange", // Distance to subject
92 |
93 | // other tags
94 | 0xA005 : "InteroperabilityIFDPointer",
95 | 0xA420 : "ImageUniqueID" // Identifier assigned uniquely to each image
96 | };
97 |
98 | var TiffTags = EXIF.TiffTags = {
99 | 0x0100 : "ImageWidth",
100 | 0x0101 : "ImageHeight",
101 | 0x8769 : "ExifIFDPointer",
102 | 0x8825 : "GPSInfoIFDPointer",
103 | 0xA005 : "InteroperabilityIFDPointer",
104 | 0x0102 : "BitsPerSample",
105 | 0x0103 : "Compression",
106 | 0x0106 : "PhotometricInterpretation",
107 | 0x0112 : "Orientation",
108 | 0x0115 : "SamplesPerPixel",
109 | 0x011C : "PlanarConfiguration",
110 | 0x0212 : "YCbCrSubSampling",
111 | 0x0213 : "YCbCrPositioning",
112 | 0x011A : "XResolution",
113 | 0x011B : "YResolution",
114 | 0x0128 : "ResolutionUnit",
115 | 0x0111 : "StripOffsets",
116 | 0x0116 : "RowsPerStrip",
117 | 0x0117 : "StripByteCounts",
118 | 0x0201 : "JPEGInterchangeFormat",
119 | 0x0202 : "JPEGInterchangeFormatLength",
120 | 0x012D : "TransferFunction",
121 | 0x013E : "WhitePoint",
122 | 0x013F : "PrimaryChromaticities",
123 | 0x0211 : "YCbCrCoefficients",
124 | 0x0214 : "ReferenceBlackWhite",
125 | 0x0132 : "DateTime",
126 | 0x010E : "ImageDescription",
127 | 0x010F : "Make",
128 | 0x0110 : "Model",
129 | 0x0131 : "Software",
130 | 0x013B : "Artist",
131 | 0x8298 : "Copyright"
132 | };
133 |
134 | var GPSTags = EXIF.GPSTags = {
135 | 0x0000 : "GPSVersionID",
136 | 0x0001 : "GPSLatitudeRef",
137 | 0x0002 : "GPSLatitude",
138 | 0x0003 : "GPSLongitudeRef",
139 | 0x0004 : "GPSLongitude",
140 | 0x0005 : "GPSAltitudeRef",
141 | 0x0006 : "GPSAltitude",
142 | 0x0007 : "GPSTimeStamp",
143 | 0x0008 : "GPSSatellites",
144 | 0x0009 : "GPSStatus",
145 | 0x000A : "GPSMeasureMode",
146 | 0x000B : "GPSDOP",
147 | 0x000C : "GPSSpeedRef",
148 | 0x000D : "GPSSpeed",
149 | 0x000E : "GPSTrackRef",
150 | 0x000F : "GPSTrack",
151 | 0x0010 : "GPSImgDirectionRef",
152 | 0x0011 : "GPSImgDirection",
153 | 0x0012 : "GPSMapDatum",
154 | 0x0013 : "GPSDestLatitudeRef",
155 | 0x0014 : "GPSDestLatitude",
156 | 0x0015 : "GPSDestLongitudeRef",
157 | 0x0016 : "GPSDestLongitude",
158 | 0x0017 : "GPSDestBearingRef",
159 | 0x0018 : "GPSDestBearing",
160 | 0x0019 : "GPSDestDistanceRef",
161 | 0x001A : "GPSDestDistance",
162 | 0x001B : "GPSProcessingMethod",
163 | 0x001C : "GPSAreaInformation",
164 | 0x001D : "GPSDateStamp",
165 | 0x001E : "GPSDifferential"
166 | };
167 |
168 | var StringValues = EXIF.StringValues = {
169 | ExposureProgram : {
170 | 0 : "Not defined",
171 | 1 : "Manual",
172 | 2 : "Normal program",
173 | 3 : "Aperture priority",
174 | 4 : "Shutter priority",
175 | 5 : "Creative program",
176 | 6 : "Action program",
177 | 7 : "Portrait mode",
178 | 8 : "Landscape mode"
179 | },
180 | MeteringMode : {
181 | 0 : "Unknown",
182 | 1 : "Average",
183 | 2 : "CenterWeightedAverage",
184 | 3 : "Spot",
185 | 4 : "MultiSpot",
186 | 5 : "Pattern",
187 | 6 : "Partial",
188 | 255 : "Other"
189 | },
190 | LightSource : {
191 | 0 : "Unknown",
192 | 1 : "Daylight",
193 | 2 : "Fluorescent",
194 | 3 : "Tungsten (incandescent light)",
195 | 4 : "Flash",
196 | 9 : "Fine weather",
197 | 10 : "Cloudy weather",
198 | 11 : "Shade",
199 | 12 : "Daylight fluorescent (D 5700 - 7100K)",
200 | 13 : "Day white fluorescent (N 4600 - 5400K)",
201 | 14 : "Cool white fluorescent (W 3900 - 4500K)",
202 | 15 : "White fluorescent (WW 3200 - 3700K)",
203 | 17 : "Standard light A",
204 | 18 : "Standard light B",
205 | 19 : "Standard light C",
206 | 20 : "D55",
207 | 21 : "D65",
208 | 22 : "D75",
209 | 23 : "D50",
210 | 24 : "ISO studio tungsten",
211 | 255 : "Other"
212 | },
213 | Flash : {
214 | 0x0000 : "Flash did not fire",
215 | 0x0001 : "Flash fired",
216 | 0x0005 : "Strobe return light not detected",
217 | 0x0007 : "Strobe return light detected",
218 | 0x0009 : "Flash fired, compulsory flash mode",
219 | 0x000D : "Flash fired, compulsory flash mode, return light not detected",
220 | 0x000F : "Flash fired, compulsory flash mode, return light detected",
221 | 0x0010 : "Flash did not fire, compulsory flash mode",
222 | 0x0018 : "Flash did not fire, auto mode",
223 | 0x0019 : "Flash fired, auto mode",
224 | 0x001D : "Flash fired, auto mode, return light not detected",
225 | 0x001F : "Flash fired, auto mode, return light detected",
226 | 0x0020 : "No flash function",
227 | 0x0041 : "Flash fired, red-eye reduction mode",
228 | 0x0045 : "Flash fired, red-eye reduction mode, return light not detected",
229 | 0x0047 : "Flash fired, red-eye reduction mode, return light detected",
230 | 0x0049 : "Flash fired, compulsory flash mode, red-eye reduction mode",
231 | 0x004D : "Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected",
232 | 0x004F : "Flash fired, compulsory flash mode, red-eye reduction mode, return light detected",
233 | 0x0059 : "Flash fired, auto mode, red-eye reduction mode",
234 | 0x005D : "Flash fired, auto mode, return light not detected, red-eye reduction mode",
235 | 0x005F : "Flash fired, auto mode, return light detected, red-eye reduction mode"
236 | },
237 | SensingMethod : {
238 | 1 : "Not defined",
239 | 2 : "One-chip color area sensor",
240 | 3 : "Two-chip color area sensor",
241 | 4 : "Three-chip color area sensor",
242 | 5 : "Color sequential area sensor",
243 | 7 : "Trilinear sensor",
244 | 8 : "Color sequential linear sensor"
245 | },
246 | SceneCaptureType : {
247 | 0 : "Standard",
248 | 1 : "Landscape",
249 | 2 : "Portrait",
250 | 3 : "Night scene"
251 | },
252 | SceneType : {
253 | 1 : "Directly photographed"
254 | },
255 | CustomRendered : {
256 | 0 : "Normal process",
257 | 1 : "Custom process"
258 | },
259 | WhiteBalance : {
260 | 0 : "Auto white balance",
261 | 1 : "Manual white balance"
262 | },
263 | GainControl : {
264 | 0 : "None",
265 | 1 : "Low gain up",
266 | 2 : "High gain up",
267 | 3 : "Low gain down",
268 | 4 : "High gain down"
269 | },
270 | Contrast : {
271 | 0 : "Normal",
272 | 1 : "Soft",
273 | 2 : "Hard"
274 | },
275 | Saturation : {
276 | 0 : "Normal",
277 | 1 : "Low saturation",
278 | 2 : "High saturation"
279 | },
280 | Sharpness : {
281 | 0 : "Normal",
282 | 1 : "Soft",
283 | 2 : "Hard"
284 | },
285 | SubjectDistanceRange : {
286 | 0 : "Unknown",
287 | 1 : "Macro",
288 | 2 : "Close view",
289 | 3 : "Distant view"
290 | },
291 | FileSource : {
292 | 3 : "DSC"
293 | },
294 |
295 | Components : {
296 | 0 : "",
297 | 1 : "Y",
298 | 2 : "Cb",
299 | 3 : "Cr",
300 | 4 : "R",
301 | 5 : "G",
302 | 6 : "B"
303 | }
304 | };
305 |
306 | function addEvent(element, event, handler) {
307 | if (element.addEventListener) {
308 | element.addEventListener(event, handler, false);
309 | } else if (element.attachEvent) {
310 | element.attachEvent("on" + event, handler);
311 | }
312 | }
313 |
314 | function imageHasData(img) {
315 | return !!(img.exifdata);
316 | }
317 |
318 |
319 | function base64ToArrayBuffer(base64, contentType) {
320 | contentType = contentType || base64.match(/^data\:([^\;]+)\;base64,/mi)[1] || ''; // e.g. 'data:image/jpeg;base64,...' => 'image/jpeg'
321 | base64 = base64.replace(/^data\:([^\;]+)\;base64,/gmi, '');
322 | var binary = atob(base64);
323 | var len = binary.length;
324 | var buffer = new ArrayBuffer(len);
325 | var view = new Uint8Array(buffer);
326 | for (var i = 0; i < len; i++) {
327 | view[i] = binary.charCodeAt(i);
328 | }
329 | return buffer;
330 | }
331 |
332 | function objectURLToBlob(url, callback) {
333 | var http = new XMLHttpRequest();
334 | http.open("GET", url, true);
335 | http.responseType = "blob";
336 | http.onload = function(e) {
337 | if (this.status == 200 || this.status === 0) {
338 | callback(this.response);
339 | }
340 | };
341 | http.send();
342 | }
343 |
344 | function getImageData(img, callback) {
345 | function handleBinaryFile(binFile) {
346 | var data = findEXIFinJPEG(binFile);
347 | var iptcdata = findIPTCinJPEG(binFile);
348 | img.exifdata = data || {};
349 | img.iptcdata = iptcdata || {};
350 | if (callback) {
351 | callback.call(img);
352 | }
353 | }
354 |
355 | if (img.src) {
356 | if (/^data\:/i.test(img.src)) { // Data URI
357 | var arrayBuffer = base64ToArrayBuffer(img.src);
358 | handleBinaryFile(arrayBuffer);
359 |
360 | } else if (/^blob\:/i.test(img.src)) { // Object URL
361 | var fileReader = new FileReader();
362 | fileReader.onload = function(e) {
363 | handleBinaryFile(e.target.result);
364 | };
365 | objectURLToBlob(img.src, function (blob) {
366 | fileReader.readAsArrayBuffer(blob);
367 | });
368 | } else {
369 | var http = new XMLHttpRequest();
370 | http.onload = function() {
371 | if (this.status == 200 || this.status === 0) {
372 | handleBinaryFile(http.response);
373 | } else {
374 | throw "Could not load image";
375 | }
376 | http = null;
377 | };
378 | http.open("GET", img.src, true);
379 | http.responseType = "arraybuffer";
380 | http.send(null);
381 | }
382 | } else if (window.FileReader && (img instanceof window.Blob || img instanceof window.File)) {
383 | var fileReader = new FileReader();
384 | fileReader.onload = function(e) {
385 | if (debug) console.log("Got file of length " + e.target.result.byteLength);
386 | handleBinaryFile(e.target.result);
387 | };
388 |
389 | fileReader.readAsArrayBuffer(img);
390 | }
391 | }
392 |
393 | function findEXIFinJPEG(file) {
394 | var dataView = new DataView(file);
395 |
396 | if (debug) console.log("Got file of length " + file.byteLength);
397 | if ((dataView.getUint8(0) != 0xFF) || (dataView.getUint8(1) != 0xD8)) {
398 | if (debug) console.log("Not a valid JPEG");
399 | return false; // not a valid jpeg
400 | }
401 |
402 | var offset = 2,
403 | length = file.byteLength,
404 | marker;
405 |
406 | while (offset < length) {
407 | if (dataView.getUint8(offset) != 0xFF) {
408 | if (debug) console.log("Not a valid marker at offset " + offset + ", found: " + dataView.getUint8(offset));
409 | return false; // not a valid marker, something is wrong
410 | }
411 |
412 | marker = dataView.getUint8(offset + 1);
413 | if (debug) console.log(marker);
414 |
415 | // we could implement handling for other markers here,
416 | // but we're only looking for 0xFFE1 for EXIF data
417 |
418 | if (marker == 225) {
419 | if (debug) console.log("Found 0xFFE1 marker");
420 |
421 | return readEXIFData(dataView, offset + 4, dataView.getUint16(offset + 2) - 2);
422 |
423 | // offset += 2 + file.getShortAt(offset+2, true);
424 |
425 | } else {
426 | offset += 2 + dataView.getUint16(offset+2);
427 | }
428 |
429 | }
430 |
431 | }
432 |
433 | function findIPTCinJPEG(file) {
434 | var dataView = new DataView(file);
435 |
436 | if (debug) console.log("Got file of length " + file.byteLength);
437 | if ((dataView.getUint8(0) != 0xFF) || (dataView.getUint8(1) != 0xD8)) {
438 | if (debug) console.log("Not a valid JPEG");
439 | return false; // not a valid jpeg
440 | }
441 |
442 | var offset = 2,
443 | length = file.byteLength;
444 |
445 |
446 | var isFieldSegmentStart = function(dataView, offset){
447 | return (
448 | dataView.getUint8(offset) === 0x38 &&
449 | dataView.getUint8(offset+1) === 0x42 &&
450 | dataView.getUint8(offset+2) === 0x49 &&
451 | dataView.getUint8(offset+3) === 0x4D &&
452 | dataView.getUint8(offset+4) === 0x04 &&
453 | dataView.getUint8(offset+5) === 0x04
454 | );
455 | };
456 |
457 | while (offset < length) {
458 |
459 | if ( isFieldSegmentStart(dataView, offset )){
460 |
461 | // Get the length of the name header (which is padded to an even number of bytes)
462 | var nameHeaderLength = dataView.getUint8(offset+7);
463 | if(nameHeaderLength % 2 !== 0) nameHeaderLength += 1;
464 | // Check for pre photoshop 6 format
465 | if(nameHeaderLength === 0) {
466 | // Always 4
467 | nameHeaderLength = 4;
468 | }
469 |
470 | var startOffset = offset + 8 + nameHeaderLength;
471 | var sectionLength = dataView.getUint16(offset + 6 + nameHeaderLength);
472 |
473 | return readIPTCData(file, startOffset, sectionLength);
474 |
475 | break;
476 |
477 | }
478 |
479 |
480 | // Not the marker, continue searching
481 | offset++;
482 |
483 | }
484 |
485 | }
486 | var IptcFieldMap = {
487 | 0x78 : 'caption',
488 | 0x6E : 'credit',
489 | 0x19 : 'keywords',
490 | 0x37 : 'dateCreated',
491 | 0x50 : 'byline',
492 | 0x55 : 'bylineTitle',
493 | 0x7A : 'captionWriter',
494 | 0x69 : 'headline',
495 | 0x74 : 'copyright',
496 | 0x0F : 'category'
497 | };
498 | function readIPTCData(file, startOffset, sectionLength){
499 | var dataView = new DataView(file);
500 | var data = {};
501 | var fieldValue, fieldName, dataSize, segmentType, segmentSize;
502 | var segmentStartPos = startOffset;
503 | while(segmentStartPos < startOffset+sectionLength) {
504 | if(dataView.getUint8(segmentStartPos) === 0x1C && dataView.getUint8(segmentStartPos+1) === 0x02){
505 | segmentType = dataView.getUint8(segmentStartPos+2);
506 | if(segmentType in IptcFieldMap) {
507 | dataSize = dataView.getInt16(segmentStartPos+3);
508 | segmentSize = dataSize + 5;
509 | fieldName = IptcFieldMap[segmentType];
510 | fieldValue = getStringFromDB(dataView, segmentStartPos+5, dataSize);
511 | // Check if we already stored a value with this name
512 | if(data.hasOwnProperty(fieldName)) {
513 | // Value already stored with this name, create multivalue field
514 | if(data[fieldName] instanceof Array) {
515 | data[fieldName].push(fieldValue);
516 | }
517 | else {
518 | data[fieldName] = [data[fieldName], fieldValue];
519 | }
520 | }
521 | else {
522 | data[fieldName] = fieldValue;
523 | }
524 | }
525 |
526 | }
527 | segmentStartPos++;
528 | }
529 | return data;
530 | }
531 |
532 |
533 |
534 | function readTags(file, tiffStart, dirStart, strings, bigEnd) {
535 | var entries = file.getUint16(dirStart, !bigEnd),
536 | tags = {},
537 | entryOffset, tag,
538 | i;
539 |
540 | for (i=0;i 4 ? valueOffset : (entryOffset + 8);
565 | vals = [];
566 | for (n=0;n 4 ? valueOffset : (entryOffset + 8);
574 | return getStringFromDB(file, offset, numValues-1);
575 |
576 | case 3: // short, 16 bit int
577 | if (numValues == 1) {
578 | return file.getUint16(entryOffset + 8, !bigEnd);
579 | } else {
580 | offset = numValues > 2 ? valueOffset : (entryOffset + 8);
581 | vals = [];
582 | for (n=0;n0})});return n}},{key:"getRGBAGradientValues",value:function(e){return e.map(function(e,t){return"rgb("+e.rgba.slice(0,3).join(",")+") "+(0==t?"0%":"75%")}).join(",")}},{key:"getCSSGradientProperty",value:function(e){var t=this.getRGBAGradientValues(e);return a.map(function(e){return"background-image: -"+e+"-linear-gradient(\n 135deg,\n "+t+"\n )"}).concat(["background-image: linear-gradient(\n 135deg,\n "+t+"\n )"]).join(";")}},{key:"getMiddleRGB",value:function(e,t){var n=0,i=(n+1)/2,r=1-i,a=[parseInt(e[0]*i+t[0]*r),parseInt(e[1]*i+t[1]*r),parseInt(e[2]*i+t[2]*r)];return a}},{key:"getSortedValues",value:function(e){var t=Object.keys(e).map(function(t){var n=t,i=t.split("|"),r=(299*i[0]+587*i[1]+114*i[2])/1e3;return{rgba:n.split("|"),occurs:e[t],brightness:r}}).sort(function(e,t){return e.occurs-t.occurs}).reverse().slice(0,10);return t.sort(function(e,t){return e.brightness-t.brightness}).reverse()}},{key:"getTextProperty",value:function(e){var t=this.getMiddleRGB(e[0].rgba.slice(0,3),e[1].rgba.slice(0,3)),n=Math.round((299*parseInt(t[0])+587*parseInt(t[1])+114*parseInt(t[2]))/1e3);return n>125?"color: #000":"color: #fff"}},{key:"getTopValues",value:function(e){var t=this.getSortedValues(e);return[t[0],t[t.length-1]]}},{key:"getUniqValues",value:function(e){return e.reduce(function(e,t){var n=t.join("|");return e[n]?(e[n]=++e[n],e):(e[n]=1,e)},{})}},{key:"renderGradient",value:function(){var e=window.localStorage,t="grade-"+this.image.getAttribute("src"),n=null;if(e&&e.getItem(t))n=JSON.parse(e.getItem(t));else{var i=this.getChunkedImageData();n=this.getTopValues(this.getUniqValues(i)),e&&e.setItem(t,JSON.stringify(n))}if(this.callback)return void(this.gradientData=n);var r=this.getCSSGradientProperty(n),a=this.getTextProperty(n),o=(this.container.getAttribute("style")||"")+"; "+r+"; "+a;this.container.setAttribute("style",o)}},{key:"render",value:function(){this.canvas.width=this.imageDimensions.width,this.canvas.height=this.imageDimensions.height,this.ctx.drawImage(this.image,0,0,this.imageDimensions.width,this.imageDimensions.height),this.getImageData(),this.renderGradient()}}]),e}();t.exports=function(e,t,n){var i=function(e,t,n){var i=new o(e,t,n),r=i.gradientData;return r.length?{element:e,gradientData:r}:null},r=(NodeList.prototype.isPrototypeOf(e)?Array.from(e).map(function(e){return i(e,t,n)}):[i(e,t,n)]).filter(Boolean);if(r.length)return n(r)}},{}]},{},[1])(1)});
2 | //# sourceMappingURL=grade.min.js.map
--------------------------------------------------------------------------------
/screen.nw/js/imagesloaded.pkgd.min.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * imagesLoaded PACKAGED v3.1.8
3 | * JavaScript is all like "You images are done yet or what?"
4 | * MIT License
5 | */
6 |
7 | (function(){function e(){}function t(e,t){for(var n=e.length;n--;)if(e[n].listener===t)return n;return-1}function n(e){return function(){return this[e].apply(this,arguments)}}var i=e.prototype,r=this,o=r.EventEmitter;i.getListeners=function(e){var t,n,i=this._getEvents();if("object"==typeof e){t={};for(n in i)i.hasOwnProperty(n)&&e.test(n)&&(t[n]=i[n])}else t=i[e]||(i[e]=[]);return t},i.flattenListeners=function(e){var t,n=[];for(t=0;e.length>t;t+=1)n.push(e[t].listener);return n},i.getListenersAsObject=function(e){var t,n=this.getListeners(e);return n instanceof Array&&(t={},t[e]=n),t||n},i.addListener=function(e,n){var i,r=this.getListenersAsObject(e),o="object"==typeof n;for(i in r)r.hasOwnProperty(i)&&-1===t(r[i],n)&&r[i].push(o?n:{listener:n,once:!1});return this},i.on=n("addListener"),i.addOnceListener=function(e,t){return this.addListener(e,{listener:t,once:!0})},i.once=n("addOnceListener"),i.defineEvent=function(e){return this.getListeners(e),this},i.defineEvents=function(e){for(var t=0;e.length>t;t+=1)this.defineEvent(e[t]);return this},i.removeListener=function(e,n){var i,r,o=this.getListenersAsObject(e);for(r in o)o.hasOwnProperty(r)&&(i=t(o[r],n),-1!==i&&o[r].splice(i,1));return this},i.off=n("removeListener"),i.addListeners=function(e,t){return this.manipulateListeners(!1,e,t)},i.removeListeners=function(e,t){return this.manipulateListeners(!0,e,t)},i.manipulateListeners=function(e,t,n){var i,r,o=e?this.removeListener:this.addListener,s=e?this.removeListeners:this.addListeners;if("object"!=typeof t||t instanceof RegExp)for(i=n.length;i--;)o.call(this,t,n[i]);else for(i in t)t.hasOwnProperty(i)&&(r=t[i])&&("function"==typeof r?o.call(this,i,r):s.call(this,i,r));return this},i.removeEvent=function(e){var t,n=typeof e,i=this._getEvents();if("string"===n)delete i[e];else if("object"===n)for(t in i)i.hasOwnProperty(t)&&e.test(t)&&delete i[t];else delete this._events;return this},i.removeAllListeners=n("removeEvent"),i.emitEvent=function(e,t){var n,i,r,o,s=this.getListenersAsObject(e);for(r in s)if(s.hasOwnProperty(r))for(i=s[r].length;i--;)n=s[r][i],n.once===!0&&this.removeListener(e,n.listener),o=n.listener.apply(this,t||[]),o===this._getOnceReturnValue()&&this.removeListener(e,n.listener);return this},i.trigger=n("emitEvent"),i.emit=function(e){var t=Array.prototype.slice.call(arguments,1);return this.emitEvent(e,t)},i.setOnceReturnValue=function(e){return this._onceReturnValue=e,this},i._getOnceReturnValue=function(){return this.hasOwnProperty("_onceReturnValue")?this._onceReturnValue:!0},i._getEvents=function(){return this._events||(this._events={})},e.noConflict=function(){return r.EventEmitter=o,e},"function"==typeof define&&define.amd?define("eventEmitter/EventEmitter",[],function(){return e}):"object"==typeof module&&module.exports?module.exports=e:this.EventEmitter=e}).call(this),function(e){function t(t){var n=e.event;return n.target=n.target||n.srcElement||t,n}var n=document.documentElement,i=function(){};n.addEventListener?i=function(e,t,n){e.addEventListener(t,n,!1)}:n.attachEvent&&(i=function(e,n,i){e[n+i]=i.handleEvent?function(){var n=t(e);i.handleEvent.call(i,n)}:function(){var n=t(e);i.call(e,n)},e.attachEvent("on"+n,e[n+i])});var r=function(){};n.removeEventListener?r=function(e,t,n){e.removeEventListener(t,n,!1)}:n.detachEvent&&(r=function(e,t,n){e.detachEvent("on"+t,e[t+n]);try{delete e[t+n]}catch(i){e[t+n]=void 0}});var o={bind:i,unbind:r};"function"==typeof define&&define.amd?define("eventie/eventie",o):e.eventie=o}(this),function(e,t){"function"==typeof define&&define.amd?define(["eventEmitter/EventEmitter","eventie/eventie"],function(n,i){return t(e,n,i)}):"object"==typeof exports?module.exports=t(e,require("wolfy87-eventemitter"),require("eventie")):e.imagesLoaded=t(e,e.EventEmitter,e.eventie)}(window,function(e,t,n){function i(e,t){for(var n in t)e[n]=t[n];return e}function r(e){return"[object Array]"===d.call(e)}function o(e){var t=[];if(r(e))t=e;else if("number"==typeof e.length)for(var n=0,i=e.length;i>n;n++)t.push(e[n]);else t.push(e);return t}function s(e,t,n){if(!(this instanceof s))return new s(e,t);"string"==typeof e&&(e=document.querySelectorAll(e)),this.elements=o(e),this.options=i({},this.options),"function"==typeof t?n=t:i(this.options,t),n&&this.on("always",n),this.getImages(),a&&(this.jqDeferred=new a.Deferred);var r=this;setTimeout(function(){r.check()})}function f(e){this.img=e}function c(e){this.src=e,v[e]=this}var a=e.jQuery,u=e.console,h=u!==void 0,d=Object.prototype.toString;s.prototype=new t,s.prototype.options={},s.prototype.getImages=function(){this.images=[];for(var e=0,t=this.elements.length;t>e;e++){var n=this.elements[e];"IMG"===n.nodeName&&this.addImage(n);var i=n.nodeType;if(i&&(1===i||9===i||11===i))for(var r=n.querySelectorAll("img"),o=0,s=r.length;s>o;o++){var f=r[o];this.addImage(f)}}},s.prototype.addImage=function(e){var t=new f(e);this.images.push(t)},s.prototype.check=function(){function e(e,r){return t.options.debug&&h&&u.log("confirm",e,r),t.progress(e),n++,n===i&&t.complete(),!0}var t=this,n=0,i=this.images.length;if(this.hasAnyBroken=!1,!i)return this.complete(),void 0;for(var r=0;i>r;r++){var o=this.images[r];o.on("confirm",e),o.check()}},s.prototype.progress=function(e){this.hasAnyBroken=this.hasAnyBroken||!e.isLoaded;var t=this;setTimeout(function(){t.emit("progress",t,e),t.jqDeferred&&t.jqDeferred.notify&&t.jqDeferred.notify(t,e)})},s.prototype.complete=function(){var e=this.hasAnyBroken?"fail":"done";this.isComplete=!0;var t=this;setTimeout(function(){if(t.emit(e,t),t.emit("always",t),t.jqDeferred){var n=t.hasAnyBroken?"reject":"resolve";t.jqDeferred[n](t)}})},a&&(a.fn.imagesLoaded=function(e,t){var n=new s(this,e,t);return n.jqDeferred.promise(a(this))}),f.prototype=new t,f.prototype.check=function(){var e=v[this.img.src]||new c(this.img.src);if(e.isConfirmed)return this.confirm(e.isLoaded,"cached was confirmed"),void 0;if(this.img.complete&&void 0!==this.img.naturalWidth)return this.confirm(0!==this.img.naturalWidth,"naturalWidth"),void 0;var t=this;e.on("confirm",function(e,n){return t.confirm(e.isLoaded,n),!0}),e.check()},f.prototype.confirm=function(e,t){this.isLoaded=e,this.emit("confirm",this,t)};var v={};return c.prototype=new t,c.prototype.check=function(){if(!this.isChecked){var e=new Image;n.bind(e,"load",this),n.bind(e,"error",this),e.src=this.src,this.isChecked=!0}},c.prototype.handleEvent=function(e){var t="on"+e.type;this[t]&&this[t](e)},c.prototype.onload=function(e){this.confirm(!0,"onload"),this.unbindProxyEvents(e)},c.prototype.onerror=function(e){this.confirm(!1,"onerror"),this.unbindProxyEvents(e)},c.prototype.confirm=function(e,t){this.isConfirmed=!0,this.isLoaded=e,this.emit("confirm",this,t)},c.prototype.unbindProxyEvents=function(e){n.unbind(e.target,"load",this),n.unbind(e.target,"error",this)},s});
--------------------------------------------------------------------------------
/screen.nw/js/jquery-imagefill.js:
--------------------------------------------------------------------------------
1 | /**
2 | * imagefill.js
3 | * Author & copyright (c) 2013: John Polacek
4 | * johnpolacek.com
5 | * https://twitter.com/johnpolacek
6 | *
7 | * Dual MIT & GPL license
8 | *
9 | * Project Page: http://johnpolacek.github.io/imagefill.js
10 | *
11 | * The jQuery plugin for making images fill their containers (and be centered)
12 | *
13 | * EXAMPLE
14 | * Given this html:
15 | * 
16 | * $('.container').imagefill(); // image stretches to fill container
17 | *
18 | * REQUIRES:
19 | * imagesLoaded - https://github.com/desandro/imagesloaded
20 | *
21 | */
22 | ;(function($) {
23 |
24 | $.fn.imagefill = function(options) {
25 |
26 | var $container = this,
27 | imageAspect = 1/1,
28 | containersH = 0,
29 | containersW = 0,
30 | defaults = {
31 | runOnce: false,
32 | target: 'img',
33 | throttle : 200 // 5fps
34 | },
35 | settings = $.extend({}, defaults, options);
36 |
37 | var $img = $container.find(settings.target).addClass('loading').css({'position':'absolute'});
38 |
39 | // make sure container isn't position:static
40 | var containerPos = $container.css('position');
41 | $container.css({'overflow':'hidden','position':(containerPos === 'static') ? 'relative' : containerPos});
42 |
43 | // set containerH, containerW
44 | $container.each(function() {
45 | containersH += $(this).outerHeight();
46 | containersW += $(this).outerWidth();
47 | });
48 |
49 | // wait for image to load, then fit it inside the container
50 | $container.imagesLoaded().done(function(img) {
51 | imageAspect = $img.width() / $img.height();
52 | $img.removeClass('loading');
53 | fitImages();
54 | if (!settings.runOnce) {
55 | checkSizeChange();
56 | }
57 | });
58 |
59 | function fitImages() {
60 | containersH = 0;
61 | containersW = 0;
62 | $container.each(function() {
63 | imageAspect = $(this).find(settings.target).width() / $(this).find(settings.target).height();
64 | var containerW = $(this).outerWidth(),
65 | containerH = $(this).outerHeight();
66 | containersH += $(this).outerHeight();
67 | containersW += $(this).outerWidth();
68 |
69 | var containerAspect = containerW/containerH;
70 | if (containerAspect < imageAspect) {
71 | // taller
72 | $(this).find(settings.target).css({
73 | width: 'auto',
74 | height: containerH,
75 | top:0,
76 | left:-(containerH*imageAspect-containerW)/2
77 | });
78 | } else {
79 | // wider
80 | $(this).find(settings.target).css({
81 | width: containerW,
82 | height: 'auto',
83 | top:-(containerW/imageAspect-containerH)/2,
84 | left:0
85 | });
86 | }
87 | });
88 | }
89 |
90 | function checkSizeChange() {
91 | var checkW = 0,
92 | checkH = 0;
93 | $container.each(function() {
94 | checkH += $(this).outerHeight();
95 | checkW += $(this).outerWidth();
96 | });
97 | if (containersH !== checkH || containersW !== checkW) {
98 | fitImages();
99 | }
100 | requestAnimationFrame(checkSizeChange);
101 | }
102 |
103 | return this;
104 | };
105 |
106 | }(jQuery));
107 |
--------------------------------------------------------------------------------
/screen.nw/js/jquery.3.1.1.min.js:
--------------------------------------------------------------------------------
1 | /*! jQuery v3.1.1 | (c) jQuery Foundation | jquery.org/license */
2 | !function(a,b){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){"use strict";var c=[],d=a.document,e=Object.getPrototypeOf,f=c.slice,g=c.concat,h=c.push,i=c.indexOf,j={},k=j.toString,l=j.hasOwnProperty,m=l.toString,n=m.call(Object),o={};function p(a,b){b=b||d;var c=b.createElement("script");c.text=a,b.head.appendChild(c).parentNode.removeChild(c)}var q="3.1.1",r=function(a,b){return new r.fn.init(a,b)},s=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,t=/^-ms-/,u=/-([a-z])/g,v=function(a,b){return b.toUpperCase()};r.fn=r.prototype={jquery:q,constructor:r,length:0,toArray:function(){return f.call(this)},get:function(a){return null==a?f.call(this):a<0?this[a+this.length]:this[a]},pushStack:function(a){var b=r.merge(this.constructor(),a);return b.prevObject=this,b},each:function(a){return r.each(this,a)},map:function(a){return this.pushStack(r.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(f.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(a<0?b:0);return this.pushStack(c>=0&&c0&&b-1 in a)}var x=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C={}.hasOwnProperty,D=[],E=D.pop,F=D.push,G=D.push,H=D.slice,I=function(a,b){for(var c=0,d=a.length;c+~]|"+K+")"+K+"*"),S=new RegExp("="+K+"*([^\\]'\"]*?)"+K+"*\\]","g"),T=new RegExp(N),U=new RegExp("^"+L+"$"),V={ID:new RegExp("^#("+L+")"),CLASS:new RegExp("^\\.("+L+")"),TAG:new RegExp("^("+L+"|[*])"),ATTR:new RegExp("^"+M),PSEUDO:new RegExp("^"+N),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+K+"*(even|odd|(([+-]|)(\\d*)n|)"+K+"*(?:([+-]|)"+K+"*(\\d+)|))"+K+"*\\)|)","i"),bool:new RegExp("^(?:"+J+")$","i"),needsContext:new RegExp("^"+K+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+K+"*((?:-\\d)?\\d*)"+K+"*\\)|)(?=[^-]|$)","i")},W=/^(?:input|select|textarea|button)$/i,X=/^h\d$/i,Y=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,$=/[+~]/,_=new RegExp("\\\\([\\da-f]{1,6}"+K+"?|("+K+")|.)","ig"),aa=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:d<0?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},ba=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ca=function(a,b){return b?"\0"===a?"\ufffd":a.slice(0,-1)+"\\"+a.charCodeAt(a.length-1).toString(16)+" ":"\\"+a},da=function(){m()},ea=ta(function(a){return a.disabled===!0&&("form"in a||"label"in a)},{dir:"parentNode",next:"legend"});try{G.apply(D=H.call(v.childNodes),v.childNodes),D[v.childNodes.length].nodeType}catch(fa){G={apply:D.length?function(a,b){F.apply(a,H.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function ga(a,b,d,e){var f,h,j,k,l,o,r,s=b&&b.ownerDocument,w=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==w&&9!==w&&11!==w)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==w&&(l=Z.exec(a)))if(f=l[1]){if(9===w){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(s&&(j=s.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(l[2])return G.apply(d,b.getElementsByTagName(a)),d;if((f=l[3])&&c.getElementsByClassName&&b.getElementsByClassName)return G.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==w)s=b,r=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(ba,ca):b.setAttribute("id",k=u),o=g(a),h=o.length;while(h--)o[h]="#"+k+" "+sa(o[h]);r=o.join(","),s=$.test(a)&&qa(b.parentNode)||b}if(r)try{return G.apply(d,s.querySelectorAll(r)),d}catch(x){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(P,"$1"),b,d,e)}function ha(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ia(a){return a[u]=!0,a}function ja(a){var b=n.createElement("fieldset");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ka(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function la(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&a.sourceIndex-b.sourceIndex;if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function na(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function oa(a){return function(b){return"form"in b?b.parentNode&&b.disabled===!1?"label"in b?"label"in b.parentNode?b.parentNode.disabled===a:b.disabled===a:b.isDisabled===a||b.isDisabled!==!a&&ea(b)===a:b.disabled===a:"label"in b&&b.disabled===a}}function pa(a){return ia(function(b){return b=+b,ia(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function qa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=ga.support={},f=ga.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return!!b&&"HTML"!==b.nodeName},m=ga.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),v!==n&&(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ja(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ja(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Y.test(n.getElementsByClassName),c.getById=ja(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){return a.getAttribute("id")===b}},d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}}):(d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}},d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c,d,e,f=b.getElementById(a);if(f){if(c=f.getAttributeNode("id"),c&&c.value===a)return[f];e=b.getElementsByName(a),d=0;while(f=e[d++])if(c=f.getAttributeNode("id"),c&&c.value===a)return[f]}return[]}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){if("undefined"!=typeof b.getElementsByClassName&&p)return b.getElementsByClassName(a)},r=[],q=[],(c.qsa=Y.test(n.querySelectorAll))&&(ja(function(a){o.appendChild(a).innerHTML="",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+K+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+K+"*(?:value|"+J+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ja(function(a){a.innerHTML="";var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+K+"*[*^$|!~]?="),2!==a.querySelectorAll(":enabled").length&&q.push(":enabled",":disabled"),o.appendChild(a).disabled=!0,2!==a.querySelectorAll(":disabled").length&&q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Y.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja(function(a){c.disconnectedMatch=s.call(a,"*"),s.call(a,"[s!='']:x"),r.push("!=",N)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Y.test(o.compareDocumentPosition),t=b||Y.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?I(k,a)-I(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?I(k,a)-I(k,b):0;if(e===f)return la(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?la(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},ga.matches=function(a,b){return ga(a,null,null,b)},ga.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(S,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return ga(b,n,null,[a]).length>0},ga.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ga.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&C.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},ga.escape=function(a){return(a+"").replace(ba,ca)},ga.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ga.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=ga.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=ga.selectors={cacheLength:50,createPseudo:ia,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(_,aa),a[3]=(a[3]||a[4]||a[5]||"").replace(_,aa),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||ga.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&ga.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return V.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&T.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(_,aa).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+K+")"+a+"("+K+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=ga.attr(d,a);return null==e?"!="===b:!b||(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(O," ")+" ").indexOf(c)>-1:"|="===b&&(e===c||e.slice(0,c.length+1)===c+"-"))}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ga.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ia(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=I(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ia(function(a){var b=[],c=[],d=h(a.replace(P,"$1"));return d[u]?ia(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ia(function(a){return function(b){return ga(a,b).length>0}}),contains:ia(function(a){return a=a.replace(_,aa),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ia(function(a){return U.test(a||"")||ga.error("unsupported lang: "+a),a=a.replace(_,aa).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:oa(!1),disabled:oa(!0),checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return X.test(a.nodeName)},input:function(a){return W.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:pa(function(){return[0]}),last:pa(function(a,b){return[b-1]}),eq:pa(function(a,b,c){return[c<0?c+b:c]}),even:pa(function(a,b){for(var c=0;c=0;)a.push(d);return a}),gt:pa(function(a,b,c){for(var d=c<0?c+b:c;++d1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function va(a,b,c){for(var d=0,e=b.length;d-1&&(f[j]=!(g[j]=l))}}else r=wa(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):G.apply(g,r)})}function ya(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ta(function(a){return a===b},h,!0),l=ta(function(a){return I(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];i1&&ua(m),i>1&&sa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(P,"$1"),c,i0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=E.call(i));u=wa(u)}G.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&ga.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ia(f):f}return h=ga.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=ya(b[c]),f[u]?d.push(f):e.push(f);f=A(a,za(e,d)),f.selector=a}return f},i=ga.select=function(a,b,c,e){var f,i,j,k,l,m="function"==typeof a&&a,n=!e&&g(a=m.selector||a);if(c=c||[],1===n.length){if(i=n[0]=n[0].slice(0),i.length>2&&"ID"===(j=i[0]).type&&9===b.nodeType&&p&&d.relative[i[1].type]){if(b=(d.find.ID(j.matches[0].replace(_,aa),b)||[])[0],!b)return c;m&&(b=b.parentNode),a=a.slice(i.shift().value.length)}f=V.needsContext.test(a)?0:i.length;while(f--){if(j=i[f],d.relative[k=j.type])break;if((l=d.find[k])&&(e=l(j.matches[0].replace(_,aa),$.test(i[0].type)&&qa(b.parentNode)||b))){if(i.splice(f,1),a=e.length&&sa(i),!a)return G.apply(c,e),c;break}}}return(m||h(a,n))(e,b,!p,c,!b||$.test(a)&&qa(b.parentNode)||b),c},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja(function(a){return 1&a.compareDocumentPosition(n.createElement("fieldset"))}),ja(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||ka("type|href|height|width",function(a,b,c){if(!c)return a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ja(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ka("value",function(a,b,c){if(!c&&"input"===a.nodeName.toLowerCase())return a.defaultValue}),ja(function(a){return null==a.getAttribute("disabled")})||ka(J,function(a,b,c){var d;if(!c)return a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),ga}(a);r.find=x,r.expr=x.selectors,r.expr[":"]=r.expr.pseudos,r.uniqueSort=r.unique=x.uniqueSort,r.text=x.getText,r.isXMLDoc=x.isXML,r.contains=x.contains,r.escapeSelector=x.escape;var y=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&r(a).is(c))break;d.push(a)}return d},z=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},A=r.expr.match.needsContext,B=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i,C=/^.[^:#\[\.,]*$/;function D(a,b,c){return r.isFunction(b)?r.grep(a,function(a,d){return!!b.call(a,d,a)!==c}):b.nodeType?r.grep(a,function(a){return a===b!==c}):"string"!=typeof b?r.grep(a,function(a){return i.call(b,a)>-1!==c}):C.test(b)?r.filter(b,a,c):(b=r.filter(b,a),r.grep(a,function(a){return i.call(b,a)>-1!==c&&1===a.nodeType}))}r.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?r.find.matchesSelector(d,a)?[d]:[]:r.find.matches(a,r.grep(b,function(a){return 1===a.nodeType}))},r.fn.extend({find:function(a){var b,c,d=this.length,e=this;if("string"!=typeof a)return this.pushStack(r(a).filter(function(){for(b=0;b1?r.uniqueSort(c):c},filter:function(a){return this.pushStack(D(this,a||[],!1))},not:function(a){return this.pushStack(D(this,a||[],!0))},is:function(a){return!!D(this,"string"==typeof a&&A.test(a)?r(a):a||[],!1).length}});var E,F=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,G=r.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||E,"string"==typeof a){if(e="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:F.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof r?b[0]:b,r.merge(this,r.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),B.test(e[1])&&r.isPlainObject(b))for(e in b)r.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}return f=d.getElementById(e[2]),f&&(this[0]=f,this.length=1),this}return a.nodeType?(this[0]=a,this.length=1,this):r.isFunction(a)?void 0!==c.ready?c.ready(a):a(r):r.makeArray(a,this)};G.prototype=r.fn,E=r(d);var H=/^(?:parents|prev(?:Until|All))/,I={children:!0,contents:!0,next:!0,prev:!0};r.fn.extend({has:function(a){var b=r(a,this),c=b.length;return this.filter(function(){for(var a=0;a-1:1===c.nodeType&&r.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?r.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?i.call(r(a),this[0]):i.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(r.uniqueSort(r.merge(this.get(),r(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function J(a,b){while((a=a[b])&&1!==a.nodeType);return a}r.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return y(a,"parentNode")},parentsUntil:function(a,b,c){return y(a,"parentNode",c)},next:function(a){return J(a,"nextSibling")},prev:function(a){return J(a,"previousSibling")},nextAll:function(a){return y(a,"nextSibling")},prevAll:function(a){return y(a,"previousSibling")},nextUntil:function(a,b,c){return y(a,"nextSibling",c)},prevUntil:function(a,b,c){return y(a,"previousSibling",c)},siblings:function(a){return z((a.parentNode||{}).firstChild,a)},children:function(a){return z(a.firstChild)},contents:function(a){return a.contentDocument||r.merge([],a.childNodes)}},function(a,b){r.fn[a]=function(c,d){var e=r.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=r.filter(d,e)),this.length>1&&(I[a]||r.uniqueSort(e),H.test(a)&&e.reverse()),this.pushStack(e)}});var K=/[^\x20\t\r\n\f]+/g;function L(a){var b={};return r.each(a.match(K)||[],function(a,c){b[c]=!0}),b}r.Callbacks=function(a){a="string"==typeof a?L(a):r.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h-1)f.splice(c,1),c<=h&&h--}),this},has:function(a){return a?r.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=g=[],c||b||(f=c=""),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j};function M(a){return a}function N(a){throw a}function O(a,b,c){var d;try{a&&r.isFunction(d=a.promise)?d.call(a).done(b).fail(c):a&&r.isFunction(d=a.then)?d.call(a,b,c):b.call(void 0,a)}catch(a){c.call(void 0,a)}}r.extend({Deferred:function(b){var c=[["notify","progress",r.Callbacks("memory"),r.Callbacks("memory"),2],["resolve","done",r.Callbacks("once memory"),r.Callbacks("once memory"),0,"resolved"],["reject","fail",r.Callbacks("once memory"),r.Callbacks("once memory"),1,"rejected"]],d="pending",e={state:function(){return d},always:function(){return f.done(arguments).fail(arguments),this},"catch":function(a){return e.then(null,a)},pipe:function(){var a=arguments;return r.Deferred(function(b){r.each(c,function(c,d){var e=r.isFunction(a[d[4]])&&a[d[4]];f[d[1]](function(){var a=e&&e.apply(this,arguments);a&&r.isFunction(a.promise)?a.promise().progress(b.notify).done(b.resolve).fail(b.reject):b[d[0]+"With"](this,e?[a]:arguments)})}),a=null}).promise()},then:function(b,d,e){var f=0;function g(b,c,d,e){return function(){var h=this,i=arguments,j=function(){var a,j;if(!(b=f&&(d!==N&&(h=void 0,i=[a]),c.rejectWith(h,i))}};b?k():(r.Deferred.getStackHook&&(k.stackTrace=r.Deferred.getStackHook()),a.setTimeout(k))}}return r.Deferred(function(a){c[0][3].add(g(0,a,r.isFunction(e)?e:M,a.notifyWith)),c[1][3].add(g(0,a,r.isFunction(b)?b:M)),c[2][3].add(g(0,a,r.isFunction(d)?d:N))}).promise()},promise:function(a){return null!=a?r.extend(a,e):e}},f={};return r.each(c,function(a,b){var g=b[2],h=b[5];e[b[1]]=g.add,h&&g.add(function(){d=h},c[3-a][2].disable,c[0][2].lock),g.add(b[3].fire),f[b[0]]=function(){return f[b[0]+"With"](this===f?void 0:this,arguments),this},f[b[0]+"With"]=g.fireWith}),e.promise(f),b&&b.call(f,f),f},when:function(a){var b=arguments.length,c=b,d=Array(c),e=f.call(arguments),g=r.Deferred(),h=function(a){return function(c){d[a]=this,e[a]=arguments.length>1?f.call(arguments):c,--b||g.resolveWith(d,e)}};if(b<=1&&(O(a,g.done(h(c)).resolve,g.reject),"pending"===g.state()||r.isFunction(e[c]&&e[c].then)))return g.then();while(c--)O(e[c],h(c),g.reject);return g.promise()}});var P=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;r.Deferred.exceptionHook=function(b,c){a.console&&a.console.warn&&b&&P.test(b.name)&&a.console.warn("jQuery.Deferred exception: "+b.message,b.stack,c)},r.readyException=function(b){a.setTimeout(function(){throw b})};var Q=r.Deferred();r.fn.ready=function(a){return Q.then(a)["catch"](function(a){r.readyException(a)}),this},r.extend({isReady:!1,readyWait:1,holdReady:function(a){a?r.readyWait++:r.ready(!0)},ready:function(a){(a===!0?--r.readyWait:r.isReady)||(r.isReady=!0,a!==!0&&--r.readyWait>0||Q.resolveWith(d,[r]))}}),r.ready.then=Q.then;function R(){d.removeEventListener("DOMContentLoaded",R),
3 | a.removeEventListener("load",R),r.ready()}"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll?a.setTimeout(r.ready):(d.addEventListener("DOMContentLoaded",R),a.addEventListener("load",R));var S=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===r.type(c)){e=!0;for(h in c)S(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,r.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(r(a),c)})),b))for(;h1,null,!0)},removeData:function(a){return this.each(function(){W.remove(this,a)})}}),r.extend({queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=V.get(a,b),c&&(!d||r.isArray(c)?d=V.access(a,b,r.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=r.queue(a,b),d=c.length,e=c.shift(),f=r._queueHooks(a,b),g=function(){r.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return V.get(a,c)||V.access(a,c,{empty:r.Callbacks("once memory").add(function(){V.remove(a,[b+"queue",c])})})}}),r.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length\x20\t\r\n\f]+)/i,ka=/^$|\/(?:java|ecma)script/i,la={option:[1,""],thead:[1,""],col:[2,""],tr:[2,""],td:[3,""],_default:[0,"",""]};la.optgroup=la.option,la.tbody=la.tfoot=la.colgroup=la.caption=la.thead,la.th=la.td;function ma(a,b){var c;return c="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):[],void 0===b||b&&r.nodeName(a,b)?r.merge([a],c):c}function na(a,b){for(var c=0,d=a.length;c-1)e&&e.push(f);else if(j=r.contains(f.ownerDocument,f),g=ma(l.appendChild(f),"script"),j&&na(g),c){k=0;while(f=g[k++])ka.test(f.type||"")&&c.push(f)}return l}!function(){var a=d.createDocumentFragment(),b=a.appendChild(d.createElement("div")),c=d.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),o.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="",o.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var qa=d.documentElement,ra=/^key/,sa=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,ta=/^([^.]*)(?:\.(.+)|)/;function ua(){return!0}function va(){return!1}function wa(){try{return d.activeElement}catch(a){}}function xa(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)xa(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=va;else if(!e)return a;return 1===f&&(g=e,e=function(a){return r().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=r.guid++)),a.each(function(){r.event.add(this,b,e,d,c)})}r.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=V.get(a);if(q){c.handler&&(f=c,c=f.handler,e=f.selector),e&&r.find.matchesSelector(qa,e),c.guid||(c.guid=r.guid++),(i=q.events)||(i=q.events={}),(g=q.handle)||(g=q.handle=function(b){return"undefined"!=typeof r&&r.event.triggered!==b.type?r.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(K)||[""],j=b.length;while(j--)h=ta.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n&&(l=r.event.special[n]||{},n=(e?l.delegateType:l.bindType)||n,l=r.event.special[n]||{},k=r.extend({type:n,origType:p,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&r.expr.match.needsContext.test(e),namespace:o.join(".")},f),(m=i[n])||(m=i[n]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,o,g)!==!1||a.addEventListener&&a.addEventListener(n,g)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),r.event.global[n]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=V.hasData(a)&&V.get(a);if(q&&(i=q.events)){b=(b||"").match(K)||[""],j=b.length;while(j--)if(h=ta.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n){l=r.event.special[n]||{},n=(d?l.delegateType:l.bindType)||n,m=i[n]||[],h=h[2]&&new RegExp("(^|\\.)"+o.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&p!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,o,q.handle)!==!1||r.removeEvent(a,n,q.handle),delete i[n])}else for(n in i)r.event.remove(a,n+b[j],c,d,!0);r.isEmptyObject(i)&&V.remove(a,"handle events")}},dispatch:function(a){var b=r.event.fix(a),c,d,e,f,g,h,i=new Array(arguments.length),j=(V.get(this,"events")||{})[b.type]||[],k=r.event.special[b.type]||{};for(i[0]=b,c=1;c=1))for(;j!==this;j=j.parentNode||this)if(1===j.nodeType&&("click"!==a.type||j.disabled!==!0)){for(f=[],g={},c=0;c-1:r.find(e,this,null,[j]).length),g[e]&&f.push(d);f.length&&h.push({elem:j,handlers:f})}return j=this,i\x20\t\r\n\f]*)[^>]*)\/>/gi,za=/