mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-08-13 16:54:01 +02:00
Merge branch 'redesign-js' into develop
This commit is contained in:
@@ -16,5 +16,5 @@ release.dir = release
|
|||||||
|
|
||||||
|
|
||||||
# tools
|
# tools
|
||||||
wepp = tools/wepp
|
tool.wepp = tools/wepp
|
||||||
|
|
||||||
|
@@ -45,7 +45,7 @@
|
|||||||
background-color: #f6f6f6;
|
background-color: #f6f6f6;
|
||||||
color: #e80;
|
color: #e80;
|
||||||
}
|
}
|
||||||
&.selected {
|
&.selected:not(.selecting), &.selecting:not(.selected) {
|
||||||
border-color: rgba(240,100,0,0.2);
|
border-color: rgba(240,100,0,0.2);
|
||||||
background-color: rgba(240,100,0,0.2);
|
background-color: rgba(240,100,0,0.2);
|
||||||
}
|
}
|
||||||
@@ -193,7 +193,7 @@
|
|||||||
border-color: #eee;
|
border-color: #eee;
|
||||||
background-color: #f6f6f6;
|
background-color: #f6f6f6;
|
||||||
}
|
}
|
||||||
&.selected {
|
&.selected:not(.selecting), &.selecting:not(.selected) {
|
||||||
border-color: rgba(240,100,0,0.2);
|
border-color: rgba(240,100,0,0.2);
|
||||||
background-color: rgba(240,100,0,0.2);
|
background-color: rgba(240,100,0,0.2);
|
||||||
}
|
}
|
||||||
|
@@ -27,9 +27,7 @@
|
|||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</footer>
|
</footer>
|
||||||
<script src="/h5ai/js/lib/jquery.min.js"></script>
|
<script src="/h5ai/js/libs.js"></script>
|
||||||
<script src="/h5ai/js/lib/jquery.mousewheel.min.js"></script>
|
|
||||||
<script src="/h5ai/js/lib/jquery.fracs-core.min.js"></script>
|
|
||||||
<script src="/h5ai/options.js"></script>
|
<script src="/h5ai/options.js"></script>
|
||||||
<script src="/h5ai/js/main-js.js"></script>
|
<script src="/h5ai/js/main-js.js"></script>
|
||||||
</body>
|
</body>
|
||||||
|
@@ -14,7 +14,7 @@
|
|||||||
<link rel="apple-touch-icon" type="image/png" href="/h5ai/images/h5ai-48x48.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="http://fonts.googleapis.com/css?family=Ubuntu:regular,italic,bold">
|
||||||
<link rel="stylesheet" href="/h5ai/css/main-js.css">
|
<link rel="stylesheet" href="/h5ai/css/main-js.css">
|
||||||
<script src="/h5ai/js/lib/modernizr.min.js"></script>
|
<script src="/h5ai/js/modernizr.min.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="selection-rect"></div>
|
<div id="selection-rect"></div>
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
<link rel="apple-touch-icon" type="image/png" href="/h5ai/images/h5ai-48x48.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="http://fonts.googleapis.com/css?family=Ubuntu:regular,italic,bold">
|
||||||
<link rel="stylesheet" href="/h5ai/css/main-php.css">
|
<link rel="stylesheet" href="/h5ai/css/main-php.css">
|
||||||
<script src="/h5ai/js/lib/modernizr.min.js"></script>
|
<script src="/h5ai/js/modernizr.min.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="selection-rect"></div>
|
<div id="selection-rect"></div>
|
||||||
@@ -60,9 +60,7 @@
|
|||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</footer>
|
</footer>
|
||||||
<script src="/h5ai/js/lib/jquery.min.js"></script>
|
<script src="/h5ai/js/libs.js"></script>
|
||||||
<script src="/h5ai/js/lib/jquery.mousewheel.min.js"></script>
|
|
||||||
<script src="/h5ai/js/lib/jquery.fracs-core.min.js"></script>
|
|
||||||
<script src="/h5ai/options.js"></script>
|
<script src="/h5ai/options.js"></script>
|
||||||
<script src="/h5ai/js/main-php.js"></script>
|
<script src="/h5ai/js/main-php.js"></script>
|
||||||
<section id="table">
|
<section id="table">
|
||||||
|
@@ -1,13 +1,13 @@
|
|||||||
/*global $, Objects */
|
/*global $, H5aiJs */
|
||||||
|
|
||||||
Objects.Tree = function (pathCache, h5ai) {
|
H5aiJs.factory.Connector = function () {
|
||||||
|
|
||||||
var contentTypeRegEx = /^text\/html;h5ai=/,
|
var contentTypeRegEx = /^text\/html;h5ai=/,
|
||||||
pathnameStatusCache = {},
|
pathnameStatusCache = {},
|
||||||
fetchStatus = function (pathname, callback) {
|
fetchStatus = function (pathname, callback) {
|
||||||
|
|
||||||
if (h5ai.settings.folderStatus[pathname]) {
|
if (H5aiJs.h5ai.settings.folderStatus[pathname]) {
|
||||||
callback(h5ai.settings.folderStatus[pathname]);
|
callback(H5aiJs.h5ai.settings.folderStatus[pathname]);
|
||||||
return;
|
return;
|
||||||
} else if (pathnameStatusCache[pathname]) {
|
} else if (pathnameStatusCache[pathname]) {
|
||||||
callback(pathnameStatusCache[pathname]);
|
callback(pathnameStatusCache[pathname]);
|
||||||
@@ -37,14 +37,14 @@ Objects.Tree = function (pathCache, h5ai) {
|
|||||||
if (status !== "h5ai") {
|
if (status !== "h5ai") {
|
||||||
path.status = status;
|
path.status = status;
|
||||||
}
|
}
|
||||||
path.updateHtml();
|
H5aiJs.html.updateHtml(path);
|
||||||
h5ai.linkHoverStates();
|
H5aiJs.h5ai.linkHoverStates();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
updatePaths = function () {
|
updatePaths = function () {
|
||||||
|
|
||||||
$.each(pathCache.cache, function (ref, cached) {
|
$.each(H5aiJs.pathCache.cache, function (ref, cached) {
|
||||||
updatePath(cached);
|
updatePath(cached);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -76,7 +76,7 @@ Objects.Tree = function (pathCache, h5ai) {
|
|||||||
|
|
||||||
$(html).find("#table td").closest("tr").each(function () {
|
$(html).find("#table td").closest("tr").each(function () {
|
||||||
|
|
||||||
var path = pathCache.getPath(pathname, this);
|
var path = H5aiJs.pathCache.getPath(pathname, this);
|
||||||
|
|
||||||
if (path.isFolder && (!path.isParentFolder || includeParent)) {
|
if (path.isFolder && (!path.isParentFolder || includeParent)) {
|
||||||
content[path.absHref] = path;
|
content[path.absHref] = path;
|
||||||
@@ -92,7 +92,7 @@ Objects.Tree = function (pathCache, h5ai) {
|
|||||||
|
|
||||||
fetchStatusAndContent(pathname, false, function (status, content) {
|
fetchStatusAndContent(pathname, false, function (status, content) {
|
||||||
|
|
||||||
var path = pathCache.getPath(pathname);
|
var path = H5aiJs.pathCache.getPath(pathname);
|
||||||
|
|
||||||
path.status = status;
|
path.status = status;
|
||||||
path.content = content;
|
path.content = content;
|
||||||
@@ -103,7 +103,7 @@ Objects.Tree = function (pathCache, h5ai) {
|
|||||||
|
|
||||||
fetchPath(pathname, function (path) {
|
fetchPath(pathname, function (path) {
|
||||||
|
|
||||||
var parent = pathCache.splitPathname(pathname)[0];
|
var parent = H5aiJs.pathCache.splitPathname(pathname)[0];
|
||||||
|
|
||||||
path.treeOpen = true;
|
path.treeOpen = true;
|
||||||
if (childPath) {
|
if (childPath) {
|
||||||
@@ -120,25 +120,24 @@ Objects.Tree = function (pathCache, h5ai) {
|
|||||||
|
|
||||||
fetchTree(document.location.pathname, function (path) {
|
fetchTree(document.location.pathname, function (path) {
|
||||||
$("#tree")
|
$("#tree")
|
||||||
.append(path.updateTreeHtml())
|
.append(H5aiJs.html.updateTreeHtml(path))
|
||||||
.scrollpanel()
|
.scrollpanel()
|
||||||
.show();
|
.show();
|
||||||
h5ai.shiftTree(false, true);
|
H5aiJs.h5ai.shiftTree(false, true);
|
||||||
h5ai.linkHoverStates();
|
H5aiJs.h5ai.linkHoverStates();
|
||||||
setTimeout(function () { $("#tree").get(0).updateScrollbar(); }, 1);
|
setTimeout(function () { $("#tree").get(0).updateScrollbar(); }, 1);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
init = function () {
|
init = function () {
|
||||||
|
|
||||||
if (h5ai.settings.showTree) {
|
if (H5aiJs.h5ai.settings.showTree) {
|
||||||
updatePaths();
|
updatePaths();
|
||||||
populateTree();
|
populateTree();
|
||||||
}
|
}
|
||||||
},
|
|
||||||
tree = {
|
|
||||||
fetchStatusAndContent: fetchStatusAndContent,
|
|
||||||
init: init
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return tree;
|
return {
|
||||||
|
fetchStatusAndContent: fetchStatusAndContent,
|
||||||
|
init: init
|
||||||
|
};
|
||||||
};
|
};
|
@@ -1,6 +1,6 @@
|
|||||||
/*global $, Objects */
|
/*global $, H5aiJs */
|
||||||
|
|
||||||
Objects.Extended = function (pathCache, h5ai) {
|
H5aiJs.factory.Extended = function () {
|
||||||
|
|
||||||
var settings = {
|
var settings = {
|
||||||
customHeader: "h5ai.header.html",
|
customHeader: "h5ai.header.html",
|
||||||
@@ -17,15 +17,15 @@ Objects.Extended = function (pathCache, h5ai) {
|
|||||||
|
|
||||||
var $ul = $("body > nav ul"),
|
var $ul = $("body > nav ul"),
|
||||||
pathname = "/",
|
pathname = "/",
|
||||||
path = pathCache.getPath(pathname),
|
path = H5aiJs.pathCache.getPath(pathname),
|
||||||
pathnameParts = document.location.pathname.split("/");
|
pathnameParts = document.location.pathname.split("/");
|
||||||
|
|
||||||
$ul.append(path.updateCrumbHtml());
|
$ul.append(H5aiJs.html.updateCrumbHtml(path));
|
||||||
|
|
||||||
$.each(pathnameParts, function (idx, part) {
|
$.each(pathnameParts, function (idx, part) {
|
||||||
if (part !== "") {
|
if (part !== "") {
|
||||||
pathname += part + "/";
|
pathname += part + "/";
|
||||||
$ul.append(pathCache.getPath(pathname).updateCrumbHtml());
|
$ul.append(H5aiJs.html.updateCrumbHtml(H5aiJs.pathCache.getPath(pathname)));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -37,8 +37,8 @@ Objects.Extended = function (pathCache, h5ai) {
|
|||||||
$size = $ths.eq(3).find("a"),
|
$size = $ths.eq(3).find("a"),
|
||||||
sortquery = document.location.search,
|
sortquery = document.location.search,
|
||||||
order = {
|
order = {
|
||||||
column: (sortquery.indexOf("C=N") >= 0) ? "name" : (sortquery.indexOf("C=M") >= 0) ? "date" : (sortquery.indexOf("C=S") >= 0) ? "size" : h5ai.settings.sortorder.column,
|
column: (sortquery.indexOf("C=N") >= 0) ? "name" : (sortquery.indexOf("C=M") >= 0) ? "date" : (sortquery.indexOf("C=S") >= 0) ? "size" : H5aiJs.h5ai.settings.sortorder.column,
|
||||||
ascending: (sortquery.indexOf("O=A") >= 0) ? true : (sortquery.indexOf("O=D") >= 0) ? false : h5ai.settings.sortorder.ascending
|
ascending: (sortquery.indexOf("O=A") >= 0) ? true : (sortquery.indexOf("O=D") >= 0) ? false : H5aiJs.h5ai.settings.sortorder.ascending
|
||||||
},
|
},
|
||||||
$icon, $ul, $li;
|
$icon, $ul, $li;
|
||||||
|
|
||||||
@@ -66,8 +66,8 @@ Objects.Extended = function (pathCache, h5ai) {
|
|||||||
|
|
||||||
// entries
|
// entries
|
||||||
$("#table td").closest("tr").each(function () {
|
$("#table td").closest("tr").each(function () {
|
||||||
var path = pathCache.getPath(document.location.pathname, this);
|
var path = H5aiJs.pathCache.getPath(document.location.pathname, this);
|
||||||
$ul.append(path.updateExtendedHtml());
|
$ul.append(H5aiJs.html.updateExtendedHtml(path));
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#extended").append($ul);
|
$("#extended").append($ul);
|
||||||
@@ -95,22 +95,18 @@ Objects.Extended = function (pathCache, h5ai) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
initCounts = function () {
|
initTotals = function () {
|
||||||
|
|
||||||
$(".folderCount").text($("#extended .entry.folder:not(.parentfolder)").size());
|
$(".folderCount").text($("#extended .entry.folder:not(.parentfolder)").size());
|
||||||
$(".fileCount").text($("#extended .entry.file").size());
|
$(".fileCount").text($("#extended .entry.file").size());
|
||||||
},
|
|
||||||
init = function () {
|
|
||||||
|
|
||||||
initTitle();
|
|
||||||
initBreadcrumb();
|
|
||||||
initExtendedView();
|
|
||||||
customize();
|
|
||||||
initCounts();
|
|
||||||
},
|
|
||||||
extended = {
|
|
||||||
init: init
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return extended;
|
this.init = function () {
|
||||||
|
|
||||||
|
initTitle();
|
||||||
|
initBreadcrumb();
|
||||||
|
initExtendedView();
|
||||||
|
customize();
|
||||||
|
initTotals();
|
||||||
|
};
|
||||||
};
|
};
|
@@ -1,11 +1,13 @@
|
|||||||
/*global window, $, Objects, localStorage */
|
|
||||||
|
|
||||||
Objects.H5ai = function (options, langs) {
|
H5aiJs.factory.H5ai = function (options, langs) {
|
||||||
|
/*global window, $, amplify*/
|
||||||
|
|
||||||
var defaults = {
|
var $window = $(window),
|
||||||
|
$document = $(document),
|
||||||
|
defaults = {
|
||||||
store: {
|
store: {
|
||||||
viewmode: "h5ai.viewmode",
|
viewmode: "h5ai.pref.viewmode",
|
||||||
lang: "h5ai.lang"
|
lang: "h5ai.pref.lang"
|
||||||
},
|
},
|
||||||
callbacks: {
|
callbacks: {
|
||||||
pathClick: []
|
pathClick: []
|
||||||
@@ -41,19 +43,19 @@ Objects.H5ai = function (options, langs) {
|
|||||||
triggerPathClick = function (path, context) {
|
triggerPathClick = function (path, context) {
|
||||||
|
|
||||||
$.each(settings.callbacks.pathClick, function (idx, callback) {
|
$.each(settings.callbacks.pathClick, function (idx, callback) {
|
||||||
callback.call(window, path, context);
|
callback(path, context);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
getViewmode = function () {
|
getViewmode = function () {
|
||||||
|
|
||||||
var viewmode = localStorage.getItem(settings.store.viewmode);
|
var viewmode = amplify.store(settings.store.viewmode);
|
||||||
|
|
||||||
return $.inArray(viewmode, settings.viewmodes) >= 0 ? viewmode : settings.viewmodes[0];
|
return $.inArray(viewmode, settings.viewmodes) >= 0 ? viewmode : settings.viewmodes[0];
|
||||||
},
|
},
|
||||||
applyViewmode = function (viewmode) {
|
applyViewmode = function (viewmode) {
|
||||||
|
|
||||||
if (viewmode) {
|
if (viewmode) {
|
||||||
localStorage.setItem(settings.store.viewmode, viewmode);
|
amplify.store(settings.store.viewmode, viewmode);
|
||||||
}
|
}
|
||||||
viewmode = getViewmode();
|
viewmode = getViewmode();
|
||||||
|
|
||||||
@@ -82,7 +84,7 @@ Objects.H5ai = function (options, langs) {
|
|||||||
|
|
||||||
var adjustTopSpace = function () {
|
var adjustTopSpace = function () {
|
||||||
|
|
||||||
var winHeight = $(window).height(),
|
var winHeight = $window.height(),
|
||||||
navHeight = $("body > nav").outerHeight(),
|
navHeight = $("body > nav").outerHeight(),
|
||||||
footerHeight = $("body > footer").outerHeight(),
|
footerHeight = $("body > footer").outerHeight(),
|
||||||
contentSpacing = 50,
|
contentSpacing = 50,
|
||||||
@@ -103,7 +105,7 @@ Objects.H5ai = function (options, langs) {
|
|||||||
} catch (err) {}
|
} catch (err) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
$(window).resize(function () {
|
$window.resize(function () {
|
||||||
adjustTopSpace();
|
adjustTopSpace();
|
||||||
});
|
});
|
||||||
adjustTopSpace();
|
adjustTopSpace();
|
||||||
@@ -141,7 +143,7 @@ Objects.H5ai = function (options, langs) {
|
|||||||
$(".status.default").show();
|
$(".status.default").show();
|
||||||
$(".status.dynamic").empty().hide();
|
$(".status.dynamic").empty().hide();
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
shiftTree = function (forceVisible, dontAnimate) {
|
shiftTree = function (forceVisible, dontAnimate) {
|
||||||
|
|
||||||
@@ -168,7 +170,7 @@ Objects.H5ai = function (options, langs) {
|
|||||||
function () { shiftTree(true); },
|
function () { shiftTree(true); },
|
||||||
function () { shiftTree(); }
|
function () { shiftTree(); }
|
||||||
);
|
);
|
||||||
$(window).resize(function () { shiftTree(); });
|
$window.resize(function () { shiftTree(); });
|
||||||
shiftTree(false, true);
|
shiftTree(false, true);
|
||||||
},
|
},
|
||||||
linkHoverStates = function () {
|
linkHoverStates = function () {
|
||||||
@@ -188,7 +190,7 @@ Objects.H5ai = function (options, langs) {
|
|||||||
},
|
},
|
||||||
localize = function (langs, lang, useBrowserLang) {
|
localize = function (langs, lang, useBrowserLang) {
|
||||||
|
|
||||||
var storedLang = localStorage.getItem(settings.store.lang),
|
var storedLang = amplify.store(settings.store.lang),
|
||||||
browserLang, selected, key;
|
browserLang, selected, key;
|
||||||
|
|
||||||
if (langs[storedLang]) {
|
if (langs[storedLang]) {
|
||||||
@@ -218,7 +220,7 @@ Objects.H5ai = function (options, langs) {
|
|||||||
},
|
},
|
||||||
initLangSelector = function (langs) {
|
initLangSelector = function (langs) {
|
||||||
|
|
||||||
var idx, lang,
|
var $langOptions = $(".langOptions"),
|
||||||
sortedLangsKeys = [],
|
sortedLangsKeys = [],
|
||||||
$ul;
|
$ul;
|
||||||
|
|
||||||
@@ -234,18 +236,22 @@ Objects.H5ai = function (options, langs) {
|
|||||||
.text(lang + " - " + langs[lang].lang)
|
.text(lang + " - " + langs[lang].lang)
|
||||||
.appendTo($ul)
|
.appendTo($ul)
|
||||||
.click(function () {
|
.click(function () {
|
||||||
localStorage.setItem(settings.store.lang, lang);
|
amplify.store(settings.store.lang, lang);
|
||||||
localize(langs, lang, false);
|
localize(langs, lang, false);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
$("#langSelector .langOptions").append($ul);
|
$("#langSelector .langOptions").append($ul);
|
||||||
$("#langSelector").hover(
|
$("#langSelector").hover(
|
||||||
function () {
|
function () {
|
||||||
var $ele = $(".langOptions");
|
$langOptions
|
||||||
$ele.css("top", "-" + $ele.outerHeight() + "px").stop(true, true).fadeIn();
|
.css("top", "-" + $langOptions.outerHeight() + "px")
|
||||||
|
.stop(true, true)
|
||||||
|
.fadeIn();
|
||||||
},
|
},
|
||||||
function () {
|
function () {
|
||||||
$(".langOptions").stop(true, true).fadeOut();
|
$langOptions
|
||||||
|
.stop(true, true)
|
||||||
|
.fadeOut();
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
@@ -266,7 +272,9 @@ Objects.H5ai = function (options, langs) {
|
|||||||
$indicator.addClass("open");
|
$indicator.addClass("open");
|
||||||
$entry.find("> .content").replaceWith($content);
|
$entry.find("> .content").replaceWith($content);
|
||||||
$("#tree").get(0).updateScrollbar();
|
$("#tree").get(0).updateScrollbar();
|
||||||
initIndicators();
|
$content.find(".indicator:not(.initiated)")
|
||||||
|
.click(onIndicatorClick)
|
||||||
|
.addClass("initiated");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else if ($indicator.hasClass("open")) {
|
} else if ($indicator.hasClass("open")) {
|
||||||
@@ -285,24 +293,31 @@ Objects.H5ai = function (options, langs) {
|
|||||||
},
|
},
|
||||||
initIndicators = function () {
|
initIndicators = function () {
|
||||||
|
|
||||||
$("#tree .entry.folder .indicator:not(.initiated)").each(function () {
|
$("#tree .entry.folder .indicator:not(.initiated)")
|
||||||
|
.click(onIndicatorClick)
|
||||||
$(this).addClass("initiated").click(onIndicatorClick);
|
.addClass("initiated");
|
||||||
});
|
|
||||||
},
|
},
|
||||||
initZippedDownload = function () {
|
initZippedDownload = function () {
|
||||||
|
|
||||||
var x = 0,
|
var x = 0,
|
||||||
y = 0,
|
y = 0,
|
||||||
$window = $(window),
|
ctrl = false,
|
||||||
selected = function (hrefs) {
|
updateDownloadBtn = function () {
|
||||||
|
|
||||||
var query, idx;
|
var query,
|
||||||
$.each(hrefs, function (idx, href) {
|
href,
|
||||||
query = query ? query + ":" + href : href;
|
$selected = $("#extended a.selected");
|
||||||
});
|
|
||||||
query = "/h5ai/php/zipcontent.php?hrefs=" + query;
|
if ($selected.size() > 0) {
|
||||||
$("#download").show().find("a").attr("href", query);
|
$selected.each(function () {
|
||||||
|
href = $(this).attr("href");
|
||||||
|
query = query ? query + ":" + href : href;
|
||||||
|
});
|
||||||
|
query = "/h5ai/php/zipcontent.php?hrefs=" + query;
|
||||||
|
$("#download").show().find("a").attr("href", query);
|
||||||
|
} else {
|
||||||
|
$("#download").hide().find("a").attr("href", "#");
|
||||||
|
}
|
||||||
},
|
},
|
||||||
selectionUpdate = function (event) {
|
selectionUpdate = function (event) {
|
||||||
|
|
||||||
@@ -316,41 +331,45 @@ Objects.H5ai = function (options, langs) {
|
|||||||
$("#selection-rect").css({left: l, top: t, width: w, height: h});
|
$("#selection-rect").css({left: l, top: t, width: w, height: h});
|
||||||
|
|
||||||
sel = $("#selection-rect").fracs("rect");
|
sel = $("#selection-rect").fracs("rect");
|
||||||
$("#extended a").removeClass("selected").each(function () {
|
$("#extended a").removeClass("selecting").each(function () {
|
||||||
|
|
||||||
var $a = $(this),
|
var $a = $(this),
|
||||||
rect = $a.fracs("rect"),
|
rect = $a.fracs("rect"),
|
||||||
inter = sel.intersection(rect);
|
inter = sel.intersection(rect);
|
||||||
if (inter && !$a.closest(".entry").hasClass("folder-parent")) {
|
if (inter && !$a.closest(".entry").hasClass("folder-parent")) {
|
||||||
$a.addClass("selected");
|
$a.addClass("selecting");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
selectionEnd = function (event) {
|
selectionEnd = function (event) {
|
||||||
|
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
$document.unbind("mousemove", selectionUpdate);
|
||||||
$("#selection-rect").hide().css({left: 0, top: 0, width: 0, height: 0});
|
$("#selection-rect").hide().css({left: 0, top: 0, width: 0, height: 0});
|
||||||
|
$("#extended a.selecting.selected").removeClass("selecting").removeClass("selected");
|
||||||
$window.unbind("mousemove", selectionUpdate);
|
$("#extended a.selecting").removeClass("selecting").addClass("selected");
|
||||||
|
updateDownloadBtn();
|
||||||
var hrefs = [];
|
|
||||||
$("#extended a.selected").each(function () {
|
|
||||||
hrefs.push($(this).attr("href"));
|
|
||||||
});
|
|
||||||
if (hrefs.length > 0) {
|
|
||||||
selected(hrefs);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
selectionStart = function (event) {
|
selectionStart = function (event) {
|
||||||
|
|
||||||
event.preventDefault();
|
var view = $.fracs.viewport();
|
||||||
|
|
||||||
x = event.pageX;
|
x = event.pageX;
|
||||||
y = event.pageY;
|
y = event.pageY;
|
||||||
$("#download").hide().find("a").attr("href", "#");
|
if (x >= view.right || y >= view.bottom) {
|
||||||
$("#extended a").removeClass("selected");
|
// don't block the scrollbars
|
||||||
$("#selection-rect").show().css({left: x, top: y, width: 0, height: 0});
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$window
|
event.preventDefault();
|
||||||
|
if (!ctrl) {
|
||||||
|
$("#extended a").removeClass("selected");
|
||||||
|
updateDownloadBtn();
|
||||||
|
}
|
||||||
|
$("#selection-rect").show().css({left: x, top: y, width: 0, height: 0});
|
||||||
|
selectionUpdate(event);
|
||||||
|
|
||||||
|
$document
|
||||||
.bind("mousemove", selectionUpdate)
|
.bind("mousemove", selectionUpdate)
|
||||||
.one("mouseup", selectionEnd);
|
.one("mouseup", selectionEnd);
|
||||||
},
|
},
|
||||||
@@ -358,12 +377,29 @@ Objects.H5ai = function (options, langs) {
|
|||||||
|
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
return false;
|
return false;
|
||||||
|
},
|
||||||
|
noSelectionUnlessCtrl = function (event) {
|
||||||
|
|
||||||
|
if (!ctrl) {
|
||||||
|
noSelection(event);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
if (settings.zippedDownload) {
|
if (settings.zippedDownload) {
|
||||||
$("body>nav,body>footer,#tree,#extended a").bind("mousedown", noSelection);
|
$("body>nav,body>footer,#tree").bind("mousedown", noSelection);
|
||||||
$("#extended a").live("mousedown", noSelection);
|
$("#extended .entry a").bind("mousedown", noSelectionUnlessCtrl).live("mousedown", noSelectionUnlessCtrl);
|
||||||
$window.bind("mousedown", selectionStart);
|
$document
|
||||||
|
.bind("mousedown", selectionStart)
|
||||||
|
.keydown(function (event) {
|
||||||
|
if (event.keyCode === 17) {
|
||||||
|
ctrl = true;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.keyup(function (event) {
|
||||||
|
if (event.keyCode === 17) {
|
||||||
|
ctrl = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
init = function () {
|
init = function () {
|
||||||
@@ -377,16 +413,15 @@ Objects.H5ai = function (options, langs) {
|
|||||||
localize(langs, settings.lang, settings.useBrowserLang);
|
localize(langs, settings.lang, settings.useBrowserLang);
|
||||||
initIndicators();
|
initIndicators();
|
||||||
initZippedDownload();
|
initZippedDownload();
|
||||||
},
|
|
||||||
h5ai = {
|
|
||||||
settings: settings,
|
|
||||||
shiftTree: shiftTree,
|
|
||||||
linkHoverStates: linkHoverStates,
|
|
||||||
pathClick: pathClick,
|
|
||||||
triggerPathClick: triggerPathClick,
|
|
||||||
initIndicators: initIndicators,
|
|
||||||
init: init
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return h5ai;
|
return {
|
||||||
|
settings: settings,
|
||||||
|
shiftTree: shiftTree,
|
||||||
|
linkHoverStates: linkHoverStates,
|
||||||
|
pathClick: pathClick,
|
||||||
|
triggerPathClick: triggerPathClick,
|
||||||
|
initIndicators: initIndicators,
|
||||||
|
init: init
|
||||||
|
};
|
||||||
};
|
};
|
260
src/h5ai/js/inc/Html.js
Normal file
260
src/h5ai/js/inc/Html.js
Normal file
@@ -0,0 +1,260 @@
|
|||||||
|
/*global $, H5aiJs */
|
||||||
|
|
||||||
|
H5aiJs.factory.Html = function () {
|
||||||
|
|
||||||
|
var imagesPath = "/h5ai/images",
|
||||||
|
iconsPath = "/h5ai/icons",
|
||||||
|
image = function (id) {
|
||||||
|
|
||||||
|
return imagesPath + "/" + id + ".png";
|
||||||
|
},
|
||||||
|
icon = function (id, big) {
|
||||||
|
|
||||||
|
return iconsPath + "/" + (big ? "48x48" : "16x16") + "/" + id + ".png";
|
||||||
|
},
|
||||||
|
onClick = function (path, context) {
|
||||||
|
|
||||||
|
H5aiJs.h5ai.triggerPathClick(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' />")
|
||||||
|
.data("path", path)
|
||||||
|
.addClass(path.isFolder ? "folder" : "file");
|
||||||
|
|
||||||
|
if (path.status) {
|
||||||
|
$html.data("status", path.status);
|
||||||
|
}
|
||||||
|
|
||||||
|
$a = $("<a><img src='" + image("crumb") + "' alt='>' />" + path.label + "</a>")
|
||||||
|
.appendTo($html)
|
||||||
|
.attr("href", path.absHref)
|
||||||
|
.click(function() { onClick(path, "crumb"); });
|
||||||
|
|
||||||
|
if (path.isDomain) {
|
||||||
|
$html.addClass("domain");
|
||||||
|
$a.find("img").attr("src", image("home"));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (path.isCurrentFolder) {
|
||||||
|
$html.addClass("current");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isNaN(path.status)) {
|
||||||
|
if (path.status === 200) {
|
||||||
|
$("<img class='hint' src='" + image("page") + "' alt='not listable' />").appendTo($a);
|
||||||
|
} else {
|
||||||
|
$("<span class='hint'>(" + path.status + ")</span>").appendTo($a);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (path.html.$crumb) {
|
||||||
|
path.html.$crumb.replaceWith($html);
|
||||||
|
}
|
||||||
|
path.html.$crumb = $html;
|
||||||
|
|
||||||
|
return $html;
|
||||||
|
},
|
||||||
|
updateExtendedHtml = function (path) {
|
||||||
|
|
||||||
|
var $html, $a, $label;
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
$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 src='" + path.icon16 + "' alt='" + path.alt + "' /></span>"))
|
||||||
|
.append($("<span class='icon big'><img src='" + path.icon48 + "' alt='" + path.alt + "' /></span>"))
|
||||||
|
.append($label)
|
||||||
|
.append($("<span class='date'>" + path.date + "</span>"))
|
||||||
|
.append($("<span class='size'>" + 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 (!H5aiJs.h5ai.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", icon("folder-page"));
|
||||||
|
$a.find(".icon.big img").attr("src", 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);
|
||||||
|
}
|
||||||
|
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() { path.onClick(path, "tree"); })
|
||||||
|
.appendTo($html)
|
||||||
|
.append($("<span class='icon'><img src='" + path.icon16 + "' /></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='" + image("tree") + "' /></span>")
|
||||||
|
.click(function (event) {
|
||||||
|
|
||||||
|
var $entry = $indicator.closest(".entry"); // $html
|
||||||
|
|
||||||
|
if ($indicator.hasClass("unknown")) {
|
||||||
|
H5aiJs.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", icon("folder-home"));
|
||||||
|
}
|
||||||
|
|
||||||
|
// is path the current folder?
|
||||||
|
if (path.isCurrentFolder) {
|
||||||
|
$html.addClass("current");
|
||||||
|
$a.find(".icon img").attr("src", 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", icon("folder-page"));
|
||||||
|
$a.append($("<span class='hint'><img src='" + 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
|
||||||
|
};
|
||||||
|
};
|
96
src/h5ai/js/inc/Path.js
Normal file
96
src/h5ai/js/inc/Path.js
Normal file
@@ -0,0 +1,96 @@
|
|||||||
|
/*global $, H5aiJs */
|
||||||
|
|
||||||
|
H5aiJs.factory.Path = function (folder, tableRow) {
|
||||||
|
|
||||||
|
var checkedDecodeUri = function (uri) {
|
||||||
|
|
||||||
|
try { return decodeURI(uri); } catch (err) {}
|
||||||
|
return uri;
|
||||||
|
},
|
||||||
|
$tds, $img, $a, splits;
|
||||||
|
|
||||||
|
// parentFolder: undefined,
|
||||||
|
// label: undefined,
|
||||||
|
// date: undefined,
|
||||||
|
// size: undefined,
|
||||||
|
// href: undefined,
|
||||||
|
// absHref: undefined,
|
||||||
|
// alt: undefined,
|
||||||
|
// icon16: undefined,
|
||||||
|
// icon48: undefined,
|
||||||
|
// isFolder: undefined,
|
||||||
|
// isParentFolder: undefined,
|
||||||
|
// isCurrentFolder: undefined,
|
||||||
|
// isDomain: undefined,
|
||||||
|
|
||||||
|
this.status = undefined; // undefined, "h5ai" or HTTP response code
|
||||||
|
this.content = undefined; // associative array path.absHref -> path
|
||||||
|
this.html = {
|
||||||
|
$crumb: undefined,
|
||||||
|
$extended: undefined,
|
||||||
|
$tree: undefined
|
||||||
|
};
|
||||||
|
this.treeOpen = false;
|
||||||
|
|
||||||
|
if (!H5aiJs.pathCache.pathEndsWithSlash(folder)) {
|
||||||
|
folder += "/";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tableRow) {
|
||||||
|
$tds = $(tableRow).find("td");
|
||||||
|
$img = $tds.eq(0).find("img");
|
||||||
|
$a = $tds.eq(1).find("a");
|
||||||
|
|
||||||
|
this.parentFolder = folder;
|
||||||
|
this.label = $a.text();
|
||||||
|
this.date = $tds.eq(2).text();
|
||||||
|
this.size = $tds.eq(3).text();
|
||||||
|
this.href = $a.attr("href");
|
||||||
|
this.alt = $img.attr("alt");
|
||||||
|
this.icon16 = $img.attr("src");
|
||||||
|
} else {
|
||||||
|
splits = H5aiJs.pathCache.splitPathname(folder);
|
||||||
|
|
||||||
|
this.parentFolder = splits[0];
|
||||||
|
this.label = checkedDecodeUri(splits[1]);
|
||||||
|
if (this.label === "/") {
|
||||||
|
this.label = checkedDecodeUri(document.domain) + "/";
|
||||||
|
}
|
||||||
|
this.date = "";
|
||||||
|
this.size = "";
|
||||||
|
this.href = splits[1];
|
||||||
|
this.alt = "[DIR]";
|
||||||
|
this.icon16 = "/h5ai/icons/16x16/folder.png";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (H5aiJs.pathCache.pathEndsWithSlash(this.label)) {
|
||||||
|
this.label = this.label.slice(0, -1);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.icon48 = this.icon16.replace("16x16", "48x48");
|
||||||
|
this.isFolder = (this.alt === "[DIR]");
|
||||||
|
this.isParentFolder = (this.isFolder && this.label === "Parent Directory");
|
||||||
|
this.absHref = this.isParentFolder ? this.href : this.parentFolder + this.href;
|
||||||
|
this.isCurrentFolder = (this.absHref === document.location.pathname);
|
||||||
|
this.isDomain = (this.absHref === "/");
|
||||||
|
|
||||||
|
if (this.isParentFolder && H5aiJs.h5ai.settings.setParentFolderLabels) {
|
||||||
|
if (this.isDomain) {
|
||||||
|
this.label = checkedDecodeUri(document.domain);
|
||||||
|
} else {
|
||||||
|
this.label = checkedDecodeUri(H5aiJs.pathCache.splitPathname(H5aiJs.pathCache.splitPathname(this.parentFolder)[0])[1].slice(0, -1));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
H5aiJs.factory.Path.prototype = {
|
||||||
|
|
||||||
|
isEmpty: function () {
|
||||||
|
|
||||||
|
return !this.content || $.isEmptyObject(this.content);
|
||||||
|
},
|
||||||
|
onClick: function (context) {
|
||||||
|
|
||||||
|
H5aiJs.h5ai.triggerPathClick(this, context);
|
||||||
|
}
|
||||||
|
};
|
56
src/h5ai/js/inc/PathCache.js
Normal file
56
src/h5ai/js/inc/PathCache.js
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
/*global $, H5aiJs */
|
||||||
|
|
||||||
|
H5aiJs.factory.PathCache = function () {
|
||||||
|
|
||||||
|
var cache = {},
|
||||||
|
rePathnameSplit = /^(\/(.*\/)*)([^\/]+\/?)$/,
|
||||||
|
rePathEndsWithSlash = /\/$/,
|
||||||
|
splitPathname = function (pathname) {
|
||||||
|
|
||||||
|
var match;
|
||||||
|
|
||||||
|
if (pathname === "/") {
|
||||||
|
return ["", "/"];
|
||||||
|
}
|
||||||
|
match = rePathnameSplit.exec(pathname);
|
||||||
|
return [match[1], match[3]];
|
||||||
|
},
|
||||||
|
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;
|
||||||
|
},
|
||||||
|
getPath = function (folder, tableRow) {
|
||||||
|
|
||||||
|
var absHref = getAbsHref(folder, tableRow),
|
||||||
|
path = cache[absHref];
|
||||||
|
|
||||||
|
if (!path) {
|
||||||
|
path = new H5aiJs.factory.Path(folder, tableRow);
|
||||||
|
if (!path.isParentFolder) {
|
||||||
|
cache[path.absHref] = path;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return path;
|
||||||
|
};
|
||||||
|
|
||||||
|
this.splitPathname = splitPathname;
|
||||||
|
this.pathEndsWithSlash = pathEndsWithSlash;
|
||||||
|
this.getPath = getPath;
|
||||||
|
this.cache = cache;
|
||||||
|
};
|
@@ -1,30 +0,0 @@
|
|||||||
/*global window, jQuery */
|
|
||||||
|
|
||||||
(function ($) {
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
// http://paulirish.com/2009/log-a-lightweight-wrapper-for-consolelog/
|
|
||||||
// modified
|
|
||||||
$.log = function () {
|
|
||||||
$.log.history = $.log.history || [];
|
|
||||||
$.log.history.push(arguments);
|
|
||||||
if (window.console) {
|
|
||||||
window.console.log(Array.prototype.slice.call(arguments));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
$.timer = (function () {
|
|
||||||
var start = $.now(),
|
|
||||||
last = start,
|
|
||||||
timer = {
|
|
||||||
log: function (label) {
|
|
||||||
var now = $.now();
|
|
||||||
$.log("timer", label, "+" + (now - last), "=" + (now - start));
|
|
||||||
last = now;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
return timer;
|
|
||||||
}());
|
|
||||||
|
|
||||||
}(jQuery));
|
|
10
src/h5ai/js/inc/lib/amplify.min.js
vendored
Normal file
10
src/h5ai/js/inc/lib/amplify.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
@@ -1,7 +1,7 @@
|
|||||||
/*global window, jQuery */
|
|
||||||
|
|
||||||
(function ($) {
|
(function ($) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
/*global window, jQuery */
|
||||||
|
|
||||||
var init = function (htmlElement) {
|
var init = function (htmlElement) {
|
||||||
|
|
@@ -1,404 +0,0 @@
|
|||||||
/*global $, Objects */
|
|
||||||
|
|
||||||
Objects.Path = function (pathCache, folder, tableRow) {
|
|
||||||
|
|
||||||
var path,
|
|
||||||
checkedDecodeUri = function (uri) {
|
|
||||||
|
|
||||||
try { return decodeURI(uri); } catch (err) {}
|
|
||||||
return uri;
|
|
||||||
},
|
|
||||||
isEmpty = function () {
|
|
||||||
|
|
||||||
return !path.content || $.isEmptyObject(path.content);
|
|
||||||
},
|
|
||||||
onClick = function (context) {
|
|
||||||
|
|
||||||
h5ai.triggerPathClick(path, context);
|
|
||||||
},
|
|
||||||
updateHtml = function () {
|
|
||||||
|
|
||||||
path.updateCrumbHtml();
|
|
||||||
path.updateExtendedHtml();
|
|
||||||
path.updateTreeHtml();
|
|
||||||
},
|
|
||||||
updateCrumbHtml = function () {
|
|
||||||
|
|
||||||
var $html, $a;
|
|
||||||
|
|
||||||
if (path.html.$crumb && path.html.$crumb.data("status") === path.status) {
|
|
||||||
return path.html.$crumb;
|
|
||||||
}
|
|
||||||
|
|
||||||
$html = $("<li class='crumb' />")
|
|
||||||
.data("path", path)
|
|
||||||
.addClass(path.isFolder ? "folder" : "file");
|
|
||||||
|
|
||||||
if (path.status) {
|
|
||||||
$html.data("status", path.status);
|
|
||||||
}
|
|
||||||
|
|
||||||
$a = $("<a><img src='/h5ai/images/crumb.png' alt='>' />" + path.label + "</a>")
|
|
||||||
.appendTo($html)
|
|
||||||
.attr("href", path.absHref)
|
|
||||||
.click(function() { onClick("crumb"); });
|
|
||||||
|
|
||||||
if (path.isDomain) {
|
|
||||||
$html.addClass("domain");
|
|
||||||
$a.find("img").attr("src", "/h5ai/images/home.png");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (path.isCurrentFolder) {
|
|
||||||
$html.addClass("current");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!isNaN(path.status)) {
|
|
||||||
if (path.status === 200) {
|
|
||||||
$("<img class='hint' src='/h5ai/images/page.png' alt='not listable' />").appendTo($a);
|
|
||||||
} else {
|
|
||||||
$("<span class='hint'>(" + path.status + ")</span>").appendTo($a);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (path.html.$crumb) {
|
|
||||||
path.html.$cpathreplaceWith($html);
|
|
||||||
}
|
|
||||||
path.html.$crumb = $html;
|
|
||||||
|
|
||||||
return $html;
|
|
||||||
},
|
|
||||||
updateExtendedHtml = function () {
|
|
||||||
|
|
||||||
var $html, $a, $label;
|
|
||||||
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
$label = $("<span class='label'>" + path.label + "</span>");
|
|
||||||
$a = $("<a />")
|
|
||||||
.attr("href", path.absHref)
|
|
||||||
.click(function() { onClick("extended"); })
|
|
||||||
.appendTo($html)
|
|
||||||
.append($("<span class='icon small'><img src='" + path.icon16 + "' alt='" + path.alt + "' /></span>"))
|
|
||||||
.append($("<span class='icon big'><img src='" + path.icon48 + "' alt='" + path.alt + "' /></span>"))
|
|
||||||
.append($label)
|
|
||||||
.append($("<span class='date'>" + path.date + "</span>"))
|
|
||||||
.append($("<span class='size'>" + 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.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/icons/16x16/folder-page.png");
|
|
||||||
$a.find(".icon.big img").attr("src", "/h5ai/icons/48x48/folder-page.png");
|
|
||||||
} else {
|
|
||||||
$html.addClass("error");
|
|
||||||
$label.append($("<span class='hint'> " + path.status + " </span>"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (path.html.$extended) {
|
|
||||||
path.html.$extended.replaceWith($html);
|
|
||||||
}
|
|
||||||
path.html.$extended = $html;
|
|
||||||
|
|
||||||
return $html;
|
|
||||||
},
|
|
||||||
updateTreeHtml = function () {
|
|
||||||
|
|
||||||
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() { path.onClick("tree"); })
|
|
||||||
.appendTo($html)
|
|
||||||
.append($("<span class='icon'><img src='" + path.icon16 + "' /></span>"))
|
|
||||||
.append($("<span class='label'>" + path.label + "</span>"));
|
|
||||||
|
|
||||||
if (path.isFolder) {
|
|
||||||
// indicator
|
|
||||||
if (path.status === undefined || !path.isEmpty()) {
|
|
||||||
$indicator = $("<span class='indicator'><img src='/h5ai/images/tree.png' /></span>");
|
|
||||||
if (path.status === undefined) {
|
|
||||||
$indicator.addClass("unknown");
|
|
||||||
} else if (path.treeOpen) {
|
|
||||||
$indicator.addClass("open");
|
|
||||||
}
|
|
||||||
|
|
||||||
$indicator.click(function(event) {
|
|
||||||
|
|
||||||
if ($indicator.hasClass("unknown")) {
|
|
||||||
tree.fetchStatusAndContent(path.absHref, false, function (status, content) {
|
|
||||||
|
|
||||||
path.status = status;
|
|
||||||
path.content = content;
|
|
||||||
path.treeOpen = true;
|
|
||||||
$("#tree").get(0).updateScrollbar(true);
|
|
||||||
path.updateTreeHtml(function() {
|
|
||||||
|
|
||||||
$("#tree").get(0).updateScrollbar();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
} else if ($indicator.hasClass("open")) {
|
|
||||||
path.treeOpen = false;
|
|
||||||
$indicator.removeClass("open");
|
|
||||||
$("#tree").get(0).updateScrollbar(true);
|
|
||||||
$html.find("> ul.content").slideUp(function() {
|
|
||||||
|
|
||||||
$("#tree").get(0).updateScrollbar();
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
path.treeOpen = true;
|
|
||||||
$indicator.addClass("open");
|
|
||||||
$("#tree").get(0).updateScrollbar(true);
|
|
||||||
$html.find("> ul.content").slideDown(function() {
|
|
||||||
|
|
||||||
$("#tree").get(0).updateScrollbar();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
$html.addClass("initiatedIndicator");
|
|
||||||
|
|
||||||
$blank.replaceWith($indicator);
|
|
||||||
}
|
|
||||||
|
|
||||||
// is path the domain?
|
|
||||||
if (path.isDomain) {
|
|
||||||
$html.addClass("domain");
|
|
||||||
$a.find(".icon img").attr("src", "/h5ai/icons/16x16/folder-home.png");
|
|
||||||
}
|
|
||||||
|
|
||||||
// is path the current folder?
|
|
||||||
if (path.isCurrentFolder) {
|
|
||||||
$html.addClass("current");
|
|
||||||
$a.find(".icon img").attr("src", "/h5ai/icons/16x16/folder-open.png");
|
|
||||||
}
|
|
||||||
|
|
||||||
// does it have subfolders?
|
|
||||||
if (!path.isEmpty()) {
|
|
||||||
$ul = $("<ul class='content' />").appendTo($html);
|
|
||||||
$.each(path.content, function (idx, entry) {
|
|
||||||
$("<li />").append(entry.updateTreeHtml()).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/icons/16x16/folder-page.png");
|
|
||||||
$a.append($("<span class='hint'><img src='/h5ai/images/page.png' /></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;
|
|
||||||
},
|
|
||||||
init = function () {
|
|
||||||
|
|
||||||
var $tds, $img, $a, splits;
|
|
||||||
|
|
||||||
path = {
|
|
||||||
// parentFolder: undefined,
|
|
||||||
// label: undefined,
|
|
||||||
// date: undefined,
|
|
||||||
// size: undefined,
|
|
||||||
// href: undefined,
|
|
||||||
// absHref: undefined,
|
|
||||||
// alt: undefined,
|
|
||||||
// icon16: undefined,
|
|
||||||
// icon48: undefined,
|
|
||||||
// isFolder: undefined,
|
|
||||||
// isParentFolder: undefined,
|
|
||||||
// isCurrentFolder: undefined,
|
|
||||||
// isDomain: undefined,
|
|
||||||
|
|
||||||
status: undefined, // undefined, "h5ai" or HTTP response code
|
|
||||||
content: undefined, // associative array path.absHref -> path
|
|
||||||
html: {
|
|
||||||
$crumb: undefined,
|
|
||||||
$extended: undefined,
|
|
||||||
$tree: undefined
|
|
||||||
},
|
|
||||||
treeOpen: false,
|
|
||||||
|
|
||||||
isEmpty: isEmpty,
|
|
||||||
onClick: onClick,
|
|
||||||
updateHtml: updateHtml,
|
|
||||||
updateCrumbHtml: updateCrumbHtml,
|
|
||||||
updateExtendedHtml: updateExtendedHtml,
|
|
||||||
updateTreeHtml: updateTreeHtml
|
|
||||||
};
|
|
||||||
|
|
||||||
if (!pathCache.pathEndsWithSlash(folder)) {
|
|
||||||
folder += "/";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (tableRow) {
|
|
||||||
$tds = $(tableRow).find("td");
|
|
||||||
$img = $tds.eq(0).find("img");
|
|
||||||
$a = $tds.eq(1).find("a");
|
|
||||||
|
|
||||||
path.parentFolder = folder;
|
|
||||||
path.label = $a.text();
|
|
||||||
path.date = $tds.eq(2).text();
|
|
||||||
path.size = $tds.eq(3).text();
|
|
||||||
path.href = $a.attr("href");
|
|
||||||
path.alt = $img.attr("alt");
|
|
||||||
path.icon16 = $img.attr("src");
|
|
||||||
} else {
|
|
||||||
splits = pathCache.splitPathname(folder);
|
|
||||||
|
|
||||||
path.parentFolder = splits[0];
|
|
||||||
path.label = checkedDecodeUri(splits[1]);
|
|
||||||
if (path.label === "/") {
|
|
||||||
path.label = checkedDecodeUri(document.domain) + "/";
|
|
||||||
}
|
|
||||||
path.date = "";
|
|
||||||
path.size = "";
|
|
||||||
path.href = splits[1];
|
|
||||||
path.alt = "[DIR]";
|
|
||||||
path.icon16 = "/h5ai/icons/16x16/folder.png";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (pathCache.pathEndsWithSlash(path.label)) {
|
|
||||||
path.label = path.label.slice(0, -1);
|
|
||||||
}
|
|
||||||
|
|
||||||
path.icon48 = path.icon16.replace("16x16", "48x48");
|
|
||||||
path.isFolder = (path.alt === "[DIR]");
|
|
||||||
path.isParentFolder = (path.isFolder && path.label === "Parent Directory");
|
|
||||||
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.settings.setParentFolderLabels) {
|
|
||||||
if (path.isDomain) {
|
|
||||||
path.label = checkedDecodeUri(document.domain);
|
|
||||||
} else {
|
|
||||||
path.label = checkedDecodeUri(pathCache.splitPathname(pathCache.splitPathname(path.parentFolder)[0])[1].slice(0, -1));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
init();
|
|
||||||
|
|
||||||
return path;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
Objects.PathCache = function () {
|
|
||||||
|
|
||||||
var pathCache,
|
|
||||||
cache = {},
|
|
||||||
rePathnameSplit = /^(\/(.*\/)*)([^\/]+\/?)$/,
|
|
||||||
rePathEndsWithSlash = /\/$/,
|
|
||||||
splitPathname = function (pathname) {
|
|
||||||
|
|
||||||
var match;
|
|
||||||
|
|
||||||
if (pathname === "/") {
|
|
||||||
return ["", "/"];
|
|
||||||
}
|
|
||||||
match = rePathnameSplit.exec(pathname);
|
|
||||||
return [match[1], match[3]];
|
|
||||||
},
|
|
||||||
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;
|
|
||||||
},
|
|
||||||
getPath = function (folder, tableRow) {
|
|
||||||
|
|
||||||
var absHref = getAbsHref(folder, tableRow),
|
|
||||||
path = cache[absHref];
|
|
||||||
|
|
||||||
if (!path) {
|
|
||||||
path = new Objects.Path(pathCache, folder, tableRow);
|
|
||||||
if (!path.isParentFolder) {
|
|
||||||
cache[path.absHref] = path;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return path;
|
|
||||||
};
|
|
||||||
|
|
||||||
pathCache = {
|
|
||||||
splitPathname: splitPathname,
|
|
||||||
pathEndsWithSlash: pathEndsWithSlash,
|
|
||||||
getPath: getPath,
|
|
||||||
cache: cache
|
|
||||||
};
|
|
||||||
|
|
||||||
return pathCache;
|
|
||||||
};
|
|
4
src/h5ai/js/lib/modernizr.min.js
vendored
4
src/h5ai/js/lib/modernizr.min.js
vendored
File diff suppressed because one or more lines are too long
7
src/h5ai/js/libs.js
Normal file
7
src/h5ai/js/libs.js
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
|
||||||
|
// @include "inc/lib/jquery.min.js"
|
||||||
|
// @include "inc/lib/jquery.mousewheel.min.js"
|
||||||
|
// @include "inc/lib/jquery.fracs-core.min.js"
|
||||||
|
// @include "inc/lib/jquery.scrollpanel.js"
|
||||||
|
|
||||||
|
// @include "inc/lib/amplify.min.js"
|
@@ -1,33 +1,37 @@
|
|||||||
/*global jQuery, h5aiOptions, h5aiLangs*/
|
|
||||||
|
|
||||||
// @include "inc/jquery.scrollpanel.js"
|
|
||||||
// @include "inc/jquery.utils.js"
|
|
||||||
|
|
||||||
(function($) {
|
(function($) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
var Objects = {},
|
var H5aiJs = {
|
||||||
pathCache, h5ai, extended, tree;
|
factory: {},
|
||||||
|
init: function () {
|
||||||
|
|
||||||
// @include "inc/h5ai.js"
|
this.h5ai = new this.factory.H5ai(h5aiOptions, h5aiLangs);
|
||||||
// @include "inc/path.js"
|
this.pathCache = new this.factory.PathCache();
|
||||||
// @include "inc/extended.js"
|
this.connector = new this.factory.Connector();
|
||||||
// @include "inc/tree.js"
|
this.html = new this.factory.Html();
|
||||||
|
this.extended = new this.factory.Extended();
|
||||||
|
|
||||||
pathCache = new Objects.PathCache();
|
this.extended.init();
|
||||||
h5ai = new Objects.H5ai(h5aiOptions, h5aiLangs);
|
this.connector.init();
|
||||||
extended = new Objects.Extended(pathCache, h5ai);
|
this.h5ai.init();
|
||||||
tree = new Objects.Tree(pathCache, h5ai);
|
|
||||||
|
|
||||||
$.h5ai = {
|
$.h5ai = {
|
||||||
click: $.proxy(h5ai.pathClick, h5ai)
|
click: $.proxy(this.h5ai.pathClick, this.h5ai)
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// @include "inc/H5ai.js"
|
||||||
|
// @include "inc/Path.js"
|
||||||
|
// @include "inc/PathCache.js"
|
||||||
|
// @include "inc/Connector.js"
|
||||||
|
// @include "inc/Html.js"
|
||||||
|
// @include "inc/Extended.js"
|
||||||
|
|
||||||
$(function () {
|
$(function () {
|
||||||
|
|
||||||
extended.init();
|
H5aiJs.init();
|
||||||
tree.init();
|
|
||||||
h5ai.init();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
}(jQuery));
|
}(jQuery));
|
||||||
|
@@ -1,27 +1,28 @@
|
|||||||
/*global jQuery, h5aiOptions, h5aiLangs*/
|
|
||||||
|
|
||||||
// @include "inc/jquery.scrollpanel.js"
|
|
||||||
// @include "inc/jquery.utils.js"
|
|
||||||
|
|
||||||
(function($) {
|
(function($) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
var Objects = {},
|
var H5aiJs = {
|
||||||
h5ai;
|
factory: {},
|
||||||
|
init: function () {
|
||||||
|
|
||||||
// @include "inc/h5ai.js"
|
this.h5ai = new this.factory.H5ai(h5aiOptions, h5aiLangs);
|
||||||
|
|
||||||
h5ai = new Objects.H5ai(h5aiOptions, h5aiLangs);
|
this.h5ai.init();
|
||||||
|
$("#tree").scrollpanel();
|
||||||
|
this.h5ai.shiftTree(false, true);
|
||||||
|
|
||||||
$.h5ai = {
|
$.h5ai = {
|
||||||
click: $.proxy(h5ai.pathClick, h5ai)
|
click: $.proxy(this.h5ai.pathClick, this.h5ai)
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// @include "inc/H5ai.js"
|
||||||
|
|
||||||
$(function () {
|
$(function () {
|
||||||
|
|
||||||
h5ai.init();
|
H5aiJs.init();
|
||||||
$("#tree").scrollpanel();
|
|
||||||
h5ai.shiftTree(false, true);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
}(jQuery));
|
}(jQuery));
|
||||||
|
4
src/h5ai/js/modernizr.min.js
vendored
Normal file
4
src/h5ai/js/modernizr.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
@@ -57,7 +57,7 @@ h5aiOptions = {
|
|||||||
* possible values. Adjust it to your needs. If lang is not found in
|
* possible values. Adjust it to your needs. If lang is not found in
|
||||||
* h5aiLangs it defaults to "en".
|
* h5aiLangs it defaults to "en".
|
||||||
*/
|
*/
|
||||||
"lang": null,
|
"lang": "en",
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Try to use browser language, falls back to previous specified lang.
|
* Try to use browser language, falls back to previous specified lang.
|
||||||
@@ -103,7 +103,7 @@ h5aiOptions = {
|
|||||||
* Enable zipped download of selected entries. Requieres
|
* Enable zipped download of selected entries. Requieres
|
||||||
* PHP on the server.
|
* PHP on the server.
|
||||||
*/
|
*/
|
||||||
"zippedDownload": true
|
"zippedDownload": false
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -194,7 +194,7 @@ h5aiLangs = {
|
|||||||
"empty": "vide",
|
"empty": "vide",
|
||||||
"folders": "Répertoires",
|
"folders": "Répertoires",
|
||||||
"files": "Fichiers",
|
"files": "Fichiers",
|
||||||
"download": "download"
|
"download": "télécharger"
|
||||||
},
|
},
|
||||||
|
|
||||||
"it": {
|
"it": {
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
if (!array_key_exists("hrefs", $_REQUEST)) {
|
if (!array_key_exists("hrefs", $_REQUEST)) {
|
||||||
echo "failed";
|
echo "1: no href specified";
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -12,7 +12,6 @@ $h5ai = new H5ai();
|
|||||||
$zipit = new ZipIt($h5ai);
|
$zipit = new ZipIt($h5ai);
|
||||||
|
|
||||||
$hrefs = explode(":", trim($_REQUEST["hrefs"]));
|
$hrefs = explode(":", trim($_REQUEST["hrefs"]));
|
||||||
|
|
||||||
$zipFile = $zipit->zip($hrefs);
|
$zipFile = $zipit->zip($hrefs);
|
||||||
|
|
||||||
if ($zipFile !== false) {
|
if ($zipFile !== false) {
|
||||||
@@ -22,7 +21,7 @@ if ($zipFile !== false) {
|
|||||||
header("Connection: close");
|
header("Connection: close");
|
||||||
readfile($zipFile);
|
readfile($zipFile);
|
||||||
} else {
|
} else {
|
||||||
echo "sorry, something went wrong while building the zip.";
|
echo "2: something went wrong while building the zip";
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
@@ -27,7 +27,8 @@ IndexIgnore h5ai h5ai.header.html h5ai.footer.html
|
|||||||
# table options
|
# table options
|
||||||
################################
|
################################
|
||||||
|
|
||||||
# syntax for default sort order is: IndexOrderDefault Ascending|Descending Name|Date|Size
|
# syntax for default sort order is:
|
||||||
|
# IndexOrderDefault Ascending|Descending Name|Date|Size
|
||||||
IndexOrderDefault Ascending Name
|
IndexOrderDefault Ascending Name
|
||||||
|
|
||||||
IndexOptions Type=text/html;h5ai=%BUILD_VERSION%
|
IndexOptions Type=text/html;h5ai=%BUILD_VERSION%
|
||||||
|
@@ -6,7 +6,7 @@
|
|||||||
<attribute name="toFile" />
|
<attribute name="toFile" />
|
||||||
<attribute name="args" default="" />
|
<attribute name="args" default="" />
|
||||||
<sequential>
|
<sequential>
|
||||||
<exec executable="${wepp}">
|
<exec executable="${tool.wepp}">
|
||||||
<arg line="@{args}" />
|
<arg line="@{args}" />
|
||||||
<arg value="--in" />
|
<arg value="--in" />
|
||||||
<arg value="@{file}" />
|
<arg value="@{file}" />
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
<attribute name="dir" />
|
<attribute name="dir" />
|
||||||
<attribute name="args" default="" />
|
<attribute name="args" default="" />
|
||||||
<sequential>
|
<sequential>
|
||||||
<exec executable="${wepp}">
|
<exec executable="${tool.wepp}">
|
||||||
<arg line="@{args}" />
|
<arg line="@{args}" />
|
||||||
<arg value="--inDir" />
|
<arg value="--inDir" />
|
||||||
<arg value="@{dir}" />
|
<arg value="@{dir}" />
|
||||||
|
Reference in New Issue
Block a user