Compare commits
467 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
c521ecd055 | ||
|
44e53ab213 | ||
|
5af71185ff | ||
|
d714ea90fb | ||
|
1e12faa756 | ||
|
85ddff9c2d | ||
|
00232389ad | ||
|
e10fe49cc0 | ||
|
6c52ae659f | ||
|
3c54c1d66c | ||
|
940608d02a | ||
|
b6b8d9f144 | ||
|
c559edc208 | ||
|
4a41994556 | ||
|
d763d6b20a | ||
|
dc2a74d251 | ||
|
fe5ce111af | ||
|
a930f4ce1b | ||
|
dae89ba5d8 | ||
|
78df81266c | ||
|
b261c7e937 | ||
|
f9a7a217f8 | ||
|
4d96cb47ad | ||
|
0f4fe15195 | ||
|
d20d1e8b2c | ||
|
4130f7a6fd | ||
|
4ccd4bb030 | ||
|
16926f821d | ||
|
7b5599e9d1 | ||
|
834f3b5425 | ||
|
f0bee58869 | ||
|
03e89dab5e | ||
|
b7f25c45f2 | ||
|
e5966bc610 | ||
|
78bc1e2a1e | ||
|
0315e29b44 | ||
|
152dcb9b46 | ||
|
3a87b594a6 | ||
|
631a0f7aa3 | ||
|
5564559b7c | ||
|
0e0f06d634 | ||
|
e52b3dd440 | ||
|
c486962ff8 | ||
|
3fe1b2d6f8 | ||
|
691cbce10f | ||
|
4ccab28253 | ||
|
a6994150ca | ||
|
1d4b4b8a02 | ||
|
20e080751d | ||
|
8a4ccd098c | ||
|
9e0b1698fc | ||
|
18dfa1e09f | ||
|
83aad78ab0 | ||
|
9b88cdeb9b | ||
|
11030a17af | ||
|
aa7df50402 | ||
|
2008d0755c | ||
|
c7fdfc27a1 | ||
|
717e046bb9 | ||
|
5bbc88b8e2 | ||
|
babb952485 | ||
|
22b2db8daf | ||
|
8485905901 | ||
|
73e74bb887 | ||
|
a893cb7534 | ||
|
87e5472d42 | ||
|
05194167e1 | ||
|
6dbffb8be1 | ||
|
24945faded | ||
|
3761a40e50 | ||
|
f547d95f30 | ||
|
4a3e8c6734 | ||
|
07ccdbd734 | ||
|
47b46813db | ||
|
82c0ae88f8 | ||
|
749c8b29c9 | ||
|
d0b6197aec | ||
|
3b8edf9ad8 | ||
|
9c4f3111ba | ||
|
901d8c407d | ||
|
6b3ba18da1 | ||
|
cfbae4c5d5 | ||
|
7320592dc2 | ||
|
9234e3f287 | ||
|
95c473a7c7 | ||
|
3e14d7bed4 | ||
|
aebfdeb1cd | ||
|
131d153cf5 | ||
|
a3c9bc9db0 | ||
|
06b4d81a61 | ||
|
d8d7b997b5 | ||
|
26c4d569aa | ||
|
67d9e9794b | ||
|
0b8d7e5343 | ||
|
c3cd171785 | ||
|
171f1c12eb | ||
|
50644c84dc | ||
|
92e8e34a66 | ||
|
804df4c0fb | ||
|
41bb7d76b5 | ||
|
35df02984b | ||
|
e0fc7043b5 | ||
|
628836a201 | ||
|
00f9ee09d3 | ||
|
029d4ed5af | ||
|
cd7c3c3dd4 | ||
|
d5c9668013 | ||
|
2fb7f9129e | ||
|
f6150c58f4 | ||
|
3246525d78 | ||
|
fe9cdbc46b | ||
|
324fceb5c3 | ||
|
8656bdd74e | ||
|
8ef9575e51 | ||
|
1fc72d8473 | ||
|
2153056266 | ||
|
2240bd3ca1 | ||
|
127eaf9aac | ||
|
7d5945d45b | ||
|
1d2c45dc68 | ||
|
2ee4a18e1c | ||
|
f0a9937dc6 | ||
|
3a2e61b163 | ||
|
c4fa90a747 | ||
|
1cba9290b6 | ||
|
58cbad2bfd | ||
|
da9d027fed | ||
|
70d6528190 | ||
|
f7187fb14b | ||
|
7ec2bdf16a | ||
|
c7433b0d14 | ||
|
0179a5044b | ||
|
f37e8e7b89 | ||
|
ba670be7d8 | ||
|
93487de085 | ||
|
a2fb3d952d | ||
|
fada3c1e36 | ||
|
aa87ec15b0 | ||
|
a0db0e0ac3 | ||
|
a790c34a24 | ||
|
38daa4aa1f | ||
|
c92822ba7d | ||
|
18f2c72fd1 | ||
|
d03dc990fa | ||
|
882abd1972 | ||
|
2dd594ba13 | ||
|
8d5473903e | ||
|
69c1ffd92f | ||
|
808e37d034 | ||
|
60ef5ff983 | ||
|
171539643e | ||
|
793bfce202 | ||
|
10d6d2c3c1 | ||
|
51a161eede | ||
|
57b3ee6c2f | ||
|
641d9b3cfa | ||
|
5c2d84aaa9 | ||
|
8157ada8fc | ||
|
8e143a4607 | ||
|
e021862acf | ||
|
ed9f04a372 | ||
|
ca86993091 | ||
|
85bd0abd8d | ||
|
ed1ab4053c | ||
|
6aed4455d3 | ||
|
5f265672ae | ||
|
1653306440 | ||
|
d0fe566f8f | ||
|
11bab8d0a1 | ||
|
c612fbcfb7 | ||
|
11c86c7031 | ||
|
e2ffb09ed1 | ||
|
77f1a073a7 | ||
|
168ead7ed5 | ||
|
0e5b463acf | ||
|
2e8ae301c5 | ||
|
ab622d5cd2 | ||
|
a6e6cf96d6 | ||
|
58b4d20185 | ||
|
39ea94daa8 | ||
|
0c6143704a | ||
|
5d0770ca36 | ||
|
1ae45f6cbb | ||
|
eb69d73190 | ||
|
2b2656b7e1 | ||
|
6c7e3e8c5d | ||
|
063049ec8e | ||
|
787eae7a80 | ||
|
5b1b8e0b2d | ||
|
18a62ca831 | ||
|
de0b2eedc9 | ||
|
d7b389e407 | ||
|
14825ebe29 | ||
|
34aeac9787 | ||
|
fc3f84da6e | ||
|
6ed6819cef | ||
|
370bb3b068 | ||
|
570431e39c | ||
|
efc4623a0b | ||
|
65d8aab429 | ||
|
6c9d480736 | ||
|
9fde25fc8e | ||
|
e6a59ae6d0 | ||
|
5b68fe731a | ||
|
c8eff2d313 | ||
|
74745a8603 | ||
|
0aadd1add9 | ||
|
b3f61f81e2 | ||
|
90befd2b8e | ||
|
bf5483950c | ||
|
bd7e005c91 | ||
|
e08cbb4c96 | ||
|
c93df78f1d | ||
|
bfb1be8aa5 | ||
|
86466f072b | ||
|
b33599f4f2 | ||
|
d0f29ec3cf | ||
|
be7626b698 | ||
|
01b1a8e029 | ||
|
09fa3acc4d | ||
|
04d9296733 | ||
|
0b57b1cbd2 | ||
|
0a843a0b1f | ||
|
8d3611e30c | ||
|
76c226c57b | ||
|
673afead73 | ||
|
8e5b874490 | ||
|
d9ea66ef85 | ||
|
fbd9db897e | ||
|
1995acab95 | ||
|
fe9c7587d8 | ||
|
9eb29b5707 | ||
|
99462d0ae0 | ||
|
89d56b3ae4 | ||
|
a61dea8c40 | ||
|
cc4bb962a6 | ||
|
0a3d085c5a | ||
|
17b5d4dfaa | ||
|
95f087cfd6 | ||
|
9090c28f04 | ||
|
fe5723f75d | ||
|
9637c89b1b | ||
|
4db158e8d9 | ||
|
05547c2685 | ||
|
4f9a298273 | ||
|
2a7b1b1f0d | ||
|
21014ff788 | ||
|
9611aed707 | ||
|
ae677a2194 | ||
|
f19d9b9419 | ||
|
fe6830cd83 | ||
|
4932dda11c | ||
|
37fbca2ead | ||
|
093296dbac | ||
|
4f83c95d20 | ||
|
0f72db1961 | ||
|
7063b26a5f | ||
|
4889290d3e | ||
|
b1f88f28f4 | ||
|
ee241e7e3f | ||
|
057a5f05a5 | ||
|
06b9232552 | ||
|
6258c40a24 | ||
|
9f53ddd3f3 | ||
|
e199be6363 | ||
|
788f4f047c | ||
|
34f86997cb | ||
|
291f4e28d8 | ||
|
8f921c8a1f | ||
|
8c810a1818 | ||
|
d07850b6ef | ||
|
cb9b8c6244 | ||
|
1e11b804ab | ||
|
0719eeeb90 | ||
|
f363e78601 | ||
|
b340fe3569 | ||
|
429a2b7749 | ||
|
c18b09c658 | ||
|
7bcb52214b | ||
|
34e6c2c381 | ||
|
b6b84a541b | ||
|
76186e513f | ||
|
5930681095 | ||
|
1d7457a4a2 | ||
|
7503d79c06 | ||
|
24319e1c49 | ||
|
48b788eaef | ||
|
6b071fc1e7 | ||
|
942f4696e2 | ||
|
022f715b98 | ||
|
7311cc8e4b | ||
|
7f6755b5de | ||
|
a482529fdc | ||
|
5798529fe2 | ||
|
a362356a72 | ||
|
4896d9a101 | ||
|
d244ab9fca | ||
|
570599c19d | ||
|
a9f6f157fa | ||
|
c35abad20a | ||
|
7f687e0a84 | ||
|
ea24ae3b5f | ||
|
55597ae1ba | ||
|
6ee0ed3444 | ||
|
d5a1a829e3 | ||
|
5c72378b39 | ||
|
e3603cfec1 | ||
|
90d337a51f | ||
|
1975715dbd | ||
|
85be66886a | ||
|
d4e349f260 | ||
|
059e166402 | ||
|
1d7c2f3b80 | ||
|
11c3750690 | ||
|
808b1bf657 | ||
|
7c4f9d574c | ||
|
e31028f5a9 | ||
|
0f1ca4e85b | ||
|
003b3f3edb | ||
|
69cc1bd281 | ||
|
31fe4d1591 | ||
|
675efd6cd3 | ||
|
0f0d97dab5 | ||
|
4b19239f6f | ||
|
a74e849faf | ||
|
d0f7f586e8 | ||
|
3b9e87e11b | ||
|
46b335eb9f | ||
|
9bdf86fc24 | ||
|
167e30dee1 | ||
|
16186811a4 | ||
|
d2031d57d2 | ||
|
6e54ba2f73 | ||
|
77d6da3a24 | ||
|
65caa0fe9d | ||
|
d6040b028e | ||
|
509074c263 | ||
|
6ad53ec2aa | ||
|
e275ecac07 | ||
|
2d0cc10e44 | ||
|
af6c715a5b | ||
|
3360e4d167 | ||
|
2331f21f90 | ||
|
58bf1a3091 | ||
|
3cf135b670 | ||
|
5ce0541937 | ||
|
19aa32feb4 | ||
|
aedf75b9f8 | ||
|
8b7e0b57c5 | ||
|
3dfd912266 | ||
|
5bd767d744 | ||
|
b39ba9cd00 | ||
|
07ffb9d995 | ||
|
2479aa597b | ||
|
8c34337136 | ||
|
0faf399abd | ||
|
7704a00d7b | ||
|
96b6ff7fff | ||
|
3dedb6b0f6 | ||
|
13457f8a6a | ||
|
bc966c46c6 | ||
|
a5d04198dc | ||
|
c3803b2e84 | ||
|
aa8b9789f7 | ||
|
70c8364349 | ||
|
ea306c7d0c | ||
|
33bc45d179 | ||
|
f7d0f7d5eb | ||
|
f181c52d13 | ||
|
f7e3f4da79 | ||
|
2365c23af7 | ||
|
73496c6b7c | ||
|
6500b624f5 | ||
|
2525ad8393 | ||
|
344c61bd23 | ||
|
248e7efdb0 | ||
|
530e9c3859 | ||
|
594653a753 | ||
|
cb5c197994 | ||
|
c8bffa006b | ||
|
df76ca0807 | ||
|
1e00e2b733 | ||
|
2b834f0233 | ||
|
af34531ee0 | ||
|
b5049ea855 | ||
|
785f4632c7 | ||
|
fcaddbbd3b | ||
|
ddf23d1ea5 | ||
|
dabc9e3c93 | ||
|
f89010bd98 | ||
|
cf84bd74f1 | ||
|
b95aa583a9 | ||
|
21c976bb3d | ||
|
63fe57731e | ||
|
668f316465 | ||
|
55fa4a1bcd | ||
|
bdeac2533f | ||
|
2ed333ab82 | ||
|
8d11090f7d | ||
|
336e9ac0bd | ||
|
0a4fd4ee2c | ||
|
b90b164552 | ||
|
b7a77797f6 | ||
|
ebcf431363 | ||
|
ba315be9e5 | ||
|
d5a0dce27a | ||
|
1a47a2aa3b | ||
|
d5221c0d17 | ||
|
0be36ea9e8 | ||
|
c03fd20bae | ||
|
c632cc6dea | ||
|
908c49c584 | ||
|
d591dbc0cd | ||
|
945703952b | ||
|
9102b6d1c3 | ||
|
4daab5d77b | ||
|
5e8baf027e | ||
|
34525afe56 | ||
|
c73bc83f7d | ||
|
ce11fcffbc | ||
|
239157df30 | ||
|
e7d97d4b66 | ||
|
b2c4802310 | ||
|
60b366a7f4 | ||
|
c732fbb363 | ||
|
41b199c578 | ||
|
88854ad451 | ||
|
3882f1483b | ||
|
882bf8ae11 | ||
|
c396800dfa | ||
|
5a8ecd593d | ||
|
84693e6404 | ||
|
476df8219f | ||
|
448c889e56 | ||
|
52ca5275b1 | ||
|
0fd6e2c878 | ||
|
85599f8a33 | ||
|
5f2a7985d8 | ||
|
b1b5e37ab6 | ||
|
2f26146228 | ||
|
6bfbebc51e | ||
|
762fd54788 | ||
|
57ab18355d | ||
|
8d9a2f505f | ||
|
c20da80bda | ||
|
e99bd06370 | ||
|
6f5446f218 | ||
|
c1c25f0e28 | ||
|
cdca37e59d | ||
|
6137120b2e | ||
|
f0912f9e9d | ||
|
1623d0f60a | ||
|
96db9677c6 | ||
|
bcfdec87c9 | ||
|
488e321613 | ||
|
90fcae1932 | ||
|
271c5fd9d2 | ||
|
bd2b564876 | ||
|
99a45ab56e | ||
|
18d12b6746 | ||
|
90013da52c | ||
|
ce6680ae19 | ||
|
bdbaf26e9b | ||
|
c487eaa846 | ||
|
69318824f6 | ||
|
fc918f1e3c | ||
|
04c574c6f9 |
@@ -12,21 +12,11 @@ insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
|
||||
[package.json]
|
||||
indent_style = space
|
||||
[{package.json,.travis.yml,.eslintrc}]
|
||||
indent_size = 2
|
||||
|
||||
|
||||
[.travis.yml]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
|
||||
[*.jade]
|
||||
[{*.md,*.pug}]
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
|
||||
|
3
.eslintignore
Normal file
@@ -0,0 +1,3 @@
|
||||
build
|
||||
node_modules
|
||||
**/vendor
|
182
.eslintrc
Normal file
@@ -0,0 +1,182 @@
|
||||
---
|
||||
root: true
|
||||
|
||||
env:
|
||||
es6: true
|
||||
node: true
|
||||
|
||||
parserOptions:
|
||||
ecmaVersion: 6
|
||||
|
||||
rules:
|
||||
array-bracket-spacing: [2, never]
|
||||
arrow-parens: [2, as-needed]
|
||||
arrow-spacing: 2
|
||||
block-scoped-var: 2
|
||||
brace-style: [2, 1tbs, {allowSingleLine: true}]
|
||||
camelcase: 0
|
||||
comma-dangle: [2, never]
|
||||
comma-spacing: [2, {before: false, after: true}]
|
||||
comma-style: [2, last]
|
||||
complexity: [1, 10] ###
|
||||
computed-property-spacing: [2, never]
|
||||
consistent-return: 2
|
||||
consistent-this: [2, self]
|
||||
constructor-super: 2
|
||||
curly: [2, multi-line]
|
||||
default-case: 2
|
||||
dot-location: [2, property]
|
||||
dot-notation: [2, {allowKeywords: true}]
|
||||
eol-last: 2
|
||||
eqeqeq: 2
|
||||
func-names: 2
|
||||
func-style: [2, declaration, {allowArrowFunctions: true}]
|
||||
generator-star-spacing: [2, after]
|
||||
guard-for-in: 2
|
||||
handle-callback-err: 2
|
||||
indent: [2, 4]
|
||||
key-spacing: [2, {beforeColon: false, afterColon: true}]
|
||||
keyword-spacing: [2, {before: true, after: true}]
|
||||
linebreak-style: [2, unix]
|
||||
max-depth: [1, 4]
|
||||
max-len: [0, 80, 4]
|
||||
max-nested-callbacks: [1, 3]
|
||||
max-params: [1, 4] ###
|
||||
max-statements: [1, 30] ###
|
||||
new-cap: 0
|
||||
new-parens: 2
|
||||
newline-after-var: 0
|
||||
no-alert: 2
|
||||
no-array-constructor: 2
|
||||
no-bitwise: 2
|
||||
no-caller: 2
|
||||
no-catch-shadow: 2
|
||||
no-class-assign: 2
|
||||
no-cond-assign: 2
|
||||
no-console: 0 ###
|
||||
no-const-assign: 2
|
||||
no-constant-condition: 1
|
||||
no-continue: 0
|
||||
no-control-regex: 2
|
||||
no-debugger: 2
|
||||
no-delete-var: 2
|
||||
no-div-regex: 2
|
||||
no-dupe-args: 2
|
||||
no-dupe-class-members: 2
|
||||
no-dupe-keys: 2
|
||||
no-duplicate-case: 2
|
||||
no-else-return: 1
|
||||
no-empty: 2
|
||||
no-empty-character-class: 2
|
||||
no-empty-pattern: 2
|
||||
no-eq-null: 2
|
||||
no-eval: 2
|
||||
no-ex-assign: 2
|
||||
no-extend-native: 1
|
||||
no-extra-bind: 2
|
||||
no-extra-boolean-cast: 2
|
||||
no-extra-parens: 1
|
||||
no-extra-semi: 2
|
||||
no-fallthrough: 2
|
||||
no-floating-decimal: 2
|
||||
no-func-assign: 2
|
||||
no-implicit-coercion: [2, {boolean: false, number: true, string: true}]
|
||||
no-implied-eval: 2
|
||||
no-inline-comments: 0
|
||||
no-inner-declarations: [2, functions]
|
||||
no-invalid-regexp: 2
|
||||
no-invalid-this: 2
|
||||
no-irregular-whitespace: 2
|
||||
no-iterator: 2
|
||||
no-label-var: 2
|
||||
no-labels: 2
|
||||
no-lone-blocks: 2
|
||||
no-lonely-if: 2
|
||||
no-loop-func: 1
|
||||
no-magic-numbers: 0
|
||||
no-mixed-requires: [2, false]
|
||||
no-mixed-spaces-and-tabs: [2, false]
|
||||
no-multi-spaces: 2
|
||||
no-multi-str: 2
|
||||
no-multiple-empty-lines: [2, {max: 4}]
|
||||
no-native-reassign: 1
|
||||
no-negated-in-lhs: 2
|
||||
no-nested-ternary: 0
|
||||
no-new: 2
|
||||
no-new-func: 2
|
||||
no-new-object: 2
|
||||
no-new-require: 2
|
||||
no-new-wrappers: 2
|
||||
no-obj-calls: 2
|
||||
no-octal: 2
|
||||
no-octal-escape: 2
|
||||
no-param-reassign: 0
|
||||
no-path-concat: 2
|
||||
no-plusplus: 2
|
||||
no-process-env: 2
|
||||
no-process-exit: 2
|
||||
no-proto: 2
|
||||
no-redeclare: 2
|
||||
no-regex-spaces: 2
|
||||
no-restricted-modules: 2
|
||||
no-return-assign: 2
|
||||
no-script-url: 2
|
||||
no-self-compare: 2
|
||||
no-sequences: 2
|
||||
no-shadow: 2
|
||||
no-shadow-restricted-names: 2
|
||||
no-spaced-func: 2
|
||||
no-sparse-arrays: 2
|
||||
no-sync: 0
|
||||
no-ternary: 0
|
||||
no-this-before-super: 2
|
||||
no-throw-literal: 1
|
||||
no-trailing-spaces: 2
|
||||
no-undef: 2
|
||||
no-undef-init: 2
|
||||
no-undefined: 0
|
||||
no-underscore-dangle: 0
|
||||
no-unexpected-multiline: 2
|
||||
no-unneeded-ternary: 2
|
||||
no-unreachable: 2
|
||||
no-useless-call: 2
|
||||
no-useless-concat: 2
|
||||
no-unused-expressions: 2
|
||||
no-unused-vars: [1, {vars: all, args: after-used}]
|
||||
no-use-before-define: 2
|
||||
no-var: 2
|
||||
no-void: 2
|
||||
no-warning-comments: [1, {terms: [todo, fixme, xxx], location: start}]
|
||||
no-with: 2
|
||||
object-curly-spacing: [2, never]
|
||||
object-shorthand: [2, always]
|
||||
one-var: [2, never]
|
||||
operator-assignment: [2, always]
|
||||
operator-linebreak: [2, after]
|
||||
padded-blocks: [2, never]
|
||||
prefer-arrow-callback: 2
|
||||
prefer-const: 1
|
||||
prefer-reflect: 1
|
||||
prefer-spread: 2
|
||||
prefer-template: 0
|
||||
quote-props: [2, as-needed]
|
||||
quotes: [2, single, avoid-escape]
|
||||
radix: 2
|
||||
require-yield: 2
|
||||
semi: 2
|
||||
semi-spacing: [2, {before: false, after: true}]
|
||||
sort-vars: 0
|
||||
space-before-blocks: [2, always]
|
||||
space-before-function-paren: [2, {anonymous: always, named: never}]
|
||||
space-in-parens: [2, never]
|
||||
space-infix-ops: 2
|
||||
space-unary-ops: [2, {words: true, nonwords: false}]
|
||||
spaced-comment: [2, always]
|
||||
strict: [2, never]
|
||||
use-isnan: 2
|
||||
valid-jsdoc: 2
|
||||
valid-typeof: 2
|
||||
vars-on-top: 0
|
||||
wrap-iife: [2, outside]
|
||||
wrap-regex: 2
|
||||
yoda: [2, never, {exceptRange: true}]
|
2
.gitignore
vendored
@@ -1,4 +1,4 @@
|
||||
build
|
||||
local
|
||||
node_modules
|
||||
test
|
||||
npm-debug.log
|
||||
|
@@ -1,2 +0,0 @@
|
||||
{
|
||||
}
|
234
CHANGELOG.md
@@ -1,113 +1,187 @@
|
||||
# Changelog
|
||||
|
||||
|
||||
## v0.29.1 - *2019-01-20*
|
||||
|
||||
* replace `babel-preset-es2015` with `babel-preset-env`
|
||||
* update `eslint` to 5.14.1
|
||||
* update `ghu` to 0.12.0
|
||||
* update `jsdom` to 9.2.0
|
||||
* update `kjua` to 0.1.2
|
||||
* update `lolight` to 0.6.0
|
||||
* update `marked` to 0.6.1
|
||||
* update `normalize.css` to 8.0.1
|
||||
* update `scar` to 1.0.0
|
||||
|
||||
|
||||
## v0.29.0 - *2016-08-12*
|
||||
|
||||
* back to cleaner visual experience
|
||||
* add option to disable sidebar
|
||||
* add options to filter/search ignore case
|
||||
* replace PHP `getenv` calls with `$_SERVER` lookups
|
||||
* add `view.fallbackMode` option to generally serve only fallback mode
|
||||
* serve fallback mode for text browsers (`curl`, `links`, `lynx`, `w3m`)
|
||||
* change type `txt-svg` to `img-svg`, no thumbs but preview
|
||||
* fix a tree indentation glitch
|
||||
* fix shell command detection on Windows
|
||||
* fix Piwik anayltics
|
||||
* fix `.htaccess` auth issues
|
||||
* fix drag-select on scrollable content
|
||||
* fix download-all function
|
||||
* fix audio and video preview loading
|
||||
* fix thumbnail request issues
|
||||
* add `rust` type and icon
|
||||
* add `autoplay` option to audio and video preview
|
||||
* add `--dereference` to `shell-du` to follow sym links
|
||||
* remove *Install* section from `README.md`, causes too much trouble
|
||||
* remove peer5 support
|
||||
* update build process to use `node 6.0+`, no need for babel now
|
||||
* replace `jquery-qrcode` with [`kjua`](https://larsjung.de/kjua/)
|
||||
* replace `prism` with [`lolight`](https://larsjung.de/lolight/)
|
||||
* move deps to `package.json` (`normalize.css`, `kjua`, `lolight` and `marked`)
|
||||
* remove `jQuery`
|
||||
* remove `lodash`
|
||||
* remove [`modulejs`](https://larsjung.de/modulejs/) for now
|
||||
* reduce JS code by 60% (~250kb -> ~100kb)
|
||||
* update languages (`et`, `nl`, `pl`)
|
||||
|
||||
|
||||
## v0.28.0 - *2015-12-19*
|
||||
|
||||
* now require PHP 5.5.0+
|
||||
* change index path to `/_h5ai/public/index.php`
|
||||
* now only `/_h5ai/public/` needs to be web-accessible
|
||||
* add support for custom script and style additions
|
||||
* add options to set font families
|
||||
* add search
|
||||
* add ignorecase sorting option to tree
|
||||
* add wide links in tree view
|
||||
* add IE edge mode
|
||||
* add frontend tests
|
||||
* fix some styles in IE10
|
||||
* fix preview bottom bar for small screen widths
|
||||
* lots of code cleanup and refactorings
|
||||
* change API
|
||||
* update build process, now uses [`ghu`](https://larsjung.de/ghu/)
|
||||
* switch from jshint and jscs to [`eslint`](http://eslint.org/)
|
||||
* update `jQuery` to 2.1.4
|
||||
* update `lodash` to 3.9.3 (add debounce and trim)
|
||||
* update `marked` to 0.3.5
|
||||
* update `modulejs` to 1.13.0
|
||||
* update `prism` to 2015-12-19
|
||||
* update h5bp styles to 5.2.0
|
||||
* update `normalize.css` to 3.0.3
|
||||
* remove `Moment.js`
|
||||
|
||||
|
||||
## v0.27.0 - *2015-04-06*
|
||||
|
||||
* new layout
|
||||
* adds editorconfig
|
||||
* drops support for IE9 (gets fallback)
|
||||
* updates sidebar settings
|
||||
* adds info sidebar
|
||||
* adds opt-out for click'n'drag selection
|
||||
* adds package name option for single selections
|
||||
* adds initial support for Peer5
|
||||
* adds option to down-sample images for preview
|
||||
* adds option for natural sorting in tree sidebar
|
||||
* fixes problems with files/folders named `0`
|
||||
* changes font from `Ubuntu` to `Roboto` (smaller footprint, clearer for small sizes)
|
||||
* switches back to Google Fonts
|
||||
* improves PDF thumbnail quality
|
||||
* improves drag-select
|
||||
* improves image preview
|
||||
* prevents listing `_h5ai` folder and subfolders
|
||||
* updates build process, now uses [mkr](http://larsjung.de/mkr/) and [fQuery](http://larsjung.de/fquery/)
|
||||
* updates `jQuery` to 2.1.3
|
||||
* updates `jQuery.qrcode` to 0.11.0
|
||||
* updates `Lo-Dash` to 3.6.0
|
||||
* updates `Modernizr` to 2.8.3
|
||||
* updates `modulejs` to 1.4.0
|
||||
* updates `Moment.js` to 2.9.0
|
||||
* updates `Prism` to 2015-04-05
|
||||
* removes deprecated Google Analytics code
|
||||
* removes `jQuery.fracs`
|
||||
* removes `jQuery.scrollpanel`
|
||||
* removes `jQuery.mousewheel`
|
||||
* language updates and additions (`af`, `es`, `ja`, `ko`, `ru`, `zh-cn`)
|
||||
* add editorconfig
|
||||
* drop support for IE9 (gets fallback)
|
||||
* update sidebar settings
|
||||
* add info sidebar
|
||||
* add opt-out for click'n'drag selection
|
||||
* add package name option for single selections
|
||||
* add initial support for Peer5
|
||||
* add option to down-sample images for preview
|
||||
* add option for natural sorting in tree sidebar
|
||||
* fix problems with files/folders named `0`
|
||||
* change font from `Ubuntu` to `Roboto` (smaller footprint, clearer for small sizes)
|
||||
* switch back to Google Fonts
|
||||
* improve PDF thumbnail quality
|
||||
* improve drag-select
|
||||
* improve image preview
|
||||
* prevent listing `_h5ai` folder and subfolders
|
||||
* update build process, now uses [`mkr`](https://larsjung.de/mkr/) and [`fQuery`](https://larsjung.de/fquery/)
|
||||
* update `jQuery` to 2.1.3
|
||||
* update `jQuery.qrcode` to 0.11.0
|
||||
* update `Lo-Dash` to 3.6.0
|
||||
* update `Modernizr` to 2.8.3
|
||||
* update `modulejs` to 1.4.0
|
||||
* update `Moment.js` to 2.9.0
|
||||
* update `Prism` to 2015-04-05
|
||||
* remove deprecated Google Analytics code
|
||||
* remove `jQuery.fracs`
|
||||
* remove `jQuery.scrollpanel`
|
||||
* remove `jQuery.mousewheel`
|
||||
* update languages (`af`, `es`, `ja`, `ko`, `ru`, `zh-cn`)
|
||||
|
||||
|
||||
## v0.26.1 - *2014-08-17*
|
||||
|
||||
* fixes links
|
||||
* fix links
|
||||
|
||||
|
||||
## v0.26.0 - *2014-08-16*
|
||||
|
||||
* removes True Type fonts
|
||||
* outsources themes to [h5ai-themes](https://github.com/lrsjng/h5ai-themes)
|
||||
* adds filesize fallback for large files and 32bit PHP
|
||||
* fixes server detection
|
||||
* adds config file tests to info page
|
||||
* removes JSON shim
|
||||
* adds caching of command checks
|
||||
* updates `jQuery.mousewheel` to 3.1.12
|
||||
* updates `jQuery.qrcode` to 0.8.0
|
||||
* replaces `markdown` with [`marked`](https://github.com/chjj/marked) 0.3.2
|
||||
* updates `modulejs` to 0.4.5
|
||||
* updates `Moment.js` to 2.8.1
|
||||
* replaces `underscore` with [`Lo-Dash`](https://github.com/lodash/lodash) 2.4.1
|
||||
* replaces `SyntaxHighlighter` with [`Prism`](http://prismjs.com) 2014-08-04
|
||||
* remove True Type fonts
|
||||
* outsource themes to [h5ai-themes](https://github.com/lrsjng/h5ai-themes)
|
||||
* add filesize fallback for large files and 32bit PHP
|
||||
* fix server detection
|
||||
* add config file tests to info page
|
||||
* remove JSON shim
|
||||
* add caching of command checks
|
||||
* update `jQuery.mousewheel` to 3.1.12
|
||||
* update `jQuery.qrcode` to 0.8.0
|
||||
* replace `markdown` with [`marked`](https://github.com/chjj/marked) 0.3.2
|
||||
* update `modulejs` to 0.4.5
|
||||
* update `Moment.js` to 2.8.1
|
||||
* replace `underscore` with [`Lo-Dash`](https://github.com/lodash/lodash) 2.4.1
|
||||
* replace `SyntaxHighlighter` with [`Prism`](http://prismjs.com) 2014-08-04
|
||||
|
||||
|
||||
## v0.25.2 - *2014-07-01*
|
||||
|
||||
* adds optional info page protection
|
||||
* fixes `short_open_tag` issues for PHP < 5.4.0
|
||||
* fixes default folder download (`alwaysVisible` option)
|
||||
* add optional info page protection
|
||||
* fix `short_open_tag` issues for PHP < 5.4.0
|
||||
* fix default folder download (`alwaysVisible` option)
|
||||
* minor fixes
|
||||
|
||||
|
||||
## v0.25.1 - *2014-06-25*
|
||||
|
||||
* fixes broken paths for filenames containing '+' characters
|
||||
* fixes Google Universal Analytics
|
||||
* fixes file type check
|
||||
* fix broken paths for filenames containing '+' characters
|
||||
* fix Google Universal Analytics
|
||||
* fix file type check
|
||||
|
||||
|
||||
## v0.25.0 - *2014-06-22*
|
||||
|
||||
* adds sidebar
|
||||
* adds initial theme support
|
||||
* adds icons from [Evolvere Icon Theme](http://franksouza183.deviantart.com/art/Evolvere-Icon-theme-440718295)
|
||||
* adds PHP variant to calc folder sizes
|
||||
* adds scroll position reset on location change (issue [#279](https://github.com/lrsjng/h5ai/issues/279))
|
||||
* adds option to hide unreadable files
|
||||
* adds option where to place folders (top, inplace, bottom)
|
||||
* adds markdown support for custom header and footer files
|
||||
* adds video and audio preview via HTML5 elements (no fallback, works best in Chrome)
|
||||
* adds filter reset on location change
|
||||
* adds option to make download button always visible
|
||||
* adds Google UA support
|
||||
* extends selectable icon sizes (adds 128px, 192px, 256px, 384px)
|
||||
* improves preview GUI
|
||||
* add sidebar
|
||||
* add initial theme support
|
||||
* add icons from [Evolvere Icon Theme](http://franksouza183.deviantart.com/art/Evolvere-Icon-theme-440718295)
|
||||
* add PHP variant to calc folder sizes
|
||||
* add scroll position reset on location change (issue [#279](https://github.com/lrsjng/h5ai/issues/279))
|
||||
* add option to hide unreadable files
|
||||
* add option where to place folders (top, inplace, bottom)
|
||||
* add markdown support for custom header and footer files
|
||||
* add video and audio preview via HTML5 elements (no fallback, works best in Chrome)
|
||||
* add filter reset on location change
|
||||
* add option to make download button always visible
|
||||
* add Google UA support
|
||||
* extend selectable icon sizes (add 128px, 192px, 256px, 384px)
|
||||
* improve preview GUI
|
||||
* disable thumbs in `cache` folder
|
||||
* fixes QR code URI origin (issue [#287](https://github.com/lrsjng/h5ai/issues/287))
|
||||
* replaces PHP backtick operator with `exec`
|
||||
* removes server side file manipulation extensions `dropbox`, `delete` and `rename`
|
||||
* updates `H5BP` to 4.3.0
|
||||
* updates `jQuery` to 2.1.1
|
||||
* updates `json2.js` to 2014-02-04
|
||||
* updates `markdown-js` to 0.5.0
|
||||
* updates `Modernizr` to 2.8.2
|
||||
* updates `Moment.js` to 2.6.0
|
||||
* updates `Underscore.js` to 1.6.0
|
||||
* language updates (`bg`, `ko`, `pt`, `sl`, `sv`, `zh-cn`)
|
||||
* fix QR code URI origin (issue [#287](https://github.com/lrsjng/h5ai/issues/287))
|
||||
* replace PHP backtick operator with `exec`
|
||||
* remove server side file manipulation extensions `dropbox`, `delete` and `rename`
|
||||
* update `H5BP` to 4.3.0
|
||||
* update `jQuery` to 2.1.1
|
||||
* update `json2.js` to 2014-02-04
|
||||
* update `markdown-js` to 0.5.0
|
||||
* update `Modernizr` to 2.8.2
|
||||
* update `Moment.js` to 2.6.0
|
||||
* update `Underscore.js` to 1.6.0
|
||||
* update languages (`bg`, `ko`, `pt`, `sl`, `sv`, `zh-cn`)
|
||||
|
||||
|
||||
## v0.24.1 - *2014-04-09*
|
||||
|
||||
* security fixes! (issues [#268](https://github.com/lrsjng/h5ai/issues/268), [#269](https://github.com/lrsjng/h5ai/issues/269))
|
||||
* language updates (`fi`, `fr`, `hi`, `it`, `zh-tw`)
|
||||
* fixes WinOS command detection
|
||||
* fix WinOS command detection
|
||||
* update languages (`fi`, `fr`, `hi`, `it`, `zh-tw`)
|
||||
|
||||
|
||||
## v0.24.0 - *2013-09-04*
|
||||
@@ -202,9 +276,9 @@
|
||||
* changes language code `gr` to `el`
|
||||
* adds localization for filter placeholder
|
||||
* adds `hu` translation by [Rodolffo](https://github.com/Rodolffo)
|
||||
* updates to [jQuery.qrcode](http://larsjung.de/qrcode/) 0.2
|
||||
* updates to [jQuery.scrollpanel](http://larsjung.de/scrollpanel/) 0.1
|
||||
* updates to [modulejs](http://larsjung.de/modulejs/) 0.2
|
||||
* updates to [jQuery.qrcode](https://larsjung.de/qrcode/) 0.2
|
||||
* updates to [jQuery.scrollpanel](https://larsjung.de/scrollpanel/) 0.1
|
||||
* updates to [modulejs](https://larsjung.de/modulejs/) 0.2
|
||||
* updates to [Moment.js](http://momentjs.com) 1.7.0
|
||||
* updates to [Underscore.js](http://underscorejs.org) 1.3.3
|
||||
|
||||
|
45
README.md
@@ -3,34 +3,36 @@
|
||||
[![license][license-img]][github] [![web][web-img]][web] [![github][github-img]][github]
|
||||
|
||||
A modern HTTP web server index for Apache httpd, lighttpd, nginx and Cherokee.
|
||||
For bug reports and feature requests please use [issues][github-issues].
|
||||
|
||||
|
||||
## Install
|
||||
## Important
|
||||
|
||||
Do **not** install any files from the `src` folder, they need to be
|
||||
preprocessed to work correctly! Find a preprocessed package and detailed
|
||||
install instructions on the [project page][web].
|
||||
* Do **not** install any files from the `src` folder, they need to be
|
||||
preprocessed to work correctly!
|
||||
* Find a preprocessed package and detailed install instructions on the
|
||||
[project page][web].
|
||||
* For bug reports and feature requests please use [issues][github-issues].
|
||||
|
||||
|
||||
## Build
|
||||
|
||||
There are installation ready packages for the latest [releases][release] and
|
||||
[dev builds][develop]. But to clone and build **h5ai** yourself run the
|
||||
following commands to find a fresh zipball in folder `build` (tested on linux
|
||||
only, requires [`git`][git] and [`npm`][npm] to be installed).
|
||||
[dev builds][develop]. But to build **h5ai** yourself either `git clone` or
|
||||
download the repository. From within the root folder run the following
|
||||
commands to find a fresh zipball in folder `build` (tested on linux only,
|
||||
requires [`node 6.0+`][node] to be installed).
|
||||
|
||||
> git clone git://github.com/lrsjng/h5ai.git
|
||||
> cd h5ai
|
||||
> npm install
|
||||
> npm run build
|
||||
~~~sh
|
||||
> npm install
|
||||
> npm run build
|
||||
~~~
|
||||
|
||||
|
||||
## License
|
||||
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015 Lars Jung (http://larsjung.de)
|
||||
Copyright (c) 2019 Lars Jung (https://larsjung.de)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -54,18 +56,17 @@ THE SOFTWARE.
|
||||
## References
|
||||
|
||||
**h5ai** profits from other projects, all of them licensed under the MIT license
|
||||
too. Exceptions are the [Material Design icons][material-design-icons] (CC BY 4.0).
|
||||
too. Exceptions are some [Material Design icons][material-design-icons] (CC BY 4.0).
|
||||
|
||||
|
||||
[web]: http://larsjung.de/h5ai/
|
||||
[web]: https://larsjung.de/h5ai/
|
||||
[github]: https://github.com/lrsjng/h5ai
|
||||
[github-issues]: https://github.com/lrsjng/h5ai/issues
|
||||
[release]: http://release.larsjung.de/h5ai/
|
||||
[develop]: http://release.larsjung.de/h5ai/develop/
|
||||
[git]: http://git-scm.com
|
||||
[npm]: https://www.npmjs.org
|
||||
[release]: https://release.larsjung.de/h5ai/
|
||||
[develop]: https://release.larsjung.de/h5ai/develop/
|
||||
[node]: https://nodejs.org
|
||||
[material-design-icons]: https://github.com/google/material-design-icons
|
||||
|
||||
[license-img]: http://img.shields.io/badge/license-MIT-a0a060.svg?style=flat-square
|
||||
[web-img]: http://img.shields.io/badge/web-larsjung.de/h5ai-a0a060.svg?style=flat-square
|
||||
[github-img]: http://img.shields.io/badge/github-lrsjng/h5ai-a0a060.svg?style=flat-square
|
||||
[license-img]: https://img.shields.io/badge/license-MIT-a0a060.svg?style=flat-square
|
||||
[web-img]: https://img.shields.io/badge/web-larsjung.de/h5ai-a0a060.svg?style=flat-square
|
||||
[github-img]: https://img.shields.io/badge/github-lrsjng/h5ai-a0a060.svg?style=flat-square
|
||||
|
169
ghu.js
Normal file
@@ -0,0 +1,169 @@
|
||||
const {resolve, join} = require('path');
|
||||
const {
|
||||
ghu, autoprefixer, cssmin, each, ife, includeit, jszip, less, mapfn,
|
||||
newerThan, pug, read, remove, run, uglify, watch, webpack, wrap, write
|
||||
} = require('ghu');
|
||||
|
||||
const ROOT = resolve(__dirname);
|
||||
const SRC = join(ROOT, 'src');
|
||||
const TEST = join(ROOT, 'test');
|
||||
const BUILD = join(ROOT, 'build');
|
||||
|
||||
const mapper = mapfn.p(SRC, BUILD).s('.less', '.css').s('.pug', '');
|
||||
const webpackCfg = include => ({
|
||||
module: {
|
||||
loaders: [
|
||||
{
|
||||
include,
|
||||
loader: 'babel-loader',
|
||||
query: {
|
||||
cacheDirectory: true,
|
||||
presets: ['babel-preset-env']
|
||||
}
|
||||
},
|
||||
{
|
||||
test: /jsdom/,
|
||||
loader: 'null-loader'
|
||||
}
|
||||
]
|
||||
}
|
||||
});
|
||||
|
||||
ghu.defaults('release');
|
||||
|
||||
ghu.before(runtime => {
|
||||
runtime.pkg = Object.assign({}, require('./package.json'));
|
||||
|
||||
const res = run.sync(`git rev-list v${runtime.pkg.version}..HEAD`, {silent: true});
|
||||
if (res.code === 0) {
|
||||
const hashes = res.stdout.split(/\r?\n/).filter(x => x);
|
||||
if (hashes.length) {
|
||||
const counter = ('000' + hashes.length).substr(-3);
|
||||
const hash = hashes[0].substr(0, 7);
|
||||
runtime.pkg.version += `+${counter}~${hash}`;
|
||||
}
|
||||
}
|
||||
|
||||
runtime.comment = `${runtime.pkg.name} v${runtime.pkg.version} - ${runtime.pkg.homepage}`;
|
||||
runtime.commentJs = `/* ${runtime.comment} */\n`;
|
||||
runtime.commentHtml = `<!-- ${runtime.comment} -->`;
|
||||
|
||||
console.log(runtime.comment);
|
||||
});
|
||||
|
||||
ghu.task('force-production', 'ensure :production flag is set', runtime => {
|
||||
if (!runtime.args.production) {
|
||||
runtime.args.production = true;
|
||||
console.log('forcing production mode');
|
||||
}
|
||||
});
|
||||
|
||||
ghu.task('clean', 'delete build folder', () => {
|
||||
return remove(BUILD);
|
||||
});
|
||||
|
||||
ghu.task('lint', 'lint all JavaScript files with eslint', () => {
|
||||
return run('eslint .', {stdio: 'inherit'});
|
||||
});
|
||||
|
||||
ghu.task('build:scripts', runtime => {
|
||||
return read(`${SRC}/_h5ai/public/js/scripts.js`)
|
||||
.then(newerThan(mapper, `${SRC}/_h5ai/public/js/**`))
|
||||
.then(webpack(webpackCfg([SRC]), {showStats: false}))
|
||||
.then(wrap('\n\n// @include "pre.js"\n\n'))
|
||||
.then(includeit())
|
||||
.then(ife(() => runtime.args.production, uglify({compressor: {warnings: false}})))
|
||||
.then(wrap(runtime.commentJs))
|
||||
.then(write(mapper, {overwrite: true}));
|
||||
});
|
||||
|
||||
ghu.task('build:styles', runtime => {
|
||||
return read(`${SRC}/_h5ai/public/css/*.less`)
|
||||
.then(newerThan(mapper, `${SRC}/_h5ai/public/css/**`))
|
||||
.then(includeit())
|
||||
.then(less())
|
||||
.then(autoprefixer())
|
||||
.then(ife(() => runtime.args.production, cssmin()))
|
||||
.then(wrap(runtime.commentJs))
|
||||
.then(write(mapper, {overwrite: true}));
|
||||
});
|
||||
|
||||
ghu.task('build:pages', runtime => {
|
||||
return read(`${SRC}: **/*.pug, ! **/*.tpl.pug`)
|
||||
.then(newerThan(mapper, `${SRC}/**/*.tpl.pug`))
|
||||
.then(pug({pkg: runtime.pkg}))
|
||||
.then(wrap('', runtime.commentHtml))
|
||||
.then(write(mapper, {overwrite: true}));
|
||||
});
|
||||
|
||||
ghu.task('build:copy', runtime => {
|
||||
const mapperRoot = mapfn.p(ROOT, join(BUILD, '_h5ai'));
|
||||
|
||||
return Promise.all([
|
||||
read(`${SRC}/**/conf/*.json`)
|
||||
.then(newerThan(mapper))
|
||||
.then(wrap(runtime.commentJs))
|
||||
.then(write(mapper, {overwrite: true, cluster: true})),
|
||||
|
||||
read(`${SRC}: **, ! **/*.js, ! **/*.less, ! **/*.pug, ! **/conf/*.json`)
|
||||
.then(newerThan(mapper))
|
||||
.then(each(obj => {
|
||||
if ((/index\.php$/).test(obj.source)) {
|
||||
obj.content = obj.content.replace('{{VERSION}}', runtime.pkg.version);
|
||||
}
|
||||
}))
|
||||
.then(write(mapper, {overwrite: true, cluster: true})),
|
||||
|
||||
read(`${ROOT}/*.md`)
|
||||
.then(newerThan(mapperRoot))
|
||||
.then(write(mapperRoot, {overwrite: true, cluster: true}))
|
||||
]);
|
||||
});
|
||||
|
||||
ghu.task('build:tests', ['build:styles'], 'build the test suite', () => {
|
||||
return Promise.all([
|
||||
read(`${BUILD}/_h5ai/public/css/styles.css`)
|
||||
.then(newerThan(`${BUILD}/test/h5ai-styles.css`))
|
||||
.then(write(`${BUILD}/test/h5ai-styles.css`, {overwrite: true})),
|
||||
|
||||
read(`${TEST}/index.html`)
|
||||
.then(newerThan(`${BUILD}/test/index.html`))
|
||||
.then(write(`${BUILD}/test/index.html`, {overwrite: true})),
|
||||
|
||||
read(`${TEST}: index.js`)
|
||||
.then(webpack(webpackCfg([SRC, TEST]), {showStats: false}))
|
||||
.then(wrap(`\n\n// @include "${SRC}/**/js/pre.js"\n\n`))
|
||||
.then(includeit())
|
||||
.then(write(mapfn.p(TEST, `${BUILD}/test`), {overwrite: true}))
|
||||
]).then(() => {
|
||||
console.log(`browse to file://${BUILD}/test/index.html to run the test suite`);
|
||||
});
|
||||
});
|
||||
|
||||
ghu.task('build', ['build:scripts', 'build:styles', 'build:pages', 'build:copy', 'build:tests'],
|
||||
'build all updated files, optionally use :production');
|
||||
|
||||
ghu.task('deploy', ['build'], 'deploy to a specified path with :dest=/some/path', runtime => {
|
||||
if (typeof runtime.args.dest !== 'string') {
|
||||
throw new Error('no destination path (e.g. :dest=/some/path)');
|
||||
}
|
||||
console.log(`deploy to ${runtime.args.dest}`);
|
||||
|
||||
const mapperDeploy = mapfn.p(BUILD, resolve(runtime.args.dest));
|
||||
|
||||
return read(`${BUILD}/_h5ai/**`)
|
||||
.then(newerThan(mapperDeploy))
|
||||
.then(write(mapperDeploy, {overwrite: true, cluster: true}));
|
||||
});
|
||||
|
||||
ghu.task('watch', runtime => {
|
||||
return watch([SRC, TEST], () => ghu.run(runtime.sequence.filter(x => x !== 'watch'), runtime.args, true));
|
||||
});
|
||||
|
||||
ghu.task('release', ['force-production', 'clean', 'build'], 'create a zipball', runtime => {
|
||||
const target = join(BUILD, `${runtime.pkg.name}-${runtime.pkg.version}.zip`);
|
||||
|
||||
return read(`${BUILD}/_h5ai/**`)
|
||||
.then(jszip({dir: BUILD, level: 9}))
|
||||
.then(write(target, {overwrite: true}));
|
||||
});
|
208
mkrfile.js
@@ -1,208 +0,0 @@
|
||||
/*jshint node: true */
|
||||
'use strict';
|
||||
|
||||
|
||||
var path = require('path');
|
||||
var $ = require('fquery');
|
||||
|
||||
var pkg = require('./package.json');
|
||||
|
||||
var root = path.resolve(__dirname);
|
||||
var src = path.join(root, 'src');
|
||||
var build = path.join(root, 'build');
|
||||
|
||||
var mapSrc = $.map.p(src, build).s('.less', '.css').s('.jade', '');
|
||||
var mapRoot = $.map.p(root, path.join(build, '_h5ai'));
|
||||
|
||||
|
||||
function getBuildSuffix(callback) {
|
||||
|
||||
require('child_process').exec('git rev-list v' + pkg.version + '..HEAD', {cwd: root}, function (err, out) {
|
||||
|
||||
try {
|
||||
var lines = out.trim().split(/\r?\n/);
|
||||
callback('+' + ('000' + lines.length).substr(-3) + '~' + lines[0].substring(0, 7));
|
||||
} catch (e) {
|
||||
callback('+X');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
$.fn.autoprefixer = function (options) {
|
||||
|
||||
var autoprefixer = require('autoprefixer-core');
|
||||
var options = {browsers: ['last 2 versions']};
|
||||
|
||||
return this.edit(function (blob) {
|
||||
|
||||
try {
|
||||
blob.content = autoprefixer.process(blob.content, options).css;
|
||||
} catch (e) {
|
||||
$.report({
|
||||
type: 'err',
|
||||
method: 'autoprefixer',
|
||||
message: e.message,
|
||||
fquery: this,
|
||||
blob: blob,
|
||||
err: e
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
$.plugin('fquery-cssmin');
|
||||
$.plugin('fquery-handlebars');
|
||||
$.plugin('fquery-includeit');
|
||||
$.plugin('fquery-jade');
|
||||
$.plugin('fquery-jshint');
|
||||
$.plugin('fquery-jszip');
|
||||
$.plugin('fquery-less');
|
||||
$.plugin('fquery-uglifyjs');
|
||||
|
||||
|
||||
module.exports = function (suite) {
|
||||
|
||||
|
||||
suite.defaults('release');
|
||||
|
||||
|
||||
suite.target('check-version', [], 'add git info to dev builds').task(function (done) {
|
||||
|
||||
if (!pkg.develop) {
|
||||
done();
|
||||
return;
|
||||
}
|
||||
|
||||
getBuildSuffix(function (result) {
|
||||
|
||||
pkg.version += result;
|
||||
$.report({type: 'info', method: 'check-version', message: 'version set to ' + pkg.version});
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
suite.target('clean', [], 'delete build folder').task(function () {
|
||||
|
||||
$(build, {dirs: true}).delete();
|
||||
});
|
||||
|
||||
|
||||
suite.target('lint', [], 'lint all JavaScript files with JSHint').task(function () {
|
||||
|
||||
var jshint = {
|
||||
// Enforcing Options
|
||||
bitwise: true,
|
||||
curly: true,
|
||||
eqeqeq: true,
|
||||
forin: true,
|
||||
latedef: true,
|
||||
newcap: true,
|
||||
noempty: true,
|
||||
plusplus: true,
|
||||
trailing: true,
|
||||
undef: true,
|
||||
|
||||
// Environments
|
||||
browser: true
|
||||
};
|
||||
var globals = {
|
||||
modulejs: true
|
||||
};
|
||||
|
||||
$(src + '/_h5ai/client/js: **/*.js, ! lib/**')
|
||||
.jshint(jshint, globals);
|
||||
});
|
||||
|
||||
|
||||
suite.target('build', ['check-version', 'lint'], 'build all updated files').task(function () {
|
||||
|
||||
var header = '/* ' + pkg.name + ' ' + pkg.version + ' - ' + pkg.homepage + ' */\n';
|
||||
var env = {pkg: pkg};
|
||||
|
||||
$(src + ': _h5ai/client/js/*.js')
|
||||
.newerThan(mapSrc, $(src + ': _h5ai/client/js/**'))
|
||||
.includeit()
|
||||
.uglifyjs()
|
||||
.wrap(header)
|
||||
.write(mapSrc, true);
|
||||
|
||||
$(src + ': _h5ai/client/css/*.less')
|
||||
.newerThan(mapSrc, $(src + ': _h5ai/client/css/**'))
|
||||
.less()
|
||||
.autoprefixer()
|
||||
.cssmin()
|
||||
.wrap(header)
|
||||
.write(mapSrc, true);
|
||||
|
||||
$(src + ': _h5ai/client/css/fonts/**')
|
||||
.newerThan(mapSrc)
|
||||
.write(mapSrc, true);
|
||||
|
||||
$(src + ': **/*.jade')
|
||||
.newerThan(mapSrc)
|
||||
.jade(env)
|
||||
.write(mapSrc, true);
|
||||
|
||||
$(src + ': **, ! _h5ai/client/js/**, ! _h5ai/client/css/**, ! **/*.jade')
|
||||
.newerThan(mapSrc)
|
||||
.handlebars(env)
|
||||
.write(mapSrc, true);
|
||||
|
||||
$(root + ': *.md')
|
||||
.newerThan(mapRoot)
|
||||
.write(mapRoot, true);
|
||||
});
|
||||
|
||||
|
||||
suite.target('build-uncompressed', ['check-version', 'lint'], 'build all updated files').task(function () {
|
||||
|
||||
var header = '/* ' + pkg.name + ' ' + pkg.version + ' - ' + pkg.homepage + ' */\n';
|
||||
var env = {pkg: pkg};
|
||||
|
||||
$(src + ': _h5ai/client/js/*.js')
|
||||
.newerThan(mapSrc, $(src + ': _h5ai/client/js/**'))
|
||||
.includeit()
|
||||
// .uglifyjs()
|
||||
.wrap(header)
|
||||
.write(mapSrc, true);
|
||||
|
||||
$(src + ': _h5ai/client/css/*.less')
|
||||
.newerThan(mapSrc, $(src + ': _h5ai/client/css/**'))
|
||||
.less()
|
||||
.autoprefixer()
|
||||
// .cssmin()
|
||||
.wrap(header)
|
||||
.write(mapSrc, true);
|
||||
|
||||
$(src + ': _h5ai/client/css/fonts/**')
|
||||
.newerThan(mapSrc)
|
||||
.write(mapSrc, true);
|
||||
|
||||
$(src + ': **/*.jade')
|
||||
.newerThan(mapSrc)
|
||||
.jade(env)
|
||||
.write(mapSrc, true);
|
||||
|
||||
$(src + ': **, ! _h5ai/client/js/**, ! _h5ai/client/css/**, ! **/*.jade')
|
||||
.newerThan(mapSrc)
|
||||
.handlebars(env)
|
||||
.write(mapSrc, true);
|
||||
|
||||
$(root + ': *.md')
|
||||
.newerThan(mapRoot)
|
||||
.write(mapRoot, true);
|
||||
});
|
||||
|
||||
|
||||
suite.target('release', ['clean', 'build'], 'create a zipball').task(function () {
|
||||
|
||||
var target = path.join(build, pkg.name + '-' + pkg.version + '.zip');
|
||||
|
||||
$(build + ': **')
|
||||
.jszip({dir: build})
|
||||
.write(target, true);
|
||||
});
|
||||
};
|
6579
package-lock.json
generated
Normal file
37
package.json
@@ -1,31 +1,32 @@
|
||||
{
|
||||
"name": "h5ai",
|
||||
"version": "0.27.0",
|
||||
"develop": false,
|
||||
"description": "a modern HTTP web server index",
|
||||
"homepage": "http://larsjung.de/h5ai/",
|
||||
"version": "0.29.1",
|
||||
"description": "Modern HTTP web server index.",
|
||||
"homepage": "https://larsjung.de/h5ai/",
|
||||
"bugs": "https://github.com/lrsjng/h5ai/issues",
|
||||
"author": "Lars Jung <lrsjng@gmail.com> (http://larsjung.de)",
|
||||
"author": "Lars Jung <lrsjng@gmail.com> (https://larsjung.de)",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/lrsjng/h5ai.git"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "mkr release",
|
||||
"test": "mocha --recursive test"
|
||||
"build": "node ghu release"
|
||||
},
|
||||
"devDependencies": {
|
||||
"autoprefixer-core": "~5.1.8",
|
||||
"fquery": "~0.16.2",
|
||||
"fquery-cssmin": "~0.3.0",
|
||||
"fquery-handlebars": "~0.2.0",
|
||||
"fquery-includeit": "~0.2.0",
|
||||
"fquery-jade": "~0.3.0",
|
||||
"fquery-jshint": "~0.2.0",
|
||||
"fquery-jszip": "~0.4.0",
|
||||
"fquery-less": "~0.2.0",
|
||||
"fquery-uglifyjs": "~0.2.1",
|
||||
"mkr": "~0.6.1"
|
||||
"babel-loader": "6.2.4",
|
||||
"babel-preset-env": "1.7.0",
|
||||
"eslint": "5.14.1",
|
||||
"ghu": "0.12.0",
|
||||
"jsdom": "9.2.0",
|
||||
"kjua": "0.1.2",
|
||||
"lolight": "0.6.0",
|
||||
"marked": "0.6.1",
|
||||
"normalize.css": "8.0.1",
|
||||
"null-loader": "0.1.1",
|
||||
"scar": "1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10.0.0"
|
||||
}
|
||||
}
|
||||
|
4
src/.eslintrc
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
rules:
|
||||
no-console: 1
|
||||
prefer-reflect: 0
|
@@ -1,46 +1,165 @@
|
||||
## details here: https://github.com/h5bp/server-configs-apache
|
||||
|
||||
DirectoryIndex index.html
|
||||
|
||||
|
||||
## SECURITY ###################################################################
|
||||
|
||||
DirectoryIndex disabled
|
||||
FileETag None
|
||||
ServerSignature Off
|
||||
|
||||
# Apache < 2.3
|
||||
<IfModule !mod_authz_core.c>
|
||||
Order allow,deny
|
||||
Deny from all
|
||||
Satisfy All
|
||||
</IfModule>
|
||||
|
||||
# Apache ≥ 2.3
|
||||
<IfModule mod_authz_core.c>
|
||||
Require all denied
|
||||
</IfModule>
|
||||
|
||||
<IfModule mod_headers.c>
|
||||
Header set X-Content-Type-Options "nosniff"
|
||||
Header unset ETag
|
||||
Header unset X-Powered-By
|
||||
</IfModule>
|
||||
|
||||
<IfModule mod_autoindex.c>
|
||||
Options -Indexes
|
||||
</IfModule>
|
||||
|
||||
|
||||
|
||||
## COMPAT #####################################################################
|
||||
|
||||
AddDefaultCharset utf-8
|
||||
|
||||
|
||||
<IfModule mod_mime.c>
|
||||
AddCharset utf-8 .css .js .json .svg
|
||||
AddCharset utf-8 .css .html .js .json .php .svg
|
||||
|
||||
AddType application/font-woff woff
|
||||
AddType application/font-woff2 woff2
|
||||
AddType application/json json
|
||||
AddType application/javascript js
|
||||
AddType application/vnd.ms-fontobject eot
|
||||
AddType application/x-font-ttf ttc ttf
|
||||
AddType image/jpeg jpeg jpg
|
||||
AddType image/png png
|
||||
AddType image/svg+xml svg svgz
|
||||
AddType image/x-icon ico
|
||||
AddType font/opentype otf
|
||||
AddType text/css css
|
||||
AddType text/html html
|
||||
</IfModule>
|
||||
|
||||
|
||||
|
||||
## SPEED ######################################################################
|
||||
|
||||
<IfModule mod_expires.c>
|
||||
ExpiresActive on
|
||||
ExpiresDefault "access plus 1 month"
|
||||
|
||||
# CSS
|
||||
ExpiresByType text/css "access plus 1 week"
|
||||
|
||||
# Data interchange
|
||||
ExpiresByType application/json "access plus 0 seconds"
|
||||
ExpiresByType application/xml "access plus 0 seconds"
|
||||
ExpiresByType text/xml "access plus 0 seconds"
|
||||
|
||||
# Favicon (cannot be renamed!)
|
||||
ExpiresByType text/html "access plus 1 minute"
|
||||
|
||||
ExpiresByType image/x-icon "access plus 1 week"
|
||||
|
||||
# HTML
|
||||
ExpiresByType text/html "access plus 0 seconds"
|
||||
|
||||
# JavaScript
|
||||
ExpiresByType application/javascript "access plus 1 week"
|
||||
|
||||
# Media
|
||||
ExpiresByType image/jpeg "access plus 1 month"
|
||||
ExpiresByType image/png "access plus 1 month"
|
||||
|
||||
# Web fonts
|
||||
ExpiresByType application/font-woff "access plus 1 month"
|
||||
ExpiresByType image/svg+xml "access plus 1 month"
|
||||
ExpiresByType application/javascript "access plus 1 year"
|
||||
ExpiresByType image/jpeg "access plus 1 year"
|
||||
ExpiresByType image/png "access plus 1 year"
|
||||
ExpiresByType image/svg+xml "access plus 1 year"
|
||||
ExpiresByType text/css "access plus 1 year"
|
||||
</IfModule>
|
||||
|
||||
<IfModule mod_deflate.c>
|
||||
<IfModule mod_setenvif.c>
|
||||
<IfModule mod_headers.c>
|
||||
SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
|
||||
RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
|
||||
</IfModule>
|
||||
</IfModule>
|
||||
|
||||
# Apache ≥ 2.3
|
||||
<IfModule mod_authz_core.c>
|
||||
# mod_filter as module only available for Apache ≥ 2.3.7
|
||||
<IfModule mod_filter.c>
|
||||
AddOutputFilterByType DEFLATE "application/atom+xml" \
|
||||
"application/javascript" \
|
||||
"application/json" \
|
||||
"application/ld+json" \
|
||||
"application/manifest+json" \
|
||||
"application/rdf+xml" \
|
||||
"application/rss+xml" \
|
||||
"application/schema+json" \
|
||||
"application/vnd.geo+json" \
|
||||
"application/vnd.ms-fontobject" \
|
||||
"application/x-font-ttf" \
|
||||
"application/x-javascript" \
|
||||
"application/x-web-app-manifest+json" \
|
||||
"application/xhtml+xml" \
|
||||
"application/xml" \
|
||||
"font/eot" \
|
||||
"font/opentype" \
|
||||
"image/bmp" \
|
||||
"image/svg+xml" \
|
||||
"image/vnd.microsoft.icon" \
|
||||
"image/x-icon" \
|
||||
"text/cache-manifest" \
|
||||
"text/css" \
|
||||
"text/html" \
|
||||
"text/javascript" \
|
||||
"text/plain" \
|
||||
"text/vcard" \
|
||||
"text/vnd.rim.location.xloc" \
|
||||
"text/vtt" \
|
||||
"text/x-component" \
|
||||
"text/x-cross-domain-policy" \
|
||||
"text/xml"
|
||||
</IfModule>
|
||||
</IfModule>
|
||||
|
||||
# Apache < 2.3
|
||||
<IfModule !mod_authz_core.c>
|
||||
AddOutputFilterByType DEFLATE "application/atom+xml" \
|
||||
"application/javascript" \
|
||||
"application/json" \
|
||||
"application/ld+json" \
|
||||
"application/manifest+json" \
|
||||
"application/rdf+xml" \
|
||||
"application/rss+xml" \
|
||||
"application/schema+json" \
|
||||
"application/vnd.geo+json" \
|
||||
"application/vnd.ms-fontobject" \
|
||||
"application/x-font-ttf" \
|
||||
"application/x-javascript" \
|
||||
"application/x-web-app-manifest+json" \
|
||||
"application/xhtml+xml" \
|
||||
"application/xml" \
|
||||
"font/eot" \
|
||||
"font/opentype" \
|
||||
"image/bmp" \
|
||||
"image/svg+xml" \
|
||||
"image/vnd.microsoft.icon" \
|
||||
"image/x-icon" \
|
||||
"text/cache-manifest" \
|
||||
"text/css" \
|
||||
"text/html" \
|
||||
"text/javascript" \
|
||||
"text/plain" \
|
||||
"text/vcard" \
|
||||
"text/vnd.rim.location.xloc" \
|
||||
"text/vtt" \
|
||||
"text/x-component" \
|
||||
"text/x-cross-domain-policy" \
|
||||
"text/xml"
|
||||
</IfModule>
|
||||
|
||||
<IfModule mod_mime.c>
|
||||
AddEncoding gzip gz
|
||||
AddEncoding gzip svgz
|
||||
</IfModule>
|
||||
</IfModule>
|
||||
|
@@ -1,77 +0,0 @@
|
||||
|
||||
.cm-overlay {
|
||||
display: none;
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
overflow: hidden;
|
||||
z-index: 200;
|
||||
// background: rgba(0,0,0,0.1);
|
||||
// background: rgba(255,255,255,0.6);
|
||||
}
|
||||
|
||||
|
||||
.cm-panel {
|
||||
.popup();
|
||||
.rounded();
|
||||
display: block;
|
||||
position: absolute;
|
||||
left: 100px;
|
||||
top: 100px;
|
||||
background: #fff;
|
||||
color: @col;
|
||||
z-index: 10;
|
||||
overflow: auto;
|
||||
min-width: 200px;
|
||||
|
||||
ul {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
text-align: left;
|
||||
|
||||
.cm-label {
|
||||
padding: 8px 16px;
|
||||
white-space: nowrap;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.cm-entry {
|
||||
padding: 8px 16px;
|
||||
white-space: nowrap;
|
||||
cursor: pointer;
|
||||
|
||||
&:hover {
|
||||
color: @col-hover;
|
||||
background: @col-darkgray;
|
||||
}
|
||||
|
||||
.cm-icon {
|
||||
position: relative;
|
||||
top: -2px;
|
||||
|
||||
img {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
}
|
||||
|
||||
&.no-icon {
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.cm-text {
|
||||
margin: 0 0 0 12px;
|
||||
}
|
||||
}
|
||||
|
||||
.cm-sep {
|
||||
height: 1px;
|
||||
margin: 8px 0;
|
||||
padding: 0;
|
||||
border-top: 1px solid rgba(0,0,0,0.08);
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,8 +0,0 @@
|
||||
|
||||
#download {
|
||||
display: none;
|
||||
|
||||
&.failed {
|
||||
background-color: @col-error;
|
||||
}
|
||||
}
|
@@ -1,190 +0,0 @@
|
||||
@col-blue-200: #90caf9;
|
||||
@col-blue-400: #42a5f5;
|
||||
@col-blue-500: #2196F3;
|
||||
@col-blue-700: #1976D2;
|
||||
@col-blue-900: #0D47A1;
|
||||
@col-green: #4caf50;
|
||||
@col-red: #f44336;
|
||||
@col-pink-a200: #ff4081;
|
||||
|
||||
@col-light: #ffffff;
|
||||
@col-lightgray: #fafafa;
|
||||
// @col-darkgray: #eeeeee;
|
||||
@col-darkgray: #f3f3f3;
|
||||
// @col-dark: #333;
|
||||
@col-dark: #212121;
|
||||
|
||||
@col-text-primary-black: rgba(0,0,0,0.87);
|
||||
@col-text-secondary-black: rgba(0,0,0,0.54);
|
||||
@col-text-disabled-black: rgba(0,0,0,0.26);
|
||||
@col-divider-black: rgba(0,0,0,0.12);
|
||||
|
||||
@col-text-primary-white: rgba(255,255,255,1.0);
|
||||
@col-text-secondary-white: rgba(255,255,255,0.7);
|
||||
@col-text-disabled-white: rgba(255,255,255,0.3);
|
||||
@col-divider-white: rgba(255,255,255,0.12);
|
||||
|
||||
@col-text-selected: @col-text-primary-white;
|
||||
@col-back-selected: @col-blue-400;
|
||||
|
||||
@col-text-highlight: #111111;
|
||||
|
||||
@col-font-light: @col-light;
|
||||
@col-font-dark: @col-dark;
|
||||
|
||||
@col-back-light: @col-lightgray;
|
||||
@col-back-dark: @col-darkgray;
|
||||
|
||||
@col: @col-text-primary-black;
|
||||
@col-back: @col-back-dark;
|
||||
@col-hover: @col-blue-400;
|
||||
@col-border: rgba(0,0,0,0.05);
|
||||
@col-border-strong: rgba(0,0,0,0.15);
|
||||
@col-border-stronger: rgba(0,0,0,0.3);
|
||||
|
||||
@col-okay: @col-green;
|
||||
@col-error: @col-red;
|
||||
|
||||
@col-link: @col-blue-400;
|
||||
@col-link-hover: @col-blue-400;
|
||||
|
||||
@col-widget-back: rgb(245,245,245);
|
||||
@col-widget-back-highlight: rgba(255,255,255,0.8);
|
||||
@col-widget-back-hover: rgba(255,255,255,0.8);
|
||||
@col-widget-back-sel: rgba(255,255,255,0.8);
|
||||
@col-widget-sep: @col-border;
|
||||
|
||||
@col-sb-back: rgba(0,0,0,0.08);
|
||||
@col-sb-thumb: rgba(0,0,0,0.15);
|
||||
@col-sb-thumb-active: rgba(0,0,0,0.25);
|
||||
|
||||
@col-range-back: rgb(224,224,224);
|
||||
@col-range-thumb: #555;
|
||||
|
||||
@border-widget: 1px solid @col-border;
|
||||
@border-widget-sep: 1px solid @col-widget-sep;
|
||||
|
||||
@font-family: Roboto, Helvetica, Arial, sans-serif;
|
||||
@font-weight: normal;
|
||||
@font-size: 13px;
|
||||
@font-family-mono: monospace;
|
||||
|
||||
// @max-icon-size: 24px;
|
||||
@max-icon-size: 32px;
|
||||
// @max-icon-size: 48px;
|
||||
|
||||
|
||||
::-moz-selection { background: @col-pink-a200; color: @col-text-primary-white; text-shadow: none; }
|
||||
::selection { background: @col-pink-a200; color: @col-text-primary-white; text-shadow: none; }
|
||||
|
||||
.transition (@transition) {
|
||||
-webkit-transition: @transition;
|
||||
transition: @transition;
|
||||
}
|
||||
|
||||
.transform (@transform) {
|
||||
-webkit-transform: @transform;
|
||||
-ms-transform: @transform;
|
||||
transform: @transform;
|
||||
zoom: 1;
|
||||
}
|
||||
|
||||
.card() {
|
||||
box-shadow: 0 1px 1px 0 rgba(0,0,0,0.2);
|
||||
}
|
||||
|
||||
.raised() {
|
||||
box-shadow: 0 1px 10px 0 rgba(0,0,0,0.5);
|
||||
}
|
||||
|
||||
.popup() {
|
||||
box-shadow: 0 1px 20px 0 rgba(0,0,0,0.5);
|
||||
}
|
||||
|
||||
.rounded() {
|
||||
// overflow: hidden;
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
.el-button() {
|
||||
.card();
|
||||
.rounded();
|
||||
.transition(all 0.2s ease-in-out);
|
||||
color: @col-text-primary-white;
|
||||
background: @col-blue-400;
|
||||
border-radius: 2px;
|
||||
cursor: pointer;
|
||||
text-decoration: none;
|
||||
|
||||
&:hover {
|
||||
.raised();
|
||||
}
|
||||
}
|
||||
|
||||
.el-input() {
|
||||
.card();
|
||||
.rounded();
|
||||
-moz-appearance: none;
|
||||
-ms-appearance: none;
|
||||
-webkit-appearance: none;
|
||||
font-family: @font-family;
|
||||
font-weight: @font-weight;
|
||||
color: @col-text-primary-black;
|
||||
background: @col-light;
|
||||
border: none;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
|
||||
html {
|
||||
min-height: 100%;
|
||||
overflow: auto;
|
||||
|
||||
&.js .noJsMsg {
|
||||
display: none;
|
||||
}
|
||||
&.browser .noBrowserMsg {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
body {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
|
||||
font-family: @font-family;
|
||||
font-size: @font-size;
|
||||
font-weight: @font-weight;
|
||||
color: @col-text-primary-black;
|
||||
background: @col-back;
|
||||
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex-wrap: nowrap;
|
||||
justify-content: flex-start;
|
||||
align-content: flex-start;
|
||||
align-items: stretch;
|
||||
}
|
||||
|
||||
#main-row {
|
||||
flex: 1 1 auto;
|
||||
order: 50;
|
||||
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: nowrap;
|
||||
justify-content: flex-start;
|
||||
align-content: flex-start;
|
||||
align-items: stretch;
|
||||
|
||||
// non-webkit fix;
|
||||
height: 0;
|
||||
}
|
||||
|
||||
*:focus {
|
||||
// outline: 1px solid @col-pink-a200;
|
||||
outline: none;
|
||||
}
|
@@ -1,117 +0,0 @@
|
||||
|
||||
#pv-txt-text {
|
||||
max-width: 960px;
|
||||
text-align: left;
|
||||
background-color: #fff;
|
||||
margin: 0 auto;
|
||||
padding: 8px;
|
||||
overflow: auto;
|
||||
|
||||
box-shadow: 0 0 8px 2px rgba(0, 0, 0, 0.3);
|
||||
|
||||
&.highlighted {
|
||||
|
||||
code {
|
||||
font-family: @font-family-mono;
|
||||
font-size: @font-size;
|
||||
line-height: 1.2em;
|
||||
}
|
||||
|
||||
a, a:active, a:visited {
|
||||
color: #2080FF;
|
||||
text-decoration: none;
|
||||
cursor: pointer;
|
||||
|
||||
&:hover {
|
||||
color: #68A9FF;
|
||||
}
|
||||
}
|
||||
|
||||
.token.comment,
|
||||
.token.prolog,
|
||||
.token.doctype,
|
||||
.token.cdata {
|
||||
color: #aaa;
|
||||
}
|
||||
|
||||
.token.punctuation {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.namespace {
|
||||
opacity: .7;
|
||||
}
|
||||
|
||||
.token.property,
|
||||
.token.tag,
|
||||
.token.boolean,
|
||||
.token.number,
|
||||
.token.constant,
|
||||
.token.symbol {
|
||||
color: #905;
|
||||
}
|
||||
|
||||
.token.selector,
|
||||
.token.attr-name,
|
||||
.token.string,
|
||||
.token.builtin {
|
||||
color: #690;
|
||||
}
|
||||
|
||||
.token.operator,
|
||||
.token.entity,
|
||||
.token.url,
|
||||
.language-css .token.string,
|
||||
.style .token.string,
|
||||
.token.variable {
|
||||
color: #a67f59;
|
||||
background: hsla(0,0%,100%,.5);
|
||||
}
|
||||
|
||||
.token.atrule,
|
||||
.token.attr-value,
|
||||
.token.keyword {
|
||||
color: #07a;
|
||||
}
|
||||
|
||||
.token.function {
|
||||
color: #DD4A68;
|
||||
}
|
||||
|
||||
.token.regex,
|
||||
.token.important {
|
||||
color: #e90;
|
||||
}
|
||||
|
||||
.token.important {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.token.entity {
|
||||
cursor: help;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
&.markdown {
|
||||
font-size: 1.1em;
|
||||
padding: 8px 24px;
|
||||
|
||||
a, a:active, a:visited {
|
||||
color: #2080FF;
|
||||
text-decoration: none;
|
||||
cursor: pointer;
|
||||
|
||||
&:hover {
|
||||
color: #68A9FF;
|
||||
}
|
||||
}
|
||||
|
||||
pre, code {
|
||||
font-family: @font-family-mono;
|
||||
}
|
||||
code {
|
||||
color: #008200;
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,31 +0,0 @@
|
||||
|
||||
@media only screen and (max-width: 700px) {
|
||||
#crumbbar {
|
||||
.crumb:not(.active) {
|
||||
display: none;
|
||||
}
|
||||
.crumb.active .sep {
|
||||
width: 0;
|
||||
}
|
||||
}
|
||||
#view.view-details {
|
||||
.header .label, .item .label {
|
||||
margin-right: 80px !important;
|
||||
}
|
||||
.header .date, .item .date {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
#tree, #info {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
@media print {
|
||||
a[href]:after {
|
||||
content: "" !important;
|
||||
}
|
||||
#toolbar, #download, #sidebar, #tree, #info {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
@@ -1,127 +0,0 @@
|
||||
|
||||
#topbar {
|
||||
overflow: hidden;
|
||||
flex: 0 0 auto;
|
||||
order: 1;
|
||||
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: nowrap;
|
||||
justify-content: flex-start;
|
||||
align-content: flex-start;
|
||||
align-items: stretch;
|
||||
|
||||
background: @col-lightgray;
|
||||
box-shadow: 0 0 8px 0 rgba(0,0,0,0.2);
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
|
||||
#backlink {
|
||||
overflow: hidden;
|
||||
flex: 0 0 auto;
|
||||
order: 99;
|
||||
text-align: center;
|
||||
padding: 6px 12px;
|
||||
max-width: 80px;
|
||||
overflow: hidden;
|
||||
height: 36px;
|
||||
.transition(all 0.2s ease-in-out);
|
||||
|
||||
&, &:active, &:visited {
|
||||
color: @col-text-disabled-black;
|
||||
cursor: pointer;
|
||||
text-decoration: none;
|
||||
}
|
||||
&:hover {
|
||||
color: @col-hover;
|
||||
background: rgba(0,0,0,0.03);
|
||||
}
|
||||
&:focus {
|
||||
outline: 0;
|
||||
}
|
||||
|
||||
div {
|
||||
line-height: 18px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#toolbar {
|
||||
overflow: hidden;
|
||||
flex: 0 0 auto;
|
||||
order: 1;
|
||||
height: 48px;
|
||||
|
||||
.tool {
|
||||
display: inline-block;
|
||||
cursor: pointer;
|
||||
|
||||
img {
|
||||
display: inline-block;
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
padding: 12px;
|
||||
.transition(all 0.2s ease-in-out);
|
||||
}
|
||||
|
||||
&:hover img {
|
||||
background: rgba(0,0,0,0.03);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#crumbbar {
|
||||
overflow: hidden;
|
||||
flex: 1 1 auto;
|
||||
order: 2;
|
||||
height: 48px;
|
||||
font-size: 16px;
|
||||
padding: 0 8px;
|
||||
// border-left: 1px solid rgba(0,0,0,0.05);
|
||||
|
||||
a, a:active, a:visited {
|
||||
color: @col;
|
||||
cursor: pointer;
|
||||
text-decoration: none;
|
||||
|
||||
&.active {
|
||||
font-weight: bold;
|
||||
color: @col-text-highlight;
|
||||
}
|
||||
&:hover {
|
||||
color: @col-hover;
|
||||
}
|
||||
&:focus {
|
||||
outline: 0;
|
||||
}
|
||||
}
|
||||
.crumb {
|
||||
display: inline-block;
|
||||
.transition(all 0.2s ease-in-out);
|
||||
}
|
||||
.sep {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
padding: 12px 0;
|
||||
line-height: 48px;
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
}
|
||||
.label {
|
||||
line-height: 48px;
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
padding: 0 8px;
|
||||
}
|
||||
.hint {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
padding: 16px 4px 16px 0;
|
||||
line-height: 48px;
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
}
|
||||
}
|
@@ -1,149 +0,0 @@
|
||||
|
||||
|
||||
html.drag-select, html.drag-select * {
|
||||
cursor: move !important;
|
||||
|
||||
-webkit-touch-callout: none;
|
||||
-webkit-user-select: none;
|
||||
-khtml-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
|
||||
#selection-rect {
|
||||
display: none;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
z-index: 2;
|
||||
border: 1px dashed @col-border-strong;
|
||||
background: rgba(0,0,0,0.1);
|
||||
}
|
||||
|
||||
|
||||
#view {
|
||||
display: none;
|
||||
|
||||
a, a:active, a:visited {
|
||||
display: block;
|
||||
color: inherit;
|
||||
cursor: pointer;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
ul {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.header {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.item {
|
||||
position: relative;
|
||||
white-space: nowrap;
|
||||
background: #fff;
|
||||
|
||||
&:hover {
|
||||
color: @col-hover;
|
||||
background: @col-lightgray;
|
||||
border-color: @col-border;
|
||||
|
||||
.selector {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
&.selected:not(.selecting), &.selecting:not(.selected) {
|
||||
color: @col-text-selected;
|
||||
background: @col-back-selected;
|
||||
|
||||
&:hover {
|
||||
color: @col-text-selected;
|
||||
background: @col-back-selected;
|
||||
}
|
||||
|
||||
.selector {
|
||||
display: block;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.folder-parent {
|
||||
|
||||
.date, .size {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.icon {
|
||||
display: none;
|
||||
text-align: center;
|
||||
|
||||
img {
|
||||
max-width: @max-icon-size;
|
||||
max-height: @max-icon-size;
|
||||
position: relative;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
|
||||
.thumb {
|
||||
max-width: none;
|
||||
max-height: none;
|
||||
}
|
||||
}
|
||||
|
||||
.label {
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
text-align: left;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.date {
|
||||
text-align: right;
|
||||
width: 130px;
|
||||
}
|
||||
|
||||
.size {
|
||||
text-align: right;
|
||||
width: 80px;
|
||||
}
|
||||
|
||||
.selector {
|
||||
display: none;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
background: @col-back-selected;
|
||||
cursor: pointer;
|
||||
border-radius: 0 0 2px 0;
|
||||
opacity: 0.6;
|
||||
|
||||
&:hover {
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.empty, .no-match {
|
||||
display: none;
|
||||
margin-top: 36px;
|
||||
text-align: center;
|
||||
color: @col-border;
|
||||
font-size: 5em;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
@@ -1,172 +0,0 @@
|
||||
/* ==========================================================================
|
||||
Helper classes
|
||||
========================================================================== */
|
||||
|
||||
/*
|
||||
* Image replacement
|
||||
*/
|
||||
|
||||
.ir {
|
||||
background-color: transparent;
|
||||
border: 0;
|
||||
overflow: hidden;
|
||||
/* IE 6/7 fallback */
|
||||
*text-indent: -9999px;
|
||||
}
|
||||
|
||||
.ir:before {
|
||||
content: "";
|
||||
display: block;
|
||||
width: 0;
|
||||
height: 150%;
|
||||
}
|
||||
|
||||
/*
|
||||
* Hide from both screenreaders and browsers: h5bp.com/u
|
||||
*/
|
||||
|
||||
.hidden {
|
||||
display: none !important;
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
/*
|
||||
* Hide only visually, but have it available for screenreaders: h5bp.com/v
|
||||
*/
|
||||
|
||||
.visuallyhidden {
|
||||
border: 0;
|
||||
clip: rect(0 0 0 0);
|
||||
height: 1px;
|
||||
margin: -1px;
|
||||
overflow: hidden;
|
||||
padding: 0;
|
||||
position: absolute;
|
||||
width: 1px;
|
||||
}
|
||||
|
||||
/*
|
||||
* Extends the .visuallyhidden class to allow the element to be focusable
|
||||
* when navigated to via the keyboard: h5bp.com/p
|
||||
*/
|
||||
|
||||
.visuallyhidden.focusable:active,
|
||||
.visuallyhidden.focusable:focus {
|
||||
clip: auto;
|
||||
height: auto;
|
||||
margin: 0;
|
||||
overflow: visible;
|
||||
position: static;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
/*
|
||||
* Hide visually and from screenreaders, but maintain layout
|
||||
*/
|
||||
|
||||
.invisible {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
/*
|
||||
* Clearfix: contain floats
|
||||
*
|
||||
* For modern browsers
|
||||
* 1. The space content is one way to avoid an Opera bug when the
|
||||
* `contenteditable` attribute is included anywhere else in the document.
|
||||
* Otherwise it causes space to appear at the top and bottom of elements
|
||||
* that receive the `clearfix` class.
|
||||
* 2. The use of `table` rather than `block` is only necessary if using
|
||||
* `:before` to contain the top-margins of child elements.
|
||||
*/
|
||||
|
||||
.clearfix:before,
|
||||
.clearfix:after {
|
||||
content: " "; /* 1 */
|
||||
display: table; /* 2 */
|
||||
}
|
||||
|
||||
.clearfix:after {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
/*
|
||||
* For IE 6/7 only
|
||||
* Include this rule to trigger hasLayout and contain floats.
|
||||
*/
|
||||
|
||||
.clearfix {
|
||||
*zoom: 1;
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Print styles.
|
||||
Inlined to avoid required HTTP connection: h5bp.com/r
|
||||
========================================================================== */
|
||||
|
||||
@media print {
|
||||
* {
|
||||
background: transparent !important;
|
||||
color: #000 !important; /* Black prints faster: h5bp.com/s */
|
||||
box-shadow: none !important;
|
||||
text-shadow: none !important;
|
||||
}
|
||||
|
||||
a,
|
||||
a:visited {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
a[href]:after {
|
||||
content: " (" attr(href) ")";
|
||||
}
|
||||
|
||||
abbr[title]:after {
|
||||
content: " (" attr(title) ")";
|
||||
}
|
||||
|
||||
/*
|
||||
* Don't show links for images, or javascript/internal links
|
||||
*/
|
||||
|
||||
.ir a:after,
|
||||
a[href^="javascript:"]:after,
|
||||
a[href^="#"]:after {
|
||||
content: "";
|
||||
}
|
||||
|
||||
pre,
|
||||
blockquote {
|
||||
border: 1px solid #999;
|
||||
page-break-inside: avoid;
|
||||
}
|
||||
|
||||
thead {
|
||||
display: table-header-group; /* h5bp.com/t */
|
||||
}
|
||||
|
||||
tr,
|
||||
img {
|
||||
page-break-inside: avoid;
|
||||
}
|
||||
|
||||
img {
|
||||
max-width: 100% !important;
|
||||
}
|
||||
|
||||
@page {
|
||||
margin: 0.5cm;
|
||||
}
|
||||
|
||||
p,
|
||||
h2,
|
||||
h3 {
|
||||
orphans: 3;
|
||||
widows: 3;
|
||||
}
|
||||
|
||||
h2,
|
||||
h3 {
|
||||
page-break-after: avoid;
|
||||
}
|
||||
}
|
@@ -1,87 +0,0 @@
|
||||
/*! HTML5 Boilerplate v4.3.0 | MIT License | http://h5bp.com/ */
|
||||
|
||||
/*
|
||||
* What follows is the result of much research on cross-browser styling.
|
||||
* Credit left inline and big thanks to Nicolas Gallagher, Jonathan Neal,
|
||||
* Kroc Camen, and the H5BP dev community and team.
|
||||
*/
|
||||
|
||||
/* ==========================================================================
|
||||
Base styles: opinionated defaults
|
||||
========================================================================== */
|
||||
|
||||
html,
|
||||
button,
|
||||
input,
|
||||
select,
|
||||
textarea {
|
||||
color: #222;
|
||||
}
|
||||
|
||||
body {
|
||||
font-size: 1em;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
/*
|
||||
* Remove text-shadow in selection highlight: h5bp.com/i
|
||||
* These selection rule sets have to be separate.
|
||||
* Customize the background color to match your design.
|
||||
*/
|
||||
|
||||
::-moz-selection {
|
||||
background: #b3d4fc;
|
||||
text-shadow: none;
|
||||
}
|
||||
|
||||
::selection {
|
||||
background: #b3d4fc;
|
||||
text-shadow: none;
|
||||
}
|
||||
|
||||
/*
|
||||
* A better looking default horizontal rule
|
||||
*/
|
||||
|
||||
hr {
|
||||
display: block;
|
||||
height: 1px;
|
||||
border: 0;
|
||||
border-top: 1px solid #ccc;
|
||||
margin: 1em 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Remove the gap between images, videos, audio and canvas and the bottom of
|
||||
* their containers: h5bp.com/i/440
|
||||
*/
|
||||
|
||||
audio,
|
||||
canvas,
|
||||
img,
|
||||
video {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
/*
|
||||
* Remove default fieldset styles.
|
||||
*/
|
||||
|
||||
fieldset {
|
||||
border: 0;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Allow only vertical resizing of textareas.
|
||||
*/
|
||||
|
||||
textarea {
|
||||
resize: vertical;
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Author's custom styles
|
||||
========================================================================== */
|
@@ -1,527 +0,0 @@
|
||||
/*! normalize.css v1.1.3 | MIT License | git.io/normalize */
|
||||
|
||||
/* ==========================================================================
|
||||
HTML5 display definitions
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Correct `block` display not defined in IE 6/7/8/9 and Firefox 3.
|
||||
*/
|
||||
|
||||
article,
|
||||
aside,
|
||||
details,
|
||||
figcaption,
|
||||
figure,
|
||||
footer,
|
||||
header,
|
||||
hgroup,
|
||||
main,
|
||||
nav,
|
||||
section,
|
||||
summary {
|
||||
display: block;
|
||||
}
|
||||
|
||||
/**
|
||||
* Correct `inline-block` display not defined in IE 6/7/8/9 and Firefox 3.
|
||||
*/
|
||||
|
||||
audio,
|
||||
canvas,
|
||||
video {
|
||||
display: inline-block;
|
||||
*display: inline;
|
||||
*zoom: 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prevent modern browsers from displaying `audio` without controls.
|
||||
* Remove excess height in iOS 5 devices.
|
||||
*/
|
||||
|
||||
audio:not([controls]) {
|
||||
display: none;
|
||||
height: 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Address styling not present in IE 7/8/9, Firefox 3, and Safari 4.
|
||||
* Known issue: no IE 6 support.
|
||||
*/
|
||||
|
||||
[hidden] {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Base
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* 1. Correct text resizing oddly in IE 6/7 when body `font-size` is set using
|
||||
* `em` units.
|
||||
* 2. Prevent iOS text size adjust after orientation change, without disabling
|
||||
* user zoom.
|
||||
*/
|
||||
|
||||
html {
|
||||
font-size: 100%; /* 1 */
|
||||
-ms-text-size-adjust: 100%; /* 2 */
|
||||
-webkit-text-size-adjust: 100%; /* 2 */
|
||||
}
|
||||
|
||||
/**
|
||||
* Address `font-family` inconsistency between `textarea` and other form
|
||||
* elements.
|
||||
*/
|
||||
|
||||
html,
|
||||
button,
|
||||
input,
|
||||
select,
|
||||
textarea {
|
||||
font-family: sans-serif;
|
||||
}
|
||||
|
||||
/**
|
||||
* Address margins handled incorrectly in IE 6/7.
|
||||
*/
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Links
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Address `outline` inconsistency between Chrome and other browsers.
|
||||
*/
|
||||
|
||||
a:focus {
|
||||
outline: thin dotted;
|
||||
}
|
||||
|
||||
/**
|
||||
* Improve readability when focused and also mouse hovered in all browsers.
|
||||
*/
|
||||
|
||||
a:active,
|
||||
a:hover {
|
||||
outline: 0;
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Typography
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Address font sizes and margins set differently in IE 6/7.
|
||||
* Address font sizes within `section` and `article` in Firefox 4+, Safari 5,
|
||||
* and Chrome.
|
||||
*/
|
||||
|
||||
h1 {
|
||||
font-size: 2em;
|
||||
margin: 0.67em 0;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: 1.5em;
|
||||
margin: 0.83em 0;
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-size: 1.17em;
|
||||
margin: 1em 0;
|
||||
}
|
||||
|
||||
h4 {
|
||||
font-size: 1em;
|
||||
margin: 1.33em 0;
|
||||
}
|
||||
|
||||
h5 {
|
||||
font-size: 0.83em;
|
||||
margin: 1.67em 0;
|
||||
}
|
||||
|
||||
h6 {
|
||||
font-size: 0.67em;
|
||||
margin: 2.33em 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Address styling not present in IE 7/8/9, Safari 5, and Chrome.
|
||||
*/
|
||||
|
||||
abbr[title] {
|
||||
border-bottom: 1px dotted;
|
||||
}
|
||||
|
||||
/**
|
||||
* Address style set to `bolder` in Firefox 3+, Safari 4/5, and Chrome.
|
||||
*/
|
||||
|
||||
b,
|
||||
strong {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
blockquote {
|
||||
margin: 1em 40px;
|
||||
}
|
||||
|
||||
/**
|
||||
* Address styling not present in Safari 5 and Chrome.
|
||||
*/
|
||||
|
||||
dfn {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
/**
|
||||
* Address differences between Firefox and other browsers.
|
||||
* Known issue: no IE 6/7 normalization.
|
||||
*/
|
||||
|
||||
hr {
|
||||
-moz-box-sizing: content-box;
|
||||
box-sizing: content-box;
|
||||
height: 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Address styling not present in IE 6/7/8/9.
|
||||
*/
|
||||
|
||||
mark {
|
||||
background: #ff0;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
/**
|
||||
* Address margins set differently in IE 6/7.
|
||||
*/
|
||||
|
||||
p,
|
||||
pre {
|
||||
margin: 1em 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Correct font family set oddly in IE 6, Safari 4/5, and Chrome.
|
||||
*/
|
||||
|
||||
code,
|
||||
kbd,
|
||||
pre,
|
||||
samp {
|
||||
font-family: monospace, serif;
|
||||
_font-family: 'courier new', monospace;
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
/**
|
||||
* Improve readability of pre-formatted text in all browsers.
|
||||
*/
|
||||
|
||||
pre {
|
||||
white-space: pre;
|
||||
white-space: pre-wrap;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
/**
|
||||
* Address CSS quotes not supported in IE 6/7.
|
||||
*/
|
||||
|
||||
q {
|
||||
quotes: none;
|
||||
}
|
||||
|
||||
/**
|
||||
* Address `quotes` property not supported in Safari 4.
|
||||
*/
|
||||
|
||||
q:before,
|
||||
q:after {
|
||||
content: '';
|
||||
content: none;
|
||||
}
|
||||
|
||||
/**
|
||||
* Address inconsistent and variable font size in all browsers.
|
||||
*/
|
||||
|
||||
small {
|
||||
font-size: 80%;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prevent `sub` and `sup` affecting `line-height` in all browsers.
|
||||
*/
|
||||
|
||||
sub,
|
||||
sup {
|
||||
font-size: 75%;
|
||||
line-height: 0;
|
||||
position: relative;
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
sup {
|
||||
top: -0.5em;
|
||||
}
|
||||
|
||||
sub {
|
||||
bottom: -0.25em;
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Lists
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Address margins set differently in IE 6/7.
|
||||
*/
|
||||
|
||||
dl,
|
||||
menu,
|
||||
ol,
|
||||
ul {
|
||||
margin: 1em 0;
|
||||
}
|
||||
|
||||
dd {
|
||||
margin: 0 0 0 40px;
|
||||
}
|
||||
|
||||
/**
|
||||
* Address paddings set differently in IE 6/7.
|
||||
*/
|
||||
|
||||
menu,
|
||||
ol,
|
||||
ul {
|
||||
padding: 0 0 0 40px;
|
||||
}
|
||||
|
||||
/**
|
||||
* Correct list images handled incorrectly in IE 7.
|
||||
*/
|
||||
|
||||
nav ul,
|
||||
nav ol {
|
||||
list-style: none;
|
||||
list-style-image: none;
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Embedded content
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* 1. Remove border when inside `a` element in IE 6/7/8/9 and Firefox 3.
|
||||
* 2. Improve image quality when scaled in IE 7.
|
||||
*/
|
||||
|
||||
img {
|
||||
border: 0; /* 1 */
|
||||
-ms-interpolation-mode: bicubic; /* 2 */
|
||||
}
|
||||
|
||||
/**
|
||||
* Correct overflow displayed oddly in IE 9.
|
||||
*/
|
||||
|
||||
svg:not(:root) {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Figures
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Address margin not present in IE 6/7/8/9, Safari 5, and Opera 11.
|
||||
*/
|
||||
|
||||
figure {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Forms
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Correct margin displayed oddly in IE 6/7.
|
||||
*/
|
||||
|
||||
form {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Define consistent border, margin, and padding.
|
||||
*/
|
||||
|
||||
fieldset {
|
||||
border: 1px solid #c0c0c0;
|
||||
margin: 0 2px;
|
||||
padding: 0.35em 0.625em 0.75em;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Correct color not being inherited in IE 6/7/8/9.
|
||||
* 2. Correct text not wrapping in Firefox 3.
|
||||
* 3. Correct alignment displayed oddly in IE 6/7.
|
||||
*/
|
||||
|
||||
legend {
|
||||
border: 0; /* 1 */
|
||||
padding: 0;
|
||||
white-space: normal; /* 2 */
|
||||
*margin-left: -7px; /* 3 */
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Correct font size not being inherited in all browsers.
|
||||
* 2. Address margins set differently in IE 6/7, Firefox 3+, Safari 5,
|
||||
* and Chrome.
|
||||
* 3. Improve appearance and consistency in all browsers.
|
||||
*/
|
||||
|
||||
button,
|
||||
input,
|
||||
select,
|
||||
textarea {
|
||||
font-size: 100%; /* 1 */
|
||||
margin: 0; /* 2 */
|
||||
vertical-align: baseline; /* 3 */
|
||||
*vertical-align: middle; /* 3 */
|
||||
}
|
||||
|
||||
/**
|
||||
* Address Firefox 3+ setting `line-height` on `input` using `!important` in
|
||||
* the UA stylesheet.
|
||||
*/
|
||||
|
||||
button,
|
||||
input {
|
||||
line-height: normal;
|
||||
}
|
||||
|
||||
/**
|
||||
* Address inconsistent `text-transform` inheritance for `button` and `select`.
|
||||
* All other form control elements do not inherit `text-transform` values.
|
||||
* Correct `button` style inheritance in Chrome, Safari 5+, and IE 6+.
|
||||
* Correct `select` style inheritance in Firefox 4+ and Opera.
|
||||
*/
|
||||
|
||||
button,
|
||||
select {
|
||||
text-transform: none;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`
|
||||
* and `video` controls.
|
||||
* 2. Correct inability to style clickable `input` types in iOS.
|
||||
* 3. Improve usability and consistency of cursor style between image-type
|
||||
* `input` and others.
|
||||
* 4. Remove inner spacing in IE 7 without affecting normal text inputs.
|
||||
* Known issue: inner spacing remains in IE 6.
|
||||
*/
|
||||
|
||||
button,
|
||||
html input[type="button"], /* 1 */
|
||||
input[type="reset"],
|
||||
input[type="submit"] {
|
||||
-webkit-appearance: button; /* 2 */
|
||||
cursor: pointer; /* 3 */
|
||||
*overflow: visible; /* 4 */
|
||||
}
|
||||
|
||||
/**
|
||||
* Re-set default cursor for disabled elements.
|
||||
*/
|
||||
|
||||
button[disabled],
|
||||
html input[disabled] {
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Address box sizing set to content-box in IE 8/9.
|
||||
* 2. Remove excess padding in IE 8/9.
|
||||
* 3. Remove excess padding in IE 7.
|
||||
* Known issue: excess padding remains in IE 6.
|
||||
*/
|
||||
|
||||
input[type="checkbox"],
|
||||
input[type="radio"] {
|
||||
box-sizing: border-box; /* 1 */
|
||||
padding: 0; /* 2 */
|
||||
*height: 13px; /* 3 */
|
||||
*width: 13px; /* 3 */
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Address `appearance` set to `searchfield` in Safari 5 and Chrome.
|
||||
* 2. Address `box-sizing` set to `border-box` in Safari 5 and Chrome
|
||||
* (include `-moz` to future-proof).
|
||||
*/
|
||||
|
||||
input[type="search"] {
|
||||
-webkit-appearance: textfield; /* 1 */
|
||||
-moz-box-sizing: content-box;
|
||||
-webkit-box-sizing: content-box; /* 2 */
|
||||
box-sizing: content-box;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove inner padding and search cancel button in Safari 5 and Chrome
|
||||
* on OS X.
|
||||
*/
|
||||
|
||||
input[type="search"]::-webkit-search-cancel-button,
|
||||
input[type="search"]::-webkit-search-decoration {
|
||||
-webkit-appearance: none;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove inner padding and border in Firefox 3+.
|
||||
*/
|
||||
|
||||
button::-moz-focus-inner,
|
||||
input::-moz-focus-inner {
|
||||
border: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Remove default vertical scrollbar in IE 6/7/8/9.
|
||||
* 2. Improve readability and alignment in all browsers.
|
||||
*/
|
||||
|
||||
textarea {
|
||||
overflow: auto; /* 1 */
|
||||
vertical-align: top; /* 2 */
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Tables
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Remove most spacing between table cells.
|
||||
*/
|
||||
|
||||
table {
|
||||
border-collapse: collapse;
|
||||
border-spacing: 0;
|
||||
}
|
@@ -1,33 +0,0 @@
|
||||
|
||||
@import "lib/h5bp-normalize";
|
||||
@import "lib/h5bp-main-header";
|
||||
|
||||
@import "inc/general";
|
||||
@import "inc/topbar";
|
||||
@import "inc/sidebar";
|
||||
@import "inc/download";
|
||||
@import "inc/filter";
|
||||
@import "inc/tree";
|
||||
@import "inc/info";
|
||||
@import "inc/preview";
|
||||
@import "inc/preview-aud";
|
||||
@import "inc/preview-img";
|
||||
@import "inc/preview-txt";
|
||||
@import "inc/preview-vid";
|
||||
@import "inc/notify";
|
||||
|
||||
@import "inc/content";
|
||||
@import "inc/view";
|
||||
@import "inc/view-details";
|
||||
@import "inc/view-icons";
|
||||
@import "inc/view-grid";
|
||||
@import "inc/contextmenu";
|
||||
@import "inc/fallback";
|
||||
|
||||
@import "inc/responsive";
|
||||
|
||||
@import "inc/h5ai-info";
|
||||
|
||||
@import "lib/h5bp-main-footer";
|
||||
|
||||
@import url(//fonts.googleapis.com/css?family=Roboto:300,400,700);
|
Before Width: | Height: | Size: 281 B |
Before Width: | Height: | Size: 428 B |
Before Width: | Height: | Size: 268 B |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 5.3 KiB |
@@ -1,3 +0,0 @@
|
||||
<svg xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" height="24" width="24" viewBox="0 0 24 24" version="1.1">
|
||||
<path d="M5 3C3.9 3 3 3.9 3 5L3 19C3 20.1 3.9 21 5 21L19 21C20.1 21 21 20.1 21 19L21 5C21 3.9 20.1 3 19 3L5 3zM10 5L14 5 14 11 10 11 10 5z" fill="#555"/>
|
||||
</svg>
|
Before Width: | Height: | Size: 299 B |
@@ -1,3 +0,0 @@
|
||||
<svg xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" height="24" width="24" viewBox="0 0 24 24" version="1.1">
|
||||
<path d="M6 2C4.9 2 4 2.9 4 4L4 20C4 21.1 4.9 22 6 22L18 22C19.1 22 20 21.1 20 20L20 4C20 2.9 19.1 2 18 2L6 2zM13.1 7.1C15.4 7.6 17 9.6 17 12 17 14.4 15.4 16.4 13.1 16.9L13.1 15.7C14.7 15.2 15.9 13.8 15.9 12 15.9 10.2 14.7 8.8 13.1 8.3L13.1 7.1zM12 7.6L12 16.4 9.2 13.7 7 13.7 7 10.3 9.2 10.3 12 7.6zM13.1 9.8C13.9 10.2 14.5 11 14.5 12 14.5 13 13.9 13.8 13.1 14.2L13.1 9.8z" fill="#555"/>
|
||||
</svg>
|
Before Width: | Height: | Size: 534 B |
@@ -1,3 +0,0 @@
|
||||
<svg xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" height="24" width="24" viewBox="0 0 24 24" version="1.1">
|
||||
<path d="M5 3C3.9 3 3 3.9 3 5L3 19C3 20.1 3.9 21 5 21L19 21C20.1 21 21 20.1 21 19L21 5C21 3.9 20.1 3 19 3L5 3zM10.8 6L13.2 6C13.4 6 13.5 6.1 13.5 6.3L13.8 7.8C14.1 8 14.4 8.2 14.7 8.4L16.2 7.8C16.4 7.8 16.5 7.8 16.6 8L17.8 10C17.9 10.2 17.8 10.3 17.7 10.4L16.5 11.4C16.5 11.6 16.5 11.8 16.5 12 16.5 12.2 16.5 12.4 16.5 12.6L17.7 13.6C17.8 13.7 17.9 13.8 17.8 14L16.6 16C16.5 16.2 16.4 16.3 16.2 16.2L14.7 15.6C14.4 15.8 14.1 16 13.8 16.2L13.5 17.8C13.5 17.9 13.4 18 13.2 18L10.8 18C10.6 18 10.5 17.9 10.5 17.8L10.3 16.2C9.9 16 9.6 15.8 9.3 15.6L7.8 16.2C7.6 16.2 7.5 16.2 7.4 16L6.2 14C6.1 13.8 6.2 13.7 6.3 13.6L7.6 12.6C7.5 12.4 7.5 12.2 7.5 12 7.5 11.8 7.5 11.6 7.6 11.4L6.3 10.4C6.2 10.3 6.1 10.2 6.2 10L7.4 8C7.5 7.8 7.6 7.7 7.8 7.8L9.3 8.4C9.6 8.2 9.9 8 10.3 7.8L10.5 6.3C10.5 6.1 10.6 6 10.8 6zM12 9.9C10.8 9.9 9.9 10.8 9.9 12 9.9 13.2 10.8 14.1 12 14.1 13.2 14.1 14.1 13.2 14.1 12 14.1 10.8 13.2 9.9 12 9.9z" fill="#555"/>
|
||||
</svg>
|
Before Width: | Height: | Size: 1.1 KiB |
@@ -1,3 +0,0 @@
|
||||
<svg xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" height="24" width="24" viewBox="0 0 24 24" version="1.1">
|
||||
<path d="m14 2-8 0c-1.1 0-2 0.9-2 2L4 20c0 1.1 0.9 2 2 2L18 22c1.1 0 2-0.9 2-2L20 8zm-1 7 0-5.5 5.5 5.5z" fill="#555"/>
|
||||
</svg>
|
Before Width: | Height: | Size: 265 B |
@@ -1,3 +0,0 @@
|
||||
<svg xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" height="24" width="24" viewBox="0 0 24 24" version="1.1">
|
||||
<path d="M4 4C2.9 4 2 4.9 2 6L2 18C2 19.1 2.9 20 4 20L20 20C21.1 20 22 19.1 22 18L22 8C22 6.9 21.1 6 20 6L12 6 10 4 4 4zM19 9L19 17 11 17C11 12.6 14.6 9 19 9z" fill="#555"/>
|
||||
</svg>
|
Before Width: | Height: | Size: 319 B |
@@ -1,3 +0,0 @@
|
||||
<svg xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" version="1.1">
|
||||
<path d="m10 4-6 6 6 6 1.4-1.4L7.8 11 15 11c1.6 0 3 1.3 3 3 0 1.7-1.4 3-3 3l0 2c2.6 0 5-2.2 5-5 0-2.8-2.4-5-5-5l-7.2 0 3.6-3.6z" fill="#555"/>
|
||||
</svg>
|
Before Width: | Height: | Size: 288 B |
@@ -1,3 +0,0 @@
|
||||
<svg xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" height="24" width="24" viewBox="0 0 24 24" version="1.1">
|
||||
<path d="M4 4C2.9 4 2 4.9 2 6l0 2 0 1 0 9c0 1.1 0.9 2 2 2l16 0c1.1 0 2-0.9 2-2L22 8C22 6.9 21.1 6 20 6L12 6 10 4z" fill="#555"/>
|
||||
</svg>
|
Before Width: | Height: | Size: 274 B |
@@ -1,3 +0,0 @@
|
||||
<svg xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" height="24" width="24" viewBox="0 0 24 24" version="1.1">
|
||||
<path d="M4 4C2.9 4 2 4.9 2 6l0 12c0 1.1 0.9 2 2 2l16 0c1.1 0 2-0.9 2-2L22 6C22 4.9 21.1 4 20 4zm5 6 4 5 3-2 3 4-14 0z" fill="#555"/>
|
||||
</svg>
|
Before Width: | Height: | Size: 279 B |
@@ -1,3 +0,0 @@
|
||||
<svg xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" height="24" width="24" viewBox="0 0 24 24" version="1.1">
|
||||
<path d="M14 2H6c-1.1 0-2 0.9-2 2L4 20c0 1.1 0.9 2 2 2H18c1.1 0 2-0.9 2-2V8l-6-6zM16 18H8v-2h8v2zm0-4H8v-2h8v2zM13 9v-5.5l5.5 5.5H13z" fill="#555"/>
|
||||
</svg>
|
Before Width: | Height: | Size: 294 B |
@@ -1,3 +0,0 @@
|
||||
<svg xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" height="24" width="24" viewBox="0 0 24 24" version="1.1">
|
||||
<path d="M4 4C2.9 4 2 4.9 2 6l0 12c0 1.1 0.9 2 2 2l16 0c1.1 0 2-0.9 2-2L22 6C22 4.9 21.1 4 20 4zM4 7 6 7 6 9 4 9zm14 0 2 0 0 2-2 0zm-14 4 2 0 0 2-2 0zm14 0 2 0 0 2-2 0zm-14 4 2 0 0 2-2 0zm14 0 2 0 0 2-2 0z" fill="#555"/>
|
||||
</svg>
|
Before Width: | Height: | Size: 366 B |
@@ -1,3 +0,0 @@
|
||||
<svg xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" height="24" width="24" viewBox="0 0 24 24" version="1.1">
|
||||
<path d="m14 2-8 0c-1.1 0-2 0.9-2 2L4 20c0 1.1 0.9 2 2 2L18 22c1.1 0 2-0.9 2-2L20 8zm-1 7 0-5.5 5.5 5.5z" fill="#555"/>
|
||||
</svg>
|
Before Width: | Height: | Size: 265 B |
@@ -1,46 +0,0 @@
|
||||
modulejs.define('core/event', ['_'], function (_) {
|
||||
|
||||
var slice = Array.prototype.slice;
|
||||
var subscriptions = {};
|
||||
|
||||
|
||||
function sub(topic, callback) {
|
||||
|
||||
if (_.isString(topic) && _.isFunction(callback)) {
|
||||
|
||||
if (!subscriptions[topic]) {
|
||||
subscriptions[topic] = [];
|
||||
}
|
||||
subscriptions[topic].push(callback);
|
||||
}
|
||||
}
|
||||
|
||||
function unsub(topic, callback) {
|
||||
|
||||
if (_.isString(topic) && _.isFunction(callback) && subscriptions[topic]) {
|
||||
|
||||
subscriptions[topic] = _.without(subscriptions[topic], callback);
|
||||
}
|
||||
}
|
||||
|
||||
function pub(topic, data) {
|
||||
|
||||
var args = slice.call(arguments, 1);
|
||||
|
||||
// console.log('EVENT PUB', topic, args);
|
||||
if (_.isString(topic) && subscriptions[topic]) {
|
||||
|
||||
_.each(subscriptions[topic], function (callback) {
|
||||
|
||||
callback.apply(topic, args);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return {
|
||||
sub: sub,
|
||||
unsub: unsub,
|
||||
pub: pub
|
||||
};
|
||||
});
|
@@ -1,57 +0,0 @@
|
||||
modulejs.define('core/format', ['_', 'moment'], function (_, moment) {
|
||||
|
||||
var decimalMetric = {
|
||||
t: 1000.0,
|
||||
k: 1000.0,
|
||||
u: ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']
|
||||
};
|
||||
var binaryMetric = {
|
||||
t: 1024.0,
|
||||
k: 1024.0,
|
||||
u: ['B', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB']
|
||||
};
|
||||
var defaultMetric = decimalMetric;
|
||||
var defaultDateFormat = 'YYYY-MM-DD HH:mm';
|
||||
|
||||
|
||||
function setDefaultMetric(useBinaryMetric) {
|
||||
|
||||
defaultMetric = useBinaryMetric ? binaryMetric : decimalMetric;
|
||||
}
|
||||
|
||||
function formatSize(size, metric) {
|
||||
|
||||
metric = metric || defaultMetric;
|
||||
|
||||
if (!_.isNumber(size) || size < 0) {
|
||||
return '';
|
||||
}
|
||||
|
||||
var i = 0;
|
||||
var maxI = metric.u.length - 1;
|
||||
|
||||
while (size >= metric.t && i < maxI) {
|
||||
size /= metric.k;
|
||||
i += 1;
|
||||
}
|
||||
return (i <= 1 ? Math.round(size) : size.toFixed(1)).toString() + ' ' + metric.u[i];
|
||||
}
|
||||
|
||||
function setDefaultDateFormat(dateFormat) {
|
||||
|
||||
defaultDateFormat = dateFormat;
|
||||
}
|
||||
|
||||
function formatDate(millis) {
|
||||
|
||||
return _.isNumber(millis) && millis ? moment(millis).format(defaultDateFormat) : '';
|
||||
}
|
||||
|
||||
|
||||
return {
|
||||
setDefaultMetric: setDefaultMetric,
|
||||
formatSize: formatSize,
|
||||
setDefaultDateFormat: setDefaultDateFormat,
|
||||
formatDate: formatDate
|
||||
};
|
||||
});
|
@@ -1,4 +0,0 @@
|
||||
modulejs.define('core/langs', ['config', '_'], function (config, _) {
|
||||
|
||||
return _.extend({}, config.langs);
|
||||
});
|
@@ -1,204 +0,0 @@
|
||||
modulejs.define('core/location', ['_', 'modernizr', 'core/settings', 'core/event', 'core/notify'], function (_, modernizr, allsettings, event, notify) {
|
||||
|
||||
var settings = _.extend({
|
||||
smartBrowsing: true,
|
||||
unmanagedInNewWindow: true
|
||||
}, allsettings.view);
|
||||
var doc = document;
|
||||
var history = settings.smartBrowsing && modernizr.history ? window.history : null;
|
||||
var reUriToPathname = /^.*:\/\/[^\/]*|[^\/]*$/g;
|
||||
var absHref = null;
|
||||
|
||||
|
||||
function forceEncoding(href) {
|
||||
|
||||
return href
|
||||
.replace(/\/+/g, '/')
|
||||
|
||||
.replace(/ /g, '%20')
|
||||
.replace(/!/g, '%21')
|
||||
.replace(/#/g, '%23')
|
||||
.replace(/\$/g, '%24')
|
||||
.replace(/&/g, '%26')
|
||||
.replace(/'/g, '%27')
|
||||
.replace(/\(/g, '%28')
|
||||
.replace(/\)/g, '%29')
|
||||
.replace(/\*/g, '%2A')
|
||||
.replace(/\+/g, '%2B')
|
||||
.replace(/\,/g, '%2C')
|
||||
// .replace(/\//g, '%2F')
|
||||
.replace(/:/g, '%3A')
|
||||
.replace(/;/g, '%3B')
|
||||
.replace(/=/g, '%3D')
|
||||
.replace(/\?/g, '%3F')
|
||||
.replace(/@/g, '%40')
|
||||
.replace(/\[/g, '%5B')
|
||||
.replace(/\]/g, '%5D');
|
||||
}
|
||||
|
||||
function uriToPathname(uri) {
|
||||
|
||||
return uri.replace(reUriToPathname, '');
|
||||
}
|
||||
|
||||
var hrefsAreDecoded = (function () {
|
||||
|
||||
var testpathname = '/a b';
|
||||
var a = doc.createElement('a');
|
||||
|
||||
a.href = testpathname;
|
||||
return uriToPathname(a.href) === testpathname;
|
||||
}());
|
||||
|
||||
function encodedHref(href) {
|
||||
|
||||
var a = doc.createElement('a');
|
||||
var location;
|
||||
|
||||
a.href = href;
|
||||
location = uriToPathname(a.href);
|
||||
|
||||
if (hrefsAreDecoded) {
|
||||
location = encodeURIComponent(location).replace(/%2F/ig, '/');
|
||||
}
|
||||
|
||||
return forceEncoding(location);
|
||||
}
|
||||
|
||||
function getDomain() {
|
||||
|
||||
return doc.domain;
|
||||
}
|
||||
|
||||
function getAbsHref() {
|
||||
|
||||
return absHref;
|
||||
}
|
||||
|
||||
function getItem() {
|
||||
|
||||
return modulejs.require('model/item').get(absHref);
|
||||
}
|
||||
|
||||
function load(callback) {
|
||||
|
||||
modulejs.require('core/server').request({action: 'get', items: true, itemsHref: absHref, itemsWhat: 1}, function (json) {
|
||||
|
||||
var Item = modulejs.require('model/item');
|
||||
var item = Item.get(absHref);
|
||||
|
||||
if (json) {
|
||||
|
||||
var found = {};
|
||||
|
||||
_.each(json.items, function (jsonItem) {
|
||||
|
||||
var e = Item.get(jsonItem.absHref, jsonItem.time, jsonItem.size, jsonItem.is_managed, jsonItem.content, jsonItem.md5, jsonItem.sha1);
|
||||
found[e.absHref] = true;
|
||||
});
|
||||
|
||||
_.each(item.content, function (e) {
|
||||
|
||||
if (!found[e.absHref]) {
|
||||
Item.remove(e.absHref);
|
||||
}
|
||||
});
|
||||
}
|
||||
if (_.isFunction(callback)) {
|
||||
callback(item);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function setLocation(newAbsHref, keepBrowserUrl) {
|
||||
|
||||
event.pub('location.beforeChange');
|
||||
|
||||
newAbsHref = encodedHref(newAbsHref);
|
||||
|
||||
if (absHref !== newAbsHref) {
|
||||
absHref = newAbsHref;
|
||||
|
||||
if (history) {
|
||||
if (keepBrowserUrl) {
|
||||
history.replaceState({absHref: absHref}, '', absHref);
|
||||
} else {
|
||||
history.pushState({absHref: absHref}, '', absHref);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var item = getItem();
|
||||
if (item.isLoaded) {
|
||||
event.pub('location.changed', item);
|
||||
refresh();
|
||||
} else {
|
||||
notify.set('loading...');
|
||||
load(function () {
|
||||
item.isLoaded = true;
|
||||
notify.set();
|
||||
event.pub('location.changed', item);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function refresh() {
|
||||
|
||||
var item = getItem();
|
||||
var oldItems = _.values(item.content);
|
||||
|
||||
event.pub('location.beforeRefresh');
|
||||
|
||||
load(function () {
|
||||
|
||||
var newItems = _.values(item.content);
|
||||
var added = _.difference(newItems, oldItems);
|
||||
var removed = _.difference(oldItems, newItems);
|
||||
|
||||
event.pub('location.refreshed', item, added, removed);
|
||||
});
|
||||
}
|
||||
|
||||
function setLink($el, item) {
|
||||
|
||||
$el.attr('href', item.absHref);
|
||||
|
||||
if (history && item.isFolder() && item.isManaged) {
|
||||
$el.on('click', function () {
|
||||
|
||||
setLocation(item.absHref);
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
if (settings.unmanagedInNewWindow && !item.isManaged) {
|
||||
$el.attr('target', '_blank');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (history) {
|
||||
window.onpopstate = function (e) {
|
||||
|
||||
if (e.state && e.state.absHref) {
|
||||
setLocation(e.state.absHref, true);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
event.sub('ready', function () {
|
||||
|
||||
setLocation(document.location.href, true);
|
||||
});
|
||||
|
||||
|
||||
return {
|
||||
forceEncoding: forceEncoding,
|
||||
getDomain: getDomain,
|
||||
getAbsHref: getAbsHref,
|
||||
getItem: getItem,
|
||||
setLocation: setLocation,
|
||||
refresh: refresh,
|
||||
setLink: setLink
|
||||
};
|
||||
});
|
@@ -1,19 +0,0 @@
|
||||
modulejs.define('core/notify', ['$'], function ($) {
|
||||
|
||||
var template = '<div id="notify"/>';
|
||||
|
||||
function set(content) {
|
||||
|
||||
if (content) {
|
||||
$('#notify').stop(true, true).html(content).fadeIn(400);
|
||||
} else {
|
||||
$('#notify').stop(true, true).fadeOut(400);
|
||||
}
|
||||
}
|
||||
|
||||
$(template).hide().appendTo('body');
|
||||
|
||||
return {
|
||||
set: set
|
||||
};
|
||||
});
|
@@ -1,40 +0,0 @@
|
||||
modulejs.define('core/resource', ['_', 'config', 'core/settings'], function (_, config, settings) {
|
||||
|
||||
var imagesHref = settings.appHref + 'client/images/';
|
||||
var uiHref = imagesHref + 'ui/';
|
||||
var themesHref = imagesHref + 'themes/';
|
||||
var defaultThemeHref = themesHref + 'default/';
|
||||
var defaultIcons = ['file', 'folder', 'folder-page', 'folder-parent', 'ar', 'aud', 'bin', 'img', 'txt', 'vid', 'x'];
|
||||
|
||||
|
||||
function image(id) {
|
||||
|
||||
return uiHref + id + '.svg';
|
||||
}
|
||||
|
||||
function icon(id) {
|
||||
|
||||
var baseId = id.split('-')[0];
|
||||
var href = config.theme[id] || config.theme[baseId];
|
||||
|
||||
if (href) {
|
||||
return themesHref + href;
|
||||
}
|
||||
|
||||
if (_.indexOf(defaultIcons, id) >= 0) {
|
||||
return defaultThemeHref + id + '.svg';
|
||||
}
|
||||
|
||||
if (_.indexOf(defaultIcons, baseId) >= 0) {
|
||||
return defaultThemeHref + baseId + '.svg';
|
||||
}
|
||||
|
||||
return defaultThemeHref + 'file.svg';
|
||||
}
|
||||
|
||||
|
||||
return {
|
||||
image: image,
|
||||
icon: icon
|
||||
};
|
||||
});
|
@@ -1,55 +0,0 @@
|
||||
modulejs.define('core/server', ['$', '_', 'config', 'core/location'], function ($, _, config, location) {
|
||||
|
||||
var hasApi = config.setup.API === true;
|
||||
|
||||
|
||||
function request(data, callback) {
|
||||
|
||||
if (hasApi) {
|
||||
$.ajax({
|
||||
url: location.getAbsHref(),
|
||||
data: data,
|
||||
type: 'POST',
|
||||
dataType: 'json'
|
||||
})
|
||||
.done(function (json) {
|
||||
|
||||
callback(json);
|
||||
})
|
||||
.fail(function () {
|
||||
|
||||
callback();
|
||||
});
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
}
|
||||
|
||||
function formRequest(data) {
|
||||
|
||||
if (hasApi) {
|
||||
var $form = $('<form method="post" style="display:none;"/>')
|
||||
.attr('action', location.getAbsHref());
|
||||
|
||||
_.each(data, function (val, key) {
|
||||
|
||||
$('<input type="hidden"/>')
|
||||
.attr('name', key)
|
||||
.attr('value', val)
|
||||
.appendTo($form);
|
||||
});
|
||||
|
||||
$form.appendTo('body').submit().remove();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return {
|
||||
backend: config.setup.BACKEND,
|
||||
api: hasApi,
|
||||
name: config.setup.SERVER_NAME,
|
||||
version: config.setup.SERVER_VERSION,
|
||||
request: request,
|
||||
formRequest: formRequest
|
||||
};
|
||||
});
|
@@ -1,8 +0,0 @@
|
||||
modulejs.define('core/settings', ['config', '_'], function (config, _) {
|
||||
|
||||
return _.extend({}, config.options, {
|
||||
appHref: config.setup.APP_HREF,
|
||||
rootHref: config.setup.ROOT_HREF,
|
||||
currentHref: config.setup.CURRENT_HREF
|
||||
});
|
||||
});
|
@@ -1,41 +0,0 @@
|
||||
modulejs.define('core/store', ['modernizr'], function (modernizr) {
|
||||
|
||||
var store = modernizr.localstorage ? window.localStorage : null;
|
||||
var key = '_h5ai';
|
||||
|
||||
|
||||
function load() {
|
||||
|
||||
if (store) {
|
||||
try {
|
||||
return JSON.parse(store[key]);
|
||||
} catch (e) {}
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
function save(obj) {
|
||||
|
||||
if (store) {
|
||||
store[key] = JSON.stringify(obj);
|
||||
}
|
||||
}
|
||||
|
||||
function put(key, value) {
|
||||
|
||||
var obj = load();
|
||||
obj[key] = value;
|
||||
return save(obj);
|
||||
}
|
||||
|
||||
function get(key) {
|
||||
|
||||
return load()[key];
|
||||
}
|
||||
|
||||
|
||||
return {
|
||||
put: put,
|
||||
get: get
|
||||
};
|
||||
});
|
@@ -1,48 +0,0 @@
|
||||
modulejs.define('core/types', ['config', '_'], function (config, _) {
|
||||
|
||||
var reEndsWithSlash = /\/$/;
|
||||
var regexps = {};
|
||||
|
||||
|
||||
function escapeRegExp(sequence) {
|
||||
|
||||
return sequence.replace(/[\-\[\]\/\{\}\(\)\+\?\.\\\^\$]/g, "\\$&");
|
||||
// return sequence.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
|
||||
}
|
||||
|
||||
function parse(types) {
|
||||
|
||||
_.each(types, function (patterns, type) {
|
||||
|
||||
var pattern = '^(' + _.map(patterns, function (p) { return '(' + escapeRegExp(p).replace(/\*/g, '.*') + ')'; }).join('|') + ')$';
|
||||
regexps[type] = new RegExp(pattern, 'i');
|
||||
});
|
||||
}
|
||||
|
||||
function getType(sequence) {
|
||||
|
||||
if (reEndsWithSlash.test(sequence)) {
|
||||
return 'folder';
|
||||
}
|
||||
|
||||
var slashidx = sequence.lastIndexOf('/');
|
||||
var name = slashidx >= 0 ? sequence.substr(slashidx + 1) : sequence;
|
||||
|
||||
for (var type in regexps) {
|
||||
if (regexps.hasOwnProperty(type)) {
|
||||
if (regexps[type].test(name)) {
|
||||
return type;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 'file';
|
||||
}
|
||||
|
||||
|
||||
parse(_.extend({}, config.types));
|
||||
|
||||
return {
|
||||
getType: getType
|
||||
};
|
||||
});
|
@@ -1,71 +0,0 @@
|
||||
modulejs.define('core/util', [], function () {
|
||||
|
||||
|
||||
function regularCmpFn(val1, val2) {
|
||||
|
||||
if (val1 < val2) {
|
||||
return -1;
|
||||
}
|
||||
if (val1 > val2) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Natural Sort algorithm for Javascript - Version 0.7 - Released under MIT license
|
||||
// Author: Jim Palmer (based on chunking idea from Dave Koelle)
|
||||
//
|
||||
// Modified to make it work with h5ai
|
||||
function naturalCmpFn(val1, val2) {
|
||||
|
||||
var re = /(^-?[0-9]+(\.?[0-9]*)[df]?e?[0-9]?$|^0x[0-9a-f]+$|[0-9]+)/gi;
|
||||
var sre = /(^[ ]*|[ ]*$)/g;
|
||||
var dre = /(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/;
|
||||
var hre = /^0x[0-9a-f]+$/i;
|
||||
var ore = /^0/;
|
||||
// convert all to strings strip whitespace
|
||||
var x = ('' + val1).replace(sre, '');
|
||||
var y = ('' + val2).replace(sre, '');
|
||||
// chunk/tokenize
|
||||
var xN = x.replace(re, '\0$1\0').replace(/\0$/,'').replace(/^\0/,'').split('\0');
|
||||
var yN = y.replace(re, '\0$1\0').replace(/\0$/,'').replace(/^\0/,'').split('\0');
|
||||
// numeric, hex or date detection
|
||||
var xD = parseInt(x.match(hre), 10) || (xN.length !== 1 && x.match(dre) && Date.parse(x));
|
||||
var yD = parseInt(y.match(hre), 10) || xD && y.match(dre) && Date.parse(y) || null;
|
||||
var oFxNcL, oFyNcL;
|
||||
// first try and sort Hex codes or Dates
|
||||
if (yD) {
|
||||
if (xD < yD) {
|
||||
return -1;
|
||||
} else if (xD > yD) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
// natural sorting through split numeric strings and default strings
|
||||
for(var cLoc=0, numS=Math.max(xN.length, yN.length); cLoc < numS; cLoc += 1) {
|
||||
// find floats not starting with '0', string or 0 if not defined (Clint Priest)
|
||||
oFxNcL = !(xN[cLoc] || '').match(ore) && parseFloat(xN[cLoc]) || xN[cLoc] || 0;
|
||||
oFyNcL = !(yN[cLoc] || '').match(ore) && parseFloat(yN[cLoc]) || yN[cLoc] || 0;
|
||||
// handle numeric vs string comparison - number < string - (Kyle Adams)
|
||||
if (isNaN(oFxNcL) !== isNaN(oFyNcL)) { return (isNaN(oFxNcL)) ? 1 : -1; }
|
||||
// rely on string comparison if different types - i.e. '02' < 2 != '02' < '2'
|
||||
else if (typeof oFxNcL !== typeof oFyNcL) {
|
||||
oFxNcL += '';
|
||||
oFyNcL += '';
|
||||
}
|
||||
if (oFxNcL < oFyNcL) {
|
||||
return -1;
|
||||
}
|
||||
if (oFxNcL > oFyNcL) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
return {
|
||||
regularCmpFn: regularCmpFn,
|
||||
naturalCmpFn: naturalCmpFn
|
||||
};
|
||||
});
|
@@ -1,42 +0,0 @@
|
||||
modulejs.define('ext/autorefresh', ['_', '$', 'core/settings', 'core/event', 'core/location'], function (_, $, allsettings, event, location) {
|
||||
|
||||
var settings = _.extend({
|
||||
enabled: false,
|
||||
interval: 5000
|
||||
}, allsettings.autorefresh);
|
||||
var timeoutId = null;
|
||||
|
||||
|
||||
function heartbeat() {
|
||||
|
||||
location.refresh();
|
||||
}
|
||||
|
||||
function before() {
|
||||
|
||||
clearTimeout(timeoutId);
|
||||
}
|
||||
|
||||
function after() {
|
||||
|
||||
clearTimeout(timeoutId);
|
||||
timeoutId = setTimeout(heartbeat, settings.interval);
|
||||
}
|
||||
|
||||
function init() {
|
||||
|
||||
if (!settings.enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
settings.interval = Math.max(1000, settings.interval);
|
||||
|
||||
event.sub('location.beforeChange', before);
|
||||
event.sub('location.beforeRefresh', before);
|
||||
event.sub('location.changed', after);
|
||||
event.sub('location.refreshed', after);
|
||||
}
|
||||
|
||||
|
||||
init();
|
||||
});
|
@@ -1,179 +0,0 @@
|
||||
modulejs.define('ext/contextmenu', ['_', '$', 'core/settings', 'core/resource'], function (_, $, allsettings, resource) {
|
||||
|
||||
var settings = _.extend({
|
||||
enabled: false
|
||||
}, allsettings.contextmenu);
|
||||
var templateOverlay = '<div class="cm-overlay"/>';
|
||||
var templatePanel = '<div class="cm-panel"><ul/></div>';
|
||||
var templateSep = '<li class="cm-sep"/>';
|
||||
var templateEntry = '<li class="cm-entry"><span class="cm-icon"><img/></span><span class="cm-text"/></li>';
|
||||
var templateLabel = '<li class="cm-label"><span class="cm-text"/></li>';
|
||||
|
||||
|
||||
function createOverlay(callback) {
|
||||
|
||||
var $overlay = $(templateOverlay);
|
||||
|
||||
$overlay
|
||||
.on('click contextmenu', function (ev) {
|
||||
|
||||
ev.stopPropagation();
|
||||
ev.preventDefault();
|
||||
|
||||
var cmId = $(ev.target).closest('.cm-entry').data('cm-id');
|
||||
|
||||
if (ev.target === $overlay[0] || cmId !== undefined) {
|
||||
$overlay.remove();
|
||||
callback(cmId);
|
||||
}
|
||||
});
|
||||
|
||||
return $overlay;
|
||||
}
|
||||
|
||||
function createPanel(menu) {
|
||||
|
||||
var $panel = $(templatePanel);
|
||||
var $ul = $panel.find('ul');
|
||||
var $li;
|
||||
|
||||
_.each(menu, function (entry) {
|
||||
|
||||
if (entry.type === '-') {
|
||||
$(templateSep).appendTo($ul);
|
||||
}
|
||||
|
||||
else if (entry.type === 'l') {
|
||||
$(templateLabel)
|
||||
.find('.cm-text').text(entry.text).end()
|
||||
.appendTo($ul);
|
||||
}
|
||||
|
||||
else if (entry.type === 'e') {
|
||||
$li = $(templateEntry)
|
||||
.data('cm-id', entry.id)
|
||||
.find('.cm-text').text(entry.text).end()
|
||||
.appendTo($ul);
|
||||
|
||||
if (entry.icon) {
|
||||
$li.find('.cm-icon img').attr('src', resource.icon(entry.icon));
|
||||
} else {
|
||||
$li.find('.cm-icon').addClass('no-icon');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return $panel;
|
||||
}
|
||||
|
||||
function positionPanel($overlay, $panel, x, y) {
|
||||
|
||||
var margin = 4;
|
||||
|
||||
$panel.css({
|
||||
left: 0,
|
||||
top: 0,
|
||||
opacity: 0
|
||||
});
|
||||
$overlay.show();
|
||||
|
||||
var overlayOffset = $overlay.offset();
|
||||
var overlayLeft = overlayOffset.left;
|
||||
var overlayTop = overlayOffset.top;
|
||||
var overlayWidth = $overlay.outerWidth(true);
|
||||
var overlayHeight = $overlay.outerHeight(true);
|
||||
|
||||
var panelOffset = $panel.offset();
|
||||
var panelLeft = panelOffset.left;
|
||||
var panelTop = panelOffset.top;
|
||||
var panelWidth = $panel.outerWidth(true);
|
||||
var panelHeight = $panel.outerHeight(true);
|
||||
|
||||
var posLeft = x;
|
||||
var posTop = y;
|
||||
|
||||
if (panelWidth > overlayWidth - 2 * margin) {
|
||||
posLeft = margin;
|
||||
panelWidth = overlayWidth - 2 * margin;
|
||||
}
|
||||
|
||||
if (panelHeight > overlayHeight - 2 * margin) {
|
||||
posTop = margin;
|
||||
panelHeight = overlayHeight - 2 * margin;
|
||||
}
|
||||
|
||||
if (posLeft < overlayLeft + margin) {
|
||||
posLeft = overlayLeft + margin;
|
||||
}
|
||||
|
||||
if (posLeft + panelWidth > overlayLeft + overlayWidth - margin) {
|
||||
posLeft = overlayLeft + overlayWidth - margin - panelWidth;
|
||||
}
|
||||
|
||||
if (posTop < overlayTop + margin) {
|
||||
posTop = overlayTop + margin;
|
||||
}
|
||||
|
||||
if (posTop + panelHeight > overlayTop + overlayHeight - margin) {
|
||||
posTop = overlayTop + overlayHeight - margin - panelHeight;
|
||||
}
|
||||
|
||||
$panel.css({
|
||||
left: posLeft,
|
||||
top: posTop,
|
||||
width: panelWidth,
|
||||
height: panelHeight,
|
||||
opacity: 1
|
||||
});
|
||||
}
|
||||
|
||||
function showMenuAt(x, y, menu, callback) {
|
||||
|
||||
var $overlay = createOverlay(callback);
|
||||
var $panel = createPanel(menu);
|
||||
$overlay.append($panel).appendTo('body');
|
||||
positionPanel($overlay, $panel, x, y);
|
||||
}
|
||||
|
||||
function init() {
|
||||
|
||||
if (!settings.enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
$(document).on('contextmenu', function (ev) {
|
||||
|
||||
ev.stopPropagation();
|
||||
ev.preventDefault();
|
||||
$(ev.target).trigger($.Event('h5ai-contextmenu', {
|
||||
originalEvent: ev,
|
||||
showMenu: function (menu, callback) {
|
||||
|
||||
showMenuAt(ev.pageX, ev.pageY, menu, callback);
|
||||
}
|
||||
}));
|
||||
});
|
||||
|
||||
// var menu = [
|
||||
// {type: 'e', id: 'e1', text: 'testing context menus'},
|
||||
// {type: 'e', id: 'e2', text: 'another entry'},
|
||||
// {type: 'e', id: 'e3', text: 'one with icon', icon: 'folder'},
|
||||
// {type: '-'},
|
||||
// {type: 'e', id: 'e4', text: 'one with icon', icon: 'x'},
|
||||
// {type: 'e', id: 'e5', text: 'one with icon', icon: 'img'}
|
||||
// ];
|
||||
// var callback = function (res) {
|
||||
|
||||
// window.console.log('>> CB-RESULT >> ' + res);
|
||||
// };
|
||||
|
||||
// $(document).on('h5ai-contextmenu', '#items .item.folder', function (ev) {
|
||||
|
||||
// window.console.log('CM', ev);
|
||||
// ev.showMenu(menu, callback);
|
||||
// });
|
||||
}
|
||||
|
||||
|
||||
init();
|
||||
});
|
@@ -1,86 +0,0 @@
|
||||
modulejs.define('ext/crumb', ['_', '$', 'core/settings', 'core/resource', 'core/event', 'core/location'], function (_, $, allsettings, resource, event, location) {
|
||||
|
||||
var settings = _.extend({
|
||||
enabled: false
|
||||
}, allsettings.crumb);
|
||||
var template =
|
||||
'<a class="crumb">' +
|
||||
'<img class="sep" src="' + resource.image('crumb') + '" alt=">"/>' +
|
||||
'<span class="label"/>' +
|
||||
'</a>';
|
||||
var pageHintTemplate = '<img class="hint" src="' + resource.icon('folder-page') + '" alt="has index page"/>';
|
||||
|
||||
|
||||
function update(item, force) {
|
||||
|
||||
if (!force && item.$crumb) {
|
||||
return item.$crumb;
|
||||
}
|
||||
|
||||
var $html = $(template);
|
||||
|
||||
$html
|
||||
.addClass(item.isFolder() ? 'folder' : 'file')
|
||||
.data('item', item);
|
||||
|
||||
location.setLink($html, item);
|
||||
$html.find('.label').text(item.label).end();
|
||||
|
||||
if (item.isDomain() || item.isRoot()) {
|
||||
$html.find('.sep').width(0);
|
||||
}
|
||||
|
||||
if (item.isCurrentFolder()) {
|
||||
$html.addClass('active');
|
||||
}
|
||||
|
||||
if (!item.isManaged) {
|
||||
$html.append($(pageHintTemplate));
|
||||
}
|
||||
|
||||
if (item.$crumb) {
|
||||
item.$crumb.replaceWith($html);
|
||||
}
|
||||
item.$crumb = $html;
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
||||
function onLocationChanged(item) {
|
||||
|
||||
var crumb = item.getCrumb();
|
||||
var $crumbbar = $('#crumbbar');
|
||||
var found = false;
|
||||
|
||||
$crumbbar.find('.crumb').each(function () {
|
||||
|
||||
var $html = $(this);
|
||||
if ($html.data('item') === item) {
|
||||
found = true;
|
||||
$html.addClass('active');
|
||||
} else {
|
||||
$html.removeClass('active');
|
||||
}
|
||||
});
|
||||
|
||||
if (!found) {
|
||||
$crumbbar.find('.crumb').remove();
|
||||
_.each(crumb, function (e) {
|
||||
|
||||
$crumbbar.append(update(e, true));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function init() {
|
||||
|
||||
if (!settings.enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
event.sub('location.changed', onLocationChanged);
|
||||
}
|
||||
|
||||
|
||||
init();
|
||||
});
|
@@ -1,61 +0,0 @@
|
||||
modulejs.define('ext/custom', ['_', '$', 'marked', 'core/settings', 'core/server', 'core/event', 'core/resource'], function (_, $, marked, allsettings, server, event, resource) {
|
||||
|
||||
var settings = _.extend({
|
||||
enabled: false
|
||||
}, allsettings.custom);
|
||||
var $header, $footer;
|
||||
var duration = 200;
|
||||
|
||||
|
||||
function onLocationChanged(item) {
|
||||
|
||||
server.request({action: 'get', custom: true, customHref: item.absHref}, function (response) {
|
||||
|
||||
var has_header, has_footer, data, content;
|
||||
|
||||
if (response) {
|
||||
data = response.custom;
|
||||
|
||||
if (data.header) {
|
||||
content = data.header;
|
||||
if (data.header_type === 'md') {
|
||||
content = marked(content);
|
||||
}
|
||||
$header.html(content).stop().slideDown(duration);
|
||||
has_header = true;
|
||||
}
|
||||
|
||||
if (data.footer) {
|
||||
content = data.footer;
|
||||
if (data.footer_type === 'md') {
|
||||
content = marked(content);
|
||||
}
|
||||
$footer.html(content).stop().slideDown(duration);
|
||||
has_footer = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!has_header) {
|
||||
$header.stop().slideUp(duration);
|
||||
}
|
||||
if (!has_footer) {
|
||||
$footer.stop().slideUp(duration);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function init() {
|
||||
|
||||
if (!settings.enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
$header = $('<div id="content-header"/>').hide().prependTo('#content');
|
||||
$footer = $('<div id="content-footer"/>').hide().appendTo('#content');
|
||||
|
||||
event.sub('location.changed', onLocationChanged);
|
||||
}
|
||||
|
||||
|
||||
init();
|
||||
});
|
@@ -1,71 +0,0 @@
|
||||
modulejs.define('ext/download', ['_', '$', 'core/settings', 'core/resource', 'core/event', 'core/location', 'core/server'], function (_, $, allsettings, resource, event, location, server) {
|
||||
|
||||
var settings = _.extend({
|
||||
enabled: false,
|
||||
type: 'php-tar',
|
||||
packageName: 'package',
|
||||
alwaysVisible: false
|
||||
}, allsettings.download);
|
||||
var downloadBtnTemplate =
|
||||
'<div id="download" class="tool">' +
|
||||
'<img src="' + resource.image('download') + '" alt="download"/>' +
|
||||
'</div>';
|
||||
var selectedItems = [];
|
||||
|
||||
|
||||
function onSelection(items) {
|
||||
|
||||
var $download = $('#download');
|
||||
|
||||
selectedItems = items.slice(0);
|
||||
if (selectedItems.length) {
|
||||
$download.show();
|
||||
} else if (!settings.alwaysVisible) {
|
||||
$download.hide();
|
||||
}
|
||||
}
|
||||
|
||||
function onClick(event) {
|
||||
|
||||
var type = settings.type;
|
||||
var name = settings.packageName;
|
||||
var extension = (type === 'shell-zip') ? 'zip' : 'tar';
|
||||
|
||||
if (!name) {
|
||||
if (selectedItems.length === 1) {
|
||||
name = selectedItems[0].label;
|
||||
} else {
|
||||
name = location.getItem().label;
|
||||
}
|
||||
}
|
||||
|
||||
var query = {
|
||||
action: 'download',
|
||||
as: name + '.' + extension,
|
||||
type: type,
|
||||
hrefs: _.pluck(selectedItems, 'absHref').join('|:|')
|
||||
};
|
||||
|
||||
server.formRequest(query);
|
||||
}
|
||||
|
||||
function init() {
|
||||
|
||||
if (!settings.enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
$(downloadBtnTemplate)
|
||||
.on('click', onClick)
|
||||
.appendTo('#toolbar');
|
||||
|
||||
if (settings.alwaysVisible) {
|
||||
$('#download').show();
|
||||
}
|
||||
|
||||
event.sub('selection', onSelection);
|
||||
}
|
||||
|
||||
|
||||
init();
|
||||
});
|
@@ -1,110 +0,0 @@
|
||||
modulejs.define('ext/filter', ['_', '$', 'core/settings', 'core/resource', 'core/event'], function (_, $, allsettings, resource, event) {
|
||||
|
||||
var settings = _.extend({
|
||||
enabled: false
|
||||
}, allsettings.filter);
|
||||
var template =
|
||||
'<div id="filter" class="tool">' +
|
||||
'<img src="' + resource.image('filter') + '" alt="filter"/>' +
|
||||
'<input type="text" value="" placeholder="filter"/>' +
|
||||
'</div>';
|
||||
var noMatchTemplate = '<div class="no-match l10n-noMatch"/>';
|
||||
var inputIsVisible = false;
|
||||
var $filter, $input, $noMatch;
|
||||
|
||||
|
||||
function filter(re) {
|
||||
|
||||
var match = [];
|
||||
var noMatch = [];
|
||||
var duration = 200;
|
||||
|
||||
if (re) {
|
||||
$('#items .item').not('.folder-parent').each(function () {
|
||||
|
||||
var label = $(this).find('.label').text();
|
||||
|
||||
if (label.match(re)) {
|
||||
match.push(this);
|
||||
} else {
|
||||
noMatch.push(this);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
match = $('#items .item').not('.folder-parent');
|
||||
}
|
||||
|
||||
if (match.length) {
|
||||
$noMatch.hide();
|
||||
} else if (noMatch.length) {
|
||||
setTimeout(function () { $noMatch.show(); }, duration);
|
||||
}
|
||||
$(match).fadeIn(duration);
|
||||
$(noMatch).fadeOut(duration);
|
||||
}
|
||||
|
||||
function escapeRegExp(sequence) {
|
||||
|
||||
return sequence.replace(/[\-\[\]{}()*+?.,\\$\^|#\s]/g, '\\$&');
|
||||
}
|
||||
|
||||
function parseFilterSequence(sequence) {
|
||||
|
||||
if (sequence.substr(0, 3) === 're:') {
|
||||
return new RegExp(sequence.substr(3));
|
||||
}
|
||||
|
||||
sequence = $.map($.trim(sequence).split(/\s+/), function (part) {
|
||||
|
||||
return _.map(part.split(''), function (character) {
|
||||
|
||||
return escapeRegExp(character);
|
||||
}).join('.*?');
|
||||
}).join('|');
|
||||
|
||||
return new RegExp(sequence, 'i');
|
||||
}
|
||||
|
||||
function update() {
|
||||
|
||||
if (inputIsVisible) {
|
||||
var val = $input.val();
|
||||
filter(parseFilterSequence(val));
|
||||
$filter.addClass('active');
|
||||
$input.focus();
|
||||
} else {
|
||||
filter();
|
||||
$filter.removeClass('active');
|
||||
}
|
||||
}
|
||||
|
||||
function toggle() {
|
||||
|
||||
inputIsVisible = !inputIsVisible;
|
||||
update();
|
||||
}
|
||||
|
||||
function reset() {
|
||||
|
||||
$input.val('');
|
||||
update();
|
||||
}
|
||||
|
||||
function init() {
|
||||
|
||||
if (!settings.enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
$filter = $(template).appendTo('#toolbar');
|
||||
$input = $filter.find('input');
|
||||
$noMatch = $(noMatchTemplate).appendTo('#view');
|
||||
|
||||
$filter.on('click', 'img', toggle);
|
||||
$input.on('keyup', update);
|
||||
event.sub('location.changed', reset);
|
||||
}
|
||||
|
||||
|
||||
init();
|
||||
});
|
@@ -1,48 +0,0 @@
|
||||
modulejs.define('ext/google-analytics-ua', ['_', 'core/settings', 'core/event'], function (_, allsettings, event) {
|
||||
|
||||
var settings = _.extend({
|
||||
enabled: false,
|
||||
id: 'UA-000000-0'
|
||||
}, allsettings['google-analytics-ua']);
|
||||
var win = window;
|
||||
var doc = document;
|
||||
var scriptLiteral = 'script';
|
||||
var id = 'h5ai-ga';
|
||||
|
||||
|
||||
function init() {
|
||||
|
||||
if (!settings.enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
var el, firstScriptElement;
|
||||
|
||||
win.GoogleAnalyticsObject = id;
|
||||
win[id] = win[id] || function () {
|
||||
(win[id].q = win[id].q || []).push(arguments);
|
||||
};
|
||||
win[id].l = 1 * new Date();
|
||||
|
||||
el = doc.createElement(scriptLiteral);
|
||||
el.async = true;
|
||||
el.src = '//www.google-analytics.com/analytics.js';
|
||||
|
||||
firstScriptElement = doc.getElementsByTagName(scriptLiteral)[0];
|
||||
firstScriptElement.parentNode.insertBefore(el, firstScriptElement);
|
||||
|
||||
win[id]('create', settings.id, 'auto');
|
||||
|
||||
event.sub('location.changed', function (item) {
|
||||
|
||||
var loc = win.location;
|
||||
win[id]('send', 'pageview', {
|
||||
location: loc.protocol + '//' + loc.host + item.absHref,
|
||||
title: _.pluck(item.getCrumb(), 'label').join(' > ')
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
init();
|
||||
});
|
@@ -1,158 +0,0 @@
|
||||
modulejs.define('ext/info', ['_', '$', 'modernizr', 'core/settings', 'core/resource', 'core/store', 'core/event', 'core/format'], function (_, $, modernizr, allsettings, resource, store, event, format) {
|
||||
|
||||
var settings = _.extend({
|
||||
enabled: false,
|
||||
show: false,
|
||||
qrcode: true,
|
||||
qrColor: "#999"
|
||||
}, allsettings.info);
|
||||
var template =
|
||||
'<div id="info">' +
|
||||
'<div class="icon"><img/></div>' +
|
||||
'<div class="block">' +
|
||||
'<div class="label"/>' +
|
||||
'<div class="time"/>' +
|
||||
'<div class="size"/>' +
|
||||
'<div class="content">' +
|
||||
'<span class="folders"/> <span class="l10n-folders"/>, ' +
|
||||
'<span class="files"/> <span class="l10n-files"/>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'<div class="qrcode"/>' +
|
||||
'</div>';
|
||||
var settingsTemplate =
|
||||
'<div class="block">' +
|
||||
'<h1 class="l10n-info">Info</h1>' +
|
||||
'<div id="view-info" class="button view">' +
|
||||
'<img src="' + resource.image('info-toggle') + '" alt="view-info"/>' +
|
||||
'</div>' +
|
||||
'</div>';
|
||||
var sepTemplate = '<span class="sep"/>';
|
||||
var storekey = 'ext/info';
|
||||
var $img, $label, $time, $size, $content, $folders, $files, $qrcode;
|
||||
var currentFolder;
|
||||
|
||||
// <span class="l10n-folders"/>
|
||||
// <span class="l10n-files"/>
|
||||
|
||||
function updateSettings() {
|
||||
|
||||
if (store.get(storekey)) {
|
||||
$('#view-info').addClass('active');
|
||||
$('#info').show();
|
||||
} else {
|
||||
$('#view-info').removeClass('active');
|
||||
$('#info').hide();
|
||||
}
|
||||
}
|
||||
|
||||
function update(item) {
|
||||
|
||||
var src = item.thumbRational || item.icon;
|
||||
var isThumb = !!item.thumbRational;
|
||||
|
||||
if (item.isCurrentFolder() || !src) {
|
||||
src = resource.icon('folder');
|
||||
}
|
||||
|
||||
$img.attr('src', src);
|
||||
if (isThumb) {
|
||||
$img.addClass('thumb');
|
||||
} else {
|
||||
$img.removeClass('thumb');
|
||||
}
|
||||
|
||||
$label.text(item.label);
|
||||
if (_.isNumber(item.time)) {
|
||||
$time.text(format.formatDate(item.time));
|
||||
} else {
|
||||
$time.text('.');
|
||||
}
|
||||
|
||||
if (_.isNumber(item.size)) {
|
||||
$size.text(format.formatSize(item.size));
|
||||
$size.show();
|
||||
} else {
|
||||
$size.hide();
|
||||
}
|
||||
|
||||
if (item.isContentFetched) {
|
||||
var stats = item.getStats();
|
||||
$folders.text(stats.folders);
|
||||
$files.text(stats.files);
|
||||
$content.show();
|
||||
} else {
|
||||
$content.hide();
|
||||
}
|
||||
|
||||
if (settings.qrcode) {
|
||||
$qrcode.empty().qrcode({
|
||||
render: modernizr.canvas ? 'canvas' : 'div',
|
||||
size: 200,
|
||||
fill: settings.qrColor,
|
||||
background: null,
|
||||
text: window.location.protocol + '//' + window.location.host + item.absHref
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function onMouseenter(item) {
|
||||
|
||||
update(item);
|
||||
}
|
||||
|
||||
function onMouseleave(item) {
|
||||
|
||||
update(currentFolder);
|
||||
}
|
||||
|
||||
function onLocationChanged(item) {
|
||||
|
||||
currentFolder = item;
|
||||
update(currentFolder);
|
||||
}
|
||||
|
||||
function init() {
|
||||
|
||||
if (!settings.enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
var $info = $(template).appendTo('#main-row');
|
||||
$img = $info.find('.icon img');
|
||||
$label = $info.find('.label');
|
||||
$time = $info.find('.time');
|
||||
$size = $info.find('.size');
|
||||
$content = $info.find('.content');
|
||||
$folders = $info.find('.folders');
|
||||
$files = $info.find('.files');
|
||||
$qrcode = $info.find('.qrcode');
|
||||
|
||||
if (!settings.qrcode) {
|
||||
$qrcode.remove();
|
||||
}
|
||||
|
||||
$(settingsTemplate)
|
||||
.appendTo('#settings')
|
||||
.find('#view-info')
|
||||
.on('click', function (ev) {
|
||||
|
||||
store.put(storekey, !store.get(storekey));
|
||||
updateSettings();
|
||||
ev.preventDefault();
|
||||
});
|
||||
|
||||
// ensure stored value is boolean, otherwise set default
|
||||
if (typeof(store.get(storekey)) !== 'boolean') {
|
||||
store.put(storekey, settings.show);
|
||||
}
|
||||
updateSettings();
|
||||
|
||||
event.sub('location.changed', onLocationChanged);
|
||||
event.sub('item.mouseenter', onMouseenter);
|
||||
event.sub('item.mouseleave', onMouseleave);
|
||||
}
|
||||
|
||||
|
||||
init();
|
||||
});
|
@@ -1,139 +0,0 @@
|
||||
modulejs.define('ext/l10n', ['_', '$', 'core/settings', 'core/langs', 'core/format', 'core/store', 'core/event', 'core/server'], function (_, $, allsettings, langs, format, store, event, server) {
|
||||
|
||||
var settings = _.extend({
|
||||
enabled: false,
|
||||
lang: 'en',
|
||||
useBrowserLang: true
|
||||
}, allsettings.l10n);
|
||||
var defaultTranslations = {
|
||||
isoCode: 'en',
|
||||
lang: 'english',
|
||||
details: 'details',
|
||||
grid: 'grid',
|
||||
icons: 'icons',
|
||||
name: 'Name',
|
||||
lastModified: 'Last modified',
|
||||
size: 'Size',
|
||||
parentDirectory: 'Parent Directory',
|
||||
empty: 'empty',
|
||||
folders: 'folders',
|
||||
files: 'files',
|
||||
download: 'download',
|
||||
noMatch: 'no match',
|
||||
dateFormat: 'YYYY-MM-DD HH:mm',
|
||||
filter: 'filter',
|
||||
view: 'View',
|
||||
language: 'Language'
|
||||
};
|
||||
var blockTemplate = '<div class="block"><h1 class="l10n-language">Language</h1><div class="select"><select id="langs"/></div></div>';
|
||||
var optionTemplate = '<option/>';
|
||||
var storekey = 'ext/l10n';
|
||||
var loaded = {
|
||||
en: _.extend({}, defaultTranslations)
|
||||
};
|
||||
var currentLang = loaded.en;
|
||||
|
||||
|
||||
function update(lang) {
|
||||
|
||||
if (lang) {
|
||||
currentLang = lang;
|
||||
}
|
||||
|
||||
$('#langs option')
|
||||
.removeAttr('selected').removeProp('selected')
|
||||
.filter('.' + currentLang.isoCode)
|
||||
.attr('selected', 'selected').prop('selected', 'selected');
|
||||
|
||||
$.each(currentLang, function (key, value) {
|
||||
$('.l10n-' + key).text(value);
|
||||
});
|
||||
format.setDefaultDateFormat(currentLang.dateFormat);
|
||||
|
||||
$('#items .item .date').each(function () {
|
||||
|
||||
var $this = $(this);
|
||||
|
||||
$this.text(format.formatDate($this.data('time')));
|
||||
});
|
||||
|
||||
$('#filter input').attr('placeholder', currentLang.filter);
|
||||
}
|
||||
|
||||
function loadLanguage(isoCode, callback) {
|
||||
|
||||
if (loaded[isoCode]) {
|
||||
|
||||
callback(loaded[isoCode]);
|
||||
} else {
|
||||
|
||||
server.request({action: 'get', l10n: true, l10nCodes: isoCode}, function (response) {
|
||||
|
||||
var json = response.l10n && response.l10n[isoCode] ? response.l10n[isoCode] : {};
|
||||
loaded[isoCode] = _.extend({}, defaultTranslations, json, {isoCode: isoCode});
|
||||
callback(loaded[isoCode]);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function localize(langs, isoCode, useBrowserLang) {
|
||||
|
||||
var storedIsoCode = store.get(storekey);
|
||||
|
||||
if (langs[storedIsoCode]) {
|
||||
isoCode = storedIsoCode;
|
||||
} else if (useBrowserLang) {
|
||||
var browserLang = navigator.language || navigator.browserLanguage;
|
||||
if (browserLang) {
|
||||
if (langs[browserLang]) {
|
||||
isoCode = browserLang;
|
||||
} else if (browserLang.length > 2 && langs[browserLang.substr(0, 2)]) {
|
||||
isoCode = browserLang.substr(0, 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!langs[isoCode]) {
|
||||
isoCode = 'en';
|
||||
}
|
||||
|
||||
loadLanguage(isoCode, update);
|
||||
}
|
||||
|
||||
function initLangSelector(langs) {
|
||||
|
||||
var isoCodes = _.keys(langs).sort();
|
||||
var $block = $(blockTemplate);
|
||||
var $select = $block.find('select')
|
||||
.on('change', function (event) {
|
||||
var isoCode = event.target.value;
|
||||
store.put(storekey, isoCode);
|
||||
localize(langs, isoCode, false);
|
||||
});
|
||||
|
||||
$.each(isoCodes, function (idx, isoCode) {
|
||||
$(optionTemplate)
|
||||
.attr('value', isoCode)
|
||||
.addClass(isoCode)
|
||||
.text(isoCode + ' - ' + (_.isString(langs[isoCode]) ? langs[isoCode] : langs[isoCode].lang))
|
||||
.appendTo($select);
|
||||
});
|
||||
|
||||
$block.appendTo('#settings');
|
||||
}
|
||||
|
||||
function init() {
|
||||
|
||||
if (settings.enabled) {
|
||||
initLangSelector(langs);
|
||||
}
|
||||
|
||||
event.sub('location.changed', function () {
|
||||
|
||||
localize(langs, settings.lang, settings.useBrowserLang);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
init();
|
||||
});
|
@@ -1,41 +0,0 @@
|
||||
modulejs.define('ext/peer5', ['_', '$', 'core/settings'], function (_, $, allsettings) {
|
||||
|
||||
var settings = _.extend({
|
||||
enabled: false,
|
||||
id: 'z142i5n5qypq4cxr'
|
||||
}, allsettings.peer5);
|
||||
|
||||
|
||||
function init() {
|
||||
|
||||
if (!settings.enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
var peer5js = '//api.peer5.com/peer5.js?id=' + settings.id;
|
||||
|
||||
// load peer5 with caching
|
||||
$.ajax({
|
||||
url: peer5js,
|
||||
dataType: 'script',
|
||||
cache:true
|
||||
});
|
||||
|
||||
// attach to file items, once the DOM is ready
|
||||
$(function() {
|
||||
|
||||
$('body').on('click', '.item.file > a', function (e) {
|
||||
|
||||
if (window.peer5) {
|
||||
e.preventDefault();
|
||||
var url = e.currentTarget.href;
|
||||
window.peer5.download(url);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
init();
|
||||
});
|
@@ -1,32 +0,0 @@
|
||||
modulejs.define('ext/piwik-analytics', ['_', '$', 'core/settings'], function (_, $, allsettings) {
|
||||
|
||||
var settings = _.extend({
|
||||
enabled: false,
|
||||
baseURL: 'not-set',
|
||||
idSite: 0
|
||||
}, allsettings['piwik-analytics']);
|
||||
|
||||
|
||||
function init() {
|
||||
|
||||
if (!settings.enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
// reference: http://piwik.org/docs/javascript-tracking/
|
||||
|
||||
var pkBaseURL = (("https:" === document.location.protocol) ? "https://" : "http://") + settings.baseURL + '/';
|
||||
|
||||
$('<script/>').attr('src', pkBaseURL + 'piwik.js').appendTo('body');
|
||||
$(window).load(function () {
|
||||
/*global Piwik */
|
||||
|
||||
var piwikTracker = Piwik.getTracker(pkBaseURL + 'piwik.php', settings.idSite);
|
||||
piwikTracker.trackPageView();
|
||||
piwikTracker.enableLinkTracking();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
init();
|
||||
});
|
@@ -1,123 +0,0 @@
|
||||
modulejs.define('ext/preview-audio', ['_', '$', 'moment', 'core/settings', 'core/event', 'ext/preview'], function (_, $, moment, allsettings, event, preview) {
|
||||
|
||||
var settings = _.extend({
|
||||
enabled: false,
|
||||
types: []
|
||||
}, allsettings['preview-aud']);
|
||||
|
||||
|
||||
function preloadAudio(src, callback) {
|
||||
|
||||
var $audio = $('<audio/>')
|
||||
.one('loadedmetadata', function () {
|
||||
|
||||
callback($audio);
|
||||
// setTimeout(function () { callback($img); }, 1000); // for testing
|
||||
})
|
||||
.attr('autoplay', 'autoplay')
|
||||
.attr('controls', 'controls')
|
||||
.attr('src', src);
|
||||
}
|
||||
|
||||
function onEnter(items, idx) {
|
||||
|
||||
var currentItems = items;
|
||||
var currentIdx = idx;
|
||||
var currentItem = items[idx];
|
||||
|
||||
function onAdjustSize() {
|
||||
|
||||
var $content = $('#pv-content');
|
||||
var $audio = $('#pv-aud-audio');
|
||||
|
||||
if ($audio.length) {
|
||||
|
||||
$audio.css({
|
||||
'left': '' + (($content.width()-$audio.width())*0.5) + 'px',
|
||||
'top': '' + (($content.height()-$audio.height())*0.5) + 'px'
|
||||
});
|
||||
|
||||
preview.setLabels([
|
||||
currentItem.label,
|
||||
moment(0).add('seconds', $audio[0].duration).format('m:ss')
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
function onIdxChange(rel) {
|
||||
|
||||
currentIdx = (currentIdx + rel + currentItems.length) % currentItems.length;
|
||||
currentItem = currentItems[currentIdx];
|
||||
|
||||
var spinnerTimeout = setTimeout(function () { preview.showSpinner(true); }, 200);
|
||||
|
||||
if ($('#pv-aud-audio').length) {
|
||||
$('#pv-aud-audio')[0].pause();
|
||||
}
|
||||
preloadAudio(currentItem.absHref, function ($preloaded_audio) {
|
||||
|
||||
clearTimeout(spinnerTimeout);
|
||||
preview.showSpinner(false);
|
||||
|
||||
$('#pv-content').fadeOut(100, function () {
|
||||
|
||||
$('#pv-content').empty().append($preloaded_audio.attr('id', 'pv-aud-audio')).fadeIn(200);
|
||||
|
||||
// small timeout, so $preloaded_audio is visible and therefore $preloaded_audio.width is available
|
||||
setTimeout(function () {
|
||||
onAdjustSize();
|
||||
|
||||
preview.setIndex(currentIdx + 1, currentItems.length);
|
||||
preview.setRawLink(currentItem.absHref);
|
||||
}, 10);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
onIdxChange(0);
|
||||
preview.setOnIndexChange(onIdxChange);
|
||||
preview.setOnAdjustSize(onAdjustSize);
|
||||
preview.enter();
|
||||
}
|
||||
|
||||
function initItem(item) {
|
||||
|
||||
if (item.$view && _.indexOf(settings.types, item.type) >= 0) {
|
||||
item.$view.find('a').on('click', function (event) {
|
||||
|
||||
event.preventDefault();
|
||||
|
||||
var matchedEntries = _.compact(_.map($('#items .item'), function (item) {
|
||||
|
||||
item = $(item).data('item');
|
||||
return _.indexOf(settings.types, item.type) >= 0 ? item : null;
|
||||
}));
|
||||
|
||||
onEnter(matchedEntries, _.indexOf(matchedEntries, item));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function onLocationChanged(item) {
|
||||
|
||||
_.each(item.content, initItem);
|
||||
}
|
||||
|
||||
function onLocationRefreshed(item, added, removed) {
|
||||
|
||||
_.each(added, initItem);
|
||||
}
|
||||
|
||||
function init() {
|
||||
|
||||
if (!settings.enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
event.sub('location.changed', onLocationChanged);
|
||||
event.sub('location.refreshed', onLocationRefreshed);
|
||||
}
|
||||
|
||||
|
||||
init();
|
||||
});
|
@@ -1,172 +0,0 @@
|
||||
modulejs.define('ext/preview-img', ['_', '$', 'core/settings', 'core/event', 'core/server', 'ext/preview'], function (_, $, allsettings, event, server, preview) {
|
||||
|
||||
var settings = _.extend({
|
||||
enabled: false,
|
||||
size: null,
|
||||
types: []
|
||||
}, allsettings['preview-img']);
|
||||
var templateLoading = '<img id="pv-img-image" class="loading"/>';
|
||||
var spinnerThreshold = 200;
|
||||
var currentItems, currentIdx, currentItem;
|
||||
|
||||
|
||||
function requestSample(href, callback) {
|
||||
|
||||
if (!settings.size) {
|
||||
callback(href);
|
||||
return;
|
||||
}
|
||||
|
||||
server.request({
|
||||
action: 'getThumbHref',
|
||||
type: 'img',
|
||||
href: href,
|
||||
width: settings.size,
|
||||
height: 0
|
||||
}, function (json) {
|
||||
|
||||
callback(json && json.code === 0 ? json.absHref : null);
|
||||
});
|
||||
}
|
||||
|
||||
function showSpinner(item) {
|
||||
|
||||
var timeoutId;
|
||||
|
||||
function start() {
|
||||
|
||||
$('#pv-content')
|
||||
.empty()
|
||||
.append($(templateLoading).attr('src', item.thumbSquare))
|
||||
.show();
|
||||
|
||||
onAdjustSize();
|
||||
|
||||
preview.setLabels([item.label]);
|
||||
preview.showSpinner(true);
|
||||
}
|
||||
|
||||
function stop() {
|
||||
|
||||
clearTimeout(timeoutId);
|
||||
preview.showSpinner(false);
|
||||
}
|
||||
|
||||
timeoutId = setTimeout(start, spinnerThreshold);
|
||||
return stop;
|
||||
}
|
||||
|
||||
function preloadImg(item, callback) {
|
||||
|
||||
var hide = showSpinner(item);
|
||||
|
||||
requestSample(item.absHref, function (src) {
|
||||
|
||||
$('<img/>')
|
||||
.one('load', function (ev) {
|
||||
|
||||
hide();
|
||||
callback(item, ev.target);
|
||||
|
||||
// for testing
|
||||
// setTimeout(function () { hide(); callback(item, ev.target); }, 1000);
|
||||
})
|
||||
.attr('src', src);
|
||||
});
|
||||
}
|
||||
|
||||
function onAdjustSize() {
|
||||
|
||||
var $content = $('#pv-content');
|
||||
var $img = $('#pv-img-image');
|
||||
|
||||
if ($img.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
$img.css({
|
||||
left: ($content.width() - $img.width()) * 0.5,
|
||||
top: ($content.height() - $img.height()) * 0.5
|
||||
});
|
||||
|
||||
var labels = [currentItem.label];
|
||||
if (!settings.size) {
|
||||
labels.push('' + $img[0].naturalWidth + 'x' + $img[0].naturalHeight);
|
||||
labels.push('' + (100 * $img.width() / $img[0].naturalWidth).toFixed(0) + '%');
|
||||
}
|
||||
preview.setLabels(labels);
|
||||
}
|
||||
|
||||
function onIdxChange(rel) {
|
||||
|
||||
currentIdx = (currentIdx + rel + currentItems.length) % currentItems.length;
|
||||
currentItem = currentItems[currentIdx];
|
||||
|
||||
preview.setIndex(currentIdx + 1, currentItems.length);
|
||||
preview.setRawLink(currentItem.absHref);
|
||||
|
||||
preloadImg(currentItem, function (item, preloaded_img) {
|
||||
|
||||
if (item !== currentItem) {
|
||||
return;
|
||||
}
|
||||
|
||||
$('#pv-content')
|
||||
.empty()
|
||||
.append($(preloaded_img).attr('id', 'pv-img-image'))
|
||||
.show();
|
||||
onAdjustSize();
|
||||
});
|
||||
}
|
||||
|
||||
function onEnter(items, idx) {
|
||||
|
||||
currentItems = items;
|
||||
currentIdx = idx;
|
||||
onIdxChange(0);
|
||||
preview.setOnIndexChange(onIdxChange);
|
||||
preview.setOnAdjustSize(onAdjustSize);
|
||||
preview.enter();
|
||||
}
|
||||
|
||||
function initItem(item) {
|
||||
|
||||
if (item.$view && _.indexOf(settings.types, item.type) >= 0) {
|
||||
item.$view.find('a').on('click', function (ev) {
|
||||
|
||||
ev.preventDefault();
|
||||
|
||||
var matchedEntries = _.compact(_.map($('#items .item'), function (item) {
|
||||
|
||||
item = $(item).data('item');
|
||||
return _.indexOf(settings.types, item.type) >= 0 ? item : null;
|
||||
}));
|
||||
|
||||
onEnter(matchedEntries, _.indexOf(matchedEntries, item));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function onLocationChanged(item) {
|
||||
|
||||
_.each(item.content, initItem);
|
||||
}
|
||||
|
||||
function onLocationRefreshed(item, added, removed) {
|
||||
|
||||
_.each(added, initItem);
|
||||
}
|
||||
|
||||
function init() {
|
||||
|
||||
if (!settings.enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
event.sub('location.changed', onLocationChanged);
|
||||
event.sub('location.refreshed', onLocationRefreshed);
|
||||
}
|
||||
|
||||
|
||||
init();
|
||||
});
|
@@ -1,138 +0,0 @@
|
||||
modulejs.define('ext/preview-txt', ['_', '$', 'marked', 'prism', 'core/settings', 'core/event', 'ext/preview'], function (_, $, marked, prism, allsettings, event, preview) {
|
||||
|
||||
var settings = _.extend({
|
||||
enabled: false,
|
||||
types: {}
|
||||
}, allsettings['preview-txt']);
|
||||
var templateText = '<pre id="pv-txt-text" class="highlighted"/>';
|
||||
var templateMarkdown = '<div id="pv-txt-text" class="markdown"/>';
|
||||
|
||||
|
||||
function preloadText(absHref, callback) {
|
||||
|
||||
$.ajax({
|
||||
url: absHref,
|
||||
dataType: 'text'
|
||||
})
|
||||
.done(function (content) {
|
||||
|
||||
callback(content);
|
||||
// setTimeout(function () { callback(content); }, 1000); // for testing
|
||||
})
|
||||
.fail(function (jqXHR, textStatus, errorThrown) {
|
||||
|
||||
callback('[ajax error] ' + textStatus);
|
||||
});
|
||||
}
|
||||
|
||||
function onEnter(items, idx) {
|
||||
|
||||
var currentItems = items;
|
||||
var currentIdx = idx;
|
||||
var currentItem = items[idx];
|
||||
|
||||
function onAdjustSize() {
|
||||
|
||||
var $content = $('#pv-content');
|
||||
var $text = $('#pv-txt-text');
|
||||
|
||||
if ($text.length) {
|
||||
|
||||
$text.height($content.height() - 16);
|
||||
}
|
||||
}
|
||||
|
||||
function onIdxChange(rel) {
|
||||
|
||||
currentIdx = (currentIdx + rel + currentItems.length) % currentItems.length;
|
||||
currentItem = currentItems[currentIdx];
|
||||
|
||||
var spinnerTimeout = setTimeout(function () { preview.showSpinner(true); }, 200);
|
||||
|
||||
preloadText(currentItem.absHref, function (textContent) {
|
||||
|
||||
clearTimeout(spinnerTimeout);
|
||||
preview.showSpinner(false);
|
||||
|
||||
$('#pv-content').fadeOut(100, function () {
|
||||
|
||||
var type = settings.types[currentItem.type];
|
||||
var $text, $code;
|
||||
|
||||
if (type === 'none') {
|
||||
$text = $(templateMarkdown).text(textContent);
|
||||
} else if (type === 'fixed') {
|
||||
$text = $(templateText).text(textContent);
|
||||
} else if (type === 'markdown') {
|
||||
$text = $(templateMarkdown).html(marked(textContent));
|
||||
} else {
|
||||
$text = $(templateText);
|
||||
$code = $('<code/>').appendTo($text);
|
||||
|
||||
if (textContent.length < 20000) {
|
||||
$code.empty().html(prism.highlight(textContent, prism.languages[type]));
|
||||
} else {
|
||||
$code.empty().text(textContent);
|
||||
setTimeout(function () { $code.empty().html(prism.highlight(textContent, prism.languages[type])); }, 300);
|
||||
}
|
||||
}
|
||||
$('#pv-content').empty().append($text).fadeIn(200);
|
||||
onAdjustSize();
|
||||
|
||||
preview.setIndex(currentIdx + 1, currentItems.length);
|
||||
preview.setLabels([
|
||||
currentItem.label,
|
||||
'' + currentItem.size + ' bytes'
|
||||
]);
|
||||
preview.setRawLink(currentItem.absHref);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
onIdxChange(0);
|
||||
preview.setOnIndexChange(onIdxChange);
|
||||
preview.setOnAdjustSize(onAdjustSize);
|
||||
preview.enter();
|
||||
}
|
||||
|
||||
function initItem(item) {
|
||||
|
||||
if (item.$view && _.indexOf(_.keys(settings.types), item.type) >= 0) {
|
||||
item.$view.find('a').on('click', function (event) {
|
||||
|
||||
event.preventDefault();
|
||||
|
||||
var matchedEntries = _.compact(_.map($('#items .item'), function (item) {
|
||||
|
||||
item = $(item).data('item');
|
||||
return _.indexOf(_.keys(settings.types), item.type) >= 0 ? item : null;
|
||||
}));
|
||||
|
||||
onEnter(matchedEntries, _.indexOf(matchedEntries, item));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function onLocationChanged(item) {
|
||||
|
||||
_.each(item.content, initItem);
|
||||
}
|
||||
|
||||
function onLocationRefreshed(item, added, removed) {
|
||||
|
||||
_.each(added, initItem);
|
||||
}
|
||||
|
||||
function init() {
|
||||
|
||||
if (!settings.enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
event.sub('location.changed', onLocationChanged);
|
||||
event.sub('location.refreshed', onLocationRefreshed);
|
||||
}
|
||||
|
||||
|
||||
init();
|
||||
});
|
@@ -1,124 +0,0 @@
|
||||
modulejs.define('ext/preview-vid', ['_', '$', 'core/settings', 'core/event', 'ext/preview'], function (_, $, allsettings, event, preview) {
|
||||
|
||||
var settings = _.extend({
|
||||
enabled: false,
|
||||
types: []
|
||||
}, allsettings['preview-vid']);
|
||||
|
||||
|
||||
function preloadVid(src, callback) {
|
||||
|
||||
var $video = $('<video/>')
|
||||
.one('loadedmetadata', function () {
|
||||
|
||||
callback($video);
|
||||
// setTimeout(function () { callback($video); }, 1000); // for testing
|
||||
})
|
||||
.attr('autoplay', 'autoplay')
|
||||
.attr('controls', 'controls')
|
||||
.attr('src', src);
|
||||
}
|
||||
|
||||
function onEnter(items, idx) {
|
||||
|
||||
var currentItems = items;
|
||||
var currentIdx = idx;
|
||||
var currentItem = items[idx];
|
||||
|
||||
function onAdjustSize() {
|
||||
|
||||
var $content = $('#pv-content'),
|
||||
$vid = $('#pv-vid-video');
|
||||
|
||||
if ($vid.length) {
|
||||
|
||||
$vid.css({
|
||||
'left': '' + (($content.width()-$vid.width())*0.5) + 'px',
|
||||
'top': '' + (($content.height()-$vid.height())*0.5) + 'px'
|
||||
});
|
||||
|
||||
preview.setLabels([
|
||||
currentItem.label,
|
||||
'' + $vid[0].videoWidth + 'x' + $vid[0].videoHeight,
|
||||
'' + (100 * $vid.width() / $vid[0].videoWidth).toFixed(0) + '%'
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
function onIdxChange(rel) {
|
||||
|
||||
currentIdx = (currentIdx + rel + currentItems.length) % currentItems.length;
|
||||
currentItem = currentItems[currentIdx];
|
||||
|
||||
var spinnerTimeout = setTimeout(function () { preview.showSpinner(true); }, 200);
|
||||
|
||||
if ($('#pv-vid-video').length) {
|
||||
$('#pv-vid-video')[0].pause();
|
||||
}
|
||||
preloadVid(currentItem.absHref, function ($preloaded_vid) {
|
||||
|
||||
clearTimeout(spinnerTimeout);
|
||||
preview.showSpinner(false);
|
||||
|
||||
$('#pv-content').fadeOut(100, function () {
|
||||
|
||||
$('#pv-content').empty().append($preloaded_vid.attr('id', 'pv-vid-video')).fadeIn(200);
|
||||
|
||||
// small timeout, so $preloaded_vid is visible and therefore $preloaded_vid.width is available
|
||||
setTimeout(function () {
|
||||
onAdjustSize();
|
||||
|
||||
preview.setIndex(currentIdx + 1, currentItems.length);
|
||||
preview.setRawLink(currentItem.absHref);
|
||||
}, 10);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
onIdxChange(0);
|
||||
preview.setOnIndexChange(onIdxChange);
|
||||
preview.setOnAdjustSize(onAdjustSize);
|
||||
preview.enter();
|
||||
}
|
||||
|
||||
function initItem(item) {
|
||||
|
||||
if (item.$view && _.indexOf(settings.types, item.type) >= 0) {
|
||||
item.$view.find('a').on('click', function (event) {
|
||||
|
||||
event.preventDefault();
|
||||
|
||||
var matchedEntries = _.compact(_.map($('#items .item'), function (item) {
|
||||
|
||||
item = $(item).data('item');
|
||||
return _.indexOf(settings.types, item.type) >= 0 ? item : null;
|
||||
}));
|
||||
|
||||
onEnter(matchedEntries, _.indexOf(matchedEntries, item));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function onLocationChanged(item) {
|
||||
|
||||
_.each(item.content, initItem);
|
||||
}
|
||||
|
||||
function onLocationRefreshed(item, added, removed) {
|
||||
|
||||
_.each(added, initItem);
|
||||
}
|
||||
|
||||
function init() {
|
||||
|
||||
if (!settings.enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
event.sub('location.changed', onLocationChanged);
|
||||
event.sub('location.refreshed', onLocationRefreshed);
|
||||
}
|
||||
|
||||
|
||||
init();
|
||||
});
|
@@ -1,241 +0,0 @@
|
||||
modulejs.define('ext/preview', ['_', '$', 'core/settings', 'core/resource', 'core/store'], function (_, $, allsettings, resource, store) {
|
||||
|
||||
var settings = _.extend({
|
||||
enabled: true
|
||||
}, allsettings.preview);
|
||||
var $window = $(window);
|
||||
var template =
|
||||
'<div id="pv-overlay">' +
|
||||
'<div id="pv-content"/>' +
|
||||
'<div id="pv-spinner"><img src="' + resource.image('spinner') + '"/></div>' +
|
||||
'<div id="pv-prev-area" class="hof"><img src="' + resource.image('preview-prev') + '"/></div>' +
|
||||
'<div id="pv-next-area" class="hof"><img src="' + resource.image('preview-next') + '"/></div>' +
|
||||
'<div id="pv-bottombar" class="clearfix hof">' +
|
||||
'<ul id="pv-buttons">' +
|
||||
'<li id="pv-bar-close" class="bar-right bar-button"><img src="' + resource.image('preview-close') + '"/></li>' +
|
||||
'<li id="pv-bar-raw" class="bar-right"><a class="bar-button" target="_blank"><img src="' + resource.image('preview-raw') + '"/></a></li>' +
|
||||
'<li id="pv-bar-fullscreen" class="bar-right bar-button"><img src="' + resource.image('preview-fullscreen') + '"/></li>' +
|
||||
'<li id="pv-bar-next" class="bar-right bar-button"><img src="' + resource.image('preview-next') + '"/></li>' +
|
||||
'<li id="pv-bar-idx" class="bar-right bar-label"/>' +
|
||||
'<li id="pv-bar-prev" class="bar-right bar-button"><img src="' + resource.image('preview-prev') + '"/></li>' +
|
||||
'</ul>' +
|
||||
'</div>' +
|
||||
'</div>';
|
||||
var storekey = 'ext/preview';
|
||||
var currentEntries = [];
|
||||
var currentIdx = 0;
|
||||
var isFullscreen = store.get(storekey) || false;
|
||||
var userAliveTimeoutId = null;
|
||||
var onIndexChange = null;
|
||||
var onAdjustSize = null;
|
||||
|
||||
|
||||
function adjustSize() {
|
||||
|
||||
var winWidth = $window.width();
|
||||
var winHeight = $window.height();
|
||||
var $container = $('#pv-content');
|
||||
var $spinner = $('#pv-spinner');
|
||||
var margin = isFullscreen ? 0 : 20;
|
||||
var barHeight = isFullscreen ? 0 : 48;
|
||||
|
||||
$container.css({
|
||||
width: winWidth - 2 * margin,
|
||||
height: winHeight - 2 * margin - barHeight,
|
||||
left: margin,
|
||||
top: margin
|
||||
});
|
||||
|
||||
$spinner.css({
|
||||
left: winWidth * 0.5,
|
||||
top: winHeight * 0.5
|
||||
});
|
||||
|
||||
if (isFullscreen) {
|
||||
$('#pv-overlay').addClass('fullscreen');
|
||||
$('#pv-bar-fullscreen').find('img').attr('src', resource.image('preview-no-fullscreen'));
|
||||
} else {
|
||||
$('#pv-overlay').removeClass('fullscreen');
|
||||
$('#pv-bar-fullscreen').find('img').attr('src', resource.image('preview-fullscreen'));
|
||||
}
|
||||
|
||||
if (_.isFunction(onAdjustSize)) {
|
||||
onAdjustSize(1);
|
||||
}
|
||||
}
|
||||
|
||||
function onEnter() {
|
||||
|
||||
$('#pv-content').empty();
|
||||
setLabels([]);
|
||||
$('#pv-overlay').stop(true, true).fadeIn(200);
|
||||
$window.on('keydown', onKeydown);
|
||||
|
||||
adjustSize();
|
||||
}
|
||||
|
||||
function onExit() {
|
||||
|
||||
$window.off('keydown', onKeydown);
|
||||
$('#pv-overlay').stop(true, true).fadeOut(200, function () {
|
||||
$('#pv-content').empty();
|
||||
setLabels([]);
|
||||
});
|
||||
}
|
||||
|
||||
function onNext() {
|
||||
|
||||
if (_.isFunction(onIndexChange)) {
|
||||
onIndexChange(1);
|
||||
}
|
||||
}
|
||||
|
||||
function onPrevious() {
|
||||
|
||||
if (_.isFunction(onIndexChange)) {
|
||||
onIndexChange(-1);
|
||||
}
|
||||
}
|
||||
|
||||
function userAlive() {
|
||||
|
||||
clearTimeout(userAliveTimeoutId);
|
||||
$('#pv-overlay .hof').stop(true, true).fadeIn(200);
|
||||
|
||||
if (isFullscreen) {
|
||||
userAliveTimeoutId = setTimeout(function () {
|
||||
|
||||
$('#pv-overlay .hof').stop(true, true).fadeOut(2000);
|
||||
}, 2000);
|
||||
}
|
||||
}
|
||||
|
||||
function onFullscreen() {
|
||||
|
||||
isFullscreen = !isFullscreen;
|
||||
store.put(storekey, isFullscreen);
|
||||
|
||||
userAlive();
|
||||
adjustSize();
|
||||
}
|
||||
|
||||
function onKeydown(ev) {
|
||||
|
||||
var key = ev.which;
|
||||
|
||||
if (key === 27) { // esc
|
||||
ev.preventDefault();
|
||||
ev.stopImmediatePropagation();
|
||||
onExit();
|
||||
} else if (key === 8 || key === 37) { // backspace, left
|
||||
ev.preventDefault();
|
||||
ev.stopImmediatePropagation();
|
||||
onPrevious();
|
||||
} else if (key === 13 || key === 32 || key === 39) { // enter, space, right
|
||||
ev.preventDefault();
|
||||
ev.stopImmediatePropagation();
|
||||
onNext();
|
||||
} else if (key === 70) { // f
|
||||
ev.preventDefault();
|
||||
ev.stopImmediatePropagation();
|
||||
onFullscreen();
|
||||
}
|
||||
}
|
||||
|
||||
function setIndex(idx, total) {
|
||||
|
||||
if (_.isNumber(idx)) {
|
||||
$('#pv-bar-idx').text('' + idx + (_.isNumber(total) ? '/' + total : '')).show();
|
||||
} else {
|
||||
$('#pv-bar-idx').text('').hide();
|
||||
}
|
||||
}
|
||||
|
||||
function setRawLink(href) {
|
||||
|
||||
if (href) {
|
||||
$('#pv-bar-raw').find('a').attr('href', href).end().show();
|
||||
} else {
|
||||
$('#pv-bar-raw').find('a').attr('href', '#').end().hide();
|
||||
}
|
||||
}
|
||||
|
||||
function setLabels(labels) {
|
||||
|
||||
$('#pv-buttons .bar-left').remove();
|
||||
_.each(labels, function (label) {
|
||||
|
||||
$('<li/>')
|
||||
.addClass('bar-left bar-label')
|
||||
.text(label)
|
||||
.appendTo('#pv-buttons');
|
||||
});
|
||||
}
|
||||
|
||||
function setOnIndexChange(fn) {
|
||||
|
||||
onIndexChange = fn;
|
||||
}
|
||||
|
||||
function setOnAdjustSize(fn) {
|
||||
|
||||
onAdjustSize = fn;
|
||||
}
|
||||
|
||||
function showSpinner(show, millis) {
|
||||
|
||||
if (!_.isNumber(millis)) {
|
||||
millis = 400;
|
||||
}
|
||||
|
||||
if (show) {
|
||||
$('#pv-spinner').stop(true, true).fadeIn(millis);
|
||||
} else {
|
||||
$('#pv-spinner').stop(true, true).fadeOut(millis);
|
||||
}
|
||||
}
|
||||
|
||||
function init() {
|
||||
|
||||
if (!settings.enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
$(template).appendTo('body');
|
||||
|
||||
$('#pv-spinner').hide();
|
||||
$('#pv-bar-prev, #pv-prev-area').on('click', onPrevious);
|
||||
$('#pv-bar-next, #pv-next-area').on('click', onNext);
|
||||
$('#pv-bar-close, #pv-close-area').on('click', onExit);
|
||||
$('#pv-bar-fullscreen').on('click', onFullscreen);
|
||||
|
||||
$('#pv-overlay')
|
||||
.on('keydown', onKeydown)
|
||||
.on('mousemove mousedown', userAlive)
|
||||
.on('click mousedown mousemove keydown keypress', function (ev) {
|
||||
|
||||
if (ev.type === 'click') {
|
||||
if (ev.target.id === 'pv-overlay' || ev.target.id === 'pv-content') {
|
||||
onExit();
|
||||
}
|
||||
}
|
||||
ev.stopImmediatePropagation();
|
||||
});
|
||||
|
||||
$window.on('resize load', adjustSize);
|
||||
}
|
||||
|
||||
|
||||
init();
|
||||
|
||||
return {
|
||||
enter: onEnter,
|
||||
exit: onExit,
|
||||
setIndex: setIndex,
|
||||
setRawLink: setRawLink,
|
||||
setLabels: setLabels,
|
||||
setOnIndexChange: setOnIndexChange,
|
||||
setOnAdjustSize: setOnAdjustSize,
|
||||
showSpinner: showSpinner
|
||||
};
|
||||
});
|
@@ -1,216 +0,0 @@
|
||||
modulejs.define('ext/select', ['_', '$', 'core/settings', 'core/resource', 'core/event'], function (_, $, allsettings, resource, event) {
|
||||
|
||||
var settings = _.extend({
|
||||
enabled: false,
|
||||
clickndrag: false,
|
||||
checkboxes: false
|
||||
}, allsettings.select);
|
||||
var template = '<span class="selector"><img src="' + resource.image('selected') + '" alt="selected"/></span>';
|
||||
var x = 0, y = 0;
|
||||
var l = 0, t = 0, w = 0, h = 0;
|
||||
var isDragSelect, isCtrlPressed;
|
||||
var shrink = 1/3;
|
||||
var $document = $(document);
|
||||
var $html = $('html');
|
||||
var $selectionRect = $('<div id="selection-rect"/>');
|
||||
|
||||
|
||||
function publish() {
|
||||
|
||||
var items = _.map($('#items .item.selected'), function (itemElement) {
|
||||
|
||||
return $(itemElement).data('item');
|
||||
});
|
||||
|
||||
event.pub('selection', items);
|
||||
}
|
||||
|
||||
function elementRect($element) {
|
||||
|
||||
if (!$element.is(':visible')) {
|
||||
return null;
|
||||
}
|
||||
|
||||
var offset = $element.offset();
|
||||
var l = offset.left;
|
||||
var t = offset.top;
|
||||
var w = $element.outerWidth();
|
||||
var h = $element.outerHeight();
|
||||
return {l: l, t: t, w: w, h: h, r: l + w, b: t + h};
|
||||
}
|
||||
|
||||
function doOverlap(rect1, rect2) {
|
||||
|
||||
if (!rect1 || !rect2) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var left = Math.max(rect1.l, rect2.l);
|
||||
var right = Math.min(rect1.r, rect2.r);
|
||||
var top = Math.max(rect1.t, rect2.t);
|
||||
var bottom = Math.min(rect1.b, rect2.b);
|
||||
var width = right - left;
|
||||
var height = bottom - top;
|
||||
|
||||
return (width >= 0 && height >= 0);
|
||||
}
|
||||
|
||||
function selectionUpdate(ev) {
|
||||
|
||||
l = Math.min(x, ev.pageX);
|
||||
t = Math.min(y, ev.pageY);
|
||||
w = Math.abs(x - ev.pageX);
|
||||
h = Math.abs(y - ev.pageY);
|
||||
|
||||
if (!isDragSelect && w < 4 && h < 4) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!isDragSelect && !isCtrlPressed) {
|
||||
$('#items .item').removeClass('selected');
|
||||
publish();
|
||||
}
|
||||
|
||||
isDragSelect = true;
|
||||
$html.addClass('drag-select');
|
||||
|
||||
ev.preventDefault();
|
||||
$selectionRect
|
||||
.stop(true, true)
|
||||
.css({left: l, top: t, width: w, height: h, opacity: 1})
|
||||
.show();
|
||||
|
||||
var selRect = elementRect($selectionRect);
|
||||
$('#items .item').removeClass('selecting').each(function () {
|
||||
|
||||
var $item = $(this);
|
||||
var inter = doOverlap(selRect, elementRect($item.find('a')));
|
||||
|
||||
if (inter && !$item.hasClass('folder-parent')) {
|
||||
$item.addClass('selecting');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function selectionEnd(ev) {
|
||||
|
||||
$document.off('mousemove', selectionUpdate);
|
||||
|
||||
if (!isDragSelect) {
|
||||
return;
|
||||
}
|
||||
|
||||
ev.preventDefault();
|
||||
$('#items .item.selecting.selected').removeClass('selecting').removeClass('selected');
|
||||
$('#items .item.selecting').removeClass('selecting').addClass('selected');
|
||||
publish();
|
||||
|
||||
$html.removeClass('drag-select');
|
||||
$selectionRect
|
||||
.stop(true, true)
|
||||
.animate(
|
||||
{
|
||||
left: l + w * 0.5 * shrink,
|
||||
top: t + h * 0.5 * shrink,
|
||||
width: w * (1 - shrink),
|
||||
height: h * (1 - shrink),
|
||||
opacity: 0
|
||||
},
|
||||
300,
|
||||
function () {
|
||||
$selectionRect.hide();
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
function selectionStart(ev) {
|
||||
|
||||
// only on left button and don't block scrollbar
|
||||
if (ev.button !== 0 || ev.offsetX >= $('#content').width() - 14) {
|
||||
return;
|
||||
}
|
||||
|
||||
isDragSelect = false;
|
||||
isCtrlPressed = ev.ctrlKey || ev.metaKey;
|
||||
x = ev.pageX;
|
||||
y = ev.pageY;
|
||||
|
||||
$document
|
||||
.on('mousemove', selectionUpdate)
|
||||
.one('mouseup', selectionEnd);
|
||||
}
|
||||
|
||||
function initItem(item) {
|
||||
|
||||
if (item.$view) {
|
||||
$(template)
|
||||
.appendTo(item.$view.find('a'))
|
||||
.on('click', function (ev) {
|
||||
|
||||
ev.stopImmediatePropagation();
|
||||
ev.preventDefault();
|
||||
|
||||
item.$view.toggleClass('selected');
|
||||
publish();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function onLocationChanged(item) {
|
||||
|
||||
if (settings.checkboxes) {
|
||||
_.each(item.content, initItem);
|
||||
}
|
||||
publish();
|
||||
}
|
||||
|
||||
function onLocationRefreshed(item, added, removed) {
|
||||
|
||||
var selectionChanged = false;
|
||||
|
||||
if (settings.checkboxes) {
|
||||
_.each(added, initItem);
|
||||
}
|
||||
_.each(removed, function (item) {
|
||||
|
||||
if (item.$view && item.$view.hasClass('selected')) {
|
||||
item.$view.removeClass('selected');
|
||||
selectionChanged = true;
|
||||
}
|
||||
});
|
||||
|
||||
if (selectionChanged) {
|
||||
publish();
|
||||
}
|
||||
}
|
||||
|
||||
function init() {
|
||||
|
||||
if (!settings.enabled || (!settings.clickndrag && !settings.checkboxes)) {
|
||||
return;
|
||||
}
|
||||
|
||||
event.sub('location.changed', onLocationChanged);
|
||||
event.sub('location.refreshed', onLocationRefreshed);
|
||||
|
||||
if (settings.clickndrag) {
|
||||
$selectionRect.hide().appendTo('body');
|
||||
|
||||
$('#content')
|
||||
.on('mousedown', selectionStart)
|
||||
.on('drag dragstart', function (ev) {
|
||||
|
||||
ev.stopImmediatePropagation();
|
||||
ev.preventDefault();
|
||||
})
|
||||
.on('click', function (ev) {
|
||||
|
||||
$('#items .item').removeClass('selected');
|
||||
publish();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
init();
|
||||
});
|
@@ -1,158 +0,0 @@
|
||||
modulejs.define('ext/sort', ['_', '$', 'core/settings', 'core/resource', 'core/event', 'core/store', 'core/util'], function (_, $, allsettings, resource, event, store, util) {
|
||||
|
||||
var settings = _.extend({
|
||||
enabled: false,
|
||||
column: 0,
|
||||
reverse: false,
|
||||
ignorecase: true,
|
||||
natural: false,
|
||||
folders: 0
|
||||
}, allsettings.sort);
|
||||
var storekey = 'ext/sort';
|
||||
var template = '<img src="' + resource.image('sort') + '" class="sort" alt="sort order" />';
|
||||
|
||||
|
||||
function getType(item) {
|
||||
|
||||
var $item = $(item);
|
||||
|
||||
if ($item.hasClass('folder-parent')) {
|
||||
return 0;
|
||||
}
|
||||
if ($item.hasClass('folder')) {
|
||||
if (settings.folders === 1) {
|
||||
return 2;
|
||||
} else if (settings.folders === 2) {
|
||||
return 3;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
return 2;
|
||||
}
|
||||
|
||||
function getName(item) {
|
||||
|
||||
return $(item).find('.label').text();
|
||||
}
|
||||
|
||||
function getTime(item) {
|
||||
|
||||
return $(item).find('.date').data('time');
|
||||
}
|
||||
|
||||
function getSize(item) {
|
||||
|
||||
return $(item).find('.size').data('bytes');
|
||||
}
|
||||
|
||||
|
||||
var columnGetters = {
|
||||
0: getName,
|
||||
1: getTime,
|
||||
2: getSize
|
||||
};
|
||||
var columnClasses = {
|
||||
0: 'label',
|
||||
1: 'date',
|
||||
2: 'size'
|
||||
};
|
||||
|
||||
|
||||
function cmpFn(getValue, reverse, ignorecase, natural) {
|
||||
|
||||
return function (item1, item2) {
|
||||
|
||||
var res, val1, val2;
|
||||
|
||||
res = getType(item1) - getType(item2);
|
||||
if (res !== 0) {
|
||||
return res;
|
||||
}
|
||||
|
||||
val1 = getValue(item1);
|
||||
val2 = getValue(item2);
|
||||
|
||||
if (isNaN(val1) || isNaN(val2)) {
|
||||
val1 = '' + val1;
|
||||
val2 = '' + val2;
|
||||
|
||||
if (ignorecase) {
|
||||
val1 = val1.toLowerCase();
|
||||
val2 = val2.toLowerCase();
|
||||
}
|
||||
}
|
||||
|
||||
res = natural ? util.naturalCmpFn(val1, val2) : util.regularCmpFn(val1, val2);
|
||||
return reverse ? -res : res;
|
||||
};
|
||||
}
|
||||
|
||||
function sortItems(column, reverse) {
|
||||
|
||||
var headers = $('#items li.header a');
|
||||
var header = $('#items li.header a.' + columnClasses[column]);
|
||||
var fn = cmpFn(columnGetters[column], reverse, settings.ignorecase, column === 0 && settings.natural);
|
||||
var current = $('#items .item');
|
||||
var sorted = $('#items .item').sort(fn);
|
||||
|
||||
store.put(storekey, {column: column, reverse: reverse});
|
||||
|
||||
headers.removeClass('ascending descending');
|
||||
header.addClass(reverse ? 'descending' : 'ascending');
|
||||
|
||||
for (var i = 0, l = current.length; i < l; i += 1) {
|
||||
if (current[i] !== sorted[i]) {
|
||||
sorted.detach().sort(fn).appendTo('#items');
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function onContentChanged(item) {
|
||||
|
||||
var order = store.get(storekey);
|
||||
var column = order && order.column || settings.column;
|
||||
var reverse = order && order.reverse || settings.reverse;
|
||||
|
||||
sortItems(column, reverse);
|
||||
}
|
||||
|
||||
function init() {
|
||||
|
||||
if (!settings.enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
$('#items li.header')
|
||||
|
||||
.find('a.label')
|
||||
.append(template)
|
||||
.click(function (ev) {
|
||||
sortItems(0, $(this).hasClass('ascending'));
|
||||
ev.preventDefault();
|
||||
})
|
||||
.end()
|
||||
|
||||
.find('a.date')
|
||||
.prepend(template)
|
||||
.click(function (ev) {
|
||||
sortItems(1, $(this).hasClass('ascending'));
|
||||
ev.preventDefault();
|
||||
})
|
||||
.end()
|
||||
|
||||
.find('a.size')
|
||||
.prepend(template)
|
||||
.click(function (ev) {
|
||||
sortItems(2, $(this).hasClass('ascending'));
|
||||
ev.preventDefault();
|
||||
})
|
||||
.end();
|
||||
|
||||
event.sub('location.changed', onContentChanged);
|
||||
event.sub('location.refreshed', onContentChanged);
|
||||
}
|
||||
|
||||
|
||||
init();
|
||||
});
|
@@ -1,91 +0,0 @@
|
||||
modulejs.define('ext/thumbnails', ['_', 'core/settings', 'core/event', 'core/server', 'core/resource'], function (_, allsettings, event, server, resource) {
|
||||
|
||||
var settings = _.extend({
|
||||
enabled: false,
|
||||
img: ['img-bmp', 'img-gif', 'img-ico', 'img-jpg', 'img-png'],
|
||||
mov: ['vid-avi', 'vid-flv', 'vid-mkv', 'vid-mov', 'vid-mp4', 'vid-mpg', 'vid-webm'],
|
||||
doc: ['x-pdf', 'x-ps'],
|
||||
delay: 1,
|
||||
size: 100,
|
||||
exif: true
|
||||
}, allsettings.thumbnails);
|
||||
|
||||
|
||||
function requestThumb(type, href, ratio, callback) {
|
||||
|
||||
server.request({
|
||||
action: 'getThumbHref',
|
||||
type: type,
|
||||
href: href,
|
||||
width: Math.round(settings.size * ratio),
|
||||
height: settings.size
|
||||
}, function (json) {
|
||||
|
||||
callback(json && json.code === 0 ? json.absHref : null);
|
||||
});
|
||||
}
|
||||
|
||||
function checkItem(item) {
|
||||
|
||||
var type = null;
|
||||
|
||||
if (_.contains(settings.img, item.type)) {
|
||||
type = 'img';
|
||||
} else if (_.contains(settings.mov, item.type)) {
|
||||
type = 'mov';
|
||||
} else if (_.contains(settings.doc, item.type)) {
|
||||
type = 'doc';
|
||||
}
|
||||
|
||||
if (type) {
|
||||
if (item.thumbSquare) {
|
||||
item.$view.find('.icon.square img').addClass('thumb').attr('src', item.thumbSquare);
|
||||
} else {
|
||||
requestThumb(type, item.absHref, 1, function (src) {
|
||||
|
||||
if (src && item.$view) {
|
||||
item.thumbSquare = src;
|
||||
item.$view.find('.icon.square img').addClass('thumb').attr('src', src);
|
||||
}
|
||||
});
|
||||
}
|
||||
if (item.thumbRational) {
|
||||
item.$view.find('.icon.landscape img').addClass('thumb').attr('src', item.thumbRational);
|
||||
} else {
|
||||
requestThumb(type, item.absHref, 4/3, function (src) {
|
||||
|
||||
if (src && item.$view) {
|
||||
item.thumbRational = src;
|
||||
item.$view.find('.icon.landscape img').addClass('thumb').attr('src', src);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function onLocationChanged(item) {
|
||||
|
||||
setTimeout(function () {
|
||||
|
||||
_.each(item.content, checkItem);
|
||||
}, settings.delay);
|
||||
}
|
||||
|
||||
function onLocationRefreshed(item, added, removed) {
|
||||
|
||||
_.each(added, checkItem);
|
||||
}
|
||||
|
||||
function init() {
|
||||
|
||||
if (!settings.enabled || !server.api) {
|
||||
return;
|
||||
}
|
||||
|
||||
event.sub('location.changed', onLocationChanged);
|
||||
event.sub('location.refreshed', onLocationRefreshed);
|
||||
}
|
||||
|
||||
|
||||
init();
|
||||
});
|
@@ -1,29 +0,0 @@
|
||||
modulejs.define('ext/title', ['_', 'core/settings', 'core/event'], function (_, allsettings, event) {
|
||||
|
||||
var settings = _.extend({
|
||||
enabled: false
|
||||
}, allsettings.title);
|
||||
|
||||
function onLocationChanged(item) {
|
||||
|
||||
var labels = _.pluck(item.getCrumb(), 'label'),
|
||||
title = labels.join(' > ');
|
||||
|
||||
if (labels.length > 1) {
|
||||
title = labels[labels.length - 1] + ' - ' + title;
|
||||
}
|
||||
|
||||
document.title = title;
|
||||
}
|
||||
|
||||
function init() {
|
||||
|
||||
if (!settings.enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
event.sub('location.changed', onLocationChanged);
|
||||
}
|
||||
|
||||
init();
|
||||
});
|
@@ -1,218 +0,0 @@
|
||||
modulejs.define('ext/tree', ['_', '$', 'core/settings', 'core/resource', 'core/store', 'core/event', 'core/location', 'core/util'], function (_, $, allsettings, resource, store, event, location, util) {
|
||||
|
||||
var settings = _.extend({
|
||||
enabled: false,
|
||||
show: true,
|
||||
maxSubfolders: 50,
|
||||
naturalSort: false
|
||||
}, allsettings.tree);
|
||||
var template =
|
||||
'<div class="item">' +
|
||||
'<span class="indicator none">' +
|
||||
'<img src="' + resource.image('tree-indicator') + '"/>' +
|
||||
'</span>' +
|
||||
'<a>' +
|
||||
'<span class="icon"><img/></span>' +
|
||||
'<span class="label"/>' +
|
||||
'</a>' +
|
||||
'</span>';
|
||||
var settingsTemplate =
|
||||
'<div class="block">' +
|
||||
'<h1 class="l10n-tree">Tree</h1>' +
|
||||
'<div id="view-tree" class="button view">' +
|
||||
'<img src="' + resource.image('tree-toggle') + '" alt="view-tree"/>' +
|
||||
'</div>' +
|
||||
'</div>';
|
||||
var storekey = 'ext/tree';
|
||||
|
||||
|
||||
function cmpFn(item1, item2) {
|
||||
|
||||
var val1 = item1.label;
|
||||
var val2 = item2.label;
|
||||
|
||||
return settings.natural ? util.naturalCmpFn(val1, val2) : util.regularCmpFn(val1, val2);
|
||||
}
|
||||
|
||||
function update(item) {
|
||||
|
||||
var $html = $(template);
|
||||
var $indicator = $html.find('.indicator');
|
||||
var $a = $html.find('a');
|
||||
var $img = $html.find('.icon img');
|
||||
var $label = $html.find('.label');
|
||||
|
||||
$html
|
||||
.addClass(item.isFolder() ? 'folder' : 'file')
|
||||
.data('item', item);
|
||||
|
||||
location.setLink($a, item);
|
||||
$img.attr('src', resource.icon('folder'));
|
||||
$label.text(item.label);
|
||||
|
||||
if (item.isFolder()) {
|
||||
|
||||
var subfolders = item.getSubfolders();
|
||||
|
||||
// indicator
|
||||
if ((item.isManaged && !item.isContentFetched) || subfolders.length) {
|
||||
|
||||
$indicator.removeClass('none');
|
||||
|
||||
if ((item.isManaged && !item.isContentFetched)) {
|
||||
$indicator.addClass('unknown');
|
||||
} else if (item.isContentVisible) {
|
||||
$indicator.addClass('open');
|
||||
} else {
|
||||
$indicator.addClass('close');
|
||||
}
|
||||
}
|
||||
|
||||
// is it the current folder?
|
||||
if (item.isCurrentFolder()) {
|
||||
$html.addClass('active');
|
||||
}
|
||||
|
||||
// does it have subfolders?
|
||||
if (subfolders.length) {
|
||||
subfolders.sort(cmpFn);
|
||||
|
||||
var $ul = $('<ul class="content"/>').appendTo($html);
|
||||
var counter = 0;
|
||||
_.each(subfolders, function (e) {
|
||||
counter += 1;
|
||||
if (counter <= settings.maxSubfolders) {
|
||||
$('<li/>').append(update(e)).appendTo($ul);
|
||||
}
|
||||
});
|
||||
if (subfolders.length > settings.maxSubfolders) {
|
||||
$('<li class="summary">… ' + (subfolders.length - settings.maxSubfolders) + ' more subfolders</li>').appendTo($ul);
|
||||
}
|
||||
if (!item.isContentVisible) {
|
||||
$ul.hide();
|
||||
}
|
||||
}
|
||||
|
||||
// reflect folder status
|
||||
if (!item.isManaged) {
|
||||
$img.attr('src', resource.icon('folder-page'));
|
||||
}
|
||||
}
|
||||
|
||||
if (item.$tree) {
|
||||
item.$tree.replaceWith($html);
|
||||
}
|
||||
item.$tree = $html;
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
||||
function createOnIndicatorClick() {
|
||||
|
||||
var $tree = $('#tree');
|
||||
|
||||
function slide(item, $indicator, $content, down) {
|
||||
|
||||
item.isContentVisible = down;
|
||||
$indicator.removeClass('open close').addClass(down ? 'open' : 'close');
|
||||
$content[down ? 'slideDown' : 'slideUp']();
|
||||
}
|
||||
|
||||
return function () {
|
||||
|
||||
var $indicator = $(this);
|
||||
var $item = $indicator.closest('.item');
|
||||
var item = $item.data('item');
|
||||
var $content = $item.find('> ul.content');
|
||||
|
||||
if ($indicator.hasClass('unknown')) {
|
||||
|
||||
item.fetchContent(function (item) {
|
||||
|
||||
item.isContentVisible = false;
|
||||
|
||||
var $item = update(item);
|
||||
var $indicator = $item.find('> .indicator');
|
||||
var $content = $item.find('> ul.content');
|
||||
|
||||
if (!$indicator.hasClass('none')) {
|
||||
slide(item, $indicator, $content, true);
|
||||
}
|
||||
});
|
||||
|
||||
} else if ($indicator.hasClass('open')) {
|
||||
|
||||
slide(item, $indicator, $content, false);
|
||||
|
||||
} else if ($indicator.hasClass('close')) {
|
||||
|
||||
slide(item, $indicator, $content, true);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
function fetchTree(item, callback) {
|
||||
|
||||
item.isContentVisible = true;
|
||||
item.fetchContent(function (item) {
|
||||
|
||||
if (item.parent) {
|
||||
fetchTree(item.parent, callback);
|
||||
} else {
|
||||
callback(item);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function updateSettings() {
|
||||
|
||||
if (store.get(storekey)) {
|
||||
$('#view-tree').addClass('active');
|
||||
$('#tree').show();
|
||||
} else {
|
||||
$('#view-tree').removeClass('active');
|
||||
$('#tree').hide();
|
||||
}
|
||||
}
|
||||
|
||||
function onLocationChanged(item) {
|
||||
|
||||
fetchTree(item, function (root) {
|
||||
|
||||
$('#tree').append(update(root));
|
||||
updateSettings();
|
||||
});
|
||||
}
|
||||
|
||||
function init() {
|
||||
|
||||
if (!settings.enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
$('<div id="tree"/>')
|
||||
.appendTo('#main-row')
|
||||
.on('click', '.indicator', createOnIndicatorClick());
|
||||
|
||||
$(settingsTemplate)
|
||||
.appendTo('#settings')
|
||||
.find('#view-tree')
|
||||
.on('click', function (ev) {
|
||||
|
||||
store.put(storekey, !store.get(storekey));
|
||||
updateSettings();
|
||||
ev.preventDefault();
|
||||
});
|
||||
|
||||
// ensure stored value is boolean, otherwise set default
|
||||
if (typeof(store.get(storekey)) !== 'boolean') {
|
||||
store.put(storekey, settings.show);
|
||||
}
|
||||
updateSettings();
|
||||
|
||||
event.sub('location.changed', onLocationChanged);
|
||||
}
|
||||
|
||||
|
||||
init();
|
||||
});
|
@@ -1,179 +0,0 @@
|
||||
modulejs.define('info', ['$', 'config'], function ($, config) {
|
||||
|
||||
var testsTemp =
|
||||
'<ul id="tests">';
|
||||
var testTemp =
|
||||
'<li class="test">' +
|
||||
'<span class="label"></span>' +
|
||||
'<span class="result"></span>' +
|
||||
'<div class="info"></div>' +
|
||||
'</li>';
|
||||
var loginTemp =
|
||||
'<div id="login-wrapper">' +
|
||||
'<input id="pass" type="password" placeholder="password"/>' +
|
||||
'<span id="login">login</span>' +
|
||||
'<span id="logout">logout</span>' +
|
||||
'<div id="hint">' +
|
||||
'The preset password is the empty string, so just hit login. ' +
|
||||
'You might change it in the index file to keep this information private.' +
|
||||
'</div>' +
|
||||
'</div>';
|
||||
var setup = config.setup;
|
||||
|
||||
|
||||
function addTest(label, info, passed, result) {
|
||||
|
||||
$(testTemp)
|
||||
.find('.label')
|
||||
.text(label)
|
||||
.end()
|
||||
.find('.result')
|
||||
.addClass(passed ? 'passed' : 'failed')
|
||||
.text(result ? result : (passed ? 'yes' : 'no'))
|
||||
.end()
|
||||
.find('.info')
|
||||
.html(info)
|
||||
.end()
|
||||
.appendTo('#tests');
|
||||
}
|
||||
|
||||
function addTests() {
|
||||
|
||||
$(testsTemp).appendTo('#content');
|
||||
|
||||
addTest(
|
||||
'h5ai version', 'Only green if this is an official h5ai release',
|
||||
setup.VERSION.indexOf('+') < 0, setup.VERSION
|
||||
);
|
||||
|
||||
addTest(
|
||||
'Index file found', 'Add <code>' + setup.INDEX_HREF + '</code> to your index file list',
|
||||
setup.INDEX_HREF
|
||||
);
|
||||
|
||||
addTest(
|
||||
'Options parsable', 'File <code>options.json</code> is readable and syntax is correct',
|
||||
config.options !== null
|
||||
);
|
||||
|
||||
addTest(
|
||||
'Types parsable', 'File <code>types.json</code> is readable and syntax is correct',
|
||||
config.types !== null
|
||||
);
|
||||
|
||||
addTest(
|
||||
'Server software', 'Server is one of apache, lighttpd, nginx or cherokee',
|
||||
setup.HAS_SERVER, setup.SERVER_NAME + ' ' + setup.SERVER_VERSION
|
||||
);
|
||||
|
||||
addTest(
|
||||
'PHP version', 'PHP version >= ' + setup.MIN_PHP_VERSION,
|
||||
setup.HAS_PHP_VERSION, setup.PHP_VERSION
|
||||
);
|
||||
|
||||
addTest(
|
||||
'Cache directory', 'Web server has write access',
|
||||
setup.HAS_WRITABLE_CACHE
|
||||
);
|
||||
|
||||
addTest(
|
||||
'Image thumbs', 'PHP GD extension with JPEG support available',
|
||||
setup.HAS_PHP_JPG
|
||||
);
|
||||
|
||||
addTest(
|
||||
'Use EXIF thumbs', 'PHP EXIF extension available',
|
||||
setup.HAS_PHP_EXIF
|
||||
);
|
||||
|
||||
addTest(
|
||||
'Movie thumbs', 'Command line program <code>avconv</code> or <code>ffmpeg</code> available',
|
||||
setup.HAS_CMD_AVCONV || setup.HAS_CMD_FFMPEG
|
||||
);
|
||||
|
||||
addTest(
|
||||
'PDF thumbs', 'Command line program <code>convert</code> available',
|
||||
setup.HAS_CMD_CONVERT
|
||||
);
|
||||
|
||||
addTest(
|
||||
'Shell tar', 'Command line program <code>tar</code> available',
|
||||
setup.HAS_CMD_TAR
|
||||
);
|
||||
|
||||
addTest(
|
||||
'Shell zip', 'Command line program <code>zip</code> available',
|
||||
setup.HAS_CMD_ZIP
|
||||
);
|
||||
|
||||
addTest(
|
||||
'Shell du', 'Command line program <code>du</code> available',
|
||||
setup.HAS_CMD_DU
|
||||
);
|
||||
}
|
||||
|
||||
function request(data) {
|
||||
|
||||
$.ajax({
|
||||
url: 'server/php/index.php',
|
||||
type: 'POST',
|
||||
dataType: 'JSON',
|
||||
data: data
|
||||
})
|
||||
.always(function () {
|
||||
|
||||
window.location.reload();
|
||||
});
|
||||
}
|
||||
|
||||
function onLogin() {
|
||||
|
||||
request({
|
||||
'action': 'login',
|
||||
'pass': $('#pass').val()
|
||||
});
|
||||
}
|
||||
|
||||
function onLogout() {
|
||||
|
||||
request({
|
||||
'action': 'logout'
|
||||
});
|
||||
}
|
||||
|
||||
function onKeydown(event) {
|
||||
|
||||
if (event.which === 13) {
|
||||
onLogin();
|
||||
}
|
||||
}
|
||||
|
||||
function addLogin() {
|
||||
|
||||
$(loginTemp).appendTo('#content');
|
||||
|
||||
if (setup.AS_ADMIN) {
|
||||
$('#pass').remove();
|
||||
$('#login').remove();
|
||||
$('#logout').on('click', onLogout);
|
||||
} else {
|
||||
$('#pass').on('keydown', onKeydown).focus();
|
||||
$('#login').on('click', onLogin);
|
||||
$('#logout').remove();
|
||||
}
|
||||
if (setup.HAS_CUSTOM_PASSHASH) {
|
||||
$('#hint').remove();
|
||||
}
|
||||
}
|
||||
|
||||
function init() {
|
||||
|
||||
addLogin();
|
||||
if (setup.AS_ADMIN) {
|
||||
addTests();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
init();
|
||||
});
|
@@ -1,16 +0,0 @@
|
||||
modulejs.define('main', ['_', 'core/event'], function (_, event) {
|
||||
|
||||
modulejs.require('view/ensure');
|
||||
modulejs.require('view/items');
|
||||
modulejs.require('view/sidebar');
|
||||
modulejs.require('view/viewmode');
|
||||
|
||||
_.each(modulejs.state(), function (state, id) {
|
||||
|
||||
if (id.indexOf('ext/') === 0) {
|
||||
modulejs.require(id);
|
||||
}
|
||||
});
|
||||
|
||||
event.pub('ready');
|
||||
});
|
@@ -1,242 +0,0 @@
|
||||
modulejs.define('model/item', ['_', 'core/types', 'core/event', 'core/settings', 'core/server', 'core/location'], function (_, types, event, settings, server, location) {
|
||||
|
||||
var reEndsWithSlash = /\/$/;
|
||||
var reSplitPath = /^(.*\/)([^\/]+\/?)$/;
|
||||
var cache = {};
|
||||
|
||||
|
||||
function startsWith(sequence, part) {
|
||||
|
||||
return sequence.slice && part.length && sequence.slice(0, part.length) === part;
|
||||
}
|
||||
|
||||
function createLabel(sequence) {
|
||||
|
||||
sequence = sequence.replace(reEndsWithSlash, '');
|
||||
try { sequence = decodeURIComponent(sequence); } catch (e) {}
|
||||
return sequence;
|
||||
}
|
||||
|
||||
function splitPath(sequence) {
|
||||
|
||||
if (sequence === '/') {
|
||||
return { parent: null, name: '/' };
|
||||
}
|
||||
|
||||
var match = reSplitPath.exec(sequence);
|
||||
if (match) {
|
||||
var split = { parent: match[1], name: match[2] };
|
||||
|
||||
if (split.parent && !startsWith(split.parent, settings.rootHref)) {
|
||||
split.parent = null;
|
||||
}
|
||||
return split;
|
||||
}
|
||||
}
|
||||
|
||||
function getItem(absHref, time, size, isManaged, isContentFetched, md5, sha1) {
|
||||
|
||||
absHref = location.forceEncoding(absHref);
|
||||
|
||||
if (!startsWith(absHref, settings.rootHref)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
var self = cache[absHref] || new Item(absHref);
|
||||
|
||||
if (_.isNumber(time)) {
|
||||
self.time = time;
|
||||
}
|
||||
if (_.isNumber(size)) {
|
||||
self.size = size;
|
||||
}
|
||||
if (isManaged) {
|
||||
self.isManaged = true;
|
||||
}
|
||||
if (isContentFetched) {
|
||||
self.isContentFetched = true;
|
||||
}
|
||||
if (md5) {
|
||||
self.md5 = md5;
|
||||
}
|
||||
if (sha1) {
|
||||
self.sha1 = sha1;
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
function removeItem(absHref) {
|
||||
|
||||
absHref = location.forceEncoding(absHref);
|
||||
|
||||
var self = cache[absHref];
|
||||
|
||||
if (self) {
|
||||
delete cache[absHref];
|
||||
if (self.parent) {
|
||||
delete self.parent.content[self.absHref];
|
||||
}
|
||||
_.each(self.content, function (item) {
|
||||
|
||||
removeItem(item.absHref);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function fetchContent(absHref, callback) {
|
||||
|
||||
var self = getItem(absHref);
|
||||
|
||||
if (!_.isFunction(callback)) {
|
||||
callback = function () {};
|
||||
}
|
||||
|
||||
if (self.isContentFetched) {
|
||||
callback(self);
|
||||
} else {
|
||||
server.request({action: 'get', items: true, itemsHref: self.absHref, itemsWhat: 1}, function (response) {
|
||||
|
||||
if (response.items) {
|
||||
_.each(response.items, function (item) {
|
||||
getItem(item.absHref, item.time, item.size, item.is_managed, item.content, item.md5, item.sha1);
|
||||
});
|
||||
}
|
||||
|
||||
callback(self);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function Item(absHref) {
|
||||
|
||||
var split = splitPath(absHref);
|
||||
|
||||
cache[absHref] = this;
|
||||
|
||||
this.absHref = absHref;
|
||||
this.type = types.getType(absHref);
|
||||
this.label = createLabel(absHref === '/' ? location.getDomain() : split.name);
|
||||
this.time = null;
|
||||
this.size = null;
|
||||
this.parent = null;
|
||||
this.isManaged = null;
|
||||
this.content = {};
|
||||
|
||||
if (split.parent) {
|
||||
this.parent = getItem(split.parent);
|
||||
this.parent.content[this.absHref] = this;
|
||||
if (_.keys(this.parent.content).length > 1) {
|
||||
this.parent.isContentFetched = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_.extend(Item.prototype, {
|
||||
|
||||
isFolder: function () {
|
||||
|
||||
return reEndsWithSlash.test(this.absHref);
|
||||
},
|
||||
|
||||
isCurrentFolder: function () {
|
||||
|
||||
return this.absHref === location.getAbsHref();
|
||||
},
|
||||
|
||||
isInCurrentFolder: function () {
|
||||
|
||||
return !!this.parent && this.parent.isCurrentFolder();
|
||||
},
|
||||
|
||||
isCurrentParentFolder: function () {
|
||||
|
||||
return this === getItem(location.getAbsHref()).parent;
|
||||
},
|
||||
|
||||
isDomain: function () {
|
||||
|
||||
return this.absHref === '/';
|
||||
},
|
||||
|
||||
isRoot: function () {
|
||||
|
||||
return this.absHref === settings.rootHref;
|
||||
},
|
||||
|
||||
isH5ai: function () {
|
||||
|
||||
return this.absHref === settings.appHref;
|
||||
},
|
||||
|
||||
isEmpty: function () {
|
||||
|
||||
return _.keys(this.content).length === 0;
|
||||
},
|
||||
|
||||
fetchContent: function (callback) {
|
||||
|
||||
return fetchContent(this.absHref, callback);
|
||||
},
|
||||
|
||||
getCrumb: function () {
|
||||
|
||||
var item = this;
|
||||
var crumb = [item];
|
||||
|
||||
while (item.parent) {
|
||||
item = item.parent;
|
||||
crumb.unshift(item);
|
||||
}
|
||||
|
||||
return crumb;
|
||||
},
|
||||
|
||||
getSubfolders: function () {
|
||||
|
||||
return _.sortBy(_.filter(this.content, function (item) {
|
||||
|
||||
return item.isFolder();
|
||||
}), function (item) {
|
||||
|
||||
return item.label.toLowerCase();
|
||||
});
|
||||
},
|
||||
|
||||
getStats: function () {
|
||||
|
||||
var folders = 0;
|
||||
var files = 0;
|
||||
|
||||
_.each(this.content, function (item) {
|
||||
|
||||
if (item.isFolder()) {
|
||||
folders += 1;
|
||||
} else {
|
||||
files += 1;
|
||||
}
|
||||
});
|
||||
|
||||
var depth = 0;
|
||||
var item = this;
|
||||
|
||||
while (item.parent) {
|
||||
depth += 1;
|
||||
item = item.parent;
|
||||
}
|
||||
|
||||
return {
|
||||
folders: folders,
|
||||
files: files,
|
||||
depth: depth
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
return {
|
||||
get: getItem,
|
||||
remove: removeItem
|
||||
};
|
||||
});
|
@@ -1,31 +0,0 @@
|
||||
modulejs.define('view/ensure', ['$', 'config', 'core/event'], function ($, config, event) {
|
||||
|
||||
var templateTopbar =
|
||||
'<div id="topbar">' +
|
||||
'<div id="toolbar"/>' +
|
||||
'<div id="crumbbar"/>' +
|
||||
'</div>';
|
||||
var templateMainRow =
|
||||
'<div id="main-row">' +
|
||||
'<div id="sidebar">' +
|
||||
'<div id="settings"/>' +
|
||||
'</div>' +
|
||||
'</div>';
|
||||
var templateBacklink =
|
||||
'<a id="backlink" href="http://larsjung.de/h5ai/" title="powered by h5ai ' + config.setup.VERSION + '">' +
|
||||
'<div>powered</div>' +
|
||||
'<div>by h5ai</div>' +
|
||||
'</a>';
|
||||
|
||||
|
||||
function init() {
|
||||
|
||||
$('#fallback, #fallback-hints').remove();
|
||||
$(templateTopbar).appendTo('body');
|
||||
$(templateMainRow).appendTo('body');
|
||||
$(templateBacklink).appendTo('#topbar');
|
||||
}
|
||||
|
||||
|
||||
init();
|
||||
});
|
@@ -1,169 +0,0 @@
|
||||
modulejs.define('view/items', ['_', '$', 'core/settings', 'core/resource', 'core/format', 'core/event', 'core/location'], function (_, $, allsettings, resource, format, event, location) {
|
||||
|
||||
var settings = _.extend({
|
||||
binaryPrefix: false,
|
||||
hideFolders: false,
|
||||
hideParentFolder: false,
|
||||
setParentFolderLabels: false
|
||||
}, allsettings.view);
|
||||
var itemTemplate =
|
||||
'<li class="item">' +
|
||||
'<a>' +
|
||||
'<span class="icon square"><img/></span>' +
|
||||
'<span class="icon landscape"><img/></span>' +
|
||||
'<span class="label"/>' +
|
||||
'<span class="date"/>' +
|
||||
'<span class="size"/>' +
|
||||
'</a>' +
|
||||
'</li>';
|
||||
var hintTemplate = '<span class="hint"/>';
|
||||
var contentTemplate =
|
||||
'<div id="content">' +
|
||||
'<div id="view">' +
|
||||
'<ul id="items" class="clearfix">' +
|
||||
'<li class="header">' +
|
||||
'<a class="icon"/>' +
|
||||
'<a class="label" href="#"><span class="l10n-name"/></a>' +
|
||||
'<a class="date" href="#"><span class="l10n-lastModified"/></a>' +
|
||||
'<a class="size" href="#"><span class="l10n-size"/></a>' +
|
||||
'</li>' +
|
||||
'</ul>' +
|
||||
'<div class="empty l10n-empty"/>' +
|
||||
'</div>' +
|
||||
'</div>';
|
||||
|
||||
|
||||
function update(item, force) {
|
||||
|
||||
if (!force && item.$view) {
|
||||
return item.$view;
|
||||
}
|
||||
|
||||
var $html = $(itemTemplate);
|
||||
var $a = $html.find('a');
|
||||
var $iconImg = $html.find('.icon img');
|
||||
var $label = $html.find('.label');
|
||||
var $date = $html.find('.date');
|
||||
var $size = $html.find('.size');
|
||||
|
||||
$html
|
||||
.addClass(item.isFolder() ? 'folder' : 'file')
|
||||
.data('item', item);
|
||||
|
||||
location.setLink($a, item);
|
||||
|
||||
$label.text(item.label).attr('title', item.label);
|
||||
$date.data('time', item.time).text(format.formatDate(item.time));
|
||||
$size.data('bytes', item.size).text(format.formatSize(item.size));
|
||||
item.icon = resource.icon(item.type);
|
||||
|
||||
if (item.isFolder() && !item.isManaged) {
|
||||
$html.addClass('page');
|
||||
item.icon = resource.icon('folder-page');
|
||||
}
|
||||
|
||||
if (item.isCurrentParentFolder()) {
|
||||
item.icon = resource.icon('folder-parent');
|
||||
if (!settings.setParentFolderLabels) {
|
||||
$label.addClass('l10n-parentDirectory');
|
||||
}
|
||||
$html.addClass('folder-parent');
|
||||
}
|
||||
$iconImg.attr('src', item.icon).attr('alt', item.type);
|
||||
|
||||
if (item.$view) {
|
||||
item.$view.replaceWith($html);
|
||||
}
|
||||
item.$view = $html;
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
||||
function onMouseenter() {
|
||||
|
||||
var item = $(this).closest('.item').data('item');
|
||||
event.pub('item.mouseenter', item);
|
||||
}
|
||||
|
||||
function onMouseleave() {
|
||||
|
||||
var item = $(this).closest('.item').data('item');
|
||||
event.pub('item.mouseleave', item);
|
||||
}
|
||||
|
||||
function onLocationChanged(item) {
|
||||
|
||||
var $items = $('#items');
|
||||
var $empty = $('#view').find('.empty');
|
||||
|
||||
$items.find('.item').remove();
|
||||
|
||||
if (item.parent && !settings.hideParentFolder) {
|
||||
$items.append(update(item.parent, true));
|
||||
}
|
||||
|
||||
_.each(item.content, function (e) {
|
||||
|
||||
if (!(e.isFolder() && settings.hideFolders)) {
|
||||
$items.append(update(e, true));
|
||||
}
|
||||
});
|
||||
|
||||
if (item.isEmpty()) {
|
||||
$empty.show();
|
||||
} else {
|
||||
$empty.hide();
|
||||
}
|
||||
|
||||
$('html,body').scrollLeft(0).scrollTop(0);
|
||||
}
|
||||
|
||||
function onLocationRefreshed(item, added, removed) {
|
||||
|
||||
var $items = $('#items');
|
||||
var $empty = $('#view').find('.empty');
|
||||
|
||||
_.each(added, function (item) {
|
||||
|
||||
if (!(item.isFolder() && settings.hideFolders)) {
|
||||
update(item, true).hide().appendTo($items).fadeIn(400);
|
||||
}
|
||||
});
|
||||
|
||||
_.each(removed, function (item) {
|
||||
|
||||
item.$view.fadeOut(400, function () {
|
||||
item.$view.remove();
|
||||
});
|
||||
});
|
||||
|
||||
if (item.isEmpty()) {
|
||||
setTimeout(function () { $empty.show(); }, 400);
|
||||
} else {
|
||||
$empty.hide();
|
||||
}
|
||||
}
|
||||
|
||||
function init() {
|
||||
|
||||
var $content = $(contentTemplate);
|
||||
var $view = $content.find('#view');
|
||||
var $items = $view.find('#items');
|
||||
var $emtpy = $view.find('.empty').hide();
|
||||
|
||||
format.setDefaultMetric(settings.binaryPrefix);
|
||||
|
||||
$items
|
||||
.on('mouseenter', '.item a', onMouseenter)
|
||||
.on('mouseleave', '.item a', onMouseleave);
|
||||
|
||||
event.sub('location.changed', onLocationChanged);
|
||||
event.sub('location.refreshed', onLocationRefreshed);
|
||||
|
||||
// $content.appendTo('body');
|
||||
$content.appendTo('#main-row');
|
||||
}
|
||||
|
||||
|
||||
init();
|
||||
});
|
@@ -1,48 +0,0 @@
|
||||
modulejs.define('view/sidebar', ['$', 'core/resource', 'core/store'], function ($, resource, store) {
|
||||
|
||||
var storekey = 'sidebarIsVisible';
|
||||
var toggleTemplate =
|
||||
'<div id="sidebar-toggle" class="tool">' +
|
||||
'<img alt="settings"/>' +
|
||||
'</div>';
|
||||
|
||||
|
||||
function update(toggle) {
|
||||
|
||||
var $toggle = $('#sidebar-toggle');
|
||||
var $img = $toggle.find('img');
|
||||
var $sidebar = $('#sidebar');
|
||||
var isVisible = store.get(storekey);
|
||||
|
||||
if (toggle) {
|
||||
isVisible = !isVisible;
|
||||
store.put(storekey, isVisible);
|
||||
}
|
||||
|
||||
if (isVisible) {
|
||||
$toggle.addClass('current');
|
||||
$img.attr('src', resource.image('back'));
|
||||
$sidebar.show();
|
||||
} else {
|
||||
$toggle.removeClass('current');
|
||||
$img.attr('src', resource.image('settings'));
|
||||
$sidebar.hide();
|
||||
}
|
||||
}
|
||||
|
||||
function init() {
|
||||
|
||||
$(toggleTemplate)
|
||||
.appendTo('#toolbar')
|
||||
.on('click', function (ev) {
|
||||
|
||||
update(true);
|
||||
ev.preventDefault();
|
||||
});
|
||||
|
||||
update(false);
|
||||
}
|
||||
|
||||
|
||||
init();
|
||||
});
|
@@ -1,147 +0,0 @@
|
||||
modulejs.define('view/viewmode', ['_', '$', 'core/settings', 'core/resource', 'core/store', 'core/event'], function (_, $, allsettings, resource, store, event) {
|
||||
|
||||
var modes = ['details', 'grid', 'icons'];
|
||||
var settings = _.extend({}, {
|
||||
modes: modes,
|
||||
sizes: [20, 40, 60, 80, 100, 150, 200],
|
||||
}, allsettings.view);
|
||||
var storekey = 'viewmode';
|
||||
var modeTemplate =
|
||||
'<div id="view-[MODE]" class="button view">' +
|
||||
'<img src="' + resource.image('view-[MODE]') + '" alt="view-[MODE]"/>' +
|
||||
'</div>';
|
||||
var sizeTemplate =
|
||||
'<input id="view-size" type="range" min="0" max="0" value="0">';
|
||||
var sortedSizes = settings.sizes.sort(function (a, b) { return a-b; });
|
||||
var dynamicStyleTag = null;
|
||||
|
||||
|
||||
function adjustSpacing() {
|
||||
|
||||
// kept here for later use
|
||||
}
|
||||
|
||||
function applyCss(rules) {
|
||||
|
||||
if (dynamicStyleTag) {
|
||||
document.head.removeChild(dynamicStyleTag);
|
||||
}
|
||||
dynamicStyleTag = document.createElement('style');
|
||||
dynamicStyleTag.appendChild(document.createTextNode('')); // fix webkit
|
||||
document.head.appendChild(dynamicStyleTag);
|
||||
_.each(rules, function (rule, i) {
|
||||
|
||||
dynamicStyleTag.sheet.insertRule(rule, i);
|
||||
});
|
||||
}
|
||||
|
||||
function cropSize(size, min, max) {
|
||||
|
||||
return Math.min(max, Math.max(min, size));
|
||||
}
|
||||
|
||||
function applyCssSizes(size) {
|
||||
|
||||
var dsize = cropSize(size, 20, 80);
|
||||
var gsize = cropSize(size, 40, 150);
|
||||
var isize = cropSize(size, 80, 2000);
|
||||
var ilsize = Math.round(isize*4/3);
|
||||
var rules = [
|
||||
'#view.view-details .item .label { line-height: ' + (dsize+14) + 'px !important; }',
|
||||
'#view.view-details .item .date { line-height: ' + (dsize+14) + 'px !important; }',
|
||||
'#view.view-details .item .size { line-height: ' + (dsize+14) + 'px !important; }',
|
||||
'#view.view-details .square { width: ' + dsize + 'px !important; height: ' + dsize + 'px !important; }',
|
||||
'#view.view-details .square img { width: ' + dsize + 'px !important; height: ' + dsize + 'px !important; }',
|
||||
'#view.view-details .label { margin: 0 246px 0 ' + (dsize+32) + 'px !important; }',
|
||||
|
||||
'#view.view-grid .item .label { line-height: ' + gsize + 'px !important; }',
|
||||
'#view.view-grid .square { width: ' + gsize + 'px !important; height: ' + gsize + 'px !important; }',
|
||||
'#view.view-grid .square img { width: ' + gsize + 'px !important; height: ' + gsize + 'px !important; }',
|
||||
|
||||
'#view.view-icons .item { width: ' + ilsize + 'px !important; }',
|
||||
'#view.view-icons .landscape { width: ' + ilsize + 'px !important; height: ' + isize + 'px !important; }',
|
||||
'#view.view-icons .landscape img { width: ' + isize + 'px !important; height: ' + isize + 'px !important; }',
|
||||
'#view.view-icons .landscape .thumb { width: ' + ilsize + 'px !important; }'
|
||||
];
|
||||
applyCss(rules);
|
||||
}
|
||||
|
||||
|
||||
function update(mode, size) {
|
||||
|
||||
var $view = $('#view');
|
||||
var stored = store.get(storekey);
|
||||
|
||||
mode = mode || stored && stored.mode;
|
||||
size = size || stored && stored.size;
|
||||
mode = _.contains(settings.modes, mode) ? mode : settings.modes[0];
|
||||
size = _.contains(settings.sizes, size) ? size : settings.sizes[0];
|
||||
store.put(storekey, {mode: mode, size: size});
|
||||
|
||||
_.each(modes, function (m) {
|
||||
if (m === mode) {
|
||||
$('#view-' + m).addClass('active');
|
||||
$view.addClass('view-' + m).show();
|
||||
} else {
|
||||
$('#view-' + m).removeClass('active');
|
||||
$view.removeClass('view-' + m);
|
||||
}
|
||||
});
|
||||
|
||||
applyCssSizes(size);
|
||||
$('#view-size').val(_.indexOf(sortedSizes, size));
|
||||
|
||||
adjustSpacing();
|
||||
}
|
||||
|
||||
function addViewSettings() {
|
||||
|
||||
if (settings.modes.length < 2 && settings.sizes.length < 2) {
|
||||
return;
|
||||
}
|
||||
|
||||
var $viewBlock = $('<div class="block"><h1 class="l10n-view">View</h1></div>');
|
||||
var max;
|
||||
|
||||
settings.modes = _.intersection(settings.modes, modes);
|
||||
|
||||
if (settings.modes.length > 1) {
|
||||
_.each(modes, function (mode) {
|
||||
if (_.contains(settings.modes, mode)) {
|
||||
$(modeTemplate.replace(/\[MODE\]/g, mode))
|
||||
.appendTo($viewBlock)
|
||||
.on('click', function (ev) {
|
||||
|
||||
update(mode);
|
||||
ev.preventDefault();
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (settings.sizes.length > 1) {
|
||||
max = settings.sizes.length-1;
|
||||
$(sizeTemplate)
|
||||
.prop('max', max).attr('max', max)
|
||||
.on('input change', function (ev) {
|
||||
|
||||
update(null, settings.sizes[parseInt(ev.target.value, 10)]);
|
||||
})
|
||||
.appendTo($viewBlock);
|
||||
}
|
||||
|
||||
$viewBlock.appendTo('#settings');
|
||||
}
|
||||
|
||||
function init() {
|
||||
|
||||
addViewSettings();
|
||||
update();
|
||||
|
||||
event.sub('location.changed', adjustSpacing);
|
||||
$(window).on('resize', adjustSpacing);
|
||||
}
|
||||
|
||||
|
||||
init();
|
||||
});
|
4
src/_h5ai/client/js/lib/jquery-2.1.3.min.js
vendored
@@ -1,33 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* lodash 3.6.0 (Custom Build) lodash.com/license | Underscore.js 1.8.2 underscorejs.org/LICENSE
|
||||
* Build: `lodash exports="global" include="compact,contains,difference,each,extend,filter,indexOf,intersection,isFunction,isNumber,isString,keys,map,pluck,sortBy,values,without"`
|
||||
*/
|
||||
;(function(){function n(n,r,t){if(r!==r){n:{for(r=n.length,t+=-1;++t<r;){var e=n[t];if(e!==e){n=t;break n}}n=-1}return n}for(t-=1,e=n.length;++t<e;)if(n[t]===r)return t;return-1}function r(n){return typeof n=="function"||false}function t(n,r){var t;n:{t=n.a;var e=r.a;if(t!==e){var u=t===t,o=e===e;if(t>e||!u||typeof t=="undefined"&&o){t=1;break n}if(t<e||!o||typeof e=="undefined"&&u){t=-1;break n}}t=0}return t||n.b-r.b}function e(n){return!!n&&typeof n=="object"}function u(){}function o(n){var r=n?n.length:0;
|
||||
for(this.data={hash:tt(null),set:new Qr};r--;)this.push(n[r])}function c(n,r){var t=n.data;return(typeof r=="string"||G(r)?t.set.has(r):t.hash[r])?0:-1}function f(n,r){var t=-1,e=n.length;for(r||(r=Array(e));++t<e;)r[t]=n[t];return r}function a(n,r){for(var t=-1,e=n.length;++t<e&&false!==r(n[t],t,n););return n}function i(n,r){for(var t=-1,e=n.length,u=-1,o=[];++t<e;){var c=n[t];r(c,t,n)&&(o[++u]=c)}return o}function l(n,r){for(var t=-1,e=n.length,u=Array(e);++t<e;)u[t]=r(n[t],t,n);return u}function s(n,r,t){t||(t=r,r={});
|
||||
for(var e=-1,u=t.length;++e<u;){var o=t[e];r[o]=n[o]}return r}function p(n,r,t){var e=typeof n;return"function"==e?typeof r=="undefined"?n:O(n,r,t):null==n?tr:"object"==e?A(n):typeof r=="undefined"?x(n+""):w(n+"",r)}function y(n,r,t,e,u,o,c){var i;if(t&&(i=u?t(n,e,u):t(n)),typeof i!="undefined")return i;if(!G(n))return n;if(e=jt(n)){if(i=F(n),!r)return f(n,i)}else{var l=qr.call(n),p=l==sr;if(l!=yr&&l!=cr&&(!p||u))return Fr[l]?T(n,l,r):u?n:{};if(Br(n))return u?n:{};if(i=U(p?{}:n),!r)return s(n,i,xt(n))
|
||||
}for(o||(o=[]),c||(c=[]),u=o.length;u--;)if(o[u]==n)return c[u];return o.push(n),c.push(i),(e?a:b)(n,function(e,u){i[u]=y(e,r,t,u,n,o,c)}),i}function h(r,t){var e=r?r.length:0,u=[];if(!e)return u;var o=-1,f=P(),a=f==n,i=a&&200<=t.length?vt(t):null,l=t.length;i&&(f=c,a=false,t=i);n:for(;++o<e;)if(i=r[o],a&&i===i){for(var s=l;s--;)if(t[s]===i)continue n;u.push(i)}else 0>f(t,i,0)&&u.push(i);return u}function g(n,r){var t=[];return ht(n,function(n,e,u){r(n,e,u)&&t.push(n)}),t}function v(n,r,t){for(var u=-1,o=n.length,c=-1,f=[];++u<o;){var a=n[u];
|
||||
if(e(a)&&$(a.length)&&(jt(a)||z(a))){r&&(a=v(a,r,t));var i=-1,l=a.length;for(f.length+=l;++i<l;)f[++c]=a[i]}else t||(f[++c]=a)}return f}function b(n,r){return gt(n,r,xt)}function d(n,r,t,e,u,o){if(n===r)return 0!==n||1/n==1/r;var c=typeof n,f=typeof r;return"function"!=c&&"object"!=c&&"function"!=f&&"object"!=f||null==n||null==r?n!==n&&r!==r:m(n,r,d,t,e,u,o)}function m(n,r,t,e,u,o,c){var f=jt(n),a=jt(r),i=fr,l=fr;f||(i=qr.call(n),i==cr?i=yr:i!=yr&&(f=K(n))),a||(l=qr.call(r),l==cr?l=yr:l!=yr&&K(r));
|
||||
var s=(i==yr||u&&i==sr)&&!Br(n),a=(l==yr||u&&l==sr)&&!Br(r);if((l=i==l)&&!f&&!s)return I(n,r,i);if(u){if(!(l||s&&a))return false}else{if(i=s&&Yr.call(n,"__wrapped__"),a=a&&Yr.call(r,"__wrapped__"),i||a)return t(i?n.value():n,a?r.value():r,e,u,o,c);if(!l)return false}for(o||(o=[]),c||(c=[]),i=o.length;i--;)if(o[i]==n)return c[i]==r;return o.push(n),c.push(r),n=(f?k:_)(n,r,t,e,u,o,c),o.pop(),c.pop(),n}function j(n,r){var t=[];return ht(n,function(n,e,u){t.push(r(n,e,u))}),t}function A(n){var r=xt(n),t=r.length;
|
||||
if(!t)return rr(true);if(1==t){var e=r[0],u=n[e];if(B(u))return function(n){return null!=n&&n[e]===u&&(typeof u!="undefined"||e in L(n))}}for(var o=Array(t),c=Array(t);t--;)u=n[r[t]],o[t]=u,c[t]=B(u);return function(n){var t;if(t=null!=n)n:{n=L(n),t=-1;for(var e=r.length;++t<e;)if(c[t]?o[t]!==n[r[t]]:!(r[t]in n)){t=false;break n}for(t=-1;++t<e;){var u=r[t],f=n[u],a=o[t];if(c[t]?u=typeof f!="undefined"||u in n:(u=ur,typeof u=="undefined"&&(u=d(a,f,void 0,true))),!u){t=false;break n}}t=true}return t}}function w(n,r){return B(r)?function(t){return null!=t&&t[n]===r&&(typeof r!="undefined"||n in L(t))
|
||||
}:function(t){return null!=t&&d(r,t[n],null,true)}}function x(n){return function(r){return null==r?ur:r[n]}}function E(n,r){var t=n.length;for(n.sort(r);t--;)n[t]=n[t].c;return n}function O(n,r,t){if(typeof n!="function")return tr;if(typeof r=="undefined")return n;switch(t){case 1:return function(t){return n.call(r,t)};case 3:return function(t,e,u){return n.call(r,t,e,u)};case 4:return function(t,e,u,o){return n.call(r,t,e,u,o)};case 5:return function(t,e,u,o,c){return n.call(r,t,e,u,o,c)}}return function(){return n.apply(r,arguments)
|
||||
}}function S(n){return Hr.call(n,0)}function k(n,r,t,e,u,o,c){var f=-1,a=n.length,i=r.length,l=true;if(a!=i&&(!u||i<=a))return false;for(;l&&++f<a;){var s=n[f],p=r[f],l=ur;if(e&&(l=u?e(p,s,f):e(s,p,f)),typeof l=="undefined")if(u)for(var y=i;y--&&(p=r[y],!(l=s&&s===p||t(s,p,e,u,o,c))););else l=s&&s===p||t(s,p,e,u,o,c)}return!!l}function I(n,r,t){switch(t){case ar:case ir:return+n==+r;case lr:return n.name==r.name&&n.message==r.message;case pr:return n!=+n?r!=+r:0==n?1/n==1/r:n==+r;case hr:case gr:return n==r+""
|
||||
}return false}function _(n,r,t,e,u,o,c){var f=xt(n),a=f.length,i=xt(r).length;if(a!=i&&!u)return false;for(var i=u,l=-1;++l<a;){var s=f[l],p=u?s in r:Yr.call(r,s);if(p){var y=n[s],h=r[s],p=ur;e&&(p=u?e(h,y,s):e(y,h,s)),typeof p=="undefined"&&(p=y&&y===h||t(y,h,e,u,o,c))}if(!p)return false;i||(i="constructor"==s)}return i||(t=n.constructor,e=r.constructor,!(t!=e&&"constructor"in n&&"constructor"in r)||typeof t=="function"&&t instanceof t&&typeof e=="function"&&e instanceof e)?true:false}function M(n,r,t){var e=u.callback||nr,e=e===nr?p:e;
|
||||
return t?e(n,r,t):e}function P(r,t,e){var o=u.indexOf||D,o=o===D?n:o;return r?o(r,t,e):o}function F(n){var r=n.length,t=new n.constructor(r);return r&&"string"==typeof n[0]&&Yr.call(n,"index")&&(t.index=n.index,t.input=n.input),t}function U(n){return n=n.constructor,typeof n=="function"&&n instanceof n||(n=Object),new n}function T(n,r,t){var e=n.constructor;switch(r){case vr:return S(n);case ar:case ir:return new e(+n);case br:case dr:case mr:case jr:case Ar:case wr:case xr:case Er:case Or:return e instanceof e&&(e=st[r]),r=n.buffer,new e(t?S(r):r,n.byteOffset,n.length);
|
||||
case pr:case gr:return new e(n);case hr:var u=new e(n.source,Sr.exec(n));u.lastIndex=n.lastIndex}return u}function N(n,r){return n=+n,r=null==r?lt:r,-1<n&&0==n%1&&n<r}function R(n,r,t){if(!G(t))return false;var e=typeof r;return"number"==e?(e=t.length,e=$(e)&&N(r,e)):e="string"==e&&r in t,e?(r=t[r],n===n?n===r:r!==r):false}function $(n){return typeof n=="number"&&-1<n&&0==n%1&&n<=lt}function B(n){return n===n&&(0===n?0<1/n:!G(n))}function C(n){for(var r=Q(n),t=r.length,e=t&&n.length,o=u.support,o=e&&$(e)&&(jt(n)||o.nonEnumStrings&&J(n)||o.nonEnumArgs&&z(n)),c=-1,f=[];++c<t;){var a=r[c];
|
||||
(o&&N(a,e)||Yr.call(n,a))&&f.push(a)}return f}function L(n){if(u.support.unindexedChars&&J(n)){for(var r=-1,t=n.length,e=Object(n);++r<t;)e[r]=n.charAt(r);return e}return G(n)?n:Object(n)}function D(r,t,e){var u=r?r.length:0;if(!u)return-1;if(typeof e=="number")e=0>e?ut(u+e,0):e;else if(e){if(e=0,u=r?r.length:e,typeof t!="number"||t!==t||u>at){u=tr,e=u(t);for(var o=0,c=r?r.length:0,f=e!==e,a=typeof e=="undefined";o<c;){var i=Jr((o+c)/2),l=u(r[i]),s=l===l;(f?s:a?s&&typeof l!="undefined":l<e)?o=i+1:c=i
|
||||
}e=ot(c,ft)}else{for(;e<u;){var o=e+u>>>1;r[o]<t?e=o+1:u=o}e=u}return r=r[e],(t===t?t===r:r!==r)?e:-1}return n(r,t,e||0)}function W(n,r,t){var e=jt(n)?i:g;return r=M(r,t,3),e(n,r)}function V(n,r,t,e){var u=n?n.length:0;return $(u)||(n=X(n),u=n.length),u?(t=typeof t!="number"||e&&R(r,t,e)?0:0>t?ut(u+t,0):t||0,typeof n=="string"||!jt(n)&&J(n)?t<u&&-1<n.indexOf(r,t):-1<P(n,r,t)):false}function Y(n,r,t){var e=jt(n)?l:j;return r=M(r,t,3),e(n,r)}function q(n,r){if(typeof n!="function")throw new TypeError(or);
|
||||
return r=ut(typeof r=="undefined"?n.length-1:+r||0,0),function(){for(var t=arguments,e=-1,u=ut(t.length-r,0),o=Array(u);++e<u;)o[e]=t[r+e];switch(r){case 0:return n.call(this,o);case 1:return n.call(this,t[0],o);case 2:return n.call(this,t[0],t[1],o)}for(u=Array(r+1),e=-1;++e<r;)u[e]=t[e];return u[r]=o,n.apply(this,u)}}function z(n){var r=e(n)?n.length:ur;return $(r)&&qr.call(n)==cr}function G(n){var r=typeof n;return"function"==r||!!n&&"object"==r}function H(n){return null==n?false:qr.call(n)==sr?zr.test(Vr.call(n)):e(n)&&(Br(n)?zr:kr).test(n)
|
||||
}function J(n){return typeof n=="string"||e(n)&&qr.call(n)==gr}function K(n){return e(n)&&$(n.length)&&!!Pr[qr.call(n)]}function Q(n){if(null==n)return[];G(n)||(n=Object(n));for(var r=n.length,t=u.support,r=r&&$(r)&&(jt(n)||t.nonEnumStrings&&J(n)||t.nonEnumArgs&&z(n))&&r||0,e=n.constructor,o=-1,e=At(e)&&e.prototype||Dr,c=e===n,f=Array(r),a=0<r,i=t.enumErrorProps&&(n===Lr||n instanceof Error),l=t.enumPrototypes&&At(n);++o<r;)f[o]=o+"";for(var s in n)l&&"prototype"==s||i&&("message"==s||"name"==s)||a&&N(s,r)||"constructor"==s&&(c||!Yr.call(n,s))||f.push(s);
|
||||
if(t.nonEnumShadows&&n!==Dr)for(r=n===Wr?gr:n===Lr?lr:qr.call(n),t=pt[r]||pt[yr],r==yr&&(e=Dr),r=Mr.length;r--;)s=Mr[r],o=t[s],c&&o||(o?!Yr.call(n,s):n[s]===e[s])||f.push(s);return f}function X(n){for(var r=xt(n),t=-1,e=r.length,u=Array(e);++t<e;)u[t]=n[r[t]];return u}function Z(n){return typeof n!="string"&&(n=null==n?"":n+""),n&&_r.test(n)?n.replace(Ir,"\\$&"):n}function nr(n,r,t){return t&&R(n,r,t)&&(r=null),e(n)?er(n):p(n,r)}function rr(n){return function(){return n}}function tr(n){return n}function er(n){return A(y(n,true))
|
||||
}var ur,or="Expected a function",cr="[object Arguments]",fr="[object Array]",ar="[object Boolean]",ir="[object Date]",lr="[object Error]",sr="[object Function]",pr="[object Number]",yr="[object Object]",hr="[object RegExp]",gr="[object String]",vr="[object ArrayBuffer]",br="[object Float32Array]",dr="[object Float64Array]",mr="[object Int8Array]",jr="[object Int16Array]",Ar="[object Int32Array]",wr="[object Uint8Array]",xr="[object Uint8ClampedArray]",Er="[object Uint16Array]",Or="[object Uint32Array]",Sr=/\w*$/,kr=/^\[object .+?Constructor\]$/,Ir=/[.*+?^${}()|[\]\/\\]/g,_r=RegExp(Ir.source),Mr="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),Pr={};
|
||||
Pr[br]=Pr[dr]=Pr[mr]=Pr[jr]=Pr[Ar]=Pr[wr]=Pr[xr]=Pr[Er]=Pr[Or]=true,Pr[cr]=Pr[fr]=Pr[vr]=Pr[ar]=Pr[ir]=Pr[lr]=Pr[sr]=Pr["[object Map]"]=Pr[pr]=Pr[yr]=Pr[hr]=Pr["[object Set]"]=Pr[gr]=Pr["[object WeakMap]"]=false;var Fr={};Fr[cr]=Fr[fr]=Fr[vr]=Fr[ar]=Fr[ir]=Fr[br]=Fr[dr]=Fr[mr]=Fr[jr]=Fr[Ar]=Fr[pr]=Fr[yr]=Fr[hr]=Fr[gr]=Fr[wr]=Fr[xr]=Fr[Er]=Fr[Or]=true,Fr[lr]=Fr[sr]=Fr["[object Map]"]=Fr["[object Set]"]=Fr["[object WeakMap]"]=false;var Ur={"function":true,object:true},Tr=Ur[typeof module]&&module&&!module.nodeType&&module,Nr=Ur[typeof self]&&self&&self.Object&&self,Rr=Ur[typeof window]&&window&&window.Object&&window,$r=Ur[typeof exports]&&exports&&!exports.nodeType&&exports&&Tr&&typeof global=="object"&&global||Rr!==(this&&this.window)&&Rr||Nr||this,Br=function(){try{Object({toString:0}+"")
|
||||
}catch(n){return function(){return false}}return function(n){return typeof n.toString!="function"&&typeof(n+"")=="string"}}(),Cr=Array.prototype,Lr=Error.prototype,Dr=Object.prototype,Wr=String.prototype,Vr=Function.prototype.toString,Yr=Dr.hasOwnProperty,qr=Dr.toString,zr=RegExp("^"+Z(qr).replace(/toString|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Gr=H(Gr=$r.ArrayBuffer)&&Gr,Hr=H(Hr=Gr&&new Gr(0).slice)&&Hr,Jr=Math.floor,Kr=Dr.propertyIsEnumerable,Qr=H(Qr=$r.Set)&&Qr,Xr=Cr.splice,Zr=H(Zr=$r.Uint8Array)&&Zr,nt=function(){try{var n=H(n=$r.Float64Array)&&n,r=new n(new Gr(10),0,1)&&n
|
||||
}catch(t){}return r}(),rt=H(rt=Array.isArray)&&rt,tt=H(tt=Object.create)&&tt,et=H(et=Object.keys)&&et,ut=Math.max,ot=Math.min,ct=Math.pow(2,32)-1,ft=ct-1,at=ct>>>1,it=nt?nt.BYTES_PER_ELEMENT:0,lt=Math.pow(2,53)-1,st={};st[br]=$r.Float32Array,st[dr]=$r.Float64Array,st[mr]=$r.Int8Array,st[jr]=$r.Int16Array,st[Ar]=$r.Int32Array,st[wr]=$r.Uint8Array,st[xr]=$r.Uint8ClampedArray,st[Er]=$r.Uint16Array,st[Or]=$r.Uint32Array;var pt={};pt[fr]=pt[ir]=pt[pr]={constructor:true,toLocaleString:true,toString:true,valueOf:true},pt[ar]=pt[gr]={constructor:true,toString:true,valueOf:true},pt[lr]=pt[sr]=pt[hr]={constructor:true,toString:true},pt[yr]={constructor:true},a(Mr,function(n){for(var r in pt)if(Yr.call(pt,r)){var t=pt[r];
|
||||
t[n]=Yr.call(t,n)}});var yt=u.support={};!function(n){var r=function(){this.x=1},t={0:1,length:1},e=[];r.prototype={valueOf:1,y:1};for(var u in new r)e.push(u);yt.argsTag=qr.call(arguments)==cr,yt.enumErrorProps=Kr.call(Lr,"message")||Kr.call(Lr,"name"),yt.enumPrototypes=Kr.call(r,"prototype"),yt.funcDecomp=/\bthis\b/.test(function(){return this}),yt.funcNames=typeof Function.name=="string",yt.nonEnumStrings=!Kr.call("x",0),yt.nonEnumShadows=!/valueOf/.test(e),yt.spliceObjects=(Xr.call(t,0,1),!t[0]),yt.unindexedChars="xx"!="x"[0]+Object("x")[0];
|
||||
try{yt.nonEnumArgs=!Kr.call(arguments,1)}catch(o){yt.nonEnumArgs=true}}(0,0);var ht=function(n,r){return function(t,e){var u=t?t.length:0;if(!$(u))return n(t,e);for(var o=r?u:-1,c=L(t);(r?o--:++o<u)&&false!==e(c[o],o,c););return t}}(b),gt=function(n){return function(r,t,e){var u=L(r);e=e(r);for(var o=e.length,c=n?o:-1;n?c--:++c<o;){var f=e[c];if(false===t(u[f],f,u))break}return r}}();Hr||(S=Gr&&Zr?function(n){var r=n.byteLength,t=nt?Jr(r/it):0,e=t*it,u=new Gr(r);if(t){var o=new nt(u,0,t);o.set(new nt(n,0,t))
|
||||
}return r!=e&&(o=new Zr(u,e),o.set(new Zr(n,e))),u}:rr(null));var vt=tt&&Qr?function(n){return new o(n)}:rr(null),bt=q(function(n,r){return jt(n)||z(n)?h(n,v(r,false,true)):[]}),dt=q(function(n,r){return jt(n)||z(n)?h(n,r):[]}),mt=function(n,r){return function(t,e,u){return typeof e=="function"&&typeof u=="undefined"&&jt(t)?n(t,e):r(t,O(e,u,3))}}(a,ht);yt.argsTag||(z=function(n){var r=e(n)?n.length:ur;return $(r)&&Yr.call(n,"callee")&&!Kr.call(n,"callee")});var jt=rt||function(n){return e(n)&&$(n.length)&&qr.call(n)==fr
|
||||
},At=r(/x/)||Zr&&!r(Zr)?function(n){return qr.call(n)==sr}:r,wt=function(n){return function(){var r=arguments,t=r.length,e=r[0];if(2>t||null==e)return e;var u=r[t-2],o=r[t-1],c=r[3];for(3<t&&typeof u=="function"?(u=O(u,o,5),t-=2):(u=2<t&&typeof o=="function"?o:null,t-=u?1:0),c&&R(r[1],r[2],c)&&(u=3==t?null:u,t=2),o=0;++o<t;)(c=r[o])&&n(e,c,u);return e}}(function(n,r,t){var e=xt(r);if(!t)return s(r,n,e);for(var u=-1,o=e.length;++u<o;){var c=e[u],f=n[c],a=t(f,r[c],c,n,r);(a===a?a===f:f!==f)&&(typeof f!="undefined"||c in n)||(n[c]=a)
|
||||
}return n}),xt=et?function(n){if(n)var r=n.constructor,t=n.length;return typeof r=="function"&&r.prototype===n||(typeof n=="function"?u.support.enumPrototypes:t&&$(t))?C(n):G(n)?et(n):[]}:C;o.prototype.push=function(n){var r=this.data;typeof n=="string"||G(n)?r.set.add(n):r.hash[n]=true},u.assign=wt,u.callback=nr,u.compact=function(n){for(var r=-1,t=n?n.length:0,e=-1,u=[];++r<t;){var o=n[r];o&&(u[++e]=o)}return u},u.constant=rr,u.difference=bt,u.filter=W,u.forEach=mt,u.intersection=function(){for(var r=[],t=-1,e=arguments.length,u=[],o=P(),f=o==n;++t<e;){var a=arguments[t];
|
||||
(jt(a)||z(a))&&(r.push(a),u.push(f&&120<=a.length?vt(t&&a):null))}var e=r.length,f=r[0],i=-1,l=f?f.length:0,s=[],p=u[0];n:for(;++i<l;)if(a=f[i],0>(p?c(p,a):o(s,a,0))){for(t=e;--t;){var y=u[t];if(0>(y?c(y,a):o(r[t],a,0)))continue n}p&&p.push(a),s.push(a)}return s},u.keys=xt,u.keysIn=Q,u.map=Y,u.matches=er,u.pluck=function(n,r){return Y(n,x(r))},u.restParam=q,u.sortBy=function(n,r,e){if(null==n)return[];var u=-1,o=n.length,c=$(o)?Array(o):[];return e&&R(n,r,e)&&(r=null),r=M(r,e,3),ht(n,function(n,t,e){c[++u]={a:r(n,t,e),b:u,c:n}
|
||||
}),E(c,t)},u.values=X,u.without=dt,u.collect=Y,u.each=mt,u.extend=wt,u.iteratee=nr,u.select=W,u.escapeRegExp=Z,u.identity=tr,u.includes=V,u.indexOf=D,u.isArguments=z,u.isArray=jt,u.isFunction=At,u.isNative=H,u.isNumber=function(n){return typeof n=="number"||e(n)&&qr.call(n)==pr},u.isObject=G,u.isString=J,u.isTypedArray=K,u.contains=V,u.include=V,u.VERSION="3.6.0",$r._=u}).call(this);
|
6
src/_h5ai/client/js/lib/marked-0.3.2.min.js
vendored
@@ -1,2 +0,0 @@
|
||||
/* modulejs 1.4.0 - http://larsjung.de/modulejs/ */
|
||||
!function(n){"use strict";function r(n){return function(r){return h.toString.call(r)==="[object "+n+"]"}}function t(n){return n===new Object(n)}function e(n,r){return h.hasOwnProperty.call(n,r)}function i(n,r,t){if(v&&n.forEach===v)n.forEach(r,t);else if(n.length===+n.length)for(var i=0,o=n.length;o>i;i+=1)r.call(t,n[i],i,n);else for(var u in n)e(n,u)&&r.call(t,n[u],u,n)}function o(n,r){for(var t=0,e=n.length;e>t;t+=1)if(n[t]===r)return!0;return!1}function u(n){var r={},t=[];return i(n,function(n){e(r,n)||(t.push(n),r[n]=1)}),t}function c(n,r,t){if(n)throw{code:r,msg:t,toString:function(){return p+" error "+r+": "+t}}}function f(r,t,a){if(c(!g(r),31,'id must be a string "'+r+'"'),!t&&e(q,r))return q[r];var s=j[r];c(!s,32,'id not defined "'+r+'"'),a=(a||[]).slice(0),a.push(r);var d=[];if(i(s.deps,function(n){c(o(a,n),33,"circular dependencies: "+a+" & "+n),t?(d=d.concat(f(n,t,a)),d.push(n)):d.push(f(n,t,a))}),t)return u(d);var l=s.fn.apply(n,d);return q[r]=l,l}function a(n,r,e){void 0===e&&(e=r,r=[]),c(!g(n),11,'id must be a string "'+n+'"'),c(j[n],12,'id already defined "'+n+'"'),c(!b(r),13,'dependencies for "'+n+'" must be an array "'+r+'"'),c(!t(e)&&!y(e),14,'arg for "'+n+'" must be object or function "'+e+'"'),j[n]={id:n,deps:r,fn:y(e)?e:function(){return e}}}function s(n){return f(n)}function d(){var n={};return i(j,function(r,t){n[t]={deps:r.deps.slice(0),reqs:f(t,!0),init:e(q,t)}}),i(j,function(r,t){var e=[];i(j,function(r,i){o(n[i].reqs,t)&&e.push(i)}),n[t].reqd=e}),n}function l(n){var r="\n";return i(d(),function(t,e){var i=n?t.reqd:t.reqs;r+=(t.init?"* ":" ")+e+" -> [ "+i.join(", ")+" ]\n"}),r}var p="modulejs",h=Object.prototype,v=Array.prototype.forEach,g=r("String"),y=r("Function"),b=Array.isArray||r("Array"),j={},q={};n[p]={define:a,require:s,state:d,log:l,_private:{isString:g,isFunction:y,isArray:b,isObject:t,has:e,each:i,contains:o,uniq:u,err:c,definitions:j,instances:q,resolve:f}}}(this);
|
7
src/_h5ai/client/js/lib/moment-2.9.0.min.js
vendored
36
src/_h5ai/client/js/lib/prism-2015-04-05.min.js
vendored
@@ -1,52 +0,0 @@
|
||||
// @include "lib/modernizr-*.js"
|
||||
// @include "lib/jquery-*.js"
|
||||
// @include "lib/jquery.*.js"
|
||||
// @include "lib/lodash-*.js"
|
||||
// @include "lib/marked-*.js"
|
||||
// @include "lib/modulejs-*.js"
|
||||
// @include "lib/moment-*.js"
|
||||
// @include "lib/prism-*.js"
|
||||
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
/*global jQuery, marked, Modernizr, moment, Prism, _ */
|
||||
modulejs.define('$', function () { return jQuery; });
|
||||
modulejs.define('marked', function () { return marked; });
|
||||
modulejs.define('modernizr', function () { return Modernizr; });
|
||||
modulejs.define('moment', function () { return moment; });
|
||||
modulejs.define('prism', function () { return Prism; });
|
||||
modulejs.define('_', function () { return _; });
|
||||
|
||||
// @include "inc/**/*.js"
|
||||
|
||||
var $ = jQuery;
|
||||
|
||||
if ($('html').hasClass('no-browser')) {
|
||||
return;
|
||||
}
|
||||
|
||||
var module = $('script[data-module]').data('module');
|
||||
var data = {action: 'get', setup: true, options: true, types: true, theme: true, langs: true};
|
||||
var url;
|
||||
|
||||
if (module === 'main') {
|
||||
url = '.';
|
||||
} else if (module === 'info') {
|
||||
data.updatecmds = true;
|
||||
url = 'server/php/index.php';
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
url: url,
|
||||
data: data,
|
||||
type: 'POST',
|
||||
dataType: 'json'
|
||||
}).done(function (config) {
|
||||
|
||||
modulejs.define('config', config);
|
||||
$(function () { modulejs.require(module); });
|
||||
});
|
||||
}());
|
@@ -1,10 +0,0 @@
|
||||
{
|
||||
"lang": "nederlands",
|
||||
"details": "details",
|
||||
"icons": "iconen",
|
||||
"name": "Naam",
|
||||
"lastModified": "Laatste wijziging",
|
||||
"size": "Grootte",
|
||||
"parentDirectory": "Bovenliggende map",
|
||||
"empty": "lege"
|
||||
}
|
@@ -1,39 +0,0 @@
|
||||
doctype html
|
||||
<!--[if lt IE 10]><html class="no-js no-browser" lang="en"><![endif]-->
|
||||
<!--[if gt IE 9]><!--><html class="no-js browser" lang="en"><!--<![endif]-->
|
||||
|
||||
head
|
||||
meta( charset="utf-8" )
|
||||
title #{pkg.name} #{pkg.version} Server Setup
|
||||
meta( name="description", content="#{pkg.name} #{pkg.version} Server Setup" )
|
||||
meta( name="viewport", content="width=device-width, initial-scale=1" )
|
||||
link( rel="shortcut icon", href="client/images/favicon/favicon-16-32.ico" )
|
||||
link( rel="apple-touch-icon-precomposed", type="image/png", href="client/images/favicon/favicon-152.png" )
|
||||
link( rel="stylesheet", href="client/css/styles.css" )
|
||||
script( src="client/js/scripts.js", data-module="info" )
|
||||
|
||||
body#h5ai-info
|
||||
|
||||
div#fallback-hints
|
||||
span.noJsMsg
|
||||
| Works best with JavaScript enabled!
|
||||
span.noBrowserMsg
|
||||
| Works best in
|
||||
a( href="http://browsehappy.com" ) modern browsers
|
||||
| !
|
||||
span.backlink
|
||||
a( href="#{pkg.homepage}", title="#{pkg.name} #{pkg.version} · #{pkg.description}" ) powered by #{pkg.name}
|
||||
|
||||
div#content
|
||||
h1#header
|
||||
a( href="#{pkg.homepage}" ) #{pkg.name}
|
||||
|
||||
div#support
|
||||
| Show your support with a donation!
|
||||
div.paypal
|
||||
form( action="https://www.paypal.com/cgi-bin/webscr", method="post", target="_top" )
|
||||
input( type="hidden", name="cmd", value="_s-xclick" )
|
||||
input( type="hidden", name="hosted_button_id", value="8WSPKWT7YBTSQ" )
|
||||
input( type="image", src="client/images/ui/paypal.svg", width="100px", border="0", name="submit", alt="PayPal - The safer, easier way to pay online!" )
|
||||
|
||||
</html>
|
9
src/_h5ai/private/cache/README.md
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
# Cache
|
||||
|
||||
Private cache.
|
||||
|
||||
This directory is used for server side caching. To use caching make this
|
||||
directory writable for your webserver.
|
||||
|
||||
There is no critical data in here. You can savely remove any content. This
|
||||
will clear the cache.
|
@@ -1,19 +1,18 @@
|
||||
{
|
||||
"lang": "afrikaans",
|
||||
|
||||
"dateFormat": "YYYY-MM-DD HH:mm",
|
||||
"details": "besonderhede",
|
||||
"list": "lys",
|
||||
"download": "aflaai",
|
||||
"empty": "leeg",
|
||||
"files": "lêers",
|
||||
"filter": "filter",
|
||||
"folders": "gidse",
|
||||
"grid": "rooster",
|
||||
"icons": "ikone",
|
||||
"name": "Naam",
|
||||
"lastModified": "Laas verander",
|
||||
"size": "Grootte",
|
||||
"parentDirectory": "Hoër Vlak",
|
||||
"empty": "leeg",
|
||||
"folders": "gidse",
|
||||
"files": "lêers",
|
||||
"download": "aflaai",
|
||||
"name": "Naam",
|
||||
"noMatch": "geen resultaat",
|
||||
"dateFormat": "YYYY-MM-DD HH:mm",
|
||||
"filter": "filter",
|
||||
"delete": "verwyder"
|
||||
"parentDirectory": "Hoër Vlak",
|
||||
"size": "Grootte"
|
||||
}
|
@@ -1,17 +1,18 @@
|
||||
{
|
||||
"lang": "български",
|
||||
|
||||
"dateFormat": "DD-MM-YYYY HH:mm",
|
||||
"details": "детайли",
|
||||
"download": "изтегляне",
|
||||
"empty": "празна",
|
||||
"files": "файлове",
|
||||
"filter": "филтър",
|
||||
"folders": "директории",
|
||||
"grid": "мрежа",
|
||||
"icons": "икони",
|
||||
"name": "Име",
|
||||
"lastModified": "Последна промяна",
|
||||
"size": "Размер",
|
||||
"parentDirectory": "Предходна директория",
|
||||
"empty": "празна",
|
||||
"folders": "директории",
|
||||
"files": "файлове",
|
||||
"download": "изтегляне",
|
||||
"name": "Име",
|
||||
"noMatch": "няма съвпадение",
|
||||
"dateFormat": "DD-MM-YYYY HH:mm",
|
||||
"filter": "филтър"
|
||||
"parentDirectory": "Предходна директория",
|
||||
"size": "Размер"
|
||||
}
|
@@ -1,17 +1,18 @@
|
||||
{
|
||||
"lang": "čeština",
|
||||
|
||||
"dateFormat": "DD.MM.YYYY HH:mm",
|
||||
"details": "Podrobnosti",
|
||||
"download": "Stáhnout",
|
||||
"empty": "Prázdná složka",
|
||||
"files": "souborů",
|
||||
"filter": "Filtr",
|
||||
"folders": "složek",
|
||||
"grid": "Seznam",
|
||||
"icons": "Velké ikony",
|
||||
"name": "Název",
|
||||
"lastModified": "Datum změny",
|
||||
"size": "Velikost",
|
||||
"parentDirectory": "Nadřazený adresář",
|
||||
"empty": "Prázdná složka",
|
||||
"folders": "složek",
|
||||
"files": "souborů",
|
||||
"download": "Stáhnout",
|
||||
"name": "Název",
|
||||
"noMatch": "Žádná shoda",
|
||||
"dateFormat": "DD.MM.YYYY HH:mm",
|
||||
"filter": "Filtr"
|
||||
"parentDirectory": "Nadřazený adresář",
|
||||
"size": "Velikost"
|
||||
}
|
@@ -1,17 +1,18 @@
|
||||
{
|
||||
"lang": "dansk",
|
||||
|
||||
"dateFormat": "DD-MM-YYYY HH:mm",
|
||||
"details": "detaljer",
|
||||
"download": "download",
|
||||
"empty": "tom",
|
||||
"files": "filer",
|
||||
"filter": "filter",
|
||||
"folders": "mapper",
|
||||
"grid": "grid",
|
||||
"icons": "ikoner",
|
||||
"name": "Navn",
|
||||
"lastModified": "Sidst ændret",
|
||||
"size": "Størrelse",
|
||||
"parentDirectory": "Overordnet mappe",
|
||||
"empty": "tom",
|
||||
"folders": "mapper",
|
||||
"files": "filer",
|
||||
"download": "download",
|
||||
"name": "Navn",
|
||||
"noMatch": "ingen match",
|
||||
"dateFormat": "DD-MM-YYYY HH:mm",
|
||||
"filter": "filter"
|
||||
"parentDirectory": "Overordnet mappe",
|
||||
"size": "Størrelse"
|
||||
}
|
@@ -1,19 +1,22 @@
|
||||
{
|
||||
"lang": "deutsch",
|
||||
|
||||
"dateFormat": "DD.MM.YYYY HH:mm",
|
||||
"details": "Details",
|
||||
"download": "Download",
|
||||
"empty": "leer",
|
||||
"files": "Dateien",
|
||||
"filter": "filtern",
|
||||
"folders": "Ordner",
|
||||
"grid": "Gitter",
|
||||
"icons": "Icons",
|
||||
"name": "Name",
|
||||
"language": "Sprache",
|
||||
"lastModified": "Geändert",
|
||||
"size": "Größe",
|
||||
"parentDirectory": "Übergeordnetes Verzeichnis",
|
||||
"empty": "leer",
|
||||
"folders": "Ordner",
|
||||
"files": "Dateien",
|
||||
"download": "Download",
|
||||
"name": "Name",
|
||||
"noMatch": "keine Treffer",
|
||||
"dateFormat": "DD.MM.YYYY HH:mm",
|
||||
"filter": "Filter",
|
||||
"view": "Ansicht",
|
||||
"language": "Sprache"
|
||||
"parentDirectory": "Übergeordnetes Verzeichnis",
|
||||
"search": "suchen",
|
||||
"size": "Größe",
|
||||
"tree": "Baum",
|
||||
"view": "Ansicht"
|
||||
}
|
@@ -1,17 +1,18 @@
|
||||
{
|
||||
"lang": "ελληνικά",
|
||||
|
||||
"dateFormat": "DD/MM/YYYY HH:mm",
|
||||
"details": "λεπτομέρειες",
|
||||
"download": "μεταμόρφωση",
|
||||
"empty": "κενό",
|
||||
"files": "αρχεία",
|
||||
"filter": "φίλτρο",
|
||||
"folders": "φάκελοι",
|
||||
"grid": "πλέγμα",
|
||||
"icons": "εικονίδια",
|
||||
"name": "Όνομα",
|
||||
"lastModified": "Τελευταία τροποποίηση",
|
||||
"size": "Μέγεθος",
|
||||
"parentDirectory": "Προηγούμενος Κατάλογος",
|
||||
"empty": "κενό",
|
||||
"folders": "φάκελοι",
|
||||
"files": "αρχεία",
|
||||
"download": "μεταμόρφωση",
|
||||
"name": "Όνομα",
|
||||
"noMatch": "κανένα αποτέλεσμα",
|
||||
"dateFormat": "DD/MM/YYYY HH:mm",
|
||||
"filter": "φίλτρο"
|
||||
"parentDirectory": "Προηγούμενος Κατάλογος",
|
||||
"size": "Μέγεθος"
|
||||
}
|
@@ -1,20 +1,23 @@
|
||||
/* only here as a reference, these values are the hardcoded defaults */
|
||||
{
|
||||
"lang": "english",
|
||||
|
||||
"dateFormat": "YYYY-MM-DD HH:mm",
|
||||
"details": "details",
|
||||
"download": "download",
|
||||
"empty": "empty",
|
||||
"files": "files",
|
||||
"filter": "filter",
|
||||
"folders": "folders",
|
||||
"grid": "grid",
|
||||
"icons": "icons",
|
||||
"name": "Name",
|
||||
"language": "Language",
|
||||
"lastModified": "Last modified",
|
||||
"size": "Size",
|
||||
"parentDirectory": "Parent Directory",
|
||||
"empty": "empty",
|
||||
"folders": "folders",
|
||||
"files": "files",
|
||||
"download": "download",
|
||||
"name": "Name",
|
||||
"noMatch": "no match",
|
||||
"dateFormat": "YYYY-MM-DD HH:mm", /* syntax as specified on http://momentjs.com */
|
||||
"filter": "filter",
|
||||
"view": "View",
|
||||
"language": "Language"
|
||||
"parentDirectory": "Parent Directory",
|
||||
"search": "search",
|
||||
"size": "Size",
|
||||
"tree": "Tree",
|
||||
"view": "View"
|
||||
}
|
@@ -1,17 +1,22 @@
|
||||
{
|
||||
"lang": "español",
|
||||
|
||||
"dateFormat": "DD/MM/YYYY HH:mm",
|
||||
"details": "Detalles",
|
||||
"download": "Descargar",
|
||||
"empty": "vacío",
|
||||
"files": "Archivos",
|
||||
"filter": "Filtrar",
|
||||
"folders": "Directorios",
|
||||
"grid": "Cuadrícula",
|
||||
"icons": "Íconos",
|
||||
"name": "Nombre",
|
||||
"language": "Idioma",
|
||||
"lastModified": "Última modificación",
|
||||
"size": "Tamaño",
|
||||
"parentDirectory": "Directorio superior",
|
||||
"empty": "vacío",
|
||||
"folders": "Directorios",
|
||||
"files": "Archivos",
|
||||
"download": "Descargar",
|
||||
"name": "Nombre",
|
||||
"noMatch": "Sin coincidencias",
|
||||
"dateFormat": "DD/MM/YYYY HH:mm",
|
||||
"filter": "Filtar"
|
||||
"parentDirectory": "Directorio superior",
|
||||
"search": "buscar",
|
||||
"size": "Tamaño",
|
||||
"tree": "Arbol",
|
||||
"view": "Vista"
|
||||
}
|
22
src/_h5ai/private/conf/l10n/et.json
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"lang": "estonian",
|
||||
|
||||
"dateFormat": "DD-MM-YYYY HH.mm",
|
||||
"details": "täpsem info",
|
||||
"download": "laadi alla",
|
||||
"empty": "tühi",
|
||||
"files": "failid",
|
||||
"filter": "filter",
|
||||
"folders": "kataloogid",
|
||||
"grid": "võre",
|
||||
"icons": "ikoonid",
|
||||
"language": "Keel",
|
||||
"lastModified": "Viimati muudetud",
|
||||
"name": "Nimi",
|
||||
"noMatch": "ei leitud sobivat",
|
||||
"parentDirectory": "Emakataloog",
|
||||
"search": "otsi",
|
||||
"size": "Suurus",
|
||||
"tree": "Puu",
|
||||
"view": "Vaade"
|
||||
}
|