mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-05-28 14:04:45 -04:00
Refactores localization.
This commit is contained in:
parent
1152c00018
commit
a796bd606f
13 changed files with 286 additions and 267 deletions
|
@ -1,40 +1,75 @@
|
|||
|
||||
(function ($) {
|
||||
(function ($, config) {
|
||||
'use strict';
|
||||
/*jslint browser: true, confusion: true, regexp: true, vars: true, white: true */
|
||||
/*global Modernizr, jQuery, amplify, Base64, H5AI_CONFIG */
|
||||
|
||||
var h5ai = function () {
|
||||
var 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
|
||||
},
|
||||
init = function () {
|
||||
h5ai = function () {
|
||||
|
||||
var $html = $('html');
|
||||
|
||||
h5ai.isJs = $html.hasClass('h5ai-js');
|
||||
h5ai.isPhp = $html.hasClass('h5ai-php');
|
||||
|
||||
if (h5ai.isJs) {
|
||||
h5ai.extended.init();
|
||||
}
|
||||
|
||||
h5ai.core.init();
|
||||
h5ai.sort.init();
|
||||
h5ai.finder.init();
|
||||
h5ai.zippedDownload.init();
|
||||
h5ai.context.init();
|
||||
|
||||
if (h5ai.isPhp) {
|
||||
$('#tree').scrollpanel();
|
||||
h5ai.core.shiftTree(false, true);
|
||||
}
|
||||
|
||||
// publish for testing
|
||||
window.h5ai = h5ai;
|
||||
};
|
||||
|
||||
h5ai.config = config;
|
||||
h5ai.settings = $.extend({}, defaults, config.options);
|
||||
|
||||
h5ai.init = function () {
|
||||
|
||||
var $html = $('html');
|
||||
|
||||
h5ai.isJs = $html.hasClass('h5ai-js');
|
||||
h5ai.isPhp = $html.hasClass('h5ai-php');
|
||||
|
||||
if (h5ai.isJs) {
|
||||
h5ai.extended.init();
|
||||
}
|
||||
|
||||
h5ai.core.init();
|
||||
h5ai.localize.init();
|
||||
h5ai.sort.init();
|
||||
h5ai.finder.init();
|
||||
h5ai.zippedDownload.init();
|
||||
h5ai.context.init();
|
||||
|
||||
if (h5ai.isPhp) {
|
||||
$('#tree').scrollpanel();
|
||||
h5ai.core.shiftTree(false, true);
|
||||
}
|
||||
|
||||
// publish for testing
|
||||
window.h5ai = h5ai;
|
||||
};
|
||||
|
||||
// @include "Util.js"
|
||||
// @include "Core.js"
|
||||
// @include "Localize.js"
|
||||
// @include "Sort.js"
|
||||
// @include "ZippedDownload.js"
|
||||
// @include "Finder.js"
|
||||
|
@ -45,6 +80,6 @@
|
|||
// @include "Html.js"
|
||||
// @include "Extended.js"
|
||||
|
||||
$(init);
|
||||
$(h5ai.init);
|
||||
|
||||
}(jQuery));
|
||||
}(jQuery, H5AI_CONFIG));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue