Compare commits
122 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
bdb8c3f099 | ||
|
bc945895cf | ||
|
aa9ed865f6 | ||
|
a8a6871ebd | ||
|
61ae46386e | ||
|
219234dfdd | ||
|
c29b681c1b | ||
|
8c2c02fe82 | ||
|
9c1142bd02 | ||
|
298d2e2efd | ||
|
d4a213beac | ||
|
0f948a56d8 | ||
|
a8e0474cca | ||
|
725cb1a6b8 | ||
|
a0a8882db7 | ||
|
f366779f7b | ||
|
90b0b97e22 | ||
|
974392d2eb | ||
|
2bcf6593a9 | ||
|
a6fdf653a1 | ||
|
0ff3d900fe | ||
|
ce75e45b03 | ||
|
a3c68c61f8 | ||
|
38011bd9a7 | ||
|
f5e7b10d94 | ||
|
7ad5958487 | ||
|
695d5148bb | ||
|
87103f1c3f | ||
|
77f301057b | ||
|
9e6c612513 | ||
|
eaf6ad3fcb | ||
|
e25e5b72f4 | ||
|
65b1823c5d | ||
|
8682e202a9 | ||
|
3349108f7e | ||
|
050d91daa8 | ||
|
a4c81135d5 | ||
|
30d48fb1ef | ||
|
f65f5021ae | ||
|
8273f0ded0 | ||
|
07e8c67338 | ||
|
162f32f5b8 | ||
|
68497e749b | ||
|
8fea7bfb74 | ||
|
7e6549faee | ||
|
4724214b9e | ||
|
1828855f63 | ||
|
17c31fc9d9 | ||
|
b6d6bf8ba7 | ||
|
2282a0ba71 | ||
|
864687aedf | ||
|
93d13d6177 | ||
|
74450a252a | ||
|
87f9ada878 | ||
|
f6d24d050f | ||
|
64640ada83 | ||
|
018a574d5e | ||
|
52ffd8720a | ||
|
a7ffda422b | ||
|
e870292878 | ||
|
875b4fbe0e | ||
|
d47b996c9f | ||
|
84a2ed582f | ||
|
cad50f76e2 | ||
|
9266be9708 | ||
|
76e89820eb | ||
|
bd76573401 | ||
|
6c3f271a3e | ||
|
85f0af61d0 | ||
|
3d06b0b81a | ||
|
09c8cf04af | ||
|
387ded1033 | ||
|
4cb9967b39 | ||
|
faf1ce0bcf | ||
|
ce3ef3a195 | ||
|
ade6cf8e0b | ||
|
de92767e5a | ||
|
e67c854cb5 | ||
|
cc06b07d52 | ||
|
71ed41fa69 | ||
|
859a680e19 | ||
|
240adb79eb | ||
|
4a530f5ec0 | ||
|
eb7f3878b1 | ||
|
972be7677c | ||
|
0d22407a2d | ||
|
c173d74d06 | ||
|
eda1a3b6ac | ||
|
e4b6bace43 | ||
|
908848bfc7 | ||
|
764bc0034c | ||
|
c2e76dee24 | ||
|
81cce9e07c | ||
|
cdb9157cd1 | ||
|
f34de37913 | ||
|
3f0327ff1d | ||
|
998d3f30c6 | ||
|
0eda3f3701 | ||
|
db4bfec2dd | ||
|
a796bd606f | ||
|
1152c00018 | ||
|
194a202a0b | ||
|
fbff8686bf | ||
|
b1f6bd0d67 | ||
|
89a85c0dd2 | ||
|
18181edad9 | ||
|
db946f2812 | ||
|
833a8ed13f | ||
|
51c5eb53e7 | ||
|
3e318e43e8 | ||
|
d4c80612dc | ||
|
13693a4f3b | ||
|
1f1a6938ba | ||
|
a45725052b | ||
|
d90f7f33f7 | ||
|
f917f3b570 | ||
|
4be6e0f4c3 | ||
|
ad82ecad6f | ||
|
14db2a2db7 | ||
|
e1c7e3da59 | ||
|
6bbf0604b8 | ||
|
16d4aa3aa9 |
18
.gitignore
vendored
@@ -1,20 +1,6 @@
|
||||
|
||||
# Build folders to ignore
|
||||
build
|
||||
build.local.*
|
||||
release
|
||||
|
||||
# Sublime
|
||||
local
|
||||
*.sublime-*
|
||||
|
||||
# Numerous always-ignore extensions
|
||||
*.diff
|
||||
*.err
|
||||
*.orig
|
||||
*.log
|
||||
*.rej
|
||||
*.swo
|
||||
*.swp
|
||||
*.vi
|
||||
*~
|
||||
*.sass-cache
|
||||
test
|
||||
|
267
README.md
@@ -1,33 +1,106 @@
|
||||
# h5ai
|
||||
|
||||
Don't use files from this repository (`src` folder) for installation.
|
||||
They need to be preprocessed/compiled to work correctly. You'll find a
|
||||
precompiled package on the [project page](http://larsjung.de/h5ai).
|
||||
Please don't use files from the `src` folder for installation.
|
||||
They need to be preprocessed to work correctly. You'll find a preprocessed
|
||||
package on the [project page](http://larsjung.de/h5ai/).
|
||||
|
||||
To report a bug or make a feature request
|
||||
please create [a new issue](http://github.com/lrsjng/h5ai/issues/new).
|
||||
|
||||
* Website with download, docs and demo: <http://larsjung.de/h5ai>
|
||||
* Sources: <http://github.com/lrsjng/h5ai>
|
||||
* Q&A group: <http://groups.google.com/group/h5ai>
|
||||
* to report a bug or make a feature request please create [a new issue](http://github.com/lrsjng/h5ai/issues/new) on GitHub
|
||||
* website with download, docs and demo: <http://larsjung.de/h5ai>
|
||||
* sources: <http://github.com/lrsjng/h5ai>
|
||||
|
||||
h5ai is provided under the terms of the [MIT License](http://github.com/lrsjng/h5ai/blob/master/LICENSE.txt).
|
||||
It profits from these great projects:
|
||||
[AmplifyJS](http://amplifyjs.com) (MIT/GPL),
|
||||
[Faenza icon set](http://tiheum.deviantart.com/art/Faenza-Icons-173323228) (GPL),
|
||||
[HTML5 ★ Boilerplate](http://html5boilerplate.com),
|
||||
[jQuery](http://jquery.com) (MIT/GPL),
|
||||
[jQuery.fracs](http://larsjung.de/fracs/) (MIT),
|
||||
[jQuery.mousewheel](http://github.com/brandonaaron/jquery-mousewheel) (MIT),
|
||||
[jQuery.qrcode](http://larsjung.de/qrcode/) (MIT),
|
||||
[jQuery.scrollpanel](http://larsjung.de/scrollpanel/) (MIT),
|
||||
[markdown-js](http://github.com/evilstreak/markdown-js) (MIT),
|
||||
[Modernizr](http://www.modernizr.com) (MIT/BSD),
|
||||
[modulejs](http://larsjung.de/modulejs/) (MIT),
|
||||
[Moment.js](http://momentjs.com) (MIT),
|
||||
[SyntaxHighlighter](http://alexgorbatchev.com/SyntaxHighlighter/) (MIT/GPL),
|
||||
[Underscore.js](http://underscorejs.org) (MIT)
|
||||
|
||||
|
||||
## h5ai profits from these great projects
|
||||
## Build
|
||||
|
||||
A prebuilt package can be found on the [project page](http://larsjung.de/h5ai/). If you want to build
|
||||
h5ai yourself you need to install [fQuery](http://larsjung.de/fquery/) first:
|
||||
|
||||
> npm install -g fquery
|
||||
|
||||
To build the project run the following command inside the project's root directory
|
||||
|
||||
> makejs
|
||||
|
||||
Run `makejs -t` to list all possible targets.
|
||||
|
||||
* [AmplifyJS](http://amplifyjs.com) (MIT/GPL)
|
||||
* [Datejs](http://www.datejs.com) (MIT)
|
||||
* [Faenza icon set](http://tiheum.deviantart.com/art/Faenza-Icons-173323228) (GPL)
|
||||
* [HTML5 ★ Boilerplate](http://html5boilerplate.com)
|
||||
* [jQuery](http://jquery.com) (MIT/GPL)
|
||||
* [jQuery.mousewheel](http://github.com/brandonaaron/jquery-mousewheel) (MIT)
|
||||
* [modernizr](http://www.modernizr.com) (MIT/BSD)
|
||||
* [qrcode](http://www.d-project.com/qrcode/index.html) (MIT)
|
||||
|
||||
|
||||
## Changelog
|
||||
|
||||
### v0.21 - *2012-08-06*
|
||||
|
||||
* fixes misaligned image previews
|
||||
* adds no JavaScript fallback to PHP version
|
||||
* fixes duplicate tree entries and empty main views
|
||||
* adds Google Analytics support (async)
|
||||
* improves filter (now ignorecase, now only checks if chars in right order)
|
||||
* adds keyboard support to image preview (space, enter, backspace, left, right, up, down, f, esc)
|
||||
* adds text file preview and highlighting with [SyntaxHighlighter](http://alexgorbatchev.com/SyntaxHighlighter/) (same keys as img preview)
|
||||
* adds Markdown preview with [markdown-js](http://github.com/evilstreak/markdown-js)
|
||||
* adds new type `markdown`
|
||||
* changes language code `gr` to `el`
|
||||
* adds localization for filter placeholder
|
||||
* adds `hu` translation by [Rodolffo](http://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 [Moment.js](http://momentjs.com) 1.7.0
|
||||
* updates to [Underscore.js](http://underscorejs.org) 1.3.3
|
||||
|
||||
|
||||
### v0.20 - *2012-05-11*
|
||||
|
||||
* adds image preview
|
||||
* adds thumbnails for video and pdf
|
||||
* adds support for lighttpd, nginx and cherokee and maybe other webservers with PHP
|
||||
* adds folder size in PHP version via shell `du`
|
||||
* fixes some localization problems
|
||||
* updates info page at `/_h5ai/`
|
||||
* switches to JSHint
|
||||
|
||||
|
||||
### v0.19 - *2012-04-19*
|
||||
|
||||
* adds lots of config options
|
||||
* changes in `config.js` and `h5ai.htaccess`
|
||||
* fixes js problems in IE 7+8
|
||||
* hides broken tree view in IE < 9, adds a message to the footer
|
||||
* removes hash changes since they break logical browser history
|
||||
* fixes thumbnail size for portrait images in icon view
|
||||
* fixes problems with file type recognition
|
||||
* adds an info page at `/_h5ai/`
|
||||
* sort order is preserved while browsing
|
||||
* removes PHP error messages on thumbnail generation
|
||||
* fixes PHP some problems with packed download
|
||||
* adds support for tarred downloads
|
||||
* changes crumb image for folders with an index file
|
||||
* adds `index.php` to use h5ai in non-Apache environments
|
||||
* switches from [Datejs](http://www.datejs.com) to [Moment.js](http://momentjs.com)
|
||||
* adds [underscore.js](http://underscorejs.org)
|
||||
* fixes mousewheel problems, updates [jQuery.mousewheel](http://github.com/brandonaaron/jquery-mousewheel) to 3.0.6
|
||||
* updates `lv` translation
|
||||
* adds `ro` translation by [Jakob Cosoroabă](http://github.com/midday)
|
||||
* adds `ja` translation by [metasta](http://github.com/metasta)
|
||||
* adds `nb` translation by [Sindre Sorhus](http://github.com/sindresorhus)
|
||||
* adds `sr` translation by [vBm](http://github.com/vBm)
|
||||
* adds `gr` translation by [xhmikosr](http://github.com/xhmikosr)
|
||||
|
||||
|
||||
### v0.18 - *2012-02-24*
|
||||
|
||||
@@ -46,8 +119,8 @@ h5ai is provided under the terms of the [MIT License](http://github.com/lrsjng/h
|
||||
* improves url hashes
|
||||
* updates year in `LICENSE.TXT`
|
||||
* updates es translation
|
||||
* adds zh-tw translation by [Yao Wei](http://github.com/medicalwei)
|
||||
* updates zh-cn translation
|
||||
* adds `zh-tw` translation by [Yao Wei](http://github.com/medicalwei)
|
||||
* updates `zh-cn` translation
|
||||
|
||||
|
||||
### v0.17 - *2011-11-28*
|
||||
@@ -82,33 +155,33 @@ h5ai is provided under the terms of the [MIT License](http://github.com/lrsjng/h
|
||||
|
||||
### v0.15.2 - *2011-09-18*
|
||||
|
||||
* added it translation by [Salvo Gentile](http://github.com/SalvoGentile) and [Marco Patriarca](http://github.com/Fexys)
|
||||
* switched build process from scripp to wepp
|
||||
* adds `it` translation by [Salvo Gentile](http://github.com/SalvoGentile) and [Marco Patriarca](http://github.com/Fexys)
|
||||
* switches build process from scripp to wepp
|
||||
|
||||
|
||||
### v0.15.1 - *2011-09-06*
|
||||
|
||||
* fixed security issues with the zipped download feature
|
||||
* made zipped download optional (but enabled by default)
|
||||
* fixes security issues with the zipped download feature
|
||||
* makes zipped download optional (but enabled by default)
|
||||
|
||||
|
||||
### v0.15 - *2011-09-04*
|
||||
|
||||
* added zipped download for selected files
|
||||
* cleaned and refactored
|
||||
* adds zipped download for selected files
|
||||
* cleans and refactores
|
||||
|
||||
|
||||
### v0.14.1 - *2011-09-01*
|
||||
|
||||
* display meta information in bottom bar (icon view)
|
||||
* added zh-cn translation by [Dongsheng Cai](http://github.com/dongsheng)
|
||||
* added pl translation by Radosław Zając
|
||||
* added ru translation by Богдан Илюхин
|
||||
* adds `zh-cn` translation by [Dongsheng Cai](http://github.com/dongsheng)
|
||||
* adds `pl` translation by Radosław Zając
|
||||
* adds `ru` translation by Богдан Илюхин
|
||||
|
||||
|
||||
### v0.14 - *2011-08-16*
|
||||
|
||||
* added image thumbnails for PHP version
|
||||
* adds image thumbnails for PHP version
|
||||
* new option `slideTree` to turn off auto slide in
|
||||
|
||||
|
||||
@@ -119,180 +192,178 @@ h5ai is provided under the terms of the [MIT License](http://github.com/lrsjng/h
|
||||
|
||||
### v0.13.1 - *2011-08-12*
|
||||
|
||||
* ~~hopefully fixed that PHP doesn't get interpreted~~ :/
|
||||
* fixed initial tree display
|
||||
* added sort order option
|
||||
* added/fixed some translations
|
||||
* added lv translation by Sandis Veinbergs
|
||||
* fixes initial tree display
|
||||
* adds sort order option
|
||||
* adds/fixes some translations
|
||||
* adds `lv` translation by Sandis Veinbergs
|
||||
|
||||
|
||||
### v0.13 - *2011-08-06*
|
||||
|
||||
* added PHP implementation! (should work with PHP 5.2+)
|
||||
* added new options
|
||||
* changed layout of the bottom bar to display status information
|
||||
* added language selector to the bottom bar
|
||||
* quoted keys in `options.js` to make it valid json
|
||||
* changed value of option `lang` from `undefined` to `null`
|
||||
* added some new keys to `h5aiLangs`
|
||||
* added browser caching rules for css and js
|
||||
* added pt translation by [Jonnathan](http://github.com/jonnsl)
|
||||
* added bg translation by George Andonov
|
||||
* adds PHP implementation! (should work with PHP 5.2+)
|
||||
* adds new options
|
||||
* changes layout of the bottom bar to display status information
|
||||
* adds language selector to the bottom bar
|
||||
* quotes keys in `options.js` to make it valid json
|
||||
* changes value of option `lang` from `undefined` to `null`
|
||||
* adds some new keys to `h5aiLangs`
|
||||
* adds browser caching rules for css and js
|
||||
* adds `pt` translation by [Jonnathan](http://github.com/jonnsl)
|
||||
* adds `bg` translation by George Andonov
|
||||
|
||||
|
||||
### v0.12.3 - *2011-07-30*
|
||||
|
||||
* added tr translation by [Batuhan Icoz](http://github.com/batuhanicoz)
|
||||
* adds `tr` translation by [Batuhan Icoz](http://github.com/batuhanicoz)
|
||||
|
||||
|
||||
### v0.12.2 - *2011-07-30*
|
||||
|
||||
* added es translation by Jose David Calderon Serrano
|
||||
* adds `es` translation by Jose David Calderon Serrano
|
||||
|
||||
|
||||
### v0.12.1 - *2011-07-29*
|
||||
|
||||
* fixed unchecked use of console.log
|
||||
* fixes unchecked use of console.log
|
||||
|
||||
|
||||
### v0.12 - *2011-07-28*
|
||||
|
||||
* improved performance
|
||||
* improves performance
|
||||
|
||||
|
||||
### v0.11 - *2011-07-27*
|
||||
|
||||
* changed license to MIT license, see `LICENSE.txt`
|
||||
* changes license to MIT license, see `LICENSE.txt`
|
||||
|
||||
|
||||
### v0.10.2 - *2011-07-26*
|
||||
|
||||
* improved tree scrollbar
|
||||
* improves tree scrollbar
|
||||
|
||||
|
||||
### v0.10.1 - *2011-07-24*
|
||||
|
||||
* fixed problems with ' in links
|
||||
* fixes problems with ' in links
|
||||
|
||||
|
||||
### v0.10 - *2011-07-24*
|
||||
|
||||
* fixed problems with XAMPP on Windows (see `dot.htaccess` comments for instructions)
|
||||
* fixed tree fade-in-fade-out effect for small displays ([issue #6](http://github.com/lrsjng/h5ai/issues/6))
|
||||
* added custom scrollbar to tree ([issue #6](http://github.com/lrsjng/h5ai/issues/6))
|
||||
* fixed broken links caused by URI encoding/decoding ([issue #9](http://github.com/lrsjng/h5ai/issues/9))
|
||||
* added "empty" to localization (hope Google Translate did a good job here)
|
||||
* fixes problems with XAMPP on Windows (see `dot.htaccess` comments for instructions)
|
||||
* fixes tree fade-in-fade-out effect for small displays ([issue #6](http://github.com/lrsjng/h5ai/issues/6))
|
||||
* adds custom scrollbar to tree ([issue #6](http://github.com/lrsjng/h5ai/issues/6))
|
||||
* fixes broken links caused by URI encoding/decoding ([issue #9](http://github.com/lrsjng/h5ai/issues/9))
|
||||
* adds "empty" to localization (hope Google Translate did a good job here)
|
||||
|
||||
|
||||
### v0.9 - *2011-07-18*
|
||||
|
||||
* linked hover states between crumb, extended view and tree
|
||||
* fixed size of tree view (now there's a ugly scrollbar, hopefully will be fixed)
|
||||
* refactored js to improve performance and cleaned code
|
||||
* added caching for folder status codes and content
|
||||
* added fr translation by [Nicolas](http://github.com/Nicosmos)
|
||||
* added nl translation by [Stefan de Konink](http://github.com/skinkie)
|
||||
* added sv translation by Oscar Carlsson
|
||||
* links hover states between crumb, extended view and tree
|
||||
* fixes size of tree view (now there's a ugly scrollbar, hopefully will be fixed)
|
||||
* refactores js to improve performance and cleaned code
|
||||
* adds caching for folder status codes and content
|
||||
* adds `fr` translation by [Nicolas](http://github.com/Nicosmos)
|
||||
* adds `nl` translation by [Stefan de Konink](http://github.com/skinkie)
|
||||
* adds `sv` translation by Oscar Carlsson
|
||||
|
||||
|
||||
### v0.8 - *2011-07-08*
|
||||
|
||||
* removed slashes from folder labels
|
||||
* removes slashes from folder labels
|
||||
* optionally rename parent folder entries to real folder names, see `options.js`
|
||||
* long breadcrumbs (multiple rows) no longer hide content
|
||||
* error folder icons are opaque now
|
||||
* refactored js a lot (again...)
|
||||
* refactores js a lot (again...)
|
||||
|
||||
|
||||
### v0.7 - *2011-07-07*
|
||||
|
||||
* removed shadows
|
||||
* removes shadows
|
||||
* smarter tree side bar
|
||||
|
||||
|
||||
### v0.6 - *2011-07-05*
|
||||
|
||||
* refactored js
|
||||
* added localization, see `options.js`
|
||||
* refactores js
|
||||
* adds localization, see `options.js`
|
||||
|
||||
|
||||
### v0.5.3 - *2011-07-04*
|
||||
|
||||
* refactored js
|
||||
* added basic options support via `options.js`
|
||||
* commented `options.js`
|
||||
* optional tree sidebar
|
||||
* refactores js
|
||||
* adds basic options support via `options.js`
|
||||
* adds comments to `options.js`
|
||||
* adds optional tree sidebar
|
||||
|
||||
|
||||
### v0.5.2 - *2011-07-02*
|
||||
|
||||
* details view adjusts to window width
|
||||
* linked icon for *.gz and *.bz2
|
||||
* links icon for *.gz and *.bz2
|
||||
|
||||
|
||||
### v0.5.1 - *2011-07-01*
|
||||
|
||||
* disabled tree sidebar for now, since it had unwanted side effects
|
||||
* disables tree sidebar for now, since it had unwanted side effects
|
||||
|
||||
|
||||
### v0.5 - *2011-07-01*
|
||||
|
||||
* added tree sidebar
|
||||
* adds tree sidebar
|
||||
* some refactorings
|
||||
|
||||
|
||||
### v0.4 - *2011-06-27*
|
||||
|
||||
* added better fallback, in case JavaScript is disabled
|
||||
* rewrote js, fixed middle-button click etc. problems
|
||||
* refactored css
|
||||
* sorted, added and moved icons and images
|
||||
* updated dot.access
|
||||
* adds better fallback, in case JavaScript is disabled
|
||||
* rewrites js, fixed middle-button click etc. problems
|
||||
* refactors css
|
||||
* sorts, adds and moves icons and images
|
||||
* updates dot.access
|
||||
|
||||
|
||||
### v0.3.2 - *2011-06-24*
|
||||
|
||||
* removed lib versions from file names
|
||||
* added 'empty' indicator for icons view
|
||||
* removes lib versions from file names
|
||||
* adds 'empty' indicator for icons view
|
||||
|
||||
|
||||
### v0.3.1 - *2011-06-24*
|
||||
|
||||
* refactored js
|
||||
* added `folderClick` and `fileClick` callback hooks
|
||||
* fixed .emtpy style
|
||||
* refactores js
|
||||
* adds `folderClick` and `fileClick` callback hooks
|
||||
* fixes .emtpy style
|
||||
|
||||
|
||||
### v0.3 - *2011-06-23*
|
||||
|
||||
* included build stuff, files previously found in the base directory are now located in folder `target`
|
||||
* includes build stuff, files previously found in the base directory are now located in folder `target`
|
||||
* styles and scripts are now minified
|
||||
* added Modernizr 2.0.4 for future use
|
||||
* updated jQuery to version 1.6.1
|
||||
* adds Modernizr 2.0.4 for future use
|
||||
* updates jQuery to version 1.6.1
|
||||
|
||||
|
||||
### v0.2.3 - *2011-06-17*
|
||||
|
||||
* more refactoring in main.js
|
||||
* ~~added custom js support, and global includes~~ *removed, only custom top and bottom sections supported*
|
||||
|
||||
|
||||
### v0.2.2 - *2011-06-16*
|
||||
|
||||
* refactored a lot, added some comments
|
||||
* included fixes from [NumEricR](http://github.com/NumEricR)
|
||||
* added top/bottom message support, only basicly styled
|
||||
* refactores a lot, adds some comments
|
||||
* includes fixes from [NumEricR](http://github.com/NumEricR)
|
||||
* adds top/bottom message support, only basicly styled
|
||||
|
||||
|
||||
### v0.2.1 - *2011-06-16*
|
||||
|
||||
* fixed croped filenames
|
||||
* fixed missing .png extension in header
|
||||
* added some color to the links
|
||||
* added changelog
|
||||
* fixes croped filenames
|
||||
* fixes missing .png extension in header
|
||||
* adds some color to the links
|
||||
* adds changelog
|
||||
|
||||
|
||||
### v0.2 - *2011-06-15*
|
||||
|
||||
* added icon view
|
||||
* adds icon view
|
||||
|
||||
|
@@ -1,21 +0,0 @@
|
||||
custom = true
|
||||
|
||||
|
||||
# project
|
||||
project.name = h5ai
|
||||
project.version = 0.18
|
||||
|
||||
|
||||
# src
|
||||
src.dir = src
|
||||
|
||||
|
||||
# build
|
||||
build.dir = build
|
||||
release.dir = release
|
||||
|
||||
|
||||
# tools
|
||||
tool.wepp = wepp
|
||||
tool.jslint = jslint
|
||||
|
116
build.xml
@@ -1,116 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<project
|
||||
name="h5ai"
|
||||
basedir="."
|
||||
default="release"
|
||||
>
|
||||
|
||||
<target name="init">
|
||||
<property file="build.properties" />
|
||||
<tstamp>
|
||||
<format property="build.stamp" pattern="yyyy-MM-dd-HHmmss" />
|
||||
</tstamp>
|
||||
<property name="build.label" value="${project.name} ${project.version} b${build.stamp}" />
|
||||
<echo>Build: ${build.label}</echo>
|
||||
</target>
|
||||
|
||||
<target name="clean" depends="init">
|
||||
<delete dir="${build.dir}" />
|
||||
<delete dir="${release.dir}" />
|
||||
</target>
|
||||
|
||||
<target name="build-prepare" depends="clean">
|
||||
<mkdir dir="${build.dir}" />
|
||||
<copy todir="${build.dir}">
|
||||
<fileset dir="${src.dir}" />
|
||||
<fileset file="LICENSE.txt" />
|
||||
<fileset file="README.md" />
|
||||
</copy>
|
||||
<replace dir="${build.dir}">
|
||||
<replacefilter token="%BUILD%" value="${build.label}" />
|
||||
<replacefilter token="%BUILD_NAME%" value="${project.name}" />
|
||||
<replacefilter token="%BUILD_VERSION%" value="${project.version}" />
|
||||
<replacefilter token="%BUILD_STAMP%" value="${build.stamp}" />
|
||||
</replace>
|
||||
</target>
|
||||
|
||||
<target name="build" depends="build-prepare">
|
||||
<wepp-dir-min dir="${build.dir}/_h5ai/css" todir="${build.dir}/_h5ai/css" />
|
||||
<wepp-dir-min dir="${build.dir}/_h5ai/js" todir="${build.dir}/_h5ai/js" />
|
||||
</target>
|
||||
|
||||
<target name="build-uncompressed" depends="build-prepare">
|
||||
<wepp-dir dir="${build.dir}/_h5ai/css" todir="${build.dir}/_h5ai/css" />
|
||||
<wepp-dir dir="${build.dir}/_h5ai/js" todir="${build.dir}/_h5ai/js" />
|
||||
</target>
|
||||
|
||||
<target name="release" depends="build">
|
||||
<mkdir dir="${release.dir}" />
|
||||
<zip destfile="${release.dir}/${project.name}-${project.version}.zip" basedir="${build.dir}" />
|
||||
</target>
|
||||
|
||||
<target name="lint" depends="build-prepare">
|
||||
<wepp file="${build.dir}/_h5ai/js/inc/main.js" tofile="${build.dir}/_h5ai/js/inc/main.js" />
|
||||
<jslint files="${build.dir}/_h5ai/js/inc/main.js" />
|
||||
</target>
|
||||
|
||||
|
||||
<macrodef name="wepp-args">
|
||||
<attribute name="args" default="" />
|
||||
<sequential>
|
||||
<exec executable="${tool.wepp}" failonerror="true">
|
||||
<arg line="@{args}" />
|
||||
</exec>
|
||||
</sequential>
|
||||
</macrodef>
|
||||
|
||||
<macrodef name="wepp">
|
||||
<attribute name="file" />
|
||||
<attribute name="tofile" />
|
||||
<sequential>
|
||||
<wepp-args args="--nc --inFile '@{file}' --outFile '@{toFile}'" />
|
||||
</sequential>
|
||||
</macrodef>
|
||||
|
||||
<macrodef name="wepp-min">
|
||||
<attribute name="file" />
|
||||
<attribute name="tofile" />
|
||||
<sequential>
|
||||
<wepp-args args="--inFile '@{file}' --outFile '@{toFile}'" />
|
||||
<bytes file="@{file}" toFile="@{toFile}" />
|
||||
</sequential>
|
||||
</macrodef>
|
||||
|
||||
<macrodef name="wepp-dir">
|
||||
<attribute name="dir" />
|
||||
<attribute name="todir" />
|
||||
<sequential>
|
||||
<wepp-args args="--nc --inDir '@{dir}' --outDir '@{todir}'" />
|
||||
<delete dir="@{todir}/inc" >
|
||||
<fileset dir="." includes="@{todir}/**/*.less" />
|
||||
</delete>
|
||||
</sequential>
|
||||
</macrodef>
|
||||
|
||||
<macrodef name="wepp-dir-min">
|
||||
<attribute name="dir" />
|
||||
<attribute name="todir" />
|
||||
<sequential>
|
||||
<wepp-args args="--inDir '@{dir}' --outDir '@{todir}'" />
|
||||
<delete dir="@{todir}/inc" >
|
||||
<fileset dir="." includes="@{todir}/**/*.less" />
|
||||
</delete>
|
||||
</sequential>
|
||||
</macrodef>
|
||||
|
||||
<macrodef name="jslint">
|
||||
<attribute name="files" />
|
||||
<sequential>
|
||||
<echo>JSLint @{files}</echo>
|
||||
<exec executable="${tool.jslint}" failonerror="false">
|
||||
<arg line="@{files}" />
|
||||
</exec>
|
||||
</sequential>
|
||||
</macrodef>
|
||||
|
||||
</project>
|
185
makefile.js
Normal file
@@ -0,0 +1,185 @@
|
||||
/*jshint node: true */
|
||||
'use strict';
|
||||
|
||||
|
||||
var path = require('path'),
|
||||
child_process = require('child_process');
|
||||
|
||||
|
||||
var version = '0.21',
|
||||
|
||||
root = path.resolve(__dirname),
|
||||
src = path.join(root, 'src'),
|
||||
build = path.join(root, 'build'),
|
||||
|
||||
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,
|
||||
|
||||
// Globals
|
||||
predef: [
|
||||
'modulejs'
|
||||
]
|
||||
},
|
||||
|
||||
mapper = function (blob) {
|
||||
|
||||
return blob.source.replace(src, build).replace(/\.less$/, '.css');
|
||||
},
|
||||
|
||||
mapperRoot = function (blob) {
|
||||
|
||||
return blob.source.replace(root, build + '/_h5ai');
|
||||
};
|
||||
|
||||
|
||||
module.exports = function (make) {
|
||||
|
||||
var Event = make.Event,
|
||||
$ = make.fQuery,
|
||||
moment = make.moment,
|
||||
stamp, replacements;
|
||||
|
||||
|
||||
make.defaults('build');
|
||||
|
||||
|
||||
make.before(function () {
|
||||
|
||||
stamp = moment();
|
||||
|
||||
replacements = {
|
||||
version: version,
|
||||
stamp: stamp.format('YYYY-MM-DD HH:mm:ss')
|
||||
};
|
||||
|
||||
Event.info({ method: 'before', message: version + ' ' + replacements.stamp });
|
||||
});
|
||||
|
||||
|
||||
make.target('inc', [], 'increase build number, if any')
|
||||
.sync(function () {
|
||||
|
||||
var re = /-(\d+)$/;
|
||||
var match = version.match(re);
|
||||
|
||||
if (match) {
|
||||
var number = parseInt(match[1], 10) + 1;
|
||||
var newVersion = version.replace(re, '-' + number);
|
||||
|
||||
$('makefile.js').replace([[version, newVersion]]).write($.OVERWRITE, 'makefile.js');
|
||||
|
||||
version = newVersion;
|
||||
replacements.version = version;
|
||||
Event.ok({ method: 'inc', message: 'version is now ' + version });
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
make.target('clean', [], 'delete build folder')
|
||||
.sync(function () {
|
||||
|
||||
$.rmfr($.I_AM_SURE, build);
|
||||
});
|
||||
|
||||
|
||||
make.target('lint', [], 'lint all JavaScript files with JSHint')
|
||||
.sync(function () {
|
||||
|
||||
$(src + '/_h5ai/js: **/*.js, ! *.min.js, ! inc/lib/**')
|
||||
.jshint(jshint);
|
||||
});
|
||||
|
||||
|
||||
make.target('build', [], 'build all updated files')
|
||||
.sync(function () {
|
||||
|
||||
$(src + ': _h5ai/js/*.js')
|
||||
.modified(mapper, $(src + ': _h5ai/js/**'))
|
||||
.includify()
|
||||
.uglifyjs()
|
||||
.write($.OVERWRITE, mapper);
|
||||
|
||||
$(src + ': _h5ai/css/*.less')
|
||||
.modified(mapper, $(src + ': _h5ai/css/**'))
|
||||
.less()
|
||||
.cssmin()
|
||||
.write($.OVERWRITE, mapper);
|
||||
|
||||
$(src + ': **, ! _h5ai/js/**, ! _h5ai/css/**')
|
||||
.modified(mapper)
|
||||
.mustache(replacements)
|
||||
.write($.OVERWRITE, mapper);
|
||||
|
||||
$(root + ': README*, LICENSE*')
|
||||
.modified(mapperRoot)
|
||||
.write($.OVERWRITE, mapperRoot);
|
||||
});
|
||||
|
||||
|
||||
make.target('build-uncompressed', [], 'build all updated files without compression')
|
||||
.sync(function () {
|
||||
|
||||
$(src + ': _h5ai/js/*.js')
|
||||
.modified(mapper, $(src + ': _h5ai/js/**'))
|
||||
.includify()
|
||||
// .uglifyjs()
|
||||
.write($.OVERWRITE, mapper);
|
||||
|
||||
$(src + ': _h5ai/css/*.less')
|
||||
.modified(mapper, $(src + ': _h5ai/css/**'))
|
||||
.less()
|
||||
// .cssmin()
|
||||
.write($.OVERWRITE, mapper);
|
||||
|
||||
$(src + ': **, ! _h5ai/js/**, ! _h5ai/css/**')
|
||||
.modified(mapper)
|
||||
.mustache(replacements)
|
||||
.write($.OVERWRITE, mapper);
|
||||
|
||||
$(root + ': README*, LICENSE*')
|
||||
.modified(mapperRoot)
|
||||
.write($.OVERWRITE, mapperRoot);
|
||||
});
|
||||
|
||||
|
||||
make.target('release', ['inc', 'clean', 'build'], 'create a zipball')
|
||||
.async(function (done, fail) {
|
||||
|
||||
var target = path.join(build, 'h5ai-' + version + '.zip'),
|
||||
cmd = 'zip',
|
||||
args = ['-ro', target, '_h5ai'],
|
||||
options = { cwd: build },
|
||||
proc = child_process.spawn(cmd, args, options);
|
||||
|
||||
Event.info({ method: 'exec', message: cmd + ' ' + args.join(' ') });
|
||||
|
||||
// proc.stdout.on('data', function (data) {
|
||||
// process.stdout.write(data);
|
||||
// });
|
||||
proc.stderr.on('data', function (data) {
|
||||
process.stderr.write(data);
|
||||
});
|
||||
proc.on('exit', function (code) {
|
||||
if (code) {
|
||||
Event.error({ method: 'exec', message: cmd + ' exit code ' + code });
|
||||
fail();
|
||||
} else {
|
||||
Event.ok({ method: 'exec', message: 'created zipball ' + target });
|
||||
done();
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
@@ -1,37 +1,43 @@
|
||||
|
||||
Options -Indexes
|
||||
|
||||
Options -Indexes
|
||||
<IfModule mod_expires.c>
|
||||
Header set Cache-Control "public"
|
||||
ExpiresActive on
|
||||
|
||||
AddType text/html .php
|
||||
# Perhaps better to whitelist expires rules? Perhaps.
|
||||
ExpiresDefault "access plus 1 month"
|
||||
|
||||
# cache.manifest needs re-requests in FF 3.6 (thx Remy ~Introducing HTML5)
|
||||
ExpiresByType text/cache-manifest "access plus 0 seconds"
|
||||
|
||||
###########################################
|
||||
# if php doesn't get interpreted try to
|
||||
# uncomment one of the following lines
|
||||
###########################################
|
||||
#AddHandler application/x-httpd-php .php
|
||||
#AddHandler application/x-httpd-php5 .php
|
||||
#AddHandler application/x-httpd-php52 .php
|
||||
#AddHandler application/x-httpd-php53 .php
|
||||
#AddHandler php-script .php
|
||||
#AddHandler php5-script .php
|
||||
#AddHandler php52-script .php
|
||||
#AddHandler php53-script .php
|
||||
# your document html
|
||||
ExpiresByType text/html "access plus 0 seconds"
|
||||
|
||||
# data
|
||||
ExpiresByType text/xml "access plus 0 seconds"
|
||||
ExpiresByType application/xml "access plus 0 seconds"
|
||||
ExpiresByType application/json "access plus 0 seconds"
|
||||
|
||||
# cache images, css and js for 52 weeks
|
||||
<IfModule headers_module>
|
||||
<FilesMatch "\.png$">
|
||||
Header set Cache-Control "max-age=31449600, public"
|
||||
</FilesMatch>
|
||||
<FilesMatch "\.css$">
|
||||
Header set Cache-Control "max-age=31449600, public"
|
||||
</FilesMatch>
|
||||
<FilesMatch "\.js$">
|
||||
Header set Cache-Control "max-age=31449600, public"
|
||||
</FilesMatch>
|
||||
<FilesMatch "thumb-.*\.jpg$">
|
||||
Header set Cache-Control "max-age=31449600, public"
|
||||
</FilesMatch>
|
||||
# media: images, video, audio
|
||||
ExpiresByType image/gif "access plus 1 month"
|
||||
ExpiresByType image/png "access plus 1 month"
|
||||
ExpiresByType image/jpg "access plus 1 month"
|
||||
ExpiresByType image/jpeg "access plus 1 month"
|
||||
ExpiresByType video/ogg "access plus 1 month"
|
||||
ExpiresByType audio/ogg "access plus 1 month"
|
||||
ExpiresByType video/mp4 "access plus 1 month"
|
||||
ExpiresByType video/webm "access plus 1 month"
|
||||
|
||||
# webfonts
|
||||
ExpiresByType font/truetype "access plus 1 month"
|
||||
ExpiresByType font/opentype "access plus 1 month"
|
||||
ExpiresByType font/woff "access plus 1 month"
|
||||
ExpiresByType image/svg+xml "access plus 1 month"
|
||||
ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
|
||||
|
||||
# css and javascript
|
||||
ExpiresByType text/css "access plus 1 month"
|
||||
ExpiresByType application/javascript "access plus 1 month"
|
||||
ExpiresByType text/javascript "access plus 1 month"
|
||||
</IfModule>
|
||||
|
||||
|
@@ -1,26 +1,23 @@
|
||||
################################
|
||||
# h5ai %BUILD_VERSION%
|
||||
# h5ai {{version}}
|
||||
# customized .htaccess
|
||||
################################
|
||||
|
||||
# Options +Indexes
|
||||
# Options +FollowSymLinks
|
||||
Options +Indexes
|
||||
Options +FollowSymLinks
|
||||
|
||||
# pure JavaScript version
|
||||
HeaderName /_h5ai/header.html
|
||||
HeaderName /_h5ai/apache/h5ai-header.html
|
||||
ReadmeName /_h5ai/apache/h5ai-footer.html
|
||||
|
||||
# PHP version
|
||||
# HeaderName /_h5ai/header.php
|
||||
IndexIgnore _h5ai*
|
||||
|
||||
ReadmeName /_h5ai/footer.html
|
||||
|
||||
IndexIgnore _h5ai*
|
||||
|
||||
IndexOptions Type=text/html;h5ai=%BUILD_VERSION%
|
||||
IndexOptions Charset=UTF-8
|
||||
IndexOptions FancyIndexing
|
||||
IndexOptions FoldersFirst
|
||||
IndexOptions HTMLTable
|
||||
IndexOptions NameWidth=*
|
||||
IndexOptions SuppressDescription
|
||||
IndexOptions SuppressHTMLPreamble
|
||||
IndexOptions SuppressRules
|
||||
IndexOptions SuppressDescription
|
||||
IndexOptions NameWidth=*
|
||||
IndexOptions HTMLTable
|
||||
IndexOptions Type=text/html;h5ai={{version}}
|
||||
IndexOptions XHTML
|
6
src/_h5ai/apache/h5ai-footer.html
Normal file
@@ -0,0 +1,6 @@
|
||||
<!-- generated code ends here -->
|
||||
</div>
|
||||
<script src="/_h5ai/config.js"></script>
|
||||
<script src="/_h5ai/js/scripts.js"></script>
|
||||
</body>
|
||||
</html>
|
38
src/_h5ai/apache/h5ai-header.html
Normal file
@@ -0,0 +1,38 @@
|
||||
<!DOCTYPE html>
|
||||
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en"> <![endif]-->
|
||||
<!--[if IE 7]> <html class="no-js ie7 oldie" lang="en"> <![endif]-->
|
||||
<!--[if IE 8]> <html class="no-js ie8 oldie" lang="en"> <![endif]-->
|
||||
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<title>Directory index · styled with h5ai</title>
|
||||
<meta name="description" content="Directory index styled with h5ai (http://larsjung.de/h5ai)">
|
||||
<meta name="viewport" content="width=device-width">
|
||||
<link rel="shortcut icon" type="image/png" href="/_h5ai/images/h5ai-16x16.png">
|
||||
<link rel="apple-touch-icon" type="image/png" href="/_h5ai/images/h5ai-48x48.png">
|
||||
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Ubuntu+Mono:400,700,400italic,700italic|Ubuntu:400,700,400italic,700italic">
|
||||
<link rel="stylesheet" href="/_h5ai/css/styles.css">
|
||||
<script src="/_h5ai/js/modernizr.js"></script>
|
||||
</head>
|
||||
<body id="h5ai-main">
|
||||
<div id="topbar" class="clearfix">
|
||||
<ul id="navbar"></ul>
|
||||
</div>
|
||||
<div id="content">
|
||||
<div id="extended" class="clearfix"></div>
|
||||
</div>
|
||||
<div id="bottombar" class="clearfix">
|
||||
<span class="left">
|
||||
<a id="h5ai-reference" href="http://larsjung.de/h5ai" title="h5ai project page">h5ai {{version}}</a>
|
||||
<span class="hideOnJs noJsMsg"> ⚡ JavaScript is disabled! ⚡ </span>
|
||||
<span class="oldBrowser"> ⚡ Some features disabled! Works best in <a href="http://browsehappy.com">modern browsers</a>. ⚡ </span>
|
||||
</span>
|
||||
<span class="right"></span>
|
||||
<span class="center"></span>
|
||||
</div>
|
||||
<div id="data-apache-autoindex" class="hideOnJs">
|
||||
<!--
|
||||
The following code was generated by Apache's autoindex module. It is not valid HTML5, but gets
|
||||
removed from the DOM tree as soon as possible. The actual page should render as valid HTML5.
|
||||
-->
|
@@ -1,7 +1,7 @@
|
||||
# Cache
|
||||
|
||||
This directory is used for server side caching. To use caching make this
|
||||
directory writable for Apache.
|
||||
directory writable for your webserver.
|
||||
|
||||
There is no critical data in here. You can savely remove any content. This
|
||||
will clear the cache.
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* h5ai %BUILD_VERSION%
|
||||
* h5ai {{version}}
|
||||
*
|
||||
* Configuration
|
||||
* options, types and localization
|
||||
@@ -17,16 +17,17 @@ var H5AI_CONFIG = {
|
||||
"h5aiAbsHref": "/_h5ai/",
|
||||
|
||||
/*
|
||||
* Filenames of customized header and footer files to look for
|
||||
* in each folder. For Example:
|
||||
*
|
||||
* "customHeader": "_h5ai.header.html",
|
||||
* "customFooter": "_h5ai.footer.html",
|
||||
*
|
||||
* This is disabled by default.
|
||||
* Spacing of the main content.
|
||||
* Left and right will be added to a minimum of 30px. Top and bottom
|
||||
* are calculated relative to the top and bottom bar heights.
|
||||
*/
|
||||
"customHeader": null,
|
||||
"customFooter": null,
|
||||
"spacing": {
|
||||
"maxWidth": 960,
|
||||
"top": 50,
|
||||
"right": "auto",
|
||||
"bottom": 50,
|
||||
"left": "auto"
|
||||
},
|
||||
|
||||
/*
|
||||
* An array of view modes the user may choose from. Currently there
|
||||
@@ -35,8 +36,196 @@ var H5AI_CONFIG = {
|
||||
* view mode is fixed and the selector buttons are hidden.
|
||||
* The user selected view mode is also stored local in modern browsers
|
||||
* so that it will be persistent.
|
||||
*
|
||||
* Set parent folder labels to real folder names.
|
||||
*/
|
||||
"viewmodes": ["details", "icons"],
|
||||
"view": {
|
||||
"modes": ["details", "icons"],
|
||||
"setParentFolderLabels": true
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Extensions in alphabetical order.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Show a clickable breadcrumb.
|
||||
*/
|
||||
"crumb": {
|
||||
"enabled": true
|
||||
},
|
||||
|
||||
/*
|
||||
* Filenames of customized header and footer files to look for
|
||||
* in each folder.
|
||||
*/
|
||||
"custom": {
|
||||
"enabled": true,
|
||||
"header": "_h5ai.header.html",
|
||||
"footer": "_h5ai.footer.html"
|
||||
},
|
||||
|
||||
/*
|
||||
* EXPLICITLY: USE "shell" ON YOUR OWN RISK.
|
||||
*
|
||||
* Requires PHP on the server.
|
||||
* Enable packaged download of selected entries.
|
||||
* Execution: "php", "shell".
|
||||
* Supported formats: "tar", "zip".
|
||||
*/
|
||||
"download": {
|
||||
"enabled": true,
|
||||
"execution": "shell",
|
||||
"format": "tar"
|
||||
},
|
||||
|
||||
/*
|
||||
* Allow filtering the displayed files and folders.
|
||||
* Will check entries for right order of characters, i.e.
|
||||
* "ab" matches "ab", "axb", "xaxbx" but not "ba".
|
||||
* Space separated sequences get OR-ed.
|
||||
*
|
||||
* Filters will be treated as JavaScript regular expressions
|
||||
* if you prefix them with "re:".
|
||||
*/
|
||||
"filter": {
|
||||
"enabled": true
|
||||
},
|
||||
|
||||
/*
|
||||
* Requires PHP on the server.
|
||||
* Calc the size of folders.
|
||||
* Depends on du.
|
||||
*/
|
||||
"foldersize": {
|
||||
"enabled": true
|
||||
},
|
||||
|
||||
/*
|
||||
* Associative array of folders and their HTTP status codes to
|
||||
* avoid HEAD requests to that folders. The key (folder) must start
|
||||
* and end with a slash (/).
|
||||
* For example
|
||||
* "/some/folder/": 200
|
||||
* will always return HTTP status 200 (OK), which will be interpreted
|
||||
* as a non auto indexed folder, that means a folder containing an
|
||||
* appropriate default index file.
|
||||
*/
|
||||
"folderstatus": {
|
||||
"enabled": true,
|
||||
"folders": {}
|
||||
},
|
||||
|
||||
/*
|
||||
* Adds Google Analytics asynchronous tracking code.
|
||||
*
|
||||
* for example:
|
||||
* "gaq": [
|
||||
* ["_setAccount", "UA-xxxxxx-x"],
|
||||
* ["_setDomainName", ".your-domain.tld"],
|
||||
* ["_trackPageview"],
|
||||
* ["_trackPageLoadTime"]
|
||||
* ]
|
||||
*
|
||||
* see: http://support.google.com/googleanalytics/bin/topic.py?hl=en&topic=27612
|
||||
*/
|
||||
"google-analytics": {
|
||||
"enabled": true,
|
||||
"gaq": []
|
||||
},
|
||||
|
||||
/*
|
||||
* Localization, for example "en", "de" etc. - see "langs" below for
|
||||
* possible values. Adjust it to your needs. If lang is not found in
|
||||
* "langs" it defaults to "en".
|
||||
*
|
||||
* Optionally try to use browser language, falls back to previous
|
||||
* specified language.
|
||||
*/
|
||||
"l10n": {
|
||||
"enabled": true,
|
||||
"lang": "en",
|
||||
"useBrowserLang": true
|
||||
},
|
||||
|
||||
/*
|
||||
* Link the hover effects between crumb, main view and tree.
|
||||
*/
|
||||
"link-hover-states": {
|
||||
"enabled": true
|
||||
},
|
||||
|
||||
/*
|
||||
* Shows the server mode in the bottom left corner.
|
||||
* display values:
|
||||
* 0: only show mode
|
||||
* 1: mode and servername
|
||||
* 2: mode, servername and -version
|
||||
*/
|
||||
"mode": {
|
||||
"enabled": true,
|
||||
"display": 2
|
||||
},
|
||||
|
||||
/*
|
||||
* Show an image preview on click.
|
||||
*/
|
||||
"preview-img": {
|
||||
"enabled": true,
|
||||
"types": ["bmp", "gif", "ico", "image", "jpg", "png", "tiff"]
|
||||
},
|
||||
|
||||
/*
|
||||
* Show text file preview on click.
|
||||
* "types" maps file types to SyntaxHighligher brushes. Special case: "markdown" will
|
||||
* be rendered as HTML.
|
||||
*
|
||||
* For available brushes see http://alexgorbatchev.com/SyntaxHighlighter/manual/brushes/
|
||||
*/
|
||||
"preview-txt": {
|
||||
"enabled": true,
|
||||
"types": {
|
||||
"authors": "plain",
|
||||
"copying": "plain",
|
||||
"c": "c",
|
||||
"cpp": "cpp",
|
||||
"css": "css",
|
||||
"h": "c",
|
||||
"hpp": "cpp",
|
||||
"install": "plain",
|
||||
"log": "plain",
|
||||
"java": "java",
|
||||
"makefile": "xml",
|
||||
"markdown": "plain",
|
||||
"php": "php",
|
||||
"python": "python",
|
||||
"readme": "plain",
|
||||
"rb": "ruby",
|
||||
"rtf": "plain",
|
||||
"script": "shell",
|
||||
"text": "plain",
|
||||
"js": "js",
|
||||
"xml": "xml"
|
||||
}
|
||||
},
|
||||
|
||||
/*
|
||||
* Show QRCodes on hovering files.
|
||||
*/
|
||||
"qrcode": {
|
||||
"enabled": true,
|
||||
"size": 150
|
||||
},
|
||||
|
||||
/*
|
||||
* Make entries selectable. At the moment only needed for packaged download.
|
||||
*/
|
||||
"select": {
|
||||
"enabled": true
|
||||
},
|
||||
|
||||
/*
|
||||
* Default sort order is a two letter code. The first letter specifies
|
||||
@@ -44,162 +233,133 @@ var H5AI_CONFIG = {
|
||||
* second letter specifies the sort order: "a" for "ascending" or "d"
|
||||
* for "descending".
|
||||
*/
|
||||
"sortorder": "na",
|
||||
"sort": {
|
||||
"enabled": true,
|
||||
"order": "na"
|
||||
},
|
||||
|
||||
/*
|
||||
* Show a folder tree, boolean.
|
||||
* Show additional info in a statusbar.
|
||||
*/
|
||||
"statusbar": {
|
||||
"enabled": true
|
||||
},
|
||||
|
||||
/*
|
||||
* Requires PHP on the server.
|
||||
* Show thumbnails for image files. Needs the "/_h5ai/cache" folder to be
|
||||
* writable for the Apache Server.
|
||||
* - img thumbnails depend on PHP-GD
|
||||
* - mov thumbnails depend on ffmpeg
|
||||
* - doc thumbnails depend on convert
|
||||
*/
|
||||
"thumbnails": {
|
||||
"enabled": true,
|
||||
"img": ["bmp", "gif", "ico", "image", "jpg", "png", "tiff"],
|
||||
"mov": ["video"],
|
||||
"doc": ["pdf", "ps"],
|
||||
"delay": 1
|
||||
},
|
||||
|
||||
/*
|
||||
* Replace window title with current breadcrumb.
|
||||
*/
|
||||
"title": {
|
||||
"enabled": true
|
||||
},
|
||||
|
||||
/*
|
||||
* Show a folder tree.
|
||||
* Note that this tree might have side effects as it sends HEAD requests
|
||||
* to the folders, and therefore will invoke index.php scripts. Use
|
||||
* folderStatus below to avoid such requests.
|
||||
* "folderstatus" above to avoid such requests.
|
||||
* It might also affect performance significantly.
|
||||
*
|
||||
* Slide tree bar into viewport if there is enough space.
|
||||
*/
|
||||
"showTree": true,
|
||||
|
||||
/*
|
||||
* Slide tree bar into viewport if there is enough space, boolean.
|
||||
*/
|
||||
"slideTree": true,
|
||||
|
||||
/*
|
||||
* Associative array of folders and their HTTP status codes to
|
||||
* avoid HEAD requests to that folders. The key (folder) must start
|
||||
* and end with a slash (/).
|
||||
* For example:
|
||||
* "/some/folder/": 200
|
||||
* will always return HTTP status 200 (OK), which will be interpreted
|
||||
* as a non auto indexed folder, that means a folder containing an
|
||||
* appropriate default index file.
|
||||
*/
|
||||
"folderStatus": {},
|
||||
|
||||
/*
|
||||
* Localization, for example "en", "de" etc. - see h5aiLangs below for
|
||||
* possible values. Adjust it to your needs. If lang is not found in
|
||||
* h5aiLangs it defaults to "en".
|
||||
*/
|
||||
"lang": "en",
|
||||
|
||||
/*
|
||||
* Try to use browser language, falls back to previous specified lang.
|
||||
*/
|
||||
"useBrowserLang": true,
|
||||
|
||||
/*
|
||||
* Set parent folder labels to real folder names.
|
||||
*/
|
||||
"setParentFolderLabels": true,
|
||||
|
||||
/*
|
||||
* Link the hover effects between crumb, extended view and tree.
|
||||
*/
|
||||
"linkHoverStates": true,
|
||||
|
||||
/*
|
||||
* Date format in detailed view, for example: "yyyy-MM-dd HH:mm:ss"
|
||||
* Syntax as specified by date.js
|
||||
* http://code.google.com/p/datejs/wiki/FormatSpecifiers
|
||||
*/
|
||||
"dateFormat": "yyyy-MM-dd HH:mm",
|
||||
|
||||
/*
|
||||
* Requires PHP on the server.
|
||||
* Show thumbnails for image files.
|
||||
*/
|
||||
"showThumbs": true,
|
||||
"thumbTypes": ["bmp", "gif", "ico", "image", "jpg", "png", "tiff"],
|
||||
|
||||
/*
|
||||
* Requires PHP on the server.
|
||||
* Enable zipped download of selected entries.
|
||||
*/
|
||||
"zippedDownload": false,
|
||||
|
||||
/*
|
||||
* Show QRCodes on hovering files.
|
||||
* Set this to the desired size in pixel or null to not display QRCodes.
|
||||
* A good size to start with might be 150.
|
||||
*/
|
||||
"qrCodesSize": null,
|
||||
|
||||
/*
|
||||
* Allow filtering the displayed files and folders.
|
||||
* Filters are ment to be JavaScript regular expressions.
|
||||
*/
|
||||
"showFilter": false
|
||||
"tree": {
|
||||
"enabled": true,
|
||||
"slide": true
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
/*
|
||||
* File types mapped to file extensions.
|
||||
* File types mapped to file extensions. In alphabetical order.
|
||||
*/
|
||||
"types": {
|
||||
"archive": [".tar.bz2", ".tar.gz", ".tgz"],
|
||||
"audio": [".aif", ".m4a", ".mid", ".mp3", ".mpa", ".ra", ".ogg", ".wav", ".wma"],
|
||||
"authors": ["authors"],
|
||||
"bin": [".class", ".o", ".so"],
|
||||
"blank": [],
|
||||
"bmp": [".bmp"],
|
||||
"c": [".c"],
|
||||
"calc": [".ods", ".ots", ".xlr", ".xls", ".xlsx"],
|
||||
"cd": [".cue", ".iso"],
|
||||
"copying": ["copying", "license"],
|
||||
"cpp": [".cpp"],
|
||||
"css": [".css", ".less"],
|
||||
"deb": [".deb"],
|
||||
"default": [],
|
||||
"doc": [".doc", ".docx", ".odm", ".odt", ".ott"],
|
||||
"draw": [".drw"],
|
||||
"eps": [".eps"],
|
||||
"exe": [".exe"],
|
||||
"folder": [],
|
||||
"folder-home": [],
|
||||
"folder-open": [],
|
||||
"folder-page": [],
|
||||
"folder-parent": [],
|
||||
"gif": [".gif"],
|
||||
"gzip": [".gz"],
|
||||
"h": [".h"],
|
||||
"hpp": [".hpp"],
|
||||
"html": [".htm", ".html", ".shtml"],
|
||||
"ico": [".ico"],
|
||||
"image": [".xpm"],
|
||||
"install": ["install"],
|
||||
"java": [".java"],
|
||||
"jpg": [".jpg", ".jpeg"],
|
||||
"js": [".js", ".json"],
|
||||
"log": [".log", "changelog"],
|
||||
"makefile": [".pom", "build.xml", "pom.xml"],
|
||||
"package": [],
|
||||
"pdf": [".pdf"],
|
||||
"php": [".php"],
|
||||
"playlist": [".m3u"],
|
||||
"png": [".png"],
|
||||
"pres": [".odp", ".otp", ".pps", ".ppt", ".pptx"],
|
||||
"psd": [".psd"],
|
||||
"py": [".py"],
|
||||
"rar": [".rar"],
|
||||
"rb": [".rb"],
|
||||
"readme": ["readme"],
|
||||
"rpm": [".rpm"],
|
||||
"rss": [".rss"],
|
||||
"rtf": [".rtf"],
|
||||
"script": [".conf", ".csh", ".ini", ".ksh", ".sh", ".shar", ".tcl"],
|
||||
"source": [],
|
||||
"sql": [],
|
||||
"tar": [".tar"],
|
||||
"tex": [".tex"],
|
||||
"text": [".markdown", ".md", ".text", ".txt"],
|
||||
"tiff": [".tiff"],
|
||||
"unknown": [],
|
||||
"vcal": [".vcal"],
|
||||
"video": [".avi", ".flv", ".mov", ".mp4", ".mpg", ".rm", ".swf", ".vob", ".wmv"],
|
||||
"xml": [".xml"],
|
||||
"zip": [".bz2", ".jar", ".war", ".z", ".Z", ".zip"]
|
||||
"archive": [".tar.bz2", ".tar.gz", ".tgz"],
|
||||
"audio": [".aif", ".flac", ".m4a", ".mid", ".mp3", ".mpa", ".ra", ".ogg", ".wav", ".wma"],
|
||||
"authors": ["authors"],
|
||||
"bin": [".class", ".o", ".so"],
|
||||
"blank": [],
|
||||
"bmp": [".bmp"],
|
||||
"c": [".c"],
|
||||
"calc": [".ods", ".ots", ".xlr", ".xls", ".xlsx"],
|
||||
"cd": [".cue", ".iso"],
|
||||
"copying": ["copying", "license"],
|
||||
"cpp": [".cpp"],
|
||||
"css": [".css", ".less"],
|
||||
"deb": [".deb"],
|
||||
"default": [],
|
||||
"doc": [".doc", ".docx", ".odm", ".odt", ".ott"],
|
||||
"draw": [".drw"],
|
||||
"eps": [".eps"],
|
||||
"exe": [".bat", ".cmd", ".exe"],
|
||||
"folder": [],
|
||||
"folder-home": [],
|
||||
"folder-open": [],
|
||||
"folder-page": [],
|
||||
"folder-parent": [],
|
||||
"gif": [".gif"],
|
||||
"gzip": [".gz"],
|
||||
"h": [".h"],
|
||||
"hpp": [".hpp"],
|
||||
"html": [".htm", ".html", ".shtml"],
|
||||
"ico": [".ico"],
|
||||
"image": [".xpm"],
|
||||
"install": ["install"],
|
||||
"java": [".java"],
|
||||
"jpg": [".jpg", ".jpeg"],
|
||||
"js": [".js", ".json"],
|
||||
"log": [".log", "changelog"],
|
||||
"makefile": [".pom", "build.xml", "pom.xml"],
|
||||
"markdown": [".markdown", ".md"],
|
||||
"package": [],
|
||||
"pdf": [".pdf"],
|
||||
"php": [".php"],
|
||||
"playlist": [".m3u", ".m3u8", ".pls"],
|
||||
"png": [".png"],
|
||||
"pres": [".odp", ".otp", ".pps", ".ppt", ".pptx"],
|
||||
"ps": [".ps"],
|
||||
"psd": [".psd"],
|
||||
"py": [".py"],
|
||||
"rar": [".rar"],
|
||||
"rb": [".rb"],
|
||||
"readme": ["readme"],
|
||||
"rpm": [".rpm"],
|
||||
"rss": [".rss"],
|
||||
"rtf": [".rtf"],
|
||||
"script": [".conf", ".csh", ".ini", ".ksh", ".sh", ".shar", ".tcl"],
|
||||
"source": [],
|
||||
"sql": [],
|
||||
"tar": [".tar"],
|
||||
"tex": [".tex"],
|
||||
"text": [".diff", ".patch", ".text", ".txt"],
|
||||
"tiff": [".tiff"],
|
||||
"unknown": [],
|
||||
"vcal": [".vcal"],
|
||||
"video": [".avi", ".flv", ".mkv", ".mov", ".mp4", ".mpg", ".rm", ".swf", ".vob", ".wmv"],
|
||||
"xml": [".xml"],
|
||||
"zip": [".7z", ".bz2", ".jar", ".lzma", ".war", ".z", ".Z", ".zip"]
|
||||
},
|
||||
|
||||
|
||||
/*
|
||||
* Available translations.
|
||||
* Available translations. "en" in first place as a reference, otherwise in alphabetical order.
|
||||
*
|
||||
* Date format is used in detailed view, for example: "YYYY-MM-DD HH:mm:ss"
|
||||
* Syntax as specified by Moment.js (http://momentjs.com)
|
||||
*/
|
||||
"langs": {
|
||||
|
||||
@@ -215,7 +375,9 @@ var H5AI_CONFIG = {
|
||||
"folders": "folders",
|
||||
"files": "files",
|
||||
"download": "download",
|
||||
"noMatch": "no match"
|
||||
"noMatch": "no match",
|
||||
"dateFormat": "YYYY-MM-DD HH:mm",
|
||||
"filter": "filter"
|
||||
},
|
||||
|
||||
"bg": {
|
||||
@@ -228,9 +390,7 @@ var H5AI_CONFIG = {
|
||||
"parentDirectory": "Предходна директория",
|
||||
"empty": "празно",
|
||||
"folders": "папки",
|
||||
"files": "файлове",
|
||||
"download": "download",
|
||||
"noMatch": "no match"
|
||||
"files": "файлове"
|
||||
},
|
||||
|
||||
"cs": {
|
||||
@@ -243,9 +403,7 @@ var H5AI_CONFIG = {
|
||||
"parentDirectory": "Nadřazený adresář",
|
||||
"empty": "prázdný",
|
||||
"folders": "složek",
|
||||
"files": "souborů",
|
||||
"download": "download",
|
||||
"noMatch": "no match"
|
||||
"files": "souborů"
|
||||
},
|
||||
|
||||
"de": {
|
||||
@@ -260,7 +418,25 @@ var H5AI_CONFIG = {
|
||||
"folders": "Ordner",
|
||||
"files": "Dateien",
|
||||
"download": "Download",
|
||||
"noMatch": "keine Treffer"
|
||||
"noMatch": "keine Treffer",
|
||||
"dateFormat": "DD.MM.YYYY HH:mm",
|
||||
"filter": "Filter"
|
||||
},
|
||||
|
||||
"el": {
|
||||
"lang": "ελληνικά",
|
||||
"details": "λεπτομέρειες",
|
||||
"icons": "εικονίδια",
|
||||
"name": "Όνομα",
|
||||
"lastModified": "Τελευταία τροποποίηση",
|
||||
"size": "Μέγεθος",
|
||||
"parentDirectory": "Προηγούμενος Κατάλογος",
|
||||
"empty": "κενό",
|
||||
"folders": "φάκελοι",
|
||||
"files": "αρχεία",
|
||||
"download": "μεταμόρφωση",
|
||||
"noMatch": "κανένα αποτέλεσμα",
|
||||
"dateFormat": "DD/MM/YYYY HH:mm"
|
||||
},
|
||||
|
||||
"es": {
|
||||
@@ -274,8 +450,7 @@ var H5AI_CONFIG = {
|
||||
"empty": "vacío",
|
||||
"folders": "Directorios",
|
||||
"files": "Archivos",
|
||||
"download": "Descargar",
|
||||
"noMatch": "no match"
|
||||
"download": "Descargar"
|
||||
},
|
||||
|
||||
"fr": {
|
||||
@@ -290,7 +465,24 @@ var H5AI_CONFIG = {
|
||||
"folders": "Répertoires",
|
||||
"files": "Fichiers",
|
||||
"download": "télécharger",
|
||||
"noMatch": "no match"
|
||||
"noMatch": "rien trouvé",
|
||||
"dateFormat": "DD/MM/YYYY HH:mm"
|
||||
},
|
||||
|
||||
"hu": {
|
||||
"lang": "magyar",
|
||||
"details": "részletek",
|
||||
"icons": "ikonok",
|
||||
"name": "Név",
|
||||
"lastModified": "Utoljára módosítva",
|
||||
"size": "Méret",
|
||||
"parentDirectory": "Szülő könyvtár",
|
||||
"empty": "üres",
|
||||
"folders": "mappák",
|
||||
"files": "fájlok",
|
||||
"download": "letöltés",
|
||||
"noMatch": "nincs találat",
|
||||
"dateFormat": "YYYY-MM-DD HH:mm"
|
||||
},
|
||||
|
||||
"it": {
|
||||
@@ -303,10 +495,23 @@ var H5AI_CONFIG = {
|
||||
"parentDirectory": "Cartella Superiore",
|
||||
"empty": "vuota",
|
||||
"folders": "cartelle",
|
||||
"files": "file",
|
||||
"download": "download",
|
||||
"noMatch": "no match"
|
||||
},
|
||||
"files": "file"
|
||||
},
|
||||
|
||||
"ja": {
|
||||
"lang": "日本語",
|
||||
"details": "詳細",
|
||||
"icons": "アイコン",
|
||||
"name": "名前",
|
||||
"lastModified": "変更日",
|
||||
"size": "サイズ",
|
||||
"parentDirectory": "親フォルダ",
|
||||
"empty": "項目なし",
|
||||
"folders": "フォルダ",
|
||||
"files": "ファイル",
|
||||
"download": "ダウンロード",
|
||||
"noMatch": "一致なし"
|
||||
},
|
||||
|
||||
"lv": {
|
||||
"lang": "latviešu",
|
||||
@@ -320,7 +525,23 @@ var H5AI_CONFIG = {
|
||||
"folders": "mapes",
|
||||
"files": "faili",
|
||||
"download": "lejupielādēt",
|
||||
"noMatch": "no match"
|
||||
"noMatch": "nav sakritības",
|
||||
"dateFormat": "YYYY-MM-DD HH:mm"
|
||||
},
|
||||
|
||||
"nb": {
|
||||
"lang": "norwegian",
|
||||
"details": "detaljer",
|
||||
"icons": "ikoner",
|
||||
"name": "Navn",
|
||||
"lastModified": "Sist endret",
|
||||
"size": "Størrelse",
|
||||
"parentDirectory": "Overordnet mappe",
|
||||
"empty": "tom",
|
||||
"folders": "mapper",
|
||||
"files": "filer",
|
||||
"download": "last ned",
|
||||
"noMatch": "ingen treff"
|
||||
},
|
||||
|
||||
"nl": {
|
||||
@@ -331,11 +552,7 @@ var H5AI_CONFIG = {
|
||||
"lastModified": "Laatste wijziging",
|
||||
"size": "Grootte",
|
||||
"parentDirectory": "Bovenliggende map",
|
||||
"empty": "lege",
|
||||
"folders": "folders",
|
||||
"files": "files",
|
||||
"download": "download",
|
||||
"noMatch": "no match"
|
||||
"empty": "lege"
|
||||
},
|
||||
|
||||
"pl": {
|
||||
@@ -348,9 +565,7 @@ var H5AI_CONFIG = {
|
||||
"parentDirectory": "Katalog nadrzędny",
|
||||
"empty": "pusty",
|
||||
"folders": "foldery",
|
||||
"files": "pliki",
|
||||
"download": "download",
|
||||
"noMatch": "no match"
|
||||
"files": "pliki"
|
||||
},
|
||||
|
||||
"pt": {
|
||||
@@ -363,9 +578,22 @@ var H5AI_CONFIG = {
|
||||
"parentDirectory": "Diretório superior",
|
||||
"empty": "vazio",
|
||||
"folders": "pastas",
|
||||
"files": "arquivos",
|
||||
"download": "download",
|
||||
"noMatch": "no match"
|
||||
"files": "arquivos"
|
||||
},
|
||||
|
||||
"ro": {
|
||||
"lang": "română",
|
||||
"details": "detalii",
|
||||
"icons": "pictograme",
|
||||
"name": "nume",
|
||||
"lastModified": "ultima modificare",
|
||||
"size": "mărime",
|
||||
"parentDirectory": "dosar părinte",
|
||||
"empty": "gol",
|
||||
"folders": "dosar",
|
||||
"files": "fişiere",
|
||||
"download": "descarcă",
|
||||
"noMatch": "0 rezultate"
|
||||
},
|
||||
|
||||
"ru": {
|
||||
@@ -378,9 +606,7 @@ var H5AI_CONFIG = {
|
||||
"parentDirectory": "Главная директория",
|
||||
"empty": "пусто",
|
||||
"folders": "папки",
|
||||
"files": "файлы",
|
||||
"download": "download",
|
||||
"noMatch": "no match"
|
||||
"files": "файлы"
|
||||
},
|
||||
|
||||
"sk": {
|
||||
@@ -393,9 +619,22 @@ var H5AI_CONFIG = {
|
||||
"parentDirectory": "Nadriadený priečinok",
|
||||
"empty": "prázdny",
|
||||
"folders": "priečinkov",
|
||||
"files": "súborov",
|
||||
"files": "súborov"
|
||||
},
|
||||
|
||||
"sr": {
|
||||
"lang": "srpski",
|
||||
"details": "detalji",
|
||||
"icons": "ikone",
|
||||
"name": "Ime",
|
||||
"lastModified": "Poslednja modifikacija",
|
||||
"size": "Veličina",
|
||||
"parentDirectory": "Roditeljski direktorijum",
|
||||
"empty": "prazno",
|
||||
"folders": "direktorijum",
|
||||
"files": "fajlovi",
|
||||
"download": "download",
|
||||
"noMatch": "no match"
|
||||
"noMatch": "bez poklapanja"
|
||||
},
|
||||
|
||||
"sv": {
|
||||
@@ -406,11 +645,7 @@ var H5AI_CONFIG = {
|
||||
"lastModified": "Senast ändrad",
|
||||
"size": "Filstorlek",
|
||||
"parentDirectory": "Till överordnad mapp",
|
||||
"empty": "tom",
|
||||
"folders": "folders",
|
||||
"files": "files",
|
||||
"download": "download",
|
||||
"noMatch": "no match"
|
||||
"empty": "tom"
|
||||
},
|
||||
|
||||
"tr": {
|
||||
@@ -424,8 +659,7 @@ var H5AI_CONFIG = {
|
||||
"empty": "boş",
|
||||
"folders": "klasörler",
|
||||
"files": "dosyalar",
|
||||
"download": "indir",
|
||||
"noMatch": "no match"
|
||||
"download": "indir"
|
||||
},
|
||||
|
||||
"zh-cn": {
|
||||
@@ -439,8 +673,7 @@ var H5AI_CONFIG = {
|
||||
"empty": "空文件夹",
|
||||
"folders": "文件夹",
|
||||
"files": "文件",
|
||||
"download": "下载",
|
||||
"noMatch": "no match"
|
||||
"download": "下载"
|
||||
},
|
||||
|
||||
"zh-tw": {
|
||||
@@ -454,8 +687,7 @@ var H5AI_CONFIG = {
|
||||
"empty": "空資料夾",
|
||||
"folders": "資料夾",
|
||||
"files": "檔案",
|
||||
"download": "下載",
|
||||
"noMatch": "no match"
|
||||
"download": "下載"
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
* h5ai %BUILD_VERSION%
|
||||
* h5ai {{version}}
|
||||
*
|
||||
* PHP Configuration
|
||||
* filesystem paths and file ignore rules
|
||||
@@ -14,7 +14,7 @@ $H5AI_CONFIG = array(
|
||||
* This configuration assumes that h5ai is installed
|
||||
* in the webroot directory of the Apache server.
|
||||
*/
|
||||
"ROOT_ABS_PATH" => safe_dirname(safe_dirname(__FILE__)),
|
||||
"ROOT_ABS_PATH" => dirname(dirname(__FILE__)),
|
||||
|
||||
/*
|
||||
* Files/folders that should not be listed. Specified
|
||||
@@ -22,8 +22,13 @@ $H5AI_CONFIG = array(
|
||||
* http://www.php.net/manual/en/function.preg-match.php
|
||||
*/
|
||||
"IGNORE" => array(),
|
||||
"IGNORE_PATTERNS" => array("/^\\./", "/^_h5ai/")
|
||||
"IGNORE_PATTERNS" => array("/^\\./", "/^_h5ai/"),
|
||||
|
||||
/*
|
||||
* Folders that contain one of these files will be considered
|
||||
* as none h5ai folders.
|
||||
*/
|
||||
"INDEX_FILES" => array("index.html", "index.htm", "index.php")
|
||||
);
|
||||
|
||||
?>
|
@@ -1,40 +1,58 @@
|
||||
|
||||
#table {
|
||||
#data-apache-autoindex, #data-php-no-js-fallback {
|
||||
max-width: 960px;
|
||||
margin: 0 auto;
|
||||
|
||||
table {
|
||||
display: block;
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
|
||||
th, td {
|
||||
padding: 3px 6px;
|
||||
padding: 6px;
|
||||
text-align: left;
|
||||
border: none;
|
||||
}
|
||||
th {
|
||||
padding-bottom: 18px;
|
||||
opacity: 0.4;
|
||||
.transition(all 0.2s ease-in-out);
|
||||
|
||||
&:hover, &:hover a {
|
||||
color: #555;
|
||||
cursor: pointer;
|
||||
opacity: 0.9;
|
||||
}
|
||||
a, a:visited {
|
||||
color: #555;
|
||||
font-weight: normal;
|
||||
text-decoration: none;
|
||||
cursor: pointer;
|
||||
opacity: 0.4;
|
||||
.transition(all 0.2s ease-in-out);
|
||||
|
||||
img {
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
padding: 0 8px;
|
||||
&:hover {
|
||||
color: #555;
|
||||
opacity: 0.9;
|
||||
}
|
||||
}
|
||||
span {
|
||||
color: #555;
|
||||
font-weight: normal;
|
||||
opacity: 0.4;
|
||||
}
|
||||
}
|
||||
td {
|
||||
border: 1px solid #ddd;
|
||||
border-left: none;
|
||||
border-right: none;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
font-size: 16px;
|
||||
|
||||
a, a:active, a:visited {
|
||||
display: block;
|
||||
color: #555;
|
||||
text-decoration: none;
|
||||
cursor: pointer;
|
||||
|
||||
&:hover {
|
||||
color: #e80;
|
||||
}
|
||||
}
|
||||
}
|
||||
td:nth-child(1), th:nth-child(1) {
|
||||
text-align: center;
|
||||
@@ -43,26 +61,23 @@
|
||||
img {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
padding-top: 2px;
|
||||
position: relative;
|
||||
top: -2px;
|
||||
}
|
||||
}
|
||||
td:nth-child(2), th:nth-child(2) {
|
||||
width: 682px;
|
||||
max-width: 682px;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
}
|
||||
td:nth-child(3), th:nth-child(3) {
|
||||
text-align: right;
|
||||
width: 160px;
|
||||
min-width: 160px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
td:nth-child(4), th:nth-child(4) {
|
||||
text-align: right;
|
||||
width: 70px;
|
||||
min-width: 70px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
}
|
67
src/_h5ai/css/inc/bottombar.less
Normal file
@@ -0,0 +1,67 @@
|
||||
|
||||
#bottombar {
|
||||
position: fixed;
|
||||
z-index: 5;
|
||||
width: 100%;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
padding: 6px 0 8px 0;
|
||||
.vert-gradient(rgb(241,241,241), rgb(228,228,228));
|
||||
border-top: 1px solid rgb(210,210,210);
|
||||
|
||||
color: #999;
|
||||
text-align: center;
|
||||
|
||||
a, a:active, a:visited {
|
||||
color: #555;
|
||||
text-decoration: none;
|
||||
.transition(all 0.2s ease-in-out);
|
||||
opacity: 0.7;
|
||||
|
||||
&:hover {
|
||||
color: #e80;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
.left {
|
||||
display: block;
|
||||
padding: 0 8px;
|
||||
float: left
|
||||
}
|
||||
.center {
|
||||
display: block;
|
||||
margin: 0 100px;
|
||||
}
|
||||
.right {
|
||||
display: block;
|
||||
padding: 0 8px;
|
||||
float: right
|
||||
}
|
||||
.noJsMsg {
|
||||
color: #c33;
|
||||
margin-left: 16px;
|
||||
}
|
||||
.oldBrowser {
|
||||
display: none;
|
||||
color: #c33;
|
||||
margin-left: 16px;
|
||||
a, a:active, a:visited {
|
||||
color: #c33;
|
||||
text-decoration: underline;
|
||||
&:hover {
|
||||
color: #e80;
|
||||
}
|
||||
}
|
||||
}
|
||||
.status {
|
||||
.sep {
|
||||
display: inline-block;
|
||||
padding: 0 6px;
|
||||
}
|
||||
&.default {
|
||||
}
|
||||
&.dynamic {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,18 +1,31 @@
|
||||
|
||||
#content {
|
||||
max-width: 960px;
|
||||
margin: 0 auto;
|
||||
margin: 50px auto;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
> header {
|
||||
display: none;
|
||||
padding-bottom: 10px;
|
||||
margin-bottom: 80px;
|
||||
border-bottom: 2px dashed #ddd;
|
||||
}
|
||||
> footer {
|
||||
display: none;
|
||||
padding-top: 10px;
|
||||
margin-top: 80px;
|
||||
border-top: 2px dashed #ddd;
|
||||
|
||||
#content-header, #content-footer {
|
||||
|
||||
a, a:active, a:visited {
|
||||
color: #2080FF;
|
||||
text-decoration: none;
|
||||
cursor: pointer;
|
||||
|
||||
&:hover {
|
||||
color: #68A9FF;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#content-header {
|
||||
padding-bottom: 12px;
|
||||
margin-bottom: 32px;
|
||||
}
|
||||
|
||||
#content-footer {
|
||||
padding-top: 12px;
|
||||
margin-top: 32px;
|
||||
}
|
||||
|
30
src/_h5ai/css/inc/download.less
Normal file
@@ -0,0 +1,30 @@
|
||||
|
||||
#download {
|
||||
display: none;
|
||||
.topbar-right;
|
||||
.transition(all 0.2s ease-in-out);
|
||||
|
||||
&.failed {
|
||||
background-color: rgba(255,0,0,0.5);
|
||||
}
|
||||
}
|
||||
|
||||
#download-auth {
|
||||
display: none;
|
||||
position: fixed;
|
||||
z-index: 5;
|
||||
left: 0;
|
||||
top: 0;
|
||||
.vert-gradient(rgb(241,241,241), rgb(228,228,228));
|
||||
border: 1px solid rgb(210,210,210);
|
||||
|
||||
input {
|
||||
display: block;
|
||||
margin: 4px 6px;
|
||||
border: 1px solid rgb(210,210,210);
|
||||
font-family: Ubuntu, sans-serif;
|
||||
color: #555;
|
||||
background-color: rgba(255,255,255,1);
|
||||
width: 100px;
|
||||
}
|
||||
}
|
@@ -1,5 +1,17 @@
|
||||
|
||||
#extended.details-view {
|
||||
#selection-rect {
|
||||
display: none;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
z-index: 2;
|
||||
border: 1px dashed rgba(240,100,0,0.5);
|
||||
background-color: rgba(240,100,0,0.2);
|
||||
}
|
||||
|
||||
|
||||
|
||||
#extended.view-details {
|
||||
display: none;
|
||||
|
||||
ul {
|
||||
@@ -13,6 +25,8 @@
|
||||
clear: both;
|
||||
|
||||
&.header {
|
||||
font-size: 13px;
|
||||
|
||||
a, a:active, a:visited {
|
||||
padding-bottom: 18px;
|
||||
color: #555;
|
||||
@@ -42,22 +56,21 @@
|
||||
}
|
||||
}
|
||||
&.entry {
|
||||
|
||||
a, a:active, a:visited {
|
||||
display: block;
|
||||
color: #555;
|
||||
text-decoration: none;
|
||||
cursor: pointer;
|
||||
border-bottom: 1px solid #ddd;
|
||||
border-bottom: 1px solid #e8e8e8;
|
||||
|
||||
&:hover, &.hover {
|
||||
background-color: #f6f6f6;
|
||||
color: #e80;
|
||||
}
|
||||
&.selected:not(.selecting), &.selecting:not(.selected) {
|
||||
border-color: rgba(240,100,0,0.2);
|
||||
background-color: rgba(240,100,0,0.2);
|
||||
}
|
||||
}
|
||||
&.selected:not(.selecting) a, &.selecting:not(.selected) a {
|
||||
border-color: rgba(240,100,0,0.2);
|
||||
background-color: rgba(240,100,0,0.2);
|
||||
}
|
||||
&.error {
|
||||
a, a:active, a:visited {
|
||||
@@ -82,11 +95,6 @@
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
&.folder {
|
||||
.size {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
.icon, .label, .date, .size {
|
||||
padding: 6px;
|
||||
@@ -97,12 +105,13 @@
|
||||
left: 0;
|
||||
top: -2px;
|
||||
width: 16px;
|
||||
text-align: center;
|
||||
|
||||
img {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
max-width: 16px;
|
||||
max-height: 16px;
|
||||
&.thumb {
|
||||
border: 1px solid #eee;
|
||||
.box-shadow(0 0 0 1px #ddd);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -132,18 +141,121 @@
|
||||
width: 80px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
&.entry.thumb .icon.small {
|
||||
overflow: hidden;
|
||||
padding: 5px;
|
||||
}
|
||||
}
|
||||
.empty, .no-match {
|
||||
text-align: center;
|
||||
margin: 50px 0;
|
||||
color: #ddd;
|
||||
font-size: 5em;
|
||||
font-weight: bold;
|
||||
}
|
||||
.no-match {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#extended.view-list {
|
||||
display: none;
|
||||
|
||||
ul {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
|
||||
li {
|
||||
position: relative;
|
||||
white-space: nowrap;
|
||||
clear: both;
|
||||
|
||||
&.header {
|
||||
display: none;
|
||||
}
|
||||
&.entry {
|
||||
a, a:active, a:visited {
|
||||
display: block;
|
||||
color: #555;
|
||||
text-decoration: none;
|
||||
cursor: pointer;
|
||||
border-bottom: 1px solid #e8e8e8;
|
||||
height: 56px;
|
||||
|
||||
&:hover, &.hover {
|
||||
background-color: #f6f6f6;
|
||||
color: #e80;
|
||||
}
|
||||
}
|
||||
&.selected:not(.selecting) a, &.selecting:not(.selected) a {
|
||||
border-color: rgba(240,100,0,0.2);
|
||||
background-color: rgba(240,100,0,0.2);
|
||||
}
|
||||
&.error {
|
||||
a, a:active, a:visited {
|
||||
color: #aaa;
|
||||
|
||||
.label {
|
||||
.hint {
|
||||
margin-left: 12px;
|
||||
font-size: 0.9em;
|
||||
color: #c55;
|
||||
}
|
||||
}
|
||||
&:hover, &.hover {
|
||||
opacity: 1;
|
||||
background-color: #f6f6f6;
|
||||
color: #e80;
|
||||
}
|
||||
}
|
||||
}
|
||||
&.folder-parent {
|
||||
.date, .size {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
.icon, .label, .date, .size {
|
||||
padding: 6px;
|
||||
}
|
||||
.icon {
|
||||
display: inline-block;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: -2px;
|
||||
width: 100px;
|
||||
text-align: center;
|
||||
|
||||
img {
|
||||
background-color: #eee;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
border: 1px solid #ddd;
|
||||
overflow: hidden;
|
||||
max-width: 100px;
|
||||
max-height: 48px;
|
||||
&.thumb {
|
||||
.box-shadow(0 0 0 1px #ddd);
|
||||
}
|
||||
}
|
||||
}
|
||||
.icon.small {
|
||||
display: none;
|
||||
}
|
||||
.label {
|
||||
display: block;
|
||||
margin: 0 270px 0 106px;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-align: left;
|
||||
}
|
||||
.date {
|
||||
margin: 0 0 0 106px;
|
||||
text-align: right;
|
||||
width: 160px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.size {
|
||||
text-align: right;
|
||||
width: 80px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
}
|
||||
.empty, .no-match {
|
||||
@@ -159,18 +271,9 @@
|
||||
}
|
||||
|
||||
|
||||
#selection-rect {
|
||||
display: none;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
z-index: 2;
|
||||
border: 1px dashed rgba(240,100,0,0.5);
|
||||
background-color: rgba(240,100,0,0.2);
|
||||
}
|
||||
|
||||
|
||||
#extended.icons-view {
|
||||
#extended.view-icons {
|
||||
display: none;
|
||||
padding: 3px;
|
||||
|
||||
@@ -206,19 +309,16 @@
|
||||
border-color: #eee;
|
||||
background-color: #f6f6f6;
|
||||
}
|
||||
&.selected:not(.selecting), &.selecting:not(.selected) {
|
||||
border-color: rgba(240,100,0,0.2);
|
||||
background-color: rgba(240,100,0,0.2);
|
||||
}
|
||||
.icon {
|
||||
display: block;
|
||||
height: 48px;
|
||||
margin-bottom: 6px;
|
||||
|
||||
img {
|
||||
min-width: 48px;
|
||||
min-height: 48px;
|
||||
margin-bottom: 8px;
|
||||
max-width: 100px;
|
||||
max-height: 48px;
|
||||
&.thumb {
|
||||
border: 1px solid #eee;
|
||||
.box-shadow(0 0 0 1px #ddd);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -233,6 +333,10 @@
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
&.selected:not(.selecting) a, &.selecting:not(.selected) a {
|
||||
border-color: rgba(240,100,0,0.2);
|
||||
background-color: rgba(240,100,0,0.2);
|
||||
}
|
||||
&.error {
|
||||
a, a:active, a:visited {
|
||||
color: #aaa;
|
||||
@@ -253,21 +357,6 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
&.entry.thumb .icon.big {
|
||||
width: 100px;
|
||||
height: 58px;
|
||||
overflow: hidden;
|
||||
|
||||
img {
|
||||
background-color: #eee;
|
||||
min-width: 46px;
|
||||
min-height: 46px;
|
||||
min-width: 12px;
|
||||
min-height: 12px;
|
||||
border: 1px solid #ddd;
|
||||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.empty, .no-match {
|
||||
|
19
src/_h5ai/css/inc/filter.less
Normal file
@@ -0,0 +1,19 @@
|
||||
|
||||
#filter {
|
||||
.topbar-right;
|
||||
|
||||
input {
|
||||
display: none;
|
||||
border: none;
|
||||
font-family: Ubuntu, sans-serif;
|
||||
color: #555;
|
||||
background-color: rgba(0,0,0,0);
|
||||
width: 100px;
|
||||
}
|
||||
|
||||
&.current {
|
||||
input {
|
||||
display: inline;
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,108 +0,0 @@
|
||||
|
||||
body > footer {
|
||||
position: fixed;
|
||||
z-index: 5;
|
||||
width: 100%;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
padding: 6px 0 8px 0;
|
||||
.vert-gradient(rgb(241,241,241), rgb(228,228,228));
|
||||
border-top: 1px solid rgb(210,210,210);
|
||||
|
||||
color: #999;
|
||||
font-size: 0.85em;
|
||||
text-align: center;
|
||||
|
||||
a, a:active, a:visited {
|
||||
color: #555;
|
||||
text-decoration: none;
|
||||
.transition(all 0.2s ease-in-out);
|
||||
opacity: 0.7;
|
||||
|
||||
&:hover {
|
||||
color: #e80;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
.left {
|
||||
display: block;
|
||||
padding: 0 8px;
|
||||
float: left
|
||||
}
|
||||
.center {
|
||||
display: block;
|
||||
margin: 0 100px;
|
||||
}
|
||||
.right {
|
||||
display: block;
|
||||
padding: 0 8px;
|
||||
float: right
|
||||
}
|
||||
.noJsMsg {
|
||||
color: #c33;
|
||||
margin-left: 16px;
|
||||
}
|
||||
.status {
|
||||
.sep {
|
||||
display: inline-block;
|
||||
padding: 0 6px;
|
||||
}
|
||||
&.default {
|
||||
}
|
||||
&.dynamic {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
#langSelector {
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
|
||||
.langOptions {
|
||||
position: absolute;
|
||||
z-index: 2;
|
||||
overflow: auto;
|
||||
display: none;
|
||||
right: 0;
|
||||
top: 0;
|
||||
max-height: 200px;
|
||||
background-color: rgb(241,241,241);
|
||||
border: 1px solid rgb(210,210,210);
|
||||
|
||||
> .scrollbar {
|
||||
margin: 0;
|
||||
width: 6px;
|
||||
background-color: rgb(210,210,210);
|
||||
|
||||
.drag {
|
||||
background-color: rgb(180,180,180);
|
||||
}
|
||||
&.dragOn .drag {
|
||||
background-color: rgb(150,150,150);
|
||||
}
|
||||
}
|
||||
|
||||
ul {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
text-align: left;
|
||||
|
||||
li {
|
||||
padding: 8px 24px 10px 24px;
|
||||
white-space: nowrap;
|
||||
border-top: 1px solid rgb(231,231,231);
|
||||
.transition(all 0.2s ease-in-out);
|
||||
|
||||
&.current {
|
||||
color: #333;
|
||||
background-color: rgba(255,255,255,0.8);
|
||||
}
|
||||
&:hover {
|
||||
color: #e80;
|
||||
background-color: rgba(255,255,255,0.8);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
77
src/_h5ai/css/inc/h5ai-info.less
Normal file
@@ -0,0 +1,77 @@
|
||||
|
||||
body#h5ai-info {
|
||||
font-family: Ubuntu, Arial, sans;
|
||||
margin: 2em auto 4em auto;
|
||||
font-size: 20px;
|
||||
color: #555;
|
||||
max-width: 600px;
|
||||
text-align: center;
|
||||
|
||||
.build-version {
|
||||
display: block;
|
||||
// font-size: 0.9em;
|
||||
// color: #aaa;
|
||||
}
|
||||
.build-stamp {
|
||||
display: block;
|
||||
margin-top: 0.3em;
|
||||
font-size: 0.6em;
|
||||
color: #aaa;
|
||||
}
|
||||
h1 {
|
||||
font-size: 3.6em;
|
||||
margin: 0;
|
||||
}
|
||||
h2 {
|
||||
font-size: 1.15em;
|
||||
margin: 2.6em 0 0 0;
|
||||
}
|
||||
p {
|
||||
line-height: 1.6em;
|
||||
}
|
||||
p + p {
|
||||
margin-top: 1.2em;
|
||||
}
|
||||
li {
|
||||
margin-top: 0.6em;
|
||||
line-height: 1.4em;
|
||||
}
|
||||
|
||||
#tests {
|
||||
display: inline-block;
|
||||
list-style-type: none;
|
||||
text-align: left;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
|
||||
.test-label {
|
||||
display: inline-block;
|
||||
width: 300px;
|
||||
}
|
||||
.test-result {
|
||||
display: inline-block;
|
||||
width: 70px;
|
||||
text-align: right;
|
||||
font-weight: bold;
|
||||
color: #aaa;
|
||||
|
||||
&.test-passed {
|
||||
color: #5a5;
|
||||
}
|
||||
&.test-failed {
|
||||
color: #a55;
|
||||
}
|
||||
}
|
||||
.test-info {
|
||||
margin: 4px 0 12px 12px;
|
||||
font-size: 0.7em;
|
||||
color: #aaa;
|
||||
width: 300px;
|
||||
line-height: 1.2em;
|
||||
}
|
||||
}
|
||||
|
||||
#bottombar {
|
||||
font-size: 13px;
|
||||
}
|
||||
}
|
54
src/_h5ai/css/inc/l10n.less
Normal file
@@ -0,0 +1,54 @@
|
||||
|
||||
#langSelector {
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
|
||||
.langOptions {
|
||||
position: absolute;
|
||||
z-index: 2;
|
||||
overflow: auto;
|
||||
display: none;
|
||||
right: 0;
|
||||
top: 0;
|
||||
max-height: 200px;
|
||||
background-color: rgb(241,241,241);
|
||||
border: 1px solid rgb(210,210,210);
|
||||
|
||||
.sp-scrollbar {
|
||||
margin: 0;
|
||||
width: 6px;
|
||||
background-color: rgb(210,210,210);
|
||||
cursor: pointer;
|
||||
|
||||
.sp-thumb {
|
||||
background-color: rgb(180,180,180);
|
||||
}
|
||||
&.active .sp-thumb {
|
||||
background-color: rgb(150,150,150);
|
||||
}
|
||||
}
|
||||
|
||||
ul {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
text-align: left;
|
||||
|
||||
li {
|
||||
padding: 8px 24px 10px 24px;
|
||||
white-space: nowrap;
|
||||
border-top: 1px solid rgb(231,231,231);
|
||||
.transition(all 0.2s ease-in-out);
|
||||
|
||||
&.current {
|
||||
color: #333;
|
||||
background-color: rgba(255,255,255,0.8);
|
||||
}
|
||||
&:hover {
|
||||
color: #e80;
|
||||
background-color: rgba(255,255,255,0.8);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,135 +0,0 @@
|
||||
|
||||
.nav-highlight {
|
||||
background-color: rgba(255,255,255,0.5);
|
||||
opacity: 1.0;
|
||||
}
|
||||
|
||||
.nav-hover {
|
||||
.nav-highlight;
|
||||
color: #e80;
|
||||
}
|
||||
|
||||
@nav-sep-border: 1px solid rgba(0,0,0,0.05);
|
||||
|
||||
.nav-left {
|
||||
float: left;
|
||||
border-right: @nav-sep-border;
|
||||
}
|
||||
|
||||
.nav-right {
|
||||
float: right;
|
||||
border-left: @nav-sep-border;
|
||||
}
|
||||
|
||||
body > nav {
|
||||
position: fixed;
|
||||
z-index: 5;
|
||||
width: 100%;
|
||||
left: 0;
|
||||
top: 0;
|
||||
font-size: 0.85em;
|
||||
.vert-gradient(rgb(241,241,241), rgb(228,228,228));
|
||||
border-bottom: 1px solid rgb(210,210,210);
|
||||
|
||||
span.jsDisabledFallback {
|
||||
display: block;
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
padding: 0 10px;
|
||||
color: #999;
|
||||
}
|
||||
a, a:active, a:visited, span.element {
|
||||
color: #555;
|
||||
cursor: pointer;
|
||||
text-decoration: none;
|
||||
opacity: 0.7;
|
||||
.transition(all 0.2s ease-in-out);
|
||||
|
||||
display: block;
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
padding: 0 10px;
|
||||
|
||||
&:hover, &.hover {
|
||||
.nav-hover;
|
||||
}
|
||||
}
|
||||
.current {
|
||||
a, span.element {
|
||||
.nav-highlight;
|
||||
}
|
||||
}
|
||||
img {
|
||||
position: relative;
|
||||
top: -2px;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
}
|
||||
img + span, img + input {
|
||||
margin-left: 6px;
|
||||
}
|
||||
.crumb {
|
||||
.nav-left;
|
||||
.hint {
|
||||
margin-left: 8px;
|
||||
font-style: italic;
|
||||
color: #999;
|
||||
}
|
||||
img.hint {
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
}
|
||||
}
|
||||
.view {
|
||||
.nav-right;
|
||||
}
|
||||
#download {
|
||||
display: none;
|
||||
.nav-right;
|
||||
.transition(all 0.2s ease-in-out);
|
||||
|
||||
&.failed {
|
||||
background-color: rgba(255,0,0,0.5);
|
||||
}
|
||||
}
|
||||
#filter {
|
||||
.nav-right;
|
||||
|
||||
input {
|
||||
display: none;
|
||||
border: none;
|
||||
font-family: Ubuntu, sans-serif;
|
||||
color: #555;
|
||||
background-color: rgba(0,0,0,0);
|
||||
width: 100px;
|
||||
}
|
||||
|
||||
&.current {
|
||||
input {
|
||||
display: inline;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#download-auth {
|
||||
display: none;
|
||||
position: fixed;
|
||||
z-index: 5;
|
||||
left: 0;
|
||||
top: 0;
|
||||
font-size: 0.85em;
|
||||
.vert-gradient(rgb(241,241,241), rgb(228,228,228));
|
||||
border: 1px solid rgb(210,210,210);
|
||||
|
||||
input {
|
||||
display: block;
|
||||
margin: 4px 6px;
|
||||
border: 1px solid rgb(210,210,210);
|
||||
font-family: Ubuntu, sans-serif;
|
||||
color: #555;
|
||||
background-color: rgba(255,255,255,1);
|
||||
width: 100px;
|
||||
}
|
||||
}
|
129
src/_h5ai/css/inc/preview-img.less
Normal file
@@ -0,0 +1,129 @@
|
||||
|
||||
#pv-img-overlay {
|
||||
display: none;
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
z-index: 100;
|
||||
|
||||
background-color: rgba(0,0,0,0.5);
|
||||
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#pv-img-content {
|
||||
position: fixed;
|
||||
|
||||
}
|
||||
|
||||
#pv-img-image {
|
||||
max-width: 100%;
|
||||
max-height: 100%;
|
||||
border: 2px solid #fff;
|
||||
.border-radius(4px);
|
||||
}
|
||||
|
||||
#pv-img-overlay.fullscreen {
|
||||
background-color: #111;
|
||||
|
||||
#pv-img-image {
|
||||
border: 0;
|
||||
.border-radius(0);
|
||||
}
|
||||
}
|
||||
|
||||
#pv-img-close {
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#pv-img-prev {
|
||||
position: fixed;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#pv-img-next {
|
||||
position: fixed;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#pv-img-buttons, #pv-img-topbuttons {
|
||||
list-style: none;
|
||||
list-style-image: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
|
||||
img {
|
||||
position: relative;
|
||||
top: -2px;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
}
|
||||
img + span, img + input {
|
||||
margin-left: 6px;
|
||||
}
|
||||
input {
|
||||
background-color: rgba(255,255,255,0.1);
|
||||
border: none;
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
.bar-label {
|
||||
display: block;
|
||||
color: #ccc;
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
padding: 0 10px;
|
||||
opacity: 0.7;
|
||||
.transition(all 0.2s ease-in-out);
|
||||
}
|
||||
|
||||
.bar-highlight {
|
||||
background-color: rgba(255,255,255,0.1);
|
||||
opacity: 1.0;
|
||||
}
|
||||
|
||||
@bar-sep-border: 1px solid rgba(255,255,255,0.05);
|
||||
|
||||
.bar-button {
|
||||
.bar-label;
|
||||
cursor: pointer;
|
||||
&:hover, &.hover {
|
||||
.bar-highlight;
|
||||
}
|
||||
}
|
||||
|
||||
.bar-left {
|
||||
float: left;
|
||||
border-right: @bar-sep-border;
|
||||
}
|
||||
|
||||
.bar-right {
|
||||
float: right;
|
||||
border-left: @bar-sep-border;
|
||||
}
|
||||
}
|
||||
|
||||
#pv-img-topbar {
|
||||
position: fixed;
|
||||
z-index: 5;
|
||||
width: 100%;
|
||||
left: 0;
|
||||
top: 0;
|
||||
.vert-gradient(rgb(37,37,37), rgb(24,24,24));
|
||||
border-bottom: 1px solid rgb(27,27,27);
|
||||
}
|
||||
|
||||
#pv-img-bottombar {
|
||||
position: fixed;
|
||||
z-index: 5;
|
||||
width: 100%;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
.vert-gradient(rgb(27,27,27), rgb(14,14,14));
|
||||
border-top: 1px solid rgb(45,45,45);
|
||||
}
|
154
src/_h5ai/css/inc/preview-txt.less
Normal file
@@ -0,0 +1,154 @@
|
||||
|
||||
#pv-txt-overlay {
|
||||
display: none;
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
z-index: 100;
|
||||
|
||||
background-color: rgba(0,0,0,0.5);
|
||||
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#pv-txt-content {
|
||||
max-width: 960px;
|
||||
margin: 0 auto;
|
||||
padding: 10px;
|
||||
background-color: #fff;
|
||||
border: 2px solid #fff;
|
||||
.border-radius(4px);
|
||||
text-align: left;
|
||||
overflow: auto;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
#pv-txt-text {
|
||||
.syntaxhighlighter {
|
||||
overflow: visible !important;
|
||||
|
||||
.gutter .line {
|
||||
border-right: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
&.markdown {
|
||||
font-size: 16px;
|
||||
padding: 8px 24px;
|
||||
|
||||
a, a:active, a:visited {
|
||||
color: #2080FF;
|
||||
text-decoration: none;
|
||||
cursor: pointer;
|
||||
|
||||
&:hover {
|
||||
color: #68A9FF;
|
||||
}
|
||||
}
|
||||
|
||||
pre, code {
|
||||
font-family: "Ubuntu Mono", monospace;
|
||||
}
|
||||
code {
|
||||
color: #008200;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#pv-txt-close {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#pv-txt-prev {
|
||||
position: fixed;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#pv-txt-next {
|
||||
position: fixed;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#pv-txt-buttons, #pv-txt-topbuttons {
|
||||
list-style: none;
|
||||
list-style-image: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
|
||||
img {
|
||||
position: relative;
|
||||
top: -2px;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
}
|
||||
img + span, img + input {
|
||||
margin-left: 6px;
|
||||
}
|
||||
input {
|
||||
background-color: rgba(255,255,255,0.1);
|
||||
border: none;
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
.bar-label {
|
||||
display: block;
|
||||
color: #ccc;
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
padding: 0 10px;
|
||||
opacity: 0.7;
|
||||
.transition(all 0.2s ease-in-out);
|
||||
}
|
||||
|
||||
.bar-highlight {
|
||||
background-color: rgba(255,255,255,0.1);
|
||||
opacity: 1.0;
|
||||
}
|
||||
|
||||
@bar-sep-border: 1px solid rgba(255,255,255,0.05);
|
||||
|
||||
.bar-button {
|
||||
.bar-label;
|
||||
cursor: pointer;
|
||||
&:hover, &.hover {
|
||||
.bar-highlight;
|
||||
}
|
||||
}
|
||||
|
||||
.bar-left {
|
||||
float: left;
|
||||
border-right: @bar-sep-border;
|
||||
}
|
||||
|
||||
.bar-right {
|
||||
float: right;
|
||||
border-left: @bar-sep-border;
|
||||
}
|
||||
}
|
||||
|
||||
#pv-txt-topbar {
|
||||
position: fixed;
|
||||
z-index: 5;
|
||||
width: 100%;
|
||||
left: 0;
|
||||
top: 0;
|
||||
.vert-gradient(rgb(37,37,37), rgb(24,24,24));
|
||||
border-bottom: 1px solid rgb(27,27,27);
|
||||
}
|
||||
|
||||
#pv-txt-bottombar {
|
||||
position: fixed;
|
||||
z-index: 5;
|
||||
width: 100%;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
.vert-gradient(rgb(27,27,27), rgb(14,14,14));
|
||||
border-top: 1px solid rgb(45,45,45);
|
||||
}
|
@@ -1,10 +1,11 @@
|
||||
|
||||
@media only screen and (max-width: 500px) {
|
||||
body > nav {
|
||||
#topbar {
|
||||
.view span {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
#extended.icons-view {
|
||||
#extended.view-icons {
|
||||
padding: 0;
|
||||
border: none;
|
||||
margin: 0 -14px;
|
||||
@@ -12,7 +13,7 @@ body > nav {
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 350px) {
|
||||
body > nav {
|
||||
#topbar {
|
||||
.crumb {
|
||||
display: none;
|
||||
}
|
||||
@@ -20,7 +21,7 @@ body > nav {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
#extended.details-view {
|
||||
#extended.view-details {
|
||||
.header .label, .entry .label {
|
||||
margin-right: 110px;
|
||||
}
|
||||
@@ -28,9 +29,29 @@ body > nav {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
body > footer {
|
||||
#bottombar {
|
||||
.center {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media print {
|
||||
a[href]:after {
|
||||
content: "";
|
||||
}
|
||||
#topbar {
|
||||
position: static;
|
||||
margin-bottom: 2em;
|
||||
.view, #download {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
#bottombar {
|
||||
position: static;
|
||||
margin-top: 2em;
|
||||
}
|
||||
#tree {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
|
88
src/_h5ai/css/inc/topbar.less
Normal file
@@ -0,0 +1,88 @@
|
||||
|
||||
#topbar {
|
||||
position: fixed;
|
||||
z-index: 5;
|
||||
width: 100%;
|
||||
left: 0;
|
||||
top: 0;
|
||||
.vert-gradient(rgb(241,241,241), rgb(228,228,228));
|
||||
border-bottom: 1px solid rgb(210,210,210);
|
||||
}
|
||||
|
||||
|
||||
.topbar-highlight {
|
||||
background-color: rgba(255,255,255,0.5);
|
||||
opacity: 1.0;
|
||||
}
|
||||
|
||||
.topbar-hover {
|
||||
.topbar-highlight;
|
||||
color: #e80;
|
||||
}
|
||||
|
||||
@topbar-sep-border: 1px solid rgba(0,0,0,0.05);
|
||||
|
||||
.topbar-left {
|
||||
float: left;
|
||||
border-right: @topbar-sep-border;
|
||||
}
|
||||
|
||||
.topbar-right {
|
||||
float: right;
|
||||
border-left: @topbar-sep-border;
|
||||
}
|
||||
|
||||
|
||||
#navbar {
|
||||
list-style: none;
|
||||
list-style-image: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
|
||||
a, a:active, a:visited, span.element {
|
||||
color: #555;
|
||||
cursor: pointer;
|
||||
text-decoration: none;
|
||||
opacity: 0.7;
|
||||
.transition(all 0.2s ease-in-out);
|
||||
|
||||
display: block;
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
padding: 0 10px;
|
||||
|
||||
&:hover, &.hover {
|
||||
.topbar-hover;
|
||||
}
|
||||
}
|
||||
.current {
|
||||
a, span.element {
|
||||
.topbar-highlight;
|
||||
}
|
||||
}
|
||||
img {
|
||||
position: relative;
|
||||
top: -2px;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
}
|
||||
img + span, img + input {
|
||||
margin-left: 6px;
|
||||
}
|
||||
.crumb {
|
||||
.topbar-left;
|
||||
.hint {
|
||||
margin-left: 8px;
|
||||
font-style: italic;
|
||||
color: #999;
|
||||
}
|
||||
img.hint {
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
opacity: 0.8;
|
||||
}
|
||||
}
|
||||
.view {
|
||||
.topbar-right;
|
||||
}
|
||||
}
|
@@ -7,41 +7,33 @@
|
||||
height: 100%;
|
||||
z-index: 3;
|
||||
overflow: auto;
|
||||
font-size: 0.85em;
|
||||
padding: 8px;
|
||||
background-color: rgb(241,241,241);
|
||||
border-right: 2px solid rgb(221,221,221);
|
||||
|
||||
> .scrollbar {
|
||||
.sp-scrollbar {
|
||||
margin: 8px 8px 8px 0;
|
||||
width: 6px;
|
||||
background-color: rgb(210,210,210);
|
||||
.border-radius(3px);
|
||||
cursor: pointer;
|
||||
|
||||
.drag {
|
||||
.sp-thumb {
|
||||
background-color: rgb(180,180,180);
|
||||
.border-radius(3px);
|
||||
}
|
||||
&.dragOn .drag {
|
||||
&.active .sp-thumb {
|
||||
background-color: rgb(150,150,150);
|
||||
}
|
||||
}
|
||||
|
||||
.entry {
|
||||
.blank, .indicator {
|
||||
.indicator {
|
||||
display: inline-block;
|
||||
width: 16px;
|
||||
height: 25px;
|
||||
float: left;
|
||||
}
|
||||
.indicator {
|
||||
opacity: 0.7;
|
||||
.transition(all 0.2s ease-in-out);
|
||||
cursor: pointer;
|
||||
|
||||
&:hover {
|
||||
opacity: 1;
|
||||
}
|
||||
img {
|
||||
position: relative;
|
||||
left: 0;
|
||||
@@ -52,13 +44,23 @@
|
||||
.transition(all 0.2s ease-in-out);
|
||||
}
|
||||
&.open {
|
||||
cursor: pointer;
|
||||
opacity: 0.7;
|
||||
img {
|
||||
.transform(rotate(90deg));
|
||||
}
|
||||
}
|
||||
&.close {
|
||||
cursor: pointer;
|
||||
opacity: 0.7;
|
||||
}
|
||||
&.unknown {
|
||||
cursor: pointer;
|
||||
opacity: 0.3;
|
||||
}
|
||||
&.none {
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
> a, > a:active, > a.visited {
|
||||
margin-left: 16px;
|
||||
@@ -92,16 +94,8 @@
|
||||
margin-left: 12px;
|
||||
font-size: 0.9em;
|
||||
color: #ccc;
|
||||
img {
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
vertical-align: baseline;
|
||||
}
|
||||
}
|
||||
}
|
||||
&.file {
|
||||
display: none;
|
||||
}
|
||||
&.current {
|
||||
> a, > a:active, > a:visited {
|
||||
border: 1px solid rgb(221,221,221);
|
||||
|
@@ -31,8 +31,7 @@ audio:not([controls]) { display: none; }
|
||||
* 3. Prevent iOS text size adjust on device orientation change, without disabling user zoom: h5bp.com/g
|
||||
*/
|
||||
|
||||
//html { font-size: 100%; overflow-y: scroll; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; }
|
||||
html { font-size: 100%; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; }
|
||||
html { font-size: 100%; overflow-y: scroll; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; }
|
||||
|
||||
body { margin: 0; font-size: 13px; line-height: 1.231; }
|
||||
|
@@ -1,5 +1,4 @@
|
||||
|
||||
|
||||
.border-radius (@radius) {
|
||||
-webkit-border-radius: @radius; /* Saf3-4, iOS 1-3.2, Android <1.6 */
|
||||
-moz-border-radius: @radius; /* FF1-3.6 */
|
||||
@@ -56,4 +55,3 @@
|
||||
-moz-background-size: @size; /* FF3.6 */
|
||||
background-size: @size; /* Opera, IE9, Saf5, Chrome, FF4 */
|
||||
}
|
||||
|
228
src/_h5ai/css/lib/sh/shCore.less
Normal file
@@ -0,0 +1,228 @@
|
||||
/**
|
||||
* SyntaxHighlighter
|
||||
* http://alexgorbatchev.com/SyntaxHighlighter
|
||||
*
|
||||
* SyntaxHighlighter is donationware. If you are using it, please donate.
|
||||
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
|
||||
*
|
||||
* @version
|
||||
* 3.0.83 (July 02 2010)
|
||||
*
|
||||
* @copyright
|
||||
* Copyright (C) 2004-2010 Alex Gorbatchev.
|
||||
*
|
||||
* @license
|
||||
* Dual licensed under the MIT and GPL licenses.
|
||||
*/
|
||||
.syntaxhighlighter a,
|
||||
.syntaxhighlighter div,
|
||||
.syntaxhighlighter code,
|
||||
.syntaxhighlighter table,
|
||||
.syntaxhighlighter table td,
|
||||
.syntaxhighlighter table tr,
|
||||
.syntaxhighlighter table tbody,
|
||||
.syntaxhighlighter table thead,
|
||||
.syntaxhighlighter table caption,
|
||||
.syntaxhighlighter textarea {
|
||||
-moz-border-radius: 0 0 0 0 !important;
|
||||
-webkit-border-radius: 0 0 0 0 !important;
|
||||
background: none !important;
|
||||
border: 0 !important;
|
||||
bottom: auto !important;
|
||||
float: none !important;
|
||||
height: auto !important;
|
||||
left: auto !important;
|
||||
line-height: 1.1em !important;
|
||||
margin: 0 !important;
|
||||
outline: 0 !important;
|
||||
overflow: visible !important;
|
||||
padding: 0 !important;
|
||||
position: static !important;
|
||||
right: auto !important;
|
||||
text-align: left !important;
|
||||
top: auto !important;
|
||||
vertical-align: baseline !important;
|
||||
width: auto !important;
|
||||
box-sizing: content-box !important;
|
||||
// font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important;
|
||||
font-family: "Ubuntu Mono", "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important;
|
||||
font-weight: normal !important;
|
||||
font-style: normal !important;
|
||||
// font-size: 1em !important;
|
||||
font-size: 16px !important;
|
||||
min-height: inherit !important;
|
||||
min-height: auto !important;
|
||||
}
|
||||
|
||||
.syntaxhighlighter {
|
||||
width: 100% !important;
|
||||
margin: 1em 0 1em 0 !important;
|
||||
position: relative !important;
|
||||
overflow: auto !important;
|
||||
font-size: 1em !important;
|
||||
}
|
||||
.syntaxhighlighter.source {
|
||||
overflow: hidden !important;
|
||||
}
|
||||
.syntaxhighlighter .bold {
|
||||
font-weight: bold !important;
|
||||
}
|
||||
.syntaxhighlighter .italic {
|
||||
font-style: italic !important;
|
||||
}
|
||||
.syntaxhighlighter .line {
|
||||
white-space: pre !important;
|
||||
}
|
||||
.syntaxhighlighter table {
|
||||
width: 100% !important;
|
||||
}
|
||||
.syntaxhighlighter table caption {
|
||||
text-align: left !important;
|
||||
padding: .5em 0 0.5em 1em !important;
|
||||
}
|
||||
.syntaxhighlighter table td.code {
|
||||
width: 100% !important;
|
||||
}
|
||||
.syntaxhighlighter table td.code .container {
|
||||
position: relative !important;
|
||||
}
|
||||
.syntaxhighlighter table td.code .container textarea {
|
||||
box-sizing: border-box !important;
|
||||
position: absolute !important;
|
||||
left: 0 !important;
|
||||
top: 0 !important;
|
||||
width: 100% !important;
|
||||
height: 100% !important;
|
||||
border: none !important;
|
||||
background: white !important;
|
||||
padding-left: 1em !important;
|
||||
overflow: hidden !important;
|
||||
white-space: pre !important;
|
||||
}
|
||||
.syntaxhighlighter table td.gutter .line {
|
||||
text-align: right !important;
|
||||
padding: 0 0.5em 0 1em !important;
|
||||
}
|
||||
.syntaxhighlighter table td.code .line {
|
||||
padding: 0 1em !important;
|
||||
}
|
||||
.syntaxhighlighter.nogutter td.code .container textarea, .syntaxhighlighter.nogutter td.code .line {
|
||||
padding-left: 0em !important;
|
||||
}
|
||||
.syntaxhighlighter.show {
|
||||
display: block !important;
|
||||
}
|
||||
.syntaxhighlighter.collapsed table {
|
||||
display: none !important;
|
||||
}
|
||||
.syntaxhighlighter.collapsed .toolbar {
|
||||
padding: 0.1em 0.8em 0em 0.8em !important;
|
||||
font-size: 1em !important;
|
||||
position: static !important;
|
||||
width: auto !important;
|
||||
height: auto !important;
|
||||
}
|
||||
.syntaxhighlighter.collapsed .toolbar span {
|
||||
display: inline !important;
|
||||
margin-right: 1em !important;
|
||||
}
|
||||
.syntaxhighlighter.collapsed .toolbar span a {
|
||||
padding: 0 !important;
|
||||
display: none !important;
|
||||
}
|
||||
.syntaxhighlighter.collapsed .toolbar span a.expandSource {
|
||||
display: inline !important;
|
||||
}
|
||||
.syntaxhighlighter .toolbar {
|
||||
position: absolute !important;
|
||||
right: 1px !important;
|
||||
top: 1px !important;
|
||||
width: 11px !important;
|
||||
height: 11px !important;
|
||||
font-size: 10px !important;
|
||||
z-index: 10 !important;
|
||||
}
|
||||
.syntaxhighlighter .toolbar span.title {
|
||||
display: inline !important;
|
||||
}
|
||||
.syntaxhighlighter .toolbar a {
|
||||
display: block !important;
|
||||
text-align: center !important;
|
||||
text-decoration: none !important;
|
||||
padding-top: 1px !important;
|
||||
}
|
||||
.syntaxhighlighter .toolbar a.expandSource {
|
||||
display: none !important;
|
||||
}
|
||||
.syntaxhighlighter.ie {
|
||||
font-size: .9em !important;
|
||||
padding: 1px 0 1px 0 !important;
|
||||
}
|
||||
.syntaxhighlighter.ie .toolbar {
|
||||
line-height: 8px !important;
|
||||
}
|
||||
.syntaxhighlighter.ie .toolbar a {
|
||||
padding-top: 0px !important;
|
||||
}
|
||||
.syntaxhighlighter.printing .line.alt1 .content,
|
||||
.syntaxhighlighter.printing .line.alt2 .content,
|
||||
.syntaxhighlighter.printing .line.highlighted .number,
|
||||
.syntaxhighlighter.printing .line.highlighted.alt1 .content,
|
||||
.syntaxhighlighter.printing .line.highlighted.alt2 .content {
|
||||
background: none !important;
|
||||
}
|
||||
.syntaxhighlighter.printing .line .number {
|
||||
color: #bbbbbb !important;
|
||||
}
|
||||
.syntaxhighlighter.printing .line .content {
|
||||
color: black !important;
|
||||
}
|
||||
.syntaxhighlighter.printing .toolbar {
|
||||
display: none !important;
|
||||
}
|
||||
.syntaxhighlighter.printing a {
|
||||
text-decoration: none !important;
|
||||
}
|
||||
.syntaxhighlighter.printing .plain, .syntaxhighlighter.printing .plain a {
|
||||
color: black !important;
|
||||
}
|
||||
.syntaxhighlighter.printing .comments, .syntaxhighlighter.printing .comments a {
|
||||
color: #008200 !important;
|
||||
}
|
||||
.syntaxhighlighter.printing .string, .syntaxhighlighter.printing .string a {
|
||||
color: blue !important;
|
||||
}
|
||||
.syntaxhighlighter.printing .keyword {
|
||||
color: #006699 !important;
|
||||
font-weight: bold !important;
|
||||
}
|
||||
.syntaxhighlighter.printing .preprocessor {
|
||||
color: gray !important;
|
||||
}
|
||||
.syntaxhighlighter.printing .variable {
|
||||
color: #aa7700 !important;
|
||||
}
|
||||
.syntaxhighlighter.printing .value {
|
||||
color: #009900 !important;
|
||||
}
|
||||
.syntaxhighlighter.printing .functions {
|
||||
color: #ff1493 !important;
|
||||
}
|
||||
.syntaxhighlighter.printing .constants {
|
||||
color: #0066cc !important;
|
||||
}
|
||||
.syntaxhighlighter.printing .script {
|
||||
font-weight: bold !important;
|
||||
}
|
||||
.syntaxhighlighter.printing .color1, .syntaxhighlighter.printing .color1 a {
|
||||
color: gray !important;
|
||||
}
|
||||
.syntaxhighlighter.printing .color2, .syntaxhighlighter.printing .color2 a {
|
||||
color: #ff1493 !important;
|
||||
}
|
||||
.syntaxhighlighter.printing .color3, .syntaxhighlighter.printing .color3 a {
|
||||
color: red !important;
|
||||
}
|
||||
.syntaxhighlighter.printing .break, .syntaxhighlighter.printing .break a {
|
||||
color: black !important;
|
||||
}
|
117
src/_h5ai/css/lib/sh/shThemeDefault.less
Normal file
@@ -0,0 +1,117 @@
|
||||
/**
|
||||
* SyntaxHighlighter
|
||||
* http://alexgorbatchev.com/SyntaxHighlighter
|
||||
*
|
||||
* SyntaxHighlighter is donationware. If you are using it, please donate.
|
||||
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
|
||||
*
|
||||
* @version
|
||||
* 3.0.83 (July 02 2010)
|
||||
*
|
||||
* @copyright
|
||||
* Copyright (C) 2004-2010 Alex Gorbatchev.
|
||||
*
|
||||
* @license
|
||||
* Dual licensed under the MIT and GPL licenses.
|
||||
*/
|
||||
.syntaxhighlighter {
|
||||
background-color: white !important;
|
||||
}
|
||||
.syntaxhighlighter .line.alt1 {
|
||||
background-color: white !important;
|
||||
}
|
||||
.syntaxhighlighter .line.alt2 {
|
||||
background-color: white !important;
|
||||
}
|
||||
.syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 {
|
||||
background-color: #e0e0e0 !important;
|
||||
}
|
||||
.syntaxhighlighter .line.highlighted.number {
|
||||
color: black !important;
|
||||
}
|
||||
.syntaxhighlighter table caption {
|
||||
color: black !important;
|
||||
}
|
||||
.syntaxhighlighter .gutter {
|
||||
color: #afafaf !important;
|
||||
}
|
||||
.syntaxhighlighter .gutter .line {
|
||||
border-right: 3px solid #6ce26c !important;
|
||||
}
|
||||
.syntaxhighlighter .gutter .line.highlighted {
|
||||
background-color: #6ce26c !important;
|
||||
color: white !important;
|
||||
}
|
||||
.syntaxhighlighter.printing .line .content {
|
||||
border: none !important;
|
||||
}
|
||||
.syntaxhighlighter.collapsed {
|
||||
overflow: visible !important;
|
||||
}
|
||||
.syntaxhighlighter.collapsed .toolbar {
|
||||
color: blue !important;
|
||||
background: white !important;
|
||||
border: 1px solid #6ce26c !important;
|
||||
}
|
||||
.syntaxhighlighter.collapsed .toolbar a {
|
||||
color: blue !important;
|
||||
}
|
||||
.syntaxhighlighter.collapsed .toolbar a:hover {
|
||||
color: red !important;
|
||||
}
|
||||
.syntaxhighlighter .toolbar {
|
||||
color: white !important;
|
||||
background: #6ce26c !important;
|
||||
border: none !important;
|
||||
}
|
||||
.syntaxhighlighter .toolbar a {
|
||||
color: white !important;
|
||||
}
|
||||
.syntaxhighlighter .toolbar a:hover {
|
||||
color: black !important;
|
||||
}
|
||||
.syntaxhighlighter .plain, .syntaxhighlighter .plain a {
|
||||
color: black !important;
|
||||
}
|
||||
.syntaxhighlighter .comments, .syntaxhighlighter .comments a {
|
||||
color: #008200 !important;
|
||||
}
|
||||
.syntaxhighlighter .string, .syntaxhighlighter .string a {
|
||||
color: blue !important;
|
||||
}
|
||||
.syntaxhighlighter .keyword {
|
||||
color: #006699 !important;
|
||||
}
|
||||
.syntaxhighlighter .preprocessor {
|
||||
color: gray !important;
|
||||
}
|
||||
.syntaxhighlighter .variable {
|
||||
color: #aa7700 !important;
|
||||
}
|
||||
.syntaxhighlighter .value {
|
||||
color: #009900 !important;
|
||||
}
|
||||
.syntaxhighlighter .functions {
|
||||
color: #ff1493 !important;
|
||||
}
|
||||
.syntaxhighlighter .constants {
|
||||
color: #0066cc !important;
|
||||
}
|
||||
.syntaxhighlighter .script {
|
||||
font-weight: bold !important;
|
||||
color: #006699 !important;
|
||||
background-color: none !important;
|
||||
}
|
||||
.syntaxhighlighter .color1, .syntaxhighlighter .color1 a {
|
||||
color: gray !important;
|
||||
}
|
||||
.syntaxhighlighter .color2, .syntaxhighlighter .color2 a {
|
||||
color: #ff1493 !important;
|
||||
}
|
||||
.syntaxhighlighter .color3, .syntaxhighlighter .color3 a {
|
||||
color: red !important;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .keyword {
|
||||
font-weight: bold !important;
|
||||
}
|
120
src/_h5ai/css/lib/sh/shThemeDjango.less
Normal file
@@ -0,0 +1,120 @@
|
||||
/**
|
||||
* SyntaxHighlighter
|
||||
* http://alexgorbatchev.com/SyntaxHighlighter
|
||||
*
|
||||
* SyntaxHighlighter is donationware. If you are using it, please donate.
|
||||
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
|
||||
*
|
||||
* @version
|
||||
* 3.0.83 (July 02 2010)
|
||||
*
|
||||
* @copyright
|
||||
* Copyright (C) 2004-2010 Alex Gorbatchev.
|
||||
*
|
||||
* @license
|
||||
* Dual licensed under the MIT and GPL licenses.
|
||||
*/
|
||||
.syntaxhighlighter {
|
||||
background-color: #0a2b1d !important;
|
||||
}
|
||||
.syntaxhighlighter .line.alt1 {
|
||||
background-color: #0a2b1d !important;
|
||||
}
|
||||
.syntaxhighlighter .line.alt2 {
|
||||
background-color: #0a2b1d !important;
|
||||
}
|
||||
.syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 {
|
||||
background-color: #233729 !important;
|
||||
}
|
||||
.syntaxhighlighter .line.highlighted.number {
|
||||
color: white !important;
|
||||
}
|
||||
.syntaxhighlighter table caption {
|
||||
color: #f8f8f8 !important;
|
||||
}
|
||||
.syntaxhighlighter .gutter {
|
||||
color: #497958 !important;
|
||||
}
|
||||
.syntaxhighlighter .gutter .line {
|
||||
border-right: 3px solid #41a83e !important;
|
||||
}
|
||||
.syntaxhighlighter .gutter .line.highlighted {
|
||||
background-color: #41a83e !important;
|
||||
color: #0a2b1d !important;
|
||||
}
|
||||
.syntaxhighlighter.printing .line .content {
|
||||
border: none !important;
|
||||
}
|
||||
.syntaxhighlighter.collapsed {
|
||||
overflow: visible !important;
|
||||
}
|
||||
.syntaxhighlighter.collapsed .toolbar {
|
||||
color: #96dd3b !important;
|
||||
background: black !important;
|
||||
border: 1px solid #41a83e !important;
|
||||
}
|
||||
.syntaxhighlighter.collapsed .toolbar a {
|
||||
color: #96dd3b !important;
|
||||
}
|
||||
.syntaxhighlighter.collapsed .toolbar a:hover {
|
||||
color: white !important;
|
||||
}
|
||||
.syntaxhighlighter .toolbar {
|
||||
color: white !important;
|
||||
background: #41a83e !important;
|
||||
border: none !important;
|
||||
}
|
||||
.syntaxhighlighter .toolbar a {
|
||||
color: white !important;
|
||||
}
|
||||
.syntaxhighlighter .toolbar a:hover {
|
||||
color: #ffe862 !important;
|
||||
}
|
||||
.syntaxhighlighter .plain, .syntaxhighlighter .plain a {
|
||||
color: #f8f8f8 !important;
|
||||
}
|
||||
.syntaxhighlighter .comments, .syntaxhighlighter .comments a {
|
||||
color: #336442 !important;
|
||||
}
|
||||
.syntaxhighlighter .string, .syntaxhighlighter .string a {
|
||||
color: #9df39f !important;
|
||||
}
|
||||
.syntaxhighlighter .keyword {
|
||||
color: #96dd3b !important;
|
||||
}
|
||||
.syntaxhighlighter .preprocessor {
|
||||
color: #91bb9e !important;
|
||||
}
|
||||
.syntaxhighlighter .variable {
|
||||
color: #ffaa3e !important;
|
||||
}
|
||||
.syntaxhighlighter .value {
|
||||
color: #f7e741 !important;
|
||||
}
|
||||
.syntaxhighlighter .functions {
|
||||
color: #ffaa3e !important;
|
||||
}
|
||||
.syntaxhighlighter .constants {
|
||||
color: #e0e8ff !important;
|
||||
}
|
||||
.syntaxhighlighter .script {
|
||||
font-weight: bold !important;
|
||||
color: #96dd3b !important;
|
||||
background-color: none !important;
|
||||
}
|
||||
.syntaxhighlighter .color1, .syntaxhighlighter .color1 a {
|
||||
color: #eb939a !important;
|
||||
}
|
||||
.syntaxhighlighter .color2, .syntaxhighlighter .color2 a {
|
||||
color: #91bb9e !important;
|
||||
}
|
||||
.syntaxhighlighter .color3, .syntaxhighlighter .color3 a {
|
||||
color: #edef7d !important;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .comments {
|
||||
font-style: italic !important;
|
||||
}
|
||||
.syntaxhighlighter .keyword {
|
||||
font-weight: bold !important;
|
||||
}
|
128
src/_h5ai/css/lib/sh/shThemeEclipse.less
Normal file
@@ -0,0 +1,128 @@
|
||||
/**
|
||||
* SyntaxHighlighter
|
||||
* http://alexgorbatchev.com/SyntaxHighlighter
|
||||
*
|
||||
* SyntaxHighlighter is donationware. If you are using it, please donate.
|
||||
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
|
||||
*
|
||||
* @version
|
||||
* 3.0.83 (July 02 2010)
|
||||
*
|
||||
* @copyright
|
||||
* Copyright (C) 2004-2010 Alex Gorbatchev.
|
||||
*
|
||||
* @license
|
||||
* Dual licensed under the MIT and GPL licenses.
|
||||
*/
|
||||
.syntaxhighlighter {
|
||||
background-color: white !important;
|
||||
}
|
||||
.syntaxhighlighter .line.alt1 {
|
||||
background-color: white !important;
|
||||
}
|
||||
.syntaxhighlighter .line.alt2 {
|
||||
background-color: white !important;
|
||||
}
|
||||
.syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 {
|
||||
background-color: #c3defe !important;
|
||||
}
|
||||
.syntaxhighlighter .line.highlighted.number {
|
||||
color: white !important;
|
||||
}
|
||||
.syntaxhighlighter table caption {
|
||||
color: black !important;
|
||||
}
|
||||
.syntaxhighlighter .gutter {
|
||||
color: #787878 !important;
|
||||
}
|
||||
.syntaxhighlighter .gutter .line {
|
||||
border-right: 3px solid #d4d0c8 !important;
|
||||
}
|
||||
.syntaxhighlighter .gutter .line.highlighted {
|
||||
background-color: #d4d0c8 !important;
|
||||
color: white !important;
|
||||
}
|
||||
.syntaxhighlighter.printing .line .content {
|
||||
border: none !important;
|
||||
}
|
||||
.syntaxhighlighter.collapsed {
|
||||
overflow: visible !important;
|
||||
}
|
||||
.syntaxhighlighter.collapsed .toolbar {
|
||||
color: #3f5fbf !important;
|
||||
background: white !important;
|
||||
border: 1px solid #d4d0c8 !important;
|
||||
}
|
||||
.syntaxhighlighter.collapsed .toolbar a {
|
||||
color: #3f5fbf !important;
|
||||
}
|
||||
.syntaxhighlighter.collapsed .toolbar a:hover {
|
||||
color: #aa7700 !important;
|
||||
}
|
||||
.syntaxhighlighter .toolbar {
|
||||
color: #a0a0a0 !important;
|
||||
background: #d4d0c8 !important;
|
||||
border: none !important;
|
||||
}
|
||||
.syntaxhighlighter .toolbar a {
|
||||
color: #a0a0a0 !important;
|
||||
}
|
||||
.syntaxhighlighter .toolbar a:hover {
|
||||
color: red !important;
|
||||
}
|
||||
.syntaxhighlighter .plain, .syntaxhighlighter .plain a {
|
||||
color: black !important;
|
||||
}
|
||||
.syntaxhighlighter .comments, .syntaxhighlighter .comments a {
|
||||
color: #3f5fbf !important;
|
||||
}
|
||||
.syntaxhighlighter .string, .syntaxhighlighter .string a {
|
||||
color: #2a00ff !important;
|
||||
}
|
||||
.syntaxhighlighter .keyword {
|
||||
color: #7f0055 !important;
|
||||
}
|
||||
.syntaxhighlighter .preprocessor {
|
||||
color: #646464 !important;
|
||||
}
|
||||
.syntaxhighlighter .variable {
|
||||
color: #aa7700 !important;
|
||||
}
|
||||
.syntaxhighlighter .value {
|
||||
color: #009900 !important;
|
||||
}
|
||||
.syntaxhighlighter .functions {
|
||||
color: #ff1493 !important;
|
||||
}
|
||||
.syntaxhighlighter .constants {
|
||||
color: #0066cc !important;
|
||||
}
|
||||
.syntaxhighlighter .script {
|
||||
font-weight: bold !important;
|
||||
color: #7f0055 !important;
|
||||
background-color: none !important;
|
||||
}
|
||||
.syntaxhighlighter .color1, .syntaxhighlighter .color1 a {
|
||||
color: gray !important;
|
||||
}
|
||||
.syntaxhighlighter .color2, .syntaxhighlighter .color2 a {
|
||||
color: #ff1493 !important;
|
||||
}
|
||||
.syntaxhighlighter .color3, .syntaxhighlighter .color3 a {
|
||||
color: red !important;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .keyword {
|
||||
font-weight: bold !important;
|
||||
}
|
||||
.syntaxhighlighter .xml .keyword {
|
||||
color: #3f7f7f !important;
|
||||
font-weight: normal !important;
|
||||
}
|
||||
.syntaxhighlighter .xml .color1, .syntaxhighlighter .xml .color1 a {
|
||||
color: #7f007f !important;
|
||||
}
|
||||
.syntaxhighlighter .xml .string {
|
||||
font-style: italic !important;
|
||||
color: #2a00ff !important;
|
||||
}
|
113
src/_h5ai/css/lib/sh/shThemeEmacs.less
Normal file
@@ -0,0 +1,113 @@
|
||||
/**
|
||||
* SyntaxHighlighter
|
||||
* http://alexgorbatchev.com/SyntaxHighlighter
|
||||
*
|
||||
* SyntaxHighlighter is donationware. If you are using it, please donate.
|
||||
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
|
||||
*
|
||||
* @version
|
||||
* 3.0.83 (July 02 2010)
|
||||
*
|
||||
* @copyright
|
||||
* Copyright (C) 2004-2010 Alex Gorbatchev.
|
||||
*
|
||||
* @license
|
||||
* Dual licensed under the MIT and GPL licenses.
|
||||
*/
|
||||
.syntaxhighlighter {
|
||||
background-color: black !important;
|
||||
}
|
||||
.syntaxhighlighter .line.alt1 {
|
||||
background-color: black !important;
|
||||
}
|
||||
.syntaxhighlighter .line.alt2 {
|
||||
background-color: black !important;
|
||||
}
|
||||
.syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 {
|
||||
background-color: #2a3133 !important;
|
||||
}
|
||||
.syntaxhighlighter .line.highlighted.number {
|
||||
color: white !important;
|
||||
}
|
||||
.syntaxhighlighter table caption {
|
||||
color: #d3d3d3 !important;
|
||||
}
|
||||
.syntaxhighlighter .gutter {
|
||||
color: #d3d3d3 !important;
|
||||
}
|
||||
.syntaxhighlighter .gutter .line {
|
||||
border-right: 3px solid #990000 !important;
|
||||
}
|
||||
.syntaxhighlighter .gutter .line.highlighted {
|
||||
background-color: #990000 !important;
|
||||
color: black !important;
|
||||
}
|
||||
.syntaxhighlighter.printing .line .content {
|
||||
border: none !important;
|
||||
}
|
||||
.syntaxhighlighter.collapsed {
|
||||
overflow: visible !important;
|
||||
}
|
||||
.syntaxhighlighter.collapsed .toolbar {
|
||||
color: #ebdb8d !important;
|
||||
background: black !important;
|
||||
border: 1px solid #990000 !important;
|
||||
}
|
||||
.syntaxhighlighter.collapsed .toolbar a {
|
||||
color: #ebdb8d !important;
|
||||
}
|
||||
.syntaxhighlighter.collapsed .toolbar a:hover {
|
||||
color: #ff7d27 !important;
|
||||
}
|
||||
.syntaxhighlighter .toolbar {
|
||||
color: white !important;
|
||||
background: #990000 !important;
|
||||
border: none !important;
|
||||
}
|
||||
.syntaxhighlighter .toolbar a {
|
||||
color: white !important;
|
||||
}
|
||||
.syntaxhighlighter .toolbar a:hover {
|
||||
color: #9ccff4 !important;
|
||||
}
|
||||
.syntaxhighlighter .plain, .syntaxhighlighter .plain a {
|
||||
color: #d3d3d3 !important;
|
||||
}
|
||||
.syntaxhighlighter .comments, .syntaxhighlighter .comments a {
|
||||
color: #ff7d27 !important;
|
||||
}
|
||||
.syntaxhighlighter .string, .syntaxhighlighter .string a {
|
||||
color: #ff9e7b !important;
|
||||
}
|
||||
.syntaxhighlighter .keyword {
|
||||
color: aqua !important;
|
||||
}
|
||||
.syntaxhighlighter .preprocessor {
|
||||
color: #aec4de !important;
|
||||
}
|
||||
.syntaxhighlighter .variable {
|
||||
color: #ffaa3e !important;
|
||||
}
|
||||
.syntaxhighlighter .value {
|
||||
color: #009900 !important;
|
||||
}
|
||||
.syntaxhighlighter .functions {
|
||||
color: #81cef9 !important;
|
||||
}
|
||||
.syntaxhighlighter .constants {
|
||||
color: #ff9e7b !important;
|
||||
}
|
||||
.syntaxhighlighter .script {
|
||||
font-weight: bold !important;
|
||||
color: aqua !important;
|
||||
background-color: none !important;
|
||||
}
|
||||
.syntaxhighlighter .color1, .syntaxhighlighter .color1 a {
|
||||
color: #ebdb8d !important;
|
||||
}
|
||||
.syntaxhighlighter .color2, .syntaxhighlighter .color2 a {
|
||||
color: #ff7d27 !important;
|
||||
}
|
||||
.syntaxhighlighter .color3, .syntaxhighlighter .color3 a {
|
||||
color: #aec4de !important;
|
||||
}
|
117
src/_h5ai/css/lib/sh/shThemeFadeToGrey.less
Normal file
@@ -0,0 +1,117 @@
|
||||
/**
|
||||
* SyntaxHighlighter
|
||||
* http://alexgorbatchev.com/SyntaxHighlighter
|
||||
*
|
||||
* SyntaxHighlighter is donationware. If you are using it, please donate.
|
||||
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
|
||||
*
|
||||
* @version
|
||||
* 3.0.83 (July 02 2010)
|
||||
*
|
||||
* @copyright
|
||||
* Copyright (C) 2004-2010 Alex Gorbatchev.
|
||||
*
|
||||
* @license
|
||||
* Dual licensed under the MIT and GPL licenses.
|
||||
*/
|
||||
.syntaxhighlighter {
|
||||
background-color: #121212 !important;
|
||||
}
|
||||
.syntaxhighlighter .line.alt1 {
|
||||
background-color: #121212 !important;
|
||||
}
|
||||
.syntaxhighlighter .line.alt2 {
|
||||
background-color: #121212 !important;
|
||||
}
|
||||
.syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 {
|
||||
background-color: #2c2c29 !important;
|
||||
}
|
||||
.syntaxhighlighter .line.highlighted.number {
|
||||
color: white !important;
|
||||
}
|
||||
.syntaxhighlighter table caption {
|
||||
color: white !important;
|
||||
}
|
||||
.syntaxhighlighter .gutter {
|
||||
color: #afafaf !important;
|
||||
}
|
||||
.syntaxhighlighter .gutter .line {
|
||||
border-right: 3px solid #3185b9 !important;
|
||||
}
|
||||
.syntaxhighlighter .gutter .line.highlighted {
|
||||
background-color: #3185b9 !important;
|
||||
color: #121212 !important;
|
||||
}
|
||||
.syntaxhighlighter.printing .line .content {
|
||||
border: none !important;
|
||||
}
|
||||
.syntaxhighlighter.collapsed {
|
||||
overflow: visible !important;
|
||||
}
|
||||
.syntaxhighlighter.collapsed .toolbar {
|
||||
color: #3185b9 !important;
|
||||
background: black !important;
|
||||
border: 1px solid #3185b9 !important;
|
||||
}
|
||||
.syntaxhighlighter.collapsed .toolbar a {
|
||||
color: #3185b9 !important;
|
||||
}
|
||||
.syntaxhighlighter.collapsed .toolbar a:hover {
|
||||
color: #d01d33 !important;
|
||||
}
|
||||
.syntaxhighlighter .toolbar {
|
||||
color: white !important;
|
||||
background: #3185b9 !important;
|
||||
border: none !important;
|
||||
}
|
||||
.syntaxhighlighter .toolbar a {
|
||||
color: white !important;
|
||||
}
|
||||
.syntaxhighlighter .toolbar a:hover {
|
||||
color: #96daff !important;
|
||||
}
|
||||
.syntaxhighlighter .plain, .syntaxhighlighter .plain a {
|
||||
color: white !important;
|
||||
}
|
||||
.syntaxhighlighter .comments, .syntaxhighlighter .comments a {
|
||||
color: #696854 !important;
|
||||
}
|
||||
.syntaxhighlighter .string, .syntaxhighlighter .string a {
|
||||
color: #e3e658 !important;
|
||||
}
|
||||
.syntaxhighlighter .keyword {
|
||||
color: #d01d33 !important;
|
||||
}
|
||||
.syntaxhighlighter .preprocessor {
|
||||
color: #435a5f !important;
|
||||
}
|
||||
.syntaxhighlighter .variable {
|
||||
color: #898989 !important;
|
||||
}
|
||||
.syntaxhighlighter .value {
|
||||
color: #009900 !important;
|
||||
}
|
||||
.syntaxhighlighter .functions {
|
||||
color: #aaaaaa !important;
|
||||
}
|
||||
.syntaxhighlighter .constants {
|
||||
color: #96daff !important;
|
||||
}
|
||||
.syntaxhighlighter .script {
|
||||
font-weight: bold !important;
|
||||
color: #d01d33 !important;
|
||||
background-color: none !important;
|
||||
}
|
||||
.syntaxhighlighter .color1, .syntaxhighlighter .color1 a {
|
||||
color: #ffc074 !important;
|
||||
}
|
||||
.syntaxhighlighter .color2, .syntaxhighlighter .color2 a {
|
||||
color: #4a8cdb !important;
|
||||
}
|
||||
.syntaxhighlighter .color3, .syntaxhighlighter .color3 a {
|
||||
color: #96daff !important;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .functions {
|
||||
font-weight: bold !important;
|
||||
}
|
113
src/_h5ai/css/lib/sh/shThemeMDUltra.less
Executable file
@@ -0,0 +1,113 @@
|
||||
/**
|
||||
* SyntaxHighlighter
|
||||
* http://alexgorbatchev.com/SyntaxHighlighter
|
||||
*
|
||||
* SyntaxHighlighter is donationware. If you are using it, please donate.
|
||||
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
|
||||
*
|
||||
* @version
|
||||
* 3.0.83 (July 02 2010)
|
||||
*
|
||||
* @copyright
|
||||
* Copyright (C) 2004-2010 Alex Gorbatchev.
|
||||
*
|
||||
* @license
|
||||
* Dual licensed under the MIT and GPL licenses.
|
||||
*/
|
||||
.syntaxhighlighter {
|
||||
background-color: #222222 !important;
|
||||
}
|
||||
.syntaxhighlighter .line.alt1 {
|
||||
background-color: #222222 !important;
|
||||
}
|
||||
.syntaxhighlighter .line.alt2 {
|
||||
background-color: #222222 !important;
|
||||
}
|
||||
.syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 {
|
||||
background-color: #253e5a !important;
|
||||
}
|
||||
.syntaxhighlighter .line.highlighted.number {
|
||||
color: white !important;
|
||||
}
|
||||
.syntaxhighlighter table caption {
|
||||
color: lime !important;
|
||||
}
|
||||
.syntaxhighlighter .gutter {
|
||||
color: #38566f !important;
|
||||
}
|
||||
.syntaxhighlighter .gutter .line {
|
||||
border-right: 3px solid #435a5f !important;
|
||||
}
|
||||
.syntaxhighlighter .gutter .line.highlighted {
|
||||
background-color: #435a5f !important;
|
||||
color: #222222 !important;
|
||||
}
|
||||
.syntaxhighlighter.printing .line .content {
|
||||
border: none !important;
|
||||
}
|
||||
.syntaxhighlighter.collapsed {
|
||||
overflow: visible !important;
|
||||
}
|
||||
.syntaxhighlighter.collapsed .toolbar {
|
||||
color: #428bdd !important;
|
||||
background: black !important;
|
||||
border: 1px solid #435a5f !important;
|
||||
}
|
||||
.syntaxhighlighter.collapsed .toolbar a {
|
||||
color: #428bdd !important;
|
||||
}
|
||||
.syntaxhighlighter.collapsed .toolbar a:hover {
|
||||
color: lime !important;
|
||||
}
|
||||
.syntaxhighlighter .toolbar {
|
||||
color: #aaaaff !important;
|
||||
background: #435a5f !important;
|
||||
border: none !important;
|
||||
}
|
||||
.syntaxhighlighter .toolbar a {
|
||||
color: #aaaaff !important;
|
||||
}
|
||||
.syntaxhighlighter .toolbar a:hover {
|
||||
color: #9ccff4 !important;
|
||||
}
|
||||
.syntaxhighlighter .plain, .syntaxhighlighter .plain a {
|
||||
color: lime !important;
|
||||
}
|
||||
.syntaxhighlighter .comments, .syntaxhighlighter .comments a {
|
||||
color: #428bdd !important;
|
||||
}
|
||||
.syntaxhighlighter .string, .syntaxhighlighter .string a {
|
||||
color: lime !important;
|
||||
}
|
||||
.syntaxhighlighter .keyword {
|
||||
color: #aaaaff !important;
|
||||
}
|
||||
.syntaxhighlighter .preprocessor {
|
||||
color: #8aa6c1 !important;
|
||||
}
|
||||
.syntaxhighlighter .variable {
|
||||
color: aqua !important;
|
||||
}
|
||||
.syntaxhighlighter .value {
|
||||
color: #f7e741 !important;
|
||||
}
|
||||
.syntaxhighlighter .functions {
|
||||
color: #ff8000 !important;
|
||||
}
|
||||
.syntaxhighlighter .constants {
|
||||
color: yellow !important;
|
||||
}
|
||||
.syntaxhighlighter .script {
|
||||
font-weight: bold !important;
|
||||
color: #aaaaff !important;
|
||||
background-color: none !important;
|
||||
}
|
||||
.syntaxhighlighter .color1, .syntaxhighlighter .color1 a {
|
||||
color: red !important;
|
||||
}
|
||||
.syntaxhighlighter .color2, .syntaxhighlighter .color2 a {
|
||||
color: yellow !important;
|
||||
}
|
||||
.syntaxhighlighter .color3, .syntaxhighlighter .color3 a {
|
||||
color: #ffaa3e !important;
|
||||
}
|
113
src/_h5ai/css/lib/sh/shThemeMidnight.less
Normal file
@@ -0,0 +1,113 @@
|
||||
/**
|
||||
* SyntaxHighlighter
|
||||
* http://alexgorbatchev.com/SyntaxHighlighter
|
||||
*
|
||||
* SyntaxHighlighter is donationware. If you are using it, please donate.
|
||||
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
|
||||
*
|
||||
* @version
|
||||
* 3.0.83 (July 02 2010)
|
||||
*
|
||||
* @copyright
|
||||
* Copyright (C) 2004-2010 Alex Gorbatchev.
|
||||
*
|
||||
* @license
|
||||
* Dual licensed under the MIT and GPL licenses.
|
||||
*/
|
||||
.syntaxhighlighter {
|
||||
background-color: #0f192a !important;
|
||||
}
|
||||
.syntaxhighlighter .line.alt1 {
|
||||
background-color: #0f192a !important;
|
||||
}
|
||||
.syntaxhighlighter .line.alt2 {
|
||||
background-color: #0f192a !important;
|
||||
}
|
||||
.syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 {
|
||||
background-color: #253e5a !important;
|
||||
}
|
||||
.syntaxhighlighter .line.highlighted.number {
|
||||
color: #38566f !important;
|
||||
}
|
||||
.syntaxhighlighter table caption {
|
||||
color: #d1edff !important;
|
||||
}
|
||||
.syntaxhighlighter .gutter {
|
||||
color: #afafaf !important;
|
||||
}
|
||||
.syntaxhighlighter .gutter .line {
|
||||
border-right: 3px solid #435a5f !important;
|
||||
}
|
||||
.syntaxhighlighter .gutter .line.highlighted {
|
||||
background-color: #435a5f !important;
|
||||
color: #0f192a !important;
|
||||
}
|
||||
.syntaxhighlighter.printing .line .content {
|
||||
border: none !important;
|
||||
}
|
||||
.syntaxhighlighter.collapsed {
|
||||
overflow: visible !important;
|
||||
}
|
||||
.syntaxhighlighter.collapsed .toolbar {
|
||||
color: #428bdd !important;
|
||||
background: black !important;
|
||||
border: 1px solid #435a5f !important;
|
||||
}
|
||||
.syntaxhighlighter.collapsed .toolbar a {
|
||||
color: #428bdd !important;
|
||||
}
|
||||
.syntaxhighlighter.collapsed .toolbar a:hover {
|
||||
color: #1dc116 !important;
|
||||
}
|
||||
.syntaxhighlighter .toolbar {
|
||||
color: #d1edff !important;
|
||||
background: #435a5f !important;
|
||||
border: none !important;
|
||||
}
|
||||
.syntaxhighlighter .toolbar a {
|
||||
color: #d1edff !important;
|
||||
}
|
||||
.syntaxhighlighter .toolbar a:hover {
|
||||
color: #8aa6c1 !important;
|
||||
}
|
||||
.syntaxhighlighter .plain, .syntaxhighlighter .plain a {
|
||||
color: #d1edff !important;
|
||||
}
|
||||
.syntaxhighlighter .comments, .syntaxhighlighter .comments a {
|
||||
color: #428bdd !important;
|
||||
}
|
||||
.syntaxhighlighter .string, .syntaxhighlighter .string a {
|
||||
color: #1dc116 !important;
|
||||
}
|
||||
.syntaxhighlighter .keyword {
|
||||
color: #b43d3d !important;
|
||||
}
|
||||
.syntaxhighlighter .preprocessor {
|
||||
color: #8aa6c1 !important;
|
||||
}
|
||||
.syntaxhighlighter .variable {
|
||||
color: #ffaa3e !important;
|
||||
}
|
||||
.syntaxhighlighter .value {
|
||||
color: #f7e741 !important;
|
||||
}
|
||||
.syntaxhighlighter .functions {
|
||||
color: #ffaa3e !important;
|
||||
}
|
||||
.syntaxhighlighter .constants {
|
||||
color: #e0e8ff !important;
|
||||
}
|
||||
.syntaxhighlighter .script {
|
||||
font-weight: bold !important;
|
||||
color: #b43d3d !important;
|
||||
background-color: none !important;
|
||||
}
|
||||
.syntaxhighlighter .color1, .syntaxhighlighter .color1 a {
|
||||
color: #f8bb00 !important;
|
||||
}
|
||||
.syntaxhighlighter .color2, .syntaxhighlighter .color2 a {
|
||||
color: white !important;
|
||||
}
|
||||
.syntaxhighlighter .color3, .syntaxhighlighter .color3 a {
|
||||
color: #ffaa3e !important;
|
||||
}
|
113
src/_h5ai/css/lib/sh/shThemeRDark.less
Normal file
@@ -0,0 +1,113 @@
|
||||
/**
|
||||
* SyntaxHighlighter
|
||||
* http://alexgorbatchev.com/SyntaxHighlighter
|
||||
*
|
||||
* SyntaxHighlighter is donationware. If you are using it, please donate.
|
||||
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
|
||||
*
|
||||
* @version
|
||||
* 3.0.83 (July 02 2010)
|
||||
*
|
||||
* @copyright
|
||||
* Copyright (C) 2004-2010 Alex Gorbatchev.
|
||||
*
|
||||
* @license
|
||||
* Dual licensed under the MIT and GPL licenses.
|
||||
*/
|
||||
.syntaxhighlighter {
|
||||
background-color: #1b2426 !important;
|
||||
}
|
||||
.syntaxhighlighter .line.alt1 {
|
||||
background-color: #1b2426 !important;
|
||||
}
|
||||
.syntaxhighlighter .line.alt2 {
|
||||
background-color: #1b2426 !important;
|
||||
}
|
||||
.syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 {
|
||||
background-color: #323e41 !important;
|
||||
}
|
||||
.syntaxhighlighter .line.highlighted.number {
|
||||
color: #b9bdb6 !important;
|
||||
}
|
||||
.syntaxhighlighter table caption {
|
||||
color: #b9bdb6 !important;
|
||||
}
|
||||
.syntaxhighlighter .gutter {
|
||||
color: #afafaf !important;
|
||||
}
|
||||
.syntaxhighlighter .gutter .line {
|
||||
border-right: 3px solid #435a5f !important;
|
||||
}
|
||||
.syntaxhighlighter .gutter .line.highlighted {
|
||||
background-color: #435a5f !important;
|
||||
color: #1b2426 !important;
|
||||
}
|
||||
.syntaxhighlighter.printing .line .content {
|
||||
border: none !important;
|
||||
}
|
||||
.syntaxhighlighter.collapsed {
|
||||
overflow: visible !important;
|
||||
}
|
||||
.syntaxhighlighter.collapsed .toolbar {
|
||||
color: #5ba1cf !important;
|
||||
background: black !important;
|
||||
border: 1px solid #435a5f !important;
|
||||
}
|
||||
.syntaxhighlighter.collapsed .toolbar a {
|
||||
color: #5ba1cf !important;
|
||||
}
|
||||
.syntaxhighlighter.collapsed .toolbar a:hover {
|
||||
color: #5ce638 !important;
|
||||
}
|
||||
.syntaxhighlighter .toolbar {
|
||||
color: white !important;
|
||||
background: #435a5f !important;
|
||||
border: none !important;
|
||||
}
|
||||
.syntaxhighlighter .toolbar a {
|
||||
color: white !important;
|
||||
}
|
||||
.syntaxhighlighter .toolbar a:hover {
|
||||
color: #e0e8ff !important;
|
||||
}
|
||||
.syntaxhighlighter .plain, .syntaxhighlighter .plain a {
|
||||
color: #b9bdb6 !important;
|
||||
}
|
||||
.syntaxhighlighter .comments, .syntaxhighlighter .comments a {
|
||||
color: #878a85 !important;
|
||||
}
|
||||
.syntaxhighlighter .string, .syntaxhighlighter .string a {
|
||||
color: #5ce638 !important;
|
||||
}
|
||||
.syntaxhighlighter .keyword {
|
||||
color: #5ba1cf !important;
|
||||
}
|
||||
.syntaxhighlighter .preprocessor {
|
||||
color: #435a5f !important;
|
||||
}
|
||||
.syntaxhighlighter .variable {
|
||||
color: #ffaa3e !important;
|
||||
}
|
||||
.syntaxhighlighter .value {
|
||||
color: #009900 !important;
|
||||
}
|
||||
.syntaxhighlighter .functions {
|
||||
color: #ffaa3e !important;
|
||||
}
|
||||
.syntaxhighlighter .constants {
|
||||
color: #e0e8ff !important;
|
||||
}
|
||||
.syntaxhighlighter .script {
|
||||
font-weight: bold !important;
|
||||
color: #5ba1cf !important;
|
||||
background-color: none !important;
|
||||
}
|
||||
.syntaxhighlighter .color1, .syntaxhighlighter .color1 a {
|
||||
color: #e0e8ff !important;
|
||||
}
|
||||
.syntaxhighlighter .color2, .syntaxhighlighter .color2 a {
|
||||
color: white !important;
|
||||
}
|
||||
.syntaxhighlighter .color3, .syntaxhighlighter .color3 a {
|
||||
color: #ffaa3e !important;
|
||||
}
|
@@ -1,58 +0,0 @@
|
||||
|
||||
@import "inc/h5bp-norm";
|
||||
@import "inc/mixins";
|
||||
|
||||
|
||||
body {
|
||||
font-family: Ubuntu, sans-serif;
|
||||
font-size: 16px;
|
||||
color: #555;
|
||||
background-color: #fff;
|
||||
margin: 80px 30px;
|
||||
}
|
||||
|
||||
|
||||
@import "inc/nav";
|
||||
@import "inc/content";
|
||||
@import "inc/table";
|
||||
@import "inc/extended";
|
||||
@import "inc/tree";
|
||||
@import "inc/context";
|
||||
@import "inc/footer";
|
||||
@import "inc/responsive";
|
||||
|
||||
|
||||
html.js {
|
||||
.hideOnJs {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
html.no-js {
|
||||
.hideOnNoJs {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
html.h5ai-js {
|
||||
#h5ai-reference:after {
|
||||
content: " (js)";
|
||||
}
|
||||
}
|
||||
html.h5ai-php {
|
||||
#h5ai-reference:after {
|
||||
content: " (php)";
|
||||
}
|
||||
|
||||
#table {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#tree, #content > header, #content > footer {
|
||||
display: block;
|
||||
}
|
||||
|
||||
html.no-js {
|
||||
#extended.details-view, #extended.icons-view {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
}
|
52
src/_h5ai/css/styles.less
Normal file
@@ -0,0 +1,52 @@
|
||||
|
||||
@import "lib/h5bp-norm";
|
||||
@import "lib/mixins";
|
||||
@import "lib/sh/shCore";
|
||||
@import "lib/sh/shThemeDefault";
|
||||
|
||||
html { overflow-y: auto; }
|
||||
::-moz-selection { background: #68A9FF; color: #fff; text-shadow: none; }
|
||||
::selection { background: #68A9FF; color: #fff; text-shadow: none; }
|
||||
|
||||
body {
|
||||
font-family: Ubuntu, sans-serif;
|
||||
font-size: 13px;
|
||||
color: #555;
|
||||
background-color: #fff;
|
||||
margin: 30px;
|
||||
}
|
||||
|
||||
|
||||
@import "inc/topbar";
|
||||
@import "inc/download";
|
||||
@import "inc/filter";
|
||||
|
||||
@import "inc/content";
|
||||
@import "inc/extended";
|
||||
|
||||
@import "inc/bottombar";
|
||||
@import "inc/l10n";
|
||||
|
||||
@import "inc/tree";
|
||||
@import "inc/context";
|
||||
@import "inc/apache-autoindex-table";
|
||||
|
||||
@import "inc/preview-img";
|
||||
@import "inc/preview-txt";
|
||||
|
||||
@import "inc/responsive";
|
||||
|
||||
@import "inc/h5ai-info";
|
||||
|
||||
|
||||
html.js .hideOnJs, html.no-js .hideOnNoJs {
|
||||
display: none;
|
||||
}
|
||||
html.oldie {
|
||||
.oldBrowser {
|
||||
display: inline !important;
|
||||
}
|
||||
#tree {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
@@ -1,31 +0,0 @@
|
||||
<!-- generated code ends here -->
|
||||
</section>
|
||||
</section>
|
||||
<div id="selection-rect"></div>
|
||||
<footer class="clearfix">
|
||||
<span class="left">
|
||||
<a id="h5ai-reference" href="http://larsjung.de/h5ai" target="_blank" title="h5ai project page">h5ai %BUILD_VERSION%</a>
|
||||
<span class="hideOnJs noJsMsg"> ⚡ JavaScript is disabled! ⚡ </span>
|
||||
</span>
|
||||
<span class="right">
|
||||
<span id="langSelector">
|
||||
<span class="lang">en</span> - <span class="l10n-lang">english</span>
|
||||
<span class="langOptions"></span>
|
||||
</span>
|
||||
</span>
|
||||
<span class="center">
|
||||
<span class="hideOnNoJs">
|
||||
<span class="status default">
|
||||
<span class="folderTotal"></span> <span class="l10n-folders">folders</span>
|
||||
<span class='sep'>·</span>
|
||||
<span class="fileTotal"></span> <span class="l10n-files">files</span>
|
||||
</span>
|
||||
<span class="status dynamic">
|
||||
</span>
|
||||
</span>
|
||||
</span>
|
||||
</footer>
|
||||
<script src="/_h5ai/config.js"></script>
|
||||
<script src="/_h5ai/js/libs.js"></script>
|
||||
</body>
|
||||
</html>
|
@@ -1,33 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en"> <![endif]-->
|
||||
<!--[if IE 7]> <html class="no-js ie7 oldie" lang="en"> <![endif]-->
|
||||
<!--[if IE 8]> <html class="no-js ie8 oldie" lang="en"> <![endif]-->
|
||||
<!--[if gt IE 8]><!--> <html class="h5ai-js no-js" lang="en"> <!--<![endif]-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<title>Directory index · styled with h5ai</title>
|
||||
<meta name="h5ai-version" content="h5ai %BUILD_VERSION% (js)">
|
||||
<meta name="description" content="Directory index styled with h5ai (http://larsjung.de/h5ai)">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="shortcut icon" type="image/png" href="/_h5ai/images/h5ai-16x16.png">
|
||||
<link rel="apple-touch-icon" type="image/png" href="/_h5ai/images/h5ai-48x48.png">
|
||||
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Ubuntu:regular,italic,bold">
|
||||
<link rel="stylesheet" href="/_h5ai/css/main.css">
|
||||
<script src="/_h5ai/js/modernizr.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<nav class="clearfix hideOnNoJs">
|
||||
<ul id="navbar"></ul>
|
||||
</nav>
|
||||
<section id="tree"></section>
|
||||
<section id="content">
|
||||
<header></header>
|
||||
<section id="extended" class="clearfix"></section>
|
||||
<footer></footer>
|
||||
<section id="table" class="hideOnJs">
|
||||
<!--
|
||||
The following code was generated by Apache's autoindex module. It is not valid HTML5, but this
|
||||
section gets removed from the DOM tree as soon as its information is parsed. The actual page
|
||||
should render as valid HTML5, even if the produced source is not valid HTML5.
|
||||
-->
|
@@ -1,32 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en"> <![endif]-->
|
||||
<!--[if IE 7]> <html class="no-js ie7 oldie" lang="en"> <![endif]-->
|
||||
<!--[if IE 8]> <html class="no-js ie8 oldie" lang="en"> <![endif]-->
|
||||
<!--[if gt IE 8]><!--> <html class="h5ai-php no-js" lang="en"> <!--<![endif]-->
|
||||
<?php include "php/main.php"; ?>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<title><?php echo $h5ai->getTitle(); ?></title>
|
||||
<meta name="h5ai-version" content="h5ai %BUILD_VERSION% (php)">
|
||||
<meta name="description" content="Directory index styled with h5ai (http://larsjung.de/h5ai)">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="shortcut icon" type="image/png" href="/_h5ai/images/h5ai-16x16.png">
|
||||
<link rel="apple-touch-icon" type="image/png" href="/_h5ai/images/h5ai-48x48.png">
|
||||
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Ubuntu:regular,italic,bold">
|
||||
<link rel="stylesheet" href="/_h5ai/css/main.css">
|
||||
<script src="/_h5ai/js/modernizr.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<nav class="clearfix">
|
||||
<ul id="navbar">
|
||||
<?php echo $crumb->toHtml(); ?>
|
||||
</ul>
|
||||
</nav>
|
||||
<?php echo $tree->toHtml(); ?>
|
||||
<section id="content">
|
||||
<?php echo $customize->getHeader(); ?>
|
||||
<?php echo $extended->toHtml(); ?>
|
||||
<?php echo $customize->getFooter(); ?>
|
||||
<section id="table" class="hideOnJs">
|
||||
<!-- The following code was generated by Apache's autoindex module and gets ignored and removed from the DOM tree. -->
|
BIN
src/_h5ai/icons/16x16/markdown.png
Normal file
After Width: | Height: | Size: 627 B |
BIN
src/_h5ai/icons/16x16/ps.png
Normal file
After Width: | Height: | Size: 817 B |
BIN
src/_h5ai/icons/48x48/markdown.png
Normal file
After Width: | Height: | Size: 2.6 KiB |
BIN
src/_h5ai/icons/48x48/ps.png
Normal file
After Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 409 B After Width: | Height: | Size: 395 B |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 706 B After Width: | Height: | Size: 564 B |
BIN
src/_h5ai/images/preview/close.png
Normal file
After Width: | Height: | Size: 612 B |
BIN
src/_h5ai/images/preview/crumb.png
Normal file
After Width: | Height: | Size: 495 B |
BIN
src/_h5ai/images/preview/fullscreen.png
Normal file
After Width: | Height: | Size: 611 B |
BIN
src/_h5ai/images/preview/home.png
Normal file
After Width: | Height: | Size: 524 B |
BIN
src/_h5ai/images/preview/next.png
Normal file
After Width: | Height: | Size: 492 B |
BIN
src/_h5ai/images/preview/no-fullscreen.png
Normal file
After Width: | Height: | Size: 658 B |
BIN
src/_h5ai/images/preview/play.png
Normal file
After Width: | Height: | Size: 495 B |
BIN
src/_h5ai/images/preview/prev.png
Normal file
After Width: | Height: | Size: 499 B |
BIN
src/_h5ai/images/preview/raw.png
Normal file
After Width: | Height: | Size: 597 B |
BIN
src/_h5ai/images/view-list.png
Normal file
After Width: | Height: | Size: 324 B |
67
src/_h5ai/index.html
Normal file
@@ -0,0 +1,67 @@
|
||||
<!DOCTYPE html>
|
||||
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en"> <![endif]-->
|
||||
<!--[if IE 7]> <html class="no-js ie7 oldie" lang="en"> <![endif]-->
|
||||
<!--[if IE 8]> <html class="no-js ie8 oldie" lang="en"> <![endif]-->
|
||||
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<title>h5ai {{version}} server details</title>
|
||||
<meta name="description" content="h5ai server details">
|
||||
<meta name="viewport" content="width=device-width">
|
||||
<link rel="shortcut icon" type="image/png" href="/_h5ai/images/h5ai-16x16.png">
|
||||
<link rel="apple-touch-icon" type="image/png" href="/_h5ai/images/h5ai-48x48.png">
|
||||
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Ubuntu+Mono:400,700,400italic,700italic|Ubuntu:400,700,400italic,700italic">
|
||||
<link rel="stylesheet" href="/_h5ai/css/styles.css">
|
||||
<script src="/_h5ai/js/modernizr.js"></script>
|
||||
</head>
|
||||
<body id="h5ai-info">
|
||||
<h1>h5ai</h1>
|
||||
<span class="build-version">version {{version}}</span>
|
||||
<span class="build-stamp">{{stamp}}</span>
|
||||
<h2>server supports</h2>
|
||||
<ul id="tests">
|
||||
<li class="test" data-id="php"><span class="test-label">php version</span><span class="test-result">?</span>
|
||||
<div class="test-info">PHP version >= 5.2.1</div>
|
||||
</li>
|
||||
<li class="test" data-id="cache"><span class="test-label">cache</span><span class="test-result">?</span>
|
||||
<div class="test-info">_h5ai/cache writable for the server</div>
|
||||
</li>
|
||||
<li class="test" data-id="thumbs"><span class="test-label">image thumbs</span><span class="test-result">?</span>
|
||||
<div class="test-info">PHP GD extension with JPEG support available</div>
|
||||
</li>
|
||||
<li class="test" data-id="ffmpeg"><span class="test-label">movie thumbs</span><span class="test-result">?</span>
|
||||
<div class="test-info">ffmpeg executable in a shell</div>
|
||||
</li>
|
||||
<li class="test" data-id="convert"><span class="test-label">pdf thumbs</span><span class="test-result">?</span>
|
||||
<div class="test-info">convert executable in a shell</div>
|
||||
</li>
|
||||
<li class="test" data-id="temp"><span class="test-label">temp directory</span><span class="test-result">?</span>
|
||||
<div class="test-info">temporary directory writable for the server</div>
|
||||
</li>
|
||||
<li class="test" data-id="archive"><span class="test-label">php tar and zip</span><span class="test-result">?</span>
|
||||
<div class="test-info">PHP Phar extension available</div>
|
||||
</li>
|
||||
<li class="test" data-id="tar"><span class="test-label">shell tar</span><span class="test-result">?</span>
|
||||
<div class="test-info">tar executable in a shell</div>
|
||||
</li>
|
||||
<li class="test" data-id="zip"><span class="test-label">shell zip</span><span class="test-result">?</span>
|
||||
<div class="test-info">zip executable in a shell</div>
|
||||
</li>
|
||||
<li class="test" data-id="du"><span class="test-label">folder size</span><span class="test-result">?</span>
|
||||
<div class="test-info">du executable in a shell</div>
|
||||
</li>
|
||||
</ul>
|
||||
<div id="bottombar" class="clearfix">
|
||||
<span class="left">
|
||||
<a id="h5ai-reference" href="http://larsjung.de/h5ai" title="h5ai project page">h5ai {{version}}</a>
|
||||
<span class="hideOnJs noJsMsg"> ⚡ JavaScript is disabled! ⚡ </span>
|
||||
<span class="oldBrowser"> ⚡ Some features disabled! Works best in <a href="http://browsehappy.com">modern browsers</a>. ⚡ </span>
|
||||
</span>
|
||||
<span class="right"></span>
|
||||
<span class="center"></span>
|
||||
</div>
|
||||
<script src="/_h5ai/config.js"></script>
|
||||
<script src="/_h5ai/js/scripts.js"></script>
|
||||
</body>
|
||||
</html>
|
@@ -1,115 +0,0 @@
|
||||
|
||||
(function ($, H5AI) {
|
||||
|
||||
H5AI.connector = (function () {
|
||||
|
||||
var cache = {},
|
||||
pathnameStatusCache = {},
|
||||
contentTypeRegEx = /^text\/html;h5ai=/,
|
||||
getPath = function (folder, tableRow) {
|
||||
|
||||
var absHref = H5AI.util.getAbsHref(folder, tableRow),
|
||||
path = cache[absHref];
|
||||
|
||||
if (!path) {
|
||||
path = H5AI.Path(folder, tableRow);
|
||||
if (!path.isParentFolder) {
|
||||
cache[path.absHref] = path;
|
||||
}
|
||||
}
|
||||
|
||||
return path;
|
||||
},
|
||||
fetchStatus = function (pathname, callback) {
|
||||
|
||||
if (H5AI.core.settings.folderStatus[pathname]) {
|
||||
callback(H5AI.core.settings.folderStatus[pathname]);
|
||||
return;
|
||||
} else if (pathnameStatusCache[pathname]) {
|
||||
callback(pathnameStatusCache[pathname]);
|
||||
return;
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
url: pathname,
|
||||
type: "HEAD",
|
||||
complete: function (xhr) {
|
||||
|
||||
var status = xhr.status;
|
||||
|
||||
if (status === 200 && contentTypeRegEx.test(xhr.getResponseHeader("Content-Type"))) {
|
||||
status = "h5ai";
|
||||
}
|
||||
pathnameStatusCache[pathname] = status;
|
||||
callback(status);
|
||||
}
|
||||
});
|
||||
},
|
||||
updatePath = function (path) {
|
||||
|
||||
if (path.isFolder && !path.isParentFolder && path.status === undefined) {
|
||||
fetchStatus(path.absHref, function (status) {
|
||||
|
||||
if (status !== "h5ai") {
|
||||
path.status = status;
|
||||
}
|
||||
H5AI.html.updateHtml(path);
|
||||
H5AI.core.linkHoverStates();
|
||||
});
|
||||
}
|
||||
},
|
||||
updatePaths = function () {
|
||||
|
||||
$.each(cache, function (ref, cached) {
|
||||
updatePath(cached);
|
||||
});
|
||||
},
|
||||
fetchStatusAndContent = function (pathname, includeParent, callback) {
|
||||
|
||||
fetchStatus(pathname, function (status) {
|
||||
|
||||
if (status !== "h5ai") {
|
||||
callback(status, {});
|
||||
return;
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
url: pathname,
|
||||
type: "GET",
|
||||
dataType: "html",
|
||||
error: function (xhr) {
|
||||
|
||||
callback(xhr.status, {}); // since it was checked before this should never happen
|
||||
},
|
||||
success: function (html, status, xhr) {
|
||||
|
||||
var content = {};
|
||||
|
||||
if (!contentTypeRegEx.test(xhr.getResponseHeader("Content-Type"))) {
|
||||
callback(xhr.status, {}); // since it was checked before this should never happen
|
||||
return;
|
||||
}
|
||||
|
||||
$(html).find("#table td").closest("tr").each(function () {
|
||||
|
||||
var path = getPath(pathname, this);
|
||||
|
||||
if (path.isFolder && (!path.isParentFolder || includeParent)) {
|
||||
content[path.absHref] = path;
|
||||
updatePath(path);
|
||||
}
|
||||
});
|
||||
callback("h5ai", content);
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
return {
|
||||
getPath: getPath,
|
||||
updatePaths: updatePaths,
|
||||
fetchStatusAndContent: fetchStatusAndContent
|
||||
};
|
||||
}());
|
||||
|
||||
}(jQuery, H5AI));
|
@@ -1,55 +0,0 @@
|
||||
|
||||
(function ($, H5AI) {
|
||||
|
||||
H5AI.context = (function () {
|
||||
|
||||
var $context,
|
||||
qrCodesSize,
|
||||
showQrCode = function ($a) {
|
||||
|
||||
var absHref = $a.attr('href'),
|
||||
url = 'http://' + document.domain + absHref;
|
||||
|
||||
$context.find('.qrcode').empty().qrcode({
|
||||
render: Modernizr.canvas ? 'canvas' : 'div',
|
||||
width: qrCodesSize,
|
||||
height: qrCodesSize,
|
||||
color: '#333',
|
||||
text: url
|
||||
});
|
||||
},
|
||||
init = function () {
|
||||
|
||||
qrCodesSize = H5AI.core.settings.qrCodesSize;
|
||||
if (!qrCodesSize) {
|
||||
return;
|
||||
}
|
||||
|
||||
var hideTimeoutId = null;
|
||||
|
||||
$context = $('<div id="context"><div class="qrcode"/></div>');
|
||||
$context.appendTo('body');
|
||||
|
||||
$('#extended')
|
||||
.on('mouseenter', '.entry.file a', function () {
|
||||
|
||||
showQrCode($(this));
|
||||
clearTimeout(hideTimeoutId);
|
||||
$context.stop(true, true).fadeIn(400);
|
||||
})
|
||||
.on('mouseleave', '.entry.file a', function () {
|
||||
|
||||
hideTimeoutId = setTimeout(function () {
|
||||
|
||||
$context.stop(true, true).fadeOut(400);
|
||||
}, 200);
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
return {
|
||||
init: init
|
||||
};
|
||||
}());
|
||||
|
||||
}(jQuery, H5AI));
|
@@ -1,439 +0,0 @@
|
||||
|
||||
(function (window, $, H5AI, config) {
|
||||
|
||||
H5AI.core = (function () {
|
||||
|
||||
var $window = $(window),
|
||||
defaults = {
|
||||
store: {
|
||||
viewmode: "h5ai.pref.viewmode",
|
||||
lang: "h5ai.pref.lang"
|
||||
},
|
||||
callbacks: {
|
||||
pathClick: []
|
||||
},
|
||||
|
||||
rootAbsHref: "/",
|
||||
h5aiAbsHref: "/_h5ai/",
|
||||
customHeader: null,
|
||||
customFooter: null,
|
||||
viewmodes: ["details", "icons"],
|
||||
sortorder: "na",
|
||||
showTree: true,
|
||||
slideTree: true,
|
||||
folderStatus: {},
|
||||
lang: "en",
|
||||
useBrowserLang: true,
|
||||
setParentFolderLabels: true,
|
||||
linkHoverStates: true,
|
||||
dateFormat: "yyyy-MM-dd HH:mm",
|
||||
showThumbs: false,
|
||||
thumbTypes: ["bmp", "gif", "ico", "image", "jpg", "png", "tiff"],
|
||||
zippedDownload: false,
|
||||
qrCodesSize: null,
|
||||
showFilter: false
|
||||
},
|
||||
settings = $.extend({}, defaults, config.options),
|
||||
currentDateFormat = settings.dateFormat,
|
||||
extToFileType = (function (types) {
|
||||
var map = {};
|
||||
$.each(types, function (type, exts) {
|
||||
$.each(exts, function (idx, ext) {
|
||||
map[ext] = type;
|
||||
});
|
||||
});
|
||||
return map;
|
||||
}(config.types)),
|
||||
hash = function (obj) {
|
||||
|
||||
if ($.isPlainObject(obj)) {
|
||||
var hashStr = '';
|
||||
$.each($.extend({}, hash(), obj), function (key, value) {
|
||||
if (value) {
|
||||
hashStr += '/' + encodeURIComponent(key) + '=' + encodeURIComponent(value);
|
||||
}
|
||||
});
|
||||
hashStr = '#!' + hashStr;
|
||||
window.location.hash = hashStr;
|
||||
return hashStr;
|
||||
} else {
|
||||
var result = {},
|
||||
parts = document.location.hash.split('/');
|
||||
|
||||
if (parts.length >= 2 || parts[0] === '#!') {
|
||||
parts.shift();
|
||||
$.each(parts, function (idx, part) {
|
||||
|
||||
var match = /^([^=]*)=(.*?)$/.exec(part);
|
||||
if (match) {
|
||||
result[decodeURIComponent(match[1])] = decodeURIComponent(match[2]);
|
||||
}
|
||||
});
|
||||
}
|
||||
return typeof obj === 'string' ? result[obj] : result;
|
||||
}
|
||||
},
|
||||
api = function () {
|
||||
|
||||
return settings.h5aiAbsHref + "php/api.php";
|
||||
},
|
||||
image = function (id, noPngExt) {
|
||||
|
||||
return settings.h5aiAbsHref + "images/" + id + (noPngExt ? "" : ".png");
|
||||
},
|
||||
icon = function (id, big) {
|
||||
|
||||
return settings.h5aiAbsHref + "icons/" + (big ? "48x48" : "16x16") + "/" + id + ".png";
|
||||
},
|
||||
viewmode = function (viewmode) {
|
||||
|
||||
var $viewDetails = $("#viewdetails"),
|
||||
$viewIcons = $("#viewicons"),
|
||||
$extended = $("#extended");
|
||||
|
||||
if (viewmode) {
|
||||
amplify.store(settings.store.viewmode, viewmode);
|
||||
} else {
|
||||
viewmode = amplify.store(settings.store.viewmode);
|
||||
}
|
||||
viewmode = $.inArray(viewmode, settings.viewmodes) >= 0 ? viewmode : settings.viewmodes[0];
|
||||
H5AI.core.hash({view: viewmode});
|
||||
|
||||
$viewDetails.add($viewIcons).removeClass("current");
|
||||
if (viewmode === "details") {
|
||||
$viewDetails.addClass("current");
|
||||
$extended.addClass("details-view").removeClass("icons-view").show();
|
||||
} else if (viewmode === "icons") {
|
||||
$viewIcons.addClass("current");
|
||||
$extended.removeClass("details-view").addClass("icons-view").show();
|
||||
} else {
|
||||
$extended.hide();
|
||||
}
|
||||
},
|
||||
initTopSpace = function () {
|
||||
|
||||
var $body = $("body"),
|
||||
$tree = $("#tree"),
|
||||
adjustTopSpace = function () {
|
||||
|
||||
var winHeight = $window.height(),
|
||||
navHeight = $("body > nav").outerHeight(),
|
||||
footerHeight = $("body > footer").outerHeight(),
|
||||
contentSpacing = 50,
|
||||
treeSpacing = 0;
|
||||
|
||||
$body.css({
|
||||
"margin-top": navHeight + contentSpacing,
|
||||
"margin-bottom": footerHeight + contentSpacing
|
||||
});
|
||||
|
||||
$tree.css({
|
||||
top: navHeight + treeSpacing,
|
||||
height: winHeight - navHeight - footerHeight - 16 - 2 * treeSpacing
|
||||
});
|
||||
|
||||
try {
|
||||
$tree.get(0).updateScrollbar();
|
||||
} catch (err) {}
|
||||
};
|
||||
|
||||
$window.resize(function () {
|
||||
adjustTopSpace();
|
||||
});
|
||||
adjustTopSpace();
|
||||
},
|
||||
initViews = function () {
|
||||
|
||||
var $navbar = $("#navbar"),
|
||||
$extended = $("#extended");
|
||||
|
||||
$("#table").remove();
|
||||
|
||||
if (settings.viewmodes.length > 1) {
|
||||
if ($.inArray("icons", settings.viewmodes) >= 0) {
|
||||
$("<li id='viewicons' class='view'><a href='#'><img alt='view-icons' /><span class='l10n-icons'>icons</span></a></li>")
|
||||
.find("img").attr("src", image("view-icons")).end()
|
||||
.find("a").click(function (event) {
|
||||
viewmode("icons");
|
||||
event.preventDefault();
|
||||
}).end()
|
||||
.appendTo($navbar);
|
||||
}
|
||||
if ($.inArray("details", settings.viewmodes) >= 0) {
|
||||
$("<li id='viewdetails' class='view'><a href='#'><img alt='view-details' /><span class='l10n-details'>details</span></a></li>")
|
||||
.find("img").attr("src", image("view-details")).end()
|
||||
.find("a").click(function (event) {
|
||||
viewmode("details");
|
||||
event.preventDefault();
|
||||
}).end()
|
||||
.appendTo($navbar);
|
||||
}
|
||||
}
|
||||
|
||||
// status update
|
||||
$extended.find(".entry a").hover(
|
||||
function () {
|
||||
if ($extended.hasClass("icons-view")) {
|
||||
var $this = $(this);
|
||||
$(".status.default").hide();
|
||||
$(".status.dynamic")
|
||||
.empty()
|
||||
.append($this.find(".label").clone())
|
||||
.append($("<span class='sep'>·</span>"))
|
||||
.append($this.find(".date").clone())
|
||||
.show();
|
||||
|
||||
if (!$this.closest(".entry").hasClass("folder")) {
|
||||
$(".status.dynamic")
|
||||
.append($("<span class='sep'>·</span>"))
|
||||
.append($this.find(".size").clone());
|
||||
}
|
||||
}
|
||||
},
|
||||
function () {
|
||||
$(".status.default").show();
|
||||
$(".status.dynamic").empty().hide();
|
||||
}
|
||||
);
|
||||
},
|
||||
shiftTree = function (forceVisible, dontAnimate) {
|
||||
|
||||
var $tree = $("#tree"),
|
||||
$extended = $("#extended");
|
||||
|
||||
if ((settings.slideTree && $tree.outerWidth() < $extended.offset().left) || forceVisible) {
|
||||
if (dontAnimate) {
|
||||
$tree.stop().css({ left: 0 });
|
||||
} else {
|
||||
$tree.stop().animate({ left: 0 });
|
||||
}
|
||||
} else {
|
||||
if (dontAnimate) {
|
||||
$tree.stop().css({ left: 18 - $tree.outerWidth() });
|
||||
} else {
|
||||
$tree.stop().animate({ left: 18 - $tree.outerWidth() });
|
||||
}
|
||||
}
|
||||
},
|
||||
initTree = function () {
|
||||
|
||||
$("#tree").hover(
|
||||
function () { shiftTree(true); },
|
||||
function () { shiftTree(); }
|
||||
);
|
||||
$window.resize(function () { shiftTree(); });
|
||||
shiftTree(false, true);
|
||||
},
|
||||
selectLinks = function (href) {
|
||||
|
||||
var elements = [];
|
||||
$("a[href^='/']").each(function () {
|
||||
|
||||
if ($(this).attr("href") === href) {
|
||||
elements.push(this);
|
||||
}
|
||||
});
|
||||
return $(elements);
|
||||
},
|
||||
linkHoverStates = function () {
|
||||
|
||||
if (settings.linkHoverStates) {
|
||||
$("a[href^='/']:not(.linkedHoverStates)").each(function () {
|
||||
|
||||
var $a = $(this).addClass("linkedHoverStates"),
|
||||
href = $a.attr("href");
|
||||
|
||||
$a.hover(
|
||||
function () { selectLinks(href).addClass("hover"); },
|
||||
function () { selectLinks(href).removeClass("hover"); }
|
||||
);
|
||||
});
|
||||
}
|
||||
},
|
||||
formatDates = function (dateFormat) {
|
||||
|
||||
if (dateFormat) {
|
||||
currentDateFormat = dateFormat;
|
||||
}
|
||||
|
||||
$("#extended .entry .date").each(function () {
|
||||
|
||||
var $this = $(this),
|
||||
time = $this.data("time"),
|
||||
formattedDate = time ? new Date(time).toString(currentDateFormat) : "";
|
||||
|
||||
$this.text(formattedDate);
|
||||
});
|
||||
},
|
||||
localize = function (langs, lang, useBrowserLang) {
|
||||
|
||||
var storedLang = amplify.store(settings.store.lang),
|
||||
browserLang, selected, key;
|
||||
|
||||
if (langs[storedLang]) {
|
||||
lang = storedLang;
|
||||
} else if (useBrowserLang) {
|
||||
browserLang = navigator.language;
|
||||
if (langs[browserLang]) {
|
||||
lang = browserLang;
|
||||
} else if (browserLang.length > 2 && langs[browserLang.substr(0, 2)]) {
|
||||
lang = browserLang.substr(0, 2);
|
||||
}
|
||||
}
|
||||
|
||||
if (!langs[lang]) {
|
||||
lang = "en";
|
||||
}
|
||||
|
||||
selected = langs[lang];
|
||||
if (selected) {
|
||||
$.each(selected, function (key, value) {
|
||||
$(".l10n-" + key).text(value);
|
||||
});
|
||||
$(".lang").text(lang);
|
||||
$(".langOption").removeClass("current");
|
||||
$(".langOption." + lang).addClass("current");
|
||||
H5AI.core.hash({lang: lang});
|
||||
}
|
||||
|
||||
formatDates(selected.dateFormat || settings.dateFormat);
|
||||
},
|
||||
initLangSelector = function (langs) {
|
||||
|
||||
var $langOptions = $("#langSelector .langOptions"),
|
||||
sortedLangsKeys = [],
|
||||
$ul;
|
||||
|
||||
$.each(langs, function (lang) {
|
||||
sortedLangsKeys.push(lang);
|
||||
});
|
||||
sortedLangsKeys.sort();
|
||||
|
||||
$ul = $("<ul />");
|
||||
$.each(sortedLangsKeys, function (idx, lang) {
|
||||
$("<li class='langOption' />")
|
||||
.addClass(lang)
|
||||
.text(lang + " - " + langs[lang].lang)
|
||||
.appendTo($ul)
|
||||
.click(function () {
|
||||
amplify.store(settings.store.lang, lang);
|
||||
localize(langs, lang, false);
|
||||
});
|
||||
});
|
||||
$langOptions
|
||||
.append($ul)
|
||||
.scrollpanel();
|
||||
|
||||
$("#langSelector").hover(
|
||||
function () {
|
||||
$langOptions
|
||||
.css("top", "-" + $langOptions.outerHeight() + "px")
|
||||
.stop(true, true)
|
||||
.fadeIn();
|
||||
$langOptions.get(0).updateScrollbar();
|
||||
},
|
||||
function () {
|
||||
$langOptions
|
||||
.stop(true, true)
|
||||
.fadeOut();
|
||||
}
|
||||
);
|
||||
},
|
||||
onIndicatorClick = function (event) {
|
||||
|
||||
var $indicator = $(this),
|
||||
$entry = $indicator.closest(".entry"),
|
||||
updateTreeScrollbar = $("#tree").get(0).updateScrollbar;
|
||||
|
||||
if ($indicator.hasClass("unknown")) {
|
||||
$.get(api(), { "action": "tree", "href": $entry.find("> a").attr("href") }, function (html) {
|
||||
|
||||
var $content = $(html);
|
||||
|
||||
$indicator.removeClass("unknown");
|
||||
if ($content.find("> li").size() === 0) {
|
||||
$indicator.replaceWith($("<span class='blank' />"));
|
||||
} else {
|
||||
$indicator.addClass("open");
|
||||
$entry.find("> .content").replaceWith($content);
|
||||
updateTreeScrollbar();
|
||||
$content.find(".indicator:not(.initiated)")
|
||||
.click(onIndicatorClick)
|
||||
.addClass("initiated");
|
||||
}
|
||||
});
|
||||
} else if ($indicator.hasClass("open")) {
|
||||
$indicator.removeClass("open");
|
||||
updateTreeScrollbar(true);
|
||||
$entry.find("> .content").slideUp(function () {
|
||||
updateTreeScrollbar();
|
||||
});
|
||||
} else {
|
||||
$indicator.addClass("open");
|
||||
updateTreeScrollbar(true);
|
||||
$entry.find("> .content").slideDown(function () {
|
||||
updateTreeScrollbar();
|
||||
});
|
||||
}
|
||||
},
|
||||
initIndicators = function () {
|
||||
|
||||
$("#tree .entry.folder .indicator:not(.initiated)")
|
||||
.click(onIndicatorClick)
|
||||
.addClass("initiated");
|
||||
},
|
||||
getFileType = function (filename) {
|
||||
|
||||
var dotidx = filename.lastIndexOf('.'),
|
||||
ext = dotidx >= 0 ? filename.substr(dotidx) : filename;
|
||||
|
||||
return extToFileType[ext.toLowerCase()] || "unknown";
|
||||
},
|
||||
formatSizes = function () {
|
||||
|
||||
$("#extended .entry .size").each(function () {
|
||||
|
||||
var $this = $(this),
|
||||
bytes = $this.data("bytes"),
|
||||
formattedSize = bytes >= 0 ? H5AI.util.formatSize(bytes) : "";
|
||||
|
||||
$this.text(formattedSize);
|
||||
});
|
||||
},
|
||||
setTotals = function () {
|
||||
|
||||
var $extended = $("#extended");
|
||||
|
||||
$(".folderTotal").text($extended.find(".entry.folder:not(.folder-parent)").length);
|
||||
$(".fileTotal").text($extended.find(".entry.file").length);
|
||||
},
|
||||
init = function () {
|
||||
|
||||
initViews();
|
||||
viewmode();
|
||||
initTopSpace();
|
||||
initTree();
|
||||
linkHoverStates();
|
||||
initLangSelector(config.langs);
|
||||
localize(config.langs, settings.lang, settings.useBrowserLang);
|
||||
formatSizes();
|
||||
setTotals();
|
||||
initIndicators();
|
||||
};
|
||||
|
||||
return {
|
||||
settings: settings,
|
||||
hash: hash,
|
||||
api: api,
|
||||
image: image,
|
||||
icon: icon,
|
||||
shiftTree: shiftTree,
|
||||
linkHoverStates: linkHoverStates,
|
||||
initIndicators: initIndicators,
|
||||
formatDates: formatDates,
|
||||
getFileType: getFileType,
|
||||
init: init
|
||||
};
|
||||
}());
|
||||
|
||||
}(window, jQuery, H5AI, H5AI_CONFIG));
|
@@ -1,132 +0,0 @@
|
||||
|
||||
(function (document, $, H5AI) {
|
||||
|
||||
H5AI.extended = (function () {
|
||||
|
||||
var initBreadcrumb = function () {
|
||||
|
||||
var $ul = $("body > nav ul"),
|
||||
pathname = "/",
|
||||
path = H5AI.connector.getPath(pathname),
|
||||
pathnameParts = document.location.pathname.split("/"),
|
||||
lastPart = "",
|
||||
title = document.domain;
|
||||
|
||||
$ul.append(H5AI.html.updateCrumbHtml(path));
|
||||
|
||||
$.each(pathnameParts, function (idx, part) {
|
||||
if (part !== "") {
|
||||
pathname += part + "/";
|
||||
$ul.append(H5AI.html.updateCrumbHtml(H5AI.connector.getPath(pathname)));
|
||||
lastPart = part + " - ";
|
||||
title += " > " + part;
|
||||
}
|
||||
});
|
||||
|
||||
document.title = H5AI.util.checkedDecodeUri(lastPart + title);
|
||||
},
|
||||
initExtendedView = function () {
|
||||
|
||||
var $ul, $li;
|
||||
|
||||
$ul = $("<ul/>");
|
||||
$li = $("<li class='header' />")
|
||||
.appendTo($ul)
|
||||
.append($("<a class='icon'></a>"))
|
||||
.append($("<a class='label' href='#'><span class='l10n-name'></span></a>"))
|
||||
.append($("<a class='date' href='#'><span class='l10n-lastModified'></span></a>"))
|
||||
.append($("<a class='size' href='#'><span class='l10n-size'></span></a>"));
|
||||
|
||||
// entries
|
||||
$("#table td").closest("tr").each(function () {
|
||||
var path = H5AI.connector.getPath(document.location.pathname, this);
|
||||
$ul.append(H5AI.html.updateExtendedHtml(path));
|
||||
});
|
||||
|
||||
$("#extended").append($ul);
|
||||
|
||||
// empty
|
||||
if ($ul.children(".entry:not(.folder-parent)").size() === 0) {
|
||||
$("#extended").append($("<div class='empty l10n-empty'>empty</div>"));
|
||||
}
|
||||
$("#extended").append($("<div class='no-match l10n-noMatch'>no match</div>"));
|
||||
},
|
||||
customize = function () {
|
||||
|
||||
if (H5AI.core.settings.customHeader) {
|
||||
$.ajax({
|
||||
url: H5AI.core.settings.customHeader,
|
||||
dataType: "html",
|
||||
success: function (data) {
|
||||
$("#content > header").append($(data)).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (H5AI.core.settings.customFooter) {
|
||||
$.ajax({
|
||||
url: H5AI.core.settings.customFooter,
|
||||
dataType: "html",
|
||||
success: function (data) {
|
||||
$("#content > footer").prepend($(data)).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
fetchPath = function (pathname, callback) {
|
||||
|
||||
H5AI.connector.fetchStatusAndContent(pathname, false, function (status, content) {
|
||||
|
||||
var path = H5AI.connector.getPath(pathname);
|
||||
|
||||
path.status = status;
|
||||
path.content = content;
|
||||
callback(path);
|
||||
});
|
||||
},
|
||||
fetchTree = function (pathname, callback, childPath) {
|
||||
|
||||
fetchPath(pathname, function (path) {
|
||||
|
||||
var parent = H5AI.util.splitPath(pathname).parent;
|
||||
|
||||
path.treeOpen = true;
|
||||
if (childPath) {
|
||||
path.content[childPath.absHref] = childPath;
|
||||
}
|
||||
if (parent === null) {
|
||||
callback(path);
|
||||
} else {
|
||||
fetchTree(parent, callback, path);
|
||||
}
|
||||
});
|
||||
},
|
||||
populateTree = function () {
|
||||
|
||||
fetchTree(document.location.pathname, function (path) {
|
||||
$("#tree")
|
||||
.append(H5AI.html.updateTreeHtml(path))
|
||||
.scrollpanel()
|
||||
.show();
|
||||
H5AI.core.shiftTree(false, true);
|
||||
H5AI.core.linkHoverStates();
|
||||
setTimeout(function () { $("#tree").get(0).updateScrollbar(); }, 1);
|
||||
});
|
||||
},
|
||||
init = function () {
|
||||
|
||||
initBreadcrumb();
|
||||
initExtendedView();
|
||||
customize();
|
||||
H5AI.connector.updatePaths();
|
||||
if (H5AI.core.settings.showTree) {
|
||||
populateTree();
|
||||
}
|
||||
};
|
||||
|
||||
return {
|
||||
init: init
|
||||
};
|
||||
}());
|
||||
|
||||
}(document, jQuery, H5AI));
|
@@ -1,111 +0,0 @@
|
||||
|
||||
(function ($, H5AI) {
|
||||
|
||||
H5AI.finder = (function () {
|
||||
|
||||
var filter = function (re) {
|
||||
|
||||
var match = [],
|
||||
noMatch = [];
|
||||
|
||||
if (re) {
|
||||
$('#extended .entry').each(function () {
|
||||
|
||||
var label = $(this).find('.label').text();
|
||||
|
||||
if (label.match(re)) {
|
||||
match.push(this);
|
||||
} else {
|
||||
noMatch.push(this);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
match = $('#extended .entry');
|
||||
}
|
||||
|
||||
if ($(match).length) {
|
||||
$('#extended .no-match').hide();
|
||||
} else {
|
||||
setTimeout(function () {
|
||||
|
||||
$('#extended .no-match').show();
|
||||
}, 200);
|
||||
}
|
||||
$(match).fadeIn(200);
|
||||
$(noMatch).fadeOut(200);
|
||||
},
|
||||
checkState = function (focus) {
|
||||
|
||||
var $filter = $('#filter'),
|
||||
$input = $filter.find('input'),
|
||||
val = $input.val();
|
||||
|
||||
if (val || focus) {
|
||||
$filter.addClass('current');
|
||||
} else {
|
||||
$filter.removeClass('current');
|
||||
}
|
||||
H5AI.core.hash({filter: val});
|
||||
},
|
||||
parseFilterSequence = function (sequence) {
|
||||
|
||||
if (sequence.substr(0,3) === 're:') {
|
||||
return new RegExp(sequence.substr(3));
|
||||
}
|
||||
|
||||
sequence = $.map($.trim(sequence).split(/\s+/), function (part) {
|
||||
|
||||
return H5AI.util.reEscape(part);
|
||||
}).join('|');
|
||||
return new RegExp(sequence);
|
||||
},
|
||||
init = function () {
|
||||
|
||||
if (H5AI.core.settings.showFilter) {
|
||||
$("<li id='filter'><span class='element'><img alt='filter' /><input type='text' value='' placeholder='filter' /></span></li>")
|
||||
.on('click', function () {
|
||||
|
||||
var $input = $(this).find('input');
|
||||
$input.focus();
|
||||
})
|
||||
.find("img").attr("src", H5AI.core.image("filter")).end()
|
||||
.find("input")
|
||||
.on('focus', function () {
|
||||
|
||||
checkState(true);
|
||||
})
|
||||
.on('blur', function () {
|
||||
|
||||
checkState(false);
|
||||
})
|
||||
.on('keyup', function () {
|
||||
|
||||
var $input = $(this),
|
||||
val = $input.val();
|
||||
|
||||
if (val) {
|
||||
filter(parseFilterSequence(val));
|
||||
} else {
|
||||
filter();
|
||||
}
|
||||
checkState($input.is(':focus'));
|
||||
})
|
||||
.end()
|
||||
.appendTo($("#navbar"));
|
||||
|
||||
var initialFilter = H5AI.core.hash('filter');
|
||||
if (initialFilter) {
|
||||
$('#filter input').val(initialFilter);
|
||||
checkState(false);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
return {
|
||||
init: init,
|
||||
filter: filter
|
||||
};
|
||||
}());
|
||||
|
||||
}(jQuery, H5AI));
|
@@ -1,264 +0,0 @@
|
||||
|
||||
(function ($, H5AI) {
|
||||
|
||||
H5AI.html = (function () {
|
||||
|
||||
var onClick = function (path, context) {
|
||||
|
||||
},
|
||||
updateCrumbHtml = function (path) {
|
||||
|
||||
var $html, $a;
|
||||
|
||||
if (path.html.$crumb && path.html.$crumb.data("status") === path.status) {
|
||||
return path.html.$crumb;
|
||||
}
|
||||
|
||||
$html = $("<li class='crumb'><a><img alt='>' /><span></span></a></li>")
|
||||
.addClass(path.isFolder ? "folder" : "file");
|
||||
|
||||
if (path.status) {
|
||||
$html.data("status", path.status);
|
||||
}
|
||||
|
||||
$a = $html.find("a")
|
||||
.attr("href", path.absHref)
|
||||
.click(function() { onClick(path, "crumb"); })
|
||||
.find("img").attr("src", H5AI.core.image("crumb")).end()
|
||||
.find("span").text(path.label).end();
|
||||
|
||||
if (path.isDomain) {
|
||||
$html.addClass("domain");
|
||||
$a.find("img").attr("src", H5AI.core.image("home"));
|
||||
}
|
||||
|
||||
if (path.isCurrentFolder) {
|
||||
$html.addClass("current");
|
||||
}
|
||||
|
||||
if (!isNaN(path.status)) {
|
||||
if (path.status === 200) {
|
||||
$a.append($("<img class='hint' src='" + H5AI.core.image("page") + "' alt='not listable' />"));
|
||||
} else {
|
||||
$a.append($("<span class='hint'>(" + path.status + ")</span>"));
|
||||
}
|
||||
}
|
||||
|
||||
if (path.html.$crumb) {
|
||||
path.html.$crumb.replaceWith($html);
|
||||
}
|
||||
path.html.$crumb = $html;
|
||||
|
||||
return $html;
|
||||
},
|
||||
updateExtendedHtml = function (path) {
|
||||
|
||||
var $html, $a, $label,
|
||||
formattedDate = path.date ? path.date.toString(H5AI.core.settings.dateFormat) : "",
|
||||
imgClass = "",
|
||||
icon16 = H5AI.core.icon(path.type),
|
||||
icon48 = H5AI.core.icon(path.type, true);
|
||||
|
||||
if (path.html.$extended && path.html.$extended.data("status") === path.status) {
|
||||
return path.html.$extended;
|
||||
}
|
||||
|
||||
$html = $("<li class='entry' />")
|
||||
.data("path", path)
|
||||
.addClass(path.isFolder ? "folder" : "file");
|
||||
|
||||
if (path.status) {
|
||||
$html.data("status", path.status);
|
||||
}
|
||||
|
||||
if (H5AI.core.settings.showThumbs === true && $.inArray(path.type, H5AI.core.settings.thumbTypes) >= 0) {
|
||||
imgClass = "class='thumb'";
|
||||
var escapedHref = path.absHref.replace(/'/g, "%27").replace(/"/g, "%22");
|
||||
icon16 = H5AI.core.api() + "?action=thumb&href=" + escapedHref + "&width=16&height=16&mode=square";
|
||||
icon48 = H5AI.core.api() + "?action=thumb&href=" + escapedHref + "&width=96&height=46&mode=rational";
|
||||
}
|
||||
|
||||
$label = $("<span class='label'>" + path.label + "</span>");
|
||||
$a = $("<a />")
|
||||
.attr("href", path.absHref)
|
||||
.click(function() { onClick(path, "extended"); })
|
||||
.appendTo($html)
|
||||
.append($("<span class='icon small'><img " + imgClass + " src='" + icon16 + "' alt='" + path.type + "' /></span>"))
|
||||
.append($("<span class='icon big'><img " + imgClass + " src='" + icon48 + "' alt='" + path.type + "' /></span>"))
|
||||
.append($label)
|
||||
.append($("<span class='date' data-time='" + path.time + "'></span>"))
|
||||
.append($("<span class='size' data-bytes='" + path.size + "'></span>"));
|
||||
|
||||
$a.hover(
|
||||
function () {
|
||||
if ($("#extended").hasClass("icons-view")) {
|
||||
var $this = $(this);
|
||||
$(".status.default").hide();
|
||||
$(".status.dynamic")
|
||||
.empty()
|
||||
.append($this.find(".label").clone())
|
||||
.append($("<span class='sep'>·</span>"))
|
||||
.append($this.find(".date").clone())
|
||||
.show();
|
||||
|
||||
if (!$this.closest(".entry").hasClass("folder")) {
|
||||
$(".status.dynamic")
|
||||
.append($("<span class='sep'>·</span>"))
|
||||
.append($this.find(".size").clone());
|
||||
}
|
||||
}
|
||||
},
|
||||
function () {
|
||||
$(".status.default").show();
|
||||
$(".status.dynamic").empty().hide();
|
||||
}
|
||||
);
|
||||
|
||||
if (path.isParentFolder) {
|
||||
if (!H5AI.core.settings.setParentFolderLabels) {
|
||||
$label.addClass("l10n-parentDirectory");
|
||||
}
|
||||
$html.addClass("folder-parent");
|
||||
}
|
||||
|
||||
if (!isNaN(path.status)) {
|
||||
if (path.status === 200) {
|
||||
$html.addClass("page");
|
||||
$a.find(".icon.small img").attr("src", H5AI.core.icon("folder-page"));
|
||||
$a.find(".icon.big img").attr("src", H5AI.core.icon("folder-page", true));
|
||||
} else {
|
||||
$html.addClass("error");
|
||||
$label.append($("<span class='hint'> " + path.status + " </span>"));
|
||||
}
|
||||
}
|
||||
|
||||
if (path.html.$extended) {
|
||||
path.html.$extended.replaceWith($html);
|
||||
H5AI.core.formatDates();
|
||||
}
|
||||
path.html.$extended = $html;
|
||||
|
||||
return $html;
|
||||
},
|
||||
updateTreeHtml = function (path) {
|
||||
|
||||
var $html, $blank, $a, $indicator, $ul, idx;
|
||||
|
||||
$html = $("<div class='entry' />")
|
||||
.data("path", path)
|
||||
.addClass(path.isFolder ? "folder" : "file");
|
||||
|
||||
$blank = $("<span class='blank' />").appendTo($html);
|
||||
|
||||
$a = $("<a />")
|
||||
.attr("href", path.absHref)
|
||||
.click(function() { onClick(path, "tree"); })
|
||||
.appendTo($html)
|
||||
.append($("<span class='icon'><img src='" + H5AI.core.icon(path.type) + "' /></span>"))
|
||||
.append($("<span class='label'>" + path.label + "</span>"));
|
||||
|
||||
if (path.isFolder) {
|
||||
// indicator
|
||||
if (path.status === undefined || !path.isEmpty()) {
|
||||
$indicator = $("<span class='indicator initiated'><img src='" + H5AI.core.image("tree") + "' /></span>")
|
||||
.click(function (event) {
|
||||
|
||||
var $entry = $indicator.closest(".entry"); // $html
|
||||
|
||||
if ($indicator.hasClass("unknown")) {
|
||||
H5AI.connector.fetchStatusAndContent(path.absHref, false, function (status, content) {
|
||||
|
||||
path.status = status;
|
||||
path.content = content;
|
||||
path.treeOpen = true;
|
||||
$("#tree").get(0).updateScrollbar(true);
|
||||
updateTreeHtml(path);
|
||||
$("#tree").get(0).updateScrollbar();
|
||||
});
|
||||
} else if ($indicator.hasClass("open")) {
|
||||
path.treeOpen = false;
|
||||
$indicator.removeClass("open");
|
||||
$("#tree").get(0).updateScrollbar(true);
|
||||
$entry.find("> ul.content").slideUp(function() {
|
||||
|
||||
$("#tree").get(0).updateScrollbar();
|
||||
});
|
||||
} else {
|
||||
path.treeOpen = true;
|
||||
$indicator.addClass("open");
|
||||
$("#tree").get(0).updateScrollbar(true);
|
||||
$entry.find("> ul.content").slideDown(function() {
|
||||
|
||||
$("#tree").get(0).updateScrollbar();
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
if (path.status === undefined) {
|
||||
$indicator.addClass("unknown");
|
||||
} else if (path.treeOpen) {
|
||||
$indicator.addClass("open");
|
||||
}
|
||||
|
||||
$blank.replaceWith($indicator);
|
||||
}
|
||||
|
||||
// is path the domain?
|
||||
if (path.isDomain) {
|
||||
$html.addClass("domain");
|
||||
$a.find(".icon img").attr("src", H5AI.core.icon("folder-home"));
|
||||
}
|
||||
|
||||
// is path the current folder?
|
||||
if (path.isCurrentFolder) {
|
||||
$html.addClass("current");
|
||||
$a.find(".icon img").attr("src", H5AI.core.icon("folder-open"));
|
||||
}
|
||||
|
||||
// does it have subfolders?
|
||||
if (!path.isEmpty()) {
|
||||
$ul = $("<ul class='content' />").appendTo($html);
|
||||
$.each(path.content, function (idx, entry) {
|
||||
$("<li />").append(updateTreeHtml(entry)).appendTo($ul);
|
||||
});
|
||||
if (path.status === undefined || !path.treeOpen) {
|
||||
$ul.hide();
|
||||
}
|
||||
}
|
||||
|
||||
// reflect folder status
|
||||
if (!isNaN(path.status)) {
|
||||
if (path.status === 200) {
|
||||
$a.find(".icon img").attr("src", H5AI.core.icon("folder-page"));
|
||||
$a.append($("<span class='hint'><img src='" + H5AI.core.image("page") + "' /></span>"));
|
||||
} else {
|
||||
$html.addClass("error");
|
||||
$a.append($("<span class='hint'>" + path.status + "</span>"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (path.html.$tree) {
|
||||
path.html.$tree.replaceWith($html);
|
||||
}
|
||||
path.html.$tree = $html;
|
||||
|
||||
return $html;
|
||||
},
|
||||
updateHtml = function (path) {
|
||||
|
||||
updateCrumbHtml(path);
|
||||
updateExtendedHtml(path);
|
||||
updateTreeHtml(path);
|
||||
};
|
||||
|
||||
return {
|
||||
updateCrumbHtml: updateCrumbHtml,
|
||||
updateExtendedHtml: updateExtendedHtml,
|
||||
updateTreeHtml: updateTreeHtml,
|
||||
updateHtml: updateHtml
|
||||
};
|
||||
}());
|
||||
|
||||
}(jQuery, H5AI));
|
@@ -1,95 +0,0 @@
|
||||
|
||||
(function (document, $, H5AI) {
|
||||
|
||||
H5AI.Path = function (folder, tableRow) {
|
||||
|
||||
var path = {},
|
||||
$tds, $a, date, size, splits;
|
||||
|
||||
// path.parentFolder: undefined
|
||||
// path.label: undefined
|
||||
// path.type: undefined
|
||||
// path.href: undefined
|
||||
// path.time: undefined
|
||||
// path.size: undefined
|
||||
// path.absHref: undefined
|
||||
// path.isFolder: undefined
|
||||
// path.isParentFolder: undefined
|
||||
// path.isCurrentFolder: undefined
|
||||
// path.isDomain: undefined
|
||||
|
||||
path.status = undefined; // undefined, "h5ai" or HTTP response code
|
||||
path.content = undefined; // associative array path.absHref -> path
|
||||
path.html = {
|
||||
$crumb: undefined,
|
||||
$extended: undefined,
|
||||
$tree: undefined
|
||||
};
|
||||
path.treeOpen = false;
|
||||
|
||||
if (!H5AI.util.pathEndsWithSlash(folder)) {
|
||||
folder += "/";
|
||||
}
|
||||
|
||||
if (tableRow) {
|
||||
$tds = $(tableRow).find("td");
|
||||
$a = $tds.eq(1).find("a");
|
||||
date = Date.parse($tds.eq(2).text());
|
||||
size = H5AI.util.parseSize($tds.eq(3).text());
|
||||
|
||||
path.parentFolder = folder;
|
||||
path.label = $a.text();
|
||||
path.type = H5AI.util.pathEndsWithSlash(path.label) ? "folder" : H5AI.core.getFileType(path.label);
|
||||
path.href = $a.attr("href");
|
||||
path.time = date ? date.getTime() : 0;
|
||||
path.size = size;
|
||||
} else {
|
||||
splits = H5AI.util.splitPath(folder);
|
||||
|
||||
path.parentFolder = splits.parent || "";
|
||||
path.label = H5AI.util.checkedDecodeUri(splits.name);
|
||||
if (path.label === "/") {
|
||||
path.label = H5AI.util.checkedDecodeUri(document.domain);
|
||||
}
|
||||
path.type = "folder";
|
||||
path.href = splits.name;
|
||||
path.time = 0;
|
||||
path.size = -1;
|
||||
}
|
||||
|
||||
if (H5AI.util.pathEndsWithSlash(path.label)) {
|
||||
path.label = path.label.slice(0, -1);
|
||||
}
|
||||
|
||||
path.isFolder = (path.type === "folder");
|
||||
path.isParentFolder = (path.label === "Parent Directory");
|
||||
if (path.isParentFolder) {
|
||||
path.isFolder = true;
|
||||
path.type = "folder-parent";
|
||||
}
|
||||
path.absHref = path.isParentFolder ? path.href : path.parentFolder + path.href;
|
||||
path.isCurrentFolder = (path.absHref === document.location.pathname);
|
||||
path.isDomain = (path.absHref === "/");
|
||||
|
||||
if (path.isParentFolder && H5AI.core.settings.setParentFolderLabels) {
|
||||
if (path.isDomain) {
|
||||
path.label = H5AI.util.checkedDecodeUri(document.domain);
|
||||
} else {
|
||||
splits = H5AI.util.splitPath(path.parentFolder);
|
||||
path.label = H5AI.util.checkedDecodeUri(splits.parentname);
|
||||
}
|
||||
}
|
||||
|
||||
path.isEmpty = function () {
|
||||
|
||||
return !path.content || $.isEmptyObject(path.content);
|
||||
};
|
||||
path.onClick = function (context) {
|
||||
|
||||
H5AI.core.triggerPathClick(path, context);
|
||||
};
|
||||
|
||||
return path;
|
||||
};
|
||||
|
||||
}(document, jQuery, H5AI));
|
@@ -1,158 +0,0 @@
|
||||
|
||||
(function ($, H5AI) {
|
||||
|
||||
H5AI.sort = (function () {
|
||||
|
||||
var type = function (entry) {
|
||||
|
||||
var $entry = $(entry);
|
||||
|
||||
if ($entry.hasClass("folder-parent")) {
|
||||
return 0;
|
||||
} else if ($entry.hasClass("folder")) {
|
||||
return 1;
|
||||
}
|
||||
return 2;
|
||||
},
|
||||
cmp = function (entry1, entry2, rev, getVal) {
|
||||
|
||||
var res, val1, val2;
|
||||
|
||||
res = type(entry1) - type(entry2);
|
||||
if (res !== 0) {
|
||||
return res;
|
||||
}
|
||||
|
||||
val1 = getVal(entry1);
|
||||
val2 = getVal(entry2);
|
||||
if (val1 < val2) {
|
||||
return rev ? 1 : -1;
|
||||
} else if (val1 > val2) {
|
||||
return rev ? -1 : 1;
|
||||
}
|
||||
return 0;
|
||||
},
|
||||
cmpName = function (entry1, entry2) {
|
||||
|
||||
return cmp(entry1, entry2, false, function (entry) {
|
||||
return $(entry).find(".label").text().toLowerCase();
|
||||
});
|
||||
},
|
||||
cmpTime = function (entry1, entry2) {
|
||||
|
||||
return cmp(entry1, entry2, false, function (entry) {
|
||||
return $(entry).find(".date").data("time");
|
||||
});
|
||||
},
|
||||
cmpSize = function (entry1, entry2) {
|
||||
|
||||
return cmp(entry1, entry2, false, function (entry) {
|
||||
return $(entry).find(".size").data("bytes");
|
||||
});
|
||||
},
|
||||
cmpNameRev = function (entry1, entry2) {
|
||||
|
||||
return cmp(entry1, entry2, true, function (entry) {
|
||||
return $(entry).find(".label").text().toLowerCase();
|
||||
});
|
||||
},
|
||||
cmpTimeRev = function (entry1, entry2) {
|
||||
|
||||
return cmp(entry1, entry2, true, function (entry) {
|
||||
return $(entry).find(".date").data("time");
|
||||
});
|
||||
},
|
||||
cmpSizeRev = function (entry1, entry2) {
|
||||
|
||||
return cmp(entry1, entry2, true, function (entry) {
|
||||
return $(entry).find(".size").data("bytes");
|
||||
});
|
||||
},
|
||||
sort = function (fn) {
|
||||
|
||||
$("#extended .entry").detach().sort(fn).appendTo($("#extended > ul"));
|
||||
},
|
||||
$all, orders,
|
||||
sortBy = function (id) {
|
||||
|
||||
var order = orders[id];
|
||||
|
||||
$all.removeClass("ascending").removeClass("descending");
|
||||
order.head.addClass(order.clas);
|
||||
sort(order.fn);
|
||||
H5AI.core.hash({sort: id});
|
||||
},
|
||||
init = function () {
|
||||
|
||||
var $ascending = $("<img src='" + H5AI.core.image("ascending") + "' class='sort ascending' alt='ascending' />"),
|
||||
$descending = $("<img src='" + H5AI.core.image("descending") + "' class='sort descending' alt='descending' />"),
|
||||
initialOrder = H5AI.core.hash('sort'),
|
||||
$header = $("#extended li.header"),
|
||||
$label = $header.find("a.label"),
|
||||
$date = $header.find("a.date"),
|
||||
$size = $header.find("a.size");
|
||||
|
||||
$all = $header.find("a.label,a.date,a.size");
|
||||
orders = {
|
||||
na: {
|
||||
head: $label,
|
||||
clas: "ascending",
|
||||
fn: cmpName
|
||||
},
|
||||
nd: {
|
||||
head: $label,
|
||||
clas: "descending",
|
||||
fn: cmpNameRev
|
||||
},
|
||||
da: {
|
||||
head: $date,
|
||||
clas: "ascending",
|
||||
fn: cmpTime
|
||||
},
|
||||
dd: {
|
||||
head: $date,
|
||||
clas: "descending",
|
||||
fn: cmpTimeRev
|
||||
},
|
||||
sa: {
|
||||
head: $size,
|
||||
clas: "ascending",
|
||||
fn: cmpSize
|
||||
},
|
||||
sd: {
|
||||
head: $size,
|
||||
clas: "descending",
|
||||
fn: cmpSizeRev
|
||||
}
|
||||
};
|
||||
|
||||
sortBy(initialOrder ? initialOrder : H5AI.core.settings.sortorder);
|
||||
|
||||
$label
|
||||
.append($ascending.clone()).append($descending.clone())
|
||||
.click(function (event) {
|
||||
sortBy("n" + ($label.hasClass("ascending") ? "d" : "a"));
|
||||
event.preventDefault();
|
||||
});
|
||||
|
||||
$date
|
||||
.prepend($ascending.clone()).prepend($descending.clone())
|
||||
.click(function (event) {
|
||||
sortBy("d" + ($date.hasClass("ascending") ? "d" : "a"));
|
||||
event.preventDefault();
|
||||
});
|
||||
|
||||
$size
|
||||
.prepend($ascending.clone()).prepend($descending.clone())
|
||||
.click(function (event) {
|
||||
sortBy("s" + ($size.hasClass("ascending") ? "d" : "a"));
|
||||
event.preventDefault();
|
||||
});
|
||||
};
|
||||
|
||||
return {
|
||||
init: init
|
||||
};
|
||||
}());
|
||||
|
||||
}(jQuery, H5AI));
|
@@ -1,120 +0,0 @@
|
||||
|
||||
(function ($, H5AI) {
|
||||
|
||||
H5AI.util = (function () {
|
||||
|
||||
var reSplitPath = /^\/([^\/]+\/?)$/,
|
||||
reSplitPath2 = /^(\/(?:.*\/)*?([^\/]+)\/)([^\/]+\/?)$/,
|
||||
splitPath = function (pathname) {
|
||||
|
||||
var match;
|
||||
|
||||
if (pathname === "/") {
|
||||
return {
|
||||
parent: null,
|
||||
parentname: null,
|
||||
name: "/"
|
||||
};
|
||||
}
|
||||
match = reSplitPath2.exec(pathname);
|
||||
if (match) {
|
||||
return {
|
||||
parent: match[1],
|
||||
parentname: match[2],
|
||||
name: match[3]
|
||||
};
|
||||
}
|
||||
match = reSplitPath.exec(pathname);
|
||||
if (match) {
|
||||
return {
|
||||
parent: "/",
|
||||
parentname: "/",
|
||||
name: match[1]
|
||||
};
|
||||
}
|
||||
},
|
||||
rePathEndsWithSlash = /\/$/,
|
||||
pathEndsWithSlash = function (pathname) {
|
||||
|
||||
return rePathEndsWithSlash.test(pathname);
|
||||
},
|
||||
getAbsHref = function (folder, tableRow) {
|
||||
|
||||
var $a, isParentFolder, href;
|
||||
|
||||
if (!pathEndsWithSlash(folder)) {
|
||||
folder += "/";
|
||||
}
|
||||
if (!tableRow) {
|
||||
return folder;
|
||||
}
|
||||
$a = $(tableRow).find("td").eq(1).find("a");
|
||||
isParentFolder = ($a.text() === "Parent Directory");
|
||||
href = $a.attr("href");
|
||||
return isParentFolder ? undefined : folder + href;
|
||||
},
|
||||
kilo = 1000.0,
|
||||
reParseSize = /^\s*([\.\d]+)\s*([kmg]?)b?\s*$/i,
|
||||
parseSize = function (str) {
|
||||
|
||||
var match = reParseSize.exec(str),
|
||||
val, unit;
|
||||
|
||||
if (!match) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
val = parseFloat(match[1]);
|
||||
unit = match[2].toLowerCase();
|
||||
if (unit === "k") {
|
||||
val *= kilo;
|
||||
} else if (unit === "m") {
|
||||
val *= kilo * kilo;
|
||||
} else if (unit === "g") {
|
||||
val *= kilo * kilo * kilo;
|
||||
} else if (unit === "t") {
|
||||
val *= kilo * kilo * kilo * kilo;
|
||||
}
|
||||
return val;
|
||||
},
|
||||
sizeUnits = ["B", "KB", "MB", "GB", "TB"],
|
||||
formatSize = function (size) {
|
||||
|
||||
var th = 1000.0,
|
||||
i = 0,
|
||||
maxI = sizeUnits.length - 1;
|
||||
|
||||
if (isNaN(size)) {
|
||||
return size;
|
||||
}
|
||||
|
||||
while (size >= th && i < maxI) {
|
||||
size /= kilo;
|
||||
i += 1;
|
||||
}
|
||||
return (i <= 1 ? Math.round(size) : size.toFixed(1)).toString() + " " + sizeUnits[i];
|
||||
},
|
||||
checkedDecodeUri = function (uri) {
|
||||
|
||||
try {
|
||||
return decodeURI(uri);
|
||||
} catch (err) {}
|
||||
return uri;
|
||||
},
|
||||
reEscape = function (sequence) {
|
||||
|
||||
return sequence.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
|
||||
};
|
||||
|
||||
return {
|
||||
splitPath: splitPath,
|
||||
pathEndsWithSlash: pathEndsWithSlash,
|
||||
getAbsHref: getAbsHref,
|
||||
parseSize: parseSize,
|
||||
formatSize: formatSize,
|
||||
checkedDecodeUri: checkedDecodeUri,
|
||||
reEscape: reEscape
|
||||
};
|
||||
}());
|
||||
|
||||
}(jQuery, H5AI));
|
@@ -1,191 +0,0 @@
|
||||
|
||||
(function ($, H5AI) {
|
||||
|
||||
H5AI.zippedDownload = (function () {
|
||||
|
||||
var x = 0,
|
||||
y = 0,
|
||||
$document = $(document),
|
||||
$selectionRect = $("#selection-rect"),
|
||||
selectedHrefsStr = "",
|
||||
$download, $img, $downloadAuth, $downloadUser, $downloadPassword,
|
||||
|
||||
updateDownloadBtn = function () {
|
||||
|
||||
var $selected = $("#extended a.selected"),
|
||||
$downloadBtn = $("#download");
|
||||
|
||||
selectedHrefsStr = "";
|
||||
if ($selected.length) {
|
||||
$selected.each(function () {
|
||||
|
||||
var href = $(this).attr("href");
|
||||
selectedHrefsStr = selectedHrefsStr ? selectedHrefsStr + ":" + href : href;
|
||||
});
|
||||
$downloadBtn.show();
|
||||
} else {
|
||||
$downloadBtn.hide();
|
||||
$downloadAuth.hide();
|
||||
}
|
||||
},
|
||||
selectionUpdate = function (event) {
|
||||
|
||||
var l = Math.min(x, event.pageX),
|
||||
t = Math.min(y, event.pageY),
|
||||
w = Math.abs(x - event.pageX),
|
||||
h = Math.abs(y - event.pageY),
|
||||
selRect;
|
||||
|
||||
event.preventDefault();
|
||||
$selectionRect.css({left: l, top: t, width: w, height: h});
|
||||
|
||||
selRect = $selectionRect.fracs("rect");
|
||||
$("#extended a").removeClass("selecting").each(function () {
|
||||
|
||||
var $a = $(this),
|
||||
rect = $a.fracs("rect"),
|
||||
inter = selRect.intersection(rect);
|
||||
if (inter && !$a.closest(".entry").hasClass("folder-parent")) {
|
||||
$a.addClass("selecting");
|
||||
}
|
||||
});
|
||||
},
|
||||
selectionEnd = function (event) {
|
||||
|
||||
event.preventDefault();
|
||||
$document.off("mousemove", selectionUpdate);
|
||||
$selectionRect.hide().css({left: 0, top: 0, width: 0, height: 0});
|
||||
$("#extended a.selecting.selected").removeClass("selecting").removeClass("selected");
|
||||
$("#extended a.selecting").removeClass("selecting").addClass("selected");
|
||||
updateDownloadBtn();
|
||||
},
|
||||
selectionStart = function (event) {
|
||||
|
||||
var view = $.fracs.viewport();
|
||||
|
||||
x = event.pageX;
|
||||
y = event.pageY;
|
||||
// only on left button and don't block the scrollbars
|
||||
if (event.button !== 0 || x >= view.right || y >= view.bottom) {
|
||||
return;
|
||||
}
|
||||
|
||||
event.preventDefault();
|
||||
$(':focus').blur();
|
||||
if (!event.ctrlKey) {
|
||||
$("#extended a").removeClass("selected");
|
||||
updateDownloadBtn();
|
||||
}
|
||||
$selectionRect.show().css({left: x, top: y, width: 0, height: 0});
|
||||
|
||||
$document
|
||||
.on("mousemove", selectionUpdate)
|
||||
.one("mouseup", selectionEnd);
|
||||
},
|
||||
noSelection = function (event) {
|
||||
|
||||
event.stopImmediatePropagation();
|
||||
return false;
|
||||
},
|
||||
noSelectionUnlessCtrl = function (event) {
|
||||
|
||||
if (!event.ctrlKey) {
|
||||
noSelection(event);
|
||||
}
|
||||
},
|
||||
failed = function () {
|
||||
|
||||
$download.addClass('failed');
|
||||
setTimeout(function () {
|
||||
$download.removeClass('failed');
|
||||
}, 1000);
|
||||
},
|
||||
handleResponse = function (response) {
|
||||
|
||||
|
||||
$download.removeClass('current');
|
||||
$img.attr('src', H5AI.core.image("download"));
|
||||
|
||||
if (response) {
|
||||
if (response.status === 'ok') {
|
||||
window.location = H5AI.core.api() + '?action=getzip&id=' + response.id;
|
||||
} else {
|
||||
if (response.code === 401) {
|
||||
$downloadAuth
|
||||
.css({
|
||||
left: $download.offset().left,
|
||||
top: $download.offset().top + $download.outerHeight()
|
||||
})
|
||||
.show();
|
||||
$downloadUser.focus();
|
||||
}
|
||||
failed();
|
||||
}
|
||||
} else {
|
||||
failed();
|
||||
}
|
||||
},
|
||||
requestZipping = function (hrefsStr) {
|
||||
|
||||
$download.addClass('current');
|
||||
$img.attr('src', H5AI.core.image("loading.gif", true));
|
||||
$.ajax({
|
||||
url: H5AI.core.api(),
|
||||
data: {
|
||||
action: 'zip',
|
||||
hrefs: selectedHrefsStr
|
||||
},
|
||||
type: 'POST',
|
||||
dataType: 'json',
|
||||
beforeSend: function (xhr) {
|
||||
|
||||
var user = $downloadUser.val(),
|
||||
password = $downloadPassword.val();
|
||||
|
||||
if (user) {
|
||||
xhr.setRequestHeader ('Authorization', 'Basic ' + Base64.encode(user + ':' + password));
|
||||
}
|
||||
},
|
||||
success: function (response) {
|
||||
|
||||
handleResponse(response);
|
||||
},
|
||||
failed: function () {
|
||||
|
||||
handleResponse();
|
||||
}
|
||||
});
|
||||
},
|
||||
init = function () {
|
||||
|
||||
if (H5AI.core.settings.zippedDownload) {
|
||||
$("<li id='download'><a href='#'><img alt='download' /><span class='l10n-download'>download</span></a></li>")
|
||||
.find("img").attr("src", H5AI.core.image("download")).end()
|
||||
.find("a").click(function (event) {
|
||||
|
||||
event.preventDefault();
|
||||
$downloadAuth.hide();
|
||||
requestZipping(selectedHrefsStr);
|
||||
}).end()
|
||||
.appendTo($("#navbar"));
|
||||
$("<div id='download-auth'><input id='download-auth-user' type='text' value='' placeholder='user' /><input id='download-auth-password' type='text' value='' placeholder='password' /></div>")
|
||||
.appendTo($("body"));
|
||||
|
||||
$download = $('#download');
|
||||
$downloadAuth = $('#download-auth');
|
||||
$downloadUser = $('#download-auth-user');
|
||||
$downloadPassword = $('#download-auth-password');
|
||||
$img = $download.find('img');
|
||||
|
||||
$("body>nav,body>footer,#tree,input").on("mousedown", noSelection);
|
||||
$("#content").on("mousedown", "a", noSelectionUnlessCtrl);
|
||||
$document.on("mousedown", selectionStart);
|
||||
}
|
||||
};
|
||||
|
||||
return {
|
||||
init: init
|
||||
};
|
||||
}());
|
||||
|
||||
}(jQuery, H5AI));
|
157
src/_h5ai/js/inc/core/ajax.js
Normal file
@@ -0,0 +1,157 @@
|
||||
|
||||
modulejs.define('core/ajax', ['$', 'amplify', 'base64', 'core/resource'], function ($, amplify, base64, resource) {
|
||||
|
||||
var reContentType = /^text\/html;h5ai=/,
|
||||
|
||||
getStatus = function (href, withContent, callback) {
|
||||
|
||||
$.ajax({
|
||||
url: href,
|
||||
type: withContent ? 'GET' : 'HEAD',
|
||||
complete: function (xhr) {
|
||||
|
||||
var res = {
|
||||
status: xhr.status,
|
||||
content: xhr.responseText
|
||||
};
|
||||
|
||||
if (xhr.status === 200 && reContentType.test(xhr.getResponseHeader('Content-Type'))) {
|
||||
res.status = 'h5ai';
|
||||
}
|
||||
|
||||
callback(res);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
getChecks = function (callback) {
|
||||
|
||||
$.ajax({
|
||||
url: resource.api(),
|
||||
data: {
|
||||
action: 'getchecks'
|
||||
},
|
||||
type: 'POST',
|
||||
dataType: 'json',
|
||||
success: function (json) {
|
||||
|
||||
callback(json);
|
||||
},
|
||||
error: function () {
|
||||
|
||||
callback();
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
getArchive = function (data, callback) {
|
||||
|
||||
$.ajax({
|
||||
url: resource.api(),
|
||||
data: {
|
||||
action: 'archive',
|
||||
execution: data.execution,
|
||||
format: data.format,
|
||||
hrefs: data.hrefs
|
||||
},
|
||||
type: 'POST',
|
||||
dataType: 'json',
|
||||
beforeSend: function (xhr) {
|
||||
|
||||
if (data.user) {
|
||||
xhr.setRequestHeader('Authorization', 'Basic ' + base64.encode(data.user + ':' + data.password));
|
||||
}
|
||||
},
|
||||
success: function (json) {
|
||||
|
||||
callback(json);
|
||||
},
|
||||
error: function () {
|
||||
|
||||
callback();
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
getThumbSrc = function (data, callback) {
|
||||
|
||||
$.ajax({
|
||||
url: resource.api(),
|
||||
data: {
|
||||
action: 'getthumbsrc',
|
||||
type: data.type,
|
||||
href: data.href,
|
||||
mode: data.mode,
|
||||
width: data.width,
|
||||
height: data.height
|
||||
},
|
||||
type: 'POST',
|
||||
dataType: 'json',
|
||||
success: function (json) {
|
||||
|
||||
if (json.code === 0) {
|
||||
callback(json.absHref);
|
||||
}
|
||||
callback();
|
||||
},
|
||||
error: function () {
|
||||
|
||||
callback();
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
getThumbSrcSmall = function (type, href, callback) {
|
||||
|
||||
getThumbSrc(
|
||||
{
|
||||
type: type,
|
||||
href: href,
|
||||
mode: 'square',
|
||||
width: 16,
|
||||
height: 16
|
||||
},
|
||||
callback
|
||||
);
|
||||
},
|
||||
|
||||
getThumbSrcBig = function (type, href, callback) {
|
||||
|
||||
getThumbSrc(
|
||||
{
|
||||
type: type,
|
||||
href: href,
|
||||
mode: 'rational',
|
||||
width: 100,
|
||||
height: 48
|
||||
},
|
||||
callback
|
||||
);
|
||||
},
|
||||
|
||||
getHtml = function (url, callback) {
|
||||
|
||||
$.ajax({
|
||||
url: url,
|
||||
dataType: 'html',
|
||||
success: function (html) {
|
||||
|
||||
callback(html);
|
||||
},
|
||||
error: function () {
|
||||
|
||||
callback();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
return {
|
||||
getStatus: getStatus,
|
||||
getChecks: getChecks,
|
||||
getArchive: getArchive,
|
||||
getThumbSrcSmall: getThumbSrcSmall,
|
||||
getThumbSrcBig: getThumbSrcBig,
|
||||
getHtml: getHtml
|
||||
};
|
||||
});
|
15
src/_h5ai/js/inc/core/entry.js
Normal file
@@ -0,0 +1,15 @@
|
||||
|
||||
modulejs.define('core/entry', ['$', 'core/parser', 'model/entry'], function ($, parser, Entry) {
|
||||
|
||||
var entry = Entry.get();
|
||||
|
||||
parser.parse(entry.absHref, $('body'));
|
||||
$('#data-apache-autoindex').remove();
|
||||
|
||||
entry.status = 'h5ai';
|
||||
if (entry.parent) {
|
||||
entry.parent.isParentFolder = true;
|
||||
}
|
||||
|
||||
return entry;
|
||||
});
|
25
src/_h5ai/js/inc/core/event.js
Normal file
@@ -0,0 +1,25 @@
|
||||
|
||||
modulejs.define('core/event', ['amplify'], function (amplify) {
|
||||
|
||||
var sub = function (topic, callback) {
|
||||
|
||||
amplify.subscribe(topic, callback);
|
||||
},
|
||||
|
||||
unsub = function (topic, callback) {
|
||||
|
||||
amplify.unsubscribe(topic, callback);
|
||||
},
|
||||
|
||||
pub = function (topic, data) {
|
||||
|
||||
// console.log('EVENT PUB', topic, data);
|
||||
amplify.publish(topic, data);
|
||||
};
|
||||
|
||||
return {
|
||||
sub: sub,
|
||||
unsub: unsub,
|
||||
pub: pub
|
||||
};
|
||||
});
|
80
src/_h5ai/js/inc/core/format.js
Normal file
@@ -0,0 +1,80 @@
|
||||
|
||||
modulejs.define('core/format', ['_', 'moment'], function (_, moment) {
|
||||
|
||||
var reParseSize = /^\s*([\.\d]+)\s*([kmgt]?)b?\s*$/i,
|
||||
treshhold = 1000.0,
|
||||
kilo = 1000.0,
|
||||
sizeUnits = ['B', 'KB', 'MB', 'GB', 'TB'],
|
||||
|
||||
parseSize = function (str) {
|
||||
|
||||
var match = reParseSize.exec(str),
|
||||
val, unit;
|
||||
|
||||
if (!match) {
|
||||
return null;
|
||||
}
|
||||
|
||||
val = parseFloat(match[1]);
|
||||
unit = match[2].toLowerCase();
|
||||
if (unit === 'k') {
|
||||
val *= kilo;
|
||||
} else if (unit === 'm') {
|
||||
val *= kilo * kilo;
|
||||
} else if (unit === 'g') {
|
||||
val *= kilo * kilo * kilo;
|
||||
} else if (unit === 't') {
|
||||
val *= kilo * kilo * kilo * kilo;
|
||||
}
|
||||
return val;
|
||||
},
|
||||
|
||||
formatSize = function (size) {
|
||||
|
||||
if (!_.isNumber(size) || size < 0) {
|
||||
return '';
|
||||
}
|
||||
|
||||
var i = 0,
|
||||
maxI = sizeUnits.length - 1;
|
||||
|
||||
while (size >= treshhold && i < maxI) {
|
||||
size /= kilo;
|
||||
i += 1;
|
||||
}
|
||||
return (i <= 1 ? Math.round(size) : size.toFixed(1)).toString() + ' ' + sizeUnits[i];
|
||||
},
|
||||
|
||||
defaultDateFormat = 'YYYY-MM-DD HH:mm',
|
||||
|
||||
setDefaultDateFormat = function (dateFormat) {
|
||||
|
||||
defaultDateFormat = dateFormat;
|
||||
},
|
||||
|
||||
parseDate = function (str, dateFormat) {
|
||||
|
||||
try { // problems with ie < 9 :(
|
||||
return moment(str, dateFormat || defaultDateFormat).valueOf() || null;
|
||||
} catch (err) {}
|
||||
|
||||
return Date.parse(str).valueOf() || null;
|
||||
},
|
||||
|
||||
formatDate = function (millis, dateFormat) {
|
||||
|
||||
if (!_.isNumber(millis) || !millis) {
|
||||
return '';
|
||||
}
|
||||
|
||||
return moment(millis).format(dateFormat || defaultDateFormat);
|
||||
};
|
||||
|
||||
return {
|
||||
parseSize: parseSize,
|
||||
formatSize: formatSize,
|
||||
setDefaultDateFormat: setDefaultDateFormat,
|
||||
parseDate: parseDate,
|
||||
formatDate: formatDate
|
||||
};
|
||||
});
|
34
src/_h5ai/js/inc/core/langs.js
Normal file
@@ -0,0 +1,34 @@
|
||||
|
||||
modulejs.define('core/langs', ['config', '_'], function (config, _) {
|
||||
|
||||
var defaults = {
|
||||
lang: 'unknown',
|
||||
details: 'details',
|
||||
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'
|
||||
},
|
||||
|
||||
translations = {},
|
||||
|
||||
parse = function (langs) {
|
||||
|
||||
_.each(langs, function (trans, lang) {
|
||||
|
||||
translations[lang] = _.extend({}, defaults, trans);
|
||||
});
|
||||
};
|
||||
|
||||
parse(_.extend({}, config.langs));
|
||||
|
||||
return translations;
|
||||
});
|
22
src/_h5ai/js/inc/core/parser.js
Normal file
@@ -0,0 +1,22 @@
|
||||
|
||||
modulejs.define('core/parser', ['$'], function ($) {
|
||||
|
||||
if ($('#data-apache-autoindex').length) {
|
||||
return modulejs.require('parser/apache-autoindex');
|
||||
}
|
||||
if ($('#data-generic-json').length) {
|
||||
return modulejs.require('parser/generic-json');
|
||||
}
|
||||
|
||||
return {
|
||||
id: 'none',
|
||||
mode: null,
|
||||
server: {
|
||||
name: null,
|
||||
version: null
|
||||
},
|
||||
parse: function () {
|
||||
return [];
|
||||
}
|
||||
};
|
||||
});
|
22
src/_h5ai/js/inc/core/resource.js
Normal file
@@ -0,0 +1,22 @@
|
||||
|
||||
modulejs.define('core/resource', ['core/settings'], function (settings) {
|
||||
|
||||
var api = function () {
|
||||
|
||||
return settings.h5aiAbsHref + 'php/api.php';
|
||||
},
|
||||
image = function (id, noPngExt) {
|
||||
|
||||
return settings.h5aiAbsHref + 'images/' + id + (noPngExt ? '' : '.png');
|
||||
},
|
||||
icon = function (id, big) {
|
||||
|
||||
return settings.h5aiAbsHref + 'icons/' + (big ? '48x48' : '16x16') + '/' + id + '.png';
|
||||
};
|
||||
|
||||
return {
|
||||
api: api,
|
||||
image: image,
|
||||
icon: icon
|
||||
};
|
||||
});
|
12
src/_h5ai/js/inc/core/settings.js
Normal file
@@ -0,0 +1,12 @@
|
||||
|
||||
modulejs.define('core/settings', ['config', '_'], function (config, _) {
|
||||
|
||||
var defaults = {
|
||||
rootAbsHref: '/',
|
||||
h5aiAbsHref: '/_h5ai/',
|
||||
server: 'unknown',
|
||||
mode: 'unknown'
|
||||
};
|
||||
|
||||
return _.extend({}, defaults, config.options);
|
||||
});
|
18
src/_h5ai/js/inc/core/store.js
Normal file
@@ -0,0 +1,18 @@
|
||||
|
||||
modulejs.define('core/store', ['amplify'], function (amplify) {
|
||||
|
||||
var put = function (key, value) {
|
||||
|
||||
amplify.store(key, value);
|
||||
},
|
||||
|
||||
get = function (key) {
|
||||
|
||||
return amplify.store(key);
|
||||
};
|
||||
|
||||
return {
|
||||
put: put,
|
||||
get: get
|
||||
};
|
||||
});
|
48
src/_h5ai/js/inc/core/types.js
Normal file
@@ -0,0 +1,48 @@
|
||||
|
||||
modulejs.define('core/types', ['config', '_'], function (config, _) {
|
||||
|
||||
var reEndsWithSlash = /\/$/,
|
||||
reStartsWithDot = /^\./,
|
||||
|
||||
fileExts = {},
|
||||
fileNames = {},
|
||||
|
||||
parse = function (types) {
|
||||
|
||||
_.each(types, function (matches, type) {
|
||||
|
||||
_.each(matches, function (match) {
|
||||
|
||||
match = match.toLowerCase();
|
||||
|
||||
if (reStartsWithDot.test(match)) {
|
||||
fileExts[match] = type;
|
||||
} else {
|
||||
fileNames[match] = type;
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
getType = function (sequence) {
|
||||
|
||||
if (reEndsWithSlash.test(sequence)) {
|
||||
return 'folder';
|
||||
}
|
||||
|
||||
sequence = sequence.toLowerCase();
|
||||
|
||||
var slashidx = sequence.lastIndexOf('/'),
|
||||
name = slashidx >= 0 ? sequence.substr(slashidx + 1) : sequence,
|
||||
dotidx = sequence.lastIndexOf('.'),
|
||||
ext = dotidx >= 0 ? sequence.substr(dotidx) : sequence;
|
||||
|
||||
return fileNames[name] || fileExts[ext] || 'unknown';
|
||||
};
|
||||
|
||||
parse(_.extend({}, config.types));
|
||||
|
||||
return {
|
||||
getType: getType
|
||||
};
|
||||
});
|
84
src/_h5ai/js/inc/ext/crumb.js
Normal file
@@ -0,0 +1,84 @@
|
||||
|
||||
modulejs.define('ext/crumb', ['_', '$', 'core/settings', 'core/resource', 'core/entry'], function (_, $, allsettings, resource, entry) {
|
||||
|
||||
var defaults = {
|
||||
enabled: false
|
||||
},
|
||||
|
||||
settings = _.extend({}, defaults, allsettings.crumb),
|
||||
|
||||
template = '<li class="crumb">' +
|
||||
'<a>' +
|
||||
'<img src="' + resource.image('crumb') + '" alt=">" />' +
|
||||
'<span />' +
|
||||
'</a>' +
|
||||
'</li>',
|
||||
pageHintTemplate = '<img class="hint" src="' + resource.image('page') + '" alt="has index page" />',
|
||||
statusHintTemplate = '<span class="hint"></span>',
|
||||
|
||||
// updates the crumb for this single entry
|
||||
update = function (entry) {
|
||||
|
||||
if (entry.$crumb && entry.$crumb.data('status') === entry.status) {
|
||||
return entry.$crumb;
|
||||
}
|
||||
|
||||
var $html = $(template),
|
||||
$a = $html.find('a');
|
||||
|
||||
$html
|
||||
.addClass(entry.isFolder() ? 'folder' : 'file')
|
||||
.data('status', entry.status);
|
||||
|
||||
$a
|
||||
.attr('href', entry.absHref)
|
||||
.find('span').text(entry.label).end();
|
||||
|
||||
if (entry.isDomain()) {
|
||||
$html.addClass('domain');
|
||||
$a.find('img').attr('src', resource.image('home'));
|
||||
}
|
||||
|
||||
if (entry.isCurrentFolder()) {
|
||||
$html.addClass('current');
|
||||
}
|
||||
|
||||
if (_.isNumber(entry.status)) {
|
||||
if (entry.status === 200) {
|
||||
$a.append($(pageHintTemplate));
|
||||
} else {
|
||||
$a.append($(statusHintTemplate).text('(' + entry.status + ')'));
|
||||
}
|
||||
}
|
||||
|
||||
if (entry.$crumb) {
|
||||
entry.$crumb.replaceWith($html);
|
||||
}
|
||||
entry.$crumb = $html;
|
||||
|
||||
return $html;
|
||||
},
|
||||
|
||||
// creates the complete crumb from entry down to the root
|
||||
init = function (entry) {
|
||||
|
||||
if (!settings.enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
var crumb = entry.getCrumb(),
|
||||
$ul = $('#navbar');
|
||||
|
||||
_.each(crumb, function (e) {
|
||||
|
||||
$ul.append(update(e));
|
||||
|
||||
e.fetchStatus(function (e) {
|
||||
|
||||
update(e);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
init(entry);
|
||||
});
|
38
src/_h5ai/js/inc/ext/custom.js
Normal file
@@ -0,0 +1,38 @@
|
||||
|
||||
modulejs.define('ext/custom', ['_', '$', 'core/settings', 'core/ajax'], function (_, $, allsettings, ajax) {
|
||||
|
||||
var defaults = {
|
||||
enabled: false,
|
||||
header: '_h5ai.header.html',
|
||||
footer: '_h5ai.footer.html'
|
||||
},
|
||||
|
||||
settings = _.extend({}, defaults, allsettings.custom),
|
||||
|
||||
init = function () {
|
||||
|
||||
if (!settings.enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (_.isString(settings.header)) {
|
||||
ajax.getHtml(settings.header, function (html) {
|
||||
|
||||
if (html) {
|
||||
$('<div id="content-header">' + html + '</div>').prependTo('#content');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (_.isString(settings.footer)) {
|
||||
ajax.getHtml(settings.footer, function (html) {
|
||||
|
||||
if (html) {
|
||||
$('<div id="content-footer">' + html + '</div>').appendTo('#content');
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
init();
|
||||
});
|
116
src/_h5ai/js/inc/ext/download.js
Normal file
@@ -0,0 +1,116 @@
|
||||
|
||||
modulejs.define('ext/download', ['_', '$', 'core/settings', 'core/resource', 'core/event', 'core/ajax'], function (_, $, allsettings, resource, event, ajax) {
|
||||
|
||||
var defaults = {
|
||||
enabled: false,
|
||||
execution: 'php',
|
||||
format: 'zip'
|
||||
},
|
||||
|
||||
settings = _.extend({}, defaults, allsettings.download),
|
||||
|
||||
// formats = ['tar', 'zip'],
|
||||
|
||||
downloadBtnTemplate = '<li id="download">' +
|
||||
'<a href="#">' +
|
||||
'<img src="' + resource.image('download') + '" alt="download" />' +
|
||||
'<span class="l10n-download">download</span>' +
|
||||
'</a>' +
|
||||
'</li>',
|
||||
authTemplate = '<div id="download-auth">' +
|
||||
'<input id="download-auth-user" type="text" value="" placeholder="user" />' +
|
||||
'<input id="download-auth-password" type="text" value="" placeholder="password" />' +
|
||||
'</div>',
|
||||
|
||||
selectedHrefsStr = '',
|
||||
$download, $img, $downloadAuth, $downloadUser, $downloadPassword,
|
||||
|
||||
failed = function () {
|
||||
|
||||
$download.addClass('failed');
|
||||
setTimeout(function () {
|
||||
$download.removeClass('failed');
|
||||
}, 1000);
|
||||
},
|
||||
|
||||
handleResponse = function (json) {
|
||||
|
||||
$download.removeClass('current');
|
||||
$img.attr('src', resource.image('download'));
|
||||
|
||||
if (json) {
|
||||
if (json.code === 0) {
|
||||
setTimeout(function () { // wait here so the img above can be updated in time
|
||||
|
||||
window.location = resource.api() + '?action=getarchive&id=' + json.id + '&as=h5ai-selection.' + settings.format;
|
||||
}, 200);
|
||||
} else {
|
||||
if (json.code === 401) {
|
||||
$downloadAuth
|
||||
.css({
|
||||
left: $download.offset().left,
|
||||
top: $download.offset().top + $download.outerHeight()
|
||||
})
|
||||
.show();
|
||||
$downloadUser.focus();
|
||||
}
|
||||
failed();
|
||||
}
|
||||
} else {
|
||||
failed();
|
||||
}
|
||||
},
|
||||
|
||||
requestArchive = function (hrefsStr) {
|
||||
|
||||
$download.addClass('current');
|
||||
$img.attr('src', resource.image('loading.gif', true));
|
||||
ajax.getArchive({
|
||||
execution: settings.execution,
|
||||
format: settings.format,
|
||||
hrefs: hrefsStr,
|
||||
user: $downloadUser.val(),
|
||||
password: $downloadPassword.val()
|
||||
}, handleResponse);
|
||||
},
|
||||
|
||||
onSelection = function (entries) {
|
||||
|
||||
selectedHrefsStr = '';
|
||||
if (entries.length) {
|
||||
selectedHrefsStr = _.map(entries, function (entry) {
|
||||
|
||||
return entry.absHref;
|
||||
}).join(':');
|
||||
$download.appendTo('#navbar').show();
|
||||
} else {
|
||||
$download.hide();
|
||||
$downloadAuth.hide();
|
||||
}
|
||||
},
|
||||
|
||||
init = function () {
|
||||
|
||||
if (!settings.enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
$download = $(downloadBtnTemplate)
|
||||
.find('a').on('click', function (event) {
|
||||
|
||||
event.preventDefault();
|
||||
$downloadAuth.hide();
|
||||
requestArchive(selectedHrefsStr);
|
||||
}).end()
|
||||
.appendTo('#navbar');
|
||||
$img = $download.find('img');
|
||||
|
||||
$downloadAuth = $(authTemplate).appendTo('body');
|
||||
$downloadUser = $downloadAuth.find('#download-auth-user');
|
||||
$downloadPassword = $downloadAuth.find('#download-auth-password');
|
||||
|
||||
event.sub('selection', onSelection);
|
||||
};
|
||||
|
||||
init();
|
||||
});
|
127
src/_h5ai/js/inc/ext/filter.js
Normal file
@@ -0,0 +1,127 @@
|
||||
|
||||
modulejs.define('ext/filter', ['_', '$', 'core/settings', 'core/resource'], function (_, $, allsettings, resource) {
|
||||
|
||||
var defaults = {
|
||||
enabled: false
|
||||
},
|
||||
|
||||
settings = _.extend({}, defaults, allsettings.filter),
|
||||
|
||||
template = '<li id="filter">' +
|
||||
'<span class="element">' +
|
||||
'<img src="' + resource.image('filter') + '" alt="filter" />' +
|
||||
'<input type="text" value="" placeholder="filter" />' +
|
||||
'</span>' +
|
||||
'</li>',
|
||||
noMatchTemplate = '<div class="no-match l10n-noMatch">no match</div>',
|
||||
|
||||
$filter, $input, $noMatch,
|
||||
|
||||
filter = function (re) {
|
||||
|
||||
var match = [],
|
||||
noMatch = [],
|
||||
duration = 200;
|
||||
|
||||
if (re) {
|
||||
$('#extended .entry').each(function () {
|
||||
|
||||
var label = $(this).find('.label').text();
|
||||
|
||||
if (label.match(re)) {
|
||||
match.push(this);
|
||||
} else {
|
||||
noMatch.push(this);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
match = $('#extended .entry');
|
||||
}
|
||||
|
||||
if ($(match).length) {
|
||||
$noMatch.hide();
|
||||
} else {
|
||||
setTimeout(function () { $noMatch.show(); }, duration);
|
||||
}
|
||||
$(match).fadeIn(duration);
|
||||
$(noMatch).fadeOut(duration);
|
||||
},
|
||||
|
||||
checkState = function (focus) {
|
||||
|
||||
var val = $input.val();
|
||||
|
||||
if (val || focus) {
|
||||
$filter.addClass('current');
|
||||
} else {
|
||||
$filter.removeClass('current');
|
||||
}
|
||||
},
|
||||
|
||||
escapeRegExp = function (sequence) {
|
||||
|
||||
return sequence.replace(/[\-\[\]{}()*+?.,\\$\^|#\s]/g, '\\$&');
|
||||
},
|
||||
|
||||
parseFilterSequence = function (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 (char) {
|
||||
|
||||
return escapeRegExp(char);
|
||||
}).join('.*?');
|
||||
|
||||
// return escapeRegExp(part);
|
||||
}).join('|');
|
||||
|
||||
return new RegExp(sequence, 'i');
|
||||
},
|
||||
|
||||
update = function () {
|
||||
|
||||
var val = $input.val();
|
||||
|
||||
if (val) {
|
||||
filter(parseFilterSequence(val));
|
||||
} else {
|
||||
filter();
|
||||
}
|
||||
checkState($input.is(':focus'));
|
||||
},
|
||||
|
||||
init = function () {
|
||||
|
||||
if (!settings.enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
$filter = $(template);
|
||||
$input = $filter.find('input');
|
||||
$noMatch = $(noMatchTemplate).appendTo('#extended');
|
||||
|
||||
$filter
|
||||
.on('click', function () {
|
||||
|
||||
$input.focus();
|
||||
})
|
||||
.appendTo('#navbar');
|
||||
|
||||
$input
|
||||
.on('focus', function () {
|
||||
|
||||
checkState(true);
|
||||
})
|
||||
.on('blur', function () {
|
||||
|
||||
checkState(false);
|
||||
})
|
||||
.on('keyup', update);
|
||||
};
|
||||
|
||||
init();
|
||||
});
|
14
src/_h5ai/js/inc/ext/folderstatus.js
Normal file
@@ -0,0 +1,14 @@
|
||||
|
||||
modulejs.define('ext/folderstatus', ['_', 'core/settings'], function (_, allsettings) {
|
||||
|
||||
var defaults = {
|
||||
enabled: false,
|
||||
folders: {}
|
||||
},
|
||||
|
||||
settings = _.extend({}, defaults, allsettings.folderstatus),
|
||||
|
||||
folders = settings.enabled ? settings.folders : defaults.folders;
|
||||
|
||||
return folders;
|
||||
});
|
30
src/_h5ai/js/inc/ext/google-analytics.js
Normal file
@@ -0,0 +1,30 @@
|
||||
|
||||
modulejs.define('ext/google-analytics', ['_', 'core/settings'], function (_, allsettings) {
|
||||
|
||||
var defaults = {
|
||||
enabled: false,
|
||||
gaq: []
|
||||
},
|
||||
|
||||
settings = _.extend({}, defaults, allsettings['google-analytics']),
|
||||
|
||||
init = function () {
|
||||
|
||||
if (!settings.enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
window._gaq = settings.gaq;
|
||||
|
||||
var strScript = 'script',
|
||||
doc = document,
|
||||
newScriptTag = doc.createElement(strScript),
|
||||
firstScriptTag = doc.getElementsByTagName(strScript)[0];
|
||||
|
||||
newScriptTag.async = true;
|
||||
newScriptTag.src = ('https:' === location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
|
||||
firstScriptTag.parentNode.insertBefore(newScriptTag, firstScriptTag);
|
||||
};
|
||||
|
||||
init();
|
||||
});
|
124
src/_h5ai/js/inc/ext/l10n.js
Normal file
@@ -0,0 +1,124 @@
|
||||
|
||||
modulejs.define('ext/l10n', ['_', '$', 'core/settings', 'core/langs', 'core/format', 'core/store', 'core/event'], function (_, $, allsettings, langs, format, store, event) {
|
||||
|
||||
var defaults = {
|
||||
enabled: true,
|
||||
lang: 'en',
|
||||
useBrowserLang: true
|
||||
},
|
||||
|
||||
settings = _.extend({}, defaults, allsettings.l10n),
|
||||
|
||||
template = '<span id="langSelector">' +
|
||||
'<span class="lang">en</span> - <span class="l10n-lang">english</span>' +
|
||||
'<span class="langOptions"> <ul /> </span>' +
|
||||
'</span>',
|
||||
langOptionTemplate = '<li class="langOption" />',
|
||||
|
||||
storekey = 'h5ai.language',
|
||||
|
||||
currentLang = null,
|
||||
|
||||
localize = function (langs, lang, useBrowserLang) {
|
||||
|
||||
var storedLang = store.get(storekey);
|
||||
|
||||
if (langs[storedLang]) {
|
||||
lang = storedLang;
|
||||
} else if (useBrowserLang) {
|
||||
var browserLang = navigator.language || navigator.browserLanguage;
|
||||
if (browserLang) {
|
||||
if (langs[browserLang]) {
|
||||
lang = browserLang;
|
||||
} else if (browserLang.length > 2 && langs[browserLang.substr(0, 2)]) {
|
||||
lang = browserLang.substr(0, 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!langs[lang]) {
|
||||
lang = 'en';
|
||||
}
|
||||
|
||||
currentLang = langs[lang];
|
||||
if (currentLang) {
|
||||
$.each(currentLang, function (key, value) {
|
||||
$('.l10n-' + key).text(value);
|
||||
});
|
||||
$('.lang').text(lang);
|
||||
$('.langOption').removeClass('current');
|
||||
$('.langOption.' + lang).addClass('current');
|
||||
}
|
||||
|
||||
format.setDefaultDateFormat(currentLang.dateFormat);
|
||||
|
||||
$('#extended .entry .date').each(function () {
|
||||
|
||||
var $this = $(this);
|
||||
|
||||
$this.text(format.formatDate($this.data('time')));
|
||||
});
|
||||
|
||||
$('#filter input').attr('placeholder', currentLang.filter);
|
||||
},
|
||||
|
||||
initLangSelector = function (langs) {
|
||||
|
||||
var $langSelector = $(template).appendTo('#bottombar .right'),
|
||||
$langOptions = $langSelector.find('.langOptions'),
|
||||
$ul = $langOptions.find('ul'),
|
||||
sortedLangsKeys = [];
|
||||
|
||||
$.each(langs, function (lang) {
|
||||
sortedLangsKeys.push(lang);
|
||||
});
|
||||
sortedLangsKeys.sort();
|
||||
|
||||
$.each(sortedLangsKeys, function (idx, lang) {
|
||||
$(langOptionTemplate)
|
||||
.addClass(lang)
|
||||
.text(lang + ' - ' + langs[lang].lang)
|
||||
.appendTo($ul)
|
||||
.click(function () {
|
||||
store.put(storekey, lang);
|
||||
localize(langs, lang, false);
|
||||
});
|
||||
});
|
||||
$langOptions
|
||||
.append($ul)
|
||||
.scrollpanel();
|
||||
|
||||
$langSelector.hover(
|
||||
function () {
|
||||
$langOptions
|
||||
.css('top', '-' + $langOptions.outerHeight() + 'px')
|
||||
.stop(true, true)
|
||||
.fadeIn();
|
||||
|
||||
// needs to be updated twice for initial fade in rendering :/
|
||||
$langOptions.scrollpanel('update').scrollpanel('update');
|
||||
},
|
||||
function () {
|
||||
$langOptions
|
||||
.stop(true, true)
|
||||
.fadeOut();
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
init = function () {
|
||||
|
||||
if (!settings.enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
initLangSelector(langs);
|
||||
|
||||
event.sub('ready', function () {
|
||||
|
||||
localize(langs, settings.lang, settings.useBrowserLang);
|
||||
});
|
||||
};
|
||||
|
||||
init();
|
||||
});
|
44
src/_h5ai/js/inc/ext/link-hover-states.js
Normal file
@@ -0,0 +1,44 @@
|
||||
|
||||
modulejs.define('ext/link-hover-states', ['_', '$', 'core/settings'], function (_, $, allsettings) {
|
||||
|
||||
var defaults = {
|
||||
enabled: false
|
||||
},
|
||||
|
||||
settings = _.extend({}, defaults, allsettings['link-hover-states']),
|
||||
|
||||
selector = "a[href^='/']",
|
||||
|
||||
selectLinks = function (href) {
|
||||
|
||||
return $(_.filter($(selector), function (el) {
|
||||
|
||||
return $(el).attr('href') === href;
|
||||
}));
|
||||
},
|
||||
|
||||
onMouseEnter = function () {
|
||||
|
||||
var href = $(this).attr('href');
|
||||
|
||||
selectLinks(href).addClass('hover');
|
||||
},
|
||||
|
||||
onMouseLeave = function () {
|
||||
|
||||
var href = $(this).attr('href');
|
||||
|
||||
selectLinks(href).removeClass('hover');
|
||||
},
|
||||
|
||||
init = function () {
|
||||
|
||||
if (settings.enabled) {
|
||||
$('body')
|
||||
.on('mouseenter', selector, onMouseEnter)
|
||||
.on('mouseleave', selector, onMouseLeave);
|
||||
}
|
||||
};
|
||||
|
||||
init();
|
||||
});
|
35
src/_h5ai/js/inc/ext/mode.js
Normal file
@@ -0,0 +1,35 @@
|
||||
|
||||
modulejs.define('ext/mode', ['_', '$', 'core/settings', 'core/parser'], function (_, $, allsettings, parser) {
|
||||
|
||||
var defaults = {
|
||||
enabled: false,
|
||||
display: 0
|
||||
},
|
||||
|
||||
settings = _.extend({}, defaults, allsettings.mode),
|
||||
|
||||
init = function () {
|
||||
|
||||
if (!settings.enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
var info = '';
|
||||
|
||||
if (parser.mode) {
|
||||
info += parser.mode;
|
||||
}
|
||||
if (settings.display > 0 && parser.server.name) {
|
||||
info += (info ? ' on ' : '') + parser.server.name;
|
||||
}
|
||||
if (settings.display > 1 && parser.server.version) {
|
||||
info += (info ? '-' : '') + parser.server.version;
|
||||
}
|
||||
|
||||
if (info) {
|
||||
$('#h5ai-reference').append(' (' + info + ')');
|
||||
}
|
||||
};
|
||||
|
||||
init();
|
||||
});
|
284
src/_h5ai/js/inc/ext/preview-img.js
Normal file
@@ -0,0 +1,284 @@
|
||||
|
||||
modulejs.define('ext/preview-img', ['_', '$', 'core/settings', 'core/resource', 'core/store', 'core/entry'], function (_, $, allsettings, resource, store, entry) {
|
||||
|
||||
var defaults = {
|
||||
enabled: false,
|
||||
types: ['bmp', 'gif', 'ico', 'image', 'jpg', 'png', 'tiff']
|
||||
},
|
||||
|
||||
settings = _.extend({}, defaults, allsettings['preview-img']),
|
||||
|
||||
template = '<div id="pv-img-overlay" class="noSelection">' +
|
||||
'<div id="pv-img-content">' +
|
||||
'<img id="pv-img-image" />' +
|
||||
'</div>' +
|
||||
'<div id="pv-img-close" />' +
|
||||
'<div id="pv-img-prev" />' +
|
||||
'<div id="pv-img-next" />' +
|
||||
'<div id="pv-img-bottombar" class="clearfix">' +
|
||||
'<ul id="pv-img-buttons">' +
|
||||
'<li id="pv-img-bar-size" class="bar-left bar-label"></li>' +
|
||||
'<li id="pv-img-bar-percent" class="bar-left bar-label"></li>' +
|
||||
'<li id="pv-img-bar-label" class="bar-left bar-label"></li>' +
|
||||
'<li id="pv-img-bar-close" class="bar-right bar-button"><img src="' + resource.image('preview/close') + '" /></li>' +
|
||||
'<li id="pv-img-bar-original" class="bar-right"><a class="bar-button" target="_blank"><img src="' + resource.image('preview/raw') + '" /></a></li>' +
|
||||
'<li id="pv-img-bar-fullscreen" class="bar-right bar-button"><img src="' + resource.image('preview/fullscreen') + '" /></li>' +
|
||||
'<li id="pv-img-bar-next" class="bar-right bar-button"><img src="' + resource.image('preview/next') + '" /></li>' +
|
||||
'<li id="pv-img-bar-idx" class="bar-right bar-label"></li>' +
|
||||
'<li id="pv-img-bar-prev" class="bar-right bar-button"><img src="' + resource.image('preview/prev') + '" /></li>' +
|
||||
'</ul>' +
|
||||
'</div>' +
|
||||
'</div>',
|
||||
|
||||
storekey = 'h5ai.preview-img.isFullscreen',
|
||||
|
||||
currentEntries = [],
|
||||
currentIdx = 0,
|
||||
isFullscreen = store.get(storekey) || false,
|
||||
|
||||
adjustSize = function () {
|
||||
|
||||
var rect = $(window).fracs('viewport'),
|
||||
$container = $('#pv-img-content'),
|
||||
$img = $('#pv-img-image'),
|
||||
margin = isFullscreen ? 0 : 20,
|
||||
barheight = isFullscreen ? 0 : 31;
|
||||
|
||||
$container.css({
|
||||
width: rect.width - 2 * margin,
|
||||
height: rect.height - 2 * margin - barheight,
|
||||
left: margin,
|
||||
top: margin
|
||||
});
|
||||
|
||||
var lr = ($container.width() - $img.width()) / 2,
|
||||
tb = ($container.height() - $img.height()) / 2;
|
||||
|
||||
$img.css({
|
||||
margin: '' + tb + 'px ' + lr + 'px'
|
||||
});
|
||||
|
||||
rect = $img.fracs('rect');
|
||||
if (!rect) {
|
||||
return;
|
||||
}
|
||||
rect = rect.relativeTo($('#pv-img-overlay').fracs('rect'));
|
||||
|
||||
$('#pv-img-prev').css({
|
||||
left: rect.left,
|
||||
top: rect.top,
|
||||
width: rect.width / 2,
|
||||
height: rect.height
|
||||
});
|
||||
$('#pv-img-next').css({
|
||||
left: rect.left + rect.width / 2,
|
||||
top: rect.top,
|
||||
width: rect.width / 2,
|
||||
height: rect.height
|
||||
});
|
||||
|
||||
if (isFullscreen) {
|
||||
$('#pv-img-overlay').addClass('fullscreen');
|
||||
$('#pv-img-bar-fullscreen').find('img').attr('src', resource.image('preview/no-fullscreen'));
|
||||
$('#pv-img-bottombar').fadeOut(400);
|
||||
} else {
|
||||
$('#pv-img-overlay').removeClass('fullscreen');
|
||||
$('#pv-img-bar-fullscreen').find('img').attr('src', resource.image('preview/fullscreen'));
|
||||
$('#pv-img-bottombar').fadeIn(200);
|
||||
}
|
||||
},
|
||||
|
||||
preloadImg = function (src, callback) {
|
||||
|
||||
var $hidden = $('<div><img/></div>')
|
||||
.css({
|
||||
position: 'absolute',
|
||||
overflow: 'hidden',
|
||||
width: 0,
|
||||
height: 0
|
||||
})
|
||||
.appendTo('body'),
|
||||
$img = $hidden.find('img')
|
||||
.one('load', function () {
|
||||
|
||||
var width = $img.width(),
|
||||
height = $img.height();
|
||||
|
||||
$hidden.remove();
|
||||
|
||||
callback(width, height);
|
||||
// setTimeout(function () { callback(width, height); }, 1000); // for testing
|
||||
})
|
||||
.attr('src', src);
|
||||
},
|
||||
|
||||
onIndexChange = function (idx) {
|
||||
|
||||
currentIdx = (idx + currentEntries.length) % currentEntries.length;
|
||||
|
||||
var $container = $('#pv-img-content'),
|
||||
$img = $('#pv-img-image'),
|
||||
src = currentEntries[currentIdx].absHref,
|
||||
spinnerTimeout = setTimeout(function () {
|
||||
|
||||
$container.spin({
|
||||
length: 12,
|
||||
width: 4,
|
||||
radius: 24,
|
||||
color: '#ccc',
|
||||
shadow: true
|
||||
});
|
||||
}, 200);
|
||||
|
||||
preloadImg(src, function (width, height) {
|
||||
|
||||
clearTimeout(spinnerTimeout);
|
||||
$container.spin(false);
|
||||
|
||||
$img.fadeOut(100, function () {
|
||||
|
||||
$img.attr('src', src).fadeIn(200);
|
||||
|
||||
// small timeout, so $img is visible and therefor $img.width is available
|
||||
setTimeout(function () {
|
||||
adjustSize();
|
||||
$('#pv-img-bar-percent').text('' + (100 * $img.width() / width).toFixed(0) + '%');
|
||||
$('#pv-img-bar-label').text(currentEntries[currentIdx].label);
|
||||
$('#pv-img-bar-size').text('' + width + 'x' + height);
|
||||
$('#pv-img-bar-idx').text('' + (currentIdx + 1) + ' / ' + currentEntries.length);
|
||||
$('#pv-img-bar-original').find('a').attr('href', currentEntries[currentIdx].absHref);
|
||||
}, 1);
|
||||
});
|
||||
|
||||
});
|
||||
},
|
||||
|
||||
onEnter = function (entries, idx) {
|
||||
|
||||
$(window).on('keydown', onKeydown);
|
||||
$('#pv-img-overlay').stop(true, true).fadeIn(200);
|
||||
|
||||
currentEntries = entries;
|
||||
onIndexChange(idx);
|
||||
},
|
||||
|
||||
onNext = function () {
|
||||
|
||||
onIndexChange(currentIdx + 1);
|
||||
},
|
||||
|
||||
onPrevious = function () {
|
||||
|
||||
onIndexChange(currentIdx - 1);
|
||||
},
|
||||
|
||||
onExit = function () {
|
||||
|
||||
$(window).off('keydown', onKeydown);
|
||||
$('#pv-img-overlay').stop(true, true).fadeOut(200);
|
||||
},
|
||||
|
||||
onFullscreen = function () {
|
||||
|
||||
isFullscreen = !isFullscreen;
|
||||
store.put(storekey, isFullscreen);
|
||||
|
||||
adjustSize();
|
||||
},
|
||||
|
||||
onKeydown = function (event) {
|
||||
|
||||
var key = event.which;
|
||||
|
||||
if (key === 27) { // esc
|
||||
onExit();
|
||||
} else if (key === 8 || key === 37 || key === 40) { // backspace, left, down
|
||||
onPrevious();
|
||||
} else if (key === 13 || key === 32 || key === 38 || key === 39) { // enter, space, up, right
|
||||
onNext();
|
||||
} else if (key === 70) { // f
|
||||
onFullscreen();
|
||||
}
|
||||
},
|
||||
|
||||
initEntry = function (entries, entry, idx) {
|
||||
|
||||
if (entry.$extended) {
|
||||
entry.$extended.find('a').on('click', function (event) {
|
||||
|
||||
event.preventDefault();
|
||||
onEnter(entries, idx);
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
init = function (entry) {
|
||||
|
||||
if (!settings.enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
var imageEntries = _.filter(entry.content, function (entry) {
|
||||
|
||||
return _.indexOf(settings.types, entry.type) >= 0;
|
||||
});
|
||||
_.each(imageEntries, function (e, idx) {
|
||||
|
||||
initEntry(imageEntries, e, idx);
|
||||
});
|
||||
|
||||
$(template).appendTo('body');
|
||||
$('#pv-img-bar-prev, #pv-img-prev').on('click', onPrevious);
|
||||
$('#pv-img-bar-next, #pv-img-next').on('click', onNext);
|
||||
$('#pv-img-bar-close, #pv-img-close').on('click', onExit);
|
||||
$('#pv-img-bar-fullscreen').on('click', onFullscreen);
|
||||
$('#pv-img-overlay').on('keydown', onKeydown);
|
||||
|
||||
$('#pv-img-prev')
|
||||
.on('mouseenter', function () {
|
||||
$('#pv-img-bar-prev').addClass('hover');
|
||||
})
|
||||
.on('mouseleave', function () {
|
||||
$('#pv-img-bar-prev').removeClass('hover');
|
||||
});
|
||||
|
||||
$('#pv-img-next')
|
||||
.on('mouseenter', function () {
|
||||
$('#pv-img-bar-next').addClass('hover');
|
||||
})
|
||||
.on('mouseleave', function () {
|
||||
$('#pv-img-bar-next').removeClass('hover');
|
||||
});
|
||||
|
||||
$('#pv-img-close')
|
||||
.on('mouseenter', function () {
|
||||
$('#pv-img-bar-close').addClass('hover');
|
||||
})
|
||||
.on('mouseleave', function () {
|
||||
$('#pv-img-bar-close').removeClass('hover');
|
||||
});
|
||||
|
||||
|
||||
$('#pv-img-overlay')
|
||||
.on('click mousedown mousemove keydown keypress', function (event) {
|
||||
|
||||
event.stopPropagation();
|
||||
})
|
||||
.on('mousemove', function (event) {
|
||||
|
||||
if (isFullscreen) {
|
||||
var rect = $('#pv-img-overlay').fracs('rect');
|
||||
|
||||
if (rect.bottom - event.pageY < 64) {
|
||||
$('#pv-img-bottombar').fadeIn(200);
|
||||
} else {
|
||||
$('#pv-img-bottombar').fadeOut(400);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$(window).on('resize load', adjustSize);
|
||||
};
|
||||
|
||||
init(entry);
|
||||
});
|
261
src/_h5ai/js/inc/ext/preview-txt.js
Normal file
@@ -0,0 +1,261 @@
|
||||
|
||||
modulejs.define('ext/preview-txt', ['_', '$', 'core/settings', 'core/resource', 'core/store', 'core/entry'], function (_, $, allsettings, resource, store, entry) {
|
||||
|
||||
var defaults = {
|
||||
enabled: false,
|
||||
types: {
|
||||
authors: 'plain',
|
||||
copying: 'plain',
|
||||
c: 'c',
|
||||
cpp: 'cpp',
|
||||
css: 'css',
|
||||
h: 'c',
|
||||
hpp: 'cpp',
|
||||
install: 'plain',
|
||||
log: 'plain',
|
||||
java: 'java',
|
||||
makefile: 'xml',
|
||||
markdown: 'plain',
|
||||
php: 'php',
|
||||
python: 'python',
|
||||
readme: 'plain',
|
||||
rb: 'ruby',
|
||||
rtf: 'plain',
|
||||
script: 'shell',
|
||||
text: 'plain',
|
||||
js: 'js',
|
||||
xml: 'xml'
|
||||
}
|
||||
},
|
||||
|
||||
settings = _.extend({}, defaults, allsettings['preview-txt']),
|
||||
|
||||
template = '<div id="pv-txt-overlay" class="noSelection">' +
|
||||
'<div id="pv-txt-close" />' +
|
||||
'<div id="pv-txt-content">' +
|
||||
'<div id="pv-txt-text" />' +
|
||||
'</div>' +
|
||||
'<div id="pv-txt-bottombar" class="clearfix">' +
|
||||
'<ul id="pv-txt-buttons">' +
|
||||
'<li id="pv-txt-bar-size" class="bar-left bar-label"></li>' +
|
||||
'<li id="pv-txt-bar-label" class="bar-left bar-label"></li>' +
|
||||
'<li id="pv-txt-bar-close" class="bar-right bar-button"><img src="' + resource.image('preview/close') + '" /></li>' +
|
||||
'<li id="pv-txt-bar-original" class="bar-right"><a class="bar-button" target="_blank"><img src="' + resource.image('preview/raw') + '" /></a></li>' +
|
||||
'<li id="pv-txt-bar-next" class="bar-right bar-button"><img src="' + resource.image('preview/next') + '" /></li>' +
|
||||
'<li id="pv-txt-bar-idx" class="bar-right bar-label"></li>' +
|
||||
'<li id="pv-txt-bar-prev" class="bar-right bar-button"><img src="' + resource.image('preview/prev') + '" /></li>' +
|
||||
'</ul>' +
|
||||
'</div>' +
|
||||
'</div>',
|
||||
|
||||
templateText = '<pre id="pv-txt-text" />',
|
||||
templateMarkdown = '<div id="pv-txt-text" class="markdown" />',
|
||||
|
||||
currentEntries = [],
|
||||
currentIdx = 0,
|
||||
|
||||
loadScript = function (url, globalId, callback) {
|
||||
|
||||
if (window[globalId]) {
|
||||
callback(window[globalId]);
|
||||
} else {
|
||||
$.ajax({
|
||||
url: url,
|
||||
dataType: 'script',
|
||||
complete: function () {
|
||||
|
||||
callback(window[globalId]);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
loadSyntaxhighlighter = function (callback) {
|
||||
|
||||
loadScript(allsettings.h5aiAbsHref + 'js/syntaxhighlighter.js', 'SyntaxHighlighter', callback);
|
||||
},
|
||||
loadMarkdown = function (callback) {
|
||||
|
||||
loadScript(allsettings.h5aiAbsHref + 'js/markdown.js', 'markdown', callback);
|
||||
},
|
||||
|
||||
adjustSize = function () {
|
||||
|
||||
var rect = $(window).fracs('viewport'),
|
||||
$container = $('#pv-txt-content'),
|
||||
margin = 20,
|
||||
barheight = 31;
|
||||
|
||||
$container.css({
|
||||
// width: rect.width - 2 * margin,
|
||||
height: rect.height - 2 * margin - barheight - 32,
|
||||
// left: margin,
|
||||
top: margin
|
||||
});
|
||||
},
|
||||
|
||||
preloadText = function (absHref, callback) {
|
||||
|
||||
$.ajax({
|
||||
url: absHref,
|
||||
dataType: 'text',
|
||||
success: function (content) {
|
||||
|
||||
callback(content);
|
||||
// setTimeout(function () { callback(content); }, 1000); // for testing
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
|
||||
callback('[ajax error] ' + textStatus);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
onIndexChange = function (idx) {
|
||||
|
||||
currentIdx = (idx + currentEntries.length) % currentEntries.length;
|
||||
|
||||
var $container = $('#pv-txt-content'),
|
||||
$text = $('#pv-txt-text'),
|
||||
current = currentEntries[currentIdx],
|
||||
spinnerTimeout = setTimeout(function () {
|
||||
|
||||
$container.spin({
|
||||
length: 12,
|
||||
width: 4,
|
||||
radius: 24,
|
||||
color: '#ccc',
|
||||
shadow: true
|
||||
});
|
||||
}, 200);
|
||||
|
||||
preloadText(current.absHref, function (content) {
|
||||
|
||||
clearTimeout(spinnerTimeout);
|
||||
$container.spin(false);
|
||||
|
||||
$text.fadeOut(100, function () {
|
||||
|
||||
var $nText;
|
||||
|
||||
if (current.type === 'markdown') {
|
||||
$nText = $(templateMarkdown).hide();
|
||||
$text.replaceWith($nText);
|
||||
|
||||
loadMarkdown(function (md) {
|
||||
|
||||
if (md) {
|
||||
$nText.html(md.toHTML(content));
|
||||
}
|
||||
});
|
||||
} else {
|
||||
$nText = $(templateText).hide().addClass('toolbar: false; brush:').addClass(settings.types[current.type] || 'plain').text(content);
|
||||
$text.replaceWith($nText);
|
||||
|
||||
loadSyntaxhighlighter(function (sh) {
|
||||
|
||||
if (sh) {
|
||||
sh.highlight({}, $nText[0]);
|
||||
}
|
||||
});
|
||||
}
|
||||
$nText.fadeIn(200);
|
||||
|
||||
adjustSize();
|
||||
$('#pv-txt-bar-label').text(current.label);
|
||||
$('#pv-txt-bar-size').text('' + current.size + ' bytes');
|
||||
$('#pv-txt-bar-idx').text('' + (currentIdx + 1) + ' / ' + currentEntries.length);
|
||||
$('#pv-txt-bar-original').find('a').attr('href', current.absHref);
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
onEnter = function (entries, idx) {
|
||||
|
||||
$(window).on('keydown', onKeydown);
|
||||
$('#pv-txt-overlay').stop(true, true).fadeIn(200);
|
||||
|
||||
currentEntries = entries;
|
||||
onIndexChange(idx);
|
||||
},
|
||||
|
||||
onNext = function () {
|
||||
|
||||
onIndexChange(currentIdx + 1);
|
||||
},
|
||||
|
||||
onPrevious = function () {
|
||||
|
||||
onIndexChange(currentIdx - 1);
|
||||
},
|
||||
|
||||
onExit = function () {
|
||||
|
||||
$(window).off('keydown', onKeydown);
|
||||
$('#pv-txt-overlay').stop(true, true).fadeOut(200);
|
||||
},
|
||||
|
||||
onKeydown = function (event) {
|
||||
|
||||
var key = event.which;
|
||||
|
||||
if (key === 27) { // esc
|
||||
onExit();
|
||||
} else if (key === 8 || key === 37 || key === 40) { // backspace, left, down
|
||||
onPrevious();
|
||||
} else if (key === 13 || key === 32 || key === 38 || key === 39) { // enter, space, up, right
|
||||
onNext();
|
||||
}
|
||||
},
|
||||
|
||||
initEntry = function (entries, entry, idx) {
|
||||
|
||||
if (entry.$extended) {
|
||||
entry.$extended.find('a').on('click', function (event) {
|
||||
|
||||
event.preventDefault();
|
||||
onEnter(entries, idx);
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
init = function (entry) {
|
||||
|
||||
if (!settings.enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
var imageEntries = _.filter(entry.content, function (entry) {
|
||||
|
||||
return _.indexOf(_.keys(settings.types), entry.type) >= 0;
|
||||
});
|
||||
_.each(imageEntries, function (e, idx) {
|
||||
|
||||
initEntry(imageEntries, e, idx);
|
||||
});
|
||||
|
||||
$(template).appendTo('body');
|
||||
$('#pv-txt-bar-prev').on('click', onPrevious);
|
||||
$('#pv-txt-bar-next').on('click', onNext);
|
||||
$('#pv-txt-bar-close, #pv-txt-close').on('click', onExit);
|
||||
$('#pv-txt-overlay').on('keydown', onKeydown);
|
||||
|
||||
$('#pv-txt-close')
|
||||
.on('mouseenter', function () {
|
||||
$('#pv-txt-bar-close').addClass('hover');
|
||||
})
|
||||
.on('mouseleave', function () {
|
||||
$('#pv-txt-bar-close').removeClass('hover');
|
||||
});
|
||||
|
||||
|
||||
$('#pv-txt-overlay')
|
||||
.on('click mousedown mousemove keydown keypress', function (event) {
|
||||
|
||||
event.stopPropagation();
|
||||
});
|
||||
|
||||
$(window).on('resize load', adjustSize);
|
||||
};
|
||||
|
||||
init(entry);
|
||||
});
|
56
src/_h5ai/js/inc/ext/qrcode.js
Normal file
@@ -0,0 +1,56 @@
|
||||
|
||||
modulejs.define('ext/qrcode', ['_', '$', 'modernizr', 'core/settings', 'core/event'], function (_, $, modernizr, allsettings, event) {
|
||||
|
||||
var defaults = {
|
||||
enabled: false,
|
||||
size: 150
|
||||
},
|
||||
|
||||
settings = _.extend({}, defaults, allsettings.qrcode),
|
||||
|
||||
template = '<div id="context"><div class="qrcode" /></div>',
|
||||
|
||||
$context, hideTimeoutId,
|
||||
|
||||
update = function (entry) {
|
||||
|
||||
$context.find('.qrcode').empty().qrcode({
|
||||
render: modernizr.canvas ? 'canvas' : 'div',
|
||||
width: settings.size,
|
||||
height: settings.size,
|
||||
color: '#333',
|
||||
text: 'http://' + document.domain + entry.absHref
|
||||
});
|
||||
},
|
||||
|
||||
onMouseenter = function (entry) {
|
||||
|
||||
if (!entry.isFolder()) {
|
||||
update(entry);
|
||||
clearTimeout(hideTimeoutId);
|
||||
$context.stop(true, true).fadeIn(400);
|
||||
}
|
||||
},
|
||||
|
||||
onMouseleave = function (entry) {
|
||||
|
||||
hideTimeoutId = setTimeout(function () {
|
||||
|
||||
$context.stop(true, true).fadeOut(400);
|
||||
}, 200);
|
||||
},
|
||||
|
||||
init = function () {
|
||||
|
||||
if (!settings.enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
$context = $(template).appendTo('body');
|
||||
|
||||
event.sub('entry.mouseenter', onMouseenter);
|
||||
event.sub('entry.mouseleave', onMouseleave);
|
||||
};
|
||||
|
||||
init();
|
||||
});
|
135
src/_h5ai/js/inc/ext/select.js
Normal file
@@ -0,0 +1,135 @@
|
||||
|
||||
modulejs.define('ext/select', ['_', '$', 'core/settings', 'core/event'], function (_, $, allsettings, event) {
|
||||
|
||||
var defaults = {
|
||||
enabled: false
|
||||
},
|
||||
|
||||
settings = _.extend({}, defaults, allsettings.select),
|
||||
|
||||
x = 0, y = 0,
|
||||
l = 0, t = 0, w = 0, h = 0,
|
||||
shrink = 1/3,
|
||||
$document = $(document),
|
||||
$selectionRect = $('<div id="selection-rect"></div>'),
|
||||
|
||||
publish = function () {
|
||||
|
||||
var entries = _.map($('#extended .entry.selected'), function (entryElement) {
|
||||
|
||||
return $(entryElement).data('entry');
|
||||
});
|
||||
|
||||
event.pub('selection', entries);
|
||||
},
|
||||
|
||||
selectionUpdate = function (event) {
|
||||
|
||||
l = Math.min(x, event.pageX);
|
||||
t = Math.min(y, event.pageY);
|
||||
w = Math.abs(x - event.pageX);
|
||||
h = Math.abs(y - event.pageY);
|
||||
|
||||
event.preventDefault();
|
||||
$selectionRect
|
||||
.stop(true, true)
|
||||
.css({left: l, top: t, width: w, height: h});
|
||||
|
||||
var selRect = $selectionRect.fracs('rect');
|
||||
$('#extended .entry').removeClass('selecting').each(function () {
|
||||
|
||||
var $entry = $(this),
|
||||
rect = $entry.find('a').fracs('rect'),
|
||||
inter = selRect.intersection(rect);
|
||||
if (inter && !$entry.hasClass('folder-parent')) {
|
||||
$entry.addClass('selecting');
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
selectionEnd = function (event) {
|
||||
|
||||
event.preventDefault();
|
||||
$document.off('mousemove', selectionUpdate);
|
||||
$('#extended .entry.selecting.selected').removeClass('selecting').removeClass('selected');
|
||||
$('#extended .entry.selecting').removeClass('selecting').addClass('selected');
|
||||
publish();
|
||||
|
||||
$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();
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
selectionStart = function (event) {
|
||||
|
||||
var view = $(document).fracs('viewport');
|
||||
|
||||
x = event.pageX;
|
||||
y = event.pageY;
|
||||
l = x;
|
||||
t = y;
|
||||
w = 0;
|
||||
h = 0;
|
||||
|
||||
// only on left button and don't block the scrollbars
|
||||
if (event.button !== 0 || l >= view.right || t >= view.bottom) {
|
||||
return;
|
||||
}
|
||||
|
||||
event.preventDefault();
|
||||
$(':focus').blur();
|
||||
if (!event.ctrlKey && !event.metaKey) {
|
||||
$('#extended .entry').removeClass('selected');
|
||||
publish();
|
||||
}
|
||||
$selectionRect
|
||||
.stop(true, true)
|
||||
.css({left: l, top: t, width: w, height: h, opacity: 1})
|
||||
.show();
|
||||
|
||||
$document
|
||||
.on('mousemove', selectionUpdate)
|
||||
.one('mouseup', selectionEnd);
|
||||
},
|
||||
|
||||
noSelection = function (event) {
|
||||
|
||||
event.stopImmediatePropagation();
|
||||
return false;
|
||||
},
|
||||
|
||||
noSelectionUnlessCtrl = function (event) {
|
||||
|
||||
if (!event.ctrlKey && !event.metaKey) {
|
||||
noSelection(event);
|
||||
}
|
||||
},
|
||||
|
||||
init = function () {
|
||||
|
||||
if (!settings.enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
$selectionRect.hide().appendTo('body');
|
||||
|
||||
$document
|
||||
.on('mousedown', '.noSelection', noSelection)
|
||||
.on('mousedown', '.noSelectionUnlessCtrl,input,a', noSelectionUnlessCtrl)
|
||||
.on('mousedown', selectionStart);
|
||||
};
|
||||
|
||||
init();
|
||||
});
|
145
src/_h5ai/js/inc/ext/sort.js
Normal file
@@ -0,0 +1,145 @@
|
||||
|
||||
modulejs.define('ext/sort', ['_', '$', 'core/settings', 'core/resource', 'core/store'], function (_, $, allsettings, resource, store) {
|
||||
|
||||
var defaults = {
|
||||
enabled: false,
|
||||
order: 'na'
|
||||
},
|
||||
|
||||
settings = _.extend({}, defaults, allsettings.sort),
|
||||
|
||||
storekey = 'h5ai.sortorder',
|
||||
|
||||
type = function (entry) {
|
||||
|
||||
var $entry = $(entry);
|
||||
|
||||
if ($entry.hasClass('folder-parent')) {
|
||||
return 0;
|
||||
} else if ($entry.hasClass('folder')) {
|
||||
return 1;
|
||||
}
|
||||
return 2;
|
||||
},
|
||||
|
||||
cmpFn = function (rev, getVal) {
|
||||
|
||||
return function (entry1, entry2) {
|
||||
|
||||
var res, val1, val2;
|
||||
|
||||
res = type(entry1) - type(entry2);
|
||||
if (res !== 0) {
|
||||
return res;
|
||||
}
|
||||
|
||||
val1 = getVal(entry1);
|
||||
val2 = getVal(entry2);
|
||||
if (val1 < val2) {
|
||||
return rev ? 1 : -1;
|
||||
} else if (val1 > val2) {
|
||||
return rev ? -1 : 1;
|
||||
}
|
||||
return 0;
|
||||
};
|
||||
},
|
||||
|
||||
getName = function (entry) {
|
||||
|
||||
return $(entry).find('.label').text().toLowerCase();
|
||||
},
|
||||
getTime = function (entry) {
|
||||
|
||||
return $(entry).find('.date').data('time');
|
||||
},
|
||||
getSize = function (entry) {
|
||||
|
||||
return $(entry).find('.size').data('bytes');
|
||||
},
|
||||
|
||||
$all, orders,
|
||||
|
||||
sortBy = function (id) {
|
||||
|
||||
var order = orders[id];
|
||||
|
||||
store.put(storekey, id);
|
||||
|
||||
$all.removeClass('ascending').removeClass('descending');
|
||||
order.head.addClass(order.clas);
|
||||
$('#extended .entry').detach().sort(order.fn).appendTo('#extended > ul');
|
||||
},
|
||||
|
||||
init = function () {
|
||||
|
||||
if (!settings.enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
var $ascending = $('<img src="' + resource.image('ascending') + '" class="sort ascending" alt="ascending" />'),
|
||||
$descending = $('<img src="' + resource.image('descending') + '" class="sort descending" alt="descending" />'),
|
||||
$header = $('#extended li.header'),
|
||||
$label = $header.find('a.label'),
|
||||
$date = $header.find('a.date'),
|
||||
$size = $header.find('a.size');
|
||||
|
||||
$all = $header.find('a.label,a.date,a.size');
|
||||
orders = {
|
||||
na: {
|
||||
head: $label,
|
||||
clas: 'ascending',
|
||||
fn: cmpFn(false, getName)
|
||||
},
|
||||
nd: {
|
||||
head: $label,
|
||||
clas: 'descending',
|
||||
fn: cmpFn(true, getName)
|
||||
},
|
||||
da: {
|
||||
head: $date,
|
||||
clas: 'ascending',
|
||||
fn: cmpFn(false, getTime)
|
||||
},
|
||||
dd: {
|
||||
head: $date,
|
||||
clas: 'descending',
|
||||
fn: cmpFn(true, getTime)
|
||||
},
|
||||
sa: {
|
||||
head: $size,
|
||||
clas: 'ascending',
|
||||
fn: cmpFn(false, getSize)
|
||||
},
|
||||
sd: {
|
||||
head: $size,
|
||||
clas: 'descending',
|
||||
fn: cmpFn(true, getSize)
|
||||
}
|
||||
};
|
||||
|
||||
sortBy(store.get(storekey) || settings.order);
|
||||
|
||||
$label
|
||||
.append($ascending.clone()).append($descending.clone())
|
||||
.click(function (event) {
|
||||
sortBy('n' + ($label.hasClass('ascending') ? 'd' : 'a'));
|
||||
event.preventDefault();
|
||||
});
|
||||
|
||||
$date
|
||||
.prepend($ascending.clone()).prepend($descending.clone())
|
||||
.click(function (event) {
|
||||
sortBy('d' + ($date.hasClass('ascending') ? 'd' : 'a'));
|
||||
event.preventDefault();
|
||||
});
|
||||
|
||||
$size
|
||||
.prepend($ascending.clone()).prepend($descending.clone())
|
||||
.click(function (event) {
|
||||
sortBy('s' + ($size.hasClass('ascending') ? 'd' : 'a'));
|
||||
event.preventDefault();
|
||||
});
|
||||
};
|
||||
|
||||
init();
|
||||
});
|
83
src/_h5ai/js/inc/ext/statusbar.js
Normal file
@@ -0,0 +1,83 @@
|
||||
|
||||
modulejs.define('ext/statusbar', ['_', '$', 'core/settings', 'core/format', 'core/event', 'core/entry'], function (_, $, allsettings, format, event, entry) {
|
||||
|
||||
var defaults = {
|
||||
enabled: false
|
||||
},
|
||||
|
||||
settings = _.extend({}, defaults, allsettings.statusbar),
|
||||
|
||||
template = '<span class="statusbar">' +
|
||||
'<span class="status default">' +
|
||||
'<span class="folderTotal"></span> <span class="l10n-folders">folders</span>' +
|
||||
'<span class="sep">·</span>' +
|
||||
'<span class="fileTotal"></span> <span class="l10n-files">files</span>' +
|
||||
'</span>' +
|
||||
'<span class="status dynamic"></span>' +
|
||||
'</span>',
|
||||
sepTemplate = '<span class="sep">·</span>',
|
||||
|
||||
$statusDynamic,
|
||||
$statusDefault,
|
||||
|
||||
update = function (html) {
|
||||
|
||||
if (html) {
|
||||
$statusDefault.hide();
|
||||
$statusDynamic.empty().append(html).show();
|
||||
} else {
|
||||
$statusDynamic.empty().hide();
|
||||
$statusDefault.show();
|
||||
}
|
||||
},
|
||||
|
||||
init = function (entry) {
|
||||
|
||||
if (!settings.enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
var $statusbar = $(template),
|
||||
$folderTotal = $statusbar.find('.folderTotal'),
|
||||
$fileTotal = $statusbar.find('.fileTotal');
|
||||
|
||||
$statusDefault = $statusbar.find('.status.default');
|
||||
$statusDynamic = $statusbar.find('.status.dynamic');
|
||||
|
||||
var stats = entry.getStats();
|
||||
$folderTotal.text(stats.folders);
|
||||
$fileTotal.text(stats.files);
|
||||
|
||||
update();
|
||||
|
||||
event.sub('statusbar', update);
|
||||
$('#bottombar > .center').append($statusbar);
|
||||
|
||||
|
||||
|
||||
event.sub('entry.mouseenter', function (entry) {
|
||||
|
||||
if (entry.isParentFolder) {
|
||||
return;
|
||||
}
|
||||
|
||||
var $span = $('<span/>').append(entry.label);
|
||||
|
||||
if (_.isNumber(entry.time)) {
|
||||
$span.append(sepTemplate).append(format.formatDate(entry.time));
|
||||
}
|
||||
if (_.isNumber(entry.size)) {
|
||||
$span.append(sepTemplate).append(format.formatSize(entry.size));
|
||||
}
|
||||
|
||||
update($span);
|
||||
});
|
||||
|
||||
event.sub('entry.mouseleave', function (entry) {
|
||||
|
||||
update();
|
||||
});
|
||||
};
|
||||
|
||||
init(entry);
|
||||
});
|
58
src/_h5ai/js/inc/ext/thumbnails.js
Normal file
@@ -0,0 +1,58 @@
|
||||
|
||||
modulejs.define('ext/thumbnails', ['_', 'core/settings', 'core/entry', 'core/ajax'], function (_, allsettings, entry, ajax) {
|
||||
|
||||
var defaults = {
|
||||
enabled: false,
|
||||
img: ['bmp', 'gif', 'ico', 'image', 'jpg', 'png', 'tiff'],
|
||||
mov: ['video'],
|
||||
doc: ['pdf', 'ps'],
|
||||
delay: 1000
|
||||
},
|
||||
|
||||
settings = _.extend({}, defaults, allsettings.thumbnails),
|
||||
|
||||
checkEntry = function (entry) {
|
||||
|
||||
if (entry.$extended) {
|
||||
|
||||
var type = null;
|
||||
|
||||
if (_.indexOf(settings.img, entry.type) >= 0) {
|
||||
type = 'img';
|
||||
} else if (_.indexOf(settings.mov, entry.type) >= 0) {
|
||||
type = 'mov';
|
||||
} else if (_.indexOf(settings.doc, entry.type) >= 0) {
|
||||
type = 'doc';
|
||||
}
|
||||
|
||||
if (type) {
|
||||
ajax.getThumbSrcSmall(type, entry.absHref, function (src) {
|
||||
|
||||
if (src) {
|
||||
entry.$extended.find('.icon.small img').addClass('thumb').attr('src', src);
|
||||
}
|
||||
});
|
||||
ajax.getThumbSrcBig(type, entry.absHref, function (src) {
|
||||
|
||||
if (src) {
|
||||
entry.$extended.find('.icon.big img').addClass('thumb').attr('src', src);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
init = function (entry) {
|
||||
|
||||
if (!settings.enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
setTimeout(function () {
|
||||
|
||||
_.each(entry.content, checkEntry);
|
||||
}, settings.delay);
|
||||
};
|
||||
|
||||
init(entry);
|
||||
});
|
27
src/_h5ai/js/inc/ext/title.js
Normal file
@@ -0,0 +1,27 @@
|
||||
|
||||
modulejs.define('ext/title', ['_', 'core/settings', 'core/entry'], function (_, allsettings, entry) {
|
||||
|
||||
var defaults = {
|
||||
enabled: false
|
||||
},
|
||||
|
||||
settings = _.extend({}, defaults, allsettings.title),
|
||||
|
||||
init = function (entry) {
|
||||
|
||||
if (!settings.enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
var labels = _.pluck(entry.getCrumb(), 'label'),
|
||||
title = labels.join(' > ');
|
||||
|
||||
if (labels.length > 1) {
|
||||
title = labels[labels.length - 1] + ' - ' + title;
|
||||
}
|
||||
|
||||
document.title = title;
|
||||
};
|
||||
|
||||
init(entry);
|
||||
});
|
229
src/_h5ai/js/inc/ext/tree.js
Normal file
@@ -0,0 +1,229 @@
|
||||
|
||||
modulejs.define('ext/tree', ['_', '$', 'core/settings', 'core/resource', 'core/event', 'core/entry', 'core/parser'], function (_, $, allsettings, resource, event, entry, parser) {
|
||||
|
||||
var defaults = {
|
||||
enabled: false,
|
||||
slide: true
|
||||
},
|
||||
|
||||
settings = _.extend({}, defaults, allsettings.tree),
|
||||
|
||||
template = '<div class="entry">' +
|
||||
'<span class="indicator none">' +
|
||||
'<img src="' + resource.image('tree') + '" />' +
|
||||
'</span>' +
|
||||
'<a>' +
|
||||
'<span class="icon"><img /></span>' +
|
||||
'<span class="label"></span>' +
|
||||
'</a>' +
|
||||
'</span>',
|
||||
statusHintTemplate = '<span class="hint"></span>',
|
||||
|
||||
// updates the tree for this single entry
|
||||
update = function (entry) {
|
||||
|
||||
var $html = $(template),
|
||||
$indicator = $html.find('.indicator'),
|
||||
$a = $html.find('a'),
|
||||
$img = $html.find('.icon img'),
|
||||
$label = $html.find('.label');
|
||||
|
||||
$html
|
||||
.addClass(entry.isFolder() ? 'folder' : 'file')
|
||||
.data('entry', entry)
|
||||
.data('status', entry.status);
|
||||
|
||||
$a.attr('href', entry.absHref);
|
||||
$img.attr('src', resource.icon(entry.type));
|
||||
$label.text(entry.label);
|
||||
|
||||
if (entry.isFolder()) {
|
||||
|
||||
var subfolders = entry.getSubfolders();
|
||||
|
||||
// indicator
|
||||
if (!entry.status || (entry.status === 'h5ai' && !entry.isContentFetched) || subfolders.length) {
|
||||
|
||||
$indicator.removeClass('none');
|
||||
|
||||
if (!entry.status || (entry.status === 'h5ai' && !entry.isContentFetched)) {
|
||||
$indicator.addClass('unknown');
|
||||
} else if (entry.isContentVisible) {
|
||||
$indicator.addClass('open');
|
||||
} else {
|
||||
$indicator.addClass('close');
|
||||
}
|
||||
}
|
||||
|
||||
// is it the domain?
|
||||
if (entry.isDomain()) {
|
||||
$html.addClass('domain');
|
||||
$img.attr('src', resource.icon('folder-home'));
|
||||
}
|
||||
|
||||
// is it the current folder?
|
||||
if (entry.isCurrentFolder()) {
|
||||
$html.addClass('current');
|
||||
$img.attr('src', resource.icon('folder-open'));
|
||||
}
|
||||
|
||||
// does it have subfolders?
|
||||
if (subfolders.length) {
|
||||
var $ul = $('<ul class="content" />').appendTo($html);
|
||||
_.each(subfolders, function (e) {
|
||||
$('<li />').append(update(e)).appendTo($ul);
|
||||
});
|
||||
if (!entry.isContentVisible) {
|
||||
$ul.hide();
|
||||
}
|
||||
}
|
||||
|
||||
// reflect folder status
|
||||
if (_.isNumber(entry.status)) {
|
||||
if (entry.status === 200) {
|
||||
$img.attr('src', resource.icon('folder-page'));
|
||||
} else {
|
||||
$html.addClass('error');
|
||||
$a.append($(statusHintTemplate).text(entry.status));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (entry.$tree) {
|
||||
entry.$tree.replaceWith($html);
|
||||
}
|
||||
entry.$tree = $html;
|
||||
|
||||
return $html;
|
||||
},
|
||||
|
||||
createOnIndicatorClick = function (parser) {
|
||||
|
||||
var $tree = $('#tree'),
|
||||
slide = function (entry, $indicator, $content, down) {
|
||||
|
||||
entry.isContentVisible = down;
|
||||
$indicator.removeClass('open close').addClass(down ? 'open' : 'close');
|
||||
$tree.scrollpanel('update', true);
|
||||
$content[down ? 'slideDown' : 'slideUp'](function () {
|
||||
|
||||
$tree.scrollpanel('update');
|
||||
});
|
||||
};
|
||||
|
||||
return function () {
|
||||
|
||||
var $indicator = $(this),
|
||||
$entry = $indicator.closest('.entry'),
|
||||
entry = $entry.data('entry'),
|
||||
$content = $entry.find('> ul.content');
|
||||
|
||||
if ($indicator.hasClass('unknown')) {
|
||||
|
||||
entry.fetchContent(parser, function (entry) {
|
||||
|
||||
entry.isContentVisible = false;
|
||||
|
||||
var $entry = update(entry),
|
||||
$indicator = $entry.find('> .indicator'),
|
||||
$content = $entry.find('> ul.content');
|
||||
|
||||
if (!$indicator.hasClass('none')) {
|
||||
slide(entry, $indicator, $content, true);
|
||||
}
|
||||
});
|
||||
|
||||
} else if ($indicator.hasClass('open')) {
|
||||
|
||||
slide(entry, $indicator, $content, false);
|
||||
|
||||
} else if ($indicator.hasClass('close')) {
|
||||
|
||||
slide(entry, $indicator, $content, true);
|
||||
}
|
||||
};
|
||||
},
|
||||
|
||||
shiftTree = function (forceVisible, dontAnimate) {
|
||||
|
||||
var $tree = $("#tree"),
|
||||
$extended = $("#extended"),
|
||||
left = ((settings.slide && $tree.outerWidth() < $extended.offset().left) || forceVisible || !$extended.is(':visible')) ? 0 : 18 - $tree.outerWidth();
|
||||
|
||||
if (dontAnimate) {
|
||||
$tree.stop().css({ left: left });
|
||||
} else {
|
||||
$tree.stop().animate({ left: left });
|
||||
}
|
||||
},
|
||||
|
||||
fetchTree = function (entry, parser, callback) {
|
||||
|
||||
entry.isContentVisible = true;
|
||||
entry.fetchContent(parser, function (entry) {
|
||||
|
||||
if (entry.parent) {
|
||||
fetchTree(entry.parent, parser, callback);
|
||||
} else {
|
||||
callback(entry);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
adjustSpacing = function () {
|
||||
|
||||
var $tree = $('#tree'),
|
||||
winHeight = $(window).height(),
|
||||
navHeight = $('#topbar').outerHeight(),
|
||||
footerHeight = $('#bottombar').outerHeight();
|
||||
|
||||
$tree.css({
|
||||
top: navHeight,
|
||||
height: winHeight - navHeight - footerHeight - 16
|
||||
});
|
||||
|
||||
$tree.scrollpanel('update');
|
||||
},
|
||||
|
||||
// creates the complete tree from entry down to the root
|
||||
init = function (entry, parser) {
|
||||
|
||||
if (!settings.enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
var $tree = $('<div id="tree" />')
|
||||
.appendTo('body')
|
||||
.scrollpanel()
|
||||
.on('click', '.indicator', createOnIndicatorClick(parser))
|
||||
.on('mouseenter', function () {
|
||||
|
||||
shiftTree(true);
|
||||
})
|
||||
.on('mouseleave', function () {
|
||||
|
||||
shiftTree();
|
||||
});
|
||||
|
||||
fetchTree(entry, parser, function (root) {
|
||||
|
||||
$tree
|
||||
.find('.sp-container').append(update(root)).end()
|
||||
.show();
|
||||
|
||||
adjustSpacing();
|
||||
shiftTree(false, true);
|
||||
});
|
||||
|
||||
event.sub('ready', adjustSpacing);
|
||||
|
||||
$(window).on('resize', function () {
|
||||
|
||||
adjustSpacing();
|
||||
shiftTree();
|
||||
});
|
||||
};
|
||||
|
||||
init(entry, parser);
|
||||
});
|
29
src/_h5ai/js/inc/h5ai-info.js
Normal file
@@ -0,0 +1,29 @@
|
||||
|
||||
modulejs.define('h5ai-info', ['$', 'core/ajax'], function ($, ajax) {
|
||||
|
||||
var setCheckResult = function (id, result) {
|
||||
|
||||
var $ele = $(id).find('.test-result');
|
||||
|
||||
if (result) {
|
||||
$ele.addClass('test-passed').text('yes');
|
||||
} else {
|
||||
$ele.addClass('test-failed').text('no');
|
||||
}
|
||||
},
|
||||
|
||||
init = function () {
|
||||
|
||||
ajax.getChecks(function (json) {
|
||||
|
||||
if (json) {
|
||||
$('.test').each(function () {
|
||||
|
||||
setCheckResult(this, json[$(this).data('id')]);
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
init();
|
||||
});
|