added jquery-treeview to bower, misc dependencies cleanup

This commit is contained in:
Florian BLOUET
2015-11-17 19:01:14 +01:00
parent aade2f7884
commit 5a34aa786a
46 changed files with 61 additions and 6534 deletions

View File

@@ -24,9 +24,10 @@
"tinymce": "~4.0", "tinymce": "~4.0",
"jquery-galleria": "1.2.9", "jquery-galleria": "1.2.9",
"jquery.cookie": "~1.4", "jquery.cookie": "~1.4",
"jquery.treeview": "1.4.1",
"fancytree": "~2.7", "fancytree": "~2.7",
"bootstrap-sass": "v2.3.2.2" "bootstrap-sass": "v2.3.2.2",
"jquery.lazyload": "~1.9.7",
"jquery-treeview": "~1.4.2"
}, },
"devDependencies": { "devDependencies": {
"mocha": "latest", "mocha": "latest",

View File

@@ -59,5 +59,6 @@ gulp.task('build-vendors', [
'build-geonames-server-jquery-plugin', 'build-geonames-server-jquery-plugin',
'build-jquery-cookie', 'build-jquery-cookie',
'build-requirejs', 'build-requirejs',
'build-jquery-treeview' 'build-jquery-treeview',
'build-jquery-lazyload'
], function() {}); ], function() {});

View File

@@ -14,7 +14,7 @@ gulp.task('copy-common-fonts',function(){
gulp.task('build-common-font-css', ['copy-common-fonts'],function(){ gulp.task('build-common-font-css', ['copy-common-fonts'],function(){
return gulp.src([config.paths.vendors + 'font-awesome/css/font-awesome-ie7.min.css']) return gulp.src([config.paths.vendors + 'font-awesome/css/font-awesome-ie7.min.css'])
.pipe(gulp.dest( config.paths.distVendors + 'common/css')); .pipe(gulp.dest( config.paths.build + 'common/css'));
}); });
gulp.task('build-common-css', ['build-common-font-css'],function(){ gulp.task('build-common-css', ['build-common-font-css'],function(){

View File

@@ -30,12 +30,13 @@ gulp.task('build-prod', ['copy-prod-images', 'build-prod-css'], function(){
var prodGroup = [ var prodGroup = [
config.paths.vendors + 'underscore-amd/underscore.js', config.paths.vendors + 'underscore-amd/underscore.js',
config.paths.dist + 'include/jslibs/colorpicker/js/colorpicker.js', config.paths.dist + 'include/jslibs/colorpicker/js/colorpicker.js',
config.paths.dist + 'include/jslibs/jquery.lazyload/jquery.lazyload.1.8.1.js', config.paths.vendors + 'jquery.lazyload/jquery.lazyload.js',
// config.paths.dist + 'include/jslibs/jquery.lazyload/jquery.lazyload.1.8.1.js',
config.paths.vendors + 'humane-js/humane.js', // @TODO > extra files config.paths.vendors + 'humane-js/humane.js', // @TODO > extra files
config.paths.vendors + 'blueimp-load-image/js/load-image.js', // @TODO > extra files config.paths.vendors + 'blueimp-load-image/js/load-image.js', // @TODO > extra files
config.paths.vendors + 'jquery-file-upload/js/jquery.iframe-transport.js', config.paths.vendors + 'jquery-file-upload/js/jquery.iframe-transport.js',
config.paths.vendors + 'jquery-file-upload/js/jquery.fileupload.js', config.paths.vendors + 'jquery-file-upload/js/jquery.fileupload.js',
config.paths.dist + 'include/jslibs/jquery.form.2.49.js', config.paths.src + 'prod/js/jquery.form.2.49.js',
config.paths.src + 'prod/js/jquery.Selection.js', config.paths.src + 'prod/js/jquery.Selection.js',
config.paths.src + 'prod/js/jquery.Edit.js', config.paths.src + 'prod/js/jquery.Edit.js',
config.paths.src + 'prod/js/jquery.lists.js', config.paths.src + 'prod/js/jquery.lists.js',
@@ -51,10 +52,10 @@ gulp.task('build-prod', ['copy-prod-images', 'build-prod-css'], function(){
config.paths.dist + 'include/jslibs/jquery.sprintf.1.0.3.js', config.paths.dist + 'include/jslibs/jquery.sprintf.1.0.3.js',
config.paths.dist + 'include/jquery.p4.preview.js', config.paths.dist + 'include/jquery.p4.preview.js',
config.paths.src + 'prod/js/record.editor.js', config.paths.src + 'prod/js/record.editor.js',
config.paths.dist + 'include/jslibs/jquery.color.animation.js', config.paths.src + 'prod/js/jquery.color.animation.js',
config.paths.dist + 'include/jquery.image_enhancer.js', config.paths.dist + 'include/jquery.image_enhancer.js',
config.paths.vendors + 'jquery.treeview/jquery.treeview.js', config.paths.vendors + 'jquery-treeview/jquery.treeview.js',
config.paths.vendors + 'jquery.treeview/jquery.treeview.async.js', config.paths.vendors + 'jquery-treeview/jquery.treeview.async.js',
config.paths.vendors + 'fancytree/dist/jquery.fancytree-all.min.js' config.paths.vendors + 'fancytree/dist/jquery.fancytree-all.min.js'
]; ];
return utils.buildJsGroup(prodGroup, 'prod', 'prod/js'); return utils.buildJsGroup(prodGroup, 'prod', 'prod/js');

View File

@@ -0,0 +1,9 @@
var gulp = require('gulp');
var config = require('../../config.js');
var utils = require('../../utils.js');
gulp.task('build-jquery-lazyload', function(){
return utils.buildJsGroup([
config.paths.vendors + 'jquery.lazyload/jquery.lazyload.js'
], 'jquery.lazyload', 'vendors/jquery.lazyload');
});

View File

@@ -2,8 +2,16 @@ var gulp = require('gulp');
var config = require('../../config.js'); var config = require('../../config.js');
var utils = require('../../utils.js'); var utils = require('../../utils.js');
gulp.task('build-jquery-treeview', function(){ gulp.task('copy-jquery-treeview-images', function(){
return gulp.src([config.paths.vendors + 'jquery-treeview/images/**/*'])
.pipe(gulp.dest( config.paths.build + 'vendors/jquery-treeview/images'));
});
gulp.task('build-jquery-treeview', ['copy-jquery-treeview-images'], function(){
// no standalone version used
/*utils.buildJsGroup([
config.paths.vendors + 'jquery-treeview/jquery.treeview.async.js'
], 'jquery.treeview.async', 'vendors/jquery-treeview');*/
return utils.buildJsGroup([ return utils.buildJsGroup([
config.paths.vendors + 'jquery.treeview/jquery.treeview.js' config.paths.vendors + 'jquery-treeview/jquery.treeview.js'
], 'jquery.treeview', 'vendors/jquery.treeview'); ], 'jquery.treeview', 'vendors/jquery-treeview');
}); });

View File

@@ -1,8 +1,7 @@
var gutil = require("gulp-util"); var gutil = require("gulp-util");
var configPaths = { var configPaths = {
src: 'resources/www/', src: 'resources/www/',
vendors: 'tmp-assets/', vendors: 'www/bower_components/',
distVendors: 'www/assets/', //@deprecated
build: 'www/assets/', build: 'www/assets/',
dist: 'www/' dist: 'www/'
}; };

View File

@@ -1,7 +1,7 @@
$skinsPath: '../../../skins/'; $skinsPath: '../../../skins/';
$iconsPath: '../../../assets/common/images/icons/'; $iconsPath: '../../../assets/common/images/icons/';
@import '../../vendors/jquery.treeview/jquery.treeview'; // to inline import css file, don't put extension @import '../../vendors/jquery-treeview/jquery.treeview'; // to inline import css file, don't put extension
@import '../../../../www/bower_components/jquery-file-upload/css/jquery.fileupload-ui'; // to inline import css file, don't put extension @import '../../../../www/bower_components/jquery-file-upload/css/jquery.fileupload-ui'; // to inline import css file, don't put extension
@import '../../shared/styles/jquery.contextmenu'; @import '../../shared/styles/jquery.contextmenu';
@import '../../shared/styles/skin/main'; @import '../../shared/styles/skin/main';

View File

@@ -1,6 +1,6 @@
$iconsPath: '../../../assets/common/images/icons/'; $iconsPath: '../../../assets/common/images/icons/';
@import '../../../../www/bower_components/fancytree/dist/skin-win8/ui.fancytree'; // to inline import css file, don't put extension @import '../../../../www/bower_components/fancytree/dist/skin-win8/ui.fancytree'; // to inline import css file, don't put extension
@import '../../vendors/jquery.treeview/jquery.treeview'; // to inline import css file, don't put extension @import '../../vendors/jquery-treeview/jquery.treeview'; // to inline import css file, don't put extension
@import '../../../../www/bower_components/humane-js/themes/libnotify'; @import '../../../../www/bower_components/humane-js/themes/libnotify';
@import '../../shared/styles/jquery.contextmenu'; @import '../../shared/styles/jquery.contextmenu';
@import '../../shared/styles/jquery.image_enhancer'; @import '../../shared/styles/jquery.image_enhancer';

View File

@@ -369,7 +369,7 @@ span.ww_winTitle {
vertical-align: middle; vertical-align: middle;
padding: 0; padding: 0;
border-radius: 0; border-radius: 0;
background: $col1 url('#{$skinsPath}icons/icon_magnify.png') 50% no-repeat; background: $col1 url('#{$iconsPath}icon_magnify.png') 50% no-repeat;
border: none; border: none;
margin: 0; margin: 0;
outline:none; outline:none;
@@ -390,7 +390,7 @@ span.ww_winTitle {
line-height: 50px; line-height: 50px;
padding: 0; padding: 0;
border-radius: 0; border-radius: 0;
background: url('#{$skinsPath}icons/icon_clear_search.png') 50% no-repeat; background: url('#{$iconsPath}icon_clear_search.png') 50% no-repeat;
border: none; border: none;
outline: none; outline: none;
box-shadow: none; box-shadow: none;
@@ -414,7 +414,7 @@ span.ww_winTitle {
.treeview>li.expandable>.hitarea { .treeview>li.expandable>.hitarea {
height: 51px; height: 51px;
background: url('#{$skinsPath}icons/sprite_tree_first.png') 99% 22px no-repeat; background: url('#{$iconsPath}sprite_tree_first.png') 99% 22px no-repeat;
border-left: 5px $col1 solid; border-left: 5px $col1 solid;
} }
@@ -436,7 +436,7 @@ span.ww_winTitle {
} }
.treeview ul li .hitarea { .treeview ul li .hitarea {
background: url('#{$skinsPath}icons/icon_tree.png') 0 0 no-repeat; background: url('#{$iconsPath}/icon_tree.png') 0 0 no-repeat;
position: relative; position: relative;
height: 9px; height: 9px;
width: 9px; width: 9px;
@@ -650,7 +650,7 @@ span.ww_winTitle {
} }
.ui-accordion .ui-accordion-content.loading { .ui-accordion .ui-accordion-content.loading {
background-image: url('#{$skinsPath}icons/loader000.gif'); background-image: url('#{$iconsPath}loader000.gif');
background-position: center center; background-position: center center;
background-repeat: no-repeat; background-repeat: no-repeat;
} }
@@ -1019,7 +1019,7 @@ div.diapo {
} }
#idFrameT #selectCase { #idFrameT #selectCase {
background: url('#{$skinsPath}icons/ccoch0.gif') no-repeat center center; background: url('#{$iconsPath}ccoch0.gif') no-repeat center center;
padding-left: 16px; padding-left: 16px;
} }
@@ -1581,30 +1581,30 @@ form.phrasea_query input.query {
} }
.history-collection { .history-collection {
background-image: url('#{$skinsPath}icons/chgcoll_history.png'); background-image: url('#{$iconsPath}chgcoll_history.png');
} }
.history-status { .history-status {
background-image: url('#{$skinsPath}icons/chgstatus_history.png'); background-image: url('#{$iconsPath}chgstatus_history.png');
} }
.history-print { .history-print {
background-image: url('#{$skinsPath}icons/print_history.png'); background-image: url('#{$iconsPath}print_history.png');
} }
.history-substit, .history-publish { .history-substit, .history-publish {
background-image: url('#{$skinsPath}icons/imgtools_history.png'); background-image: url('#{$iconsPath}imgtools_history.png');
} }
.history-download, .history-mail, .history-ftp { .history-download, .history-mail, .history-ftp {
background-image: url('#{$skinsPath}icons/disktt_history.png'); background-image: url('#{$iconsPath}disktt_history.png');
} }
.history-edit { .history-edit {
background-image: url('#{$skinsPath}icons/ppen_history.png'); background-image: url('#{$iconsPath}ppen_history.png');
} }
.history-validate, .history-push { .history-validate, .history-push {
background-image: url('#{$skinsPath}icons/push16.png'); background-image: url('#{$iconsPath}push16.png');
} }
.history-collection, .history-status, .history-print, .history-substit, .history-publish, .history-download, .history-mail, .history-ftp, .history-edit, .history-validate, .history-push { .history-collection, .history-status, .history-print, .history-substit, .history-publish, .history-download, .history-mail, .history-ftp, .history-edit, .history-validate, .history-push {
@@ -1854,7 +1854,7 @@ input.input-button.hover {
input.search { input.search {
padding-left: 25px; padding-left: 25px;
background-image: url('#{$skinsPath}icons/search.png'); background-image: url('#{$iconsPath}search.png');
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: 3px center; background-position: 3px center;
} }
@@ -2947,7 +2947,7 @@ DIV.thesaurus U.w {
#idFrameE .ui-datepicker-inline { #idFrameE .ui-datepicker-inline {
background-color: #111111; background-color: #111111;
background-image: url('#{$skinsPath}prod/000000/images/ui-bg_gloss-wave_20_111111_500x100.png'); background-image: url('../images/000000/images/ui-bg_gloss-wave_20_111111_500x100.png');
background-repeat: repeat-x; background-repeat: repeat-x;
background-position: 50% top; background-position: 50% top;
} }
@@ -3266,7 +3266,7 @@ DIV.thesaurus U.w {
} }
#mainMenu .PNB.right li.user { #mainMenu .PNB.right li.user {
background: url('#{$skinsPath}icons/icon_user.png') 15px 7px no-repeat; background: url('#{$iconsPath}icon_user.png') 15px 7px no-repeat;
padding-left: 41px; padding-left: 41px;
} }
@@ -4101,7 +4101,7 @@ dans l'onglet thesaurus : arbres, menus contextuels
} }
#dialog_publicator .ui-tabs .ui-tabs-panel.loading { #dialog_publicator .ui-tabs .ui-tabs-panel.loading {
background-image: url('#{$skinsPath}icons/loader000.gif'); background-image: url('#{$iconsPath}loader000.gif');
background-position: center center; background-position: center center;
background-repeat: no-repeat; background-repeat: no-repeat;
} }
@@ -4196,7 +4196,7 @@ dans l'onglet thesaurus : arbres, menus contextuels
#dialog_publicator .api_infos { #dialog_publicator .api_infos {
top: auto; top: auto;
height: 25px; height: 25px;
background-image: url('#{$skinsPath}icons/api_info.png'); background-image: url('#{$iconsPath}api_info.png');
background-repeat: repeat-x; background-repeat: repeat-x;
background-position: 0 0; background-position: 0 0;
color: #999999; color: #999999;
@@ -4222,15 +4222,15 @@ dans l'onglet thesaurus : arbres, menus contextuels
} }
#ul_main_pub_tabs li.bridge_Youtube { #ul_main_pub_tabs li.bridge_Youtube {
background-image: url('#{$skinsPath}icons/youtube-small.gif'); background-image: url('#{$iconsPath}youtube-small.gif');
} }
#ul_main_pub_tabs li.bridge_Dailymotion { #ul_main_pub_tabs li.bridge_Dailymotion {
background-image: url('#{$skinsPath}icons/dailymotion-small.gif'); background-image: url('#{$iconsPath}dailymotion-small.gif');
} }
#ul_main_pub_tabs li.bridge_Flickr { #ul_main_pub_tabs li.bridge_Flickr {
background-image: url('#{$skinsPath}icons/flickr-small.gif'); background-image: url('#{$iconsPath}flickr-small.gif');
} }
#dialog_publicator .diapo .thumb_wrapper { #dialog_publicator .diapo .thumb_wrapper {

View File

@@ -2809,7 +2809,7 @@ DIV.thesaurus U.w {
#idFrameE .ui-datepicker-inline { #idFrameE .ui-datepicker-inline {
background-color: #111111; background-color: #111111;
background-image: url('/skins/prod/000000/images/ui-bg_gloss-wave_20_111111_500x100.png'); background-image: url('../images/000000/images/ui-bg_gloss-wave_20_111111_500x100.png');
background-repeat: repeat-x; background-repeat: repeat-x;
background-position: 50% top; background-position: 50% top;
} }

View File

@@ -1,4 +1,5 @@
$imagesPath: '../../../../include/jslibs/jquery-treeview/images/'; //$imagesPath: '../../../../include/jslibs/jquery-treeview/images/';
$imagesPath: '/assets/vendors/jquery-treeview/images';
.treeview, .treeview ul { .treeview, .treeview ul {
padding: 0; padding: 0;
margin: 0; margin: 0;

View File

@@ -1,29 +0,0 @@
1.4
---
* Added changelog (this file)
* Fixed tree control to search only for anchors, allowing images or other elements inside the controls, while keeping the control usable with the keyboard
* Restructured folder layout: root contains plugin resources, lib contains script dependencies, demo contains demos and related files
* Added prerendered option: If set to true, assumes all hitarea divs and classes already rendered, speeding up initialization for big trees, but more obtrusive
* Added jquery.treeview.async.js for ajax-lazy-loading trees, see async.html demo
* Exposed $.fn.treeview.classes for custom classes if necessary
* Show treecontrol only when JavaScript is enabled
* Completely reworked themeing via CSS sprites, resulting in only two files per theme
* updated dotted, black, gray and red theme
* added famfamfam theme (no lines)
* Improved cookie persistence to allow multiple persisted trees per page via cookieId option
* Improved location persistence by making it case-insensitive
* Improved swapClass and replaceClass plugin implementations
* Added folder-closed.gif to filetree example
1.3
---
* Fixes for all outstanding bugs
* Added persistence features
* location based: click on a link in the treeview and reopen that link after the page loaded
* cookie based: save the state of the tree in a cookie on each click and load that on reload
* smoothed animations, fixing flickering in both IE and Opera
* Tested in Firefox 2, IE 6 & 7, Opera 9, Safari 3
* Moved documentation to jQuery wiki
* Requires jQuery 1.2+

Binary file not shown.

Before

Width:  |  Height:  |  Size: 110 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 105 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 106 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 837 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 841 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 807 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

View File

@@ -1,72 +0,0 @@
/*
* Async Treeview 0.1 - Lazy-loading extension for Treeview
*
* http://bassistance.de/jquery-plugins/jquery-plugin-treeview/
*
* Copyright (c) 2007 Jörn Zaefferer
*
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*
* Revision: $Id$
*
*/
;(function($) {
function load(settings, root, child, container) {
$.getJSON(settings.url, {root: root}, function(response) {
function createNode(parent) {
var current = $("<li/>").attr("id", this.id || "").html("<span>" + this.text + "</span>").appendTo(parent);
if (this.classes) {
current.children("span").addClass(this.classes);
}
if (this.expanded) {
current.addClass("open");
}
if (this.hasChildren || this.children && this.children.length) {
var branch = $("<ul/>").appendTo(current);
if (this.hasChildren) {
current.addClass("hasChildren");
createNode.call({
text:"placeholder",
id:"placeholder",
children:[]
}, branch);
}
if (this.children && this.children.length) {
$.each(this.children, createNode, [branch]);
}
}
}
$.each(response, createNode, [child]);
$(container).treeview({add: child});
});
}
var proxied = $.fn.treeview;
$.fn.treeview = function(settings) {
if (!settings.url) {
return proxied.apply(this, arguments);
}
var container = this;
load(settings, "source", this, container);
var userToggle = settings.toggle;
return proxied.call(this, $.extend({}, settings, {
collapsed: true,
toggle: function() {
var $this = $(this);
if ($this.hasClass("hasChildren")) {
var childList = $this.removeClass("hasChildren").find("ul");
childList.empty();
load(settings, this.id, childList, container);
}
if (userToggle) {
userToggle.apply(this, arguments);
}
}
}));
};
})(jQuery);

View File

@@ -1,68 +0,0 @@
.treeview, .treeview ul {
padding: 0;
margin: 0;
list-style: none;
}
.treeview ul {
background-color: white;
margin-top: 4px;
}
.treeview .hitarea {
background: url(images/treeview-default.gif) -64px -25px no-repeat;
height: 16px;
width: 16px;
margin-left: -16px;
float: left;
cursor: pointer;
}
/* fix for IE6 */
* html .hitarea {
display: inline;
float:none;
}
.treeview li {
margin: 0;
padding: 3px 0pt 3px 16px;
}
.treeview a.selected {
background-color: #eee;
}
#treecontrol { margin: 1em 0; display: none; }
.treeview .hover { cursor: pointer; }
.treeview li { background: url(images/treeview-default-line.png) 0 0 no-repeat; }
.treeview li.collapsable, .treeview li.expandable { background-position: 0 -176px; }
.treeview .expandable-hitarea { background-position: -80px -3px; }
.treeview li.last { background-position: 0 -29986px }
.treeview li.lastCollapsable, .treeview li.lastExpandable { background-image: url(images/treeview-default.gif); }
.treeview li.lastCollapsable { background-position: 0 -111px }
.treeview li.lastExpandable { background-position: -32px -67px }
.treeview div.lastCollapsable-hitarea, .treeview div.lastExpandable-hitarea { background-position: 0; }
.treeview-red li { background-image: url(images/treeview-red-line.gif); }
.treeview-red .hitarea, .treeview-red li.lastCollapsable, .treeview-red li.lastExpandable { background-image: url(images/treeview-red.gif); }
.treeview-black li { background-image: url(images/treeview-black-line.gif); }
.treeview-black .hitarea, .treeview-black li.lastCollapsable, .treeview-black li.lastExpandable { background-image: url(images/treeview-black.gif); }
.treeview-gray li { background-image: url(images/treeview-gray-line.gif); }
.treeview-gray .hitarea, .treeview-gray li.lastCollapsable, .treeview-gray li.lastExpandable { background-image: url(images/treeview-gray.gif); }
.treeview-famfamfam li { background-image: url(images/treeview-famfamfam-line.gif); }
.treeview-famfamfam .hitarea, .treeview-famfamfam li.lastCollapsable, .treeview-famfamfam li.lastExpandable { background-image: url(images/treeview-famfamfam.gif); }
.filetree li { padding: 3px 0 2px 16px; }
.filetree span.folder, .filetree span.file { padding: 1px 0 1px 16px; display: block; }
.filetree span.folder { background: url(images/folder.gif) 0 0 no-repeat; }
.filetree li.expandable span.folder { background: url(images/folder-closed.gif) 0 0 no-repeat; }
.filetree span.file { background: url(images/file.gif) 0 0 no-repeat; }

View File

@@ -1,251 +0,0 @@
/*
* Treeview 1.4 - jQuery plugin to hide and show branches of a tree
*
* http://bassistance.de/jquery-plugins/jquery-plugin-treeview/
* http://docs.jquery.com/Plugins/Treeview
*
* Copyright (c) 2007 Jörn Zaefferer
*
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*
* Revision: $Id: jquery.treeview.js 4684 2008-02-07 19:08:06Z joern.zaefferer $
*
*/
;(function($) {
$.extend($.fn, {
swapClass: function(c1, c2) {
var c1Elements = this.filter('.' + c1);
this.filter('.' + c2).removeClass(c2).addClass(c1);
c1Elements.removeClass(c1).addClass(c2);
return this;
},
replaceClass: function(c1, c2) {
return this.filter('.' + c1).removeClass(c1).addClass(c2).end();
},
hoverClass: function(className) {
className = className || "hover";
return this.hover(function() {
$(this).addClass(className);
}, function() {
$(this).removeClass(className);
});
},
heightToggle: function(animated, callback) {
animated ?
this.animate({ height: "toggle" }, animated, callback) :
this.each(function(){
jQuery(this)[ jQuery(this).is(":hidden") ? "show" : "hide" ]();
if(callback)
callback.apply(this, arguments);
});
},
heightHide: function(animated, callback) {
if (animated) {
this.animate({ height: "hide" }, animated, callback);
} else {
this.hide();
if (callback)
this.each(callback);
}
},
prepareBranches: function(settings) {
if (!settings.prerendered) {
// mark last tree items
this.filter(":last-child:not(ul)").addClass(CLASSES.last);
// collapse whole tree, or only those marked as closed, anyway except those marked as open
this.filter((settings.collapsed ? "" : "." + CLASSES.closed) + ":not(." + CLASSES.open + ")").find(">ul").hide();
}
// return all items with sublists
return this.filter(":has(>ul)");
},
applyClasses: function(settings, toggler) {
this.filter(":has(>ul):not(:has(>a))").find(">span").click(function(event) {
toggler.apply($(this).next());
}).add( $("a", this) ).hoverClass();
if (!settings.prerendered) {
// handle closed ones first
this.filter(":has(>ul:hidden)")
.addClass(CLASSES.expandable)
.replaceClass(CLASSES.last, CLASSES.lastExpandable);
// handle open ones
this.not(":has(>ul:hidden)")
.addClass(CLASSES.collapsable)
.replaceClass(CLASSES.last, CLASSES.lastCollapsable);
// create hitarea
this.prepend("<div class=\"" + CLASSES.hitarea + "\"/>").find("div." + CLASSES.hitarea).each(function() {
var classes = "";
$.each($(this).parent().attr("class").split(" "), function() {
classes += this + "-hitarea ";
});
$(this).addClass( classes );
});
}
// apply event to hitarea
this.find("div." + CLASSES.hitarea).click( toggler );
},
treeview: function(settings) {
settings = $.extend({
cookieId: "treeview"
}, settings);
if (settings.add) {
return this.trigger("add", [settings.add]);
}
if ( settings.toggle ) {
var callback = settings.toggle;
settings.toggle = function() {
return callback.apply($(this).parent()[0], arguments);
};
}
// factory for treecontroller
function treeController(tree, control) {
// factory for click handlers
function handler(filter) {
return function() {
// reuse toggle event handler, applying the elements to toggle
// start searching for all hitareas
toggler.apply( $("div." + CLASSES.hitarea, tree).filter(function() {
// for plain toggle, no filter is provided, otherwise we need to check the parent element
return filter ? $(this).parent("." + filter).length : true;
}) );
return false;
};
}
// click on first element to collapse tree
$("a:eq(0)", control).click( handler(CLASSES.collapsable) );
// click on second to expand tree
$("a:eq(1)", control).click( handler(CLASSES.expandable) );
// click on third to toggle tree
$("a:eq(2)", control).click( handler() );
}
// handle toggle event
function toggler() {
$(this)
.parent()
// swap classes for hitarea
.find(">.hitarea")
.swapClass( CLASSES.collapsableHitarea, CLASSES.expandableHitarea )
.swapClass( CLASSES.lastCollapsableHitarea, CLASSES.lastExpandableHitarea )
.end()
// swap classes for parent li
.swapClass( CLASSES.collapsable, CLASSES.expandable )
.swapClass( CLASSES.lastCollapsable, CLASSES.lastExpandable )
// find child lists
.find( ">ul" )
// toggle them
.heightToggle( settings.animated, settings.toggle );
if ( settings.unique ) {
$(this).parent()
.siblings()
// swap classes for hitarea
.find(">.hitarea")
.replaceClass( CLASSES.collapsableHitarea, CLASSES.expandableHitarea )
.replaceClass( CLASSES.lastCollapsableHitarea, CLASSES.lastExpandableHitarea )
.end()
.replaceClass( CLASSES.collapsable, CLASSES.expandable )
.replaceClass( CLASSES.lastCollapsable, CLASSES.lastExpandable )
.find( ">ul" )
.heightHide( settings.animated, settings.toggle );
}
}
function serialize() {
function binary(arg) {
return arg ? 1 : 0;
}
var data = [];
branches.each(function(i, e) {
data[i] = $(e).is(":has(>ul:visible)") ? 1 : 0;
});
$.cookie(settings.cookieId, data.join("") );
}
function deserialize() {
var stored = $.cookie(settings.cookieId);
if ( stored ) {
var data = stored.split("");
branches.each(function(i, e) {
$(e).find(">ul")[ parseInt(data[i]) ? "show" : "hide" ]();
});
}
}
// add treeview class to activate styles
this.addClass("treeview");
// prepare branches and find all tree items with child lists
var branches = this.find("li").prepareBranches(settings);
switch(settings.persist) {
case "cookie":
var toggleCallback = settings.toggle;
settings.toggle = function() {
serialize();
if (toggleCallback) {
toggleCallback.apply(this, arguments);
}
};
deserialize();
break;
case "location":
var current = this.find("a").filter(function() { return this.href.toLowerCase() == location.href.toLowerCase(); });
if ( current.length ) {
current.addClass("selected").parents("ul, li").add( current.next() ).show();
}
break;
}
branches.applyClasses(settings, toggler);
// if control option is set, create the treecontroller and show it
if ( settings.control ) {
treeController(this, settings.control);
$(settings.control).show();
}
return this.bind("add", function(event, branches) {
$(branches).prev()
.removeClass(CLASSES.last)
.removeClass(CLASSES.lastCollapsable)
.removeClass(CLASSES.lastExpandable)
.find(">.hitarea")
.removeClass(CLASSES.lastCollapsableHitarea)
.removeClass(CLASSES.lastExpandableHitarea);
$(branches).find("li").andSelf().prepareBranches(settings).applyClasses(settings, toggler);
});
}
});
// classes used by the plugin
// need to be styled via external stylesheet, see first example
var CLASSES = $.fn.treeview.classes = {
open: "open",
closed: "closed",
expandable: "expandable",
expandableHitarea: "expandable-hitarea",
lastExpandableHitarea: "lastExpandable-hitarea",
collapsable: "collapsable",
collapsableHitarea: "collapsable-hitarea",
lastCollapsableHitarea: "lastCollapsable-hitarea",
lastCollapsable: "lastCollapsable",
lastExpandable: "lastExpandable",
last: "last",
hitarea: "hitarea"
};
// provide backwards compability
$.fn.Treeview = $.fn.treeview;
})(jQuery);

View File

@@ -1,15 +0,0 @@
/*
* Treeview 1.4 - jQuery plugin to hide and show branches of a tree
*
* http://bassistance.de/jquery-plugins/jquery-plugin-treeview/
* http://docs.jquery.com/Plugins/Treeview
*
* Copyright (c) 2007 Jörn Zaefferer
*
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*
* Revision: $Id: jquery.treeview.js 4684 2008-02-07 19:08:06Z joern.zaefferer $
*
*/;(function($){$.extend($.fn,{swapClass:function(c1,c2){var c1Elements=this.filter('.'+c1);this.filter('.'+c2).removeClass(c2).addClass(c1);c1Elements.removeClass(c1).addClass(c2);return this;},replaceClass:function(c1,c2){return this.filter('.'+c1).removeClass(c1).addClass(c2).end();},hoverClass:function(className){className=className||"hover";return this.hover(function(){$(this).addClass(className);},function(){$(this).removeClass(className);});},heightToggle:function(animated,callback){animated?this.animate({height:"toggle"},animated,callback):this.each(function(){jQuery(this)[jQuery(this).is(":hidden")?"show":"hide"]();if(callback)callback.apply(this,arguments);});},heightHide:function(animated,callback){if(animated){this.animate({height:"hide"},animated,callback);}else{this.hide();if(callback)this.each(callback);}},prepareBranches:function(settings){if(!settings.prerendered){this.filter(":last-child:not(ul)").addClass(CLASSES.last);this.filter((settings.collapsed?"":"."+CLASSES.closed)+":not(."+CLASSES.open+")").find(">ul").hide();}return this.filter(":has(>ul)");},applyClasses:function(settings,toggler){this.filter(":has(>ul):not(:has(>a))").find(">span").click(function(event){toggler.apply($(this).next());}).add($("a",this)).hoverClass();if(!settings.prerendered){this.filter(":has(>ul:hidden)").addClass(CLASSES.expandable).replaceClass(CLASSES.last,CLASSES.lastExpandable);this.not(":has(>ul:hidden)").addClass(CLASSES.collapsable).replaceClass(CLASSES.last,CLASSES.lastCollapsable);this.prepend("<div class=\""+CLASSES.hitarea+"\"/>").find("div."+CLASSES.hitarea).each(function(){var classes="";$.each($(this).parent().attr("class").split(" "),function(){classes+=this+"-hitarea ";});$(this).addClass(classes);});}this.find("div."+CLASSES.hitarea).click(toggler);},treeview:function(settings){settings=$.extend({cookieId:"treeview"},settings);if(settings.add){return this.trigger("add",[settings.add]);}if(settings.toggle){var callback=settings.toggle;settings.toggle=function(){return callback.apply($(this).parent()[0],arguments);};}function treeController(tree,control){function handler(filter){return function(){toggler.apply($("div."+CLASSES.hitarea,tree).filter(function(){return filter?$(this).parent("."+filter).length:true;}));return false;};}$("a:eq(0)",control).click(handler(CLASSES.collapsable));$("a:eq(1)",control).click(handler(CLASSES.expandable));$("a:eq(2)",control).click(handler());}function toggler(){$(this).parent().find(">.hitarea").swapClass(CLASSES.collapsableHitarea,CLASSES.expandableHitarea).swapClass(CLASSES.lastCollapsableHitarea,CLASSES.lastExpandableHitarea).end().swapClass(CLASSES.collapsable,CLASSES.expandable).swapClass(CLASSES.lastCollapsable,CLASSES.lastExpandable).find(">ul").heightToggle(settings.animated,settings.toggle);if(settings.unique){$(this).parent().siblings().find(">.hitarea").replaceClass(CLASSES.collapsableHitarea,CLASSES.expandableHitarea).replaceClass(CLASSES.lastCollapsableHitarea,CLASSES.lastExpandableHitarea).end().replaceClass(CLASSES.collapsable,CLASSES.expandable).replaceClass(CLASSES.lastCollapsable,CLASSES.lastExpandable).find(">ul").heightHide(settings.animated,settings.toggle);}}function serialize(){function binary(arg){return arg?1:0;}var data=[];branches.each(function(i,e){data[i]=$(e).is(":has(>ul:visible)")?1:0;});$.cookie(settings.cookieId,data.join(""));}function deserialize(){var stored=$.cookie(settings.cookieId);if(stored){var data=stored.split("");branches.each(function(i,e){$(e).find(">ul")[parseInt(data[i])?"show":"hide"]();});}}this.addClass("treeview");var branches=this.find("li").prepareBranches(settings);switch(settings.persist){case"cookie":var toggleCallback=settings.toggle;settings.toggle=function(){serialize();if(toggleCallback){toggleCallback.apply(this,arguments);}};deserialize();break;case"location":var current=this.find("a").filter(function(){return this.href.toLowerCase()==location.href.toLowerCase();});if(current.length){current.addClass("selected").parents("ul, li").add(current.next()).show();}break;}branches.applyClasses(settings,toggler);if(settings.control){treeController(this,settings.control);$(settings.control).show();}return this.bind("add",function(event,branches){$(branches).prev().removeClass(CLASSES.last).removeClass(CLASSES.lastCollapsable).removeClass(CLASSES.lastExpandable).find(">.hitarea").removeClass(CLASSES.lastCollapsableHitarea).removeClass(CLASSES.lastExpandableHitarea);$(branches).find("li").andSelf().prepareBranches(settings).applyClasses(settings,toggler);});}});var CLASSES=$.fn.treeview.classes={open:"open",closed:"closed",expandable:"expandable",expandableHitarea:"expandable-hitarea",lastExpandableHitarea:"lastExpandable-hitarea",collapsable:"collapsable",collapsableHitarea:"collapsable-hitarea",lastCollapsableHitarea:"lastCollapsable-hitarea",lastCollapsable:"lastCollapsable",lastExpandable:"lastExpandable",last:"last",hitarea:"hitarea"};$.fn.Treeview=$.fn.treeview;})(jQuery);

View File

@@ -1,16 +0,0 @@
/*
* Treeview 1.4 - jQuery plugin to hide and show branches of a tree
*
* http://bassistance.de/jquery-plugins/jquery-plugin-treeview/
* http://docs.jquery.com/Plugins/Treeview
*
* Copyright (c) 2007 Jörn Zaefferer
*
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*
* Revision: $Id: jquery.treeview.js 4684 2008-02-07 19:08:06Z joern.zaefferer $
*
*/
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}(';(4($){$.1l($.F,{E:4(b,c){l a=3.n(\'.\'+b);3.n(\'.\'+c).o(c).m(b);a.o(b).m(c);8 3},s:4(a,b){8 3.n(\'.\'+a).o(a).m(b).P()},1n:4(a){a=a||"1j";8 3.1j(4(){$(3).m(a)},4(){$(3).o(a)})},1h:4(b,a){b?3.1g({1e:"p"},b,a):3.x(4(){T(3)[T(3).1a(":U")?"H":"D"]();7(a)a.A(3,O)})},12:4(b,a){7(b){3.1g({1e:"D"},b,a)}1L{3.D();7(a)3.x(a)}},11:4(a){7(!a.1k){3.n(":r-1H:G(9)").m(k.r);3.n((a.1F?"":"."+k.X)+":G(."+k.W+")").6(">9").D()}8 3.n(":y(>9)")},S:4(b,c){3.n(":y(>9):G(:y(>a))").6(">1z").C(4(a){c.A($(3).19())}).w($("a",3)).1n();7(!b.1k){3.n(":y(>9:U)").m(k.q).s(k.r,k.t);3.G(":y(>9:U)").m(k.u).s(k.r,k.v);3.1r("<J 14=\\""+k.5+"\\"/>").6("J."+k.5).x(4(){l a="";$.x($(3).B().1o("14").13(" "),4(){a+=3+"-5 "});$(3).m(a)})}3.6("J."+k.5).C(c)},z:4(g){g=$.1l({N:"z"},g);7(g.w){8 3.1K("w",[g.w])}7(g.p){l d=g.p;g.p=4(){8 d.A($(3).B()[0],O)}}4 1m(b,c){4 L(a){8 4(){K.A($("J."+k.5,b).n(4(){8 a?$(3).B("."+a).1i:1I}));8 1G}}$("a:10(0)",c).C(L(k.u));$("a:10(1)",c).C(L(k.q));$("a:10(2)",c).C(L())}4 K(){$(3).B().6(">.5").E(k.Z,k.Y).E(k.I,k.M).P().E(k.u,k.q).E(k.v,k.t).6(">9").1h(g.1f,g.p);7(g.1E){$(3).B().1D().6(">.5").s(k.Z,k.Y).s(k.I,k.M).P().s(k.u,k.q).s(k.v,k.t).6(">9").12(g.1f,g.p)}}4 1d(){4 1C(a){8 a?1:0}l b=[];j.x(4(i,e){b[i]=$(e).1a(":y(>9:1B)")?1:0});$.V(g.N,b.1A(""))}4 1c(){l b=$.V(g.N);7(b){l a=b.13("");j.x(4(i,e){$(e).6(">9")[1y(a[i])?"H":"D"]()})}}3.m("z");l j=3.6("Q").11(g);1x(g.1w){18"V":l h=g.p;g.p=4(){1d();7(h){h.A(3,O)}};1c();17;18"1b":l f=3.6("a").n(4(){8 3.16.15()==1b.16.15()});7(f.1i){f.m("1v").1u("9, Q").w(f.19()).H()}17}j.S(g,K);7(g.R){1m(3,g.R);$(g.R).H()}8 3.1t("w",4(a,b){$(b).1s().o(k.r).o(k.v).o(k.t).6(">.5").o(k.I).o(k.M);$(b).6("Q").1q().11(g).S(g,K)})}});l k=$.F.z.1J={W:"W",X:"X",q:"q",Y:"q-5",M:"t-5",u:"u",Z:"u-5",I:"v-5",v:"v",t:"t",r:"r",5:"5"};$.F.1p=$.F.z})(T);',62,110,'|||this|function|hitarea|find|if|return|ul||||||||||||var|addClass|filter|removeClass|toggle|expandable|last|replaceClass|lastExpandable|collapsable|lastCollapsable|add|each|has|treeview|apply|parent|click|hide|swapClass|fn|not|show|lastCollapsableHitarea|div|toggler|handler|lastExpandableHitarea|cookieId|arguments|end|li|control|applyClasses|jQuery|hidden|cookie|open|closed|expandableHitarea|collapsableHitarea|eq|prepareBranches|heightHide|split|class|toLowerCase|href|break|case|next|is|location|deserialize|serialize|height|animated|animate|heightToggle|length|hover|prerendered|extend|treeController|hoverClass|attr|Treeview|andSelf|prepend|prev|bind|parents|selected|persist|switch|parseInt|span|join|visible|binary|siblings|unique|collapsed|false|child|true|classes|trigger|else'.split('|'),0,{}))

View File

@@ -1,92 +0,0 @@
/**
* Cookie plugin
*
* Copyright (c) 2006 Klaus Hartl (stilbuero.de)
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*
*/
/**
* Create a cookie with the given name and value and other optional parameters.
*
* @example $.cookie('the_cookie', 'the_value');
* @desc Set the value of a cookie.
* @example $.cookie('the_cookie', 'the_value', {expires: 7, path: '/', domain: 'jquery.com', secure: true});
* @desc Create a cookie with all available options.
* @example $.cookie('the_cookie', 'the_value');
* @desc Create a session cookie.
* @example $.cookie('the_cookie', null);
* @desc Delete a cookie by passing null as value.
*
* @param String name The name of the cookie.
* @param String value The value of the cookie.
* @param Object options An object literal containing key/value pairs to provide optional cookie attributes.
* @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object.
* If a negative value is specified (e.g. a date in the past), the cookie will be deleted.
* If set to null or omitted, the cookie will be a session cookie and will not be retained
* when the the browser exits.
* @option String path The value of the path atribute of the cookie (default: path of page that created the cookie).
* @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie).
* @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will
* require a secure protocol (like HTTPS).
* @type undefined
*
* @name $.cookie
* @cat Plugins/Cookie
* @author Klaus Hartl/klaus.hartl@stilbuero.de
*/
/**
* Get the value of a cookie with the given name.
*
* @example $.cookie('the_cookie');
* @desc Get the value of a cookie.
*
* @param String name The name of the cookie.
* @return The value of the cookie.
* @type String
*
* @name $.cookie
* @cat Plugins/Cookie
* @author Klaus Hartl/klaus.hartl@stilbuero.de
*/
jQuery.cookie = function(name, value, options) {
if (typeof value != 'undefined') { // name and value given, set cookie
options = options || {};
if (value === null) {
value = '';
options.expires = -1;
}
var expires = '';
if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
var date;
if (typeof options.expires == 'number') {
date = new Date();
date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
} else {
date = options.expires;
}
expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE
}
var path = options.path ? '; path=' + options.path : '';
var domain = options.domain ? '; domain=' + options.domain : '';
var secure = options.secure ? '; secure' : '';
document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
} else { // only name given, get cookie
var cookieValue = null;
if (document.cookie && document.cookie != '') {
var cookies = document.cookie.split(';');
for (var i = 0; i < cookies.length; i++) {
var cookie = jQuery.trim(cookies[i]);
// Does this cookie string begin with the name we want?
if (cookie.substring(0, name.length + 1) == (name + '=')) {
cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
break;
}
}
}
return cookieValue;
}
};

File diff suppressed because it is too large Load Diff

View File

@@ -1,8 +0,0 @@
1.5
---
* add classes and rules for root items
* lazy-loading: render the complete tree, but only apply hitzones and hiding of children to the first level on load
* async treeview
* support animations
* support persist options

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,215 +0,0 @@
/*
* Lazy Load - jQuery plugin for lazy loading images
*
* Copyright (c) 2007-2012 Mika Tuupola
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/mit-license.php
*
* Project home:
* http://www.appelsiini.net/projects/lazyload
*
* Version: 1.8.1
*
*/
(function($, window) {
var $window = $(window);
$.fn.lazyload = function(options) {
var elements = this;
var $container;
var settings = {
threshold : 0,
failure_limit : 0,
event : "scroll",
effect : "show",
container : window,
data_attribute : "original",
skip_invisible : true,
appear : null,
load : null
};
function update() {
var counter = 0;
elements.each(function() {
var $this = $(this);
if (settings.skip_invisible && !$this.is(":visible")) {
return;
}
if ($.abovethetop(this, settings) ||
$.leftofbegin(this, settings)) {
/* Nothing. */
} else if (!$.belowthefold(this, settings) &&
!$.rightoffold(this, settings)) {
$this.trigger("appear");
/* if we found an image we'll load, reset the counter */
counter = 0;
} else {
if (++counter > settings.failure_limit) {
return false;
}
}
});
}
if(options) {
/* Maintain BC for a couple of versions. */
if (undefined !== options.failurelimit) {
options.failure_limit = options.failurelimit;
delete options.failurelimit;
}
if (undefined !== options.effectspeed) {
options.effect_speed = options.effectspeed;
delete options.effectspeed;
}
$.extend(settings, options);
}
/* Cache container as jQuery as object. */
$container = (settings.container === undefined ||
settings.container === window) ? $window : $(settings.container);
/* Fire one scroll event per scroll. Not one scroll event per image. */
if (0 === settings.event.indexOf("scroll")) {
$container.bind(settings.event, function(event) {
return update();
});
}
this.each(function() {
var self = this;
var $self = $(self);
self.loaded = false;
/* When appear is triggered load original image. */
$self.one("appear", function() {
if (!this.loaded) {
if (settings.appear) {
var elements_left = elements.length;
settings.appear.call(self, elements_left, settings);
}
$("<img />")
.bind("load", function() {
$self
.hide()
.attr("src", $self.data(settings.data_attribute))
[settings.effect](settings.effect_speed);
self.loaded = true;
/* Remove image from array so it is not looped next time. */
var temp = $.grep(elements, function(element) {
return !element.loaded;
});
elements = $(temp);
if (settings.load) {
var elements_left = elements.length;
settings.load.call(self, elements_left, settings);
}
})
.attr("src", $self.data(settings.data_attribute));
}
});
/* When wanted event is triggered load original image */
/* by triggering appear. */
if (0 !== settings.event.indexOf("scroll")) {
$self.bind(settings.event, function(event) {
if (!self.loaded) {
$self.trigger("appear");
}
});
}
});
/* Check if something appears when window is resized. */
$window.bind("resize", function(event) {
update();
});
/* Force initial check if images should appear. */
$(document).ready(function() {
update();
});
return this;
};
/* Convenience methods in jQuery namespace. */
/* Use as $.belowthefold(element, {threshold : 100, container : window}) */
$.belowthefold = function(element, settings) {
var fold;
if (settings.container === undefined || settings.container === window) {
fold = $window.height() + $window.scrollTop();
} else {
fold = $(settings.container).offset().top + $(settings.container).height();
}
return fold <= $(element).offset().top - settings.threshold;
};
$.rightoffold = function(element, settings) {
var fold;
if (settings.container === undefined || settings.container === window) {
fold = $window.width() + $window.scrollLeft();
} else {
fold = $(settings.container).offset().left + $(settings.container).width();
}
return fold <= $(element).offset().left - settings.threshold;
};
$.abovethetop = function(element, settings) {
var fold;
if (settings.container === undefined || settings.container === window) {
fold = $window.scrollTop();
} else {
fold = $(settings.container).offset().top;
}
return fold >= $(element).offset().top + settings.threshold + $(element).height();
};
$.leftofbegin = function(element, settings) {
var fold;
if (settings.container === undefined || settings.container === window) {
fold = $window.scrollLeft();
} else {
fold = $(settings.container).offset().left;
}
return fold >= $(element).offset().left + settings.threshold + $(element).width();
};
$.inviewport = function(element, settings) {
return !$.rightoffold(element, settings) && !$.leftofbegin(element, settings) &&
!$.belowthefold(element, settings) && !$.abovethetop(element, settings);
};
/* Custom selectors for your convenience. */
/* Use as $("img:below-the-fold").something() or */
/* $("img").filter(":below-the-fold").something() which is faster */
$.extend($.expr[':'], {
"below-the-fold" : function(a) { return $.belowthefold(a, {threshold : 0}); },
"above-the-top" : function(a) { return !$.belowthefold(a, {threshold : 0}); },
"right-of-screen": function(a) { return $.rightoffold(a, {threshold : 0}); },
"left-of-screen" : function(a) { return !$.rightoffold(a, {threshold : 0}); },
"in-viewport" : function(a) { return $.inviewport(a, {threshold : 0}); },
/* Maintain BC for couple of versions. */
"above-the-fold" : function(a) { return !$.belowthefold(a, {threshold : 0}); },
"right-of-fold" : function(a) { return $.rightoffold(a, {threshold : 0}); },
"left-of-fold" : function(a) { return !$.rightoffold(a, {threshold : 0}); }
});
})(jQuery, window);

View File

@@ -17,7 +17,7 @@ require.config({
backbone: "../assets/vendors/backbone/backbone.min", backbone: "../assets/vendors/backbone/backbone.min",
"jquery.ui.widget": "../assets/vendors/jquery-file-upload/jquery.ui.widget.min", "jquery.ui.widget": "../assets/vendors/jquery-file-upload/jquery.ui.widget.min",
"jquery.cookie": "../assets/vendors/jquery.cookie/jquery.cookie.min", "jquery.cookie": "../assets/vendors/jquery.cookie/jquery.cookie.min",
"jquery.treeview": "../assets/vendors/jquery.treeview/jquery.treeview", "jquery.treeview": "../assets/vendors/jquery-treeview/jquery.treeview",
"jquery.tooltip": "../include/jquery.tooltip", "jquery.tooltip": "../include/jquery.tooltip",
"blueimp.loadimage" : "../assets/vendors/blueimp-load-image/load-image", "blueimp.loadimage" : "../assets/vendors/blueimp-load-image/load-image",
"jfu.iframe-transport": "../assets/vendors/jquery-file-upload/jquery.iframe-transport", "jfu.iframe-transport": "../assets/vendors/jquery-file-upload/jquery.iframe-transport",

View File

@@ -13,7 +13,7 @@ require.config({
"underscore": "../assets/underscore-amd/underscore", "underscore": "../assets/underscore-amd/underscore",
"jquery.ui.widget": "../assets/jquery-file-upload/jquery.ui.widget", "jquery.ui.widget": "../assets/jquery-file-upload/jquery.ui.widget",
"jquery.cookie": "../assets/jquery.cookie/jquery.cookie", "jquery.cookie": "../assets/jquery.cookie/jquery.cookie",
"jquery.treeview": "../assets/jquery.treeview/jquery.treeview", "jquery.treeview": "../assets/vendors/jquery-treeview/jquery.treeview",
"jquery.tooltip": "../include/jquery.tooltip", "jquery.tooltip": "../include/jquery.tooltip",
"blueimp.loadimage" : "../assets/blueimp-load-image/load-image", "blueimp.loadimage" : "../assets/blueimp-load-image/load-image",
"jfu.iframe-transport": "../assets/jquery-file-upload/jquery.iframe-transport", "jfu.iframe-transport": "../assets/jquery-file-upload/jquery.iframe-transport",