Version Description
Update now to support FooVideo and many other improvements!
Download this release
Release Info
Developer | bradvin |
Plugin | FooGallery – Image Gallery WordPress Plugin |
Version | 1.3.29 |
Comparing to | |
See all releases |
Version 1.3.29
- Gruntfile.js +212 -0
- LICENSE.txt +339 -0
- README.md +326 -0
- README.txt +323 -0
- assets/extension_bg.png +0 -0
- assets/foobot_small.png +0 -0
- assets/image-placeholder.png +0 -0
- assets/logo.png +0 -0
- assets/screenshots/admin-edit-gallery.jpg +0 -0
- assets/screenshots/admin-insert-shortcode.jpg +0 -0
- assets/screenshots/admin-nextgen-import.jpg +0 -0
- changelog.txt +4 -0
- css/admin-foogallery.css +462 -0
- css/admin-page-foogallery-extensions.css +297 -0
- css/admin-page-foogallery-settings.css +3 -0
- css/admin-tinymce.css +114 -0
- css/foogallery-foovideo-overrides.css +96 -0
- css/foogallery.admin.min.css +1 -0
- extensions/albums/admin/class-columns.php +73 -0
- extensions/albums/admin/class-metaboxes.php +576 -0
- extensions/albums/admin/index.php +1 -0
- extensions/albums/album-default.php +81 -0
- extensions/albums/album-stack.php +67 -0
- extensions/albums/class-albums-extension.php +111 -0
- extensions/albums/class-foogallery-album.php +256 -0
- extensions/albums/class-posttypes.php +108 -0
- extensions/albums/css/admin-foogallery-album.css +380 -0
- extensions/albums/css/album-default.css +102 -0
- extensions/albums/css/album-stack.css +290 -0
- extensions/albums/foogallery-albums.png +0 -0
- extensions/albums/functions.php +361 -0
- extensions/albums/js/admin-foogallery-album.js +148 -0
- extensions/albums/js/album-stack.js +863 -0
- extensions/albums/public/class-foogallery-album-template-loader.php +184 -0
- extensions/albums/public/class-rewrite-rules.php +17 -0
- extensions/albums/public/class-shortcodes.php +48 -0
- extensions/default-templates/class-default-templates-extension.php +47 -0
- extensions/default-templates/default/class-default-gallery-template.php +200 -0
- extensions/default-templates/default/gallery-default.php +22 -0
- extensions/default-templates/default/js/admin-gallery-default.js +89 -0
- extensions/default-templates/functions.php +22 -0
- extensions/default-templates/image-viewer/class-image-viewer-gallery-template.php +251 -0
- extensions/default-templates/image-viewer/gallery-image-viewer.php +41 -0
- extensions/default-templates/image-viewer/js/admin-gallery-image-viewer.js +123 -0
- extensions/default-templates/justified/class-justified-gallery-template.php +222 -0
- extensions/default-templates/justified/gallery-justified.php +21 -0
- extensions/default-templates/masonry/class-masonry-gallery-template.php +263 -0
- extensions/default-templates/masonry/gallery-masonry.php +26 -0
- extensions/default-templates/masonry/js/admin-gallery-masonry.js +30 -0
- extensions/default-templates/shared/css/admin-foogallery.css +78 -0
- extensions/default-templates/shared/css/foogallery.css +2305 -0
- extensions/default-templates/shared/css/foogallery.min.css +1 -0
- extensions/default-templates/shared/img/circle-plus.png +0 -0
- extensions/default-templates/shared/img/circle-plus@2x.png +0 -0
- extensions/default-templates/shared/img/circle-plus@3x.png +0 -0
- extensions/default-templates/shared/img/external.png +0 -0
- extensions/default-templates/shared/img/external@2x.png +0 -0
- extensions/default-templates/shared/img/external@3x.png +0 -0
- extensions/default-templates/shared/img/eye.png +0 -0
- extensions/default-templates/shared/img/eye@2x.png +0 -0
- extensions/default-templates/shared/img/eye@3x.png +0 -0
- extensions/default-templates/shared/img/image.png +0 -0
- extensions/default-templates/shared/img/image@2x.png +0 -0
- extensions/default-templates/shared/img/image@3x.png +0 -0
- extensions/default-templates/shared/img/plus.png +0 -0
- extensions/default-templates/shared/img/plus@2x.png +0 -0
- extensions/default-templates/shared/img/plus@3x.png +0 -0
- extensions/default-templates/shared/img/zoom.png +0 -0
- extensions/default-templates/shared/img/zoom2.png +0 -0
- extensions/default-templates/shared/img/zoom2@2x.png +0 -0
- extensions/default-templates/shared/img/zoom2@3x.png +0 -0
- extensions/default-templates/shared/img/zoom3.png +0 -0
- extensions/default-templates/shared/img/zoom3@2x.png +0 -0
- extensions/default-templates/shared/img/zoom3@3x.png +0 -0
- extensions/default-templates/shared/img/zoom@2x.png +0 -0
- extensions/default-templates/shared/img/zoom@3x.png +0 -0
- extensions/default-templates/shared/js/foogallery.js +7501 -0
- extensions/default-templates/shared/js/foogallery.min.js +10 -0
- extensions/default-templates/simple-portfolio/class-simple-portfolio-gallery-template.php +263 -0
- extensions/default-templates/simple-portfolio/gallery-simple_portfolio.php +27 -0
- extensions/default-templates/thumbnail/class-thumbnail-gallery-template.php +193 -0
- extensions/default-templates/thumbnail/gallery-thumbnail.php +40 -0
- extensions/default-templates/thumbnail/js/admin-gallery-thumbnail.js +30 -0
- extensions/extensions.json.js +118 -0
- extensions/media-categories/class-media-categories-extension.php +237 -0
- extensions/nextgen-importer/class-nextgen-gallery-importer-extension.php +171 -0
- extensions/nextgen-importer/class-nextgen-helper.php +578 -0
- extensions/nextgen-importer/class-nextgen-import-progress-album.php +81 -0
- extensions/nextgen-importer/class-nextgen-import-progress.php +154 -0
- extensions/nextgen-importer/class-nextgen-pagination.php +213 -0
- extensions/nextgen-importer/view-importer.php +280 -0
- foogallery.php +306 -0
- freemius/.codeclimate.yml +19 -0
- freemius/.github/ISSUE_TEMPLATE.md +29 -0
- freemius/.travis.yml +11 -0
- freemius/LICENSE.txt +674 -0
- freemius/README.md +253 -0
- freemius/assets/css/admin/account.css +1 -0
- freemius/assets/css/admin/add-ons.css +2 -0
- freemius/assets/css/admin/checkout.css +1 -0
- freemius/assets/css/admin/common.css +2 -0
- freemius/assets/css/admin/connect.css +1 -0
- freemius/assets/css/admin/deactivation-feedback.css +1 -0
- freemius/assets/css/admin/debug.css +1 -0
- freemius/assets/css/admin/dialog-boxes.css +2 -0
- freemius/assets/css/admin/license-activation.css +1 -0
- freemius/assets/css/customizer.css +1 -0
- freemius/assets/img/foogallery.png +0 -0
- freemius/assets/img/plugin-icon.png +0 -0
- freemius/assets/img/theme-icon.png +0 -0
- freemius/assets/index.php +3 -0
- freemius/assets/js/nojquery.ba-postmessage.js +140 -0
- freemius/assets/js/nojquery.ba-postmessage.min.js +12 -0
- freemius/assets/js/postmessage.js +135 -0
- freemius/assets/scss/_colors.scss +65 -0
- freemius/assets/scss/_functions.scss +0 -0
- freemius/assets/scss/_load.scss +4 -0
- freemius/assets/scss/_mixins.scss +283 -0
- freemius/assets/scss/_start.scss +4 -0
- freemius/assets/scss/_vars.scss +6 -0
- freemius/assets/scss/admin/_ajax-loader.scss +49 -0
- freemius/assets/scss/admin/_auto-install.scss +33 -0
- freemius/assets/scss/admin/_deactivation-feedback.scss +55 -0
- freemius/assets/scss/admin/_license-activation.scss +7 -0
- freemius/assets/scss/admin/_license-key-resend.scss +68 -0
- freemius/assets/scss/admin/_modal-common.scss +186 -0
- freemius/assets/scss/admin/_themes.scss +21 -0
- freemius/assets/scss/admin/account.scss +256 -0
- freemius/assets/scss/admin/add-ons.scss +449 -0
- freemius/assets/scss/admin/checkout.scss +5 -0
- freemius/assets/scss/admin/common.scss +218 -0
- freemius/assets/scss/admin/connect.scss +520 -0
- freemius/assets/scss/admin/debug.scss +135 -0
- freemius/assets/scss/admin/dialog-boxes.scss +7 -0
- freemius/assets/scss/customizer.scss +125 -0
- freemius/composer.json +10 -0
- freemius/config.php +67 -0
Gruntfile.js
ADDED
@@ -0,0 +1,212 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
module.exports = function (grunt) {
|
2 |
+
|
3 |
+
require('load-grunt-tasks')(grunt);
|
4 |
+
|
5 |
+
// Project configuration.
|
6 |
+
grunt.initConfig({
|
7 |
+
pkg: grunt.file.readJSON('package.json'),
|
8 |
+
uglify: {
|
9 |
+
options: {
|
10 |
+
compress: {
|
11 |
+
global_defs: {
|
12 |
+
"EO_SCRIPT_DEBUG": false
|
13 |
+
},
|
14 |
+
dead_code: true
|
15 |
+
},
|
16 |
+
banner: '/*! <%= pkg.name %> <%= pkg.version %> <%= grunt.template.today("yyyy-mm-dd HH:MM") %> */\n'
|
17 |
+
},
|
18 |
+
build: {
|
19 |
+
files: [
|
20 |
+
{
|
21 |
+
expand: true, // Enable dynamic expansion.
|
22 |
+
src: ['extensions/default-templates/js/*.js', '!extensions/default-templates/js/*.min.js' ], // Actual pattern(s) to match.
|
23 |
+
ext: '.min.js' // Dest filepaths will have this extension.
|
24 |
+
}
|
25 |
+
]
|
26 |
+
}
|
27 |
+
},
|
28 |
+
jshint: {
|
29 |
+
options: {
|
30 |
+
reporter: require('jshint-stylish'),
|
31 |
+
globals: {
|
32 |
+
"EO_SCRIPT_DEBUG": false
|
33 |
+
},
|
34 |
+
'-W099': true, //Mixed spaces and tabs
|
35 |
+
'-W083': true, //TODO Fix functions within loop
|
36 |
+
'-W082': true, //Todo Function declarations should not be placed in blocks
|
37 |
+
'-W020': true //Read only - error when assigning EO_SCRIPT_DEBUG a value.
|
38 |
+
},
|
39 |
+
all: [ 'js/*.js', '!js/*.min.js' ]
|
40 |
+
},
|
41 |
+
|
42 |
+
compress: {
|
43 |
+
//Compress build/foogallery
|
44 |
+
main: {
|
45 |
+
options: {
|
46 |
+
mode: 'zip',
|
47 |
+
archive: './dist/foogallery.zip'
|
48 |
+
},
|
49 |
+
expand: true,
|
50 |
+
cwd: 'dist/foogallery/',
|
51 |
+
src: ['**/*'],
|
52 |
+
dest: 'foogallery/'
|
53 |
+
},
|
54 |
+
version: {
|
55 |
+
options: {
|
56 |
+
mode: 'zip',
|
57 |
+
archive: './dist/foogallery-<%= pkg.version %>.zip'
|
58 |
+
},
|
59 |
+
expand: true,
|
60 |
+
cwd: 'dist/foogallery/',
|
61 |
+
src: ['**/*'],
|
62 |
+
dest: 'foogallery/'
|
63 |
+
}
|
64 |
+
},
|
65 |
+
|
66 |
+
clean: {
|
67 |
+
//Clean up build folder
|
68 |
+
main: ['dist/foogallery']
|
69 |
+
},
|
70 |
+
|
71 |
+
copy: {
|
72 |
+
// Copy the plugin to a versioned release directory
|
73 |
+
main: {
|
74 |
+
src: [
|
75 |
+
'**',
|
76 |
+
'!node_modules/**',
|
77 |
+
'!dist/**',
|
78 |
+
'!.git/**',
|
79 |
+
'!vendor/**',
|
80 |
+
'!Gruntfile.js',
|
81 |
+
'!package.json',
|
82 |
+
'!.gitignore',
|
83 |
+
'!.gitmodules',
|
84 |
+
'!*~',
|
85 |
+
'!CONTRIBUTING.md'
|
86 |
+
],
|
87 |
+
dest: 'dist/foogallery/'
|
88 |
+
}
|
89 |
+
},
|
90 |
+
|
91 |
+
wp_readme_to_markdown: {
|
92 |
+
convert: {
|
93 |
+
files: {
|
94 |
+
'readme.md': 'readme.txt'
|
95 |
+
}
|
96 |
+
},
|
97 |
+
options : {
|
98 |
+
banner: 'https://s3.amazonaws.com/foogallery/banner-772x250.jpg',
|
99 |
+
afterBannerMarkdown: '[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/fooplugins/foogallery/badges/quality-score.png?b=develop)](https://scrutinizer-ci.com/g/fooplugins/foogallery/?branch=develop)',
|
100 |
+
screenshots: {
|
101 |
+
enabled: true,
|
102 |
+
prefix: 'https://s3.amazonaws.com/foogallery/screenshot-',
|
103 |
+
suffix: '.jpg'
|
104 |
+
}
|
105 |
+
}
|
106 |
+
},
|
107 |
+
|
108 |
+
checkrepo: {
|
109 |
+
deploy: {
|
110 |
+
tag: {
|
111 |
+
eq: '<%= pkg.version %>' // Check if highest repo tag is equal to pkg.version
|
112 |
+
},
|
113 |
+
tagged: true, // Check if last repo commit (HEAD) is not tagged
|
114 |
+
clean: true // Check if the repo working directory is clean
|
115 |
+
}
|
116 |
+
},
|
117 |
+
|
118 |
+
watch: {
|
119 |
+
readme: {
|
120 |
+
files: ['readme.txt'],
|
121 |
+
tasks: ['wp_readme_to_markdown'],
|
122 |
+
options: {
|
123 |
+
spawn: false
|
124 |
+
}
|
125 |
+
},
|
126 |
+
scripts: {
|
127 |
+
files: ['js/*.js'],
|
128 |
+
tasks: ['newer:jshint', 'newer:uglify'],
|
129 |
+
options: {
|
130 |
+
spawn: false
|
131 |
+
}
|
132 |
+
}
|
133 |
+
},
|
134 |
+
|
135 |
+
wp_deploy: {
|
136 |
+
deploy: {
|
137 |
+
options: {
|
138 |
+
svn_user: 'bradvin',
|
139 |
+
plugin_slug: 'foogallery',
|
140 |
+
build_dir: 'dist/foogallery/'
|
141 |
+
}
|
142 |
+
}
|
143 |
+
},
|
144 |
+
|
145 |
+
po2mo: {
|
146 |
+
files: {
|
147 |
+
src: 'languages/*.po',
|
148 |
+
expand: true
|
149 |
+
}
|
150 |
+
},
|
151 |
+
|
152 |
+
pot: {
|
153 |
+
options: {
|
154 |
+
text_domain: 'foogallery',
|
155 |
+
dest: 'languages/',
|
156 |
+
keywords: ['__', '_e', 'esc_html__', 'esc_html_e', 'esc_attr__', 'esc_attr_e', 'esc_attr_x', 'esc_html_x', 'ngettext', '_n', '_ex', '_nx' ]
|
157 |
+
},
|
158 |
+
files: {
|
159 |
+
src: [
|
160 |
+
'**/*.php',
|
161 |
+
'!node_modules/**',
|
162 |
+
'!dist/**',
|
163 |
+
'!vendor/**',
|
164 |
+
'!*~'
|
165 |
+
],
|
166 |
+
expand: true
|
167 |
+
}
|
168 |
+
},
|
169 |
+
|
170 |
+
checktextdomain: {
|
171 |
+
options: {
|
172 |
+
text_domain: 'foogallery',
|
173 |
+
keywords: ['__:1,2d',
|
174 |
+
'_e:1,2d',
|
175 |
+
'_x:1,2c,3d',
|
176 |
+
'esc_html__:1,2d',
|
177 |
+
'esc_html_e:1,2d',
|
178 |
+
'esc_html_x:1,2c,3d',
|
179 |
+
'esc_attr__:1,2d',
|
180 |
+
'esc_attr_e:1,2d',
|
181 |
+
'esc_attr_x:1,2c,3d',
|
182 |
+
'_ex:1,2c,3d',
|
183 |
+
'_n:1,2,4d',
|
184 |
+
'_nx:1,2,4c,5d',
|
185 |
+
'_n_noop:1,2,3d',
|
186 |
+
'_nx_noop:1,2,3c,4d'
|
187 |
+
]
|
188 |
+
},
|
189 |
+
files: {
|
190 |
+
src: [
|
191 |
+
'**/*.php',
|
192 |
+
'!node_modules/**',
|
193 |
+
'!dist/**',
|
194 |
+
'!vendor/**',
|
195 |
+
'!*~',
|
196 |
+
'!includes/foopluginbase/**'
|
197 |
+
],
|
198 |
+
expand: true
|
199 |
+
}
|
200 |
+
}
|
201 |
+
|
202 |
+
});
|
203 |
+
|
204 |
+
grunt.registerTask('readme', [ 'wp_readme_to_markdown' ]);
|
205 |
+
|
206 |
+
grunt.registerTask('test', [ 'jshint' ]);
|
207 |
+
|
208 |
+
grunt.registerTask('build', [ 'test', 'pot', 'newer:po2mo', 'wp_readme_to_markdown', 'clean', 'copy' ]);
|
209 |
+
|
210 |
+
grunt.registerTask('deploy', [ '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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
GNU GENERAL PUBLIC LICENSE
|
2 |
+
Version 2, June 1991
|
3 |
+
|
4 |
+
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
5 |
+
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
6 |
+
Everyone is permitted to copy and distribute verbatim copies
|
7 |
+
of this license document, but changing it is not allowed.
|
8 |
+
|
9 |
+
Preamble
|
10 |
+
|
11 |
+
The licenses for most software are designed to take away your
|
12 |
+
freedom to share and change it. By contrast, the GNU General Public
|
13 |
+
License is intended to guarantee your freedom to share and change free
|
14 |
+
software--to make sure the software is free for all its users. This
|
15 |
+
General Public License applies to most of the Free Software
|
16 |
+
Foundation's software and to any other program whose authors commit to
|
17 |
+
using it. (Some other Free Software Foundation software is covered by
|
18 |
+
the GNU Lesser General Public License instead.) You can apply it to
|
19 |
+
your programs, too.
|
20 |
+
|
21 |
+
When we speak of free software, we are referring to freedom, not
|
22 |
+
price. Our General Public Licenses are designed to make sure that you
|
23 |
+
have the freedom to distribute copies of free software (and charge for
|
24 |
+
this service if you wish), that you receive source code or can get it
|
25 |
+
if you want it, that you can change the software or use pieces of it
|
26 |
+
in new free programs; and that you know you can do these things.
|
27 |
+
|
28 |
+
To protect your rights, we need to make restrictions that forbid
|
29 |
+
anyone to deny you these rights or to ask you to surrender the rights.
|
30 |
+
These restrictions translate to certain responsibilities for you if you
|
31 |
+
distribute copies of the software, or if you modify it.
|
32 |
+
|
33 |
+
For example, if you distribute copies of such a program, whether
|
34 |
+
gratis or for a fee, you must give the recipients all the rights that
|
35 |
+
you have. You must make sure that they, too, receive or can get the
|
36 |
+
source code. And you must show them these terms so they know their
|
37 |
+
rights.
|
38 |
+
|
39 |
+
We protect your rights with two steps: (1) copyright the software, and
|
40 |
+
(2) offer you this license which gives you legal permission to copy,
|
41 |
+
distribute and/or modify the software.
|
42 |
+
|
43 |
+
Also, for each author's protection and ours, we want to make certain
|
44 |
+
that everyone understands that there is no warranty for this free
|
45 |
+
software. If the software is modified by someone else and passed on, we
|
46 |
+
want its recipients to know that what they have is not the original, so
|
47 |
+
that any problems introduced by others will not reflect on the original
|
48 |
+
authors' reputations.
|
49 |
+
|
50 |
+
Finally, any free program is threatened constantly by software
|
51 |
+
patents. We wish to avoid the danger that redistributors of a free
|
52 |
+
program will individually obtain patent licenses, in effect making the
|
53 |
+
program proprietary. To prevent this, we have made it clear that any
|
54 |
+
patent must be licensed for everyone's free use or not licensed at all.
|
55 |
+
|
56 |
+
The precise terms and conditions for copying, distribution and
|
57 |
+
modification follow.
|
58 |
+
|
59 |
+
GNU GENERAL PUBLIC LICENSE
|
60 |
+
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
61 |
+
|
62 |
+
0. This License applies to any program or other work which contains
|
63 |
+
a notice placed by the copyright holder saying it may be distributed
|
64 |
+
under the terms of this General Public License. The "Program", below,
|
65 |
+
refers to any such program or work, and a "work based on the Program"
|
66 |
+
means either the Program or any derivative work under copyright law:
|
67 |
+
that is to say, a work containing the Program or a portion of it,
|
68 |
+
either verbatim or with modifications and/or translated into another
|
69 |
+
language. (Hereinafter, translation is included without limitation in
|
70 |
+
the term "modification".) Each licensee is addressed as "you".
|
71 |
+
|
72 |
+
Activities other than copying, distribution and modification are not
|
73 |
+
covered by this License; they are outside its scope. The act of
|
74 |
+
running the Program is not restricted, and the output from the Program
|
75 |
+
is covered only if its contents constitute a work based on the
|
76 |
+
Program (independent of having been made by running the Program).
|
77 |
+
Whether that is true depends on what the Program does.
|
78 |
+
|
79 |
+
1. You may copy and distribute verbatim copies of the Program's
|
80 |
+
source code as you receive it, in any medium, provided that you
|
81 |
+
conspicuously and appropriately publish on each copy an appropriate
|
82 |
+
copyright notice and disclaimer of warranty; keep intact all the
|
83 |
+
notices that refer to this License and to the absence of any warranty;
|
84 |
+
and give any other recipients of the Program a copy of this License
|
85 |
+
along with the Program.
|
86 |
+
|
87 |
+
You may charge a fee for the physical act of transferring a copy, and
|
88 |
+
you may at your option offer warranty protection in exchange for a fee.
|
89 |
+
|
90 |
+
2. You may modify your copy or copies of the Program or any portion
|
91 |
+
of it, thus forming a work based on the Program, and copy and
|
92 |
+
distribute such modifications or work under the terms of Section 1
|
93 |
+
above, provided that you also meet all of these conditions:
|
94 |
+
|
95 |
+
a) You must cause the modified files to carry prominent notices
|
96 |
+
stating that you changed the files and the date of any change.
|
97 |
+
|
98 |
+
b) You must cause any work that you distribute or publish, that in
|
99 |
+
whole or in part contains or is derived from the Program or any
|
100 |
+
part thereof, to be licensed as a whole at no charge to all third
|
101 |
+
parties under the terms of this License.
|
102 |
+
|
103 |
+
c) If the modified program normally reads commands interactively
|
104 |
+
when run, you must cause it, when started running for such
|
105 |
+
interactive use in the most ordinary way, to print or display an
|
106 |
+
announcement including an appropriate copyright notice and a
|
107 |
+
notice that there is no warranty (or else, saying that you provide
|
108 |
+
a warranty) and that users may redistribute the program under
|
109 |
+
these conditions, and telling the user how to view a copy of this
|
110 |
+
License. (Exception: if the Program itself is interactive but
|
111 |
+
does not normally print such an announcement, your work based on
|
112 |
+
the Program is not required to print an announcement.)
|
113 |
+
|
114 |
+
These requirements apply to the modified work as a whole. If
|
115 |
+
identifiable sections of that work are not derived from the Program,
|
116 |
+
and can be reasonably considered independent and separate works in
|
117 |
+
themselves, then this License, and its terms, do not apply to those
|
118 |
+
sections when you distribute them as separate works. But when you
|
119 |
+
distribute the same sections as part of a whole which is a work based
|
120 |
+
on the Program, the distribution of the whole must be on the terms of
|
121 |
+
this License, whose permissions for other licensees extend to the
|
122 |
+
entire whole, and thus to each and every part regardless of who wrote it.
|
123 |
+
|
124 |
+
Thus, it is not the intent of this section to claim rights or contest
|
125 |
+
your rights to work written entirely by you; rather, the intent is to
|
126 |
+
exercise the right to control the distribution of derivative or
|
127 |
+
collective works based on the Program.
|
128 |
+
|
129 |
+
In addition, mere aggregation of another work not based on the Program
|
130 |
+
with the Program (or with a work based on the Program) on a volume of
|
131 |
+
a storage or distribution medium does not bring the other work under
|
132 |
+
the scope of this License.
|
133 |
+
|
134 |
+
3. You may copy and distribute the Program (or a work based on it,
|
135 |
+
under Section 2) in object code or executable form under the terms of
|
136 |
+
Sections 1 and 2 above provided that you also do one of the following:
|
137 |
+
|
138 |
+
a) Accompany it with the complete corresponding machine-readable
|
139 |
+
source code, which must be distributed under the terms of Sections
|
140 |
+
1 and 2 above on a medium customarily used for software interchange; or,
|
141 |
+
|
142 |
+
b) Accompany it with a written offer, valid for at least three
|
143 |
+
years, to give any third party, for a charge no more than your
|
144 |
+
cost of physically performing source distribution, a complete
|
145 |
+
machine-readable copy of the corresponding source code, to be
|
146 |
+
distributed under the terms of Sections 1 and 2 above on a medium
|
147 |
+
customarily used for software interchange; or,
|
148 |
+
|
149 |
+
c) Accompany it with the information you received as to the offer
|
150 |
+
to distribute corresponding source code. (This alternative is
|
151 |
+
allowed only for noncommercial distribution and only if you
|
152 |
+
received the program in object code or executable form with such
|
153 |
+
an offer, in accord with Subsection b above.)
|
154 |
+
|
155 |
+
The source code for a work means the preferred form of the work for
|
156 |
+
making modifications to it. For an executable work, complete source
|
157 |
+
code means all the source code for all modules it contains, plus any
|
158 |
+
associated interface definition files, plus the scripts used to
|
159 |
+
control compilation and installation of the executable. However, as a
|
160 |
+
special exception, the source code distributed need not include
|
161 |
+
anything that is normally distributed (in either source or binary
|
162 |
+
form) with the major components (compiler, kernel, and so on) of the
|
163 |
+
operating system on which the executable runs, unless that component
|
164 |
+
itself accompanies the executable.
|
165 |
+
|
166 |
+
If distribution of executable or object code is made by offering
|
167 |
+
access to copy from a designated place, then offering equivalent
|
168 |
+
access to copy the source code from the same place counts as
|
169 |
+
distribution of the source code, even though third parties are not
|
170 |
+
compelled to copy the source along with the object code.
|
171 |
+
|
172 |
+
4. You may not copy, modify, sublicense, or distribute the Program
|
173 |
+
except as expressly provided under this License. Any attempt
|
174 |
+
otherwise to copy, modify, sublicense or distribute the Program is
|
175 |
+
void, and will automatically terminate your rights under this License.
|
176 |
+
However, parties who have received copies, or rights, from you under
|
177 |
+
this License will not have their licenses terminated so long as such
|
178 |
+
parties remain in full compliance.
|
179 |
+
|
180 |
+
5. You are not required to accept this License, since you have not
|
181 |
+
signed it. However, nothing else grants you permission to modify or
|
182 |
+
distribute the Program or its derivative works. These actions are
|
183 |
+
prohibited by law if you do not accept this License. Therefore, by
|
184 |
+
modifying or distributing the Program (or any work based on the
|
185 |
+
Program), you indicate your acceptance of this License to do so, and
|
186 |
+
all its terms and conditions for copying, distributing or modifying
|
187 |
+
the Program or works based on it.
|
188 |
+
|
189 |
+
6. Each time you redistribute the Program (or any work based on the
|
190 |
+
Program), the recipient automatically receives a license from the
|
191 |
+
original licensor to copy, distribute or modify the Program subject to
|
192 |
+
these terms and conditions. You may not impose any further
|
193 |
+
restrictions on the recipients' exercise of the rights granted herein.
|
194 |
+
You are not responsible for enforcing compliance by third parties to
|
195 |
+
this License.
|
196 |
+
|
197 |
+
7. If, as a consequence of a court judgment or allegation of patent
|
198 |
+
infringement or for any other reason (not limited to patent issues),
|
199 |
+
conditions are imposed on you (whether by court order, agreement or
|
200 |
+
otherwise) that contradict the conditions of this License, they do not
|
201 |
+
excuse you from the conditions of this License. If you cannot
|
202 |
+
distribute so as to satisfy simultaneously your obligations under this
|
203 |
+
License and any other pertinent obligations, then as a consequence you
|
204 |
+
may not distribute the Program at all. For example, if a patent
|
205 |
+
license would not permit royalty-free redistribution of the Program by
|
206 |
+
all those who receive copies directly or indirectly through you, then
|
207 |
+
the only way you could satisfy both it and this License would be to
|
208 |
+
refrain entirely from distribution of the Program.
|
209 |
+
|
210 |
+
If any portion of this section is held invalid or unenforceable under
|
211 |
+
any particular circumstance, the balance of the section is intended to
|
212 |
+
apply and the section as a whole is intended to apply in other
|
213 |
+
circumstances.
|
214 |
+
|
215 |
+
It is not the purpose of this section to induce you to infringe any
|
216 |
+
patents or other property right claims or to contest validity of any
|
217 |
+
such claims; this section has the sole purpose of protecting the
|
218 |
+
integrity of the free software distribution system, which is
|
219 |
+
implemented by public license practices. Many people have made
|
220 |
+
generous contributions to the wide range of software distributed
|
221 |
+
through that system in reliance on consistent application of that
|
222 |
+
system; it is up to the author/donor to decide if he or she is willing
|
223 |
+
to distribute software through any other system and a licensee cannot
|
224 |
+
impose that choice.
|
225 |
+
|
226 |
+
This section is intended to make thoroughly clear what is believed to
|
227 |
+
be a consequence of the rest of this License.
|
228 |
+
|
229 |
+
8. If the distribution and/or use of the Program is restricted in
|
230 |
+
certain countries either by patents or by copyrighted interfaces, the
|
231 |
+
original copyright holder who places the Program under this License
|
232 |
+
may add an explicit geographical distribution limitation excluding
|
233 |
+
those countries, so that distribution is permitted only in or among
|
234 |
+
countries not thus excluded. In such case, this License incorporates
|
235 |
+
the limitation as if written in the body of this License.
|
236 |
+
|
237 |
+
9. The Free Software Foundation may publish revised and/or new versions
|
238 |
+
of the General Public License from time to time. Such new versions will
|
239 |
+
be similar in spirit to the present version, but may differ in detail to
|
240 |
+
address new problems or concerns.
|
241 |
+
|
242 |
+
Each version is given a distinguishing version number. If the Program
|
243 |
+
specifies a version number of this License which applies to it and "any
|
244 |
+
later version", you have the option of following the terms and conditions
|
245 |
+
either of that version or of any later version published by the Free
|
246 |
+
Software Foundation. If the Program does not specify a version number of
|
247 |
+
this License, you may choose any version ever published by the Free Software
|
248 |
+
Foundation.
|
249 |
+
|
250 |
+
10. If you wish to incorporate parts of the Program into other free
|
251 |
+
programs whose distribution conditions are different, write to the author
|
252 |
+
to ask for permission. For software which is copyrighted by the Free
|
253 |
+
Software Foundation, write to the Free Software Foundation; we sometimes
|
254 |
+
make exceptions for this. Our decision will be guided by the two goals
|
255 |
+
of preserving the free status of all derivatives of our free software and
|
256 |
+
of promoting the sharing and reuse of software generally.
|
257 |
+
|
258 |
+
NO WARRANTY
|
259 |
+
|
260 |
+
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
261 |
+
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
262 |
+
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
263 |
+
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
264 |
+
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
265 |
+
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
266 |
+
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
267 |
+
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
268 |
+
REPAIR OR CORRECTION.
|
269 |
+
|
270 |
+
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
271 |
+
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
272 |
+
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
273 |
+
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
274 |
+
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
275 |
+
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
276 |
+
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
277 |
+
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
278 |
+
POSSIBILITY OF SUCH DAMAGES.
|
279 |
+
|
280 |
+
END OF TERMS AND CONDITIONS
|
281 |
+
|
282 |
+
How to Apply These Terms to Your New Programs
|
283 |
+
|
284 |
+
If you develop a new program, and you want it to be of the greatest
|
285 |
+
possible use to the public, the best way to achieve this is to make it
|
286 |
+
free software which everyone can redistribute and change under these terms.
|
287 |
+
|
288 |
+
To do so, attach the following notices to the program. It is safest
|
289 |
+
to attach them to the start of each source file to most effectively
|
290 |
+
convey the exclusion of warranty; and each file should have at least
|
291 |
+
the "copyright" line and a pointer to where the full notice is found.
|
292 |
+
|
293 |
+
<one line to give the program's name and a brief idea of what it does.>
|
294 |
+
Copyright (C) <year> <name of author>
|
295 |
+
|
296 |
+
This program is free software; you can redistribute it and/or modify
|
297 |
+
it under the terms of the GNU General Public License as published by
|
298 |
+
the Free Software Foundation; either version 2 of the License, or
|
299 |
+
(at your option) any later version.
|
300 |
+
|
301 |
+
This program is distributed in the hope that it will be useful,
|
302 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
303 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
304 |
+
GNU General Public License for more details.
|
305 |
+
|
306 |
+
You should have received a copy of the GNU General Public License along
|
307 |
+
with this program; if not, write to the Free Software Foundation, Inc.,
|
308 |
+
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
309 |
+
|
310 |
+
Also add information on how to contact you by electronic and paper mail.
|
311 |
+
|
312 |
+
If the program is interactive, make it output a short notice like this
|
313 |
+
when it starts in an interactive mode:
|
314 |
+
|
315 |
+
Gnomovision version 69, Copyright (C) year name of author
|
316 |
+
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
317 |
+
This is free software, and you are welcome to redistribute it
|
318 |
+
under certain conditions; type `show c' for details.
|
319 |
+
|
320 |
+
The hypothetical commands `show w' and `show c' should show the appropriate
|
321 |
+
parts of the General Public License. Of course, the commands you use may
|
322 |
+
be called something other than `show w' and `show c'; they could even be
|
323 |
+
mouse-clicks or menu items--whatever suits your program.
|
324 |
+
|
325 |
+
You should also get your employer (if you work as a programmer) or your
|
326 |
+
school, if any, to sign a "copyright disclaimer" for the program, if
|
327 |
+
necessary. Here is a sample; alter the names:
|
328 |
+
|
329 |
+
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
330 |
+
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
331 |
+
|
332 |
+
<signature of Ty Coon>, 1 April 1989
|
333 |
+
Ty Coon, President of Vice
|
334 |
+
|
335 |
+
This General Public License does not permit incorporating your program into
|
336 |
+
proprietary programs. If your program is a subroutine library, you may
|
337 |
+
consider it more useful to permit linking proprietary applications with the
|
338 |
+
library. If this is what you want to do, use the GNU Lesser General
|
339 |
+
Public License instead of this License.
|
README.md
ADDED
@@ -0,0 +1,326 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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rutinizer Code Quality](https://scrutinizer-ci.com/g/fooplugins/foogallery/badges/quality-score.png?b=develop)](https://scrutinizer-ci.com/g/fooplugins/foogallery/?branch=develop)
|
4 |
+
# FooGallery - Image Gallery WordPress Plugin #
|
5 |
+
**Contributors:** bradvin, fooplugins
|
6 |
+
|
7 |
+
**Donate link:** http://fooplugins.com
|
8 |
+
|
9 |
+
**Tags:** gallery, image gallery, photo gallery, responsive, album, media gallery, masonry gallery, portfolio, justified image gallery, video gallery, photography, photographer, retina
|
10 |
+
|
11 |
+
**Requires at least:** 3.9
|
12 |
+
|
13 |
+
**Tested up to:** 4.8.3
|
14 |
+
|
15 |
+
**Stable tag:** trunk
|
16 |
+
|
17 |
+
**License:** GPLv2 or later
|
18 |
+
|
19 |
+
**License URI:** http://www.gnu.org/licenses/gpl-2.0.html
|
20 |
+
|
21 |
+
FooGallery is the best image gallery plugin for WordPress. Why? Stunning gallery layouts, responsive, retina-ready, lightning fast, easy to use.
|
22 |
+
|
23 |
+
## Description ##
|
24 |
+
|
25 |
+
**Major changes in 1.3.28**
|
26 |
+
|
27 |
+
FooGallery is the best image gallery plugin for WordPress. Why? Stunning gallery layouts, responsive, retina-ready, lightning fast, easy to use. Built to be highly configurable and extensible for developers or freelancers.
|
28 |
+
|
29 |
+
[View the Foo Gallery Homepage & DEMO](http://foo.gallery/)
|
30 |
+
|
31 |
+
**Retina Support**
|
32 |
+
|
33 |
+
Foo Gallery now comes with built-in support for higher quality thumbnails on retina-enabled displays. No more blurry thumbnails, just crisp thumbnails that look amazing on all devices.
|
34 |
+
|
35 |
+
**Video Support**
|
36 |
+
|
37 |
+
Foo Gallery now supports the creation of video galleries with the [FooVideo premium extension](http://fooplugins.com/plugins/foovideo/?utm_source=foogalleryplugin&utm_medium=foogallerylink&utm_campaign=foogallery_wprepo)! Create galleries with both images and videos mixed!
|
38 |
+
|
39 |
+
**Albums Built In**
|
40 |
+
|
41 |
+
Albums are now built in as an extension. Simply head over to the extensions page and activate the albums extension. A new menu item will appear that allows you to add albums just as easily as galleries.
|
42 |
+
|
43 |
+
**Built For Developers**
|
44 |
+
|
45 |
+
Foo Gallery was designed to be the most developer-friendly gallery plugin available for WordPress. It was also built on top of a solid extension framework, which means different functionality is separated out into different areas in the codebase. It also means the core plugin is lightweight, but still allowing for the most flexibility.
|
46 |
+
|
47 |
+
**Features**
|
48 |
+
|
49 |
+
* Retina thumbnail support
|
50 |
+
* Add videos to galleries (via the [FooVideo premium extension](http://fooplugins.com/plugins/foovideo/?utm_source=foogalleryplugin&utm_medium=foogallerylink&utm_campaign=foogallery_wprepo))
|
51 |
+
* Albums built-in! (Activate the albums extension)
|
52 |
+
* Gallery custom post type
|
53 |
+
* Use built-in media library to manage images
|
54 |
+
* Drag n Drop reordering of images and galleries
|
55 |
+
* Built-in gallery templates
|
56 |
+
* Built-in support for FooBox
|
57 |
+
* Built-in Extensions Store
|
58 |
+
* Built on an extension framework
|
59 |
+
* Custom CSS for both galleries and albums
|
60 |
+
* Copy to clipboard shortcodes
|
61 |
+
* Visual shortcodes in rich text editor
|
62 |
+
* Gallery picker to insert shortcode
|
63 |
+
* Page usage metabox with one-click gallery page creation
|
64 |
+
* NextGen importer tool (albums and galleries)
|
65 |
+
* Multisite Support
|
66 |
+
* plus many, many more
|
67 |
+
|
68 |
+
**Gallery Demos**
|
69 |
+
|
70 |
+
* Responsive Image Gallery - [demo](http://foo.gallery/demos/responsive-image-gallery/)
|
71 |
+
* FooGrid Image Gallery - [light demo](http://foo.gallery/demos/foogrid-light/) - [dark demo](http://foo.gallery/demos/foogrid-dark/)
|
72 |
+
* Image Viewer Gallery - [light demo](http://foo.gallery/demos/image-viewer-gallery/) - [dark demo](http://foo.gallery/demos/image-viewer-gallery-dark/)
|
73 |
+
* Masonry Gallery - [demo](http://foo.gallery/demos/masonry-image-gallery/)
|
74 |
+
* Simple Portfolio - [demo](http://foo.gallery/demos/simple-portfolio/)
|
75 |
+
* Justified Gallery ([http://miromannino.github.io/Justified-Gallery](http://miromannino.github.io/Justified-Gallery/)) - [demo](http://foo.gallery/demos/justified-gallery/)
|
76 |
+
* Single Thumbnail Gallery - [demo](http://foo.gallery/demos/single-thumbnail-gallery/)
|
77 |
+
* Polaroid Gallery - [demo](http://foo.gallery/demos/polaroid-image-gallery/)
|
78 |
+
* Cube Gallery - [demo](http://foo.gallery/demos/cube-gallery/) - [Buy Now!](http://fooplugins.com/plugins/cube-gallery-template/?utm_source=foogalleryplugin&utm_medium=foogallerylink&utm_campaign=foogallery_wprepo)
|
79 |
+
* Mixed (Images + Videos) - [demo](http://foo.gallery/demos/mixed/)
|
80 |
+
|
81 |
+
**Caption Demos**
|
82 |
+
|
83 |
+
* Simple Hover Captions - [demo](http://foo.gallery/demos/captions-simple-hover/)
|
84 |
+
* Always Visible Captions - [demo](http://foo.gallery/demos/responsive-image-gallery-captions/)
|
85 |
+
* Drop Captions - [demo](http://foo.gallery/demos/captions-drop/)
|
86 |
+
* Fade Captions - [demo](http://foo.gallery/demos/captions-fade/)
|
87 |
+
* Push Captions - [demo](http://foo.gallery/demos/captions-push/)
|
88 |
+
|
89 |
+
**Album Demos**
|
90 |
+
|
91 |
+
* Responsive Album Layout - [demo](http://foo.gallery/demos/responsive-album-layout/)
|
92 |
+
* All-in-one Stack Album - [demo](http://foo.gallery/demos/all-in-one-stack-album/)
|
93 |
+
|
94 |
+
**Videos Demos**
|
95 |
+
|
96 |
+
* Vertical Video Slider - [demo](http://foo.gallery/demos/video-slider-vertical/) - [full-width demo](http://foo.gallery/demos/video-slider-vertical-full-width/)
|
97 |
+
* Horizontal Video Slider - [demo](http://foo.gallery/demos/video-slider-horizontal/) - [custom colors](http://foo.gallery/demos/video-slider-custom-theme/)
|
98 |
+
|
99 |
+
**Extensions**
|
100 |
+
|
101 |
+
* [FooVideo](http://fooplugins.com/plugins/foovideo/?utm_source=foogalleryplugin&utm_medium=foogallerylink&utm_campaign=foogallery_wprepo)
|
102 |
+
* Albums (bundled)
|
103 |
+
* Default Gallery Templates (bundled)
|
104 |
+
* NextGen Gallery and Album Importer (bundled)
|
105 |
+
* [FooGrid Gallery](http://fooplugins.com/plugins/foogrid/?utm_source=foogalleryplugin&utm_medium=foogallerylink&utm_campaign=foogallery_wprepo)
|
106 |
+
* [Cube Gallery](http://fooplugins.com/plugins/cube-gallery-template/?utm_source=foogalleryplugin&utm_medium=foogallerylink&utm_campaign=foogallery_wprepo)
|
107 |
+
* [Custom Branding](http://fooplugins.com/plugins/foogallery-branding/?utm_source=foogalleryplugin&utm_medium=foogallerylink&utm_campaign=foogallery_wprepo)
|
108 |
+
* [FooBox PRO Lightbox](http://fooplugins.com/plugins/foobox/?utm_source=foogalleryplugin&utm_medium=foogallerylink&utm_campaign=foogallery_wprepo)
|
109 |
+
* [FooBox FREE Lightbox](http://wordpress.org/plugins/foobox-image-lightbox)
|
110 |
+
* [Owl Carousel Template](http://wordpress.org/plugins/foogallery-owl-carousel-template/)
|
111 |
+
* [ZOOM Template](http://wordpress.org/plugins/foogallery-zoom-template/)
|
112 |
+
* [Thirsty Affiliates](http://wordpress.org/plugins/thirstyaffiliates-for-foogallery-extension/)
|
113 |
+
* [Polaroid Template](https://github.com/fooplugins/foogallery-polaroid-template)
|
114 |
+
* [Use Media Menu](https://github.com/fooplugins/foogallery-media-menu)
|
115 |
+
* Build your own!!!
|
116 |
+
|
117 |
+
**Documentation**
|
118 |
+
|
119 |
+
* [FooGallery 101](http://docs.fooplugins.com/foogallery/foogallery-101/)
|
120 |
+
* [Developer 101](http://docs.fooplugins.com/foogallery/foogallery-developers-101/)
|
121 |
+
* [Actions and Filters](http://docs.fooplugins.com/foogallery/actions-filters/)
|
122 |
+
|
123 |
+
**Contribute**
|
124 |
+
|
125 |
+
FooGallery is hosted on [GitHub](https://github.com/fooplugins/foogallery). If you find a bug, please [create an issue](https://github.com/fooplugins/foogallery/issues).
|
126 |
+
|
127 |
+
## Installation ##
|
128 |
+
|
129 |
+
1. Upload `foogallery` folder to the `/wp-content/plugins/` directory
|
130 |
+
2. Activate the plugin through the 'Plugins' menu in WordPress
|
131 |
+
3. You will be redirected to the FooGallery Help page to get your started
|
132 |
+
|
133 |
+
## Frequently Asked Questions ##
|
134 |
+
|
135 |
+
### Why are my thumbnails so blurry? ###
|
136 |
+
|
137 |
+
Have you enabled retina support for your galleries? Displays with retina support can show better quality thumbnails when retina support is enabled. To enable retina support, edit the gallery and locate the Retina Support metabox.
|
138 |
+
|
139 |
+
### Can I add videos to my galleries? ###
|
140 |
+
|
141 |
+
Yes, you need to use the [FooVideo premium extension](http://fooplugins.com/plugins/foovideo/?utm_source=foogalleryplugin&utm_medium=foogallerylink&utm_campaign=foogallery_wprepo)
|
142 |
+
|
143 |
+
### How do I get albums working? ###
|
144 |
+
|
145 |
+
Simply go to the FooGallery extensions page and activate the Albums extension. If you do not see a button to activate the albums extension, reload the extensions list by clicking the reload button.
|
146 |
+
|
147 |
+
### Can I build an extension? ###
|
148 |
+
|
149 |
+
Hell, yes! Check out our [developer page](http://foo.gallery/developers/)
|
150 |
+
|
151 |
+
## Screenshots ##
|
152 |
+
|
153 |
+
[View screenshots](https://wordpress.org/plugins/foogallery/screenshots/)
|
154 |
+
|
155 |
+
## Upgrade Notice ##
|
156 |
+
|
157 |
+
Update now to support FooVideo and many other improvements!
|
158 |
+
|
159 |
+
## Changelog ##
|
160 |
+
|
161 |
+
### 1.3.8 ###
|
162 |
+
|
163 |
+
* New : Built in support for FooBox, fixing a lot of issues where FooBox option is not available
|
164 |
+
* Fix : More reliable extension active status on extensions listing
|
165 |
+
* Fix : More obvious wording for 3rd party plugins when they are not installed
|
166 |
+
|
167 |
+
### 1.3.7 ###
|
168 |
+
|
169 |
+
* Fix : Activation redirect bug showing "Sorry, you are not allowed to access this page."
|
170 |
+
|
171 |
+
### 1.3.6 ###
|
172 |
+
|
173 |
+
* New : Freemius integration!
|
174 |
+
* New : Added support for the Responsive Lightbox by dFactory
|
175 |
+
* New : New custom class field for an attachment
|
176 |
+
* New : Added more system info for better debugging when there are server issues
|
177 |
+
* Fix : Visual editor FooGallery edit button
|
178 |
+
* Fix : Image Viewer hover effect none now works as expected
|
179 |
+
* Fix : Disable HTML caching for randomly ordered galleries
|
180 |
+
|
181 |
+
### 1.2.20 ###
|
182 |
+
|
183 |
+
* New : Force Use Original thumb setting on gallery edit page
|
184 |
+
* Fix : PHP warning from thumbnail class since 1.2.19
|
185 |
+
|
186 |
+
### 1.2.19 ###
|
187 |
+
|
188 |
+
* New : Gallery output caching! Saves database requests improving load time
|
189 |
+
* New : Gallery usage column in admin gallery listing
|
190 |
+
* New : Better support for animated gifs
|
191 |
+
* New : Hover icons retina support
|
192 |
+
* New : Uninstall button on settings
|
193 |
+
* New : Save thumb dimensions per attachment. (needed in future versions)
|
194 |
+
* Fix : Extensions refactor and many issues resolved
|
195 |
+
* Fix : Better retina support for all templates
|
196 |
+
* Fix : Colorize / Greyscale CSS filters
|
197 |
+
* Fix : Even better wpthumb compatibility
|
198 |
+
|
199 |
+
### 1.2.18 ###
|
200 |
+
|
201 |
+
* Fix : Handle no settings in retina metabox
|
202 |
+
|
203 |
+
### 1.2.17 ###
|
204 |
+
|
205 |
+
* New : Retina support - metabox per gallery and default settings
|
206 |
+
* New : Attachment datasources - backend changes for how images are used in a gallery. (This will allow for new external sources in the future)
|
207 |
+
* New : Caption color settings in Simple portfolio gallery template
|
208 |
+
* New : Updated to latest Justified Gallery
|
209 |
+
* Fix : Better wpthumb compatibility
|
210 |
+
|
211 |
+
### 1.2.16 ###
|
212 |
+
|
213 |
+
* Fix : Yoast SEO Sitemaps fatal error with deleted galleries
|
214 |
+
* Fix : Updating pages with deleted galleries throws php warnings
|
215 |
+
|
216 |
+
### 1.2.15 ###
|
217 |
+
|
218 |
+
* Fix : Album admin CSS issues in WP 4.6
|
219 |
+
* Fix : Masonry layout issues in WP 4.6
|
220 |
+
* Fix : Media attachment fields not updating
|
221 |
+
* Fix : Better support for IE10
|
222 |
+
* New : Thumbnail generation test admin notice and settings
|
223 |
+
|
224 |
+
### 1.2.13 ###
|
225 |
+
|
226 |
+
* Fix : Shortcode replacing content in visual editor
|
227 |
+
* Fix : Gallery hover effect of None being ignored
|
228 |
+
* New : ImageViewer language settings for 'Prev', 'Next' & 'of'
|
229 |
+
* New : Setting to use original thumbnails if available
|
230 |
+
|
231 |
+
### 1.2.12 ###
|
232 |
+
|
233 |
+
* Fix : Simple Portfolio missing captions fix
|
234 |
+
|
235 |
+
### 1.2.11 ###
|
236 |
+
|
237 |
+
* Fix : Simple Portfolio undefined function fix
|
238 |
+
|
239 |
+
### 1.2.10 ###
|
240 |
+
|
241 |
+
* New : support for multiple admin JS and CSS assets for gallery templates
|
242 |
+
* New : Added setting to choose Caption Description source
|
243 |
+
* New : Crop position can be chosen for attachments
|
244 |
+
* New : Albums gallery details modal for setting a gallery URL
|
245 |
+
* New : Better shortcode preview in editor
|
246 |
+
* New : Editor button now supported if multiple editors exist
|
247 |
+
* Fix : Better No-Link support for gallery templates
|
248 |
+
* Fix : Compatible with Unyson plugin
|
249 |
+
* Fix : Compatible with Advanced Custom Fields
|
250 |
+
* Fix : Simple Portfolio fixes and tweaks
|
251 |
+
* Fix : ImageViewer fixes and better browser compatibility
|
252 |
+
* Fix : Changed assets enqueue version to rather use extension version
|
253 |
+
* Fix : Album URL fix for permalinks with no trailing slashes
|
254 |
+
|
255 |
+
### 1.2.9 ###
|
256 |
+
* New : Added Image Viewer gallery template
|
257 |
+
* New : Caption support for default template
|
258 |
+
* New : Yoast SEO gallery image support!
|
259 |
+
* New : Responsive options for Masonry gallery
|
260 |
+
* New : change gallery URL slug for albums
|
261 |
+
* New : setting to turn off loading animation in default gallery
|
262 |
+
* New : French translation
|
263 |
+
* Fix : Support for WP 4.4
|
264 |
+
* Fix : All templates - moved all jQuery ready events to vanilla JS
|
265 |
+
* Fix : Many gallery template tweaks
|
266 |
+
* Fix : allow no default to be chosen in settings
|
267 |
+
|
268 |
+
### 1.2.8 ###
|
269 |
+
* Works now with Polylang translation plugin
|
270 |
+
* CSS Updates & enhancements to all gallery templates
|
271 |
+
* Password protected galleries now work as expected
|
272 |
+
* Ability to hide WYSIWYG editor button
|
273 |
+
* Updated WPThumb
|
274 |
+
* Multiple bug fixes and improvements
|
275 |
+
|
276 |
+
### 1.2.7 ###
|
277 |
+
* Bug fixes for 1.2.6 release
|
278 |
+
* Added 2 new settings to Justified Gallery template (maxRowHeight + Caption Source)
|
279 |
+
|
280 |
+
### 1.2.6 ###
|
281 |
+
* CSS load optimizations
|
282 |
+
* Updates and tweaks on all built-in gallery templates
|
283 |
+
* More robust extension loading
|
284 |
+
* More robust upgrades to FooBox PRO
|
285 |
+
* Improved copy-to-clipboard
|
286 |
+
* Added more hover effects
|
287 |
+
* Support for FooVideo
|
288 |
+
|
289 |
+
### 1.2.5 ###
|
290 |
+
* Fix for extensions being empty
|
291 |
+
* Added support for Multi-site
|
292 |
+
* Added esc_url to all places where url is rendered
|
293 |
+
* Updated to latest Justified Gallery v3.5.4
|
294 |
+
|
295 |
+
### 1.2.4 ###
|
296 |
+
* Many album template updates, enhancements and fixes
|
297 |
+
* Many gallery template tweaks and fixes
|
298 |
+
* Sort order settings for galleries and albums
|
299 |
+
* Added new Single Thumbnail Gallery template
|
300 |
+
|
301 |
+
### 1.2.1 ###
|
302 |
+
* Added setting to choose default gallery to copy settings from
|
303 |
+
* Fixed bug #45 - gallery fields not showing onload
|
304 |
+
* replaced minicolors with spectrum colorpicker
|
305 |
+
* Allow gallery fields to have a suffix
|
306 |
+
* Added function to render galleries "foogallery_render_gallery( $gallery_id )"
|
307 |
+
|
308 |
+
### 1.2.0 ###
|
309 |
+
* Added albums extension
|
310 |
+
* Added custom CSS metaboxes
|
311 |
+
* Updated Nextgen importer
|
312 |
+
* Fixed many bugs
|
313 |
+
|
314 |
+
### 1.1.8.2 ###
|
315 |
+
* Fixed "edit gallery" CSS with WP 4.0
|
316 |
+
|
317 |
+
### 1.1.8.1 ###
|
318 |
+
* Fixed "insert gallery" CSS with WP 4.0
|
319 |
+
|
320 |
+
### 1.1.8 ###
|
321 |
+
* Added 2 new gallery templates
|
322 |
+
* Added 10+ actions and filters for more customization
|
323 |
+
* Countless bug fixes and enhancements
|
324 |
+
|
325 |
+
### 1.1.7 ###
|
326 |
+
* first version!
|
README.txt
ADDED
@@ -0,0 +1,323 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
=== FooGallery - Image Gallery WordPress Plugin ===
|
2 |
+
Contributors: bradvin, fooplugins, freemius
|
3 |
+
Donate link: http://fooplugins.com
|
4 |
+
Tags: gallery, image gallery, photo gallery, responsive, album, media gallery, masonry gallery, portfolio, justified image gallery, video gallery, photography, photographer, retina
|
5 |
+
Requires at least: 3.9
|
6 |
+
Tested up to: 4.8.3
|
7 |
+
Stable tag: trunk
|
8 |
+
License: GPLv2 or later
|
9 |
+
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
+
|
11 |
+
FooGallery is the best image gallery plugin for WordPress. Why? Stunning gallery layouts, responsive, retina-ready, lightning fast, easy to use.
|
12 |
+
|
13 |
+
== Description ==
|
14 |
+
|
15 |
+
FooGallery is the best image gallery plugin for WordPress. Why? Stunning gallery layouts, responsive, retina-ready, lightning fast, easy to use. Built to be highly configurable and extensible for developers or freelancers.
|
16 |
+
|
17 |
+
[View the Foo Gallery Homepage & DEMO](http://foo.gallery/)
|
18 |
+
|
19 |
+
**Major changes in 1.3.28!**
|
20 |
+
|
21 |
+
There have been major updates to the gallery templates in v1.3.28. If you have updated, please test your galleries.
|
22 |
+
|
23 |
+
**Retina Support**
|
24 |
+
|
25 |
+
Foo Gallery now comes with built-in support for higher quality thumbnails on retina-enabled displays. No more blurry thumbnails, just crisp thumbnails that look amazing on all devices.
|
26 |
+
|
27 |
+
**Video Support**
|
28 |
+
|
29 |
+
Foo Gallery now supports the creation of video galleries with the [FooVideo premium extension](http://fooplugins.com/plugins/foovideo/?utm_source=foogalleryplugin&utm_medium=foogallerylink&utm_campaign=foogallery_wprepo)! Create galleries with both images and videos mixed!
|
30 |
+
|
31 |
+
**Albums Built In**
|
32 |
+
|
33 |
+
Albums are now built in as an extension. Simply head over to the extensions page and activate the albums extension. A new menu item will appear that allows you to add albums just as easily as galleries.
|
34 |
+
|
35 |
+
**Built For Developers**
|
36 |
+
|
37 |
+
Foo Gallery was designed to be the most developer-friendly gallery plugin available for WordPress. It was also built on top of a solid extension framework, which means different functionality is separated out into different areas in the codebase. It also means the core plugin is lightweight, but still allowing for the most flexibility.
|
38 |
+
|
39 |
+
**Features**
|
40 |
+
|
41 |
+
* Lazy loading
|
42 |
+
* Simple Pagination (dots)
|
43 |
+
* Live previews in admin
|
44 |
+
* Retina thumbnail support
|
45 |
+
* Add videos to galleries (via the [FooVideo premium extension](http://fooplugins.com/plugins/foovideo/?utm_source=foogalleryplugin&utm_medium=foogallerylink&utm_campaign=foogallery_wprepo))
|
46 |
+
* Albums built-in! (Activate the albums extension)
|
47 |
+
* Use built-in media library to manage images
|
48 |
+
* Drag n Drop reordering of images and galleries
|
49 |
+
* Beautiful gallery templates
|
50 |
+
* Custom CSS for both galleries and albums
|
51 |
+
* Copy to clipboard shortcodes
|
52 |
+
* Visual shortcodes in rich text editor
|
53 |
+
* Gallery picker to insert shortcodes
|
54 |
+
* Page usage metabox with one-click gallery page creation
|
55 |
+
* NextGen importer tool (albums and galleries)
|
56 |
+
* Multisite Support
|
57 |
+
* plus many, many more
|
58 |
+
|
59 |
+
**PRO Features**
|
60 |
+
|
61 |
+
* Polaroid PRO Gallery Template
|
62 |
+
* Grid PRO Gallery Template
|
63 |
+
* Advanced Pagination
|
64 |
+
* Infinite Scroll
|
65 |
+
* Multiple Loaded Effects
|
66 |
+
* Multiple hover effects presets
|
67 |
+
* More on the way!
|
68 |
+
|
69 |
+
**Gallery Demos**
|
70 |
+
|
71 |
+
* Responsive Image Gallery - [demo](http://foo.gallery/demos/responsive-image-gallery/)
|
72 |
+
* Image Viewer Gallery - [light demo](http://foo.gallery/demos/image-viewer-gallery/) - [dark demo](http://foo.gallery/demos/image-viewer-gallery-dark/)
|
73 |
+
* Masonry Gallery - [demo](http://foo.gallery/demos/masonry-image-gallery/)
|
74 |
+
* Simple Portfolio - [demo](http://foo.gallery/demos/simple-portfolio/)
|
75 |
+
* Justified Gallery - [demo](http://foo.gallery/demos/justified-gallery/)
|
76 |
+
* Single Thumbnail Gallery - [demo](http://foo.gallery/demos/single-thumbnail-gallery/)
|
77 |
+
* Mixed (Images + Videos) - [demo](http://foo.gallery/demos/mixed/)
|
78 |
+
|
79 |
+
**Album Demos**
|
80 |
+
|
81 |
+
* Responsive Album Layout - [demo](http://foo.gallery/demos/responsive-album-layout/)
|
82 |
+
* All-in-one Stack Album - [demo](http://foo.gallery/demos/all-in-one-stack-album/)
|
83 |
+
|
84 |
+
**Videos Demos**
|
85 |
+
|
86 |
+
* Vertical Video Slider - [demo](http://foo.gallery/demos/video-slider-vertical/) - [full-width demo](http://foo.gallery/demos/video-slider-vertical-full-width/)
|
87 |
+
* Horizontal Video Slider - [demo](http://foo.gallery/demos/video-slider-horizontal/) - [custom colors](http://foo.gallery/demos/video-slider-custom-theme/)
|
88 |
+
|
89 |
+
**Extensions**
|
90 |
+
|
91 |
+
* [FooVideo](http://fooplugins.com/plugins/foovideo/?utm_source=foogalleryplugin&utm_medium=foogallerylink&utm_campaign=foogallery_wprepo)
|
92 |
+
* Albums (bundled)
|
93 |
+
* Default Gallery Templates (bundled)
|
94 |
+
* NextGen Gallery and Album Importer (bundled)
|
95 |
+
* [Custom Branding](http://fooplugins.com/plugins/foogallery-branding/?utm_source=foogalleryplugin&utm_medium=foogallerylink&utm_campaign=foogallery_wprepo)
|
96 |
+
* [FooBox PRO Lightbox](http://fooplugins.com/plugins/foobox/?utm_source=foogalleryplugin&utm_medium=foogallerylink&utm_campaign=foogallery_wprepo)
|
97 |
+
* [FooBox FREE Lightbox](http://wordpress.org/plugins/foobox-image-lightbox)
|
98 |
+
* [ZOOM Template](http://wordpress.org/plugins/foogallery-zoom-template/)
|
99 |
+
* [Use Media Menu](https://github.com/fooplugins/foogallery-media-menu)
|
100 |
+
* Build your own!!!
|
101 |
+
|
102 |
+
**Documentation**
|
103 |
+
|
104 |
+
* [FooGallery 101](http://docs.fooplugins.com/foogallery/foogallery-101/)
|
105 |
+
* [Developer 101](http://docs.fooplugins.com/foogallery/foogallery-developers-101/)
|
106 |
+
* [Actions and Filters](http://docs.fooplugins.com/foogallery/actions-filters/)
|
107 |
+
|
108 |
+
**Contribute**
|
109 |
+
|
110 |
+
FooGallery is hosted on [GitHub](https://github.com/fooplugins/foogallery). If you find a bug, please [create an issue](https://github.com/fooplugins/foogallery/issues).
|
111 |
+
|
112 |
+
== Installation ==
|
113 |
+
|
114 |
+
1. Upload `foogallery` folder to the `/wp-content/plugins/` directory
|
115 |
+
2. Activate the plugin through the 'Plugins' menu in WordPress
|
116 |
+
3. You will be redirected to the FooGallery Help page to get your started
|
117 |
+
|
118 |
+
== Frequently Asked Questions ==
|
119 |
+
|
120 |
+
= Why are my thumbnails so blurry? =
|
121 |
+
|
122 |
+
Have you enabled retina support for your galleries? Displays with retina support can show better quality thumbnails when retina support is enabled. To enable retina support, edit the gallery and locate the Retina Support metabox.
|
123 |
+
|
124 |
+
= Can I add videos to my galleries? =
|
125 |
+
|
126 |
+
Yes, you need to use the [FooVideo premium extension](http://fooplugins.com/plugins/foovideo/?utm_source=foogalleryplugin&utm_medium=foogallerylink&utm_campaign=foogallery_wprepo)
|
127 |
+
|
128 |
+
= How do I get albums working? =
|
129 |
+
|
130 |
+
Simply go to the FooGallery extensions page and activate the Albums extension. If you do not see a button to activate the albums extension, reload the extensions list by clicking the reload button.
|
131 |
+
|
132 |
+
= Can I build an extension? =
|
133 |
+
|
134 |
+
Hell, yes! Check out our [developer page](http://foo.gallery/developers/)
|
135 |
+
|
136 |
+
== Screenshots ==
|
137 |
+
|
138 |
+
1. Gallery Edit Page
|
139 |
+
2. Visual Shortcodes
|
140 |
+
3. Gallery Picker
|
141 |
+
4. Frontend example with default template
|
142 |
+
5. Album Edit Page
|
143 |
+
|
144 |
+
== Upgrade Notice ==
|
145 |
+
|
146 |
+
Update now to support FooVideo and many other improvements!
|
147 |
+
|
148 |
+
== Changelog ==
|
149 |
+
|
150 |
+
= 1.3.28 =
|
151 |
+
|
152 |
+
* Complete rewrite of the built-in gallery templates
|
153 |
+
* New : lazy loading
|
154 |
+
* New : simple pagination
|
155 |
+
* New : Live Previews when editing a gallery
|
156 |
+
* 260+ updates, changes and bug fixes
|
157 |
+
|
158 |
+
= 1.3.8 =
|
159 |
+
|
160 |
+
* New : Built in support for FooBox, fixing a lot of issues where FooBox option is not available
|
161 |
+
* Fix : More reliable extension active status on extensions listing
|
162 |
+
* Fix : More obvious wording for 3rd party plugins when they are not installed
|
163 |
+
|
164 |
+
= 1.3.7 =
|
165 |
+
|
166 |
+
* Fix : Activation redirect bug showing "Sorry, you are not allowed to access this page."
|
167 |
+
|
168 |
+
= 1.3.6 =
|
169 |
+
|
170 |
+
* New : Freemius integration!
|
171 |
+
* New : Added support for the Responsive Lightbox by dFactory
|
172 |
+
* New : New custom class field for an attachment
|
173 |
+
* New : Added more system info for better debugging when there are server issues
|
174 |
+
* Fix : Visual editor FooGallery edit button
|
175 |
+
* Fix : Image Viewer hover effect none now works as expected
|
176 |
+
* Fix : Disable HTML caching for randomly ordered galleries
|
177 |
+
|
178 |
+
= 1.2.20 =
|
179 |
+
|
180 |
+
* New : Force Use Original thumb setting on gallery edit page
|
181 |
+
* Fix : PHP warning from thumbnail class since 1.2.19
|
182 |
+
|
183 |
+
= 1.2.19 =
|
184 |
+
|
185 |
+
* New : Gallery output caching! Saves database requests improving load time
|
186 |
+
* New : Gallery usage column in admin gallery listing
|
187 |
+
* New : Better support for animated gifs
|
188 |
+
* New : Hover icons retina support
|
189 |
+
* New : Uninstall button on settings
|
190 |
+
* New : Save thumb dimensions per attachment. (needed in future versions)
|
191 |
+
* Fix : Extensions refactor and many issues resolved
|
192 |
+
* Fix : Better retina support for all templates
|
193 |
+
* Fix : Colorize / Greyscale CSS filters
|
194 |
+
* Fix : Even better wpthumb compatibility
|
195 |
+
|
196 |
+
= 1.2.18 =
|
197 |
+
|
198 |
+
* Fix : Handle no settings in retina metabox
|
199 |
+
|
200 |
+
= 1.2.17 =
|
201 |
+
|
202 |
+
* New : Retina support - metabox per gallery and default settings
|
203 |
+
* New : Attachment datasources - backend changes for how images are used in a gallery. (This will allow for new external sources in the future)
|
204 |
+
* New : Caption color settings in Simple portfolio gallery template
|
205 |
+
* New : Updated to latest Justified Gallery
|
206 |
+
* Fix : Better wpthumb compatibility
|
207 |
+
|
208 |
+
= 1.2.16 =
|
209 |
+
|
210 |
+
* Fix : Yoast SEO Sitemaps fatal error with deleted galleries
|
211 |
+
* Fix : Updating pages with deleted galleries throws php warnings
|
212 |
+
|
213 |
+
= 1.2.15 =
|
214 |
+
|
215 |
+
* Fix : Album admin CSS issues in WP 4.6
|
216 |
+
* Fix : Masonry layout issues in WP 4.6
|
217 |
+
* Fix : Media attachment fields not updating
|
218 |
+
* Fix : Better support for IE10
|
219 |
+
* New : Thumbnail generation test admin notice and settings
|
220 |
+
|
221 |
+
= 1.2.13 =
|
222 |
+
|
223 |
+
* Fix : Shortcode replacing content in visual editor
|
224 |
+
* Fix : Gallery hover effect of None being ignored
|
225 |
+
* New : ImageViewer language settings for 'Prev', 'Next' & 'of'
|
226 |
+
* New : Setting to use original thumbnails if available
|
227 |
+
|
228 |
+
= 1.2.12 =
|
229 |
+
|
230 |
+
* Fix : Simple Portfolio missing captions fix
|
231 |
+
|
232 |
+
= 1.2.11 =
|
233 |
+
|
234 |
+
* Fix : Simple Portfolio undefined function fix
|
235 |
+
|
236 |
+
= 1.2.10 =
|
237 |
+
|
238 |
+
* New : support for multiple admin JS and CSS assets for gallery templates
|
239 |
+
* New : Added setting to choose Caption Description source
|
240 |
+
* New : Crop position can be chosen for attachments
|
241 |
+
* New : Albums gallery details modal for setting a gallery URL
|
242 |
+
* New : Better shortcode preview in editor
|
243 |
+
* New : Editor button now supported if multiple editors exist
|
244 |
+
* Fix : Better No-Link support for gallery templates
|
245 |
+
* Fix : Compatible with Unyson plugin
|
246 |
+
* Fix : Compatible with Advanced Custom Fields
|
247 |
+
* Fix : Simple Portfolio fixes and tweaks
|
248 |
+
* Fix : ImageViewer fixes and better browser compatibility
|
249 |
+
* Fix : Changed assets enqueue version to rather use extension version
|
250 |
+
* Fix : Album URL fix for permalinks with no trailing slashes
|
251 |
+
|
252 |
+
= 1.2.9 =
|
253 |
+
* New : Added Image Viewer gallery template
|
254 |
+
* New : Caption support for default template
|
255 |
+
* New : Yoast SEO gallery image support!
|
256 |
+
* New : Responsive options for Masonry gallery
|
257 |
+
* New : change gallery URL slug for albums
|
258 |
+
* New : setting to turn off loading animation in default gallery
|
259 |
+
* New : French translation
|
260 |
+
* Fix : Support for WP 4.4
|
261 |
+
* Fix : All templates - moved all jQuery ready events to vanilla JS
|
262 |
+
* Fix : Many gallery template tweaks
|
263 |
+
* Fix : allow no default to be chosen in settings
|
264 |
+
|
265 |
+
= 1.2.8 =
|
266 |
+
* Works now with Polylang translation plugin
|
267 |
+
* CSS Updates & enhancements to all gallery templates
|
268 |
+
* Password protected galleries now work as expected
|
269 |
+
* Ability to hide WYSIWYG editor button
|
270 |
+
* Updated WPThumb
|
271 |
+
* Multiple bug fixes and improvements
|
272 |
+
|
273 |
+
= 1.2.7 =
|
274 |
+
* Bug fixes for 1.2.6 release
|
275 |
+
* Added 2 new settings to Justified Gallery template (maxRowHeight + Caption Source)
|
276 |
+
|
277 |
+
= 1.2.6 =
|
278 |
+
* CSS load optimizations
|
279 |
+
* Updates and tweaks on all built-in gallery templates
|
280 |
+
* More robust extension loading
|
281 |
+
* More robust upgrades to FooBox PRO
|
282 |
+
* Improved copy-to-clipboard
|
283 |
+
* Added more hover effects
|
284 |
+
* Support for FooVideo
|
285 |
+
|
286 |
+
= 1.2.5 =
|
287 |
+
* Fix for extensions being empty
|
288 |
+
* Added support for Multi-site
|
289 |
+
* Added esc_url to all places where url is rendered
|
290 |
+
* Updated to latest Justified Gallery v3.5.4
|
291 |
+
|
292 |
+
= 1.2.4 =
|
293 |
+
* Many album template updates, enhancements and fixes
|
294 |
+
* Many gallery template tweaks and fixes
|
295 |
+
* Sort order settings for galleries and albums
|
296 |
+
* Added new Single Thumbnail Gallery template
|
297 |
+
|
298 |
+
= 1.2.1 =
|
299 |
+
* Added setting to choose default gallery to copy settings from
|
300 |
+
* Fixed bug #45 - gallery fields not showing onload
|
301 |
+
* replaced minicolors with spectrum colorpicker
|
302 |
+
* Allow gallery fields to have a suffix
|
303 |
+
* Added function to render galleries "foogallery_render_gallery( $gallery_id )"
|
304 |
+
|
305 |
+
= 1.2.0 =
|
306 |
+
* Added albums extension
|
307 |
+
* Added custom CSS metaboxes
|
308 |
+
* Updated Nextgen importer
|
309 |
+
* Fixed many bugs
|
310 |
+
|
311 |
+
= 1.1.8.2 =
|
312 |
+
* Fixed "edit gallery" CSS with WP 4.0
|
313 |
+
|
314 |
+
= 1.1.8.1 =
|
315 |
+
* Fixed "insert gallery" CSS with WP 4.0
|
316 |
+
|
317 |
+
= 1.1.8 =
|
318 |
+
* Added 2 new gallery templates
|
319 |
+
* Added 10+ actions and filters for more customization
|
320 |
+
* Countless bug fixes and enhancements
|
321 |
+
|
322 |
+
= 1.1.7 =
|
323 |
+
* first version!
|
assets/extension_bg.png
ADDED
Binary file
|
assets/foobot_small.png
ADDED
Binary file
|
assets/image-placeholder.png
ADDED
Binary file
|
assets/logo.png
ADDED
Binary file
|
assets/screenshots/admin-edit-gallery.jpg
ADDED
Binary file
|
assets/screenshots/admin-insert-shortcode.jpg
ADDED
Binary file
|
assets/screenshots/admin-nextgen-import.jpg
ADDED
Binary file
|
changelog.txt
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
FooGallery Changelog
|
2 |
+
====================
|
3 |
+
|
4 |
+
See changelog in readme.txt
|
css/admin-foogallery.css
ADDED
@@ -0,0 +1,462 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.foogallery-attachments-list .add-attachment {
|
2 |
+
background: #ddd;
|
3 |
+
box-shadow: 0 0 0 1px #ccc;
|
4 |
+
width: 150px;
|
5 |
+
position: relative;
|
6 |
+
float: left;
|
7 |
+
padding: 0;
|
8 |
+
color: #464646;
|
9 |
+
list-style: none;
|
10 |
+
text-align: center;
|
11 |
+
-webkit-user-select: none;
|
12 |
+
-moz-user-select: none;
|
13 |
+
-ms-user-select: none;
|
14 |
+
-o-user-select: none;
|
15 |
+
user-select: none;
|
16 |
+
}
|
17 |
+
|
18 |
+
.foogallery-attachments-list .add-attachment a {
|
19 |
+
display: table-cell;
|
20 |
+
vertical-align: middle;
|
21 |
+
height: 150px;
|
22 |
+
text-align: center;
|
23 |
+
width: 150px;
|
24 |
+
height: 150px;
|
25 |
+
color:#666;
|
26 |
+
font-weight: bold;
|
27 |
+
text-decoration: none;
|
28 |
+
}
|
29 |
+
|
30 |
+
.foogallery-attachments-list .add-attachment a:hover {
|
31 |
+
color:#444;
|
32 |
+
}
|
33 |
+
|
34 |
+
.foogallery-attachments-list .add-attachment a div.dashicons {
|
35 |
+
font-size:50px;
|
36 |
+
width: 50px;
|
37 |
+
height: 50px;
|
38 |
+
}
|
39 |
+
|
40 |
+
.foogallery-attachments-list .add-attachment a span {
|
41 |
+
display: block;
|
42 |
+
}
|
43 |
+
|
44 |
+
|
45 |
+
.foogallery-attachments-list .attachment-preview,
|
46 |
+
.foogallery-attachments-list .attachment-preview .thumbnail {
|
47 |
+
width: 150px;
|
48 |
+
height: 150px;
|
49 |
+
cursor:move;
|
50 |
+
}
|
51 |
+
|
52 |
+
.foogallery-attachments-list .attachment {
|
53 |
+
border: transparent 1px solid;
|
54 |
+
box-shadow: none !important;
|
55 |
+
width: auto !important;
|
56 |
+
padding: 0 !important;
|
57 |
+
}
|
58 |
+
|
59 |
+
.foogallery-attachments-list .attachment.placeholder {
|
60 |
+
width: 150px !important;
|
61 |
+
height: 150px;
|
62 |
+
border: #1e8cbe 1px dashed;
|
63 |
+
background: #eee;
|
64 |
+
}
|
65 |
+
|
66 |
+
.foogallery-attachments-list li {
|
67 |
+
margin: 0px 10px 10px 0px !important;
|
68 |
+
}
|
69 |
+
|
70 |
+
.foogallery-attachments-list .attachment.ui-sortable-helper {
|
71 |
+
opacity: 0.5;
|
72 |
+
}
|
73 |
+
|
74 |
+
.foogallery-attachments-list .attachment.ui-sortable-helper:hover .close {
|
75 |
+
display: none;
|
76 |
+
}
|
77 |
+
|
78 |
+
.foogallery-attachments-list input.describe {
|
79 |
+
margin:0;
|
80 |
+
width: 150px;
|
81 |
+
font-size: 12px;
|
82 |
+
}
|
83 |
+
|
84 |
+
.foogallery-attachments-list .attachment .attachment-preview a {
|
85 |
+
display: none;
|
86 |
+
position: absolute;
|
87 |
+
padding: 0;
|
88 |
+
font-size: 20px;
|
89 |
+
line-height: 20px;
|
90 |
+
text-align: center;
|
91 |
+
text-decoration: none;
|
92 |
+
background-color: #444;
|
93 |
+
border-top-right-radius: 50%;
|
94 |
+
border-top-left-radius: 50%;
|
95 |
+
border-bottom-right-radius: 50%;
|
96 |
+
border-bottom-left-radius: 50%;
|
97 |
+
}
|
98 |
+
|
99 |
+
.foogallery-attachments-list .attachment .attachment-preview:hover a {
|
100 |
+
display: block;
|
101 |
+
}
|
102 |
+
|
103 |
+
.foogallery-attachments-list .attachment .attachment-preview a span {
|
104 |
+
color:#fff;
|
105 |
+
}
|
106 |
+
|
107 |
+
.foogallery-attachments-list .attachment .attachment-preview a:hover span {
|
108 |
+
color:#ddd;
|
109 |
+
}
|
110 |
+
|
111 |
+
.foogallery-attachments-list .attachment .attachment-preview a.remove {
|
112 |
+
top: 5px;
|
113 |
+
right: 5px;
|
114 |
+
}
|
115 |
+
|
116 |
+
.foogallery-attachments-list .attachment .attachment-preview a.info {
|
117 |
+
top: 5px;
|
118 |
+
left: 5px;
|
119 |
+
}
|
120 |
+
|
121 |
+
.spacer {
|
122 |
+
display: inline-block;
|
123 |
+
width:30px;
|
124 |
+
}
|
125 |
+
|
126 |
+
.foogallery_template_field td {
|
127 |
+
padding-bottom: 20px;
|
128 |
+
}
|
129 |
+
|
130 |
+
.foogallery_template_field th {
|
131 |
+
vertical-align: top;
|
132 |
+
text-align: left;
|
133 |
+
padding-top: 0.3em;
|
134 |
+
padding-right: 10px;
|
135 |
+
}
|
136 |
+
|
137 |
+
.foogallery_template_field textarea {
|
138 |
+
min-width: 500px;
|
139 |
+
min-height: 100px;
|
140 |
+
}
|
141 |
+
|
142 |
+
.foogallery_template_field.foogallery_template_field_type-help {
|
143 |
+
border-bottom: none;
|
144 |
+
}
|
145 |
+
|
146 |
+
.foogallery_template_field.foogallery_template_field_type-help td {
|
147 |
+
padding-bottom: 0;
|
148 |
+
}
|
149 |
+
|
150 |
+
.foogallery_template_field.foogallery_template_field_type-icon td {
|
151 |
+
padding-bottom: 0;
|
152 |
+
}
|
153 |
+
|
154 |
+
.foogallery_metabox_field-icon label {
|
155 |
+
display:inline-block;
|
156 |
+
margin-right:10px;
|
157 |
+
border:solid 3px transparent;
|
158 |
+
background:#aaa;
|
159 |
+
border-radius: 3px;
|
160 |
+
-moz-border-radius: 3px;
|
161 |
+
-webkit-border-radius: 3px;
|
162 |
+
padding:5px;
|
163 |
+
line-height: 0;
|
164 |
+
margin-bottom: 10px;
|
165 |
+
}
|
166 |
+
|
167 |
+
.foogallery_metabox_field-icon input:checked + label {
|
168 |
+
border:solid 3px #444;
|
169 |
+
background: #888;
|
170 |
+
}
|
171 |
+
|
172 |
+
.foogallery_metabox_field-icon label:hover {
|
173 |
+
border:solid 3px #444;
|
174 |
+
}
|
175 |
+
|
176 |
+
.foogallery_template_field.foogallery_template_field_type-htmlicon td {
|
177 |
+
padding-bottom: 0;
|
178 |
+
}
|
179 |
+
|
180 |
+
.foogallery_metabox_field-htmlicon label {
|
181 |
+
display:inline-block;
|
182 |
+
margin-right:10px;
|
183 |
+
border:solid 3px transparent;
|
184 |
+
background:#aaa;
|
185 |
+
border-radius: 3px;
|
186 |
+
-moz-border-radius: 3px;
|
187 |
+
-webkit-border-radius: 3px;
|
188 |
+
padding:5px;
|
189 |
+
line-height: 0;
|
190 |
+
margin-bottom: 10px;
|
191 |
+
}
|
192 |
+
|
193 |
+
.foogallery_metabox_field-htmlicon input:checked + label {
|
194 |
+
border:solid 3px #444;
|
195 |
+
background: #888;
|
196 |
+
}
|
197 |
+
|
198 |
+
.foogallery_metabox_field-htmlicon label:hover {
|
199 |
+
border:solid 3px #444;
|
200 |
+
}
|
201 |
+
|
202 |
+
.foogallery_metabox_field-thumb_size label {
|
203 |
+
vertical-align: baseline;
|
204 |
+
}
|
205 |
+
|
206 |
+
.foogallery_metabox_field-thumb_size input[type="number"] {
|
207 |
+
margin-right: 10px;
|
208 |
+
margin-left: 10px;
|
209 |
+
}
|
210 |
+
|
211 |
+
.foogallery_template_field_type-text input.small-text {
|
212 |
+
width: 65px;
|
213 |
+
height: 28px;
|
214 |
+
line-height: 1;
|
215 |
+
}
|
216 |
+
|
217 |
+
#foogallery_pages ul li:hover .row-actions { visibility: visible; }
|
218 |
+
|
219 |
+
.foogallery-shortcode {
|
220 |
+
text-align: center;
|
221 |
+
}
|
222 |
+
|
223 |
+
.foogallery-shortcode input {
|
224 |
+
cursor: pointer;
|
225 |
+
text-align: center;
|
226 |
+
padding: 10px;
|
227 |
+
font-family: "courier new", courier;
|
228 |
+
border: none;
|
229 |
+
box-shadow: none;
|
230 |
+
background: #efefef;
|
231 |
+
}
|
232 |
+
|
233 |
+
.wp-list-table .foogallery-shortcode {
|
234 |
+
cursor: pointer;
|
235 |
+
font-size: 1em;
|
236 |
+
border: none;
|
237 |
+
box-shadow: none;
|
238 |
+
background: #efefef;
|
239 |
+
font-family: "courier new", courier;
|
240 |
+
}
|
241 |
+
|
242 |
+
.foogallery-shortcode-message {
|
243 |
+
font-style: italic;
|
244 |
+
color: #2EA2CC !important;
|
245 |
+
}
|
246 |
+
|
247 |
+
.foogallery-help {
|
248 |
+
position: relative;
|
249 |
+
display: block;
|
250 |
+
line-height: 19px;
|
251 |
+
padding: 11px 10px 11px 40px;
|
252 |
+
font-size: 14px;
|
253 |
+
text-align: left;
|
254 |
+
margin: 5px 0 0 2px;
|
255 |
+
background-color: #F4F4FF;
|
256 |
+
border-left: 4px solid #1e8cbe;
|
257 |
+
-webkit-box-shadow: 0 1px 1px 0 rgba(0, 0, 0, .1);
|
258 |
+
box-shadow: 0 1px 1px 0 rgba(0, 0, 0, .1);
|
259 |
+
}
|
260 |
+
|
261 |
+
.foogallery-help:before {
|
262 |
+
content: "\f223";
|
263 |
+
font: 400 30px/1 dashicons !important;
|
264 |
+
speak: none;
|
265 |
+
color: #1e8cbe;
|
266 |
+
display: inline-block;
|
267 |
+
-webkit-font-smoothing: antialiased;
|
268 |
+
-moz-osx-font-smoothing: grayscale;
|
269 |
+
vertical-align: bottom;
|
270 |
+
position: absolute;
|
271 |
+
left: 5px;
|
272 |
+
margin-top: -15px;
|
273 |
+
top: 50%;
|
274 |
+
height: 1em;
|
275 |
+
}
|
276 |
+
|
277 |
+
#post-body.columns-2 #postbox-container-1 .foogallery-help {
|
278 |
+
padding-left: 11px;
|
279 |
+
margin-left: 5px;
|
280 |
+
}
|
281 |
+
|
282 |
+
#post-body.columns-2 #postbox-container-1 .foogallery-help:before {
|
283 |
+
content: '';
|
284 |
+
}
|
285 |
+
|
286 |
+
/** <gallery settings styling overrides> **/
|
287 |
+
|
288 |
+
.foogallery-metabox-settings {
|
289 |
+
width: 100%;
|
290 |
+
border-collapse: collapse;
|
291 |
+
}
|
292 |
+
|
293 |
+
.foogallery-metabox-settings th {
|
294 |
+
font-weight: normal;
|
295 |
+
padding: 10px;
|
296 |
+
width: 180px;
|
297 |
+
}
|
298 |
+
|
299 |
+
.foogallery-metabox-settings tr {
|
300 |
+
border-bottom: solid 1px #EEE;
|
301 |
+
}
|
302 |
+
|
303 |
+
.foogallery-metabox-settings td {
|
304 |
+
padding: 10px;
|
305 |
+
}
|
306 |
+
|
307 |
+
.foogallery_metabox_field-radio > input,
|
308 |
+
.foogallery_metabox_field-radio > label {
|
309 |
+
margin-bottom: 10px;
|
310 |
+
display: inline-block;
|
311 |
+
}
|
312 |
+
|
313 |
+
.foogallery_metabox_field-radio input[type="checkbox"],
|
314 |
+
.foogallery_metabox_field-radio input[type="radio"] {
|
315 |
+
margin: 0 0 10px 0;
|
316 |
+
}
|
317 |
+
|
318 |
+
.foogallery_metabox_field-select select {
|
319 |
+
min-width: 250px;
|
320 |
+
}
|
321 |
+
|
322 |
+
.foogallery-thumbsize-crop {
|
323 |
+
margin-top: 10px;
|
324 |
+
}
|
325 |
+
|
326 |
+
.foogallery_metabox_field-checkboxlist > input,
|
327 |
+
.foogallery_metabox_field-checkboxlist > label {
|
328 |
+
margin-bottom: 10px;
|
329 |
+
display: inline-block;
|
330 |
+
}
|
331 |
+
|
332 |
+
.foogallery_metabox_field-checkboxlist input[type="checkbox"] {
|
333 |
+
margin: 0 0 10px 0;
|
334 |
+
}
|
335 |
+
|
336 |
+
/** </gallery settings styling overrides> **/
|
337 |
+
|
338 |
+
.foogallery_metabox_custom_css {
|
339 |
+
width: 100%;
|
340 |
+
height: 10em;
|
341 |
+
}
|
342 |
+
|
343 |
+
.foo-nav-tabs a:focus {
|
344 |
+
box-shadow: none;
|
345 |
+
outline: 0;
|
346 |
+
}
|
347 |
+
|
348 |
+
.foogallery-thumbnail-preview {
|
349 |
+
display: inline-block;
|
350 |
+
}
|
351 |
+
|
352 |
+
#foogallery_apply_retina_support_container {
|
353 |
+
margin-top: 5px;
|
354 |
+
}
|
355 |
+
|
356 |
+
.widefat th.column-icon {
|
357 |
+
width: 60px;
|
358 |
+
}
|
359 |
+
|
360 |
+
#foogallery_settings .inside {
|
361 |
+
margin: 0;
|
362 |
+
padding: 0;
|
363 |
+
}
|
364 |
+
/** Balloon.css **/
|
365 |
+
button[data-balloon]{overflow:visible}[data-balloon]{position:relative}[data-balloon]:after,[data-balloon]:before{-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";filter:alpha(opacity=0);-khtml-opacity:0;-moz-opacity:0;opacity:0;pointer-events:none;-webkit-transition:all .18s ease-out .18s;transition:all .18s ease-out .18s;bottom:100%;left:50%;position:absolute;z-index:10;-webkit-transform:translate(-50%,10px);-ms-transform:translate(-50%,10px);transform:translate(-50%,10px);-webkit-transform-origin:top;-ms-transform-origin:top;transform-origin:top}[data-balloon]:after{background:rgba(17,17,17,.9);border-radius:4px;color:#fff;content:attr(data-balloon);font-size:12px;padding:.5em 1em;white-space:nowrap;margin-bottom:11px}[data-balloon]:before{background:url('data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2236px%22%20height%3D%2212px%22%3E%3Cpath%20fill%3D%22rgba%2817,%2017,%2017,%200.9%29%22%20transform%3D%22rotate%280%29%22%20d%3D%22M2.658,0.000%20C-13.615,0.000%2050.938,0.000%2034.662,0.000%20C28.662,0.000%2023.035,12.002%2018.660,12.002%20C14.285,12.002%208.594,0.000%202.658,0.000%20Z%22/%3E%3C/svg%3E') no-repeat;background-size:100% auto;height:6px;width:18px;content:"";margin-bottom:5px}[data-balloon]:hover:after,[data-balloon]:hover:before,[data-balloon][data-balloon-visible]:after,[data-balloon][data-balloon-visible]:before{-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";filter:alpha(opacity=100);-khtml-opacity:1;-moz-opacity:1;opacity:1;pointer-events:auto;-webkit-transform:translate(-50%,0);-ms-transform:translate(-50%,0);transform:translate(-50%,0)}[data-balloon].font-awesome:after{font-family:FontAwesome}[data-balloon][data-balloon-break]:after{white-space:pre}[data-balloon-pos=down]:after,[data-balloon-pos=down]:before{bottom:auto;left:50%;top:100%;-webkit-transform:translate(-50%,-10px);-ms-transform:translate(-50%,-10px);transform:translate(-50%,-10px)}[data-balloon-pos=down]:after{margin-top:11px}[data-balloon-pos=down]:before{background:url('data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2236px%22%20height%3D%2212px%22%3E%3Cpath%20fill%3D%22rgba%2817,%2017,%2017,%200.9%29%22%20transform%3D%22rotate%28180%2018%206%29%22%20d%3D%22M2.658,0.000%20C-13.615,0.000%2050.938,0.000%2034.662,0.000%20C28.662,0.000%2023.035,12.002%2018.660,12.002%20C14.285,12.002%208.594,0.000%202.658,0.000%20Z%22/%3E%3C/svg%3E') no-repeat;background-size:100% auto;height:6px;width:18px;margin-top:5px;margin-bottom:0}[data-balloon-pos=down]:hover:after,[data-balloon-pos=down]:hover:before,[data-balloon-pos=down][data-balloon-visible]:after,[data-balloon-pos=down][data-balloon-visible]:before{-webkit-transform:translate(-50%,0);-ms-transform:translate(-50%,0);transform:translate(-50%,0)}[data-balloon-pos=left]:after,[data-balloon-pos=left]:before{bottom:auto;left:auto;right:100%;top:50%;-webkit-transform:translate(10px,-50%);-ms-transform:translate(10px,-50%);transform:translate(10px,-50%)}[data-balloon-pos=left]:after{margin-right:11px}[data-balloon-pos=left]:before{background:url('data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2212px%22%20height%3D%2236px%22%3E%3Cpath%20fill%3D%22rgba%2817,%2017,%2017,%200.9%29%22%20transform%3D%22rotate%28-90%2018%2018%29%22%20d%3D%22M2.658,0.000%20C-13.615,0.000%2050.938,0.000%2034.662,0.000%20C28.662,0.000%2023.035,12.002%2018.660,12.002%20C14.285,12.002%208.594,0.000%202.658,0.000%20Z%22/%3E%3C/svg%3E') no-repeat;background-size:100% auto;height:18px;width:6px;margin-right:5px;margin-bottom:0}[data-balloon-pos=left]:hover:after,[data-balloon-pos=left]:hover:before,[data-balloon-pos=left][data-balloon-visible]:after,[data-balloon-pos=left][data-balloon-visible]:before{-webkit-transform:translate(0,-50%);-ms-transform:translate(0,-50%);transform:translate(0,-50%)}[data-balloon-pos=right]:after,[data-balloon-pos=right]:before{bottom:auto;left:100%;top:50%;-webkit-transform:translate(-10px,-50%);-ms-transform:translate(-10px,-50%);transform:translate(-10px,-50%)}[data-balloon-pos=right]:after{margin-left:11px}[data-balloon-pos=right]:before{background:url('data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2212px%22%20height%3D%2236px%22%3E%3Cpath%20fill%3D%22rgba%2817,%2017,%2017,%200.9%29%22%20transform%3D%22rotate%2890%206%206%29%22%20d%3D%22M2.658,0.000%20C-13.615,0.000%2050.938,0.000%2034.662,0.000%20C28.662,0.000%2023.035,12.002%2018.660,12.002%20C14.285,12.002%208.594,0.000%202.658,0.000%20Z%22/%3E%3C/svg%3E') no-repeat;background-size:100% auto;height:18px;width:6px;margin-bottom:0;margin-left:5px}[data-balloon-pos=right]:hover:after,[data-balloon-pos=right]:hover:before,[data-balloon-pos=right][data-balloon-visible]:after,[data-balloon-pos=right][data-balloon-visible]:before{-webkit-transform:translate(0,-50%);-ms-transform:translate(0,-50%);transform:translate(0,-50%)}[data-balloon-length]:after{white-space:normal}[data-balloon-length=small]:after{width:80px}[data-balloon-length=medium]:after{width:150px}[data-balloon-length=large]:after{width:260px}[data-balloon-length=xlarge]:after{width:90vw}@media screen and (min-width:768px){[data-balloon-length=xlarge]:after{width:380px}}[data-balloon-length=fit]:after{width:100%}
|
366 |
+
|
367 |
+
/** Balloon.css overrides **/
|
368 |
+
[data-balloon]:after,
|
369 |
+
[data-balloon]:before {
|
370 |
+
text-align: center;
|
371 |
+
line-height: 1.2em;
|
372 |
+
}
|
373 |
+
|
374 |
+
.foogallery-items-view-switch-container.hidden {
|
375 |
+
display: none;
|
376 |
+
}
|
377 |
+
|
378 |
+
.foogallery-items-view-switch-container {
|
379 |
+
display: inline-block;
|
380 |
+
margin-left: 10px;
|
381 |
+
}
|
382 |
+
|
383 |
+
.foogallery-items-view-switch {
|
384 |
+
vertical-align: middle;
|
385 |
+
display: inline-block;
|
386 |
+
}
|
387 |
+
|
388 |
+
.foogallery-items-view-switch a {
|
389 |
+
padding: 4px 10px;
|
390 |
+
line-height: 12px;
|
391 |
+
border: 1px solid #ccc;
|
392 |
+
float: left;
|
393 |
+
display: inline-block;
|
394 |
+
text-decoration: none;
|
395 |
+
margin-right: 10px;
|
396 |
+
border-radius: 4px;
|
397 |
+
text-align: center;
|
398 |
+
white-space: nowrap;
|
399 |
+
vertical-align: middle;
|
400 |
+
-ms-touch-action: manipulation;
|
401 |
+
touch-action: manipulation;
|
402 |
+
cursor: pointer;
|
403 |
+
-webkit-user-select: none;
|
404 |
+
-moz-user-select: none;
|
405 |
+
-ms-user-select: none;
|
406 |
+
user-select: none;
|
407 |
+
background: #f7f7f7;
|
408 |
+
color: #555;
|
409 |
+
}
|
410 |
+
|
411 |
+
.foogallery-items-view-switch a:first-child:not(:last-child) {
|
412 |
+
border-top-right-radius: 0;
|
413 |
+
border-bottom-right-radius: 0;
|
414 |
+
}
|
415 |
+
|
416 |
+
.foogallery-items-view-switch a:last-child:not(:first-child) {
|
417 |
+
border-top-left-radius: 0;
|
418 |
+
border-bottom-left-radius: 0;
|
419 |
+
}
|
420 |
+
|
421 |
+
.foogallery-items-view-switch a:first-child {
|
422 |
+
margin-right: 0;
|
423 |
+
}
|
424 |
+
|
425 |
+
.foogallery-items-view-switch a.current {
|
426 |
+
background: #0085ba;
|
427 |
+
color: #fff;
|
428 |
+
}
|
429 |
+
|
430 |
+
.foogallery-items-view-switch a+a {
|
431 |
+
margin-left: -1px;
|
432 |
+
}
|
433 |
+
|
434 |
+
.foogallery_preview_container {
|
435 |
+
position: relative;
|
436 |
+
padding: 10px;
|
437 |
+
}
|
438 |
+
|
439 |
+
.foogallery_preview_container.loading:after {
|
440 |
+
content: '';
|
441 |
+
position: absolute;
|
442 |
+
top: 0;
|
443 |
+
left: 0;
|
444 |
+
right: 0;
|
445 |
+
bottom: 0;
|
446 |
+
background: #fff;
|
447 |
+
opacity: 0.8;
|
448 |
+
z-index: 159900;
|
449 |
+
}
|
450 |
+
|
451 |
+
.fs-submenu-item.foogallery {
|
452 |
+
font-size: 13px;
|
453 |
+
line-height: 1.2;
|
454 |
+
}
|
455 |
+
|
456 |
+
.foogallery_template_field_type-thumb_size_no_crop input.small-text+label {
|
457 |
+
margin-left: 10px;
|
458 |
+
}
|
459 |
+
|
460 |
+
.foogallery_template_field_type-thumb_size_no_crop label+input {
|
461 |
+
margin-left: 5px;
|
462 |
+
}
|
css/admin-page-foogallery-extensions.css
ADDED
@@ -0,0 +1,297 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.extensions-wrap {
|
2 |
+
margin-left: 0;
|
3 |
+
width: 98%;
|
4 |
+
max-width: 98%;
|
5 |
+
}
|
6 |
+
|
7 |
+
.foogallery-extension-browser .extension-controls {
|
8 |
+
margin-bottom: 10px;
|
9 |
+
}
|
10 |
+
|
11 |
+
.foogallery-extension-browser .extension-controls .subsubsub {
|
12 |
+
margin:0;
|
13 |
+
}
|
14 |
+
|
15 |
+
.extension-search-box {
|
16 |
+
display: inline-block;
|
17 |
+
margin-left: 20px;
|
18 |
+
float: left;
|
19 |
+
}
|
20 |
+
|
21 |
+
.extension-search-box #extensions-search-input {
|
22 |
+
position: relative;
|
23 |
+
top: -4px;
|
24 |
+
margin: 0;
|
25 |
+
width: 280px;
|
26 |
+
font-size: 16px;
|
27 |
+
font-weight: 300;
|
28 |
+
line-height: 1.4em;
|
29 |
+
}
|
30 |
+
|
31 |
+
.extension-reload {
|
32 |
+
float: left;
|
33 |
+
display: inline-block;
|
34 |
+
margin-left: 20px;
|
35 |
+
vertical-align: middle;
|
36 |
+
}
|
37 |
+
|
38 |
+
.extension-reload .button {
|
39 |
+
vertical-align: middle;
|
40 |
+
}
|
41 |
+
|
42 |
+
.extension-reload span.dashicons {
|
43 |
+
vertical-align: middle;
|
44 |
+
font-size: 18px;
|
45 |
+
}
|
46 |
+
|
47 |
+
.extension-reload .button.disabled span.dashicons {
|
48 |
+
-webkit-animation: rotation 2s infinite linear;
|
49 |
+
animation: rotation 2s infinite linear;
|
50 |
+
}
|
51 |
+
|
52 |
+
div.foogallery-message-success {
|
53 |
+
border-left: 4px solid #7ad03a;
|
54 |
+
padding: 1px 12px;
|
55 |
+
background-color: #fff;
|
56 |
+
-webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
|
57 |
+
box-shadow: 0 1px 1px 0 rgba(0,0,0,.1)
|
58 |
+
}
|
59 |
+
|
60 |
+
div.foogallery-message-error {
|
61 |
+
border-left: 4px solid #dd3d36;
|
62 |
+
background: #fff;
|
63 |
+
-webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
|
64 |
+
box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
|
65 |
+
padding: 1px 12px
|
66 |
+
}
|
67 |
+
|
68 |
+
.spinner {
|
69 |
+
position: absolute;
|
70 |
+
margin-top: 15px;
|
71 |
+
}
|
72 |
+
|
73 |
+
.foogallery-extension-browser {
|
74 |
+
margin-top: 10px;
|
75 |
+
width: 100%;
|
76 |
+
position: relative;
|
77 |
+
}
|
78 |
+
|
79 |
+
.foogallery-extension-browser * {
|
80 |
+
box-sizing: border-box;
|
81 |
+
}
|
82 |
+
|
83 |
+
.foogallery-extension-browser .extensions .extension {
|
84 |
+
float: left;
|
85 |
+
margin: 0 20px 20px 0;
|
86 |
+
position: relative;
|
87 |
+
width: 400px;
|
88 |
+
height: 300px;
|
89 |
+
border: 1px solid #DEDEDE;
|
90 |
+
-webkit-box-shadow: 0 1px 1px -1px rgba(0, 0, 0, 0.1);
|
91 |
+
box-shadow: 0 1px 1px -1px rgba(0, 0, 0, 0.1);
|
92 |
+
-webkit-box-sizing: border-box;
|
93 |
+
-moz-box-sizing: border-box;
|
94 |
+
box-sizing: border-box;
|
95 |
+
background: #fff;
|
96 |
+
}
|
97 |
+
|
98 |
+
.foogallery-extension-browser .extensions .extension h3 {
|
99 |
+
position: absolute;
|
100 |
+
bottom: 0;
|
101 |
+
width: 100%;
|
102 |
+
font-size: 15px;
|
103 |
+
font-weight: bold;
|
104 |
+
height: 50px;
|
105 |
+
line-height: 50px;
|
106 |
+
margin: 0;
|
107 |
+
padding-left: 15px;
|
108 |
+
-webkit-box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.1);
|
109 |
+
box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.1);
|
110 |
+
overflow: hidden;
|
111 |
+
white-space: nowrap;
|
112 |
+
text-overflow: ellipsis;
|
113 |
+
background: #000;
|
114 |
+
opacity: 0.9;
|
115 |
+
color:#fff;
|
116 |
+
}
|
117 |
+
|
118 |
+
.foogallery-extension-browser .extensions .extension h3 .new {
|
119 |
+
background: #D54E21;
|
120 |
+
background: rgba(213, 78, 33, 0.95);
|
121 |
+
-webkit-border-radius: 3px;
|
122 |
+
border-radius: 3px;
|
123 |
+
padding:2px 5px;
|
124 |
+
color:#fff;
|
125 |
+
font-size: 10px;
|
126 |
+
margin-left: 5px;
|
127 |
+
margin-bottom: 3px;
|
128 |
+
}
|
129 |
+
|
130 |
+
.foogallery-extension-browser .extensions .extension h3 .tag {
|
131 |
+
background: #888;
|
132 |
+
-webkit-border-radius: 3px;
|
133 |
+
border-radius: 3px;
|
134 |
+
padding:2px 5px;
|
135 |
+
color:#000;
|
136 |
+
font-size: 9px;
|
137 |
+
margin-left: 5px;
|
138 |
+
vertical-align:top;
|
139 |
+
}
|
140 |
+
|
141 |
+
.foogallery-extension-browser .extensions .extension h3 .tag.functionality {
|
142 |
+
background: #8a5cc9;
|
143 |
+
}
|
144 |
+
|
145 |
+
.foogallery-extension-browser .extensions .extension h3 .tag.premium {
|
146 |
+
background: #080;
|
147 |
+
}
|
148 |
+
|
149 |
+
.foogallery-extension-browser .extensions .extension h3 .tag.lightbox {
|
150 |
+
background: #ff7f00;
|
151 |
+
}
|
152 |
+
|
153 |
+
.foogallery-extension-browser .extensions .extension h3 .tag.template {
|
154 |
+
background: #369;
|
155 |
+
}
|
156 |
+
|
157 |
+
.foogallery-extension-browser .extensions .extension h3 .tag.new {
|
158 |
+
background: #F00;
|
159 |
+
}
|
160 |
+
|
161 |
+
.foogallery-extension-browser .extensions .extension .screenshot {
|
162 |
+
height: 100%;
|
163 |
+
position: absolute;
|
164 |
+
left: 0;
|
165 |
+
top: 0;
|
166 |
+
width: 100%;
|
167 |
+
-webkit-transform: translateZ(0);
|
168 |
+
-webkit-transition: opacity .2s ease-in-out;
|
169 |
+
transition: opacity .2s ease-in-out;
|
170 |
+
}
|
171 |
+
|
172 |
+
.foogallery-extension-browser .extensions .extension:hover .screenshot {
|
173 |
+
opacity: .4;
|
174 |
+
}
|
175 |
+
|
176 |
+
.foogallery-extension-browser .extensions .extension .extension-actions {
|
177 |
+
-webkit-transition: opacity .1s ease-in-out;
|
178 |
+
transition: opacity .1s ease-in-out;
|
179 |
+
position: absolute;
|
180 |
+
bottom: 0;
|
181 |
+
right: 0;
|
182 |
+
height: 50px;
|
183 |
+
padding: 9px 10px 0;
|
184 |
+
}
|
185 |
+
|
186 |
+
.foogallery-extension-browser .extensions .extension .extension-details {
|
187 |
+
-ms-filter: "alpha(Opacity=0)";
|
188 |
+
opacity: 0;
|
189 |
+
position: absolute;
|
190 |
+
top: 25%;
|
191 |
+
right: 20%;
|
192 |
+
left: 20%;
|
193 |
+
background: #222;
|
194 |
+
background: rgba(0, 0, 0, 0.7);
|
195 |
+
color: #FFF;
|
196 |
+
font-size: 15px;
|
197 |
+
text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6);
|
198 |
+
-webkit-font-smoothing: antialiased;
|
199 |
+
font-weight: 600;
|
200 |
+
padding: 15px 12px;
|
201 |
+
text-align: center;
|
202 |
+
-webkit-border-radius: 3px;
|
203 |
+
border-radius: 3px;
|
204 |
+
-webkit-transition: opacity .1s ease-in-out;
|
205 |
+
transition: opacity .1s ease-in-out;
|
206 |
+
}
|
207 |
+
|
208 |
+
.foogallery-extension-browser .extensions .extension:hover .extension-details {
|
209 |
+
-ms-filter: "alpha(Opacity=1)";
|
210 |
+
opacity: 1;
|
211 |
+
}
|
212 |
+
|
213 |
+
.foogallery-extension-browser .extensions .extension .banner {
|
214 |
+
background: #888;
|
215 |
+
color: #FFF;
|
216 |
+
display: block;
|
217 |
+
font-size: 13px;
|
218 |
+
font-weight: 400;
|
219 |
+
height: 48px;
|
220 |
+
line-height: 48px;
|
221 |
+
padding: 0 10px 0 40px;
|
222 |
+
position: absolute;
|
223 |
+
top: 0;
|
224 |
+
right: 0;
|
225 |
+
left: 0;
|
226 |
+
border-bottom: 1px solid rgba(0, 0, 0, 0.25);
|
227 |
+
overflow: hidden;
|
228 |
+
}
|
229 |
+
|
230 |
+
.foogallery-extension-browser .extensions .extension .banner:empty {
|
231 |
+
display: none;
|
232 |
+
}
|
233 |
+
|
234 |
+
.foogallery-extension-browser .extensions .extension .banner:before {
|
235 |
+
display: inline-block;
|
236 |
+
font: 400 30px/1 dashicons;
|
237 |
+
top: 10px;
|
238 |
+
left: 10px;
|
239 |
+
position: absolute;
|
240 |
+
speak: none;
|
241 |
+
-webkit-font-smoothing: antialiased;
|
242 |
+
}
|
243 |
+
|
244 |
+
.foogallery-extension-browser .extensions .extension.activated .banner {
|
245 |
+
background: #080;
|
246 |
+
}
|
247 |
+
|
248 |
+
.foogallery-extension-browser .extensions .extension.activated .banner:before {
|
249 |
+
content: "\f147";
|
250 |
+
}
|
251 |
+
|
252 |
+
.foogallery-extension-browser .extensions .extension.has_error .banner {
|
253 |
+
background: #800;
|
254 |
+
}
|
255 |
+
|
256 |
+
.foogallery-extension-browser .extensions .extension.has_error .banner:before {
|
257 |
+
content: "\f158";
|
258 |
+
}
|
259 |
+
|
260 |
+
.foogallery-extension-browser .extensions .extension.updating .banner {
|
261 |
+
background: #888;
|
262 |
+
}
|
263 |
+
|
264 |
+
.foogallery-extension-browser .extensions .extension.updating .banner:before {
|
265 |
+
content: "\f463";
|
266 |
+
-webkit-animation: rotation 2s infinite linear;
|
267 |
+
animation: rotation 2s infinite linear;
|
268 |
+
}
|
269 |
+
|
270 |
+
.foogallery-extension-browser .extensions .extension .activate,
|
271 |
+
.foogallery-extension-browser .extensions .extension .deactivate {
|
272 |
+
display: none;
|
273 |
+
}
|
274 |
+
|
275 |
+
.foogallery-extension-browser .extensions .extension.downloaded .activate {
|
276 |
+
display: block;
|
277 |
+
}
|
278 |
+
|
279 |
+
.foogallery-extension-browser .extensions .extension.downloaded .download {
|
280 |
+
display: none;
|
281 |
+
}
|
282 |
+
|
283 |
+
.foogallery-extension-browser .extensions .extension.activated .activate {
|
284 |
+
display: none;
|
285 |
+
}
|
286 |
+
|
287 |
+
.foogallery-extension-browser .extensions .extension.activated .deactivate {
|
288 |
+
display: block;
|
289 |
+
}
|
290 |
+
|
291 |
+
.foogallery-extension-browser .extensions .extension.activated .updating {
|
292 |
+
display: block;
|
293 |
+
}
|
294 |
+
|
295 |
+
.foogallery-extension-browser .extension-page {
|
296 |
+
display: none;
|
297 |
+
}
|
css/admin-page-foogallery-settings.css
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
#foogallery-settings-main div+br {
|
2 |
+
display: none;
|
3 |
+
}
|
css/admin-tinymce.css
ADDED
@@ -0,0 +1,114 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.mce-content-body div.foogallery-tinymce-view {
|
2 |
+
background-color: rgba(0, 0, 0, 0.1);
|
3 |
+
position: relative;
|
4 |
+
margin-bottom: 16px;
|
5 |
+
border: 1px solid rgba(0, 0, 0, 0);
|
6 |
+
width: 99.99%;
|
7 |
+
clear: both;
|
8 |
+
height: 250px;
|
9 |
+
text-align: center;
|
10 |
+
}
|
11 |
+
|
12 |
+
.mce-content-body div.foogallery-tinymce-view .foogallery-tinymce-toolbar {
|
13 |
+
display: none;
|
14 |
+
position: absolute;
|
15 |
+
top: 0;
|
16 |
+
left: 0;
|
17 |
+
z-index: 100;
|
18 |
+
}
|
19 |
+
|
20 |
+
.mce-content-body div.foogallery-tinymce-view .foogallery-tinymce-toolbar .dashicons {
|
21 |
+
margin-top: 7px;
|
22 |
+
margin-left: 7px;
|
23 |
+
padding: 2px;
|
24 |
+
width: 30px;
|
25 |
+
height: 30px;
|
26 |
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
|
27 |
+
background-color: #000;
|
28 |
+
background-color: rgba(0, 0, 0, 0.9);
|
29 |
+
cursor: pointer;
|
30 |
+
color: #FFF;
|
31 |
+
font-size: 30px;
|
32 |
+
}
|
33 |
+
|
34 |
+
.mce-content-body div.foogallery-tinymce-view .foogallery-tinymce-toolbar .dashicons:hover {
|
35 |
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
|
36 |
+
background-color: #000;
|
37 |
+
color: #2EA2CC;
|
38 |
+
}
|
39 |
+
|
40 |
+
.mce-content-body div.foogallery-tinymce-view.foogallery-tinymce-selected {
|
41 |
+
border-color: rgba(0, 0, 0, 0.3);
|
42 |
+
}
|
43 |
+
|
44 |
+
.mce-content-body div.foogallery-tinymce-view.foogallery-tinymce-selected .foogallery-tinymce-toolbar {
|
45 |
+
display: block;
|
46 |
+
}
|
47 |
+
|
48 |
+
.mce-content-body div.foogallery-tinymce-view .foogallery-pile {
|
49 |
+
position: absolute;
|
50 |
+
z-index: 10;
|
51 |
+
left: 50%;
|
52 |
+
top: 50%;
|
53 |
+
margin-left: -83px;
|
54 |
+
margin-top: -95px;
|
55 |
+
}
|
56 |
+
|
57 |
+
/* Image styles */
|
58 |
+
.mce-content-body div.foogallery-tinymce-view .foogallery-pile .foogallery-pile-inner { max-width: 100%; height: auto; vertical-align: bottom; border: 8px solid #fff;
|
59 |
+
-webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
|
60 |
+
-moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
|
61 |
+
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
|
62 |
+
overflow: hidden;
|
63 |
+
background: #CCC;
|
64 |
+
}
|
65 |
+
|
66 |
+
/* Stacks creted by the use of generated content */
|
67 |
+
.mce-content-body div.foogallery-tinymce-view .foogallery-pile:before, .foogallery-pile:after { content: ""; width: 100%; height: 100%; position: absolute; border: 8px solid #fff; left: 0;
|
68 |
+
-webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
|
69 |
+
-moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
|
70 |
+
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
|
71 |
+
-webkit-box-sizing: border-box;
|
72 |
+
-moz-box-sizing: border-box;
|
73 |
+
box-sizing: border-box;
|
74 |
+
}
|
75 |
+
/* 1st element in stack (behind image) */
|
76 |
+
.mce-content-body div.foogallery-tinymce-view .foogallery-pile:before {
|
77 |
+
top: 0;
|
78 |
+
z-index: -10;
|
79 |
+
-webkit-transform: rotate(-3deg);
|
80 |
+
-moz-transform: rotate(-3deg);
|
81 |
+
transform: rotate(-3deg);
|
82 |
+
}
|
83 |
+
/* 2nd element in stack (behind image) */
|
84 |
+
.mce-content-body div.foogallery-tinymce-view .foogallery-pile:after {
|
85 |
+
top: 1px;
|
86 |
+
z-index: -20;
|
87 |
+
-webkit-transform: rotate(4deg);
|
88 |
+
-moz-transform: rotate(4deg);
|
89 |
+
transform: rotate(4deg);
|
90 |
+
}
|
91 |
+
|
92 |
+
.mce-content-body div.foogallery-tinymce-view .foogallery-pile-inner img {
|
93 |
+
max-width: 150px;
|
94 |
+
}
|
95 |
+
|
96 |
+
.mce-content-body div.foogallery-tinymce-view .foogallery-tinymce-title {
|
97 |
+
font-family: "Open Sans", sans-serif;
|
98 |
+
font-size: 1.2em;
|
99 |
+
color: #666;
|
100 |
+
position: absolute;
|
101 |
+
bottom: 1em;
|
102 |
+
width: 100%;
|
103 |
+
left: 0;
|
104 |
+
}
|
105 |
+
|
106 |
+
.mce-content-body div.foogallery-tinymce-view .foogallery-tinymce-count {
|
107 |
+
font-family: "Open Sans", sans-serif;
|
108 |
+
font-size: 0.7em;
|
109 |
+
color: #888;
|
110 |
+
position: absolute;
|
111 |
+
bottom: 0.5em;
|
112 |
+
width: 100%;
|
113 |
+
left: 0;
|
114 |
+
}
|
css/foogallery-foovideo-overrides.css
ADDED
@@ -0,0 +1,96 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* sticky video icon states */
|
2 |
+
.video-icon-sticky.foogallery-container.video-icon-default .fg-video .fg-thumb,
|
3 |
+
.video-icon-sticky.foogallery-container.video-icon-1 .fg-video .fg-thumb,
|
4 |
+
.video-icon-sticky.foogallery-container.video-icon-2 .fg-video .fg-thumb,
|
5 |
+
.video-icon-sticky.foogallery-container.video-icon-3 .fg-video .fg-thumb,
|
6 |
+
.video-icon-sticky.foogallery-container.video-icon-4 .fg-video .fg-thumb {
|
7 |
+
transform: translateY(0) translateX(0) translateZ(0);
|
8 |
+
}
|
9 |
+
.video-icon-sticky.foogallery-container.video-icon-default .fg-video .fg-item-inner:hover .fg-thumb,
|
10 |
+
.video-icon-sticky.foogallery-container.video-icon-1 .fg-video .fg-item-inner:hover .fg-thumb,
|
11 |
+
.video-icon-sticky.foogallery-container.video-icon-2 .fg-video .fg-item-inner:hover .fg-thumb,
|
12 |
+
.video-icon-sticky.foogallery-container.video-icon-3 .fg-video .fg-item-inner:hover .fg-thumb,
|
13 |
+
.video-icon-sticky.foogallery-container.video-icon-4 .fg-video .fg-item-inner:hover .fg-thumb {
|
14 |
+
transform: translateY(0) translateX(0) translateZ(0);
|
15 |
+
}
|
16 |
+
.video-icon-sticky.foogallery-container.video-icon-default .fg-video .fg-thumb:before,
|
17 |
+
.video-icon-sticky.foogallery-container.video-icon-1 .fg-video .fg-thumb:before,
|
18 |
+
.video-icon-sticky.foogallery-container.video-icon-2 .fg-video .fg-thumb:before,
|
19 |
+
.video-icon-sticky.foogallery-container.video-icon-3 .fg-video .fg-thumb:before,
|
20 |
+
.video-icon-sticky.foogallery-container.video-icon-4 .fg-video .fg-thumb:before {
|
21 |
+
content: '';
|
22 |
+
display: block;
|
23 |
+
top: 0;
|
24 |
+
left: 0;
|
25 |
+
bottom: 0;
|
26 |
+
right: 0;
|
27 |
+
visibility: visible;
|
28 |
+
opacity: 1;
|
29 |
+
background-color: rgba(0,0,0,0);
|
30 |
+
transition-timing-function: ease;
|
31 |
+
transition-duration: 300ms;
|
32 |
+
transition-property: opacity,visibility,background-color;
|
33 |
+
transform: translateY(0) translateX(0) translateZ(0);
|
34 |
+
z-index: 8;
|
35 |
+
}
|
36 |
+
.video-icon-sticky.foogallery-container.video-icon-default .fg-video .fg-item-inner:hover .fg-thumb:before,
|
37 |
+
.video-icon-sticky.foogallery-container.video-icon-1 .fg-video .fg-item-inner:hover .fg-thumb:before,
|
38 |
+
.video-icon-sticky.foogallery-container.video-icon-2 .fg-video .fg-item-inner:hover .fg-thumb:before,
|
39 |
+
.video-icon-sticky.foogallery-container.video-icon-3 .fg-video .fg-item-inner:hover .fg-thumb:before,
|
40 |
+
.video-icon-sticky.foogallery-container.video-icon-4 .fg-video .fg-item-inner:hover .fg-thumb:before {
|
41 |
+
background-color: rgba(0,0,0,0.5);
|
42 |
+
}
|
43 |
+
.video-icon-sticky.foogallery-container.video-icon-default .fg-video .fg-caption-inner:before,
|
44 |
+
.video-icon-sticky.foogallery-container.video-icon-1 .fg-video .fg-caption-inner:before,
|
45 |
+
.video-icon-sticky.foogallery-container.video-icon-2 .fg-video .fg-caption-inner:before,
|
46 |
+
.video-icon-sticky.foogallery-container.video-icon-3 .fg-video .fg-caption-inner:before,
|
47 |
+
.video-icon-sticky.foogallery-container.video-icon-4 .fg-video .fg-caption-inner:before {
|
48 |
+
display: none;
|
49 |
+
}
|
50 |
+
|
51 |
+
/* The icons */
|
52 |
+
.foogallery-container.video-icon-default .fg-video .fg-thumb:before,
|
53 |
+
.foogallery-container.video-icon-1 .fg-video .fg-thumb:before,
|
54 |
+
.foogallery-container.video-icon-2 .fg-video .fg-thumb:before,
|
55 |
+
.foogallery-container.video-icon-3 .fg-video .fg-thumb:before,
|
56 |
+
.foogallery-container.video-icon-4 .fg-video .fg-thumb:before,
|
57 |
+
.foogallery-container.video-icon-default .fg-video .fg-caption-inner:before,
|
58 |
+
.foogallery-container.video-icon-1 .fg-video .fg-caption-inner:before,
|
59 |
+
.foogallery-container.video-icon-2 .fg-video .fg-caption-inner:before,
|
60 |
+
.foogallery-container.video-icon-3 .fg-video .fg-caption-inner:before,
|
61 |
+
.foogallery-container.video-icon-4 .fg-video .fg-caption-inner:before {
|
62 |
+
background-size: 60px 60px;
|
63 |
+
}
|
64 |
+
.foogallery-container.video-icon-default .fg-video .fg-caption-inner:before,
|
65 |
+
.foogallery-container.video-icon-1 .fg-video .fg-caption-inner:before,
|
66 |
+
.foogallery-container.video-icon-2 .fg-video .fg-caption-inner:before,
|
67 |
+
.foogallery-container.video-icon-3 .fg-video .fg-caption-inner:before,
|
68 |
+
.foogallery-container.video-icon-4 .fg-video .fg-caption-inner:before {
|
69 |
+
width: 60px;
|
70 |
+
height: 60px;
|
71 |
+
}
|
72 |
+
|
73 |
+
.foogallery-container.video-icon-default .fg-video .fg-thumb:before,
|
74 |
+
.foogallery-container.video-icon-default .fg-video .fg-caption-inner:before {
|
75 |
+
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2Y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FBngFuBsb6ZVUKkV3dzfT09Om/d8bwK92gUeB/YjklZLcbjeJRIJ4PE46nTYNewx4zWos/W89D9yEKGnI3XuMjpJOp3GgvDENPCi30/UHIUeDp+U6nlNpxdLSEg7Vcj6OSM6jC/jv6Ov+QjpFSe0H3s55mSkaPwQ8VkCwB4FHlPyKhZd0yU++dRSRZVgzDYzs1WfQVDFncWR3IorYcAIY4CXE/W/UQdBfgDZEOmXOigG7iZ2TwG3Ao8Apw7AHEDmjz+0Y0ZHJyiJqtaqA1xH3YTp1GJEF2QPM2DWmM3U3Jz34NjndT9iw9TuiuPQO4HbgiK5GmkiWHZMObR+ibPhWGaVtRSS4PP94b1bOiNOIe7QhRMFbv6klYjI7mAEGZSx+CAgBVyMu+TfI2ZWRnv6U7Khx6ZiMyVX8G08RuAhcBD6X9NcAiPM3LJ0pyxAAAAAASUVORK5CYII=')!important;
|
76 |
+
}
|
77 |
+
|
78 |
+
.foogallery-container.video-icon-1 .fg-video .fg-thumb:before,
|
79 |
+
.foogallery-container.video-icon-1 .fg-video .fg-caption-inner:before {
|
80 |
+
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7A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YKFYGGhvaJi4x9gChGxELEUBG1sRBHxhZJKFEGwEAsJNmrhA1L4II2iaKFiiGJhQBAhhY9ClNitxc5in703O3fn/GDL3cu3c+6dOWe31W63lZQhhSXAAQ5wgAMc4AAHOMC5go9idZPArR6bhwU8wUl8KGGFF7ALb3AWI4MO7pbHCM7jFfaW9NDahDt4jM0lPaXH8QwTWF7KtjSK03iPQyXtw+twLZX5hpIOHuN4jctY09R9+AdWLeJ9P3EDV/C1BHA339KKX8XvEsDdvMVhvCylediC57iF9aV0S0PYhxkcx3Ap7eEoLqQy311SP7wR9zFVZZk3YQCwE+9Sma8sZeIxlsp8FgdLAHezFltLAT/Atl5XeFkDoF9wBPeq+LCcwX/TWftiOtEZZPBdnMDcoO/Dn7AnvebquEAuK/wLZ3A9lXJtyQE8hVNpj609/QRP4rbO6GfJ0g/wC5zDdD++5aUEz6fSnfR/gD+Q4DZu4hi+59B015npdPbdnwO2TvA8DmB7auSzSdUl/Udn/DqhM5HMLlWCH+r8QP4x506k15Jegc/pHt2RO7aKFb6ER3jalKa6Ff+XDnCAAxzgAAc4wAEOcIAXlX8DAArJYP9PMqkfAAAAAElFTkSuQmCC')!important;
|
81 |
+
}
|
82 |
+
|
83 |
+
.foogallery-container.video-icon-2 .fg-video .fg-thumb:before,
|
84 |
+
.foogallery-container.video-icon-2 .fg-video .fg-caption-inner:before {
|
85 |
+
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/q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N4XD3l8bUMGdW6Zy5GO+B2CL8uX9t9K0WFLWaMTVMo6W4eJWZbbs1EJ1Xp1tVM3X2SF+J0JNkDNFSTzdh21sZB+EK1XmSVOfv4Yb0qI3rK2Jf+DWSnXPCnzutZhuf41C2omI1oCxK0FJfLQMQ7xW7jIN4C5DaguR7KBs7UNQOgmw9hKL+U1Ld35FqP0cqeJlU9wKp7mujVQCrOhdJBRdJBedQts+Q6j5NsvkkyeajKNtHkPzdKBoEKD/Cgb8DSVoAsfRhQIhTTO4tjRCC2PlBUYkTilcifQUgMg7uNUDyWgB4v+vhhwDFVpIVjjTbRPJ3kKzfijS7D2XzDqTZgygaB4WsHUFR/QaK+j1Is/tRNm9Dmt2DoroTRaUDKBSK6lZA/CiQei+SeJfHy9cAkhXrTELNiW1oPGxmCF3SpFKptDSmUNOO0j+cZw4GJlV9YzQsRe0zLExJOR3Wf19fA70S6WOafHjVoq8xbDMJW3GKotYhWlqpULO0hLNXgtg81cZS0BtbqJkh6tMStVpJycNKhJrrjexqRK0DtDSJPrtSZCcpah2YLa2lz06jX+YyEJun0lJuJULNMaT4kwzSqmlpPRs9Topn8enPVUn5cG4Vn8hkUbyy7LO5Jb5z6mWsmdKWkSKWUe0KRlAKic/fVmOzEp/NFYwtW8voRsvZZlKeOcrW+xzw/wMAILDvruEbvv8AAAAASUVORK5CYII=')!important;
|
86 |
+
}
|
87 |
+
|
88 |
+
.foogallery-container.video-icon-3 .fg-video .fg-thumb:before,
|
89 |
+
.foogallery-container.video-icon-3 .fg-video .fg-caption-inner:before {
|
90 |
+
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAAAsSAAALEgHS3X78AAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89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hKJgKIoqaio6FeTydTx+++/WxwOx72jQIjRcDvT7EWO/j4hl8v5vLy89sLCwvrMzEze4XBMO0xPu9Ia68IoFAp/SUnJCZPJVA9gYXNzcwHP82l+vz9pdFJSwoW4wxI5+lmSyWQenU7Xl5OTc4FhmLbs7GxfLJzOJDTP+N8q0WgUgiCApulQVlaWg6Zph0aj0XR0dGS7XC6z1+vV+/1+DUVRDM/zNEEQhEajEWmaDrEs6wPAsSw7kJmZ2U0QBJ+UlITBwUEIggCFQjHjHPLPAQCVOvMDg/9I3gAAAABJRU5ErkJggg==')!important;
|
91 |
+
}
|
92 |
+
|
93 |
+
.foogallery-container.video-icon-4 .fg-video .fg-thumb:before,
|
94 |
+
.foogallery-container.video-icon-4 .fg-video .fg-caption-inner:before {
|
95 |
+
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAAEgBckRAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl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6Her1OsFgEEmS2O12N8/O3S+xzWYjEAjQaDTodrukUimcTiebzeYm2Xl4FfJ4POTzeXq9HtVqFZ/PhxDinxWfIcqow+EgHA6jKAqqquL1evVdkan6wHw+p1QqoWnaXx8VDQUwHA5Jp9OEw2EKhQLT6VSvaoYEWCwWKIpCLBYjGo3SbrdZLpfY7farDv4QgPF4rEc5k8mgaRqyLF+lHm8OYLFY/lCa6/WaVqtFPB4nGo1Sq9X0KFutVuM0MqvVymq1QlEUBoMBxWKRSCRCMplkNBohhLhplO+SAUmSmEwm9Pt9ZrMZNpvtblH+P04bHcDMiswigDSvCxWz2U/gy+VXxBvgCfjE63+crwb11u8zPgFvgZdfAwCALp9J1DCT3gAAAABJRU5ErkJggg==)!important;
|
96 |
+
}
|
css/foogallery.admin.min.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
.foogallery-settings *{box-sizing:border-box}.foogallery-settings{position:relative;display:block;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;font-size:13px;border:solid 1px #eee}.foogallery-settings:after{display:table;content:"";clear:both}.foogallery-vertical-tabs{display:block;position:absolute;top:0;left:0;bottom:0;width:150px;background-color:#fafafa;border-right:solid 1px #eee}.foogallery-vertical-tab{margin:0;padding:10px;display:block;box-shadow:none;text-decoration:none;line-height:20px;border-bottom:1px solid #eee;color:#0073aa;cursor:pointer}.foogallery-vertical-tab:hover{color:#00a0d2}.foogallery-vertical-tab.foogallery-tab-active{color:#555;background-color:#eee}.foogallery-vertical-tab .dashicons{font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;margin-right:.618em;font-size:13px;width:13px;height:13px;vertical-align:middle;margin-bottom:4px}.foogallery-tab-contents{display:block;float:right;width:calc(100% - 150px);background-color:#fff;min-height:400px}.foogallery-tab-content{display:none}.foogallery-tab-content.foogallery-tab-active{display:block}@media only screen and (max-width:900px){.foogallery-vertical-tabs{width:50px}.foogallery-vertical-tab{text-align:center}.foogallery-vertical-tab .dashicons{margin-right:0}.foogallery-tab-text{display:none}.foogallery-tab-contents{width:calc(100% - 50px)}}
|
extensions/albums/admin/class-columns.php
ADDED
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
* FooGallery Admin Columns class
|
4 |
+
*/
|
5 |
+
|
6 |
+
if ( ! class_exists( 'FooGallery_Albums_Admin_Columns' ) ) {
|
7 |
+
|
8 |
+
class FooGallery_Albums_Admin_Columns {
|
9 |
+
|
10 |
+
private $include_clipboard_script = false;
|
11 |
+
|
12 |
+
function __construct() {
|
13 |
+
add_filter( 'manage_edit-' . FOOGALLERY_CPT_ALBUM . '_columns', array( $this, 'album_custom_columns' ) );
|
14 |
+
add_action( 'manage_posts_custom_column', array( $this, 'album_custom_column_content' ) );
|
15 |
+
add_action( 'admin_footer', array( $this, 'include_clipboard_script' ) );
|
16 |
+
}
|
17 |
+
|
18 |
+
function album_custom_columns( $columns ) {
|
19 |
+
$columns[FOOGALLERY_CPT_ALBUM . '_template'] = __( 'Template', 'foogallery' );
|
20 |
+
$columns[FOOGALLERY_CPT_ALBUM . '_galleries'] = __( 'Galleries', 'foogallery' );
|
21 |
+
$columns[FOOGALLERY_CPT_ALBUM . '_shortcode'] = __( 'Shortcode', 'foogallery' );
|
22 |
+
|
23 |
+
return $columns;
|
24 |
+
}
|
25 |
+
|
26 |
+
function album_custom_column_content( $column ) {
|
27 |
+
global $post;
|
28 |
+
|
29 |
+
switch ( $column ) {
|
30 |
+
case FOOGALLERY_CPT_ALBUM . '_template':
|
31 |
+
$album = FooGalleryAlbum::get( $post );
|
32 |
+
$template = $album->album_template_details();
|
33 |
+
if ( false !== $template ) {
|
34 |
+
echo $template['name'];
|
35 |
+
}
|
36 |
+
break;
|
37 |
+
case FOOGALLERY_CPT_ALBUM . '_galleries':
|
38 |
+
$album = FooGalleryAlbum::get( $post );
|
39 |
+
echo $album->gallery_count();
|
40 |
+
break;
|
41 |
+
case FOOGALLERY_CPT_ALBUM . '_shortcode':
|
42 |
+
$album = FooGalleryAlbum::get( $post );
|
43 |
+
$shortcode = $album->shortcode();
|
44 |
+
echo '<input type="text" readonly="readonly" size="' . strlen( $shortcode ) . '" value="' . esc_attr( $shortcode ) . '" class="foogallery-shortcode" />';
|
45 |
+
$this->include_clipboard_script = true;
|
46 |
+
break;
|
47 |
+
}
|
48 |
+
}
|
49 |
+
|
50 |
+
function include_clipboard_script() {
|
51 |
+
if ( $this->include_clipboard_script ) { ?>
|
52 |
+
<script>
|
53 |
+
jQuery(function($) {
|
54 |
+
$('.foogallery-shortcode').click( function () {
|
55 |
+
try {
|
56 |
+
//select the contents
|
57 |
+
this.select();
|
58 |
+
//copy the selection
|
59 |
+
document.execCommand('copy');
|
60 |
+
//show the copied message
|
61 |
+
$('.foogallery-shortcode-message').remove();
|
62 |
+
$(this).after('<p class="foogallery-shortcode-message"><?php _e( 'Shortcode copied to clipboard :)','foogallery' ); ?></p>');
|
63 |
+
} catch(err) {
|
64 |
+
console.log('Oops, unable to copy!');
|
65 |
+
}
|
66 |
+
});
|
67 |
+
});
|
68 |
+
</script>
|
69 |
+
<?php
|
70 |
+
}
|
71 |
+
}
|
72 |
+
}
|
73 |
+
}
|
extensions/albums/admin/class-metaboxes.php
ADDED
@@ -0,0 +1,576 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* FooGallery Admin Album MetaBoxes class
|
5 |
+
*/
|
6 |
+
|
7 |
+
if ( ! class_exists( 'FooGallery_Admin_Album_MetaBoxes' ) ) {
|
8 |
+
|
9 |
+
class FooGallery_Admin_Album_MetaBoxes {
|
10 |
+
|
11 |
+
private $_album;
|
12 |
+
|
13 |
+
public function __construct() {
|
14 |
+
//add our foogallery metaboxes
|
15 |
+
add_action( 'add_meta_boxes_' . FOOGALLERY_CPT_ALBUM, array( $this, 'add_meta_boxes' ) );
|
16 |
+
|
17 |
+
//save extra post data for a gallery
|
18 |
+
add_action( 'save_post', array( $this, 'save_album' ) );
|
19 |
+
|
20 |
+
//whitelist metaboxes for our album posttype
|
21 |
+
add_filter( 'foogallery-album_metabox_sanity', array( $this, 'whitelist_metaboxes' ) );
|
22 |
+
|
23 |
+
//add scripts used by metaboxes
|
24 |
+
add_action( 'admin_enqueue_scripts', array( $this, 'include_required_scripts' ) );
|
25 |
+
|
26 |
+
// Ajax call for getting gallery details
|
27 |
+
add_action( 'wp_ajax_foogallery_get_gallery_details', array( $this, 'ajax_get_gallery_details' ) );
|
28 |
+
|
29 |
+
// Ajax call for saving gallery details
|
30 |
+
add_action( 'wp_ajax_foogallery_save_gallery_details', array( $this, 'ajax_save_gallery_details' ) );
|
31 |
+
|
32 |
+
// Save details for the gallery
|
33 |
+
add_action( 'foogallery_album_gallery_details_save', array( $this, 'gallery_details_save' ), 10, 3 );
|
34 |
+
}
|
35 |
+
|
36 |
+
public function whitelist_metaboxes() {
|
37 |
+
return array(
|
38 |
+
FOOGALLERY_CPT_GALLERY => array(
|
39 |
+
'whitelist' => apply_filters( 'foogallery_metabox_sanity_foogallery-album',
|
40 |
+
array(
|
41 |
+
'submitdiv',
|
42 |
+
'slugdiv',
|
43 |
+
'postimagediv',
|
44 |
+
'foogalleryalbum_galleries',
|
45 |
+
'foogalleryalbum_shortcode'
|
46 |
+
)
|
47 |
+
),
|
48 |
+
'contexts' => array( 'normal', 'advanced', 'side', ),
|
49 |
+
'priorities' => array( 'high', 'core', 'default', 'low', ),
|
50 |
+
)
|
51 |
+
);
|
52 |
+
}
|
53 |
+
|
54 |
+
public function add_meta_boxes( $post ) {
|
55 |
+
add_meta_box(
|
56 |
+
'foogalleryalbum_galleries',
|
57 |
+
__( 'Galleries - click a gallery to add it to your album.', 'foogallery' ),
|
58 |
+
array( $this, 'render_gallery_metabox' ),
|
59 |
+
FOOGALLERY_CPT_ALBUM,
|
60 |
+
'normal',
|
61 |
+
'high'
|
62 |
+
);
|
63 |
+
|
64 |
+
add_meta_box(
|
65 |
+
'foogalleryalbum_settings',
|
66 |
+
__( 'Settings', 'foogallery' ),
|
67 |
+
array( $this, 'render_settings_metabox' ),
|
68 |
+
FOOGALLERY_CPT_ALBUM,
|
69 |
+
'normal',
|
70 |
+
'high'
|
71 |
+
);
|
72 |
+
|
73 |
+
add_meta_box(
|
74 |
+
'foogalleryalbum_customcss',
|
75 |
+
__( 'Custom CSS', 'foogallery' ),
|
76 |
+
array( $this, 'render_customcss_metabox' ),
|
77 |
+
FOOGALLERY_CPT_ALBUM,
|
78 |
+
'normal',
|
79 |
+
'low'
|
80 |
+
);
|
81 |
+
|
82 |
+
add_meta_box(
|
83 |
+
'foogalleryalbum_shortcode',
|
84 |
+
__( 'Album Shortcode', 'foogallery' ),
|
85 |
+
array( $this, 'render_shortcode_metabox' ),
|
86 |
+
FOOGALLERY_CPT_ALBUM,
|
87 |
+
'side',
|
88 |
+
'default'
|
89 |
+
);
|
90 |
+
|
91 |
+
add_meta_box(
|
92 |
+
'foogalleryalbum_sorting',
|
93 |
+
__( 'Album Sorting', 'foogallery' ),
|
94 |
+
array( $this, 'render_sorting_metabox' ),
|
95 |
+
FOOGALLERY_CPT_ALBUM,
|
96 |
+
'side',
|
97 |
+
'default'
|
98 |
+
);
|
99 |
+
}
|
100 |
+
|
101 |
+
public function get_album( $post ) {
|
102 |
+
if ( ! isset( $this->_album ) ) {
|
103 |
+
$this->_album = FooGalleryAlbum::get( $post );
|
104 |
+
}
|
105 |
+
|
106 |
+
return $this->_album;
|
107 |
+
}
|
108 |
+
|
109 |
+
public function save_album( $post_id ) {
|
110 |
+
// check autosave
|
111 |
+
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
|
112 |
+
return $post_id;
|
113 |
+
}
|
114 |
+
|
115 |
+
// verify nonce
|
116 |
+
if ( array_key_exists( FOOGALLERY_CPT_ALBUM . '_nonce', $_POST ) &&
|
117 |
+
wp_verify_nonce( $_POST[ FOOGALLERY_CPT_ALBUM . '_nonce' ], plugin_basename( FOOGALLERY_FILE ) )
|
118 |
+
) {
|
119 |
+
//if we get here, we are dealing with the Album custom post type
|
120 |
+
|
121 |
+
$galleries = apply_filters( 'foogallery_save_album_galleries', explode( ',', $_POST[ FOOGALLERY_ALBUM_META_GALLERIES ] ) );
|
122 |
+
update_post_meta( $post_id, FOOGALLERY_ALBUM_META_GALLERIES, $galleries );
|
123 |
+
|
124 |
+
update_post_meta( $post_id, FOOGALLERY_ALBUM_META_TEMPLATE, $_POST[FOOGALLERY_ALBUM_META_TEMPLATE] );
|
125 |
+
|
126 |
+
update_post_meta( $post_id, FOOGALLERY_ALBUM_META_SORT, $_POST[FOOGALLERY_ALBUM_META_SORT] );
|
127 |
+
|
128 |
+
$settings = isset($_POST['_foogallery_settings']) ?
|
129 |
+
$_POST['_foogallery_settings'] : array();
|
130 |
+
|
131 |
+
$settings = apply_filters( 'foogallery_save_album_settings', $settings );
|
132 |
+
|
133 |
+
update_post_meta( $post_id, FOOGALLERY_META_SETTINGS_OLD, $settings );
|
134 |
+
|
135 |
+
$custom_css = isset($_POST[FOOGALLERY_META_CUSTOM_CSS]) ?
|
136 |
+
$_POST[FOOGALLERY_META_CUSTOM_CSS] : '';
|
137 |
+
|
138 |
+
if ( empty( $custom_css ) ) {
|
139 |
+
delete_post_meta( $post_id, FOOGALLERY_META_CUSTOM_CSS );
|
140 |
+
} else {
|
141 |
+
update_post_meta( $post_id, FOOGALLERY_META_CUSTOM_CSS, $custom_css );
|
142 |
+
}
|
143 |
+
|
144 |
+
do_action( 'foogallery_after_save_album', $post_id, $_POST );
|
145 |
+
}
|
146 |
+
}
|
147 |
+
|
148 |
+
public function get_ordered_galleries( $album ) {
|
149 |
+
|
150 |
+
//get all other galleries
|
151 |
+
$galleries = foogallery_get_all_galleries( $album->gallery_ids );
|
152 |
+
|
153 |
+
$album_galleries = $album->galleries();
|
154 |
+
|
155 |
+
return array_merge( $album_galleries, $galleries );
|
156 |
+
}
|
157 |
+
|
158 |
+
public function render_gallery_metabox( $post ) {
|
159 |
+
$album = $this->get_album( $post );
|
160 |
+
|
161 |
+
$galleries = $this->get_ordered_galleries( $album );
|
162 |
+
|
163 |
+
wp_enqueue_style( 'media-views' );
|
164 |
+
|
165 |
+
?>
|
166 |
+
<input type="hidden" name="<?php echo FOOGALLERY_CPT_ALBUM; ?>_nonce"
|
167 |
+
id="<?php echo FOOGALLERY_CPT_ALBUM; ?>_nonce"
|
168 |
+
value="<?php echo wp_create_nonce( plugin_basename( FOOGALLERY_FILE ) ); ?>"/>
|
169 |
+
<input type="hidden" name='foogallery_album_galleries' id="foogallery_album_galleries"
|
170 |
+
value="<?php echo $album->gallery_id_csv(); ?>"/>
|
171 |
+
<div>
|
172 |
+
<?php if ( !$album->has_galleries() ) { ?>
|
173 |
+
<div class="foogallery-album-error">
|
174 |
+
<?php _e( 'There are no galleries selected for your album yet! Click any gallery to add it to your album.', 'foogallery' ); ?>
|
175 |
+
</div>
|
176 |
+
<?php } ?>
|
177 |
+
|
178 |
+
<div class="foogallery-album-info-modal media-modal">
|
179 |
+
<div class="media-modal-content">
|
180 |
+
<div class="media-frame mode-select">
|
181 |
+
<div class="media-frame-title">
|
182 |
+
<h1><?php _e('Edit Gallery Details', 'foogallery'); ?></h1>
|
183 |
+
<span class="spinner is-active"></span>
|
184 |
+
</div>
|
185 |
+
<div class="modal-content">
|
186 |
+
<?php wp_nonce_field( 'foogallery_album_gallery_details', 'foogallery_album_gallery_details_nonce', false ); ?>
|
187 |
+
<div class="gallery-details" data-loading="<?php _e( 'Loading details for ', 'foogallery' ); ?>"></div>
|
188 |
+
</div>
|
189 |
+
</div>
|
190 |
+
<div class="media-frame-toolbar">
|
191 |
+
<div class="media-toolbar">
|
192 |
+
<div class="media-toolbar-secondary"></div>
|
193 |
+
<div class="media-toolbar-primary search-form">
|
194 |
+
<button type="button" class="button media-button button-primary button-large media-button-select gallery-details-save"><?php _e('Save Gallery Details', 'foogallery'); ?></button>
|
195 |
+
<span class="spinner"></span>
|
196 |
+
</div>
|
197 |
+
</div>
|
198 |
+
</div>
|
199 |
+
</div>
|
200 |
+
<button type="button" class="button-link media-modal-close">
|
201 |
+
<span class="media-modal-icon"><span class="screen-reader-text"><?php _e('Close media panel', 'foogallery'); ?></span></span>
|
202 |
+
</button>
|
203 |
+
|
204 |
+
</div>
|
205 |
+
<div class="foogallery-album-info-modal-backdrop media-modal-backdrop"></div>
|
206 |
+
|
207 |
+
|
208 |
+
<ul class="foogallery-album-gallery-list">
|
209 |
+
<?php
|
210 |
+
foreach ( $galleries as $gallery ) {
|
211 |
+
$img_src = foogallery_find_featured_attachment_thumbnail_src( $gallery );
|
212 |
+
$images = $gallery->image_count();
|
213 |
+
$selected = $album->includes_gallery( $gallery->ID ) ? ' selected' : '';
|
214 |
+
$title = $gallery->safe_name();
|
215 |
+
?>
|
216 |
+
<li class="foogallery-pile">
|
217 |
+
<div class="foogallery-gallery-select attachment-preview landscape<?php echo $selected; ?>" data-foogallery-id="<?php echo $gallery->ID; ?>">
|
218 |
+
<div class="thumbnail" style="display: table;">
|
219 |
+
<div style="display: table-cell; vertical-align: middle; text-align: center;">
|
220 |
+
<img src="<?php echo $img_src; ?>"/>
|
221 |
+
<h3><?php echo $title; ?>
|
222 |
+
<span><?php echo $images; ?></span>
|
223 |
+
</h3>
|
224 |
+
</div>
|
225 |
+
</div>
|
226 |
+
<a class="info foogallery-album-info" href="#"
|
227 |
+
title="<?php _e( 'Edit Album Info', 'foogallery' ); ?>"
|
228 |
+
data-gallery-title="<?php echo $title; ?>"
|
229 |
+
data-gallery-id="<?php echo $gallery->ID; ?>"><span class="dashicons dashicons-info"></span></a>
|
230 |
+
</div>
|
231 |
+
</li>
|
232 |
+
<?php } ?>
|
233 |
+
</ul>
|
234 |
+
<div style="clear: both;"></div>
|
235 |
+
</div>
|
236 |
+
<?php
|
237 |
+
}
|
238 |
+
|
239 |
+
public function render_shortcode_metabox( $post ) {
|
240 |
+
$album = $this->get_album( $post );
|
241 |
+
$shortcode = $album->shortcode();
|
242 |
+
?>
|
243 |
+
<p class="foogallery-shortcode">
|
244 |
+
<input type="text" id="foogallery-copy-shortcode" size="<?php echo strlen( $shortcode ); ?>" value="<?php echo htmlspecialchars( $shortcode ); ?>" readonly="readonly" />
|
245 |
+
</p>
|
246 |
+
<p>
|
247 |
+
<?php _e( 'Paste the above shortcode into a post or page to show the album.', 'foogallery' ); ?>
|
248 |
+
</p>
|
249 |
+
<script>
|
250 |
+
jQuery(function($) {
|
251 |
+
var shortcodeInput = document.querySelector('#foogallery-copy-shortcode');
|
252 |
+
shortcodeInput.addEventListener('click', function () {
|
253 |
+
try {
|
254 |
+
// select the contents
|
255 |
+
shortcodeInput.select();
|
256 |
+
//copy the selection
|
257 |
+
document.execCommand('copy');
|
258 |
+
//show the copied message
|
259 |
+
$('.foogallery-shortcode-message').remove();
|
260 |
+
$(shortcodeInput).after('<p class="foogallery-shortcode-message"><?php _e( 'Shortcode copied to clipboard :)','foogallery' ); ?></p>');
|
261 |
+
} catch(err) {
|
262 |
+
console.log('Oops, unable to copy!');
|
263 |
+
}
|
264 |
+
}, false);
|
265 |
+
});
|
266 |
+
</script>
|
267 |
+
<?php
|
268 |
+
}
|
269 |
+
|
270 |
+
public function render_sorting_metabox( $post ) {
|
271 |
+
$album = $this->get_album( $post );
|
272 |
+
$sorting_options = foogallery_sorting_options(); ?>
|
273 |
+
<p>
|
274 |
+
<?php _e('Change the way galleries are sorted within your album. By default, they are sorted in the order you see them.', 'foogallery'); ?>
|
275 |
+
</p>
|
276 |
+
<?php
|
277 |
+
foreach ( $sorting_options as $sorting_key => $sorting_label ) { ?>
|
278 |
+
<p>
|
279 |
+
<input type="radio" value="<?php echo $sorting_key; ?>" <?php checked( $sorting_key === $album->sorting ); ?> id="FooGallerySettings_AlbumSort_<?php echo $sorting_key; ?>" name="<?php echo FOOGALLERY_ALBUM_META_SORT; ?>" />
|
280 |
+
<label for="FooGallerySettings_AlbumSort_<?php echo $sorting_key; ?>"><?php echo $sorting_label; ?></label>
|
281 |
+
</p><?php
|
282 |
+
}
|
283 |
+
}
|
284 |
+
|
285 |
+
public function render_settings_metabox( $post ) {
|
286 |
+
$album = $this->get_album( $post );
|
287 |
+
$available_templates = foogallery_album_templates();
|
288 |
+
$album_template = foogallery_default_album_template();
|
289 |
+
if ( ! empty($album->album_template) ) {
|
290 |
+
$album_template = $album->album_template;
|
291 |
+
}
|
292 |
+
if ( false === $album_template ) {
|
293 |
+
$album_template = $available_templates[0]['slug'];
|
294 |
+
}
|
295 |
+
$hide_help = 'on' == foogallery_get_setting( 'hide_gallery_template_help' );
|
296 |
+
?>
|
297 |
+
<table class="foogallery-album-metabox-settings">
|
298 |
+
<tbody>
|
299 |
+
<tr class="foogallery_template_field foogallery_template_field_selector">
|
300 |
+
<th>
|
301 |
+
<label for="FooGallerySettings_AlbumTemplate"><?php _e( 'Album Template', 'foogallery' ); ?></label>
|
302 |
+
</th>
|
303 |
+
<td>
|
304 |
+
<select id="FooGallerySettings_AlbumTemplate" name="<?php echo FOOGALLERY_ALBUM_META_TEMPLATE; ?>">
|
305 |
+
<?php
|
306 |
+
foreach ( $available_templates as $template ) {
|
307 |
+
$selected = ($album_template === $template['slug']) ? 'selected' : '';
|
308 |
+
echo "<option {$selected} value=\"{$template['slug']}\">{$template['name']}</option>";
|
309 |
+
}
|
310 |
+
?>
|
311 |
+
</select>
|
312 |
+
<br />
|
313 |
+
<small><?php _e( 'The album template that will be used when the album is output to the frontend.', 'foogallery' ); ?></small>
|
314 |
+
</td>
|
315 |
+
</tr>
|
316 |
+
<?php
|
317 |
+
foreach ( $available_templates as $template ) {
|
318 |
+
$field_visibility = ($album_template !== $template['slug']) ? 'style="display:none"' : '';
|
319 |
+
$section = '';
|
320 |
+
$fields = isset( $template['fields'] ) ? $template['fields'] : array();
|
321 |
+
foreach ( $fields as $field ) {
|
322 |
+
//allow for the field to be altered by extensions.
|
323 |
+
$field = apply_filters( 'foogallery_alter_gallery_template_field', $field, $album );
|
324 |
+
|
325 |
+
$class ="foogallery_template_field foogallery_template_field-{$template['slug']} foogallery_template_field-{$template['slug']}-{$field['id']}";
|
326 |
+
|
327 |
+
if ( isset($field['section']) && $field['section'] !== $section ) {
|
328 |
+
$section = $field['section'];
|
329 |
+
?>
|
330 |
+
<tr class="<?php echo $class; ?>" <?php echo $field_visibility; ?>>
|
331 |
+
<td colspan="2"><h4><?php echo $section; ?></h4></td>
|
332 |
+
</tr>
|
333 |
+
<?php }
|
334 |
+
if (isset($field['type']) && 'help' == $field['type'] && $hide_help) {
|
335 |
+
continue; //skip help if the 'hide help' setting is turned on
|
336 |
+
}
|
337 |
+
?>
|
338 |
+
<tr class="<?php echo $class; ?>" <?php echo $field_visibility; ?>>
|
339 |
+
<?php if ( isset($field['type']) && 'help' == $field['type'] ) { ?>
|
340 |
+
<td colspan="2">
|
341 |
+
<div class="foogallery-help">
|
342 |
+
<?php echo $field['desc']; ?>
|
343 |
+
</div>
|
344 |
+
</td>
|
345 |
+
<?php } else { ?>
|
346 |
+
<th>
|
347 |
+
<label for="FooGallerySettings_<?php echo $template['slug'] . '_' . $field['id']; ?>"><?php echo $field['title']; ?></label>
|
348 |
+
</th>
|
349 |
+
<td>
|
350 |
+
<?php do_action( 'foogallery_render_gallery_template_field', $field, $album, $template ); ?>
|
351 |
+
</td>
|
352 |
+
<?php } ?>
|
353 |
+
</tr>
|
354 |
+
<?php
|
355 |
+
}
|
356 |
+
}
|
357 |
+
?>
|
358 |
+
</tbody>
|
359 |
+
</table>
|
360 |
+
<?php
|
361 |
+
}
|
362 |
+
|
363 |
+
public function render_customcss_metabox( $post ) {
|
364 |
+
$album = $this->get_album( $post );
|
365 |
+
$custom_css = $album->custom_css;
|
366 |
+
$example = '<code>#foogallery-album-' . $post->ID . ' { }</code>';
|
367 |
+
?>
|
368 |
+
<p>
|
369 |
+
<?php printf( __( 'Add any custom CSS to target this specific album. For example %s', 'foogallery' ), $example ); ?>
|
370 |
+
</p>
|
371 |
+
<table id="table_styling" class="form-table">
|
372 |
+
<tbody>
|
373 |
+
<tr>
|
374 |
+
<td>
|
375 |
+
<textarea class="foogallery_metabox_custom_css" name="<?php echo FOOGALLERY_META_CUSTOM_CSS; ?>" type="text"><?php echo $custom_css; ?></textarea>
|
376 |
+
</td>
|
377 |
+
</tr>
|
378 |
+
</tbody>
|
379 |
+
</table>
|
380 |
+
<?php
|
381 |
+
}
|
382 |
+
|
383 |
+
public function include_required_scripts() {
|
384 |
+
if ( FOOGALLERY_CPT_ALBUM === foo_current_screen_post_type() ) {
|
385 |
+
//include album selection script
|
386 |
+
$url = FOOGALLERY_ALBUM_URL . 'js/admin-foogallery-album.js';
|
387 |
+
wp_enqueue_script( 'admin-foogallery-album', $url, array( 'jquery', 'jquery-ui-core','jquery-ui-sortable' ), FOOGALLERY_VERSION );
|
388 |
+
|
389 |
+
//include album selection css
|
390 |
+
$url = FOOGALLERY_ALBUM_URL . 'css/admin-foogallery-album.css';
|
391 |
+
wp_enqueue_style( 'admin-foogallery-album', $url, array(), FOOGALLERY_VERSION );
|
392 |
+
|
393 |
+
//spectrum needed for the colorpicker field
|
394 |
+
$url = FOOGALLERY_URL . 'lib/spectrum/spectrum.js';
|
395 |
+
wp_enqueue_script( 'foogallery-spectrum', $url, array('jquery'), FOOGALLERY_VERSION );
|
396 |
+
$url = FOOGALLERY_URL . 'lib/spectrum/spectrum.css';
|
397 |
+
wp_enqueue_style( 'foogallery-spectrum', $url, array(), FOOGALLERY_VERSION );
|
398 |
+
}
|
399 |
+
}
|
400 |
+
|
401 |
+
public function ajax_get_gallery_details() {
|
402 |
+
if ( check_admin_referer( 'foogallery_album_gallery_details' ) ) {
|
403 |
+
$foogallery_id = $_POST['foogallery_id'];
|
404 |
+
$gallery = FooGallery::get_by_id( $foogallery_id );
|
405 |
+
|
406 |
+
if ( false !== $gallery ) {
|
407 |
+
$fields = $this->get_gallery_detail_fields( $gallery ); ?>
|
408 |
+
<form name="foogallery_gallery_details">
|
409 |
+
<input type="hidden" name="foogallery_id" id="foogallery_id" value="<?php echo $foogallery_id; ?>" />
|
410 |
+
<table class="gallery-detail-fields">
|
411 |
+
<tbody>
|
412 |
+
<?php foreach ( $fields as $field => $values ) {
|
413 |
+
$value = get_post_meta( $gallery->ID, $field, true );
|
414 |
+
$input_id = 'foogallery-gallery-detail-fields-' . $field;
|
415 |
+
switch ( $values['input'] ) {
|
416 |
+
case 'text':
|
417 |
+
$values['html'] = '<input type="text" id="' . $input_id . '" name="' . $field . '" value="' . $value . '" />';
|
418 |
+
break;
|
419 |
+
|
420 |
+
case 'textarea':
|
421 |
+
$values['html'] = '<textarea id="' . $input_id . '" name="' . $field . '">' . $value . '</textarea>';
|
422 |
+
break;
|
423 |
+
|
424 |
+
case 'select':
|
425 |
+
$html = '<select id="' . $input_id . '" name="' . $field . '">';
|
426 |
+
|
427 |
+
// If options array is passed
|
428 |
+
if ( isset( $values['options'] ) ) {
|
429 |
+
// Browse and add the options
|
430 |
+
foreach ( $values['options'] as $k => $v ) {
|
431 |
+
// Set the option selected or not
|
432 |
+
if ( $value == $k )
|
433 |
+
$selected = ' selected="selected"';
|
434 |
+
else
|
435 |
+
$selected = '';
|
436 |
+
|
437 |
+
$html .= '<option' . $selected . ' value="' . $k . '">' . $v . '</option>';
|
438 |
+
}
|
439 |
+
}
|
440 |
+
|
441 |
+
$html .= '</select>';
|
442 |
+
|
443 |
+
// Set the html content
|
444 |
+
$values['html'] = $html;
|
445 |
+
|
446 |
+
break;
|
447 |
+
|
448 |
+
case 'checkbox':
|
449 |
+
// Set the checkbox checked or not
|
450 |
+
if ( $value == 'on' )
|
451 |
+
$checked = ' checked="checked"';
|
452 |
+
else
|
453 |
+
$checked = '';
|
454 |
+
|
455 |
+
$html = '<input' . $checked . ' type="checkbox" name="' . $field . ']" id="' . $input_id . '" />';
|
456 |
+
|
457 |
+
$values['html'] = $html;
|
458 |
+
|
459 |
+
break;
|
460 |
+
|
461 |
+
case 'radio':
|
462 |
+
$html = '';
|
463 |
+
|
464 |
+
if ( ! empty( $values['options'] ) ) {
|
465 |
+
$i = 0;
|
466 |
+
|
467 |
+
foreach ( $values['options'] as $k => $v ) {
|
468 |
+
if ( $value == $k )
|
469 |
+
$checked = ' checked="checked"';
|
470 |
+
else
|
471 |
+
$checked = '';
|
472 |
+
|
473 |
+
$html .= '<input' . $checked . ' value="' . $k . '" type="radio" name="' . $field . ']" id="' . sanitize_key( $field . '_' . $i ) . '" /> <label for="' . sanitize_key( $field . '_' . $i ) . '">' . $v . '</label><br />';
|
474 |
+
$i++;
|
475 |
+
}
|
476 |
+
}
|
477 |
+
|
478 |
+
$values['html'] = $html;
|
479 |
+
|
480 |
+
break;
|
481 |
+
} ?>
|
482 |
+
<tr class="foogallery-gallery-detail-fields-<?php echo $field; ?>">
|
483 |
+
<th scope="row" class="label">
|
484 |
+
<label for="foogallery-gallery-detail-fields-<?php echo $field; ?>"><?php echo $values['label']; ?></label>
|
485 |
+
</th>
|
486 |
+
<td>
|
487 |
+
<?php echo $values['html']; ?>
|
488 |
+
<?php if ( !empty( $values['help'] ) ) { ?><p class="help"><?php echo $values['help']; ?></p><?php } ?>
|
489 |
+
</td>
|
490 |
+
</tr>
|
491 |
+
<?php } ?>
|
492 |
+
</tbody>
|
493 |
+
</table>
|
494 |
+
</form><?php
|
495 |
+
} else {
|
496 |
+
echo '<h2>' . __( 'Invalid Gallery!', 'foogallery' ) . '</h2>';
|
497 |
+
}
|
498 |
+
}
|
499 |
+
die();
|
500 |
+
}
|
501 |
+
|
502 |
+
public function ajax_save_gallery_details() {
|
503 |
+
if ( check_admin_referer( 'foogallery_album_gallery_details' ) ) {
|
504 |
+
$foogallery_id = $_POST['foogallery_id'];
|
505 |
+
$gallery = FooGallery::get_by_id( $foogallery_id );
|
506 |
+
if ( false !== $gallery ) {
|
507 |
+
$fields = $this->get_gallery_detail_fields( $gallery );
|
508 |
+
|
509 |
+
foreach ( $fields as $field => $values ) {
|
510 |
+
//for every field, save some info
|
511 |
+
do_action( 'foogallery_album_gallery_details_save', $field, $values, $gallery );
|
512 |
+
}
|
513 |
+
}
|
514 |
+
}
|
515 |
+
}
|
516 |
+
|
517 |
+
public function gallery_details_save($field, $field_args, $gallery) {
|
518 |
+
if ( 'custom_url' === $field || 'custom_target' === $field ) {
|
519 |
+
$value = $_POST[$field];
|
520 |
+
update_post_meta( $gallery->ID, $field, $value );
|
521 |
+
}
|
522 |
+
}
|
523 |
+
|
524 |
+
/**
|
525 |
+
* Get the fields that we want to edit for a gallery from the album management page
|
526 |
+
* @param $gallery FooGallery
|
527 |
+
*
|
528 |
+
* @return mixed|void
|
529 |
+
*/
|
530 |
+
public function get_gallery_detail_fields($gallery) {
|
531 |
+
|
532 |
+
$target_options = apply_filters( 'foogallery_gallery_detail_fields_custom_target_options', array(
|
533 |
+
'default' => __( 'Default', 'foogallery' ),
|
534 |
+
'_blank' => __( 'New tab (_blank)', 'foogallery' ),
|
535 |
+
'_self' => __( 'Same tab (_self)', 'foogallery' )
|
536 |
+
) );
|
537 |
+
|
538 |
+
$edit_url = get_edit_post_link( $gallery->ID );
|
539 |
+
|
540 |
+
$fields = array(
|
541 |
+
'gallery_title' => array(
|
542 |
+
'label' => __( 'Gallery Title', 'foogallery' ),
|
543 |
+
'input' => 'html',
|
544 |
+
'html' => '<strong>' . $gallery->safe_name() . ' <a href="' . $edit_url . '" target="_blank">' . __( 'Edit Gallery', 'foogallery' ) . '</a></strong>',
|
545 |
+
),
|
546 |
+
|
547 |
+
'gallery_template' => array(
|
548 |
+
'label' => __( 'Gallery Template', 'foogallery' ),
|
549 |
+
'input' => 'html',
|
550 |
+
'html' => '<strong>' . $gallery->gallery_template_name() . '</strong>',
|
551 |
+
),
|
552 |
+
|
553 |
+
'gallery_media' => array(
|
554 |
+
'label' => __( 'Media', 'foogallery' ),
|
555 |
+
'input' => 'html',
|
556 |
+
'html' => '<strong>' . $gallery->image_count() . '</strong>'
|
557 |
+
),
|
558 |
+
|
559 |
+
'custom_url' => array(
|
560 |
+
'label' => __( 'Custom URL', 'foogallery' ),
|
561 |
+
'input' => 'text',
|
562 |
+
'help' => __( 'Point your gallery to a custom URL', 'foogallery' )
|
563 |
+
),
|
564 |
+
|
565 |
+
'custom_target' => array(
|
566 |
+
'label' => __( 'Custom Target', 'foogallery' ),
|
567 |
+
'input' => 'select',
|
568 |
+
'help' => __( 'Set a custom target for your gallery', 'foogallery' ),
|
569 |
+
'options' => $target_options
|
570 |
+
)
|
571 |
+
);
|
572 |
+
|
573 |
+
return apply_filters( 'foogallery_gallery_detail_fields', $fields );
|
574 |
+
}
|
575 |
+
}
|
576 |
+
}
|
extensions/albums/admin/index.php
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<?php // Silence is golden
|
extensions/albums/album-default.php
ADDED
@@ -0,0 +1,81 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* FooGallery default responsive album template
|
4 |
+
*/
|
5 |
+
global $current_foogallery_album;
|
6 |
+
global $current_foogallery_album_arguments;
|
7 |
+
$gallery = foogallery_album_get_current_gallery();
|
8 |
+
$alignment = foogallery_album_template_setting( 'alignment', 'alignment-left' );
|
9 |
+
$foogallery = false;
|
10 |
+
|
11 |
+
if ( !empty( $gallery ) ) {
|
12 |
+
$foogallery = FooGallery::get_by_slug( $gallery );
|
13 |
+
|
14 |
+
//check to see if the gallery belongs to the album
|
15 |
+
if ( !$current_foogallery_album->includes_gallery( $foogallery->ID ) ) {
|
16 |
+
$foogallery = false;
|
17 |
+
}
|
18 |
+
}
|
19 |
+
|
20 |
+
if ( false !== $foogallery ) {
|
21 |
+
$album_url = foogallery_album_remove_gallery_from_link();
|
22 |
+
echo '<div id="' . $current_foogallery_album->slug . '" class="foogallery-album-header">';
|
23 |
+
echo '<p><a href="' . esc_url( $album_url ) . '">' . foogallery_get_setting( 'language_back_to_album_text', __( '« back to album', 'foogallery' ) ) . '</a></p>';
|
24 |
+
echo '<h2>' . $foogallery->name . '</h2>';
|
25 |
+
echo apply_filters('foogallery_album_default_gallery_content', '', $foogallery);
|
26 |
+
echo '</div>';
|
27 |
+
echo do_shortcode('[foogallery id="' . $foogallery->ID . '"]');
|
28 |
+
} else {
|
29 |
+
$title_bg = foogallery_album_template_setting( 'title_bg', '#ffffff' );
|
30 |
+
$title_font_color = foogallery_album_template_setting( 'title_font_color', '#000000' );
|
31 |
+
$args = foogallery_album_template_setting( 'thumbnail_dimensions', array() );
|
32 |
+
if ( !empty( $title_bg ) || !empty( $title_font_color ) ) {
|
33 |
+
echo '<style type="text/css">';
|
34 |
+
if ( !empty( $title_bg ) ) {
|
35 |
+
echo '.foogallery-album-gallery-list .foogallery-pile h3 { background: ' . $title_bg . ' !important; }';
|
36 |
+
}
|
37 |
+
if ( !empty( $title_font_color ) ) {
|
38 |
+
echo '.foogallery-album-gallery-list .foogallery-pile h3 { color: ' . $title_font_color . ' !important; }';
|
39 |
+
}
|
40 |
+
echo '</style>';
|
41 |
+
}
|
42 |
+
?>
|
43 |
+
<div id="foogallery-album-<?php echo $current_foogallery_album->ID; ?>">
|
44 |
+
<ul class="foogallery-album-gallery-list <?php echo $alignment; ?>">
|
45 |
+
<?php
|
46 |
+
foreach ( $current_foogallery_album->galleries() as $gallery ) {
|
47 |
+
if (!empty($gallery->attachment_ids)) {
|
48 |
+
$attachment = $gallery->featured_attachment();
|
49 |
+
|
50 |
+
if ( false === $attachment ) continue;
|
51 |
+
|
52 |
+
$img_html = $attachment->html_img( $args );
|
53 |
+
$images = $gallery->image_count();
|
54 |
+
$gallery_link = foogallery_album_build_gallery_link( $current_foogallery_album, $gallery );
|
55 |
+
$gallery_link_target = foogallery_album_build_gallery_link_target( $current_foogallery_album, $gallery );
|
56 |
+
?>
|
57 |
+
<li>
|
58 |
+
<div class="foogallery-pile">
|
59 |
+
<div class="foogallery-pile-inner">
|
60 |
+
<a href="<?php echo esc_url( $gallery_link ); ?>" target="<?php echo $gallery_link_target; ?>">
|
61 |
+
<?php echo $img_html; ?>
|
62 |
+
<?php
|
63 |
+
|
64 |
+
$title = empty( $gallery->name ) ?
|
65 |
+
sprintf( __( '%s #%s', 'foogallery' ), foogallery_plugin_name(), $gallery->ID ) :
|
66 |
+
$gallery->name;
|
67 |
+
|
68 |
+
?>
|
69 |
+
<h3><?php echo $title; ?>
|
70 |
+
<span><?php echo $images; ?></span>
|
71 |
+
</h3>
|
72 |
+
</a>
|
73 |
+
</div>
|
74 |
+
</div>
|
75 |
+
</li>
|
76 |
+
<?php } ?>
|
77 |
+
<?php } ?>
|
78 |
+
</ul>
|
79 |
+
<div style="clear: both;"></div>
|
80 |
+
</div>
|
81 |
+
<?php }
|
extensions/albums/album-stack.php
ADDED
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* FooGallery All-In-One Stack Album template
|
4 |
+
*/
|
5 |
+
global $current_foogallery_album;
|
6 |
+
global $current_foogallery_album_arguments;
|
7 |
+
$args = foogallery_album_template_setting( 'thumbnail_dimensions', array() );
|
8 |
+
$lightbox = foogallery_album_template_setting( 'lightbox', 'unknown' );
|
9 |
+
$random_angle = foogallery_album_template_setting( 'random_angle', 'false' );
|
10 |
+
$gutter = foogallery_album_template_setting( 'gutter', '40' );
|
11 |
+
$delay = foogallery_album_template_setting( 'delay', '0' );
|
12 |
+
$pile_angles = foogallery_album_template_setting( 'pile_angles', '2' );
|
13 |
+
?>
|
14 |
+
<div id="foogallery-album-<?php echo $current_foogallery_album->ID; ?>" class="foogallery-container foogallery-stack-album">
|
15 |
+
<div class="topbar">
|
16 |
+
<span id="foogallery-stack-album-back-<?php echo $current_foogallery_album->ID; ?>" class="back">←</span>
|
17 |
+
<h2><?php echo $current_foogallery_album->name; ?></h2><h3 id="foogallery-stack-album-gallery-<?php echo $current_foogallery_album->ID; ?>"></h3>
|
18 |
+
</div>
|
19 |
+
<ul id="foogallery-stack-album-<?php echo $current_foogallery_album->ID; ?>" class="tp-grid">
|
20 |
+
<?php
|
21 |
+
foreach ( $current_foogallery_album->galleries() as $gallery ) {
|
22 |
+
foreach ( $gallery->attachments() as $attachment ) {
|
23 |
+
echo '<li data-pile="'. esc_attr($gallery->name) . '">';
|
24 |
+
$args['link_attributes']['rel'] = 'gallery[' . $gallery->ID . ']';
|
25 |
+
$args['link_attributes']['class'] = apply_filters( 'foogallery_album_stack_link_class_name', $lightbox );
|
26 |
+
echo $attachment->html( $args, false, false );
|
27 |
+
if ( $attachment->caption ) {
|
28 |
+
echo '<span class="tp-info"><span>' . wp_filter_nohtml_kses( $attachment->caption ) . '</span></span>';
|
29 |
+
}
|
30 |
+
echo $attachment->html_img( $args );
|
31 |
+
echo '</a>';
|
32 |
+
echo '</li>';
|
33 |
+
}
|
34 |
+
}
|
35 |
+
?>
|
36 |
+
</ul>
|
37 |
+
</div>
|
38 |
+
<script type="text/javascript">
|
39 |
+
jQuery(function($) {
|
40 |
+
|
41 |
+
var $grid = $( '#foogallery-stack-album-<?php echo $current_foogallery_album->ID; ?>' ),
|
42 |
+
$name = $( '#foogallery-stack-album-gallery-<?php echo $current_foogallery_album->ID; ?>' ),
|
43 |
+
$close = $( '#foogallery-stack-album-back-<?php echo $current_foogallery_album->ID; ?>' ),
|
44 |
+
$loader = $( '<div class="loader"><i></i><i></i><i></i><i></i><i></i><i></i></div>' ).insertBefore( $grid ),
|
45 |
+
stapel = $grid.stapel( {
|
46 |
+
delay : <?php echo $delay; ?>,
|
47 |
+
randomAngle : <?php echo $random_angle; ?>,
|
48 |
+
gutter : <?php echo $gutter; ?>,
|
49 |
+
pileAngles : <?php echo $pile_angles; ?>,
|
50 |
+
onLoad : function() {
|
51 |
+
$loader.remove();
|
52 |
+
},
|
53 |
+
onBeforeOpen : function( pileName ) {
|
54 |
+
$name.html( pileName );
|
55 |
+
},
|
56 |
+
onAfterOpen : function( pileName ) {
|
57 |
+
$close.show();
|
58 |
+
}
|
59 |
+
} );
|
60 |
+
|
61 |
+
$close.on( 'click', function() {
|
62 |
+
$close.hide();
|
63 |
+
$name.empty();
|
64 |
+
stapel.closePile();
|
65 |
+
} );
|
66 |
+
} );
|
67 |
+
</script>
|
extensions/albums/class-albums-extension.php
ADDED
@@ -0,0 +1,111 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( ! class_exists( 'FooGallery_Albums_Extension' ) ) {
|
3 |
+
|
4 |
+
define( 'FOOGALLERY_ALBUM_PATH', plugin_dir_path( __FILE__ ) );
|
5 |
+
define( 'FOOGALLERY_ALBUM_URL', plugin_dir_url( __FILE__ ) );
|
6 |
+
define( 'FOOGALLERY_CPT_ALBUM', 'foogallery-album' );
|
7 |
+
define( 'FOOGALLERY_ALBUM_META_GALLERIES', 'foogallery_album_galleries' );
|
8 |
+
define( 'FOOGALLERY_ALBUM_META_TEMPLATE', 'foogallery_album_template' );
|
9 |
+
define( 'FOOGALLERY_ALBUM_META_SORT', 'foogallery_album_sort' );
|
10 |
+
|
11 |
+
class FooGallery_Albums_Extension {
|
12 |
+
|
13 |
+
function __construct() {
|
14 |
+
$this->includes();
|
15 |
+
|
16 |
+
new FooGallery_Album_Rewrite_Rules();
|
17 |
+
new FooGallery_Albums_PostTypes();
|
18 |
+
|
19 |
+
if ( is_admin() ) {
|
20 |
+
new FooGallery_Albums_Admin_Columns();
|
21 |
+
new FooGallery_Admin_Album_MetaBoxes();
|
22 |
+
|
23 |
+
//add language settings
|
24 |
+
add_filter( 'foogallery_admin_settings_override', array( $this, 'include_album_language_settings' ) );
|
25 |
+
|
26 |
+
//add some global settings for albums
|
27 |
+
add_filter( 'foogallery_admin_settings_override', array($this, 'add_album_settings' ) );
|
28 |
+
|
29 |
+
add_action( 'foogallery_uninstall', array($this, 'uninstall' ) );
|
30 |
+
|
31 |
+
} else {
|
32 |
+
|
33 |
+
new FooGallery_Album_Template_Loader();
|
34 |
+
new FooGallery_Album_Shortcodes();
|
35 |
+
}
|
36 |
+
add_filter( 'foogallery_album_templates_files', array( $this, 'register_myself' ) );
|
37 |
+
add_filter( 'foogallery_defaults', array( $this, 'apply_album_defaults' ) );
|
38 |
+
add_action( 'foogallery_extension_activated-albums', array( $this, 'flush_rewrite_rules' ) );
|
39 |
+
add_filter( 'foogallery_alter_album_template_field', array( $this, 'alter_gallery_template_field' ), 10, 2 );
|
40 |
+
}
|
41 |
+
|
42 |
+
function includes() {
|
43 |
+
require_once( FOOGALLERY_ALBUM_PATH . 'functions.php' );
|
44 |
+
require_once( FOOGALLERY_ALBUM_PATH . 'class-posttypes.php' );
|
45 |
+
require_once( FOOGALLERY_ALBUM_PATH . 'class-foogallery-album.php' );
|
46 |
+
require_once( FOOGALLERY_ALBUM_PATH . 'public/class-rewrite-rules.php' );
|
47 |
+
|
48 |
+
if ( is_admin() ) {
|
49 |
+
//only admin
|
50 |
+
require_once( FOOGALLERY_ALBUM_PATH . 'admin/class-metaboxes.php' );
|
51 |
+
require_once( FOOGALLERY_ALBUM_PATH . 'admin/class-columns.php' );
|
52 |
+
} else {
|
53 |
+
//only front-end
|
54 |
+
require_once( FOOGALLERY_ALBUM_PATH . 'public/class-shortcodes.php' );
|
55 |
+
|
56 |
+
//load Template \ Loader files
|
57 |
+
require_once( FOOGALLERY_ALBUM_PATH . 'public/class-foogallery-album-template-loader.php' );
|
58 |
+
}
|
59 |
+
}
|
60 |
+
|
61 |
+
function apply_album_defaults( $defaults ) {
|
62 |
+
$defaults['album_template'] = 'default';
|
63 |
+
|
64 |
+
return $defaults;
|
65 |
+
}
|
66 |
+
|
67 |
+
function register_myself( $extensions ) {
|
68 |
+
$extensions[] = __FILE__;
|
69 |
+
return $extensions;
|
70 |
+
}
|
71 |
+
|
72 |
+
function flush_rewrite_rules() {
|
73 |
+
$rewrite = new FooGallery_Album_Rewrite_Rules();
|
74 |
+
$rewrite->add_gallery_endpoint();
|
75 |
+
|
76 |
+
flush_rewrite_rules();
|
77 |
+
}
|
78 |
+
|
79 |
+
function include_album_language_settings( $settings ) {
|
80 |
+
$settings['settings'][] = array(
|
81 |
+
'id' => 'language_back_to_album_text',
|
82 |
+
'title' => __( 'Back To Album Text', 'foogallery' ),
|
83 |
+
'type' => 'text',
|
84 |
+
'default' => __( '« back to album', 'foogallery' ),
|
85 |
+
'tab' => 'language'
|
86 |
+
);
|
87 |
+
|
88 |
+
return $settings;
|
89 |
+
}
|
90 |
+
|
91 |
+
function add_album_settings( $settings ) {
|
92 |
+
|
93 |
+
$settings['tabs']['albums'] = __( 'Albums', 'foogallery' );
|
94 |
+
|
95 |
+
$settings['settings'][] = array(
|
96 |
+
'id' => 'album_gallery_slug',
|
97 |
+
'title' => __( 'Gallery Slug', 'foogallery' ),
|
98 |
+
'type' => 'text',
|
99 |
+
'default' => 'gallery',
|
100 |
+
'desc' => __( 'The slug that is used when generating gallery URL\'s for albums. PLEASE NOTE : if you change this value, you might need to save your Permalinks again.', 'foogallery' ),
|
101 |
+
'tab' => 'albums'
|
102 |
+
);
|
103 |
+
|
104 |
+
return $settings;
|
105 |
+
}
|
106 |
+
|
107 |
+
function uninstall() {
|
108 |
+
foogallery_album_uninstall();
|
109 |
+
}
|
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Class FooGalleryAlbum
|
5 |
+
*
|
6 |
+
* An easy to use wrapper class for a FooGallery Album post
|
7 |
+
*/
|
8 |
+
class FooGalleryAlbum extends stdClass {
|
9 |
+
|
10 |
+
/**
|
11 |
+
* private constructor
|
12 |
+
*
|
13 |
+
* @param null $post
|
14 |
+
*/
|
15 |
+
private function __construct( $post = null ) {
|
16 |
+
$this->set_defaults();
|
17 |
+
|
18 |
+
if ( $post !== null ) {
|
19 |
+
$this->load( $post );
|
20 |
+
}
|
21 |
+
}
|
22 |
+
|
23 |
+
/**
|
24 |
+
* Sets the default when a new album is instantiated
|
25 |
+
*/
|
26 |
+
private function set_defaults() {
|
27 |
+
$this->_post = null;
|
28 |
+
$this->ID = 0;
|
29 |
+
$this->gallery_ids = array();
|
30 |
+
$this->_galleries = false;
|
31 |
+
}
|
32 |
+
|
33 |
+
/**
|
34 |
+
* private gallery load function
|
35 |
+
* @param $post
|
36 |
+
*/
|
37 |
+
private function load( $post ) {
|
38 |
+
$this->_post = $post;
|
39 |
+
$this->ID = $post->ID;
|
40 |
+
$this->slug = $post->post_name;
|
41 |
+
$this->name = $post->post_title;
|
42 |
+
$this->author = $post->post_author;
|
43 |
+
$this->post_status = $post->post_status;
|
44 |
+
$album_meta = get_post_meta( $this->ID, FOOGALLERY_ALBUM_META_GALLERIES, true );
|
45 |
+
$this->gallery_ids = is_array( $album_meta ) ? array_filter( $album_meta ) : array();
|
46 |
+
$this->album_template = get_post_meta( $post->ID, FOOGALLERY_ALBUM_META_TEMPLATE, true );
|
47 |
+
$this->settings = get_post_meta( $post->ID, FOOGALLERY_META_SETTINGS_OLD, true );
|
48 |
+
$this->custom_css = get_post_meta( $post->ID, FOOGALLERY_META_CUSTOM_CSS, true );
|
49 |
+
$this->sorting = get_post_meta( $post->ID, FOOGALLERY_ALBUM_META_SORT, true );
|
50 |
+
do_action( 'foogallery_foogallery-album_instance_after_load', $this, $post );
|
51 |
+
}
|
52 |
+
|
53 |
+
/**
|
54 |
+
* private function to load a album by an id
|
55 |
+
* @param $post_id
|
56 |
+
*/
|
57 |
+
private function load_by_id( $post_id ) {
|
58 |
+
$post = get_post( $post_id );
|
59 |
+
if ( $post ) {
|
60 |
+
$this->load( $post );
|
61 |
+
}
|
62 |
+
}
|
63 |
+
|
64 |
+
/**
|
65 |
+
* private function to load a album by the slug.
|
66 |
+
* Will be used when loading album shortcodes
|
67 |
+
* @param $slug
|
68 |
+
*/
|
69 |
+
private function load_by_slug( $slug ) {
|
70 |
+
if ( ! empty( $slug ) ) {
|
71 |
+
$args = array(
|
72 |
+
'name' => $slug,
|
73 |
+
'numberposts' => 1,
|
74 |
+
'post_type' => FOOGALLERY_CPT_ALBUM,
|
75 |
+
);
|
76 |
+
|
77 |
+
$albums = get_posts( $args );
|
78 |
+
|
79 |
+
if ( $albums ) {
|
80 |
+
$this->load( $albums[0] );
|
81 |
+
}
|
82 |
+
}
|
83 |
+
}
|
84 |
+
|
85 |
+
/**
|
86 |
+
* Static function to load a Album instance by passing in a post object
|
87 |
+
* @static
|
88 |
+
*
|
89 |
+
* @param $post
|
90 |
+
*
|
91 |
+
* @return FooGalleryAlbum
|
92 |
+
*/
|
93 |
+
public static function get( $post ) {
|
94 |
+
return new self( $post );
|
95 |
+
}
|
96 |
+
|
97 |
+
/**
|
98 |
+
* Static function to load an Album instance by post id
|
99 |
+
*
|
100 |
+
* @param $post_id
|
101 |
+
*
|
102 |
+
* @return FooGalleryAlbum
|
103 |
+
*/
|
104 |
+
public static function get_by_id( $post_id ) {
|
105 |
+
$album = new self();
|
106 |
+
$album->load_by_id( $post_id );
|
107 |
+
if ( ! $album->does_exist() ) {
|
108 |
+
return false;
|
109 |
+
}
|
110 |
+
return $album;
|
111 |
+
}
|
112 |
+
|
113 |
+
/**
|
114 |
+
* Static function to load a album instance by passing in a album slug
|
115 |
+
*
|
116 |
+
* @param string $slug
|
117 |
+
*
|
118 |
+
* @return FooGalleryAlbum
|
119 |
+
*/
|
120 |
+
public static function get_by_slug( $slug ) {
|
121 |
+
$album = new self();
|
122 |
+
$album->load_by_slug( $slug );
|
123 |
+
if ( ! $album->does_exist() ) {
|
124 |
+
return false;
|
125 |
+
}
|
126 |
+
return $album;
|
127 |
+
}
|
128 |
+
|
129 |
+
/**
|
130 |
+
* Checks if the album has galleries
|
131 |
+
* @return bool
|
132 |
+
*/
|
133 |
+
public function has_galleries() {
|
134 |
+
return sizeof( $this->gallery_ids ) > 0;
|
135 |
+
}
|
136 |
+
|
137 |
+
/**
|
138 |
+
* Checks if the album exists
|
139 |
+
* @return bool
|
140 |
+
*/
|
141 |
+
public function does_exist() {
|
142 |
+
return $this->ID > 0;
|
143 |
+
}
|
144 |
+
|
145 |
+
/**
|
146 |
+
* Returns true if the album is published
|
147 |
+
* @return bool
|
148 |
+
*/
|
149 |
+
public function is_published() {
|
150 |
+
return $this->post_status === 'publish';
|
151 |
+
}
|
152 |
+
|
153 |
+
/**
|
154 |
+
* Get a comma separated list of gallery ids
|
155 |
+
* @return string
|
156 |
+
*/
|
157 |
+
public function gallery_id_csv() {
|
158 |
+
if ( is_array( $this->gallery_ids ) ) {
|
159 |
+
return implode( ',', $this->gallery_ids );
|
160 |
+
}
|
161 |
+
|
162 |
+
return '';
|
163 |
+
}
|
164 |
+
|
165 |
+
/**
|
166 |
+
* Lazy load the attachments for the gallery
|
167 |
+
*
|
168 |
+
* @return array
|
169 |
+
*/
|
170 |
+
public function galleries() {
|
171 |
+
//lazy load the attachments for performance
|
172 |
+
if ( $this->_galleries === false ) {
|
173 |
+
$this->_galleries = array();
|
174 |
+
|
175 |
+
if ( ! empty( $this->gallery_ids ) ) {
|
176 |
+
|
177 |
+
$gallery_query_args = apply_filters( 'foogallery_album_gallery_get_posts_args', array(
|
178 |
+
'post_type' => FOOGALLERY_CPT_GALLERY,
|
179 |
+
'posts_per_page' => -1,
|
180 |
+
'post__in' => $this->gallery_ids,
|
181 |
+
'orderby' => foogallery_sorting_get_posts_orderby_arg( $this->sorting ),
|
182 |
+
'order' => foogallery_sorting_get_posts_order_arg( $this->sorting )
|
183 |
+
) );
|
184 |
+
|
185 |
+
$galleries = get_posts( $gallery_query_args );
|
186 |
+
|
187 |
+
$this->_galleries = array_map( array( 'FooGallery', 'get' ), $galleries );
|
188 |
+
}
|
189 |
+
}
|
190 |
+
|
191 |
+
return $this->_galleries;
|
192 |
+
}
|
193 |
+
|
194 |
+
function includes_gallery( $gallery_id ) {
|
195 |
+
if ( $this->has_galleries() ) {
|
196 |
+
return in_array( $gallery_id, $this->gallery_ids );
|
197 |
+
}
|
198 |
+
return false;
|
199 |
+
}
|
200 |
+
|
201 |
+
public function gallery_count() {
|
202 |
+
$count = sizeof( $this->gallery_ids );
|
203 |
+
switch ( $count ) {
|
204 |
+
case 0:
|
205 |
+
return __( 'No galleries', 'foogallery' );
|
206 |
+
case 1:
|
207 |
+
return __( '1 gallery', 'foogallery' );
|
208 |
+
default:
|
209 |
+
return sprintf( __( '%s galleries', 'foogallery' ), $count );
|
210 |
+
}
|
211 |
+
}
|
212 |
+
|
213 |
+
/**
|
214 |
+
* Output the shortcode for the gallery
|
215 |
+
*
|
216 |
+
* @return string
|
217 |
+
*/
|
218 |
+
public function shortcode() {
|
219 |
+
return foogallery_build_album_shortcode( $this->ID );
|
220 |
+
}
|
221 |
+
|
222 |
+
function get_meta( $key, $default ) {
|
223 |
+
if ( ! is_array( $this->settings ) ) {
|
224 |
+
return $default;
|
225 |
+
}
|
226 |
+
|
227 |
+
$value = array_key_exists( $key, $this->settings ) ? $this->settings[ $key ] : null;
|
228 |
+
|
229 |
+
if ( $value === null ) {
|
230 |
+
return $default;
|
231 |
+
}
|
232 |
+
|
233 |
+
return $value;
|
234 |
+
}
|
235 |
+
|
236 |
+
function is_checked( $key, $default = false ) {
|
237 |
+
if ( ! is_array( $this->settings ) ) {
|
238 |
+
return $default;
|
239 |
+
}
|
240 |
+
|
241 |
+
return array_key_exists( $key, $this->settings );
|
242 |
+
}
|
243 |
+
|
244 |
+
public function album_template_details() {
|
245 |
+
if ( ! empty( $this->album_template ) ) {
|
246 |
+
|
247 |
+
foreach ( foogallery_album_templates() as $template ) {
|
248 |
+
if ( $this->album_template == $template['slug'] ) {
|
249 |
+
return $template;
|
250 |
+
}
|
251 |
+
}
|
252 |
+
}
|
253 |
+
|
254 |
+
return false;
|
255 |
+
}
|
256 |
+
}
|
extensions/albums/class-posttypes.php
ADDED
@@ -0,0 +1,108 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
* FooGallery Album Custom Post Types
|
4 |
+
*/
|
5 |
+
|
6 |
+
if ( ! class_exists( 'FooGallery_Albums_PostTypes' ) ) {
|
7 |
+
|
8 |
+
class FooGallery_Albums_PostTypes {
|
9 |
+
|
10 |
+
function __construct() {
|
11 |
+
//register the post types
|
12 |
+
add_action( 'init', array( $this, 'register_posttype' ) );
|
13 |
+
|
14 |
+
//update post type messages
|
15 |
+
add_filter( 'post_updated_messages', array( $this, 'update_messages' ) );
|
16 |
+
|
17 |
+
//update post bulk messages
|
18 |
+
add_filter( 'bulk_post_updated_messages', array( $this, 'update_bulk_messages' ), 10, 2 );
|
19 |
+
}
|
20 |
+
|
21 |
+
function register_posttype() {
|
22 |
+
//allow extensions to override the album post type
|
23 |
+
$args = apply_filters( 'foogallery_album_posttype_register_args',
|
24 |
+
array(
|
25 |
+
'labels' => array(
|
26 |
+
'name' => __( 'Albums', 'foogallery' ),
|
27 |
+
'singular_name' => __( 'Album', 'foogallery' ),
|
28 |
+
'add_new' => __( 'Add Album', 'foogallery' ),
|
29 |
+
'add_new_item' => __( 'Add New Album', 'foogallery' ),
|
30 |
+
'edit_item' => __( 'Edit Album', 'foogallery' ),
|
31 |
+
'new_item' => __( 'New Album', 'foogallery' ),
|
32 |
+
'view_item' => __( 'View Album', 'foogallery' ),
|
33 |
+
'search_items' => __( 'Search Albums', 'foogallery' ),
|
34 |
+
'not_found' => __( 'No Albums found', 'foogallery' ),
|
35 |
+
'not_found_in_trash' => __( 'No Albums found in Trash', 'foogallery' ),
|
36 |
+
'menu_name' => __( 'Albums', 'foogallery' ),
|
37 |
+
'all_items' => __( 'Albums', 'foogallery' )
|
38 |
+
),
|
39 |
+
'hierarchical' => false,
|
40 |
+
'public' => false,
|
41 |
+
'rewrite' => false,
|
42 |
+
'show_ui' => true,
|
43 |
+
'show_in_menu' => foogallery_admin_menu_parent_slug(),
|
44 |
+
'supports' => array( 'title' ),
|
45 |
+
)
|
46 |
+
);
|
47 |
+
|
48 |
+
register_post_type( FOOGALLERY_CPT_ALBUM, $args );
|
49 |
+
}
|
50 |
+
|
51 |
+
/**
|
52 |
+
* Customize the update messages for a album
|
53 |
+
*
|
54 |
+
* @global object $post The current post object.
|
55 |
+
*
|
56 |
+
* @param array $messages Array of default post updated messages.
|
57 |
+
*
|
58 |
+
* @return array $messages Amended array of post updated messages.
|
59 |
+
*/
|
60 |
+
public function update_messages( $messages ) {
|
61 |
+
|
62 |
+
global $post;
|
63 |
+
|
64 |
+
// Add our album messages
|
65 |
+
$messages[FOOGALLERY_CPT_ALBUM] = apply_filters( 'foogallery_album_posttype_update_messages',
|
66 |
+
array(
|
67 |
+
0 => '',
|
68 |
+
1 => __( 'Album updated.', 'foogallery' ),
|
69 |
+
2 => __( 'Album custom field updated.', 'foogallery' ),
|
70 |
+
3 => __( 'Album custom field deleted.', 'foogallery' ),
|
71 |
+
4 => __( 'Album updated.', 'foogallery' ),
|
72 |
+
5 => isset($_GET['revision']) ? sprintf( __( 'Album restored to revision from %s.', 'foogallery' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
|
73 |
+
6 => __( 'Album published.', 'foogallery' ),
|
74 |
+
7 => __( 'Album saved.', 'foogallery' ),
|
75 |
+
8 => __( 'Album submitted.', 'foogallery' ),
|
76 |
+
9 => sprintf( __( 'Album scheduled for: <strong>%1$s</strong>.', 'foogallery' ), date_i18n( __( 'M j, Y @ G:i' ), strtotime( $post->post_date ) ) ),
|
77 |
+
10 => __( 'Album draft updated.', 'foogallery' )
|
78 |
+
)
|
79 |
+
);
|
80 |
+
|
81 |
+
return $messages;
|
82 |
+
|
83 |
+
}
|
84 |
+
|
85 |
+
/**
|
86 |
+
* Customize the bulk update messages for a album
|
87 |
+
*
|
88 |
+
* @param array $bulk_messages Array of default bulk updated messages.
|
89 |
+
* @param array $bulk_counts Array containing count of posts involved in the action.
|
90 |
+
*
|
91 |
+
* @return array mixed Amended array of bulk updated messages.
|
92 |
+
*/
|
93 |
+
function update_bulk_messages( $bulk_messages, $bulk_counts ) {
|
94 |
+
|
95 |
+
$bulk_messages[FOOGALLERY_CPT_ALBUM] = apply_filters( 'foogallery_album_posttype_bulk_update_messages',
|
96 |
+
array(
|
97 |
+
'updated' => _n( '%s Album updated.', '%s Albums updated.', $bulk_counts['updated'], 'foogallery' ),
|
98 |
+
'locked' => _n( '%s Album not updated, somebody is editing it.', '%s Albums not updated, somebody is editing them.', $bulk_counts['locked'], 'foogallery' ),
|
99 |
+
'deleted' => _n( '%s Album permanently deleted.', '%s Albums permanently deleted.', $bulk_counts['deleted'], 'foogallery' ),
|
100 |
+
'trashed' => _n( '%s Album moved to the Trash.', '%s Albums moved to the Trash.', $bulk_counts['trashed'], 'foogallery' ),
|
101 |
+
'untrashed' => _n( '%s Album restored from the Trash.', '%s Albums restored from the Trash.', $bulk_counts['untrashed'], 'foogallery' ),
|
102 |
+
)
|
103 |
+
);
|
104 |
+
|
105 |
+
return $bulk_messages;
|
106 |
+
}
|
107 |
+
}
|
108 |
+
}
|
extensions/albums/css/admin-foogallery-album.css
ADDED
@@ -0,0 +1,380 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.foogallery-pile {
|
2 |
+
position: relative;
|
3 |
+
z-index: 10;
|
4 |
+
float: left;
|
5 |
+
margin: 10px 15px 15px 10px !important;
|
6 |
+
}
|
7 |
+
/* Image styles */
|
8 |
+
.foogallery-pile .foogallery-gallery-select {
|
9 |
+
max-width: 100%;
|
10 |
+
vertical-align: bottom;
|
11 |
+
border: 8px solid #fff;
|
12 |
+
-webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
|
13 |
+
-moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
|
14 |
+
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
|
15 |
+
overflow: hidden;
|
16 |
+
}
|
17 |
+
|
18 |
+
/* Stacks creted by the use of generated content */
|
19 |
+
.foogallery-pile:before, .foogallery-pile:after {
|
20 |
+
content: "";
|
21 |
+
width: 100%;
|
22 |
+
height: 100%;
|
23 |
+
position: absolute;
|
24 |
+
border: 8px solid #fff;
|
25 |
+
left: 0;
|
26 |
+
-webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
|
27 |
+
-moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
|
28 |
+
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
|
29 |
+
-webkit-box-sizing: border-box;
|
30 |
+
-moz-box-sizing: border-box;
|
31 |
+
box-sizing: border-box;
|
32 |
+
}
|
33 |
+
/* 1st element in stack (behind image) */
|
34 |
+
.foogallery-pile:before {
|
35 |
+
top: -3px; z-index: -10;
|
36 |
+
-webkit-transform: rotate(2deg);
|
37 |
+
-moz-transform: rotate(2deg);
|
38 |
+
transform: rotate(2deg);
|
39 |
+
}
|
40 |
+
/* 2nd element in stack (behind image) */
|
41 |
+
.foogallery-pile:after {
|
42 |
+
top: -2px; z-index: -20;
|
43 |
+
-webkit-transform: rotate(-2deg);
|
44 |
+
-moz-transform: rotate(-2deg);
|
45 |
+
transform: rotate(-2deg);
|
46 |
+
}
|
47 |
+
|
48 |
+
.foogallery-pile img {
|
49 |
+
height: 100%;
|
50 |
+
}
|
51 |
+
|
52 |
+
.foogallery-pile h3 {
|
53 |
+
background: #fff;
|
54 |
+
position: absolute;
|
55 |
+
display: block;
|
56 |
+
bottom: 0px;
|
57 |
+
padding: 5px;
|
58 |
+
width: 100%;
|
59 |
+
box-sizing: border-box;
|
60 |
+
margin: 0;
|
61 |
+
opacity: 0.8;
|
62 |
+
}
|
63 |
+
|
64 |
+
.foogallery-pile h3 span {
|
65 |
+
display: block;
|
66 |
+
font-size: 0.6em;
|
67 |
+
}
|
68 |
+
|
69 |
+
.foogallery-gallery-select.selected {
|
70 |
+
border-color: #1E8CBE;
|
71 |
+
}
|
72 |
+
|
73 |
+
.foogallery-gallery-select.selected::before {
|
74 |
+
content: "\f147" !important;
|
75 |
+
display: inline-block !important;
|
76 |
+
font: normal 60px/70px 'dashicons';
|
77 |
+
position: absolute;
|
78 |
+
color: #FFF;
|
79 |
+
top: 40%;
|
80 |
+
left: 50%;
|
81 |
+
margin-left: -30px;
|
82 |
+
margin-top: -30px;
|
83 |
+
-webkit-font-smoothing: antialiased;
|
84 |
+
background: #1E8CBE;
|
85 |
+
border-radius: 50%;
|
86 |
+
width: 60px;
|
87 |
+
height: 60px;
|
88 |
+
z-index: 4;
|
89 |
+
padding-top:0 !important;
|
90 |
+
}
|
91 |
+
|
92 |
+
.attachment-preview {
|
93 |
+
position: relative;
|
94 |
+
width: 150px;
|
95 |
+
height: 150px;
|
96 |
+
-webkit-box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.1), inset 0 0 0 1px rgba(0, 0, 0, 0.05);
|
97 |
+
box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.1), inset 0 0 0 1px rgba(0, 0, 0, 0.05);
|
98 |
+
background: #EEE;
|
99 |
+
cursor: pointer;
|
100 |
+
}
|
101 |
+
|
102 |
+
.foogallery-shortcode {
|
103 |
+
text-align: center;
|
104 |
+
}
|
105 |
+
|
106 |
+
.foogallery-shortcode input {
|
107 |
+
cursor: pointer;
|
108 |
+
text-align: center;
|
109 |
+
padding: 10px;
|
110 |
+
font-family: "courier new", courier;
|
111 |
+
border: none;
|
112 |
+
box-shadow: none;
|
113 |
+
background: #efefef;
|
114 |
+
}
|
115 |
+
|
116 |
+
.wp-list-table .foogallery-shortcode {
|
117 |
+
cursor: pointer;
|
118 |
+
font-size: 1em;
|
119 |
+
border: none;
|
120 |
+
box-shadow: none;
|
121 |
+
background: #efefef;
|
122 |
+
font-family: "courier new", courier;
|
123 |
+
}
|
124 |
+
|
125 |
+
.foogallery-shortcode-message {
|
126 |
+
font-style: italic;
|
127 |
+
color: #2EA2CC !important;
|
128 |
+
}
|
129 |
+
|
130 |
+
.foogallery-album-gallery-list .attachment.placeholder {
|
131 |
+
position: relative;
|
132 |
+
z-index: 10;
|
133 |
+
float: left;
|
134 |
+
margin: 10px 15px 15px 10px !important;
|
135 |
+
width: 164px;
|
136 |
+
height: 164px;
|
137 |
+
border: #1e8cbe 1px dashed;
|
138 |
+
background: #eee;
|
139 |
+
}
|
140 |
+
|
141 |
+
.foogallery-album-gallery-list .foogallery-pile.ui-sortable-helper {
|
142 |
+
opacity: 0.5;
|
143 |
+
}
|
144 |
+
|
145 |
+
.foogallery-album-gallery-list .foogallery-pile.ui-sortable-helper:hover .close {
|
146 |
+
display: none;
|
147 |
+
}
|
148 |
+
|
149 |
+
.foogallery-album-gallery-list .attachment-preview:before {
|
150 |
+
padding-top:0 !important;
|
151 |
+
}
|
152 |
+
|
153 |
+
.foogallery_template_field td {
|
154 |
+
padding-bottom: 20px;
|
155 |
+
}
|
156 |
+
|
157 |
+
.foogallery_template_field th {
|
158 |
+
vertical-align: top;
|
159 |
+
text-align: left;
|
160 |
+
padding-top: 0.3em;
|
161 |
+
padding-right: 10px;
|
162 |
+
}
|
163 |
+
|
164 |
+
.foogallery_metabox_field-icon label {
|
165 |
+
display:inline-block;
|
166 |
+
margin-right:10px;
|
167 |
+
border:solid 3px transparent;
|
168 |
+
background:#aaa;
|
169 |
+
border-radius: 3px;
|
170 |
+
-moz-border-radius: 3px;
|
171 |
+
-webkit-border-radius: 3px;
|
172 |
+
padding:5px;
|
173 |
+
line-height: 0;
|
174 |
+
}
|
175 |
+
|
176 |
+
.foogallery_metabox_field-icon input:checked + label {
|
177 |
+
border:solid 3px #444;
|
178 |
+
background: #888;
|
179 |
+
}
|
180 |
+
|
181 |
+
.foogallery_metabox_field-icon label:hover {
|
182 |
+
border:solid 3px #444;
|
183 |
+
}
|
184 |
+
|
185 |
+
.foogallery_metabox_field-thumb_size label {
|
186 |
+
vertical-align: baseline;
|
187 |
+
}
|
188 |
+
|
189 |
+
.foogallery_metabox_field-thumb_size input[type="number"] {
|
190 |
+
margin-right: 10px;
|
191 |
+
}
|
192 |
+
|
193 |
+
.foogallery_template_field h4 {
|
194 |
+
font-size: 1.2em;
|
195 |
+
border-bottom: solid 1px #EEE;
|
196 |
+
padding-bottom: 5px;
|
197 |
+
margin: 0;
|
198 |
+
}
|
199 |
+
|
200 |
+
.foogallery_metabox_field-number input[type="number"] {
|
201 |
+
width: 10em;
|
202 |
+
}
|
203 |
+
|
204 |
+
.foogallery_metabox_custom_css {
|
205 |
+
width: 100%;
|
206 |
+
height: 10em;
|
207 |
+
}
|
208 |
+
|
209 |
+
.foogallery_metabox_field-radio > input, .foogallery_metabox_field-radio > label {
|
210 |
+
margin-bottom: 10px;
|
211 |
+
display: inline-block;
|
212 |
+
}
|
213 |
+
|
214 |
+
.foogallery_template_field th {
|
215 |
+
width: 180px;
|
216 |
+
}
|
217 |
+
|
218 |
+
.foogallery-help {
|
219 |
+
position: relative;
|
220 |
+
display: block;
|
221 |
+
line-height: 19px;
|
222 |
+
padding: 11px 15px 11px 40px;
|
223 |
+
font-size: 14px;
|
224 |
+
text-align: left;
|
225 |
+
margin: 5px 0 20px 2px;
|
226 |
+
background-color: #F4F4FF;
|
227 |
+
border-left: 4px solid #1e8cbe;
|
228 |
+
-webkit-box-shadow: 0 1px 1px 0 rgba(0, 0, 0, .1);
|
229 |
+
box-shadow: 0 1px 1px 0 rgba(0, 0, 0, .1);
|
230 |
+
}
|
231 |
+
|
232 |
+
.foogallery-help:before {
|
233 |
+
content: "\f223";
|
234 |
+
font: 400 30px/1 dashicons !important;
|
235 |
+
speak: none;
|
236 |
+
color: #1e8cbe;
|
237 |
+
display: inline-block;
|
238 |
+
-webkit-font-smoothing: antialiased;
|
239 |
+
-moz-osx-font-smoothing: grayscale;
|
240 |
+
vertical-align: bottom;
|
241 |
+
position: absolute;
|
242 |
+
left: 5px;
|
243 |
+
height: 100%;
|
244 |
+
margin-top: -15px;
|
245 |
+
top: 50%;
|
246 |
+
}
|
247 |
+
|
248 |
+
.foogallery-album-error {
|
249 |
+
padding: 11px 15px;
|
250 |
+
font-size: 14px;
|
251 |
+
text-align: left;
|
252 |
+
border-left: 4px solid #dc3232;
|
253 |
+
-webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
|
254 |
+
box-shadow: 1px 1px 1px 1px rgba(0,0,0,.1);
|
255 |
+
}
|
256 |
+
|
257 |
+
.foogallery-album-gallery-list .attachment-preview a.info {
|
258 |
+
display: none;
|
259 |
+
position: absolute;
|
260 |
+
padding: 0;
|
261 |
+
font-size: 20px;
|
262 |
+
line-height: 20px;
|
263 |
+
text-align: center;
|
264 |
+
text-decoration: none;
|
265 |
+
background-color: #444;
|
266 |
+
border-top-right-radius: 50%;
|
267 |
+
border-top-left-radius: 50%;
|
268 |
+
border-bottom-right-radius: 50%;
|
269 |
+
border-bottom-left-radius: 50%;
|
270 |
+
color: #fff;
|
271 |
+
top: 5px;
|
272 |
+
left: 5px;
|
273 |
+
}
|
274 |
+
|
275 |
+
.foogallery-album-gallery-list .attachment-preview:hover a.info {
|
276 |
+
display: block;
|
277 |
+
}
|
278 |
+
|
279 |
+
.foogallery-album-info-modal {
|
280 |
+
display: none;
|
281 |
+
top: 20%;
|
282 |
+
bottom: 20%;
|
283 |
+
left: 30%;
|
284 |
+
right: 30%;
|
285 |
+
}
|
286 |
+
|
287 |
+
.foogallery-album-info-modal .media-frame-title {
|
288 |
+
left:0;
|
289 |
+
}
|
290 |
+
|
291 |
+
.foogallery-album-info-modal .media-frame-title h1 {
|
292 |
+
float: left;
|
293 |
+
}
|
294 |
+
|
295 |
+
.foogallery-album-info-modal .media-frame-title .spinner {
|
296 |
+
float:left;
|
297 |
+
margin: 15px 0;
|
298 |
+
}
|
299 |
+
|
300 |
+
.foogallery-album-info-modal .close {
|
301 |
+
position: absolute;
|
302 |
+
top: 20px;
|
303 |
+
right: 20px;
|
304 |
+
cursor: pointer;
|
305 |
+
font-size: 20px;
|
306 |
+
}
|
307 |
+
|
308 |
+
.foogallery-album-info-modal .modal-content {
|
309 |
+
position: absolute;
|
310 |
+
top: 50px;
|
311 |
+
left: 0;
|
312 |
+
right: 0;
|
313 |
+
bottom: 61px;
|
314 |
+
height: auto;
|
315 |
+
width: auto;
|
316 |
+
margin: 0;
|
317 |
+
overflow: auto;
|
318 |
+
background: #fff;
|
319 |
+
border-top: 1px solid #ddd;
|
320 |
+
border-bottom: 1px solid #ddd;
|
321 |
+
padding: 20px;
|
322 |
+
min-width: 400px;
|
323 |
+
}
|
324 |
+
|
325 |
+
.foogallery-album-info-modal .gallery-details,
|
326 |
+
.foogallery-album-info-modal .gallery-details table {
|
327 |
+
width: 100%;
|
328 |
+
}
|
329 |
+
|
330 |
+
.foogallery-album-info-modal .gallery-details th {
|
331 |
+
vertical-align: top;
|
332 |
+
}
|
333 |
+
|
334 |
+
.foogallery-album-info-modal .gallery-details th label {
|
335 |
+
box-sizing: border-box;
|
336 |
+
float: right;
|
337 |
+
padding: 6px 0px;
|
338 |
+
margin-right: 20px;
|
339 |
+
font-weight: normal;
|
340 |
+
}
|
341 |
+
|
342 |
+
.foogallery-album-info-modal .gallery-details td input,
|
343 |
+
.foogallery-album-info-modal .gallery-details td textarea,
|
344 |
+
.foogallery-album-info-modal .gallery-details td select {
|
345 |
+
width: 100%;
|
346 |
+
}
|
347 |
+
|
348 |
+
.foogallery-album-info-modal .gallery-details td select {
|
349 |
+
line-height: inherit;
|
350 |
+
padding: 6px 8px;
|
351 |
+
height: inherit;
|
352 |
+
}
|
353 |
+
|
354 |
+
.foogallery-album-info-modal .gallery-details td .help {
|
355 |
+
margin-top: 0;
|
356 |
+
font-size: 0.8em;
|
357 |
+
}
|
358 |
+
|
359 |
+
.foogallery-album-info-modal .media-toolbar .spinner {
|
360 |
+
margin-top: 20px;
|
361 |
+
margin-right: 0;
|
362 |
+
}
|
363 |
+
|
364 |
+
.foogallery-album-info-modal .media-frame-toolbar {
|
365 |
+
left: 0;
|
366 |
+
}
|
367 |
+
|
368 |
+
.foogallery-album-info-modal .media-frame-toolbar .media-toolbar-secondary {
|
369 |
+
line-height: 60px;
|
370 |
+
font-weight: bold;
|
371 |
+
}
|
372 |
+
|
373 |
+
.foogallery-album-info-modal-backdrop {
|
374 |
+
display: none;
|
375 |
+
}
|
376 |
+
|
377 |
+
.spacer {
|
378 |
+
display: inline-block;
|
379 |
+
width:30px;
|
380 |
+
}
|
extensions/albums/css/album-default.css
ADDED
@@ -0,0 +1,102 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.foogallery-album-gallery-list {
|
2 |
+
list-style: none !important;
|
3 |
+
padding: 0 !important;
|
4 |
+
}
|
5 |
+
|
6 |
+
.foogallery-album-gallery-list li {
|
7 |
+
list-style-type: none !important;
|
8 |
+
}
|
9 |
+
|
10 |
+
.foogallery-album-gallery-list .foogallery-pile {
|
11 |
+
position: relative;
|
12 |
+
z-index: 10;
|
13 |
+
float: left;
|
14 |
+
margin: 10px 15px 15px 10px !important;
|
15 |
+
}
|
16 |
+
|
17 |
+
/* Stacks creted by the use of generated content */
|
18 |
+
.foogallery-album-gallery-list .foogallery-pile:before,
|
19 |
+
.foogallery-album-gallery-list .foogallery-pile:after {
|
20 |
+
content: "";
|
21 |
+
width: 100%;
|
22 |
+
height: 100%;
|
23 |
+
position: absolute;
|
24 |
+
border: 8px solid #fff;
|
25 |
+
left: 0;
|
26 |
+
-webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
|
27 |
+
-moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
|
28 |
+
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
|
29 |
+
-webkit-box-sizing: border-box;
|
30 |
+
-moz-box-sizing: border-box;
|
31 |
+
box-sizing: border-box;
|
32 |
+
}
|
33 |
+
/* 1st element in stack (behind image) */
|
34 |
+
.foogallery-album-gallery-list .foogallery-pile:before {
|
35 |
+
top: -3px; z-index: -10;
|
36 |
+
-webkit-transform: rotate(2deg);
|
37 |
+
-moz-transform: rotate(2deg);
|
38 |
+
transform: rotate(2deg);
|
39 |
+
}
|
40 |
+
/* 2nd element in stack (behind image) */
|
41 |
+
.foogallery-album-gallery-list .foogallery-pile:after {
|
42 |
+
top: -2px; z-index: -20;
|
43 |
+
-webkit-transform: rotate(-2deg);
|
44 |
+
-moz-transform: rotate(-2deg);
|
45 |
+
transform: rotate(-2deg);
|
46 |
+
}
|
47 |
+
|
48 |
+
.foogallery-album-gallery-list .foogallery-pile .foogallery-pile-inner {
|
49 |
+
border: 8px solid #fff;
|
50 |
+
-webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
|
51 |
+
-moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
|
52 |
+
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
|
53 |
+
overflow: hidden;
|
54 |
+
line-height: 0;
|
55 |
+
}
|
56 |
+
|
57 |
+
.foogallery-album-gallery-list .foogallery-pile .foogallery-pile-inner a {
|
58 |
+
display: inline-block;
|
59 |
+
}
|
60 |
+
|
61 |
+
.foogallery-album-gallery-list .foogallery-pile img {
|
62 |
+
}
|
63 |
+
|
64 |
+
.foogallery-album-gallery-list .foogallery-pile h3 {
|
65 |
+
background: #FFF;
|
66 |
+
position: absolute;
|
67 |
+
display: block;
|
68 |
+
bottom: 0px;
|
69 |
+
padding: 5px 5px 0 5px;
|
70 |
+
width: 100%;
|
71 |
+
box-sizing: border-box;
|
72 |
+
margin: 0;
|
73 |
+
opacity: 0.6;
|
74 |
+
line-height: 1em;
|
75 |
+
}
|
76 |
+
|
77 |
+
.foogallery-album-gallery-list .foogallery-pile h3 span {
|
78 |
+
display: block;
|
79 |
+
font-size: 0.6em;
|
80 |
+
}
|
81 |
+
|
82 |
+
.foogallery-album-gallery-list .foogallery-pile a {
|
83 |
+
position: relative;
|
84 |
+
}
|
85 |
+
|
86 |
+
.foogallery-album-gallery-list.alignment-left {
|
87 |
+
text-align: left;
|
88 |
+
}
|
89 |
+
|
90 |
+
.foogallery-album-gallery-list.alignment-center {
|
91 |
+
text-align: center;
|
92 |
+
}
|
93 |
+
|
94 |
+
.foogallery-album-gallery-list.alignment-right {
|
95 |
+
text-align: right;
|
96 |
+
}
|
97 |
+
|
98 |
+
/* force no borders */
|
99 |
+
.foogallery-album-gallery-list .foogallery-pile a,
|
100 |
+
.foogallery-album-gallery-list .foogallery-pile a:hover {
|
101 |
+
border: none !important;
|
102 |
+
}
|
extensions/albums/css/album-stack.css
ADDED
@@ -0,0 +1,290 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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|
10 |
+
border: 10px solid #fff;
|
11 |
+
box-shadow: 0 2px 3px rgba(0,0,0,0.2);
|
12 |
+
display: none;
|
13 |
+
overflow: hidden;
|
14 |
+
-webkit-backface-visibility: hidden;
|
15 |
+
-moz-backface-visibility: hidden;
|
16 |
+
-o-backface-visibility: hidden;
|
17 |
+
-ms-backface-visibility: hidden;
|
18 |
+
backface-visibility: hidden;
|
19 |
+
}
|
20 |
+
|
21 |
+
.no-js .tp-grid li {
|
22 |
+
position: relative;
|
23 |
+
display: inline-block;
|
24 |
+
}
|
25 |
+
|
26 |
+
.tp-grid li a {
|
27 |
+
display: block;
|
28 |
+
outline: none;
|
29 |
+
}
|
30 |
+
|
31 |
+
.tp-grid li img {
|
32 |
+
display: block;
|
33 |
+
border: none;
|
34 |
+
}
|
35 |
+
|
36 |
+
.tp-info,
|
37 |
+
.tp-title {
|
38 |
+
position: absolute;
|
39 |
+
background: #fff;
|
40 |
+
line-height: 20px;
|
41 |
+
color: #333;
|
42 |
+
top: 40%;
|
43 |
+
width: 75%;
|
44 |
+
padding: 10px;
|
45 |
+
font-weight: 700;
|
46 |
+
text-align: right;
|
47 |
+
left: -100%;
|
48 |
+
box-shadow:
|
49 |
+
1px 1px 1px rgba(0,0,0,0.1),
|
50 |
+
5px 0 5px -3px rgba(0,0,0,0.4),
|
51 |
+
inset 0 0 5px rgba(0,0,0,0.04);
|
52 |
+
}
|
53 |
+
|
54 |
+
.tp-title-cover {
|
55 |
+
position: absolute;
|
56 |
+
top: 0;
|
57 |
+
bottom: 0;
|
58 |
+
left: 0;
|
59 |
+
right: 0;
|
60 |
+
}
|
61 |
+
|
62 |
+
.tp-open .tp-title-cover {
|
63 |
+
display: none;
|
64 |
+
}
|
65 |
+
|
66 |
+
.touch .tp-info {
|
67 |
+
left: 0px;
|
68 |
+
}
|
69 |
+
|
70 |
+
.no-touch .tp-info {
|
71 |
+
-webkit-transition: all 0.3s ease-in-out;
|
72 |
+
-moz-transition: all 0.3s ease-in-out;
|
73 |
+
-o-transition: all 0.3s ease-in-out;
|
74 |
+
-ms-transition: all 0.3s ease-in-out;
|
75 |
+
transition: all 0.3s ease-in-out;
|
76 |
+
}
|
77 |
+
|
78 |
+
.no-touch .tp-grid li:hover .tp-info {
|
79 |
+
-webkit-transition-delay: 150ms;
|
80 |
+
-moz-transition-delay: 150ms;
|
81 |
+
-o-transition-delay: 150ms;
|
82 |
+
-ms-transition-delay: 150ms;
|
83 |
+
transition-delay: 150ms;
|
84 |
+
}
|
85 |
+
|
86 |
+
.no-touch .tp-open li:hover .tp-info {
|
87 |
+
left: 0px;
|
88 |
+
}
|
89 |
+
|
90 |
+
.tp-title {
|
91 |
+
padding: 10px 35px 10px 10px;
|
92 |
+
left: 0px;
|
93 |
+
}
|
94 |
+
|
95 |
+
.tp-title span:nth-child(2){
|
96 |
+
color: #aaa;
|
97 |
+
padding: 0 5px;
|
98 |
+
background: #F7F7F7;
|
99 |
+
right: 0px;
|
100 |
+
height: 100%;
|
101 |
+
line-height: 40px;
|
102 |
+
top: 0px;
|
103 |
+
position: absolute;
|
104 |
+
display: block;
|
105 |
+
}
|
106 |
+
|
107 |
+
.foogallery-stack-album * {
|
108 |
+
box-sizing: border-box;
|
109 |
+
}
|
110 |
+
|
111 |
+
.foogallery-stack-album .topbar {
|
112 |
+
position: relative;
|
113 |
+
padding: 10px 0;
|
114 |
+
margin: 0 0 20px;
|
115 |
+
box-shadow: 0 1px 0 #aaa, 0 -1px 0 #aaa;
|
116 |
+
}
|
117 |
+
|
118 |
+
.foogallery-stack-album .back {
|
119 |
+
width: 40px;
|
120 |
+
height: 40px;
|
121 |
+
position: absolute;
|
122 |
+
left: 50%;
|
123 |
+
top: 50%;
|
124 |
+
margin: -20px 0 0 -20px;
|
125 |
+
border-radius: 50%;
|
126 |
+
text-align: center;
|
127 |
+
line-height: 38px;
|
128 |
+
color: #999;
|
129 |
+
background: #ddd;
|
130 |
+
background: rgba(200,200,200,0.5);
|
131 |
+
cursor: pointer;
|
132 |
+
display: none;
|
133 |
+
-webkit-touch-callout: none;
|
134 |
+
-webkit-user-select: none;
|
135 |
+
-khtml-user-select: none;
|
136 |
+
-moz-user-select: none;
|
137 |
+
-ms-user-select: none;
|
138 |
+
user-select: none;
|
139 |
+
}
|
140 |
+
|
141 |
+
.no-touch .foogallery-stack-album .back:hover {
|
142 |
+
background: #666;
|
143 |
+
background: rgba(100,100,100,0.5);
|
144 |
+
color: #fff;
|
145 |
+
}
|
146 |
+
|
147 |
+
.foogallery-stack-album .topbar h2,
|
148 |
+
.foogallery-stack-album .topbar h3 {
|
149 |
+
display: inline-block;
|
150 |
+
width: 49%;
|
151 |
+
margin: 0;
|
152 |
+
}
|
153 |
+
|
154 |
+
.foogallery-stack-album .topbar h2 {
|
155 |
+
padding-right: 20px;
|
156 |
+
}
|
157 |
+
|
158 |
+
.foogallery-stack-album .topbar h3 {
|
159 |
+
text-align: right;
|
160 |
+
padding-left: 20px;
|
161 |
+
}
|
162 |
+
|
163 |
+
/* Loader */
|
164 |
+
|
165 |
+
.foogallery-stack-album .loader {
|
166 |
+
left: 50%;
|
167 |
+
position: absolute;
|
168 |
+
margin-left: -120px;
|
169 |
+
}
|
170 |
+
|
171 |
+
.foogallery-stack-album .loader i {
|
172 |
+
display: inline-block;
|
173 |
+
width: 40px;
|
174 |
+
height: 40px;
|
175 |
+
-webkit-animation: loading 1s linear infinite forwards;
|
176 |
+
-moz-animation: loading 1s linear infinite forwards;
|
177 |
+
-o-animation: loading 1s linear infinite forwards;
|
178 |
+
-ms-animation: loading 1s linear infinite forwards;
|
179 |
+
animation: loading 1s linear infinite forwards;
|
180 |
+
}
|
181 |
+
|
182 |
+
.foogallery-stack-album .loader i:nth-child(2){
|
183 |
+
-webkit-animation-delay: 0.1s;
|
184 |
+
-moz-animation-delay: 0.1s;
|
185 |
+
-o-animation-delay: 0.1s;
|
186 |
+
-ms-animation-delay: 0.1s;
|
187 |
+
animation-delay: 0.1s;
|
188 |
+
}
|
189 |
+
|
190 |
+
.foogallery-stack-album .loader i:nth-child(3){
|
191 |
+
-webkit-animation-delay: 0.2s;
|
192 |
+
-moz-animation-delay: 0.2s;
|
193 |
+
-o-animation-delay: 0.2s;
|
194 |
+
-ms-animation-delay: 0.2s;
|
195 |
+
animation-delay: 0.2s;
|
196 |
+
}
|
197 |
+
|
198 |
+
.foogallery-stack-album .loader i:nth-child(4){
|
199 |
+
-webkit-animation-delay: 0.3s;
|
200 |
+
-moz-animation-delay: 0.3s;
|
201 |
+
-o-animation-delay: 0.3s;
|
202 |
+
-ms-animation-delay: 0.3s;
|
203 |
+
animation-delay: 0.3s;
|
204 |
+
}
|
205 |
+
|
206 |
+
.foogallery-stack-album .loader i:nth-child(5){
|
207 |
+
-webkit-animation-delay: 0.4s;
|
208 |
+
-moz-animation-delay: 0.4s;
|
209 |
+
-o-animation-delay: 0.4s;
|
210 |
+
-ms-animation-delay: 0.4s;
|
211 |
+
animation-delay: 0.4s;
|
212 |
+
}
|
213 |
+
|
214 |
+
.foogallery-stack-album .loader i:nth-child(6){
|
215 |
+
-webkit-animation-delay: 0.5s;
|
216 |
+
-moz-animation-delay: 0.5s;
|
217 |
+
-o-animation-delay: 0.5s;
|
218 |
+
-ms-animation-delay: 0.5s;
|
219 |
+
animation-delay: 0.5s;
|
220 |
+
}
|
221 |
+
|
222 |
+
@-webkit-keyframes loading{
|
223 |
+
0%{
|
224 |
+
opacity: 0;
|
225 |
+
background-color: rgba(255,255,255,0.9);
|
226 |
+
}
|
227 |
+
|
228 |
+
100%{
|
229 |
+
opacity: 1;
|
230 |
+
-webkit-transform: scale(0.25) rotate(75deg);
|
231 |
+
background-color: rgba(155,155,155,0.9);
|
232 |
+
}
|
233 |
+
}
|
234 |
+
|
235 |
+
@-moz-keyframes loading{
|
236 |
+
0%{
|
237 |
+
opacity: 0;
|
238 |
+
background-color: rgba(255,255,255,0.9);
|
239 |
+
}
|
240 |
+
|
241 |
+
100%{
|
242 |
+
opacity: 1;
|
243 |
+
-moz-transform: scale(0.25) rotate(75deg);
|
244 |
+
background-color: rgba(155,155,155,0.9);
|
245 |
+
}
|
246 |
+
}
|
247 |
+
|
248 |
+
@-o-keyframes loading{
|
249 |
+
0%{
|
250 |
+
opacity: 0;
|
251 |
+
background-color: rgba(255,255,255,0.9);
|
252 |
+
}
|
253 |
+
|
254 |
+
100%{
|
255 |
+
opacity: 1;
|
256 |
+
-o-transform: scale(0.25) rotate(75deg);
|
257 |
+
background-color: rgba(155,155,155,0.9);
|
258 |
+
}
|
259 |
+
}
|
260 |
+
|
261 |
+
@-ms-keyframes loading{
|
262 |
+
0%{
|
263 |
+
opacity: 0;
|
264 |
+
background-color: rgba(255,255,255,0.9);
|
265 |
+
}
|
266 |
+
|
267 |
+
100%{
|
268 |
+
opacity: 1;
|
269 |
+
-ms-transform: scale(0.25) rotate(75deg);
|
270 |
+
background-color: rgba(155,155,155,0.9);
|
271 |
+
}
|
272 |
+
}
|
273 |
+
|
274 |
+
@keyframes loading{
|
275 |
+
0%{
|
276 |
+
opacity: 0;
|
277 |
+
background-color: rgba(255,255,255,0.9);
|
278 |
+
}
|
279 |
+
|
280 |
+
100%{
|
281 |
+
opacity: 1;
|
282 |
+
transform: scale(0.25) rotate(75deg);
|
283 |
+
background-color: rgba(155,155,155,0.9);
|
284 |
+
}
|
285 |
+
}
|
286 |
+
|
287 |
+
@media screen and (max-width: 680px){
|
288 |
+
.foogallery-stack-album .topbar h2, .foogallery-stack-album .topbar h3 { text-align: left; padding: 0; display: block;}
|
289 |
+
.foogallery-stack-album .back { left: auto; right: 0px; margin-left: 0px;}
|
290 |
+
}
|
extensions/albums/foogallery-albums.png
ADDED
Binary file
|
extensions/albums/functions.php
ADDED
@@ -0,0 +1,361 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Builds up a FooGallery album shortcode
|
5 |
+
*
|
6 |
+
* @param $album_id
|
7 |
+
*
|
8 |
+
* @return string
|
9 |
+
*/
|
10 |
+
function foogallery_build_album_shortcode( $album_id ) {
|
11 |
+
return '[' . foogallery_album_shortcode_tag() . ' id="' . $album_id . '"]';
|
12 |
+
}
|
13 |
+
|
14 |
+
/**
|
15 |
+
* Returns the album shortcode tag
|
16 |
+
*
|
17 |
+
* @return string
|
18 |
+
*/
|
19 |
+
function foogallery_album_shortcode_tag() {
|
20 |
+
return apply_filters( 'foogallery_album_shortcode_tag', FOOGALLERY_CPT_ALBUM );
|
21 |
+
}
|
22 |
+
|
23 |
+
/**
|
24 |
+
* Return all the album templates used within FooGallery
|
25 |
+
*
|
26 |
+
* @return array
|
27 |
+
*/
|
28 |
+
function foogallery_album_templates() {
|
29 |
+
$album_templates[] = array(
|
30 |
+
'slug' => 'default',
|
31 |
+
'name' => __( 'Responsive Album Layout', 'foogallery' ),
|
32 |
+
'fields' => array(
|
33 |
+
array(
|
34 |
+
'id' => 'thumbnail_dimensions',
|
35 |
+
'title' => __( 'Thumbnail Size', 'foogallery' ),
|
36 |
+
'desc' => __( 'Choose the size of your gallery thumbnails.', 'foogallery' ),
|
37 |
+
'section' => __( 'Thumbnail Settings', 'foogallery' ),
|
38 |
+
'type' => 'thumb_size',
|
39 |
+
'default' => array(
|
40 |
+
'width' => get_option( 'thumbnail_size_w' ),
|
41 |
+
'height' => get_option( 'thumbnail_size_h' ),
|
42 |
+
'crop' => true,
|
43 |
+
),
|
44 |
+
),
|
45 |
+
array(
|
46 |
+
'id' => 'title_bg',
|
47 |
+
'title' => __( 'Title Background Color', 'foogallery' ),
|
48 |
+
'desc' => __( 'The color of the title that overlays the album thumbnails', 'foogallery' ),
|
49 |
+
'section' => __( 'Thumbnail Settings', 'foogallery' ),
|
50 |
+
'type' => 'colorpicker',
|
51 |
+
'default' => '#fff'
|
52 |
+
),
|
53 |
+
array(
|
54 |
+
'id' => 'title_font_color',
|
55 |
+
'title' => __( 'Title Text Color', 'foogallery' ),
|
56 |
+
'desc' => __( 'The color of the title text that overlays the album thumbnails', 'foogallery' ),
|
57 |
+
'section' => __( 'Thumbnail Settings', 'foogallery' ),
|
58 |
+
'type' => 'colorpicker',
|
59 |
+
'default' => '#000000'
|
60 |
+
),
|
61 |
+
array(
|
62 |
+
'id' => 'alignment',
|
63 |
+
'title' => __( 'Alignment', 'foogallery' ),
|
64 |
+
'desc' => __( 'The horizontal alignment of the gallery thumbnails inside the album.', 'foogallery' ),
|
65 |
+
'section' => __( 'Thumbnail Settings', 'foogallery' ),
|
66 |
+
'default' => 'alignment-left',
|
67 |
+
'type' => 'select',
|
68 |
+
'choices' => array(
|
69 |
+
'alignment-left' => __( 'Left', 'foogallery' ),
|
70 |
+
'alignment-center' => __( 'Center', 'foogallery' ),
|
71 |
+
'alignment-right' => __( 'Right', 'foogallery' ),
|
72 |
+
)
|
73 |
+
),
|
74 |
+
array(
|
75 |
+
'id' => 'gallery_link',
|
76 |
+
'title' => __( 'Gallery Link', 'foogallery' ),
|
77 |
+
'section' => __( 'URL Settings', 'foogallery' ),
|
78 |
+
'default' => '',
|
79 |
+
'type' => 'radio',
|
80 |
+
'spacer' => '<span class="spacer"></span>',
|
81 |
+
'choices' => array(
|
82 |
+
'' => __('Default', 'foogallery'),
|
83 |
+
'custom_url' => __('Custom URL', 'foogallery')
|
84 |
+
),
|
85 |
+
'desc' => __( 'You can choose to link each gallery to the default embedded gallery, or you can choose to link to the gallery custom URL (if set).', 'foogallery' ),
|
86 |
+
),
|
87 |
+
array(
|
88 |
+
'id' => 'gallery_link_format',
|
89 |
+
'title' => __( 'Gallery Link Format', 'foogallery' ),
|
90 |
+
'desc' => __( 'The format of the URL for each individual gallery in the album.', 'foogallery' ),
|
91 |
+
'section' => __( 'URL Settings', 'foogallery' ),
|
92 |
+
'type' => 'radio',
|
93 |
+
'choices' => array(
|
94 |
+
'default' => __('Pretty, e.g. ', 'foogallery') . '<code>/page-with-album/' . foogallery_album_gallery_url_slug() . '/some-gallery</code>',
|
95 |
+
'querystring' => __('Querystring e.g. ', 'foogallery') . '<code>/page-with-album?' . foogallery_album_gallery_url_slug() . '=some-gallery</code>'
|
96 |
+
),
|
97 |
+
'default' => foogallery_determine_best_link_format_default()
|
98 |
+
),
|
99 |
+
array(
|
100 |
+
'id' => 'url_help',
|
101 |
+
'title' => __( 'Please Note', 'foogallery' ),
|
102 |
+
'section' => __( 'URL Settings', 'foogallery' ),
|
103 |
+
'type' => 'help',
|
104 |
+
'help' => true,
|
105 |
+
'desc' => __( 'If you are getting 404\'s when clicking on the album galleries, then change to the querystring format. To force your rewrite rules to flush, simply deactivate and activate the albums extension again.', 'foogallery' ),
|
106 |
+
),
|
107 |
+
array(
|
108 |
+
'id' => 'album_hash',
|
109 |
+
'title' => __( 'Remember Scroll Position', 'foogallery' ),
|
110 |
+
'desc' => __( 'When a gallery is loaded in your album, the page is refreshed which means the scroll position will be lost .', 'foogallery' ),
|
111 |
+
'section' => __( 'URL Settings', 'foogallery' ),
|
112 |
+
'type' => 'radio',
|
113 |
+
'choices' => array(
|
114 |
+
'none' => __('Don\'t Remember', 'foogallery'),
|
115 |
+
'remember' => __('Remember Scroll Position', 'foogallery')
|
116 |
+
),
|
117 |
+
'default' => 'none'
|
118 |
+
)
|
119 |
+
)
|
120 |
+
);
|
121 |
+
|
122 |
+
$album_templates[] = array(
|
123 |
+
'slug' => 'stack',
|
124 |
+
'name' => __( 'All-In-One Stack Album', 'foogallery' ),
|
125 |
+
'fields' => array(
|
126 |
+
array(
|
127 |
+
'id' => 'lightbox',
|
128 |
+
'title' => __( 'Lightbox', 'foogallery' ),
|
129 |
+
'desc' => __( 'Choose which lightbox you want to use to display images.', 'foogallery' ),
|
130 |
+
'type' => 'lightbox',
|
131 |
+
),
|
132 |
+
|
133 |
+
array(
|
134 |
+
'id' => 'thumbnail_dimensions',
|
135 |
+
'title' => __( 'Thumbnail Size', 'foogallery' ),
|
136 |
+
'desc' => __( 'Choose the size of your image stack thumbnails.', 'foogallery' ),
|
137 |
+
'section' => __( 'Thumbnail Settings', 'foogallery' ),
|
138 |
+
'type' => 'thumb_size',
|
139 |
+
'default' => array(
|
140 |
+
'width' => get_option( 'thumbnail_size_w' ),
|
141 |
+
'height' => get_option( 'thumbnail_size_h' ),
|
142 |
+
'crop' => true,
|
143 |
+
),
|
144 |
+
),
|
145 |
+
|
146 |
+
array(
|
147 |
+
'id' => 'random_angle',
|
148 |
+
'title' => __( 'Thumbnail Rotation', 'foogallery' ),
|
149 |
+
'section' => __( 'Thumbnail Settings', 'foogallery' ),
|
150 |
+
'desc' => __( 'Choose how thumbnails in each gallery are shown when clicking an image stack.', 'foogallery' ),
|
151 |
+
'type' => 'radio',
|
152 |
+
'default' => 'false',
|
153 |
+
'choices' => array(
|
154 |
+
'false' => __( 'Normal', 'foogallery' ),
|
155 |
+
'true' => __( 'Random Angles', 'foogallery' )
|
156 |
+
)
|
157 |
+
),
|
158 |
+
|
159 |
+
array(
|
160 |
+
'id' => 'gutter',
|
161 |
+
'title' => __( 'Thumbnail Gutter', 'foogallery' ),
|
162 |
+
'section' => __( 'Thumbnail Settings', 'foogallery' ),
|
163 |
+
'desc' => __( 'The spacing between each image stack.', 'foogallery' ),
|
164 |
+
'type' => 'number',
|
165 |
+
'default' => 50
|
166 |
+
),
|
167 |
+
|
168 |
+
array(
|
169 |
+
'id' => 'delay',
|
170 |
+
'title' => __( 'Expand Delay', 'foogallery' ),
|
171 |
+
'section' => __( 'Thumbnail Settings', 'foogallery' ),
|
172 |
+
'desc' => __( 'The delay between expanding each image on a image stack.', 'foogallery' ),
|
173 |
+
'type' => 'number',
|
174 |
+
'default' => 0
|
175 |
+
),
|
176 |
+
|
177 |
+
array(
|
178 |
+
'id' => 'pile_angles',
|
179 |
+
'title' => __( 'Image Stack Angles', 'foogallery' ),
|
180 |
+
'section' => __( 'Thumbnail Settings', 'foogallery' ),
|
181 |
+
'desc' => __( 'The angle of the images behind the thumbnail in each image stack.', 'foogallery' ),
|
182 |
+
'type' => 'radio',
|
183 |
+
'default' => '1',
|
184 |
+
'choices' => array(
|
185 |
+
'1' => __( 'Low', 'foogallery' ),
|
186 |
+
'2' => __( 'Normal', 'foogallery' ),
|
187 |
+
'3' => __( 'More Than Normal', 'foogallery' ),
|
188 |
+
'5' => __( 'High', 'foogallery' ),
|
189 |
+
)
|
190 |
+
)
|
191 |
+
)
|
192 |
+
);
|
193 |
+
|
194 |
+
return apply_filters( 'foogallery_album_templates', $album_templates );
|
195 |
+
}
|
196 |
+
|
197 |
+
function foogallery_determine_best_link_format_default() {
|
198 |
+
global $wp_rewrite;
|
199 |
+
if ( '' === $wp_rewrite->permalink_structure ) {
|
200 |
+
//we are using ?page_id
|
201 |
+
return 'querystring';
|
202 |
+
}
|
203 |
+
|
204 |
+
//we are using permalinks
|
205 |
+
return 'default';
|
206 |
+
}
|
207 |
+
|
208 |
+
/**
|
209 |
+
* Returns the default album template
|
210 |
+
*
|
211 |
+
* @return string
|
212 |
+
*/
|
213 |
+
function foogallery_default_album_template() {
|
214 |
+
return foogallery_get_setting( 'album_template' );
|
215 |
+
}
|
216 |
+
|
217 |
+
/**
|
218 |
+
* Returns the gallery link url for an album
|
219 |
+
*
|
220 |
+
* @param $album FooGalleryAlbum
|
221 |
+
* @param $gallery FooGallery
|
222 |
+
*
|
223 |
+
* @return string
|
224 |
+
*/
|
225 |
+
function foogallery_album_build_gallery_link( $album, $gallery ) {
|
226 |
+
//first check if we want to use custom URL's
|
227 |
+
$gallery_link = $album->get_meta( 'default_gallery_link', '' );
|
228 |
+
|
229 |
+
if ( 'custom_url' === $gallery_link ) {
|
230 |
+
//check if the gallery has a custom url, and if so, then use it
|
231 |
+
$url = get_post_meta( $gallery->ID, 'custom_url', true );
|
232 |
+
}
|
233 |
+
|
234 |
+
if ( empty( $url ) ) {
|
235 |
+
$slug = foogallery_album_gallery_url_slug();
|
236 |
+
$format = $album->get_meta( 'default_gallery_link_format', 'default' );
|
237 |
+
|
238 |
+
if ( 'default' === $format && 'default' === foogallery_determine_best_link_format_default() ) {
|
239 |
+
$url = untrailingslashit( trailingslashit( get_permalink() ) . $slug . '/' . $gallery->slug );
|
240 |
+
} else {
|
241 |
+
$url = add_query_arg( $slug, $gallery->slug );
|
242 |
+
}
|
243 |
+
|
244 |
+
$use_hash = $album->get_meta( 'default_album_hash', 'remember' );
|
245 |
+
|
246 |
+
if ( 'remember' === $use_hash ) {
|
247 |
+
//add the album hash if required
|
248 |
+
$url .= '#' . $album->slug;
|
249 |
+
}
|
250 |
+
}
|
251 |
+
|
252 |
+
return apply_filters( 'foogallery_album_build_gallery_link', $url );
|
253 |
+
}
|
254 |
+
|
255 |
+
/**
|
256 |
+
* Returns the gallery slug used when generating gallery URL's
|
257 |
+
*
|
258 |
+
* @return string
|
259 |
+
*/
|
260 |
+
function foogallery_album_gallery_url_slug() {
|
261 |
+
$slug = foogallery_get_setting( 'album_gallery_slug', 'gallery' );
|
262 |
+
return apply_filters( 'foogallery_album_gallery_url_slug', $slug );
|
263 |
+
}
|
264 |
+
|
265 |
+
/**
|
266 |
+
* Returns the gallery link target for an album
|
267 |
+
*
|
268 |
+
* @param $album FooGalleryAlbum
|
269 |
+
* @param $gallery FooGallery
|
270 |
+
*
|
271 |
+
* @return string
|
272 |
+
*/
|
273 |
+
function foogallery_album_build_gallery_link_target( $album, $gallery ) {
|
274 |
+
//first check if we want to use custom URL's
|
275 |
+
$gallery_link = $album->get_meta( 'default_gallery_link', '' );
|
276 |
+
|
277 |
+
if ( 'custom_url' === $gallery_link ) {
|
278 |
+
//check if the gallery has a custom target, and if so, then use it
|
279 |
+
$target = get_post_meta( $gallery->ID, 'custom_target', true );
|
280 |
+
}
|
281 |
+
|
282 |
+
if ( empty( $target ) ) {
|
283 |
+
$target = '_self';
|
284 |
+
}
|
285 |
+
|
286 |
+
return apply_filters( 'foogallery_album_build_gallery_link_target', $target );
|
287 |
+
}
|
288 |
+
|
289 |
+
function foogallery_album_get_current_gallery() {
|
290 |
+
$slug = foogallery_album_gallery_url_slug();
|
291 |
+
|
292 |
+
$gallery = get_query_var( $slug );
|
293 |
+
|
294 |
+
if ( empty( $gallery ) ) {
|
295 |
+
$gallery = safe_get_from_request( $slug );
|
296 |
+
}
|
297 |
+
|
298 |
+
return apply_filters( 'foogallery_album_get_current_gallery', $gallery );
|
299 |
+
}
|
300 |
+
|
301 |
+
function foogallery_album_remove_gallery_from_link() {
|
302 |
+
$gallery = foogallery_album_get_current_gallery();
|
303 |
+
$slug = foogallery_album_gallery_url_slug();
|
304 |
+
|
305 |
+
$url = untrailingslashit( remove_query_arg( $slug ) );
|
306 |
+
|
307 |
+
return str_replace( $slug . '/' . $gallery, '', $url);
|
308 |
+
}
|
309 |
+
|
310 |
+
/**
|
311 |
+
* Get a foogallery album template setting for the current foogallery that is being output to the frontend
|
312 |
+
* @param string $key
|
313 |
+
* @param string $default
|
314 |
+
*
|
315 |
+
* @return bool
|
316 |
+
*/
|
317 |
+
function foogallery_album_template_setting( $key, $default = '' ) {
|
318 |
+
global $current_foogallery_album;
|
319 |
+
global $current_foogallery_album_arguments;
|
320 |
+
global $current_foogallery_album_template;
|
321 |
+
|
322 |
+
$settings_key = "{$current_foogallery_album_template}_{$key}";
|
323 |
+
|
324 |
+
if ( $current_foogallery_album_arguments && array_key_exists( $key, $current_foogallery_album_arguments ) ) {
|
325 |
+
//try to get the value from the arguments
|
326 |
+
$value = $current_foogallery_album_arguments[ $key ];
|
327 |
+
|
328 |
+
} else if ( $current_foogallery_album->settings && array_key_exists( $settings_key, $current_foogallery_album->settings ) ) {
|
329 |
+
//then get the value out of the saved gallery settings
|
330 |
+
$value = $current_foogallery_album->settings[ $settings_key ];
|
331 |
+
} else {
|
332 |
+
//otherwise set it to the default
|
333 |
+
$value = $default;
|
334 |
+
}
|
335 |
+
|
336 |
+
$value = apply_filters( 'foogallery_album_template_setting-' . $key, $value );
|
337 |
+
|
338 |
+
return $value;
|
339 |
+
}
|
340 |
+
|
341 |
+
/**
|
342 |
+
* uninstall all albums and setting for albums
|
343 |
+
*/
|
344 |
+
function foogallery_album_uninstall() {
|
345 |
+
if ( !current_user_can( 'install_plugins' ) ) exit;
|
346 |
+
|
347 |
+
//delete all albums posts
|
348 |
+
global $wpdb;
|
349 |
+
$query = "SELECT p.ID FROM {$wpdb->posts} AS p WHERE p.post_type IN (%s)";
|
350 |
+
$gallery_post_ids = $wpdb->get_col( $wpdb->prepare( $query, FOOGALLERY_CPT_ALBUM ) );
|
351 |
+
|
352 |
+
if ( !empty( $gallery_post_ids ) ) {
|
353 |
+
$deleted = 0;
|
354 |
+
foreach ( $gallery_post_ids as $post_id ) {
|
355 |
+
$del = wp_delete_post( $post_id );
|
356 |
+
if ( false !== $del ) {
|
357 |
+
++$deleted;
|
358 |
+
}
|
359 |
+
}
|
360 |
+
}
|
361 |
+
}
|
extensions/albums/js/admin-foogallery-album.js
ADDED
@@ -0,0 +1,148 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
(function(FOOGALLERYALBUM, $, undefined) {
|
2 |
+
|
3 |
+
FOOGALLERYALBUM.bindElements = function() {
|
4 |
+
$('.foogallery-album-gallery-list')
|
5 |
+
.on('click', '.foogallery-gallery-select', function(e) {
|
6 |
+
$(this).toggleClass('selected');
|
7 |
+
FOOGALLERYALBUM.changeSelection();
|
8 |
+
})
|
9 |
+
.sortable({
|
10 |
+
items: 'li',
|
11 |
+
distance: 10,
|
12 |
+
placeholder: 'attachment placeholder',
|
13 |
+
stop : function() {
|
14 |
+
FOOGALLERYALBUM.changeSelection();
|
15 |
+
}
|
16 |
+
});
|
17 |
+
|
18 |
+
//init any colorpickers
|
19 |
+
$('.colorpicker').spectrum({
|
20 |
+
preferredFormat: "rgb",
|
21 |
+
showInput: true,
|
22 |
+
clickoutFiresChange: true
|
23 |
+
});
|
24 |
+
|
25 |
+
$('.foogallery-album-info-modal').prependTo('body');
|
26 |
+
};
|
27 |
+
|
28 |
+
FOOGALLERYALBUM.changeSelection = function() {
|
29 |
+
var ids = '',
|
30 |
+
none = true;
|
31 |
+
$('.foogallery-gallery-select.selected').each(function() {
|
32 |
+
ids += $(this).data('foogallery-id') + ',';
|
33 |
+
none = false;
|
34 |
+
});
|
35 |
+
|
36 |
+
if (!none) {
|
37 |
+
ids = ids.substring(0, ids.length - 1);
|
38 |
+
}
|
39 |
+
//build up the list of ids
|
40 |
+
$('#foogallery_album_galleries').val(ids);
|
41 |
+
};
|
42 |
+
|
43 |
+
FOOGALLERYALBUM.initSettings = function() {
|
44 |
+
$('#FooGallerySettings_AlbumTemplate').change(function() {
|
45 |
+
var $this = $(this),
|
46 |
+
selectedTemplate = $this.val();
|
47 |
+
|
48 |
+
//hide all template fields
|
49 |
+
$('.foogallery-album-metabox-settings .foogallery_template_field').not('.foogallery_template_field_selector').hide();
|
50 |
+
|
51 |
+
//show all fields for the selected template only
|
52 |
+
$('.foogallery-album-metabox-settings .foogallery_template_field-' + selectedTemplate).show();
|
53 |
+
|
54 |
+
//trigger a change so custom template js can do something
|
55 |
+
FOOGALLERYALBUM.triggerTemplateChangedEvent();
|
56 |
+
});
|
57 |
+
|
58 |
+
//trigger this onload too!
|
59 |
+
FOOGALLERYALBUM.triggerTemplateChangedEvent();
|
60 |
+
};
|
61 |
+
|
62 |
+
FOOGALLERYALBUM.triggerTemplateChangedEvent = function() {
|
63 |
+
var selectedTemplate = $('#FooGallerySettings_AlbumTemplate').val();
|
64 |
+
$('body').trigger('foogallery-album-template-changed-' + selectedTemplate );
|
65 |
+
};
|
66 |
+
|
67 |
+
FOOGALLERYALBUM.initAlbumInfoButtons = function() {
|
68 |
+
$('.foogallery-album-gallery-list .attachment-preview').on('click', 'a.info', function(e) {
|
69 |
+
|
70 |
+
e.preventDefault();
|
71 |
+
|
72 |
+
e.stopPropagation();
|
73 |
+
|
74 |
+
var $this = $(this),
|
75 |
+
$modal = $('.foogallery-album-info-modal'),
|
76 |
+
$spinner = $modal.find('.media-frame-title .spinner'),
|
77 |
+
$nonce = $modal.find('#foogallery_album_gallery_details_nonce'),
|
78 |
+
$details = $modal.find('.gallery-details'),
|
79 |
+
data = 'action=foogallery_get_gallery_details' +
|
80 |
+
'&foogallery_id=' + $this.data('gallery-id') +
|
81 |
+
'&_wpnonce=' + $nonce.val() +
|
82 |
+
'&_wp_http_referer=' + encodeURIComponent($('input[name="_wp_http_referer"]').val());
|
83 |
+
|
84 |
+
$details.html( $details.data('loading') + $this.data('gallery-title') + '...' );
|
85 |
+
$spinner.addClass('is-active');
|
86 |
+
|
87 |
+
$.ajax({
|
88 |
+
type: "POST",
|
89 |
+
url: ajaxurl,
|
90 |
+
data: data,
|
91 |
+
success: function(data) {
|
92 |
+
$details.html(data);
|
93 |
+
},
|
94 |
+
complete: function() {
|
95 |
+
$spinner.removeClass('is-active');
|
96 |
+
}
|
97 |
+
});
|
98 |
+
|
99 |
+
$modal.show();
|
100 |
+
$('.media-modal-backdrop').show();
|
101 |
+
});
|
102 |
+
|
103 |
+
$('.foogallery-album-info-modal .gallery-details-save').on('click', function(e) {
|
104 |
+
e.preventDefault();
|
105 |
+
|
106 |
+
var $this = $(this),
|
107 |
+
$modal = $('.foogallery-album-info-modal'),
|
108 |
+
$spinner = $modal.find('.media-frame-toolbar .spinner'),
|
109 |
+
$nonce = $modal.find('#foogallery_album_gallery_details_nonce'),
|
110 |
+
$form = $modal.find('form[name="foogallery_gallery_details"]'),
|
111 |
+
data = 'action=foogallery_save_gallery_details' +
|
112 |
+
'&_wpnonce=' + $nonce.val() +
|
113 |
+
'&_wp_http_referer=' + encodeURIComponent($('input[name="_wp_http_referer"]').val()) +
|
114 |
+
'& ' + $form.serialize();
|
115 |
+
|
116 |
+
$this.attr('disabled', 'disabled');
|
117 |
+
$spinner.addClass('is-active');
|
118 |
+
|
119 |
+
$.ajax({
|
120 |
+
type: "POST",
|
121 |
+
url: ajaxurl,
|
122 |
+
data: data,
|
123 |
+
success: function() {
|
124 |
+
$('.foogallery-album-info-modal').hide();
|
125 |
+
$('.media-modal-backdrop').hide();
|
126 |
+
},
|
127 |
+
complete: function() {
|
128 |
+
$spinner.removeClass('is-active');
|
129 |
+
$this.removeAttr('disabled');
|
130 |
+
}
|
131 |
+
});
|
132 |
+
});
|
133 |
+
|
134 |
+
$('.foogallery-album-info-modal .media-modal-close').on('click', function() {
|
135 |
+
$('.foogallery-album-info-modal').hide();
|
136 |
+
$('.media-modal-backdrop').hide();
|
137 |
+
});
|
138 |
+
};
|
139 |
+
|
140 |
+
$(function() { //wait for ready
|
141 |
+
FOOGALLERYALBUM.bindElements();
|
142 |
+
|
143 |
+
FOOGALLERYALBUM.initSettings();
|
144 |
+
|
145 |
+
FOOGALLERYALBUM.initAlbumInfoButtons();
|
146 |
+
});
|
147 |
+
|
148 |
+
}(window.FOOGALLERYALBUM = window.FOOGALLERYALBUM || {}, jQuery));
|
extensions/albums/js/album-stack.js
ADDED
@@ -0,0 +1,863 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* Modernizr 2.8.3 (Custom Build) | MIT & BSD
|
2 |
+
* Build: http://modernizr.com/download/#-csstransitions-prefixed-testprop-testallprops-domprefixes
|
3 |
+
*/
|
4 |
+
if (!window.FooGalleryStackAlbumModernizr) {
|
5 |
+
window.FooGalleryStackAlbumModernizr=function(a,b,c){function w(a){i.cssText=a}function x(a,b){return w(prefixes.join(a+";")+(b||""))}function y(a,b){return typeof a===b}function z(a,b){return!!~(""+a).indexOf(b)}function A(a,b){for(var d in a){var e=a[d];if(!z(e,"-")&&i[e]!==c)return b=="pfx"?e:!0}return!1}function B(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:y(f,"function")?f.bind(d||b):f}return!1}function C(a,b,c){var d=a.charAt(0).toUpperCase()+a.slice(1),e=(a+" "+m.join(d+" ")+d).split(" ");return y(b,"string")||y(b,"undefined")?A(e,b):(e=(a+" "+n.join(d+" ")+d).split(" "),B(e,b,c))}var d="2.8.3",e={},f=b.documentElement,g="modernizr",h=b.createElement(g),i=h.style,j,k={}.toString,l="Webkit Moz O ms",m=l.split(" "),n=l.toLowerCase().split(" "),o={},p={},q={},r=[],s=r.slice,t,u={}.hasOwnProperty,v;!y(u,"undefined")&&!y(u.call,"undefined")?v=function(a,b){return u.call(a,b)}:v=function(a,b){return b in a&&y(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=s.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(s.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(s.call(arguments)))};return e}),o.csstransitions=function(){return C("transition")};for(var D in o)v(o,D)&&(t=D.toLowerCase(),e[t]=o[D](),r.push((e[t]?"":"no-")+t));return e.addTest=function(a,b){if(typeof a=="object")for(var d in a)v(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,typeof enableClasses!="undefined"&&enableClasses&&(f.className+=" "+(b?"":"no-")+a),e[a]=b}return e},w(""),h=j=null,e._version=d,e._domPrefixes=n,e._cssomPrefixes=m,e.testProp=function(a){return A([a])},e.testAllProps=C,e.prefixed=function(a,b,c){return b?C(a,b,c):C(a,"pfx")},e}(this,this.document);
|
6 |
+
}
|
7 |
+
|
8 |
+
/**
|
9 |
+
* jquery.stapel.js v1.0.0
|
10 |
+
* http://www.codrops.com
|
11 |
+
*
|
12 |
+
* Licensed under the MIT license.
|
13 |
+
* http://www.opensource.org/licenses/mit-license.php
|
14 |
+
*
|
15 |
+
* Copyright 2012, Codrops
|
16 |
+
* http://www.codrops.com
|
17 |
+
*/
|
18 |
+
;( function( $, window, undefined ) {
|
19 |
+
|
20 |
+
'use strict';
|
21 |
+
|
22 |
+
/*
|
23 |
+
* debouncedresize: special jQuery event that happens once after a window resize
|
24 |
+
*
|
25 |
+
* latest version and complete README available on Github:
|
26 |
+
* https://github.com/louisremi/jquery-smartresize/blob/master/jquery.debouncedresize.js
|
27 |
+
*
|
28 |
+
* Copyright 2011 @louis_remi
|
29 |
+
* Licensed under the MIT license.
|
30 |
+
*/
|
31 |
+
var $event = $.event,
|
32 |
+
$special,
|
33 |
+
resizeTimeout;
|
34 |
+
|
35 |
+
$special = $event.special.debouncedresize = {
|
36 |
+
setup: function() {
|
37 |
+
$( this ).on( "resize", $special.handler );
|
38 |
+
},
|
39 |
+
teardown: function() {
|
40 |
+
$( this ).off( "resize", $special.handler );
|
41 |
+
},
|
42 |
+
handler: function( event, execAsap ) {
|
43 |
+
// Save the context
|
44 |
+
var context = this,
|
45 |
+
args = arguments,
|
46 |
+
dispatch = function() {
|
47 |
+
// set correct event type
|
48 |
+
event.type = "debouncedresize";
|
49 |
+
$event.dispatch.apply( context, args );
|
50 |
+
};
|
51 |
+
|
52 |
+
if ( resizeTimeout ) {
|
53 |
+
clearTimeout( resizeTimeout );
|
54 |
+
}
|
55 |
+
|
56 |
+
execAsap ?
|
57 |
+
dispatch() :
|
58 |
+
resizeTimeout = setTimeout( dispatch, $special.threshold );
|
59 |
+
},
|
60 |
+
threshold: 150
|
61 |
+
};
|
62 |
+
|
63 |
+
// ======================= imagesLoaded Plugin ===============================
|
64 |
+
// https://github.com/desandro/imagesloaded
|
65 |
+
|
66 |
+
// $('#my-container').imagesLoaded(myFunction)
|
67 |
+
// execute a callback when all images have loaded.
|
68 |
+
// needed because .load() doesn't work on cached images
|
69 |
+
|
70 |
+
// callback function gets image collection as argument
|
71 |
+
// this is the container
|
72 |
+
|
73 |
+
// original: mit license. paul irish. 2010.
|
74 |
+
// contributors: Oren Solomianik, David DeSandro, Yiannis Chatzikonstantinou
|
75 |
+
|
76 |
+
// blank image data-uri bypasses webkit log warning (thx doug jones)
|
77 |
+
var BLANK = 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==';
|
78 |
+
|
79 |
+
$.fn.imagesLoaded = function( callback ) {
|
80 |
+
var $this = this,
|
81 |
+
deferred = $.isFunction($.Deferred) ? $.Deferred() : 0,
|
82 |
+
hasNotify = $.isFunction(deferred.notify),
|
83 |
+
$images = $this.find('img').add( $this.filter('img') ),
|
84 |
+
loaded = [],
|
85 |
+
proper = [],
|
86 |
+
broken = [];
|
87 |
+
|
88 |
+
// Register deferred callbacks
|
89 |
+
if ($.isPlainObject(callback)) {
|
90 |
+
$.each(callback, function (key, value) {
|
91 |
+
if (key === 'callback') {
|
92 |
+
callback = value;
|
93 |
+
} else if (deferred) {
|
94 |
+
deferred[key](value);
|
95 |
+
}
|
96 |
+
});
|
97 |
+
}
|
98 |
+
|
99 |
+
function doneLoading() {
|
100 |
+
var $proper = $(proper),
|
101 |
+
$broken = $(broken);
|
102 |
+
|
103 |
+
if ( deferred ) {
|
104 |
+
if ( broken.length ) {
|
105 |
+
deferred.reject( $images, $proper, $broken );
|
106 |
+
} else {
|
107 |
+
deferred.resolve( $images );
|
108 |
+
}
|
109 |
+
}
|
110 |
+
|
111 |
+
if ( $.isFunction( callback ) ) {
|
112 |
+
callback.call( $this, $images, $proper, $broken );
|
113 |
+
}
|
114 |
+
}
|
115 |
+
|
116 |
+
function imgLoaded( img, isBroken ) {
|
117 |
+
// don't proceed if BLANK image, or image is already loaded
|
118 |
+
if ( img.src === BLANK || $.inArray( img, loaded ) !== -1 ) {
|
119 |
+
return;
|
120 |
+
}
|
121 |
+
|
122 |
+
// store element in loaded images array
|
123 |
+
loaded.push( img );
|
124 |
+
|
125 |
+
// keep track of broken and properly loaded images
|
126 |
+
if ( isBroken ) {
|
127 |
+
broken.push( img );
|
128 |
+
} else {
|
129 |
+
proper.push( img );
|
130 |
+
}
|
131 |
+
|
132 |
+
// cache image and its state for future calls
|
133 |
+
$.data( img, 'imagesLoaded', { isBroken: isBroken, src: img.src } );
|
134 |
+
|
135 |
+
// trigger deferred progress method if present
|
136 |
+
if ( hasNotify ) {
|
137 |
+
deferred.notifyWith( $(img), [ isBroken, $images, $(proper), $(broken) ] );
|
138 |
+
}
|
139 |
+
|
140 |
+
// call doneLoading and clean listeners if all images are loaded
|
141 |
+
if ( $images.length === loaded.length ){
|
142 |
+
setTimeout( doneLoading );
|
143 |
+
$images.unbind( '.imagesLoaded' );
|
144 |
+
}
|
145 |
+
}
|
146 |
+
|
147 |
+
// if no images, trigger immediately
|
148 |
+
if ( !$images.length ) {
|
149 |
+
doneLoading();
|
150 |
+
} else {
|
151 |
+
$images.bind( 'load.imagesLoaded error.imagesLoaded', function( event ){
|
152 |
+
// trigger imgLoaded
|
153 |
+
imgLoaded( event.target, event.type === 'error' );
|
154 |
+
}).each( function( i, el ) {
|
155 |
+
var src = el.src;
|
156 |
+
|
157 |
+
// find out if this image has been already checked for status
|
158 |
+
// if it was, and src has not changed, call imgLoaded on it
|
159 |
+
var cached = $.data( el, 'imagesLoaded' );
|
160 |
+
if ( cached && cached.src === src ) {
|
161 |
+
imgLoaded( el, cached.isBroken );
|
162 |
+
return;
|
163 |
+
}
|
164 |
+
|
165 |
+
// if complete is true and browser supports natural sizes, try
|
166 |
+
// to check for image status manually
|
167 |
+
if ( el.complete && el.naturalWidth !== undefined ) {
|
168 |
+
imgLoaded( el, el.naturalWidth === 0 || el.naturalHeight === 0 );
|
169 |
+
return;
|
170 |
+
}
|
171 |
+
|
172 |
+
// cached images don't fire load sometimes, so we reset src, but only when
|
173 |
+
// dealing with IE, or image is complete (loaded) and failed manual check
|
174 |
+
// webkit hack from http://groups.google.com/group/jquery-dev/browse_thread/thread/eee6ab7b2da50e1f
|
175 |
+
if ( el.readyState || el.complete ) {
|
176 |
+
el.src = BLANK;
|
177 |
+
el.src = src;
|
178 |
+
}
|
179 |
+
});
|
180 |
+
}
|
181 |
+
|
182 |
+
return deferred ? deferred.promise( $this ) : $this;
|
183 |
+
};
|
184 |
+
|
185 |
+
// global
|
186 |
+
var $window = $( window ),
|
187 |
+
FooGalleryStackAlbumModernizr = window.FooGalleryStackAlbumModernizr;
|
188 |
+
|
189 |
+
$.Stapel = function( options, element ) {
|
190 |
+
|
191 |
+
this.el = $( element );
|
192 |
+
this._init( options );
|
193 |
+
|
194 |
+
};
|
195 |
+
|
196 |
+
// the options
|
197 |
+
$.Stapel.defaults = {
|
198 |
+
// space between the items
|
199 |
+
gutter : 40,
|
200 |
+
// the rotations degree for the 2nd and 3rd item
|
201 |
+
// (to give a more realistic pile effect)
|
202 |
+
pileAngles : 2,
|
203 |
+
// animation settings for the clicked pile's items
|
204 |
+
pileAnimation : {
|
205 |
+
openSpeed : 400,
|
206 |
+
openEasing : 'ease-in-out', // try this :) 'cubic-bezier(.47,1.34,.9,1.03)',
|
207 |
+
closeSpeed : 400,
|
208 |
+
closeEasing : 'ease-in-out'
|
209 |
+
},
|
210 |
+
// animation settings for the other piles
|
211 |
+
otherPileAnimation : {
|
212 |
+
openSpeed : 400,
|
213 |
+
openEasing : 'ease-in-out',
|
214 |
+
closeSpeed : 350,
|
215 |
+
closeEasing : 'ease-in-out'
|
216 |
+
},
|
217 |
+
// delay for each item of the pile
|
218 |
+
delay : 0,
|
219 |
+
// random rotation for the items once opened
|
220 |
+
randomAngle : false,
|
221 |
+
onLoad : function() { return false; },
|
222 |
+
onBeforeOpen : function( pileName ) { return false; },
|
223 |
+
onAfterOpen : function( pileName, totalItems ) { return false; },
|
224 |
+
onBeforeClose : function( pileName ) { return false; },
|
225 |
+
onAfterClose : function( pileName, totalItems ) { return false; }
|
226 |
+
};
|
227 |
+
|
228 |
+
$.Stapel.prototype = {
|
229 |
+
|
230 |
+
_init : function( options ) {
|
231 |
+
|
232 |
+
// options
|
233 |
+
this.options = $.extend( true, {}, $.Stapel.defaults, options );
|
234 |
+
|
235 |
+
// cache some elements
|
236 |
+
this._config();
|
237 |
+
|
238 |
+
// preload images
|
239 |
+
var self = this;
|
240 |
+
this.el.imagesLoaded( function() {
|
241 |
+
self.options.onLoad();
|
242 |
+
self._layout();
|
243 |
+
self._initEvents();
|
244 |
+
if (typeof FOOBOX != 'undefined') {
|
245 |
+
FOOBOX.init();
|
246 |
+
}
|
247 |
+
} );
|
248 |
+
|
249 |
+
},
|
250 |
+
_config : function() {
|
251 |
+
|
252 |
+
// css transitions support
|
253 |
+
this.support = FooGalleryStackAlbumModernizr.csstransitions;
|
254 |
+
|
255 |
+
var transEndEventNames = {
|
256 |
+
'WebkitTransition' : 'webkitTransitionEnd',
|
257 |
+
'MozTransition' : 'transitionend',
|
258 |
+
'OTransition' : 'oTransitionEnd',
|
259 |
+
'msTransition' : 'MSTransitionEnd',
|
260 |
+
'transition' : 'transitionend'
|
261 |
+
},
|
262 |
+
transformNames = {
|
263 |
+
'WebkitTransform' : '-webkit-transform',
|
264 |
+
'MozTransform' : '-moz-transform',
|
265 |
+
'OTransform' : '-o-transform',
|
266 |
+
'msTransform' : '-ms-transform',
|
267 |
+
'transform' : 'transform'
|
268 |
+
};
|
269 |
+
|
270 |
+
if( this.support ) {
|
271 |
+
|
272 |
+
this.transEndEventName = transEndEventNames[ FooGalleryStackAlbumModernizr.prefixed( 'transition' ) ] + '.cbpFWSlider';
|
273 |
+
this.transformName = transformNames[ FooGalleryStackAlbumModernizr.prefixed( 'transform' ) ];
|
274 |
+
|
275 |
+
}
|
276 |
+
|
277 |
+
// true if one pile is opened
|
278 |
+
this.spread = false;
|
279 |
+
|
280 |
+
// the li's
|
281 |
+
this.items = this.el.children( 'li' ).hide();
|
282 |
+
|
283 |
+
// close pile
|
284 |
+
this.close = $( '#tp-close' );
|
285 |
+
|
286 |
+
},
|
287 |
+
_getSize : function() {
|
288 |
+
|
289 |
+
this.elWidth = this.el.outerWidth( true );
|
290 |
+
|
291 |
+
},
|
292 |
+
_initEvents : function() {
|
293 |
+
|
294 |
+
var self = this;
|
295 |
+
$window.on( 'debouncedresize.stapel', function() { self._resize(); } );
|
296 |
+
this.items.on( 'click.stapel', function() {
|
297 |
+
|
298 |
+
var $item = $( this );
|
299 |
+
|
300 |
+
if( !self.spread && $item.data( 'isPile' ) ) {
|
301 |
+
|
302 |
+
self.spread = true;
|
303 |
+
self.pileName = $item.data( 'pileName' );
|
304 |
+
self.options.onBeforeOpen( self.pileName );
|
305 |
+
self._openPile();
|
306 |
+
|
307 |
+
return false;
|
308 |
+
|
309 |
+
}
|
310 |
+
|
311 |
+
} );
|
312 |
+
|
313 |
+
},
|
314 |
+
_layout : function() {
|
315 |
+
|
316 |
+
/*
|
317 |
+
piles() : save the items info in a object with the following structure:
|
318 |
+
|
319 |
+
this.piles = {
|
320 |
+
|
321 |
+
pileName : {
|
322 |
+
|
323 |
+
// elements of this pile (note that an element can be also in a different pile)
|
324 |
+
// for each element, the finalPosition is the position of the element when the pile is opened
|
325 |
+
elements : [
|
326 |
+
{ el : HTMLELEMENT, finalPosition : { left : LEFT, top : TOP } },
|
327 |
+
{},
|
328 |
+
{},
|
329 |
+
...
|
330 |
+
],
|
331 |
+
// this is the position of the pile (all elements of the pile) when the pile is closed
|
332 |
+
position : { left : LEFT, top : TOP },
|
333 |
+
index : INDEX
|
334 |
+
},
|
335 |
+
|
336 |
+
// more piles
|
337 |
+
...
|
338 |
+
|
339 |
+
}
|
340 |
+
*/
|
341 |
+
this._piles();
|
342 |
+
|
343 |
+
// items width & height
|
344 |
+
// assuming here that all items have the same width and height
|
345 |
+
this.itemSize = { width : this.items.outerWidth( true ) , height : this.items.outerHeight( true ) };
|
346 |
+
|
347 |
+
// remove original elements
|
348 |
+
this.items.remove();
|
349 |
+
|
350 |
+
// applies some initial style for the items
|
351 |
+
this._setInitialStyle();
|
352 |
+
|
353 |
+
this.el.css( 'min-width', this.itemSize.width + this.options.gutter );
|
354 |
+
|
355 |
+
// gets the current ul size (needed for the calculation of each item's position)
|
356 |
+
this._getSize();
|
357 |
+
|
358 |
+
// calculate and set each Pile's elements position based on the current ul width
|
359 |
+
// this function will also be called on window resize
|
360 |
+
this._setItemsPosition();
|
361 |
+
|
362 |
+
// new items
|
363 |
+
this.items = this.el.children( 'li' ).show();
|
364 |
+
// total items
|
365 |
+
this.itemsCount = this.items.length;
|
366 |
+
|
367 |
+
},
|
368 |
+
_piles : function() {
|
369 |
+
|
370 |
+
var piles = {};
|
371 |
+
this.pilesArr = [];
|
372 |
+
var pile, self = this, idx = 0;
|
373 |
+
this.items.each( function() {
|
374 |
+
|
375 |
+
var $item = $( this ),
|
376 |
+
itemPile = $item.attr( 'data-pile' ) || 'nopile-' + $item.index(),
|
377 |
+
attr = itemPile.split( ',' );
|
378 |
+
|
379 |
+
for( var i = 0, total = attr.length; i < total; ++i ) {
|
380 |
+
|
381 |
+
var pileName = $.trim( attr[i] );
|
382 |
+
pile = piles[ pileName ];
|
383 |
+
|
384 |
+
if( !pile ) {
|
385 |
+
|
386 |
+
pile = piles[ pileName ] = {
|
387 |
+
name : pileName,
|
388 |
+
elements : [],
|
389 |
+
position : { left : 0, top : 0 },
|
390 |
+
index : idx
|
391 |
+
};
|
392 |
+
|
393 |
+
self.pilesArr.push(pile);
|
394 |
+
|
395 |
+
++idx;
|
396 |
+
|
397 |
+
}
|
398 |
+
|
399 |
+
var clone = $item.clone().get(0);
|
400 |
+
pile.elements.push( { el : clone, finalPosition : { left : 0, top : 0 } } );
|
401 |
+
var $clone = $(clone);
|
402 |
+
$clone.appendTo(self.el);
|
403 |
+
}
|
404 |
+
|
405 |
+
} );
|
406 |
+
|
407 |
+
},
|
408 |
+
_setInitialStyle : function() {
|
409 |
+
for (var j =0, pile_len = this.pilesArr.length; j < pile_len; j++){
|
410 |
+
|
411 |
+
var p = this.pilesArr[j];
|
412 |
+
|
413 |
+
for( var i = 0, len = p.elements.length; i < len; ++i ) {
|
414 |
+
|
415 |
+
var $el = $( p.elements[i].el ),
|
416 |
+
styleCSS = { transform : 'rotate(0deg)' };
|
417 |
+
|
418 |
+
this._applyInitialTransition( $el );
|
419 |
+
|
420 |
+
if( i === len - 2 ) {
|
421 |
+
styleCSS = { transform : 'rotate(' + this.options.pileAngles + 'deg)' };
|
422 |
+
}
|
423 |
+
else if( i === len - 3 ) {
|
424 |
+
styleCSS = { transform : 'rotate(-' + this.options.pileAngles + 'deg)' };
|
425 |
+
}
|
426 |
+
else if( i !== len - 1 ) {
|
427 |
+
var extraStyle = { visibility : 'hidden' };
|
428 |
+
$el.css( extraStyle ).data( 'extraStyle', extraStyle );
|
429 |
+
}
|
430 |
+
else if( p.name.substr( 0, 6 ) !== 'nopile' ) {
|
431 |
+
$el.data( 'front', true ).append( '<div class="tp-title-cover"><div class="tp-title"><span>' + p.name + '</span><span>' + len + '</span></div></div>' );
|
432 |
+
}
|
433 |
+
|
434 |
+
$el.css( styleCSS ).data( {
|
435 |
+
initialStyle : styleCSS,
|
436 |
+
pileName : p.name,
|
437 |
+
pileCount : len,
|
438 |
+
shadow : $el.css( 'box-shadow' ),
|
439 |
+
isPile : p.name.substr( 0, 6 ) === 'nopile' ? false : true
|
440 |
+
} );
|
441 |
+
|
442 |
+
}
|
443 |
+
|
444 |
+
}
|
445 |
+
|
446 |
+
},
|
447 |
+
_applyInitialTransition : function( $el ) {
|
448 |
+
|
449 |
+
if( this.support ) {
|
450 |
+
$el.css( 'transition', 'left 400ms ease-in-out, top 400ms ease-in-out' );
|
451 |
+
}
|
452 |
+
|
453 |
+
},
|
454 |
+
_setItemsPosition : function() {
|
455 |
+
|
456 |
+
var accumL = 0, accumT = 0,
|
457 |
+
l, t, ml = 0,
|
458 |
+
lastItemTop = 0;
|
459 |
+
|
460 |
+
for (var j =0, pile_len = this.pilesArr.length; j < pile_len; j++){
|
461 |
+
|
462 |
+
var p = this.pilesArr[j],
|
463 |
+
|
464 |
+
//for( var pile in this.piles ) {
|
465 |
+
//
|
466 |
+
// var p = this.piles[pile],
|
467 |
+
stepW = this.itemSize.width + this.options.gutter,
|
468 |
+
|
469 |
+
accumIL = 0, accumIT = 0, il, it;
|
470 |
+
|
471 |
+
if( accumL + stepW <= this.elWidth ) {
|
472 |
+
|
473 |
+
l = accumL;
|
474 |
+
t = accumT;
|
475 |
+
accumL += stepW;
|
476 |
+
|
477 |
+
}
|
478 |
+
else {
|
479 |
+
|
480 |
+
if( ml === 0 ) {
|
481 |
+
ml = Math.ceil( ( this.elWidth - accumL + this.options.gutter ) / 2 );
|
482 |
+
}
|
483 |
+
|
484 |
+
accumT += this.itemSize.height + this.options.gutter;
|
485 |
+
l = 0;
|
486 |
+
t = accumT;
|
487 |
+
accumL = stepW;
|
488 |
+
|
489 |
+
}
|
490 |
+
|
491 |
+
p.position.left = l;
|
492 |
+
p.position.top = t;
|
493 |
+
|
494 |
+
for( var i = 0, len = p.elements.length; i < len; ++i ) {
|
495 |
+
|
496 |
+
var elem = p.elements[i],
|
497 |
+
fp = elem.finalPosition;
|
498 |
+
|
499 |
+
if( accumIL + stepW <= this.elWidth ) {
|
500 |
+
|
501 |
+
il = accumIL;
|
502 |
+
it = accumIT;
|
503 |
+
accumIL += stepW;
|
504 |
+
|
505 |
+
}
|
506 |
+
else {
|
507 |
+
|
508 |
+
accumIT += this.itemSize.height + this.options.gutter;
|
509 |
+
il = 0;
|
510 |
+
it = accumIT;
|
511 |
+
accumIL = stepW;
|
512 |
+
|
513 |
+
}
|
514 |
+
|
515 |
+
fp.left = il;
|
516 |
+
fp.top = it;
|
517 |
+
|
518 |
+
var $el = $( elem.el );
|
519 |
+
|
520 |
+
if(p.name !== this.pileName ) {
|
521 |
+
|
522 |
+
$el.css( { left : p.position.left, top : p.position.top } );
|
523 |
+
|
524 |
+
}
|
525 |
+
else {
|
526 |
+
|
527 |
+
lastItemTop = elem.finalPosition.top;
|
528 |
+
$el.css( { left : elem.finalPosition.left, top : lastItemTop } );
|
529 |
+
|
530 |
+
}
|
531 |
+
|
532 |
+
}
|
533 |
+
|
534 |
+
}
|
535 |
+
|
536 |
+
if( ml === 0 ) {
|
537 |
+
ml = Math.ceil( ( this.elWidth - accumL + this.options.gutter ) / 2 );
|
538 |
+
}
|
539 |
+
|
540 |
+
// the position of the items will influence the final margin left value and height for the ul
|
541 |
+
// center the ul
|
542 |
+
lastItemTop = this.spread ? lastItemTop : accumT;
|
543 |
+
this.el.css( {
|
544 |
+
marginLeft : ml,
|
545 |
+
height : lastItemTop + this.itemSize.height
|
546 |
+
} );
|
547 |
+
|
548 |
+
},
|
549 |
+
_openPile : function() {
|
550 |
+
|
551 |
+
if( !this.spread ) {
|
552 |
+
return false;
|
553 |
+
}
|
554 |
+
|
555 |
+
// final style
|
556 |
+
var fs;
|
557 |
+
|
558 |
+
for (var j =0, pile_len = this.pilesArr.length; j < pile_len; j++){
|
559 |
+
|
560 |
+
var p = this.pilesArr[j],
|
561 |
+
|
562 |
+
//for( var pile in this.piles ) {
|
563 |
+
//
|
564 |
+
// var p = this.piles[ pile ],
|
565 |
+
|
566 |
+
cnt = 0;
|
567 |
+
|
568 |
+
for( var i = 0, len = p.elements.length; i < len; ++i ) {
|
569 |
+
|
570 |
+
var elem = p.elements[i],
|
571 |
+
$item = $( elem.el ),
|
572 |
+
$img = $item.find( 'img' ),
|
573 |
+
styleCSS = p.name === this.pileName ? {
|
574 |
+
zIndex : 9999,
|
575 |
+
visibility : 'visible',
|
576 |
+
transition : this.support ? 'left ' + this.options.pileAnimation.openSpeed + 'ms ' + ( ( len - i - 1 ) * this.options.delay ) + 'ms ' + this.options.pileAnimation.openEasing + ', top ' + this.options.pileAnimation.openSpeed + 'ms ' + ( ( len - i - 1 ) * this.options.delay ) + 'ms ' + this.options.pileAnimation.openEasing + ', ' + this.transformName + ' ' + this.options.pileAnimation.openSpeed + 'ms ' + ( ( len - i - 1 ) * this.options.delay ) + 'ms ' + this.options.pileAnimation.openEasing : 'none'
|
577 |
+
} : {
|
578 |
+
zIndex : 1,
|
579 |
+
transition : this.support ? 'opacity ' + this.options.otherPileAnimation.closeSpeed + 'ms ' + this.options.otherPileAnimation.closeEasing : 'none'
|
580 |
+
};
|
581 |
+
|
582 |
+
if( p.name === this.pileName ) {
|
583 |
+
|
584 |
+
if( $item.data( 'front' ) ) {
|
585 |
+
$item.find( 'div.tp-title' ).hide();
|
586 |
+
}
|
587 |
+
|
588 |
+
if( i < len - 1 ) {
|
589 |
+
$img.css( 'visibility', 'visible' );
|
590 |
+
}
|
591 |
+
|
592 |
+
fs = elem.finalPosition;
|
593 |
+
fs.transform = this.options.randomAngle && i !== p.index ? 'rotate(' + Math.floor( Math.random() * ( 5 + 5 + 1 ) - 5 ) + 'deg)' : 'none';
|
594 |
+
|
595 |
+
if( !this.support ) {
|
596 |
+
$item.css( 'transform', 'none' );
|
597 |
+
}
|
598 |
+
|
599 |
+
// hack: remove box-shadow while animating to prevent the shadow stack effect
|
600 |
+
if( i < len - 3 ) {
|
601 |
+
$item.css( 'box-shadow', 'none' );
|
602 |
+
}
|
603 |
+
|
604 |
+
}
|
605 |
+
else if( i < len - 1 ) {
|
606 |
+
$img.css( 'visibility', 'hidden' );
|
607 |
+
}
|
608 |
+
|
609 |
+
$item.css( styleCSS );
|
610 |
+
|
611 |
+
var self = this;
|
612 |
+
|
613 |
+
p.name === this.pileName ?
|
614 |
+
this._applyTransition( $item, fs, this.options.pileAnimation.openSpeed, function( evt ) {
|
615 |
+
|
616 |
+
var target = this.target || this.nodeName;
|
617 |
+
if( target !== 'LI' ) {
|
618 |
+
return;
|
619 |
+
}
|
620 |
+
|
621 |
+
var $el = $( this );
|
622 |
+
|
623 |
+
// hack: remove box-shadow while animating to prevent the shadow stack effect
|
624 |
+
$el.css( 'box-shadow', $el.data( 'shadow' ) );
|
625 |
+
|
626 |
+
if( self.support ) {
|
627 |
+
$el.off( self.transEndEventName );
|
628 |
+
}
|
629 |
+
|
630 |
+
++cnt;
|
631 |
+
|
632 |
+
if( cnt === $el.data( 'pileCount' ) ) {
|
633 |
+
|
634 |
+
$( document ).one( 'mousemove.stapel', function() {
|
635 |
+
self.el.addClass( 'tp-open' );
|
636 |
+
} );
|
637 |
+
self.options.onAfterOpen( self.pileName, cnt );
|
638 |
+
|
639 |
+
}
|
640 |
+
|
641 |
+
} ) :
|
642 |
+
this._applyTransition( $item, { opacity : 0 }, this.options.otherPileAnimation.closeSpeed );
|
643 |
+
|
644 |
+
}
|
645 |
+
|
646 |
+
}
|
647 |
+
|
648 |
+
this.el.css( 'height', fs.top + this.itemSize.height );
|
649 |
+
|
650 |
+
},
|
651 |
+
_closePile : function() {
|
652 |
+
|
653 |
+
var self = this;
|
654 |
+
|
655 |
+
// close..
|
656 |
+
if( this.spread ) {
|
657 |
+
|
658 |
+
this.spread = false;
|
659 |
+
|
660 |
+
this.options.onBeforeClose( this.pileName );
|
661 |
+
|
662 |
+
this.el.removeClass( 'tp-open' );
|
663 |
+
|
664 |
+
// final style
|
665 |
+
var fs;
|
666 |
+
for (var j =0, pile_len = this.pilesArr.length; j < pile_len; j++){
|
667 |
+
|
668 |
+
var p = this.pilesArr[j],
|
669 |
+
|
670 |
+
//for( var pile in this.piles ) {
|
671 |
+
//
|
672 |
+
// var p = this.piles[ pile ],
|
673 |
+
|
674 |
+
cnt = 0;
|
675 |
+
|
676 |
+
for( var i = 0, len = p.elements.length; i < len; ++i ) {
|
677 |
+
|
678 |
+
var $item = $( p.elements[i].el ),
|
679 |
+
styleCSS = p.name === this.pileName ? {
|
680 |
+
transition : this.support ? 'left ' + this.options.pileAnimation.closeSpeed + 'ms ' + this.options.pileAnimation.closeEasing + ', top ' + this.options.pileAnimation.closeSpeed + 'ms ' + this.options.pileAnimation.closeEasing + ', ' + this.transformName + ' ' + this.options.pileAnimation.closeSpeed + 'ms ' + this.options.pileAnimation.closeEasing : 'none'
|
681 |
+
} : {
|
682 |
+
transition : this.support ? 'opacity ' + this.options.otherPileAnimation.openSpeed + 'ms ' + this.options.otherPileAnimation.openEasing : 'none'
|
683 |
+
};
|
684 |
+
|
685 |
+
$item.css( styleCSS );
|
686 |
+
|
687 |
+
fs = p.position;
|
688 |
+
|
689 |
+
if(p.name === this.pileName ) {
|
690 |
+
|
691 |
+
$.extend( fs, $item.data( 'initialStyle' ) );
|
692 |
+
|
693 |
+
// hack: remove box-shadow while animating to prevent the shadow stack effect
|
694 |
+
if( i < len - 3 ) {
|
695 |
+
$item.css( 'box-shadow', 'none' );
|
696 |
+
}
|
697 |
+
|
698 |
+
}
|
699 |
+
|
700 |
+
p.name === this.pileName ? this._applyTransition( $item, fs, this.options.pileAnimation.closeSpeed, function( evt ) {
|
701 |
+
|
702 |
+
var target = this.target || this.nodeName;
|
703 |
+
if( target !== 'LI' ) {
|
704 |
+
return;
|
705 |
+
}
|
706 |
+
|
707 |
+
var $el = $( this ), extraStyle = $el.data( 'extraStyle' );
|
708 |
+
|
709 |
+
// hack: remove box-shadow while animating to prevent the shadow stack effect
|
710 |
+
$el.css( 'box-shadow', $el.data( 'shadow' ) );
|
711 |
+
|
712 |
+
if( self.support ) {
|
713 |
+
$el.off( self.transEndEventName );
|
714 |
+
self._applyInitialTransition( $el );
|
715 |
+
}
|
716 |
+
else {
|
717 |
+
$el.css( $el.data( 'initialStyle' ) );
|
718 |
+
}
|
719 |
+
|
720 |
+
if( extraStyle ) {
|
721 |
+
$el.css( extraStyle );
|
722 |
+
}
|
723 |
+
|
724 |
+
++cnt;
|
725 |
+
|
726 |
+
if( $el.data( 'front' ) ) {
|
727 |
+
$el.find( 'div.tp-title' ).show();
|
728 |
+
}
|
729 |
+
|
730 |
+
if( cnt === $el.data( 'pileCount' ) ) {
|
731 |
+
self.options.onAfterClose( $el.data( 'pileName' ), cnt );
|
732 |
+
}
|
733 |
+
|
734 |
+
} ) : this._applyTransition( $item, { opacity : 1 }, this.options.otherPileAnimation.openSpeed, function( evt ) {
|
735 |
+
|
736 |
+
var target = this.target || this.nodeName;
|
737 |
+
if( target !== 'LI' ) {
|
738 |
+
return;
|
739 |
+
}
|
740 |
+
|
741 |
+
var $el = $( this );
|
742 |
+
|
743 |
+
if( $el.index() < len - 1 ) {
|
744 |
+
$el.find( 'img' ).css( 'visibility', 'visible' );
|
745 |
+
}
|
746 |
+
|
747 |
+
if( self.support ) {
|
748 |
+
$el.off( self.transEndEventName );
|
749 |
+
self._applyInitialTransition( $el );
|
750 |
+
}
|
751 |
+
|
752 |
+
} );
|
753 |
+
|
754 |
+
}
|
755 |
+
|
756 |
+
}
|
757 |
+
|
758 |
+
// reset pile name
|
759 |
+
this.pileName = '';
|
760 |
+
|
761 |
+
// update ul height
|
762 |
+
this.el.css( 'height', fs.top + this.itemSize.height );
|
763 |
+
|
764 |
+
}
|
765 |
+
|
766 |
+
return false;
|
767 |
+
|
768 |
+
},
|
769 |
+
_resize : function() {
|
770 |
+
|
771 |
+
// get ul size again
|
772 |
+
this._getSize();
|
773 |
+
// reset items positions
|
774 |
+
this._setItemsPosition();
|
775 |
+
|
776 |
+
},
|
777 |
+
_applyTransition : function( el, styleCSS, speed, fncomplete ) {
|
778 |
+
|
779 |
+
$.fn.applyStyle = this.support ? $.fn.css : $.fn.animate;
|
780 |
+
|
781 |
+
if( fncomplete && this.support ) {
|
782 |
+
|
783 |
+
el.on( this.transEndEventName, fncomplete );
|
784 |
+
|
785 |
+
}
|
786 |
+
|
787 |
+
fncomplete = fncomplete || function() { return false; };
|
788 |
+
|
789 |
+
el.stop().applyStyle( styleCSS, $.extend( true, [], { duration : speed + 'ms', complete : fncomplete } ) );
|
790 |
+
|
791 |
+
},
|
792 |
+
closePile : function() {
|
793 |
+
|
794 |
+
this._closePile();
|
795 |
+
|
796 |
+
}
|
797 |
+
|
798 |
+
};
|
799 |
+
|
800 |
+
var logError = function( message ) {
|
801 |
+
|
802 |
+
if ( window.console ) {
|
803 |
+
|
804 |
+
window.console.error( message );
|
805 |
+
|
806 |
+
}
|
807 |
+
|
808 |
+
};
|
809 |
+
|
810 |
+
$.fn.stapel = function( options ) {
|
811 |
+
|
812 |
+
var instance = $.data( this, 'stapel' );
|
813 |
+
|
814 |
+
if ( typeof options === 'string' ) {
|
815 |
+
|
816 |
+
var args = Array.prototype.slice.call( arguments, 1 );
|
817 |
+
|
818 |
+
this.each(function() {
|
819 |
+
|
820 |
+
if ( !instance ) {
|
821 |
+
|
822 |
+
logError( "cannot call methods on stapel prior to initialization; " +
|
823 |
+
"attempted to call method '" + options + "'" );
|
824 |
+
return;
|
825 |
+
|
826 |
+
}
|
827 |
+
|
828 |
+
if ( !$.isFunction( instance[options] ) || options.charAt(0) === "_" ) {
|
829 |
+
|
830 |
+
logError( "no such method '" + options + "' for stapel instance" );
|
831 |
+
return;
|
832 |
+
|
833 |
+
}
|
834 |
+
|
835 |
+
instance[ options ].apply( instance, args );
|
836 |
+
|
837 |
+
});
|
838 |
+
|
839 |
+
}
|
840 |
+
else {
|
841 |
+
|
842 |
+
this.each(function() {
|
843 |
+
|
844 |
+
if ( instance ) {
|
845 |
+
|
846 |
+
instance._init();
|
847 |
+
|
848 |
+
}
|
849 |
+
else {
|
850 |
+
|
851 |
+
instance = $.data( this, 'stapel', new $.Stapel( options, this ) );
|
852 |
+
|
853 |
+
}
|
854 |
+
|
855 |
+
});
|
856 |
+
|
857 |
+
}
|
858 |
+
|
859 |
+
return instance;
|
860 |
+
|
861 |
+
};
|
862 |
+
|
863 |
+
} )( jQuery, window );
|
extensions/albums/public/class-foogallery-album-template-loader.php
ADDED
@@ -0,0 +1,184 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Template loader for FooGallery Albums
|
5 |
+
*
|
6 |
+
* @package FooGallery
|
7 |
+
* @author Brad vincent
|
8 |
+
*/
|
9 |
+
class FooGallery_Album_Template_Loader {
|
10 |
+
|
11 |
+
/**
|
12 |
+
* Locates and renders the album based on the template
|
13 |
+
* Will look in the following locations
|
14 |
+
* wp-content/themes/{child-theme}/foogallery/album-{template}.php
|
15 |
+
* wp-content/themes/{theme}/foogallery/album-{template}.php
|
16 |
+
* wp-content/plugins/foogallery/templates/album-{template}.php
|
17 |
+
*
|
18 |
+
* @param $args array Arguments passed in from the shortcode
|
19 |
+
*/
|
20 |
+
public function render_template( $args ) {
|
21 |
+
//do some work before we locate the template
|
22 |
+
global $current_foogallery_album;
|
23 |
+
global $current_foogallery_album_arguments;
|
24 |
+
global $current_foogallery_album_template;
|
25 |
+
|
26 |
+
//set the arguments
|
27 |
+
$current_foogallery_album_arguments = $args;
|
28 |
+
|
29 |
+
//load our album
|
30 |
+
$current_foogallery_album = $this->find_album( $args );
|
31 |
+
|
32 |
+
if ( false === $current_foogallery_album ) {
|
33 |
+
_e( 'Could not load the album!', 'foogallery' );
|
34 |
+
return;
|
35 |
+
}
|
36 |
+
|
37 |
+
//find the gallery template we will use to render the gallery
|
38 |
+
$current_foogallery_album_template = $this->get_arg( $args, 'template', $current_foogallery_album->album_template );
|
39 |
+
|
40 |
+
//set a default if we have no gallery template
|
41 |
+
if ( empty($current_foogallery_album_template) ) {
|
42 |
+
$current_foogallery_album_template = foogallery_get_default( 'album_template' );
|
43 |
+
}
|
44 |
+
|
45 |
+
//if we still have not default, then use the first one we can find
|
46 |
+
if ( empty($current_foogallery_album_template) ) {
|
47 |
+
$available_templates = foogallery_album_templates();
|
48 |
+
$current_foogallery_album_template = $available_templates[0]['slug'];
|
49 |
+
}
|
50 |
+
|
51 |
+
//check if we have any galleries
|
52 |
+
if ( ! $current_foogallery_album->has_galleries() ) {
|
53 |
+
//no galleries!
|
54 |
+
do_action( "foogallery_album_template_no_galleries-($current_foogallery_album_template)", $current_foogallery_album );
|
55 |
+
} else {
|
56 |
+
|
57 |
+
//create locator instance
|
58 |
+
$instance_name = FOOGALLERY_SLUG . '_album_templates';
|
59 |
+
$loader = new Foo_Plugin_File_Locator_v1( $instance_name, FOOGALLERY_FILE, 'templates', FOOGALLERY_SLUG );
|
60 |
+
|
61 |
+
//allow extensions to very easily add pickup locations for their files
|
62 |
+
$this->add_extension_pickup_locations( $loader, apply_filters( $instance_name . '_files', array() ) );
|
63 |
+
|
64 |
+
if ( false !== ($template_location = $loader->locate_file( "album-{$current_foogallery_album_template}.php" )) ) {
|
65 |
+
|
66 |
+
//we have found a template!
|
67 |
+
do_action( 'foogallery_located_album_template', $current_foogallery_album );
|
68 |
+
do_action( "foogallery_located_album_template-{$current_foogallery_album_template}", $current_foogallery_album );
|
69 |
+
|
70 |
+
//try to include some JS
|
71 |
+
if ( false !== ($js_location = $loader->locate_file( "album-{$current_foogallery_album_template}.js" )) ) {
|
72 |
+
wp_enqueue_script( "foogallery-album-template-{$current_foogallery_album_template}", $js_location['url'] );
|
73 |
+
}
|
74 |
+
|
75 |
+
//try to include some CSS
|
76 |
+
if ( false !== ($css_location = $loader->locate_file( "album-{$current_foogallery_album_template}.css" )) ) {
|
77 |
+
wp_enqueue_style( "foogallery-album-template-{$current_foogallery_album_template}", $css_location['url'] );
|
78 |
+
}
|
79 |
+
|
80 |
+
//finally include the actual php template!
|
81 |
+
if ( $template_location ) {
|
82 |
+
load_template( $template_location['path'], false );
|
83 |
+
}
|
84 |
+
|
85 |
+
//we have loaded all files, now let extensions do some stuff
|
86 |
+
do_action( "foogallery_loaded_album_template", $current_foogallery_album );
|
87 |
+
do_action( "foogallery_loaded_album_template-($current_foogallery_album_template)", $current_foogallery_album );
|
88 |
+
|
89 |
+
} else {
|
90 |
+
//we could not find a template!
|
91 |
+
_e( 'No album template found!', 'foogallery' );
|
92 |
+
}
|
93 |
+
}
|
94 |
+
}
|
95 |
+
|
96 |
+
/**
|
97 |
+
* Add pickup locations to the loader to make it easier for extensions
|
98 |
+
*
|
99 |
+
* @param $loader Foo_Plugin_File_Locator_v1
|
100 |
+
* @param $extension_files array
|
101 |
+
*/
|
102 |
+
function add_extension_pickup_locations( $loader, $extension_files ) {
|
103 |
+
if ( count( $extension_files ) > 0 ) {
|
104 |
+
$position = 120;
|
105 |
+
foreach ( $extension_files as $file ) {
|
106 |
+
|
107 |
+
//add pickup location for php template
|
108 |
+
$loader->add_location( $position, array(
|
109 |
+
'path' => trailingslashit( plugin_dir_path( $file ) ),
|
110 |
+
'url' => trailingslashit( plugin_dir_url( $file ) )
|
111 |
+
) );
|
112 |
+
|
113 |
+
$position++;
|
114 |
+
|
115 |
+
//add pickup location for extensions js folder
|
116 |
+
$loader->add_location( $position, array(
|
117 |
+
'path' => trailingslashit( plugin_dir_path( $file ) . 'js' ),
|
118 |
+
'url' => trailingslashit( plugin_dir_url( $file ) . 'js' )
|
119 |
+
) );
|
120 |
+
|
121 |
+
$position++;
|
122 |
+
|
123 |
+
//add pickup location for extension css folder
|
124 |
+
$loader->add_location( $position, array(
|
125 |
+
'path' => trailingslashit( plugin_dir_path( $file ) . 'css' ),
|
126 |
+
'url' => trailingslashit( plugin_dir_url( $file ) . 'css' )
|
127 |
+
) );
|
128 |
+
|
129 |
+
$position++;
|
130 |
+
|
131 |
+
}
|
132 |
+
}
|
133 |
+
}
|
134 |
+
|
135 |
+
/**
|
136 |
+
* load the gallery based on either the id or slug, passed in via arguments
|
137 |
+
*
|
138 |
+
* @param $args array Arguments passed in from the shortcode
|
139 |
+
*
|
140 |
+
* @return bool|FooGallery The gallery object we want to render
|
141 |
+
*/
|
142 |
+
function find_album( $args ) {
|
143 |
+
|
144 |
+
$id = intval( $this->get_arg( $args, 'id' ), 0 );
|
145 |
+
|
146 |
+
if ( $id > 0 ) {
|
147 |
+
|
148 |
+
//load album by ID
|
149 |
+
return FooGalleryAlbum::get_by_id( $id );
|
150 |
+
|
151 |
+
} else {
|
152 |
+
|
153 |
+
//take into account the cases where id is passed in via the 'album' attribute
|
154 |
+
$album = $this->get_arg( 'album', 0 );
|
155 |
+
|
156 |
+
if ( intval( $album ) > 0 ) {
|
157 |
+
//we have an id, so load
|
158 |
+
return FooGalleryAlbum::get_by_id( intval( $album ) );
|
159 |
+
}
|
160 |
+
|
161 |
+
//we are dealing with a slug
|
162 |
+
return FooGalleryAlbum::get_by_slug( $album );
|
163 |
+
}
|
164 |
+
}
|
165 |
+
|
166 |
+
/**
|
167 |
+
* Helper to get an argument value from an array arguments
|
168 |
+
*
|
169 |
+
* @param $args Array the array of arguments to search
|
170 |
+
* @param $key string the key of the argument you are looking for
|
171 |
+
* @param $default string a default value if the argument is not found
|
172 |
+
*
|
173 |
+
* @return string
|
174 |
+
*/
|
175 |
+
function get_arg( $args, $key, $default = '' ) {
|
176 |
+
if ( empty($args)
|
177 |
+
|| !is_array( $args )
|
178 |
+
|| !array_key_exists( $key, $args ) ) {
|
179 |
+
return $default;
|
180 |
+
}
|
181 |
+
|
182 |
+
return $args[ $key ];
|
183 |
+
}
|
184 |
+
}
|
extensions/albums/public/class-rewrite-rules.php
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* FooGallery Album Rewrite Rules
|
4 |
+
*/
|
5 |
+
if (!class_exists('FooGallery_Album_Rewrite_Rules')) {
|
6 |
+
|
7 |
+
class FooGallery_Album_Rewrite_Rules {
|
8 |
+
|
9 |
+
function __construct() {
|
10 |
+
add_action( 'init', array( $this, 'add_gallery_endpoint' ) );
|
11 |
+
}
|
12 |
+
|
13 |
+
function add_gallery_endpoint() {
|
14 |
+
add_rewrite_endpoint( foogallery_album_gallery_url_slug(), EP_ALL );
|
15 |
+
}
|
16 |
+
}
|
17 |
+
}
|
extensions/albums/public/class-shortcodes.php
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
* FooGallery Album Shortcode
|
4 |
+
*/
|
5 |
+
|
6 |
+
if ( ! class_exists( 'FooGallery_Album_Shortcodes' ) ) {
|
7 |
+
|
8 |
+
class FooGallery_Album_Shortcodes {
|
9 |
+
|
10 |
+
function __construct() {
|
11 |
+
add_action( 'init', array( $this, 'init_shortcode' ) );
|
12 |
+
add_action( 'foogallery_loaded_album_template', array( $this, 'render_custom_css' ) );
|
13 |
+
}
|
14 |
+
|
15 |
+
function init_shortcode() {
|
16 |
+
add_shortcode( foogallery_album_shortcode_tag(), array( $this, 'render_foogallery_album_shortcode' ) );
|
17 |
+
}
|
18 |
+
|
19 |
+
function render_foogallery_album_shortcode( $atts ) {
|
20 |
+
|
21 |
+
$args = wp_parse_args( $atts, array(
|
22 |
+
'id' => 0,
|
23 |
+
'album' => '',
|
24 |
+
) );
|
25 |
+
|
26 |
+
$args = apply_filters( 'foogallery-album_shortcode_atts', $args );
|
27 |
+
|
28 |
+
//create new instance of template engine
|
29 |
+
$engine = new FooGallery_Album_Template_Loader();
|
30 |
+
|
31 |
+
ob_start();
|
32 |
+
|
33 |
+
$engine->render_template( $args );
|
34 |
+
|
35 |
+
$output_string = ob_get_contents();
|
36 |
+
ob_end_clean();
|
37 |
+
return $output_string;
|
38 |
+
}
|
39 |
+
|
40 |
+
function render_custom_css( $foogallery_album ) {
|
41 |
+
if ( !empty( $foogallery_album->custom_css ) ) {
|
42 |
+
echo '<style type="text/css">';
|
43 |
+
echo $foogallery_album->custom_css;
|
44 |
+
echo '</style>';
|
45 |
+
}
|
46 |
+
}
|
47 |
+
}
|
48 |
+
}
|
extensions/default-templates/class-default-templates-extension.php
ADDED
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( ! class_exists( 'FooGallery_Default_Templates_Extension' ) ) {
|
3 |
+
|
4 |
+
define( 'FOOGALLERY_DEFAULT_TEMPLATES_EXTENSION_URL', plugin_dir_url( __FILE__ ) );
|
5 |
+
define( 'FOOGALLERY_DEFAULT_TEMPLATES_EXTENSION_PATH', plugin_dir_path( __FILE__ ) );
|
6 |
+
|
7 |
+
define( 'FOOGALLERY_DEFAULT_TEMPLATES_EXTENSION_SHARED_URL', FOOGALLERY_DEFAULT_TEMPLATES_EXTENSION_URL . 'shared/' );
|
8 |
+
define( 'FOOGALLERY_DEFAULT_TEMPLATES_EXTENSION_SHARED_PATH', FOOGALLERY_DEFAULT_TEMPLATES_EXTENSION_PATH . 'shared/' );
|
9 |
+
|
10 |
+
require_once( FOOGALLERY_DEFAULT_TEMPLATES_EXTENSION_PATH . 'functions.php' );
|
11 |
+
require_once( FOOGALLERY_DEFAULT_TEMPLATES_EXTENSION_PATH . 'default/class-default-gallery-template.php' );
|
12 |
+
require_once( FOOGALLERY_DEFAULT_TEMPLATES_EXTENSION_PATH . 'image-viewer/class-image-viewer-gallery-template.php' );
|
13 |
+
require_once( FOOGALLERY_DEFAULT_TEMPLATES_EXTENSION_PATH . 'justified/class-justified-gallery-template.php' );
|
14 |
+
require_once( FOOGALLERY_DEFAULT_TEMPLATES_EXTENSION_PATH . 'masonry/class-masonry-gallery-template.php' );
|
15 |
+
require_once( FOOGALLERY_DEFAULT_TEMPLATES_EXTENSION_PATH . 'simple-portfolio/class-simple-portfolio-gallery-template.php' );
|
16 |
+
require_once( FOOGALLERY_DEFAULT_TEMPLATES_EXTENSION_PATH . 'thumbnail/class-thumbnail-gallery-template.php' );
|
17 |
+
|
18 |
+
class FooGallery_Default_Templates_Extension {
|
19 |
+
|
20 |
+
function __construct() {
|
21 |
+
new FooGallery_Default_Gallery_Template();
|
22 |
+
new FooGallery_Image_Viewer_Gallery_Template();
|
23 |
+
new FooGallery_Justified_Gallery_Template();
|
24 |
+
new FooGallery_Masonry_Gallery_Template();
|
25 |
+
new FooGallery_Simple_Portfolio_Gallery_Template();
|
26 |
+
new FooGallery_Thumbnail_Gallery_Template();
|
27 |
+
|
28 |
+
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_assets' ) );
|
29 |
+
}
|
30 |
+
|
31 |
+
/***
|
32 |
+
* Enqueue the assets needed by the default templates
|
33 |
+
* @param $hook_suffix
|
34 |
+
*/
|
35 |
+
function enqueue_assets( $hook_suffix ){
|
36 |
+
if( in_array( $hook_suffix, array( 'post.php', 'post-new.php' ) ) ) {
|
37 |
+
$screen = get_current_screen();
|
38 |
+
|
39 |
+
if ( is_object( $screen ) && FOOGALLERY_CPT_GALLERY == $screen->post_type ){
|
40 |
+
|
41 |
+
// Register, enqueue scripts and styles here
|
42 |
+
wp_enqueue_style( 'foogallery-core-admin-settings', FOOGALLERY_DEFAULT_TEMPLATES_EXTENSION_SHARED_URL . 'css/admin-foogallery.css', array(), FOOGALLERY_VERSION );
|
43 |
+
}
|
44 |
+
}
|
45 |
+
}
|
46 |
+
}
|
47 |
+
}
|
extensions/default-templates/default/class-default-gallery-template.php
ADDED
@@ -0,0 +1,200 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
if ( !class_exists( 'FooGallery_Default_Gallery_Template' ) ) {
|
4 |
+
|
5 |
+
define('FOOGALLERY_DEFAULT_GALLERY_TEMPLATE_URL', plugin_dir_url( __FILE__ ));
|
6 |
+
|
7 |
+
class FooGallery_Default_Gallery_Template {
|
8 |
+
/**
|
9 |
+
* Wire up everything we need to run the extension
|
10 |
+
*/
|
11 |
+
function __construct() {
|
12 |
+
add_filter( 'foogallery_gallery_templates', array( $this, 'add_template' ) );
|
13 |
+
|
14 |
+
add_action( 'foogallery_located_template-default', array( $this, 'enqueue_dependencies' ) );
|
15 |
+
|
16 |
+
add_filter( 'foogallery_gallery_templates_files', array( $this, 'register_myself' ) );
|
17 |
+
|
18 |
+
//build up any preview arguments
|
19 |
+
add_filter( 'foogallery_preview_arguments-default', array( $this, 'preview_arguments' ), 10, 2 );
|
20 |
+
|
21 |
+
//build up the thumb dimensions from some arguments
|
22 |
+
add_filter( 'foogallery_calculate_thumbnail_dimensions-default', array( $this, 'build_thumbnail_dimensions_from_arguments' ), 10, 2 );
|
23 |
+
|
24 |
+
//build up the thumb dimensions on save
|
25 |
+
add_filter( 'foogallery_template_thumbnail_dimensions-default', array( $this, 'get_thumbnail_dimensions' ), 10, 2 );
|
26 |
+
}
|
27 |
+
|
28 |
+
/**
|
29 |
+
* Register myself so that all associated JS and CSS files can be found and automatically included
|
30 |
+
* @param $extensions
|
31 |
+
*
|
32 |
+
* @return array
|
33 |
+
*/
|
34 |
+
function register_myself( $extensions ) {
|
35 |
+
$extensions[] = __FILE__;
|
36 |
+
return $extensions;
|
37 |
+
}
|
38 |
+
|
39 |
+
/**
|
40 |
+
* Add our gallery template to the list of templates available for every gallery
|
41 |
+
* @param $gallery_templates
|
42 |
+
*
|
43 |
+
* @return array
|
44 |
+
*/
|
45 |
+
function add_template( $gallery_templates ) {
|
46 |
+
$gallery_templates[] = array(
|
47 |
+
'slug' => 'default',
|
48 |
+
'name' => __( 'Responsive Image Gallery', 'foogallery' ),
|
49 |
+
'preview_support' => true,
|
50 |
+
'common_fields_support' => true,
|
51 |
+
'paging_support' => true,
|
52 |
+
'lazyload_support' => true,
|
53 |
+
'mandatory_classes' => 'fg-default',
|
54 |
+
'thumbnail_dimensions' => true,
|
55 |
+
'fields' => array(
|
56 |
+
array(
|
57 |
+
'id' => 'thumbnail_dimensions',
|
58 |
+
'title' => __( 'Thumbnail Size', 'foogallery' ),
|
59 |
+
'desc' => __( 'Choose the size of your thumbnails.', 'foogallery' ),
|
60 |
+
'section' => __( 'General', 'foogallery' ),
|
61 |
+
'type' => 'thumb_size_no_crop',
|
62 |
+
'default' => array(
|
63 |
+
'width' => get_option( 'thumbnail_size_w' ),
|
64 |
+
'height' => get_option( 'thumbnail_size_h' ),
|
65 |
+
),
|
66 |
+
'row_data'=> array(
|
67 |
+
'data-foogallery-change-selector' => 'input',
|
68 |
+
'data-foogallery-preview' => 'shortcode'
|
69 |
+
)
|
70 |
+
),
|
71 |
+
array(
|
72 |
+
'id' => 'thumbnail_link',
|
73 |
+
'title' => __( 'Link To', 'foogallery' ),
|
74 |
+
'section' => __( 'General', 'foogallery' ),
|
75 |
+
'default' => 'image',
|
76 |
+
'type' => 'thumb_link',
|
77 |
+
'desc' => __( 'You can choose to link each thumbnail to the full size image, the image\'s attachment page, a custom URL, or you can choose to not link to anything.', 'foogallery' ),
|
78 |
+
),
|
79 |
+
array(
|
80 |
+
'id' => 'lightbox',
|
81 |
+
'title' => __( 'Lightbox', 'foogallery' ),
|
82 |
+
'desc' => __( 'Choose which lightbox you want to use. The lightbox will generally only work if you set the thumbnail link to "Full Size Image".', 'foogallery' ),
|
83 |
+
'section' => __( 'General', 'foogallery' ),
|
84 |
+
'type' => 'lightbox',
|
85 |
+
'default' => 'none',
|
86 |
+
'row_data'=> array(
|
87 |
+
'data-foogallery-change-selector' => 'select'
|
88 |
+
)
|
89 |
+
),
|
90 |
+
array(
|
91 |
+
'id' => 'lightbox_foobox_help',
|
92 |
+
'title' => __( 'FooBox Help', 'foogallery' ),
|
93 |
+
'desc' => __( 'The FooBox lightbox is a separate plugin.', 'foogallery' ),
|
94 |
+
'section' => __( 'General', 'foogallery' ),
|
95 |
+
'type' => 'help',
|
96 |
+
'row_data'=> array(
|
97 |
+
'data-foogallery-hidden' => true,
|
98 |
+
'data-foogallery-show-when-field' => 'lightbox',
|
99 |
+
'data-foogallery-show-when-field-value' => 'foobox'
|
100 |
+
)
|
101 |
+
),
|
102 |
+
array(
|
103 |
+
'id' => 'spacing',
|
104 |
+
'title' => __( 'Spacing', 'foogallery' ),
|
105 |
+
'desc' => __( 'The spacing or gap between thumbnails in the gallery.', 'foogallery' ),
|
106 |
+
'section' => __( 'General', 'foogallery' ),
|
107 |
+
'type' => 'select',
|
108 |
+
'default' => 'fg-gutter-10',
|
109 |
+
'choices' => array(
|
110 |
+
'fg-gutter-0' => __( 'none', 'foogallery' ),
|
111 |
+
'fg-gutter-5' => __( '5 pixels', 'foogallery' ),
|
112 |
+
'fg-gutter-10' => __( '10 pixels', 'foogallery' ),
|
113 |
+
'fg-gutter-15' => __( '15 pixels', 'foogallery' ),
|
114 |
+
'fg-gutter-20' => __( '20 pixels', 'foogallery' ),
|
115 |
+
'fg-gutter-25' => __( '25 pixels', 'foogallery' ),
|
116 |
+
),
|
117 |
+
'row_data'=> array(
|
118 |
+
'data-foogallery-change-selector' => 'select',
|
119 |
+
'data-foogallery-preview' => 'class'
|
120 |
+
)
|
121 |
+
),
|
122 |
+
array(
|
123 |
+
'id' => 'alignment',
|
124 |
+
'title' => __( 'Alignment', 'foogallery' ),
|
125 |
+
'desc' => __( 'The horizontal alignment of the thumbnails inside the gallery.', 'foogallery' ),
|
126 |
+
'section' => __( 'General', 'foogallery' ),
|
127 |
+
'default' => 'fg-center',
|
128 |
+
'type' => 'radio',
|
129 |
+
'spacer' => '<span class="spacer"></span>',
|
130 |
+
'choices' => array(
|
131 |
+
'fg-left' => __( 'Left', 'foogallery' ),
|
132 |
+
'fg-center' => __( 'Center', 'foogallery' ),
|
133 |
+
'fg-right' => __( 'Right', 'foogallery' ),
|
134 |
+
),
|
135 |
+
'row_data'=> array(
|
136 |
+
'data-foogallery-change-selector' => 'input:radio',
|
137 |
+
'data-foogallery-preview' => 'class'
|
138 |
+
)
|
139 |
+
)
|
140 |
+
)
|
141 |
+
);
|
142 |
+
|
143 |
+
return $gallery_templates;
|
144 |
+
}
|
145 |
+
|
146 |
+
/**
|
147 |
+
* Enqueue scripts that the default gallery template relies on
|
148 |
+
*/
|
149 |
+
function enqueue_dependencies( $gallery ) {
|
150 |
+
//enqueue core files
|
151 |
+
foogallery_enqueue_core_gallery_template_style();
|
152 |
+
foogallery_enqueue_core_gallery_template_script();
|
153 |
+
}
|
154 |
+
|
155 |
+
/**
|
156 |
+
* Build up a arguments used in the preview of the gallery
|
157 |
+
* @param $args
|
158 |
+
* @param $post_data
|
159 |
+
*
|
160 |
+
* @return mixed
|
161 |
+
*/
|
162 |
+
function preview_arguments( $args, $post_data ) {
|
163 |
+
$args['thumbnail_dimensions'] = $post_data[FOOGALLERY_META_SETTINGS]['default_thumbnail_dimensions'];
|
164 |
+
return $args;
|
165 |
+
}
|
166 |
+
|
167 |
+
/**
|
168 |
+
* Builds thumb dimensions from arguments
|
169 |
+
*
|
170 |
+
* @param array $dimensions
|
171 |
+
* @param array $arguments
|
172 |
+
*
|
173 |
+
* @return mixed
|
174 |
+
*/
|
175 |
+
function build_thumbnail_dimensions_from_arguments( $dimensions, $arguments ) {
|
176 |
+
return array(
|
177 |
+
'height' => intval( $arguments['thumbnail_dimensions']['height'] ),
|
178 |
+
'width' => intval( $arguments['thumbnail_dimensions']['width'] ),
|
179 |
+
'crop' => '1'
|
180 |
+
);
|
181 |
+
}
|
182 |
+
|
183 |
+
/**
|
184 |
+
* Get the thumb dimensions arguments saved for the gallery for this gallery template
|
185 |
+
*
|
186 |
+
* @param array $dimensions
|
187 |
+
* @param FooGallery $foogallery
|
188 |
+
*
|
189 |
+
* @return mixed
|
190 |
+
*/
|
191 |
+
function get_thumbnail_dimensions( $dimensions, $foogallery ) {
|
192 |
+
$dimensions = $foogallery->get_meta( 'default_thumbnail_dimensions', array(
|
193 |
+
'width' => get_option( 'thumbnail_size_w' ),
|
194 |
+
'height' => get_option( 'thumbnail_size_h' )
|
195 |
+
) );
|
196 |
+
$dimensions['crop'] = true;
|
197 |
+
return $dimensions;
|
198 |
+
}
|
199 |
+
}
|
200 |
+
}
|
extensions/default-templates/default/gallery-default.php
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* FooGallery default responsive gallery template
|
4 |
+
*/
|
5 |
+
global $current_foogallery;
|
6 |
+
global $current_foogallery_arguments;
|
7 |
+
|
8 |
+
$args = foogallery_gallery_template_setting( 'thumbnail_dimensions', array() );
|
9 |
+
$args['crop'] = '1'; //we now force thumbs to be cropped
|
10 |
+
$args['link'] = foogallery_gallery_template_setting( 'thumbnail_link', 'image' );
|
11 |
+
$lightbox = foogallery_gallery_template_setting( 'lightbox', 'unknown' );
|
12 |
+
$spacing = foogallery_gallery_template_setting( 'spacing', 'spacing-width-10' );
|
13 |
+
$alignment = foogallery_gallery_template_setting( 'alignment', 'fg-center' );
|
14 |
+
|
15 |
+
$foogallery_default_classes = foogallery_build_class_attribute_safe( $current_foogallery, 'foogallery-lightbox-' . $lightbox, $spacing, $alignment );
|
16 |
+
$foogallery_default_attributes = foogallery_build_container_attributes_safe( $current_foogallery, array( 'class' => $foogallery_default_classes ) );
|
17 |
+
|
18 |
+
?><div <?php echo $foogallery_default_attributes; ?>>
|
19 |
+
<?php foreach ( $current_foogallery->attachments() as $attachment ) {
|
20 |
+
echo foogallery_attachment_html( $attachment, $args );
|
21 |
+
} ?>
|
22 |
+
</div>
|
extensions/default-templates/default/js/admin-gallery-default.js
ADDED
@@ -0,0 +1,89 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
(function (FOOGALLERY_DEF_TEMPLATE, $, undefined) {
|
2 |
+
|
3 |
+
FOOGALLERY_DEF_TEMPLATE.setPreviewClasses = function() {
|
4 |
+
|
5 |
+
var $previewImage = $('.foogallery-default-preview'),
|
6 |
+
border_style = $('input[name="foogallery_settings[default_border-style]"]:checked').val(),
|
7 |
+
hover_effect = $('input[name="foogallery_settings[default_hover-effect]"]:checked').val(),
|
8 |
+
hover_effect_type = $('input[name="foogallery_settings[default_hover-effect-type]"]:checked').val(),
|
9 |
+
caption_effect_type = $('input[name="foogallery_settings[default_caption-hover-effect]"]:checked').val(),
|
10 |
+
classNames = 'foogallery-default-preview foogallery-container foogallery-default ' + border_style + ' ' + hover_effect_type;
|
11 |
+
|
12 |
+
var $hoverEffectrow = $('.gallery_template_field-default-hover-effect'),
|
13 |
+
$captionHoverRow = $('.gallery_template_field-default-caption-hover-effect'),
|
14 |
+
$captionContentRow = $('.gallery_template_field-default-caption-content');
|
15 |
+
|
16 |
+
if ( hover_effect_type === '' ) {
|
17 |
+
//icon hover effect type
|
18 |
+
$hoverEffectrow.show();
|
19 |
+
$captionHoverRow.hide();
|
20 |
+
$captionContentRow.hide();
|
21 |
+
classNames += ' ' + hover_effect;
|
22 |
+
} else if ( hover_effect_type === 'hover-effect-caption' ) {
|
23 |
+
//caption hover effect type
|
24 |
+
$hoverEffectrow.hide();
|
25 |
+
$captionHoverRow.show();
|
26 |
+
$captionContentRow.show();
|
27 |
+
classNames += ' ' + caption_effect_type;
|
28 |
+
} else {
|
29 |
+
//no hover effect type
|
30 |
+
$hoverEffectrow.hide();
|
31 |
+
$captionHoverRow.hide();
|
32 |
+
$captionContentRow.hide();
|
33 |
+
}
|
34 |
+
|
35 |
+
$previewImage.attr('class' , classNames);
|
36 |
+
};
|
37 |
+
|
38 |
+
FOOGALLERY_DEF_TEMPLATE.showHideCaptionContent = function(){
|
39 |
+
var $previewImage = $('.foogallery-default-preview'),
|
40 |
+
$caption = $previewImage.find('.foogallery-caption'),
|
41 |
+
$title = $previewImage.find('.foogallery-caption-title'),
|
42 |
+
$desc = $previewImage.find('.foogallery-caption-desc'),
|
43 |
+
caption_content = $('input[name="foogallery_settings[default_caption-content]"]:checked').val();
|
44 |
+
|
45 |
+
$caption.add($title).add($desc).show();
|
46 |
+
switch(caption_content){
|
47 |
+
case 'title':
|
48 |
+
$desc.hide();
|
49 |
+
break;
|
50 |
+
case 'desc':
|
51 |
+
$title.hide();
|
52 |
+
break;
|
53 |
+
case 'none':
|
54 |
+
$caption.hide();
|
55 |
+
break;
|
56 |
+
}
|
57 |
+
};
|
58 |
+
|
59 |
+
FOOGALLERY_DEF_TEMPLATE.adminReady = function () {
|
60 |
+
$('body').on('foogallery-gallery-template-changed-default', function() {
|
61 |
+
FOOGALLERY_DEF_TEMPLATE.setPreviewClasses();
|
62 |
+
FOOGALLERY_DEF_TEMPLATE.showHideCaptionContent();
|
63 |
+
});
|
64 |
+
|
65 |
+
$('input[name="foogallery_settings[default_border-style]"], ' +
|
66 |
+
'input[name="foogallery_settings[default_hover-effect]"], ' +
|
67 |
+
'input[name="foogallery_settings[default_hover-effect-type]"], ' +
|
68 |
+
'input[name="foogallery_settings[default_caption-hover-effect]"]').change(function() {
|
69 |
+
FOOGALLERY_DEF_TEMPLATE.setPreviewClasses();
|
70 |
+
});
|
71 |
+
|
72 |
+
$('input[name="foogallery_settings[default_caption-content]"]').change(function() {
|
73 |
+
FOOGALLERY_DEF_TEMPLATE.showHideCaptionContent();
|
74 |
+
});
|
75 |
+
|
76 |
+
$('.foogallery-thumbnail-preview').click(function(e) {
|
77 |
+
e.preventDefault();
|
78 |
+
});
|
79 |
+
|
80 |
+
//run when the page load for the first time too!
|
81 |
+
FOOGALLERY_DEF_TEMPLATE.setPreviewClasses();
|
82 |
+
FOOGALLERY_DEF_TEMPLATE.showHideCaptionContent();
|
83 |
+
};
|
84 |
+
|
85 |
+
}(window.FOOGALLERY_DEF_TEMPLATE = window.FOOGALLERY_DEF_TEMPLATE || {}, jQuery));
|
86 |
+
|
87 |
+
jQuery(function () {
|
88 |
+
FOOGALLERY_DEF_TEMPLATE.adminReady();
|
89 |
+
});
|
extensions/default-templates/functions.php
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* FooGallery default extensions common functions
|
4 |
+
*/
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Enqueue the core FooGallery stylesheet used by all default templates
|
8 |
+
*/
|
9 |
+
function foogallery_enqueue_core_gallery_template_style() {
|
10 |
+
$filename = foogallery_get_setting( 'enable_debugging', false ) ? '' : '.min';
|
11 |
+
$css = apply_filters( 'foogallery_core_gallery_style', FOOGALLERY_DEFAULT_TEMPLATES_EXTENSION_SHARED_URL . 'css/foogallery' . $filename . '.css' );
|
12 |
+
foogallery_enqueue_style( 'foogallery-core', $css, array(), FOOGALLERY_VERSION );
|
13 |
+
}
|
14 |
+
|
15 |
+
/**
|
16 |
+
* Enqueue the core FooGallery script used by all default templates
|
17 |
+
*/
|
18 |
+
function foogallery_enqueue_core_gallery_template_script() {
|
19 |
+
$filename = foogallery_get_setting( 'enable_debugging', false ) ? '' : '.min';
|
20 |
+
$js = apply_filters( 'foogallery_core_gallery_script', FOOGALLERY_DEFAULT_TEMPLATES_EXTENSION_SHARED_URL . 'js/foogallery' . $filename . '.js' );
|
21 |
+
wp_enqueue_script( 'foogallery-core', $js, array('jquery'), FOOGALLERY_VERSION );
|
22 |
+
}
|
extensions/default-templates/image-viewer/class-image-viewer-gallery-template.php
ADDED
@@ -0,0 +1,251 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
if ( !class_exists( 'FooGallery_Image_Viewer_Gallery_Template' ) ) {
|
4 |
+
|
5 |
+
define('FOOGALLERY_IMAGE_VIEWER_GALLERY_TEMPLATE_URL', plugin_dir_url( __FILE__ ));
|
6 |
+
|
7 |
+
class FooGallery_Image_Viewer_Gallery_Template {
|
8 |
+
/**
|
9 |
+
* Wire up everything we need to run the extension
|
10 |
+
*/
|
11 |
+
function __construct() {
|
12 |
+
add_filter( 'foogallery_gallery_templates', array( $this, 'add_template' ) );
|
13 |
+
|
14 |
+
//add extra fields to the templates
|
15 |
+
add_filter( 'foogallery_override_gallery_template_fields-image-viewer', array( $this, 'add_common_thumbnail_fields' ), 10, 2 );
|
16 |
+
|
17 |
+
add_action( 'foogallery_located_template-image-viewer', array( $this, 'enqueue_dependencies' ) );
|
18 |
+
|
19 |
+
add_filter( 'foogallery_gallery_templates_files', array( $this, 'register_myself' ) );
|
20 |
+
|
21 |
+
add_filter( 'foogallery_template_thumbnail_dimensions-image-viewer', array( $this, 'get_thumbnail_dimensions' ), 10, 2 );
|
22 |
+
|
23 |
+
//override specific settings when saving the gallery
|
24 |
+
add_filter( 'foogallery_save_gallery_settings-image-viewer', array( $this, 'override_settings'), 10, 3 );
|
25 |
+
|
26 |
+
//build up any preview arguments
|
27 |
+
add_filter( 'foogallery_preview_arguments-image-viewer', array( $this, 'preview_arguments' ), 10, 2 );
|
28 |
+
|
29 |
+
//build up the thumb dimensions from some arguments
|
30 |
+
add_filter( 'foogallery_calculate_thumbnail_dimensions-image-viewer', array( $this, 'build_thumbnail_dimensions_from_arguments' ), 10, 2 );
|
31 |
+
}
|
32 |
+
|
33 |
+
/**
|
34 |
+
* Register myself so that all associated JS and CSS files can be found and automatically included
|
35 |
+
* @param $extensions
|
36 |
+
*
|
37 |
+
* @return array
|
38 |
+
*/
|
39 |
+
function register_myself( $extensions ) {
|
40 |
+
$extensions[] = __FILE__;
|
41 |
+
return $extensions;
|
42 |
+
}
|
43 |
+
|
44 |
+
/**
|
45 |
+
* Add our gallery template to the list of templates available for every gallery
|
46 |
+
* @param $gallery_templates
|
47 |
+
*
|
48 |
+
* @return array
|
49 |
+
*/
|
50 |
+
function add_template( $gallery_templates ) {
|
51 |
+
|
52 |
+
$gallery_templates[] = array(
|
53 |
+
'slug' => 'image-viewer',
|
54 |
+
'name' => __( 'Image Viewer', 'foogallery' ),
|
55 |
+
'preview_support' => true,
|
56 |
+
'common_fields_support' => true,
|
57 |
+
'lazyload_support' => true,
|
58 |
+
'mandatory_classes' => 'fg-image-viewer',
|
59 |
+
'thumbnail_dimensions' => true,
|
60 |
+
'fields' => array(
|
61 |
+
array(
|
62 |
+
'id' => 'thumbnail_size',
|
63 |
+
'title' => __( 'Thumb Size', 'foogallery' ),
|
64 |
+
'section' => __( 'General', 'foogallery' ),
|
65 |
+
'desc' => __( 'Choose the size of your thumbnails', 'foogallery' ),
|
66 |
+
'type' => 'thumb_size_no_crop',
|
67 |
+
'default' => array(
|
68 |
+
'width' => 640,
|
69 |
+
'height' => 360
|
70 |
+
),
|
71 |
+
'row_data'=> array(
|
72 |
+
'data-foogallery-change-selector' => 'input',
|
73 |
+
'data-foogallery-preview' => 'shortcode'
|
74 |
+
)
|
75 |
+
),
|
76 |
+
array(
|
77 |
+
'id' => 'thumbnail_link',
|
78 |
+
'title' => __( 'Thumb Link', 'foogallery' ),
|
79 |
+
'section' => __( 'General', 'foogallery' ),
|
80 |
+
'default' => 'image' ,
|
81 |
+
'type' => 'thumb_link',
|
82 |
+
'desc' => __( 'You can choose to either link each thumbnail to the full size image or to the image\'s attachment page', 'foogallery')
|
83 |
+
),
|
84 |
+
array(
|
85 |
+
'id' => 'lightbox',
|
86 |
+
'title' => __( 'Lightbox', 'foogallery' ),
|
87 |
+
'section' => __( 'General', 'foogallery' ),
|
88 |
+
'desc' => __( 'Choose which lightbox you want to use in the gallery', 'foogallery' ),
|
89 |
+
'default' => 'none',
|
90 |
+
'type' => 'lightbox'
|
91 |
+
),
|
92 |
+
array(
|
93 |
+
'id' => 'alignment',
|
94 |
+
'title' => __( 'Alignment', 'foogallery' ),
|
95 |
+
'section' => __( 'General', 'foogallery' ),
|
96 |
+
'desc' => __( 'The horizontal alignment of the thumbnails inside the gallery', 'foogallery' ),
|
97 |
+
'default' => 'fg-center',
|
98 |
+
'type' => 'radio',
|
99 |
+
'spacer' => '<span class="spacer"></span>',
|
100 |
+
'choices' => array(
|
101 |
+
'fg-left' => __( 'Left', 'foogallery' ),
|
102 |
+
'fg-center' => __( 'Center', 'foogallery' ),
|
103 |
+
'fg-right' => __( 'Right', 'foogallery' ),
|
104 |
+
),
|
105 |
+
'row_data'=> array(
|
106 |
+
'data-foogallery-change-selector' => 'input:radio',
|
107 |
+
'data-foogallery-preview' => 'class'
|
108 |
+
)
|
109 |
+
),
|
110 |
+
array(
|
111 |
+
'id' => 'language-help',
|
112 |
+
'title' => __( 'Language Help', 'foogallery' ),
|
113 |
+
'desc' => __( 'This gallery template shows the below items of text. Change them to suit your preference or language.', 'foogallery' ),
|
114 |
+
'section' => __( 'General', 'foogallery' ),
|
115 |
+
'type' => 'help'
|
116 |
+
),
|
117 |
+
array(
|
118 |
+
'id' => 'text-prev',
|
119 |
+
'title' => __( '"Prev" Text', 'foogallery' ),
|
120 |
+
'section' => __( 'General', 'foogallery' ),
|
121 |
+
'type' => 'text',
|
122 |
+
'default' => __('Prev', 'foogallery'),
|
123 |
+
'row_data'=> array(
|
124 |
+
'data-foogallery-change-selector' => 'input',
|
125 |
+
'data-foogallery-preview' => 'shortcode'
|
126 |
+
)
|
127 |
+
),
|
128 |
+
array(
|
129 |
+
'id' => 'text-of',
|
130 |
+
'title' => __( '"of" Text', 'foogallery' ),
|
131 |
+
'section' => __( 'General', 'foogallery' ),
|
132 |
+
'type' => 'text',
|
133 |
+
'default' => __('of', 'foogallery'),
|
134 |
+
'row_data'=> array(
|
135 |
+
'data-foogallery-change-selector' => 'input',
|
136 |
+
'data-foogallery-preview' => 'shortcode'
|
137 |
+
)
|
138 |
+
),
|
139 |
+
array(
|
140 |
+
'id' => 'text-next',
|
141 |
+
'title' => __( '"Next" Text', 'foogallery' ),
|
142 |
+
'section' => __( 'General', 'foogallery' ),
|
143 |
+
'type' => 'text',
|
144 |
+
'default' => __('Next', 'foogallery'),
|
145 |
+
'row_data'=> array(
|
146 |
+
'data-foogallery-change-selector' => 'input',
|
147 |
+
'data-foogallery-preview' => 'shortcode'
|
148 |
+
)
|
149 |
+
)
|
150 |
+
)
|
151 |
+
);
|
152 |
+
|
153 |
+
return $gallery_templates;
|
154 |
+
}
|
155 |
+
|
156 |
+
/**
|
157 |
+
* Add thumbnail fields to the gallery template
|
158 |
+
*
|
159 |
+
* @uses "foogallery_override_gallery_template_fields"
|
160 |
+
* @param $fields
|
161 |
+
* @param $template
|
162 |
+
*
|
163 |
+
* @return array
|
164 |
+
*/
|
165 |
+
function add_common_thumbnail_fields( $fields, $template ) {
|
166 |
+
|
167 |
+
//update specific fields
|
168 |
+
foreach ($fields as &$field) {
|
169 |
+
if ( 'rounded_corners' === $field['id'] ) {
|
170 |
+
unset( $field['choices']['fg-round-full'] );
|
171 |
+
}
|
172 |
+
}
|
173 |
+
|
174 |
+
return $fields;
|
175 |
+
}
|
176 |
+
|
177 |
+
/**
|
178 |
+
* Enqueue scripts that the default gallery template relies on
|
179 |
+
*/
|
180 |
+
function enqueue_dependencies( $gallery ) {
|
181 |
+
//enqueue core files
|
182 |
+
foogallery_enqueue_core_gallery_template_style();
|
183 |
+
foogallery_enqueue_core_gallery_template_script();
|
184 |
+
}
|
185 |
+
|
186 |
+
/**
|
187 |
+
* Get the thumb dimensions arguments saved for the gallery for this gallery template
|
188 |
+
*
|
189 |
+
* @param array $dimensions
|
190 |
+
* @param FooGallery $foogallery
|
191 |
+
*
|
192 |
+
* @return mixed
|
193 |
+
*/
|
194 |
+
function get_thumbnail_dimensions( $dimensions, $foogallery ) {
|
195 |
+
$dimensions = $foogallery->get_meta( 'image-viewer_thumbnail_size', array(
|
196 |
+
'width' => 640,
|
197 |
+
'height' => 360
|
198 |
+
) );
|
199 |
+
$dimensions['crop'] = true;
|
200 |
+
return $dimensions;
|
201 |
+
}
|
202 |
+
|
203 |
+
/**
|
204 |
+
* Override specific settings so that the gallery template will always work
|
205 |
+
*
|
206 |
+
* @param $settings
|
207 |
+
* @param $post_id
|
208 |
+
* @param $form_data
|
209 |
+
*
|
210 |
+
* @return mixed
|
211 |
+
*/
|
212 |
+
function override_settings($settings, $post_id, $form_data) {
|
213 |
+
if ( 'fg-round-full' === $settings['image-viewer_rounded_corners'] ) {
|
214 |
+
$settings['image-viewer_rounded_corners'] = 'fg-round-large';
|
215 |
+
}
|
216 |
+
|
217 |
+
return $settings;
|
218 |
+
}
|
219 |
+
|
220 |
+
/**
|
221 |
+
* Build up a arguments used in the preview of the gallery
|
222 |
+
* @param $args
|
223 |
+
* @param $post_data
|
224 |
+
*
|
225 |
+
* @return mixed
|
226 |
+
*/
|
227 |
+
function preview_arguments( $args, $post_data ) {
|
228 |
+
$args['thumbnail_size'] = $post_data[FOOGALLERY_META_SETTINGS]['image-viewer_thumbnail_size'];
|
229 |
+
$args['text-prev'] = $post_data[FOOGALLERY_META_SETTINGS]['image-viewer_text-prev'];
|
230 |
+
$args['text-of'] = $post_data[FOOGALLERY_META_SETTINGS]['image-viewer_text-of'];
|
231 |
+
$args['text-next'] = $post_data[FOOGALLERY_META_SETTINGS]['image-viewer_text-next'];
|
232 |
+
return $args;
|
233 |
+
}
|
234 |
+
|
235 |
+
/**
|
236 |
+
* Builds thumb dimensions from arguments
|
237 |
+
*
|
238 |
+
* @param array $dimensions
|
239 |
+
* @param array $arguments
|
240 |
+
*
|
241 |
+
* @return mixed
|
242 |
+
*/
|
243 |
+
function build_thumbnail_dimensions_from_arguments( $dimensions, $arguments ) {
|
244 |
+
return array(
|
245 |
+
'height' => intval( $arguments['thumbnail_size']['height'] ),
|
246 |
+
'width' => intval( $arguments['thumbnail_size']['width'] ),
|
247 |
+
'crop' => '1'
|
248 |
+
);
|
249 |
+
}
|
250 |
+
}
|
251 |
+
}
|
extensions/default-templates/image-viewer/gallery-image-viewer.php
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* FooGallery Image Viewer gallery template
|
4 |
+
* This is the template that is run when a FooGallery shortcode is rendered to the frontend
|
5 |
+
*/
|
6 |
+
//the current FooGallery that is currently being rendered to the frontend
|
7 |
+
global $current_foogallery;
|
8 |
+
//the current shortcode args
|
9 |
+
global $current_foogallery_arguments;
|
10 |
+
//get our thumbnail sizing args
|
11 |
+
$args = foogallery_gallery_template_setting( 'thumbnail_size', 'thumbnail' );
|
12 |
+
$args['crop'] = '1'; //we now force thumbs to be cropped
|
13 |
+
//add the link setting to the args
|
14 |
+
$link = foogallery_gallery_template_setting( 'thumbnail_link', 'image' );
|
15 |
+
$args['link'] = $link;
|
16 |
+
//get which lightbox we want to use
|
17 |
+
$lightbox = foogallery_gallery_template_setting( 'lightbox', 'unknown' );
|
18 |
+
|
19 |
+
$alignment = foogallery_gallery_template_setting( 'alignment', 'fg-center' );
|
20 |
+
$text_prev = foogallery_gallery_template_setting( 'text-prev', __('Prev', 'foogallery') );
|
21 |
+
$text_of = foogallery_gallery_template_setting( 'text-of', __('of', 'foogallery') );
|
22 |
+
$text_next = foogallery_gallery_template_setting( 'text-next', __('Next', 'foogallery') );
|
23 |
+
|
24 |
+
$attachments = $current_foogallery->attachments();
|
25 |
+
|
26 |
+
$foogallery_imageviewer_classes = foogallery_build_class_attribute_safe( $current_foogallery, 'foogallery-link-' . $link, 'foogallery-lightbox-' . $lightbox, $alignment );
|
27 |
+
$foogallery_imageviewer_attributes = foogallery_build_container_attributes_safe( $current_foogallery, array( 'class' => $foogallery_imageviewer_classes ) );
|
28 |
+
?><div <?php echo $foogallery_imageviewer_attributes; ?>>
|
29 |
+
<div class="fiv-inner">
|
30 |
+
<div class="fiv-inner-container">
|
31 |
+
<?php foreach ( $attachments as $attachment ) {
|
32 |
+
echo foogallery_attachment_html( $attachment, $args );
|
33 |
+
} ?>
|
34 |
+
</div>
|
35 |
+
<div class="fiv-ctrls">
|
36 |
+
<div class="fiv-prev"><span><?php echo $text_prev; ?></span></div>
|
37 |
+
<label class="fiv-count"><span class="fiv-count-current">1</span><?php echo $text_of; ?><span class="fiv-count-total"><?php echo count($attachments) ?></span></label>
|
38 |
+
<div class="fiv-next"><span><?php echo $text_next; ?></span></div>
|
39 |
+
</div>
|
40 |
+
</div>
|
41 |
+
</div>
|
extensions/default-templates/image-viewer/js/admin-gallery-image-viewer.js
ADDED
@@ -0,0 +1,123 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
//Use this file to inject custom javascript behaviour into the foogallery edit page
|
2 |
+
//For an example usage, check out wp-content/foogallery/extensions/default-templates/js/admin-gallery-default.js
|
3 |
+
|
4 |
+
(function (IMAGE_VIEWER_TEMPLATE_FOOGALLERY_EXTENSION, $, undefined) {
|
5 |
+
|
6 |
+
IMAGE_VIEWER_TEMPLATE_FOOGALLERY_EXTENSION.setPreviewClasses = function() {
|
7 |
+
var $previewImage = $('.foogallery-image-viewer-preview'),
|
8 |
+
theme = $('input[name="foogallery_settings[image-viewer_theme]"]:checked').val(),
|
9 |
+
hover_effect = $('input[name="foogallery_settings[image-viewer_hover-effect]"]:checked').val(),
|
10 |
+
hover_effect_type = $('input[name="foogallery_settings[image-viewer_hover-effect-type]"]:checked').val();
|
11 |
+
|
12 |
+
var $styles = $('#image-preview-custom-styles');
|
13 |
+
if (theme === 'fiv-custom'){
|
14 |
+
var bg_color = $('input[name="foogallery_settings[image-viewer_theme_custom_bgcolor]"]').val(),
|
15 |
+
text_color = $('input[name="foogallery_settings[image-viewer_theme_custom_textcolor]"]').val(),
|
16 |
+
border_color = $('input[name="foogallery_settings[image-viewer_theme_custom_bordercolor]"]').val(),
|
17 |
+
hover_color = $('input[name="foogallery_settings[image-viewer_theme_custom_hovercolor]"]').val();
|
18 |
+
|
19 |
+
var css = '.foogallery-image-viewer-preview.fiv-custom > .fiv-inner,';
|
20 |
+
css += '.foogallery-image-viewer-preview.fiv-custom > .fiv-inner > .fiv-ctrls > .fiv-prev,';
|
21 |
+
css += '.foogallery-image-viewer-preview.fiv-custom > .fiv-inner > .fiv-ctrls > .fiv-next {';
|
22 |
+
css += 'background-color: '+bg_color+';';
|
23 |
+
css += 'color: '+text_color+';';
|
24 |
+
css += '}';
|
25 |
+
css += '.foogallery-image-viewer-preview.fiv-custom > .fiv-inner,';
|
26 |
+
css += '.foogallery-image-viewer-preview.fiv-custom > .fiv-inner > .fiv-inner-container,';
|
27 |
+
css += '.foogallery-image-viewer-preview.fiv-custom > .fiv-inner > .fiv-ctrls > .fiv-prev,';
|
28 |
+
css += '.foogallery-image-viewer-preview.fiv-custom > .fiv-inner > .fiv-ctrls > .fiv-next {';
|
29 |
+
css += 'border-color: '+border_color+';';
|
30 |
+
css += '}';
|
31 |
+
css += '.foogallery-image-viewer-preview.fiv-custom > .fiv-inner > .fiv-ctrls > .fiv-prev:hover,';
|
32 |
+
css += '.foogallery-image-viewer-preview.fiv-custom > .fiv-inner > .fiv-ctrls > .fiv-next:hover {';
|
33 |
+
css += 'background-color: '+hover_color+';';
|
34 |
+
css += '}';
|
35 |
+
$styles.remove();
|
36 |
+
$('head').append('<style id="image-preview-custom-styles">'+css+'</style>');
|
37 |
+
} else {
|
38 |
+
$styles.remove();
|
39 |
+
}
|
40 |
+
|
41 |
+
$previewImage.attr('class' ,'foogallery-image-viewer-preview foogallery-container foogallery-image-viewer ' + theme);
|
42 |
+
if (hover_effect_type !== 'hover-effect-none'){
|
43 |
+
$previewImage.addClass(hover_effect_type + ' ' + hover_effect);
|
44 |
+
}
|
45 |
+
|
46 |
+
var $hoverEffectrow = $('.gallery_template_field-image-viewer-hover-effect');
|
47 |
+
if ( hover_effect_type === '' ) {
|
48 |
+
$hoverEffectrow.show();
|
49 |
+
} else {
|
50 |
+
$hoverEffectrow.hide();
|
51 |
+
}
|
52 |
+
};
|
53 |
+
|
54 |
+
IMAGE_VIEWER_TEMPLATE_FOOGALLERY_EXTENSION.showHideRows = function(){
|
55 |
+
var $theme_rows = $('.gallery_template_field-image-viewer-theme_custom_bgcolor')
|
56 |
+
.add('.gallery_template_field-image-viewer-theme_custom_textcolor')
|
57 |
+
.add('.gallery_template_field-image-viewer-theme_custom_hovercolor')
|
58 |
+
.add('.gallery_template_field-image-viewer-theme_custom_bordercolor');
|
59 |
+
|
60 |
+
if ( $('input[name="foogallery_settings[image-viewer_theme]"]:checked').val() === 'fiv-custom' ) {
|
61 |
+
$theme_rows.show();
|
62 |
+
} else {
|
63 |
+
$theme_rows.hide();
|
64 |
+
}
|
65 |
+
};
|
66 |
+
|
67 |
+
IMAGE_VIEWER_TEMPLATE_FOOGALLERY_EXTENSION.showHideCaptionContent = function(){
|
68 |
+
var $previewImage = $('.foogallery-image-viewer-preview'),
|
69 |
+
$caption = $previewImage.find('.foogallery-caption'),
|
70 |
+
$title = $previewImage.find('.foogallery-caption-title'),
|
71 |
+
$desc = $previewImage.find('.foogallery-caption-desc'),
|
72 |
+
caption_content = $('input[name="foogallery_settings[image-viewer_caption-content]"]:checked').val();
|
73 |
+
|
74 |
+
$caption.add($title).add($desc).show();
|
75 |
+
switch(caption_content){
|
76 |
+
case 'title':
|
77 |
+
$desc.hide();
|
78 |
+
break;
|
79 |
+
case 'desc':
|
80 |
+
$title.hide();
|
81 |
+
break;
|
82 |
+
case 'none':
|
83 |
+
$caption.hide();
|
84 |
+
break;
|
85 |
+
}
|
86 |
+
};
|
87 |
+
|
88 |
+
IMAGE_VIEWER_TEMPLATE_FOOGALLERY_EXTENSION.adminReady = function () {
|
89 |
+
$('body').on('foogallery-gallery-template-changed-image-viewer', function() {
|
90 |
+
IMAGE_VIEWER_TEMPLATE_FOOGALLERY_EXTENSION.setPreviewClasses();
|
91 |
+
IMAGE_VIEWER_TEMPLATE_FOOGALLERY_EXTENSION.showHideRows();
|
92 |
+
IMAGE_VIEWER_TEMPLATE_FOOGALLERY_EXTENSION.showHideCaptionContent();
|
93 |
+
});
|
94 |
+
|
95 |
+
var ps = 'input[name="foogallery_settings[image-viewer_hover-effect]"], ' +
|
96 |
+
'input[name="foogallery_settings[image-viewer_hover-effect-type]"], ' +
|
97 |
+
'input[name="foogallery_settings[image-viewer_theme]"], ' +
|
98 |
+
'input[name="foogallery_settings[image-viewer_theme_custom_bgcolor]"], ' +
|
99 |
+
'input[name="foogallery_settings[image-viewer_theme_custom_textcolor]"], ' +
|
100 |
+
'input[name="foogallery_settings[image-viewer_theme_custom_bordercolor]"], ' +
|
101 |
+
'input[name="foogallery_settings[image-viewer_theme_custom_hovercolor]"]';
|
102 |
+
$(ps).change(function() {
|
103 |
+
IMAGE_VIEWER_TEMPLATE_FOOGALLERY_EXTENSION.setPreviewClasses();
|
104 |
+
});
|
105 |
+
|
106 |
+
$('input[name="foogallery_settings[image-viewer_caption-content]"]').change(function() {
|
107 |
+
IMAGE_VIEWER_TEMPLATE_FOOGALLERY_EXTENSION.showHideCaptionContent();
|
108 |
+
});
|
109 |
+
|
110 |
+
$('input[name="foogallery_settings[image-viewer_theme]"]').change(function() {
|
111 |
+
IMAGE_VIEWER_TEMPLATE_FOOGALLERY_EXTENSION.showHideRows();
|
112 |
+
});
|
113 |
+
|
114 |
+
$('.foogallery-image-viewer-preview').click(function(e) {
|
115 |
+
e.preventDefault();
|
116 |
+
});
|
117 |
+
};
|
118 |
+
|
119 |
+
}(window.IMAGE_VIEWER_TEMPLATE_FOOGALLERY_EXTENSION = window.IMAGE_VIEWER_TEMPLATE_FOOGALLERY_EXTENSION || {}, jQuery));
|
120 |
+
|
121 |
+
jQuery(function () {
|
122 |
+
IMAGE_VIEWER_TEMPLATE_FOOGALLERY_EXTENSION.adminReady();
|
123 |
+
});
|
extensions/default-templates/justified/class-justified-gallery-template.php
ADDED
@@ -0,0 +1,222 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
if ( !class_exists( 'FooGallery_Justified_Gallery_Template' ) ) {
|
4 |
+
|
5 |
+
define('FOOGALLERY_JUSTIFIED_GALLERY_TEMPLATE_URL', plugin_dir_url( __FILE__ ));
|
6 |
+
|
7 |
+
class FooGallery_Justified_Gallery_Template {
|
8 |
+
/**
|
9 |
+
* Wire up everything we need to run the extension
|
10 |
+
*/
|
11 |
+
function __construct() {
|
12 |
+
add_filter( 'foogallery_gallery_templates', array( $this, 'add_template' ) );
|
13 |
+
add_filter( 'foogallery_gallery_templates_files', array( $this, 'register_myself' ) );
|
14 |
+
add_filter( 'foogallery_template_thumbnail_dimensions-justified', array( $this, 'get_thumbnail_dimensions' ), 10, 2 );
|
15 |
+
|
16 |
+
add_action( 'foogallery_located_template-justified', array( $this, 'enqueue_dependencies' ) );
|
17 |
+
|
18 |
+
//add the data options needed for justified
|
19 |
+
add_filter( 'foogallery_build_container_data_options-justified', array( $this, 'add_justified_options' ), 10, 3 );
|
20 |
+
|
21 |
+
//build up any preview arguments
|
22 |
+
add_filter( 'foogallery_preview_arguments-justified', array( $this, 'preview_arguments' ), 10, 2 );
|
23 |
+
|
24 |
+
//build up the thumb dimensions from some arguments
|
25 |
+
add_filter( 'foogallery_calculate_thumbnail_dimensions-justified', array( $this, 'build_thumbnail_dimensions_from_arguments' ), 10, 2 );
|
26 |
+
}
|
27 |
+
|
28 |
+
/**
|
29 |
+
* Register myself so that all associated JS and CSS files can be found and automatically included
|
30 |
+
* @param $extensions
|
31 |
+
*
|
32 |
+
* @return array
|
33 |
+
*/
|
34 |
+
function register_myself( $extensions ) {
|
35 |
+
$extensions[] = __FILE__;
|
36 |
+
return $extensions;
|
37 |
+
}
|
38 |
+
|
39 |
+
/**
|
40 |
+
* Add our gallery template to the list of templates available for every gallery
|
41 |
+
* @param $gallery_templates
|
42 |
+
*
|
43 |
+
* @return array
|
44 |
+
*/
|
45 |
+
function add_template( $gallery_templates ) {
|
46 |
+
$gallery_templates[] = array(
|
47 |
+
'slug' => 'justified',
|
48 |
+
'name' => __( 'Justified Gallery', 'foogallery' ),
|
49 |
+
'preview_support' => true,
|
50 |
+
'common_fields_support' => true,
|
51 |
+
'lazyload_support' => true,
|
52 |
+
'paging_support' => true,
|
53 |
+
'mandatory_classes' => 'fg-justified',
|
54 |
+
'thumbnail_dimensions' => true,
|
55 |
+
'fields' => array(
|
56 |
+
array(
|
57 |
+
'id' => 'thumb_height',
|
58 |
+
'title' => __( 'Thumb Height', 'foogallery' ),
|
59 |
+
'desc' => __( 'Choose the height of your thumbnails. Thumbnails will be generated on the fly and cached once generated', 'foogallery' ),
|
60 |
+
'section' => __( 'General', 'foogallery' ),
|
61 |
+
'type' => 'number',
|
62 |
+
'class' => 'small-text',
|
63 |
+
'default' => 250,
|
64 |
+
'step' => '10',
|
65 |
+
'min' => '0',
|
66 |
+
'row_data'=> array(
|
67 |
+
'data-foogallery-preview' => 'shortcode',
|
68 |
+
'data-foogallery-change-selector' => 'input',
|
69 |
+
)
|
70 |
+
),
|
71 |
+
array(
|
72 |
+
'id' => 'row_height',
|
73 |
+
'title' => __( 'Row Height', 'foogallery' ),
|
74 |
+
'desc' => __( 'The preferred height of your gallery rows. This can be different from the thumbnail height', 'foogallery' ),
|
75 |
+
'section' => __( 'General', 'foogallery' ),
|
76 |
+
'type' => 'number',
|
77 |
+
'class' => 'small-text',
|
78 |
+
'default' => 150,
|
79 |
+
'step' => '10',
|
80 |
+
'min' => '0',
|
81 |
+
'row_data'=> array(
|
82 |
+
'data-foogallery-change-selector' => 'input',
|
83 |
+
'data-foogallery-value-selector' => 'input',
|
84 |
+
'data-foogallery-preview' => 'shortcode',
|
85 |
+
)
|
86 |
+
),
|
87 |
+
array(
|
88 |
+
'id' => 'max_row_height',
|
89 |
+
'title' => __( 'Max Row Height', 'foogallery' ),
|
90 |
+
'desc' => __( 'A number (e.g 200) which specifies the maximum row height in pixels. A negative value for no limits. Alternatively, use a percentage (e.g. 200% which means that the row height cannot exceed 2 * rowHeight)', 'foogallery' ),
|
91 |
+
'section' => __( 'General', 'foogallery' ),
|
92 |
+
'type' => 'text',
|
93 |
+
'class' => 'small-text',
|
94 |
+
'default' => '200%',
|
95 |
+
'row_data'=> array(
|
96 |
+
'data-foogallery-change-selector' => 'input',
|
97 |
+
'data-foogallery-value-selector' => 'input',
|
98 |
+
'data-foogallery-preview' => 'shortcode',
|
99 |
+
)
|
100 |
+
),
|
101 |
+
array(
|
102 |
+
'id' => 'margins',
|
103 |
+
'title' => __( 'Margins', 'foogallery' ),
|
104 |
+
'desc' => __( 'The spacing between your thumbnails.', 'foogallery' ),
|
105 |
+
'section' => __( 'General', 'foogallery' ),
|
106 |
+
'type' => 'number',
|
107 |
+
'class' => 'small-text',
|
108 |
+
'default' => 1,
|
109 |
+
'step' => '1',
|
110 |
+
'min' => '0',
|
111 |
+
'row_data'=> array(
|
112 |
+
'data-foogallery-change-selector' => 'input',
|
113 |
+
'data-foogallery-value-selector' => 'input',
|
114 |
+
'data-foogallery-preview' => 'shortcode',
|
115 |
+
)
|
116 |
+
),
|
117 |
+
array(
|
118 |
+
'id' => 'thumbnail_link',
|
119 |
+
'title' => __( 'Thumbnail Link', 'foogallery' ),
|
120 |
+
'section' => __( 'General', 'foogallery' ),
|
121 |
+
'default' => 'image' ,
|
122 |
+
'type' => 'thumb_link',
|
123 |
+
'desc' => __( 'You can choose to link each thumbnail to the full size image, or to the image\'s attachment page, or you can choose to not link to anything.', 'foogallery' ),
|
124 |
+
),
|
125 |
+
array(
|
126 |
+
'id' => 'lightbox',
|
127 |
+
'title' => __( 'Lightbox', 'foogallery' ),
|
128 |
+
'desc' => __( 'Choose which lightbox you want to display images with. The lightbox will only work if you set the thumbnail link to "Full Size Image".', 'foogallery' ),
|
129 |
+
'section' => __( 'General', 'foogallery' ),
|
130 |
+
'default' => 'none',
|
131 |
+
'type' => 'lightbox',
|
132 |
+
),
|
133 |
+
),
|
134 |
+
);
|
135 |
+
|
136 |
+
return $gallery_templates;
|
137 |
+
}
|
138 |
+
|
139 |
+
/**
|
140 |
+
* Get the thumb dimensions arguments saved for the gallery for this gallery template
|
141 |
+
*
|
142 |
+
* @param array $dimensions
|
143 |
+
* @param FooGallery $foogallery
|
144 |
+
*
|
145 |
+
* @return mixed
|
146 |
+
*/
|
147 |
+
function get_thumbnail_dimensions( $dimensions, $foogallery ) {
|
148 |
+
$height = $foogallery->get_meta( 'justified_thumb_height', false );
|
149 |
+
return array(
|
150 |
+
'height' => intval( $height ),
|
151 |
+
'width' => 0,
|
152 |
+
'crop' => false
|
153 |
+
);
|
154 |
+
}
|
155 |
+
|
156 |
+
/**
|
157 |
+
* Enqueue scripts that the default gallery template relies on
|
158 |
+
*/
|
159 |
+
function enqueue_dependencies( $gallery ) {
|
160 |
+
//enqueue core files
|
161 |
+
foogallery_enqueue_core_gallery_template_style();
|
162 |
+
foogallery_enqueue_core_gallery_template_script();
|
163 |
+
}
|
164 |
+
|
165 |
+
/**
|
166 |
+
* Add the required justified options if needed
|
167 |
+
*
|
168 |
+
* @param $options
|
169 |
+
* @param $gallery FooGallery
|
170 |
+
*
|
171 |
+
* @param $attributes array
|
172 |
+
*
|
173 |
+
* @return array
|
174 |
+
*/
|
175 |
+
function add_justified_options($options, $gallery, $attributes) {
|
176 |
+
|
177 |
+
$row_height = foogallery_gallery_template_setting( 'row_height', '150' );
|
178 |
+
$max_row_height = foogallery_gallery_template_setting( 'max_row_height', '200%' );
|
179 |
+
if ( strpos( $max_row_height, '%' ) === false ) {
|
180 |
+
$max_row_height = intval( $max_row_height );
|
181 |
+
}
|
182 |
+
$margins = foogallery_gallery_template_setting( 'margins', '1' );
|
183 |
+
|
184 |
+
$options['template']['rowHeight'] = intval($row_height);
|
185 |
+
$options['template']['maxRowHeight'] = $max_row_height;
|
186 |
+
$options['template']['margins'] = intval($margins);
|
187 |
+
|
188 |
+
return $options;
|
189 |
+
}
|
190 |
+
|
191 |
+
/**
|
192 |
+
* Build up a arguments used in the preview of the gallery
|
193 |
+
* @param $args
|
194 |
+
* @param $post_data
|
195 |
+
*
|
196 |
+
* @return mixed
|
197 |
+
*/
|
198 |
+
function preview_arguments( $args, $post_data ) {
|
199 |
+
$args['thumbnail_height'] = $post_data[FOOGALLERY_META_SETTINGS]['justified_thumb_height'];
|
200 |
+
$args['row_height'] = $post_data[FOOGALLERY_META_SETTINGS]['justified_row_height'];
|
201 |
+
$args['max_row_height'] = $post_data[FOOGALLERY_META_SETTINGS]['justified_max_row_height'];
|
202 |
+
$args['margins'] = $post_data[FOOGALLERY_META_SETTINGS]['justified_margins'];
|
203 |
+
return $args;
|
204 |
+
}
|
205 |
+
|
206 |
+
/**
|
207 |
+
* Builds thumb dimensions from arguments
|
208 |
+
*
|
209 |
+
* @param array $dimensions
|
210 |
+
* @param array $arguments
|
211 |
+
*
|
212 |
+
* @return mixed
|
213 |
+
*/
|
214 |
+
function build_thumbnail_dimensions_from_arguments( $dimensions, $arguments ) {
|
215 |
+
return array(
|
216 |
+
'height' => intval( $arguments['thumbnail_height'] ),
|
217 |
+
'width' => 0,
|
218 |
+
'crop' => false
|
219 |
+
);
|
220 |
+
}
|
221 |
+
}
|
222 |
+
}
|
extensions/default-templates/justified/gallery-justified.php
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* FooGallery Justified gallery template
|
4 |
+
*/
|
5 |
+
global $current_foogallery;
|
6 |
+
global $current_foogallery_arguments;
|
7 |
+
$height = foogallery_gallery_template_setting( 'thumb_height', '250' );
|
8 |
+
$args = array(
|
9 |
+
'height' => $height,
|
10 |
+
'link' => foogallery_gallery_template_setting( 'thumbnail_link', 'image' )
|
11 |
+
);
|
12 |
+
$lightbox = foogallery_gallery_template_setting( 'lightbox', 'unknown' );
|
13 |
+
|
14 |
+
$foogallery_justified_classes = foogallery_build_class_attribute_safe( $current_foogallery, 'foogallery-lightbox-' . $lightbox );
|
15 |
+
$foogallery_justified_attributes = foogallery_build_container_attributes_safe( $current_foogallery, array( 'class' => $foogallery_justified_classes) );
|
16 |
+
?>
|
17 |
+
<div <?php echo $foogallery_justified_attributes; ?>>
|
18 |
+
<?php foreach ( $current_foogallery->attachments() as $attachment ) {
|
19 |
+
echo foogallery_attachment_html( $attachment, $args );
|
20 |
+
} ?>
|
21 |
+
</div>
|
extensions/default-templates/masonry/class-masonry-gallery-template.php
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
if ( !class_exists( 'FooGallery_Masonry_Gallery_Template' ) ) {
|
4 |
+
|
5 |
+
define('FOOGALLERY_MASONRY_GALLERY_TEMPLATE_URL', plugin_dir_url( __FILE__ ));
|
6 |
+
|
7 |
+
class FooGallery_Masonry_Gallery_Template {
|
8 |
+
/**
|
9 |
+
* Wire up everything we need to run the extension
|
10 |
+
*/
|
11 |
+
function __construct() {
|
12 |
+
add_filter( 'foogallery_gallery_templates', array( $this, 'add_template' ) );
|
13 |
+
add_filter( 'foogallery_gallery_templates_files', array( $this, 'register_myself' ) );
|
14 |
+
|
15 |
+
add_action( 'foogallery_enqueue_preview_dependencies', array( $this, 'enqueue_preview_dependencies' ) );
|
16 |
+
|
17 |
+
add_filter( 'foogallery_located_template-masonry', array( $this, 'enqueue_dependencies' ) );
|
18 |
+
|
19 |
+
add_filter( 'foogallery_template_thumbnail_dimensions-masonry', array( $this, 'get_thumbnail_dimensions' ), 10, 2 );
|
20 |
+
|
21 |
+
//add the data options needed for masonry
|
22 |
+
add_filter( 'foogallery_build_container_data_options-masonry', array( $this, 'add_masonry_options' ), 10, 3 );
|
23 |
+
|
24 |
+
//build up any preview arguments
|
25 |
+
add_filter( 'foogallery_preview_arguments-masonry', array( $this, 'preview_arguments' ), 10, 2 );
|
26 |
+
|
27 |
+
//build up the thumb dimensions from some arguments
|
28 |
+
add_filter( 'foogallery_calculate_thumbnail_dimensions-masonry', array( $this, 'build_thumbnail_dimensions_from_arguments' ), 10, 2 );
|
29 |
+
}
|
30 |
+
|
31 |
+
/**
|
32 |
+
* Register myself so that all associated JS and CSS files can be found and automatically included
|
33 |
+
* @param $extensions
|
34 |
+
*
|
35 |
+
* @return array
|
36 |
+
*/
|
37 |
+
function register_myself( $extensions ) {
|
38 |
+
$extensions[] = __FILE__;
|
39 |
+
return $extensions;
|
40 |
+
}
|
41 |
+
|
42 |
+
/**
|
43 |
+
* Add our gallery template to the list of templates available for every gallery
|
44 |
+
* @param $gallery_templates
|
45 |
+
*
|
46 |
+
* @return array
|
47 |
+
*/
|
48 |
+
function add_template( $gallery_templates ) {
|
49 |
+
$gallery_templates[] = array(
|
50 |
+
'slug' => 'masonry',
|
51 |
+
'name' => __( 'Masonry Image Gallery', 'foogallery' ),
|
52 |
+
'preview_support' => true,
|
53 |
+
'common_fields_support' => true,
|
54 |
+
'lazyload_support' => true,
|
55 |
+
'paging_support' => true,
|
56 |
+
'mandatory_classes' => 'fg-masonry',
|
57 |
+
'thumbnail_dimensions' => true,
|
58 |
+
'fields' => array(
|
59 |
+
array(
|
60 |
+
'id' => 'thumbnail_width',
|
61 |
+
'title' => __( 'Thumb Width', 'foogallery' ),
|
62 |
+
'desc' => __( 'Choose the width of your thumbnails. Thumbnails will be generated on the fly and cached once generated', 'foogallery' ),
|
63 |
+
'section' => __( 'General', 'foogallery' ),
|
64 |
+
'type' => 'number',
|
65 |
+
'class' => 'small-text',
|
66 |
+
'default' => 150,
|
67 |
+
'step' => '1',
|
68 |
+
'min' => '0',
|
69 |
+
'row_data'=> array(
|
70 |
+
'data-foogallery-change-selector' => 'input',
|
71 |
+
'data-foogallery-preview' => 'shortcode'
|
72 |
+
)
|
73 |
+
),
|
74 |
+
array(
|
75 |
+
'id' => 'layout',
|
76 |
+
'title' => __( 'Masonry Layout', 'foogallery' ),
|
77 |
+
'desc' => __( 'Choose a fixed width thumb layout, or responsive columns.', 'foogallery' ),
|
78 |
+
'section' => __( 'General', 'foogallery' ),
|
79 |
+
'type' => 'radio',
|
80 |
+
'choices' => array(
|
81 |
+
'fixed' => __( 'Fixed Width', 'foogallery' ),
|
82 |
+
'col2' => __( '2 Columns', 'foogallery' ),
|
83 |
+
'col3' => __( '3 Columns', 'foogallery' ),
|
84 |
+
'col4' => __( '4 Columns', 'foogallery' ),
|
85 |
+
'col5' => __( '5 Columns', 'foogallery' )
|
86 |
+
),
|
87 |
+
'default' => 'fixed',
|
88 |
+
'row_data'=> array(
|
89 |
+
'data-foogallery-change-selector' => 'input:radio',
|
90 |
+
'data-foogallery-value-selector' => 'input:checked',
|
91 |
+
'data-foogallery-preview' => 'shortcode'
|
92 |
+
)
|
93 |
+
),
|
94 |
+
array(
|
95 |
+
'id' => 'gutter_width',
|
96 |
+
'title' => __( 'Gutter Width', 'foogallery' ),
|
97 |
+
'desc' => __( 'The spacing between your thumbnails. Only applicable when using a fixed layout!', 'foogallery' ),
|
98 |
+
'section' => __( 'General', 'foogallery' ),
|
99 |
+
'type' => 'number',
|
100 |
+
'class' => 'small-text',
|
101 |
+
'default' => 10,
|
102 |
+
'step' => '1',
|
103 |
+
'min' => '0',
|
104 |
+
'row_data'=> array(
|
105 |
+
'data-foogallery-hidden' => true,
|
106 |
+
'data-foogallery-change-selector' => 'input',
|
107 |
+
'data-foogallery-value-selector' => 'input',
|
108 |
+
'data-foogallery-show-when-field' => 'layout',
|
109 |
+
'data-foogallery-show-when-field-value' => 'fixed',
|
110 |
+
'data-foogallery-preview' => 'shortcode',
|
111 |
+
)
|
112 |
+
),
|
113 |
+
array(
|
114 |
+
'id' => 'gutter_percent',
|
115 |
+
'title' => __( 'Gutter Size', 'foogallery' ),
|
116 |
+
'desc' => __( 'Choose a gutter size when using responsive columns.', 'foogallery' ),
|
117 |
+
'section' => __( 'General', 'foogallery' ),
|
118 |
+
'type' => 'radio',
|
119 |
+
'choices' => array(
|
120 |
+
'fg-gutter-none' => __( 'No Gutter', 'foogallery' ),
|
121 |
+
'' => __( 'Normal Size Gutter', 'foogallery' ),
|
122 |
+
'fg-gutter-large' => __( 'Larger Gutter', 'foogallery' )
|
123 |
+
),
|
124 |
+
'default' => '',
|
125 |
+
'row_data'=> array(
|
126 |
+
'data-foogallery-hidden' => true,
|
127 |
+
'data-foogallery-change-selector' => 'input:radio',
|
128 |
+
'data-foogallery-value-selector' => 'input:checked',
|
129 |
+
'data-foogallery-show-when-field' => 'layout',
|
130 |
+
'data-foogallery-show-when-field-operator' => '!==',
|
131 |
+
'data-foogallery-show-when-field-value' => 'fixed',
|
132 |
+
'data-foogallery-preview' => 'class'
|
133 |
+
)
|
134 |
+
),
|
135 |
+
array(
|
136 |
+
'id' => 'alignment',
|
137 |
+
'title' => __( 'Alignment', 'foogallery' ),
|
138 |
+
'desc' => __( 'You can choose to center align your images or leave them at the default (left). Only applicable when using a fixed layout!', 'foogallery' ),
|
139 |
+
'section' => __( 'General', 'foogallery' ),
|
140 |
+
'type' => 'radio',
|
141 |
+
'spacer' => '<span class="spacer"></span>',
|
142 |
+
'choices' => array(
|
143 |
+
'' => __( 'Left', 'foogallery' ),
|
144 |
+
'fg-center' => __( 'Center', 'foogallery' )
|
145 |
+
),
|
146 |
+
'default' => 'fg-center',
|
147 |
+
'row_data'=> array(
|
148 |
+
'data-foogallery-hidden' => true,
|
149 |
+
'data-foogallery-show-when-field' => 'layout',
|
150 |
+
'data-foogallery-show-when-field-value' => 'fixed',
|
151 |
+
'data-foogallery-change-selector' => 'input:radio',
|
152 |
+
'data-foogallery-preview' => 'class'
|
153 |
+
)
|
154 |
+
),
|
155 |
+
array(
|
156 |
+
'id' => 'thumbnail_link',
|
157 |
+
'title' => __( 'Thumb Link', 'foogallery' ),
|
158 |
+
'default' => 'image' ,
|
159 |
+
'type' => 'thumb_link',
|
160 |
+
'desc' => __( 'You can choose to link each thumbnail to the full size image, or to the image\'s attachment page, or you can choose to not link to anything', 'foogallery' ),
|
161 |
+
),
|
162 |
+
array(
|
163 |
+
'id' => 'lightbox',
|
164 |
+
'title' => __( 'Lightbox', 'foogallery' ),
|
165 |
+
'desc' => __( 'Choose which lightbox you want to display images with. The lightbox will only work if you set the thumbnail link to "Full Size Image"', 'foogallery' ),
|
166 |
+
'type' => 'lightbox',
|
167 |
+
'default' => 'none',
|
168 |
+
),
|
169 |
+
),
|
170 |
+
);
|
171 |
+
|
172 |
+
|
173 |
+
return $gallery_templates;
|
174 |
+
}
|
175 |
+
|
176 |
+
/**
|
177 |
+
* Enqueue scripts that the masonry gallery template relies on
|
178 |
+
*/
|
179 |
+
function enqueue_preview_dependencies() {
|
180 |
+
wp_enqueue_script( 'masonry' );
|
181 |
+
}
|
182 |
+
|
183 |
+
/**
|
184 |
+
* Enqueue scripts that the masonry gallery template relies on
|
185 |
+
*/
|
186 |
+
function enqueue_dependencies() {
|
187 |
+
wp_enqueue_script( 'masonry' );
|
188 |
+
|
189 |
+
//enqueue core files
|
190 |
+
foogallery_enqueue_core_gallery_template_style();
|
191 |
+
foogallery_enqueue_core_gallery_template_script();
|
192 |
+
}
|
193 |
+
|
194 |
+
/**
|
195 |
+
* Get the thumb dimensions arguments saved for the gallery for this gallery template
|
196 |
+
*
|
197 |
+
* @param array $dimensions
|
198 |
+
* @param FooGallery $foogallery
|
199 |
+
*
|
200 |
+
* @return mixed
|
201 |
+
*/
|
202 |
+
function get_thumbnail_dimensions( $dimensions, $foogallery ) {
|
203 |
+
$width = $foogallery->get_meta( 'masonry_thumbnail_width', false );
|
204 |
+
return array(
|
205 |
+
'height' => 0,
|
206 |
+
'width' => intval( $width ),
|
207 |
+
'crop' => false
|
208 |
+
);
|
209 |
+
}
|
210 |
+
|
211 |
+
/**
|
212 |
+
* Add the required masonry options if needed
|
213 |
+
*
|
214 |
+
* @param $options
|
215 |
+
* @param $gallery FooGallery
|
216 |
+
*
|
217 |
+
* @param $attributes array
|
218 |
+
*
|
219 |
+
* @return array
|
220 |
+
*/
|
221 |
+
function add_masonry_options($options, $gallery, $attributes) {
|
222 |
+
$layout = foogallery_gallery_template_setting( 'layout', 'fixed' );
|
223 |
+
$options['template']['layout'] = $layout;
|
224 |
+
if ( 'fixed' === $layout ) {
|
225 |
+
$width = foogallery_gallery_template_setting( 'thumbnail_width', '150' );
|
226 |
+
$gutter_width = foogallery_gallery_template_setting( 'gutter_width', '10' );
|
227 |
+
$options['template']['columnWidth'] = intval($width);
|
228 |
+
$options['template']['gutter'] = intval($gutter_width);
|
229 |
+
}
|
230 |
+
return $options;
|
231 |
+
}
|
232 |
+
|
233 |
+
/**
|
234 |
+
* Build up a arguments used in the preview of the gallery
|
235 |
+
* @param $args
|
236 |
+
* @param $post_data
|
237 |
+
*
|
238 |
+
* @return mixed
|
239 |
+
*/
|
240 |
+
function preview_arguments( $args, $post_data ) {
|
241 |
+
$args['thumbnail_width'] = $post_data[FOOGALLERY_META_SETTINGS]['masonry_thumbnail_width'];
|
242 |
+
$args['layout'] = $post_data[FOOGALLERY_META_SETTINGS]['masonry_layout'];
|
243 |
+
$args['gutter_width'] = $post_data[FOOGALLERY_META_SETTINGS]['masonry_gutter_width'];
|
244 |
+
return $args;
|
245 |
+
}
|
246 |
+
|
247 |
+
/**
|
248 |
+
* Builds thumb dimensions from arguments
|
249 |
+
*
|
250 |
+
* @param array $dimensions
|
251 |
+
* @param array $arguments
|
252 |
+
*
|
253 |
+
* @return mixed
|
254 |
+
*/
|
255 |
+
function build_thumbnail_dimensions_from_arguments( $dimensions, $arguments ) {
|
256 |
+
return array(
|
257 |
+
'height' => 0,
|
258 |
+
'width' => intval( $arguments['thumbnail_width'] ),
|
259 |
+
'crop' => false
|
260 |
+
);
|
261 |
+
}
|
262 |
+
}
|
263 |
+
}
|
extensions/default-templates/masonry/gallery-masonry.php
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* FooGallery masonry gallery template
|
4 |
+
*/
|
5 |
+
global $current_foogallery;
|
6 |
+
global $current_foogallery_arguments;
|
7 |
+
$args = array(
|
8 |
+
'width' => foogallery_gallery_template_setting( 'thumbnail_width', '150' ),
|
9 |
+
'link' => foogallery_gallery_template_setting( 'thumbnail_link', 'image' ),
|
10 |
+
'crop' => false
|
11 |
+
);
|
12 |
+
$lightbox = foogallery_gallery_template_setting( 'lightbox', 'unknown' );
|
13 |
+
$alignment = foogallery_gallery_template_setting( 'alignment', 'fg-center' );
|
14 |
+
$layout = foogallery_gallery_template_setting( 'layout', 'fixed' );
|
15 |
+
$gutter_percent = '';
|
16 |
+
if ( 'fixed' !== $layout ) {
|
17 |
+
$gutter_percent = foogallery_gallery_template_setting( 'gutter_percent', '' );
|
18 |
+
}
|
19 |
+
$foogallery_masonry_classes = foogallery_build_class_attribute_safe( $current_foogallery, 'foogallery-lightbox-' . $lightbox, $alignment, $gutter_percent );
|
20 |
+
$foogallery_masonry_attributes = foogallery_build_container_attributes_safe( $current_foogallery, array( 'class' => $foogallery_masonry_classes) );
|
21 |
+
?>
|
22 |
+
<div <?php echo $foogallery_masonry_attributes; ?>>
|
23 |
+
<?php foreach ( $current_foogallery->attachments() as $attachment ) {
|
24 |
+
echo foogallery_attachment_html( $attachment, $args );
|
25 |
+
} ?>
|
26 |
+
</div>
|
extensions/default-templates/masonry/js/admin-gallery-masonry.js
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
(function (FOOGALLERY_MASONRY_TEMPLATE, $, undefined) {
|
2 |
+
|
3 |
+
FOOGALLERY_MASONRY_TEMPLATE.showHideControls = function() {
|
4 |
+
|
5 |
+
var layout = $('input[name="foogallery_settings[masonry_layout]"]:checked').val();
|
6 |
+
|
7 |
+
if ( layout === 'fixed' ) {
|
8 |
+
$('.gallery_template_field-masonry-gutter_width, .gallery_template_field-masonry-center_align').show();
|
9 |
+
$('.gallery_template_field-masonry-gutter_percent').hide();
|
10 |
+
} else {
|
11 |
+
$('.gallery_template_field-masonry-gutter_width, .gallery_template_field-masonry-center_align').hide();
|
12 |
+
$('.gallery_template_field-masonry-gutter_percent').show();
|
13 |
+
}
|
14 |
+
};
|
15 |
+
|
16 |
+
FOOGALLERY_MASONRY_TEMPLATE.adminReady = function () {
|
17 |
+
$('body').on('foogallery-gallery-template-changed-masonry', function() {
|
18 |
+
FOOGALLERY_MASONRY_TEMPLATE.showHideControls();
|
19 |
+
});
|
20 |
+
|
21 |
+
$('input[name="foogallery_settings[masonry_layout]"]').change(function() {
|
22 |
+
FOOGALLERY_MASONRY_TEMPLATE.showHideControls();
|
23 |
+
});
|
24 |
+
};
|
25 |
+
|
26 |
+
}(window.FOOGALLERY_MASONRY_TEMPLATE = window.FOOGALLERY_MASONRY_TEMPLATE || {}, jQuery));
|
27 |
+
|
28 |
+
jQuery(function () {
|
29 |
+
FOOGALLERY_MASONRY_TEMPLATE.adminReady();
|
30 |
+
});
|
extensions/default-templates/shared/css/admin-foogallery.css
ADDED
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.foogallery-setting-caption_icon,
|
2 |
+
.foogallery-setting-loading_icon {
|
3 |
+
content: "";
|
4 |
+
display: inline-block;
|
5 |
+
position: relative;
|
6 |
+
width: 40px;
|
7 |
+
height: 40px;
|
8 |
+
margin: 0;
|
9 |
+
background: transparent no-repeat center center;
|
10 |
+
background-size: 40px 40px;
|
11 |
+
vertical-align: middle;
|
12 |
+
}
|
13 |
+
.foogallery-setting-caption_icon.fg-hover-zoom {
|
14 |
+
background-image: url('../img/zoom.png');
|
15 |
+
}
|
16 |
+
.foogallery-setting-caption_icon.fg-hover-zoom2 {
|
17 |
+
background-image: url('../img/zoom2.png');
|
18 |
+
}
|
19 |
+
.foogallery-setting-caption_icon.fg-hover-zoom3 {
|
20 |
+
background-image: url('../img/zoom3.png');
|
21 |
+
}
|
22 |
+
.foogallery-setting-caption_icon.fg-hover-plus {
|
23 |
+
background-image: url('../img/plus.png');
|
24 |
+
}
|
25 |
+
.foogallery-setting-caption_icon.fg-hover-circle-plus {
|
26 |
+
background-image: url('../img/circle-plus.png');
|
27 |
+
}
|
28 |
+
.foogallery-setting-caption_icon.fg-hover-eye {
|
29 |
+
background-image: url('../img/eye.png');
|
30 |
+
}
|
31 |
+
.foogallery-setting-caption_icon.fg-hover-external {
|
32 |
+
background-image: url('../img/external.png');
|
33 |
+
}
|
34 |
+
|
35 |
+
.foogallery_template_field_type-htmlicon.foogallery_template_field_id-loading_icon td label {
|
36 |
+
background-color: #eee;
|
37 |
+
}
|
38 |
+
|
39 |
+
.foogallery_template_field_type-htmlicon.foogallery_template_field_id-loading_icon td input:checked + label {
|
40 |
+
background-color: #eee;
|
41 |
+
}
|
42 |
+
|
43 |
+
.foogallery-setting-loading_icon .fg-loader {
|
44 |
+
position: absolute;
|
45 |
+
top: 50%;
|
46 |
+
left: 50%;
|
47 |
+
transform: translateX(-50%) translateY(-50%);
|
48 |
+
width: 1em;
|
49 |
+
height: 1em;
|
50 |
+
font-size: 5px;
|
51 |
+
}
|
52 |
+
|
53 |
+
.foogallery-setting-loading_icon.fg-loading-bars .fg-loader {
|
54 |
+
font-size: 4px;
|
55 |
+
width: 1em;
|
56 |
+
height: 4em;
|
57 |
+
}
|
58 |
+
|
59 |
+
.foogallery-setting-loading_icon.fg-loading-partial .fg-loader {
|
60 |
+
font-size: 4px;
|
61 |
+
width: 10em;
|
62 |
+
height: 10em;
|
63 |
+
}
|
64 |
+
|
65 |
+
.foogallery-setting-loading_icon.fg-loading-pulse .fg-loader {
|
66 |
+
font-size: 4px;
|
67 |
+
width: 2.5em;
|
68 |
+
height: 2.5em;
|
69 |
+
transform: translateX(-50%) translateY(-150%);
|
70 |
+
}
|
71 |
+
|
72 |
+
.foogallery-setting-loading_icon.fg-loading-trail .fg-loader {
|
73 |
+
font-size: 20px;
|
74 |
+
}
|
75 |
+
|
76 |
+
.fg-item-inner {
|
77 |
+
margin: 0;
|
78 |
+
}
|
extensions/default-templates/shared/css/foogallery.css
ADDED
@@ -0,0 +1,2305 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.foogallery, .foogallery * {
|
2 |
+
box-sizing: border-box;
|
3 |
+
}
|
4 |
+
.foogallery {
|
5 |
+
display: block;
|
6 |
+
z-index: 1;
|
7 |
+
font-family: -apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
|
8 |
+
position: relative;
|
9 |
+
line-height: 0;
|
10 |
+
font-size: 0;
|
11 |
+
}
|
12 |
+
.foogallery .fg-item {
|
13 |
+
display: inline-block;
|
14 |
+
position: relative;
|
15 |
+
background-color: transparent;
|
16 |
+
z-index: 2;
|
17 |
+
-webkit-user-select: none;
|
18 |
+
-moz-user-select: none;
|
19 |
+
-ms-user-select: none;
|
20 |
+
user-select: none;
|
21 |
+
}
|
22 |
+
.foogallery .fg-item-inner {
|
23 |
+
display: block;
|
24 |
+
position: relative;
|
25 |
+
visibility: hidden;
|
26 |
+
overflow: hidden;
|
27 |
+
opacity: 0;
|
28 |
+
z-index: 3;
|
29 |
+
margin: 0;
|
30 |
+
border: solid 0 transparent;
|
31 |
+
}
|
32 |
+
|
33 |
+
.foogallery .fg-item.fg-loading,
|
34 |
+
.foogallery .fg-item.fg-error {
|
35 |
+
background: no-repeat center;
|
36 |
+
}
|
37 |
+
|
38 |
+
.foogallery .fg-item.fg-error {
|
39 |
+
background-image: url('../img/image.png');
|
40 |
+
}
|
41 |
+
|
42 |
+
/* @2x Images (Pixel Ratio of 1.25+) */
|
43 |
+
@media only screen and (-o-min-device-pixel-ratio: 5/4),
|
44 |
+
only screen and (-webkit-min-device-pixel-ratio: 1.25),
|
45 |
+
only screen and (min-device-pixel-ratio: 1.25),
|
46 |
+
only screen and (min-resolution: 1.25dppx) {
|
47 |
+
.foogallery .fg-item.fg-error {
|
48 |
+
background-image: url('../img/image@2x.png');
|
49 |
+
}
|
50 |
+
}
|
51 |
+
|
52 |
+
/* @3x Images (Pixel Ratio of 2.25+) */
|
53 |
+
@media only screen and (-o-min-device-pixel-ratio: 9/4),
|
54 |
+
only screen and (-webkit-min-device-pixel-ratio: 2.25),
|
55 |
+
only screen and (min-device-pixel-ratio: 2.25),
|
56 |
+
only screen and (min-resolution: 2.25dppx) {
|
57 |
+
.foogallery .fg-item.fg-error {
|
58 |
+
background-image: url('../img/image@3x.png');
|
59 |
+
}
|
60 |
+
}
|
61 |
+
|
62 |
+
.foogallery .fg-item.fg-loaded {
|
63 |
+
z-index: 4;
|
64 |
+
}
|
65 |
+
.foogallery .fg-loaded .fg-item-inner {
|
66 |
+
visibility: visible;
|
67 |
+
opacity: 1;
|
68 |
+
z-index: 5;
|
69 |
+
}
|
70 |
+
.foogallery .fg-error .fg-item-inner {
|
71 |
+
pointer-events: none;
|
72 |
+
cursor: default;
|
73 |
+
}
|
74 |
+
.foogallery .fg-thumb {
|
75 |
+
display: block;
|
76 |
+
position: relative;
|
77 |
+
border: none;
|
78 |
+
outline: 0;
|
79 |
+
text-decoration: none;
|
80 |
+
z-index: 4;
|
81 |
+
}
|
82 |
+
.foogallery .fg-image {
|
83 |
+
display: block;
|
84 |
+
position: relative;
|
85 |
+
border: none;
|
86 |
+
outline: 0;
|
87 |
+
text-decoration: none;
|
88 |
+
z-index: 5;
|
89 |
+
max-width: none;
|
90 |
+
height: auto;
|
91 |
+
}
|
92 |
+
.foogallery .fg-loaded .fg-thumb {
|
93 |
+
z-index: 6;
|
94 |
+
}
|
95 |
+
.foogallery .fg-loaded .fg-image {
|
96 |
+
z-index: 7;
|
97 |
+
}
|
98 |
+
|
99 |
+
|
100 |
+
/* Item Style */
|
101 |
+
.foogallery.fg-light .fg-item-inner {
|
102 |
+
background-color: #FFF;
|
103 |
+
color: #333;
|
104 |
+
border-color: #FFF;
|
105 |
+
}
|
106 |
+
.foogallery.fg-dark .fg-item-inner {
|
107 |
+
background-color: #333;
|
108 |
+
color: #FFF;
|
109 |
+
border-color: #333;
|
110 |
+
}
|
111 |
+
/* Idle / Loading / Error Style */
|
112 |
+
.foogallery.fg-light .fg-item.fg-idle,
|
113 |
+
.foogallery.fg-light .fg-item.fg-loading,
|
114 |
+
.foogallery.fg-light .fg-item.fg-error {
|
115 |
+
background-color: #eee;
|
116 |
+
box-shadow: inset 0 0 0 1px #ddd;
|
117 |
+
}
|
118 |
+
.foogallery.fg-dark .fg-item.fg-idle,
|
119 |
+
.foogallery.fg-dark .fg-item.fg-loading,
|
120 |
+
.foogallery.fg-dark .fg-item.fg-error {
|
121 |
+
background-color: #444;
|
122 |
+
box-shadow: inset 0 0 0 1px #333;
|
123 |
+
}
|
124 |
+
/* Border Size */
|
125 |
+
.foogallery.fg-border-thin .fg-item-inner {
|
126 |
+
border-width: 4px;
|
127 |
+
}
|
128 |
+
.foogallery.fg-border-medium .fg-item-inner {
|
129 |
+
border-width: 10px;
|
130 |
+
}
|
131 |
+
.foogallery.fg-border-thick .fg-item-inner {
|
132 |
+
border-width: 16px;
|
133 |
+
}
|
134 |
+
/* Drop Shadows */
|
135 |
+
.foogallery.fg-light.fg-shadow-outline .fg-item-inner {
|
136 |
+
box-shadow: 0 0 0 1px #ddd;
|
137 |
+
}
|
138 |
+
.foogallery.fg-dark.fg-shadow-outline .fg-item-inner {
|
139 |
+
box-shadow: 0 0 0 1px #222;
|
140 |
+
}
|
141 |
+
.foogallery.fg-light.fg-shadow-small .fg-item-inner,
|
142 |
+
.foogallery.fg-dark.fg-shadow-small .fg-item-inner {
|
143 |
+
box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.5);
|
144 |
+
}
|
145 |
+
.foogallery.fg-light.fg-shadow-medium .fg-item-inner,
|
146 |
+
.foogallery.fg-dark.fg-shadow-medium .fg-item-inner {
|
147 |
+
box-shadow: 0 1px 10px 0 rgba(0, 0, 0, 0.5);
|
148 |
+
}
|
149 |
+
.foogallery.fg-light.fg-shadow-large .fg-item-inner,
|
150 |
+
.foogallery.fg-dark.fg-shadow-large .fg-item-inner {
|
151 |
+
box-shadow: 0 1px 16px 0 rgba(0, 0, 0, 0.5);
|
152 |
+
}
|
153 |
+
/* Inset Shadows */
|
154 |
+
.foogallery.fg-shadow-inset-small .fg-thumb:after,
|
155 |
+
.foogallery.fg-shadow-inset-medium .fg-thumb:after,
|
156 |
+
.foogallery.fg-shadow-inset-large .fg-thumb:after {
|
157 |
+
display: block;
|
158 |
+
content: "";
|
159 |
+
position: absolute;
|
160 |
+
top: 0;
|
161 |
+
left: 0;
|
162 |
+
right: 0;
|
163 |
+
bottom: 0;
|
164 |
+
z-index: 7;
|
165 |
+
}
|
166 |
+
.foogallery.fg-light.fg-shadow-inset-small .fg-thumb:after,
|
167 |
+
.foogallery.fg-dark.fg-shadow-inset-small .fg-thumb:after {
|
168 |
+
box-shadow: inset 0 1px 4px 0 rgba(0,0,0,0.3);
|
169 |
+
}
|
170 |
+
.foogallery.fg-light.fg-shadow-inset-medium .fg-thumb:after,
|
171 |
+
.foogallery.fg-dark.fg-shadow-inset-medium .fg-thumb:after {
|
172 |
+
box-shadow: inset 0 1px 10px 0 rgba(0,0,0,0.3);
|
173 |
+
}
|
174 |
+
.foogallery.fg-light.fg-shadow-inset-large .fg-thumb:after,
|
175 |
+
.foogallery.fg-dark.fg-shadow-inset-large .fg-thumb:after {
|
176 |
+
box-shadow: inset 0 1px 16px 0 rgba(0,0,0,0.3);
|
177 |
+
}
|
178 |
+
|
179 |
+
.foogallery.fg-round-full.fg-shadow-inset-small .fg-thumb:after,
|
180 |
+
.foogallery.fg-round-full.fg-shadow-inset-medium .fg-thumb:after,
|
181 |
+
.foogallery.fg-round-full.fg-shadow-inset-large .fg-thumb:after {
|
182 |
+
border-radius: 50%;
|
183 |
+
}
|
184 |
+
/* Rounded Corners */
|
185 |
+
.foogallery.fg-round-small .fg-item,
|
186 |
+
.foogallery.fg-round-small .fg-item-inner {
|
187 |
+
border-radius: 5px;
|
188 |
+
}
|
189 |
+
.foogallery.fg-round-medium .fg-item,
|
190 |
+
.foogallery.fg-round-medium .fg-item-inner {
|
191 |
+
border-radius: 10px;
|
192 |
+
}
|
193 |
+
.foogallery.fg-round-large .fg-item,
|
194 |
+
.foogallery.fg-round-large .fg-item-inner {
|
195 |
+
border-radius: 15px;
|
196 |
+
}
|
197 |
+
.foogallery.fg-round-full .fg-item,
|
198 |
+
.foogallery.fg-round-full .fg-item-inner {
|
199 |
+
border-radius: 50%;
|
200 |
+
}
|
201 |
+
/* Loader Styles */
|
202 |
+
.foogallery .fg-loader {
|
203 |
+
position: absolute;
|
204 |
+
top: 50%;
|
205 |
+
left: 50%;
|
206 |
+
transform: translateX(-50%) translateY(-50%);
|
207 |
+
width: 1em;
|
208 |
+
height: 1em;
|
209 |
+
font-size: 5px;
|
210 |
+
visibility: hidden;
|
211 |
+
opacity: 0;
|
212 |
+
}
|
213 |
+
|
214 |
+
.foogallery .fg-loading .fg-loader {
|
215 |
+
visibility: visible;
|
216 |
+
opacity: 1;
|
217 |
+
}
|
218 |
+
.fg-loading-default .fg-loader {
|
219 |
+
border-radius: 50%;
|
220 |
+
text-indent: -9999em;
|
221 |
+
-webkit-animation: loading-default 1.1s infinite ease;
|
222 |
+
animation: loading-default 1.1s infinite ease;
|
223 |
+
}
|
224 |
+
|
225 |
+
@-webkit-keyframes loading-default {
|
226 |
+
0%,
|
227 |
+
100% {
|
228 |
+
box-shadow: 0 -2.6em 0 0 rgba(130, 130, 130, 1),
|
229 |
+
1.8em -1.8em 0 0 rgba(130, 130, 130, 0.2),
|
230 |
+
2.5em 0 0 0 rgba(130, 130, 130, 0.2),
|
231 |
+
1.75em 1.75em 0 0 rgba(130, 130, 130, 0.2),
|
232 |
+
0 2.5em 0 0 rgba(130, 130, 130, 0.2),
|
233 |
+
-1.8em 1.8em 0 0 rgba(130, 130, 130, 0.2),
|
234 |
+
-2.6em 0 0 0 rgba(130, 130, 130, 0.5),
|
235 |
+
-1.8em -1.8em 0 0 rgba(130, 130, 130, 0.7);
|
236 |
+
}
|
237 |
+
12.5% {
|
238 |
+
box-shadow: 0 -2.6em 0 0 rgba(130, 130, 130, 0.7),
|
239 |
+
1.8em -1.8em 0 0 rgba(130, 130, 130, 1), 2.5em 0 0 0 rgba(130, 130, 130, 0.2),
|
240 |
+
1.75em 1.75em 0 0 rgba(130, 130, 130, 0.2),
|
241 |
+
0 2.5em 0 0 rgba(130, 130, 130, 0.2),
|
242 |
+
-1.8em 1.8em 0 0 rgba(130, 130, 130, 0.2),
|
243 |
+
-2.6em 0 0 0 rgba(130, 130, 130, 0.2),
|
244 |
+
-1.8em -1.8em 0 0 rgba(130, 130, 130, 0.5);
|
245 |
+
}
|
246 |
+
25% {
|
247 |
+
box-shadow: 0 -2.6em 0 0 rgba(130, 130, 130, 0.5),
|
248 |
+
1.8em -1.8em 0 0 rgba(130, 130, 130, 0.7),
|
249 |
+
2.5em 0 0 0 rgba(130, 130, 130, 1), 1.75em 1.75em 0 0 rgba(130, 130, 130, 0.2),
|
250 |
+
0 2.5em 0 0 rgba(130, 130, 130, 0.2),
|
251 |
+
-1.8em 1.8em 0 0 rgba(130, 130, 130, 0.2),
|
252 |
+
-2.6em 0 0 0 rgba(130, 130, 130, 0.2),
|
253 |
+
-1.8em -1.8em 0 0 rgba(130, 130, 130, 0.2);
|
254 |
+
}
|
255 |
+
37.5% {
|
256 |
+
box-shadow: 0 -2.6em 0 0 rgba(130, 130, 130, 0.2),
|
257 |
+
1.8em -1.8em 0 0 rgba(130, 130, 130, 0.5),
|
258 |
+
2.5em 0 0 0 rgba(130, 130, 130, 0.7),
|
259 |
+
1.75em 1.75em 0 0 rgba(130, 130, 130, 1), 0 2.5em 0 0 rgba(130, 130, 130, 0.2),
|
260 |
+
-1.8em 1.8em 0 0 rgba(130, 130, 130, 0.2),
|
261 |
+
-2.6em 0 0 0 rgba(130, 130, 130, 0.2),
|
262 |
+
-1.8em -1.8em 0 0 rgba(130, 130, 130, 0.2);
|
263 |
+
}
|
264 |
+
50% {
|
265 |
+
box-shadow: 0 -2.6em 0 0 rgba(130, 130, 130, 0.2),
|
266 |
+
1.8em -1.8em 0 0 rgba(130, 130, 130, 0.2),
|
267 |
+
2.5em 0 0 0 rgba(130, 130, 130, 0.5),
|
268 |
+
1.75em 1.75em 0 0 rgba(130, 130, 130, 0.7),
|
269 |
+
0 2.5em 0 0 rgba(130, 130, 130, 1), -1.8em 1.8em 0 0 rgba(130, 130, 130, 0.2),
|
270 |
+
-2.6em 0 0 0 rgba(130, 130, 130, 0.2),
|
271 |
+
-1.8em -1.8em 0 0 rgba(130, 130, 130, 0.2);
|
272 |
+
}
|
273 |
+
62.5% {
|
274 |
+
box-shadow: 0 -2.6em 0 0 rgba(130, 130, 130, 0.2),
|
275 |
+
1.8em -1.8em 0 0 rgba(130, 130, 130, 0.2),
|
276 |
+
2.5em 0 0 0 rgba(130, 130, 130, 0.2),
|
277 |
+
1.75em 1.75em 0 0 rgba(130, 130, 130, 0.5),
|
278 |
+
0 2.5em 0 0 rgba(130, 130, 130, 0.7),
|
279 |
+
-1.8em 1.8em 0 0 rgba(130, 130, 130, 1), -2.6em 0 0 0 rgba(130, 130, 130, 0.2),
|
280 |
+
-1.8em -1.8em 0 0 rgba(130, 130, 130, 0.2);
|
281 |
+
}
|
282 |
+
75% {
|
283 |
+
box-shadow: 0 -2.6em 0 0 rgba(130, 130, 130, 0.2),
|
284 |
+
1.8em -1.8em 0 0 rgba(130, 130, 130, 0.2),
|
285 |
+
2.5em 0 0 0 rgba(130, 130, 130, 0.2),
|
286 |
+
1.75em 1.75em 0 0 rgba(130, 130, 130, 0.2),
|
287 |
+
0 2.5em 0 0 rgba(130, 130, 130, 0.5),
|
288 |
+
-1.8em 1.8em 0 0 rgba(130, 130, 130, 0.7),
|
289 |
+
-2.6em 0 0 0 rgba(130, 130, 130, 1), -1.8em -1.8em 0 0 rgba(130, 130, 130, 0.2);
|
290 |
+
}
|
291 |
+
87.5% {
|
292 |
+
box-shadow: 0 -2.6em 0 0 rgba(130, 130, 130, 0.2),
|
293 |
+
1.8em -1.8em 0 0 rgba(130, 130, 130, 0.2),
|
294 |
+
2.5em 0 0 0 rgba(130, 130, 130, 0.2),
|
295 |
+
1.75em 1.75em 0 0 rgba(130, 130, 130, 0.2),
|
296 |
+
0 2.5em 0 0 rgba(130, 130, 130, 0.2),
|
297 |
+
-1.8em 1.8em 0 0 rgba(130, 130, 130, 0.5),
|
298 |
+
-2.6em 0 0 0 rgba(130, 130, 130, 0.7),
|
299 |
+
-1.8em -1.8em 0 0 rgba(130, 130, 130, 1);
|
300 |
+
}
|
301 |
+
}
|
302 |
+
|
303 |
+
@keyframes loading-default {
|
304 |
+
0%,
|
305 |
+
100% {
|
306 |
+
box-shadow: 0 -2.6em 0 0 rgba(130, 130, 130, 1),
|
307 |
+
1.8em -1.8em 0 0 rgba(130, 130, 130, 0.2),
|
308 |
+
2.5em 0 0 0 rgba(130, 130, 130, 0.2),
|
309 |
+
1.75em 1.75em 0 0 rgba(130, 130, 130, 0.2),
|
310 |
+
0 2.5em 0 0 rgba(130, 130, 130, 0.2),
|
311 |
+
-1.8em 1.8em 0 0 rgba(130, 130, 130, 0.2),
|
312 |
+
-2.6em 0 0 0 rgba(130, 130, 130, 0.5),
|
313 |
+
-1.8em -1.8em 0 0 rgba(130, 130, 130, 0.7);
|
314 |
+
}
|
315 |
+
12.5% {
|
316 |
+
box-shadow: 0 -2.6em 0 0 rgba(130, 130, 130, 0.7),
|
317 |
+
1.8em -1.8em 0 0 rgba(130, 130, 130, 1), 2.5em 0 0 0 rgba(130, 130, 130, 0.2),
|
318 |
+
1.75em 1.75em 0 0 rgba(130, 130, 130, 0.2),
|
319 |
+
0 2.5em 0 0 rgba(130, 130, 130, 0.2),
|
320 |
+
-1.8em 1.8em 0 0 rgba(130, 130, 130, 0.2),
|
321 |
+
-2.6em 0 0 0 rgba(130, 130, 130, 0.2),
|
322 |
+
-1.8em -1.8em 0 0 rgba(130, 130, 130, 0.5);
|
323 |
+
}
|
324 |
+
25% {
|
325 |
+
box-shadow: 0 -2.6em 0 0 rgba(130, 130, 130, 0.5),
|
326 |
+
1.8em -1.8em 0 0 rgba(130, 130, 130, 0.7),
|
327 |
+
2.5em 0 0 0 rgba(130, 130, 130, 1), 1.75em 1.75em 0 0 rgba(130, 130, 130, 0.2),
|
328 |
+
0 2.5em 0 0 rgba(130, 130, 130, 0.2),
|
329 |
+
-1.8em 1.8em 0 0 rgba(130, 130, 130, 0.2),
|
330 |
+
-2.6em 0 0 0 rgba(130, 130, 130, 0.2),
|
331 |
+
-1.8em -1.8em 0 0 rgba(130, 130, 130, 0.2);
|
332 |
+
}
|
333 |
+
37.5% {
|
334 |
+
box-shadow: 0 -2.6em 0 0 rgba(130, 130, 130, 0.2),
|
335 |
+
1.8em -1.8em 0 0 rgba(130, 130, 130, 0.5),
|
336 |
+
2.5em 0 0 0 rgba(130, 130, 130, 0.7),
|
337 |
+
1.75em 1.75em 0 0 rgba(130, 130, 130, 1), 0 2.5em 0 0 rgba(130, 130, 130, 0.2),
|
338 |
+
-1.8em 1.8em 0 0 rgba(130, 130, 130, 0.2),
|
339 |
+
-2.6em 0 0 0 rgba(130, 130, 130, 0.2),
|
340 |
+
-1.8em -1.8em 0 0 rgba(130, 130, 130, 0.2);
|
341 |
+
}
|
342 |
+
50% {
|
343 |
+
box-shadow: 0 -2.6em 0 0 rgba(130, 130, 130, 0.2),
|
344 |
+
1.8em -1.8em 0 0 rgba(130, 130, 130, 0.2),
|
345 |
+
2.5em 0 0 0 rgba(130, 130, 130, 0.5),
|
346 |
+
1.75em 1.75em 0 0 rgba(130, 130, 130, 0.7),
|
347 |
+
0 2.5em 0 0 rgba(130, 130, 130, 1), -1.8em 1.8em 0 0 rgba(130, 130, 130, 0.2),
|
348 |
+
-2.6em 0 0 0 rgba(130, 130, 130, 0.2),
|
349 |
+
-1.8em -1.8em 0 0 rgba(130, 130, 130, 0.2);
|
350 |
+
}
|
351 |
+
62.5% {
|
352 |
+
box-shadow: 0 -2.6em 0 0 rgba(130, 130, 130, 0.2),
|
353 |
+
1.8em -1.8em 0 0 rgba(130, 130, 130, 0.2),
|
354 |
+
2.5em 0 0 0 rgba(130, 130, 130, 0.2),
|
355 |
+
1.75em 1.75em 0 0 rgba(130, 130, 130, 0.5),
|
356 |
+
0 2.5em 0 0 rgba(130, 130, 130, 0.7),
|
357 |
+
-1.8em 1.8em 0 0 rgba(130, 130, 130, 1), -2.6em 0 0 0 rgba(130, 130, 130, 0.2),
|
358 |
+
-1.8em -1.8em 0 0 rgba(130, 130, 130, 0.2);
|
359 |
+
}
|
360 |
+
75% {
|
361 |
+
box-shadow: 0 -2.6em 0 0 rgba(130, 130, 130, 0.2),
|
362 |
+
1.8em -1.8em 0 0 rgba(130, 130, 130, 0.2),
|
363 |
+
2.5em 0 0 0 rgba(130, 130, 130, 0.2),
|
364 |
+
1.75em 1.75em 0 0 rgba(130, 130, 130, 0.2),
|
365 |
+
0 2.5em 0 0 rgba(130, 130, 130, 0.5),
|
366 |
+
-1.8em 1.8em 0 0 rgba(130, 130, 130, 0.7),
|
367 |
+
-2.6em 0 0 0 rgba(130, 130, 130, 1), -1.8em -1.8em 0 0 rgba(130, 130, 130, 0.2);
|
368 |
+
}
|
369 |
+
87.5% {
|
370 |
+
box-shadow: 0 -2.6em 0 0 rgba(130, 130, 130, 0.2),
|
371 |
+
1.8em -1.8em 0 0 rgba(130, 130, 130, 0.2),
|
372 |
+
2.5em 0 0 0 rgba(130, 130, 130, 0.2),
|
373 |
+
1.75em 1.75em 0 0 rgba(130, 130, 130, 0.2),
|
374 |
+
0 2.5em 0 0 rgba(130, 130, 130, 0.2),
|
375 |
+
-1.8em 1.8em 0 0 rgba(130, 130, 130, 0.5),
|
376 |
+
-2.6em 0 0 0 rgba(130, 130, 130, 0.7),
|
377 |
+
-1.8em -1.8em 0 0 rgba(130, 130, 130, 1);
|
378 |
+
}
|
379 |
+
}
|
380 |
+
.fg-loading-bars .fg-loader,
|
381 |
+
.fg-loading-bars .fg-loader:before,
|
382 |
+
.fg-loading-bars .fg-loader:after {
|
383 |
+
background: rgba(130, 130, 130, 1);
|
384 |
+
-webkit-animation: loading-bars 1s infinite ease-in-out;
|
385 |
+
animation: loading-bars 1s infinite ease-in-out;
|
386 |
+
width: 1em;
|
387 |
+
height: 4em;
|
388 |
+
}
|
389 |
+
.fg-loading-bars .fg-loader {
|
390 |
+
color: rgba(130, 130, 130, 1);
|
391 |
+
text-indent: -9999em;
|
392 |
+
font-size: 4px;
|
393 |
+
-webkit-animation-delay: -0.16s;
|
394 |
+
animation-delay: -0.16s;
|
395 |
+
}
|
396 |
+
.fg-loading-bars .fg-loader:before,
|
397 |
+
.fg-loading-bars .fg-loader:after {
|
398 |
+
position: absolute;
|
399 |
+
top: 0;
|
400 |
+
content: '';
|
401 |
+
}
|
402 |
+
.fg-loading-bars .fg-loader:before {
|
403 |
+
left: -1.5em;
|
404 |
+
-webkit-animation-delay: -0.32s;
|
405 |
+
animation-delay: -0.32s;
|
406 |
+
}
|
407 |
+
.fg-loading-bars .fg-loader:after {
|
408 |
+
left: 1.5em;
|
409 |
+
}
|
410 |
+
@-webkit-keyframes loading-bars {
|
411 |
+
0%,
|
412 |
+
80%,
|
413 |
+
100% {
|
414 |
+
box-shadow: 0 0;
|
415 |
+
height: 4em;
|
416 |
+
}
|
417 |
+
40% {
|
418 |
+
box-shadow: 0 -2em;
|
419 |
+
height: 5em;
|
420 |
+
}
|
421 |
+
}
|
422 |
+
@keyframes loading-bars {
|
423 |
+
0%,
|
424 |
+
80%,
|
425 |
+
100% {
|
426 |
+
box-shadow: 0 0;
|
427 |
+
height: 4em;
|
428 |
+
}
|
429 |
+
40% {
|
430 |
+
box-shadow: 0 -2em;
|
431 |
+
height: 5em;
|
432 |
+
}
|
433 |
+
}
|
434 |
+
.fg-loading-trail .fg-loader {
|
435 |
+
color: #828282;
|
436 |
+
font-size: 20px;
|
437 |
+
text-indent: -9999em;
|
438 |
+
overflow: hidden;
|
439 |
+
border-radius: 50%;
|
440 |
+
-webkit-animation: loading-trail-1 1.7s infinite ease, loading-trail-2 1.7s infinite ease;
|
441 |
+
animation: loading-trail-1 1.7s infinite ease, loading-trail-2 1.7s infinite ease;
|
442 |
+
}
|
443 |
+
@-webkit-keyframes loading-trail-1 {
|
444 |
+
0% {
|
445 |
+
box-shadow: 0 -0.83em 0 -0.4em, 0 -0.83em 0 -0.42em, 0 -0.83em 0 -0.44em, 0 -0.83em 0 -0.46em, 0 -0.83em 0 -0.477em;
|
446 |
+
}
|
447 |
+
5%,
|
448 |
+
95% {
|
449 |
+
box-shadow: 0 -0.83em 0 -0.4em, 0 -0.83em 0 -0.42em, 0 -0.83em 0 -0.44em, 0 -0.83em 0 -0.46em, 0 -0.83em 0 -0.477em;
|
450 |
+
}
|
451 |
+
10%,
|
452 |
+
59% {
|
453 |
+
box-shadow: 0 -0.83em 0 -0.4em, -0.087em -0.825em 0 -0.42em, -0.173em -0.812em 0 -0.44em, -0.256em -0.789em 0 -0.46em, -0.297em -0.775em 0 -0.477em;
|
454 |
+
}
|
455 |
+
20% {
|
456 |
+
box-shadow: 0 -0.83em 0 -0.4em, -0.338em -0.758em 0 -0.42em, -0.555em -0.617em 0 -0.44em, -0.671em -0.488em 0 -0.46em, -0.749em -0.34em 0 -0.477em;
|
457 |
+
}
|
458 |
+
38% {
|
459 |
+
box-shadow: 0 -0.83em 0 -0.4em, -0.377em -0.74em 0 -0.42em, -0.645em -0.522em 0 -0.44em, -0.775em -0.297em 0 -0.46em, -0.82em -0.09em 0 -0.477em;
|
460 |
+
}
|
461 |
+
100% {
|
462 |
+
box-shadow: 0 -0.83em 0 -0.4em, 0 -0.83em 0 -0.42em, 0 -0.83em 0 -0.44em, 0 -0.83em 0 -0.46em, 0 -0.83em 0 -0.477em;
|
463 |
+
}
|
464 |
+
}
|
465 |
+
@keyframes loading-trail-1 {
|
466 |
+
0% {
|
467 |
+
box-shadow: 0 -0.83em 0 -0.4em, 0 -0.83em 0 -0.42em, 0 -0.83em 0 -0.44em, 0 -0.83em 0 -0.46em, 0 -0.83em 0 -0.477em;
|
468 |
+
}
|
469 |
+
5%,
|
470 |
+
95% {
|
471 |
+
box-shadow: 0 -0.83em 0 -0.4em, 0 -0.83em 0 -0.42em, 0 -0.83em 0 -0.44em, 0 -0.83em 0 -0.46em, 0 -0.83em 0 -0.477em;
|
472 |
+
}
|
473 |
+
10%,
|
474 |
+
59% {
|
475 |
+
box-shadow: 0 -0.83em 0 -0.4em, -0.087em -0.825em 0 -0.42em, -0.173em -0.812em 0 -0.44em, -0.256em -0.789em 0 -0.46em, -0.297em -0.775em 0 -0.477em;
|
476 |
+
}
|
477 |
+
20% {
|
478 |
+
box-shadow: 0 -0.83em 0 -0.4em, -0.338em -0.758em 0 -0.42em, -0.555em -0.617em 0 -0.44em, -0.671em -0.488em 0 -0.46em, -0.749em -0.34em 0 -0.477em;
|
479 |
+
}
|
480 |
+
38% {
|
481 |
+
box-shadow: 0 -0.83em 0 -0.4em, -0.377em -0.74em 0 -0.42em, -0.645em -0.522em 0 -0.44em, -0.775em -0.297em 0 -0.46em, -0.82em -0.09em 0 -0.477em;
|
482 |
+
}
|
483 |
+
100% {
|
484 |
+
box-shadow: 0 -0.83em 0 -0.4em, 0 -0.83em 0 -0.42em, 0 -0.83em 0 -0.44em, 0 -0.83em 0 -0.46em, 0 -0.83em 0 -0.477em;
|
485 |
+
}
|
486 |
+
}
|
487 |
+
@-webkit-keyframes loading-trail-2 {
|
488 |
+
0% {
|
489 |
+
-webkit-transform: translateX(-50%) translateY(-50%) rotate(0deg);
|
490 |
+
transform: translateX(-50%) translateY(-50%) rotate(0deg);
|
491 |
+
}
|
492 |
+
100% {
|
493 |
+
-webkit-transform: translateX(-50%) translateY(-50%) rotate(360deg);
|
494 |
+
transform: translateX(-50%) translateY(-50%) rotate(360deg);
|
495 |
+
}
|
496 |
+
}
|
497 |
+
@keyframes loading-trail-2 {
|
498 |
+
0% {
|
499 |
+
-webkit-transform: translateX(-50%) translateY(-50%) rotate(0deg);
|
500 |
+
transform: translateX(-50%) translateY(-50%) rotate(0deg);
|
501 |
+
}
|
502 |
+
100% {
|
503 |
+
-webkit-transform: translateX(-50%) translateY(-50%) rotate(360deg);
|
504 |
+
transform: translateX(-50%) translateY(-50%) rotate(360deg);
|
505 |
+
}
|
506 |
+
}
|
507 |
+
.fg-loading-pulse .fg-loader,
|
508 |
+
.fg-loading-pulse .fg-loader:before,
|
509 |
+
.fg-loading-pulse .fg-loader:after {
|
510 |
+
border-radius: 50%;
|
511 |
+
width: 2.5em;
|
512 |
+
height: 2.5em;
|
513 |
+
-webkit-animation-fill-mode: both;
|
514 |
+
animation-fill-mode: both;
|
515 |
+
-webkit-animation: loading-pulse 1.8s infinite ease-in-out;
|
516 |
+
animation: loading-pulse 1.8s infinite ease-in-out;
|
517 |
+
}
|
518 |
+
.fg-loading-pulse .fg-loader {
|
519 |
+
color: #828282;
|
520 |
+
font-size: 4px;
|
521 |
+
text-indent: -9999em;
|
522 |
+
transform: translateX(-50%) translateY(-150%);
|
523 |
+
-webkit-animation-delay: -0.16s;
|
524 |
+
animation-delay: -0.16s;
|
525 |
+
}
|
526 |
+
.fg-loading-pulse .fg-loader:before,
|
527 |
+
.fg-loading-pulse .fg-loader:after {
|
528 |
+
content: '';
|
529 |
+
position: absolute;
|
530 |
+
top: 0;
|
531 |
+
}
|
532 |
+
.fg-loading-pulse .fg-loader:before {
|
533 |
+
left: -3.5em;
|
534 |
+
-webkit-animation-delay: -0.32s;
|
535 |
+
animation-delay: -0.32s;
|
536 |
+
}
|
537 |
+
.fg-loading-pulse .fg-loader:after {
|
538 |
+
left: 3.5em;
|
539 |
+
}
|
540 |
+
@-webkit-keyframes loading-pulse {
|
541 |
+
0%,
|
542 |
+
80%,
|
543 |
+
100% {
|
544 |
+
box-shadow: 0 2.5em 0 -1.3em;
|
545 |
+
}
|
546 |
+
40% {
|
547 |
+
box-shadow: 0 2.5em 0 0;
|
548 |
+
}
|
549 |
+
}
|
550 |
+
@keyframes loading-pulse {
|
551 |
+
0%,
|
552 |
+
80%,
|
553 |
+
100% {
|
554 |
+
box-shadow: 0 2.5em 0 -1.3em;
|
555 |
+
}
|
556 |
+
40% {
|
557 |
+
box-shadow: 0 2.5em 0 0;
|
558 |
+
}
|
559 |
+
}
|
560 |
+
.fg-loading-dots .fg-loader {
|
561 |
+
color: #828282;
|
562 |
+
font-size: 5px;
|
563 |
+
border-radius: 50%;
|
564 |
+
text-indent: -9999em;
|
565 |
+
-webkit-animation: loading-dots 1.3s infinite linear;
|
566 |
+
animation: loading-dots 1.3s infinite linear;
|
567 |
+
}
|
568 |
+
@-webkit-keyframes loading-dots {
|
569 |
+
0%,
|
570 |
+
100% {
|
571 |
+
box-shadow: 0 -3em 0 0.2em, 2em -2em 0 0em, 3em 0 0 -1em, 2em 2em 0 -1em, 0 3em 0 -1em, -2em 2em 0 -1em, -3em 0 0 -1em, -2em -2em 0 0;
|
572 |
+
}
|
573 |
+
12.5% {
|
574 |
+
box-shadow: 0 -3em 0 0, 2em -2em 0 0.2em, 3em 0 0 0, 2em 2em 0 -1em, 0 3em 0 -1em, -2em 2em 0 -1em, -3em 0 0 -1em, -2em -2em 0 -1em;
|
575 |
+
}
|
576 |
+
25% {
|
577 |
+
box-shadow: 0 -3em 0 -0.5em, 2em -2em 0 0, 3em 0 0 0.2em, 2em 2em 0 0, 0 3em 0 -1em, -2em 2em 0 -1em, -3em 0 0 -1em, -2em -2em 0 -1em;
|
578 |
+
}
|
579 |
+
37.5% {
|
580 |
+
box-shadow: 0 -3em 0 -1em, 2em -2em 0 -1em, 3em 0em 0 0, 2em 2em 0 0.2em, 0 3em 0 0em, -2em 2em 0 -1em, -3em 0em 0 -1em, -2em -2em 0 -1em;
|
581 |
+
}
|
582 |
+
50% {
|
583 |
+
box-shadow: 0 -3em 0 -1em, 2em -2em 0 -1em, 3em 0 0 -1em, 2em 2em 0 0em, 0 3em 0 0.2em, -2em 2em 0 0, -3em 0em 0 -1em, -2em -2em 0 -1em;
|
584 |
+
}
|
585 |
+
62.5% {
|
586 |
+
box-shadow: 0 -3em 0 -1em, 2em -2em 0 -1em, 3em 0 0 -1em, 2em 2em 0 -1em, 0 3em 0 0, -2em 2em 0 0.2em, -3em 0 0 0, -2em -2em 0 -1em;
|
587 |
+
}
|
588 |
+
75% {
|
589 |
+
box-shadow: 0em -3em 0 -1em, 2em -2em 0 -1em, 3em 0em 0 -1em, 2em 2em 0 -1em, 0 3em 0 -1em, -2em 2em 0 0, -3em 0em 0 0.2em, -2em -2em 0 0;
|
590 |
+
}
|
591 |
+
87.5% {
|
592 |
+
box-shadow: 0em -3em 0 0, 2em -2em 0 -1em, 3em 0 0 -1em, 2em 2em 0 -1em, 0 3em 0 -1em, -2em 2em 0 0, -3em 0em 0 0, -2em -2em 0 0.2em;
|
593 |
+
}
|
594 |
+
}
|
595 |
+
@keyframes loading-dots {
|
596 |
+
0%,
|
597 |
+
100% {
|
598 |
+
box-shadow: 0 -3em 0 0.2em, 2em -2em 0 0em, 3em 0 0 -1em, 2em 2em 0 -1em, 0 3em 0 -1em, -2em 2em 0 -1em, -3em 0 0 -1em, -2em -2em 0 0;
|
599 |
+
}
|
600 |
+
12.5% {
|
601 |
+
box-shadow: 0 -3em 0 0, 2em -2em 0 0.2em, 3em 0 0 0, 2em 2em 0 -1em, 0 3em 0 -1em, -2em 2em 0 -1em, -3em 0 0 -1em, -2em -2em 0 -1em;
|
602 |
+
}
|
603 |
+
25% {
|
604 |
+
box-shadow: 0 -3em 0 -0.5em, 2em -2em 0 0, 3em 0 0 0.2em, 2em 2em 0 0, 0 3em 0 -1em, -2em 2em 0 -1em, -3em 0 0 -1em, -2em -2em 0 -1em;
|
605 |
+
}
|
606 |
+
37.5% {
|
607 |
+
box-shadow: 0 -3em 0 -1em, 2em -2em 0 -1em, 3em 0em 0 0, 2em 2em 0 0.2em, 0 3em 0 0em, -2em 2em 0 -1em, -3em 0em 0 -1em, -2em -2em 0 -1em;
|
608 |
+
}
|
609 |
+
50% {
|
610 |
+
box-shadow: 0 -3em 0 -1em, 2em -2em 0 -1em, 3em 0 0 -1em, 2em 2em 0 0em, 0 3em 0 0.2em, -2em 2em 0 0, -3em 0em 0 -1em, -2em -2em 0 -1em;
|
611 |
+
}
|
612 |
+
62.5% {
|
613 |
+
box-shadow: 0 -3em 0 -1em, 2em -2em 0 -1em, 3em 0 0 -1em, 2em 2em 0 -1em, 0 3em 0 0, -2em 2em 0 0.2em, -3em 0 0 0, -2em -2em 0 -1em;
|
614 |
+
}
|
615 |
+
75% {
|
616 |
+
box-shadow: 0em -3em 0 -1em, 2em -2em 0 -1em, 3em 0em 0 -1em, 2em 2em 0 -1em, 0 3em 0 -1em, -2em 2em 0 0, -3em 0em 0 0.2em, -2em -2em 0 0;
|
617 |
+
}
|
618 |
+
87.5% {
|
619 |
+
box-shadow: 0em -3em 0 0, 2em -2em 0 -1em, 3em 0 0 -1em, 2em 2em 0 -1em, 0 3em 0 -1em, -2em 2em 0 0, -3em 0em 0 0, -2em -2em 0 0.2em;
|
620 |
+
}
|
621 |
+
}
|
622 |
+
.fg-loading-partial .fg-loader,
|
623 |
+
.fg-loading-partial .fg-loader:after {
|
624 |
+
border-radius: 50%;
|
625 |
+
width: 10em;
|
626 |
+
height: 10em;
|
627 |
+
}
|
628 |
+
.fg-loading-partial .fg-loader {
|
629 |
+
font-size: 4px;
|
630 |
+
text-indent: -9999em;
|
631 |
+
border-top: 1.1em solid rgba(130,130,130, 0.2);
|
632 |
+
border-right: 1.1em solid rgba(130,130,130, 0.2);
|
633 |
+
border-bottom: 1.1em solid rgba(130,130,130, 0.2);
|
634 |
+
border-left: 1.1em solid #828282;
|
635 |
+
-webkit-animation: loading-partial 1.1s infinite linear;
|
636 |
+
animation: loading-partial 1.1s infinite linear;
|
637 |
+
}
|
638 |
+
@-webkit-keyframes loading-partial {
|
639 |
+
0% {
|
640 |
+
-webkit-transform: translateX(-50%) translateY(-50%) rotate(0deg);
|
641 |
+
transform: translateX(-50%) translateY(-50%) rotate(0deg);
|
642 |
+
}
|
643 |
+
100% {
|
644 |
+
-webkit-transform: translateX(-50%) translateY(-50%) rotate(360deg);
|
645 |
+
transform: translateX(-50%) translateY(-50%) rotate(360deg);
|
646 |
+
}
|
647 |
+
}
|
648 |
+
@keyframes loading-partial {
|
649 |
+
0% {
|
650 |
+
-webkit-transform: translateX(-50%) translateY(-50%) rotate(0deg);
|
651 |
+
transform: translateX(-50%) translateY(-50%) rotate(0deg);
|
652 |
+
}
|
653 |
+
100% {
|
654 |
+
-webkit-transform: translateX(-50%) translateY(-50%) rotate(360deg);
|
655 |
+
transform: translateX(-50%) translateY(-50%) rotate(360deg);
|
656 |
+
}
|
657 |
+
}
|
658 |
+
/* Loaded Effects */
|
659 |
+
.foogallery.fg-loaded-fade-in .fg-item,
|
660 |
+
.foogallery.fg-loaded-slide-up .fg-item,
|
661 |
+
.foogallery.fg-loaded-slide-down .fg-item,
|
662 |
+
.foogallery.fg-loaded-slide-left .fg-item,
|
663 |
+
.foogallery.fg-loaded-slide-right .fg-item,
|
664 |
+
.foogallery.fg-loaded-scale-up .fg-item,
|
665 |
+
.foogallery.fg-loaded-swing-down .fg-item,
|
666 |
+
.foogallery.fg-loaded-drop .fg-item,
|
667 |
+
.foogallery.fg-loaded-fly .fg-item,
|
668 |
+
.foogallery.fg-loaded-flip .fg-item {
|
669 |
+
transition-timing-function: ease;
|
670 |
+
transition-duration: 650ms;
|
671 |
+
transition-property: background-color, transform;
|
672 |
+
}
|
673 |
+
.foogallery.fg-loaded-fade-in .fg-item-inner,
|
674 |
+
.foogallery.fg-loaded-slide-up .fg-item-inner,
|
675 |
+
.foogallery.fg-loaded-slide-down .fg-item-inner,
|
676 |
+
.foogallery.fg-loaded-slide-left .fg-item-inner,
|
677 |
+
.foogallery.fg-loaded-slide-right .fg-item-inner,
|
678 |
+
.foogallery.fg-loaded-scale-up .fg-item-inner,
|
679 |
+
.foogallery.fg-loaded-swing-down .fg-item-inner,
|
680 |
+
.foogallery.fg-loaded-drop .fg-item-inner,
|
681 |
+
.foogallery.fg-loaded-fly .fg-item-inner,
|
682 |
+
.foogallery.fg-loaded-flip .fg-item-inner {
|
683 |
+
transition-timing-function: ease;
|
684 |
+
transition-duration: 650ms;
|
685 |
+
}
|
686 |
+
/* Only apply the perspective once loaded otherwise transitions could take place behind other items*/
|
687 |
+
.foogallery.fg-loaded-swing-down .fg-item.fg-loaded,
|
688 |
+
.foogallery.fg-loaded-drop .fg-item.fg-loaded,
|
689 |
+
.foogallery.fg-loaded-fly .fg-item.fg-loaded,
|
690 |
+
.foogallery.fg-loaded-flip .fg-item.fg-loaded {
|
691 |
+
perspective: 1300px;
|
692 |
+
}
|
693 |
+
/* Fade In */
|
694 |
+
.foogallery.fg-loaded-fade-in .fg-item-inner {
|
695 |
+
transition-property: visibility, opacity;
|
696 |
+
}
|
697 |
+
/* Caption Styles */
|
698 |
+
.foogallery .fg-caption {
|
699 |
+
visibility: hidden;
|
700 |
+
opacity: 0;
|
701 |
+
background-color: rgba(0,0,0,0.6);
|
702 |
+
color: #fff;
|
703 |
+
position: absolute;
|
704 |
+
z-index: 8;
|
705 |
+
width: 100%;
|
706 |
+
max-height: 100%;
|
707 |
+
overflow: hidden;
|
708 |
+
font-family: -apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
|
709 |
+
font-size: 13px;
|
710 |
+
font-weight: 400;
|
711 |
+
line-height: 1.3;
|
712 |
+
border: none;
|
713 |
+
text-align: center;
|
714 |
+
cursor: pointer;
|
715 |
+
}
|
716 |
+
.foogallery .fg-caption a {
|
717 |
+
text-decoration: none;
|
718 |
+
color: #fff;
|
719 |
+
border-bottom: 1px solid #FFF;
|
720 |
+
}
|
721 |
+
.foogallery .fg-caption a:hover {
|
722 |
+
border-bottom: none;
|
723 |
+
}
|
724 |
+
|
725 |
+
.foogallery .fg-caption-title {
|
726 |
+
white-space: nowrap;
|
727 |
+
overflow: hidden;
|
728 |
+
text-overflow: ellipsis;
|
729 |
+
font-size: 16px;
|
730 |
+
font-weight: 400;
|
731 |
+
padding: 5px;
|
732 |
+
}
|
733 |
+
.foogallery .fg-caption-desc {
|
734 |
+
padding: 5px;
|
735 |
+
}
|
736 |
+
.foogallery .fg-caption-title+.fg-caption-desc {
|
737 |
+
padding-top: 0;
|
738 |
+
}
|
739 |
+
|
740 |
+
/* Always */
|
741 |
+
.foogallery.fg-caption-always .fg-caption .fg-caption-inner:before {
|
742 |
+
display: none;
|
743 |
+
}
|
744 |
+
.foogallery.fg-caption-always .fg-item.fg-loaded .fg-caption {
|
745 |
+
left: 0;
|
746 |
+
bottom: 0;
|
747 |
+
transition-timing-function: ease;
|
748 |
+
transition-duration: 300ms;
|
749 |
+
transition-property: visibility, opacity;
|
750 |
+
visibility: visible;
|
751 |
+
opacity: 1;
|
752 |
+
text-align: left;
|
753 |
+
}
|
754 |
+
|
755 |
+
/* On Hover */
|
756 |
+
.foogallery.fg-caption-hover .fg-caption .fg-caption-inner {
|
757 |
+
width: 100%;
|
758 |
+
max-height: 100%;
|
759 |
+
position: absolute;
|
760 |
+
top: 50%;
|
761 |
+
left: 0;
|
762 |
+
transform: translateY(-50%);
|
763 |
+
}
|
764 |
+
.foogallery.fg-caption-hover .fg-item.fg-loaded .fg-thumb:before {
|
765 |
+
display: none;
|
766 |
+
}
|
767 |
+
/* Icon & Overlay */
|
768 |
+
.foogallery.fg-hover-zoom .fg-thumb:before,
|
769 |
+
.foogallery.fg-hover-zoom2 .fg-thumb:before,
|
770 |
+
.foogallery.fg-hover-zoom3 .fg-thumb:before,
|
771 |
+
.foogallery.fg-hover-plus .fg-thumb:before,
|
772 |
+
.foogallery.fg-hover-circle-plus .fg-thumb:before,
|
773 |
+
.foogallery.fg-hover-eye .fg-thumb:before,
|
774 |
+
.foogallery.fg-hover-external .fg-thumb:before,
|
775 |
+
.foogallery.fg-hover-tint .fg-thumb:before {
|
776 |
+
content: "";
|
777 |
+
display: block;
|
778 |
+
position: absolute;
|
779 |
+
visibility: hidden;
|
780 |
+
opacity: 0;
|
781 |
+
top: 0;
|
782 |
+
bottom: 0;
|
783 |
+
left: 0;
|
784 |
+
right: 0;
|
785 |
+
z-index: 8;
|
786 |
+
background: rgba(0,0,0,0.5) no-repeat center center;
|
787 |
+
background-size: 32px 32px;
|
788 |
+
}
|
789 |
+
|
790 |
+
.foogallery.fg-hover-zoom .fg-item-inner:hover .fg-thumb:before,
|
791 |
+
.foogallery.fg-hover-zoom2 .fg-item-inner:hover .fg-thumb:before,
|
792 |
+
.foogallery.fg-hover-zoom3 .fg-item-inner:hover .fg-thumb:before,
|
793 |
+
.foogallery.fg-hover-plus .fg-item-inner:hover .fg-thumb:before,
|
794 |
+
.foogallery.fg-hover-circle-plus .fg-item-inner:hover .fg-thumb:before,
|
795 |
+
.foogallery.fg-hover-eye .fg-item-inner:hover .fg-thumb:before,
|
796 |
+
.foogallery.fg-hover-external .fg-item-inner:hover .fg-thumb:before,
|
797 |
+
.foogallery.fg-hover-tint .fg-item-inner:hover .fg-thumb:before,
|
798 |
+
.foogallery.fg-hover-zoom .fg-thumb:focus:before,
|
799 |
+
.foogallery.fg-hover-zoom2 .fg-thumb:focus:before,
|
800 |
+
.foogallery.fg-hover-zoom3 .fg-thumb:focus:before,
|
801 |
+
.foogallery.fg-hover-plus .fg-thumb:focus:before,
|
802 |
+
.foogallery.fg-hover-circle-plus .fg-thumb:focus:before,
|
803 |
+
.foogallery.fg-hover-eye .fg-thumb:focus:before,
|
804 |
+
.foogallery.fg-hover-external .fg-thumb:focus:before,
|
805 |
+
.foogallery.fg-hover-tint .fg-thumb:focus:before {
|
806 |
+
visibility: visible;
|
807 |
+
opacity: 1;
|
808 |
+
}
|
809 |
+
|
810 |
+
/* Support captions showing the icon */
|
811 |
+
.foogallery.fg-hover-zoom .fg-caption-inner:before,
|
812 |
+
.foogallery.fg-hover-zoom2 .fg-caption-inner:before,
|
813 |
+
.foogallery.fg-hover-zoom3 .fg-caption-inner:before,
|
814 |
+
.foogallery.fg-hover-plus .fg-caption-inner:before,
|
815 |
+
.foogallery.fg-hover-circle-plus .fg-caption-inner:before,
|
816 |
+
.foogallery.fg-hover-eye .fg-caption-inner:before,
|
817 |
+
.foogallery.fg-hover-external .fg-caption-inner:before,
|
818 |
+
.foogallery.fg-hover-tint .fg-caption-inner:before {
|
819 |
+
content: "";
|
820 |
+
display: inline-block;
|
821 |
+
position: relative;
|
822 |
+
width: 32px;
|
823 |
+
height: 32px;
|
824 |
+
margin: 10px 0 5px 0;
|
825 |
+
background: transparent no-repeat center center;
|
826 |
+
background-size: 32px 32px;
|
827 |
+
vertical-align: middle;
|
828 |
+
}
|
829 |
+
|
830 |
+
|
831 |
+
.foogallery.fg-hover-zoom .fg-thumb:before,
|
832 |
+
.foogallery.fg-hover-zoom .fg-caption-inner:before {
|
833 |
+
background-image: url('../img/zoom.png');
|
834 |
+
}
|
835 |
+
|
836 |
+
.foogallery.fg-hover-zoom2 .fg-thumb:before,
|
837 |
+
.foogallery.fg-hover-zoom2 .fg-caption-inner:before {
|
838 |
+
background-image: url('../img/zoom2.png');
|
839 |
+
}
|
840 |
+
|
841 |
+
.foogallery.fg-hover-zoom3 .fg-thumb:before,
|
842 |
+
.foogallery.fg-hover-zoom3 .fg-caption-inner:before {
|
843 |
+
background-image: url('../img/zoom3.png');
|
844 |
+
}
|
845 |
+
|
846 |
+
.foogallery.fg-hover-plus .fg-thumb:before,
|
847 |
+
.foogallery.fg-hover-plus .fg-caption-inner:before {
|
848 |
+
background-image: url('../img/plus.png');
|
849 |
+
}
|
850 |
+
|
851 |
+
.foogallery.fg-hover-circle-plus .fg-thumb:before,
|
852 |
+
.foogallery.fg-hover-circle-plus .fg-caption-inner:before {
|
853 |
+
background-image: url('../img/circle-plus.png');
|
854 |
+
}
|
855 |
+
|
856 |
+
.foogallery.fg-hover-eye .fg-thumb:before,
|
857 |
+
.foogallery.fg-hover-eye .fg-caption-inner:before {
|
858 |
+
background-image: url('../img/eye.png');
|
859 |
+
}
|
860 |
+
|
861 |
+
.foogallery.fg-hover-external .fg-thumb:before,
|
862 |
+
.foogallery.fg-hover-external .fg-caption-inner:before {
|
863 |
+
background-image: url('../img/external.png');
|
864 |
+
}
|
865 |
+
|
866 |
+
/* @2x Images (Pixel Ratio of 1.25+) */
|
867 |
+
@media only screen and (-o-min-device-pixel-ratio: 5/4),
|
868 |
+
only screen and (-webkit-min-device-pixel-ratio: 1.25),
|
869 |
+
only screen and (min-device-pixel-ratio: 1.25),
|
870 |
+
only screen and (min-resolution: 1.25dppx) {
|
871 |
+
|
872 |
+
.foogallery.fg-hover-zoom .fg-thumb:before,
|
873 |
+
.foogallery.fg-hover-zoom .fg-caption-inner:before {
|
874 |
+
background-image: url('../img/zoom@2x.png');
|
875 |
+
}
|
876 |
+
|
877 |
+
.foogallery.fg-hover-zoom2 .fg-thumb:before,
|
878 |
+
.foogallery.fg-hover-zoom2 .fg-caption-inner:before {
|
879 |
+
background-image: url('../img/zoom2@2x.png');
|
880 |
+
}
|
881 |
+
|
882 |
+
.foogallery.fg-hover-zoom3 .fg-thumb:before,
|
883 |
+
.foogallery.fg-hover-zoom3 .fg-caption-inner:before {
|
884 |
+
background-image: url('../img/zoom3@2x.png');
|
885 |
+
}
|
886 |
+
|
887 |
+
.foogallery.fg-hover-plus .fg-thumb:before,
|
888 |
+
.foogallery.fg-hover-plus .fg-caption-inner:before {
|
889 |
+
background-image: url('../img/plus@2x.png');
|
890 |
+
}
|
891 |
+
|
892 |
+
.foogallery.fg-hover-circle-plus .fg-thumb:before,
|
893 |
+
.foogallery.fg-hover-circle-plus .fg-caption-inner:before {
|
894 |
+
background-image: url('../img/circle-plus@2x.png');
|
895 |
+
}
|
896 |
+
|
897 |
+
.foogallery.fg-hover-eye .fg-thumb:before,
|
898 |
+
.foogallery.fg-hover-eye .fg-caption-inner:before {
|
899 |
+
background-image: url('../img/eye@2x.png');
|
900 |
+
}
|
901 |
+
|
902 |
+
.foogallery.fg-hover-external .fg-thumb:before,
|
903 |
+
.foogallery.fg-hover-external .fg-caption-inner:before {
|
904 |
+
background-image: url('../img/external@2x.png');
|
905 |
+
}
|
906 |
+
|
907 |
+
}
|
908 |
+
|
909 |
+
/* @3x Images (Pixel Ratio of 2.25+) */
|
910 |
+
@media only screen and (-o-min-device-pixel-ratio: 9/4),
|
911 |
+
only screen and (-webkit-min-device-pixel-ratio: 2.25),
|
912 |
+
only screen and (min-device-pixel-ratio: 2.25),
|
913 |
+
only screen and (min-resolution: 2.25dppx) {
|
914 |
+
|
915 |
+
.foogallery.fg-hover-zoom .fg-thumb:before,
|
916 |
+
.foogallery.fg-hover-zoom .fg-caption-inner:before {
|
917 |
+
background-image: url('../img/zoom@3x.png');
|
918 |
+
}
|
919 |
+
|
920 |
+
.foogallery.fg-hover-zoom2 .fg-thumb:before,
|
921 |
+
.foogallery.fg-hover-zoom2 .fg-caption-inner:before {
|
922 |
+
background-image: url('../img/zoom2@3x.png');
|
923 |
+
}
|
924 |
+
|
925 |
+
.foogallery.fg-hover-zoom3 .fg-thumb:before,
|
926 |
+
.foogallery.fg-hover-zoom3 .fg-caption-inner:before {
|
927 |
+
background-image: url('../img/zoom3@3x.png');
|
928 |
+
}
|
929 |
+
|
930 |
+
.foogallery.fg-hover-plus .fg-thumb:before,
|
931 |
+
.foogallery.fg-hover-plus .fg-caption-inner:before {
|
932 |
+
background-image: url('../img/plus@3x.png');
|
933 |
+
}
|
934 |
+
|
935 |
+
.foogallery.fg-hover-circle-plus .fg-thumb:before,
|
936 |
+
.foogallery.fg-hover-circle-plus .fg-caption-inner:before {
|
937 |
+
background-image: url('../img/circle-plus@3x.png');
|
938 |
+
}
|
939 |
+
|
940 |
+
.foogallery.fg-hover-eye .fg-thumb:before,
|
941 |
+
.foogallery.fg-hover-eye .fg-caption-inner:before {
|
942 |
+
background-image: url('../img/eye@3x.png');
|
943 |
+
}
|
944 |
+
|
945 |
+
.foogallery.fg-hover-external .fg-thumb:before,
|
946 |
+
.foogallery.fg-hover-external .fg-caption-inner:before {
|
947 |
+
background-image: url('../img/external@3x.png');
|
948 |
+
}
|
949 |
+
|
950 |
+
}
|
951 |
+
/* Transitions */
|
952 |
+
.foogallery.fg-caption-hover.fg-hover-instant .fg-caption,
|
953 |
+
.foogallery.fg-caption-hover.fg-hover-fade .fg-caption,
|
954 |
+
.foogallery.fg-caption-hover.fg-hover-slide-up .fg-caption,
|
955 |
+
.foogallery.fg-caption-hover.fg-hover-slide-down .fg-caption,
|
956 |
+
.foogallery.fg-caption-hover.fg-hover-slide-left .fg-caption,
|
957 |
+
.foogallery.fg-caption-hover.fg-hover-slide-right .fg-caption,
|
958 |
+
.foogallery.fg-caption-hover.fg-hover-push .fg-caption,
|
959 |
+
.foogallery.fg-caption-hover.fg-hover-colorize .fg-caption,
|
960 |
+
.foogallery.fg-caption-hover.fg-hover-grayscale .fg-caption,
|
961 |
+
.foogallery.fg-caption-hover.fg-hover-scale .fg-caption,
|
962 |
+
.foogallery.fg-hover-instant .fg-thumb:before,
|
963 |
+
.foogallery.fg-hover-fade .fg-thumb:before,
|
964 |
+
.foogallery.fg-hover-slide-up .fg-thumb:before,
|
965 |
+
.foogallery.fg-hover-slide-down .fg-thumb:before,
|
966 |
+
.foogallery.fg-hover-slide-left .fg-thumb:before,
|
967 |
+
.foogallery.fg-hover-slide-right .fg-thumb:before,
|
968 |
+
.foogallery.fg-hover-push .fg-thumb,
|
969 |
+
.foogallery.fg-hover-colorize .fg-thumb:before,
|
970 |
+
.foogallery.fg-hover-grayscale .fg-thumb:before,
|
971 |
+
.foogallery.fg-hover-scale .fg-item,
|
972 |
+
.foogallery.fg-hover-scale .fg-thumb:before,
|
973 |
+
.foogallery.fg-hover-colorize .fg-image,
|
974 |
+
.foogallery.fg-hover-grayscale .fg-image {
|
975 |
+
transition-timing-function: ease;
|
976 |
+
transition-duration: 300ms;
|
977 |
+
}
|
978 |
+
/* Colorize */
|
979 |
+
.foogallery.fg-hover-colorize .fg-image {
|
980 |
+
/* Firefox 10+, Firefox on Android */
|
981 |
+
filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'saturate\' values=\'0\'/></filter></svg>#grayscale");
|
982 |
+
/* IE 6-9 */
|
983 |
+
filter: gray;
|
984 |
+
/* Chrome 19+, Safari 6+, Safari 6+ iOS */
|
985 |
+
-webkit-filter: grayscale(100%);
|
986 |
+
-webkit-transition-property: -webkit-filter;
|
987 |
+
transition-property: filter;
|
988 |
+
}
|
989 |
+
.foogallery.fg-hover-colorize .fg-item-inner:hover .fg-image {
|
990 |
+
-webkit-filter: none;
|
991 |
+
filter: none;
|
992 |
+
}
|
993 |
+
.foogallery.fg-hover-colorize .fg-thumb:before,
|
994 |
+
.foogallery.fg-caption-hover.fg-hover-colorize .fg-caption {
|
995 |
+
display: block;
|
996 |
+
left: 0;
|
997 |
+
top: 0;
|
998 |
+
bottom: 0;
|
999 |
+
transition-property: visibility, opacity;
|
1000 |
+
}
|
1001 |
+
.foogallery.fg-hover-colorize .fg-item-inner:hover .fg-thumb:before,
|
1002 |
+
.foogallery.fg-caption-hover.fg-hover-colorize .fg-item-inner:hover .fg-caption {
|
1003 |
+
visibility: visible;
|
1004 |
+
opacity: 1;
|
1005 |
+
}
|
1006 |
+
/* Fade */
|
1007 |
+
.foogallery.fg-hover-fade .fg-loaded .fg-thumb:before,
|
1008 |
+
.foogallery.fg-caption-hover.fg-hover-fade .fg-loaded .fg-caption {
|
1009 |
+
display: block;
|
1010 |
+
left: 0;
|
1011 |
+
top: 0;
|
1012 |
+
bottom: 0;
|
1013 |
+
transition-property: visibility, opacity;
|
1014 |
+
}
|
1015 |
+
.foogallery.fg-hover-fade .fg-loaded .fg-item-inner:hover .fg-thumb:before,
|
1016 |
+
.foogallery.fg-caption-hover.fg-hover-fade .fg-loaded .fg-item-inner:hover .fg-caption {
|
1017 |
+
visibility: visible;
|
1018 |
+
opacity: 1;
|
1019 |
+
}
|
1020 |
+
/* Grayscale */
|
1021 |
+
.foogallery.fg-hover-grayscale .fg-image {
|
1022 |
+
-webkit-filter: none;
|
1023 |
+
filter: none;
|
1024 |
+
-webkit-transition-property: -webkit-filter;
|
1025 |
+
transition-property: filter;
|
1026 |
+
}
|
1027 |
+
.foogallery.fg-hover-grayscale .fg-item-inner:hover .fg-image {
|
1028 |
+
/* For Webkit browsers */
|
1029 |
+
-webkit-filter: grayscale(1);
|
1030 |
+
-webkit-filter: grayscale(100%);
|
1031 |
+
/* Standard */
|
1032 |
+
filter: grayscale(100%);
|
1033 |
+
/* For IE 6 - 9 */
|
1034 |
+
filter: gray;
|
1035 |
+
opacity: 1;
|
1036 |
+
}
|
1037 |
+
.foogallery.fg-hover-grayscale .fg-thumb:before,
|
1038 |
+
.foogallery.fg-caption-hover.fg-hover-grayscale .fg-caption {
|
1039 |
+
display: block;
|
1040 |
+
left: 0;
|
1041 |
+
top: 0;
|
1042 |
+
bottom: 0;
|
1043 |
+
transition-property: visibility, opacity;
|
1044 |
+
}
|
1045 |
+
.foogallery.fg-hover-grayscale .fg-item-inner:hover .fg-thumb:before,
|
1046 |
+
.foogallery.fg-caption-hover.fg-hover-grayscale .fg-item-inner:hover .fg-caption {
|
1047 |
+
visibility: visible;
|
1048 |
+
opacity: 1;
|
1049 |
+
}
|
1050 |
+
/* Instant */
|
1051 |
+
.foogallery.fg-hover-instant .fg-loaded .fg-thumb:before,
|
1052 |
+
.foogallery.fg-caption-hover.fg-hover-instant .fg-loaded .fg-caption {
|
1053 |
+
display: block;
|
1054 |
+
left: 0;
|
1055 |
+
top: 0;
|
1056 |
+
bottom: 0;
|
1057 |
+
transition-property: none;
|
1058 |
+
}
|
1059 |
+
.foogallery.fg-hover-instant .fg-loaded .fg-item-inner:hover .fg-thumb:before,
|
1060 |
+
.foogallery.fg-caption-hover.fg-hover-instant .fg-loaded .fg-item-inner:hover .fg-caption {
|
1061 |
+
visibility: visible;
|
1062 |
+
opacity: 1;
|
1063 |
+
}
|
1064 |
+
/* Push */
|
1065 |
+
.foogallery.fg-hover-push .fg-loaded .fg-thumb:before,
|
1066 |
+
.foogallery.fg-caption-hover.fg-hover-push .fg-loaded .fg-caption {
|
1067 |
+
display: block;
|
1068 |
+
left: 0;
|
1069 |
+
top: 0;
|
1070 |
+
bottom: 0;
|
1071 |
+
transform: translateX(100%);
|
1072 |
+
visibility: visible;
|
1073 |
+
opacity: 1;
|
1074 |
+
}
|
1075 |
+
.foogallery.fg-hover-push .fg-loaded .fg-thumb,
|
1076 |
+
.foogallery.fg-caption-hover.fg-hover-push .fg-loaded .fg-caption {
|
1077 |
+
transition-property: transform;
|
1078 |
+
}
|
1079 |
+
.foogallery.fg-caption-hover.fg-hover-push .fg-loaded .fg-item-inner:hover .fg-caption {
|
1080 |
+
transform: translateY(0);
|
1081 |
+
}
|
1082 |
+
.foogallery.fg-hover-push .fg-loaded .fg-item-inner:hover .fg-thumb,
|
1083 |
+
.foogallery.fg-caption-hover.fg-hover-push .fg-loaded .fg-item-inner:hover .fg-thumb {
|
1084 |
+
transform: translateX(-100%);
|
1085 |
+
}
|
1086 |
+
/* Scale */
|
1087 |
+
.foogallery.fg-hover-scale .fg-item {
|
1088 |
+
transition-property: transform;
|
1089 |
+
z-index: 4;
|
1090 |
+
}
|
1091 |
+
|
1092 |
+
.foogallery.fg-hover-scale .fg-item:hover {
|
1093 |
+
transform: scale(1.048);
|
1094 |
+
z-index: 10;
|
1095 |
+
}
|
1096 |
+
.foogallery.fg-hover-scale .fg-thumb:before,
|
1097 |
+
.foogallery.fg-caption-hover.fg-hover-scale .fg-caption {
|
1098 |
+
display: block;
|
1099 |
+
left: 0;
|
1100 |
+
top: 0;
|
1101 |
+
bottom: 0;
|
1102 |
+
transition-property: visibility, opacity;
|
1103 |
+
}
|
1104 |
+
.foogallery.fg-hover-scale .fg-item-inner:hover .fg-thumb:before,
|
1105 |
+
.foogallery.fg-caption-hover.fg-hover-scale .fg-item-inner:hover .fg-caption {
|
1106 |
+
visibility: visible;
|
1107 |
+
opacity: 1;
|
1108 |
+
}
|
1109 |
+
/* Slide */
|
1110 |
+
.foogallery.fg-hover-slide-up .fg-loaded .fg-thumb:before,
|
1111 |
+
.foogallery.fg-caption-hover.fg-hover-slide-up .fg-loaded .fg-caption,
|
1112 |
+
.foogallery.fg-hover-slide-down .fg-loaded .fg-thumb:before,
|
1113 |
+
.foogallery.fg-caption-hover.fg-hover-slide-down .fg-loaded .fg-caption,
|
1114 |
+
.foogallery.fg-hover-slide-left .fg-loaded .fg-thumb:before,
|
1115 |
+
.foogallery.fg-caption-hover.fg-hover-slide-left .fg-loaded .fg-caption,
|
1116 |
+
.foogallery.fg-hover-slide-right .fg-loaded .fg-thumb:before,
|
1117 |
+
.foogallery.fg-caption-hover.fg-hover-slide-right .fg-loaded .fg-caption {
|
1118 |
+
display: block;
|
1119 |
+
left: 0;
|
1120 |
+
top: 0;
|
1121 |
+
bottom: 0;
|
1122 |
+
transition-property: transform;
|
1123 |
+
visibility: visible;
|
1124 |
+
opacity: 1;
|
1125 |
+
}
|
1126 |
+
.foogallery.fg-hover-slide-up .fg-loaded .fg-item-inner:hover .fg-thumb:before,
|
1127 |
+
.foogallery.fg-caption-hover.fg-hover-slide-up .fg-loaded .fg-item-inner:hover .fg-caption,
|
1128 |
+
.foogallery.fg-hover-slide-down .fg-loaded .fg-item-inner:hover .fg-thumb:before,
|
1129 |
+
.foogallery.fg-caption-hover.fg-hover-slide-down .fg-loaded .fg-item-inner:hover .fg-caption,
|
1130 |
+
.foogallery.fg-hover-slide-left .fg-loaded .fg-item-inner:hover .fg-thumb:before,
|
1131 |
+
.foogallery.fg-caption-hover.fg-hover-slide-left .fg-loaded .fg-item-inner:hover .fg-caption,
|
1132 |
+
.foogallery.fg-hover-slide-right .fg-loaded .fg-item-inner:hover .fg-thumb:before,
|
1133 |
+
.foogallery.fg-caption-hover.fg-hover-slide-right .fg-loaded .fg-item-inner:hover .fg-caption {
|
1134 |
+
transform: translateY(0) translateX(0);
|
1135 |
+
}
|
1136 |
+
|
1137 |
+
|
1138 |
+
/* Slide Up */
|
1139 |
+
.foogallery.fg-hover-slide-up .fg-loaded .fg-thumb:before,
|
1140 |
+
.foogallery.fg-caption-hover.fg-hover-slide-up .fg-loaded .fg-caption {
|
1141 |
+
transform: translateY(100%);
|
1142 |
+
}
|
1143 |
+
|
1144 |
+
/* Slide Down */
|
1145 |
+
.foogallery.fg-hover-slide-down .fg-loaded .fg-thumb:before,
|
1146 |
+
.foogallery.fg-caption-hover.fg-hover-slide-down .fg-loaded .fg-caption {
|
1147 |
+
transform: translateY(-100%);
|
1148 |
+
}
|
1149 |
+
|
1150 |
+
/* Slide Left */
|
1151 |
+
.foogallery.fg-hover-slide-left .fg-loaded .fg-thumb:before,
|
1152 |
+
.foogallery.fg-caption-hover.fg-hover-slide-left .fg-loaded .fg-caption {
|
1153 |
+
transform: translateX(100%);
|
1154 |
+
}
|
1155 |
+
|
1156 |
+
/* Slide Right */
|
1157 |
+
.foogallery.fg-hover-slide-right .fg-loaded .fg-thumb:before,
|
1158 |
+
.foogallery.fg-caption-hover.fg-hover-slide-right .fg-loaded .fg-caption {
|
1159 |
+
transform: translateX(-100%);
|
1160 |
+
}
|
1161 |
+
.fg-paging-container, .fg-paging-container *, .fg-paging-container *:before, .fg-paging-container *:after {
|
1162 |
+
-webkit-box-sizing: border-box;
|
1163 |
+
-moz-box-sizing: border-box;
|
1164 |
+
box-sizing: border-box;
|
1165 |
+
}
|
1166 |
+
.fg-paging-container {
|
1167 |
+
display: block;
|
1168 |
+
padding: 15px;
|
1169 |
+
text-align: center;
|
1170 |
+
font-family: -apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
|
1171 |
+
-webkit-user-select: none;
|
1172 |
+
-moz-user-select: none;
|
1173 |
+
-ms-user-select: none;
|
1174 |
+
user-select: none;
|
1175 |
+
}
|
1176 |
+
/* Utility */
|
1177 |
+
.fg-sr-only {
|
1178 |
+
position: absolute;
|
1179 |
+
width: 1px;
|
1180 |
+
height: 1px;
|
1181 |
+
padding: 0;
|
1182 |
+
margin: -1px;
|
1183 |
+
overflow: hidden;
|
1184 |
+
clip: rect(0,0,0,0);
|
1185 |
+
border: 0;
|
1186 |
+
}
|
1187 |
+
.fg-paging-container .fg-dots,
|
1188 |
+
.fg-paging-container .fg-dot-item {
|
1189 |
+
display: inline-block;
|
1190 |
+
margin: 0;
|
1191 |
+
padding: 0;
|
1192 |
+
outline: none;
|
1193 |
+
list-style: none;
|
1194 |
+
}
|
1195 |
+
.fg-paging-container .fg-dot-item .fg-dot-link {
|
1196 |
+
display: inline-block;
|
1197 |
+
margin: 3px;
|
1198 |
+
font-weight: 400;
|
1199 |
+
line-height: 1.42857143;
|
1200 |
+
text-align: center;
|
1201 |
+
white-space: nowrap;
|
1202 |
+
vertical-align: middle;
|
1203 |
+
cursor: pointer;
|
1204 |
+
user-select: none;
|
1205 |
+
background-image: none;
|
1206 |
+
text-decoration: none;
|
1207 |
+
border: 1px solid transparent;
|
1208 |
+
position: relative;
|
1209 |
+
border-radius: 50%;
|
1210 |
+
padding: 0;
|
1211 |
+
font-size: 0;
|
1212 |
+
outline: none;
|
1213 |
+
color: transparent;
|
1214 |
+
box-shadow: none;
|
1215 |
+
}
|
1216 |
+
.fg-paging-container .fg-dot-item .fg-dot-link:before {
|
1217 |
+
content: "";
|
1218 |
+
background-color: transparent;
|
1219 |
+
border: 1px solid transparent;
|
1220 |
+
display: block;
|
1221 |
+
border-radius: 50%;
|
1222 |
+
width: 9px;
|
1223 |
+
height: 9px;
|
1224 |
+
padding: 0;
|
1225 |
+
margin: 2px;
|
1226 |
+
}
|
1227 |
+
.fg-paging-container .fg-dot-item .fg-dot-link:active,
|
1228 |
+
.fg-paging-container .fg-dot-item .fg-dot-link:hover,
|
1229 |
+
.fg-paging-container .fg-dot-item .fg-dot-link:focus {
|
1230 |
+
text-decoration: none;
|
1231 |
+
box-shadow: none;
|
1232 |
+
outline: none;
|
1233 |
+
}
|
1234 |
+
.fg-paging-container .fg-dot-item.fg-disabled .fg-dot-link,
|
1235 |
+
.fg-paging-container .fg-dot-item.fg-selected .fg-dot-link {
|
1236 |
+
cursor: not-allowed;
|
1237 |
+
pointer-events: none;
|
1238 |
+
}
|
1239 |
+
.fg-paging-container .fg-dot-item.fg-disabled .fg-dot-link {
|
1240 |
+
cursor: not-allowed;
|
1241 |
+
pointer-events: none;
|
1242 |
+
outline: none;
|
1243 |
+
}
|
1244 |
+
|
1245 |
+
/* Light - Dots */
|
1246 |
+
.fg-paging-container.fg-light .fg-dot-item .fg-dot-link,
|
1247 |
+
.fg-paging-container.fg-light .fg-dot-item .fg-dot-link:before {
|
1248 |
+
transition-timing-function: ease-out;
|
1249 |
+
transition-duration: 0.3s;
|
1250 |
+
transition-property: color, border-color, background-color;
|
1251 |
+
}
|
1252 |
+
.fg-paging-container.fg-light .fg-dot-item .fg-dot-link {
|
1253 |
+
background-color: #eee;
|
1254 |
+
border-color: #9e9e9e;
|
1255 |
+
}
|
1256 |
+
.fg-paging-container.fg-light .fg-dot-item.fg-selected .fg-dot-link {
|
1257 |
+
border-color: #8a8a8a;
|
1258 |
+
}
|
1259 |
+
.fg-paging-container.fg-light .fg-dot-item.fg-selected .fg-dot-link:before,
|
1260 |
+
.fg-paging-container.fg-light .fg-dot-item .fg-dot-link:hover:before,
|
1261 |
+
.fg-paging-container.fg-light .fg-dot-item .fg-dot-link:focus:before {
|
1262 |
+
background-color: #666;
|
1263 |
+
border-color: #8a8a8a;
|
1264 |
+
}
|
1265 |
+
.fg-paging-container.fg-light .fg-dot-item.fg-disabled .fg-dot-link,
|
1266 |
+
.fg-paging-container.fg-light .fg-dot-item.fg-disabled .fg-dot-link:hover,
|
1267 |
+
.fg-paging-container.fg-light .fg-dot-item.fg-disabled .fg-dot-link:focus {
|
1268 |
+
background-color: #eee;
|
1269 |
+
border-color: #9e9e9e;
|
1270 |
+
opacity: 0.5;
|
1271 |
+
}
|
1272 |
+
|
1273 |
+
/* Dark - Dots */
|
1274 |
+
.fg-paging-container.fg-dark .fg-dot-item .fg-dot-link,
|
1275 |
+
.fg-paging-container.fg-dark .fg-dot-item .fg-dot-link:before {
|
1276 |
+
transition-timing-function: ease-out;
|
1277 |
+
transition-duration: 0.3s;
|
1278 |
+
transition-property: color, border-color, background-color;
|
1279 |
+
}
|
1280 |
+
.fg-paging-container.fg-dark .fg-dot-item .fg-dot-link {
|
1281 |
+
background-color: #666;
|
1282 |
+
border-color: #333;
|
1283 |
+
}
|
1284 |
+
.fg-paging-container.fg-dark .fg-dot-item.fg-selected .fg-dot-link {
|
1285 |
+
border-color: #444;
|
1286 |
+
}
|
1287 |
+
.fg-paging-container.fg-dark .fg-dot-item.fg-selected .fg-dot-link:before,
|
1288 |
+
.fg-paging-container.fg-dark .fg-dot-item .fg-dot-link:hover:before,
|
1289 |
+
.fg-paging-container.fg-dark .fg-dot-item .fg-dot-link:focus:before {
|
1290 |
+
background-color: #333;
|
1291 |
+
border-color: #444;
|
1292 |
+
}
|
1293 |
+
.fg-paging-container.fg-dark .fg-dot-item.fg-disabled .fg-dot-link,
|
1294 |
+
.fg-paging-container.fg-dark .fg-dot-item.fg-disabled .fg-dot-link:hover,
|
1295 |
+
.fg-paging-container.fg-dark .fg-dot-item.fg-disabled .fg-dot-link:focus {
|
1296 |
+
background-color: #666;
|
1297 |
+
border-color: #333;
|
1298 |
+
opacity: 0.5;
|
1299 |
+
}
|
1300 |
+
/* Base styles */
|
1301 |
+
.fg-default:after {
|
1302 |
+
content: '';
|
1303 |
+
display: block;
|
1304 |
+
clear: both;
|
1305 |
+
}
|
1306 |
+
|
1307 |
+
.fg-default .fg-item,
|
1308 |
+
.fg-default .fg-item-inner,
|
1309 |
+
.fg-default .fg-thumb {
|
1310 |
+
display: inline-block;
|
1311 |
+
vertical-align: top;
|
1312 |
+
max-width: 100%;
|
1313 |
+
}
|
1314 |
+
|
1315 |
+
.fg-default .fg-image {
|
1316 |
+
border-radius: 0;
|
1317 |
+
display: block;
|
1318 |
+
max-width: 100%;
|
1319 |
+
height: auto;
|
1320 |
+
margin: 0;
|
1321 |
+
padding: 0;
|
1322 |
+
}
|
1323 |
+
|
1324 |
+
/* Horizontal alignment */
|
1325 |
+
.fg-default .fg-image {
|
1326 |
+
vertical-align: top;
|
1327 |
+
}
|
1328 |
+
|
1329 |
+
.fg-default.fg-left {
|
1330 |
+
text-align: left;
|
1331 |
+
}
|
1332 |
+
|
1333 |
+
.fg-default.fg-center {
|
1334 |
+
text-align: center;
|
1335 |
+
}
|
1336 |
+
|
1337 |
+
.fg-default.fg-right {
|
1338 |
+
text-align: right;
|
1339 |
+
}
|
1340 |
+
|
1341 |
+
/* Gutter widths */
|
1342 |
+
.fg-default.fg-gutter-5 {
|
1343 |
+
padding-left: 5px;
|
1344 |
+
margin-bottom: -5px;
|
1345 |
+
}
|
1346 |
+
.fg-default.fg-gutter-5 .fg-item {
|
1347 |
+
margin-right: 5px;
|
1348 |
+
margin-bottom: 5px;
|
1349 |
+
}
|
1350 |
+
|
1351 |
+
.fg-default.fg-gutter-10 {
|
1352 |
+
padding-left: 10px;
|
1353 |
+
margin-bottom: -10px;
|
1354 |
+
}
|
1355 |
+
.fg-default.fg-gutter-10 .fg-item {
|
1356 |
+
margin-right: 10px;
|
1357 |
+
margin-bottom: 10px;
|
1358 |
+
}
|
1359 |
+
|
1360 |
+
.fg-default.fg-gutter-15 {
|
1361 |
+
padding-left: 15px;
|
1362 |
+
margin-bottom: -15px;
|
1363 |
+
}
|
1364 |
+
.fg-default.fg-gutter-15 .fg-item {
|
1365 |
+
margin-right: 15px;
|
1366 |
+
margin-bottom: 15px;
|
1367 |
+
}
|
1368 |
+
|
1369 |
+
.fg-default.fg-gutter-20 {
|
1370 |
+
padding-left: 20px;
|
1371 |
+
margin-bottom: -20px;
|
1372 |
+
}
|
1373 |
+
.fg-default.fg-gutter-20 .fg-item {
|
1374 |
+
margin-right: 20px;
|
1375 |
+
margin-bottom: 20px;
|
1376 |
+
}
|
1377 |
+
|
1378 |
+
.fg-default.fg-gutter-25 {
|
1379 |
+
padding-left: 25px;
|
1380 |
+
margin-bottom: -25px;
|
1381 |
+
}
|
1382 |
+
.fg-default.fg-gutter-25 .fg-item {
|
1383 |
+
margin-right: 25px;
|
1384 |
+
margin-bottom: 25px;
|
1385 |
+
}
|
1386 |
+
/* Base styles */
|
1387 |
+
.fg-masonry * {
|
1388 |
+
-webkit-box-sizing: border-box;
|
1389 |
+
-moz-box-sizing: border-box;
|
1390 |
+
box-sizing: border-box;
|
1391 |
+
}
|
1392 |
+
.foogallery.fg-masonry.fg-center {
|
1393 |
+
margin: 0 auto;
|
1394 |
+
}
|
1395 |
+
.fg-masonry .fg-thumb {
|
1396 |
+
display: block;
|
1397 |
+
}
|
1398 |
+
.fg-masonry.fg-masonry-fixed .fg-thumb {
|
1399 |
+
display: inline-block;
|
1400 |
+
}
|
1401 |
+
|
1402 |
+
.fg-masonry .fg-column-width {
|
1403 |
+
display: inline-block;
|
1404 |
+
visibility: hidden;
|
1405 |
+
height: 0;
|
1406 |
+
border: solid 0 transparent;
|
1407 |
+
}
|
1408 |
+
.fg-masonry.fg-masonry-fixed .fg-column-width {
|
1409 |
+
-webkit-box-sizing: content-box;
|
1410 |
+
-moz-box-sizing: content-box;
|
1411 |
+
box-sizing: content-box;
|
1412 |
+
}
|
1413 |
+
|
1414 |
+
.fg-masonry.fg-masonry-5col .fg-image,
|
1415 |
+
.fg-masonry.fg-masonry-4col .fg-image,
|
1416 |
+
.fg-masonry.fg-masonry-3col .fg-image,
|
1417 |
+
.fg-masonry.fg-masonry-2col .fg-image {
|
1418 |
+
width: 100%;
|
1419 |
+
height: auto;
|
1420 |
+
max-width: 100%;
|
1421 |
+
}
|
1422 |
+
|
1423 |
+
.fg-masonry .fg-item {
|
1424 |
+
line-height: 0;
|
1425 |
+
font-size: 0;
|
1426 |
+
}
|
1427 |
+
|
1428 |
+
/* 2 column layouts */
|
1429 |
+
/* 2 column layout - normal gutter */
|
1430 |
+
.fg-masonry.fg-masonry-2col .fg-item { margin-bottom: 1%; width: 49%; }
|
1431 |
+
.fg-masonry.fg-masonry-2col .fg-column-width { width: 49%; }
|
1432 |
+
.fg-masonry.fg-masonry-2col .fg-gutter-width { width: 1%; }
|
1433 |
+
|
1434 |
+
/* 2 column layout - no gutter */
|
1435 |
+
.fg-masonry.fg-masonry-2col.fg-gutter-none .fg-item { margin-bottom: 0; width: 50%; }
|
1436 |
+
.fg-masonry.fg-masonry-2col.fg-gutter-none .fg-column-width { width: 50%; }
|
1437 |
+
.fg-masonry.fg-masonry-2col.fg-gutter-none .fg-gutter-width { width: 0; }
|
1438 |
+
|
1439 |
+
/* 2 column layout - large gutter */
|
1440 |
+
.fg-masonry.fg-masonry-2col.fg-gutter-large .fg-item { margin-bottom: 3%; width: 47%; }
|
1441 |
+
.fg-masonry.fg-masonry-2col.fg-gutter-large .fg-column-width { width: 47%; }
|
1442 |
+
.fg-masonry.fg-masonry-2col.fg-gutter-large .fg-gutter-width { width: 3%; }
|
1443 |
+
|
1444 |
+
/* 3 column layouts */
|
1445 |
+
/* 3 column layout - normal gutter */
|
1446 |
+
.fg-masonry.fg-masonry-3col .fg-item { margin-bottom: 1%; width: 32%; }
|
1447 |
+
.fg-masonry.fg-masonry-3col .fg-column-width { width: 32%; }
|
1448 |
+
.fg-masonry.fg-masonry-3col .fg-gutter-width { width: 1%; }
|
1449 |
+
|
1450 |
+
/* 3 column layout - no gutter */
|
1451 |
+
.fg-masonry.fg-masonry-3col.fg-gutter-none .fg-item { margin-bottom: 0; width: 33%; }
|
1452 |
+
.fg-masonry.fg-masonry-3col.fg-gutter-none .fg-column-width { width: 33%; }
|
1453 |
+
.fg-masonry.fg-masonry-3col.fg-gutter-none .fg-gutter-width { width: 0; }
|
1454 |
+
|
1455 |
+
/* 3 column layout - large gutter */
|
1456 |
+
.fg-masonry.fg-masonry-3col.fg-gutter-large .fg-item { margin-bottom: 3%; width: 30%; }
|
1457 |
+
.fg-masonry.fg-masonry-3col.fg-gutter-large .fg-column-width { width: 30%; }
|
1458 |
+
.fg-masonry.fg-masonry-3col.fg-gutter-large .fg-gutter-width { width: 3%; }
|
1459 |
+
|
1460 |
+
/* 4 column layouts */
|
1461 |
+
/* 4 column layout - normal gutter */
|
1462 |
+
.fg-masonry.fg-masonry-4col .fg-item { margin-bottom: 1%; width: 24%; }
|
1463 |
+
.fg-masonry.fg-masonry-4col .fg-column-width { width: 24%; }
|
1464 |
+
.fg-masonry.fg-masonry-4col .fg-gutter-width { width: 1%; }
|
1465 |
+
|
1466 |
+
/* 4 column layout - no gutter */
|
1467 |
+
.fg-masonry.fg-masonry-4col.fg-gutter-none .fg-item { margin-bottom: 0; width: 25%; }
|
1468 |
+
.fg-masonry.fg-masonry-4col.fg-gutter-none .fg-column-width { width: 25%; }
|
1469 |
+
.fg-masonry.fg-masonry-4col.fg-gutter-none .fg-gutter-width { width: 0; }
|
1470 |
+
|
1471 |
+
/* 4 column layout - large gutter */
|
1472 |
+
.fg-masonry.fg-masonry-4col.fg-gutter-large .fg-item { margin-bottom: 3%; width: 22%; }
|
1473 |
+
.fg-masonry.fg-masonry-4col.fg-gutter-large .fg-column-width { width: 22%; }
|
1474 |
+
.fg-masonry.fg-masonry-4col.fg-gutter-large .fg-gutter-width { width: 3%; }
|
1475 |
+
|
1476 |
+
/* 5 column layouts */
|
1477 |
+
/* 5 column layout - normal gutter */
|
1478 |
+
.fg-masonry.fg-masonry-5col .fg-item { margin-bottom: 1%; width: 19%; }
|
1479 |
+
.fg-masonry.fg-masonry-5col .fg-column-width { width: 19%; }
|
1480 |
+
.fg-masonry.fg-masonry-5col .fg-gutter-width { width: 1%; }
|
1481 |
+
|
1482 |
+
/* 5 column layout - no gutter */
|
1483 |
+
.fg-masonry.fg-masonry-5col.fg-gutter-none .fg-item { margin-bottom: 0; width: 20%; }
|
1484 |
+
.fg-masonry.fg-masonry-5col.fg-gutter-none .fg-column-width { width: 20%; }
|
1485 |
+
.fg-masonry.fg-masonry-5col.fg-gutter-none .fg-gutter-width { width: 0; }
|
1486 |
+
|
1487 |
+
/* 5 column layout - large gutter */
|
1488 |
+
.fg-masonry.fg-masonry-5col.fg-gutter-large .fg-item { margin-bottom: 3%; width: 17%; }
|
1489 |
+
.fg-masonry.fg-masonry-5col.fg-gutter-large .fg-column-width { width: 17%; }
|
1490 |
+
.fg-masonry.fg-masonry-5col.fg-gutter-large .fg-gutter-width { width: 3%; }
|
1491 |
+
|
1492 |
+
/* Force 3 column layout < 720px */
|
1493 |
+
@media screen and (max-width: 720px) {
|
1494 |
+
/* default gutter */
|
1495 |
+
.fg-masonry.fg-masonry-5col .fg-item,
|
1496 |
+
.fg-masonry.fg-masonry-4col .fg-item { margin-bottom: 1%; width: 32%; }
|
1497 |
+
.fg-masonry.fg-masonry-5col .fg-column-width,
|
1498 |
+
.fg-masonry.fg-masonry-4col .fg-column-width { width: 32%; }
|
1499 |
+
.fg-masonry.fg-masonry-5col .fg-gutter-width,
|
1500 |
+
.fg-masonry.fg-masonry-4col .fg-gutter-width { width: 1%; }
|
1501 |
+
|
1502 |
+
/* no gutter */
|
1503 |
+
.fg-masonry.fg-masonry-5col.fg-gutter-none .fg-item,
|
1504 |
+
.fg-masonry.fg-masonry-4col.fg-gutter-none .fg-item { margin-bottom: 0; width: 33%; }
|
1505 |
+
.fg-masonry.fg-masonry-5col.fg-gutter-none .fg-column-width,
|
1506 |
+
.fg-masonry.fg-masonry-4col.fg-gutter-none .fg-column-width { width: 33%; }
|
1507 |
+
.fg-masonry.fg-masonry-5col.fg-gutter-none .fg-gutter-width,
|
1508 |
+
.fg-masonry.fg-masonry-4col.fg-gutter-none .fg-gutter-width { width: 0; }
|
1509 |
+
|
1510 |
+
/* large gutter */
|
1511 |
+
.fg-masonry.fg-masonry-5col.fg-gutter-large .fg-item,
|
1512 |
+
.fg-masonry.fg-masonry-4col.fg-gutter-large .fg-item { margin-bottom: 3%; width: 30%; }
|
1513 |
+
.fg-masonry.fg-masonry-5col.fg-gutter-large .fg-column-width,
|
1514 |
+
.fg-masonry.fg-masonry-4col.fg-gutter-large .fg-column-width { width: 30%; }
|
1515 |
+
.fg-masonry.fg-masonry-5col.fg-gutter-large .fg-gutter-width,
|
1516 |
+
.fg-masonry.fg-masonry-4col.fg-gutter-large .fg-gutter-width { width: 3%; }
|
1517 |
+
|
1518 |
+
}
|
1519 |
+
|
1520 |
+
/* Force 2 column layout < 480px */
|
1521 |
+
@media screen and (max-width: 480px) {
|
1522 |
+
/* default gutter */
|
1523 |
+
.fg-masonry.fg-masonry-5col .fg-item,
|
1524 |
+
.fg-masonry.fg-masonry-4col .fg-item,
|
1525 |
+
.fg-masonry.fg-masonry-3col .fg-item { margin-bottom: 1%; width: 49%; }
|
1526 |
+
.fg-masonry.fg-masonry-5col .fg-column-width,
|
1527 |
+
.fg-masonry.fg-masonry-4col .fg-column-width,
|
1528 |
+
.fg-masonry.fg-masonry-3col .fg-column-width { width: 49%; }
|
1529 |
+
.fg-masonry.fg-masonry-5col .fg-gutter-width,
|
1530 |
+
.fg-masonry.fg-masonry-4col .fg-gutter-width,
|
1531 |
+
.fg-masonry.fg-masonry-3col .fg-gutter-width { width: 1%; }
|
1532 |
+
|
1533 |
+
/* no gutter */
|
1534 |
+
.fg-masonry.fg-masonry-5col.fg-gutter-none .fg-item,
|
1535 |
+
.fg-masonry.fg-masonry-4col.fg-gutter-none .fg-item,
|
1536 |
+
.fg-masonry.fg-masonry-3col.fg-gutter-none .fg-item { margin-bottom: 0; width: 50%; }
|
1537 |
+
.fg-masonry.fg-masonry-5col.fg-gutter-none .fg-column-width,
|
1538 |
+
.fg-masonry.fg-masonry-4col.fg-gutter-none .fg-column-width,
|
1539 |
+
.fg-masonry.fg-masonry-3col.fg-gutter-none .fg-column-width { width: 50%; }
|
1540 |
+
.fg-masonry.fg-masonry-5col.fg-gutter-none .fg-gutter-width,
|
1541 |
+
.fg-masonry.fg-masonry-4col.fg-gutter-none .fg-gutter-width,
|
1542 |
+
.fg-masonry.fg-masonry-3col.fg-gutter-none .fg-gutter-width { width: 0; }
|
1543 |
+
|
1544 |
+
/* large gutter */
|
1545 |
+
.fg-masonry.fg-masonry-5col.fg-gutter-large .fg-item,
|
1546 |
+
.fg-masonry.fg-masonry-4col.fg-gutter-large .fg-item,
|
1547 |
+
.fg-masonry.fg-masonry-3col.fg-gutter-large .fg-item { margin-bottom: 3%; width: 47%; }
|
1548 |
+
.fg-masonry.fg-masonry-5col.fg-gutter-large .fg-column-width,
|
1549 |
+
.fg-masonry.fg-masonry-4col.fg-gutter-large .fg-column-width,
|
1550 |
+
.fg-masonry.fg-masonry-3col.fg-gutter-large .fg-column-width { width: 47%; }
|
1551 |
+
.fg-masonry.fg-masonry-5col.fg-gutter-large .fg-gutter-width,
|
1552 |
+
.fg-masonry.fg-masonry-4col.fg-gutter-large .fg-gutter-width,
|
1553 |
+
.fg-masonry.fg-masonry-3col.fg-gutter-large .fg-gutter-width { width: 3%; }
|
1554 |
+
}
|
1555 |
+
|
1556 |
+
/* Force 1 column layout < 320px */
|
1557 |
+
@media screen and (max-width: 320px) {
|
1558 |
+
/* default gutter */
|
1559 |
+
.fg-masonry.fg-masonry-5col .fg-item,
|
1560 |
+
.fg-masonry.fg-masonry-4col .fg-item,
|
1561 |
+
.fg-masonry.fg-masonry-3col .fg-item,
|
1562 |
+
.fg-masonry.fg-masonry-2col .fg-item { margin-bottom: 1%; width: 100%; }
|
1563 |
+
.fg-masonry.fg-masonry-5col .fg-column-width,
|
1564 |
+
.fg-masonry.fg-masonry-4col .fg-column-width,
|
1565 |
+
.fg-masonry.fg-masonry-3col .fg-column-width,
|
1566 |
+
.fg-masonry.fg-masonry-2col .fg-column-width { width: 100%; }
|
1567 |
+
.fg-masonry.fg-masonry-5col .fg-gutter-width,
|
1568 |
+
.fg-masonry.fg-masonry-4col .fg-gutter-width,
|
1569 |
+
.fg-masonry.fg-masonry-3col .fg-gutter-width,
|
1570 |
+
.fg-masonry.fg-masonry-2col .fg-gutter-width { width: 0; }
|
1571 |
+
|
1572 |
+
/* no gutter */
|
1573 |
+
.fg-masonry.fg-masonry-5col.fg-gutter-none .fg-item,
|
1574 |
+
.fg-masonry.fg-masonry-4col.fg-gutter-none .fg-item,
|
1575 |
+
.fg-masonry.fg-masonry-3col.fg-gutter-none .fg-item,
|
1576 |
+
.fg-masonry.fg-masonry-2col.fg-gutter-none .fg-item { margin-bottom: 0; width: 100%; }
|
1577 |
+
.fg-masonry.fg-masonry-5col.fg-gutter-none .fg-column-width,
|
1578 |
+
.fg-masonry.fg-masonry-4col.fg-gutter-none .fg-column-width,
|
1579 |
+
.fg-masonry.fg-masonry-3col.fg-gutter-none .fg-column-width,
|
1580 |
+
.fg-masonry.fg-masonry-2col.fg-gutter-none .fg-column-width { width: 100%; }
|
1581 |
+
.fg-masonry.fg-masonry-5col.fg-gutter-none .fg-gutter-width,
|
1582 |
+
.fg-masonry.fg-masonry-4col.fg-gutter-none .fg-gutter-width,
|
1583 |
+
.fg-masonry.fg-masonry-3col.fg-gutter-none .fg-gutter-width,
|
1584 |
+
.fg-masonry.fg-masonry-2col.fg-gutter-none .fg-gutter-width { width: 0; }
|
1585 |
+
|
1586 |
+
/* large gutter */
|
1587 |
+
.fg-masonry.fg-masonry-5col.fg-gutter-large .fg-item,
|
1588 |
+
.fg-masonry.fg-masonry-4col.fg-gutter-large .fg-item,
|
1589 |
+
.fg-masonry.fg-masonry-3col.fg-gutter-large .fg-item,
|
1590 |
+
.fg-masonry.fg-masonry-2col.fg-gutter-large .fg-item { margin-bottom: 3%; width: 100%; }
|
1591 |
+
.fg-masonry.fg-masonry-5col.fg-gutter-large .fg-column-width,
|
1592 |
+
.fg-masonry.fg-masonry-4col.fg-gutter-large .fg-column-width,
|
1593 |
+
.fg-masonry.fg-masonry-3col.fg-gutter-large .fg-column-width,
|
1594 |
+
.fg-masonry.fg-masonry-2col.fg-gutter-large .fg-column-width { width: 100%; }
|
1595 |
+
.fg-masonry.fg-masonry-5col.fg-gutter-large .fg-gutter-width,
|
1596 |
+
.fg-masonry.fg-masonry-4col.fg-gutter-large .fg-gutter-width,
|
1597 |
+
.fg-masonry.fg-masonry-3col.fg-gutter-large .fg-gutter-width,
|
1598 |
+
.fg-masonry.fg-masonry-2col.fg-gutter-large .fg-gutter-width { width: 0; }
|
1599 |
+
}
|
1600 |
+
|
1601 |
+
/* Border Styles - We must apply width changing border styles to the fg-column-width element so that the plugin can correctly determine the item widths. */
|
1602 |
+
.foogallery.fg-border-thin .fg-column-width {
|
1603 |
+
border-width: 5px;
|
1604 |
+
}
|
1605 |
+
.foogallery.fg-border-medium .fg-column-width {
|
1606 |
+
border-width: 10px;
|
1607 |
+
}
|
1608 |
+
.foogallery.fg-border-thick .fg-column-width {
|
1609 |
+
border-width: 15px;
|
1610 |
+
}
|
1611 |
+
/* Base Styles */
|
1612 |
+
.fg-justified {
|
1613 |
+
box-sizing: border-box;
|
1614 |
+
position: relative;
|
1615 |
+
}
|
1616 |
+
.foogallery.fg-justified .fg-item,
|
1617 |
+
.foogallery.fg-justified .fg-item-inner,
|
1618 |
+
.foogallery.fg-justified .fg-thumb,
|
1619 |
+
.foogallery.fg-justified .fg-image {
|
1620 |
+
box-sizing: border-box;
|
1621 |
+
display: block;
|
1622 |
+
margin: 0;
|
1623 |
+
padding: 0;
|
1624 |
+
}
|
1625 |
+
.fg-justified .fg-item {
|
1626 |
+
visibility: visible;
|
1627 |
+
position: absolute;
|
1628 |
+
}
|
1629 |
+
.fg-justified .fg-item-inner {
|
1630 |
+
position: relative;
|
1631 |
+
width: 100%;
|
1632 |
+
height: 100%;
|
1633 |
+
}
|
1634 |
+
.fg-justified .fg-thumb {
|
1635 |
+
position: relative;
|
1636 |
+
overflow: hidden;
|
1637 |
+
}
|
1638 |
+
.fg-justified .fg-image {
|
1639 |
+
z-index: 1;
|
1640 |
+
}
|
1641 |
+
.fg-justified .fg-item.fg-positioned .fg-thumb {
|
1642 |
+
width: 100%;
|
1643 |
+
height: 100%;
|
1644 |
+
}
|
1645 |
+
.fg-justified .fg-item.fg-positioned .fg-image {
|
1646 |
+
width: 100%;
|
1647 |
+
height: auto;
|
1648 |
+
min-height: 100%;
|
1649 |
+
}
|
1650 |
+
/* Base Styles */
|
1651 |
+
.fg-simple_portfolio {
|
1652 |
+
box-sizing: border-box;
|
1653 |
+
position: relative;
|
1654 |
+
font-size: 16px;
|
1655 |
+
margin: 0 auto;
|
1656 |
+
padding: 0;
|
1657 |
+
/* The foogallery-portfolio container must have a width set and it is recommended to make the min-width the same as the item width. */
|
1658 |
+
width: 100%;
|
1659 |
+
}
|
1660 |
+
.fg-simple_portfolio .fg-item {
|
1661 |
+
position: absolute;
|
1662 |
+
display: inline-block;
|
1663 |
+
margin: 0;
|
1664 |
+
padding: 0;
|
1665 |
+
outline: none;
|
1666 |
+
}
|
1667 |
+
.fg-simple_portfolio .fg-item-inner,
|
1668 |
+
.fg-simple_portfolio .fg-thumb,
|
1669 |
+
.fg-simple_portfolio .fg-image {
|
1670 |
+
display: block;
|
1671 |
+
margin: 0;
|
1672 |
+
padding: 0;
|
1673 |
+
outline: none;
|
1674 |
+
}
|
1675 |
+
.fg-simple_portfolio .fg-item-inner {
|
1676 |
+
position: relative;
|
1677 |
+
width: 100%;
|
1678 |
+
height: 100%;
|
1679 |
+
}
|
1680 |
+
.fg-simple_portfolio .fg-thumb {
|
1681 |
+
box-sizing: border-box;
|
1682 |
+
display: block;
|
1683 |
+
margin: 0;
|
1684 |
+
padding: 0;
|
1685 |
+
border: none;
|
1686 |
+
outline: none;
|
1687 |
+
position: relative;
|
1688 |
+
overflow: hidden;
|
1689 |
+
}
|
1690 |
+
.fg-simple_portfolio .fg-item.fg-positioned .fg-image {
|
1691 |
+
width: 100%;
|
1692 |
+
height: auto;
|
1693 |
+
}
|
1694 |
+
.fg-simple_portfolio .fg-image {
|
1695 |
+
z-index: 1;
|
1696 |
+
}
|
1697 |
+
|
1698 |
+
.foogallery.fg-simple_portfolio .fg-item-inner .fg-caption {
|
1699 |
+
visibility: visible;
|
1700 |
+
opacity: 1;
|
1701 |
+
font-size: 13px;
|
1702 |
+
position: relative;
|
1703 |
+
display: block;
|
1704 |
+
top: auto;
|
1705 |
+
bottom: auto;
|
1706 |
+
left: auto;
|
1707 |
+
right: auto;
|
1708 |
+
width: auto;
|
1709 |
+
height: auto;
|
1710 |
+
text-transform: none;
|
1711 |
+
transform: none;
|
1712 |
+
transition: none;
|
1713 |
+
background-color: transparent;
|
1714 |
+
border-style: solid;
|
1715 |
+
border-color: transparent;
|
1716 |
+
}
|
1717 |
+
.foogallery.fg-simple_portfolio .fg-item-inner:hover .fg-caption {
|
1718 |
+
transform: none;
|
1719 |
+
transition: none;
|
1720 |
+
}
|
1721 |
+
.foogallery.fg-simple_portfolio .fg-item-inner .fg-caption-inner {
|
1722 |
+
display: block;
|
1723 |
+
top: auto;
|
1724 |
+
bottom: auto;
|
1725 |
+
left: auto;
|
1726 |
+
right: auto;
|
1727 |
+
width: auto;
|
1728 |
+
height: auto;
|
1729 |
+
border: none;
|
1730 |
+
transform: none;
|
1731 |
+
transition: none;
|
1732 |
+
}
|
1733 |
+
.foogallery.fg-simple_portfolio .fg-item-inner .fg-caption-inner:before {
|
1734 |
+
display: none;
|
1735 |
+
}
|
1736 |
+
.foogallery.fg-simple_portfolio.fg-caption-hover .fg-item-inner .fg-thumb:before {
|
1737 |
+
display: block;
|
1738 |
+
}
|
1739 |
+
.foogallery.fg-simple_portfolio.fg-caption-always .fg-item-inner:hover .fg-caption {
|
1740 |
+
visibility: visible;
|
1741 |
+
opacity: 1;
|
1742 |
+
}
|
1743 |
+
|
1744 |
+
.fg-simple_portfolio .fg-caption-title {
|
1745 |
+
text-align: left;
|
1746 |
+
}
|
1747 |
+
.fg-simple_portfolio .fg-caption-desc {
|
1748 |
+
text-align: justify;
|
1749 |
+
}
|
1750 |
+
.fg-simple_portfolio.fg-light .fg-caption,
|
1751 |
+
.fg-simple_portfolio.fg-dark .fg-caption {
|
1752 |
+
color: #828282;
|
1753 |
+
}
|
1754 |
+
.fg-simple_portfolio.fg-light .fg-caption a,
|
1755 |
+
.fg-simple_portfolio.fg-dark .fg-caption a {
|
1756 |
+
color: #828282;
|
1757 |
+
border-bottom: 1px solid #828282;
|
1758 |
+
}
|
1759 |
+
.fg-simple_portfolio.fg-light .fg-caption a:hover,
|
1760 |
+
.fg-simple_portfolio.fg-dark .fg-caption a:hover {
|
1761 |
+
border-bottom: none;
|
1762 |
+
}
|
1763 |
+
.fg-simple_portfolio.fg-light .fg-caption-title,
|
1764 |
+
.fg-simple_portfolio.fg-light .fg-caption-title a {
|
1765 |
+
color: #222;
|
1766 |
+
}
|
1767 |
+
.fg-simple_portfolio.fg-dark .fg-caption-title,
|
1768 |
+
.fg-simple_portfolio.fg-dark .fg-caption-title a {
|
1769 |
+
color: #FFF;
|
1770 |
+
}
|
1771 |
+
.fg-simple_portfolio.fg-light .fg-caption-title a {
|
1772 |
+
border-bottom: 1px solid #222;
|
1773 |
+
}
|
1774 |
+
.fg-simple_portfolio.fg-dark .fg-caption-title a {
|
1775 |
+
border-bottom: 1px solid #FFF;
|
1776 |
+
}
|
1777 |
+
|
1778 |
+
.fg-simple_portfolio.fg-captions-top .fg-item.fg-positioned .fg-thumb {
|
1779 |
+
position: absolute;
|
1780 |
+
bottom: 0;
|
1781 |
+
left: 0;
|
1782 |
+
}
|
1783 |
+
|
1784 |
+
/* Handle Border Sizing */
|
1785 |
+
.fg-simple_portfolio .fg-caption {
|
1786 |
+
border-width: 10px;
|
1787 |
+
}
|
1788 |
+
.fg-simple_portfolio .fg-caption-title+.fg-caption-desc {
|
1789 |
+
margin-top: 5px;
|
1790 |
+
}
|
1791 |
+
.fg-simple_portfolio.fg-border-thin .fg-caption {
|
1792 |
+
border-width: 10px 5px 5px 5px;
|
1793 |
+
}
|
1794 |
+
.fg-simple_portfolio.fg-captions-top.fg-border-thin .fg-caption {
|
1795 |
+
border-width: 5px 5px 10px 5px;
|
1796 |
+
}
|
1797 |
+
.fg-simple_portfolio.fg-border-medium .fg-caption {
|
1798 |
+
border-width: 10px 0 0 0;
|
1799 |
+
}
|
1800 |
+
.fg-simple_portfolio.fg-captions-top.fg-border-medium .fg-caption {
|
1801 |
+
border-width: 0 0 10px 0;
|
1802 |
+
}
|
1803 |
+
.fg-simple_portfolio.fg-border-thick .fg-caption {
|
1804 |
+
border-width: 15px 0 0 0;
|
1805 |
+
}
|
1806 |
+
.fg-simple_portfolio.fg-captions-top.fg-border-thick .fg-caption {
|
1807 |
+
border-width: 0 0 15px 0;
|
1808 |
+
}
|
1809 |
+
.fg-simple_portfolio.fg-border-thick .fg-caption-title+.fg-caption-desc {
|
1810 |
+
margin-top: 10px;
|
1811 |
+
}
|
1812 |
+
/* Polaroid */
|
1813 |
+
.foogallery.fg-preset.fg-polaroid .fg-item {
|
1814 |
+
-webkit-backface-visibility: hidden;
|
1815 |
+
backface-visibility: hidden;
|
1816 |
+
-webkit-transition: -webkit-transform 0.35s, background-color 0.65s;
|
1817 |
+
transition: transform 0.35s, background-color 0.65s;
|
1818 |
+
}
|
1819 |
+
.foogallery.fg-preset.fg-polaroid .fg-item:nth-child(2n+1) {
|
1820 |
+
-webkit-transform: rotate(3deg);
|
1821 |
+
transform: rotate(3deg);
|
1822 |
+
}
|
1823 |
+
.foogallery.fg-preset.fg-polaroid .fg-item:nth-child(2n) {
|
1824 |
+
-webkit-transform: rotate(-3deg);
|
1825 |
+
transform: rotate(-3deg);
|
1826 |
+
}
|
1827 |
+
.foogallery.fg-preset.fg-polaroid .fg-item:nth-child(3n) {
|
1828 |
+
-webkit-transform: rotate(1deg);
|
1829 |
+
transform: rotate(1deg);
|
1830 |
+
}
|
1831 |
+
.foogallery.fg-preset.fg-polaroid .fg-item:nth-child(5n) {
|
1832 |
+
-webkit-transform: rotate(-2deg);
|
1833 |
+
transform: rotate(-2deg);
|
1834 |
+
}
|
1835 |
+
|
1836 |
+
.foogallery.fg-preset.fg-polaroid .fg-item:hover {
|
1837 |
+
-webkit-transform: rotate(0);
|
1838 |
+
transform: rotate(0);
|
1839 |
+
}
|
1840 |
+
|
1841 |
+
.foogallery.fg-preset.fg-polaroid .fg-caption {
|
1842 |
+
position: relative;
|
1843 |
+
width: auto;
|
1844 |
+
font-family: "Segoe Print Regular",-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
|
1845 |
+
}
|
1846 |
+
|
1847 |
+
.foogallery.fg-preset.fg-polaroid .fg-caption-inner,
|
1848 |
+
.foogallery.fg-preset.fg-polaroid .fg-caption-title {
|
1849 |
+
position: relative;
|
1850 |
+
width: auto;
|
1851 |
+
}
|
1852 |
+
.foogallery.fg-preset.fg-polaroid .fg-caption-title {
|
1853 |
+
text-align: center;
|
1854 |
+
}
|
1855 |
+
.foogallery.fg-preset.fg-polaroid .fg-caption-desc {
|
1856 |
+
display: none;
|
1857 |
+
}
|
1858 |
+
|
1859 |
+
/* Themes */
|
1860 |
+
.foogallery.fg-preset.fg-polaroid .fg-caption-title,
|
1861 |
+
.foogallery.fg-light.fg-preset.fg-polaroid .fg-caption-title {
|
1862 |
+
color: #333;
|
1863 |
+
}
|
1864 |
+
.foogallery.fg-dark.fg-preset.fg-polaroid .fg-caption-title {
|
1865 |
+
color: #FFF;
|
1866 |
+
}
|
1867 |
+
|
1868 |
+
/* Handle Border Sizing */
|
1869 |
+
.foogallery.fg-preset.fg-polaroid .fg-caption {
|
1870 |
+
border-style: solid;
|
1871 |
+
border-color: transparent;
|
1872 |
+
border-width: 10px;
|
1873 |
+
}
|
1874 |
+
.foogallery.fg-preset.fg-polaroid .fg-caption-title+.fg-caption-desc {
|
1875 |
+
margin-top: 5px;
|
1876 |
+
}
|
1877 |
+
.foogallery.fg-preset.fg-polaroid.fg-border-thin .fg-caption {
|
1878 |
+
border-width: 10px 5px 5px 5px;
|
1879 |
+
}
|
1880 |
+
.foogallery.fg-preset.fg-polaroid.fg-captions-top.fg-border-thin .fg-caption {
|
1881 |
+
border-width: 5px 5px 10px 5px;
|
1882 |
+
}
|
1883 |
+
.foogallery.fg-preset.fg-polaroid.fg-border-medium .fg-caption {
|
1884 |
+
border-width: 10px 0 0 0;
|
1885 |
+
}
|
1886 |
+
.foogallery.fg-preset.fg-polaroid.fg-captions-top.fg-border-medium .fg-caption {
|
1887 |
+
border-width: 0 0 10px 0;
|
1888 |
+
}
|
1889 |
+
.foogallery.fg-preset.fg-polaroid.fg-border-thick .fg-caption {
|
1890 |
+
border-width: 15px 0 0 0;
|
1891 |
+
}
|
1892 |
+
.foogallery.fg-preset.fg-polaroid.fg-captions-top.fg-border-thick .fg-caption {
|
1893 |
+
border-width: 0 0 15px 0;
|
1894 |
+
}
|
1895 |
+
.foogallery.fg-preset.fg-polaroid.fg-border-thick .fg-caption-title+.fg-caption-desc {
|
1896 |
+
margin-top: 10px;
|
1897 |
+
}
|
1898 |
+
/* Base styles */
|
1899 |
+
.fg-image-viewer {
|
1900 |
+
display: block;
|
1901 |
+
font-family: 'Open Sans', 'Helvetica Neue', Arial, sans-serif;
|
1902 |
+
}
|
1903 |
+
.fg-image-viewer.fg-left {
|
1904 |
+
text-align: left;
|
1905 |
+
}
|
1906 |
+
|
1907 |
+
.fg-image-viewer.fg-center {
|
1908 |
+
text-align: center;
|
1909 |
+
}
|
1910 |
+
.fg-image-viewer.fg-right {
|
1911 |
+
text-align: right;
|
1912 |
+
}
|
1913 |
+
|
1914 |
+
.fiv-inner {
|
1915 |
+
position: relative;
|
1916 |
+
display: inline-block;
|
1917 |
+
max-width: 100%;
|
1918 |
+
overflow: hidden;
|
1919 |
+
z-index: 6;
|
1920 |
+
}
|
1921 |
+
.fiv-inner .fiv-inner-container {
|
1922 |
+
position: relative;
|
1923 |
+
overflow: hidden;
|
1924 |
+
max-width: 100%;
|
1925 |
+
border-style: solid;
|
1926 |
+
border-width: 0;
|
1927 |
+
border-bottom-width: 4px;
|
1928 |
+
z-index: 5;
|
1929 |
+
}
|
1930 |
+
.fg-image-viewer .fiv-inner .fiv-inner-container .fg-item .fg-thumb,
|
1931 |
+
.fg-image-viewer .fiv-inner .fiv-inner-container .fg-item .fg-thumb:hover,
|
1932 |
+
.fg-image-viewer .fiv-inner .fiv-inner-container .fg-item .fg-thumb:active,
|
1933 |
+
.fg-image-viewer .fiv-inner .fiv-inner-container .fg-item .fg-thumb:visited {
|
1934 |
+
position: relative;
|
1935 |
+
display: block;
|
1936 |
+
border: none;
|
1937 |
+
outline: none;
|
1938 |
+
text-decoration: none;
|
1939 |
+
box-shadow: none;
|
1940 |
+
max-width: 100%;
|
1941 |
+
}
|
1942 |
+
|
1943 |
+
.fg-image-viewer .fiv-inner .fiv-inner-container .fg-item {
|
1944 |
+
position: relative;
|
1945 |
+
visibility: visible;
|
1946 |
+
opacity: 1;
|
1947 |
+
border: none;
|
1948 |
+
outline: none;
|
1949 |
+
text-decoration: none;
|
1950 |
+
box-shadow: none;
|
1951 |
+
max-width: 100%;
|
1952 |
+
}
|
1953 |
+
.fg-image-viewer .fiv-inner .fiv-inner-container .fg-item .fg-thumb img {
|
1954 |
+
display: block;
|
1955 |
+
max-width: 100%;
|
1956 |
+
height: auto;
|
1957 |
+
border: none;
|
1958 |
+
outline: none;
|
1959 |
+
text-decoration: none;
|
1960 |
+
}
|
1961 |
+
|
1962 |
+
.fg-image-viewer .fiv-inner .fiv-ctrls {
|
1963 |
+
display: block;
|
1964 |
+
text-align: center;
|
1965 |
+
font-size: 14px;
|
1966 |
+
border-style: solid;
|
1967 |
+
line-height: 34px;
|
1968 |
+
}
|
1969 |
+
.fg-image-viewer .fiv-inner .fiv-ctrls:after {
|
1970 |
+
content: '';
|
1971 |
+
display: block;
|
1972 |
+
clear: both;
|
1973 |
+
}
|
1974 |
+
.fg-image-viewer .fiv-inner .fiv-ctrls .fiv-count {
|
1975 |
+
display: inline-block;
|
1976 |
+
font-weight: normal;
|
1977 |
+
margin: 0;
|
1978 |
+
}
|
1979 |
+
.fg-image-viewer .fiv-inner .fiv-ctrls .fiv-prev,
|
1980 |
+
.fg-image-viewer .fiv-inner .fiv-ctrls .fiv-next {
|
1981 |
+
cursor: pointer;
|
1982 |
+
-webkit-user-select: none;
|
1983 |
+
-moz-user-select: none;
|
1984 |
+
-ms-user-select: none;
|
1985 |
+
user-select: none;
|
1986 |
+
border: none;
|
1987 |
+
min-width: 80px;
|
1988 |
+
position: relative;
|
1989 |
+
overflow: hidden;
|
1990 |
+
transition: background-color .3s;
|
1991 |
+
}
|
1992 |
+
.fg-image-viewer .fiv-inner .fiv-ctrls .fiv-prev:before,
|
1993 |
+
.fg-image-viewer .fiv-inner .fiv-ctrls .fiv-next:before {
|
1994 |
+
display: block;
|
1995 |
+
position: absolute;
|
1996 |
+
font-size: 24px;
|
1997 |
+
line-height: 30px;
|
1998 |
+
top:0;
|
1999 |
+
left:0;
|
2000 |
+
width: 100%;
|
2001 |
+
transform: translateY(0);
|
2002 |
+
transition: transform .3s;
|
2003 |
+
}
|
2004 |
+
.fg-image-viewer .fiv-inner .fiv-ctrls .fiv-prev:hover:before,
|
2005 |
+
.fg-image-viewer .fiv-inner .fiv-ctrls .fiv-next:hover:before {
|
2006 |
+
transform: translateY(-100%);
|
2007 |
+
}
|
2008 |
+
.fg-image-viewer .fiv-inner .fiv-ctrls .fiv-prev span,
|
2009 |
+
.fg-image-viewer .fiv-inner .fiv-ctrls .fiv-next span {
|
2010 |
+
display: block;
|
2011 |
+
width: 100%;
|
2012 |
+
transform: translateY(100%);
|
2013 |
+
transition: transform .3s;
|
2014 |
+
}
|
2015 |
+
.fg-image-viewer .fiv-inner .fiv-ctrls .fiv-prev:hover span,
|
2016 |
+
.fg-image-viewer .fiv-inner .fiv-ctrls .fiv-next:hover span {
|
2017 |
+
transform: translateY(0);
|
2018 |
+
}
|
2019 |
+
.fg-image-viewer .fiv-inner .fiv-ctrls .fiv-prev {
|
2020 |
+
float: left;
|
2021 |
+
}
|
2022 |
+
.fg-image-viewer .fiv-inner .fiv-ctrls .fiv-prev:before {
|
2023 |
+
content: '\2190';
|
2024 |
+
}
|
2025 |
+
.fg-image-viewer .fiv-inner .fiv-ctrls .fiv-next {
|
2026 |
+
float: right;
|
2027 |
+
}
|
2028 |
+
.fg-image-viewer .fiv-inner .fiv-ctrls .fiv-next:before {
|
2029 |
+
content: '\2192';
|
2030 |
+
}
|
2031 |
+
.fg-image-viewer .fiv-inner .fiv-ctrls .fiv-count span {
|
2032 |
+
margin: 0 4px;
|
2033 |
+
}
|
2034 |
+
|
2035 |
+
/*!* Theme - Default (Light) *!*/
|
2036 |
+
/*.fg-image-viewer .fiv-inner,*/
|
2037 |
+
/*.fg-image-viewer .fiv-inner .fiv-ctrls .fiv-prev,*/
|
2038 |
+
/*.fg-image-viewer .fiv-inner .fiv-ctrls .fiv-next {*/
|
2039 |
+
/*background-color: #FFFFFF;*/
|
2040 |
+
/*color: #1b1b1b;*/
|
2041 |
+
/*}*/
|
2042 |
+
/*.fg-image-viewer .fiv-inner,*/
|
2043 |
+
/*.fg-image-viewer .fiv-inner .fiv-inner-container,*/
|
2044 |
+
/*.fg-image-viewer .fiv-inner .fiv-ctrls .fiv-prev,*/
|
2045 |
+
/*.fg-image-viewer .fiv-inner .fiv-ctrls .fiv-next {*/
|
2046 |
+
/*border-color: #e6e6e6;*/
|
2047 |
+
/*}*/
|
2048 |
+
/*.fg-image-viewer .fiv-inner .fiv-ctrls .fiv-prev:hover,*/
|
2049 |
+
/*.fg-image-viewer .fiv-inner .fiv-ctrls .fiv-next:hover {*/
|
2050 |
+
/*background-color: #F2F2F2;*/
|
2051 |
+
/*}*/
|
2052 |
+
|
2053 |
+
/*!* Theme - Dark *!*/
|
2054 |
+
/*.fg-image-viewer.fiv-dark .fiv-inner,*/
|
2055 |
+
/*.fg-image-viewer.fiv-dark .fiv-inner .fiv-ctrls .fiv-prev,*/
|
2056 |
+
/*.fg-image-viewer.fiv-dark .fiv-inner .fiv-ctrls .fiv-next {*/
|
2057 |
+
/*background-color: #151515;*/
|
2058 |
+
/*color: #FFFFFF;*/
|
2059 |
+
/*}*/
|
2060 |
+
/*.fg-image-viewer.fiv-dark .fiv-inner,*/
|
2061 |
+
/*.fg-image-viewer.fiv-dark .fiv-inner .fiv-inner-container,*/
|
2062 |
+
/*.fg-image-viewer.fiv-dark .fiv-inner .fiv-ctrls .fiv-prev,*/
|
2063 |
+
/*.fg-image-viewer.fiv-dark .fiv-inner .fiv-ctrls .fiv-next {*/
|
2064 |
+
/*border-color: #2E2E2E;*/
|
2065 |
+
/*}*/
|
2066 |
+
/*.fg-image-viewer.fiv-dark .fiv-inner .fiv-ctrls .fiv-prev:hover,*/
|
2067 |
+
/*.fg-image-viewer.fiv-dark .fiv-inner .fiv-ctrls .fiv-next:hover {*/
|
2068 |
+
/*background-color: #000000;*/
|
2069 |
+
/*}*/
|
2070 |
+
|
2071 |
+
/* Captions */
|
2072 |
+
|
2073 |
+
.foogallery.fg-image-viewer.fg-caption-always .fg-item-inner .fg-caption {
|
2074 |
+
padding: 0;
|
2075 |
+
border: none;
|
2076 |
+
background: #000; /* Old browsers */
|
2077 |
+
background: -moz-linear-gradient(left, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.8) 60%, rgba(0,0,0,0) 100%); /* FF3.6-15 */
|
2078 |
+
background: -webkit-linear-gradient(left, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.8) 60%,rgba(0,0,0,0) 100%); /* Chrome10-25,Safari5.1-6 */
|
2079 |
+
background: linear-gradient(to right, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.8) 60%,rgba(0,0,0,0) 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
|
2080 |
+
}
|
2081 |
+
.foogallery.fg-image-viewer.fg-caption-always .fg-caption-title {
|
2082 |
+
padding: 10px 10px 10px 10px;
|
2083 |
+
}
|
2084 |
+
.foogallery.fg-image-viewer.fg-caption-always .fg-caption-desc {
|
2085 |
+
padding: 10px 10px 10px 10px;
|
2086 |
+
}
|
2087 |
+
.foogallery.fg-image-viewer.fg-caption-always .fg-caption-title+.fg-caption-desc {
|
2088 |
+
padding: 0 10px 10px 10px;
|
2089 |
+
}
|
2090 |
+
|
2091 |
+
/* Theme - Default (Light) */
|
2092 |
+
.fg-image-viewer.fg-light .fiv-inner .fiv-ctrls,
|
2093 |
+
.fg-image-viewer.fg-light .fiv-inner .fiv-inner-container,
|
2094 |
+
.fg-image-viewer.fg-light .fiv-inner .fiv-ctrls .fiv-count,
|
2095 |
+
.fg-image-viewer.fg-light .fiv-inner .fiv-ctrls .fiv-prev,
|
2096 |
+
.fg-image-viewer.fg-light .fiv-inner .fiv-ctrls .fiv-next {
|
2097 |
+
background-color: #FFF;
|
2098 |
+
color: #333;
|
2099 |
+
border-color: #FFF;
|
2100 |
+
}
|
2101 |
+
.fg-image-viewer.fg-light .fiv-inner .fiv-ctrls .fiv-prev:hover,
|
2102 |
+
.fg-image-viewer.fg-light .fiv-inner .fiv-ctrls .fiv-next:hover {
|
2103 |
+
background-color: #F2F2F2;
|
2104 |
+
}
|
2105 |
+
.fg-image-viewer.fg-light .fiv-prev,
|
2106 |
+
.fg-image-viewer.fg-light .fiv-next {
|
2107 |
+
box-shadow: inset 0 0 0 1px #ddd;
|
2108 |
+
}
|
2109 |
+
|
2110 |
+
/* Theme - Dark */
|
2111 |
+
.fg-image-viewer.fg-dark .fiv-inner .fiv-ctrls,
|
2112 |
+
.fg-image-viewer.fg-dark .fiv-inner .fiv-inner-container,
|
2113 |
+
.fg-image-viewer.fg-dark .fiv-inner .fiv-ctrls .fiv-count,
|
2114 |
+
.fg-image-viewer.fg-dark .fiv-inner .fiv-ctrls .fiv-prev,
|
2115 |
+
.fg-image-viewer.fg-dark .fiv-inner .fiv-ctrls .fiv-next {
|
2116 |
+
background-color: #333;
|
2117 |
+
color: #FFF;
|
2118 |
+
border-color: #333;
|
2119 |
+
}
|
2120 |
+
.fg-image-viewer.fg-dark .fiv-inner .fiv-ctrls .fiv-prev:hover,
|
2121 |
+
.fg-image-viewer.fg-dark .fiv-inner .fiv-ctrls .fiv-next:hover {
|
2122 |
+
background-color: #444;
|
2123 |
+
}
|
2124 |
+
.fg-image-viewer.fg-dark .fiv-prev,
|
2125 |
+
.fg-image-viewer.fg-dark .fiv-next {
|
2126 |
+
box-shadow: inset 0 0 0 1px #222;
|
2127 |
+
}
|
2128 |
+
|
2129 |
+
/* Border Size */
|
2130 |
+
.foogallery.fg-image-viewer.fg-border-thin .fg-item-inner,
|
2131 |
+
.foogallery.fg-image-viewer.fg-border-medium .fg-item-inner,
|
2132 |
+
.foogallery.fg-image-viewer.fg-border-thick .fg-item-inner {
|
2133 |
+
border-width: 0;
|
2134 |
+
}
|
2135 |
+
.foogallery.fg-image-viewer .fiv-ctrls,
|
2136 |
+
.foogallery.fg-image-viewer.fg-border-thin .fiv-inner-container {
|
2137 |
+
border-width: 4px;
|
2138 |
+
}
|
2139 |
+
.foogallery.fg-image-viewer.fg-border-medium .fiv-ctrls,
|
2140 |
+
.foogallery.fg-image-viewer.fg-border-medium .fiv-inner-container {
|
2141 |
+
border-width: 10px;
|
2142 |
+
}
|
2143 |
+
.foogallery.fg-image-viewer.fg-border-thick .fiv-ctrls,
|
2144 |
+
.foogallery.fg-image-viewer.fg-border-thick .fiv-inner-container {
|
2145 |
+
border-width: 16px;
|
2146 |
+
}
|
2147 |
+
.foogallery.fg-image-viewer .fiv-ctrls,
|
2148 |
+
.foogallery.fg-image-viewer.fg-border-thin .fiv-ctrls,
|
2149 |
+
.foogallery.fg-image-viewer.fg-border-medium .fiv-ctrls,
|
2150 |
+
.foogallery.fg-image-viewer.fg-border-thick .fiv-ctrls {
|
2151 |
+
border-top-width: 1px;
|
2152 |
+
}
|
2153 |
+
|
2154 |
+
/* Rounded Corners */
|
2155 |
+
.foogallery.fg-image-viewer.fg-round-small .fg-item,
|
2156 |
+
.foogallery.fg-image-viewer.fg-round-small .fg-item-inner,
|
2157 |
+
.foogallery.fg-image-viewer.fg-round-small .fiv-inner {
|
2158 |
+
border-radius: 5px;
|
2159 |
+
}
|
2160 |
+
.foogallery.fg-image-viewer.fg-round-small .fg-item,
|
2161 |
+
.foogallery.fg-image-viewer.fg-round-small .fg-item-inner {
|
2162 |
+
border-bottom-left-radius: 0;
|
2163 |
+
border-bottom-right-radius: 0;
|
2164 |
+
}
|
2165 |
+
.foogallery.fg-image-viewer.fg-round-small .fiv-prev,
|
2166 |
+
.foogallery.fg-image-viewer.fg-round-small .fiv-next {
|
2167 |
+
border-radius: 3px;
|
2168 |
+
}
|
2169 |
+
|
2170 |
+
.foogallery.fg-image-viewer.fg-border-thin.fg-round-small .fg-item,
|
2171 |
+
.foogallery.fg-image-viewer.fg-border-thin.fg-round-small .fg-item-inner,
|
2172 |
+
.foogallery.fg-image-viewer.fg-border-thin.fg-round-small .fiv-prev,
|
2173 |
+
.foogallery.fg-image-viewer.fg-border-thin.fg-round-small .fiv-next,
|
2174 |
+
.foogallery.fg-image-viewer.fg-border-medium.fg-round-small .fg-item,
|
2175 |
+
.foogallery.fg-image-viewer.fg-border-medium.fg-round-small .fg-item-inner,
|
2176 |
+
.foogallery.fg-image-viewer.fg-border-medium.fg-round-small .fiv-prev,
|
2177 |
+
.foogallery.fg-image-viewer.fg-border-medium.fg-round-small .fiv-next,
|
2178 |
+
.foogallery.fg-image-viewer.fg-border-thick.fg-round-small .fg-item,
|
2179 |
+
.foogallery.fg-image-viewer.fg-border-thick.fg-round-small .fg-item-inner,
|
2180 |
+
.foogallery.fg-image-viewer.fg-border-thick.fg-round-small .fiv-prev,
|
2181 |
+
.foogallery.fg-image-viewer.fg-border-thick.fg-round-small .fiv-next {
|
2182 |
+
border-radius: 3px;
|
2183 |
+
}
|
2184 |
+
|
2185 |
+
.foogallery.fg-image-viewer.fg-round-medium .fg-item,
|
2186 |
+
.foogallery.fg-image-viewer.fg-round-medium .fg-item-inner,
|
2187 |
+
.foogallery.fg-image-viewer.fg-round-medium .fiv-inner {
|
2188 |
+
border-radius: 10px;
|
2189 |
+
}
|
2190 |
+
.foogallery.fg-image-viewer.fg-round-medium .fg-item,
|
2191 |
+
.foogallery.fg-image-viewer.fg-round-medium .fg-item-inner {
|
2192 |
+
border-bottom-left-radius: 0;
|
2193 |
+
border-bottom-right-radius: 0;
|
2194 |
+
}
|
2195 |
+
.foogallery.fg-image-viewer.fg-round-medium .fiv-prev,
|
2196 |
+
.foogallery.fg-image-viewer.fg-round-medium .fiv-next {
|
2197 |
+
border-radius: 5px;
|
2198 |
+
}
|
2199 |
+
.foogallery.fg-image-viewer.fg-border-thin.fg-round-medium .fg-item,
|
2200 |
+
.foogallery.fg-image-viewer.fg-border-thin.fg-round-medium .fg-item-inner,
|
2201 |
+
.foogallery.fg-image-viewer.fg-border-thin.fg-round-medium .fiv-prev,
|
2202 |
+
.foogallery.fg-image-viewer.fg-border-thin.fg-round-medium .fiv-next {
|
2203 |
+
border-radius: 5px;
|
2204 |
+
}
|
2205 |
+
.foogallery.fg-image-viewer.fg-border-medium.fg-round-medium .fg-item,
|
2206 |
+
.foogallery.fg-image-viewer.fg-border-medium.fg-round-medium .fg-item-inner,
|
2207 |
+
.foogallery.fg-image-viewer.fg-border-medium.fg-round-medium .fiv-prev,
|
2208 |
+
.foogallery.fg-image-viewer.fg-border-medium.fg-round-medium .fiv-next,
|
2209 |
+
.foogallery.fg-image-viewer.fg-border-thick.fg-round-medium .fg-item,
|
2210 |
+
.foogallery.fg-image-viewer.fg-border-thick.fg-round-medium .fg-item-inner,
|
2211 |
+
.foogallery.fg-image-viewer.fg-border-thick.fg-round-medium .fiv-prev,
|
2212 |
+
.foogallery.fg-image-viewer.fg-border-thick.fg-round-medium .fiv-next {
|
2213 |
+
border-radius: 3px;
|
2214 |
+
}
|
2215 |
+
|
2216 |
+
.foogallery.fg-image-viewer.fg-round-large .fg-item,
|
2217 |
+
.foogallery.fg-image-viewer.fg-round-large .fg-item-inner,
|
2218 |
+
.foogallery.fg-image-viewer.fg-round-large .fiv-inner {
|
2219 |
+
border-radius: 15px;
|
2220 |
+
}
|
2221 |
+
.foogallery.fg-image-viewer.fg-round-large .fg-item,
|
2222 |
+
.foogallery.fg-image-viewer.fg-round-large .fg-item-inner {
|
2223 |
+
border-bottom-left-radius: 0;
|
2224 |
+
border-bottom-right-radius: 0;
|
2225 |
+
}
|
2226 |
+
.foogallery.fg-image-viewer.fg-round-large .fiv-prev,
|
2227 |
+
.foogallery.fg-image-viewer.fg-round-large .fiv-next {
|
2228 |
+
border-radius: 11px;
|
2229 |
+
}
|
2230 |
+
.foogallery.fg-image-viewer.fg-border-thin.fg-round-large .fg-item,
|
2231 |
+
.foogallery.fg-image-viewer.fg-border-thin.fg-round-large .fg-item-inner,
|
2232 |
+
.foogallery.fg-image-viewer.fg-border-thin.fg-round-large .fiv-prev,
|
2233 |
+
.foogallery.fg-image-viewer.fg-border-thin.fg-round-large .fiv-next {
|
2234 |
+
border-radius: 11px;
|
2235 |
+
}
|
2236 |
+
|
2237 |
+
.foogallery.fg-image-viewer.fg-border-medium.fg-round-large .fg-item,
|
2238 |
+
.foogallery.fg-image-viewer.fg-border-medium.fg-round-large .fg-item-inner,
|
2239 |
+
.foogallery.fg-image-viewer.fg-border-medium.fg-round-large .fiv-prev,
|
2240 |
+
.foogallery.fg-image-viewer.fg-border-medium.fg-round-large .fiv-next {
|
2241 |
+
border-radius: 5px;
|
2242 |
+
}
|
2243 |
+
|
2244 |
+
.foogallery.fg-image-viewer.fg-border-thick.fg-round-large .fg-item,
|
2245 |
+
.foogallery.fg-image-viewer.fg-border-thick.fg-round-large .fg-item-inner,
|
2246 |
+
.foogallery.fg-image-viewer.fg-border-thick.fg-round-large .fiv-prev,
|
2247 |
+
.foogallery.fg-image-viewer.fg-border-thick.fg-round-large .fiv-next {
|
2248 |
+
border-radius: 3px;
|
2249 |
+
}
|
2250 |
+
|
2251 |
+
.foogallery.fg-image-viewer.fg-round-full .fiv-inner,
|
2252 |
+
.foogallery.fg-image-viewer.fg-round-full .fiv-prev,
|
2253 |
+
.foogallery.fg-image-viewer.fg-round-full .fiv-next {
|
2254 |
+
border-radius: 50%;
|
2255 |
+
}
|
2256 |
+
|
2257 |
+
/* Drop Shadows */
|
2258 |
+
.foogallery.fg-image-viewer.fg-light.fg-shadow-outline .fg-item-inner,
|
2259 |
+
.foogallery.fg-image-viewer.fg-dark.fg-shadow-outline .fg-item-inner,
|
2260 |
+
.foogallery.fg-image-viewer.fg-light.fg-shadow-small .fg-item-inner,
|
2261 |
+
.foogallery.fg-image-viewer.fg-dark.fg-shadow-small .fg-item-inner,
|
2262 |
+
.foogallery.fg-image-viewer.fg-light.fg-shadow-medium .fg-item-inner,
|
2263 |
+
.foogallery.fg-image-viewer.fg-dark.fg-shadow-medium .fg-item-inner,
|
2264 |
+
.foogallery.fg-image-viewer.fg-light.fg-shadow-large .fg-item-inner,
|
2265 |
+
.foogallery.fg-image-viewer.fg-dark.fg-shadow-large .fg-item-inner {
|
2266 |
+
box-shadow: none;
|
2267 |
+
}
|
2268 |
+
|
2269 |
+
.foogallery.fg-image-viewer.fg-light.fg-shadow-outline .fiv-inner {
|
2270 |
+
box-shadow: 0 0 0 1px #ddd;
|
2271 |
+
}
|
2272 |
+
.foogallery.fg-image-viewer.fg-dark.fg-shadow-outline .fiv-inner {
|
2273 |
+
box-shadow: 0 0 0 1px #222;
|
2274 |
+
}
|
2275 |
+
.foogallery.fg-image-viewer.fg-light.fg-shadow-small .fiv-inner,
|
2276 |
+
.foogallery.fg-image-viewer.fg-dark.fg-shadow-small .fiv-inner {
|
2277 |
+
box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.5);
|
2278 |
+
}
|
2279 |
+
.foogallery.fg-image-viewer.fg-light.fg-shadow-medium .fiv-inner,
|
2280 |
+
.foogallery.fg-image-viewer.fg-dark.fg-shadow-medium .fiv-inner {
|
2281 |
+
box-shadow: 0 1px 10px 0 rgba(0, 0, 0, 0.5);
|
2282 |
+
}
|
2283 |
+
.foogallery.fg-image-viewer.fg-light.fg-shadow-large .fiv-inner,
|
2284 |
+
.foogallery.fg-image-viewer.fg-dark.fg-shadow-large .fiv-inner {
|
2285 |
+
box-shadow: 0 1px 16px 0 rgba(0, 0, 0, 0.5);
|
2286 |
+
}
|
2287 |
+
.foogallery.fg-thumbnail,
|
2288 |
+
.foogallery.fg-thumbnail.fg-center {
|
2289 |
+
text-align: center;
|
2290 |
+
}
|
2291 |
+
.foogallery.fg-thumbnail.fg-left {
|
2292 |
+
float: left;
|
2293 |
+
}
|
2294 |
+
.foogallery.fg-thumbnail.fg-right {
|
2295 |
+
float: right;
|
2296 |
+
}
|
2297 |
+
|
2298 |
+
.foogallery.fg-thumbnail .fg-item {
|
2299 |
+
display: inline-block;
|
2300 |
+
vertical-align: top;
|
2301 |
+
max-width: 100%;
|
2302 |
+
}
|
2303 |
+
.foogallery.fg-thumbnail .fg-st-hidden {
|
2304 |
+
display: none;
|
2305 |
+
}
|
extensions/default-templates/shared/css/foogallery.min.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
.foogallery,.foogallery *{box-sizing:border-box}.foogallery{display:block;z-index:1;font-family:-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;position:relative;line-height:0;font-size:0}.foogallery .fg-item{display:inline-block;position:relative;background-color:transparent;z-index:2;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.foogallery .fg-item-inner{display:block;position:relative;visibility:hidden;overflow:hidden;opacity:0;z-index:3;margin:0;border:solid 0 transparent}.foogallery .fg-item.fg-error,.foogallery .fg-item.fg-loading{background:no-repeat center}.foogallery .fg-item.fg-error{background-image:url(../img/image.png)}@media only screen and (-o-min-device-pixel-ratio:5/4),only screen and (-webkit-min-device-pixel-ratio:1.25),only screen and (min-device-pixel-ratio:1.25),only screen and (min-resolution:1.25dppx){.foogallery .fg-item.fg-error{background-image:url(../img/image@2x.png)}}@media only screen and (-o-min-device-pixel-ratio:9/4),only screen and (-webkit-min-device-pixel-ratio:2.25),only screen and (min-device-pixel-ratio:2.25),only screen and (min-resolution:2.25dppx){.foogallery .fg-item.fg-error{background-image:url(../img/image@3x.png)}}.foogallery .fg-item.fg-loaded{z-index:4}.foogallery .fg-loaded .fg-item-inner{visibility:visible;opacity:1;z-index:5}.foogallery .fg-error .fg-item-inner{pointer-events:none;cursor:default}.foogallery .fg-thumb{display:block;position:relative;border:none;outline:0;text-decoration:none;z-index:4}.foogallery .fg-image{display:block;position:relative;border:none;outline:0;text-decoration:none;z-index:5;max-width:none;height:auto}.foogallery .fg-loaded .fg-thumb{z-index:6}.foogallery .fg-loaded .fg-image{z-index:7}.foogallery.fg-light .fg-item-inner{background-color:#fff;color:#333;border-color:#fff}.foogallery.fg-dark .fg-item-inner{background-color:#333;color:#fff;border-color:#333}.foogallery.fg-light .fg-item.fg-error,.foogallery.fg-light .fg-item.fg-idle,.foogallery.fg-light .fg-item.fg-loading{background-color:#eee;box-shadow:inset 0 0 0 1px #ddd}.foogallery.fg-dark .fg-item.fg-error,.foogallery.fg-dark .fg-item.fg-idle,.foogallery.fg-dark .fg-item.fg-loading{background-color:#444;box-shadow:inset 0 0 0 1px #333}.foogallery.fg-border-thin .fg-item-inner{border-width:4px}.foogallery.fg-border-medium .fg-item-inner{border-width:10px}.foogallery.fg-border-thick .fg-item-inner{border-width:16px}.foogallery.fg-light.fg-shadow-outline .fg-item-inner{box-shadow:0 0 0 1px #ddd}.foogallery.fg-dark.fg-shadow-outline .fg-item-inner{box-shadow:0 0 0 1px #222}.foogallery.fg-dark.fg-shadow-small .fg-item-inner,.foogallery.fg-light.fg-shadow-small .fg-item-inner{box-shadow:0 1px 4px 0 rgba(0,0,0,.5)}.foogallery.fg-dark.fg-shadow-medium .fg-item-inner,.foogallery.fg-light.fg-shadow-medium .fg-item-inner{box-shadow:0 1px 10px 0 rgba(0,0,0,.5)}.foogallery.fg-dark.fg-shadow-large .fg-item-inner,.foogallery.fg-light.fg-shadow-large .fg-item-inner{box-shadow:0 1px 16px 0 rgba(0,0,0,.5)}.foogallery.fg-shadow-inset-large .fg-thumb:after,.foogallery.fg-shadow-inset-medium .fg-thumb:after,.foogallery.fg-shadow-inset-small .fg-thumb:after{display:block;content:"";position:absolute;top:0;left:0;right:0;bottom:0;z-index:7}.foogallery.fg-dark.fg-shadow-inset-small .fg-thumb:after,.foogallery.fg-light.fg-shadow-inset-small .fg-thumb:after{box-shadow:inset 0 1px 4px 0 rgba(0,0,0,.3)}.foogallery.fg-dark.fg-shadow-inset-medium .fg-thumb:after,.foogallery.fg-light.fg-shadow-inset-medium .fg-thumb:after{box-shadow:inset 0 1px 10px 0 rgba(0,0,0,.3)}.foogallery.fg-dark.fg-shadow-inset-large .fg-thumb:after,.foogallery.fg-light.fg-shadow-inset-large .fg-thumb:after{box-shadow:inset 0 1px 16px 0 rgba(0,0,0,.3)}.foogallery.fg-round-full.fg-shadow-inset-large .fg-thumb:after,.foogallery.fg-round-full.fg-shadow-inset-medium .fg-thumb:after,.foogallery.fg-round-full.fg-shadow-inset-small .fg-thumb:after{border-radius:50%}.foogallery.fg-round-small .fg-item,.foogallery.fg-round-small .fg-item-inner{border-radius:5px}.foogallery.fg-round-medium .fg-item,.foogallery.fg-round-medium .fg-item-inner{border-radius:10px}.foogallery.fg-round-large .fg-item,.foogallery.fg-round-large .fg-item-inner{border-radius:15px}.foogallery.fg-round-full .fg-item,.foogallery.fg-round-full .fg-item-inner{border-radius:50%}.foogallery .fg-loader{position:absolute;top:50%;left:50%;transform:translateX(-50%) translateY(-50%);width:1em;height:1em;font-size:5px;visibility:hidden;opacity:0}.foogallery .fg-loading .fg-loader{visibility:visible;opacity:1}.fg-loading-default .fg-loader{border-radius:50%;text-indent:-9999em;-webkit-animation:loading-default 1.1s infinite ease;animation:loading-default 1.1s infinite ease}@-webkit-keyframes loading-default{0%,100%{box-shadow:0 -2.6em 0 0 rgba(130,130,130,1),1.8em -1.8em 0 0 rgba(130,130,130,.2),2.5em 0 0 0 rgba(130,130,130,.2),1.75em 1.75em 0 0 rgba(130,130,130,.2),0 2.5em 0 0 rgba(130,130,130,.2),-1.8em 1.8em 0 0 rgba(130,130,130,.2),-2.6em 0 0 0 rgba(130,130,130,.5),-1.8em -1.8em 0 0 rgba(130,130,130,.7)}12.5%{box-shadow:0 -2.6em 0 0 rgba(130,130,130,.7),1.8em -1.8em 0 0 rgba(130,130,130,1),2.5em 0 0 0 rgba(130,130,130,.2),1.75em 1.75em 0 0 rgba(130,130,130,.2),0 2.5em 0 0 rgba(130,130,130,.2),-1.8em 1.8em 0 0 rgba(130,130,130,.2),-2.6em 0 0 0 rgba(130,130,130,.2),-1.8em -1.8em 0 0 rgba(130,130,130,.5)}25%{box-shadow:0 -2.6em 0 0 rgba(130,130,130,.5),1.8em -1.8em 0 0 rgba(130,130,130,.7),2.5em 0 0 0 rgba(130,130,130,1),1.75em 1.75em 0 0 rgba(130,130,130,.2),0 2.5em 0 0 rgba(130,130,130,.2),-1.8em 1.8em 0 0 rgba(130,130,130,.2),-2.6em 0 0 0 rgba(130,130,130,.2),-1.8em -1.8em 0 0 rgba(130,130,130,.2)}37.5%{box-shadow:0 -2.6em 0 0 rgba(130,130,130,.2),1.8em -1.8em 0 0 rgba(130,130,130,.5),2.5em 0 0 0 rgba(130,130,130,.7),1.75em 1.75em 0 0 rgba(130,130,130,1),0 2.5em 0 0 rgba(130,130,130,.2),-1.8em 1.8em 0 0 rgba(130,130,130,.2),-2.6em 0 0 0 rgba(130,130,130,.2),-1.8em -1.8em 0 0 rgba(130,130,130,.2)}50%{box-shadow:0 -2.6em 0 0 rgba(130,130,130,.2),1.8em -1.8em 0 0 rgba(130,130,130,.2),2.5em 0 0 0 rgba(130,130,130,.5),1.75em 1.75em 0 0 rgba(130,130,130,.7),0 2.5em 0 0 rgba(130,130,130,1),-1.8em 1.8em 0 0 rgba(130,130,130,.2),-2.6em 0 0 0 rgba(130,130,130,.2),-1.8em -1.8em 0 0 rgba(130,130,130,.2)}62.5%{box-shadow:0 -2.6em 0 0 rgba(130,130,130,.2),1.8em -1.8em 0 0 rgba(130,130,130,.2),2.5em 0 0 0 rgba(130,130,130,.2),1.75em 1.75em 0 0 rgba(130,130,130,.5),0 2.5em 0 0 rgba(130,130,130,.7),-1.8em 1.8em 0 0 rgba(130,130,130,1),-2.6em 0 0 0 rgba(130,130,130,.2),-1.8em -1.8em 0 0 rgba(130,130,130,.2)}75%{box-shadow:0 -2.6em 0 0 rgba(130,130,130,.2),1.8em -1.8em 0 0 rgba(130,130,130,.2),2.5em 0 0 0 rgba(130,130,130,.2),1.75em 1.75em 0 0 rgba(130,130,130,.2),0 2.5em 0 0 rgba(130,130,130,.5),-1.8em 1.8em 0 0 rgba(130,130,130,.7),-2.6em 0 0 0 rgba(130,130,130,1),-1.8em -1.8em 0 0 rgba(130,130,130,.2)}87.5%{box-shadow:0 -2.6em 0 0 rgba(130,130,130,.2),1.8em -1.8em 0 0 rgba(130,130,130,.2),2.5em 0 0 0 rgba(130,130,130,.2),1.75em 1.75em 0 0 rgba(130,130,130,.2),0 2.5em 0 0 rgba(130,130,130,.2),-1.8em 1.8em 0 0 rgba(130,130,130,.5),-2.6em 0 0 0 rgba(130,130,130,.7),-1.8em -1.8em 0 0 rgba(130,130,130,1)}}@keyframes loading-default{0%,100%{box-shadow:0 -2.6em 0 0 rgba(130,130,130,1),1.8em -1.8em 0 0 rgba(130,130,130,.2),2.5em 0 0 0 rgba(130,130,130,.2),1.75em 1.75em 0 0 rgba(130,130,130,.2),0 2.5em 0 0 rgba(130,130,130,.2),-1.8em 1.8em 0 0 rgba(130,130,130,.2),-2.6em 0 0 0 rgba(130,130,130,.5),-1.8em -1.8em 0 0 rgba(130,130,130,.7)}12.5%{box-shadow:0 -2.6em 0 0 rgba(130,130,130,.7),1.8em -1.8em 0 0 rgba(130,130,130,1),2.5em 0 0 0 rgba(130,130,130,.2),1.75em 1.75em 0 0 rgba(130,130,130,.2),0 2.5em 0 0 rgba(130,130,130,.2),-1.8em 1.8em 0 0 rgba(130,130,130,.2),-2.6em 0 0 0 rgba(130,130,130,.2),-1.8em -1.8em 0 0 rgba(130,130,130,.5)}25%{box-shadow:0 -2.6em 0 0 rgba(130,130,130,.5),1.8em -1.8em 0 0 rgba(130,130,130,.7),2.5em 0 0 0 rgba(130,130,130,1),1.75em 1.75em 0 0 rgba(130,130,130,.2),0 2.5em 0 0 rgba(130,130,130,.2),-1.8em 1.8em 0 0 rgba(130,130,130,.2),-2.6em 0 0 0 rgba(130,130,130,.2),-1.8em -1.8em 0 0 rgba(130,130,130,.2)}37.5%{box-shadow:0 -2.6em 0 0 rgba(130,130,130,.2),1.8em -1.8em 0 0 rgba(130,130,130,.5),2.5em 0 0 0 rgba(130,130,130,.7),1.75em 1.75em 0 0 rgba(130,130,130,1),0 2.5em 0 0 rgba(130,130,130,.2),-1.8em 1.8em 0 0 rgba(130,130,130,.2),-2.6em 0 0 0 rgba(130,130,130,.2),-1.8em -1.8em 0 0 rgba(130,130,130,.2)}50%{box-shadow:0 -2.6em 0 0 rgba(130,130,130,.2),1.8em -1.8em 0 0 rgba(130,130,130,.2),2.5em 0 0 0 rgba(130,130,130,.5),1.75em 1.75em 0 0 rgba(130,130,130,.7),0 2.5em 0 0 rgba(130,130,130,1),-1.8em 1.8em 0 0 rgba(130,130,130,.2),-2.6em 0 0 0 rgba(130,130,130,.2),-1.8em -1.8em 0 0 rgba(130,130,130,.2)}62.5%{box-shadow:0 -2.6em 0 0 rgba(130,130,130,.2),1.8em -1.8em 0 0 rgba(130,130,130,.2),2.5em 0 0 0 rgba(130,130,130,.2),1.75em 1.75em 0 0 rgba(130,130,130,.5),0 2.5em 0 0 rgba(130,130,130,.7),-1.8em 1.8em 0 0 rgba(130,130,130,1),-2.6em 0 0 0 rgba(130,130,130,.2),-1.8em -1.8em 0 0 rgba(130,130,130,.2)}75%{box-shadow:0 -2.6em 0 0 rgba(130,130,130,.2),1.8em -1.8em 0 0 rgba(130,130,130,.2),2.5em 0 0 0 rgba(130,130,130,.2),1.75em 1.75em 0 0 rgba(130,130,130,.2),0 2.5em 0 0 rgba(130,130,130,.5),-1.8em 1.8em 0 0 rgba(130,130,130,.7),-2.6em 0 0 0 rgba(130,130,130,1),-1.8em -1.8em 0 0 rgba(130,130,130,.2)}87.5%{box-shadow:0 -2.6em 0 0 rgba(130,130,130,.2),1.8em -1.8em 0 0 rgba(130,130,130,.2),2.5em 0 0 0 rgba(130,130,130,.2),1.75em 1.75em 0 0 rgba(130,130,130,.2),0 2.5em 0 0 rgba(130,130,130,.2),-1.8em 1.8em 0 0 rgba(130,130,130,.5),-2.6em 0 0 0 rgba(130,130,130,.7),-1.8em -1.8em 0 0 rgba(130,130,130,1)}}.fg-loading-bars .fg-loader,.fg-loading-bars .fg-loader:after,.fg-loading-bars .fg-loader:before{background:rgba(130,130,130,1);-webkit-animation:loading-bars 1s infinite ease-in-out;animation:loading-bars 1s infinite ease-in-out;width:1em;height:4em}.fg-loading-bars .fg-loader{color:rgba(130,130,130,1);text-indent:-9999em;font-size:4px;-webkit-animation-delay:-.16s;animation-delay:-.16s}.fg-loading-bars .fg-loader:after,.fg-loading-bars .fg-loader:before{position:absolute;top:0;content:''}.fg-loading-bars .fg-loader:before{left:-1.5em;-webkit-animation-delay:-.32s;animation-delay:-.32s}.fg-loading-bars .fg-loader:after{left:1.5em}@-webkit-keyframes loading-bars{0%,100%,80%{box-shadow:0 0;height:4em}40%{box-shadow:0 -2em;height:5em}}@keyframes loading-bars{0%,100%,80%{box-shadow:0 0;height:4em}40%{box-shadow:0 -2em;height:5em}}.fg-loading-trail .fg-loader{color:#828282;font-size:20px;text-indent:-9999em;overflow:hidden;border-radius:50%;-webkit-animation:loading-trail-1 1.7s infinite ease,loading-trail-2 1.7s infinite ease;animation:loading-trail-1 1.7s infinite ease,loading-trail-2 1.7s infinite ease}@-webkit-keyframes loading-trail-1{0%{box-shadow:0 -.83em 0 -.4em,0 -.83em 0 -.42em,0 -.83em 0 -.44em,0 -.83em 0 -.46em,0 -.83em 0 -.477em}5%,95%{box-shadow:0 -.83em 0 -.4em,0 -.83em 0 -.42em,0 -.83em 0 -.44em,0 -.83em 0 -.46em,0 -.83em 0 -.477em}10%,59%{box-shadow:0 -.83em 0 -.4em,-.087em -.825em 0 -.42em,-.173em -.812em 0 -.44em,-.256em -.789em 0 -.46em,-.297em -.775em 0 -.477em}20%{box-shadow:0 -.83em 0 -.4em,-.338em -.758em 0 -.42em,-.555em -.617em 0 -.44em,-.671em -.488em 0 -.46em,-.749em -.34em 0 -.477em}38%{box-shadow:0 -.83em 0 -.4em,-.377em -.74em 0 -.42em,-.645em -.522em 0 -.44em,-.775em -.297em 0 -.46em,-.82em -.09em 0 -.477em}100%{box-shadow:0 -.83em 0 -.4em,0 -.83em 0 -.42em,0 -.83em 0 -.44em,0 -.83em 0 -.46em,0 -.83em 0 -.477em}}@keyframes loading-trail-1{0%{box-shadow:0 -.83em 0 -.4em,0 -.83em 0 -.42em,0 -.83em 0 -.44em,0 -.83em 0 -.46em,0 -.83em 0 -.477em}5%,95%{box-shadow:0 -.83em 0 -.4em,0 -.83em 0 -.42em,0 -.83em 0 -.44em,0 -.83em 0 -.46em,0 -.83em 0 -.477em}10%,59%{box-shadow:0 -.83em 0 -.4em,-.087em -.825em 0 -.42em,-.173em -.812em 0 -.44em,-.256em -.789em 0 -.46em,-.297em -.775em 0 -.477em}20%{box-shadow:0 -.83em 0 -.4em,-.338em -.758em 0 -.42em,-.555em -.617em 0 -.44em,-.671em -.488em 0 -.46em,-.749em -.34em 0 -.477em}38%{box-shadow:0 -.83em 0 -.4em,-.377em -.74em 0 -.42em,-.645em -.522em 0 -.44em,-.775em -.297em 0 -.46em,-.82em -.09em 0 -.477em}100%{box-shadow:0 -.83em 0 -.4em,0 -.83em 0 -.42em,0 -.83em 0 -.44em,0 -.83em 0 -.46em,0 -.83em 0 -.477em}}@-webkit-keyframes loading-trail-2{0%{-webkit-transform:translateX(-50%) translateY(-50%) rotate(0);transform:translateX(-50%) translateY(-50%) rotate(0)}100%{-webkit-transform:translateX(-50%) translateY(-50%) rotate(360deg);transform:translateX(-50%) translateY(-50%) rotate(360deg)}}@keyframes loading-trail-2{0%{-webkit-transform:translateX(-50%) translateY(-50%) rotate(0);transform:translateX(-50%) translateY(-50%) rotate(0)}100%{-webkit-transform:translateX(-50%) translateY(-50%) rotate(360deg);transform:translateX(-50%) translateY(-50%) rotate(360deg)}}.fg-loading-pulse .fg-loader,.fg-loading-pulse .fg-loader:after,.fg-loading-pulse .fg-loader:before{border-radius:50%;width:2.5em;height:2.5em;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation:loading-pulse 1.8s infinite ease-in-out;animation:loading-pulse 1.8s infinite ease-in-out}.fg-loading-pulse .fg-loader{color:#828282;font-size:4px;text-indent:-9999em;transform:translateX(-50%) translateY(-150%);-webkit-animation-delay:-.16s;animation-delay:-.16s}.fg-loading-pulse .fg-loader:after,.fg-loading-pulse .fg-loader:before{content:'';position:absolute;top:0}.fg-loading-pulse .fg-loader:before{left:-3.5em;-webkit-animation-delay:-.32s;animation-delay:-.32s}.fg-loading-pulse .fg-loader:after{left:3.5em}@-webkit-keyframes loading-pulse{0%,100%,80%{box-shadow:0 2.5em 0 -1.3em}40%{box-shadow:0 2.5em 0 0}}@keyframes loading-pulse{0%,100%,80%{box-shadow:0 2.5em 0 -1.3em}40%{box-shadow:0 2.5em 0 0}}.fg-loading-dots .fg-loader{color:#828282;font-size:5px;border-radius:50%;text-indent:-9999em;-webkit-animation:loading-dots 1.3s infinite linear;animation:loading-dots 1.3s infinite linear}@-webkit-keyframes loading-dots{0%,100%{box-shadow:0 -3em 0 .2em,2em -2em 0 0,3em 0 0 -1em,2em 2em 0 -1em,0 3em 0 -1em,-2em 2em 0 -1em,-3em 0 0 -1em,-2em -2em 0 0}12.5%{box-shadow:0 -3em 0 0,2em -2em 0 .2em,3em 0 0 0,2em 2em 0 -1em,0 3em 0 -1em,-2em 2em 0 -1em,-3em 0 0 -1em,-2em -2em 0 -1em}25%{box-shadow:0 -3em 0 -.5em,2em -2em 0 0,3em 0 0 .2em,2em 2em 0 0,0 3em 0 -1em,-2em 2em 0 -1em,-3em 0 0 -1em,-2em -2em 0 -1em}37.5%{box-shadow:0 -3em 0 -1em,2em -2em 0 -1em,3em 0 0 0,2em 2em 0 .2em,0 3em 0 0,-2em 2em 0 -1em,-3em 0 0 -1em,-2em -2em 0 -1em}50%{box-shadow:0 -3em 0 -1em,2em -2em 0 -1em,3em 0 0 -1em,2em 2em 0 0,0 3em 0 .2em,-2em 2em 0 0,-3em 0 0 -1em,-2em -2em 0 -1em}62.5%{box-shadow:0 -3em 0 -1em,2em -2em 0 -1em,3em 0 0 -1em,2em 2em 0 -1em,0 3em 0 0,-2em 2em 0 .2em,-3em 0 0 0,-2em -2em 0 -1em}75%{box-shadow:0 -3em 0 -1em,2em -2em 0 -1em,3em 0 0 -1em,2em 2em 0 -1em,0 3em 0 -1em,-2em 2em 0 0,-3em 0 0 .2em,-2em -2em 0 0}87.5%{box-shadow:0 -3em 0 0,2em -2em 0 -1em,3em 0 0 -1em,2em 2em 0 -1em,0 3em 0 -1em,-2em 2em 0 0,-3em 0 0 0,-2em -2em 0 .2em}}@keyframes loading-dots{0%,100%{box-shadow:0 -3em 0 .2em,2em -2em 0 0,3em 0 0 -1em,2em 2em 0 -1em,0 3em 0 -1em,-2em 2em 0 -1em,-3em 0 0 -1em,-2em -2em 0 0}12.5%{box-shadow:0 -3em 0 0,2em -2em 0 .2em,3em 0 0 0,2em 2em 0 -1em,0 3em 0 -1em,-2em 2em 0 -1em,-3em 0 0 -1em,-2em -2em 0 -1em}25%{box-shadow:0 -3em 0 -.5em,2em -2em 0 0,3em 0 0 .2em,2em 2em 0 0,0 3em 0 -1em,-2em 2em 0 -1em,-3em 0 0 -1em,-2em -2em 0 -1em}37.5%{box-shadow:0 -3em 0 -1em,2em -2em 0 -1em,3em 0 0 0,2em 2em 0 .2em,0 3em 0 0,-2em 2em 0 -1em,-3em 0 0 -1em,-2em -2em 0 -1em}50%{box-shadow:0 -3em 0 -1em,2em -2em 0 -1em,3em 0 0 -1em,2em 2em 0 0,0 3em 0 .2em,-2em 2em 0 0,-3em 0 0 -1em,-2em -2em 0 -1em}62.5%{box-shadow:0 -3em 0 -1em,2em -2em 0 -1em,3em 0 0 -1em,2em 2em 0 -1em,0 3em 0 0,-2em 2em 0 .2em,-3em 0 0 0,-2em -2em 0 -1em}75%{box-shadow:0 -3em 0 -1em,2em -2em 0 -1em,3em 0 0 -1em,2em 2em 0 -1em,0 3em 0 -1em,-2em 2em 0 0,-3em 0 0 .2em,-2em -2em 0 0}87.5%{box-shadow:0 -3em 0 0,2em -2em 0 -1em,3em 0 0 -1em,2em 2em 0 -1em,0 3em 0 -1em,-2em 2em 0 0,-3em 0 0 0,-2em -2em 0 .2em}}.fg-loading-partial .fg-loader,.fg-loading-partial .fg-loader:after{border-radius:50%;width:10em;height:10em}.fg-loading-partial .fg-loader{font-size:4px;text-indent:-9999em;border-top:1.1em solid rgba(130,130,130,.2);border-right:1.1em solid rgba(130,130,130,.2);border-bottom:1.1em solid rgba(130,130,130,.2);border-left:1.1em solid #828282;-webkit-animation:loading-partial 1.1s infinite linear;animation:loading-partial 1.1s infinite linear}@-webkit-keyframes loading-partial{0%{-webkit-transform:translateX(-50%) translateY(-50%) rotate(0);transform:translateX(-50%) translateY(-50%) rotate(0)}100%{-webkit-transform:translateX(-50%) translateY(-50%) rotate(360deg);transform:translateX(-50%) translateY(-50%) rotate(360deg)}}@keyframes loading-partial{0%{-webkit-transform:translateX(-50%) translateY(-50%) rotate(0);transform:translateX(-50%) translateY(-50%) rotate(0)}100%{-webkit-transform:translateX(-50%) translateY(-50%) rotate(360deg);transform:translateX(-50%) translateY(-50%) rotate(360deg)}}.foogallery.fg-loaded-drop .fg-item,.foogallery.fg-loaded-fade-in .fg-item,.foogallery.fg-loaded-flip .fg-item,.foogallery.fg-loaded-fly .fg-item,.foogallery.fg-loaded-scale-up .fg-item,.foogallery.fg-loaded-slide-down .fg-item,.foogallery.fg-loaded-slide-left .fg-item,.foogallery.fg-loaded-slide-right .fg-item,.foogallery.fg-loaded-slide-up .fg-item,.foogallery.fg-loaded-swing-down .fg-item{transition-timing-function:ease;transition-duration:650ms;transition-property:background-color,transform}.foogallery.fg-loaded-drop .fg-item-inner,.foogallery.fg-loaded-fade-in .fg-item-inner,.foogallery.fg-loaded-flip .fg-item-inner,.foogallery.fg-loaded-fly .fg-item-inner,.foogallery.fg-loaded-scale-up .fg-item-inner,.foogallery.fg-loaded-slide-down .fg-item-inner,.foogallery.fg-loaded-slide-left .fg-item-inner,.foogallery.fg-loaded-slide-right .fg-item-inner,.foogallery.fg-loaded-slide-up .fg-item-inner,.foogallery.fg-loaded-swing-down .fg-item-inner{transition-timing-function:ease;transition-duration:650ms}.foogallery.fg-loaded-drop .fg-item.fg-loaded,.foogallery.fg-loaded-flip .fg-item.fg-loaded,.foogallery.fg-loaded-fly .fg-item.fg-loaded,.foogallery.fg-loaded-swing-down .fg-item.fg-loaded{perspective:1300px}.foogallery.fg-loaded-fade-in .fg-item-inner{transition-property:visibility,opacity}.foogallery .fg-caption{visibility:hidden;opacity:0;background-color:rgba(0,0,0,.6);color:#fff;position:absolute;z-index:8;width:100%;max-height:100%;overflow:hidden;font-family:-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-size:13px;font-weight:400;line-height:1.3;border:none;text-align:center;cursor:pointer}.foogallery .fg-caption a{text-decoration:none;color:#fff;border-bottom:1px solid #fff}.foogallery .fg-caption a:hover{border-bottom:none}.foogallery .fg-caption-title{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:16px;font-weight:400;padding:5px}.foogallery .fg-caption-desc{padding:5px}.foogallery .fg-caption-title+.fg-caption-desc{padding-top:0}.foogallery.fg-caption-always .fg-caption .fg-caption-inner:before{display:none}.foogallery.fg-caption-always .fg-item.fg-loaded .fg-caption{left:0;bottom:0;transition-timing-function:ease;transition-duration:.3s;transition-property:visibility,opacity;visibility:visible;opacity:1;text-align:left}.foogallery.fg-caption-hover .fg-caption .fg-caption-inner{width:100%;max-height:100%;position:absolute;top:50%;left:0;transform:translateY(-50%)}.foogallery.fg-caption-hover .fg-item.fg-loaded .fg-thumb:before{display:none}.foogallery.fg-hover-circle-plus .fg-thumb:before,.foogallery.fg-hover-external .fg-thumb:before,.foogallery.fg-hover-eye .fg-thumb:before,.foogallery.fg-hover-plus .fg-thumb:before,.foogallery.fg-hover-tint .fg-thumb:before,.foogallery.fg-hover-zoom .fg-thumb:before,.foogallery.fg-hover-zoom2 .fg-thumb:before,.foogallery.fg-hover-zoom3 .fg-thumb:before{content:"";display:block;position:absolute;visibility:hidden;opacity:0;top:0;bottom:0;left:0;right:0;z-index:8;background:rgba(0,0,0,.5) no-repeat center center;background-size:32px 32px}.foogallery.fg-hover-circle-plus .fg-item-inner:hover .fg-thumb:before,.foogallery.fg-hover-circle-plus .fg-thumb:focus:before,.foogallery.fg-hover-external .fg-item-inner:hover .fg-thumb:before,.foogallery.fg-hover-external .fg-thumb:focus:before,.foogallery.fg-hover-eye .fg-item-inner:hover .fg-thumb:before,.foogallery.fg-hover-eye .fg-thumb:focus:before,.foogallery.fg-hover-plus .fg-item-inner:hover .fg-thumb:before,.foogallery.fg-hover-plus .fg-thumb:focus:before,.foogallery.fg-hover-tint .fg-item-inner:hover .fg-thumb:before,.foogallery.fg-hover-tint .fg-thumb:focus:before,.foogallery.fg-hover-zoom .fg-item-inner:hover .fg-thumb:before,.foogallery.fg-hover-zoom .fg-thumb:focus:before,.foogallery.fg-hover-zoom2 .fg-item-inner:hover .fg-thumb:before,.foogallery.fg-hover-zoom2 .fg-thumb:focus:before,.foogallery.fg-hover-zoom3 .fg-item-inner:hover .fg-thumb:before,.foogallery.fg-hover-zoom3 .fg-thumb:focus:before{visibility:visible;opacity:1}.foogallery.fg-hover-circle-plus .fg-caption-inner:before,.foogallery.fg-hover-external .fg-caption-inner:before,.foogallery.fg-hover-eye .fg-caption-inner:before,.foogallery.fg-hover-plus .fg-caption-inner:before,.foogallery.fg-hover-tint .fg-caption-inner:before,.foogallery.fg-hover-zoom .fg-caption-inner:before,.foogallery.fg-hover-zoom2 .fg-caption-inner:before,.foogallery.fg-hover-zoom3 .fg-caption-inner:before{content:"";display:inline-block;position:relative;width:32px;height:32px;margin:10px 0 5px 0;background:transparent no-repeat center center;background-size:32px 32px;vertical-align:middle}.foogallery.fg-hover-zoom .fg-caption-inner:before,.foogallery.fg-hover-zoom .fg-thumb:before{background-image:url(../img/zoom.png)}.foogallery.fg-hover-zoom2 .fg-caption-inner:before,.foogallery.fg-hover-zoom2 .fg-thumb:before{background-image:url(../img/zoom2.png)}.foogallery.fg-hover-zoom3 .fg-caption-inner:before,.foogallery.fg-hover-zoom3 .fg-thumb:before{background-image:url(../img/zoom3.png)}.foogallery.fg-hover-plus .fg-caption-inner:before,.foogallery.fg-hover-plus .fg-thumb:before{background-image:url(../img/plus.png)}.foogallery.fg-hover-circle-plus .fg-caption-inner:before,.foogallery.fg-hover-circle-plus .fg-thumb:before{background-image:url(../img/circle-plus.png)}.foogallery.fg-hover-eye .fg-caption-inner:before,.foogallery.fg-hover-eye .fg-thumb:before{background-image:url(../img/eye.png)}.foogallery.fg-hover-external .fg-caption-inner:before,.foogallery.fg-hover-external .fg-thumb:before{background-image:url(../img/external.png)}@media only screen and (-o-min-device-pixel-ratio:5/4),only screen and (-webkit-min-device-pixel-ratio:1.25),only screen and (min-device-pixel-ratio:1.25),only screen and (min-resolution:1.25dppx){.foogallery.fg-hover-zoom .fg-caption-inner:before,.foogallery.fg-hover-zoom .fg-thumb:before{background-image:url(../img/zoom@2x.png)}.foogallery.fg-hover-zoom2 .fg-caption-inner:before,.foogallery.fg-hover-zoom2 .fg-thumb:before{background-image:url(../img/zoom2@2x.png)}.foogallery.fg-hover-zoom3 .fg-caption-inner:before,.foogallery.fg-hover-zoom3 .fg-thumb:before{background-image:url(../img/zoom3@2x.png)}.foogallery.fg-hover-plus .fg-caption-inner:before,.foogallery.fg-hover-plus .fg-thumb:before{background-image:url(../img/plus@2x.png)}.foogallery.fg-hover-circle-plus .fg-caption-inner:before,.foogallery.fg-hover-circle-plus .fg-thumb:before{background-image:url(../img/circle-plus@2x.png)}.foogallery.fg-hover-eye .fg-caption-inner:before,.foogallery.fg-hover-eye .fg-thumb:before{background-image:url(../img/eye@2x.png)}.foogallery.fg-hover-external .fg-caption-inner:before,.foogallery.fg-hover-external .fg-thumb:before{background-image:url(../img/external@2x.png)}}@media only screen and (-o-min-device-pixel-ratio:9/4),only screen and (-webkit-min-device-pixel-ratio:2.25),only screen and (min-device-pixel-ratio:2.25),only screen and (min-resolution:2.25dppx){.foogallery.fg-hover-zoom .fg-caption-inner:before,.foogallery.fg-hover-zoom .fg-thumb:before{background-image:url(../img/zoom@3x.png)}.foogallery.fg-hover-zoom2 .fg-caption-inner:before,.foogallery.fg-hover-zoom2 .fg-thumb:before{background-image:url(../img/zoom2@3x.png)}.foogallery.fg-hover-zoom3 .fg-caption-inner:before,.foogallery.fg-hover-zoom3 .fg-thumb:before{background-image:url(../img/zoom3@3x.png)}.foogallery.fg-hover-plus .fg-caption-inner:before,.foogallery.fg-hover-plus .fg-thumb:before{background-image:url(../img/plus@3x.png)}.foogallery.fg-hover-circle-plus .fg-caption-inner:before,.foogallery.fg-hover-circle-plus .fg-thumb:before{background-image:url(../img/circle-plus@3x.png)}.foogallery.fg-hover-eye .fg-caption-inner:before,.foogallery.fg-hover-eye .fg-thumb:before{background-image:url(../img/eye@3x.png)}.foogallery.fg-hover-external .fg-caption-inner:before,.foogallery.fg-hover-external .fg-thumb:before{background-image:url(../img/external@3x.png)}}.foogallery.fg-caption-hover.fg-hover-colorize .fg-caption,.foogallery.fg-caption-hover.fg-hover-fade .fg-caption,.foogallery.fg-caption-hover.fg-hover-grayscale .fg-caption,.foogallery.fg-caption-hover.fg-hover-instant .fg-caption,.foogallery.fg-caption-hover.fg-hover-push .fg-caption,.foogallery.fg-caption-hover.fg-hover-scale .fg-caption,.foogallery.fg-caption-hover.fg-hover-slide-down .fg-caption,.foogallery.fg-caption-hover.fg-hover-slide-left .fg-caption,.foogallery.fg-caption-hover.fg-hover-slide-right .fg-caption,.foogallery.fg-caption-hover.fg-hover-slide-up .fg-caption,.foogallery.fg-hover-colorize .fg-image,.foogallery.fg-hover-colorize .fg-thumb:before,.foogallery.fg-hover-fade .fg-thumb:before,.foogallery.fg-hover-grayscale .fg-image,.foogallery.fg-hover-grayscale .fg-thumb:before,.foogallery.fg-hover-instant .fg-thumb:before,.foogallery.fg-hover-push .fg-thumb,.foogallery.fg-hover-scale .fg-item,.foogallery.fg-hover-scale .fg-thumb:before,.foogallery.fg-hover-slide-down .fg-thumb:before,.foogallery.fg-hover-slide-left .fg-thumb:before,.foogallery.fg-hover-slide-right .fg-thumb:before,.foogallery.fg-hover-slide-up .fg-thumb:before{transition-timing-function:ease;transition-duration:.3s}.foogallery.fg-hover-colorize .fg-image{filter:url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'saturate\' values=\'0\'/></filter></svg>#grayscale");filter:gray;-webkit-filter:grayscale(100%);-webkit-transition-property:-webkit-filter;transition-property:filter}.foogallery.fg-hover-colorize .fg-item-inner:hover .fg-image{-webkit-filter:none;filter:none}.foogallery.fg-caption-hover.fg-hover-colorize .fg-caption,.foogallery.fg-hover-colorize .fg-thumb:before{display:block;left:0;top:0;bottom:0;transition-property:visibility,opacity}.foogallery.fg-caption-hover.fg-hover-colorize .fg-item-inner:hover .fg-caption,.foogallery.fg-hover-colorize .fg-item-inner:hover .fg-thumb:before{visibility:visible;opacity:1}.foogallery.fg-caption-hover.fg-hover-fade .fg-loaded .fg-caption,.foogallery.fg-hover-fade .fg-loaded .fg-thumb:before{display:block;left:0;top:0;bottom:0;transition-property:visibility,opacity}.foogallery.fg-caption-hover.fg-hover-fade .fg-loaded .fg-item-inner:hover .fg-caption,.foogallery.fg-hover-fade .fg-loaded .fg-item-inner:hover .fg-thumb:before{visibility:visible;opacity:1}.foogallery.fg-hover-grayscale .fg-image{-webkit-filter:none;filter:none;-webkit-transition-property:-webkit-filter;transition-property:filter}.foogallery.fg-hover-grayscale .fg-item-inner:hover .fg-image{-webkit-filter:grayscale(1);-webkit-filter:grayscale(100%);filter:grayscale(100%);filter:gray;opacity:1}.foogallery.fg-caption-hover.fg-hover-grayscale .fg-caption,.foogallery.fg-hover-grayscale .fg-thumb:before{display:block;left:0;top:0;bottom:0;transition-property:visibility,opacity}.foogallery.fg-caption-hover.fg-hover-grayscale .fg-item-inner:hover .fg-caption,.foogallery.fg-hover-grayscale .fg-item-inner:hover .fg-thumb:before{visibility:visible;opacity:1}.foogallery.fg-caption-hover.fg-hover-instant .fg-loaded .fg-caption,.foogallery.fg-hover-instant .fg-loaded .fg-thumb:before{display:block;left:0;top:0;bottom:0;transition-property:none}.foogallery.fg-caption-hover.fg-hover-instant .fg-loaded .fg-item-inner:hover .fg-caption,.foogallery.fg-hover-instant .fg-loaded .fg-item-inner:hover .fg-thumb:before{visibility:visible;opacity:1}.foogallery.fg-caption-hover.fg-hover-push .fg-loaded .fg-caption,.foogallery.fg-hover-push .fg-loaded .fg-thumb:before{display:block;left:0;top:0;bottom:0;transform:translateX(100%);visibility:visible;opacity:1}.foogallery.fg-caption-hover.fg-hover-push .fg-loaded .fg-caption,.foogallery.fg-hover-push .fg-loaded .fg-thumb{transition-property:transform}.foogallery.fg-caption-hover.fg-hover-push .fg-loaded .fg-item-inner:hover .fg-caption{transform:translateY(0)}.foogallery.fg-caption-hover.fg-hover-push .fg-loaded .fg-item-inner:hover .fg-thumb,.foogallery.fg-hover-push .fg-loaded .fg-item-inner:hover .fg-thumb{transform:translateX(-100%)}.foogallery.fg-hover-scale .fg-item{transition-property:transform;z-index:4}.foogallery.fg-hover-scale .fg-item:hover{transform:scale(1.048);z-index:10}.foogallery.fg-caption-hover.fg-hover-scale .fg-caption,.foogallery.fg-hover-scale .fg-thumb:before{display:block;left:0;top:0;bottom:0;transition-property:visibility,opacity}.foogallery.fg-caption-hover.fg-hover-scale .fg-item-inner:hover .fg-caption,.foogallery.fg-hover-scale .fg-item-inner:hover .fg-thumb:before{visibility:visible;opacity:1}.foogallery.fg-caption-hover.fg-hover-slide-down .fg-loaded .fg-caption,.foogallery.fg-caption-hover.fg-hover-slide-left .fg-loaded .fg-caption,.foogallery.fg-caption-hover.fg-hover-slide-right .fg-loaded .fg-caption,.foogallery.fg-caption-hover.fg-hover-slide-up .fg-loaded .fg-caption,.foogallery.fg-hover-slide-down .fg-loaded .fg-thumb:before,.foogallery.fg-hover-slide-left .fg-loaded .fg-thumb:before,.foogallery.fg-hover-slide-right .fg-loaded .fg-thumb:before,.foogallery.fg-hover-slide-up .fg-loaded .fg-thumb:before{display:block;left:0;top:0;bottom:0;transition-property:transform;visibility:visible;opacity:1}.foogallery.fg-caption-hover.fg-hover-slide-down .fg-loaded .fg-item-inner:hover .fg-caption,.foogallery.fg-caption-hover.fg-hover-slide-left .fg-loaded .fg-item-inner:hover .fg-caption,.foogallery.fg-caption-hover.fg-hover-slide-right .fg-loaded .fg-item-inner:hover .fg-caption,.foogallery.fg-caption-hover.fg-hover-slide-up .fg-loaded .fg-item-inner:hover .fg-caption,.foogallery.fg-hover-slide-down .fg-loaded .fg-item-inner:hover .fg-thumb:before,.foogallery.fg-hover-slide-left .fg-loaded .fg-item-inner:hover .fg-thumb:before,.foogallery.fg-hover-slide-right .fg-loaded .fg-item-inner:hover .fg-thumb:before,.foogallery.fg-hover-slide-up .fg-loaded .fg-item-inner:hover .fg-thumb:before{transform:translateY(0) translateX(0)}.foogallery.fg-caption-hover.fg-hover-slide-up .fg-loaded .fg-caption,.foogallery.fg-hover-slide-up .fg-loaded .fg-thumb:before{transform:translateY(100%)}.foogallery.fg-caption-hover.fg-hover-slide-down .fg-loaded .fg-caption,.foogallery.fg-hover-slide-down .fg-loaded .fg-thumb:before{transform:translateY(-100%)}.foogallery.fg-caption-hover.fg-hover-slide-left .fg-loaded .fg-caption,.foogallery.fg-hover-slide-left .fg-loaded .fg-thumb:before{transform:translateX(100%)}.foogallery.fg-caption-hover.fg-hover-slide-right .fg-loaded .fg-caption,.foogallery.fg-hover-slide-right .fg-loaded .fg-thumb:before{transform:translateX(-100%)}.fg-paging-container,.fg-paging-container *,.fg-paging-container :after,.fg-paging-container :before{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.fg-paging-container{display:block;padding:15px;text-align:center;font-family:-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.fg-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.fg-paging-container .fg-dot-item,.fg-paging-container .fg-dots{display:inline-block;margin:0;padding:0;outline:0;list-style:none}.fg-paging-container .fg-dot-item .fg-dot-link{display:inline-block;margin:3px;font-weight:400;line-height:1.42857143;text-align:center;white-space:nowrap;vertical-align:middle;cursor:pointer;user-select:none;background-image:none;text-decoration:none;border:1px solid transparent;position:relative;border-radius:50%;padding:0;font-size:0;outline:0;color:transparent;box-shadow:none}.fg-paging-container .fg-dot-item .fg-dot-link:before{content:"";background-color:transparent;border:1px solid transparent;display:block;border-radius:50%;width:9px;height:9px;padding:0;margin:2px}.fg-paging-container .fg-dot-item .fg-dot-link:active,.fg-paging-container .fg-dot-item .fg-dot-link:focus,.fg-paging-container .fg-dot-item .fg-dot-link:hover{text-decoration:none;box-shadow:none;outline:0}.fg-paging-container .fg-dot-item.fg-disabled .fg-dot-link,.fg-paging-container .fg-dot-item.fg-selected .fg-dot-link{cursor:not-allowed;pointer-events:none}.fg-paging-container .fg-dot-item.fg-disabled .fg-dot-link{cursor:not-allowed;pointer-events:none;outline:0}.fg-paging-container.fg-light .fg-dot-item .fg-dot-link,.fg-paging-container.fg-light .fg-dot-item .fg-dot-link:before{transition-timing-function:ease-out;transition-duration:.3s;transition-property:color,border-color,background-color}.fg-paging-container.fg-light .fg-dot-item .fg-dot-link{background-color:#eee;border-color:#9e9e9e}.fg-paging-container.fg-light .fg-dot-item.fg-selected .fg-dot-link{border-color:#8a8a8a}.fg-paging-container.fg-light .fg-dot-item .fg-dot-link:focus:before,.fg-paging-container.fg-light .fg-dot-item .fg-dot-link:hover:before,.fg-paging-container.fg-light .fg-dot-item.fg-selected .fg-dot-link:before{background-color:#666;border-color:#8a8a8a}.fg-paging-container.fg-light .fg-dot-item.fg-disabled .fg-dot-link,.fg-paging-container.fg-light .fg-dot-item.fg-disabled .fg-dot-link:focus,.fg-paging-container.fg-light .fg-dot-item.fg-disabled .fg-dot-link:hover{background-color:#eee;border-color:#9e9e9e;opacity:.5}.fg-paging-container.fg-dark .fg-dot-item .fg-dot-link,.fg-paging-container.fg-dark .fg-dot-item .fg-dot-link:before{transition-timing-function:ease-out;transition-duration:.3s;transition-property:color,border-color,background-color}.fg-paging-container.fg-dark .fg-dot-item .fg-dot-link{background-color:#666;border-color:#333}.fg-paging-container.fg-dark .fg-dot-item.fg-selected .fg-dot-link{border-color:#444}.fg-paging-container.fg-dark .fg-dot-item .fg-dot-link:focus:before,.fg-paging-container.fg-dark .fg-dot-item .fg-dot-link:hover:before,.fg-paging-container.fg-dark .fg-dot-item.fg-selected .fg-dot-link:before{background-color:#333;border-color:#444}.fg-paging-container.fg-dark .fg-dot-item.fg-disabled .fg-dot-link,.fg-paging-container.fg-dark .fg-dot-item.fg-disabled .fg-dot-link:focus,.fg-paging-container.fg-dark .fg-dot-item.fg-disabled .fg-dot-link:hover{background-color:#666;border-color:#333;opacity:.5}.fg-default:after{content:'';display:block;clear:both}.fg-default .fg-item,.fg-default .fg-item-inner,.fg-default .fg-thumb{display:inline-block;vertical-align:top;max-width:100%}.fg-default .fg-image{border-radius:0;display:block;max-width:100%;height:auto;margin:0;padding:0}.fg-default .fg-image{vertical-align:top}.fg-default.fg-left{text-align:left}.fg-default.fg-center{text-align:center}.fg-default.fg-right{text-align:right}.fg-default.fg-gutter-5{padding-left:5px;margin-bottom:-5px}.fg-default.fg-gutter-5 .fg-item{margin-right:5px;margin-bottom:5px}.fg-default.fg-gutter-10{padding-left:10px;margin-bottom:-10px}.fg-default.fg-gutter-10 .fg-item{margin-right:10px;margin-bottom:10px}.fg-default.fg-gutter-15{padding-left:15px;margin-bottom:-15px}.fg-default.fg-gutter-15 .fg-item{margin-right:15px;margin-bottom:15px}.fg-default.fg-gutter-20{padding-left:20px;margin-bottom:-20px}.fg-default.fg-gutter-20 .fg-item{margin-right:20px;margin-bottom:20px}.fg-default.fg-gutter-25{padding-left:25px;margin-bottom:-25px}.fg-default.fg-gutter-25 .fg-item{margin-right:25px;margin-bottom:25px}.fg-masonry *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.foogallery.fg-masonry.fg-center{margin:0 auto}.fg-masonry .fg-thumb{display:block}.fg-masonry.fg-masonry-fixed .fg-thumb{display:inline-block}.fg-masonry .fg-column-width{display:inline-block;visibility:hidden;height:0;border:solid 0 transparent}.fg-masonry.fg-masonry-fixed .fg-column-width{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.fg-masonry.fg-masonry-2col .fg-image,.fg-masonry.fg-masonry-3col .fg-image,.fg-masonry.fg-masonry-4col .fg-image,.fg-masonry.fg-masonry-5col .fg-image{width:100%;height:auto;max-width:100%}.fg-masonry .fg-item{line-height:0;font-size:0}.fg-masonry.fg-masonry-2col .fg-item{margin-bottom:1%;width:49%}.fg-masonry.fg-masonry-2col .fg-column-width{width:49%}.fg-masonry.fg-masonry-2col .fg-gutter-width{width:1%}.fg-masonry.fg-masonry-2col.fg-gutter-none .fg-item{margin-bottom:0;width:50%}.fg-masonry.fg-masonry-2col.fg-gutter-none .fg-column-width{width:50%}.fg-masonry.fg-masonry-2col.fg-gutter-none .fg-gutter-width{width:0}.fg-masonry.fg-masonry-2col.fg-gutter-large .fg-item{margin-bottom:3%;width:47%}.fg-masonry.fg-masonry-2col.fg-gutter-large .fg-column-width{width:47%}.fg-masonry.fg-masonry-2col.fg-gutter-large .fg-gutter-width{width:3%}.fg-masonry.fg-masonry-3col .fg-item{margin-bottom:1%;width:32%}.fg-masonry.fg-masonry-3col .fg-column-width{width:32%}.fg-masonry.fg-masonry-3col .fg-gutter-width{width:1%}.fg-masonry.fg-masonry-3col.fg-gutter-none .fg-item{margin-bottom:0;width:33%}.fg-masonry.fg-masonry-3col.fg-gutter-none .fg-column-width{width:33%}.fg-masonry.fg-masonry-3col.fg-gutter-none .fg-gutter-width{width:0}.fg-masonry.fg-masonry-3col.fg-gutter-large .fg-item{margin-bottom:3%;width:30%}.fg-masonry.fg-masonry-3col.fg-gutter-large .fg-column-width{width:30%}.fg-masonry.fg-masonry-3col.fg-gutter-large .fg-gutter-width{width:3%}.fg-masonry.fg-masonry-4col .fg-item{margin-bottom:1%;width:24%}.fg-masonry.fg-masonry-4col .fg-column-width{width:24%}.fg-masonry.fg-masonry-4col .fg-gutter-width{width:1%}.fg-masonry.fg-masonry-4col.fg-gutter-none .fg-item{margin-bottom:0;width:25%}.fg-masonry.fg-masonry-4col.fg-gutter-none .fg-column-width{width:25%}.fg-masonry.fg-masonry-4col.fg-gutter-none .fg-gutter-width{width:0}.fg-masonry.fg-masonry-4col.fg-gutter-large .fg-item{margin-bottom:3%;width:22%}.fg-masonry.fg-masonry-4col.fg-gutter-large .fg-column-width{width:22%}.fg-masonry.fg-masonry-4col.fg-gutter-large .fg-gutter-width{width:3%}.fg-masonry.fg-masonry-5col .fg-item{margin-bottom:1%;width:19%}.fg-masonry.fg-masonry-5col .fg-column-width{width:19%}.fg-masonry.fg-masonry-5col .fg-gutter-width{width:1%}.fg-masonry.fg-masonry-5col.fg-gutter-none .fg-item{margin-bottom:0;width:20%}.fg-masonry.fg-masonry-5col.fg-gutter-none .fg-column-width{width:20%}.fg-masonry.fg-masonry-5col.fg-gutter-none .fg-gutter-width{width:0}.fg-masonry.fg-masonry-5col.fg-gutter-large .fg-item{margin-bottom:3%;width:17%}.fg-masonry.fg-masonry-5col.fg-gutter-large .fg-column-width{width:17%}.fg-masonry.fg-masonry-5col.fg-gutter-large .fg-gutter-width{width:3%}@media screen and (max-width:720px){.fg-masonry.fg-masonry-4col .fg-item,.fg-masonry.fg-masonry-5col .fg-item{margin-bottom:1%;width:32%}.fg-masonry.fg-masonry-4col .fg-column-width,.fg-masonry.fg-masonry-5col .fg-column-width{width:32%}.fg-masonry.fg-masonry-4col .fg-gutter-width,.fg-masonry.fg-masonry-5col .fg-gutter-width{width:1%}.fg-masonry.fg-masonry-4col.fg-gutter-none .fg-item,.fg-masonry.fg-masonry-5col.fg-gutter-none .fg-item{margin-bottom:0;width:33%}.fg-masonry.fg-masonry-4col.fg-gutter-none .fg-column-width,.fg-masonry.fg-masonry-5col.fg-gutter-none .fg-column-width{width:33%}.fg-masonry.fg-masonry-4col.fg-gutter-none .fg-gutter-width,.fg-masonry.fg-masonry-5col.fg-gutter-none .fg-gutter-width{width:0}.fg-masonry.fg-masonry-4col.fg-gutter-large .fg-item,.fg-masonry.fg-masonry-5col.fg-gutter-large .fg-item{margin-bottom:3%;width:30%}.fg-masonry.fg-masonry-4col.fg-gutter-large .fg-column-width,.fg-masonry.fg-masonry-5col.fg-gutter-large .fg-column-width{width:30%}.fg-masonry.fg-masonry-4col.fg-gutter-large .fg-gutter-width,.fg-masonry.fg-masonry-5col.fg-gutter-large .fg-gutter-width{width:3%}}@media screen and (max-width:480px){.fg-masonry.fg-masonry-3col .fg-item,.fg-masonry.fg-masonry-4col .fg-item,.fg-masonry.fg-masonry-5col .fg-item{margin-bottom:1%;width:49%}.fg-masonry.fg-masonry-3col .fg-column-width,.fg-masonry.fg-masonry-4col .fg-column-width,.fg-masonry.fg-masonry-5col .fg-column-width{width:49%}.fg-masonry.fg-masonry-3col .fg-gutter-width,.fg-masonry.fg-masonry-4col .fg-gutter-width,.fg-masonry.fg-masonry-5col .fg-gutter-width{width:1%}.fg-masonry.fg-masonry-3col.fg-gutter-none .fg-item,.fg-masonry.fg-masonry-4col.fg-gutter-none .fg-item,.fg-masonry.fg-masonry-5col.fg-gutter-none .fg-item{margin-bottom:0;width:50%}.fg-masonry.fg-masonry-3col.fg-gutter-none .fg-column-width,.fg-masonry.fg-masonry-4col.fg-gutter-none .fg-column-width,.fg-masonry.fg-masonry-5col.fg-gutter-none .fg-column-width{width:50%}.fg-masonry.fg-masonry-3col.fg-gutter-none .fg-gutter-width,.fg-masonry.fg-masonry-4col.fg-gutter-none .fg-gutter-width,.fg-masonry.fg-masonry-5col.fg-gutter-none .fg-gutter-width{width:0}.fg-masonry.fg-masonry-3col.fg-gutter-large .fg-item,.fg-masonry.fg-masonry-4col.fg-gutter-large .fg-item,.fg-masonry.fg-masonry-5col.fg-gutter-large .fg-item{margin-bottom:3%;width:47%}.fg-masonry.fg-masonry-3col.fg-gutter-large .fg-column-width,.fg-masonry.fg-masonry-4col.fg-gutter-large .fg-column-width,.fg-masonry.fg-masonry-5col.fg-gutter-large .fg-column-width{width:47%}.fg-masonry.fg-masonry-3col.fg-gutter-large .fg-gutter-width,.fg-masonry.fg-masonry-4col.fg-gutter-large .fg-gutter-width,.fg-masonry.fg-masonry-5col.fg-gutter-large .fg-gutter-width{width:3%}}@media screen and (max-width:320px){.fg-masonry.fg-masonry-2col .fg-item,.fg-masonry.fg-masonry-3col .fg-item,.fg-masonry.fg-masonry-4col .fg-item,.fg-masonry.fg-masonry-5col .fg-item{margin-bottom:1%;width:100%}.fg-masonry.fg-masonry-2col .fg-column-width,.fg-masonry.fg-masonry-3col .fg-column-width,.fg-masonry.fg-masonry-4col .fg-column-width,.fg-masonry.fg-masonry-5col .fg-column-width{width:100%}.fg-masonry.fg-masonry-2col .fg-gutter-width,.fg-masonry.fg-masonry-3col .fg-gutter-width,.fg-masonry.fg-masonry-4col .fg-gutter-width,.fg-masonry.fg-masonry-5col .fg-gutter-width{width:0}.fg-masonry.fg-masonry-2col.fg-gutter-none .fg-item,.fg-masonry.fg-masonry-3col.fg-gutter-none .fg-item,.fg-masonry.fg-masonry-4col.fg-gutter-none .fg-item,.fg-masonry.fg-masonry-5col.fg-gutter-none .fg-item{margin-bottom:0;width:100%}.fg-masonry.fg-masonry-2col.fg-gutter-none .fg-column-width,.fg-masonry.fg-masonry-3col.fg-gutter-none .fg-column-width,.fg-masonry.fg-masonry-4col.fg-gutter-none .fg-column-width,.fg-masonry.fg-masonry-5col.fg-gutter-none .fg-column-width{width:100%}.fg-masonry.fg-masonry-2col.fg-gutter-none .fg-gutter-width,.fg-masonry.fg-masonry-3col.fg-gutter-none .fg-gutter-width,.fg-masonry.fg-masonry-4col.fg-gutter-none .fg-gutter-width,.fg-masonry.fg-masonry-5col.fg-gutter-none .fg-gutter-width{width:0}.fg-masonry.fg-masonry-2col.fg-gutter-large .fg-item,.fg-masonry.fg-masonry-3col.fg-gutter-large .fg-item,.fg-masonry.fg-masonry-4col.fg-gutter-large .fg-item,.fg-masonry.fg-masonry-5col.fg-gutter-large .fg-item{margin-bottom:3%;width:100%}.fg-masonry.fg-masonry-2col.fg-gutter-large .fg-column-width,.fg-masonry.fg-masonry-3col.fg-gutter-large .fg-column-width,.fg-masonry.fg-masonry-4col.fg-gutter-large .fg-column-width,.fg-masonry.fg-masonry-5col.fg-gutter-large .fg-column-width{width:100%}.fg-masonry.fg-masonry-2col.fg-gutter-large .fg-gutter-width,.fg-masonry.fg-masonry-3col.fg-gutter-large .fg-gutter-width,.fg-masonry.fg-masonry-4col.fg-gutter-large .fg-gutter-width,.fg-masonry.fg-masonry-5col.fg-gutter-large .fg-gutter-width{width:0}}.foogallery.fg-border-thin .fg-column-width{border-width:5px}.foogallery.fg-border-medium .fg-column-width{border-width:10px}.foogallery.fg-border-thick .fg-column-width{border-width:15px}.fg-justified{box-sizing:border-box;position:relative}.foogallery.fg-justified .fg-image,.foogallery.fg-justified .fg-item,.foogallery.fg-justified .fg-item-inner,.foogallery.fg-justified .fg-thumb{box-sizing:border-box;display:block;margin:0;padding:0}.fg-justified .fg-item{visibility:visible;position:absolute}.fg-justified .fg-item-inner{position:relative;width:100%;height:100%}.fg-justified .fg-thumb{position:relative;overflow:hidden}.fg-justified .fg-image{z-index:1}.fg-justified .fg-item.fg-positioned .fg-thumb{width:100%;height:100%}.fg-justified .fg-item.fg-positioned .fg-image{width:100%;height:auto;min-height:100%}.fg-simple_portfolio{box-sizing:border-box;position:relative;font-size:16px;margin:0 auto;padding:0;width:100%}.fg-simple_portfolio .fg-item{position:absolute;display:inline-block;margin:0;padding:0;outline:0}.fg-simple_portfolio .fg-image,.fg-simple_portfolio .fg-item-inner,.fg-simple_portfolio .fg-thumb{display:block;margin:0;padding:0;outline:0}.fg-simple_portfolio .fg-item-inner{position:relative;width:100%;height:100%}.fg-simple_portfolio .fg-thumb{box-sizing:border-box;display:block;margin:0;padding:0;border:none;outline:0;position:relative;overflow:hidden}.fg-simple_portfolio .fg-item.fg-positioned .fg-image{width:100%;height:auto}.fg-simple_portfolio .fg-image{z-index:1}.foogallery.fg-simple_portfolio .fg-item-inner .fg-caption{visibility:visible;opacity:1;font-size:13px;position:relative;display:block;top:auto;bottom:auto;left:auto;right:auto;width:auto;height:auto;text-transform:none;transform:none;transition:none;background-color:transparent;border-style:solid;border-color:transparent}.foogallery.fg-simple_portfolio .fg-item-inner:hover .fg-caption{transform:none;transition:none}.foogallery.fg-simple_portfolio .fg-item-inner .fg-caption-inner{display:block;top:auto;bottom:auto;left:auto;right:auto;width:auto;height:auto;border:none;transform:none;transition:none}.foogallery.fg-simple_portfolio .fg-item-inner .fg-caption-inner:before{display:none}.foogallery.fg-simple_portfolio.fg-caption-hover .fg-item-inner .fg-thumb:before{display:block}.foogallery.fg-simple_portfolio.fg-caption-always .fg-item-inner:hover .fg-caption{visibility:visible;opacity:1}.fg-simple_portfolio .fg-caption-title{text-align:left}.fg-simple_portfolio .fg-caption-desc{text-align:justify}.fg-simple_portfolio.fg-dark .fg-caption,.fg-simple_portfolio.fg-light .fg-caption{color:#828282}.fg-simple_portfolio.fg-dark .fg-caption a,.fg-simple_portfolio.fg-light .fg-caption a{color:#828282;border-bottom:1px solid #828282}.fg-simple_portfolio.fg-dark .fg-caption a:hover,.fg-simple_portfolio.fg-light .fg-caption a:hover{border-bottom:none}.fg-simple_portfolio.fg-light .fg-caption-title,.fg-simple_portfolio.fg-light .fg-caption-title a{color:#222}.fg-simple_portfolio.fg-dark .fg-caption-title,.fg-simple_portfolio.fg-dark .fg-caption-title a{color:#fff}.fg-simple_portfolio.fg-light .fg-caption-title a{border-bottom:1px solid #222}.fg-simple_portfolio.fg-dark .fg-caption-title a{border-bottom:1px solid #fff}.fg-simple_portfolio.fg-captions-top .fg-item.fg-positioned .fg-thumb{position:absolute;bottom:0;left:0}.fg-simple_portfolio .fg-caption{border-width:10px}.fg-simple_portfolio .fg-caption-title+.fg-caption-desc{margin-top:5px}.fg-simple_portfolio.fg-border-thin .fg-caption{border-width:10px 5px 5px 5px}.fg-simple_portfolio.fg-captions-top.fg-border-thin .fg-caption{border-width:5px 5px 10px 5px}.fg-simple_portfolio.fg-border-medium .fg-caption{border-width:10px 0 0 0}.fg-simple_portfolio.fg-captions-top.fg-border-medium .fg-caption{border-width:0 0 10px 0}.fg-simple_portfolio.fg-border-thick .fg-caption{border-width:15px 0 0 0}.fg-simple_portfolio.fg-captions-top.fg-border-thick .fg-caption{border-width:0 0 15px 0}.fg-simple_portfolio.fg-border-thick .fg-caption-title+.fg-caption-desc{margin-top:10px}.foogallery.fg-preset.fg-polaroid .fg-item{-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-transition:-webkit-transform .35s,background-color .65s;transition:transform .35s,background-color .65s}.foogallery.fg-preset.fg-polaroid .fg-item:nth-child(2n+1){-webkit-transform:rotate(3deg);transform:rotate(3deg)}.foogallery.fg-preset.fg-polaroid .fg-item:nth-child(2n){-webkit-transform:rotate(-3deg);transform:rotate(-3deg)}.foogallery.fg-preset.fg-polaroid .fg-item:nth-child(3n){-webkit-transform:rotate(1deg);transform:rotate(1deg)}.foogallery.fg-preset.fg-polaroid .fg-item:nth-child(5n){-webkit-transform:rotate(-2deg);transform:rotate(-2deg)}.foogallery.fg-preset.fg-polaroid .fg-item:hover{-webkit-transform:rotate(0);transform:rotate(0)}.foogallery.fg-preset.fg-polaroid .fg-caption{position:relative;width:auto;font-family:"Segoe Print Regular",-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif}.foogallery.fg-preset.fg-polaroid .fg-caption-inner,.foogallery.fg-preset.fg-polaroid .fg-caption-title{position:relative;width:auto}.foogallery.fg-preset.fg-polaroid .fg-caption-title{text-align:center}.foogallery.fg-preset.fg-polaroid .fg-caption-desc{display:none}.foogallery.fg-light.fg-preset.fg-polaroid .fg-caption-title,.foogallery.fg-preset.fg-polaroid .fg-caption-title{color:#333}.foogallery.fg-dark.fg-preset.fg-polaroid .fg-caption-title{color:#fff}.foogallery.fg-preset.fg-polaroid .fg-caption{border-style:solid;border-color:transparent;border-width:10px}.foogallery.fg-preset.fg-polaroid .fg-caption-title+.fg-caption-desc{margin-top:5px}.foogallery.fg-preset.fg-polaroid.fg-border-thin .fg-caption{border-width:10px 5px 5px 5px}.foogallery.fg-preset.fg-polaroid.fg-captions-top.fg-border-thin .fg-caption{border-width:5px 5px 10px 5px}.foogallery.fg-preset.fg-polaroid.fg-border-medium .fg-caption{border-width:10px 0 0 0}.foogallery.fg-preset.fg-polaroid.fg-captions-top.fg-border-medium .fg-caption{border-width:0 0 10px 0}.foogallery.fg-preset.fg-polaroid.fg-border-thick .fg-caption{border-width:15px 0 0 0}.foogallery.fg-preset.fg-polaroid.fg-captions-top.fg-border-thick .fg-caption{border-width:0 0 15px 0}.foogallery.fg-preset.fg-polaroid.fg-border-thick .fg-caption-title+.fg-caption-desc{margin-top:10px}.fg-image-viewer{display:block;font-family:'Open Sans','Helvetica Neue',Arial,sans-serif}.fg-image-viewer.fg-left{text-align:left}.fg-image-viewer.fg-center{text-align:center}.fg-image-viewer.fg-right{text-align:right}.fiv-inner{position:relative;display:inline-block;max-width:100%;overflow:hidden;z-index:6}.fiv-inner .fiv-inner-container{position:relative;overflow:hidden;max-width:100%;border-style:solid;border-width:0;border-bottom-width:4px;z-index:5}.fg-image-viewer .fiv-inner .fiv-inner-container .fg-item .fg-thumb,.fg-image-viewer .fiv-inner .fiv-inner-container .fg-item .fg-thumb:active,.fg-image-viewer .fiv-inner .fiv-inner-container .fg-item .fg-thumb:hover,.fg-image-viewer .fiv-inner .fiv-inner-container .fg-item .fg-thumb:visited{position:relative;display:block;border:none;outline:0;text-decoration:none;box-shadow:none;max-width:100%}.fg-image-viewer .fiv-inner .fiv-inner-container .fg-item{position:relative;visibility:visible;opacity:1;border:none;outline:0;text-decoration:none;box-shadow:none;max-width:100%}.fg-image-viewer .fiv-inner .fiv-inner-container .fg-item .fg-thumb img{display:block;max-width:100%;height:auto;border:none;outline:0;text-decoration:none}.fg-image-viewer .fiv-inner .fiv-ctrls{display:block;text-align:center;font-size:14px;border-style:solid;line-height:34px}.fg-image-viewer .fiv-inner .fiv-ctrls:after{content:'';display:block;clear:both}.fg-image-viewer .fiv-inner .fiv-ctrls .fiv-count{display:inline-block;font-weight:400;margin:0}.fg-image-viewer .fiv-inner .fiv-ctrls .fiv-next,.fg-image-viewer .fiv-inner .fiv-ctrls .fiv-prev{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border:none;min-width:80px;position:relative;overflow:hidden;transition:background-color .3s}.fg-image-viewer .fiv-inner .fiv-ctrls .fiv-next:before,.fg-image-viewer .fiv-inner .fiv-ctrls .fiv-prev:before{display:block;position:absolute;font-size:24px;line-height:30px;top:0;left:0;width:100%;transform:translateY(0);transition:transform .3s}.fg-image-viewer .fiv-inner .fiv-ctrls .fiv-next:hover:before,.fg-image-viewer .fiv-inner .fiv-ctrls .fiv-prev:hover:before{transform:translateY(-100%)}.fg-image-viewer .fiv-inner .fiv-ctrls .fiv-next span,.fg-image-viewer .fiv-inner .fiv-ctrls .fiv-prev span{display:block;width:100%;transform:translateY(100%);transition:transform .3s}.fg-image-viewer .fiv-inner .fiv-ctrls .fiv-next:hover span,.fg-image-viewer .fiv-inner .fiv-ctrls .fiv-prev:hover span{transform:translateY(0)}.fg-image-viewer .fiv-inner .fiv-ctrls .fiv-prev{float:left}.fg-image-viewer .fiv-inner .fiv-ctrls .fiv-prev:before{content:'\2190'}.fg-image-viewer .fiv-inner .fiv-ctrls .fiv-next{float:right}.fg-image-viewer .fiv-inner .fiv-ctrls .fiv-next:before{content:'\2192'}.fg-image-viewer .fiv-inner .fiv-ctrls .fiv-count span{margin:0 4px}/*!* Theme - Default (Light) *!*//*!* Theme - Dark *!*/.foogallery.fg-image-viewer.fg-caption-always .fg-item-inner .fg-caption{padding:0;border:none;background:#000;background:-moz-linear-gradient(left,rgba(0,0,0,.8) 0,rgba(0,0,0,.8) 60%,rgba(0,0,0,0) 100%);background:-webkit-linear-gradient(left,rgba(0,0,0,.8) 0,rgba(0,0,0,.8) 60%,rgba(0,0,0,0) 100%);background:linear-gradient(to right,rgba(0,0,0,.8) 0,rgba(0,0,0,.8) 60%,rgba(0,0,0,0) 100%)}.foogallery.fg-image-viewer.fg-caption-always .fg-caption-title{padding:10px 10px 10px 10px}.foogallery.fg-image-viewer.fg-caption-always .fg-caption-desc{padding:10px 10px 10px 10px}.foogallery.fg-image-viewer.fg-caption-always .fg-caption-title+.fg-caption-desc{padding:0 10px 10px 10px}.fg-image-viewer.fg-light .fiv-inner .fiv-ctrls,.fg-image-viewer.fg-light .fiv-inner .fiv-ctrls .fiv-count,.fg-image-viewer.fg-light .fiv-inner .fiv-ctrls .fiv-next,.fg-image-viewer.fg-light .fiv-inner .fiv-ctrls .fiv-prev,.fg-image-viewer.fg-light .fiv-inner .fiv-inner-container{background-color:#fff;color:#333;border-color:#fff}.fg-image-viewer.fg-light .fiv-inner .fiv-ctrls .fiv-next:hover,.fg-image-viewer.fg-light .fiv-inner .fiv-ctrls .fiv-prev:hover{background-color:#f2f2f2}.fg-image-viewer.fg-light .fiv-next,.fg-image-viewer.fg-light .fiv-prev{box-shadow:inset 0 0 0 1px #ddd}.fg-image-viewer.fg-dark .fiv-inner .fiv-ctrls,.fg-image-viewer.fg-dark .fiv-inner .fiv-ctrls .fiv-count,.fg-image-viewer.fg-dark .fiv-inner .fiv-ctrls .fiv-next,.fg-image-viewer.fg-dark .fiv-inner .fiv-ctrls .fiv-prev,.fg-image-viewer.fg-dark .fiv-inner .fiv-inner-container{background-color:#333;color:#fff;border-color:#333}.fg-image-viewer.fg-dark .fiv-inner .fiv-ctrls .fiv-next:hover,.fg-image-viewer.fg-dark .fiv-inner .fiv-ctrls .fiv-prev:hover{background-color:#444}.fg-image-viewer.fg-dark .fiv-next,.fg-image-viewer.fg-dark .fiv-prev{box-shadow:inset 0 0 0 1px #222}.foogallery.fg-image-viewer.fg-border-medium .fg-item-inner,.foogallery.fg-image-viewer.fg-border-thick .fg-item-inner,.foogallery.fg-image-viewer.fg-border-thin .fg-item-inner{border-width:0}.foogallery.fg-image-viewer .fiv-ctrls,.foogallery.fg-image-viewer.fg-border-thin .fiv-inner-container{border-width:4px}.foogallery.fg-image-viewer.fg-border-medium .fiv-ctrls,.foogallery.fg-image-viewer.fg-border-medium .fiv-inner-container{border-width:10px}.foogallery.fg-image-viewer.fg-border-thick .fiv-ctrls,.foogallery.fg-image-viewer.fg-border-thick .fiv-inner-container{border-width:16px}.foogallery.fg-image-viewer .fiv-ctrls,.foogallery.fg-image-viewer.fg-border-medium .fiv-ctrls,.foogallery.fg-image-viewer.fg-border-thick .fiv-ctrls,.foogallery.fg-image-viewer.fg-border-thin .fiv-ctrls{border-top-width:1px}.foogallery.fg-image-viewer.fg-round-small .fg-item,.foogallery.fg-image-viewer.fg-round-small .fg-item-inner,.foogallery.fg-image-viewer.fg-round-small .fiv-inner{border-radius:5px}.foogallery.fg-image-viewer.fg-round-small .fg-item,.foogallery.fg-image-viewer.fg-round-small .fg-item-inner{border-bottom-left-radius:0;border-bottom-right-radius:0}.foogallery.fg-image-viewer.fg-round-small .fiv-next,.foogallery.fg-image-viewer.fg-round-small .fiv-prev{border-radius:3px}.foogallery.fg-image-viewer.fg-border-medium.fg-round-small .fg-item,.foogallery.fg-image-viewer.fg-border-medium.fg-round-small .fg-item-inner,.foogallery.fg-image-viewer.fg-border-medium.fg-round-small .fiv-next,.foogallery.fg-image-viewer.fg-border-medium.fg-round-small .fiv-prev,.foogallery.fg-image-viewer.fg-border-thick.fg-round-small .fg-item,.foogallery.fg-image-viewer.fg-border-thick.fg-round-small .fg-item-inner,.foogallery.fg-image-viewer.fg-border-thick.fg-round-small .fiv-next,.foogallery.fg-image-viewer.fg-border-thick.fg-round-small .fiv-prev,.foogallery.fg-image-viewer.fg-border-thin.fg-round-small .fg-item,.foogallery.fg-image-viewer.fg-border-thin.fg-round-small .fg-item-inner,.foogallery.fg-image-viewer.fg-border-thin.fg-round-small .fiv-next,.foogallery.fg-image-viewer.fg-border-thin.fg-round-small .fiv-prev{border-radius:3px}.foogallery.fg-image-viewer.fg-round-medium .fg-item,.foogallery.fg-image-viewer.fg-round-medium .fg-item-inner,.foogallery.fg-image-viewer.fg-round-medium .fiv-inner{border-radius:10px}.foogallery.fg-image-viewer.fg-round-medium .fg-item,.foogallery.fg-image-viewer.fg-round-medium .fg-item-inner{border-bottom-left-radius:0;border-bottom-right-radius:0}.foogallery.fg-image-viewer.fg-round-medium .fiv-next,.foogallery.fg-image-viewer.fg-round-medium .fiv-prev{border-radius:5px}.foogallery.fg-image-viewer.fg-border-thin.fg-round-medium .fg-item,.foogallery.fg-image-viewer.fg-border-thin.fg-round-medium .fg-item-inner,.foogallery.fg-image-viewer.fg-border-thin.fg-round-medium .fiv-next,.foogallery.fg-image-viewer.fg-border-thin.fg-round-medium .fiv-prev{border-radius:5px}.foogallery.fg-image-viewer.fg-border-medium.fg-round-medium .fg-item,.foogallery.fg-image-viewer.fg-border-medium.fg-round-medium .fg-item-inner,.foogallery.fg-image-viewer.fg-border-medium.fg-round-medium .fiv-next,.foogallery.fg-image-viewer.fg-border-medium.fg-round-medium .fiv-prev,.foogallery.fg-image-viewer.fg-border-thick.fg-round-medium .fg-item,.foogallery.fg-image-viewer.fg-border-thick.fg-round-medium .fg-item-inner,.foogallery.fg-image-viewer.fg-border-thick.fg-round-medium .fiv-next,.foogallery.fg-image-viewer.fg-border-thick.fg-round-medium .fiv-prev{border-radius:3px}.foogallery.fg-image-viewer.fg-round-large .fg-item,.foogallery.fg-image-viewer.fg-round-large .fg-item-inner,.foogallery.fg-image-viewer.fg-round-large .fiv-inner{border-radius:15px}.foogallery.fg-image-viewer.fg-round-large .fg-item,.foogallery.fg-image-viewer.fg-round-large .fg-item-inner{border-bottom-left-radius:0;border-bottom-right-radius:0}.foogallery.fg-image-viewer.fg-round-large .fiv-next,.foogallery.fg-image-viewer.fg-round-large .fiv-prev{border-radius:11px}.foogallery.fg-image-viewer.fg-border-thin.fg-round-large .fg-item,.foogallery.fg-image-viewer.fg-border-thin.fg-round-large .fg-item-inner,.foogallery.fg-image-viewer.fg-border-thin.fg-round-large .fiv-next,.foogallery.fg-image-viewer.fg-border-thin.fg-round-large .fiv-prev{border-radius:11px}.foogallery.fg-image-viewer.fg-border-medium.fg-round-large .fg-item,.foogallery.fg-image-viewer.fg-border-medium.fg-round-large .fg-item-inner,.foogallery.fg-image-viewer.fg-border-medium.fg-round-large .fiv-next,.foogallery.fg-image-viewer.fg-border-medium.fg-round-large .fiv-prev{border-radius:5px}.foogallery.fg-image-viewer.fg-border-thick.fg-round-large .fg-item,.foogallery.fg-image-viewer.fg-border-thick.fg-round-large .fg-item-inner,.foogallery.fg-image-viewer.fg-border-thick.fg-round-large .fiv-next,.foogallery.fg-image-viewer.fg-border-thick.fg-round-large .fiv-prev{border-radius:3px}.foogallery.fg-image-viewer.fg-round-full .fiv-inner,.foogallery.fg-image-viewer.fg-round-full .fiv-next,.foogallery.fg-image-viewer.fg-round-full .fiv-prev{border-radius:50%}.foogallery.fg-image-viewer.fg-dark.fg-shadow-large .fg-item-inner,.foogallery.fg-image-viewer.fg-dark.fg-shadow-medium .fg-item-inner,.foogallery.fg-image-viewer.fg-dark.fg-shadow-outline .fg-item-inner,.foogallery.fg-image-viewer.fg-dark.fg-shadow-small .fg-item-inner,.foogallery.fg-image-viewer.fg-light.fg-shadow-large .fg-item-inner,.foogallery.fg-image-viewer.fg-light.fg-shadow-medium .fg-item-inner,.foogallery.fg-image-viewer.fg-light.fg-shadow-outline .fg-item-inner,.foogallery.fg-image-viewer.fg-light.fg-shadow-small .fg-item-inner{box-shadow:none}.foogallery.fg-image-viewer.fg-light.fg-shadow-outline .fiv-inner{box-shadow:0 0 0 1px #ddd}.foogallery.fg-image-viewer.fg-dark.fg-shadow-outline .fiv-inner{box-shadow:0 0 0 1px #222}.foogallery.fg-image-viewer.fg-dark.fg-shadow-small .fiv-inner,.foogallery.fg-image-viewer.fg-light.fg-shadow-small .fiv-inner{box-shadow:0 1px 4px 0 rgba(0,0,0,.5)}.foogallery.fg-image-viewer.fg-dark.fg-shadow-medium .fiv-inner,.foogallery.fg-image-viewer.fg-light.fg-shadow-medium .fiv-inner{box-shadow:0 1px 10px 0 rgba(0,0,0,.5)}.foogallery.fg-image-viewer.fg-dark.fg-shadow-large .fiv-inner,.foogallery.fg-image-viewer.fg-light.fg-shadow-large .fiv-inner{box-shadow:0 1px 16px 0 rgba(0,0,0,.5)}.foogallery.fg-thumbnail,.foogallery.fg-thumbnail.fg-center{text-align:center}.foogallery.fg-thumbnail.fg-left{float:left}.foogallery.fg-thumbnail.fg-right{float:right}.foogallery.fg-thumbnail .fg-item{display:inline-block;vertical-align:top;max-width:100%}.foogallery.fg-thumbnail .fg-st-hidden{display:none}
|
extensions/default-templates/shared/img/circle-plus.png
ADDED
Binary file
|
extensions/default-templates/shared/img/circle-plus@2x.png
ADDED
Binary file
|
extensions/default-templates/shared/img/circle-plus@3x.png
ADDED
Binary file
|
extensions/default-templates/shared/img/external.png
ADDED
Binary file
|
extensions/default-templates/shared/img/external@2x.png
ADDED
Binary file
|
extensions/default-templates/shared/img/external@3x.png
ADDED
Binary file
|
extensions/default-templates/shared/img/eye.png
ADDED
Binary file
|
extensions/default-templates/shared/img/eye@2x.png
ADDED
Binary file
|
extensions/default-templates/shared/img/eye@3x.png
ADDED
Binary file
|
extensions/default-templates/shared/img/image.png
ADDED
Binary file
|
extensions/default-templates/shared/img/image@2x.png
ADDED
Binary file
|
extensions/default-templates/shared/img/image@3x.png
ADDED
Binary file
|
extensions/default-templates/shared/img/plus.png
ADDED
Binary file
|
extensions/default-templates/shared/img/plus@2x.png
ADDED
Binary file
|
extensions/default-templates/shared/img/plus@3x.png
ADDED
Binary file
|
extensions/default-templates/shared/img/zoom.png
ADDED
Binary file
|
extensions/default-templates/shared/img/zoom2.png
ADDED
Binary file
|
extensions/default-templates/shared/img/zoom2@2x.png
ADDED
Binary file
|
extensions/default-templates/shared/img/zoom2@3x.png
ADDED
Binary file
|
extensions/default-templates/shared/img/zoom3.png
ADDED
Binary file
|
extensions/default-templates/shared/img/zoom3@2x.png
ADDED
Binary file
|
extensions/default-templates/shared/img/zoom3@3x.png
ADDED
Binary file
|
extensions/default-templates/shared/img/zoom@2x.png
ADDED
Binary file
|
extensions/default-templates/shared/img/zoom@3x.png
ADDED
Binary file
|
extensions/default-templates/shared/js/foogallery.js
ADDED
@@ -0,0 +1,7501 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
(function($, _){
|
2 |
+
|
3 |
+
/**
|
4 |
+
* @summary A reference to the jQuery object the plugin is registered with.
|
5 |
+
* @memberof FooGallery
|
6 |
+
* @name $
|
7 |
+
* @type {jQuery}
|
8 |
+
* @description This is used internally for all jQuery operations to help work around issues where multiple jQuery libraries have been included in a single page.
|
9 |
+
* @example {@caption The following shows the issue when multiple jQuery's are included in a single page.}{@lang xml}
|
10 |
+
* <script src="jquery-1.12.4.js"></script>
|
11 |
+
* <script src="foogallery.js"></script>
|
12 |
+
* <script src="jquery-2.2.4.js"></script>
|
13 |
+
* <script>
|
14 |
+
* jQuery(function($){
|
15 |
+
* $(".selector").foogallery(); // => This would throw a TypeError: $(...).foogallery is not a function
|
16 |
+
* });
|
17 |
+
* </script>
|
18 |
+
* @example {@caption The reason the above throws an error is that the `$.fn.foogallery` function is registered to the first instance of jQuery in the page however the instance used to create the ready callback and actually try to execute `$(...).foogallery()` is the second. To resolve this issue ideally you would remove the second instance of jQuery however you can use the `FooGallery.$` member to ensure you are always working with the instance of jQuery the plugin was registered with.}{@lang xml}
|
19 |
+
* <script src="jquery-1.12.4.js"></script>
|
20 |
+
* <script src="foogallery.js"></script>
|
21 |
+
* <script src="jquery-2.2.4.js"></script>
|
22 |
+
* <script>
|
23 |
+
* FooGallery.$(function($){
|
24 |
+
* $(".selector").foogallery(); // => It works!
|
25 |
+
* });
|
26 |
+
* </script>
|
27 |
+
*/
|
28 |
+
_.$ = $;
|
29 |
+
|
30 |
+
/**
|
31 |
+
* @summary The jQuery plugin namespace.
|
32 |
+
* @external "jQuery.fn"
|
33 |
+
* @see {@link http://learn.jquery.com/plugins/basic-plugin-creation/|How to Create a Basic Plugin | jQuery Learning Center}
|
34 |
+
*/
|
35 |
+
})(
|
36 |
+
// dependencies
|
37 |
+
jQuery,
|
38 |
+
/**
|
39 |
+
* @summary The core namespace for the plugin containing all its code.
|
40 |
+
* @namespace FooGallery
|
41 |
+
* @description This plugin houses all it's code within a single `FooGallery` global variable to prevent polluting the global namespace and to make accessing its various members simpler.
|
42 |
+
* @example {@caption As this namespace is registered as a global on the `window` object, it can be accessed using the `window.` prefix.}
|
43 |
+
* var fg = window.FooGallery;
|
44 |
+
* @example {@caption Or without it.}
|
45 |
+
* var fg = FooGallery;
|
46 |
+
* @example {@caption When using this namespace I would recommend aliasing it to a short variable name such as `fg` or as used internally `_`.}
|
47 |
+
* // alias the FooGallery namespace
|
48 |
+
* var _ = FooGallery;
|
49 |
+
* @example {@caption This is not required but lets us write less code and allows the alias to be minified by compressors like UglifyJS. How you choose to alias the namespace is up to you. You can use the simple `var` method as seen above or supply the namespace as a parameter when creating a new scope as seen below.}
|
50 |
+
* // create a new scope to work in passing the namespace as a parameter
|
51 |
+
* (function(_){
|
52 |
+
*
|
53 |
+
* // use `_.` to access members and methods
|
54 |
+
*
|
55 |
+
* })(FooGallery);
|
56 |
+
*/
|
57 |
+
window.FooGallery = window.FooGallery || {}
|
58 |
+
);
|
59 |
+
/*!
|
60 |
+
* FooGallery.utils - Contains common utility methods and classes used in our plugins.
|
61 |
+
* @version 0.0.5
|
62 |
+
* @link https://github.com/steveush/foo-utils#readme
|
63 |
+
* @copyright Steve Usher 2017
|
64 |
+
* @license Released under the GPL-3.0 license.
|
65 |
+
*/
|
66 |
+
/**
|
67 |
+
* @file This creates the global FooGallery.utils namespace ensuring it only registers itself if the namespace doesn't already exist or if the current version is lower than this one.
|
68 |
+
*/
|
69 |
+
(function ($) {
|
70 |
+
|
71 |
+
if (!$){
|
72 |
+
console.warn('jQuery must be included in the page prior to the FooGallery.utils library.');
|
73 |
+
return;
|
74 |
+
}
|
75 |
+
|
76 |
+
/**
|
77 |
+
* @summary This namespace contains common utility methods and code shared between our plugins.
|
78 |
+
* @namespace FooGallery.utils
|
79 |
+
* @description This namespace relies on jQuery being included in the page prior to it being loaded.
|
80 |
+
*/
|
81 |
+
var utils = {
|
82 |
+
/**
|
83 |
+
* @summary A reference to the jQuery object the library is registered with.
|
84 |
+
* @memberof FooGallery.utils
|
85 |
+
* @name $
|
86 |
+
* @type {jQuery}
|
87 |
+
* @description This is used internally for all jQuery operations to help work around issues where multiple jQuery libraries have been included in a single page.
|
88 |
+
* @example {@caption The following shows the issue when multiple jQuery's are included in a single page.}{@lang html}
|
89 |
+
* <script src="jquery-1.12.4.js"></script>
|
90 |
+
* <script src="my-plugin.js"></script>
|
91 |
+
* <script src="jquery-2.2.4.js"></script>
|
92 |
+
* <script>
|
93 |
+
* jQuery(function($){
|
94 |
+
* $(".selector").myPlugin(); // => This would throw a TypeError: $(...).myPlugin is not a function
|
95 |
+
* });
|
96 |
+
* </script>
|
97 |
+
* @example {@caption The reason the above throws an error is that the `$.fn.myPlugin` function is registered to the first instance of jQuery in the page however the instance used to create the ready callback and actually try to execute `$(...).myPlugin()` is the second. To resolve this issue ideally you would remove the second instance of jQuery however you can use the `FooGallery.utils.$` member to ensure you are always working with the instance of jQuery the library was registered with.}{@lang html}
|
98 |
+
* <script src="jquery-1.12.4.js"></script>
|
99 |
+
* <script src="my-plugin.js"></script>
|
100 |
+
* <script src="jquery-2.2.4.js"></script>
|
101 |
+
* <script>
|
102 |
+
* FooGallery.utils.$(function($){
|
103 |
+
* $(".selector").myPlugin(); // => It works!
|
104 |
+
* });
|
105 |
+
* </script>
|
106 |
+
*/
|
107 |
+
$: $,
|
108 |
+
/**
|
109 |
+
* @summary The version of this library.
|
110 |
+
* @memberof FooGallery.utils
|
111 |
+
* @name version
|
112 |
+
* @type {string}
|
113 |
+
*/
|
114 |
+
version: '0.0.5',
|
115 |
+
};
|
116 |
+
|
117 |
+
/**
|
118 |
+
* @summary Compares two version numbers.
|
119 |
+
* @memberof FooGallery.utils
|
120 |
+
* @function versionCompare
|
121 |
+
* @param {string} version1 - The first version to use in the comparison.
|
122 |
+
* @param {string} version2 - The second version to compare to the first.
|
123 |
+
* @returns {number} `0` if the version are equal.
|
124 |
+
* `-1` if `version1` is less than `version2`.
|
125 |
+
* `1` if `version1` is greater than `version2`.
|
126 |
+
* `NaN` if either of the supplied versions do not conform to MAJOR.MINOR.PATCH format.
|
127 |
+
* @description This method will compare two version numbers that conform to the basic MAJOR.MINOR.PATCH format returning the result as a simple number. This method will handle short version string comparisons e.g. `1.0` versus `1.0.1`.
|
128 |
+
* @example {@caption The following shows the results of comparing various version strings.}
|
129 |
+
* console.log( FooGallery.utils.versionCompare( "0", "0" ) ); // => 0
|
130 |
+
* console.log( FooGallery.utils.versionCompare( "0.0", "0" ) ); // => 0
|
131 |
+
* console.log( FooGallery.utils.versionCompare( "0.0", "0.0.0" ) ); // => 0
|
132 |
+
* console.log( FooGallery.utils.versionCompare( "0.1", "0.0.0" ) ); // => 1
|
133 |
+
* console.log( FooGallery.utils.versionCompare( "0.1", "0.0.1" ) ); // => 1
|
134 |
+
* console.log( FooGallery.utils.versionCompare( "1", "0.1" ) ); // => 1
|
135 |
+
* console.log( FooGallery.utils.versionCompare( "1.10", "1.9" ) ); // => 1
|
136 |
+
* console.log( FooGallery.utils.versionCompare( "1.9", "1.10" ) ); // => -1
|
137 |
+
* console.log( FooGallery.utils.versionCompare( "1", "1.1" ) ); // => -1
|
138 |
+
* console.log( FooGallery.utils.versionCompare( "1.0.9", "1.1" ) ); // => -1
|
139 |
+
* @example {@caption If either of the supplied version strings does not match the MAJOR.MINOR.PATCH format then `NaN` is returned.}
|
140 |
+
* console.log( FooGallery.utils.versionCompare( "not-a-version", "1.1" ) ); // => NaN
|
141 |
+
* console.log( FooGallery.utils.versionCompare( "1.1", "not-a-version" ) ); // => NaN
|
142 |
+
* console.log( FooGallery.utils.versionCompare( "not-a-version", "not-a-version" ) ); // => NaN
|
143 |
+
*/
|
144 |
+
utils.versionCompare = function(version1, version2){
|
145 |
+
// if either of the versions do not match the expected format return NaN
|
146 |
+
if (!(/[\d.]/.test(version1) && /[\d.]/.test(version2))) return NaN;
|
147 |
+
|
148 |
+
/**
|
149 |
+
* @summary Splits and parses the given version string into a numeric array.
|
150 |
+
* @param {string} version - The version string to split and parse.
|
151 |
+
* @returns {Array.<number>}
|
152 |
+
* @ignore
|
153 |
+
*/
|
154 |
+
function split(version){
|
155 |
+
var res = version.split('.');
|
156 |
+
for(var i = 0, len = res.length; i < len; i++){
|
157 |
+
res[i] = parseInt(res[i]);
|
158 |
+
if (isNaN(res[i])) res[i] = 0;
|
159 |
+
}
|
160 |
+
return res;
|
161 |
+
}
|
162 |
+
|
163 |
+
// get the base numeric arrays for each version
|
164 |
+
var v1parts = split(version1),
|
165 |
+
v2parts = split(version2);
|
166 |
+
|
167 |
+
// ensure both arrays are the same length by padding the shorter with 0
|
168 |
+
while (v1parts.length < v2parts.length) v1parts.push(0);
|
169 |
+
while (v2parts.length < v1parts.length) v2parts.push(0);
|
170 |
+
|
171 |
+
// perform the actual comparison
|
172 |
+
for (var i = 0; i < v1parts.length; ++i) {
|
173 |
+
if (v2parts.length == i) return 1;
|
174 |
+
if (v1parts[i] == v2parts[i]) continue;
|
175 |
+
if (v1parts[i] > v2parts[i]) return 1;
|
176 |
+
else return -1;
|
177 |
+
}
|
178 |
+
if (v1parts.length != v2parts.length) return -1;
|
179 |
+
return 0;
|
180 |
+
};
|
181 |
+
|
182 |
+
function __exists(){
|
183 |
+
try {
|
184 |
+
return !!window.FooGallery.utils; // does the namespace already exist?
|
185 |
+
} catch(err) {
|
186 |
+
return false;
|
187 |
+
}
|
188 |
+
}
|
189 |
+
|
190 |
+
if (__exists()){
|
191 |
+
// if it already exists always log a warning as there may be version conflicts as the following code always ensures the latest version is loaded
|
192 |
+
if (utils.versionCompare(utils.version, window.FooGallery.utils.version) > 0){
|
193 |
+
// if it exists but it's an old version replace it
|
194 |
+
console.warn("An older version of FooGallery.utils (" + window.FooGallery.utils.version + ") already exists in the page, version " + utils.version + " will override it.");
|
195 |
+
window.FooGallery.utils = utils;
|
196 |
+
} else {
|
197 |
+
// otherwise its a newer version so do nothing
|
198 |
+
console.warn("A newer version of FooGallery.utils (" + window.FooGallery.utils.version + ") already exists in the page, version " + utils.version + " will not register itself.");
|
199 |
+
}
|
200 |
+
} else {
|
201 |
+
// if it doesn't exist register it
|
202 |
+
window.FooGallery.utils = utils;
|
203 |
+
}
|
204 |
+
|
205 |
+
// at this point there will always be a FooGallery.utils namespace registered to the global scope.
|
206 |
+
|
207 |
+
})(jQuery);
|
208 |
+
(function ($, _){
|
209 |
+
// only register methods if this version is the current version
|
210 |
+
if (_.version !== '0.0.5') return;
|
211 |
+
|
212 |
+
/**
|
213 |
+
* @summary Contains common type checking utility methods.
|
214 |
+
* @memberof FooGallery.utils
|
215 |
+
* @namespace is
|
216 |
+
*/
|
217 |
+
_.is = {};
|
218 |
+
|
219 |
+
/**
|
220 |
+
* @summary Checks if the `value` is an array.
|
221 |
+
* @memberof FooGallery.utils.is
|
222 |
+
* @function array
|
223 |
+
* @param {*} value - The value to check.
|
224 |
+
* @returns {boolean} `true` if the supplied `value` is an array.
|
225 |
+
* @example {@run true}
|
226 |
+
* // alias the FooGallery.utils.is namespace
|
227 |
+
* var _is = FooGallery.utils.is;
|
228 |
+
*
|
229 |
+
* console.log( _is.array( [] ) ); // => true
|
230 |
+
* console.log( _is.array( null ) ); // => false
|
231 |
+
* console.log( _is.array( 123 ) ); // => false
|
232 |
+
* console.log( _is.array( "" ) ); // => false
|
233 |
+
*/
|
234 |
+
_.is.array = function (value) {
|
235 |
+
return '[object Array]' === Object.prototype.toString.call(value);
|
236 |
+
};
|
237 |
+
|
238 |
+
/**
|
239 |
+
* @summary Checks if the `value` is a boolean.
|
240 |
+
* @memberof FooGallery.utils.is
|
241 |
+
* @function boolean
|
242 |
+
* @param {*} value - The value to check.
|
243 |
+
* @returns {boolean} `true` if the supplied `value` is a boolean.
|
244 |
+
* @example {@run true}
|
245 |
+
* // alias the FooGallery.utils.is namespace
|
246 |
+
* var _is = FooGallery.utils.is;
|
247 |
+
*
|
248 |
+
* console.log( _is.boolean( true ) ); // => true
|
249 |
+
* console.log( _is.boolean( false ) ); // => true
|
250 |
+
* console.log( _is.boolean( "true" ) ); // => false
|
251 |
+
* console.log( _is.boolean( "false" ) ); // => false
|
252 |
+
* console.log( _is.boolean( 1 ) ); // => false
|
253 |
+
* console.log( _is.boolean( 0 ) ); // => false
|
254 |
+
*/
|
255 |
+
_.is.boolean = function (value) {
|
256 |
+
return '[object Boolean]' === Object.prototype.toString.call(value);
|
257 |
+
};
|
258 |
+
|
259 |
+
/**
|
260 |
+
* @summary Checks if the `value` is an element.
|
261 |
+
* @memberof FooGallery.utils.is
|
262 |
+
* @function element
|
263 |
+
* @param {*} value - The value to check.
|
264 |
+
* @returns {boolean} `true` if the supplied `value` is an element.
|
265 |
+
* @example {@run true}
|
266 |
+
* // alias the FooGallery.utils.is namespace
|
267 |
+
* var _is = FooGallery.utils.is,
|
268 |
+
* // create an element to test
|
269 |
+
* el = document.createElement("span");
|
270 |
+
*
|
271 |
+
* console.log( _is.element( el ) ); // => true
|
272 |
+
* console.log( _is.element( $(el) ) ); // => false
|
273 |
+
* console.log( _is.element( null ) ); // => false
|
274 |
+
* console.log( _is.element( {} ) ); // => false
|
275 |
+
*/
|
276 |
+
_.is.element = function (value) {
|
277 |
+
return typeof HTMLElement === 'object'
|
278 |
+
? value instanceof HTMLElement
|
279 |
+
: !!value && typeof value === 'object' && value !== null && value.nodeType === 1 && typeof value.nodeName === 'string';
|
280 |
+
};
|
281 |
+
|
282 |
+
/**
|
283 |
+
* @summary Checks if the `value` is empty.
|
284 |
+
* @memberof FooGallery.utils.is
|
285 |
+
* @function empty
|
286 |
+
* @param {*} value - The value to check.
|
287 |
+
* @returns {boolean} `true` if the supplied `value` is empty.
|
288 |
+
* @description The following values are considered to be empty by this method:
|
289 |
+
*
|
290 |
+
* <ul><!--
|
291 |
+
* --><li>`""` - An empty string</li><!--
|
292 |
+
* --><li>`0` - 0 as an integer</li><!--
|
293 |
+
* --><li>`0.0` - 0 as a float</li><!--
|
294 |
+
* --><li>`[]` - An empty array</li><!--
|
295 |
+
* --><li>`{}` - An empty object</li><!--
|
296 |
+
* --><li>`$()` - An empty jQuery object</li><!--
|
297 |
+
* --><li>`false`</li><!--
|
298 |
+
* --><li>`null`</li><!--
|
299 |
+
* --><li>`undefined`</li><!--
|
300 |
+
* --></ul>
|
301 |
+
* @example {@run true}
|
302 |
+
* // alias the FooGallery.utils.is namespace
|
303 |
+
* var _is = FooGallery.utils.is;
|
304 |
+
*
|
305 |
+
* console.log( _is.empty( undefined ) ); // => true
|
306 |
+
* console.log( _is.empty( null ) ); // => true
|
307 |
+
* console.log( _is.empty( 0 ) ); // => true
|
308 |
+
* console.log( _is.empty( 0.0 ) ); // => true
|
309 |
+
* console.log( _is.empty( "" ) ); // => true
|
310 |
+
* console.log( _is.empty( [] ) ); // => true
|
311 |
+
* console.log( _is.empty( {} ) ); // => true
|
312 |
+
* console.log( _is.empty( 1 ) ); // => false
|
313 |
+
* console.log( _is.empty( 0.1 ) ); // => false
|
314 |
+
* console.log( _is.empty( "one" ) ); // => false
|
315 |
+
* console.log( _is.empty( ["one"] ) ); // => false
|
316 |
+
* console.log( _is.empty( { "name": "My Object" } ) ); // => false
|
317 |
+
*/
|
318 |
+
_.is.empty = function(value){
|
319 |
+
if (_.is.undef(value) || value === null) return true;
|
320 |
+
if (_.is.number(value) && value == 0) return true;
|
321 |
+
if (_.is.boolean(value) && value === false) return true;
|
322 |
+
if (_.is.string(value) && value.length === 0) return true;
|
323 |
+
if (_.is.array(value) && value.length === 0) return true;
|
324 |
+
if (_.is.jq(value) && value.length === 0) return true;
|
325 |
+
if (_.is.hash(value)){
|
326 |
+
for(var prop in value) {
|
327 |
+
if(value.hasOwnProperty(prop))
|
328 |
+
return false;
|
329 |
+
}
|
330 |
+
return true;
|
331 |
+
}
|
332 |
+
return false;
|
333 |
+
};
|
334 |
+
|
335 |
+
/**
|
336 |
+
* @summary Checks if the `value` is an error.
|
337 |
+
* @memberof FooGallery.utils.is
|
338 |
+
* @function error
|
339 |
+
* @param {*} value - The value to check.
|
340 |
+
* @returns {boolean} `true` if the supplied `value` is an error.
|
341 |
+
* @example {@run true}
|
342 |
+
* // alias the FooGallery.utils.is namespace
|
343 |
+
* var _is = FooGallery.utils.is,
|
344 |
+
* // create some errors to test
|
345 |
+
* err1 = new Error("err1"),
|
346 |
+
* err2 = new SyntaxError("err2");
|
347 |
+
*
|
348 |
+
* console.log( _is.error( err1 ) ); // => true
|
349 |
+
* console.log( _is.error( err2 ) ); // => true
|
350 |
+
* console.log( _is.error( null ) ); // => false
|
351 |
+
* console.log( _is.error( 123 ) ); // => false
|
352 |
+
* console.log( _is.error( "" ) ); // => false
|
353 |
+
* console.log( _is.error( {} ) ); // => false
|
354 |
+
* console.log( _is.error( [] ) ); // => false
|
355 |
+
*/
|
356 |
+
_.is.error = function (value) {
|
357 |
+
return '[object Error]' === Object.prototype.toString.call(value);
|
358 |
+
};
|
359 |
+
|
360 |
+
/**
|
361 |
+
* @summary Checks if the `value` is a function.
|
362 |
+
* @memberof FooGallery.utils.is
|
363 |
+
* @function fn
|
364 |
+
* @param {*} value - The value to check.
|
365 |
+
* @returns {boolean} `true` if the supplied `value` is a function.
|
366 |
+
* @example {@run true}
|
367 |
+
* // alias the FooGallery.utils.is namespace
|
368 |
+
* var _is = FooGallery.utils.is,
|
369 |
+
* // create a function to test
|
370 |
+
* func = function(){};
|
371 |
+
*
|
372 |
+
* console.log( _is.fn( func ) ); // => true
|
373 |
+
* console.log( _is.fn( null ) ); // => false
|
374 |
+
* console.log( _is.fn( 123 ) ); // => false
|
375 |
+
* console.log( _is.fn( "" ) ); // => false
|
376 |
+
*/
|
377 |
+
_.is.fn = function (value) {
|
378 |
+
return value === window.alert || '[object Function]' === Object.prototype.toString.call(value);
|
379 |
+
};
|
380 |
+
|
381 |
+
/**
|
382 |
+
* @summary Checks if the `value` is a hash.
|
383 |
+
* @memberof FooGallery.utils.is
|
384 |
+
* @function hash
|
385 |
+
* @param {*} value - The value to check.
|
386 |
+
* @returns {boolean} `true` if the supplied `value` is a hash.
|
387 |
+
* @example {@run true}
|
388 |
+
* // alias the FooGallery.utils.is namespace
|
389 |
+
* var _is = FooGallery.utils.is;
|
390 |
+
*
|
391 |
+
* console.log( _is.hash( {"some": "prop"} ) ); // => true
|
392 |
+
* console.log( _is.hash( {} ) ); // => true
|
393 |
+
* console.log( _is.hash( window ) ); // => false
|
394 |
+
* console.log( _is.hash( document ) ); // => false
|
395 |
+
* console.log( _is.hash( "" ) ); // => false
|
396 |
+
* console.log( _is.hash( 123 ) ); // => false
|
397 |
+
*/
|
398 |
+
_.is.hash = function (value) {
|
399 |
+
return _.is.object(value) && value.constructor === Object && !value.nodeType && !value.setInterval;
|
400 |
+
};
|
401 |
+
|
402 |
+
/**
|
403 |
+
* @summary Checks if the `value` is a jQuery object.
|
404 |
+
* @memberof FooGallery.utils.is
|
405 |
+
* @function jq
|
406 |
+
* @param {*} value - The value to check.
|
407 |
+
* @returns {boolean} `true` if the supplied `value` is a jQuery object.
|
408 |
+
* @example {@run true}
|
409 |
+
* // alias the FooGallery.utils.is namespace
|
410 |
+
* var _is = FooGallery.utils.is,
|
411 |
+
* // create an element to test
|
412 |
+
* el = document.createElement("span");
|
413 |
+
*
|
414 |
+
* console.log( _is.jq( $(el) ) ); // => true
|
415 |
+
* console.log( _is.jq( $() ) ); // => true
|
416 |
+
* console.log( _is.jq( el ) ); // => false
|
417 |
+
* console.log( _is.jq( {} ) ); // => false
|
418 |
+
* console.log( _is.jq( null ) ); // => false
|
419 |
+
* console.log( _is.jq( 123 ) ); // => false
|
420 |
+
* console.log( _is.jq( "" ) ); // => false
|
421 |
+
*/
|
422 |
+
_.is.jq = function(value){
|
423 |
+
return !_.is.undef($) && value instanceof $;
|
424 |
+
};
|
425 |
+
|
426 |
+
/**
|
427 |
+
* @summary Checks if the `value` is a number.
|
428 |
+
* @memberof FooGallery.utils.is
|
429 |
+
* @function number
|
430 |
+
* @param {*} value - The value to check.
|
431 |
+
* @returns {boolean}
|
432 |
+
* @example {@run true}
|
433 |
+
* // alias the FooGallery.utils.is namespace
|
434 |
+
* var _is = FooGallery.utils.is;
|
435 |
+
*
|
436 |
+
* console.log( _is.number( 123 ) ); // => true
|
437 |
+
* console.log( _is.number( undefined ) ); // => false
|
438 |
+
* console.log( _is.number( null ) ); // => false
|
439 |
+
* console.log( _is.number( "" ) ); // => false
|
440 |
+
*/
|
441 |
+
_.is.number = function (value) {
|
442 |
+
return '[object Number]' === Object.prototype.toString.call(value) && !isNaN(value);
|
443 |
+
};
|
444 |
+
|
445 |
+
/**
|
446 |
+
* @summary Checks if the `value` is an object.
|
447 |
+
* @memberof FooGallery.utils.is
|
448 |
+
* @function object
|
449 |
+
* @param {*} value - The value to check.
|
450 |
+
* @returns {boolean} `true` if the supplied `value` is an object.
|
451 |
+
* @example {@run true}
|
452 |
+
* // alias the FooGallery.utils.is namespace
|
453 |
+
* var _is = FooGallery.utils.is;
|
454 |
+
*
|
455 |
+
* console.log( _is.object( {"some": "prop"} ) ); // => true
|
456 |
+
* console.log( _is.object( {} ) ); // => true
|
457 |
+
* console.log( _is.object( window ) ); // => true
|
458 |
+
* console.log( _is.object( document ) ); // => true
|
459 |
+
* console.log( _is.object( undefined ) ); // => false
|
460 |
+
* console.log( _is.object( null ) ); // => false
|
461 |
+
* console.log( _is.object( "" ) ); // => false
|
462 |
+
* console.log( _is.object( 123 ) ); // => false
|
463 |
+
*/
|
464 |
+
_.is.object = function (value) {
|
465 |
+
return '[object Object]' === Object.prototype.toString.call(value) && !_.is.undef(value) && value !== null;
|
466 |
+
};
|
467 |
+
|
468 |
+
/**
|
469 |
+
* @summary Checks if the `value` is a promise.
|
470 |
+
* @memberof FooGallery.utils.is
|
471 |
+
* @function promise
|
472 |
+
* @param {*} value - The object to check.
|
473 |
+
* @returns {boolean} `true` if the supplied `value` is an object.
|
474 |
+
* @description This is a simple check to determine if an object is a jQuery promise object. It simply checks the object has a `then` and `promise` function defined.
|
475 |
+
*
|
476 |
+
* The promise object is created as an object literal inside of `jQuery.Deferred`, it has no prototype, nor any other truly unique properties that could be used to distinguish it.
|
477 |
+
*
|
478 |
+
* This method should be a little more accurate than the internal jQuery one that simply checks for a `promise` function.
|
479 |
+
* @example {@run true}
|
480 |
+
* // alias the FooGallery.utils.is namespace
|
481 |
+
* var _is = FooGallery.utils.is;
|
482 |
+
*
|
483 |
+
* console.log( _is.promise( $.Deferred() ) ); // => true
|
484 |
+
* console.log( _is.promise( {} ) ); // => false
|
485 |
+
* console.log( _is.promise( undefined ) ); // => false
|
486 |
+
* console.log( _is.promise( null ) ); // => false
|
487 |
+
* console.log( _is.promise( "" ) ); // => false
|
488 |
+
* console.log( _is.promise( 123 ) ); // => false
|
489 |
+
*/
|
490 |
+
_.is.promise = function(value){
|
491 |
+
return _.is.object(value) && _.is.fn(value.then) && _.is.fn(value.promise);
|
492 |
+
};
|
493 |
+
|
494 |
+
/**
|
495 |
+
* @summary Checks if the `value` is a valid CSS length.
|
496 |
+
* @memberof FooGallery.utils.is
|
497 |
+
* @function size
|
498 |
+
* @param {*} value - The value to check.
|
499 |
+
* @returns {boolean} `true` if the `value` is a number or CSS length.
|
500 |
+
* @example {@run true}
|
501 |
+
* // alias the FooGallery.utils.is namespace
|
502 |
+
* var _is = FooGallery.utils.is;
|
503 |
+
*
|
504 |
+
* console.log( _is.size( 80 ) ); // => true
|
505 |
+
* console.log( _is.size( "80px" ) ); // => true
|
506 |
+
* console.log( _is.size( "80em" ) ); // => true
|
507 |
+
* console.log( _is.size( "80%" ) ); // => true
|
508 |
+
* console.log( _is.size( {} ) ); // => false
|
509 |
+
* console.log( _is.size( undefined ) ); // => false
|
510 |
+
* console.log( _is.size( null ) ); // => false
|
511 |
+
* console.log( _is.size( "" ) ); // => false
|
512 |
+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/CSS/length|<length> - CSS | MDN} for more information on CSS length values.
|
513 |
+
*/
|
514 |
+
_.is.size = function(value){
|
515 |
+
if (!(_.is.string(value) && !_.is.empty(value)) && !_.is.number(value)) return false;
|
516 |
+
return /^(auto|none|(?:[\d\.]*)+?(?:%|px|mm|q|cm|in|pt|pc|em|ex|ch|rem|vh|vw|vmin|vmax)?)$/.test(value);
|
517 |
+
};
|
518 |
+
|
519 |
+
/**
|
520 |
+
* @summary Checks if the `value` is a string.
|
521 |
+
* @memberof FooGallery.utils.is
|
522 |
+
* @function string
|
523 |
+
* @param {*} value - The value to check.
|
524 |
+
* @returns {boolean} `true` if the `value` is a string.
|
525 |
+
* @example {@run true}
|
526 |
+
* // alias the FooGallery.utils.is namespace
|
527 |
+
* var _is = FooGallery.utils.is;
|
528 |
+
*
|
529 |
+
* console.log( _is.string( "" ) ); // => true
|
530 |
+
* console.log( _is.string( undefined ) ); // => false
|
531 |
+
* console.log( _is.string( null ) ); // => false
|
532 |
+
* console.log( _is.string( 123 ) ); // => false
|
533 |
+
*/
|
534 |
+
_.is.string = function (value) {
|
535 |
+
return '[object String]' === Object.prototype.toString.call(value);
|
536 |
+
};
|
537 |
+
|
538 |
+
/**
|
539 |
+
* @summary Checks if the `value` is `undefined`.
|
540 |
+
* @memberof FooGallery.utils.is
|
541 |
+
* @function undef
|
542 |
+
* @param {*} value - The value to check is undefined.
|
543 |
+
* @returns {boolean} `true` if the supplied `value` is `undefined`.
|
544 |
+
* @example {@run true}
|
545 |
+
* // alias the FooGallery.utils.is namespace
|
546 |
+
* var _is = FooGallery.utils.is;
|
547 |
+
*
|
548 |
+
* console.log( _is.undef( undefined ) ); // => true
|
549 |
+
* console.log( _is.undef( null ) ); // => false
|
550 |
+
* console.log( _is.undef( 123 ) ); // => false
|
551 |
+
* console.log( _is.undef( "" ) ); // => false
|
552 |
+
*/
|
553 |
+
_.is.undef = function (value) {
|
554 |
+
return typeof value === 'undefined';
|
555 |
+
};
|
556 |
+
|
557 |
+
})(
|
558 |
+
// dependencies
|
559 |
+
FooGallery.utils.$,
|
560 |
+
FooGallery.utils
|
561 |
+
);
|
562 |
+
(function($, _, _is){
|
563 |
+
// only register methods if this version is the current version
|
564 |
+
if (_.version !== '0.0.5') return;
|
565 |
+
|
566 |
+
/**
|
567 |
+
* @memberof FooGallery.utils
|
568 |
+
* @namespace fn
|
569 |
+
* @summary Contains common function utility methods.
|
570 |
+
*/
|
571 |
+
_.fn = {};
|
572 |
+
|
573 |
+
var fnStr = Function.prototype.toString;
|
574 |
+
|
575 |
+
/**
|
576 |
+
* @summary The regular expression to test if a function uses the `this._super` method applied by the {@link FooGallery.utils.fn.add} method.
|
577 |
+
* @memberof FooGallery.utils.fn
|
578 |
+
* @name CONTAINS_SUPER
|
579 |
+
* @type {RegExp}
|
580 |
+
* @default /\b_super\b/
|
581 |
+
* @readonly
|
582 |
+
* @description When the script is first loaded into the page this performs a quick check to see if the browser supports function decompilation. If it does the regular expression is set to match the expected `_super`, however if function decompilation is not supported, the regular expression is set to match anything effectively making the test always return `true`.
|
583 |
+
* @example {@run true}
|
584 |
+
* // alias the FooGallery.utils.fn namespace
|
585 |
+
* var _fn = FooGallery.utils.fn;
|
586 |
+
*
|
587 |
+
* // create some functions to test
|
588 |
+
* function testFn1(){}
|
589 |
+
* function testFn2(){
|
590 |
+
* this._super();
|
591 |
+
* }
|
592 |
+
*
|
593 |
+
* console.log( _fn.CONTAINS_SUPER.test( testFn1 ) ); // => false
|
594 |
+
* console.log( _fn.CONTAINS_SUPER.test( testFn2 ) ); // => true
|
595 |
+
*
|
596 |
+
* // NOTE: in browsers that don't support functional decompilation both tests will return `true`
|
597 |
+
*/
|
598 |
+
_.fn.CONTAINS_SUPER = /xyz/.test(fnStr.call(function(){
|
599 |
+
//noinspection JSUnresolvedVariable,BadExpressionStatementJS
|
600 |
+
xyz;
|
601 |
+
})) ? /\b_super\b/ : /.*/;
|
602 |
+
|
603 |
+
/**
|
604 |
+
* @summary Adds or overrides the given method `name` on the `proto` using the supplied `fn`.
|
605 |
+
* @memberof FooGallery.utils.fn
|
606 |
+
* @function addOrOverride
|
607 |
+
* @param {Object} proto - The prototype to add the method to.
|
608 |
+
* @param {string} name - The name of the method to add, if this already exists the original will be exposed within the scope of the supplied `fn` as `this._super`.
|
609 |
+
* @param {function} fn - The function to add to the prototype, if this is overriding an existing method you can use `this._super` to access the original within its' scope.
|
610 |
+
* @description If the new method overrides a pre-existing one, this function will expose the overridden method as `this._super` within the new methods scope.
|
611 |
+
*
|
612 |
+
* This replaces having to write out the following to override a method and call its original:
|
613 |
+
*
|
614 |
+
* ```javascript
|
615 |
+
* var original = MyClass.prototype.someMethod;
|
616 |
+
* MyClass.prototype.someMethod = function(arg1, arg2){
|
617 |
+
* // execute the original
|
618 |
+
* original.call(this, arg1, arg2);
|
619 |
+
* };
|
620 |
+
* ```
|
621 |
+
*
|
622 |
+
* With the following:
|
623 |
+
*
|
624 |
+
* ```javascript
|
625 |
+
* FooGallery.utils.fn.addOrOverride( MyClass.prototype, "someMethod", function(arg1, arg2){
|
626 |
+
* // execute the original
|
627 |
+
* this._super(arg1, arg2);
|
628 |
+
* });
|
629 |
+
* ```
|
630 |
+
*
|
631 |
+
* This method is used by the {@link FooGallery.utils.Class} to implement the inheritance of individual methods.
|
632 |
+
* @example {@run true}
|
633 |
+
* // alias the FooGallery.utils.fn namespace
|
634 |
+
* var _fn = FooGallery.utils.fn;
|
635 |
+
*
|
636 |
+
* var proto = {
|
637 |
+
* write: function( message ){
|
638 |
+
* console.log( "Original#write: " + message );
|
639 |
+
* }
|
640 |
+
* };
|
641 |
+
*
|
642 |
+
* proto.write( "My message" ); // => "Original#write: My message"
|
643 |
+
*
|
644 |
+
* _fn.addOrOverride( proto, "write", function( message ){
|
645 |
+
* message = "Override#write: " + message;
|
646 |
+
* this._super( message );
|
647 |
+
* } );
|
648 |
+
*
|
649 |
+
* proto.write( "My message" ); // => "Original#write: Override#write: My message"
|
650 |
+
*/
|
651 |
+
_.fn.addOrOverride = function(proto, name, fn){
|
652 |
+
if (!_is.object(proto) || !_is.string(name) || _is.empty(name) || !_is.fn(fn)) return;
|
653 |
+
var _super = proto[name],
|
654 |
+
wrap = _is.fn(_super) && _.fn.CONTAINS_SUPER.test(fnStr.call(fn));
|
655 |
+
// only wrap the function if it overrides a method and makes use of `_super` within it's body.
|
656 |
+
proto[name] = wrap ?
|
657 |
+
(function (_super, fn) {
|
658 |
+
// create a new wrapped that exposes the original method as `_super`
|
659 |
+
return function () {
|
660 |
+
var tmp = this._super;
|
661 |
+
this._super = _super;
|
662 |
+
var ret = fn.apply(this, arguments);
|
663 |
+
this._super = tmp;
|
664 |
+
return ret;
|
665 |
+
};
|
666 |
+
})(_super, fn) : fn;
|
667 |
+
};
|
668 |
+
|
669 |
+
/**
|
670 |
+
* @summary Use the `Function.prototype.apply` method on a class constructor using the `new` keyword.
|
671 |
+
* @memberof FooGallery.utils.fn
|
672 |
+
* @function apply
|
673 |
+
* @param {Object} klass - The class to create.
|
674 |
+
* @param {Array} [args=[]] - The arguments to pass to the constructor.
|
675 |
+
* @returns {function} The new instance of the `klass` created with the supplied `args`.
|
676 |
+
* @description When using the default `Function.prototype.apply` you can't use it on class constructors requiring the `new` keyword, this method allows us to do that.
|
677 |
+
* @example {@run true}
|
678 |
+
* // alias the FooGallery.utils.fn namespace
|
679 |
+
* var _fn = FooGallery.utils.fn;
|
680 |
+
*
|
681 |
+
* // create a class to test with
|
682 |
+
* function Test( name, value ){
|
683 |
+
* if ( !( this instanceof Test )){
|
684 |
+
* console.log( "Test instantiated without the `new` keyword." );
|
685 |
+
* return;
|
686 |
+
* }
|
687 |
+
* console.log( "Test: name = " + name + ", value = " + value );
|
688 |
+
* }
|
689 |
+
*
|
690 |
+
* Test.apply( Test, ["My name", "My value"] ); // => "Test instantiated without the `new` keyword."
|
691 |
+
* _fn.apply( Test, ["My name", "My value"] ); // => "Test: name = My name, value = My value"
|
692 |
+
*/
|
693 |
+
_.fn.apply = function(klass, args){
|
694 |
+
args = _is.array(args) ? args : [];
|
695 |
+
function Class() {
|
696 |
+
return klass.apply(this, args);
|
697 |
+
}
|
698 |
+
Class.prototype = klass.prototype;
|
699 |
+
//noinspection JSValidateTypes
|
700 |
+
return new Class();
|
701 |
+
};
|
702 |
+
|
703 |
+
/**
|
704 |
+
* @summary Converts the default `arguments` object into a proper array.
|
705 |
+
* @memberof FooGallery.utils.fn
|
706 |
+
* @function arg2arr
|
707 |
+
* @param {Arguments} args - The arguments object to create an array from.
|
708 |
+
* @returns {Array}
|
709 |
+
* @description This method is simply a replacement for calling `Array.prototype.slice.call()` to create an array from an `arguments` object.
|
710 |
+
* @example {@run true}
|
711 |
+
* // alias the FooGallery.utils.fn namespace
|
712 |
+
* var _fn = FooGallery.utils.fn;
|
713 |
+
*
|
714 |
+
* function callMe(){
|
715 |
+
* var args = _fn.arg2arr(arguments);
|
716 |
+
* console.log( arguments instanceof Array ); // => false
|
717 |
+
* console.log( args instanceof Array ); // => true
|
718 |
+
* console.log( args ); // => [ "arg1", "arg2" ]
|
719 |
+
* }
|
720 |
+
*
|
721 |
+
* callMe("arg1", "arg2");
|
722 |
+
*/
|
723 |
+
_.fn.arg2arr = function(args){
|
724 |
+
return Array.prototype.slice.call(args);
|
725 |
+
};
|
726 |
+
|
727 |
+
/**
|
728 |
+
* @summary Checks the given `value` and ensures a function is returned.
|
729 |
+
* @memberof FooGallery.utils.fn
|
730 |
+
* @function check
|
731 |
+
* @param {?Object} thisArg=window - The `this` keyword within the returned function, if the supplied value is not an object this defaults to the `window`.
|
732 |
+
* @param {*} value - The value to check, if not a function or the name of one then the `def` value is automatically returned.
|
733 |
+
* @param {function} [def=jQuery.noop] - A default function to use if the `value` is not resolved to a function.
|
734 |
+
* @param {Object} [ctx=window] - If the `value` is a string this is supplied to the {@link FooGallery.utils.fn.fetch} method as the content to retrieve the function from.
|
735 |
+
* @returns {function} A function that ensures the correct context is applied when executed.
|
736 |
+
* @description This function is primarily used to check the value of a callback option that could be supplied as either a function or a string.
|
737 |
+
*
|
738 |
+
* When just the function name is supplied this method uses the {@link FooGallery.utils.fn.fetch} method to resolve and wrap it to ensure when it's called the correct context is applied.
|
739 |
+
*
|
740 |
+
* Being able to resolve a function from a name allows callbacks to be easily set even through data attributes as you can just supply the full function name as a string and then use this method to retrieve the actual function.
|
741 |
+
* @example {@run true}
|
742 |
+
* // alias the FooGallery.utils.fn namespace
|
743 |
+
* var _fn = FooGallery.utils.fn;
|
744 |
+
*
|
745 |
+
* // a simple `api` with a `sendMessage` function
|
746 |
+
* window.api = {
|
747 |
+
* sendMessage: function(){
|
748 |
+
* this.write( "window.api.sendMessage" );
|
749 |
+
* },
|
750 |
+
* child: {
|
751 |
+
* api: {
|
752 |
+
* sendMessage: function(){
|
753 |
+
* this.write( "window.api.child.api.sendMessage" );
|
754 |
+
* }
|
755 |
+
* }
|
756 |
+
* }
|
757 |
+
* };
|
758 |
+
*
|
759 |
+
* // a default function to use in case the check fails
|
760 |
+
* var def = function(){
|
761 |
+
* this.write( "default" );
|
762 |
+
* };
|
763 |
+
*
|
764 |
+
* // an object to use as the `this` object within the scope of the checked functions
|
765 |
+
* var thisArg = {
|
766 |
+
* write: function( message ){
|
767 |
+
* console.log( message );
|
768 |
+
* }
|
769 |
+
* };
|
770 |
+
*
|
771 |
+
* // check the value and return a wrapped function ensuring the correct context.
|
772 |
+
* var fn = _fn.check( thisArg, null, def );
|
773 |
+
* fn(); // => "default"
|
774 |
+
*
|
775 |
+
* fn = _fn.check( thisArg, "api.doesNotExist", def );
|
776 |
+
* fn(); // => "default"
|
777 |
+
*
|
778 |
+
* fn = _fn.check( thisArg, api.sendMessage, def );
|
779 |
+
* fn(); // => "window.api.sendMessage"
|
780 |
+
*
|
781 |
+
* fn = _fn.check( thisArg, "api.sendMessage", def );
|
782 |
+
* fn(); // => "window.api.sendMessage"
|
783 |
+
*
|
784 |
+
* fn = _fn.check( thisArg, "api.sendMessage", def, window.api.child );
|
785 |
+
* fn(); // => "window.api.child.api.sendMessage"
|
786 |
+
*/
|
787 |
+
_.fn.check = function(thisArg, value, def, ctx){
|
788 |
+
def = _is.fn(def) ? def : $.noop;
|
789 |
+
thisArg = _is.object(thisArg) ? thisArg : window;
|
790 |
+
function wrap(fn){
|
791 |
+
return function(){
|
792 |
+
return fn.apply(thisArg, arguments);
|
793 |
+
};
|
794 |
+
}
|
795 |
+
value = _is.string(value) ? _.fn.fetch(value, ctx) : value;
|
796 |
+
return _is.fn(value) ? wrap(value) : wrap(def);
|
797 |
+
};
|
798 |
+
|
799 |
+
/**
|
800 |
+
* @summary Fetches a function given its `name`.
|
801 |
+
* @memberof FooGallery.utils.fn
|
802 |
+
* @function fetch
|
803 |
+
* @param {string} name - The name of the function to fetch. This can be a `.` notated name.
|
804 |
+
* @param {Object} [ctx=window] - The context to retrieve the function from, defaults to the `window` object.
|
805 |
+
* @returns {?function} `null` if a function with the given name is not found within the context.
|
806 |
+
* @example {@run true}
|
807 |
+
* // alias the FooGallery.utils.fn namespace
|
808 |
+
* var _fn = FooGallery.utils.fn;
|
809 |
+
*
|
810 |
+
* // create a dummy `api` with a `sendMessage` function to test
|
811 |
+
* window.api = {
|
812 |
+
* sendMessage: function( message ){
|
813 |
+
* console.log( "api.sendMessage: " + message );
|
814 |
+
* }
|
815 |
+
* };
|
816 |
+
*
|
817 |
+
* // the below shows 3 different ways to fetch the `sendMessage` function
|
818 |
+
* var send1 = _fn.fetch( "api.sendMessage" );
|
819 |
+
* var send2 = _fn.fetch( "api.sendMessage", window );
|
820 |
+
* var send3 = _fn.fetch( "sendMessage", window.api );
|
821 |
+
*
|
822 |
+
* // all the retrieved methods should be the same
|
823 |
+
* console.log( send1 === send2 && send2 === send3 ); // => true
|
824 |
+
*
|
825 |
+
* // check if the function was found
|
826 |
+
* if ( send1 != null ){
|
827 |
+
* send1( "My message" ); // => "api.sendMessage: My message"
|
828 |
+
* }
|
829 |
+
*/
|
830 |
+
_.fn.fetch = function(name, ctx){
|
831 |
+
if (!_is.string(name) || _is.empty(name)) return null;
|
832 |
+
ctx = _is.object(ctx) ? ctx : window;
|
833 |
+
$.each(name.split('.'), function(i, part){
|
834 |
+
if (ctx[part]) ctx = ctx[part];
|
835 |
+
else return false;
|
836 |
+
});
|
837 |
+
return _is.fn(ctx) ? ctx : null;
|
838 |
+
};
|
839 |
+
|
840 |
+
/**
|
841 |
+
* @summary Enqueues methods using the given `name` from all supplied `objects` and executes each in order with the given arguments.
|
842 |
+
* @memberof FooGallery.utils.fn
|
843 |
+
* @function enqueue
|
844 |
+
* @param {Array.<Object>} objects - The objects to call the method on.
|
845 |
+
* @param {string} name - The name of the method to execute.
|
846 |
+
* @param {*} [arg1] - The first argument to call the method with.
|
847 |
+
* @param {...*} [argN] - Any additional arguments for the method.
|
848 |
+
* @returns {Promise} If `resolved` the first argument supplied to any success callbacks is an array of all returned value(s). These values are encapsulated within their own array as if the method returned a promise it could be resolved with more than one argument.
|
849 |
+
*
|
850 |
+
* If `rejected` any fail callbacks are supplied the arguments the promise was rejected with plus an additional one appended by this method, an array of all objects that have already had their methods run. This allows you to perform rollback operations if required after a failure. The last object in this array would contain the method that raised the error.
|
851 |
+
* @description This method allows an array of `objects` that implement a common set of methods to be executed in a supplied order. Each method in the queue is only executed after the successful completion of the previous. Success is evaluated as the method did not throw an error and if it returned a promise it was resolved.
|
852 |
+
*
|
853 |
+
* An example of this being used within the plugin is the loading and execution of methods on the various components. Using this method ensures components are loaded and have their methods executed in a static order regardless of when they were registered with the plugin or if the method is async. This way if `ComponentB`'s `preinit` relies on properties set in `ComponentA`'s `preinit` method you can register `ComponentB` with a lower priority than `ComponentA` and you can be assured `ComponentA`'s `preinit` completed successfully before `ComponentB`'s `preinit` is called event if it performs an async operation.
|
854 |
+
* @example {@caption Shows a basic example of how you can use this method.}{@run true}
|
855 |
+
* // alias the FooGallery.utils.fn namespace
|
856 |
+
* var _fn = FooGallery.utils.fn;
|
857 |
+
*
|
858 |
+
* // create some dummy objects that implement the same members or methods.
|
859 |
+
* var obj1 = {
|
860 |
+
* "name": "obj1",
|
861 |
+
* "appendName": function(str){
|
862 |
+
* console.log( "Executing obj1.appendName..." );
|
863 |
+
* return str + this.name;
|
864 |
+
* }
|
865 |
+
* };
|
866 |
+
*
|
867 |
+
* // this objects `appendName` method returns a promise
|
868 |
+
* var obj2 = {
|
869 |
+
* "name": "obj2",
|
870 |
+
* "appendName": function(str){
|
871 |
+
* console.log( "Executing obj2.appendName..." );
|
872 |
+
* var self = this;
|
873 |
+
* return $.Deferred(function(def){
|
874 |
+
* // use a setTimeout to delay execution
|
875 |
+
* setTimeout(function(){
|
876 |
+
* def.resolve(str + self.name);
|
877 |
+
* }, 300);
|
878 |
+
* });
|
879 |
+
* }
|
880 |
+
* };
|
881 |
+
*
|
882 |
+
* // this objects `appendName` method is only executed once obj2's promise is resolved
|
883 |
+
* var obj3 = {
|
884 |
+
* "name": "obj3",
|
885 |
+
* "appendName": function(str){
|
886 |
+
* console.log( "Executing obj3.appendName..." );
|
887 |
+
* return str + this.name;
|
888 |
+
* }
|
889 |
+
* };
|
890 |
+
*
|
891 |
+
* _fn.enqueue( [obj1, obj2, obj3], "appendName", "modified_by:" ).then(function(results){
|
892 |
+
* console.log( results ); // => [ [ "modified_by:obj1" ], [ "modified_by:obj2" ], [ "modified_by:obj3" ] ]
|
893 |
+
* });
|
894 |
+
* @example {@caption If an error is thrown by one of the called methods or it returns a promise that is rejected, execution is halted and any fail callbacks are executed. The last argument is an array of objects that have had their methods run, the last object within this array is the one that raised the error.}{@run true}
|
895 |
+
* // alias the FooGallery.utils.fn namespace
|
896 |
+
* var _fn = FooGallery.utils.fn;
|
897 |
+
*
|
898 |
+
* // create some dummy objects that implement the same members or methods.
|
899 |
+
* var obj1 = {
|
900 |
+
* "name": "obj1",
|
901 |
+
* "last": null,
|
902 |
+
* "appendName": function(str){
|
903 |
+
* console.log( "Executing obj1.appendName..." );
|
904 |
+
* return this.last = str + this.name;
|
905 |
+
* },
|
906 |
+
* "rollback": function(){
|
907 |
+
* console.log( "Executing obj1.rollback..." );
|
908 |
+
* this.last = null;
|
909 |
+
* }
|
910 |
+
* };
|
911 |
+
*
|
912 |
+
* // this objects `appendName` method throws an error
|
913 |
+
* var obj2 = {
|
914 |
+
* "name": "obj2",
|
915 |
+
* "last": null,
|
916 |
+
* "appendName": function(str){
|
917 |
+
* console.log( "Executing obj2.appendName..." );
|
918 |
+
* //throw new Error("Oops, something broke.");
|
919 |
+
* var self = this;
|
920 |
+
* return $.Deferred(function(def){
|
921 |
+
* // use a setTimeout to delay execution
|
922 |
+
* setTimeout(function(){
|
923 |
+
* self.last = str + self.name;
|
924 |
+
* def.reject(Error("Oops, something broke."));
|
925 |
+
* }, 300);
|
926 |
+
* });
|
927 |
+
* },
|
928 |
+
* "rollback": function(){
|
929 |
+
* console.log( "Executing obj2.rollback..." );
|
930 |
+
* this.last = null;
|
931 |
+
* }
|
932 |
+
* };
|
933 |
+
*
|
934 |
+
* // this objects `appendName` and `rollback` methods are never executed
|
935 |
+
* var obj3 = {
|
936 |
+
* "name": "obj3",
|
937 |
+
* "last": null,
|
938 |
+
* "appendName": function(str){
|
939 |
+
* console.log( "Executing obj3.appendName..." );
|
940 |
+
* return this.last = str + this.name;
|
941 |
+
* },
|
942 |
+
* "rollback": function(){
|
943 |
+
* console.log( "Executing obj3.rollback..." );
|
944 |
+
* this.last = null;
|
945 |
+
* }
|
946 |
+
* };
|
947 |
+
*
|
948 |
+
* _fn.enqueue( [obj1, obj2, obj3], "appendName", "modified_by:" ).fail(function(err, run){
|
949 |
+
* console.log( err.message ); // => "Oops, something broke."
|
950 |
+
* console.log( run ); // => [ {"name":"obj1","last":"modified_by:obj1"}, {"name":"obj2","last":"modified_by:obj2"} ]
|
951 |
+
* var guilty = run[run.length - 1];
|
952 |
+
* console.log( "Error thrown by: " + guilty.name ); // => "obj2"
|
953 |
+
* run.reverse(); // reverse execution when rolling back to avoid dependency issues
|
954 |
+
* return _fn.enqueue( run, "rollback" ).then(function(){
|
955 |
+
* console.log( "Error handled and rollback performed." );
|
956 |
+
* console.log( run ); // => [ {"name":"obj1","last":null}, {"name":"obj2","last":null} ]
|
957 |
+
* });
|
958 |
+
* });
|
959 |
+
*/
|
960 |
+
_.fn.enqueue = function(objects, name, arg1, argN){
|
961 |
+
var args = _.fn.arg2arr(arguments), // get an array of all supplied arguments
|
962 |
+
def = $.Deferred(), // the main deferred object for the function
|
963 |
+
queue = $.Deferred(), // the deferred object to use as an queue
|
964 |
+
promise = queue.promise(), // used to register component methods for execution
|
965 |
+
results = [], // stores the results of each method to be returned by the main deferred
|
966 |
+
run = [], // stores each object once its' method has been run
|
967 |
+
first = true; // whether or not this is the first resolve callback
|
968 |
+
|
969 |
+
// take the objects and name parameters out of the args array
|
970 |
+
objects = args.shift();
|
971 |
+
name = args.shift();
|
972 |
+
|
973 |
+
// safely execute a function, catch any errors and reject the deferred if required.
|
974 |
+
function safe(obj, method){
|
975 |
+
try {
|
976 |
+
run.push(obj);
|
977 |
+
return method.apply(obj, args);
|
978 |
+
} catch(err) {
|
979 |
+
def.reject(err, run);
|
980 |
+
return def;
|
981 |
+
}
|
982 |
+
}
|
983 |
+
|
984 |
+
// loop through all the supplied objects
|
985 |
+
$.each(objects, function(i, obj){
|
986 |
+
// if the obj has a function with the supplied name
|
987 |
+
if (_is.fn(obj[name])){
|
988 |
+
// then register the method in the callback queue
|
989 |
+
promise = promise.then(function(){
|
990 |
+
// only register the result if this is not the first resolve callback, the first is triggered by this function kicking off the queue
|
991 |
+
if (!first){
|
992 |
+
var resolveArgs = _.fn.arg2arr(arguments);
|
993 |
+
results.push(resolveArgs);
|
994 |
+
}
|
995 |
+
first = false;
|
996 |
+
// execute the method and return it's result, if the result is a promise
|
997 |
+
// the next method will only be executed once it's resolved
|
998 |
+
return safe(obj, obj[name]);
|
999 |
+
});
|
1000 |
+
}
|
1001 |
+
});
|
1002 |
+
|
1003 |
+
// add one last callback to catch the final result
|
1004 |
+
promise.then(function(){
|
1005 |
+
// only register the result if this is not the first resolve callback
|
1006 |
+
if (!first){
|
1007 |
+
var resolveArgs = _.fn.arg2arr(arguments);
|
1008 |
+
results.push(resolveArgs);
|
1009 |
+
}
|
1010 |
+
first = false;
|
1011 |
+
// resolve the main deferred with the array of all the method results
|
1012 |
+
def.resolve(results);
|
1013 |
+
});
|
1014 |
+
|
1015 |
+
// hook into failures and ensure the run array is appended to the args
|
1016 |
+
promise.fail(function(){
|
1017 |
+
var rejectArgs = _.fn.arg2arr(arguments);
|
1018 |
+
rejectArgs.push(run);
|
1019 |
+
def.reject.apply(def, rejectArgs);
|
1020 |
+
});
|
1021 |
+
|
1022 |
+
// kick off the queue
|
1023 |
+
queue.resolve();
|
1024 |
+
|
1025 |
+
return def.promise();
|
1026 |
+
};
|
1027 |
+
|
1028 |
+
/**
|
1029 |
+
* @summary Waits for the outcome of all promises regardless of failure and resolves supplying the results of just those that succeeded.
|
1030 |
+
* @memberof FooGallery.utils.fn
|
1031 |
+
* @function when
|
1032 |
+
* @param {Promise[]} promises - The array of promises to wait for.
|
1033 |
+
* @returns {Promise}
|
1034 |
+
*/
|
1035 |
+
_.fn.when = function(promises){
|
1036 |
+
if (!_is.array(promises) || _is.empty(promises)) return $.when();
|
1037 |
+
var d = $.Deferred(), results = [], remaining = promises.length;
|
1038 |
+
for(var i = 0; i < promises.length; i++){
|
1039 |
+
promises[i].then(function(res){
|
1040 |
+
results.push(res); // on success, add to results
|
1041 |
+
}).always(function(){
|
1042 |
+
remaining--; // always mark as finished
|
1043 |
+
if(!remaining) d.resolve(results);
|
1044 |
+
})
|
1045 |
+
}
|
1046 |
+
return d.promise(); // return a promise on the remaining values
|
1047 |
+
};
|
1048 |
+
|
1049 |
+
/**
|
1050 |
+
* @summary Return a promise rejected using the supplied args.
|
1051 |
+
* @memberof FooGallery.utils.fn
|
1052 |
+
* @function rejectWith
|
1053 |
+
* @param {*} [arg1] - The first argument to reject the promise with.
|
1054 |
+
* @param {...*} [argN] - Any additional arguments to reject the promise with.
|
1055 |
+
* @returns {Promise}
|
1056 |
+
*/
|
1057 |
+
_.fn.rejectWith = function(arg1, argN){
|
1058 |
+
var def = $.Deferred(), args = _.fn.arg2arr(arguments);
|
1059 |
+
return def.reject.apply(def, args).promise();
|
1060 |
+
};
|
1061 |
+
|
1062 |
+
/**
|
1063 |
+
* @summary Return a promise resolved using the supplied args.
|
1064 |
+
* @memberof FooGallery.utils.fn
|
1065 |
+
* @function resolveWith
|
1066 |
+
* @param {*} [arg1] - The first argument to resolve the promise with.
|
1067 |
+
* @param {...*} [argN] - Any additional arguments to resolve the promise with.
|
1068 |
+
* @returns {Promise}
|
1069 |
+
*/
|
1070 |
+
_.fn.resolveWith = function(arg1, argN){
|
1071 |
+
var def = $.Deferred(), args = _.fn.arg2arr(arguments);
|
1072 |
+
return def.resolve.apply(def, args).promise();
|
1073 |
+
};
|
1074 |
+
|
1075 |
+
/**
|
1076 |
+
* @summary A resolved promise object.
|
1077 |
+
* @memberof FooGallery.utils.fn
|
1078 |
+
* @name resolved
|
1079 |
+
* @type {Promise}
|
1080 |
+
*/
|
1081 |
+
_.fn.resolved = $.Deferred().resolve().promise();
|
1082 |
+
|
1083 |
+
/**
|
1084 |
+
* @summary A rejected promise object.
|
1085 |
+
* @memberof FooGallery.utils.fn
|
1086 |
+
* @name resolved
|
1087 |
+
* @type {Promise}
|
1088 |
+
*/
|
1089 |
+
_.fn.rejected = $.Deferred().reject().promise();
|
1090 |
+
|
1091 |
+
})(
|
1092 |
+
// dependencies
|
1093 |
+
FooGallery.utils.$,
|
1094 |
+
FooGallery.utils,
|
1095 |
+
FooGallery.utils.is
|
1096 |
+
);
|
1097 |
+
(function(_, _is){
|
1098 |
+
// only register methods if this version is the current version
|
1099 |
+
if (_.version !== '0.0.5') return;
|
1100 |
+
|
1101 |
+
/**
|
1102 |
+
* @summary Contains common url utility methods.
|
1103 |
+
* @memberof FooGallery.utils
|
1104 |
+
* @namespace url
|
1105 |
+
*/
|
1106 |
+
_.url = {};
|
1107 |
+
|
1108 |
+
// used for parsing a url into it's parts.
|
1109 |
+
var _a = document.createElement('a');
|
1110 |
+
|
1111 |
+
/**
|
1112 |
+
* @summary Parses the supplied url into an object containing it's component parts.
|
1113 |
+
* @memberof FooGallery.utils.url
|
1114 |
+
* @function parts
|
1115 |
+
* @param {string} url - The url to parse.
|
1116 |
+
* @returns {FooGallery.utils.url~Parts}
|
1117 |
+
* @example {@run true}
|
1118 |
+
* // alias the FooGallery.utils.url namespace
|
1119 |
+
* var _url = FooGallery.utils.url;
|
1120 |
+
*
|
1121 |
+
* console.log( _url.parts( "http://example.com/path/?param=true#something" ) ); // => {"hash":"#something", ...}
|
1122 |
+
*/
|
1123 |
+
_.url.parts = function(url){
|
1124 |
+
_a.href = url;
|
1125 |
+
return {
|
1126 |
+
hash: _a.hash, host: _a.host, hostname: _a.hostname, href: _a.href,
|
1127 |
+
origin: _a.origin, pathname: _a.pathname, port: _a.port,
|
1128 |
+
protocol: _a.protocol, search: _a.search
|
1129 |
+
};
|
1130 |
+
};
|
1131 |
+
|
1132 |
+
/**
|
1133 |
+
* @summary Given a <code>url</code> that could be relative or full this ensures a full url is returned.
|
1134 |
+
* @memberof FooGallery.utils.url
|
1135 |
+
* @function full
|
1136 |
+
* @param {string} url - The url to ensure is full.
|
1137 |
+
* @returns {?string} `null` if the given `path` is not a string or empty.
|
1138 |
+
* @description Given a full url this will simply return it however if given a relative url this will create a full url using the current location to fill in the blanks.
|
1139 |
+
* @example {@run true}
|
1140 |
+
* // alias the FooGallery.utils.url namespace
|
1141 |
+
* var _url = FooGallery.utils.url;
|
1142 |
+
*
|
1143 |
+
* console.log( _url.full( "http://example.com/path/" ) ); // => "http://example.com/path/"
|
1144 |
+
* console.log( _url.full( "/path/" ) ); // => "{protocol}//{host}/path/"
|
1145 |
+
* console.log( _url.full( "path/" ) ); // => "{protocol}//{host}/{pathname}/path/"
|
1146 |
+
* console.log( _url.full( "../path/" ) ); // => "{protocol}//{host}/{calculated pathname}/path/"
|
1147 |
+
* console.log( _url.full() ); // => null
|
1148 |
+
* console.log( _url.full( 123 ) ); // => null
|
1149 |
+
*/
|
1150 |
+
_.url.full = function(url){
|
1151 |
+
if (!_is.string(url) || _is.empty(url)) return null;
|
1152 |
+
_a.href = url;
|
1153 |
+
return _a.href;
|
1154 |
+
};
|
1155 |
+
|
1156 |
+
/**
|
1157 |
+
* @summary Gets or sets a parameter in the given <code>search</code> string.
|
1158 |
+
* @memberof FooGallery.utils.url
|
1159 |
+
* @function param
|
1160 |
+
* @param {string} search - The search string to use (usually `location.search`).
|
1161 |
+
* @param {string} key - The key of the parameter.
|
1162 |
+
* @param {string} [value] - The value to set for the parameter. If not provided the current value for the `key` is returned.
|
1163 |
+
* @returns {?string} The value of the `key` in the given `search` string if no `value` is supplied or `null` if the `key` does not exist.
|
1164 |
+
* @returns {string} A modified `search` string if a `value` is supplied.
|
1165 |
+
* @example <caption>Shows how to retrieve a parameter value from a search string.</caption>{@run true}
|
1166 |
+
* // alias the FooGallery.utils.url namespace
|
1167 |
+
* var _url = FooGallery.utils.url,
|
1168 |
+
* // create a search string to test
|
1169 |
+
* search = "?wmode=opaque&autoplay=1";
|
1170 |
+
*
|
1171 |
+
* console.log( _url.param( search, "wmode" ) ); // => "opaque"
|
1172 |
+
* console.log( _url.param( search, "autoplay" ) ); // => "1"
|
1173 |
+
* console.log( _url.param( search, "nonexistent" ) ); // => null
|
1174 |
+
* @example <caption>Shows how to set a parameter value in the given search string.</caption>{@run true}
|
1175 |
+
* // alias the FooGallery.utils.url namespace
|
1176 |
+
* var _url = FooGallery.utils.url,
|
1177 |
+
* // create a search string to test
|
1178 |
+
* search = "?wmode=opaque&autoplay=1";
|
1179 |
+
*
|
1180 |
+
* console.log( _url.param( search, "wmode", "window" ) ); // => "?wmode=window&autoplay=1"
|
1181 |
+
* console.log( _url.param( search, "autoplay", "0" ) ); // => "?wmode=opaque&autoplay=0"
|
1182 |
+
* console.log( _url.param( search, "v", "2" ) ); // => "?wmode=opaque&autoplay=1&v=2"
|
1183 |
+
*/
|
1184 |
+
_.url.param = function(search, key, value){
|
1185 |
+
if (!_is.string(search) || _is.empty(search) || !_is.string(key) || _is.empty(key)) return search;
|
1186 |
+
var regex, match, result, param;
|
1187 |
+
if (_is.undef(value)){
|
1188 |
+
regex = new RegExp('[?|&]' + key + '=([^&;]+?)(&|#|;|$)'); // regex to match the key and it's value but only capture the value
|
1189 |
+
match = regex.exec(search) || [,""]; // match the param otherwise return an empty string match
|
1190 |
+
result = match[1].replace(/\+/g, '%20'); // replace any + character's with spaces
|
1191 |
+
return _is.string(result) && !_is.empty(result) ? decodeURIComponent(result) : null; // decode the result otherwise return null
|
1192 |
+
}
|
1193 |
+
if (value === "" || value === null){
|
1194 |
+
regex = new RegExp('^([^#]*\?)(([^#]*)&)?' + key + '(\=[^&#]*)?(&|#|$)');
|
1195 |
+
result = search.replace(regex, '$1$3$5').replace(/^([^#]*)((\?)&|\?(#|$))/,'$1$3$4');
|
1196 |
+
} else {
|
1197 |
+
regex = new RegExp('([?&])' + key + '[^&]*'); // regex to match the key and it's current value but only capture the preceding ? or & char
|
1198 |
+
param = key + '=' + encodeURIComponent(value);
|
1199 |
+
result = search.replace(regex, '$1' + param); // replace any existing instance of the key with the new value
|
1200 |
+
// If nothing was replaced, then add the new param to the end
|
1201 |
+
if (result === search && !regex.test(result)) { // if no replacement occurred and the parameter is not currently in the result then add it
|
1202 |
+
result += '&' + param;
|
1203 |
+
}
|
1204 |
+
}
|
1205 |
+
return result;
|
1206 |
+
};
|
1207 |
+
|
1208 |
+
//######################
|
1209 |
+
//## Type Definitions ##
|
1210 |
+
//######################
|
1211 |
+
|
1212 |
+
/**
|
1213 |
+
* @summary A plain JavaScript object returned by the {@link FooGallery.utils.url.parts} method.
|
1214 |
+
* @typedef {Object} FooGallery.utils.url~Parts
|
1215 |
+
* @property {string} hash - A string containing a `#` followed by the fragment identifier of the URL.
|
1216 |
+
* @property {string} host - A string containing the host, that is the hostname, a `:`, and the port of the URL.
|
1217 |
+
* @property {string} hostname - A string containing the domain of the URL.
|
1218 |
+
* @property {string} href - A string containing the entire URL.
|
1219 |
+
* @property {string} origin - A string containing the canonical form of the origin of the specific location.
|
1220 |
+
* @property {string} pathname - A string containing an initial `/` followed by the path of the URL.
|
1221 |
+
* @property {string} port - A string containing the port number of the URL.
|
1222 |
+
* @property {string} protocol - A string containing the protocol scheme of the URL, including the final `:`.
|
1223 |
+
* @property {string} search - A string containing a `?` followed by the parameters of the URL. Also known as "querystring".
|
1224 |
+
* @see {@link FooGallery.utils.url.parts} for example usage.
|
1225 |
+
*/
|
1226 |
+
|
1227 |
+
})(
|
1228 |
+
// dependencies
|
1229 |
+
FooGallery.utils,
|
1230 |
+
FooGallery.utils.is
|
1231 |
+
);
|
1232 |
+
(function (_, _is, _fn) {
|
1233 |
+
// only register methods if this version is the current version
|
1234 |
+
if (_.version !== '0.0.5') return;
|
1235 |
+
|
1236 |
+
/**
|
1237 |
+
* @summary Contains common string utility methods.
|
1238 |
+
* @memberof FooGallery.utils
|
1239 |
+
* @namespace str
|
1240 |
+
*/
|
1241 |
+
_.str = {};
|
1242 |
+
|
1243 |
+
/**
|
1244 |
+
* @summary Converts the given `target` to camel case.
|
1245 |
+
* @memberof FooGallery.utils.str
|
1246 |
+
* @function camel
|
1247 |
+
* @param {string} target - The string to camel case.
|
1248 |
+
* @returns {string}
|
1249 |
+
* @example {@run true}
|
1250 |
+
* // alias the FooGallery.utils.str namespace
|
1251 |
+
* var _str = FooGallery.utils.str;
|
1252 |
+
*
|
1253 |
+
* console.log( _str.camel( "max-width" ) ); // => "maxWidth"
|
1254 |
+
* console.log( _str.camel( "max--width" ) ); // => "maxWidth"
|
1255 |
+
* console.log( _str.camel( "max Width" ) ); // => "maxWidth"
|
1256 |
+
* console.log( _str.camel( "Max_width" ) ); // => "maxWidth"
|
1257 |
+
* console.log( _str.camel( "MaxWidth" ) ); // => "maxWidth"
|
1258 |
+
* console.log( _str.camel( "Abbreviations like CSS are left intact" ) ); // => "abbreviationsLikeCSSAreLeftIntact"
|
1259 |
+
*/
|
1260 |
+
_.str.camel = function (target) {
|
1261 |
+
if (_is.empty(target)) return target;
|
1262 |
+
if (target.toUpperCase() === target) return target.toLowerCase();
|
1263 |
+
return target.replace(/^([A-Z])|[-\s_]+(\w)/g, function (match, p1, p2) {
|
1264 |
+
if (_is.string(p2)) return p2.toUpperCase();
|
1265 |
+
return p1.toLowerCase();
|
1266 |
+
});
|
1267 |
+
};
|
1268 |
+
|
1269 |
+
/**
|
1270 |
+
* @summary Checks if the `target` contains the given `substr`.
|
1271 |
+
* @memberof FooGallery.utils.str
|
1272 |
+
* @function contains
|
1273 |
+
* @param {string} target - The string to check.
|
1274 |
+
* @param {string} substr - The string to check for.
|
1275 |
+
* @param {boolean} [ignoreCase=false] - Whether or not to ignore casing when performing the check.
|
1276 |
+
* @returns {boolean} `true` if the `target` contains the given `substr`.
|
1277 |
+
* @example {@run true}
|
1278 |
+
* // alias the FooGallery.utils.str namespace
|
1279 |
+
* var _str = FooGallery.utils.str,
|
1280 |
+
* // create a string to test
|
1281 |
+
* target = "To be, or not to be, that is the question.";
|
1282 |
+
*
|
1283 |
+
* console.log( _str.contains( target, "To be" ) ); // => true
|
1284 |
+
* console.log( _str.contains( target, "question" ) ); // => true
|
1285 |
+
* console.log( _str.contains( target, "no" ) ); // => true
|
1286 |
+
* console.log( _str.contains( target, "nonexistent" ) ); // => false
|
1287 |
+
* console.log( _str.contains( target, "TO BE" ) ); // => false
|
1288 |
+
* console.log( _str.contains( target, "TO BE", true ) ); // => true
|
1289 |
+
*/
|
1290 |
+
_.str.contains = function (target, substr, ignoreCase) {
|
1291 |
+
if (!_is.string(target) || _is.empty(target) || !_is.string(substr) || _is.empty(substr)) return false;
|
1292 |
+
return substr.length <= target.length
|
1293 |
+
&& (!!ignoreCase ? target.toUpperCase().indexOf(substr.toUpperCase()) : target.indexOf(substr)) !== -1;
|
1294 |
+
};
|
1295 |
+
|
1296 |
+
/**
|
1297 |
+
* @summary Checks if the `target` contains the given `word`.
|
1298 |
+
* @memberof FooGallery.utils.str
|
1299 |
+
* @function containsWord
|
1300 |
+
* @param {string} target - The string to check.
|
1301 |
+
* @param {string} word - The word to check for.
|
1302 |
+
* @param {boolean} [ignoreCase=false] - Whether or not to ignore casing when performing the check.
|
1303 |
+
* @returns {boolean} `true` if the `target` contains the given `word`.
|
1304 |
+
* @description This method differs from {@link FooGallery.utils.str.contains} in that it searches for whole words by splitting the `target` string on word boundaries (`\b`) and then comparing the individual parts.
|
1305 |
+
* @example {@run true}
|
1306 |
+
* // alias the FooGallery.utils.str namespace
|
1307 |
+
* var _str = FooGallery.utils.str,
|
1308 |
+
* // create a string to test
|
1309 |
+
* target = "To be, or not to be, that is the question.";
|
1310 |
+
*
|
1311 |
+
* console.log( _str.containsWord( target, "question" ) ); // => true
|
1312 |
+
* console.log( _str.containsWord( target, "no" ) ); // => false
|
1313 |
+
* console.log( _str.containsWord( target, "NOT" ) ); // => false
|
1314 |
+
* console.log( _str.containsWord( target, "NOT", true ) ); // => true
|
1315 |
+
* console.log( _str.containsWord( target, "nonexistent" ) ); // => false
|
1316 |
+
*/
|
1317 |
+
_.str.containsWord = function(target, word, ignoreCase){
|
1318 |
+
if (!_is.string(target) || _is.empty(target) || !_is.string(word) || _is.empty(word) || target.length < word.length)
|
1319 |
+
return false;
|
1320 |
+
var parts = target.split(/\W/);
|
1321 |
+
for (var i = 0, len = parts.length; i < len; i++){
|
1322 |
+
if (ignoreCase ? parts[i].toUpperCase() == word.toUpperCase() : parts[i] == word) return true;
|
1323 |
+
}
|
1324 |
+
return false;
|
1325 |
+
};
|
1326 |
+
|
1327 |
+
/**
|
1328 |
+
* @summary Checks if the `target` ends with the given `substr`.
|
1329 |
+
* @memberof FooGallery.utils.str
|
1330 |
+
* @function endsWith
|
1331 |
+
* @param {string} target - The string to check.
|
1332 |
+
* @param {string} substr - The substr to check for.
|
1333 |
+
* @returns {boolean} `true` if the `target` ends with the given `substr`.
|
1334 |
+
* @example {@run true}
|
1335 |
+
* // alias the FooGallery.utils.str namespace
|
1336 |
+
* var _str = FooGallery.utils.str;
|
1337 |
+
*
|
1338 |
+
* console.log( _str.endsWith( "something", "g" ) ); // => true
|
1339 |
+
* console.log( _str.endsWith( "something", "ing" ) ); // => true
|
1340 |
+
* console.log( _str.endsWith( "something", "no" ) ); // => false
|
1341 |
+
*/
|
1342 |
+
_.str.endsWith = function (target, substr) {
|
1343 |
+
if (!_is.string(target) || _is.empty(target) || !_is.string(substr) || _is.empty(substr)) return target == substr;
|
1344 |
+
return target.slice(target.length - substr.length) == substr;
|
1345 |
+
};
|
1346 |
+
|
1347 |
+
/**
|
1348 |
+
* @summary Escapes the `target` for use in a regular expression.
|
1349 |
+
* @memberof FooGallery.utils.str
|
1350 |
+
* @function escapeRegExp
|
1351 |
+
* @param {string} target - The string to escape.
|
1352 |
+
* @returns {string}
|
1353 |
+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions|Regular Expressions: Using Special Characters - JavaScript | MDN}
|
1354 |
+
*/
|
1355 |
+
_.str.escapeRegExp = function(target){
|
1356 |
+
if (_is.empty(target)) return target;
|
1357 |
+
return target.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
1358 |
+
};
|
1359 |
+
|
1360 |
+
/**
|
1361 |
+
* @summary Generates a 32 bit FNV-1a hash from the given `target`.
|
1362 |
+
* @memberof FooGallery.utils.str
|
1363 |
+
* @function fnv1a
|
1364 |
+
* @param {string} target - The string to generate a hash from.
|
1365 |
+
* @returns {?number} `null` if the `target` is not a string or empty otherwise a 32 bit FNV-1a hash.
|
1366 |
+
* @example {@run true}
|
1367 |
+
* // alias the FooGallery.utils.str namespace
|
1368 |
+
* var _str = FooGallery.utils.str;
|
1369 |
+
*
|
1370 |
+
* console.log( _str.fnv1a( "Some string to generate a hash for." ) ); // => 207568994
|
1371 |
+
* console.log( _str.fnv1a( "Some string to generate a hash for" ) ); // => 1350435704
|
1372 |
+
* @see {@link https://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function|Fowler–Noll–Vo hash function}
|
1373 |
+
*/
|
1374 |
+
_.str.fnv1a = function(target){
|
1375 |
+
if (!_is.string(target) || _is.empty(target)) return null;
|
1376 |
+
var i, l, hval = 0x811c9dc5;
|
1377 |
+
for (i = 0, l = target.length; i < l; i++) {
|
1378 |
+
hval ^= target.charCodeAt(i);
|
1379 |
+
hval += (hval << 1) + (hval << 4) + (hval << 7) + (hval << 8) + (hval << 24);
|
1380 |
+
}
|
1381 |
+
return hval >>> 0;
|
1382 |
+
};
|
1383 |
+
|
1384 |
+
/**
|
1385 |
+
* @summary Returns the remainder of the `target` split on the first index of the given `substr`.
|
1386 |
+
* @memberof FooGallery.utils.str
|
1387 |
+
* @function from
|
1388 |
+
* @param {string} target - The string to split.
|
1389 |
+
* @param {string} substr - The substring to split on.
|
1390 |
+
* @returns {?string} `null` if the given `substr` does not exist within the `target`.
|
1391 |
+
* @example {@run true}
|
1392 |
+
* // alias the FooGallery.utils.str namespace
|
1393 |
+
* var _str = FooGallery.utils.str,
|
1394 |
+
* // create a string to test
|
1395 |
+
* target = "To be, or not to be, that is the question.";
|
1396 |
+
*
|
1397 |
+
* console.log( _str.from( target, "no" ) ); // => "t to be, that is the question."
|
1398 |
+
* console.log( _str.from( target, "that" ) ); // => " is the question."
|
1399 |
+
* console.log( _str.from( target, "question" ) ); // => "."
|
1400 |
+
* console.log( _str.from( target, "nonexistent" ) ); // => null
|
1401 |
+
*/
|
1402 |
+
_.str.from = function (target, substr) {
|
1403 |
+
if (!_is.string(target) || _is.empty(target) || !_is.string(substr) || _is.empty(substr)) return null;
|
1404 |
+
return _.str.contains(target, substr) ? target.substring(target.indexOf(substr) + substr.length) : null;
|
1405 |
+
};
|
1406 |
+
|
1407 |
+
/**
|
1408 |
+
* @summary Joins any number of strings using the given `separator`.
|
1409 |
+
* @memberof FooGallery.utils.str
|
1410 |
+
* @function join
|
1411 |
+
* @param {string} separator - The separator to use to join the strings.
|
1412 |
+
* @param {string} part - The first string to join.
|
1413 |
+
* @param {...string} [partN] - Any number of additional strings to join.
|
1414 |
+
* @returns {?string}
|
1415 |
+
* @description This method differs from using the standard `Array.prototype.join` function to join strings in that it ignores empty parts and checks to see if each starts with the supplied `separator`. If the part starts with the `separator` it is removed before appending it to the final result.
|
1416 |
+
* @example {@run true}
|
1417 |
+
* // alias the FooGallery.utils.str namespace
|
1418 |
+
* var _str = FooGallery.utils.str;
|
1419 |
+
*
|
1420 |
+
* console.log( _str.join( "_", "all", "in", "one" ) ); // => "all_in_one"
|
1421 |
+
* console.log( _str.join( "_", "all", "_in", "one" ) ); // => "all_in_one"
|
1422 |
+
* console.log( _str.join( "/", "http://", "/example.com/", "/path/to/image.png" ) ); // => "http://example.com/path/to/image.png"
|
1423 |
+
* console.log( _str.join( "/", "http://", "/example.com", "/path/to/image.png" ) ); // => "http://example.com/path/to/image.png"
|
1424 |
+
* console.log( _str.join( "/", "http://", "example.com", "path/to/image.png" ) ); // => "http://example.com/path/to/image.png"
|
1425 |
+
*/
|
1426 |
+
_.str.join = function(separator, part, partN){
|
1427 |
+
if (!_is.string(separator) || !_is.string(part)) return null;
|
1428 |
+
var parts = _fn.arg2arr(arguments);
|
1429 |
+
separator = parts.shift();
|
1430 |
+
var i, l, result = parts.shift();
|
1431 |
+
for (i = 0, l = parts.length; i < l; i++){
|
1432 |
+
part = parts[i];
|
1433 |
+
if (_is.empty(part)) continue;
|
1434 |
+
if (_.str.endsWith(result, separator)){
|
1435 |
+
result = result.slice(0, result.length-separator.length);
|
1436 |
+
}
|
1437 |
+
if (_.str.startsWith(part, separator)){
|
1438 |
+
part = part.slice(separator.length);
|
1439 |
+
}
|
1440 |
+
result += separator + part;
|
1441 |
+
}
|
1442 |
+
return result;
|
1443 |
+
};
|
1444 |
+
|
1445 |
+
/**
|
1446 |
+
* @summary Checks if the `target` starts with the given `substr`.
|
1447 |
+
* @memberof FooGallery.utils.str
|
1448 |
+
* @function startsWith
|
1449 |
+
* @param {string} target - The string to check.
|
1450 |
+
* @param {string} substr - The substr to check for.
|
1451 |
+
* @returns {boolean} `true` if the `target` starts with the given `substr`.
|
1452 |
+
* @example {@run true}
|
1453 |
+
* // alias the FooGallery.utils.str namespace
|
1454 |
+
* var _str = FooGallery.utils.str;
|
1455 |
+
*
|
1456 |
+
* console.log( _str.startsWith( "something", "s" ) ); // => true
|
1457 |
+
* console.log( _str.startsWith( "something", "some" ) ); // => true
|
1458 |
+
* console.log( _str.startsWith( "something", "no" ) ); // => false
|
1459 |
+
*/
|
1460 |
+
_.str.startsWith = function (target, substr) {
|
1461 |
+
if (_is.empty(target) || _is.empty(substr)) return false;
|
1462 |
+
return target.slice(0, substr.length) == substr;
|
1463 |
+
};
|
1464 |
+
|
1465 |
+
/**
|
1466 |
+
* @summary Returns the first part of the `target` split on the first index of the given `substr`.
|
1467 |
+
* @memberof FooGallery.utils.str
|
1468 |
+
* @function until
|
1469 |
+
* @param {string} target - The string to split.
|
1470 |
+
* @param {string} substr - The substring to split on.
|
1471 |
+
* @returns {string} The `target` if the `substr` does not exist.
|
1472 |
+
* @example {@run true}
|
1473 |
+
* // alias the FooGallery.utils.str namespace
|
1474 |
+
* var _str = FooGallery.utils.str,
|
1475 |
+
* // create a string to test
|
1476 |
+
* target = "To be, or not to be, that is the question.";
|
1477 |
+
*
|
1478 |
+
* console.log( _str.until( target, "no" ) ); // => "To be, or "
|
1479 |
+
* console.log( _str.until( target, "that" ) ); // => "To be, or not to be, "
|
1480 |
+
* console.log( _str.until( target, "question" ) ); // => "To be, or not to be, that is the "
|
1481 |
+
* console.log( _str.until( target, "nonexistent" ) ); // => "To be, or not to be, that is the question."
|
1482 |
+
*/
|
1483 |
+
_.str.until = function (target, substr) {
|
1484 |
+
if (_is.empty(target) || _is.empty(substr)) return target;
|
1485 |
+
return _.str.contains(target, substr) ? target.substring(0, target.indexOf(substr)) : target;
|
1486 |
+
};
|
1487 |
+
|
1488 |
+
/**
|
1489 |
+
* @summary A basic string formatter that can use both index and name based placeholders but handles only string or number replacements.
|
1490 |
+
* @memberof FooGallery.utils.str
|
1491 |
+
* @function format
|
1492 |
+
* @param {string} target - The format string containing any placeholders to replace.
|
1493 |
+
* @param {string|number|Object|Array} arg1 - The first value to format the target with. If an object is supplied it's properties are used to match named placeholders. If an array, string or number is supplied it's values are used to match any index placeholders.
|
1494 |
+
* @param {...(string|number)} [argN] - Any number of additional strings or numbers to format the target with.
|
1495 |
+
* @returns {string} The string formatted with the supplied arguments.
|
1496 |
+
* @description This method allows you to supply the replacements as an object when using named placeholders or as an array or additional arguments when using index placeholders.
|
1497 |
+
*
|
1498 |
+
* This does not perform a simultaneous replacement of placeholders, which is why it's referred to as a basic formatter. This means replacements that contain placeholders within there value could end up being replaced themselves as seen in the last example.
|
1499 |
+
* @example {@caption The following shows how to use index placeholders.}{@run true}
|
1500 |
+
* // alias the FooGallery.utils.str namespace
|
1501 |
+
* var _str = FooGallery.utils.str,
|
1502 |
+
* // create a format string using index placeholders
|
1503 |
+
* format = "Hello, {0}, are you feeling {1}?";
|
1504 |
+
*
|
1505 |
+
* console.log( _str.format( format, "Steve", "OK" ) ); // => "Hello, Steve, are you feeling OK?"
|
1506 |
+
* // or
|
1507 |
+
* console.log( _str.format( format, [ "Steve", "OK" ] ) ); // => "Hello, Steve, are you feeling OK?"
|
1508 |
+
* @example {@caption While the above works perfectly fine the downside is that the placeholders provide no clues as to what should be supplied as a replacement value, this is were supplying an object and using named placeholders steps in.}{@run true}
|
1509 |
+
* // alias the FooGallery.utils.str namespace
|
1510 |
+
* var _str = FooGallery.utils.str,
|
1511 |
+
* // create a format string using named placeholders
|
1512 |
+
* format = "Hello, {name}, are you feeling {adjective}?";
|
1513 |
+
*
|
1514 |
+
* console.log( _str.format( format, {name: "Steve", adjective: "OK"} ) ); // => "Hello, Steve, are you feeling OK?"
|
1515 |
+
* @example {@caption The following demonstrates the issue with not performing a simultaneous replacement of placeholders.}{@run true}
|
1516 |
+
* // alias the FooGallery.utils.str namespace
|
1517 |
+
* var _str = FooGallery.utils.str;
|
1518 |
+
*
|
1519 |
+
* console.log( _str.format("{0}{1}", "{1}", "{0}") ); // => "{0}{0}"
|
1520 |
+
*
|
1521 |
+
* // If the replacement happened simultaneously the result would be "{1}{0}" but this method executes
|
1522 |
+
* // replacements synchronously as seen below:
|
1523 |
+
*
|
1524 |
+
* // "{0}{1}".replace( "{0}", "{1}" )
|
1525 |
+
* // => "{1}{1}".replace( "{1}", "{0}" )
|
1526 |
+
* // => "{0}{0}"
|
1527 |
+
*/
|
1528 |
+
_.str.format = function (target, arg1, argN){
|
1529 |
+
var args = _fn.arg2arr(arguments);
|
1530 |
+
target = args.shift(); // remove the target from the args
|
1531 |
+
if (_is.empty(target) || _is.empty(args)) return target;
|
1532 |
+
if (args.length === 1 && (_is.array(args[0]) || _is.object(args[0]))){
|
1533 |
+
args = args[0];
|
1534 |
+
}
|
1535 |
+
for (var arg in args){
|
1536 |
+
target = target.replace(new RegExp("\\{" + arg + "\\}", "gi"), args[arg]);
|
1537 |
+
}
|
1538 |
+
return target;
|
1539 |
+
};
|
1540 |
+
|
1541 |
+
})(
|
1542 |
+
// dependencies
|
1543 |
+
FooGallery.utils,
|
1544 |
+
FooGallery.utils.is,
|
1545 |
+
FooGallery.utils.fn
|
1546 |
+
);
|
1547 |
+
(function($, _, _is, _fn, _str){
|
1548 |
+
// only register methods if this version is the current version
|
1549 |
+
if (_.version !== '0.0.5') return;
|
1550 |
+
|
1551 |
+
/**
|
1552 |
+
* @summary Contains common object utility methods.
|
1553 |
+
* @memberof FooGallery.utils
|
1554 |
+
* @namespace obj
|
1555 |
+
*/
|
1556 |
+
_.obj = {};
|
1557 |
+
|
1558 |
+
// used by the obj.create method
|
1559 |
+
var Obj = function () {};
|
1560 |
+
/**
|
1561 |
+
* @summary Creates a new object with the specified prototype.
|
1562 |
+
* @memberof FooGallery.utils.obj
|
1563 |
+
* @function create
|
1564 |
+
* @param {object} proto - The object which should be the prototype of the newly-created object.
|
1565 |
+
* @returns {object} A new object with the specified prototype.
|
1566 |
+
* @description This is a basic implementation of the {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create|Object.create} method.
|
1567 |
+
*/
|
1568 |
+
_.obj.create = function (proto) {
|
1569 |
+
if (!_is.object(proto))
|
1570 |
+
throw TypeError('Argument must be an object');
|
1571 |
+
Obj.prototype = proto;
|
1572 |
+
var result = new Obj();
|
1573 |
+
Obj.prototype = null;
|
1574 |
+
return result;
|
1575 |
+
};
|
1576 |
+
|
1577 |
+
/**
|
1578 |
+
* @summary Merge the contents of two or more objects together into the first `target` object.
|
1579 |
+
* @memberof FooGallery.utils.obj
|
1580 |
+
* @function extend
|
1581 |
+
* @param {Object} target - The object to merge properties into.
|
1582 |
+
* @param {Object} object - An object containing properties to merge.
|
1583 |
+
* @param {...Object} [objectN] - Additional objects containing properties to merge.
|
1584 |
+
* @returns {Object} The `target` merged with the contents from any additional objects.
|
1585 |
+
* @description This does not merge arrays by index as jQuery does, it treats them as a single property and replaces the array with a shallow copy of the new one.
|
1586 |
+
*
|
1587 |
+
* This method makes use of the {@link FooGallery.utils.obj.merge} method internally.
|
1588 |
+
* @example {@run true}
|
1589 |
+
* // alias the FooGallery.utils.obj namespace
|
1590 |
+
* var _obj = FooGallery.utils.obj,
|
1591 |
+
* // create some objects to merge
|
1592 |
+
* defaults = {"name": "My Object", "enabled": false, "arr": [1,2,3]},
|
1593 |
+
* options = {"enabled": true, "something": 123, "arr": [4,5,6]};
|
1594 |
+
*
|
1595 |
+
* // merge the two objects into a new third one without modifying either of the originals
|
1596 |
+
* var settings = _obj.extend( {}, defaults, options );
|
1597 |
+
*
|
1598 |
+
* console.log( settings ); // => {"name": "My Object", "enabled": true, "arr": [4,5,6], "something": 123}
|
1599 |
+
* console.log( defaults ); // => {"name": "My Object", "enabled": true, "arr": [1,2,3]}
|
1600 |
+
* console.log( options ); // => {"enabled": true, "arr": [4,5,6], "something": 123}
|
1601 |
+
*/
|
1602 |
+
_.obj.extend = function(target, object, objectN){
|
1603 |
+
target = _is.object(target) ? target : {};
|
1604 |
+
var objects = _fn.arg2arr(arguments);
|
1605 |
+
objects.shift();
|
1606 |
+
$.each(objects, function(i, object){
|
1607 |
+
_.obj.merge(target, object);
|
1608 |
+
});
|
1609 |
+
return target;
|
1610 |
+
};
|
1611 |
+
|
1612 |
+
/**
|
1613 |
+
* @summary Merge the contents of two objects together into the first `target` object.
|
1614 |
+
* @memberof FooGallery.utils.obj
|
1615 |
+
* @function merge
|
1616 |
+
* @param {Object} target - The object to merge properties into.
|
1617 |
+
* @param {Object} object - The object containing properties to merge.
|
1618 |
+
* @returns {Object} The `target` merged with the contents from the `object`.
|
1619 |
+
* @description This does not merge arrays by index as jQuery does, it treats them as a single property and replaces the array with a shallow copy of the new one.
|
1620 |
+
*
|
1621 |
+
* This method is used internally by the {@link FooGallery.utils.obj.extend} method.
|
1622 |
+
* @example {@run true}
|
1623 |
+
* // alias the FooGallery.utils.obj namespace
|
1624 |
+
* var _obj = FooGallery.utils.obj,
|
1625 |
+
* // create some objects to merge
|
1626 |
+
* target = {"name": "My Object", "enabled": false, "arr": [1,2,3]},
|
1627 |
+
* object = {"enabled": true, "something": 123, "arr": [4,5,6]};
|
1628 |
+
*
|
1629 |
+
* console.log( _obj.merge( target, object ) ); // => {"name": "My Object", "enabled": true, "arr": [4,5,6], "something": 123}
|
1630 |
+
*/
|
1631 |
+
_.obj.merge = function(target, object){
|
1632 |
+
target = _is.object(target) ? target : {};
|
1633 |
+
object = _is.object(object) ? object : {};
|
1634 |
+
for (var prop in object) {
|
1635 |
+
if (object.hasOwnProperty(prop)) {
|
1636 |
+
if (_is.object(object[prop])) {
|
1637 |
+
target[prop] = _is.object(target[prop]) ? target[prop] : {};
|
1638 |
+
_.obj.merge(target[prop], object[prop]);
|
1639 |
+
} else if (_is.array(object[prop])) {
|
1640 |
+
target[prop] = object[prop].slice();
|
1641 |
+
} else {
|
1642 |
+
target[prop] = object[prop];
|
1643 |
+
}
|
1644 |
+
}
|
1645 |
+
}
|
1646 |
+
return target;
|
1647 |
+
};
|
1648 |
+
|
1649 |
+
/**
|
1650 |
+
* @summary Merge the validated properties of the `object` into the `target` using the optional `mappings`.
|
1651 |
+
* @memberof FooGallery.utils.obj
|
1652 |
+
* @function mergeValid
|
1653 |
+
* @param {Object} target - The object to merge properties into.
|
1654 |
+
* @param {FooGallery.utils.obj~Validators} validators - An object containing validators for the `target` object properties.
|
1655 |
+
* @param {Object} object - The object containing properties to merge.
|
1656 |
+
* @param {FooGallery.utils.obj~Mappings} [mappings] - An object containing property name mappings.
|
1657 |
+
* @returns {Object} The modified `target` object containing any valid properties from the supplied `object`.
|
1658 |
+
* @example {@caption Shows the basic usage for this method and shows how invalid properties or those with no corresponding validator are ignored.}{@run true}
|
1659 |
+
* // alias the FooGallery.utils.obj and FooGallery.utils.is namespaces
|
1660 |
+
* var _obj = FooGallery.utils.obj,
|
1661 |
+
* _is = FooGallery.utils.is;
|
1662 |
+
*
|
1663 |
+
* //create the target object and it's validators
|
1664 |
+
* var target = {"name":"John","location":"unknown"},
|
1665 |
+
* validators = {"name":_is.string,"location":_is.string};
|
1666 |
+
*
|
1667 |
+
* // create the object to merge into the target
|
1668 |
+
* var object = {
|
1669 |
+
* "name": 1234, // invalid
|
1670 |
+
* "location": "Liverpool", // updated
|
1671 |
+
* "notMerged": true // ignored
|
1672 |
+
* };
|
1673 |
+
*
|
1674 |
+
* // merge the object into the target, invalid properties or those with no corresponding validator are ignored.
|
1675 |
+
* console.log( _obj.mergeValid( target, validators, object ) ); // => { "name": "John", "location": "Liverpool" }
|
1676 |
+
* @example {@caption Shows how to supply a mappings object for this method.}{@run true}
|
1677 |
+
* // alias the FooGallery.utils.obj and FooGallery.utils.is namespaces
|
1678 |
+
* var _obj = FooGallery.utils.obj,
|
1679 |
+
* _is = FooGallery.utils.is;
|
1680 |
+
*
|
1681 |
+
* //create the target object and it's validators
|
1682 |
+
* var target = {"name":"John","location":"unknown"},
|
1683 |
+
* validators = {"name":_is.string,"location":_is.string};
|
1684 |
+
*
|
1685 |
+
* // create the object to merge into the target
|
1686 |
+
* var object = {
|
1687 |
+
* "name": { // ignored
|
1688 |
+
* "proper": "Christopher", // mapped to name if short is invalid
|
1689 |
+
* "short": "Chris" // map to name
|
1690 |
+
* },
|
1691 |
+
* "city": "London" // map to location
|
1692 |
+
* };
|
1693 |
+
*
|
1694 |
+
* // create the mapping object
|
1695 |
+
* var mappings = {
|
1696 |
+
* "name": [ "name.short", "name.proper" ], // try use the short name and fallback to the proper
|
1697 |
+
* "location": "city"
|
1698 |
+
* };
|
1699 |
+
*
|
1700 |
+
* // merge the object into the target using the mappings, invalid properties or those with no corresponding validator are ignored.
|
1701 |
+
* console.log( _obj.mergeValid( target, validators, object, mappings ) ); // => { "name": "Chris", "location": "London" }
|
1702 |
+
*/
|
1703 |
+
_.obj.mergeValid = function(target, validators, object, mappings){
|
1704 |
+
if (!_is.hash(object) || !_is.hash(validators)) return target;
|
1705 |
+
validators = _is.hash(validators) ? validators : {};
|
1706 |
+
mappings = _is.hash(mappings) ? mappings : {};
|
1707 |
+
var prop, maps, value;
|
1708 |
+
for (prop in validators){
|
1709 |
+
if (!validators.hasOwnProperty(prop) || !_is.fn(validators[prop])) continue;
|
1710 |
+
maps = _is.array(mappings[prop]) ? mappings[prop] : (_is.string(mappings[prop]) ? [mappings[prop]] : [prop]);
|
1711 |
+
$.each(maps, function(i, map){
|
1712 |
+
value = _.obj.prop(object, map);
|
1713 |
+
if (_is.undef(value)) return; // continue
|
1714 |
+
if (validators[prop](value)){
|
1715 |
+
_.obj.prop(target, prop, value);
|
1716 |
+
return false; // break
|
1717 |
+
}
|
1718 |
+
});
|
1719 |
+
}
|
1720 |
+
return target;
|
1721 |
+
};
|
1722 |
+
|
1723 |
+
/**
|
1724 |
+
* @summary Get or set a property value given its `name`.
|
1725 |
+
* @memberof FooGallery.utils.obj
|
1726 |
+
* @function prop
|
1727 |
+
* @param {Object} object - The object to inspect for the property.
|
1728 |
+
* @param {string} name - The name of the property to fetch. This can be a `.` notated name.
|
1729 |
+
* @param {*} [value] - If supplied this is the value to set for the property.
|
1730 |
+
* @returns {*} The value for the `name` property, if it does not exist then `undefined`.
|
1731 |
+
* @returns {undefined} If a `value` is supplied this method returns nothing.
|
1732 |
+
* @example {@caption Shows how to get a property value from an object.}{@run true}
|
1733 |
+
* // alias the FooGallery.utils.obj namespace
|
1734 |
+
* var _obj = FooGallery.utils.obj,
|
1735 |
+
* // create an object to test
|
1736 |
+
* object = {
|
1737 |
+
* "name": "My Object",
|
1738 |
+
* "some": {
|
1739 |
+
* "thing": 123
|
1740 |
+
* }
|
1741 |
+
* };
|
1742 |
+
*
|
1743 |
+
* console.log( _obj.prop( object, "name" ) ); // => "My Object"
|
1744 |
+
* console.log( _obj.prop( object, "some.thing" ) ); // => 123
|
1745 |
+
* @example {@caption Shows how to set a property value for an object.}{@run true}
|
1746 |
+
* // alias the FooGallery.utils.obj namespace
|
1747 |
+
* var _obj = FooGallery.utils.obj,
|
1748 |
+
* // create an object to test
|
1749 |
+
* object = {
|
1750 |
+
* "name": "My Object",
|
1751 |
+
* "some": {
|
1752 |
+
* "thing": 123
|
1753 |
+
* }
|
1754 |
+
* };
|
1755 |
+
*
|
1756 |
+
* _obj.prop( object, "name", "My Updated Object" );
|
1757 |
+
* _obj.prop( object, "some.thing", 987 );
|
1758 |
+
*
|
1759 |
+
* console.log( object ); // => { "name": "My Updated Object", "some": { "thing": 987 } }
|
1760 |
+
*/
|
1761 |
+
_.obj.prop = function(object, name, value){
|
1762 |
+
if (!_is.object(object) || _is.empty(name)) return;
|
1763 |
+
var parts, last;
|
1764 |
+
if (_is.undef(value)){
|
1765 |
+
if (_str.contains(name, '.')){
|
1766 |
+
parts = name.split('.');
|
1767 |
+
last = parts.length - 1;
|
1768 |
+
$.each(parts, function(i, part){
|
1769 |
+
if (i === last){
|
1770 |
+
value = object[part];
|
1771 |
+
} else if (_is.hash(object[part])) {
|
1772 |
+
object = object[part];
|
1773 |
+
} else {
|
1774 |
+
// exit early
|
1775 |
+
return false;
|
1776 |
+
}
|
1777 |
+
});
|
1778 |
+
} else if (!_is.undef(object[name])){
|
1779 |
+
value = object[name];
|
1780 |
+
}
|
1781 |
+
return value;
|
1782 |
+
}
|
1783 |
+
if (_str.contains(name, '.')){
|
1784 |
+
parts = name.split('.');
|
1785 |
+
last = parts.length - 1;
|
1786 |
+
$.each(parts, function(i, part){
|
1787 |
+
if (i === last){
|
1788 |
+
object[part] = value;
|
1789 |
+
} else {
|
1790 |
+
object = _is.hash(object[part]) ? object[part] : (object[part] = {});
|
1791 |
+
}
|
1792 |
+
});
|
1793 |
+
} else if (!_is.undef(object[name])){
|
1794 |
+
object[name] = value;
|
1795 |
+
}
|
1796 |
+
};
|
1797 |
+
|
1798 |
+
//######################
|
1799 |
+
//## Type Definitions ##
|
1800 |
+
//######################
|
1801 |
+
|
1802 |
+
/**
|
1803 |
+
* @summary An object used by the {@link FooGallery.utils.obj.mergeValid|mergeValid} method to map new values onto the `target` object.
|
1804 |
+
* @typedef {Object.<string,string>|Object.<string,Array.<string>>} FooGallery.utils.obj~Mappings
|
1805 |
+
* @description The mappings object is a single level object. If you want to map a property from/to a child object on either the source or target objects you must supply the name using `.` notation as seen in the below example with the `"name.first"` to `"Name.Short"` mapping.
|
1806 |
+
* @example {@caption The basic structure of a mappings object is the below.}
|
1807 |
+
* {
|
1808 |
+
* "TargetName": "SourceName", // for top level properties
|
1809 |
+
* "Child.TargetName": "Child.SourceName" // for child properties
|
1810 |
+
* }
|
1811 |
+
* @example {@caption Given the following target object.}
|
1812 |
+
* var target = {
|
1813 |
+
* "name": {
|
1814 |
+
* "first": "",
|
1815 |
+
* "last": null
|
1816 |
+
* },
|
1817 |
+
* "age": 0
|
1818 |
+
* };
|
1819 |
+
* @example {@caption And the following object to merge.}
|
1820 |
+
* var object = {
|
1821 |
+
* "Name": {
|
1822 |
+
* "Full": "Christopher",
|
1823 |
+
* "Short": "Chris"
|
1824 |
+
* },
|
1825 |
+
* "Age": 32
|
1826 |
+
* };
|
1827 |
+
* @example {@caption The mappings object would look like the below.}
|
1828 |
+
* var mappings = {
|
1829 |
+
* "name.first": "Name.Short",
|
1830 |
+
* "age": "Age"
|
1831 |
+
* };
|
1832 |
+
* @example {@caption If you want the `"name.first"` property to try to use the `"Name.Short"` value but fallback to `"Name.Proper"` you can specify the mapping value as an array.}
|
1833 |
+
* var mappings = {
|
1834 |
+
* "name.first": [ "Name.Short", "Name.Proper" ],
|
1835 |
+
* "age": "Age"
|
1836 |
+
* };
|
1837 |
+
*/
|
1838 |
+
|
1839 |
+
/**
|
1840 |
+
* @summary An object used by the {@link FooGallery.utils.obj.mergeValid|mergeValid} method to validate properties.
|
1841 |
+
* @typedef {Object.<string,function(*):boolean>} FooGallery.utils.obj~Validators
|
1842 |
+
* @description The validators object is a single level object. If you want to validate a property of a child object you must supply the name using `.` notation as seen in the below example with the `"name.first"` and `"name.last"` properties.
|
1843 |
+
*
|
1844 |
+
* Any function that accepts a value to test as the first argument and returns a boolean can be used as a validator. This means the majority of the {@link FooGallery.utils.is} methods can be used directly. If the property supports multiple types just provide your own function as seen with `"name.last"` in the below example.
|
1845 |
+
* @example {@caption The basic structure of a validators object is the below.}
|
1846 |
+
* {
|
1847 |
+
* "PropName": function(*):boolean, // for top level properties
|
1848 |
+
* "Child.PropName": function(*):boolean // for child properties
|
1849 |
+
* }
|
1850 |
+
* @example {@caption Given the following target object.}
|
1851 |
+
* var target = {
|
1852 |
+
* "name": {
|
1853 |
+
* "first": "", // must be a string
|
1854 |
+
* "last": null // must be a string or null
|
1855 |
+
* },
|
1856 |
+
* "age": 0 // must be a number
|
1857 |
+
* };
|
1858 |
+
* @example {@caption The validators object could be created as seen below.}
|
1859 |
+
* // alias the FooGallery.utils.is namespace
|
1860 |
+
* var _is = FooGallery.utils.is;
|
1861 |
+
*
|
1862 |
+
* var validators = {
|
1863 |
+
* "name.first": _is.string,
|
1864 |
+
* "name.last": function(value){
|
1865 |
+
* return _is.string(value) || value === null;
|
1866 |
+
* },
|
1867 |
+
* "age": _is.number
|
1868 |
+
* };
|
1869 |
+
*/
|
1870 |
+
|
1871 |
+
})(
|
1872 |
+
// dependencies
|
1873 |
+
FooGallery.utils.$,
|
1874 |
+
FooGallery.utils,
|
1875 |
+
FooGallery.utils.is,
|
1876 |
+
FooGallery.utils.fn,
|
1877 |
+
FooGallery.utils.str
|
1878 |
+
);
|
1879 |
+
(function($, _, _is){
|
1880 |
+
// only register methods if this version is the current version
|
1881 |
+
if (_.version !== '0.0.5') return;
|
1882 |
+
|
1883 |
+
// any methods that have dependencies but don't fall into a specific subset or namespace can be added here
|
1884 |
+
|
1885 |
+
/**
|
1886 |
+
* @summary The callback for the {@link FooGallery.utils.ready} method.
|
1887 |
+
* @callback FooGallery.utils~readyCallback
|
1888 |
+
* @param {jQuery} $ - The instance of jQuery the plugin was registered with.
|
1889 |
+
* @this window
|
1890 |
+
* @see Take a look at the {@link FooGallery.utils.ready} method for example usage.
|
1891 |
+
*/
|
1892 |
+
|
1893 |
+
/**
|
1894 |
+
* @summary Waits for the DOM to be accessible and then executes the supplied callback.
|
1895 |
+
* @memberof FooGallery.utils
|
1896 |
+
* @function ready
|
1897 |
+
* @param {FooGallery.utils~readyCallback} callback - The function to execute once the DOM is accessible.
|
1898 |
+
* @example {@caption This method can be used as a replacement for the jQuery ready callback to avoid an error in another script stopping our scripts from running.}
|
1899 |
+
* FooGallery.utils.ready(function($){
|
1900 |
+
* // do something
|
1901 |
+
* });
|
1902 |
+
*/
|
1903 |
+
_.ready = function (callback) {
|
1904 |
+
function onready(){
|
1905 |
+
try { callback.call(window, _.$); }
|
1906 |
+
catch(err) { console.error(err); }
|
1907 |
+
}
|
1908 |
+
if (Function('/*@cc_on return true@*/')() ? document.readyState === "complete" : document.readyState !== "loading") onready();
|
1909 |
+
else document.addEventListener('DOMContentLoaded', onready, false);
|
1910 |
+
};
|
1911 |
+
|
1912 |
+
// A variable to hold the last number used to generate an ID in the current page.
|
1913 |
+
var uniqueId = 0;
|
1914 |
+
|
1915 |
+
/**
|
1916 |
+
* @summary Generate and apply a unique id for the given `$element`.
|
1917 |
+
* @memberof FooGallery.utils
|
1918 |
+
* @function uniqueId
|
1919 |
+
* @param {jQuery} $element - The jQuery element object to retrieve an id from or generate an id for.
|
1920 |
+
* @param {string} [prefix="uid-"] - A prefix to append to the start of any generated ids.
|
1921 |
+
* @returns {string} Either the `$element`'s existing id or a generated one that has been applied to it.
|
1922 |
+
* @example {@run true}
|
1923 |
+
* // alias the FooGallery.utils namespace
|
1924 |
+
* var _ = FooGallery.utils;
|
1925 |
+
*
|
1926 |
+
* // create some elements to test
|
1927 |
+
* var $hasId = $("<span/>", {id: "exists"});
|
1928 |
+
* var $generatedId = $("<span/>");
|
1929 |
+
* var $generatedPrefixedId = $("<span/>");
|
1930 |
+
*
|
1931 |
+
* console.log( _.uniqueId( $hasId ) ); // => "exists"
|
1932 |
+
* console.log( $hasId.attr( "id" ) ); // => "exists"
|
1933 |
+
* console.log( _.uniqueId( $generatedId ) ); // => "uid-1"
|
1934 |
+
* console.log( $generatedId.attr( "id" ) ); // => "uid-1"
|
1935 |
+
* console.log( _.uniqueId( $generatedPrefixedId, "plugin-" ) ); // => "plugin-2"
|
1936 |
+
* console.log( $generatedPrefixedId.attr( "id" ) ); // => "plugin-2"
|
1937 |
+
*/
|
1938 |
+
_.uniqueId = function($element, prefix){
|
1939 |
+
var id = $element.attr('id');
|
1940 |
+
if (_is.empty(id)){
|
1941 |
+
prefix = _is.string(prefix) && !_is.empty(prefix) ? prefix : "uid-";
|
1942 |
+
id = prefix + (++uniqueId);
|
1943 |
+
$element.attr('id', id).data('__uniqueId__', true);
|
1944 |
+
}
|
1945 |
+
return id;
|
1946 |
+
};
|
1947 |
+
|
1948 |
+
/**
|
1949 |
+
* @summary Remove the id from the given `$element` if it was set using the {@link FooGallery.utils.uniqueId|uniqueId} method.
|
1950 |
+
* @memberof FooGallery.utils
|
1951 |
+
* @function removeUniqueId
|
1952 |
+
* @param {jQuery} $element - The jQuery element object to remove a generated id from.
|
1953 |
+
* @example {@run true}
|
1954 |
+
* // alias the FooGallery.utils namespace
|
1955 |
+
* var _ = FooGallery.utils;
|
1956 |
+
*
|
1957 |
+
* // create some elements to test
|
1958 |
+
* var $hasId = $("<span/>", {id: "exists"});
|
1959 |
+
* var $generatedId = $("<span/>");
|
1960 |
+
* var $generatedPrefixedId = $("<span/>");
|
1961 |
+
*
|
1962 |
+
* console.log( _.uniqueId( $hasId ) ); // => "exists"
|
1963 |
+
* console.log( _.uniqueId( $generatedId ) ); // => "uid-1"
|
1964 |
+
* console.log( _.uniqueId( $generatedPrefixedId, "plugin-" ) ); // => "plugin-2"
|
1965 |
+
*/
|
1966 |
+
_.removeUniqueId = function($element){
|
1967 |
+
if ($element.data('__uniqueId__')){
|
1968 |
+
$element.removeAttr('id').removeData('__uniqueId__');
|
1969 |
+
}
|
1970 |
+
};
|
1971 |
+
|
1972 |
+
})(
|
1973 |
+
// dependencies
|
1974 |
+
FooGallery.utils.$,
|
1975 |
+
FooGallery.utils,
|
1976 |
+
FooGallery.utils.is
|
1977 |
+
);
|
1978 |
+
(function($, _, _is){
|
1979 |
+
// only register methods if this version is the current version
|
1980 |
+
if (_.version !== '0.0.5') return;
|
1981 |
+
|
1982 |
+
/**
|
1983 |
+
* @summary Contains common utility methods and members for the CSS transition property.
|
1984 |
+
* @memberof FooGallery.utils
|
1985 |
+
* @namespace transition
|
1986 |
+
*/
|
1987 |
+
_.transition = {};
|
1988 |
+
|
1989 |
+
// create a test element to check for the existence of the various transition properties
|
1990 |
+
var testElement = document.createElement('div');
|
1991 |
+
|
1992 |
+
/**
|
1993 |
+
* @summary Whether or not transitions are supported by the current browser.
|
1994 |
+
* @memberof FooGallery.utils.transition
|
1995 |
+
* @name supported
|
1996 |
+
* @type {boolean}
|
1997 |
+
*/
|
1998 |
+
_.transition.supported = (
|
1999 |
+
/**
|
2000 |
+
* @ignore
|
2001 |
+
* @summary Performs a one time test to see if transitions are supported
|
2002 |
+
* @param {Element} el - An element to test with.
|
2003 |
+
* @returns {boolean} `true` if transitions are supported.
|
2004 |
+
*/
|
2005 |
+
function(el){
|
2006 |
+
var style = el.style;
|
2007 |
+
return _is.string(style['transition'])
|
2008 |
+
|| _is.string(style['WebkitTransition'])
|
2009 |
+
|| _is.string(style['MozTransition'])
|
2010 |
+
|| _is.string(style['msTransition'])
|
2011 |
+
|| _is.string(style['OTransition']);
|
2012 |
+
}
|
2013 |
+
)(testElement);
|
2014 |
+
|
2015 |
+
/**
|
2016 |
+
* @summary The `transitionend` event name for the current browser.
|
2017 |
+
* @memberof FooGallery.utils.transition
|
2018 |
+
* @name end
|
2019 |
+
* @type {string}
|
2020 |
+
* @description Depending on the browser this returns one of the following values:
|
2021 |
+
*
|
2022 |
+
* <ul><!--
|
2023 |
+
* --><li>`"transitionend"`</li><!--
|
2024 |
+
* --><li>`"webkitTransitionEnd"`</li><!--
|
2025 |
+
* --><li>`"msTransitionEnd"`</li><!--
|
2026 |
+
* --><li>`"oTransitionEnd"`</li><!--
|
2027 |
+
* --><li>`null` - If the browser doesn't support transitions</li><!--
|
2028 |
+
* --></ul>
|
2029 |
+
*/
|
2030 |
+
_.transition.end = (
|
2031 |
+
/**
|
2032 |
+
* @ignore
|
2033 |
+
* @summary Performs a one time test to determine which `transitionend` event to use for the current browser.
|
2034 |
+
* @param {Element} el - An element to test with.
|
2035 |
+
* @returns {?string} The correct `transitionend` event for the current browser, `null` if the browser doesn't support transitions.
|
2036 |
+
*/
|
2037 |
+
function(el){
|
2038 |
+
var style = el.style;
|
2039 |
+
if (_is.string(style['transition'])) return 'transitionend';
|
2040 |
+
if (_is.string(style['WebkitTransition'])) return 'webkitTransitionEnd';
|
2041 |
+
if (_is.string(style['MozTransition'])) return 'transitionend';
|
2042 |
+
if (_is.string(style['msTransition'])) return 'msTransitionEnd';
|
2043 |
+
if (_is.string(style['OTransition'])) return 'oTransitionEnd';
|
2044 |
+
return null;
|
2045 |
+
}
|
2046 |
+
)(testElement);
|
2047 |
+
|
2048 |
+
/**
|
2049 |
+
* @summary Gets the `transition-duration` value for the supplied jQuery element.
|
2050 |
+
* @memberof FooGallery.utils.transition
|
2051 |
+
* @function duration
|
2052 |
+
* @param {jQuery} $element - The jQuery element to retrieve the duration from.
|
2053 |
+
* @param {number} [def=0] - The default value to return if no duration is set.
|
2054 |
+
* @returns {number} The value of the `transition-duration` property converted to a millisecond value.
|
2055 |
+
*/
|
2056 |
+
_.transition.duration = function($element, def){
|
2057 |
+
def = _is.number(def) ? def : 0;
|
2058 |
+
if (!_is.jq($element)) return def;
|
2059 |
+
// we can use jQuery.css() method to retrieve the value cross browser
|
2060 |
+
var duration = $element.css('transition-duration');
|
2061 |
+
if (/^([\d\.]*)+?(ms|s)$/i.test(duration)){
|
2062 |
+
// if we have a valid time value
|
2063 |
+
var match = duration.match(/^([\d\.]*)+?(ms|s)$/i),
|
2064 |
+
value = parseFloat(match[1]),
|
2065 |
+
unit = match[2].toLowerCase();
|
2066 |
+
if (unit === 's'){
|
2067 |
+
// convert seconds to milliseconds
|
2068 |
+
value = value * 1000;
|
2069 |
+
}
|
2070 |
+
return value;
|
2071 |
+
}
|
2072 |
+
return def;
|
2073 |
+
};
|
2074 |
+
|
2075 |
+
/**
|
2076 |
+
* @summary Start a transition by toggling the supplied `className` on the `$element`.
|
2077 |
+
* @memberof FooGallery.utils.transition
|
2078 |
+
* @function start
|
2079 |
+
* @param {jQuery} $element - The jQuery element to start the transition on.
|
2080 |
+
* @param {string} className - One or more class names (separated by spaces) to be toggled that starts the transition.
|
2081 |
+
* @param {boolean} [state] - A Boolean (not just truthy/falsy) value to determine whether the class should be added or removed.
|
2082 |
+
* @param {number} [timeout] - The maximum time, in milliseconds, to wait for the `transitionend` event to be raised. If not provided this will be automatically set to the elements `transition-duration` property plus an extra 50 milliseconds.
|
2083 |
+
* @returns {Promise}
|
2084 |
+
* @description This method lets us use CSS transitions by toggling a class and using the `transitionend` event to perform additional actions once the transition has completed across all browsers. In browsers that do not support transitions this method would behave the same as if just calling jQuery's `.toggleClass` method.
|
2085 |
+
*
|
2086 |
+
* The last parameter `timeout` is used to create a timer that behaves as a safety net in case the `transitionend` event is never raised and ensures the deferred returned by this method is resolved or rejected within a specified time.
|
2087 |
+
* @see {@link https://developer.mozilla.org/en/docs/Web/CSS/transition-duration|transition-duration - CSS | MDN} for more information on the `transition-duration` CSS property.
|
2088 |
+
*/
|
2089 |
+
_.transition.start = function($element, className, state, timeout){
|
2090 |
+
var deferred = $.Deferred();
|
2091 |
+
|
2092 |
+
$element = $element.first();
|
2093 |
+
|
2094 |
+
if (_.transition.supported){
|
2095 |
+
var safety = $element.data('transition_safety');
|
2096 |
+
if (_is.hash(safety) && _is.number(safety.timer)){
|
2097 |
+
clearTimeout(safety.timer);
|
2098 |
+
$element.removeData('transition_safety').off(_.transition.end + '.utils');
|
2099 |
+
safety.deferred.reject();
|
2100 |
+
}
|
2101 |
+
timeout = _is.number(timeout) ? timeout : _.transition.duration($element) + 50;
|
2102 |
+
safety = {
|
2103 |
+
deferred: deferred,
|
2104 |
+
timer: setTimeout(function(){
|
2105 |
+
// This is the safety net in case a transition fails for some reason and the transitionend event is never raised.
|
2106 |
+
// This will remove the bound event and resolve the deferred
|
2107 |
+
$element.removeData('transition_safety').off(_.transition.end + '.utils');
|
2108 |
+
deferred.resolve();
|
2109 |
+
}, timeout)
|
2110 |
+
};
|
2111 |
+
$element.data('transition_safety', safety);
|
2112 |
+
|
2113 |
+
$element.on(_.transition.end + '.utils', function(e){
|
2114 |
+
if ($element.is(e.target)){
|
2115 |
+
clearTimeout(safety.timer);
|
2116 |
+
$element.removeData('transition_safety').off(_.transition.end + '.utils');
|
2117 |
+
deferred.resolve();
|
2118 |
+
}
|
2119 |
+
});
|
2120 |
+
}
|
2121 |
+
|
2122 |
+
setTimeout(function(){
|
2123 |
+
// This is executed inside of a 20ms timeout to allow the binding of the event handler above to actually happen before the class is toggled
|
2124 |
+
$element.toggleClass(className, state);
|
2125 |
+
if (!_.transition.supported){
|
2126 |
+
// If the browser doesn't support transitions then just resolve the deferred
|
2127 |
+
deferred.resolve();
|
2128 |
+
}
|
2129 |
+
}, 20);
|
2130 |
+
|
2131 |
+
return deferred.promise();
|
2132 |
+
};
|
2133 |
+
|
2134 |
+
})(
|
2135 |
+
// dependencies
|
2136 |
+
FooGallery.utils.$,
|
2137 |
+
FooGallery.utils,
|
2138 |
+
FooGallery.utils.is
|
2139 |
+
);
|
2140 |
+
(function ($, _, _is, _obj, _fn) {
|
2141 |
+
// only register methods if this version is the current version
|
2142 |
+
if (_.version !== '0.0.5') return;
|
2143 |
+
|
2144 |
+
/**
|
2145 |
+
* @summary A base class providing some helper methods for prototypal inheritance.
|
2146 |
+
* @memberof FooGallery.utils
|
2147 |
+
* @constructs Class
|
2148 |
+
* @description This is a base class for making prototypal inheritance simpler to work with. It provides an easy way to inherit from another class and exposes a `_super` method within the scope of any overriding methods that allows a simple way to execute the overridden function.
|
2149 |
+
*
|
2150 |
+
* Have a look at the {@link FooGallery.utils.Class.extend|extend} and {@link FooGallery.utils.Class.override|override} method examples to see some basic usage.
|
2151 |
+
* @example {@caption When using this base class the actual construction of a class is performed by the `construct` method.}
|
2152 |
+
* var MyClass = FooGallery.utils.Class.extend({
|
2153 |
+
* construct: function(arg1, arg2){
|
2154 |
+
* // handle the construction logic here
|
2155 |
+
* }
|
2156 |
+
* });
|
2157 |
+
*
|
2158 |
+
* // use the class
|
2159 |
+
* var myClass = new MyClass( "arg1:value", "arg2:value" );
|
2160 |
+
*/
|
2161 |
+
_.Class = function(){};
|
2162 |
+
|
2163 |
+
/**
|
2164 |
+
* @ignore
|
2165 |
+
* @summary The original function when within the scope of an overriding method.
|
2166 |
+
* @memberof FooGallery.utils.Class#
|
2167 |
+
* @name _super
|
2168 |
+
* @type {?function}
|
2169 |
+
* @description This is only available within the scope of an overriding method if it was created using the {@link FooGallery.utils.Class.extend|extend}, {@link FooGallery.utils.Class.override|override} or {@link FooGallery.utils.fn.addOrOverride} methods.
|
2170 |
+
* @see {@link FooGallery.utils.fn.addOrOverride} to see an example of how this property is used.
|
2171 |
+
*/
|
2172 |
+
|
2173 |
+
/**
|
2174 |
+
* @summary Creates a new class that inherits from this one which in turn allows itself to be extended.
|
2175 |
+
* @memberof FooGallery.utils.Class
|
2176 |
+
* @function extend
|
2177 |
+
* @param {Object} [definition] - An object containing any methods to implement/override.
|
2178 |
+
* @returns {function} A new class that inherits from the base class.
|
2179 |
+
* @description Every class created using this method has both the {@link FooGallery.utils.Class.extend|extend} and {@link FooGallery.utils.Class.override|override} static methods added to it to allow it to be extended.
|
2180 |
+
* @example {@caption The below shows an example of how to implement inheritance using this method.}{@run true}
|
2181 |
+
* // create a base Person class
|
2182 |
+
* var Person = FooGallery.utils.Class.extend({
|
2183 |
+
* construct: function(isDancing){
|
2184 |
+
* this.dancing = isDancing;
|
2185 |
+
* },
|
2186 |
+
* dance: function(){
|
2187 |
+
* return this.dancing;
|
2188 |
+
* }
|
2189 |
+
* });
|
2190 |
+
*
|
2191 |
+
* var Ninja = Person.extend({
|
2192 |
+
* construct: function(){
|
2193 |
+
* // Call the inherited version of construct()
|
2194 |
+
* this._super( false );
|
2195 |
+
* },
|
2196 |
+
* dance: function(){
|
2197 |
+
* // Call the inherited version of dance()
|
2198 |
+
* return this._super();
|
2199 |
+
* },
|
2200 |
+
* swingSword: function(){
|
2201 |
+
* return true;
|
2202 |
+
* }
|
2203 |
+
* });
|
2204 |
+
*
|
2205 |
+
* var p = new Person(true);
|
2206 |
+
* console.log( p.dance() ); // => true
|
2207 |
+
*
|
2208 |
+
* var n = new Ninja();
|
2209 |
+
* console.log( n.dance() ); // => false
|
2210 |
+
* console.log( n.swingSword() ); // => true
|
2211 |
+
* console.log(
|
2212 |
+
* p instanceof Person && p.constructor === Person && p instanceof FooGallery.utils.Class
|
2213 |
+
* && n instanceof Ninja && n.constructor === Ninja && n instanceof Person && n instanceof FooGallery.utils.Class
|
2214 |
+
* ); // => true
|
2215 |
+
*/
|
2216 |
+
_.Class.extend = function(definition){
|
2217 |
+
definition = _is.hash(definition) ? definition : {};
|
2218 |
+
var proto = _obj.create(this.prototype); // create a new prototype to work with so we don't modify the original
|
2219 |
+
// iterate over all properties in the supplied definition and update the prototype
|
2220 |
+
for (var name in definition) {
|
2221 |
+
if (!definition.hasOwnProperty(name)) continue;
|
2222 |
+
_fn.addOrOverride(proto, name, definition[name]);
|
2223 |
+
}
|
2224 |
+
// if no construct method is defined add a default one that does nothing
|
2225 |
+
proto.construct = _is.fn(proto.construct) ? proto.construct : function(){};
|
2226 |
+
|
2227 |
+
// create the new class using the prototype made above
|
2228 |
+
function Class() {
|
2229 |
+
if (!_is.fn(this.construct))
|
2230 |
+
throw new SyntaxError('FooGallery.utils.Class objects must be constructed with the "new" keyword.');
|
2231 |
+
this.construct.apply(this, arguments);
|
2232 |
+
}
|
2233 |
+
Class.prototype = proto;
|
2234 |
+
//noinspection JSUnresolvedVariable
|
2235 |
+
Class.prototype.constructor = _is.fn(proto.__ctor__) ? proto.__ctor__ : Class;
|
2236 |
+
Class.extend = _.Class.extend;
|
2237 |
+
Class.override = _.Class.override;
|
2238 |
+
return Class;
|
2239 |
+
};
|
2240 |
+
|
2241 |
+
/**
|
2242 |
+
* @summary Overrides a single method on this class.
|
2243 |
+
* @memberof FooGallery.utils.Class
|
2244 |
+
* @function override
|
2245 |
+
* @param {string} name - The name of the function to override.
|
2246 |
+
* @param {function} fn - The new function to override with, the `_super` method will be made available within this function.
|
2247 |
+
* @description This is a helper method for overriding a single function of a {@link FooGallery.utils.Class} or one of its child classes. This uses the {@link FooGallery.utils.fn.addOrOverride} method internally and simply provides the correct prototype.
|
2248 |
+
* @example {@caption The below example wraps the `Person.prototype.dance` method with a new one that inverts the result. Note the override applies even to instances of the class that are already created.}{@run true}
|
2249 |
+
* var Person = FooGallery.utils.Class.extend({
|
2250 |
+
* construct: function(isDancing){
|
2251 |
+
* this.dancing = isDancing;
|
2252 |
+
* },
|
2253 |
+
* dance: function(){
|
2254 |
+
* return this.dancing;
|
2255 |
+
* }
|
2256 |
+
* });
|
2257 |
+
*
|
2258 |
+
* var p = new Person(true);
|
2259 |
+
* console.log( p.dance() ); // => true
|
2260 |
+
*
|
2261 |
+
* Person.override("dance", function(){
|
2262 |
+
* // Call the original version of dance()
|
2263 |
+
* return !this._super();
|
2264 |
+
* });
|
2265 |
+
*
|
2266 |
+
* console.log( p.dance() ); // => false
|
2267 |
+
*/
|
2268 |
+
_.Class.override = function(name, fn){
|
2269 |
+
_fn.addOrOverride(this.prototype, name, fn);
|
2270 |
+
};
|
2271 |
+
|
2272 |
+
})(
|
2273 |
+
// dependencies
|
2274 |
+
FooGallery.utils.$,
|
2275 |
+
FooGallery.utils,
|
2276 |
+
FooGallery.utils.is,
|
2277 |
+
FooGallery.utils.obj,
|
2278 |
+
FooGallery.utils.fn
|
2279 |
+
);
|
2280 |
+
(function($, _, _is){
|
2281 |
+
// only register methods if this version is the current version
|
2282 |
+
if (_.version !== '0.0.5') return;
|
2283 |
+
|
2284 |
+
_.Bounds = _.Class.extend(/** @lends FooGallery.utils.Bounds */{
|
2285 |
+
/**
|
2286 |
+
* @summary A simple bounding rectangle class.
|
2287 |
+
* @memberof FooGallery.utils
|
2288 |
+
* @constructs Bounds
|
2289 |
+
* @augments FooGallery.utils.Class
|
2290 |
+
* @borrows FooGallery.utils.Class.extend as extend
|
2291 |
+
* @borrows FooGallery.utils.Class.override as override
|
2292 |
+
*/
|
2293 |
+
construct: function(){
|
2294 |
+
var self = this;
|
2295 |
+
self.top = 0;
|
2296 |
+
self.right = 0;
|
2297 |
+
self.bottom = 0;
|
2298 |
+
self.left = 0;
|
2299 |
+
self.width = 0;
|
2300 |
+
self.height = 0;
|
2301 |
+
},
|
2302 |
+
/**
|
2303 |
+
* @summary Inflate the bounds by the specified amount.
|
2304 |
+
* @memberof FooGallery.utils.Bounds#
|
2305 |
+
* @function inflate
|
2306 |
+
* @param {number} amount - A positive number will expand the bounds while a negative one will shrink it.
|
2307 |
+
* @returns {FooGallery.utils.Bounds}
|
2308 |
+
*/
|
2309 |
+
inflate: function(amount){
|
2310 |
+
var self = this;
|
2311 |
+
if (_is.number(amount)){
|
2312 |
+
self.top -= amount;
|
2313 |
+
self.right += amount;
|
2314 |
+
self.bottom += amount;
|
2315 |
+
self.left -= amount;
|
2316 |
+
self.width += amount * 2;
|
2317 |
+
self.height += amount * 2;
|
2318 |
+
}
|
2319 |
+
return self;
|
2320 |
+
},
|
2321 |
+
/**
|
2322 |
+
* @summary Checks if the supplied bounds object intersects with this one.
|
2323 |
+
* @memberof FooGallery.utils.Bounds#
|
2324 |
+
* @function intersects
|
2325 |
+
* @param {FooGallery.utils.Bounds} bounds - The bounds to check.
|
2326 |
+
* @returns {boolean}
|
2327 |
+
*/
|
2328 |
+
intersects: function(bounds){
|
2329 |
+
var self = this;
|
2330 |
+
return self.left <= bounds.right && bounds.left <= self.right && self.top <= bounds.bottom && bounds.top <= self.bottom;
|
2331 |
+
}
|
2332 |
+
});
|
2333 |
+
|
2334 |
+
var __$window;
|
2335 |
+
/**
|
2336 |
+
* @summary Gets the bounding rectangle of the current viewport.
|
2337 |
+
* @memberof FooGallery.utils
|
2338 |
+
* @function getViewportBounds
|
2339 |
+
* @param {number} [inflate] - An amount to inflate the bounds by. A positive number will expand the bounds outside of the visible viewport while a negative one would shrink it.
|
2340 |
+
* @returns {FooGallery.utils.Bounds}
|
2341 |
+
*/
|
2342 |
+
_.getViewportBounds = function(inflate){
|
2343 |
+
if (!__$window) __$window = $(window);
|
2344 |
+
var bounds = new _.Bounds();
|
2345 |
+
bounds.top = __$window.scrollTop();
|
2346 |
+
bounds.left = __$window.scrollLeft();
|
2347 |
+
bounds.width = __$window.width();
|
2348 |
+
bounds.height = __$window.height();
|
2349 |
+
bounds.right = bounds.left + bounds.width;
|
2350 |
+
bounds.bottom = bounds.top + bounds.height;
|
2351 |
+
bounds.inflate(inflate);
|
2352 |
+
return bounds;
|
2353 |
+
};
|
2354 |
+
|
2355 |
+
/**
|
2356 |
+
* @summary Get the bounding rectangle for the supplied element.
|
2357 |
+
* @memberof FooGallery.utils
|
2358 |
+
* @function getElementBounds
|
2359 |
+
* @param {(jQuery|HTMLElement|string)} element - The jQuery wrapper around the element, the element itself, or a CSS selector to retrieve the element with.
|
2360 |
+
* @returns {FooGallery.utils.Bounds}
|
2361 |
+
*/
|
2362 |
+
_.getElementBounds = function(element){
|
2363 |
+
if (!_is.jq(element)) element = $(element);
|
2364 |
+
var bounds = new _.Bounds();
|
2365 |
+
if (element.length !== 0){
|
2366 |
+
var offset = element.offset();
|
2367 |
+
bounds.top = offset.top;
|
2368 |
+
bounds.left = offset.left;
|
2369 |
+
bounds.width = element.width();
|
2370 |
+
bounds.height = element.height();
|
2371 |
+
}
|
2372 |
+
bounds.right = bounds.left + bounds.width;
|
2373 |
+
bounds.bottom = bounds.top + bounds.height;
|
2374 |
+
return bounds;
|
2375 |
+
};
|
2376 |
+
|
2377 |
+
})(
|
2378 |
+
FooGallery.utils.$,
|
2379 |
+
FooGallery.utils,
|
2380 |
+
FooGallery.utils.is
|
2381 |
+
);
|
2382 |
+
(function($, _, _is, _fn){
|
2383 |
+
// only register methods if this version is the current version
|
2384 |
+
if (_.version !== '0.0.5') return;
|
2385 |
+
|
2386 |
+
_.Factory = _.Class.extend(/** @lends FooGallery.utils.Factory */{
|
2387 |
+
/**
|
2388 |
+
* @summary A factory for classes allowing them to be registered and created using a friendly name.
|
2389 |
+
* @memberof FooGallery.utils
|
2390 |
+
* @constructs Factory
|
2391 |
+
* @description This class allows other classes to register themselves for use at a later time. Depending on how you intend to use the registered classes you can also specify a load and execution order through the `priority` parameter of the {@link FooGallery.utils.Factory#register|register} method.
|
2392 |
+
* @augments FooGallery.utils.Class
|
2393 |
+
* @borrows FooGallery.utils.Class.extend as extend
|
2394 |
+
* @borrows FooGallery.utils.Class.override as override
|
2395 |
+
*/
|
2396 |
+
construct: function(){
|
2397 |
+
/**
|
2398 |
+
* @summary An object containing all registered classes.
|
2399 |
+
* @memberof FooGallery.utils.Factory#
|
2400 |
+
* @name registered
|
2401 |
+
* @type {Object.<string, Object>}
|
2402 |
+
* @readonly
|
2403 |
+
* @example {@caption The following shows the structure of this object. The `<name>` placeholders would be the name the class was registered with.}
|
2404 |
+
* {
|
2405 |
+
* "<name>": {
|
2406 |
+
* "name": <string>,
|
2407 |
+
* "klass": <function>,
|
2408 |
+
* "priority": <number>
|
2409 |
+
* },
|
2410 |
+
* "<name>": {
|
2411 |
+
* "name": <string>,
|
2412 |
+
* "klass": <function>,
|
2413 |
+
* "priority": <number>
|
2414 |
+
* },
|
2415 |
+
* ...
|
2416 |
+
* }
|
2417 |
+
*/
|
2418 |
+
this.registered = {};
|
2419 |
+
},
|
2420 |
+
/**
|
2421 |
+
* @summary Checks if the factory contains a class registered using the supplied `name`.
|
2422 |
+
* @memberof FooGallery.utils.Factory#
|
2423 |
+
* @function contains
|
2424 |
+
* @param {string} name - The name of the class to check.
|
2425 |
+
* @returns {boolean}
|
2426 |
+
* @example {@run true}
|
2427 |
+
* // create a new instance of the factory, this is usually exposed by the class that will be using the factory.
|
2428 |
+
* var factory = new FooGallery.utils.Factory();
|
2429 |
+
*
|
2430 |
+
* // create a class to register
|
2431 |
+
* function Test(){}
|
2432 |
+
*
|
2433 |
+
* // register the class with the factory with the default priority
|
2434 |
+
* factory.register( "test", Test );
|
2435 |
+
*
|
2436 |
+
* // test if the class was registered
|
2437 |
+
* console.log( factory.contains( "test" ) ); // => true
|
2438 |
+
*/
|
2439 |
+
contains: function(name){
|
2440 |
+
return !_is.undef(this.registered[name]);
|
2441 |
+
},
|
2442 |
+
/**
|
2443 |
+
* @summary Creates new instances of all registered classes using there registered priority and the supplied arguments.
|
2444 |
+
* @memberof FooGallery.utils.Factory#
|
2445 |
+
* @function load
|
2446 |
+
* @param {Object.<string, function>} overrides - An object containing classes to override any matching registered classes with, if no overrides are required you can pass `false` or `null`.
|
2447 |
+
* @param {*} arg1 - The first argument to supply when creating new instances of all registered classes.
|
2448 |
+
* @param {...*} [argN] - Any number of additional arguments to supply when creating new instances of all registered classes.
|
2449 |
+
* @returns {Array.<Object>} An array containing new instances of all registered classes.
|
2450 |
+
* @description The class indexes within the result array are determined by the `priority` they were registered with, the higher the `priority` the lower the index.
|
2451 |
+
*
|
2452 |
+
* This method is designed to be used when all registered classes share a common interface or base type and constructor arguments.
|
2453 |
+
* @example {@caption The following loads all registered classes into an array ordered by there priority.}{@run true}
|
2454 |
+
* // create a new instance of the factory, this is usually exposed by the class that will be using the factory.
|
2455 |
+
* var factory = new FooGallery.utils.Factory();
|
2456 |
+
*
|
2457 |
+
* // create a base Extension class
|
2458 |
+
* var Extension = FooGallery.utils.Class.extend({
|
2459 |
+
* construct: function( type, options ){
|
2460 |
+
* this.type = type;
|
2461 |
+
* this.options = options;
|
2462 |
+
* },
|
2463 |
+
* getType: function(){
|
2464 |
+
* return this.type;
|
2465 |
+
* }
|
2466 |
+
* });
|
2467 |
+
*
|
2468 |
+
* // create various item, this would usually be in another file
|
2469 |
+
* var MyExtension1 = Extension.extend({
|
2470 |
+
* construct: function(options){
|
2471 |
+
* this._super( "my-extension-1", options );
|
2472 |
+
* }
|
2473 |
+
* });
|
2474 |
+
* factory.register( "my-extension-1", MyExtension1, 0 );
|
2475 |
+
*
|
2476 |
+
* // create various item, this would usually be in another file
|
2477 |
+
* var MyExtension2 = Extension.extend({
|
2478 |
+
* construct: function(options){
|
2479 |
+
* this._super( "my-extension-2", options );
|
2480 |
+
* }
|
2481 |
+
* });
|
2482 |
+
* factory.register( "my-extension-2", MyExtension2, 1 );
|
2483 |
+
*
|
2484 |
+
* // load all registered classes according to there priority passing the options to all constructors
|
2485 |
+
* var loaded = factory.load( null, {"something": true} );
|
2486 |
+
*
|
2487 |
+
* // only two classes should be loaded
|
2488 |
+
* console.log( loaded.length ); // => 2
|
2489 |
+
*
|
2490 |
+
* // the MyExtension2 class is loaded first due to it's priority being higher than the MyExtension1 class.
|
2491 |
+
* console.log( loaded[0] instanceof MyExtension2 && loaded[0] instanceof Extension ); // => true
|
2492 |
+
* console.log( loaded[1] instanceof MyExtension1 && loaded[1] instanceof Extension ); // => true
|
2493 |
+
*
|
2494 |
+
* // do something with the loaded classes
|
2495 |
+
* @example {@caption The following loads all registered classes into an array ordered by there priority but uses the overrides parameter to swap out one of them for a custom implementation.}{@run true}
|
2496 |
+
* // create a new instance of the factory, this is usually exposed by the class that will be using the factory.
|
2497 |
+
* var factory = new FooGallery.utils.Factory();
|
2498 |
+
*
|
2499 |
+
* // create a base Extension class
|
2500 |
+
* var Extension = FooGallery.utils.Class.extend({
|
2501 |
+
* construct: function( type, options ){
|
2502 |
+
* this.type = type;
|
2503 |
+
* this.options = options;
|
2504 |
+
* },
|
2505 |
+
* getType: function(){
|
2506 |
+
* return this.type;
|
2507 |
+
* }
|
2508 |
+
* });
|
2509 |
+
*
|
2510 |
+
* // create a new extension, this would usually be in another file
|
2511 |
+
* var MyExtension1 = Extension.extend({
|
2512 |
+
* construct: function(options){
|
2513 |
+
* this._super( "my-extension-1", options );
|
2514 |
+
* }
|
2515 |
+
* });
|
2516 |
+
* factory.register( "my-extension-1", MyExtension1, 0 );
|
2517 |
+
*
|
2518 |
+
* // create a new extension, this would usually be in another file
|
2519 |
+
* var MyExtension2 = Extension.extend({
|
2520 |
+
* construct: function(options){
|
2521 |
+
* this._super( "my-extension-2", options );
|
2522 |
+
* }
|
2523 |
+
* });
|
2524 |
+
* factory.register( "my-extension-2", MyExtension2, 1 );
|
2525 |
+
*
|
2526 |
+
* // create a custom extension that is not registered but overrides the default "my-extension-1"
|
2527 |
+
* var UpdatedMyExtension1 = MyExtension1.extend({
|
2528 |
+
* construct: function(options){
|
2529 |
+
* this._super( options );
|
2530 |
+
* // do something different to the original MyExtension1 class
|
2531 |
+
* }
|
2532 |
+
* });
|
2533 |
+
*
|
2534 |
+
* // load all registered classes but swaps out the registered "my-extension-1" for the supplied override.
|
2535 |
+
* var loaded = factory.load( {"my-extension-1": UpdatedMyExtension1}, {"something": true} );
|
2536 |
+
*
|
2537 |
+
* // only two classes should be loaded
|
2538 |
+
* console.log( loaded.length ); // => 2
|
2539 |
+
*
|
2540 |
+
* // the MyExtension2 class is loaded first due to it's priority being higher than the UpdatedMyExtension1 class which inherited a priority of 0.
|
2541 |
+
* console.log( loaded[0] instanceof MyExtension2 && loaded[0] instanceof Extension ); // => true
|
2542 |
+
* console.log( loaded[1] instanceof UpdatedMyExtension1 && loaded[1] instanceof MyExtension1 && loaded[1] instanceof Extension ); // => true
|
2543 |
+
*
|
2544 |
+
* // do something with the loaded classes
|
2545 |
+
*/
|
2546 |
+
load: function(overrides, arg1, argN){
|
2547 |
+
var self = this,
|
2548 |
+
args = _fn.arg2arr(arguments),
|
2549 |
+
reg = [],
|
2550 |
+
loaded = [],
|
2551 |
+
name, klass;
|
2552 |
+
|
2553 |
+
overrides = args.shift() || {};
|
2554 |
+
for (name in self.registered){
|
2555 |
+
if (!self.registered.hasOwnProperty(name)) continue;
|
2556 |
+
var component = self.registered[name];
|
2557 |
+
if (overrides.hasOwnProperty(name)){
|
2558 |
+
klass = overrides[name];
|
2559 |
+
if (_is.string(klass)) klass = _fn.fetch(overrides[name]);
|
2560 |
+
if (_is.fn(klass)){
|
2561 |
+
component = {name: name, klass: klass, priority: self.registered[name].priority};
|
2562 |
+
}
|
2563 |
+
}
|
2564 |
+
reg.push(component);
|
2565 |
+
}
|
2566 |
+
|
2567 |
+
for (name in overrides){
|
2568 |
+
if (!overrides.hasOwnProperty(name) || self.registered.hasOwnProperty(name)) continue;
|
2569 |
+
klass = overrides[name];
|
2570 |
+
if (_is.string(klass)) klass = _fn.fetch(overrides[name]);
|
2571 |
+
if (_is.fn(klass)){
|
2572 |
+
reg.push({name: name, klass: klass, priority: 0});
|
2573 |
+
}
|
2574 |
+
}
|
2575 |
+
|
2576 |
+
reg.sort(function(a, b){ return b.priority - a.priority; });
|
2577 |
+
$.each(reg, function(i, r){
|
2578 |
+
if (_is.fn(r.klass)){
|
2579 |
+
loaded.push(_fn.apply(r.klass, args));
|
2580 |
+
}
|
2581 |
+
});
|
2582 |
+
return loaded;
|
2583 |
+
},
|
2584 |
+
/**
|
2585 |
+
* @summary Create a new instance of a class registered with the supplied `name` and arguments.
|
2586 |
+
* @memberof FooGallery.utils.Factory#
|
2587 |
+
* @function make
|
2588 |
+
* @param {string} name - The name of the class to create.
|
2589 |
+
* @param {*} arg1 - The first argument to supply to the new instance.
|
2590 |
+
* @param {...*} [argN] - Any number of additional arguments to supply to the new instance.
|
2591 |
+
* @returns {Object}
|
2592 |
+
* @example {@caption The following shows how to create a new instance of a registered class.}{@run true}
|
2593 |
+
* // create a new instance of the factory, this is usually done by the class that will be using it.
|
2594 |
+
* var factory = new FooGallery.utils.Factory();
|
2595 |
+
*
|
2596 |
+
* // create a Logger class to register, this would usually be in another file
|
2597 |
+
* var Logger = FooGallery.utils.Class.extend({
|
2598 |
+
* write: function( message ){
|
2599 |
+
* console.log( "Logger#write: " + message );
|
2600 |
+
* }
|
2601 |
+
* });
|
2602 |
+
*
|
2603 |
+
* factory.register( "logger", Logger );
|
2604 |
+
*
|
2605 |
+
* // create a new instances of the class registered as "logger"
|
2606 |
+
* var logger = factory.make( "logger" );
|
2607 |
+
* logger.write( "My message" ); // => "Logger#write: My message"
|
2608 |
+
*/
|
2609 |
+
make: function(name, arg1, argN){
|
2610 |
+
var self = this, args = _fn.arg2arr(arguments), reg;
|
2611 |
+
name = args.shift();
|
2612 |
+
reg = self.registered[name];
|
2613 |
+
if (_is.hash(reg) && _is.fn(reg.klass)){
|
2614 |
+
return _fn.apply(reg.klass, args);
|
2615 |
+
}
|
2616 |
+
return null;
|
2617 |
+
},
|
2618 |
+
/**
|
2619 |
+
* @summary Gets an array of all registered names.
|
2620 |
+
* @memberof FooGallery.utils.Factory#
|
2621 |
+
* @function names
|
2622 |
+
* @param {boolean} [prioritize=false] - Whether or not to order the names by the priority they were registered with.
|
2623 |
+
* @returns {Array.<string>}
|
2624 |
+
* @example {@run true}
|
2625 |
+
* // create a new instance of the factory, this is usually exposed by the class that will be using the factory.
|
2626 |
+
* var factory = new FooGallery.utils.Factory();
|
2627 |
+
*
|
2628 |
+
* // create some classes to register
|
2629 |
+
* function Test1(){}
|
2630 |
+
* function Test2(){}
|
2631 |
+
*
|
2632 |
+
* // register the classes with the factory with the default priority
|
2633 |
+
* factory.register( "test-1", Test1 );
|
2634 |
+
* factory.register( "test-2", Test2, 1 );
|
2635 |
+
*
|
2636 |
+
* // log all registered names
|
2637 |
+
* console.log( factory.names() ); // => ["test-1","test-2"]
|
2638 |
+
* console.log( factory.names( true ) ); // => ["test-2","test-1"] ~ "test-2" appears before "test-1" as it was registered with a higher priority
|
2639 |
+
*/
|
2640 |
+
names: function( prioritize ){
|
2641 |
+
prioritize = _is.boolean(prioritize) ? prioritize : false;
|
2642 |
+
var names = [], name;
|
2643 |
+
if (prioritize){
|
2644 |
+
var reg = [];
|
2645 |
+
for (name in this.registered){
|
2646 |
+
if (!this.registered.hasOwnProperty(name)) continue;
|
2647 |
+
reg.push(this.registered[name]);
|
2648 |
+
}
|
2649 |
+
reg.sort(function(a, b){ return b.priority - a.priority; });
|
2650 |
+
$.each(reg, function(i, r){
|
2651 |
+
names.push(r.name);
|
2652 |
+
});
|
2653 |
+
} else {
|
2654 |
+
for (name in this.registered){
|
2655 |
+
if (!this.registered.hasOwnProperty(name)) continue;
|
2656 |
+
names.push(name);
|
2657 |
+
}
|
2658 |
+
}
|
2659 |
+
return names;
|
2660 |
+
},
|
2661 |
+
/**
|
2662 |
+
* @summary Registers a `klass` constructor with the factory using the given `name`.
|
2663 |
+
* @memberof FooGallery.utils.Factory#
|
2664 |
+
* @function register
|
2665 |
+
* @param {string} name - The friendly name of the class.
|
2666 |
+
* @param {function} klass - The class constructor to register.
|
2667 |
+
* @param {number} [priority=0] - This determines the index for the class when using either the {@link FooGallery.utils.Factory#load|load} or {@link FooGallery.utils.Factory#names|names} methods, a higher value equals a lower index.
|
2668 |
+
* @returns {boolean} `true` if the `klass` was successfully registered.
|
2669 |
+
* @description Once a class is registered you can use either the {@link FooGallery.utils.Factory#load|load} or {@link FooGallery.utils.Factory#make|make} methods to create new instances depending on your use case.
|
2670 |
+
* @example {@run true}
|
2671 |
+
* // create a new instance of the factory, this is usually exposed by the class that will be using the factory.
|
2672 |
+
* var factory = new FooGallery.utils.Factory();
|
2673 |
+
*
|
2674 |
+
* // create a class to register
|
2675 |
+
* function Test(){}
|
2676 |
+
*
|
2677 |
+
* // register the class with the factory with the default priority
|
2678 |
+
* var succeeded = factory.register( "test", Test );
|
2679 |
+
*
|
2680 |
+
* console.log( succeeded ); // => true
|
2681 |
+
* console.log( factory.registered.hasOwnProperty( "test" ) ); // => true
|
2682 |
+
* console.log( factory.registered[ "test" ].name === "test" ); // => true
|
2683 |
+
* console.log( factory.registered[ "test" ].klass === Test ); // => true
|
2684 |
+
* console.log( factory.registered[ "test" ].priority === 0 ); // => true
|
2685 |
+
*/
|
2686 |
+
register: function(name, klass, priority){
|
2687 |
+
if (!_is.string(name) || _is.empty(name) || !_is.fn(klass)) return false;
|
2688 |
+
priority = _is.number(priority) ? priority : 0;
|
2689 |
+
var current = this.registered[name];
|
2690 |
+
this.registered[name] = {
|
2691 |
+
name: name,
|
2692 |
+
klass: klass,
|
2693 |
+
priority: !_is.undef(current) ? current.priority : priority
|
2694 |
+
};
|
2695 |
+
return true;
|
2696 |
+
}
|
2697 |
+
});
|
2698 |
+
|
2699 |
+
})(
|
2700 |
+
// dependencies
|
2701 |
+
FooGallery.utils.$,
|
2702 |
+
FooGallery.utils,
|
2703 |
+
FooGallery.utils.is,
|
2704 |
+
FooGallery.utils.fn
|
2705 |
+
);
|
2706 |
+
(function(_, _fn, _str){
|
2707 |
+
// only register methods if this version is the current version
|
2708 |
+
if (_.version !== '0.0.5') return;
|
2709 |
+
|
2710 |
+
_.Debugger = _.Class.extend(/** @lends FooGallery.utils.Debugger */{
|
2711 |
+
/**
|
2712 |
+
* @summary A debug utility class that can be enabled across sessions using the given `key` by storing its state in `localStorage`.
|
2713 |
+
* @memberof FooGallery.utils
|
2714 |
+
* @constructs Debugger
|
2715 |
+
* @param {string} key - The key to use to store the debug state in `localStorage`.
|
2716 |
+
* @description This class allows you to write additional debug info to the console within your code which by default is not actually output. You can then enable the debugger and it will start to output the results to the console.
|
2717 |
+
*
|
2718 |
+
* This most useful feature of this is the ability to store the debug state across page sessions by using `localStorage`. This allows you enable the debugger and then refresh the page to view any debugger output that occurs on page load.
|
2719 |
+
*/
|
2720 |
+
construct: function(key){
|
2721 |
+
/**
|
2722 |
+
* @summary The key used to store the debug state in `localStorage`.
|
2723 |
+
* @memberof FooGallery.utils.Debugger#
|
2724 |
+
* @name key
|
2725 |
+
* @type {string}
|
2726 |
+
*/
|
2727 |
+
this.key = key;
|
2728 |
+
/**
|
2729 |
+
* @summary Whether or not the debugger is currently enabled.
|
2730 |
+
* @memberof FooGallery.utils.Debugger#
|
2731 |
+
* @name enabled
|
2732 |
+
* @type {boolean}
|
2733 |
+
* @readonly
|
2734 |
+
* @description The value for this property is synced with the current state stored in `localStorage` and should never set from outside of this class.
|
2735 |
+
*/
|
2736 |
+
this.enabled = !!localStorage.getItem(this.key);
|
2737 |
+
},
|
2738 |
+
/**
|
2739 |
+
* @summary Enable the debugger causing additional info to be logged to the console.
|
2740 |
+
* @memberof FooGallery.utils.Debugger#
|
2741 |
+
* @function enable
|
2742 |
+
* @example
|
2743 |
+
* var d = new FooGallery.utils.Debugger( "FOO_DEBUG" );
|
2744 |
+
* d.log( "Never logged" );
|
2745 |
+
* d.enabled();
|
2746 |
+
* d.log( "I am logged!" );
|
2747 |
+
*/
|
2748 |
+
enable: function(){
|
2749 |
+
this.enabled = true;
|
2750 |
+
localStorage.setItem(this.key, this.enabled);
|
2751 |
+
},
|
2752 |
+
/**
|
2753 |
+
* @summary Disable the debugger stopping additional info being logged to the console.
|
2754 |
+
* @memberof FooGallery.utils.Debugger#
|
2755 |
+
* @function disable
|
2756 |
+
* @example
|
2757 |
+
* var d = new FooGallery.utils.Debugger( "FOO_DEBUG" );
|
2758 |
+
* d.log( "Never logged" );
|
2759 |
+
* d.enabled();
|
2760 |
+
* d.log( "I am logged!" );
|
2761 |
+
* d.disable();
|
2762 |
+
* d.log( "Never logged" );
|
2763 |
+
*/
|
2764 |
+
disable: function(){
|
2765 |
+
this.enabled = false;
|
2766 |
+
localStorage.removeItem(this.key);
|
2767 |
+
},
|
2768 |
+
/**
|
2769 |
+
* @summary Logs the supplied message and additional arguments to the console when enabled.
|
2770 |
+
* @memberof FooGallery.utils.Debugger#
|
2771 |
+
* @function log
|
2772 |
+
* @param {string} message - The message to log to the console.
|
2773 |
+
* @param {*} [argN] - Any number of additional arguments to supply after the message.
|
2774 |
+
* @description This method basically wraps the `console.log` method and simply checks the enabled state of the debugger before passing along any supplied arguments.
|
2775 |
+
*/
|
2776 |
+
log: function(message, argN){
|
2777 |
+
if (!this.enabled) return;
|
2778 |
+
console.log.apply(console, _fn.arg2arr(arguments));
|
2779 |
+
},
|
2780 |
+
/**
|
2781 |
+
* @summary Logs the formatted message and additional arguments to the console when enabled.
|
2782 |
+
* @memberof FooGallery.utils.Debugger#
|
2783 |
+
* @function logf
|
2784 |
+
* @param {string} message - The message containing named `replacements` to log to the console.
|
2785 |
+
* @param {Object.<string, *>} replacements - An object containing key value pairs used to perform a named format on the `message`.
|
2786 |
+
* @param {*} [argN] - Any number of additional arguments to supply after the message.
|
2787 |
+
* @see {@link FooGallery.utils.str.format} for more information on supplying the replacements object.
|
2788 |
+
*/
|
2789 |
+
logf: function(message, replacements, argN){
|
2790 |
+
if (!this.enabled) return;
|
2791 |
+
var args = _fn.arg2arr(arguments);
|
2792 |
+
message = args.shift();
|
2793 |
+
replacements = args.shift();
|
2794 |
+
args.unshift(_str.format(message, replacements));
|
2795 |
+
this.log.apply(this, args);
|
2796 |
+
}
|
2797 |
+
});
|
2798 |
+
|
2799 |
+
})(
|
2800 |
+
// dependencies
|
2801 |
+
FooGallery.utils,
|
2802 |
+
FooGallery.utils.fn,
|
2803 |
+
FooGallery.utils.str
|
2804 |
+
);
|
2805 |
+
(function($, _, _is){
|
2806 |
+
// only register methods if this version is the current version
|
2807 |
+
if (_.version !== '0.0.5') return;
|
2808 |
+
|
2809 |
+
_.Throttle = _.Class.extend(/** @lends FooGallery.utils.Throttle */{
|
2810 |
+
/**
|
2811 |
+
* @summary A timer to throttle the execution of code.
|
2812 |
+
* @memberof FooGallery.utils
|
2813 |
+
* @constructs
|
2814 |
+
* @param {number} [idle=0] - The idle time, in milliseconds, that must pass before executing the callback supplied to the {@link FooGallery.utils.Throttle#limit|limit} method.
|
2815 |
+
* @augments FooGallery.utils.Class
|
2816 |
+
* @borrows FooGallery.utils.Class.extend as extend
|
2817 |
+
* @borrows FooGallery.utils.Class.override as override
|
2818 |
+
* @description This class is basically a wrapper around the {@link https://developer.mozilla.org/en-US/docs/Web/API/WindowTimers/setTimeout|window.setTimeout} and {@link https://developer.mozilla.org/en-US/docs/Web/API/WindowTimers/clearTimeout|window.clearTimeout} functions. It was created to help throttle the execution of code in event handlers that could be called multiple times per second such as the window resize event. It is meant to limit the execution of expensive code until the specified idle time has lapsed.
|
2819 |
+
*
|
2820 |
+
* Take a look at the examples for the {@link FooGallery.utils.Throttle#limit|limit} and {@link FooGallery.utils.Throttle#clear|clear} methods for basic usage.
|
2821 |
+
* @example <caption>The below shows how you can use this class to prevent expensive code being executed with every call to your window resize handler. If you run this example resize your browser to see when the messages are logged.</caption>{@run true}
|
2822 |
+
* var throttle = new FooGallery.utils.Throttle( 50 );
|
2823 |
+
*
|
2824 |
+
* $(window).on("resize", function(){
|
2825 |
+
*
|
2826 |
+
* throttle.limit(function(){
|
2827 |
+
* console.log( "Only called when resizing has stopped for at least 50 milliseconds." );
|
2828 |
+
* });
|
2829 |
+
*
|
2830 |
+
* });
|
2831 |
+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/API/WindowTimers/setTimeout|WindowTimers.setTimeout() - Web APIs | MDN}
|
2832 |
+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/API/WindowTimers/clearTimeout|WindowTimers.clearTimeout() - Web APIs | MDN}
|
2833 |
+
*/
|
2834 |
+
construct: function(idle){
|
2835 |
+
/**
|
2836 |
+
* @summary The id from the last call to {@link https://developer.mozilla.org/en-US/docs/Web/API/WindowTimers/setTimeout|window.setTimeout}.
|
2837 |
+
* @type {?number}
|
2838 |
+
* @readonly
|
2839 |
+
* @default null
|
2840 |
+
*/
|
2841 |
+
this.id = null;
|
2842 |
+
/**
|
2843 |
+
* @summary Whether or not there is an active timer.
|
2844 |
+
* @type {boolean}
|
2845 |
+
* @readonly
|
2846 |
+
* @default false
|
2847 |
+
*/
|
2848 |
+
this.active = false;
|
2849 |
+
/**
|
2850 |
+
* @summary The idle time, in milliseconds, the timer should wait before executing the callback supplied to the {@link FooGallery.utils.Throttle#limit|limit} method.
|
2851 |
+
* @type {number}
|
2852 |
+
* @readonly
|
2853 |
+
* @default 0
|
2854 |
+
*/
|
2855 |
+
this.idle = _is.number(idle) ? idle : 0;
|
2856 |
+
},
|
2857 |
+
/**
|
2858 |
+
* @summary Starts a new timer clearing any previously set and executes the <code>callback</code> once it expires.
|
2859 |
+
* @instance
|
2860 |
+
* @param {function} callback - The function to call once the timer expires.
|
2861 |
+
* @example <caption>In the below example the <code>callback</code> function will only be executed once despite the repeated calls to the {@link FooGallery.utils.Throttle#limit|limit} method as each call resets the idle timer.</caption>{@run true}
|
2862 |
+
* // create a new throttle
|
2863 |
+
* var throttle = new FooGallery.utils.Throttle( 50 );
|
2864 |
+
*
|
2865 |
+
* // this `for` loop represents something like the window resize event that could call your handler multiple times a second
|
2866 |
+
* for (var i = 0, max = 5; i < max; i++){
|
2867 |
+
*
|
2868 |
+
* throttle.limit( function(){
|
2869 |
+
* console.log( "Only called once, after the idle timer lapses" );
|
2870 |
+
* } );
|
2871 |
+
*
|
2872 |
+
* }
|
2873 |
+
*/
|
2874 |
+
limit: function(callback){
|
2875 |
+
if (!_is.fn(callback)) return;
|
2876 |
+
this.clear();
|
2877 |
+
var self = this;
|
2878 |
+
this.active = true;
|
2879 |
+
this.id = setTimeout(function(){
|
2880 |
+
self.active = false;
|
2881 |
+
self.id = null;
|
2882 |
+
callback();
|
2883 |
+
}, this.idle);
|
2884 |
+
},
|
2885 |
+
/**
|
2886 |
+
* @summary Clear any previously set timer and prevent the execution of its' callback.
|
2887 |
+
* @instance
|
2888 |
+
* @example <caption>The below shows how to cancel an active throttle and prevent the execution of it's callback.</caption>{@run true}
|
2889 |
+
* // create a new throttle
|
2890 |
+
* var throttle = new FooGallery.utils.Throttle( 50 );
|
2891 |
+
*
|
2892 |
+
* // this `for` loop represents something like the window resize event that could call your handler multiple times a second
|
2893 |
+
* for (var i = 0, max = 5; i < max; i++){
|
2894 |
+
*
|
2895 |
+
* throttle.limit( function(){
|
2896 |
+
* console.log( "I'm never called" );
|
2897 |
+
* } );
|
2898 |
+
*
|
2899 |
+
* }
|
2900 |
+
*
|
2901 |
+
* // cancel the current throttle timer
|
2902 |
+
* throttle.clear();
|
2903 |
+
*/
|
2904 |
+
clear: function(){
|
2905 |
+
if (_is.number(this.id)){
|
2906 |
+
clearTimeout(this.id);
|
2907 |
+
this.active = false;
|
2908 |
+
this.id = null;
|
2909 |
+
}
|
2910 |
+
}
|
2911 |
+
});
|
2912 |
+
|
2913 |
+
})(
|
2914 |
+
// dependencies
|
2915 |
+
FooGallery.utils.$,
|
2916 |
+
FooGallery.utils,
|
2917 |
+
FooGallery.utils.is
|
2918 |
+
);
|
2919 |
+
(function($, _, _utils, _is, _fn){
|
2920 |
+
|
2921 |
+
_.debug = new _utils.Debugger("__FooGallery__");
|
2922 |
+
|
2923 |
+
/**
|
2924 |
+
* @summary Simple utility method to convert space delimited strings of CSS class names into a CSS selector.
|
2925 |
+
* @memberof FooGallery.utils
|
2926 |
+
* @function selectify
|
2927 |
+
* @param {(string|string[]|object)} classes - A single space delimited string of CSS class names to convert or an array of them with each item being included in the selector using the OR (`,`) syntax as a separator. If an object is supplied the result will be an object with the same property names but the values converted to selectors.
|
2928 |
+
* @returns {(object|string)}
|
2929 |
+
*/
|
2930 |
+
_utils.selectify = function(classes){
|
2931 |
+
if (_is.hash(classes)){
|
2932 |
+
var result = {}, selector;
|
2933 |
+
for (var name in classes){
|
2934 |
+
if (!classes.hasOwnProperty(name)) continue;
|
2935 |
+
if (selector = _utils.selectify(classes[name])){
|
2936 |
+
result[name] = selector;
|
2937 |
+
}
|
2938 |
+
}
|
2939 |
+
return result;
|
2940 |
+
}
|
2941 |
+
if (_is.string(classes) || _is.array(classes)){
|
2942 |
+
if (_is.string(classes)) classes = [classes];
|
2943 |
+
return $.map(classes, function(str){
|
2944 |
+
return _is.string(str) ? "." + str.split(/\s/g).join(".") : null;
|
2945 |
+
}).join(",");
|
2946 |
+
}
|
2947 |
+
return null;
|
2948 |
+
};
|
2949 |
+
|
2950 |
+
/**
|
2951 |
+
* @summary The url of an empty 1x1 pixel image used as the default value for the `placeholder` and `error` {@link FooGallery.defaults|options}.
|
2952 |
+
* @memberof FooGallery
|
2953 |
+
* @name emptyImage
|
2954 |
+
* @type {string}
|
2955 |
+
* @default "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="
|
2956 |
+
*/
|
2957 |
+
_.emptyImage = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==";
|
2958 |
+
|
2959 |
+
/**
|
2960 |
+
* @summary The name to use when getting or setting an instance of a {@link FooGallery.Template|template} on an element using jQuery's `.data()` method.
|
2961 |
+
* @memberof FooGallery
|
2962 |
+
* @name dataTemplate
|
2963 |
+
* @type {string}
|
2964 |
+
* @default "__FooGallery__"
|
2965 |
+
*/
|
2966 |
+
_.dataTemplate = "__FooGallery__";
|
2967 |
+
|
2968 |
+
/**
|
2969 |
+
* @summary The name to use when getting or setting an instance of a {@link FooGallery.Item|item} on an element using jQuery's `.data()` method.
|
2970 |
+
* @memberof FooGallery
|
2971 |
+
* @name dataItem
|
2972 |
+
* @type {string}
|
2973 |
+
* @default "__FooGalleryItem__"
|
2974 |
+
*/
|
2975 |
+
_.dataItem = "__FooGalleryItem__";
|
2976 |
+
|
2977 |
+
_.init = function(options, element){
|
2978 |
+
return _.template.make(options, element).initialize();
|
2979 |
+
};
|
2980 |
+
|
2981 |
+
_.initAll = function(options){
|
2982 |
+
return _fn.when($(".foogallery").map(function(i, element){
|
2983 |
+
return _.init(options, element);
|
2984 |
+
}).get());
|
2985 |
+
};
|
2986 |
+
|
2987 |
+
_.parseSrc = function(src, srcWidth, srcHeight, srcset, renderWidth, renderHeight){
|
2988 |
+
if (!_is.string(src)) return null;
|
2989 |
+
// if there is no srcset just return the src
|
2990 |
+
if (!_is.string(srcset)) return src;
|
2991 |
+
|
2992 |
+
// parse the srcset into objects containing the url, width, height and pixel density for each supplied source
|
2993 |
+
var list = $.map(srcset.replace(/(\s[\d.]+[whx]),/g, '$1 @,@ ').split(' @,@ '), function (val) {
|
2994 |
+
return {
|
2995 |
+
url: /^\s*(\S*)/.exec(val)[1],
|
2996 |
+
w: parseFloat((/\S\s+(\d+)w/.exec(val) || [0, Infinity])[1]),
|
2997 |
+
h: parseFloat((/\S\s+(\d+)h/.exec(val) || [0, Infinity])[1]),
|
2998 |
+
x: parseFloat((/\S\s+([\d.]+)x/.exec(val) || [0, 1])[1])
|
2999 |
+
};
|
3000 |
+
});
|
3001 |
+
|
3002 |
+
// if there is no items parsed from the srcset then just return the src
|
3003 |
+
if (!list.length) return src;
|
3004 |
+
|
3005 |
+
// add the current src into the mix by inspecting the first parsed item to figure out how to handle it
|
3006 |
+
list.unshift({
|
3007 |
+
url: src,
|
3008 |
+
w: list[0].w !== Infinity && list[0].h === Infinity ? srcWidth : Infinity,
|
3009 |
+
h: list[0].h !== Infinity && list[0].w === Infinity ? srcHeight : Infinity,
|
3010 |
+
x: 1
|
3011 |
+
});
|
3012 |
+
|
3013 |
+
// get the current viewport info and use it to determine the correct src to load
|
3014 |
+
var dpr = window.devicePixelRatio || 1,
|
3015 |
+
area = {w: renderWidth * dpr, h: renderHeight * dpr, x: dpr},
|
3016 |
+
property;
|
3017 |
+
|
3018 |
+
// first check each of the viewport properties against the max values of the same properties in our src array
|
3019 |
+
// only src's with a property greater than the viewport or equal to the max are kept
|
3020 |
+
for (property in area) {
|
3021 |
+
if (!area.hasOwnProperty(property)) continue;
|
3022 |
+
list = $.grep(list, (function (prop, limit) {
|
3023 |
+
return function (item) {
|
3024 |
+
return item[prop] >= area[prop] || item[prop] === limit;
|
3025 |
+
};
|
3026 |
+
})(property, Math.max.apply(null, $.map(list, function (item) {
|
3027 |
+
return item[property];
|
3028 |
+
}))));
|
3029 |
+
}
|
3030 |
+
|
3031 |
+
// next reduce our src array by comparing the viewport properties against the minimum values of the same properties of each src
|
3032 |
+
// only src's with a property equal to the minimum are kept
|
3033 |
+
for (property in area) {
|
3034 |
+
if (!area.hasOwnProperty(property)) continue;
|
3035 |
+
list = $.grep(list, (function (prop, limit) {
|
3036 |
+
return function (item) {
|
3037 |
+
return item[prop] === limit;
|
3038 |
+
};
|
3039 |
+
})(property, Math.min.apply(null, $.map(list, function (item) {
|
3040 |
+
return item[property];
|
3041 |
+
}))));
|
3042 |
+
}
|
3043 |
+
|
3044 |
+
// return the first url as it is the best match for the current viewport
|
3045 |
+
return list[0].url;
|
3046 |
+
};
|
3047 |
+
|
3048 |
+
/**
|
3049 |
+
* @summary Expose FooGallery as a jQuery plugin.
|
3050 |
+
* @memberof external:"jQuery.fn"#
|
3051 |
+
* @function foogallery
|
3052 |
+
* @param {(object|string)} [options] - The options to supply to FooGallery or one of the supported method names.
|
3053 |
+
* @param {external:"jQuery.fn"~readyCallback} [ready] - A callback executed once each template initialized is ready.
|
3054 |
+
* @returns {jQuery}
|
3055 |
+
* @example {@caption The below shows using this method in its simplest form, initializing a template on pre-existing elements.}{@lang html}
|
3056 |
+
* <!-- The container element for the template -->
|
3057 |
+
* <div id="gallery-1" class="foogallery">
|
3058 |
+
* <!-- A single item -->
|
3059 |
+
* <div class="fg-item" data-id="[item.id]">
|
3060 |
+
* <div class="fg-item-inner">
|
3061 |
+
* <a class="fg-thumb" href="[item.href]">
|
3062 |
+
* <img class="fg-image" width="[item.width]" height="[item.height]"
|
3063 |
+
* title="[item.title]" alt="[item.description]"
|
3064 |
+
* data-src="[item.src]"
|
3065 |
+
* data-srcset="[item.srcset]" />
|
3066 |
+
* <!-- Optional caption markup -->
|
3067 |
+
* <div class="fg-caption">
|
3068 |
+
* <div class="fg-caption-inner">
|
3069 |
+
* <div class="fg-caption-title">[item.title]</div>
|
3070 |
+
* <div class="fg-caption-desc">[item.description]</div>
|
3071 |
+
* </div>
|
3072 |
+
* </div>
|
3073 |
+
* </a>
|
3074 |
+
* </div>
|
3075 |
+
* </div>
|
3076 |
+
* <!-- Any number of additional items -->
|
3077 |
+
* </div>
|
3078 |
+
* <script>
|
3079 |
+
* jQuery(function($){
|
3080 |
+
* $("#gallery-1").foogallery();
|
3081 |
+
* });
|
3082 |
+
* </script>
|
3083 |
+
* @example {@caption Options can be supplied directly to the `.foogallery()` method or by supplying them using the `data-foogallery` attribute. If supplied using the attribute the value must follow [valid JSON syntax](http://en.wikipedia.org/wiki/JSON#Data_types.2C_syntax_and_example) including quoted property names. If the same option is supplied in both locations as it is below, the value from the attribute overrides the value supplied to the method, in this case `lazy` would be `true`.}{@lang html}
|
3084 |
+
* <!-- Supplying the options using the attribute -->
|
3085 |
+
* <div id="gallery-1" class="foogallery fg-responsive" data-foogallery='{"lazy": true}'>
|
3086 |
+
* <!-- Items -->
|
3087 |
+
* </div>
|
3088 |
+
* <script>
|
3089 |
+
* jQuery(function($){
|
3090 |
+
* // Supply the options directly to the method
|
3091 |
+
* $("#gallery-1").foogallery({
|
3092 |
+
* lazy: false
|
3093 |
+
* });
|
3094 |
+
* });
|
3095 |
+
* </script>
|
3096 |
+
*/
|
3097 |
+
$.fn.foogallery = function(options, ready){
|
3098 |
+
return this.filter(".foogallery").each(function(i, element){
|
3099 |
+
if (_is.string(options)){
|
3100 |
+
var template = $.data(element, _.dataTemplate);
|
3101 |
+
if (template instanceof _.Template){
|
3102 |
+
switch (options){
|
3103 |
+
case "layout":
|
3104 |
+
template.layout();
|
3105 |
+
return;
|
3106 |
+
case "destroy":
|
3107 |
+
template.destroy();
|
3108 |
+
return;
|
3109 |
+
}
|
3110 |
+
}
|
3111 |
+
} else {
|
3112 |
+
_.template.make(options, element).initialize().then(function(template){
|
3113 |
+
if (_is.fn(ready)){
|
3114 |
+
ready(template);
|
3115 |
+
}
|
3116 |
+
});
|
3117 |
+
}
|
3118 |
+
});
|
3119 |
+
};
|
3120 |
+
|
3121 |
+
/**
|
3122 |
+
* @summary If supplied this method is executed after each template is initialized.
|
3123 |
+
* @callback external:"jQuery.fn"~readyCallback
|
3124 |
+
* @param {FooGallery.Template} template - The template that was initialized.
|
3125 |
+
* @example {@caption The below shows an example of supplying this callback to the `.foogallery()` method.}
|
3126 |
+
* jQuery(".foogallery").foogallery({
|
3127 |
+
* // Options here
|
3128 |
+
* }, function(template){
|
3129 |
+
* // Called after each template is initialized on the matched elements
|
3130 |
+
* });
|
3131 |
+
*/
|
3132 |
+
|
3133 |
+
// this automatically initializes all templates on page load
|
3134 |
+
$(function () {
|
3135 |
+
$('[id^="foogallery-"]').foogallery();
|
3136 |
+
});
|
3137 |
+
|
3138 |
+
})(
|
3139 |
+
FooGallery.$,
|
3140 |
+
FooGallery,
|
3141 |
+
FooGallery.utils,
|
3142 |
+
FooGallery.utils.is,
|
3143 |
+
FooGallery.utils.fn
|
3144 |
+
);
|
3145 |
+
(function($, _, _utils, _is, _fn, _obj){
|
3146 |
+
|
3147 |
+
_.TemplateFactory = _utils.Factory.extend(/** @lends FooGallery.TemplateFactory */{
|
3148 |
+
/**
|
3149 |
+
* @summary A factory for galleries allowing them to be easily registered and created.
|
3150 |
+
* @memberof FooGallery
|
3151 |
+
* @constructs TemplateFactory
|
3152 |
+
* @description The plugin makes use of an instance of this class exposed as {@link FooGallery.template}.
|
3153 |
+
* @augments FooGallery.utils.Factory
|
3154 |
+
* @borrows FooGallery.utils.Class.extend as extend
|
3155 |
+
* @borrows FooGallery.utils.Class.override as override
|
3156 |
+
*/
|
3157 |
+
construct: function(){
|
3158 |
+
/**
|
3159 |
+
* @summary An object containing all registered galleries.
|
3160 |
+
* @memberof FooGallery.TemplateFactory#
|
3161 |
+
* @name registered
|
3162 |
+
* @type {Object.<string, Object>}
|
3163 |
+
* @readonly
|
3164 |
+
* @example {@caption The following shows the structure of this object. The `<name>` placeholders would be the name the class was registered with.}
|
3165 |
+
* {
|
3166 |
+
* "<name>": {
|
3167 |
+
* "name": <string>,
|
3168 |
+
* "klass": <function>,
|
3169 |
+
* "test": <function>,
|
3170 |
+
* "priority": <number>
|
3171 |
+
* },
|
3172 |
+
* "<name>": {
|
3173 |
+
* "name": <string>,
|
3174 |
+
* "klass": <function>,
|
3175 |
+
* "test": <function>,
|
3176 |
+
* "priority": <number>
|
3177 |
+
* },
|
3178 |
+
* ...
|
3179 |
+
* }
|
3180 |
+
*/
|
3181 |
+
this.registered = {};
|
3182 |
+
},
|
3183 |
+
/**
|
3184 |
+
* @summary Registers a template constructor with the factory using the given `name` and `test` function.
|
3185 |
+
* @memberof FooGallery.TemplateFactory#
|
3186 |
+
* @function register
|
3187 |
+
* @param {string} name - The friendly name of the class.
|
3188 |
+
* @param {FooGallery.Template} template - The template constructor to register.
|
3189 |
+
* @param {object} options - The default options for the template.
|
3190 |
+
* @param {object} [classes={}] - The CSS classes for the template.
|
3191 |
+
* @param {object} [il8n={}] - The il8n strings for the template.
|
3192 |
+
* @param {number} [priority=0] - This determines the index for the class when using either the {@link FooGallery.TemplateFactory#load|load} or {@link FooGallery.TemplateFactory#names|names} methods, a higher value equals a lower index.
|
3193 |
+
* @returns {boolean} `true` if the `klass` was successfully registered.
|
3194 |
+
*/
|
3195 |
+
register: function(name, template, options, classes, il8n, priority){
|
3196 |
+
var self = this, result = self._super(name, template, priority);
|
3197 |
+
if (result){
|
3198 |
+
var reg = self.registered;
|
3199 |
+
reg[name].opt = _is.hash(options) ? options : {};
|
3200 |
+
reg[name].cls = _is.hash(classes) ? classes : {};
|
3201 |
+
reg[name].il8n = _is.hash(il8n) ? il8n : {};
|
3202 |
+
}
|
3203 |
+
return result;
|
3204 |
+
},
|
3205 |
+
/**
|
3206 |
+
* @summary Create a new instance of a registered template from the supplied `element` and `options`.
|
3207 |
+
* @memberof FooGallery.TemplateFactory#
|
3208 |
+
* @function make
|
3209 |
+
* @param {(object|FooGallery~Options)} [options] - The options for the template. If not supplied this will fall back to using the {@link FooGallery.defaults|defaults}.
|
3210 |
+
* @param {(jQuery|HTMLElement|string)} [element] - The jQuery object, HTMLElement or selector of the template element to create. If not supplied the {@link FooGallery~Options#type|type} options' value is used.
|
3211 |
+
* @returns {FooGallery.Template}
|
3212 |
+
*/
|
3213 |
+
make: function(options, element){
|
3214 |
+
element = _is.jq(element) ? element : $(element);
|
3215 |
+
options = _obj.merge(options, element.data("foogallery"));
|
3216 |
+
var self = this, type = self.type(options, element);
|
3217 |
+
if (!self.contains(type)) return null;
|
3218 |
+
options = self.options(type, options);
|
3219 |
+
return self._super(type, options, element);
|
3220 |
+
},
|
3221 |
+
type: function(options, element){
|
3222 |
+
element = _is.jq(element) ? element : $(element);
|
3223 |
+
var self = this, type = _is.hash(options) && _is.hash(options) && _is.string(options.type) && self.contains(options.type) ? options.type : "core";
|
3224 |
+
if (type === "core" && element.length > 0){
|
3225 |
+
var reg = self.registered, names = self.names(true);
|
3226 |
+
for (var i = 0, l = names.length; i < l; i++) {
|
3227 |
+
if (!reg.hasOwnProperty(names[i])) continue;
|
3228 |
+
var name = names[i], cls = reg[name].cls;
|
3229 |
+
if (!_is.string(cls.container)) continue;
|
3230 |
+
var selector = _utils.selectify(cls.container);
|
3231 |
+
if (element.is(selector)) {
|
3232 |
+
type = names[i];
|
3233 |
+
break;
|
3234 |
+
}
|
3235 |
+
}
|
3236 |
+
}
|
3237 |
+
return type;
|
3238 |
+
},
|
3239 |
+
configure: function(name, options, classes, il8n){
|
3240 |
+
var self = this;
|
3241 |
+
if (self.contains(name)){
|
3242 |
+
var reg = self.registered;
|
3243 |
+
_obj.extend(reg[name].opt, options);
|
3244 |
+
_obj.extend(reg[name].cls, classes);
|
3245 |
+
_obj.extend(reg[name].il8n, il8n);
|
3246 |
+
}
|
3247 |
+
},
|
3248 |
+
options: function(name, options){
|
3249 |
+
options = _is.hash(options) ? options : {};
|
3250 |
+
var self = this, reg = self.registered,
|
3251 |
+
def = reg["core"].opt,
|
3252 |
+
cls = reg["core"].cls,
|
3253 |
+
il8n = reg["core"].il8n;
|
3254 |
+
|
3255 |
+
options = _.paging.merge(options);
|
3256 |
+
if (name !== "core" && self.contains(name)){
|
3257 |
+
options = _obj.extend({}, def, reg[name].opt, options);
|
3258 |
+
options.cls = _obj.extend({}, cls, reg[name].cls, options.cls);
|
3259 |
+
options.il8n = _obj.extend({}, il8n, reg[name].il8n, options.il8n);
|
3260 |
+
} else {
|
3261 |
+
options = _obj.extend({}, def, options);
|
3262 |
+
options.cls = _obj.extend({}, cls, options.cls);
|
3263 |
+
options.il8n = _obj.extend({}, il8n, options.il8n);
|
3264 |
+
}
|
3265 |
+
return options;
|
3266 |
+
}
|
3267 |
+
});
|
3268 |
+
|
3269 |
+
/**
|
3270 |
+
* @summary The factory used to register and create the various template types of FooGallery.
|
3271 |
+
* @memberof FooGallery
|
3272 |
+
* @name template
|
3273 |
+
* @type {FooGallery.TemplateFactory}
|
3274 |
+
*/
|
3275 |
+
_.template = new _.TemplateFactory();
|
3276 |
+
|
3277 |
+
})(
|
3278 |
+
FooGallery.$,
|
3279 |
+
FooGallery,
|
3280 |
+
FooGallery.utils,
|
3281 |
+
FooGallery.utils.is,
|
3282 |
+
FooGallery.utils.fn,
|
3283 |
+
FooGallery.utils.obj
|
3284 |
+
);
|
3285 |
+
(function(_, _utils, _is, _fn, _obj){
|
3286 |
+
|
3287 |
+
_.PagingFactory = _utils.Factory.extend(/** @lends FooGallery.PagingFactory */{
|
3288 |
+
/**
|
3289 |
+
* @summary A factory for paging types allowing them to be easily registered and created.
|
3290 |
+
* @memberof FooGallery
|
3291 |
+
* @constructs PagingFactory
|
3292 |
+
* @description The plugin makes use of an instance of this class exposed as {@link FooGallery.paging}.
|
3293 |
+
* @augments FooGallery.Factory
|
3294 |
+
* @borrows FooGallery.Factory.extend as extend
|
3295 |
+
* @borrows FooGallery.Factory.override as override
|
3296 |
+
*/
|
3297 |
+
construct: function(){
|
3298 |
+
/**
|
3299 |
+
* @summary An object containing all registered paging types.
|
3300 |
+
* @memberof FooGallery.PagingFactory#
|
3301 |
+
* @name registered
|
3302 |
+
* @type {Object.<string, Object>}
|
3303 |
+
* @readonly
|
3304 |
+
* @example {@caption The following shows the structure of this object. The `<name>` placeholders would be the name the class was registered with.}
|
3305 |
+
* {
|
3306 |
+
* "<name>": {
|
3307 |
+
* "name": <string>,
|
3308 |
+
* "klass": <function>,
|
3309 |
+
* "ctrl": <function>,
|
3310 |
+
* "priority": <number>
|
3311 |
+
* },
|
3312 |
+
* "<name>": {
|
3313 |
+
* "name": <string>,
|
3314 |
+
* "klass": <function>,
|
3315 |
+
* "ctrl": <function>,
|
3316 |
+
* "priority": <number>
|
3317 |
+
* },
|
3318 |
+
* ...
|
3319 |
+
* }
|
3320 |
+
*/
|
3321 |
+
this.registered = {};
|
3322 |
+
},
|
3323 |
+
/**
|
3324 |
+
* @summary Registers a paging `type` constructor with the factory using the given `name` and `test` function.
|
3325 |
+
* @memberof FooGallery.PagingFactory#
|
3326 |
+
* @function register
|
3327 |
+
* @param {string} name - The friendly name of the class.
|
3328 |
+
* @param {FooGallery.Paging} type - The paging type constructor to register.
|
3329 |
+
* @param {FooGallery.PagingControl} [ctrl] - An optional control to register for the paging type.
|
3330 |
+
* @param {object} [options={}] - The default options for the paging type.
|
3331 |
+
* @param {object} [classes={}] - The CSS classes for the paging type.
|
3332 |
+
* @param {object} [il8n={}] - The il8n strings for the paging type.
|
3333 |
+
* @param {number} [priority=0] - This determines the index for the class when using either the {@link FooGallery.PagingFactory#load|load} or {@link FooGallery.PagingFactory#names|names} methods, a higher value equals a lower index.
|
3334 |
+
* @returns {boolean} `true` if the `klass` was successfully registered.
|
3335 |
+
*/
|
3336 |
+
register: function(name, type, ctrl, options, classes, il8n, priority){
|
3337 |
+
var self = this, result = self._super(name, type, priority);
|
3338 |
+
if (result){
|
3339 |
+
var reg = self.registered;
|
3340 |
+
reg[name].ctrl = _is.fn(ctrl) ? ctrl : null;
|
3341 |
+
reg[name].opt = _is.hash(options) ? options : {};
|
3342 |
+
reg[name].cls = _is.hash(classes) ? classes : {};
|
3343 |
+
reg[name].il8n = _is.hash(il8n) ? il8n : {};
|
3344 |
+
}
|
3345 |
+
return result;
|
3346 |
+
},
|
3347 |
+
// /**
|
3348 |
+
// * @summary Create a new instance of a registered paging type for the supplied `template`.
|
3349 |
+
// * @memberof FooGallery.PagingFactory#
|
3350 |
+
// * @function make
|
3351 |
+
// * @param {FooGallery.Template} template - The template creating the new instance.
|
3352 |
+
// * @returns {FooGallery.Paging}
|
3353 |
+
// */
|
3354 |
+
// make: function(template){
|
3355 |
+
// var self = this, paging, type;
|
3356 |
+
// if (!(template instanceof _.Template) || !_is.hash(paging = template.opt.paging) || !self.contains(type = paging.type) || type === "default") return null;
|
3357 |
+
// var reg = self.registered;
|
3358 |
+
// template.opt.paging = _obj.extend({}, reg["default"].opt, reg[type].opt, template.opt.paging);
|
3359 |
+
// template.cls.paging = _obj.extend({}, reg["default"].cls, reg[type].cls, template.cls.paging);
|
3360 |
+
// template.il8n.paging = _obj.extend({}, reg["default"].il8n, reg[type].il8n, template.il8n.paging);
|
3361 |
+
// template.sel.paging = _utils.selectify(template.cls.paging);
|
3362 |
+
// return self._super(type, template);
|
3363 |
+
// },
|
3364 |
+
type: function(options){
|
3365 |
+
var self = this, opt;
|
3366 |
+
return _is.hash(options) && _is.hash(opt = options.paging) && _is.string(opt.type) && self.contains(opt.type) ? opt.type : null;
|
3367 |
+
},
|
3368 |
+
merge: function(options){
|
3369 |
+
options = _is.hash(options) ? options : {};
|
3370 |
+
var self = this, type = self.type(options),
|
3371 |
+
reg = self.registered,
|
3372 |
+
def = reg["default"].opt,
|
3373 |
+
def_cls = reg["default"].cls,
|
3374 |
+
def_il8n = reg["default"].il8n,
|
3375 |
+
opt = _is.hash(options.paging) ? options.paging : {},
|
3376 |
+
cls = _is.hash(options.cls) && _is.hash(options.cls.paging) ? options.cls.paging : {},
|
3377 |
+
il8n = _is.hash(options.il8n) && _is.hash(options.il8n.paging) ? options.il8n.paging : {};
|
3378 |
+
|
3379 |
+
if (type !== "default" && self.contains(type)){
|
3380 |
+
options.paging = _obj.extend({}, def, reg[type].opt, opt, {type: type});
|
3381 |
+
options.cls = _obj.extend({}, {paging: def_cls}, {paging: reg[type].cls}, {paging: cls});
|
3382 |
+
options.il8n = _obj.extend({}, {paging: def_il8n}, {paging: reg[type].il8n}, {paging: il8n});
|
3383 |
+
} else {
|
3384 |
+
options.paging = _obj.extend({}, def, opt, {type: type});
|
3385 |
+
options.cls = _obj.extend({}, {paging: def_cls}, {paging: cls});
|
3386 |
+
options.il8n = _obj.extend({}, {paging: def_il8n}, {paging: il8n});
|
3387 |
+
}
|
3388 |
+
return options;
|
3389 |
+
},
|
3390 |
+
configure: function(name, options, classes, il8n){
|
3391 |
+
var self = this;
|
3392 |
+
if (self.contains(name)){
|
3393 |
+
var reg = self.registered;
|
3394 |
+
_obj.extend(reg[name].opt, options);
|
3395 |
+
_obj.extend(reg[name].cls, classes);
|
3396 |
+
_obj.extend(reg[name].il8n, il8n);
|
3397 |
+
}
|
3398 |
+
},
|
3399 |
+
options: function(name, options){
|
3400 |
+
options = _is.hash(options) ? options : {};
|
3401 |
+
var self = this,
|
3402 |
+
reg = self.registered,
|
3403 |
+
def = reg["default"].opt,
|
3404 |
+
def_cls = reg["default"].cls,
|
3405 |
+
def_il8n = reg["default"].il8n,
|
3406 |
+
opt = _is.hash(options.paging) ? options.paging : {},
|
3407 |
+
cls = _is.hash(options.cls) && _is.hash(options.cls.paging) ? options.cls.paging : {},
|
3408 |
+
il8n = _is.hash(options.il8n) && _is.hash(options.il8n.paging) ? options.il8n.paging : {};
|
3409 |
+
|
3410 |
+
if (name !== "default" && self.contains(name)){
|
3411 |
+
options.paging = _obj.extend({}, def, reg[name].opt, opt, {type: name});
|
3412 |
+
options.cls = _obj.extend({}, {paging: def_cls}, {paging: reg[name].cls}, {paging: cls});
|
3413 |
+
options.il8n = _obj.extend({}, {paging: def_il8n}, {paging: reg[name].il8n}, {paging: il8n});
|
3414 |
+
} else {
|
3415 |
+
options.paging = _obj.extend({}, def, opt, {type: name});
|
3416 |
+
options.cls = _obj.extend({}, {paging: def_cls}, {paging: cls});
|
3417 |
+
options.il8n = _obj.extend({}, {paging: def_il8n}, {paging: il8n});
|
3418 |
+
}
|
3419 |
+
return options;
|
3420 |
+
},
|
3421 |
+
/**
|
3422 |
+
* @summary Checks if the factory contains a control registered using the supplied `name`.
|
3423 |
+
* @memberof FooGallery.PagingFactory#
|
3424 |
+
* @function hasCtrl
|
3425 |
+
* @param {string} name - The friendly name of the class.
|
3426 |
+
* @returns {boolean}
|
3427 |
+
*/
|
3428 |
+
hasCtrl: function(name){
|
3429 |
+
var self = this, reg = self.registered[name];
|
3430 |
+
return _is.hash(reg) && _is.fn(reg.ctrl);
|
3431 |
+
},
|
3432 |
+
/**
|
3433 |
+
* @summary Create a new instance of a control class registered with the supplied `name` and arguments.
|
3434 |
+
* @memberof FooGallery.PagingFactory#
|
3435 |
+
* @function makeCtrl
|
3436 |
+
* @param {string} name - The friendly name of the class.
|
3437 |
+
* @param {FooGallery.Template} template - The template creating the control.
|
3438 |
+
* @param {FooGallery.Paging} parent - The parent paging class creating the control.
|
3439 |
+
* @param {string} position - The position the control will be displayed at.
|
3440 |
+
* @returns {?FooGallery.PagingControl}
|
3441 |
+
*/
|
3442 |
+
makeCtrl: function(name, template, parent, position){
|
3443 |
+
var self = this, reg = self.registered[name];
|
3444 |
+
if (_is.hash(reg) && _is.fn(reg.ctrl)){
|
3445 |
+
return new reg.ctrl(template, parent, position);
|
3446 |
+
}
|
3447 |
+
return null;
|
3448 |
+
}
|
3449 |
+
});
|
3450 |
+
|
3451 |
+
/**
|
3452 |
+
* @summary The factory used to register and create the various paging types of FooGallery.
|
3453 |
+
* @memberof FooGallery
|
3454 |
+
* @name paging
|
3455 |
+
* @type {FooGallery.PagingFactory}
|
3456 |
+
*/
|
3457 |
+
_.paging = new _.PagingFactory();
|
3458 |
+
|
3459 |
+
})(
|
3460 |
+
FooGallery,
|
3461 |
+
FooGallery.utils,
|
3462 |
+
FooGallery.utils.is,
|
3463 |
+
FooGallery.utils.fn,
|
3464 |
+
FooGallery.utils.obj
|
3465 |
+
);
|
3466 |
+
(function($, _, _utils, _is, _fn, _str){
|
3467 |
+
|
3468 |
+
_.Template = _utils.Class.extend(/** @lends FooGallery.Template */{
|
3469 |
+
/**
|
3470 |
+
* @summary The primary class for FooGallery, this controls the flow of the plugin across all templates.
|
3471 |
+
* @memberof FooGallery
|
3472 |
+
* @constructs Template
|
3473 |
+
* @param {FooGallery~Options} [options] - The options for the template.
|
3474 |
+
* @param {jQuery} [element] - The jQuery object of the templates' container element. If not supplied one will be created within the `parent` element supplied to the {@link FooGallery.Template#initialize|initialize} method.
|
3475 |
+
* @augments FooGallery.utils.Class
|
3476 |
+
* @borrows FooGallery.utils.Class.extend as extend
|
3477 |
+
* @borrows FooGallery.utils.Class.override as override
|
3478 |
+
*/
|
3479 |
+
construct: function(options, element){
|
3480 |
+
var self = this;
|
3481 |
+
/**
|
3482 |
+
* @summary The jQuery object for the template container.
|
3483 |
+
* @memberof FooGallery.Template#
|
3484 |
+
* @name $el
|
3485 |
+
* @type {jQuery}
|
3486 |
+
*/
|
3487 |
+
self.$el = _is.jq(element) ? element : $(element);
|
3488 |
+
/**
|
3489 |
+
* @summary The options for the template.
|
3490 |
+
* @memberof FooGallery.Template#
|
3491 |
+
* @name opt
|
3492 |
+
* @type {FooGallery~Options}
|
3493 |
+
*/
|
3494 |
+
self.opt = options;
|
3495 |
+
/**
|
3496 |
+
* @summary Any custom options for the template.
|
3497 |
+
* @memberof FooGallery.Template#
|
3498 |
+
* @name template
|
3499 |
+
* @type {object}
|
3500 |
+
*/
|
3501 |
+
self.template = options.template;
|
3502 |
+
/**
|
3503 |
+
* @summary The ID for the template.
|
3504 |
+
* @memberof FooGallery.Template#
|
3505 |
+
* @name id
|
3506 |
+
* @type {string}
|
3507 |
+
*/
|
3508 |
+
self.id = self.$el.prop("id") || options.id;
|
3509 |
+
/**
|
3510 |
+
* @summary Whether or not the template created its' own container element.
|
3511 |
+
* @memberof FooGallery.Template#
|
3512 |
+
* @name createdSelf
|
3513 |
+
* @type {boolean}
|
3514 |
+
*/
|
3515 |
+
self.createdSelf = false;
|
3516 |
+
/**
|
3517 |
+
* @summary The CSS classes for the template.
|
3518 |
+
* @memberof FooGallery.Template#
|
3519 |
+
* @name cls
|
3520 |
+
* @type {FooGallery~CSSClasses}
|
3521 |
+
*/
|
3522 |
+
self.cls = options.cls;
|
3523 |
+
/**
|
3524 |
+
* @summary The il8n strings for the template.
|
3525 |
+
* @memberof FooGallery.Template#
|
3526 |
+
* @name il8n
|
3527 |
+
* @type {FooGallery~il8n}
|
3528 |
+
*/
|
3529 |
+
self.il8n = options.il8n;
|
3530 |
+
/**
|
3531 |
+
* @summary The CSS selectors for the template.
|
3532 |
+
* @memberof FooGallery.Template#
|
3533 |
+
* @name sel
|
3534 |
+
* @type {FooGallery~CSSSelectors}
|
3535 |
+
*/
|
3536 |
+
self.sel = _utils.selectify(self.cls);
|
3537 |
+
/**
|
3538 |
+
* @summary The item manager for the template.
|
3539 |
+
* @memberof FooGallery.Template#
|
3540 |
+
* @name items
|
3541 |
+
* @type {FooGallery.Items}
|
3542 |
+
*/
|
3543 |
+
self.items = _.components.make("items", self);
|
3544 |
+
/**
|
3545 |
+
* @summary The page manager for the template.
|
3546 |
+
* @memberof FooGallery.Template#
|
3547 |
+
* @name pages
|
3548 |
+
* @type {?FooGallery.Paging}
|
3549 |
+
*/
|
3550 |
+
self.pages = _.paging.make(options.paging.type, self);
|
3551 |
+
/**
|
3552 |
+
* @summary The state manager for the template.
|
3553 |
+
* @memberof FooGallery.Template#
|
3554 |
+
* @name state
|
3555 |
+
* @type {FooGallery.State}
|
3556 |
+
*/
|
3557 |
+
self.state = _.components.make("state", self);
|
3558 |
+
/**
|
3559 |
+
* @summary The throttle used by the template to limit expensive code execution.
|
3560 |
+
* @memberof FooGallery.Template#
|
3561 |
+
* @name _throttle
|
3562 |
+
* @type {?FooGallery.utils.Throttle}
|
3563 |
+
* @private
|
3564 |
+
*/
|
3565 |
+
self._throttle = new _utils.Throttle(self.opt.throttle);
|
3566 |
+
/**
|
3567 |
+
* @summary The promise object returned by the {@link FooGallery.Template#initialize|initialize} method.
|
3568 |
+
* @memberof FooGallery.Template#
|
3569 |
+
* @name _initialize
|
3570 |
+
* @type {?Promise}
|
3571 |
+
* @private
|
3572 |
+
*/
|
3573 |
+
self._initialize = null;
|
3574 |
+
self.initializing = false;
|
3575 |
+
self.initialized = false;
|
3576 |
+
self.destroying = false;
|
3577 |
+
self.destroyed = false;
|
3578 |
+
},
|
3579 |
+
|
3580 |
+
// ################
|
3581 |
+
// ## Initialize ##
|
3582 |
+
// ################
|
3583 |
+
|
3584 |
+
/**
|
3585 |
+
* @summary Initialize the template.
|
3586 |
+
* @memberof FooGallery.Template#
|
3587 |
+
* @function initialize
|
3588 |
+
* @param {(jQuery|HTMLElement|string)} [parent] - If no element was supplied to the constructor you must supply a parent element for the template to append itself to. This can be a jQuery object, HTMLElement or a CSS selector.
|
3589 |
+
* @returns {Promise.<FooGallery.Template>}
|
3590 |
+
* @description Once resolved all options, objects and elements required by the template have been parsed or created and the initial load is complete.
|
3591 |
+
* @fires FooGallery.Template~"pre-init.foogallery"
|
3592 |
+
* @fires FooGallery.Template~"init.foogallery"
|
3593 |
+
* @fires FooGallery.Template~"post-init.foogallery"
|
3594 |
+
* @fires FooGallery.Template~"ready.foogallery"
|
3595 |
+
*/
|
3596 |
+
initialize: function(parent){
|
3597 |
+
var self = this;
|
3598 |
+
if (_is.promise(self._initialize)) return self._initialize;
|
3599 |
+
parent = _is.jq(parent) ? parent : $(parent);
|
3600 |
+
return self._initialize = $.Deferred(function(def){
|
3601 |
+
self.initializing = true;
|
3602 |
+
if (parent.length === 0 && self.$el.parent().length === 0){
|
3603 |
+
def.reject("A parent element is required.");
|
3604 |
+
return;
|
3605 |
+
}
|
3606 |
+
if (self.$el.length === 0){
|
3607 |
+
self.$el = self.create();
|
3608 |
+
self.createdSelf = true;
|
3609 |
+
}
|
3610 |
+
if (parent.length > 0){
|
3611 |
+
self.$el.appendTo(parent);
|
3612 |
+
}
|
3613 |
+
var queue = $.Deferred(), existing;
|
3614 |
+
if (self.$el.length > 0 && (existing = self.$el.data(_.dataTemplate)) instanceof _.Template){
|
3615 |
+
queue.then(function(){
|
3616 |
+
return existing.destroy().then(function(){
|
3617 |
+
self.$el.data(_.dataTemplate, self);
|
3618 |
+
});
|
3619 |
+
});
|
3620 |
+
} else {
|
3621 |
+
self.$el.data(_.dataTemplate, self);
|
3622 |
+
}
|
3623 |
+
queue.then(function(){
|
3624 |
+
if (self.destroying) return _fn.rejectWith("destroy in progress");
|
3625 |
+
// at this point we have our container element free of pre-existing instances so let's bind any event listeners supplied by the .on option
|
3626 |
+
if (!_is.empty(self.opt.on)){
|
3627 |
+
self.$el.on(self.opt.on);
|
3628 |
+
}
|
3629 |
+
|
3630 |
+
/**
|
3631 |
+
* @summary Raised before the template is fully initialized.
|
3632 |
+
* @event FooGallery.Template~"pre-init.foogallery"
|
3633 |
+
* @type {jQuery.Event}
|
3634 |
+
* @param {jQuery.Event} event - The jQuery.Event object for the current event.
|
3635 |
+
* @param {FooGallery.Template} template - The template raising the event.
|
3636 |
+
* @returns {Promise} Resolved once the pre-initialization work is complete, rejected if an error occurs or execution is prevented.
|
3637 |
+
* @description At this point in the initialization chain the {@link FooGallery.Template#opt|opt} property has not undergone any additional parsing and is just the result of the {@link FooGallery.defaults|default options} being extended with any user supplied ones.
|
3638 |
+
* @example {@caption To listen for this event and perform some action when it occurs you would bind to it as follows.}
|
3639 |
+
* $(".foogallery").foogallery({
|
3640 |
+
* on: {
|
3641 |
+
* "pre-init.foogallery": function(event, template){
|
3642 |
+
* // do something
|
3643 |
+
* }
|
3644 |
+
* }
|
3645 |
+
* });
|
3646 |
+
* @example {@caption Calling the `preventDefault` method on the `event` object will prevent the template being initialized.}
|
3647 |
+
* $(".foogallery").foogallery({
|
3648 |
+
* on: {
|
3649 |
+
* "pre-init.foogallery": function(event, template){
|
3650 |
+
* if ("some condition"){
|
3651 |
+
* // stop the template being initialized
|
3652 |
+
* event.preventDefault();
|
3653 |
+
* }
|
3654 |
+
* }
|
3655 |
+
* }
|
3656 |
+
* });
|
3657 |
+
*/
|
3658 |
+
var e = self.raise("pre-init");
|
3659 |
+
if (e.isDefaultPrevented()) return _fn.rejectWith("pre-init default prevented");
|
3660 |
+
}).then(function(){
|
3661 |
+
if (self.destroying) return _fn.rejectWith("destroy in progress");
|
3662 |
+
// checks the delay option and if it is greater than 0 waits for that amount of time before continuing
|
3663 |
+
if (self.opt.delay <= 0) return _fn.resolved;
|
3664 |
+
return $.Deferred(function(wait){
|
3665 |
+
self._delay = setTimeout(function () {
|
3666 |
+
self._delay = null;
|
3667 |
+
wait.resolve();
|
3668 |
+
}, self.opt.delay);
|
3669 |
+
}).promise();
|
3670 |
+
}).then(function(){
|
3671 |
+
if (self.destroying) return _fn.rejectWith("destroy in progress");
|
3672 |
+
/**
|
3673 |
+
* @summary Raised before the template is initialized but after any pre-initialization work is complete.
|
3674 |
+
* @event FooGallery.Template~"init.foogallery"
|
3675 |
+
* @type {jQuery.Event}
|
3676 |
+
* @param {jQuery.Event} event - The jQuery.Event object for the current event.
|
3677 |
+
* @param {FooGallery.Template} template - The template raising the event.
|
3678 |
+
* @returns {Promise} Resolved once the initialization work is complete, rejected if an error occurs or execution is prevented.
|
3679 |
+
* @description At this point in the initialization chain all additional option parsing has been completed but the base components such as the items or state are not yet initialized.
|
3680 |
+
* @example {@caption To listen for this event and perform some action when it occurs you would bind to it as follows.}
|
3681 |
+
* $(".foogallery").foogallery({
|
3682 |
+
* on: {
|
3683 |
+
* "init.foogallery": function(event, template){
|
3684 |
+
* // do something
|
3685 |
+
* }
|
3686 |
+
* }
|
3687 |
+
* });
|
3688 |
+
* @example {@caption Calling the `preventDefault` method on the `event` object will prevent the template being initialized.}
|
3689 |
+
* $(".foogallery").foogallery({
|
3690 |
+
* on: {
|
3691 |
+
* "init.foogallery": function(event, template){
|
3692 |
+
* if ("some condition"){
|
3693 |
+
* // stop the template being initialized
|
3694 |
+
* event.preventDefault();
|
3695 |
+
* }
|
3696 |
+
* }
|
3697 |
+
* }
|
3698 |
+
* });
|
3699 |
+
* @example {@caption You can also prevent the default logic and replace it with your own by calling the `preventDefault` method on the `event` object and returning a promise.}
|
3700 |
+
* $(".foogallery").foogallery({
|
3701 |
+
* on: {
|
3702 |
+
* "init.foogallery": function(event, template){
|
3703 |
+
* // stop the default logic
|
3704 |
+
* event.preventDefault();
|
3705 |
+
* // you can execute the default logic by calling the handler directly yourself
|
3706 |
+
* // var promise = template.onInit();
|
3707 |
+
* // replace the default logic with your own
|
3708 |
+
* return Promise;
|
3709 |
+
* }
|
3710 |
+
* }
|
3711 |
+
* });
|
3712 |
+
*/
|
3713 |
+
var e = self.raise("init");
|
3714 |
+
if (e.isDefaultPrevented()) return _fn.rejectWith("init default prevented");
|
3715 |
+
return self.items.fetch();
|
3716 |
+
}).then(function(){
|
3717 |
+
if (self.destroying) return _fn.rejectWith("destroy in progress");
|
3718 |
+
/**
|
3719 |
+
* @summary Raised after the template is initialized but before any post-initialization work is complete.
|
3720 |
+
* @event FooGallery.Template~"post-init.foogallery"
|
3721 |
+
* @type {jQuery.Event}
|
3722 |
+
* @param {jQuery.Event} event - The jQuery.Event object for the current event.
|
3723 |
+
* @param {FooGallery.Template} template - The template raising the event.
|
3724 |
+
* @returns {Promise} Resolved once the post-initialization work is complete, rejected if an error occurs or execution is prevented.
|
3725 |
+
* @description At this point in the initialization chain all options, objects and elements required by the template have been parsed or created however the initial state has not been set yet and no items have been loaded.
|
3726 |
+
* @example {@caption To listen for this event and perform some action when it occurs you would bind to it as follows.}
|
3727 |
+
* $(".foogallery").foogallery({
|
3728 |
+
* on: {
|
3729 |
+
* "post-init.foogallery": function(event, template){
|
3730 |
+
* // do something
|
3731 |
+
* }
|
3732 |
+
* }
|
3733 |
+
* });
|
3734 |
+
* @example {@caption Calling the `preventDefault` method on the `event` object will prevent the template being initialized.}
|
3735 |
+
* $(".foogallery").foogallery({
|
3736 |
+
* on: {
|
3737 |
+
* "post-init.foogallery": function(event, template){
|
3738 |
+
* if ("some condition"){
|
3739 |
+
* // stop the template being initialized
|
3740 |
+
* event.preventDefault();
|
3741 |
+
* }
|
3742 |
+
* }
|
3743 |
+
* }
|
3744 |
+
* });
|
3745 |
+
* @example {@caption You can also prevent the default logic and replace it with your own by calling the `preventDefault` method on the `event` object and returning a promise.}
|
3746 |
+
* $(".foogallery").foogallery({
|
3747 |
+
* on: {
|
3748 |
+
* "post-init.foogallery": function(event, template){
|
3749 |
+
* // stop the default logic
|
3750 |
+
* event.preventDefault();
|
3751 |
+
* // you can execute the default logic by calling the handler directly yourself
|
3752 |
+
* // var promise = template.onPostInit();
|
3753 |
+
* // replace the default logic with your own
|
3754 |
+
* return Promise;
|
3755 |
+
* }
|
3756 |
+
* }
|
3757 |
+
* });
|
3758 |
+
*/
|
3759 |
+
var e = self.raise("post-init");
|
3760 |
+
if (e.isDefaultPrevented()) return _fn.rejectWith("post-init default prevented");
|
3761 |
+
var state = self.state.parse();
|
3762 |
+
self.state.set(_is.empty(state) ? self.state.initial() : state);
|
3763 |
+
$(window).on("scroll.foogallery", {self: self}, self.onWindowScroll)
|
3764 |
+
.on("popstate.foogallery", {self: self}, self.onWindowPopState);
|
3765 |
+
}).then(function(){
|
3766 |
+
if (self.destroying) return _fn.rejectWith("destroy in progress");
|
3767 |
+
/**
|
3768 |
+
* @summary Raised after the template is fully initialized but before the first load occurs.
|
3769 |
+
* @event FooGallery.Template~"first-load.foogallery"
|
3770 |
+
* @type {jQuery.Event}
|
3771 |
+
* @param {jQuery.Event} event - The jQuery.Event object for the current event.
|
3772 |
+
* @param {FooGallery.Template} template - The template raising the event.
|
3773 |
+
* @description This event is raised after all post-initialization work such as setting the initial state is performed but before the first load of items takes place.
|
3774 |
+
* @example {@caption To listen for this event and perform some action when it occurs you would bind to it as follows.}
|
3775 |
+
* $(".foogallery").foogallery({
|
3776 |
+
* on: {
|
3777 |
+
* "first-load.foogallery": function(event, template){
|
3778 |
+
* // do something
|
3779 |
+
* }
|
3780 |
+
* }
|
3781 |
+
* });
|
3782 |
+
*/
|
3783 |
+
self.raise("first-load");
|
3784 |
+
return self.loadAvailable();
|
3785 |
+
}).then(function(){
|
3786 |
+
if (self.destroying) return _fn.rejectWith("destroy in progress");
|
3787 |
+
self.initializing = false;
|
3788 |
+
self.initialized = true;
|
3789 |
+
/**
|
3790 |
+
* @summary Raised after the template is fully initialized and is ready to be interacted with.
|
3791 |
+
* @event FooGallery.Template~"ready.foogallery"
|
3792 |
+
* @type {jQuery.Event}
|
3793 |
+
* @param {jQuery.Event} event - The jQuery.Event object for the current event.
|
3794 |
+
* @param {FooGallery.Template} template - The template raising the event.
|
3795 |
+
* @description This event is raised after all post-initialization work such as setting the initial state and performing the first load are completed.
|
3796 |
+
* @example {@caption To listen for this event and perform some action when it occurs you would bind to it as follows.}
|
3797 |
+
* $(".foogallery").foogallery({
|
3798 |
+
* on: {
|
3799 |
+
* "ready.foogallery": function(event, template){
|
3800 |
+
* // do something
|
3801 |
+
* }
|
3802 |
+
* }
|
3803 |
+
* });
|
3804 |
+
*/
|
3805 |
+
self.raise("ready");
|
3806 |
+
def.resolve(self);
|
3807 |
+
}).fail(function(err){
|
3808 |
+
def.reject(err);
|
3809 |
+
});
|
3810 |
+
queue.resolve();
|
3811 |
+
}).promise().fail(function(err){
|
3812 |
+
console.log("initialize failed", self, err);
|
3813 |
+
self.destroy();
|
3814 |
+
});
|
3815 |
+
},
|
3816 |
+
/**
|
3817 |
+
* @summary Create a new container element for the template returning the jQuery object.
|
3818 |
+
* @memberof FooGallery.Template#
|
3819 |
+
* @function create
|
3820 |
+
* @returns {jQuery} A jQuery object to use as the container for the template.
|
3821 |
+
* @description This method is called from within the {@link FooGallery.Template#initialize|initialize} method only if a container element is required.
|
3822 |
+
* @example {@caption The below shows an example of what the returned jQuery objects' outer HTML would look like.}{@lang html}
|
3823 |
+
* <div id="{options.id}" class="{options.cls.container} {options.classes}">
|
3824 |
+
* </div>
|
3825 |
+
*/
|
3826 |
+
create: function(){
|
3827 |
+
var self = this;
|
3828 |
+
return $("<div/>", {"id": self.id, "class": self.cls.container}).addClass(self.opt.classes);
|
3829 |
+
},
|
3830 |
+
|
3831 |
+
// #############
|
3832 |
+
// ## Destroy ##
|
3833 |
+
// #############
|
3834 |
+
|
3835 |
+
/**
|
3836 |
+
* @summary Destroy the template.
|
3837 |
+
* @memberof FooGallery.Template#
|
3838 |
+
* @function destroy
|
3839 |
+
* @returns {Promise}
|
3840 |
+
* @description Once this method is called it can not be stopped and the template will be destroyed.
|
3841 |
+
* @fires FooGallery.Template~"destroy.foogallery"
|
3842 |
+
*/
|
3843 |
+
destroy: function(){
|
3844 |
+
var self = this;
|
3845 |
+
if (self.destroyed) return _fn.resolved;
|
3846 |
+
self.destroying = true;
|
3847 |
+
if (self.initializing && _is.promise(self._initialize)){
|
3848 |
+
return self._initialize.always(function(){
|
3849 |
+
self.destroying = false;
|
3850 |
+
self._destroy();
|
3851 |
+
});
|
3852 |
+
} else {
|
3853 |
+
self.destroying = false;
|
3854 |
+
self._destroy();
|
3855 |
+
}
|
3856 |
+
return _fn.resolved;
|
3857 |
+
},
|
3858 |
+
/**
|
3859 |
+
* @summary Destroy the template.
|
3860 |
+
* @memberof FooGallery.Template#
|
3861 |
+
* @function _destroy
|
3862 |
+
* @private
|
3863 |
+
*/
|
3864 |
+
_destroy: function(){
|
3865 |
+
var self = this;
|
3866 |
+
if (self.destroyed) return;
|
3867 |
+
/**
|
3868 |
+
* @summary Raised before the template is destroyed.
|
3869 |
+
* @event FooGallery.Template~"destroy.foogallery"
|
3870 |
+
* @type {jQuery.Event}
|
3871 |
+
* @param {jQuery.Event} event - The jQuery.Event object for the current event.
|
3872 |
+
* @param {FooGallery.Template} template - The template raising the event.
|
3873 |
+
* @example {@caption To listen for this event and perform some action when it occurs you would bind to it as follows.}
|
3874 |
+
* $(".foogallery").foogallery({
|
3875 |
+
* on: {
|
3876 |
+
* "destroy.foogallery": function(event, template){
|
3877 |
+
* // do something
|
3878 |
+
* }
|
3879 |
+
* }
|
3880 |
+
* });
|
3881 |
+
*/
|
3882 |
+
self.raise("destroy");
|
3883 |
+
$(window).off("popstate.foogallery", self.onWindowPopState)
|
3884 |
+
.off("scroll.foogallery", self.onWindowScroll);
|
3885 |
+
self.state.destroy();
|
3886 |
+
if (self.pages) self.pages.destroy();
|
3887 |
+
self.items.destroy();
|
3888 |
+
if (!_is.empty(self.opt.on)){
|
3889 |
+
self.$el.off(self.opt.on);
|
3890 |
+
}
|
3891 |
+
/**
|
3892 |
+
* @summary Raised after the template has been destroyed.
|
3893 |
+
* @event FooGallery.Template~"destroyed.foogallery"
|
3894 |
+
* @type {jQuery.Event}
|
3895 |
+
* @param {jQuery.Event} event - The jQuery.Event object for the current event.
|
3896 |
+
* @param {FooGallery.Template} template - The template raising the event.
|
3897 |
+
* @example {@caption To listen for this event and perform some action when it occurs you would bind to it as follows.}
|
3898 |
+
* $(".foogallery").foogallery({
|
3899 |
+
* on: {
|
3900 |
+
* "destroyed.foogallery": function(event, template){
|
3901 |
+
* // do something
|
3902 |
+
* }
|
3903 |
+
* }
|
3904 |
+
* });
|
3905 |
+
*/
|
3906 |
+
self.raise("destroyed");
|
3907 |
+
self.$el.removeData(_.dataTemplate);
|
3908 |
+
if (self.createdSelf){
|
3909 |
+
self.$el.remove();
|
3910 |
+
}
|
3911 |
+
self.$el = self.state = self.items = self.pages = null;
|
3912 |
+
self.destroyed = true;
|
3913 |
+
self.initializing = false;
|
3914 |
+
self.initialized = false;
|
3915 |
+
},
|
3916 |
+
|
3917 |
+
// ################
|
3918 |
+
// ## Load Items ##
|
3919 |
+
// ################
|
3920 |
+
|
3921 |
+
/**
|
3922 |
+
* @summary Check if any available items need to be loaded and loads them.
|
3923 |
+
* @memberof FooGallery.Template#
|
3924 |
+
* @function loadAvailable
|
3925 |
+
* @returns {Promise<FooGallery.Item[]>} Resolves with an array of {@link FooGallery.Item|items} as the first argument. If no items are loaded this array is empty.
|
3926 |
+
*/
|
3927 |
+
loadAvailable: function(){
|
3928 |
+
var self = this, items;
|
3929 |
+
if (self.pages){
|
3930 |
+
items = self.pages.available();
|
3931 |
+
} else {
|
3932 |
+
items = self.items.available();
|
3933 |
+
}
|
3934 |
+
var p = self.items.load(items);
|
3935 |
+
return p;
|
3936 |
+
},
|
3937 |
+
|
3938 |
+
// #############
|
3939 |
+
// ## Utility ##
|
3940 |
+
// #############
|
3941 |
+
|
3942 |
+
/**
|
3943 |
+
* @summary Raises the supplied `eventName` on the template {@link FooGallery.Template#$el|element}.
|
3944 |
+
* @memberof FooGallery.Template#
|
3945 |
+
* @function raise
|
3946 |
+
* @param {string} eventName - The name of the event to raise.
|
3947 |
+
* @param {Array} [args] - An additional arguments to supply to the listeners for the event.
|
3948 |
+
* @returns {?jQuery.Event} The jQuery.Event object or null if no `eventName` was supplied.
|
3949 |
+
* @description This method also executes any listeners set on the template object itself. These listeners are not bound to the element but are executed after the event is raised but before any default logic is executed. The names of these listeners use the following convention; prefix the `eventName` with `"on-"` and then camel-case the result. e.g. `"pre-init"` becomes `onPreInit`.
|
3950 |
+
* @example {@caption The following displays a listener for the `"pre-init.foogallery"` event in a sub-classed template.}
|
3951 |
+
* FooGallery.MyTemplate = FooGallery.Template.extend({
|
3952 |
+
* onPreInit: function(event, template){
|
3953 |
+
* // do something
|
3954 |
+
* }
|
3955 |
+
* });
|
3956 |
+
*/
|
3957 |
+
raise: function (eventName, args) {
|
3958 |
+
if (!_is.string(eventName) || _is.empty(eventName)) return null;
|
3959 |
+
args = _is.array(args) ? args : [];
|
3960 |
+
var self = this,
|
3961 |
+
name = eventName.split(".")[0],
|
3962 |
+
listener = _str.camel("on-" + name),
|
3963 |
+
event = $.Event(name + ".foogallery");
|
3964 |
+
args.unshift(self); // add self
|
3965 |
+
self.$el.trigger(event, args);
|
3966 |
+
_.debug.logf("{id}|{name}:", {id: self.id, name: name}, args);
|
3967 |
+
if (_is.fn(self[listener])){
|
3968 |
+
args.unshift(event); // add event
|
3969 |
+
self[listener].apply(self.$el.get(0), args);
|
3970 |
+
}
|
3971 |
+
return event;
|
3972 |
+
},
|
3973 |
+
|
3974 |
+
layout: function(){
|
3975 |
+
var self = this;
|
3976 |
+
if (self._initialize === null) return;
|
3977 |
+
/**
|
3978 |
+
* @summary Raised when the templates' {@link FooGallery.Template#layout|layout} method is called.
|
3979 |
+
* @event FooGallery.Template~"layout.foogallery"
|
3980 |
+
* @type {jQuery.Event}
|
3981 |
+
* @param {jQuery.Event} event - The jQuery.Event object for the current event.
|
3982 |
+
* @param {FooGallery.Template} template - The template raising the event.
|
3983 |
+
* @description This allows templates to perform layout if required for example when visibility changes.
|
3984 |
+
* @example {@caption To listen for this event and perform some action when it occurs you would bind to it as follows.}
|
3985 |
+
* $(".foogallery").foogallery({
|
3986 |
+
* on: {
|
3987 |
+
* "layout.foogallery": function(event, template){
|
3988 |
+
* // do something
|
3989 |
+
* }
|
3990 |
+
* }
|
3991 |
+
* });
|
3992 |
+
*/
|
3993 |
+
self.raise("layout");
|
3994 |
+
},
|
3995 |
+
|
3996 |
+
// ###############
|
3997 |
+
// ## Listeners ##
|
3998 |
+
// ###############
|
3999 |
+
|
4000 |
+
/**
|
4001 |
+
* @summary Listens for the windows popstate event and performs any actions required by the template.
|
4002 |
+
* @memberof FooGallery.Template#
|
4003 |
+
* @function onWindowPopState
|
4004 |
+
* @param {jQuery.Event} e - The jQuery.Event object for the event.
|
4005 |
+
* @private
|
4006 |
+
*/
|
4007 |
+
onWindowPopState: function(e){
|
4008 |
+
var self = e.data.self, state = e.originalEvent.state;
|
4009 |
+
if (!_is.empty(state) && state.id === self.id){
|
4010 |
+
self.state.set(state);
|
4011 |
+
self.loadAvailable();
|
4012 |
+
}
|
4013 |
+
},
|
4014 |
+
/**
|
4015 |
+
* @summary Listens for the windows scroll event and performs any checks required by the template.
|
4016 |
+
* @memberof FooGallery.Template#
|
4017 |
+
* @function onWindowScroll
|
4018 |
+
* @param {jQuery.Event} e - The jQuery.Event object for the event.
|
4019 |
+
* @private
|
4020 |
+
*/
|
4021 |
+
onWindowScroll: function(e){
|
4022 |
+
var self = e.data.self;
|
4023 |
+
self._throttle.limit(function(){
|
4024 |
+
self.loadAvailable();
|
4025 |
+
});
|
4026 |
+
}
|
4027 |
+
});
|
4028 |
+
|
4029 |
+
_.template.register("core", _.Template, {
|
4030 |
+
id: null,
|
4031 |
+
type: "core",
|
4032 |
+
classes: "",
|
4033 |
+
on: {},
|
4034 |
+
lazy: true,
|
4035 |
+
viewport: 200,
|
4036 |
+
items: [],
|
4037 |
+
delay: 100,
|
4038 |
+
throttle: 50,
|
4039 |
+
timeout: 60000,
|
4040 |
+
srcset: "data-srcset",
|
4041 |
+
src: "data-src",
|
4042 |
+
template: {}
|
4043 |
+
}, {
|
4044 |
+
container: "foogallery"
|
4045 |
+
}, {
|
4046 |
+
|
4047 |
+
}, -100);
|
4048 |
+
|
4049 |
+
/**
|
4050 |
+
* @summary An object containing all the core template options.
|
4051 |
+
* @typedef {object} FooGallery.Template~Options
|
4052 |
+
* @property {?string} [id=null] - The id for the template. This is only required if creating a template without a pre-existing container element that has an `id` attribute.
|
4053 |
+
* @property {string} [type="core"] - The type of template to load. If no container element exists to parse the type from this must be supplied so the correct type of template is loaded.
|
4054 |
+
* @property {string} [classes=""] - A space delimited string of any additional CSS classes to append to the container element of the template.
|
4055 |
+
* @property {object} [on={}] - An object containing any template events to bind to.
|
4056 |
+
* @property {boolean} [lazy=true] - Whether or not to enable lazy loading of images.
|
4057 |
+
* @property {number} [viewport=200] - The number of pixels to inflate the viewport by when checking to lazy load items.
|
4058 |
+
* @property {(FooGallery.Item~Options[]|FooGallery.Item[]| string)} [items=[]] - An array of items to load when required. A url can be provided and the items will be fetched using an ajax call, the response should be a properly formatted JSON array of {@link FooGallery.Item~Options|item} object.
|
4059 |
+
* @property {number} [delay=100] - The number of milliseconds to delay the initialization of a template.
|
4060 |
+
* @property {number} [throttle=50] - The number of milliseconds to wait once scrolling has stopped before performing any work.
|
4061 |
+
* @property {number} [timeout=60000] - The number of milliseconds to wait before forcing a timeout when loading items.
|
4062 |
+
* @property {string} [src="data-src"] - The name of the attribute to retrieve an images src url from.
|
4063 |
+
* @property {string} [srcset="data-srcset"] - The name of the attribute to retrieve an images srcset url from.
|
4064 |
+
* @property {object} [template={}] - An object containing any additional custom options for the template.
|
4065 |
+
* @property {FooGallery.Template~CSSClasses} [cls] - An object containing all CSS classes for the template.
|
4066 |
+
* @property {FooGallery.Template~CSSSelectors} [sel] - An object containing all CSS selectors for the template.
|
4067 |
+
* @property {FooGallery.Template~il8n} [il8n] - An object containing all il8n strings for the template.
|
4068 |
+
* @property {FooGallery.Item~Options} [item] - An object containing the default values for all items.
|
4069 |
+
* @property {FooGallery.State~Options} [state] - An object containing the state options for the template.
|
4070 |
+
* @property {FooGallery.Paging~Options} [paging] - An object containing the default paging options for the template.
|
4071 |
+
*/
|
4072 |
+
|
4073 |
+
/**
|
4074 |
+
* @summary An object containing all CSS classes for the core template.
|
4075 |
+
* @typedef {object} FooGallery.Template~CSSClasses
|
4076 |
+
* @property {string} [container="foogallery"] - The base CSS class names to apply to the container element.
|
4077 |
+
* @property {FooGallery.Item~CSSClasses} [item] - A simple object containing the CSS classes used by an item.
|
4078 |
+
*/
|
4079 |
+
|
4080 |
+
/**
|
4081 |
+
* @summary An object containing all il8n strings for the core template.
|
4082 |
+
* @typedef {object} FooGallery.Template~il8n
|
4083 |
+
*/
|
4084 |
+
|
4085 |
+
/**
|
4086 |
+
* @summary An object containing all CSS selectors for the core template.
|
4087 |
+
* @typedef {object} FooGallery.Template~CSSSelectors
|
4088 |
+
* @property {string} [container=".foogallery"] - The selector for the base CSS class names for the container element.
|
4089 |
+
* @property {FooGallery.Item~CSSSelectors} [item] - An object containing the CSS selectors for an item.
|
4090 |
+
* @description This object is automatically generated from a {@link FooGallery.Template~CSSClasses|classes} object and its properties mirror those except the space delimited string of class names is converted into a CSS selector.
|
4091 |
+
*/
|
4092 |
+
|
4093 |
+
})(
|
4094 |
+
FooGallery.$,
|
4095 |
+
FooGallery,
|
4096 |
+
FooGallery.utils,
|
4097 |
+
FooGallery.utils.is,
|
4098 |
+
FooGallery.utils.fn,
|
4099 |
+
FooGallery.utils.str
|
4100 |
+
);
|
4101 |
+
|
4102 |
+
|
4103 |
+
(function(_, _utils){
|
4104 |
+
|
4105 |
+
_.Component = _utils.Class.extend(/** @lend FooGallery.Component */{
|
4106 |
+
/**
|
4107 |
+
* @summary The base class for all child components of a {@link FooGallery.Template|template}.
|
4108 |
+
* @memberof FooGallery
|
4109 |
+
* @constructs Component
|
4110 |
+
* @param {FooGallery.Template} template - The template creating the component.
|
4111 |
+
* @augments FooGallery.utils.Class
|
4112 |
+
* @borrows FooGallery.utils.Class.extend as extend
|
4113 |
+
* @borrows FooGallery.utils.Class.override as override
|
4114 |
+
*/
|
4115 |
+
construct: function(template){
|
4116 |
+
/**
|
4117 |
+
* @summary The template that created this component.
|
4118 |
+
* @memberof FooGallery.Component#
|
4119 |
+
* @name tmpl
|
4120 |
+
* @type {FooGallery.Template}
|
4121 |
+
*/
|
4122 |
+
this.tmpl = template;
|
4123 |
+
},
|
4124 |
+
/**
|
4125 |
+
* @summary Destroy the component making it ready for garbage collection.
|
4126 |
+
* @memberof FooGallery.Component#
|
4127 |
+
* @function destroy
|
4128 |
+
*/
|
4129 |
+
destroy: function(){
|
4130 |
+
this.tmpl = null;
|
4131 |
+
}
|
4132 |
+
});
|
4133 |
+
|
4134 |
+
/**
|
4135 |
+
* @summary A factory for registering and creating basic gallery components.
|
4136 |
+
* @memberof FooGallery
|
4137 |
+
* @name components
|
4138 |
+
* @type {FooGallery.utils.Factory}
|
4139 |
+
*/
|
4140 |
+
_.components = new _utils.Factory();
|
4141 |
+
|
4142 |
+
})(
|
4143 |
+
FooGallery,
|
4144 |
+
FooGallery.utils
|
4145 |
+
);
|
4146 |
+
(function($, _, _is, _str){
|
4147 |
+
|
4148 |
+
_.State = _.Component.extend(/** @lends FooGallery.State */{
|
4149 |
+
/**
|
4150 |
+
* @summary This class manages all the getting and setting of its' parent templates' state.
|
4151 |
+
* @memberof FooGallery
|
4152 |
+
* @constructs State
|
4153 |
+
* @param {FooGallery.Template} template - The template to manage the state for.
|
4154 |
+
* @augments FooGallery.Component
|
4155 |
+
* @borrows FooGallery.utils.Class.extend as extend
|
4156 |
+
* @borrows FooGallery.utils.Class.override as override
|
4157 |
+
*/
|
4158 |
+
construct: function(template){
|
4159 |
+
var self = this;
|
4160 |
+
/**
|
4161 |
+
* @ignore
|
4162 |
+
* @memberof FooGallery.State#
|
4163 |
+
* @function _super
|
4164 |
+
*/
|
4165 |
+
self._super(template);
|
4166 |
+
/**
|
4167 |
+
* @summary Whether or not the history API is enabled in the current browser.
|
4168 |
+
* @memberof FooGallery.State#
|
4169 |
+
* @name apiEnabled
|
4170 |
+
* @type {boolean}
|
4171 |
+
* @readonly
|
4172 |
+
*/
|
4173 |
+
self.apiEnabled = !!window.history && !!history.replaceState;
|
4174 |
+
/**
|
4175 |
+
* @summary The state specific options for the template.
|
4176 |
+
* @memberof FooGallery.State#
|
4177 |
+
* @name opt
|
4178 |
+
* @type {FooGallery.State~Options}
|
4179 |
+
*/
|
4180 |
+
self.opt = self.tmpl.opt.state;
|
4181 |
+
/**
|
4182 |
+
* @summary Whether or not the component is enabled.
|
4183 |
+
* @memberof FooGallery.State#
|
4184 |
+
* @name enabled
|
4185 |
+
* @type {boolean}
|
4186 |
+
*/
|
4187 |
+
self.enabled = self.opt.enabled;
|
4188 |
+
/**
|
4189 |
+
* @summary Which method of the history API to use by default when updating the state.
|
4190 |
+
* @memberof FooGallery.State#
|
4191 |
+
* @name pushOrReplace
|
4192 |
+
* @type {string}
|
4193 |
+
* @default "replace"
|
4194 |
+
*/
|
4195 |
+
self.pushOrReplace = self.isPushOrReplace(self.opt.pushOrReplace) ? self.opt.pushOrReplace : "replace";
|
4196 |
+
|
4197 |
+
var id = _str.escapeRegExp(self.tmpl.id),
|
4198 |
+
values = _str.escapeRegExp(self.opt.values),
|
4199 |
+
pair = _str.escapeRegExp(self.opt.pair);
|
4200 |
+
/**
|
4201 |
+
* @summary An object containing regular expressions used to test and parse a hash value into a state object.
|
4202 |
+
* @memberof FooGallery.State#
|
4203 |
+
* @name regex
|
4204 |
+
* @type {{exists: RegExp, values: RegExp}}
|
4205 |
+
* @readonly
|
4206 |
+
* @description The regular expressions contained within this object are specific to this template and are created using the template {@link FooGallery.Template#id|id} and the delimiters from the {@link FooGallery.State#opt|options}.
|
4207 |
+
*/
|
4208 |
+
self.regex = {
|
4209 |
+
exists: new RegExp("^#"+id+"\\"+values+".+?"),
|
4210 |
+
values: new RegExp("(\\w+)"+pair+"([^"+values+"]+)", "g")
|
4211 |
+
};
|
4212 |
+
},
|
4213 |
+
/**
|
4214 |
+
* @summary Destroy the component clearing any current state from the url and preparing it for garbage collection.
|
4215 |
+
* @memberof FooGallery.State#
|
4216 |
+
* @function destroy
|
4217 |
+
*/
|
4218 |
+
destroy: function(){
|
4219 |
+
var self = this;
|
4220 |
+
self.clear();
|
4221 |
+
self.opt = self.regex = {};
|
4222 |
+
self._super();
|
4223 |
+
},
|
4224 |
+
/**
|
4225 |
+
* @summary Check if the supplied value is `"push"` or `"replace"`.
|
4226 |
+
* @memberof FooGallery.State#
|
4227 |
+
* @function isPushOrReplace
|
4228 |
+
* @param {*} value - The value to check.
|
4229 |
+
* @returns {boolean}
|
4230 |
+
*/
|
4231 |
+
isPushOrReplace: function(value){
|
4232 |
+
return $.inArray(value, ["push","replace"]) !== -1;
|
4233 |
+
},
|
4234 |
+
/**
|
4235 |
+
* @summary Check if the current url contains state for this template.
|
4236 |
+
* @memberof FooGallery.State#
|
4237 |
+
* @function exists
|
4238 |
+
* @returns {boolean}
|
4239 |
+
*/
|
4240 |
+
exists: function(){
|
4241 |
+
return this.regex.exists.test(location.hash) && this.regex.values.test(location.hash);
|
4242 |
+
},
|
4243 |
+
/**
|
4244 |
+
* @summary Parse the current url returning an object containing all values for the template.
|
4245 |
+
* @memberof FooGallery.State#
|
4246 |
+
* @function parse
|
4247 |
+
* @returns {object}
|
4248 |
+
* @description This method always returns an object, if successful the object contains properties otherwise it is just a plain empty object. For this method to be successful the current template {@link FooGallery.Template#id|id} must match the one from the url.
|
4249 |
+
*/
|
4250 |
+
parse: function(){
|
4251 |
+
var self = this, state = {};
|
4252 |
+
if (self.exists()){
|
4253 |
+
if (self.enabled){
|
4254 |
+
state.id = self.tmpl.id;
|
4255 |
+
var pairs = location.hash.match(self.regex.values);
|
4256 |
+
$.each(pairs, function(i, pair){
|
4257 |
+
var parts = pair.split(self.opt.pair);
|
4258 |
+
if (parts.length === 2){
|
4259 |
+
state[parts[0]] = parts[1].indexOf(self.opt.array) === -1
|
4260 |
+
? decodeURIComponent(parts[1])
|
4261 |
+
: $.map(parts[1].split(self.opt.array), function(part){ return decodeURIComponent(part); });
|
4262 |
+
if (_is.string(state[parts[0]]) && !isNaN(state[parts[0]])){
|
4263 |
+
state[parts[0]] = parseInt(state[parts[0]]);
|
4264 |
+
}
|
4265 |
+
}
|
4266 |
+
});
|
4267 |
+
} else {
|
4268 |
+
// if we're here it means there is a hash on the url but the option is disabled so remove it
|
4269 |
+
if (self.apiEnabled){
|
4270 |
+
history.replaceState(null, "", location.pathname + location.search);
|
4271 |
+
} else {
|
4272 |
+
location.hash = "#";
|
4273 |
+
}
|
4274 |
+
}
|
4275 |
+
}
|
4276 |
+
return state;
|
4277 |
+
},
|
4278 |
+
/**
|
4279 |
+
* @summary Converts the supplied state object into a string value to use as a hash.
|
4280 |
+
* @memberof FooGallery.State#
|
4281 |
+
* @function hashify
|
4282 |
+
* @param {object} state - The object to hashify.
|
4283 |
+
* @returns {string}
|
4284 |
+
*/
|
4285 |
+
hashify: function(state){
|
4286 |
+
var self = this;
|
4287 |
+
if (_is.hash(state)){
|
4288 |
+
var hash = [];
|
4289 |
+
$.each(state, function(name, value){
|
4290 |
+
if (!_is.empty(value) && name !== "id"){
|
4291 |
+
if (_is.array(value)){
|
4292 |
+
value = $.map(value, function(part){ return encodeURIComponent(part); }).join("+");
|
4293 |
+
} else {
|
4294 |
+
value = encodeURIComponent(value);
|
4295 |
+
}
|
4296 |
+
hash.push(name + self.opt.pair + value);
|
4297 |
+
}
|
4298 |
+
});
|
4299 |
+
if (hash.length > 0){
|
4300 |
+
hash.unshift("#"+self.tmpl.id);
|
4301 |
+
}
|
4302 |
+
return hash.join(self.opt.values);
|
4303 |
+
}
|
4304 |
+
return "";
|
4305 |
+
},
|
4306 |
+
/**
|
4307 |
+
* @summary Replace the current state with the one supplied.
|
4308 |
+
* @memberof FooGallery.State#
|
4309 |
+
* @function replace
|
4310 |
+
* @param {object} state - The state to replace the current with.
|
4311 |
+
*/
|
4312 |
+
replace: function(state){
|
4313 |
+
var self = this;
|
4314 |
+
if (self.enabled && self.apiEnabled){
|
4315 |
+
state.id = self.tmpl.id;
|
4316 |
+
var hash = self.hashify(state), empty = _is.empty(hash);
|
4317 |
+
history.replaceState(empty ? null : state, "", empty ? location.pathname + location.search : hash);
|
4318 |
+
}
|
4319 |
+
},
|
4320 |
+
/**
|
4321 |
+
* @summary Push the supplied `state` into the browser history.
|
4322 |
+
* @memberof FooGallery.State#
|
4323 |
+
* @function push
|
4324 |
+
* @param {object} state - The state to push.
|
4325 |
+
*/
|
4326 |
+
push: function(state){
|
4327 |
+
var self = this;
|
4328 |
+
if (self.enabled && self.apiEnabled){
|
4329 |
+
state.id = self.tmpl.id;
|
4330 |
+
var hash = self.hashify(state), empty = _is.empty(hash);
|
4331 |
+
history.pushState(empty ? null : state, "", empty ? location.pathname + location.search : hash);
|
4332 |
+
}
|
4333 |
+
},
|
4334 |
+
/**
|
4335 |
+
* @summary Update the browser history using the supplied `state`.
|
4336 |
+
* @memberof FooGallery.State#
|
4337 |
+
* @function update
|
4338 |
+
* @param {object} state - The state to update.
|
4339 |
+
* @param {string} [pushOrReplace] - The method to use to update the state. If not supplied this falls back to the value of the {@link FooGallery.State#pushOrReplace|pushOrReplace} property.
|
4340 |
+
*/
|
4341 |
+
update: function(state, pushOrReplace){
|
4342 |
+
var self = this;
|
4343 |
+
if (self.enabled && self.apiEnabled){
|
4344 |
+
pushOrReplace = self.isPushOrReplace(pushOrReplace) ? pushOrReplace : self.pushOrReplace;
|
4345 |
+
self[pushOrReplace](state);
|
4346 |
+
}
|
4347 |
+
},
|
4348 |
+
/**
|
4349 |
+
* @summary Clear the template state from the current browser history if it exists.
|
4350 |
+
* @memberof FooGallery.State#
|
4351 |
+
* @function clear
|
4352 |
+
*/
|
4353 |
+
clear: function(){
|
4354 |
+
if (this.exists()) this.replace({});
|
4355 |
+
},
|
4356 |
+
/**
|
4357 |
+
* @summary Get the initial start up state of the template.
|
4358 |
+
* @memberof FooGallery.State#
|
4359 |
+
* @function initial
|
4360 |
+
* @returns {FooGallery~State}
|
4361 |
+
* @description This method returns an initial start up state from the template options.
|
4362 |
+
*/
|
4363 |
+
initial: function(){
|
4364 |
+
var self = this, tmpl = self.tmpl, state = {};
|
4365 |
+
if (tmpl.pages && tmpl.pages.current > 1) state.p = tmpl.pages.current;
|
4366 |
+
return state;
|
4367 |
+
},
|
4368 |
+
/**
|
4369 |
+
* @summary Get the current state of the template.
|
4370 |
+
* @memberof FooGallery.State#
|
4371 |
+
* @function get
|
4372 |
+
* @param {FooGallery.Item} [item] - If supplied the items' {@link FooGallery.Item#id|id} is included in the resulting state object.
|
4373 |
+
* @returns {FooGallery~State}
|
4374 |
+
* @description This method does not parse the history or url it returns the current state of the template itself. To parse the current url use the {@link FooGallery.State#parse|parse} method instead.
|
4375 |
+
*/
|
4376 |
+
get: function(item){
|
4377 |
+
var self = this, tmpl = self.tmpl, state = {};
|
4378 |
+
if (item instanceof _.Item) state.i = item.id;
|
4379 |
+
if (tmpl.pages && tmpl.pages.isValid(tmpl.pages.current)){
|
4380 |
+
state.p = tmpl.pages.current;
|
4381 |
+
}
|
4382 |
+
return state;
|
4383 |
+
},
|
4384 |
+
/**
|
4385 |
+
* @summary Set the current state of the template.
|
4386 |
+
* @memberof FooGallery.State#
|
4387 |
+
* @function set
|
4388 |
+
* @param {FooGallery~State} state - The state to set the template to.
|
4389 |
+
* @description This method does not set the history or url it sets the current state of the template itself. To update the url use the {@link FooGallery.State#update|update} method instead.
|
4390 |
+
*/
|
4391 |
+
set: function(state){
|
4392 |
+
var self = this, tmpl = self.tmpl;
|
4393 |
+
if (_is.hash(state)){
|
4394 |
+
tmpl.items.reset();
|
4395 |
+
var item = tmpl.items.get(state.i);
|
4396 |
+
if (tmpl.pages){
|
4397 |
+
tmpl.pages.rebuild();
|
4398 |
+
var page = tmpl.pages.number(state.p);
|
4399 |
+
if (item && !tmpl.pages.contains(page, item)){
|
4400 |
+
page = tmpl.pages.find(item);
|
4401 |
+
page = page !== 0 ? page : 1;
|
4402 |
+
}
|
4403 |
+
tmpl.pages.set(page, !_is.empty(state), false);
|
4404 |
+
if (item && tmpl.pages.contains(page, item)){
|
4405 |
+
item.scrollTo();
|
4406 |
+
}
|
4407 |
+
} else {
|
4408 |
+
tmpl.items.detach(tmpl.items.all());
|
4409 |
+
tmpl.items.create(tmpl.items.available(), true);
|
4410 |
+
if (item){
|
4411 |
+
item.scrollTo();
|
4412 |
+
}
|
4413 |
+
}
|
4414 |
+
if (!_is.empty(state.i)){
|
4415 |
+
state.i = null;
|
4416 |
+
self.replace(state);
|
4417 |
+
}
|
4418 |
+
}
|
4419 |
+
},
|
4420 |
+
});
|
4421 |
+
|
4422 |
+
_.template.configure("core", {
|
4423 |
+
state: {
|
4424 |
+
enabled: false,
|
4425 |
+
pushOrReplace: "replace",
|
4426 |
+
values: "/",
|
4427 |
+
pair: ":",
|
4428 |
+
array: "+"
|
4429 |
+
}
|
4430 |
+
});
|
4431 |
+
|
4432 |
+
// register the component
|
4433 |
+
_.components.register("state", _.State);
|
4434 |
+
|
4435 |
+
/**
|
4436 |
+
* @summary An object containing the state options for the template.
|
4437 |
+
* @typedef {object} FooGallery.State~Options
|
4438 |
+
* @property {boolean} [enabled=false] - Whether or not state is enabled for the template.
|
4439 |
+
* @property {string} [pushOrReplace="replace"] - Which method of the history API to use by default when updating the state.
|
4440 |
+
* @property {string} [values="/"] - The delimiter used between key value pairs in the hash.
|
4441 |
+
* @property {string} [pair=":"] - The delimiter used between a key and a value in the hash.
|
4442 |
+
* @property {string} [array="+"] - The delimiter used for array values in the hash.
|
4443 |
+
*/
|
4444 |
+
|
4445 |
+
/**
|
4446 |
+
* @summary An object used to store the state of a template.
|
4447 |
+
* @typedef {object} FooGallery~State
|
4448 |
+
* @property {number} [p] - The current page number.
|
4449 |
+
* @property {?string} [i] - The currently selected item.
|
4450 |
+
*/
|
4451 |
+
|
4452 |
+
})(
|
4453 |
+
FooGallery.$,
|
4454 |
+
FooGallery,
|
4455 |
+
FooGallery.utils.is,
|
4456 |
+
FooGallery.utils.str
|
4457 |
+
);
|
4458 |
+
(function($, _, _utils, _is, _fn, _obj){
|
4459 |
+
|
4460 |
+
_.Item = _.Component.extend(/** @lends FooGallery.Item */{
|
4461 |
+
/**
|
4462 |
+
* @summary The base class for an item.
|
4463 |
+
* @memberof FooGallery
|
4464 |
+
* @constructs Item
|
4465 |
+
* @param {FooGallery.Template} template - The template this item belongs to.
|
4466 |
+
* @param {FooGallery.Item~Options} [options] - The options to initialize the item with.
|
4467 |
+
* @augments FooGallery.Component
|
4468 |
+
* @borrows FooGallery.utils.Class.extend as extend
|
4469 |
+
* @borrows FooGallery.utils.Class.override as override
|
4470 |
+
*/
|
4471 |
+
construct: function(template, options){
|
4472 |
+
var self = this;
|
4473 |
+
/**
|
4474 |
+
* @ignore
|
4475 |
+
* @memberof FooGallery.Item#
|
4476 |
+
* @function _super
|
4477 |
+
*/
|
4478 |
+
self._super(template);
|
4479 |
+
self.cls = template.cls.item;
|
4480 |
+
self.il8n = template.il8n.item;
|
4481 |
+
self.sel = template.sel.item;
|
4482 |
+
/**
|
4483 |
+
* @summary Whether or not the items' elements are appended to the template.
|
4484 |
+
* @memberof FooGallery.Item#
|
4485 |
+
* @name isAttached
|
4486 |
+
* @type {boolean}
|
4487 |
+
* @readonly
|
4488 |
+
*/
|
4489 |
+
self.isAttached = false;
|
4490 |
+
/**
|
4491 |
+
* @summary Whether or not the items' elements are created and can be used.
|
4492 |
+
* @memberof FooGallery.Item#
|
4493 |
+
* @name isCreated
|
4494 |
+
* @type {boolean}
|
4495 |
+
* @readonly
|
4496 |
+
*/
|
4497 |
+
self.isCreated = false;
|
4498 |
+
/**
|
4499 |
+
* @summary Whether or not the items' image is currently loading.
|
4500 |
+
* @memberof FooGallery.Item#
|
4501 |
+
* @name isLoading
|
4502 |
+
* @type {boolean}
|
4503 |
+
* @readonly
|
4504 |
+
*/
|
4505 |
+
self.isLoading = false;
|
4506 |
+
/**
|
4507 |
+
* @summary Whether or not the items' image has been loaded.
|
4508 |
+
* @memberof FooGallery.Item#
|
4509 |
+
* @name isLoaded
|
4510 |
+
* @type {boolean}
|
4511 |
+
* @readonly
|
4512 |
+
*/
|
4513 |
+
self.isLoaded = false;
|
4514 |
+
/**
|
4515 |
+
* @summary Whether or not the items' image threw an error while loading.
|
4516 |
+
* @memberof FooGallery.Item#
|
4517 |
+
* @name isError
|
4518 |
+
* @type {boolean}
|
4519 |
+
* @readonly
|
4520 |
+
*/
|
4521 |
+
self.isError = false;
|
4522 |
+
/**
|
4523 |
+
* @summary Whether or not this item was parsed from an existing DOM element.
|
4524 |
+
* @memberof FooGallery.Item#
|
4525 |
+
* @name isParsed
|
4526 |
+
* @type {boolean}
|
4527 |
+
* @readonly
|
4528 |
+
*/
|
4529 |
+
self.isParsed = false;
|
4530 |
+
/**
|
4531 |
+
* @memberof FooGallery.Item#
|
4532 |
+
* @name $el
|
4533 |
+
* @type {?jQuery}
|
4534 |
+
*/
|
4535 |
+
self.$el = null;
|
4536 |
+
/**
|
4537 |
+
* @memberof FooGallery.Item#
|
4538 |
+
* @name $inner
|
4539 |
+
* @type {?jQuery}
|
4540 |
+
*/
|
4541 |
+
self.$inner = null;
|
4542 |
+
/**
|
4543 |
+
* @memberof FooGallery.Item#
|
4544 |
+
* @name $anchor
|
4545 |
+
* @type {?jQuery}
|
4546 |
+
*/
|
4547 |
+
self.$anchor = null;
|
4548 |
+
/**
|
4549 |
+
* @memberof FooGallery.Item#
|
4550 |
+
* @name $image
|
4551 |
+
* @type {?jQuery}
|
4552 |
+
*/
|
4553 |
+
self.$image = null;
|
4554 |
+
/**
|
4555 |
+
* @memberof FooGallery.Item#
|
4556 |
+
* @name $caption
|
4557 |
+
* @type {?jQuery}
|
4558 |
+
*/
|
4559 |
+
self.$caption = null;
|
4560 |
+
|
4561 |
+
options = _obj.extend({}, template.opt.item, options);
|
4562 |
+
|
4563 |
+
/**
|
4564 |
+
* @memberof FooGallery.Item#
|
4565 |
+
* @name id
|
4566 |
+
* @type {string}
|
4567 |
+
*/
|
4568 |
+
self.id = options.id;
|
4569 |
+
/**
|
4570 |
+
* @memberof FooGallery.Item#
|
4571 |
+
* @name href
|
4572 |
+
* @type {string}
|
4573 |
+
*/
|
4574 |
+
self.href = options.href;
|
4575 |
+
/**
|
4576 |
+
* @memberof FooGallery.Item#
|
4577 |
+
* @name src
|
4578 |
+
* @type {string}
|
4579 |
+
*/
|
4580 |
+
self.src = options.src;
|
4581 |
+
/**
|
4582 |
+
* @memberof FooGallery.Item#
|
4583 |
+
* @name srcset
|
4584 |
+
* @type {string}
|
4585 |
+
*/
|
4586 |
+
self.srcset = options.srcset;
|
4587 |
+
/**
|
4588 |
+
* @memberof FooGallery.Item#
|
4589 |
+
* @name width
|
4590 |
+
* @type {number}
|
4591 |
+
*/
|
4592 |
+
self.width = options.width;
|
4593 |
+
/**
|
4594 |
+
* @memberof FooGallery.Item#
|
4595 |
+
* @name height
|
4596 |
+
* @type {number}
|
4597 |
+
*/
|
4598 |
+
self.height = options.height;
|
4599 |
+
/**
|
4600 |
+
* @memberof FooGallery.Item#
|
4601 |
+
* @name title
|
4602 |
+
* @type {string}
|
4603 |
+
*/
|
4604 |
+
self.title = options.title;
|
4605 |
+
/**
|
4606 |
+
* @memberof FooGallery.Item#
|
4607 |
+
* @name alt
|
4608 |
+
* @type {string}
|
4609 |
+
*/
|
4610 |
+
self.alt = options.alt;
|
4611 |
+
/**
|
4612 |
+
* @memberof FooGallery.Item#
|
4613 |
+
* @name caption
|
4614 |
+
* @type {string}
|
4615 |
+
*/
|
4616 |
+
self.caption = _is.empty(options.caption) ? self.title : options.caption;
|
4617 |
+
/**
|
4618 |
+
* @memberof FooGallery.Item#
|
4619 |
+
* @name description
|
4620 |
+
* @type {string}
|
4621 |
+
*/
|
4622 |
+
self.description = _is.empty(options.description) ? self.alt : options.description;
|
4623 |
+
/**
|
4624 |
+
* @memberof FooGallery.Item#
|
4625 |
+
* @name attrItem
|
4626 |
+
* @type {FooGallery.Item~Attributes}
|
4627 |
+
*/
|
4628 |
+
self.attr = options.attr;
|
4629 |
+
/**
|
4630 |
+
* @memberof FooGallery.Item#
|
4631 |
+
* @name tags
|
4632 |
+
* @type {string[]}
|
4633 |
+
*/
|
4634 |
+
self.tags = options.tags;
|
4635 |
+
/**
|
4636 |
+
* @memberof FooGallery.Item#
|
4637 |
+
* @name maxWidth
|
4638 |
+
* @type {?FooGallery.Item~maxWidthCallback}
|
4639 |
+
*/
|
4640 |
+
self.maxWidth = options.maxWidth;
|
4641 |
+
/**
|
4642 |
+
* @memberof FooGallery.Item#
|
4643 |
+
* @name maxCaptionLength
|
4644 |
+
* @type {number}
|
4645 |
+
*/
|
4646 |
+
self.maxCaptionLength = options.maxCaptionLength;
|
4647 |
+
/**
|
4648 |
+
* @memberof FooGallery.Item#
|
4649 |
+
* @name maxDescriptionLength
|
4650 |
+
* @type {number}
|
4651 |
+
*/
|
4652 |
+
self.maxDescriptionLength = options.maxDescriptionLength;
|
4653 |
+
/**
|
4654 |
+
* @memberof FooGallery.Item#
|
4655 |
+
* @name showCaptionTitle
|
4656 |
+
* @type {boolean}
|
4657 |
+
*/
|
4658 |
+
self.showCaptionTitle = options.showCaptionTitle;
|
4659 |
+
/**
|
4660 |
+
* @memberof FooGallery.Item#
|
4661 |
+
* @name showCaptionDescription
|
4662 |
+
* @type {boolean}
|
4663 |
+
*/
|
4664 |
+
self.showCaptionDescription = options.showCaptionDescription;
|
4665 |
+
/**
|
4666 |
+
* @summary The cached result of the last call to the {@link FooGallery.Item#getThumbUrl|getThumbUrl} method.
|
4667 |
+
* @memberof FooGallery.Item#
|
4668 |
+
* @name _thumbUrl
|
4669 |
+
* @type {string}
|
4670 |
+
* @private
|
4671 |
+
*/
|
4672 |
+
self._thumbUrl = null;
|
4673 |
+
/**
|
4674 |
+
* @summary This property is used to store the promise created when loading an item for the first time.
|
4675 |
+
* @memberof FooGallery.Item#
|
4676 |
+
* @name _load
|
4677 |
+
* @type {?Promise}
|
4678 |
+
* @private
|
4679 |
+
*/
|
4680 |
+
self._load = null;
|
4681 |
+
},
|
4682 |
+
/**
|
4683 |
+
* @summary Destroy the item preparing it for garbage collection.
|
4684 |
+
* @memberof FooGallery.Item#
|
4685 |
+
* @function destroy
|
4686 |
+
*/
|
4687 |
+
destroy: function(){
|
4688 |
+
var self = this;
|
4689 |
+
/**
|
4690 |
+
* @summary Raised when a template destroys an item.
|
4691 |
+
* @event FooGallery.Template~"destroy-item.foogallery"
|
4692 |
+
* @type {jQuery.Event}
|
4693 |
+
* @param {jQuery.Event} event - The jQuery.Event object for the current event.
|
4694 |
+
* @param {FooGallery.Template} template - The template raising the event.
|
4695 |
+
* @param {FooGallery.Item} item - The item to destroy.
|
4696 |
+
* @returns {boolean} `true` if the {@link FooGallery.Item|`item`} has been successfully destroyed.
|
4697 |
+
* @example {@caption To listen for this event and perform some action when it occurs you would bind to it as follows.}
|
4698 |
+
* $(".foogallery").foogallery({
|
4699 |
+
* on: {
|
4700 |
+
* "destroy-item.foogallery": function(event, template, item){
|
4701 |
+
* // do something
|
4702 |
+
* }
|
4703 |
+
* }
|
4704 |
+
* });
|
4705 |
+
* @example {@caption Calling the `preventDefault` method on the `event` object will prevent the `item` being destroyed.}
|
4706 |
+
* $(".foogallery").foogallery({
|
4707 |
+
* on: {
|
4708 |
+
* "destroy-item.foogallery": function(event, template, item){
|
4709 |
+
* if ("some condition"){
|
4710 |
+
* // stop the item being destroyed
|
4711 |
+
* event.preventDefault();
|
4712 |
+
* }
|
4713 |
+
* }
|
4714 |
+
* }
|
4715 |
+
* });
|
4716 |
+
* @example {@caption You can also prevent the default logic and replace it with your own by calling the `preventDefault` method on the `event` object.}
|
4717 |
+
* $(".foogallery").foogallery({
|
4718 |
+
* on: {
|
4719 |
+
* "destroy-item.foogallery": function(event, template, item){
|
4720 |
+
* // stop the default logic
|
4721 |
+
* event.preventDefault();
|
4722 |
+
* // replacing it with your own destroying the item yourself
|
4723 |
+
* item.$el.off(".foogallery").remove();
|
4724 |
+
* item.$el = null;
|
4725 |
+
* ...
|
4726 |
+
* // once all destroy work is complete you must set tmpl to null
|
4727 |
+
* item.tmpl = null;
|
4728 |
+
* }
|
4729 |
+
* }
|
4730 |
+
* });
|
4731 |
+
*/
|
4732 |
+
var e = self.tmpl.raise("destroy-item");
|
4733 |
+
if (!e.isDefaultPrevented()){
|
4734 |
+
if (self.isParsed && !self.isAttached){
|
4735 |
+
self.append();
|
4736 |
+
} else if (!self.isParsed && self.isAttached) {
|
4737 |
+
self.detach();
|
4738 |
+
}
|
4739 |
+
self._super();
|
4740 |
+
}
|
4741 |
+
return self.tmpl === null;
|
4742 |
+
},
|
4743 |
+
/**
|
4744 |
+
* @summary Parse the supplied element updating the current items' properties.
|
4745 |
+
* @memberof FooGallery.Item#
|
4746 |
+
* @function parse
|
4747 |
+
* @param {(jQuery|HTMLElement|string)} element - The element to parse.
|
4748 |
+
* @returns {boolean}
|
4749 |
+
* @fires FooGallery.Template~"parse-item.foogallery"
|
4750 |
+
* @fires FooGallery.Template~"parsed-item.foogallery"
|
4751 |
+
*/
|
4752 |
+
parse: function(element){
|
4753 |
+
var self = this, o = self.tmpl.opt, cls = self.cls, sel = self.sel, $el = $(element);
|
4754 |
+
/**
|
4755 |
+
* @summary Raised when an item needs to parse properties from an element.
|
4756 |
+
* @event FooGallery.Template~"parse-item.foogallery"
|
4757 |
+
* @type {jQuery.Event}
|
4758 |
+
* @param {jQuery.Event} event - The jQuery.Event object for the current event.
|
4759 |
+
* @param {FooGallery.Template} template - The template raising the event.
|
4760 |
+
* @param {FooGallery.Item} item - The item to populate.
|
4761 |
+
* @param {jQuery} $element - The jQuery object of the element to parse.
|
4762 |
+
* @example {@caption To listen for this event and perform some action when it occurs you would bind to it as follows.}
|
4763 |
+
* $(".foogallery").foogallery({
|
4764 |
+
* on: {
|
4765 |
+
* "parse-item.foogallery": function(event, template, item, $element){
|
4766 |
+
* // do something
|
4767 |
+
* }
|
4768 |
+
* }
|
4769 |
+
* });
|
4770 |
+
* @example {@caption Calling the `preventDefault` method on the `event` object will prevent the `item` properties being parsed from the `element`.}
|
4771 |
+
* $(".foogallery").foogallery({
|
4772 |
+
* on: {
|
4773 |
+
* "parse-item.foogallery": function(event, template, item, $element){
|
4774 |
+
* if ("some condition"){
|
4775 |
+
* // stop the item being parsed
|
4776 |
+
* event.preventDefault();
|
4777 |
+
* }
|
4778 |
+
* }
|
4779 |
+
* }
|
4780 |
+
* });
|
4781 |
+
* @example {@caption You can also prevent the default logic and replace it with your own by calling the `preventDefault` method on the `event` object and then populating the `item` properties from the `element`.}
|
4782 |
+
* $(".foogallery").foogallery({
|
4783 |
+
* on: {
|
4784 |
+
* "parse-item.foogallery": function(event, template, item, $element){
|
4785 |
+
* // stop the default logic
|
4786 |
+
* event.preventDefault();
|
4787 |
+
* // replacing it with your own setting each property of the item yourself
|
4788 |
+
* item.$el = $element;
|
4789 |
+
* ...
|
4790 |
+
* // once all properties are set you must set isParsed to true
|
4791 |
+
* item.isParsed = true;
|
4792 |
+
* }
|
4793 |
+
* }
|
4794 |
+
* });
|
4795 |
+
*/
|
4796 |
+
var e = self.tmpl.raise("parse-item", [self, $el]);
|
4797 |
+
if (!e.isDefaultPrevented() && (self.isCreated = $el.is(sel.elem))){
|
4798 |
+
self.$el = $el.data(_.dataItem, self);
|
4799 |
+
self.$inner = self.$el.find(sel.inner);
|
4800 |
+
self.$anchor = self.$el.find(sel.anchor).on("click.foogallery", {self: self}, self.onAnchorClick);
|
4801 |
+
self.$image = self.$anchor.find(sel.image);
|
4802 |
+
self.$caption = self.$el.find(sel.caption.elem).on("click.foogallery", {self: self}, self.onCaptionClick);
|
4803 |
+
self.isAttached = self.$el.parent().length > 0;
|
4804 |
+
self.isLoading = self.$el.is(sel.loading);
|
4805 |
+
self.isLoaded = self.$el.is(sel.loaded);
|
4806 |
+
self.isError = self.$el.is(sel.error);
|
4807 |
+
self.id = self.$anchor.data("id");
|
4808 |
+
self.tags = self.$anchor.data("tags");
|
4809 |
+
self.href = self.$anchor.attr("href");
|
4810 |
+
self.src = self.$image.attr(o.src);
|
4811 |
+
self.srcset = self.$image.attr(o.srcset);
|
4812 |
+
self.width = parseInt(self.$image.attr("width"));
|
4813 |
+
self.height = parseInt(self.$image.attr("height"));
|
4814 |
+
self.title = self.$image.attr("title");
|
4815 |
+
self.alt = self.$image.attr("alt");
|
4816 |
+
self.caption = self.$anchor.data("title") || self.$anchor.data("captionTitle");
|
4817 |
+
self.description = self.$anchor.data("description") || self.$anchor.data("captionDesc");
|
4818 |
+
// if the caption or description are not provided set there values to the title and alt respectively
|
4819 |
+
if (_is.empty(self.caption)) self.caption = self.title;
|
4820 |
+
if (_is.empty(self.description)) self.description = self.alt;
|
4821 |
+
// enforce the max lengths for the caption and description
|
4822 |
+
if (_is.number(self.maxCaptionLength) && self.maxCaptionLength > 0 && !_is.empty(self.caption) && _is.string(self.caption) && self.caption.length > self.maxCaptionLength){
|
4823 |
+
self.$caption.find(sel.caption.title).html(self.caption.substr(0, self.maxCaptionLength) + "…");
|
4824 |
+
}
|
4825 |
+
if (_is.number(self.maxDescriptionLength) && self.maxDescriptionLength > 0 && !_is.empty(self.description) && _is.string(self.description) && self.description.length > self.maxDescriptionLength){
|
4826 |
+
self.$caption.find(sel.caption.description).html(self.description.substr(0, self.maxDescriptionLength) + "…");
|
4827 |
+
}
|
4828 |
+
// check if the item has a loader
|
4829 |
+
if (self.$el.find(sel.loader).length === 0){
|
4830 |
+
self.$el.append($("<div/>", {"class": cls.loader}));
|
4831 |
+
}
|
4832 |
+
// if the image has no src url then set the placeholder
|
4833 |
+
if (_is.empty(self.$image.prop("src"))){
|
4834 |
+
self.$image.prop("src", self.tmpl.items.placeholder(self.width, self.height));
|
4835 |
+
}
|
4836 |
+
if (self.isCreated && self.isAttached && !self.isLoading && !self.isLoaded && !self.isError){
|
4837 |
+
self.$el.addClass(cls.idle);
|
4838 |
+
}
|
4839 |
+
self.fix();
|
4840 |
+
self.isParsed = true;
|
4841 |
+
// We don't load the attributes when parsing as they are only ever used to create an item and if you're parsing it's already created.
|
4842 |
+
}
|
4843 |
+
if (self.isParsed){
|
4844 |
+
/**
|
4845 |
+
* @summary Raised after an item has been parsed from an element.
|
4846 |
+
* @event FooGallery.Template~"parsed-item.foogallery"
|
4847 |
+
* @type {jQuery.Event}
|
4848 |
+
* @param {jQuery.Event} event - The jQuery.Event object for the current event.
|
4849 |
+
* @param {FooGallery.Template} template - The template raising the event.
|
4850 |
+
* @param {FooGallery.Item} item - The item that was parsed.
|
4851 |
+
* @param {jQuery} $element - The jQuery object of the element that was parsed.
|
4852 |
+
* @example {@caption To listen for this event and perform some action when it occurs you would bind to it as follows.}
|
4853 |
+
* $(".foogallery").foogallery({
|
4854 |
+
* on: {
|
4855 |
+
* "parsed-item.foogallery": function(event, template, item, $element){
|
4856 |
+
* // do something
|
4857 |
+
* }
|
4858 |
+
* }
|
4859 |
+
* });
|
4860 |
+
*/
|
4861 |
+
self.tmpl.raise("parsed-item", [self]);
|
4862 |
+
}
|
4863 |
+
return self.isParsed;
|
4864 |
+
},
|
4865 |
+
/**
|
4866 |
+
* @summary Create the items' DOM elements and populate the corresponding properties.
|
4867 |
+
* @memberof FooGallery.Item#
|
4868 |
+
* @function create
|
4869 |
+
* @returns {boolean}
|
4870 |
+
* @fires FooGallery.Template~"create-item.foogallery"
|
4871 |
+
* @fires FooGallery.Template~"created-item.foogallery"
|
4872 |
+
*/
|
4873 |
+
create: function(){
|
4874 |
+
var self = this;
|
4875 |
+
if (!self.isCreated && _is.string(self.href) && _is.string(self.src) && _is.number(self.width) && _is.number(self.height)){
|
4876 |
+
/**
|
4877 |
+
* @summary Raised when an item needs to create its' elements.
|
4878 |
+
* @event FooGallery.Template~"create-item.foogallery"
|
4879 |
+
* @type {jQuery.Event}
|
4880 |
+
* @param {jQuery.Event} event - The jQuery.Event object for the current event.
|
4881 |
+
* @param {FooGallery.Template} template - The template raising the event.
|
4882 |
+
* @param {FooGallery.Item} item - The item to create the elements for.
|
4883 |
+
* @example {@caption To listen for this event and perform some action when it occurs you would bind to it as follows.}
|
4884 |
+
* $(".foogallery").foogallery({
|
4885 |
+
* on: {
|
4886 |
+
* "create-item.foogallery": function(event, template, item){
|
4887 |
+
* // do something
|
4888 |
+
* }
|
4889 |
+
* }
|
4890 |
+
* });
|
4891 |
+
* @example {@caption Calling the `preventDefault` method on the `event` object will prevent the `item` being created.}
|
4892 |
+
* $(".foogallery").foogallery({
|
4893 |
+
* on: {
|
4894 |
+
* "create-item.foogallery": function(event, template, item){
|
4895 |
+
* if ("some condition"){
|
4896 |
+
* // stop the item being created
|
4897 |
+
* event.preventDefault();
|
4898 |
+
* }
|
4899 |
+
* }
|
4900 |
+
* }
|
4901 |
+
* });
|
4902 |
+
* @example {@caption You can also prevent the default logic and replace it with your own by calling the `preventDefault` method on the `event` object.}
|
4903 |
+
* $(".foogallery").foogallery({
|
4904 |
+
* on: {
|
4905 |
+
* "create-item.foogallery": function(event, template, item){
|
4906 |
+
* // stop the default logic
|
4907 |
+
* event.preventDefault();
|
4908 |
+
* // replacing it with your own creating each element property of the item yourself
|
4909 |
+
* item.$el = $("<div/>");
|
4910 |
+
* ...
|
4911 |
+
* // once all elements are created you must set isCreated to true
|
4912 |
+
* item.isCreated = true;
|
4913 |
+
* }
|
4914 |
+
* }
|
4915 |
+
* });
|
4916 |
+
*/
|
4917 |
+
var e = self.tmpl.raise("create-item", [self]);
|
4918 |
+
if (!e.isDefaultPrevented()){
|
4919 |
+
var o = self.tmpl.opt, cls = self.cls, attr = self.attr;
|
4920 |
+
attr.elem["class"] = cls.elem + " " + cls.idle;
|
4921 |
+
|
4922 |
+
attr.inner["class"] = cls.inner;
|
4923 |
+
|
4924 |
+
attr.anchor["class"] = cls.anchor;
|
4925 |
+
attr.anchor["href"] = self.href;
|
4926 |
+
attr.anchor["data-id"] = self.id;
|
4927 |
+
attr.anchor["data-title"] = self.caption;
|
4928 |
+
attr.anchor["data-description"] = self.description;
|
4929 |
+
if (!_is.empty(self.tags)){
|
4930 |
+
attr.anchor["data-tags"] = JSON.stringify(self.tags);
|
4931 |
+
}
|
4932 |
+
|
4933 |
+
attr.image["class"] = cls.image;
|
4934 |
+
attr.image["src"] = self.tmpl.items.placeholder(self.width, self.height);
|
4935 |
+
attr.image[o.src] = self.src;
|
4936 |
+
attr.image[o.srcset] = self.srcset;
|
4937 |
+
attr.image["width"] = self.width;
|
4938 |
+
attr.image["height"] = self.height;
|
4939 |
+
attr.image["title"] = self.title;
|
4940 |
+
attr.image["alt"] = self.alt;
|
4941 |
+
|
4942 |
+
self.$el = $("<div/>").attr(attr.elem).data(_.dataItem, self);
|
4943 |
+
self.$inner = $("<figure/>").attr(attr.inner).appendTo(self.$el);
|
4944 |
+
self.$anchor = $("<a/>").attr(attr.anchor).appendTo(self.$inner).on("click.foogallery", {self: self}, self.onAnchorClick);
|
4945 |
+
self.$image = $("<img/>").attr(attr.image).appendTo(self.$anchor);
|
4946 |
+
|
4947 |
+
cls = self.cls.caption;
|
4948 |
+
attr = self.attr.caption;
|
4949 |
+
attr.elem["class"] = cls.elem;
|
4950 |
+
self.$caption = $("<figcaption/>").attr(attr.elem).on("click.foogallery", {self: self}, self.onCaptionClick);
|
4951 |
+
var hasTitle = !_is.empty(self.caption), hasDesc = !_is.empty(self.description);
|
4952 |
+
if (hasTitle || hasDesc){
|
4953 |
+
attr.inner["class"] = cls.inner;
|
4954 |
+
attr.title["class"] = cls.title;
|
4955 |
+
attr.description["class"] = cls.description;
|
4956 |
+
var $inner = $("<div/>").attr(attr.inner).appendTo(self.$caption);
|
4957 |
+
if (hasTitle){
|
4958 |
+
var $title;
|
4959 |
+
// enforce the max length for the caption
|
4960 |
+
if (_is.number(self.maxCaptionLength) && self.maxCaptionLength > 0 && _is.string(self.caption) && self.caption.length > self.maxCaptionLength){
|
4961 |
+
$title = $("<div/>").attr(attr.title).html(self.caption.substr(0, self.maxCaptionLength) + "…");
|
4962 |
+
} else {
|
4963 |
+
$title = $("<div/>").attr(attr.title).html(self.caption);
|
4964 |
+
}
|
4965 |
+
$inner.append($title);
|
4966 |
+
}
|
4967 |
+
if (hasDesc){
|
4968 |
+
var $desc;
|
4969 |
+
// enforce the max length for the description
|
4970 |
+
if (_is.number(self.maxDescriptionLength) && self.maxDescriptionLength > 0 && _is.string(self.description) && self.description.length > self.maxDescriptionLength){
|
4971 |
+
$desc = $("<div/>").attr(attr.description).html(self.description.substr(0, self.maxDescriptionLength) + "…");
|
4972 |
+
} else {
|
4973 |
+
$desc = $("<div/>").attr(attr.description).html(self.description);
|
4974 |
+
}
|
4975 |
+
$inner.append($desc);
|
4976 |
+
}
|
4977 |
+
}
|
4978 |
+
self.$caption.appendTo(self.$inner);
|
4979 |
+
// check if the item has a loader
|
4980 |
+
if (self.$el.find(self.sel.loader).length === 0){
|
4981 |
+
self.$el.append($("<div/>", {"class": self.cls.loader}));
|
4982 |
+
}
|
4983 |
+
self.isCreated = true;
|
4984 |
+
}
|
4985 |
+
if (self.isCreated){
|
4986 |
+
/**
|
4987 |
+
* @summary Raised after an items' elements have been created.
|
4988 |
+
* @event FooGallery.Template~"created-item.foogallery"
|
4989 |
+
* @type {jQuery.Event}
|
4990 |
+
* @param {jQuery.Event} event - The jQuery.Event object for the current event.
|
4991 |
+
* @param {FooGallery.Template} template - The template raising the event.
|
4992 |
+
* @param {FooGallery.Item} item - The item that was created.
|
4993 |
+
* @example {@caption To listen for this event and perform some action when it occurs you would bind to it as follows.}
|
4994 |
+
* $(".foogallery").foogallery({
|
4995 |
+
* on: {
|
4996 |
+
* "created-item.foogallery": function(event, template, item){
|
4997 |
+
* // do something
|
4998 |
+
* }
|
4999 |
+
* }
|
5000 |
+
* });
|
5001 |
+
*/
|
5002 |
+
self.tmpl.raise("created-item", [self]);
|
5003 |
+
}
|
5004 |
+
}
|
5005 |
+
return self.isCreated;
|
5006 |
+
},
|
5007 |
+
/**
|
5008 |
+
* @summary Append the item to the current template.
|
5009 |
+
* @memberof FooGallery.Item#
|
5010 |
+
* @function append
|
5011 |
+
* @returns {boolean}
|
5012 |
+
* @fires FooGallery.Template~"append-item.foogallery"
|
5013 |
+
* @fires FooGallery.Template~"appended-item.foogallery"
|
5014 |
+
*/
|
5015 |
+
append: function(){
|
5016 |
+
var self = this;
|
5017 |
+
if (self.isCreated && !self.isAttached){
|
5018 |
+
/**
|
5019 |
+
* @summary Raised when an item needs to append its elements to the template.
|
5020 |
+
* @event FooGallery.Template~"append-item.foogallery"
|
5021 |
+
* @type {jQuery.Event}
|
5022 |
+
* @param {jQuery.Event} event - The jQuery.Event object for the current event.
|
5023 |
+
* @param {FooGallery.Template} template - The template raising the event.
|
5024 |
+
* @param {FooGallery.Item} item - The item to append to the template.
|
5025 |
+
* @example {@caption To listen for this event and perform some action when it occurs you would bind to it as follows.}
|
5026 |
+
* $(".foogallery").foogallery({
|
5027 |
+
* on: {
|
5028 |
+
* "append-item.foogallery": function(event, template, item){
|
5029 |
+
* // do something
|
5030 |
+
* }
|
5031 |
+
* }
|
5032 |
+
* });
|
5033 |
+
* @example {@caption Calling the `preventDefault` method on the `event` object will prevent the `item` being appended.}
|
5034 |
+
* $(".foogallery").foogallery({
|
5035 |
+
* on: {
|
5036 |
+
* "append-item.foogallery": function(event, template, item){
|
5037 |
+
* if ("some condition"){
|
5038 |
+
* // stop the item being appended
|
5039 |
+
* event.preventDefault();
|
5040 |
+
* }
|
5041 |
+
* }
|
5042 |
+
* }
|
5043 |
+
* });
|
5044 |
+
* @example {@caption You can also prevent the default logic and replace it with your own by calling the `preventDefault` method on the `event` object.}
|
5045 |
+
* $(".foogallery").foogallery({
|
5046 |
+
* on: {
|
5047 |
+
* "append-item.foogallery": function(event, template, item){
|
5048 |
+
* // stop the default logic
|
5049 |
+
* event.preventDefault();
|
5050 |
+
* // replacing it with your own appending the item to the template
|
5051 |
+
* item.$el.appendTo(template.$el);
|
5052 |
+
* ...
|
5053 |
+
* // once the item is appended you must set isAttached to true
|
5054 |
+
* item.isAttached = true;
|
5055 |
+
* }
|
5056 |
+
* }
|
5057 |
+
* });
|
5058 |
+
*/
|
5059 |
+
var e = self.tmpl.raise("append-item", [self]);
|
5060 |
+
if (!e.isDefaultPrevented()){
|
5061 |
+
self.tmpl.$el.append(self.$el);
|
5062 |
+
self.fix();
|
5063 |
+
self.isAttached = true;
|
5064 |
+
}
|
5065 |
+
if (self.isAttached){
|
5066 |
+
/**
|
5067 |
+
* @summary Raised after an item has appended its' elements to the template.
|
5068 |
+
* @event FooGallery.Template~"appended-item.foogallery"
|
5069 |
+
* @type {jQuery.Event}
|
5070 |
+
* @param {jQuery.Event} event - The jQuery.Event object for the current event.
|
5071 |
+
* @param {FooGallery.Template} template - The template raising the event.
|
5072 |
+
* @param {FooGallery.Item} item - The item that was appended.
|
5073 |
+
* @example {@caption To listen for this event and perform some action when it occurs you would bind to it as follows.}
|
5074 |
+
* $(".foogallery").foogallery({
|
5075 |
+
* on: {
|
5076 |
+
* "appended-item.foogallery": function(event, template, item){
|
5077 |
+
* // do something
|
5078 |
+
* }
|
5079 |
+
* }
|
5080 |
+
* });
|
5081 |
+
*/
|
5082 |
+
self.tmpl.raise("appended-item", [self]);
|
5083 |
+
}
|
5084 |
+
}
|
5085 |
+
return self.isAttached;
|
5086 |
+
},
|
5087 |
+
/**
|
5088 |
+
* @summary Detach the item from the current template preserving its' data and events.
|
5089 |
+
* @memberof FooGallery.Item#
|
5090 |
+
* @function detach
|
5091 |
+
* @returns {boolean}
|
5092 |
+
*/
|
5093 |
+
detach: function(){
|
5094 |
+
var self = this;
|
5095 |
+
if (self.isCreated && self.isAttached){
|
5096 |
+
/**
|
5097 |
+
* @summary Raised when an item needs to detach its' elements from the template.
|
5098 |
+
* @event FooGallery.Template~"detach-item.foogallery"
|
5099 |
+
* @type {jQuery.Event}
|
5100 |
+
* @param {jQuery.Event} event - The jQuery.Event object for the current event.
|
5101 |
+
* @param {FooGallery.Template} template - The template raising the event.
|
5102 |
+
* @param {FooGallery.Item} item - The item to detach from the template.
|
5103 |
+
* @example {@caption To listen for this event and perform some action when it occurs you would bind to it as follows.}
|
5104 |
+
* $(".foogallery").foogallery({
|
5105 |
+
* on: {
|
5106 |
+
* "detach-item.foogallery": function(event, template, item){
|
5107 |
+
* // do something
|
5108 |
+
* }
|
5109 |
+
* }
|
5110 |
+
* });
|
5111 |
+
* @example {@caption Calling the `preventDefault` method on the `event` object will prevent the `item` being detached.}
|
5112 |
+
* $(".foogallery").foogallery({
|
5113 |
+
* on: {
|
5114 |
+
* "detach-item.foogallery": function(event, template, item){
|
5115 |
+
* if ("some condition"){
|
5116 |
+
* // stop the item being detached
|
5117 |
+
* event.preventDefault();
|
5118 |
+
* }
|
5119 |
+
* }
|
5120 |
+
* }
|
5121 |
+
* });
|
5122 |
+
* @example {@caption You can also prevent the default logic and replace it with your own by calling the `preventDefault` method on the `event` object.}
|
5123 |
+
* $(".foogallery").foogallery({
|
5124 |
+
* on: {
|
5125 |
+
* "detach-item.foogallery": function(event, template, item){
|
5126 |
+
* // stop the default logic
|
5127 |
+
* event.preventDefault();
|
5128 |
+
* // replacing it with your own detaching the item from the template
|
5129 |
+
* item.$el.detach();
|
5130 |
+
* ...
|
5131 |
+
* // once the item is detached you must set isAttached to false
|
5132 |
+
* item.isAttached = false;
|
5133 |
+
* }
|
5134 |
+
* }
|
5135 |
+
* });
|
5136 |
+
*/
|
5137 |
+
var e = self.tmpl.raise("detach-item", [self]);
|
5138 |
+
if (!e.isDefaultPrevented()){
|
5139 |
+
self.$el.detach();
|
5140 |
+
self.unfix();
|
5141 |
+
self.isAttached = false;
|
5142 |
+
}
|
5143 |
+
if (!self.isAttached){
|
5144 |
+
/**
|
5145 |
+
* @summary Raised after an item has detached its' elements from the template.
|
5146 |
+
* @event FooGallery.Template~"detached-item.foogallery"
|
5147 |
+
* @type {jQuery.Event}
|
5148 |
+
* @param {jQuery.Event} event - The jQuery.Event object for the current event.
|
5149 |
+
* @param {FooGallery.Template} template - The template raising the event.
|
5150 |
+
* @param {FooGallery.Item} item - The item that was detached.
|
5151 |
+
* @example {@caption To listen for this event and perform some action when it occurs you would bind to it as follows.}
|
5152 |
+
* $(".foogallery").foogallery({
|
5153 |
+
* on: {
|
5154 |
+
* "detached-item.foogallery": function(event, template, item){
|
5155 |
+
* // do something
|
5156 |
+
* }
|
5157 |
+
* }
|
5158 |
+
* });
|
5159 |
+
*/
|
5160 |
+
self.tmpl.raise("detached-item", [self]);
|
5161 |
+
}
|
5162 |
+
}
|
5163 |
+
return !self.isAttached;
|
5164 |
+
},
|
5165 |
+
/**
|
5166 |
+
* @summary Load the items' {@link FooGallery.Item#$image|$image}.
|
5167 |
+
* @memberof FooGallery.Item#
|
5168 |
+
* @function load
|
5169 |
+
* @returns {Promise.<FooGallery.Item>}
|
5170 |
+
*/
|
5171 |
+
load: function(){
|
5172 |
+
var self = this;
|
5173 |
+
if (_is.promise(self._load)) return self._load;
|
5174 |
+
if (!self.isCreated || !self.isAttached) return _fn.rejectWith("not created or attached");
|
5175 |
+
var e = self.tmpl.raise("load-item", [self]);
|
5176 |
+
if (e.isDefaultPrevented()) return _fn.rejectWith("default prevented");
|
5177 |
+
var cls = self.cls, img = self.$image.get(0), placeholder = img.src;
|
5178 |
+
self.isLoading = true;
|
5179 |
+
self.$el.removeClass(cls.idle).removeClass(cls.loaded).removeClass(cls.error).addClass(cls.loading);
|
5180 |
+
return self._load = $.Deferred(function (def) {
|
5181 |
+
// if Firefox reset to empty src or else the onload and onerror callbacks are executed immediately
|
5182 |
+
if (!_is.undef(window.InstallTrigger)) img.src = "";
|
5183 |
+
img.onload = function () {
|
5184 |
+
img.onload = img.onerror = null;
|
5185 |
+
self.isLoading = false;
|
5186 |
+
self.isLoaded = true;
|
5187 |
+
self.$el.removeClass(cls.loading).addClass(cls.loaded);
|
5188 |
+
self.unfix();
|
5189 |
+
self.tmpl.raise("loaded-item", [self]);
|
5190 |
+
def.resolve(self);
|
5191 |
+
};
|
5192 |
+
img.onerror = function () {
|
5193 |
+
img.onload = img.onerror = null;
|
5194 |
+
self.isLoading = false;
|
5195 |
+
self.isError = true;
|
5196 |
+
self.$el.removeClass(cls.loading).addClass(cls.error);
|
5197 |
+
if (_is.string(placeholder)) {
|
5198 |
+
self.$image.prop("src", placeholder);
|
5199 |
+
}
|
5200 |
+
self.tmpl.raise("error-item", [self]);
|
5201 |
+
def.reject(self);
|
5202 |
+
};
|
5203 |
+
// set everything in motion by setting the src
|
5204 |
+
img.src = self.getThumbUrl();
|
5205 |
+
}).promise();
|
5206 |
+
},
|
5207 |
+
/**
|
5208 |
+
* @summary Attempts to set a inline width and height on the {@link FooGallery.Item#$image|$image} to prevent layout jumps.
|
5209 |
+
* @memberof FooGallery.Item#
|
5210 |
+
* @function fix
|
5211 |
+
* @returns {FooGallery.Item}
|
5212 |
+
*/
|
5213 |
+
fix: function(){
|
5214 |
+
var self = this;
|
5215 |
+
if (self.isCreated && !self.isLoading && !self.isLoaded && !self.isError){
|
5216 |
+
var w = self.width, h = self.height;
|
5217 |
+
// if we have a base width and height to work with
|
5218 |
+
if (!isNaN(w) && !isNaN(h)){
|
5219 |
+
// figure out the max image width and calculate the height the image should be displayed as
|
5220 |
+
var width = _is.fn(self.maxWidth) ? self.maxWidth(self) : self.$image.width();
|
5221 |
+
if (width <= 0) width = w;
|
5222 |
+
var ratio = width / w, height = h * ratio;
|
5223 |
+
// actually set the inline css on the image
|
5224 |
+
self.$image.css({width: width,height: height});
|
5225 |
+
}
|
5226 |
+
}
|
5227 |
+
return self;
|
5228 |
+
},
|
5229 |
+
/**
|
5230 |
+
* @summary Removes any inline width and height values set on the {@link FooGallery.Item#$image|$image}.
|
5231 |
+
* @memberof FooGallery.Item#
|
5232 |
+
* @function unfix
|
5233 |
+
* @returns {FooGallery.Item}
|
5234 |
+
*/
|
5235 |
+
unfix: function(){
|
5236 |
+
var self = this;
|
5237 |
+
if (self.isCreated) self.$image.css({width: '',height: ''});
|
5238 |
+
return self;
|
5239 |
+
},
|
5240 |
+
/**
|
5241 |
+
* @summary Inspect the `src` and `srcset` properties to determine which url to load for the thumb.
|
5242 |
+
* @memberof FooGallery.Item#
|
5243 |
+
* @function getThumbUrl
|
5244 |
+
* @param {boolean} [refresh=false] - Whether or not to force refreshing of the cached value.
|
5245 |
+
* @returns {string}
|
5246 |
+
*/
|
5247 |
+
getThumbUrl: function(refresh){
|
5248 |
+
refresh = _is.boolean(refresh) ? refresh : false;
|
5249 |
+
var self = this;
|
5250 |
+
if (!refresh && _is.string(self._thumbUrl)) return self._thumbUrl;
|
5251 |
+
return self._thumbUrl = _.parseSrc(self.src, self.width, self.height, self.srcset, self.$anchor.innerWidth(), self.$anchor.innerHeight());
|
5252 |
+
},
|
5253 |
+
/**
|
5254 |
+
* @summary Scroll the item into the center of the viewport.
|
5255 |
+
* @memberof FooGallery.Item#
|
5256 |
+
* @function scrollTo
|
5257 |
+
*/
|
5258 |
+
scrollTo: function(align){
|
5259 |
+
var self = this;
|
5260 |
+
if (self.isAttached){
|
5261 |
+
var ib = self.bounds(), vb = _utils.getViewportBounds();
|
5262 |
+
switch(align){
|
5263 |
+
case "top": // attempts to center the item horizontally but aligns the top with the middle of the viewport
|
5264 |
+
ib.left += (ib.width / 2) - (vb.width / 2);
|
5265 |
+
ib.top -= (vb.height / 5);
|
5266 |
+
break;
|
5267 |
+
default: // attempts to center the item in the viewport
|
5268 |
+
ib.left += (ib.width / 2) - (vb.width / 2);
|
5269 |
+
ib.top += (ib.height / 2) - (vb.height / 2);
|
5270 |
+
break;
|
5271 |
+
}
|
5272 |
+
window.scrollTo(ib.left, ib.top);
|
5273 |
+
}
|
5274 |
+
return self;
|
5275 |
+
},
|
5276 |
+
/**
|
5277 |
+
* @summary Get the bounds for the item.
|
5278 |
+
* @memberof FooGallery.Item#
|
5279 |
+
* @function bounds
|
5280 |
+
* @returns {?FooGallery.utils.Bounds}
|
5281 |
+
*/
|
5282 |
+
bounds: function(){
|
5283 |
+
return this.isAttached ? _utils.getElementBounds(this.$el) : null;
|
5284 |
+
},
|
5285 |
+
/**
|
5286 |
+
* @summary Checks if the item bounds intersects the supplied bounds.
|
5287 |
+
* @memberof FooGallery.Item#
|
5288 |
+
* @function intersects
|
5289 |
+
* @param {FooGallery.utils.Bounds} bounds - The bounds to check.
|
5290 |
+
* @returns {boolean}
|
5291 |
+
*/
|
5292 |
+
intersects: function(bounds){
|
5293 |
+
return this.isAttached ? this.bounds().intersects(bounds) : false;
|
5294 |
+
},
|
5295 |
+
/**
|
5296 |
+
* @summary Listens for the click event on the {@link FooGallery.Item#$anchor|$anchor} element and updates the state if enabled.
|
5297 |
+
* @memberof FooGallery.Item#
|
5298 |
+
* @function onAnchorClick
|
5299 |
+
* @param {jQuery.Event} e - The jQuery.Event object for the click event.
|
5300 |
+
* @private
|
5301 |
+
*/
|
5302 |
+
onAnchorClick: function(e){
|
5303 |
+
var self = e.data.self,
|
5304 |
+
state = self.tmpl.state.get(self);
|
5305 |
+
self.tmpl.state.update(state);
|
5306 |
+
},
|
5307 |
+
/**
|
5308 |
+
* @summary Listens for the click event on the {@link FooGallery.Item#$caption|$caption} element and redirects it to the anchor if required.
|
5309 |
+
* @memberof FooGallery.Item#
|
5310 |
+
* @function onCaptionClick
|
5311 |
+
* @param {jQuery.Event} e - The jQuery.Event object for the click event.
|
5312 |
+
* @private
|
5313 |
+
*/
|
5314 |
+
onCaptionClick: function(e){
|
5315 |
+
var self = e.data.self;
|
5316 |
+
if ($(e.target).is(self.sel.caption.all) && self.$anchor.length > 0){
|
5317 |
+
self.$anchor.get(0).click();
|
5318 |
+
}
|
5319 |
+
}
|
5320 |
+
});
|
5321 |
+
|
5322 |
+
/**
|
5323 |
+
* @summary Called when setting an items' image size to prevent layout jumps.
|
5324 |
+
* @callback FooGallery.Item~maxWidthCallback
|
5325 |
+
* @param {FooGallery.Item} item - The item to determine the maxWidth for.
|
5326 |
+
* @returns {number} Returns the maximum width allowed for the {@link FooGallery.Item#$image|$image} element.
|
5327 |
+
* @example {@caption An example of the default behavior this callback replaces would look like the below.}
|
5328 |
+
* {
|
5329 |
+
* "maxWidth": function(item){
|
5330 |
+
* return item.$image.outerWidth();
|
5331 |
+
* }
|
5332 |
+
* }
|
5333 |
+
*/
|
5334 |
+
|
5335 |
+
/**
|
5336 |
+
* @summary A simple object containing an items' default values.
|
5337 |
+
* @typedef {object} FooGallery.Item~Options
|
5338 |
+
* @property {?string} [id=null] - The `data-id` attribute for the outer element.
|
5339 |
+
* @property {?string} [href=null] - The `href` attribute for the anchor element.
|
5340 |
+
* @property {?string} [src=null] - The `src` attribute for the image element.
|
5341 |
+
* @property {?string} [srcset=null] - The `srcset` attribute for the image element.
|
5342 |
+
* @property {number} [width=0] - The width of the image.
|
5343 |
+
* @property {number} [height=0] - The height of the image.
|
5344 |
+
* @property {?string} [title=null] - The title for the image. This should be plain text.
|
5345 |
+
* @property {?string} [alt=null] - The alt for the image. This should be plain text.
|
5346 |
+
* @property {?string} [caption=null] - The caption for the image. This can contain HTML content.
|
5347 |
+
* @property {?string} [description=null] - The description for the image. This can contain HTML content.
|
5348 |
+
* @property {string[]} [tags=[]] - The `data-tags` attribute for the outer element.
|
5349 |
+
* @property {?FooGallery.Item~maxWidthCallback} [maxWidth=null] - Called when setting an items' image size. If not supplied the images outer width is used.
|
5350 |
+
* @property {number} [maxCaptionLength=0] - The max length of the title for the caption.
|
5351 |
+
* @property {number} [maxDescriptionLength=0] - The max length of the description for the caption.
|
5352 |
+
* @property {boolean} [showCaptionTitle=true] - Whether or not the caption title should be displayed.
|
5353 |
+
* @property {boolean} [showCaptionDescription=true] - Whether or not the caption description should be displayed.
|
5354 |
+
* @property {FooGallery.Item~Attributes} [attr] - Additional attributes to apply to the items' elements.
|
5355 |
+
*/
|
5356 |
+
_.template.configure("core", {
|
5357 |
+
item: {
|
5358 |
+
id: "",
|
5359 |
+
href: "",
|
5360 |
+
src: "",
|
5361 |
+
srcset: "",
|
5362 |
+
width: 0,
|
5363 |
+
height: 0,
|
5364 |
+
title: "",
|
5365 |
+
alt: "",
|
5366 |
+
caption: "",
|
5367 |
+
description: "",
|
5368 |
+
tags: [],
|
5369 |
+
maxWidth: null,
|
5370 |
+
maxCaptionLength: 0,
|
5371 |
+
maxDescriptionLength: 0,
|
5372 |
+
showCaptionTitle: true,
|
5373 |
+
showCaptionDescription: true,
|
5374 |
+
attr: {
|
5375 |
+
elem: {},
|
5376 |
+
inner: {},
|
5377 |
+
anchor: {},
|
5378 |
+
image: {},
|
5379 |
+
caption: {
|
5380 |
+
elem: {},
|
5381 |
+
inner: {},
|
5382 |
+
title: {},
|
5383 |
+
description: {}
|
5384 |
+
}
|
5385 |
+
}
|
5386 |
+
}
|
5387 |
+
}, {
|
5388 |
+
item: {
|
5389 |
+
elem: "fg-item",
|
5390 |
+
inner: "fg-item-inner",
|
5391 |
+
anchor: "fg-thumb",
|
5392 |
+
image: "fg-image",
|
5393 |
+
loader: "fg-loader",
|
5394 |
+
idle: "fg-idle",
|
5395 |
+
loading: "fg-loading",
|
5396 |
+
loaded: "fg-loaded",
|
5397 |
+
error: "fg-error",
|
5398 |
+
caption: {
|
5399 |
+
elem: "fg-caption",
|
5400 |
+
inner: "fg-caption-inner",
|
5401 |
+
title: "fg-caption-title",
|
5402 |
+
description: "fg-caption-desc"
|
5403 |
+
}
|
5404 |
+
}
|
5405 |
+
});
|
5406 |
+
|
5407 |
+
_.components.register("item", _.Item);
|
5408 |
+
|
5409 |
+
// ######################
|
5410 |
+
// ## Type Definitions ##
|
5411 |
+
// ######################
|
5412 |
+
|
5413 |
+
/**
|
5414 |
+
* @summary A simple object containing the CSS classes used by an item.
|
5415 |
+
* @typedef {object} FooGallery.Item~CSSClasses
|
5416 |
+
* @property {string} [elem="fg-item"] - The CSS class for the outer containing `div` element of an item.
|
5417 |
+
* @property {string} [inner="fg-item-inner"] - The CSS class for the inner containing `div` element of an item.
|
5418 |
+
* @property {string} [anchor="fg-thumb"] - The CSS class for the `a` element of an item.
|
5419 |
+
* @property {string} [image="fg-image"] - The CSS class for the `img` element of an item.
|
5420 |
+
* @property {string} [loading="fg-idle"] - The CSS class applied to an item that is waiting to be loaded.
|
5421 |
+
* @property {string} [loading="fg-loading"] - The CSS class applied to an item while it is loading.
|
5422 |
+
* @property {string} [loaded="fg-loaded"] - The CSS class applied to an item once it is loaded.
|
5423 |
+
* @property {string} [error="fg-error"] - The CSS class applied to an item if it throws an error while loading.
|
5424 |
+
* @property {object} [caption] - A simple object containing the CSS classes used by an items' caption.
|
5425 |
+
* @property {string} [caption.elem="fg-caption"] - The CSS class for the outer containing `div` element of a caption.
|
5426 |
+
* @property {string} [caption.inner="fg-caption-inner"] - The CSS class for the inner containing `div` element of a caption.
|
5427 |
+
* @property {string} [caption.title="fg-caption-title"] - The CSS class for the title `div` element of a caption.
|
5428 |
+
* @property {string} [caption.description="fg-caption-desc"] - The CSS class for the description `div` element of a caption.
|
5429 |
+
*/
|
5430 |
+
/**
|
5431 |
+
* @summary A simple object used to store any additional attributes to apply to an items' elements.
|
5432 |
+
* @typedef {object} FooGallery.Item~Attributes
|
5433 |
+
* @property {object} [elem={}] - The attributes to apply to the items' outer `<div/>` element.
|
5434 |
+
* @property {object} [inner={}] - The attributes to apply to the items' inner element.
|
5435 |
+
* @property {object} [anchor={}] - The attributes to apply to the items' anchor element.
|
5436 |
+
* @property {object} [image={}] - The attributes to apply to the items' image element.
|
5437 |
+
* @property {object} [caption] - A simple object used to store any additional attributes to apply to an items' caption elements.
|
5438 |
+
* @property {object} [caption.elem={}] - The attributes to apply to the captions' outer `<div/>` element.
|
5439 |
+
* @property {object} [caption.inner={}] - The attributes to apply to the captions' inner element.
|
5440 |
+
* @property {object} [caption.title={}] - The attributes to apply to the captions' title element.
|
5441 |
+
* @property {object} [caption.description={}] - The attributes to apply to the captions' description element.
|
5442 |
+
*/
|
5443 |
+
|
5444 |
+
})(
|
5445 |
+
FooGallery.$,
|
5446 |
+
FooGallery,
|
5447 |
+
FooGallery.utils,
|
5448 |
+
FooGallery.utils.is,
|
5449 |
+
FooGallery.utils.fn,
|
5450 |
+
FooGallery.utils.obj
|
5451 |
+
);
|
5452 |
+
(function($, _, _utils, _is, _fn){
|
5453 |
+
|
5454 |
+
_.Items = _.Component.extend(/** @lends FooGallery.Items */{
|
5455 |
+
/**
|
5456 |
+
* @summary This class controls everything related to items and serves as the base class for the various paging types.
|
5457 |
+
* @memberof FooGallery
|
5458 |
+
* @constructs Items
|
5459 |
+
* @param {FooGallery.Template} template - The template for this component.
|
5460 |
+
* @augments FooGallery.Component
|
5461 |
+
* @borrows FooGallery.utils.Class.extend as extend
|
5462 |
+
* @borrows FooGallery.utils.Class.override as override
|
5463 |
+
*/
|
5464 |
+
construct: function(template){
|
5465 |
+
var self = this;
|
5466 |
+
/**
|
5467 |
+
* @ignore
|
5468 |
+
* @memberof FooGallery.Items#
|
5469 |
+
* @function _super
|
5470 |
+
*/
|
5471 |
+
self._super(template);
|
5472 |
+
self.idMap = {};
|
5473 |
+
self._fetched = null;
|
5474 |
+
self._arr = [];
|
5475 |
+
self._available = [];
|
5476 |
+
self._canvas = document.createElement("canvas");
|
5477 |
+
// add the .all caption selector
|
5478 |
+
var cls = self.tmpl.cls.item.caption;
|
5479 |
+
self.tmpl.sel.item.caption.all = _utils.selectify([cls.elem, cls.inner, cls.title, cls.description]);
|
5480 |
+
},
|
5481 |
+
destroy: function(){
|
5482 |
+
var self = this, items = self.all(), destroyed = [];
|
5483 |
+
if (items.length > 0) {
|
5484 |
+
/**
|
5485 |
+
* @summary Raised before the template destroys its' items.
|
5486 |
+
* @event FooGallery.Template~"destroy-items.foogallery"
|
5487 |
+
* @type {jQuery.Event}
|
5488 |
+
* @param {jQuery.Event} event - The jQuery.Event object for the current event.
|
5489 |
+
* @param {FooGallery.Template} template - The template raising the event.
|
5490 |
+
* @param {FooGallery.Item[]} items - The array of items about to be destroyed.
|
5491 |
+
* @example {@caption To listen for this event and perform some action when it occurs you would bind to it as follows.}
|
5492 |
+
* $(".foogallery").foogallery({
|
5493 |
+
* on: {
|
5494 |
+
* "destroy-items.foogallery": function(event, template, items){
|
5495 |
+
* // do something
|
5496 |
+
* }
|
5497 |
+
* }
|
5498 |
+
* });
|
5499 |
+
*/
|
5500 |
+
self.tmpl.raise("destroy-items", [items]);
|
5501 |
+
destroyed = $.map(items, function(item){
|
5502 |
+
return item.destroy() ? item : null;
|
5503 |
+
});
|
5504 |
+
/**
|
5505 |
+
* @summary Raised after the template has destroyed items.
|
5506 |
+
* @event FooGallery.Template~"destroyed-items.foogallery"
|
5507 |
+
* @type {jQuery.Event}
|
5508 |
+
* @param {jQuery.Event} event - The jQuery.Event object for the current event.
|
5509 |
+
* @param {FooGallery.Template} template - The template raising the event.
|
5510 |
+
* @param {FooGallery.Item[]} items - The array of items destroyed.
|
5511 |
+
* @example {@caption To listen for this event and perform some action when it occurs you would bind to it as follows.}
|
5512 |
+
* $(".foogallery").foogallery({
|
5513 |
+
* on: {
|
5514 |
+
* "destroyed-items.foogallery": function(event, template, items){
|
5515 |
+
* // do something
|
5516 |
+
* }
|
5517 |
+
* }
|
5518 |
+
* });
|
5519 |
+
*/
|
5520 |
+
if (destroyed.length > 0) self.tmpl.raise("destroyed-items", [destroyed]);
|
5521 |
+
// should we handle a case where the destroyed.length != items.length??
|
5522 |
+
}
|
5523 |
+
self.idMap = {};
|
5524 |
+
self._canvas = self._fetched = null;
|
5525 |
+
self._arr = [];
|
5526 |
+
self._available = [];
|
5527 |
+
self._super();
|
5528 |
+
},
|
5529 |
+
fetch: function(refresh){
|
5530 |
+
var self = this;
|
5531 |
+
if (!refresh && _is.promise(self._fetched)) return self._fetched;
|
5532 |
+
var fg = self.tmpl, selectors = fg.sel,
|
5533 |
+
option = fg.opt.items,
|
5534 |
+
def = $.Deferred();
|
5535 |
+
|
5536 |
+
var items = self.make(fg.$el.find(selectors.item.elem));
|
5537 |
+
|
5538 |
+
if (!_is.empty(option)){
|
5539 |
+
if (_is.array(option)){
|
5540 |
+
items.push.apply(items, self.make(option));
|
5541 |
+
def.resolve(items);
|
5542 |
+
} else if (_is.string(option)){
|
5543 |
+
$.get(option).then(function(response){
|
5544 |
+
items.push.apply(items, self.make(response));
|
5545 |
+
def.resolve(items);
|
5546 |
+
}, function( jqXHR, textStatus, errorThrown ){
|
5547 |
+
console.log("FooGallery: GET items error.", option, jqXHR, textStatus, errorThrown);
|
5548 |
+
def.resolve(items);
|
5549 |
+
});
|
5550 |
+
} else {
|
5551 |
+
def.resolve(items);
|
5552 |
+
}
|
5553 |
+
} else {
|
5554 |
+
items.push.apply(items, self.make(window[fg.id + "-items"]));
|
5555 |
+
def.resolve(items);
|
5556 |
+
}
|
5557 |
+
def.then(function(items){
|
5558 |
+
self._arr = items;
|
5559 |
+
self.idMap = self.createIdMap(items);
|
5560 |
+
self.setAvailable(self.all());
|
5561 |
+
});
|
5562 |
+
return self._fetched = def.promise();
|
5563 |
+
},
|
5564 |
+
all: function(){
|
5565 |
+
return this._arr.slice();
|
5566 |
+
},
|
5567 |
+
available: function(){
|
5568 |
+
return this._available.slice();
|
5569 |
+
},
|
5570 |
+
get: function(id){
|
5571 |
+
return !_is.empty(id) && !!this.idMap[id] ? this.idMap[id] : null;
|
5572 |
+
},
|
5573 |
+
setAvailable: function(items){
|
5574 |
+
this._available = _is.array(items) ? items : [];
|
5575 |
+
},
|
5576 |
+
reset: function(){
|
5577 |
+
this.setAvailable(this.all());
|
5578 |
+
},
|
5579 |
+
placeholder: function(width, height){
|
5580 |
+
if (this._canvas && this._canvas.toDataURL && _is.number(width) && _is.number(height)){
|
5581 |
+
this._canvas.width = width;
|
5582 |
+
this._canvas.height = height;
|
5583 |
+
return this._canvas.toDataURL();
|
5584 |
+
}
|
5585 |
+
return _.emptyImage;
|
5586 |
+
},
|
5587 |
+
/**
|
5588 |
+
* @summary Filter the supplied `items` and return only those that can be loaded.
|
5589 |
+
* @memberof FooGallery.Items#
|
5590 |
+
* @function loadable
|
5591 |
+
* @param {FooGallery.Item[]} items - The items to filter.
|
5592 |
+
* @returns {FooGallery.Item[]}
|
5593 |
+
*/
|
5594 |
+
loadable: function(items){
|
5595 |
+
var self = this, opt = self.tmpl.opt, viewport;
|
5596 |
+
if (opt.lazy){
|
5597 |
+
viewport = _utils.getViewportBounds(opt.viewport);
|
5598 |
+
}
|
5599 |
+
return _is.array(items) ? $.map(items, function(item){
|
5600 |
+
return item.isCreated && item.isAttached && !item.isLoading && !item.isLoaded && !item.isError && (!opt.lazy || (opt.lazy && item.intersects(viewport))) ? item : null;
|
5601 |
+
}) : [];
|
5602 |
+
},
|
5603 |
+
/**
|
5604 |
+
* @summary Filter the supplied `items` and return only those that can be created.
|
5605 |
+
* @memberof FooGallery.Items#
|
5606 |
+
* @function creatable
|
5607 |
+
* @param {FooGallery.Item[]} items - The items to filter.
|
5608 |
+
* @returns {FooGallery.Item[]}
|
5609 |
+
*/
|
5610 |
+
creatable: function(items){
|
5611 |
+
return _is.array(items) ? $.map(items, function(item){
|
5612 |
+
return item instanceof _.Item && !item.isCreated ? item : null;
|
5613 |
+
}) : [];
|
5614 |
+
},
|
5615 |
+
/**
|
5616 |
+
* @summary Filter the supplied `items` and return only those that can be appended.
|
5617 |
+
* @memberof FooGallery.Items#
|
5618 |
+
* @function appendable
|
5619 |
+
* @param {FooGallery.Item[]} items - The items to filter.
|
5620 |
+
* @returns {FooGallery.Item[]}
|
5621 |
+
*/
|
5622 |
+
appendable: function(items){
|
5623 |
+
return _is.array(items) ? $.map(items, function(item){
|
5624 |
+
return item instanceof _.Item && item.isCreated && !item.isAttached ? item : null;
|
5625 |
+
}) : [];
|
5626 |
+
},
|
5627 |
+
/**
|
5628 |
+
* @summary Filter the supplied `items` and return only those that can be detached.
|
5629 |
+
* @memberof FooGallery.Items#
|
5630 |
+
* @function detachable
|
5631 |
+
* @param {FooGallery.Item[]} items - The items to filter.
|
5632 |
+
* @returns {FooGallery.Item[]}
|
5633 |
+
*/
|
5634 |
+
detachable: function(items){
|
5635 |
+
return _is.array(items) ? $.map(items, function(item){
|
5636 |
+
return item instanceof _.Item && item.isCreated && item.isAttached ? item : null;
|
5637 |
+
}) : [];
|
5638 |
+
},
|
5639 |
+
/**
|
5640 |
+
* @summary Get a single jQuery object containing all the supplied items' elements.
|
5641 |
+
* @memberof FooGallery.Items#
|
5642 |
+
* @function jquerify
|
5643 |
+
* @param {FooGallery.Item[]} items - The items to get a jQuery object for.
|
5644 |
+
* @returns {jQuery}
|
5645 |
+
*/
|
5646 |
+
jquerify: function(items){
|
5647 |
+
return $($.map(items, function (item) {
|
5648 |
+
return item.$el.get();
|
5649 |
+
}));
|
5650 |
+
},
|
5651 |
+
/**
|
5652 |
+
* @summary Makes a jQuery object, NodeList or an array of elements or item options, into an array of {@link FooGallery.Item|item} objects.
|
5653 |
+
* @memberof FooGallery.Items#
|
5654 |
+
* @function make
|
5655 |
+
* @param {(jQuery|NodeList|Node[]|FooGallery.Item~Options[])} items - The value to convert into an array of items.
|
5656 |
+
* @returns {FooGallery.Item[]} The array of items successfully made.
|
5657 |
+
* @fires FooGallery.Template~"make-items.foogallery"
|
5658 |
+
* @fires FooGallery.Template~"made-items.foogallery"
|
5659 |
+
* @fires FooGallery.Template~"parsed-items.foogallery"
|
5660 |
+
*/
|
5661 |
+
make: function(items){
|
5662 |
+
var self = this, made = [];
|
5663 |
+
if (_is.jq(items) || _is.array(items)){
|
5664 |
+
var parsed = [], arr = $.makeArray(items);
|
5665 |
+
if (arr.length === 0) return made;
|
5666 |
+
/**
|
5667 |
+
* @summary Raised before the template makes an array of elements or item options into an array of {@link FooGallery.Item|item} objects.
|
5668 |
+
* @event FooGallery.Template~"make-items.foogallery"
|
5669 |
+
* @type {jQuery.Event}
|
5670 |
+
* @param {jQuery.Event} event - The jQuery.Event object for the current event.
|
5671 |
+
* @param {FooGallery.Template} template - The template raising the event.
|
5672 |
+
* @param {(HTMLElement[]|FooGallery.Item~Options[])} items - The array of Nodes or item options.
|
5673 |
+
* @returns {(HTMLElement[]|FooGallery.Item~Options[])} A filtered list of items to make.
|
5674 |
+
* @example {@caption To listen for this event and perform some action when it occurs you would bind to it as follows.}
|
5675 |
+
* $(".foogallery").foogallery({
|
5676 |
+
* on: {
|
5677 |
+
* "make-items.foogallery": function(event, template, items){
|
5678 |
+
* // do something
|
5679 |
+
* }
|
5680 |
+
* }
|
5681 |
+
* });
|
5682 |
+
* @example {@caption Calling the `preventDefault` method on the `event` object will prevent any items being made.}
|
5683 |
+
* $(".foogallery").foogallery({
|
5684 |
+
* on: {
|
5685 |
+
* "make-items.foogallery": function(event, template, items){
|
5686 |
+
* if ("some condition"){
|
5687 |
+
* // stop any items being made
|
5688 |
+
* event.preventDefault();
|
5689 |
+
* }
|
5690 |
+
* }
|
5691 |
+
* }
|
5692 |
+
* });
|
5693 |
+
*/
|
5694 |
+
var e = self.tmpl.raise("make-items", [arr]);
|
5695 |
+
if (!e.isDefaultPrevented()){
|
5696 |
+
made = $.map(arr, function(obj){
|
5697 |
+
var item = _.components.make("item", self.tmpl, _is.hash(obj) ? obj : {});
|
5698 |
+
if (_is.element(obj)){
|
5699 |
+
if (item.parse(obj)){
|
5700 |
+
parsed.push(item);
|
5701 |
+
return item;
|
5702 |
+
}
|
5703 |
+
return null;
|
5704 |
+
}
|
5705 |
+
return item;
|
5706 |
+
});
|
5707 |
+
}
|
5708 |
+
|
5709 |
+
/**
|
5710 |
+
* @summary Raised after the template has made an array of {@link FooGallery.Item|item} objects.
|
5711 |
+
* @event FooGallery.Template~"made-items.foogallery"
|
5712 |
+
* @type {jQuery.Event}
|
5713 |
+
* @param {jQuery.Event} event - The jQuery.Event object for the current event.
|
5714 |
+
* @param {FooGallery.Template} template - The template raising the event.
|
5715 |
+
* @param {FooGallery.Item[]} items - The array of items made, this includes parsed items.
|
5716 |
+
* @example {@caption To listen for this event and perform some action when it occurs you would bind to it as follows.}
|
5717 |
+
* $(".foogallery").foogallery({
|
5718 |
+
* on: {
|
5719 |
+
* "made-items.foogallery": function(event, template, items){
|
5720 |
+
* // do something
|
5721 |
+
* }
|
5722 |
+
* }
|
5723 |
+
* });
|
5724 |
+
*/
|
5725 |
+
if (made.length > 0) self.tmpl.raise("made-items", [made]);
|
5726 |
+
|
5727 |
+
/**
|
5728 |
+
* @summary Raised after the template has parsed any elements into an array of {@link FooGallery.Item|item} objects.
|
5729 |
+
* @event FooGallery.Template~"parsed-items.foogallery"
|
5730 |
+
* @type {jQuery.Event}
|
5731 |
+
* @param {jQuery.Event} event - The jQuery.Event object for the current event.
|
5732 |
+
* @param {FooGallery.Template} template - The template raising the event.
|
5733 |
+
* @param {FooGallery.Item[]} items - The array of items parsed.
|
5734 |
+
* @example {@caption To listen for this event and perform some action when it occurs you would bind to it as follows.}
|
5735 |
+
* $(".foogallery").foogallery({
|
5736 |
+
* on: {
|
5737 |
+
* "parsed-items.foogallery": function(event, template, items){
|
5738 |
+
* // do something
|
5739 |
+
* }
|
5740 |
+
* }
|
5741 |
+
* });
|
5742 |
+
*/
|
5743 |
+
if (parsed.length > 0) self.tmpl.raise("parsed-items", [parsed]);
|
5744 |
+
}
|
5745 |
+
return made;
|
5746 |
+
},
|
5747 |
+
/**
|
5748 |
+
* @summary Create each of the supplied {@link FooGallery.Item|`items`} elements.
|
5749 |
+
* @memberof FooGallery.Items#
|
5750 |
+
* @function create
|
5751 |
+
* @param {FooGallery.Item[]} items - The array of items to create.
|
5752 |
+
* @param {boolean} [append=false] - Whether or not to automatically append the item after it is created.
|
5753 |
+
* @returns {FooGallery.Item[]} The array of items that were created or if `append` is `true` the array of items that were appended.
|
5754 |
+
* @description This will only create and/or append items that are not already created and/or appended so it is safe to call without worrying about the items' pre-existing state.
|
5755 |
+
* @fires FooGallery.Template~"create-items.foogallery"
|
5756 |
+
* @fires FooGallery.Template~"created-items.foogallery"
|
5757 |
+
* @fires FooGallery.Template~"append-items.foogallery"
|
5758 |
+
* @fires FooGallery.Template~"appended-items.foogallery"
|
5759 |
+
*/
|
5760 |
+
create: function(items, append){
|
5761 |
+
var self = this, created = [], creatable = self.creatable(items);
|
5762 |
+
if (creatable.length > 0) {
|
5763 |
+
/**
|
5764 |
+
* @summary Raised before the template creates the `items` elements.
|
5765 |
+
* @event FooGallery.Template~"create-items.foogallery"
|
5766 |
+
* @type {jQuery.Event}
|
5767 |
+
* @param {jQuery.Event} event - The jQuery.Event object for the current event.
|
5768 |
+
* @param {FooGallery.Template} template - The template raising the event.
|
5769 |
+
* @param {FooGallery.Item[]} items - The array of items to create.
|
5770 |
+
* @param {boolean} [append=false] - Whether or not to automatically append the item after it is created.
|
5771 |
+
* @example {@caption To listen for this event and perform some action when it occurs you would bind to it as follows.}
|
5772 |
+
* $(".foogallery").foogallery({
|
5773 |
+
* on: {
|
5774 |
+
* "create-items.foogallery": function(event, template, items){
|
5775 |
+
* // do something
|
5776 |
+
* }
|
5777 |
+
* }
|
5778 |
+
* });
|
5779 |
+
* @example {@caption Calling the `preventDefault` method on the `event` object will prevent any items being created.}
|
5780 |
+
* $(".foogallery").foogallery({
|
5781 |
+
* on: {
|
5782 |
+
* "create-items.foogallery": function(event, template, items){
|
5783 |
+
* if ("some condition"){
|
5784 |
+
* // stop any items being created
|
5785 |
+
* event.preventDefault();
|
5786 |
+
* }
|
5787 |
+
* }
|
5788 |
+
* }
|
5789 |
+
* });
|
5790 |
+
*/
|
5791 |
+
var e = self.tmpl.raise("create-items", [creatable]);
|
5792 |
+
if (!e.isDefaultPrevented()){
|
5793 |
+
created = $.map(creatable, function(item){
|
5794 |
+
return item.create() ? item : null;
|
5795 |
+
});
|
5796 |
+
}
|
5797 |
+
/**
|
5798 |
+
* @summary Raised after the template has created the `items` elements.
|
5799 |
+
* @event FooGallery.Template~"created-items.foogallery"
|
5800 |
+
* @type {jQuery.Event}
|
5801 |
+
* @param {jQuery.Event} event - The jQuery.Event object for the current event.
|
5802 |
+
* @param {FooGallery.Template} template - The template raising the event.
|
5803 |
+
* @param {FooGallery.Item[]} items - The array of items created.
|
5804 |
+
* @example {@caption To listen for this event and perform some action when it occurs you would bind to it as follows.}
|
5805 |
+
* $(".foogallery").foogallery({
|
5806 |
+
* on: {
|
5807 |
+
* "created-items.foogallery": function(event, template, items){
|
5808 |
+
* // do something
|
5809 |
+
* }
|
5810 |
+
* }
|
5811 |
+
* });
|
5812 |
+
*/
|
5813 |
+
if (created.length > 0) self.tmpl.raise("created-items", [created]);
|
5814 |
+
}
|
5815 |
+
if (_is.boolean(append) ? append : false) return self.append(items);
|
5816 |
+
return created;
|
5817 |
+
},
|
5818 |
+
/**
|
5819 |
+
* @summary Append each of the supplied {@link FooGallery.Item|`items`} to the template.
|
5820 |
+
* @memberof FooGallery.Items#
|
5821 |
+
* @function append
|
5822 |
+
* @param {FooGallery.Item[]} items - The array of items to append.
|
5823 |
+
* @returns {FooGallery.Item[]} The array of items that were appended.
|
5824 |
+
* @fires FooGallery.Template~"append-items.foogallery"
|
5825 |
+
* @fires FooGallery.Template~"appended-items.foogallery"
|
5826 |
+
*/
|
5827 |
+
append: function(items){
|
5828 |
+
var self = this, appended = [], appendable = self.appendable(items);
|
5829 |
+
if (appendable.length > 0) {
|
5830 |
+
/**
|
5831 |
+
* @summary Raised before the template appends any items to itself.
|
5832 |
+
* @event FooGallery.Template~"append-items.foogallery"
|
5833 |
+
* @type {jQuery.Event}
|
5834 |
+
* @param {jQuery.Event} event - The jQuery.Event object for the current event.
|
5835 |
+
* @param {FooGallery.Template} template - The template raising the event.
|
5836 |
+
* @param {FooGallery.Item[]} items - The array of items to append.
|
5837 |
+
* @example {@caption To listen for this event and perform some action when it occurs you would bind to it as follows.}
|
5838 |
+
* $(".foogallery").foogallery({
|
5839 |
+
* on: {
|
5840 |
+
* "append-items.foogallery": function(event, template, items){
|
5841 |
+
* // do something
|
5842 |
+
* }
|
5843 |
+
* }
|
5844 |
+
* });
|
5845 |
+
* @example {@caption Calling the `preventDefault` method on the `event` object will prevent any items being appended.}
|
5846 |
+
* $(".foogallery").foogallery({
|
5847 |
+
* on: {
|
5848 |
+
* "append-items.foogallery": function(event, template, items){
|
5849 |
+
* if ("some condition"){
|
5850 |
+
* // stop any items being appended
|
5851 |
+
* event.preventDefault();
|
5852 |
+
* }
|
5853 |
+
* }
|
5854 |
+
* }
|
5855 |
+
* });
|
5856 |
+
*/
|
5857 |
+
var e = self.tmpl.raise("append-items", [appendable]);
|
5858 |
+
if (!e.isDefaultPrevented()){
|
5859 |
+
appended = $.map(appendable, function(item){
|
5860 |
+
return item.append() ? item : null;
|
5861 |
+
});
|
5862 |
+
}
|
5863 |
+
/**
|
5864 |
+
* @summary Raised after the template has appended items to itself.
|
5865 |
+
* @event FooGallery.Template~"appended-items.foogallery"
|
5866 |
+
* @type {jQuery.Event}
|
5867 |
+
* @param {jQuery.Event} event - The jQuery.Event object for the current event.
|
5868 |
+
* @param {FooGallery.Template} template - The template raising the event.
|
5869 |
+
* @param {FooGallery.Item[]} items - The array of items appended.
|
5870 |
+
* @example {@caption To listen for this event and perform some action when it occurs you would bind to it as follows.}
|
5871 |
+
* $(".foogallery").foogallery({
|
5872 |
+
* on: {
|
5873 |
+
* "appended-items.foogallery": function(event, template, items){
|
5874 |
+
* // do something
|
5875 |
+
* }
|
5876 |
+
* }
|
5877 |
+
* });
|
5878 |
+
*/
|
5879 |
+
if (appended.length > 0) self.tmpl.raise("appended-items", [appended]);
|
5880 |
+
}
|
5881 |
+
return appended;
|
5882 |
+
},
|
5883 |
+
/**
|
5884 |
+
* @summary Detach each of the supplied {@link FooGallery.Item|`items`} from the template.
|
5885 |
+
* @memberof FooGallery.Items#
|
5886 |
+
* @function detach
|
5887 |
+
* @param {FooGallery.Item[]} items - The array of items to detach.
|
5888 |
+
* @returns {FooGallery.Item[]} The array of items that were detached.
|
5889 |
+
* @fires FooGallery.Template~"detach-items.foogallery"
|
5890 |
+
* @fires FooGallery.Template~"detached-items.foogallery"
|
5891 |
+
*/
|
5892 |
+
detach: function(items){
|
5893 |
+
var self = this, detached = [], detachable = self.detachable(items);
|
5894 |
+
if (detachable.length > 0) {
|
5895 |
+
/**
|
5896 |
+
* @summary Raised before the template detaches any items from itself.
|
5897 |
+
* @event FooGallery.Template~"detach-items.foogallery"
|
5898 |
+
* @type {jQuery.Event}
|
5899 |
+
* @param {jQuery.Event} event - The jQuery.Event object for the current event.
|
5900 |
+
* @param {FooGallery.Template} template - The template raising the event.
|
5901 |
+
* @param {FooGallery.Item[]} items - The array of items to detach.
|
5902 |
+
* @example {@caption To listen for this event and perform some action when it occurs you would bind to it as follows.}
|
5903 |
+
* $(".foogallery").foogallery({
|
5904 |
+
* on: {
|
5905 |
+
* "detach-items.foogallery": function(event, template, items){
|
5906 |
+
* // do something
|
5907 |
+
* }
|
5908 |
+
* }
|
5909 |
+
* });
|
5910 |
+
* @example {@caption Calling the `preventDefault` method on the `event` object will prevent any items being detached.}
|
5911 |
+
* $(".foogallery").foogallery({
|
5912 |
+
* on: {
|
5913 |
+
* "detach-items.foogallery": function(event, template, items){
|
5914 |
+
* if ("some condition"){
|
5915 |
+
* // stop any items being detached
|
5916 |
+
* event.preventDefault();
|
5917 |
+
* }
|
5918 |
+
* }
|
5919 |
+
* }
|
5920 |
+
* });
|
5921 |
+
*/
|
5922 |
+
var e = self.tmpl.raise("detach-items", [detachable]);
|
5923 |
+
if (!e.isDefaultPrevented()){
|
5924 |
+
detached = $.map(detachable, function(item){
|
5925 |
+
return item.detach() ? item : null;
|
5926 |
+
});
|
5927 |
+
}
|
5928 |
+
/**
|
5929 |
+
* @summary Raised after the template has detached items from itself.
|
5930 |
+
* @event FooGallery.Template~"detached-items.foogallery"
|
5931 |
+
* @type {jQuery.Event}
|
5932 |
+
* @param {jQuery.Event} event - The jQuery.Event object for the current event.
|
5933 |
+
* @param {FooGallery.Template} template - The template raising the event.
|
5934 |
+
* @param {FooGallery.Item[]} items - The array of items detached.
|
5935 |
+
* @example {@caption To listen for this event and perform some action when it occurs you would bind to it as follows.}
|
5936 |
+
* $(".foogallery").foogallery({
|
5937 |
+
* on: {
|
5938 |
+
* "detached-items.foogallery": function(event, template, items){
|
5939 |
+
* // do something
|
5940 |
+
* }
|
5941 |
+
* }
|
5942 |
+
* });
|
5943 |
+
*/
|
5944 |
+
if (detached.length > 0) self.tmpl.raise("detached-items", [detached]);
|
5945 |
+
}
|
5946 |
+
return detached;
|
5947 |
+
},
|
5948 |
+
/**
|
5949 |
+
* @summary Load each of the supplied `items` images.
|
5950 |
+
* @memberof FooGallery.Items#
|
5951 |
+
* @function load
|
5952 |
+
* @param {FooGallery.Item[]} items - The array of items to load.
|
5953 |
+
* @returns {Promise<FooGallery.Item[]>} Resolved with an array of {@link FooGallery.Item|items} as the first argument. If no items are loaded this array is empty.
|
5954 |
+
* @fires FooGallery.Template~"load-items.foogallery"
|
5955 |
+
* @fires FooGallery.Template~"loaded-items.foogallery"
|
5956 |
+
*/
|
5957 |
+
load: function(items){
|
5958 |
+
var self = this;
|
5959 |
+
items = self.loadable(items);
|
5960 |
+
if (items.length > 0){
|
5961 |
+
/**
|
5962 |
+
* @summary Raised before the template loads any items.
|
5963 |
+
* @event FooGallery.Template~"load-items.foogallery"
|
5964 |
+
* @type {jQuery.Event}
|
5965 |
+
* @param {jQuery.Event} event - The jQuery.Event object for the current event.
|
5966 |
+
* @param {FooGallery.Template} template - The template raising the event.
|
5967 |
+
* @param {FooGallery.Item[]} items - The array of items to load.
|
5968 |
+
* @example {@caption To listen for this event and perform some action when it occurs you would bind to it as follows.}
|
5969 |
+
* $(".foogallery").foogallery({
|
5970 |
+
* on: {
|
5971 |
+
* "load-items.foogallery": function(event, template, items){
|
5972 |
+
* // do something
|
5973 |
+
* }
|
5974 |
+
* }
|
5975 |
+
* });
|
5976 |
+
* @example {@caption Calling the `preventDefault` method on the `event` object will prevent any `items` being loaded.}
|
5977 |
+
* $(".foogallery").foogallery({
|
5978 |
+
* on: {
|
5979 |
+
* "load-items.foogallery": function(event, template, items){
|
5980 |
+
* if ("some condition"){
|
5981 |
+
* // stop any items being loaded
|
5982 |
+
* event.preventDefault();
|
5983 |
+
* }
|
5984 |
+
* }
|
5985 |
+
* }
|
5986 |
+
* });
|
5987 |
+
*/
|
5988 |
+
var e = self.tmpl.raise("load-items", [items]);
|
5989 |
+
if (!e.isDefaultPrevented()){
|
5990 |
+
var loading = $.map(items, function(item){
|
5991 |
+
return item.load();
|
5992 |
+
});
|
5993 |
+
return _fn.when(loading).done(function(loaded) {
|
5994 |
+
/**
|
5995 |
+
* @summary Raised after the template has loaded items.
|
5996 |
+
* @event FooGallery.Template~"loaded-items.foogallery"
|
5997 |
+
* @type {jQuery.Event}
|
5998 |
+
* @param {jQuery.Event} event - The jQuery.Event object for the current event.
|
5999 |
+
* @param {FooGallery.Template} template - The template raising the event.
|
6000 |
+
* @param {FooGallery.Item[]} items - The array of items that were loaded.
|
6001 |
+
* @example {@caption To listen for this event and perform some action when it occurs you would bind to it as follows.}
|
6002 |
+
* $(".foogallery").foogallery({
|
6003 |
+
* on: {
|
6004 |
+
* "loaded-items.foogallery": function(event, template, items){
|
6005 |
+
* // do something
|
6006 |
+
* }
|
6007 |
+
* }
|
6008 |
+
* });
|
6009 |
+
*/
|
6010 |
+
self.tmpl.raise("loaded-items", [loaded]);
|
6011 |
+
});
|
6012 |
+
}
|
6013 |
+
}
|
6014 |
+
return _fn.resolveWith([]);
|
6015 |
+
},
|
6016 |
+
createIdMap: function(items){
|
6017 |
+
var map = {};
|
6018 |
+
$.each(items, function(i, item){
|
6019 |
+
if (_is.empty(item.id)) item.id = "" + (i + 1);
|
6020 |
+
map[item.id] = item;
|
6021 |
+
});
|
6022 |
+
return map;
|
6023 |
+
}
|
6024 |
+
});
|
6025 |
+
|
6026 |
+
_.components.register("items", _.Items);
|
6027 |
+
|
6028 |
+
})(
|
6029 |
+
FooGallery.$,
|
6030 |
+
FooGallery,
|
6031 |
+
FooGallery.utils,
|
6032 |
+
FooGallery.utils.is,
|
6033 |
+
FooGallery.utils.fn,
|
6034 |
+
FooGallery.utils.str
|
6035 |
+
);
|
6036 |
+
(function($, _, _utils, _is){
|
6037 |
+
|
6038 |
+
_.Paging = _.Component.extend({
|
6039 |
+
construct: function(template){
|
6040 |
+
var self = this;
|
6041 |
+
/**
|
6042 |
+
* @ignore
|
6043 |
+
* @memberof FooGallery.Paging#
|
6044 |
+
* @function _super
|
6045 |
+
*/
|
6046 |
+
self._super(template);
|
6047 |
+
self.opt = self.tmpl.opt.paging;
|
6048 |
+
self.cls = self.tmpl.cls.paging;
|
6049 |
+
self.il8n = self.tmpl.il8n.paging;
|
6050 |
+
self.sel = self.tmpl.sel.paging;
|
6051 |
+
self.pushOrReplace = self.opt.pushOrReplace;
|
6052 |
+
self.type = self.opt.type;
|
6053 |
+
self.theme = self.opt.theme;
|
6054 |
+
self.size = self.opt.size;
|
6055 |
+
self.position = self.opt.position;
|
6056 |
+
self.scrollToTop = self.opt.scrollToTop;
|
6057 |
+
self.current = 0;
|
6058 |
+
self.total = 0;
|
6059 |
+
self.ctrls = [];
|
6060 |
+
self._arr = [];
|
6061 |
+
},
|
6062 |
+
destroy: function(){
|
6063 |
+
var self = this;
|
6064 |
+
self._arr.splice(0, self._arr.length);
|
6065 |
+
$.each(self.ctrls.splice(0, self.ctrls.length), function(i, control){
|
6066 |
+
control.destroy();
|
6067 |
+
});
|
6068 |
+
self._super();
|
6069 |
+
},
|
6070 |
+
build: function(){
|
6071 |
+
var self = this, items = self.tmpl.items.available();
|
6072 |
+
self.total = self.size > 0 && items.length > 0 ? Math.ceil(items.length / self.size) : 1;
|
6073 |
+
if (self.total <= 1){
|
6074 |
+
self._arr.push(items);
|
6075 |
+
self.tmpl.items.detach(self._arr[0]);
|
6076 |
+
} else {
|
6077 |
+
for (var i = 0; i < self.total; i++){
|
6078 |
+
self._arr.push(items.splice(0, self.size));
|
6079 |
+
self.tmpl.items.detach(self._arr[i]);
|
6080 |
+
}
|
6081 |
+
}
|
6082 |
+
if (self.total > 1 && _.paging.hasCtrl(self.type)){
|
6083 |
+
var pos = self.position, top, bottom;
|
6084 |
+
if (pos === "both" || pos === "top"){
|
6085 |
+
top = _.paging.makeCtrl(self.type, self.tmpl, self, "top");
|
6086 |
+
if (top.create()){
|
6087 |
+
top.append();
|
6088 |
+
self.ctrls.push(top);
|
6089 |
+
}
|
6090 |
+
}
|
6091 |
+
if (pos === "both" || pos === "bottom"){
|
6092 |
+
bottom = _.paging.makeCtrl(self.type, self.tmpl, self, "bottom");
|
6093 |
+
if (bottom.create()){
|
6094 |
+
bottom.append();
|
6095 |
+
self.ctrls.push(bottom);
|
6096 |
+
}
|
6097 |
+
}
|
6098 |
+
}
|
6099 |
+
},
|
6100 |
+
rebuild: function(){
|
6101 |
+
var self = this;
|
6102 |
+
self.current = 0;
|
6103 |
+
self.total = 0;
|
6104 |
+
self._arr.splice(0, self._arr.length);
|
6105 |
+
$.each(self.ctrls.splice(0, self.ctrls.length), function(i, control){
|
6106 |
+
control.destroy();
|
6107 |
+
});
|
6108 |
+
self.build();
|
6109 |
+
},
|
6110 |
+
all: function(){
|
6111 |
+
return this._arr.slice();
|
6112 |
+
},
|
6113 |
+
available: function(){
|
6114 |
+
return this.get(this.current);
|
6115 |
+
},
|
6116 |
+
controls: function(pageNumber){
|
6117 |
+
var self = this;
|
6118 |
+
if (self.isValid(pageNumber)){
|
6119 |
+
$.each(self.ctrls, function(i, control){
|
6120 |
+
control.update(pageNumber);
|
6121 |
+
});
|
6122 |
+
}
|
6123 |
+
},
|
6124 |
+
isValid: function(pageNumber){
|
6125 |
+
return _is.number(pageNumber) && pageNumber > 0 && pageNumber <= this.total;
|
6126 |
+
},
|
6127 |
+
number: function(value){
|
6128 |
+
return this.isValid(value) ? value : (this.current === 0 ? 1 : this.current);
|
6129 |
+
},
|
6130 |
+
create: function(pageNumber){
|
6131 |
+
var self = this;
|
6132 |
+
pageNumber = self.number(pageNumber);
|
6133 |
+
var index = pageNumber - 1;
|
6134 |
+
self.tmpl.items.create(self._arr[index], true);
|
6135 |
+
for (var i = 0, l = self._arr.length; i < l; i++) {
|
6136 |
+
if (i === index) continue;
|
6137 |
+
self.tmpl.items.detach(self._arr[i]);
|
6138 |
+
}
|
6139 |
+
self.current = pageNumber;
|
6140 |
+
},
|
6141 |
+
get: function(pageNumber){
|
6142 |
+
var self = this;
|
6143 |
+
if (self.isValid(pageNumber)){
|
6144 |
+
pageNumber = self.number(pageNumber);
|
6145 |
+
return self._arr[pageNumber - 1];
|
6146 |
+
}
|
6147 |
+
return [];
|
6148 |
+
},
|
6149 |
+
set: function(pageNumber, scroll, updateState){
|
6150 |
+
var self = this;
|
6151 |
+
if (self.isValid(pageNumber)){
|
6152 |
+
self.controls(pageNumber);
|
6153 |
+
var num = self.number(pageNumber), state;
|
6154 |
+
if (num !== self.current) {
|
6155 |
+
var prev = self.current, setPage = function(){
|
6156 |
+
updateState = _is.boolean(updateState) ? updateState : true;
|
6157 |
+
if (updateState && self.current === 1 && !self.tmpl.state.exists()){
|
6158 |
+
state = self.tmpl.state.get();
|
6159 |
+
self.tmpl.state.update(state, self.pushOrReplace);
|
6160 |
+
}
|
6161 |
+
self.create(num);
|
6162 |
+
if (updateState){
|
6163 |
+
state = self.tmpl.state.get();
|
6164 |
+
self.tmpl.state.update(state, self.pushOrReplace);
|
6165 |
+
}
|
6166 |
+
if (self.scrollToTop && _is.boolean(scroll) ? scroll : false) {
|
6167 |
+
var page = self.get(self.current);
|
6168 |
+
if (page.length > 0){
|
6169 |
+
page[0].scrollTo("top");
|
6170 |
+
}
|
6171 |
+
}
|
6172 |
+
self.tmpl.raise("after-page-change", [self.current, prev]);
|
6173 |
+
};
|
6174 |
+
var e = self.tmpl.raise("before-page-change", [self.current, num, setPage]);
|
6175 |
+
if (e.isDefaultPrevented()) return false;
|
6176 |
+
setPage();
|
6177 |
+
return true;
|
6178 |
+
}
|
6179 |
+
}
|
6180 |
+
return false;
|
6181 |
+
},
|
6182 |
+
find: function(item){
|
6183 |
+
var self = this;
|
6184 |
+
for (var i = 0, l = self._arr.length; i < l; i++) {
|
6185 |
+
if ($.inArray(item, self._arr[i]) !== -1) {
|
6186 |
+
return i + 1;
|
6187 |
+
}
|
6188 |
+
}
|
6189 |
+
return 0;
|
6190 |
+
},
|
6191 |
+
contains: function(pageNumber, item){
|
6192 |
+
var items = this.get(pageNumber);
|
6193 |
+
return $.inArray(item, items) !== -1;
|
6194 |
+
},
|
6195 |
+
first: function(){
|
6196 |
+
this.goto(1);
|
6197 |
+
},
|
6198 |
+
last: function(){
|
6199 |
+
this.goto(this._arr.length);
|
6200 |
+
},
|
6201 |
+
prev: function(){
|
6202 |
+
this.goto(this.current - 1);
|
6203 |
+
},
|
6204 |
+
next: function(){
|
6205 |
+
this.goto(this.current + 1);
|
6206 |
+
},
|
6207 |
+
goto: function(pageNumber){
|
6208 |
+
var self = this;
|
6209 |
+
if (self.set(pageNumber, true)){
|
6210 |
+
self.tmpl.loadAvailable();
|
6211 |
+
}
|
6212 |
+
}
|
6213 |
+
});
|
6214 |
+
|
6215 |
+
_.PagingControl = _.Component.extend({
|
6216 |
+
construct: function(template, parent, position){
|
6217 |
+
var self = this;
|
6218 |
+
self._super(template);
|
6219 |
+
self.pages = parent;
|
6220 |
+
self.position = position;
|
6221 |
+
self.$container = null;
|
6222 |
+
},
|
6223 |
+
create: function(){
|
6224 |
+
var self = this;
|
6225 |
+
self.$container = $("<nav/>", {"class": self.pages.cls.container}).addClass(self.pages.theme);
|
6226 |
+
return true;
|
6227 |
+
},
|
6228 |
+
destroy: function(){
|
6229 |
+
var self = this;
|
6230 |
+
self.$container.remove();
|
6231 |
+
self.$container = null;
|
6232 |
+
},
|
6233 |
+
append: function(){
|
6234 |
+
var self = this;
|
6235 |
+
if (self.position === "top"){
|
6236 |
+
self.$container.insertBefore(self.tmpl.$el);
|
6237 |
+
} else {
|
6238 |
+
self.$container.insertAfter(self.tmpl.$el);
|
6239 |
+
}
|
6240 |
+
},
|
6241 |
+
update: function(pageNumber){}
|
6242 |
+
});
|
6243 |
+
|
6244 |
+
_.paging.register("default", _.Paging, null, {
|
6245 |
+
type: "none",
|
6246 |
+
theme: "fg-light",
|
6247 |
+
size: 30,
|
6248 |
+
pushOrReplace: "push",
|
6249 |
+
position: "none",
|
6250 |
+
scrollToTop: true
|
6251 |
+
}, {
|
6252 |
+
container: "fg-paging-container"
|
6253 |
+
}, null, -100);
|
6254 |
+
|
6255 |
+
})(
|
6256 |
+
FooGallery.$,
|
6257 |
+
FooGallery,
|
6258 |
+
FooGallery.utils,
|
6259 |
+
FooGallery.utils.is
|
6260 |
+
);
|
6261 |
+
(function($, _, _utils, _is){
|
6262 |
+
|
6263 |
+
_.Dots = _.Paging.extend({});
|
6264 |
+
|
6265 |
+
_.DotsControl = _.PagingControl.extend({
|
6266 |
+
construct: function(template, parent, position){
|
6267 |
+
this._super(template, parent, position);
|
6268 |
+
this.$container = $();
|
6269 |
+
this.$list = $();
|
6270 |
+
this.$items = $();
|
6271 |
+
},
|
6272 |
+
create: function(){
|
6273 |
+
var self = this, cls = self.pages.cls, il8n = self.pages.il8n,
|
6274 |
+
items = [], $list = $("<ul/>", {"class": cls.list});
|
6275 |
+
|
6276 |
+
for (var i = 0, l = self.pages.total, $item; i < l; i++){
|
6277 |
+
items.push($item = self.createItem(i + 1, il8n.page));
|
6278 |
+
$list.append($item);
|
6279 |
+
}
|
6280 |
+
self.$list = $list;
|
6281 |
+
self.$container = $("<nav/>", {"class": cls.container}).addClass(self.pages.theme).append($list);
|
6282 |
+
self.$items = $($.map(items, function($item){ return $item.get(); }));
|
6283 |
+
return true;
|
6284 |
+
},
|
6285 |
+
append: function(){
|
6286 |
+
var self = this;
|
6287 |
+
if (self.position === "top"){
|
6288 |
+
self.$container.insertBefore(self.tmpl.$el);
|
6289 |
+
} else {
|
6290 |
+
self.$container.insertAfter(self.tmpl.$el);
|
6291 |
+
}
|
6292 |
+
},
|
6293 |
+
destroy: function(){
|
6294 |
+
var self = this, sel = self.pages.sel;
|
6295 |
+
self.$list.find(sel.link).off("click.foogallery", self.onLinkClick);
|
6296 |
+
self.$container.remove();
|
6297 |
+
self.$container = $();
|
6298 |
+
self.$list = $();
|
6299 |
+
self.$items = $();
|
6300 |
+
},
|
6301 |
+
update: function(pageNumber){
|
6302 |
+
this.setSelected(pageNumber - 1);
|
6303 |
+
},
|
6304 |
+
setSelected: function(index){
|
6305 |
+
var self = this, cls = self.pages.cls, il8n = self.pages.il8n, sel = self.pages.sel;
|
6306 |
+
// first find any previous selected items and deselect them
|
6307 |
+
self.$items.filter(sel.selected).removeClass(cls.selected).each(function (i, el) {
|
6308 |
+
// we need to revert the original items screen-reader text if it existed as being selected sets it to the value of the labels.current option
|
6309 |
+
var $item = $(el), label = $item.data("label"), $sr = $item.find(sel.reader);
|
6310 |
+
// if we have an original value and a screen-reader element then update it
|
6311 |
+
if (_is.string(label) && $sr.length !== 0) {
|
6312 |
+
$sr.html(label);
|
6313 |
+
}
|
6314 |
+
});
|
6315 |
+
// next find the newly selected item and set it as selected
|
6316 |
+
self.$items.eq(index).addClass(cls.selected).each(function (i, el) {
|
6317 |
+
// we need to update the items screen-reader text to appropriately show it as selected using the value of the labels.current option
|
6318 |
+
var $item = $(el), $sr = $item.find(sel.reader), label = $sr.html();
|
6319 |
+
// if we have a current label to backup and a screen-reader element then update it
|
6320 |
+
if (_is.string(label) && $sr.length !== 0) {
|
6321 |
+
// store the original screen-reader text so we can revert it later
|
6322 |
+
$item.data("label", label);
|
6323 |
+
$sr.html(il8n.current);
|
6324 |
+
}
|
6325 |
+
});
|
6326 |
+
},
|
6327 |
+
/**
|
6328 |
+
* @summary Create and return a jQuery object containing a single `li` and its' link.
|
6329 |
+
* @memberof FooGallery.DotsControl#
|
6330 |
+
* @function createItem
|
6331 |
+
* @param {(number|string)} pageNumber - The page number for the item.
|
6332 |
+
* @param {string} [label=""] - The label that is displayed when hovering over an item.
|
6333 |
+
* @param {string} [text=""] - The text to display for the item, if not supplied this defaults to the `pageNumber` value.
|
6334 |
+
* @param {string} [classNames=""] - A space separated list of CSS class names to apply to the item.
|
6335 |
+
* @param {string} [sr=""] - The text to use for screen readers, if not supplied this defaults to the `label` value.
|
6336 |
+
* @returns {jQuery}
|
6337 |
+
*/
|
6338 |
+
createItem: function(pageNumber, label, text, classNames, sr){
|
6339 |
+
text = _is.string(text) ? text : pageNumber;
|
6340 |
+
label = _is.string(label) ? label : "";
|
6341 |
+
var self = this, opt = self.pages.opt, cls = self.pages.cls;
|
6342 |
+
var $link = $("<a/>", {"class": cls.link, "href": "#page-" + pageNumber}).html(text).on("click.foogallery", {self: self, page: pageNumber}, self.onLinkClick);
|
6343 |
+
if (!_is.empty(label)){
|
6344 |
+
$link.attr("title", label.replace(/\{PAGE}/g, pageNumber).replace(/\{LIMIT}/g, opt.limit + ""));
|
6345 |
+
}
|
6346 |
+
sr = _is.string(sr) ? sr : label;
|
6347 |
+
if (!_is.empty(sr)){
|
6348 |
+
$link.prepend($("<span/>", {"class":cls.reader, text: sr.replace(/\{PAGE}/g, "").replace(/\{LIMIT}/g, opt.limit + "")}));
|
6349 |
+
}
|
6350 |
+
var $item = $("<li/>", {"class": cls.item}).append($link);
|
6351 |
+
classNames = _is.string(classNames) ? classNames : "";
|
6352 |
+
if (!_is.empty(classNames)){
|
6353 |
+
$item.addClass(classNames);
|
6354 |
+
}
|
6355 |
+
return $item;
|
6356 |
+
},
|
6357 |
+
/**
|
6358 |
+
* @summary Handles the click event of the dots links.
|
6359 |
+
* @memberof FooGallery.DotsControl#
|
6360 |
+
* @function onLinkClick
|
6361 |
+
* @param {jQuery.Event} e - The jQuery.Event object for the click event.
|
6362 |
+
* @private
|
6363 |
+
*/
|
6364 |
+
onLinkClick: function(e){
|
6365 |
+
e.preventDefault();
|
6366 |
+
var self = e.data.self, page = e.data.page, sel = self.pages.sel;
|
6367 |
+
// this check should not be required as we use the CSS pointer-events: none; property on disabled links but just in case test for the class here
|
6368 |
+
if (!$(this).closest(sel.item).is(sel.disabled)){
|
6369 |
+
self.pages.set(page, true);
|
6370 |
+
self.tmpl.loadAvailable();
|
6371 |
+
}
|
6372 |
+
}
|
6373 |
+
});
|
6374 |
+
|
6375 |
+
_.paging.register("dots", _.Dots, _.DotsControl, {
|
6376 |
+
type: "dots",
|
6377 |
+
position: "both",
|
6378 |
+
pushOrReplace: "push"
|
6379 |
+
}, {
|
6380 |
+
list: "fg-dots",
|
6381 |
+
item: "fg-dot-item",
|
6382 |
+
link: "fg-dot-link",
|
6383 |
+
disabled: "fg-disabled",
|
6384 |
+
selected: "fg-selected",
|
6385 |
+
visible: "fg-visible",
|
6386 |
+
reader: "fg-sr-only"
|
6387 |
+
}, {
|
6388 |
+
current: "Current page",
|
6389 |
+
page: "Page {PAGE}"
|
6390 |
+
});
|
6391 |
+
|
6392 |
+
})(
|
6393 |
+
FooGallery.$,
|
6394 |
+
FooGallery,
|
6395 |
+
FooGallery.utils,
|
6396 |
+
FooGallery.utils.is
|
6397 |
+
);
|
6398 |
+
(function($, _, _utils){
|
6399 |
+
|
6400 |
+
_.DefaultTemplate = _.Template.extend({});
|
6401 |
+
|
6402 |
+
_.template.register("default", _.DefaultTemplate, null, {
|
6403 |
+
container: "foogallery fg-default"
|
6404 |
+
});
|
6405 |
+
|
6406 |
+
})(
|
6407 |
+
FooGallery.$,
|
6408 |
+
FooGallery,
|
6409 |
+
FooGallery.utils
|
6410 |
+
);
|
6411 |
+
(function($, _, _utils, _is){
|
6412 |
+
|
6413 |
+
/**
|
6414 |
+
* @summary The Masonry template for FooGallery.
|
6415 |
+
* @memberof FooGallery
|
6416 |
+
* @constructs MasonryTemplate
|
6417 |
+
* @param {FooGallery.MasonryTemplate~Options} [options] - The options for the template.
|
6418 |
+
* @param {(jQuery|HTMLElement)} [element] - The jQuery object or HTMLElement of the template. If not supplied one will be created within the `parent` element supplied to the {@link FooGallery.Template#initialize|initialize} method.
|
6419 |
+
* @augments FooGallery.Template
|
6420 |
+
* @borrows FooGallery.utils.Class.extend as extend
|
6421 |
+
* @borrows FooGallery.utils.Class.override as override
|
6422 |
+
* @description This template makes use of the popular [Masonry library](http://masonry.desandro.com/) to perform its layout. It supports two basic layout types, fixed and column based.
|
6423 |
+
* @example {@caption The below shows the simplest way to create a Masonry gallery using this template, by simply initializing it on pre-existing elements.}{@lang html}
|
6424 |
+
* <!-- The container element for the template -->
|
6425 |
+
* <div id="gallery-1" class="foogallery fg-masonry">
|
6426 |
+
* <!-- Used by the masonry to handle responsive sizing -->
|
6427 |
+
* <div class="fg-column-width"></div>
|
6428 |
+
* <div class="fg-gutter-width"></div>
|
6429 |
+
* <!-- A single item -->
|
6430 |
+
* <div class="fg-item" data-id="[item.id]">
|
6431 |
+
* <div class="fg-item-inner">
|
6432 |
+
* <a class="fg-thumb" href="[item.href]">
|
6433 |
+
* <img class="fg-image" width="[item.width]" height="[item.height]"
|
6434 |
+
* title="[item.title]" alt="[item.description]"
|
6435 |
+
* data-src="[item.src]"
|
6436 |
+
* data-srcset="[item.srcset]" />
|
6437 |
+
* <!-- Optional caption markup -->
|
6438 |
+
* <div class="fg-caption">
|
6439 |
+
* <div class="fg-caption-inner">
|
6440 |
+
* <div class="fg-caption-title">[item.title]</div>
|
6441 |
+
* <div class="fg-caption-desc">[item.description]</div>
|
6442 |
+
* </div>
|
6443 |
+
* </div>
|
6444 |
+
* </a>
|
6445 |
+
* </div>
|
6446 |
+
* </div>
|
6447 |
+
* <!-- Any number of additional items -->
|
6448 |
+
* </div>
|
6449 |
+
* <script>
|
6450 |
+
* jQuery(function($){
|
6451 |
+
* $("#gallery-1").foogallery();
|
6452 |
+
* });
|
6453 |
+
* </script>
|
6454 |
+
* @example {@caption Options can be supplied directly to the `.foogallery()` method or by supplying them using the `data-foogallery` attribute. If supplied using the attribute the value must follow [valid JSON syntax](http://en.wikipedia.org/wiki/JSON#Data_types.2C_syntax_and_example) including quoted property names.}{@lang html}
|
6455 |
+
* <!-- Supplying the options using the attribute -->
|
6456 |
+
* <div id="gallery-1" class="foogallery fg-masonry" data-foogallery='{"lazy": true, "template": {"layout": "col4"}}'>
|
6457 |
+
* <!-- Snip -->
|
6458 |
+
* </div>
|
6459 |
+
* <script>
|
6460 |
+
* jQuery(function($){
|
6461 |
+
* // Supply the options directly to the method
|
6462 |
+
* $("#gallery-1").foogallery({
|
6463 |
+
* lazy: true,
|
6464 |
+
* template: {
|
6465 |
+
* layout: "col4"
|
6466 |
+
* }
|
6467 |
+
* });
|
6468 |
+
* });
|
6469 |
+
* </script>
|
6470 |
+
* @example {@caption If required the templates container element can be created from just options however a parent element must be supplied to the `initialize` method. The created gallery container is appended to the supplied parent. When creating galleries this way all items must be supplied using the `items` option.}{@lang html}
|
6471 |
+
* <div id="gallery-parent"></div>
|
6472 |
+
* <script>
|
6473 |
+
* jQuery(function($){
|
6474 |
+
* // Create the template using just options
|
6475 |
+
* var tmpl = FooGallery.template.make({
|
6476 |
+
* type: "masonry", // required when creating from options
|
6477 |
+
* lazy: true,
|
6478 |
+
* template: {
|
6479 |
+
* layout: "col4"
|
6480 |
+
* },
|
6481 |
+
* items: [{
|
6482 |
+
* id: "item-1",
|
6483 |
+
* href: "https://url-to-your/full-image.jpg",
|
6484 |
+
* src: "https://url-to-your/thumb-image.jpg",
|
6485 |
+
* width: 250,
|
6486 |
+
* height: 300,
|
6487 |
+
* srcset: "https://url-to-your/thumb-image@2x.jpg 500w,https://url-to-your/thumb-image@3x.jpg 750w",
|
6488 |
+
* title: "Short Item Title",
|
6489 |
+
* description: "Longer item description but still fairly brief."
|
6490 |
+
* },{
|
6491 |
+
* // Any number of additional items
|
6492 |
+
* }]
|
6493 |
+
* });
|
6494 |
+
* // Supply the parent element to the initialize method
|
6495 |
+
* tmpl.initialize("#gallery-parent");
|
6496 |
+
* });
|
6497 |
+
* </script>
|
6498 |
+
*/
|
6499 |
+
_.MasonryTemplate = _.Template.extend(/** @lends FooGallery.MasonryTemplate */{
|
6500 |
+
construct: function(options, element){
|
6501 |
+
this._super(options, element);
|
6502 |
+
/**
|
6503 |
+
* @summary The current Masonry instance for the template.
|
6504 |
+
* @memberof FooGallery.MasonryTemplate#
|
6505 |
+
* @name masonry
|
6506 |
+
* @type {?Masonry}
|
6507 |
+
* @description This value is `null` until after the {@link FooGallery.Template~event:"pre-init.foogallery"|`pre-init.foogallery`} event has been raised.
|
6508 |
+
*/
|
6509 |
+
this.masonry = null;
|
6510 |
+
/**
|
6511 |
+
*
|
6512 |
+
* @type {HTMLStyleElement}
|
6513 |
+
*/
|
6514 |
+
this.style = null;
|
6515 |
+
this.$columnWidth = null;
|
6516 |
+
/**
|
6517 |
+
* @summary The CSS classes for the Masonry template.
|
6518 |
+
* @memberof FooGallery.MasonryTemplate#
|
6519 |
+
* @name cls
|
6520 |
+
* @type {FooGallery.MasonryTemplate~CSSClasses}
|
6521 |
+
*/
|
6522 |
+
/**
|
6523 |
+
* @summary The CSS selectors for the Masonry template.
|
6524 |
+
* @memberof FooGallery.MasonryTemplate#
|
6525 |
+
* @name sel
|
6526 |
+
* @type {FooGallery.MasonryTemplate~CSSSelectors}
|
6527 |
+
*/
|
6528 |
+
},
|
6529 |
+
createStylesheet: function(){
|
6530 |
+
var self = this;
|
6531 |
+
self.style = document.createElement("style");
|
6532 |
+
self.style.appendChild(document.createTextNode(""));
|
6533 |
+
document.head.appendChild(self.style);
|
6534 |
+
return self.style.sheet;
|
6535 |
+
},
|
6536 |
+
/**
|
6537 |
+
* @summary Listens for the {@link FooGallery.Template~event:"pre-init.foogallery"|`pre-init.foogallery`} event.
|
6538 |
+
* @memberof FooGallery.MasonryTemplate#
|
6539 |
+
* @function onPreInit
|
6540 |
+
* @param {jQuery.Event} event - The jQuery.Event object for the event.
|
6541 |
+
* @param {FooGallery.MasonryTemplate} self - The current instance of the template.
|
6542 |
+
* @this {HTMLElement} The templates container element that the event was raised on.
|
6543 |
+
* @description Performs all pre-initialization work required by the Masonry template, specifically handling the `layout` option and building up the required Masonry options.
|
6544 |
+
* @protected
|
6545 |
+
*/
|
6546 |
+
onPreInit: function(event, self){
|
6547 |
+
var sel = self.sel, cls = self.cls;
|
6548 |
+
// first update the templates classes to include one property containing all layouts
|
6549 |
+
cls.layouts = $.map(cls.layout, function(value){
|
6550 |
+
return value;
|
6551 |
+
}).join(" ");
|
6552 |
+
// check if the supplied layout is supported
|
6553 |
+
if (!_is.string(cls.layout[self.template.layout])){
|
6554 |
+
// if not set the default
|
6555 |
+
self.template.layout = "col4";
|
6556 |
+
}
|
6557 |
+
// configure the base masonry options depending on the layout
|
6558 |
+
var fixed = self.template.layout === "fixed";
|
6559 |
+
self.template.isFitWidth = fixed;
|
6560 |
+
self.template.percentPosition = !fixed;
|
6561 |
+
self.template.transitionDuration = 0;
|
6562 |
+
self.template.itemSelector = sel.item.elem;
|
6563 |
+
// remove any layout classes and then apply only the current to the container
|
6564 |
+
self.$el.removeClass(cls.layouts).addClass(cls.layout[self.template.layout]);
|
6565 |
+
|
6566 |
+
if (!fixed){
|
6567 |
+
// if the gutterWidth element does not exist create it
|
6568 |
+
if (self.$el.find(sel.gutterWidth).length === 0){
|
6569 |
+
self.$el.prepend($("<div/>").addClass(cls.gutterWidth));
|
6570 |
+
}
|
6571 |
+
self.template.gutter = sel.gutterWidth;
|
6572 |
+
}
|
6573 |
+
|
6574 |
+
// if the columnWidth element does not exist create it
|
6575 |
+
if (self.$el.find(sel.columnWidth).length === 0){
|
6576 |
+
self.$el.prepend($("<div/>").addClass(cls.columnWidth));
|
6577 |
+
}
|
6578 |
+
if (_is.number(self.template.columnWidth)){
|
6579 |
+
self.$el.find(sel.columnWidth).width(self.template.columnWidth);
|
6580 |
+
}
|
6581 |
+
self.template.columnWidth = sel.columnWidth;
|
6582 |
+
|
6583 |
+
// if this is a fixed layout and a number value is supplied as the gutter option then
|
6584 |
+
// make sure to vertically space the items using a CSS class and the same value
|
6585 |
+
if (fixed && _is.number(self.template.gutter)){
|
6586 |
+
var sheet = self.createStylesheet(),
|
6587 |
+
rule = '#' + self.id + sel.container + ' ' + sel.item.elem + ' { margin-bottom: ' + self.template.gutter + 'px; }';
|
6588 |
+
sheet.insertRule(rule , 0);
|
6589 |
+
}
|
6590 |
+
|
6591 |
+
self.masonry = new Masonry( self.$el.get(0), self.template );
|
6592 |
+
},
|
6593 |
+
onReady: function(event, self){
|
6594 |
+
self.masonry.layout();
|
6595 |
+
},
|
6596 |
+
onDestroy: function(event, self){
|
6597 |
+
self.$el.find(self.sel.columnWidth).remove();
|
6598 |
+
self.$el.find(self.sel.gutterWidth).remove();
|
6599 |
+
if (self.masonry instanceof Masonry){
|
6600 |
+
self.masonry.destroy();
|
6601 |
+
}
|
6602 |
+
if (self.style && self.style.parentNode){
|
6603 |
+
self.style.parentNode.removeChild(self.style);
|
6604 |
+
}
|
6605 |
+
},
|
6606 |
+
onLayout: function(event, self){
|
6607 |
+
self.masonry.layout();
|
6608 |
+
},
|
6609 |
+
/**
|
6610 |
+
* @summary Listens for the {@link FooGallery.Template~event:"parsed-items.foogallery"|`parsed-items.foogallery`} event.
|
6611 |
+
* @memberof FooGallery.MasonryTemplate#
|
6612 |
+
* @function onParsedItems
|
6613 |
+
* @param {jQuery.Event} event - The jQuery.Event object for the event.
|
6614 |
+
* @param {FooGallery.MasonryTemplate} self - The current instance of the template.
|
6615 |
+
* @param {FooGallery.Item[]} items - The array of items that were parsed.
|
6616 |
+
* @this {HTMLElement} The templates container element that the event was raised on.
|
6617 |
+
* @description Instructs Masonry to perform a layout operation whenever items are parsed.
|
6618 |
+
* @protected
|
6619 |
+
*/
|
6620 |
+
onParsedItems: function(event, self, items){
|
6621 |
+
self.masonry.layout();
|
6622 |
+
},
|
6623 |
+
/**
|
6624 |
+
* @summary Listens for the {@link FooGallery.Template~event:"appended-items.foogallery"|`appended-items.foogallery`} event.
|
6625 |
+
* @memberof FooGallery.MasonryTemplate#
|
6626 |
+
* @function onAppendedItems
|
6627 |
+
* @param {jQuery.Event} event - The jQuery.Event object for the event.
|
6628 |
+
* @param {FooGallery.MasonryTemplate} self - The current instance of the template.
|
6629 |
+
* @param {FooGallery.Item[]} items - The array of items that were appended.
|
6630 |
+
* @this {HTMLElement} The templates container element that the event was raised on.
|
6631 |
+
* @description Instructs Masonry to perform a layout operation whenever items are appended.
|
6632 |
+
* @protected
|
6633 |
+
*/
|
6634 |
+
onAppendedItems: function(event, self, items){
|
6635 |
+
items = self.items.jquerify(items);
|
6636 |
+
items = self.masonry.addItems(items);
|
6637 |
+
// add and layout the new items with no transitions
|
6638 |
+
self.masonry.layoutItems(items, true);
|
6639 |
+
},
|
6640 |
+
/**
|
6641 |
+
* @summary Listens for the {@link FooGallery.Template~event:"detach-item.foogallery"|`detach-item.foogallery`} event.
|
6642 |
+
* @memberof FooGallery.MasonryTemplate#
|
6643 |
+
* @function onDetachItem
|
6644 |
+
* @param {jQuery.Event} event - The jQuery.Event object for the event.
|
6645 |
+
* @param {FooGallery.MasonryTemplate} self - The current instance of the template.
|
6646 |
+
* @param {FooGallery.Item} item - The item to detach.
|
6647 |
+
* @this {HTMLElement} The templates container element that the event was raised on.
|
6648 |
+
* @description If not already overridden this method will override the default logic to detach an item and replace it with Masonry specific logic.
|
6649 |
+
* @protected
|
6650 |
+
*/
|
6651 |
+
onDetachItem: function(event, self, item){
|
6652 |
+
if (!event.isDefaultPrevented()){
|
6653 |
+
event.preventDefault();
|
6654 |
+
self.masonry.remove(item.$el);
|
6655 |
+
item.isAttached = false;
|
6656 |
+
item.unfix();
|
6657 |
+
}
|
6658 |
+
},
|
6659 |
+
/**
|
6660 |
+
* @summary Listens for the {@link FooGallery.Template~event:"detached-items.foogallery"|`detached-items.foogallery`} event.
|
6661 |
+
* @memberof FooGallery.MasonryTemplate#
|
6662 |
+
* @function onDetachedItems
|
6663 |
+
* @param {jQuery.Event} event - The jQuery.Event object for the event.
|
6664 |
+
* @param {FooGallery.MasonryTemplate} self - The current instance of the template.
|
6665 |
+
* @param {FooGallery.Item[]} items - The array of items that were detached.
|
6666 |
+
* @this {HTMLElement} The templates container element that the event was raised on.
|
6667 |
+
* @description Instructs Masonry to perform a layout operation whenever items are detached.
|
6668 |
+
* @protected
|
6669 |
+
*/
|
6670 |
+
onDetachedItems: function(event, self, items){
|
6671 |
+
self.masonry.layout();
|
6672 |
+
}
|
6673 |
+
});
|
6674 |
+
|
6675 |
+
_.template.register("masonry", _.MasonryTemplate, {
|
6676 |
+
template: {
|
6677 |
+
layout: "col4"
|
6678 |
+
}
|
6679 |
+
}, {
|
6680 |
+
container: "foogallery fg-masonry",
|
6681 |
+
columnWidth: "fg-column-width",
|
6682 |
+
gutterWidth: "fg-gutter-width",
|
6683 |
+
layout: {
|
6684 |
+
fixed: "fg-masonry-fixed",
|
6685 |
+
col2: "fg-masonry-2col",
|
6686 |
+
col3: "fg-masonry-3col",
|
6687 |
+
col4: "fg-masonry-4col",
|
6688 |
+
col5: "fg-masonry-5col"
|
6689 |
+
}
|
6690 |
+
});
|
6691 |
+
|
6692 |
+
/**
|
6693 |
+
* @summary An object containing the default options for the Masonry template.
|
6694 |
+
* @typedef {FooGallery.Template~Options} FooGallery.MasonryTemplate~Options
|
6695 |
+
* @property {object} [template] - An object containing the custom options for the Masonry template.
|
6696 |
+
* @property {string} [template.layout="col4"] - The layout to use for the template; "fixed", "col2", "col3", "col4" or "col5".
|
6697 |
+
* @property {FooGallery.MasonryTemplate~CSSClasses} [cls] - An object containing all CSS classes for the Masonry template.
|
6698 |
+
* @description Apart from the `layout` option the template object is identical to the standard {@link https://masonry.desandro.com/options.html|Masonry options}.
|
6699 |
+
* Note that the template overrides and sets its' own values for the following options based primarily on the `layout` value; `itemSelector`, `columnWidth`, `gutter`, `isFitWidth`, `percentPosition` and `transitionDuration`.
|
6700 |
+
* The `layout` value can be classed into two categories, fixed width and column type layouts. You can see in the examples below the options the template sets for each of these types of layouts.
|
6701 |
+
* @example {@caption For both fixed and column layouts the template sets the below option values.}
|
6702 |
+
* {
|
6703 |
+
* "itemSelector": ".fg-item", // this selector is generated from the classes.item.elem value.
|
6704 |
+
* "columnWidth": ".fg-column-width", // this selector is generated from the classes.masonry.columnWidth value.
|
6705 |
+
* "gutter": ".fg-gutter-width", // this selector is generated from the classes.masonry.gutterWidth value.
|
6706 |
+
* "transitionDuration": 0 // disables masonry's inline transitions to prevent them overriding our CSS class transitions
|
6707 |
+
* }
|
6708 |
+
* @example {@caption For fixed layouts (`"fixed"`) the template sets the below options. If a number was supplied for the `columnWidth` or `gutter` options it is applied to the relevant elements before they are replaced by the selector seen above.}
|
6709 |
+
* {
|
6710 |
+
* "isFitWidth": true,
|
6711 |
+
* "percentPosition": false
|
6712 |
+
* }
|
6713 |
+
* @example {@caption For column layouts (`"col2","col3","col4","col5"`) the template sets the below options.}
|
6714 |
+
* {
|
6715 |
+
* "isFitWidth": false,
|
6716 |
+
* "percentPosition": true
|
6717 |
+
* }
|
6718 |
+
*/
|
6719 |
+
|
6720 |
+
/**
|
6721 |
+
* @summary An object containing the default CSS classes for the Masonry template.
|
6722 |
+
* @typedef {FooGallery.Template~CSSClasses} FooGallery.MasonryTemplate~CSSClasses
|
6723 |
+
* @property {string} [container="foogallery fg-masonry"] - The base CSS class names to apply to the container element.
|
6724 |
+
* @property {string} [columnWidth="fg-column-width"] - The CSS class name to apply to the Masonry column sizer element.
|
6725 |
+
* @property {string} [gutterWidth="fg-gutter-width"] - The CSS class name to apply to the Masonry gutter sizer element.
|
6726 |
+
* @property {object} [layout] - An object containing all layout classes.
|
6727 |
+
* @property {string} [layout.fixed="fg-masonry-fixed"] - The CSS class name for a fixed width layout.
|
6728 |
+
* @property {string} [layout.col2="fg-masonry-2col"] - The CSS class name for a two column layout.
|
6729 |
+
* @property {string} [layout.col3="fg-masonry-3col"] - The CSS class name for a three column layout.
|
6730 |
+
* @property {string} [layout.col4="fg-masonry-4col"] - The CSS class name for a four column layout.
|
6731 |
+
* @property {string} [layout.col5="fg-masonry-5col"] - The CSS class name for a five column layout.
|
6732 |
+
* @property {string} [layouts="fg-masonry-fixed fg-masonry-2col fg-masonry-3col fg-masonry-4col fg-masonry-5col"] - A space delimited string of all CSS class names from the `layout` object.
|
6733 |
+
*/
|
6734 |
+
|
6735 |
+
/**
|
6736 |
+
* @summary An object containing all CSS selectors for the Masonry template.
|
6737 |
+
* @typedef {FooGallery.Template~CSSSelectors} FooGallery.MasonryTemplate~CSSSelectors
|
6738 |
+
* @property {string} [container=".foogallery.fg-masonry"] - The CSS selector for the container element.
|
6739 |
+
* @property {string} [columnWidth=".fg-column-width"] - The CSS selector for the Masonry column sizer element.
|
6740 |
+
* @property {string} [gutterWidth=".fg-gutter-width"] - The CSS selector for the Masonry gutter sizer element.
|
6741 |
+
* @property {object} [layout] - An object containing all layout CSS selectors.
|
6742 |
+
* @property {string} [layout.fixed=".fg-masonry-fixed"] - The CSS selector for a fixed width layout.
|
6743 |
+
* @property {string} [layout.col2=".fg-masonry-2col"] - The CSS selector for a two column layout.
|
6744 |
+
* @property {string} [layout.col3=".fg-masonry-3col"] - The CSS selector for a three column layout.
|
6745 |
+
* @property {string} [layout.col4=".fg-masonry-4col"] - The CSS selector for a four column layout.
|
6746 |
+
* @property {string} [layout.col5=".fg-masonry-5col"] - The CSS selector for a five column layout.
|
6747 |
+
* @description This object is automatically generated from a {@link FooGallery.MasonryTemplate~CSSClasses|classes} object and its properties mirror those except the class name values are converted into CSS selectors.
|
6748 |
+
*/
|
6749 |
+
|
6750 |
+
})(
|
6751 |
+
FooGallery.$,
|
6752 |
+
FooGallery,
|
6753 |
+
FooGallery.utils,
|
6754 |
+
FooGallery.utils.is
|
6755 |
+
);
|
6756 |
+
(function($, _, _utils, _is){
|
6757 |
+
|
6758 |
+
_.Justified = _utils.Class.extend({
|
6759 |
+
construct: function(element, options){
|
6760 |
+
this.$el = $(element);
|
6761 |
+
this.options = $.extend(true, {}, _.Justified.defaults, options);
|
6762 |
+
this._items = [];
|
6763 |
+
},
|
6764 |
+
init: function(){
|
6765 |
+
var self = this;
|
6766 |
+
if (_is.string(self.options.maxRowHeight)){
|
6767 |
+
if (self.options.maxRowHeight.indexOf('%')){
|
6768 |
+
self.options.maxRowHeight = self.options.rowHeight * (parseInt(self.options.maxRowHeight) / 100);
|
6769 |
+
} else {
|
6770 |
+
self.options.maxRowHeight = parseInt(self.options.maxRowHeight);
|
6771 |
+
}
|
6772 |
+
}
|
6773 |
+
self.layout(true);
|
6774 |
+
$(window).on("resize.justified", {self: self}, self.onWindowResize);
|
6775 |
+
},
|
6776 |
+
destroy: function(){
|
6777 |
+
$(window).off("resize.justified");
|
6778 |
+
$.each(this._items, function(i, item){
|
6779 |
+
item.$item.removeAttr("style").removeClass("fg-positioned");
|
6780 |
+
});
|
6781 |
+
this.$el.removeAttr("style");
|
6782 |
+
},
|
6783 |
+
parse: function(){
|
6784 |
+
var self = this;
|
6785 |
+
return self._items = self.$el.find(self.options.itemSelector).removeAttr("style").removeClass("fg-positioned").map(function(i, el){
|
6786 |
+
var $item = $(el),
|
6787 |
+
width = $item.outerWidth(),
|
6788 |
+
height = $item.outerHeight(),
|
6789 |
+
ratio = self.options.rowHeight / height;
|
6790 |
+
|
6791 |
+
return {
|
6792 |
+
index: i,
|
6793 |
+
width: width * ratio,
|
6794 |
+
height: self.options.rowHeight,
|
6795 |
+
top: 0,
|
6796 |
+
left: 0,
|
6797 |
+
$item: $item
|
6798 |
+
};
|
6799 |
+
}).get();
|
6800 |
+
},
|
6801 |
+
round: function(value){
|
6802 |
+
return Math.round(value);
|
6803 |
+
//return Math.round(value*2) / 2;
|
6804 |
+
},
|
6805 |
+
layout: function(refresh, autoCorrect){
|
6806 |
+
refresh = _is.boolean(refresh) ? refresh : false;
|
6807 |
+
autoCorrect = _is.boolean(autoCorrect) ? autoCorrect : true;
|
6808 |
+
|
6809 |
+
if (refresh || this._items.length === 0){
|
6810 |
+
this.parse();
|
6811 |
+
}
|
6812 |
+
|
6813 |
+
var self = this,
|
6814 |
+
containerWidth = self.$el.width(),
|
6815 |
+
rows = self.rows(containerWidth),
|
6816 |
+
offsetTop = 0;
|
6817 |
+
|
6818 |
+
for (var i = 0, l = rows.length, row; i < l; i++){
|
6819 |
+
row = rows[i];
|
6820 |
+
if (i === l - 1){
|
6821 |
+
offsetTop = self.lastRow(row, containerWidth, offsetTop);
|
6822 |
+
} else {
|
6823 |
+
offsetTop = self.justify(row, containerWidth, offsetTop);
|
6824 |
+
}
|
6825 |
+
self.render(row);
|
6826 |
+
}
|
6827 |
+
self.$el.height(offsetTop);
|
6828 |
+
// if our layout caused the container width to get smaller
|
6829 |
+
// i.e. makes a scrollbar appear then layout again to account for it
|
6830 |
+
if (autoCorrect && self.$el.width() < containerWidth){
|
6831 |
+
self.layout(false, false);
|
6832 |
+
}
|
6833 |
+
},
|
6834 |
+
render: function(row){
|
6835 |
+
for (var j = 0, jl = row.items.length, item; j < jl; j++){
|
6836 |
+
item = row.items[j];
|
6837 |
+
if (row.visible){
|
6838 |
+
item.$item.css({
|
6839 |
+
width: item.width,
|
6840 |
+
height: item.height,
|
6841 |
+
top: item.top,
|
6842 |
+
left: item.left,
|
6843 |
+
display: "",
|
6844 |
+
maxHeight: this.options.maxRowHeight > 0 ? this.options.maxRowHeight : ""
|
6845 |
+
}).addClass("fg-positioned");
|
6846 |
+
} else {
|
6847 |
+
item.$item.css("display", "none");
|
6848 |
+
}
|
6849 |
+
}
|
6850 |
+
},
|
6851 |
+
lastRow: function(row, containerWidth, offsetTop){
|
6852 |
+
var self = this;
|
6853 |
+
switch(self.options.lastRow){
|
6854 |
+
case "hide":
|
6855 |
+
row.visible = false;
|
6856 |
+
break;
|
6857 |
+
case "justify":
|
6858 |
+
offsetTop = self.justify(row, containerWidth, offsetTop);
|
6859 |
+
break;
|
6860 |
+
case "nojustify":
|
6861 |
+
if (row.width / containerWidth > self.options.justifyThreshold){
|
6862 |
+
offsetTop = self.justify(row, containerWidth, offsetTop);
|
6863 |
+
} else {
|
6864 |
+
offsetTop = self.position(row, containerWidth, offsetTop, "left");
|
6865 |
+
}
|
6866 |
+
break;
|
6867 |
+
case "right":
|
6868 |
+
case "center":
|
6869 |
+
case "left":
|
6870 |
+
offsetTop = self.position(row, containerWidth, offsetTop, self.options.lastRow);
|
6871 |
+
break;
|
6872 |
+
default:
|
6873 |
+
offsetTop = self.position(row, containerWidth, offsetTop, "left");
|
6874 |
+
break;
|
6875 |
+
}
|
6876 |
+
return offsetTop;
|
6877 |
+
},
|
6878 |
+
justify: function(row, containerWidth, offsetTop){
|
6879 |
+
var self = this,
|
6880 |
+
left = 0,
|
6881 |
+
margins = self.options.margins * (row.items.length - 1),
|
6882 |
+
ratio = (containerWidth - margins) / row.width;
|
6883 |
+
|
6884 |
+
if (row.index > 0) offsetTop += self.options.margins;
|
6885 |
+
row.top = offsetTop;
|
6886 |
+
row.width = self.round(row.width * ratio);
|
6887 |
+
row.height = self.round(row.height * ratio);
|
6888 |
+
|
6889 |
+
for (var j = 0, jl = row.items.length, item; j < jl; j++){
|
6890 |
+
item = row.items[j];
|
6891 |
+
item.width = self.round(item.width * ratio);
|
6892 |
+
item.height = self.round(item.height * ratio);
|
6893 |
+
item.top = offsetTop;
|
6894 |
+
if (j > 0) left += self.options.margins;
|
6895 |
+
item.left = left;
|
6896 |
+
left += item.width;
|
6897 |
+
}
|
6898 |
+
return offsetTop + (row.height > self.options.maxRowHeight ? self.options.maxRowHeight : row.height);
|
6899 |
+
},
|
6900 |
+
position: function(row, containerWidth, offsetTop, alignment){
|
6901 |
+
var self = this, lastItem = row.items[row.items.length - 1], diff = containerWidth - (lastItem.left + lastItem.width);
|
6902 |
+
if (row.index > 0) offsetTop += self.options.margins;
|
6903 |
+
row.top = offsetTop;
|
6904 |
+
for (var i = 0, l = row.items.length, item; i < l; i++){
|
6905 |
+
item = row.items[i];
|
6906 |
+
item.top = offsetTop;
|
6907 |
+
if (alignment === "center"){
|
6908 |
+
item.left += diff / 2;
|
6909 |
+
} else if (alignment === "right"){
|
6910 |
+
item.left += diff;
|
6911 |
+
}
|
6912 |
+
}
|
6913 |
+
return offsetTop + row.height;
|
6914 |
+
},
|
6915 |
+
items: function(){
|
6916 |
+
return $.map(this._items, function(item){
|
6917 |
+
return {
|
6918 |
+
index: item.index,
|
6919 |
+
width: item.width,
|
6920 |
+
height: item.height,
|
6921 |
+
$item: item.$item,
|
6922 |
+
top: item.top,
|
6923 |
+
left: item.left,
|
6924 |
+
};
|
6925 |
+
});
|
6926 |
+
},
|
6927 |
+
rows: function(containerWidth){
|
6928 |
+
var self = this,
|
6929 |
+
items = self.items(),
|
6930 |
+
rows = [],
|
6931 |
+
process = items.length > 0,
|
6932 |
+
index = -1, offsetTop = 0;
|
6933 |
+
|
6934 |
+
while (process){
|
6935 |
+
index += 1;
|
6936 |
+
if (index > 0) offsetTop += self.options.margins;
|
6937 |
+
var row = {
|
6938 |
+
index: index,
|
6939 |
+
visible: true,
|
6940 |
+
top: offsetTop,
|
6941 |
+
width: 0,
|
6942 |
+
height: self.options.rowHeight,
|
6943 |
+
items: []
|
6944 |
+
}, remove = [], left = 0, tmp;
|
6945 |
+
|
6946 |
+
for (var i = 0, il = items.length, item, ratio; i < il; i++){
|
6947 |
+
item = items[i];
|
6948 |
+
tmp = row.width + item.width;
|
6949 |
+
if (tmp > containerWidth && i > 0){
|
6950 |
+
break;
|
6951 |
+
} else if (tmp > containerWidth && i == 0){
|
6952 |
+
tmp = containerWidth;
|
6953 |
+
ratio = containerWidth / item.width;
|
6954 |
+
item.width = self.round(item.width * ratio);
|
6955 |
+
item.height = self.round(item.height * ratio);
|
6956 |
+
row.height = item.height;
|
6957 |
+
}
|
6958 |
+
item.top = row.top;
|
6959 |
+
if (i > 0) left += self.options.margins;
|
6960 |
+
item.left = left;
|
6961 |
+
left += item.width;
|
6962 |
+
row.width = tmp;
|
6963 |
+
row.items.push(item);
|
6964 |
+
remove.push(i);
|
6965 |
+
}
|
6966 |
+
// make sure we don't get stuck in a loop, there should always be items to be removed
|
6967 |
+
if (remove.length === 0){
|
6968 |
+
process = false;
|
6969 |
+
break;
|
6970 |
+
}
|
6971 |
+
remove.sort(function(a, b){ return b - a; });
|
6972 |
+
for (var j = 0, jl = remove.length; j < jl; j++){
|
6973 |
+
items.splice(remove[j], 1);
|
6974 |
+
}
|
6975 |
+
rows.push(row);
|
6976 |
+
process = items.length > 0;
|
6977 |
+
}
|
6978 |
+
return rows;
|
6979 |
+
},
|
6980 |
+
onWindowResize: function(e){
|
6981 |
+
e.data.self.layout();
|
6982 |
+
}
|
6983 |
+
});
|
6984 |
+
|
6985 |
+
_.Justified.defaults = {
|
6986 |
+
itemSelector: ".fg-item",
|
6987 |
+
rowHeight: 150,
|
6988 |
+
maxRowHeight: "200%",
|
6989 |
+
margins: 0,
|
6990 |
+
lastRow: "center",
|
6991 |
+
justifyThreshold: 0.5
|
6992 |
+
};
|
6993 |
+
|
6994 |
+
})(
|
6995 |
+
FooGallery.$,
|
6996 |
+
FooGallery,
|
6997 |
+
FooGallery.utils,
|
6998 |
+
FooGallery.utils.is
|
6999 |
+
);
|
7000 |
+
(function($, _, _utils){
|
7001 |
+
|
7002 |
+
_.JustifiedTemplate = _.Template.extend({
|
7003 |
+
onPreInit: function(event, self){
|
7004 |
+
self.justified = new _.Justified( self.$el.get(0), self.template );
|
7005 |
+
},
|
7006 |
+
onInit: function(event, self){
|
7007 |
+
self.justified.init();
|
7008 |
+
},
|
7009 |
+
onReady: function(event, self){
|
7010 |
+
self.justified.layout( true );
|
7011 |
+
},
|
7012 |
+
onDestroy: function(event, self){
|
7013 |
+
self.justified.destroy();
|
7014 |
+
},
|
7015 |
+
onLayout: function(event, self){
|
7016 |
+
self.justified.layout( true );
|
7017 |
+
},
|
7018 |
+
onParsedItems: function(event, self, items){
|
7019 |
+
self.justified.layout();
|
7020 |
+
},
|
7021 |
+
onAppendedItems: function(event, self, items){
|
7022 |
+
self.justified.layout( true );
|
7023 |
+
},
|
7024 |
+
onDetachedItems: function(event, self, items){
|
7025 |
+
self.justified.layout( true );
|
7026 |
+
}
|
7027 |
+
});
|
7028 |
+
|
7029 |
+
_.template.register("justified", _.JustifiedTemplate, null, {
|
7030 |
+
container: "foogallery fg-justified"
|
7031 |
+
});
|
7032 |
+
|
7033 |
+
})(
|
7034 |
+
FooGallery.$,
|
7035 |
+
FooGallery,
|
7036 |
+
FooGallery.utils
|
7037 |
+
);
|
7038 |
+
(function($, _, _utils, _is){
|
7039 |
+
|
7040 |
+
_.Portfolio = _utils.Class.extend({
|
7041 |
+
construct: function(element, options){
|
7042 |
+
this.$el = $(element);
|
7043 |
+
this.options = $.extend(true, {}, _.Portfolio.defaults, options);
|
7044 |
+
this._items = [];
|
7045 |
+
},
|
7046 |
+
init: function(){
|
7047 |
+
var self = this;
|
7048 |
+
$(window).on("resize.portfolio", {self: self}, self.onWindowResize);
|
7049 |
+
self.layout(true);
|
7050 |
+
},
|
7051 |
+
destroy: function(){
|
7052 |
+
$(window).off("resize.portfolio");
|
7053 |
+
$.each(this._items, function(i, item){
|
7054 |
+
item.$item.removeAttr("style").removeClass("fg-positioned");
|
7055 |
+
});
|
7056 |
+
this.$el.removeAttr("style");
|
7057 |
+
},
|
7058 |
+
parse: function(){
|
7059 |
+
var self = this;
|
7060 |
+
return self._items = self.$el.find(".fg-item").removeAttr("style").removeClass("fg-positioned").map(function(i, el){
|
7061 |
+
var $item = $(el),
|
7062 |
+
$thumb = $item.find(".fg-thumb"),
|
7063 |
+
$img = $thumb.find(".fg-image");
|
7064 |
+
$item.find(".fg-caption").css("max-width", $img.width());
|
7065 |
+
return {
|
7066 |
+
index: i,
|
7067 |
+
width: $item.outerWidth(),
|
7068 |
+
height: $item.outerHeight(),
|
7069 |
+
top: 0,
|
7070 |
+
left: 0,
|
7071 |
+
$item: $item,
|
7072 |
+
$thumb: $thumb
|
7073 |
+
};
|
7074 |
+
}).get();
|
7075 |
+
},
|
7076 |
+
round: function(value){
|
7077 |
+
return Math.round(value*2) / 2;
|
7078 |
+
},
|
7079 |
+
layout: function(refresh, autoCorrect){
|
7080 |
+
refresh = _is.boolean(refresh) ? refresh : false;
|
7081 |
+
autoCorrect = _is.boolean(autoCorrect) ? autoCorrect : true;
|
7082 |
+
|
7083 |
+
if (refresh || this._items.length === 0){
|
7084 |
+
this.parse();
|
7085 |
+
}
|
7086 |
+
|
7087 |
+
var self = this,
|
7088 |
+
containerWidth = self.$el.width(),
|
7089 |
+
rows = self.rows(containerWidth),
|
7090 |
+
offsetTop = 0;
|
7091 |
+
|
7092 |
+
for (var i = 0, l = rows.length, row; i < l; i++){
|
7093 |
+
row = rows[i];
|
7094 |
+
offsetTop = self.position(row, containerWidth, offsetTop, "center");
|
7095 |
+
self.render(row);
|
7096 |
+
}
|
7097 |
+
self.$el.height(offsetTop);
|
7098 |
+
// if our layout caused the container width to get smaller
|
7099 |
+
// i.e. makes a scrollbar appear then layout again to account for it
|
7100 |
+
if (autoCorrect && self.$el.width() < containerWidth){
|
7101 |
+
self.layout(false, false);
|
7102 |
+
}
|
7103 |
+
},
|
7104 |
+
render: function(row){
|
7105 |
+
for (var j = 0, jl = row.items.length, item; j < jl; j++){
|
7106 |
+
item = row.items[j];
|
7107 |
+
if (row.visible){
|
7108 |
+
item.$item.css({
|
7109 |
+
width: item.width,
|
7110 |
+
height: row.height,
|
7111 |
+
top: item.top,
|
7112 |
+
left: item.left,
|
7113 |
+
display: ""
|
7114 |
+
}).addClass("fg-positioned");
|
7115 |
+
} else {
|
7116 |
+
item.$item.css("display", "none");
|
7117 |
+
}
|
7118 |
+
}
|
7119 |
+
},
|
7120 |
+
position: function(row, containerWidth, offsetTop, alignment){
|
7121 |
+
var self = this, lastItem = row.items[row.items.length - 1], diff = containerWidth - (lastItem.left + lastItem.width);
|
7122 |
+
if (row.index > 0) offsetTop += self.options.gutter;
|
7123 |
+
row.top = offsetTop;
|
7124 |
+
for (var i = 0, l = row.items.length, item; i < l; i++){
|
7125 |
+
item = row.items[i];
|
7126 |
+
item.top = offsetTop;
|
7127 |
+
if (alignment === "center"){
|
7128 |
+
item.left += diff / 2;
|
7129 |
+
} else if (alignment === "right"){
|
7130 |
+
item.left += diff;
|
7131 |
+
}
|
7132 |
+
}
|
7133 |
+
return offsetTop + row.height;
|
7134 |
+
},
|
7135 |
+
items: function(){
|
7136 |
+
return $.map(this._items, function(item){
|
7137 |
+
return {
|
7138 |
+
index: item.index,
|
7139 |
+
width: item.width,
|
7140 |
+
height: item.height,
|
7141 |
+
$item: item.$item,
|
7142 |
+
$thumb: item.$thumb,
|
7143 |
+
top: item.top,
|
7144 |
+
left: item.left,
|
7145 |
+
};
|
7146 |
+
});
|
7147 |
+
},
|
7148 |
+
rows: function(containerWidth){
|
7149 |
+
var self = this,
|
7150 |
+
items = self.items(),
|
7151 |
+
rows = [],
|
7152 |
+
process = items.length > 0,
|
7153 |
+
index = -1, offsetTop = 0;
|
7154 |
+
|
7155 |
+
while (process){
|
7156 |
+
index += 1;
|
7157 |
+
if (index > 0) offsetTop += self.options.gutter;
|
7158 |
+
var row = {
|
7159 |
+
index: index,
|
7160 |
+
visible: true,
|
7161 |
+
top: offsetTop,
|
7162 |
+
width: 0,
|
7163 |
+
height: 0,
|
7164 |
+
items: []
|
7165 |
+
}, remove = [], left = 0, tmp;
|
7166 |
+
|
7167 |
+
for (var i = 0, il = items.length, item, ratio; i < il; i++){
|
7168 |
+
item = items[i];
|
7169 |
+
tmp = row.width + item.width;
|
7170 |
+
if (tmp > containerWidth && i > 0){
|
7171 |
+
break;
|
7172 |
+
} else if (tmp > containerWidth && i == 0){
|
7173 |
+
tmp = containerWidth;
|
7174 |
+
ratio = containerWidth / item.width;
|
7175 |
+
item.width = self.round(item.width * ratio);
|
7176 |
+
item.height = self.round(item.height * ratio);
|
7177 |
+
row.height = item.height;
|
7178 |
+
}
|
7179 |
+
item.top = row.top;
|
7180 |
+
if (i > 0){
|
7181 |
+
left += self.options.gutter;
|
7182 |
+
}
|
7183 |
+
if (i !== il - 1){
|
7184 |
+
tmp += self.options.gutter;
|
7185 |
+
}
|
7186 |
+
item.left = left;
|
7187 |
+
left += item.width;
|
7188 |
+
if (item.height > row.height) row.height = item.height;
|
7189 |
+
row.width = tmp;
|
7190 |
+
row.items.push(item);
|
7191 |
+
remove.push(i);
|
7192 |
+
}
|
7193 |
+
// make sure we don't get stuck in a loop, there should always be items to be removed
|
7194 |
+
if (remove.length === 0){
|
7195 |
+
process = false;
|
7196 |
+
break;
|
7197 |
+
}
|
7198 |
+
remove.sort(function(a, b){ return b - a; });
|
7199 |
+
for (var j = 0, jl = remove.length; j < jl; j++){
|
7200 |
+
items.splice(remove[j], 1);
|
7201 |
+
}
|
7202 |
+
rows.push(row);
|
7203 |
+
process = items.length > 0;
|
7204 |
+
}
|
7205 |
+
return rows;
|
7206 |
+
},
|
7207 |
+
onWindowResize: function(e){
|
7208 |
+
e.data.self.layout();
|
7209 |
+
}
|
7210 |
+
});
|
7211 |
+
|
7212 |
+
_.Portfolio.defaults = {
|
7213 |
+
gutter: 40,
|
7214 |
+
align: "center"
|
7215 |
+
};
|
7216 |
+
|
7217 |
+
})(
|
7218 |
+
FooGallery.$,
|
7219 |
+
FooGallery,
|
7220 |
+
FooGallery.utils,
|
7221 |
+
FooGallery.utils.is
|
7222 |
+
);
|
7223 |
+
(function($, _, _utils){
|
7224 |
+
|
7225 |
+
_.PortfolioTemplate = _.Template.extend({
|
7226 |
+
construct: function(element, options){
|
7227 |
+
this._super(element, options);
|
7228 |
+
|
7229 |
+
this.portfolio = null;
|
7230 |
+
},
|
7231 |
+
onPreInit: function(event, self){
|
7232 |
+
self.portfolio = new _.Portfolio( self.$el.get(0), self.template );
|
7233 |
+
},
|
7234 |
+
onInit: function(event, self){
|
7235 |
+
self.portfolio.init();
|
7236 |
+
},
|
7237 |
+
onDestroy: function(event, self){
|
7238 |
+
self.portfolio.destroy();
|
7239 |
+
},
|
7240 |
+
onLayout: function(event, self){
|
7241 |
+
self.portfolio.layout( true );
|
7242 |
+
},
|
7243 |
+
onParsedItems: function(event, self, items){
|
7244 |
+
self.portfolio.layout();
|
7245 |
+
},
|
7246 |
+
onAppendedItems: function(event, self, items){
|
7247 |
+
self.portfolio.layout( true );
|
7248 |
+
},
|
7249 |
+
onDetachedItems: function(event, self, items){
|
7250 |
+
self.portfolio.layout( true );
|
7251 |
+
}
|
7252 |
+
});
|
7253 |
+
|
7254 |
+
_.template.register("simple_portfolio", _.PortfolioTemplate, {
|
7255 |
+
gutter: 40
|
7256 |
+
}, {
|
7257 |
+
container: "foogallery fg-simple_portfolio"
|
7258 |
+
});
|
7259 |
+
|
7260 |
+
})(
|
7261 |
+
FooGallery.$,
|
7262 |
+
FooGallery,
|
7263 |
+
FooGallery.utils
|
7264 |
+
);
|
7265 |
+
// (function(_){
|
7266 |
+
//
|
7267 |
+
// // This file contains the initialization code for the Image Viewer gallery. It makes use of the FooGallery.Loader
|
7268 |
+
// // allowing for optimized loading of images within the gallery.
|
7269 |
+
//
|
7270 |
+
// // Use FooGallery.ready to wait for the DOM to be ready
|
7271 |
+
// _.ready(function($){
|
7272 |
+
//
|
7273 |
+
// // Find each Image Viewer gallery in the current page
|
7274 |
+
// $(".fg-image-viewer").each(function(){
|
7275 |
+
// var $gallery = $(this),
|
7276 |
+
// // Get the options for the plugin
|
7277 |
+
// options = $gallery.data("loader-options"),
|
7278 |
+
// // Get the options for the loader
|
7279 |
+
// loader = $.extend(true, $gallery.data("loader-options"), {
|
7280 |
+
// oninit: function(){
|
7281 |
+
// // the first time the gallery is initialized it triggers a window resize event
|
7282 |
+
// $(window).trigger("resize");
|
7283 |
+
// },
|
7284 |
+
// onloaded: function(image){
|
7285 |
+
// // once the actual image is loaded we no longer need the inline css used to prevent layout jumps so remove it
|
7286 |
+
// $(image).fgRemoveSize();
|
7287 |
+
// }
|
7288 |
+
// });
|
7289 |
+
//
|
7290 |
+
// // Find all images that have a width and height attribute set and calculate the size to set as a temporary inline style.
|
7291 |
+
// // This calculated size is used to prevent layout jumps.
|
7292 |
+
// // Once that is done initialize the plugin and the loader.
|
7293 |
+
// $gallery.fgAddSize(true).fgImageViewer( options ).fgLoader( loader );
|
7294 |
+
// });
|
7295 |
+
//
|
7296 |
+
// });
|
7297 |
+
//
|
7298 |
+
// })(
|
7299 |
+
// FooGallery
|
7300 |
+
// );
|
7301 |
+
(function ($, _, _utils, _obj) {
|
7302 |
+
|
7303 |
+
_.ImageViewerTemplate = _.Template.extend({
|
7304 |
+
construct: function (options, element) {
|
7305 |
+
this._super(_obj.extend({}, options, {
|
7306 |
+
paging: {
|
7307 |
+
pushOrReplace: "replace",
|
7308 |
+
theme: "fg-light",
|
7309 |
+
type: "default",
|
7310 |
+
size: 1,
|
7311 |
+
position: "none",
|
7312 |
+
scrollToTop: false
|
7313 |
+
}
|
7314 |
+
}), element);
|
7315 |
+
/**
|
7316 |
+
* @summary The jQuery object containing the inner element that wraps all items.
|
7317 |
+
* @memberof FooGallery.ImageViewerTemplate#
|
7318 |
+
* @name $inner
|
7319 |
+
* @type {jQuery}
|
7320 |
+
*/
|
7321 |
+
this.$inner = this.$el.find('.fiv-inner-container');
|
7322 |
+
/**
|
7323 |
+
* @summary The jQuery object that displays the current image count.
|
7324 |
+
* @memberof FooGallery.ImageViewerTemplate#
|
7325 |
+
* @name $current
|
7326 |
+
* @type {jQuery}
|
7327 |
+
*/
|
7328 |
+
this.$current = this.$el.find('.fiv-count-current');
|
7329 |
+
/**
|
7330 |
+
* @summary The jQuery object that displays the current image count.
|
7331 |
+
* @memberof FooGallery.ImageViewerTemplate#
|
7332 |
+
* @name $current
|
7333 |
+
* @type {jQuery}
|
7334 |
+
*/
|
7335 |
+
this.$total = this.$el.find('.fiv-count-total');
|
7336 |
+
/**
|
7337 |
+
* @summary The jQuery object for the previous button.
|
7338 |
+
* @memberof FooGallery.ImageViewerTemplate#
|
7339 |
+
* @name $prev
|
7340 |
+
* @type {jQuery}
|
7341 |
+
*/
|
7342 |
+
this.$prev = this.$el.find('.fiv-prev');
|
7343 |
+
/**
|
7344 |
+
* @summary The jQuery object for the next button.
|
7345 |
+
* @memberof FooGallery.ImageViewerTemplate#
|
7346 |
+
* @name $next
|
7347 |
+
* @type {jQuery}
|
7348 |
+
*/
|
7349 |
+
this.$next = this.$el.find('.fiv-next');
|
7350 |
+
/**
|
7351 |
+
* @summary The CSS classes for the Image Viewer template.
|
7352 |
+
* @memberof FooGallery.ImageViewerTemplate#
|
7353 |
+
* @name cls
|
7354 |
+
* @type {FooGallery.ImageViewerTemplate~CSSClasses}
|
7355 |
+
*/
|
7356 |
+
/**
|
7357 |
+
* @summary The CSS selectors for the Image Viewer template.
|
7358 |
+
* @memberof FooGallery.ImageViewerTemplate#
|
7359 |
+
* @name sel
|
7360 |
+
* @type {FooGallery.ImageViewerTemplate~CSSSelectors}
|
7361 |
+
*/
|
7362 |
+
},
|
7363 |
+
onInit: function (event, self) {
|
7364 |
+
if (self.template.attachFooBox) {
|
7365 |
+
self.$el.on('foobox.previous', {self: self}, self.onFooBoxPrev)
|
7366 |
+
.on('foobox.next', {self: self}, self.onFooBoxNext);
|
7367 |
+
}
|
7368 |
+
self.$prev.on('click', {self: self}, self.onPrevClick);
|
7369 |
+
self.$next.on('click', {self: self}, self.onNextClick);
|
7370 |
+
},
|
7371 |
+
onFirstLoad: function(event, self){
|
7372 |
+
self.update();
|
7373 |
+
},
|
7374 |
+
/**
|
7375 |
+
* @summary Destroy the plugin cleaning up any bound events.
|
7376 |
+
* @memberof FooGallery.ImageViewerTemplate#
|
7377 |
+
* @function onDestroy
|
7378 |
+
*/
|
7379 |
+
onDestroy: function (event, self) {
|
7380 |
+
if (self.template.attachFooBox) {
|
7381 |
+
self.$el.off({
|
7382 |
+
'foobox.previous': self.onFooBoxPrev,
|
7383 |
+
'foobox.next': self.onFooBoxNext
|
7384 |
+
});
|
7385 |
+
}
|
7386 |
+
self.$prev.off('click', self.onPrevClick);
|
7387 |
+
self.$next.off('click', self.onNextClick);
|
7388 |
+
},
|
7389 |
+
onAppendItem: function (event, self, item) {
|
7390 |
+
event.preventDefault();
|
7391 |
+
self.$inner.append(item.$el);
|
7392 |
+
item.fix();
|
7393 |
+
item.isAttached = true;
|
7394 |
+
},
|
7395 |
+
update: function(){
|
7396 |
+
if (this.pages){
|
7397 |
+
this.$current.text(this.pages.current);
|
7398 |
+
this.$total.text(this.pages.total);
|
7399 |
+
}
|
7400 |
+
},
|
7401 |
+
/**
|
7402 |
+
* @summary Navigate to the previous item in the collection.
|
7403 |
+
* @memberof FooGallery.ImageViewerTemplate#
|
7404 |
+
* @function prev
|
7405 |
+
* @description If there is a previous item in the collection calling this method will navigate to it displaying its' image and updating the current image count.
|
7406 |
+
*/
|
7407 |
+
prev: function () {
|
7408 |
+
if (this.pages){
|
7409 |
+
this.pages.prev();
|
7410 |
+
this.update();
|
7411 |
+
}
|
7412 |
+
},
|
7413 |
+
/**
|
7414 |
+
* @summary Navigate to the next item in the collection.
|
7415 |
+
* @memberof FooGallery.ImageViewerTemplate#
|
7416 |
+
* @function next
|
7417 |
+
* @description If there is a next item in the collection calling this method will navigate to it displaying its' image and updating the current image count.
|
7418 |
+
*/
|
7419 |
+
next: function () {
|
7420 |
+
if (this.pages){
|
7421 |
+
this.pages.next();
|
7422 |
+
this.update();
|
7423 |
+
}
|
7424 |
+
},
|
7425 |
+
/**
|
7426 |
+
* @summary Handles the `"foobox.previous"` event allowing the plugin to remain in sync with what is displayed in the lightbox.
|
7427 |
+
* @memberof FooGallery.ImageViewerTemplate#
|
7428 |
+
* @function onFooBoxPrev
|
7429 |
+
* @param {jQuery.Event} e - The jQuery.Event object for the event.
|
7430 |
+
*/
|
7431 |
+
onFooBoxPrev: function (e) {
|
7432 |
+
e.data.self.prev();
|
7433 |
+
},
|
7434 |
+
/**
|
7435 |
+
* @summary Handles the `"foobox.next"` event allowing the plugin to remain in sync with what is displayed in the lightbox.
|
7436 |
+
* @memberof FooGallery.ImageViewerTemplate#
|
7437 |
+
* @function onFooBoxNext
|
7438 |
+
* @param {jQuery.Event} e - The jQuery.Event object for the event.
|
7439 |
+
*/
|
7440 |
+
onFooBoxNext: function (e) {
|
7441 |
+
e.data.self.next();
|
7442 |
+
},
|
7443 |
+
/**
|
7444 |
+
* @summary Handles the `"click"` event of the previous button.
|
7445 |
+
* @memberof FooGallery.ImageViewerTemplate#
|
7446 |
+
* @function onPrevClick
|
7447 |
+
* @param {jQuery.Event} e - The jQuery.Event object for the event.
|
7448 |
+
*/
|
7449 |
+
onPrevClick: function (e) {
|
7450 |
+
e.preventDefault();
|
7451 |
+
e.stopPropagation();
|
7452 |
+
e.data.self.prev();
|
7453 |
+
},
|
7454 |
+
/**
|
7455 |
+
* @summary Handles the `"click"` event of the next button.
|
7456 |
+
* @memberof FooGallery.ImageViewerTemplate#
|
7457 |
+
* @function onNextClick
|
7458 |
+
* @param {jQuery.Event} e - The jQuery.Event object for the event.
|
7459 |
+
*/
|
7460 |
+
onNextClick: function (e) {
|
7461 |
+
e.preventDefault();
|
7462 |
+
e.stopPropagation();
|
7463 |
+
e.data.self.next();
|
7464 |
+
}
|
7465 |
+
});
|
7466 |
+
|
7467 |
+
_.template.register("image-viewer", _.ImageViewerTemplate, {
|
7468 |
+
template: {
|
7469 |
+
attachFooBox: false
|
7470 |
+
}
|
7471 |
+
}, {
|
7472 |
+
container: "foogallery fg-image-viewer"
|
7473 |
+
});
|
7474 |
+
|
7475 |
+
})(
|
7476 |
+
FooGallery.$,
|
7477 |
+
FooGallery,
|
7478 |
+
FooGallery.utils,
|
7479 |
+
FooGallery.utils.obj
|
7480 |
+
);
|
7481 |
+
(function($, _, _obj){
|
7482 |
+
|
7483 |
+
_.ThumbnailTemplate = _.Template.extend({
|
7484 |
+
construct: function (options, element) {
|
7485 |
+
this._super(_obj.extend({}, options, {
|
7486 |
+
paging: {
|
7487 |
+
type: "none"
|
7488 |
+
}
|
7489 |
+
}), element);
|
7490 |
+
}
|
7491 |
+
});
|
7492 |
+
|
7493 |
+
_.template.register("thumbnail", _.ThumbnailTemplate, null, {
|
7494 |
+
container: "foogallery fg-thumbnail"
|
7495 |
+
});
|
7496 |
+
|
7497 |
+
})(
|
7498 |
+
FooGallery.$,
|
7499 |
+
FooGallery,
|
7500 |
+
FooGallery.utils.obj
|
7501 |
+
);
|
extensions/default-templates/shared/js/foogallery.min.js
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
* FooGallery - The Most Intuitive and Extensible Gallery Creation and Management Tool Ever Created for WordPress
|
3 |
+
* @version 1.0.1
|
4 |
+
* @link
|
5 |
+
* @copyright Steven Usher & Brad Vincent 2015
|
6 |
+
* @license Released under the GPLv3 license.
|
7 |
+
*/
|
8 |
+
|
9 |
+
!function(a,b){b.$=a}(jQuery,window.FooGallery=window.FooGallery||{}),function(a){if(!a)return void console.warn("jQuery must be included in the page prior to the FooGallery.utils library.");var b={$:a,version:"0.0.5"};b.versionCompare=function(a,b){function c(a){for(var b=a.split("."),c=0,d=b.length;c<d;c++)b[c]=parseInt(b[c]),isNaN(b[c])&&(b[c]=0);return b}if(!/[\d.]/.test(a)||!/[\d.]/.test(b))return NaN;for(var d=c(a),e=c(b);d.length<e.length;)d.push(0);for(;e.length<d.length;)e.push(0);for(var f=0;f<d.length;++f){if(e.length==f)return 1;if(d[f]!=e[f])return d[f]>e[f]?1:-1}return d.length!=e.length?-1:0},!function(){try{return!!window.FooGallery.utils}catch(a){return!1}}()?window.FooGallery.utils=b:b.versionCompare(b.version,window.FooGallery.utils.version)>0?(console.warn("An older version of FooGallery.utils ("+window.FooGallery.utils.version+") already exists in the page, version "+b.version+" will override it."),window.FooGallery.utils=b):console.warn("A newer version of FooGallery.utils ("+window.FooGallery.utils.version+") already exists in the page, version "+b.version+" will not register itself.")}(jQuery),function(a,b){"0.0.5"===b.version&&(b.is={},b.is.array=function(a){return"[object Array]"===Object.prototype.toString.call(a)},b.is.boolean=function(a){return"[object Boolean]"===Object.prototype.toString.call(a)},b.is.element=function(a){return"object"==typeof HTMLElement?a instanceof HTMLElement:!!a&&"object"==typeof a&&null!==a&&1===a.nodeType&&"string"==typeof a.nodeName},b.is.empty=function(a){if(b.is.undef(a)||null===a)return!0;if(b.is.number(a)&&0==a)return!0;if(b.is.boolean(a)&&!1===a)return!0;if(b.is.string(a)&&0===a.length)return!0;if(b.is.array(a)&&0===a.length)return!0;if(b.is.jq(a)&&0===a.length)return!0;if(b.is.hash(a)){for(var c in a)if(a.hasOwnProperty(c))return!1;return!0}return!1},b.is.error=function(a){return"[object Error]"===Object.prototype.toString.call(a)},b.is.fn=function(a){return a===window.alert||"[object Function]"===Object.prototype.toString.call(a)},b.is.hash=function(a){return b.is.object(a)&&a.constructor===Object&&!a.nodeType&&!a.setInterval},b.is.jq=function(c){return!b.is.undef(a)&&c instanceof a},b.is.number=function(a){return"[object Number]"===Object.prototype.toString.call(a)&&!isNaN(a)},b.is.object=function(a){return"[object Object]"===Object.prototype.toString.call(a)&&!b.is.undef(a)&&null!==a},b.is.promise=function(a){return b.is.object(a)&&b.is.fn(a.then)&&b.is.fn(a.promise)},b.is.size=function(a){return!!(b.is.string(a)&&!b.is.empty(a)||b.is.number(a))&&/^(auto|none|(?:[\d\.]*)+?(?:%|px|mm|q|cm|in|pt|pc|em|ex|ch|rem|vh|vw|vmin|vmax)?)$/.test(a)},b.is.string=function(a){return"[object String]"===Object.prototype.toString.call(a)},b.is.undef=function(a){return void 0===a})}(FooGallery.utils.$,FooGallery.utils),function(a,b,c){if("0.0.5"===b.version){b.fn={};var d=Function.prototype.toString;b.fn.CONTAINS_SUPER=/xyz/.test(d.call(function(){xyz}))?/\b_super\b/:/.*/,b.fn.addOrOverride=function(a,e,f){if(c.object(a)&&c.string(e)&&!c.empty(e)&&c.fn(f)){var g=a[e],h=c.fn(g)&&b.fn.CONTAINS_SUPER.test(d.call(f));a[e]=h?function(a,b){return function(){var c=this._super;this._super=a;var d=b.apply(this,arguments);return this._super=c,d}}(g,f):f}},b.fn.apply=function(a,b){function d(){return a.apply(this,b)}return b=c.array(b)?b:[],d.prototype=a.prototype,new d},b.fn.arg2arr=function(a){return Array.prototype.slice.call(a)},b.fn.check=function(d,e,f,g){function h(a){return function(){return a.apply(d,arguments)}}return f=c.fn(f)?f:a.noop,d=c.object(d)?d:window,e=c.string(e)?b.fn.fetch(e,g):e,h(c.fn(e)?e:f)},b.fn.fetch=function(b,d){return!c.string(b)||c.empty(b)?null:(d=c.object(d)?d:window,a.each(b.split("."),function(a,b){if(!d[b])return!1;d=d[b]}),c.fn(d)?d:null)},b.fn.enqueue=function(d,e,f,g){function h(a,b){try{return n.push(a),b.apply(a,i)}catch(a){return j.reject(a,n),j}}var i=b.fn.arg2arr(arguments),j=a.Deferred(),k=a.Deferred(),l=k.promise(),m=[],n=[],o=!0;return d=i.shift(),e=i.shift(),a.each(d,function(a,d){c.fn(d[e])&&(l=l.then(function(){if(!o){var a=b.fn.arg2arr(arguments);m.push(a)}return o=!1,h(d,d[e])}))}),l.then(function(){if(!o){var a=b.fn.arg2arr(arguments);m.push(a)}o=!1,j.resolve(m)}),l.fail(function(){var a=b.fn.arg2arr(arguments);a.push(n),j.reject.apply(j,a)}),k.resolve(),j.promise()},b.fn.when=function(b){if(!c.array(b)||c.empty(b))return a.when();for(var d=a.Deferred(),e=[],f=b.length,g=0;g<b.length;g++)b[g].then(function(a){e.push(a)}).always(function(){--f||d.resolve(e)});return d.promise()},b.fn.rejectWith=function(c,d){var e=a.Deferred(),f=b.fn.arg2arr(arguments);return e.reject.apply(e,f).promise()},b.fn.resolveWith=function(c,d){var e=a.Deferred(),f=b.fn.arg2arr(arguments);return e.resolve.apply(e,f).promise()},b.fn.resolved=a.Deferred().resolve().promise(),b.fn.rejected=a.Deferred().reject().promise()}}(FooGallery.utils.$,FooGallery.utils,FooGallery.utils.is),function(a,b){if("0.0.5"===a.version){a.url={};var c=document.createElement("a");a.url.parts=function(a){return c.href=a,{hash:c.hash,host:c.host,hostname:c.hostname,href:c.href,origin:c.origin,pathname:c.pathname,port:c.port,protocol:c.protocol,search:c.search}},a.url.full=function(a){return!b.string(a)||b.empty(a)?null:(c.href=a,c.href)},a.url.param=function(a,c,d){if(!b.string(a)||b.empty(a)||!b.string(c)||b.empty(c))return a;var e,f,g,h;return b.undef(d)?(e=new RegExp("[?|&]"+c+"=([^&;]+?)(&|#|;|$)"),f=e.exec(a)||[,""],g=f[1].replace(/\+/g,"%20"),b.string(g)&&!b.empty(g)?decodeURIComponent(g):null):(""===d||null===d?(e=new RegExp("^([^#]*?)(([^#]*)&)?"+c+"(=[^&#]*)?(&|#|$)"),g=a.replace(e,"$1$3$5").replace(/^([^#]*)((\?)&|\?(#|$))/,"$1$3$4")):(e=new RegExp("([?&])"+c+"[^&]*"),h=c+"="+encodeURIComponent(d),(g=a.replace(e,"$1"+h))!==a||e.test(g)||(g+="&"+h)),g)}}}(FooGallery.utils,FooGallery.utils.is),function(a,b,c){"0.0.5"===a.version&&(a.str={},a.str.camel=function(a){return b.empty(a)?a:a.toUpperCase()===a?a.toLowerCase():a.replace(/^([A-Z])|[-\s_]+(\w)/g,function(a,c,d){return b.string(d)?d.toUpperCase():c.toLowerCase()})},a.str.contains=function(a,c,d){return!(!b.string(a)||b.empty(a)||!b.string(c)||b.empty(c))&&(c.length<=a.length&&-1!==(d?a.toUpperCase().indexOf(c.toUpperCase()):a.indexOf(c)))},a.str.containsWord=function(a,c,d){if(!b.string(a)||b.empty(a)||!b.string(c)||b.empty(c)||a.length<c.length)return!1;for(var e=a.split(/\W/),f=0,g=e.length;f<g;f++)if(d?e[f].toUpperCase()==c.toUpperCase():e[f]==c)return!0;return!1},a.str.endsWith=function(a,c){return!b.string(a)||b.empty(a)||!b.string(c)||b.empty(c)?a==c:a.slice(a.length-c.length)==c},a.str.escapeRegExp=function(a){return b.empty(a)?a:a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")},a.str.fnv1a=function(a){if(!b.string(a)||b.empty(a))return null;var c,d,e=2166136261;for(c=0,d=a.length;c<d;c++)e^=a.charCodeAt(c),e+=(e<<1)+(e<<4)+(e<<7)+(e<<8)+(e<<24);return e>>>0},a.str.from=function(c,d){return!b.string(c)||b.empty(c)||!b.string(d)||b.empty(d)?null:a.str.contains(c,d)?c.substring(c.indexOf(d)+d.length):null},a.str.join=function(d,e,f){if(!b.string(d)||!b.string(e))return null;var g=c.arg2arr(arguments);d=g.shift();var h,i,j=g.shift();for(h=0,i=g.length;h<i;h++)e=g[h],b.empty(e)||(a.str.endsWith(j,d)&&(j=j.slice(0,j.length-d.length)),a.str.startsWith(e,d)&&(e=e.slice(d.length)),j+=d+e);return j},a.str.startsWith=function(a,c){return!b.empty(a)&&!b.empty(c)&&a.slice(0,c.length)==c},a.str.until=function(c,d){return b.empty(c)||b.empty(d)?c:a.str.contains(c,d)?c.substring(0,c.indexOf(d)):c},a.str.format=function(a,d,e){var f=c.arg2arr(arguments);if(a=f.shift(),b.empty(a)||b.empty(f))return a;1===f.length&&(b.array(f[0])||b.object(f[0]))&&(f=f[0]);for(var g in f)a=a.replace(new RegExp("\\{"+g+"\\}","gi"),f[g]);return a})}(FooGallery.utils,FooGallery.utils.is,FooGallery.utils.fn),function(a,b,c,d,e){if("0.0.5"===b.version){b.obj={};var f=function(){};b.obj.create=function(a){if(!c.object(a))throw TypeError("Argument must be an object");f.prototype=a;var b=new f;return f.prototype=null,b},b.obj.extend=function(e,f,g){e=c.object(e)?e:{};var h=d.arg2arr(arguments);return h.shift(),a.each(h,function(a,c){b.obj.merge(e,c)}),e},b.obj.merge=function(a,d){a=c.object(a)?a:{},d=c.object(d)?d:{};for(var e in d)d.hasOwnProperty(e)&&(c.object(d[e])?(a[e]=c.object(a[e])?a[e]:{},b.obj.merge(a[e],d[e])):c.array(d[e])?a[e]=d[e].slice():a[e]=d[e]);return a},b.obj.mergeValid=function(d,e,f,g){if(!c.hash(f)||!c.hash(e))return d;e=c.hash(e)?e:{},g=c.hash(g)?g:{};var h,i,j;for(h in e)e.hasOwnProperty(h)&&c.fn(e[h])&&(i=c.array(g[h])?g[h]:c.string(g[h])?[g[h]]:[h],a.each(i,function(a,g){if(j=b.obj.prop(f,g),!c.undef(j))return e[h](j)?(b.obj.prop(d,h,j),!1):void 0}));return d},b.obj.prop=function(b,d,f){if(c.object(b)&&!c.empty(d)){var g,h;if(c.undef(f))return e.contains(d,".")?(g=d.split("."),h=g.length-1,a.each(g,function(a,d){if(a===h)f=b[d];else{if(!c.hash(b[d]))return!1;b=b[d]}})):c.undef(b[d])||(f=b[d]),f;e.contains(d,".")?(g=d.split("."),h=g.length-1,a.each(g,function(a,d){a===h?b[d]=f:b=c.hash(b[d])?b[d]:b[d]={}})):c.undef(b[d])||(b[d]=f)}}}}(FooGallery.utils.$,FooGallery.utils,FooGallery.utils.is,FooGallery.utils.fn,FooGallery.utils.str),function(a,b,c){if("0.0.5"===b.version){b.ready=function(a){function c(){try{a.call(window,b.$)}catch(a){console.error(a)}}(Function("/*@cc_on return true@*/")()?"complete"===document.readyState:"loading"!==document.readyState)?c():document.addEventListener("DOMContentLoaded",c,!1)};var d=0;b.uniqueId=function(a,b){var e=a.attr("id");return c.empty(e)&&(b=c.string(b)&&!c.empty(b)?b:"uid-",e=b+ ++d,a.attr("id",e).data("__uniqueId__",!0)),e},b.removeUniqueId=function(a){a.data("__uniqueId__")&&a.removeAttr("id").removeData("__uniqueId__")}}}(FooGallery.utils.$,FooGallery.utils,FooGallery.utils.is),function(a,b,c){if("0.0.5"===b.version){b.transition={};var d=document.createElement("div");b.transition.supported=function(a){var b=a.style;return c.string(b.transition)||c.string(b.WebkitTransition)||c.string(b.MozTransition)||c.string(b.msTransition)||c.string(b.OTransition)}(d),b.transition.end=function(a){var b=a.style;return c.string(b.transition)?"transitionend":c.string(b.WebkitTransition)?"webkitTransitionEnd":c.string(b.MozTransition)?"transitionend":c.string(b.msTransition)?"msTransitionEnd":c.string(b.OTransition)?"oTransitionEnd":null}(d),b.transition.duration=function(a,b){if(b=c.number(b)?b:0,!c.jq(a))return b;var d=a.css("transition-duration");if(/^([\d\.]*)+?(ms|s)$/i.test(d)){var e=d.match(/^([\d\.]*)+?(ms|s)$/i),f=parseFloat(e[1]);return"s"===e[2].toLowerCase()&&(f*=1e3),f}return b},b.transition.start=function(d,e,f,g){var h=a.Deferred();if(d=d.first(),b.transition.supported){var i=d.data("transition_safety");c.hash(i)&&c.number(i.timer)&&(clearTimeout(i.timer),d.removeData("transition_safety").off(b.transition.end+".utils"),i.deferred.reject()),g=c.number(g)?g:b.transition.duration(d)+50,i={deferred:h,timer:setTimeout(function(){d.removeData("transition_safety").off(b.transition.end+".utils"),h.resolve()},g)},d.data("transition_safety",i),d.on(b.transition.end+".utils",function(a){d.is(a.target)&&(clearTimeout(i.timer),d.removeData("transition_safety").off(b.transition.end+".utils"),h.resolve())})}return setTimeout(function(){d.toggleClass(e,f),b.transition.supported||h.resolve()},20),h.promise()}}}(FooGallery.utils.$,FooGallery.utils,FooGallery.utils.is),function(a,b,c,d,e){"0.0.5"===b.version&&(b.Class=function(){},b.Class.extend=function(a){function f(){if(!c.fn(this.construct))throw new SyntaxError('FooGallery.utils.Class objects must be constructed with the "new" keyword.');this.construct.apply(this,arguments)}a=c.hash(a)?a:{};var g=d.create(this.prototype);for(var h in a)a.hasOwnProperty(h)&&e.addOrOverride(g,h,a[h]);return g.construct=c.fn(g.construct)?g.construct:function(){},f.prototype=g,f.prototype.constructor=c.fn(g.__ctor__)?g.__ctor__:f,f.extend=b.Class.extend,f.override=b.Class.override,f},b.Class.override=function(a,b){e.addOrOverride(this.prototype,a,b)})}(FooGallery.utils.$,FooGallery.utils,FooGallery.utils.is,FooGallery.utils.obj,FooGallery.utils.fn),function(a,b,c){if("0.0.5"===b.version){b.Bounds=b.Class.extend({construct:function(){var a=this;a.top=0,a.right=0,a.bottom=0,a.left=0,a.width=0,a.height=0},inflate:function(a){var b=this;return c.number(a)&&(b.top-=a,b.right+=a,b.bottom+=a,b.left-=a,b.width+=2*a,b.height+=2*a),b},intersects:function(a){var b=this;return b.left<=a.right&&a.left<=b.right&&b.top<=a.bottom&&a.top<=b.bottom}});var d;b.getViewportBounds=function(c){d||(d=a(window));var e=new b.Bounds;return e.top=d.scrollTop(),e.left=d.scrollLeft(),e.width=d.width(),e.height=d.height(),e.right=e.left+e.width,e.bottom=e.top+e.height,e.inflate(c),e},b.getElementBounds=function(d){c.jq(d)||(d=a(d));var e=new b.Bounds;if(0!==d.length){var f=d.offset();e.top=f.top,e.left=f.left,e.width=d.width(),e.height=d.height()}return e.right=e.left+e.width,e.bottom=e.top+e.height,e}}}(FooGallery.utils.$,FooGallery.utils,FooGallery.utils.is),function(a,b,c,d){"0.0.5"===b.version&&(b.Factory=b.Class.extend({construct:function(){this.registered={}},contains:function(a){return!c.undef(this.registered[a])},load:function(b,e,f){var g,h,i=this,j=d.arg2arr(arguments),k=[],l=[];b=j.shift()||{};for(g in i.registered)if(i.registered.hasOwnProperty(g)){var m=i.registered[g];b.hasOwnProperty(g)&&(h=b[g],c.string(h)&&(h=d.fetch(b[g])),c.fn(h)&&(m={name:g,klass:h,priority:i.registered[g].priority})),k.push(m)}for(g in b)b.hasOwnProperty(g)&&!i.registered.hasOwnProperty(g)&&(h=b[g],c.string(h)&&(h=d.fetch(b[g])),c.fn(h)&&k.push({name:g,klass:h,priority:0}));return k.sort(function(a,b){return b.priority-a.priority}),a.each(k,function(a,b){c.fn(b.klass)&&l.push(d.apply(b.klass,j))}),l},make:function(a,b,e){var f,g=this,h=d.arg2arr(arguments);return a=h.shift(),f=g.registered[a],c.hash(f)&&c.fn(f.klass)?d.apply(f.klass,h):null},names:function(b){b=!!c.boolean(b)&&b;var d,e=[];if(b){var f=[];for(d in this.registered)this.registered.hasOwnProperty(d)&&f.push(this.registered[d]);f.sort(function(a,b){return b.priority-a.priority}),a.each(f,function(a,b){e.push(b.name)})}else for(d in this.registered)this.registered.hasOwnProperty(d)&&e.push(d);return e},register:function(a,b,d){if(!c.string(a)||c.empty(a)||!c.fn(b))return!1;d=c.number(d)?d:0;var e=this.registered[a];return this.registered[a]={name:a,klass:b,priority:c.undef(e)?d:e.priority},!0}}))}(FooGallery.utils.$,FooGallery.utils,FooGallery.utils.is,FooGallery.utils.fn),function(a,b,c){"0.0.5"===a.version&&(a.Debugger=a.Class.extend({construct:function(a){this.key=a,this.enabled=!!localStorage.getItem(this.key)},enable:function(){this.enabled=!0,localStorage.setItem(this.key,this.enabled)},disable:function(){this.enabled=!1,localStorage.removeItem(this.key)},log:function(a,c){this.enabled&&console.log.apply(console,b.arg2arr(arguments))},logf:function(a,d,e){if(this.enabled){var f=b.arg2arr(arguments);a=f.shift(),d=f.shift(),f.unshift(c.format(a,d)),this.log.apply(this,f)}}}))}(FooGallery.utils,FooGallery.utils.fn,FooGallery.utils.str),function(a,b,c){"0.0.5"===b.version&&(b.Throttle=b.Class.extend({construct:function(a){this.id=null,this.active=!1,this.idle=c.number(a)?a:0},limit:function(a){if(c.fn(a)){this.clear();var b=this;this.active=!0,this.id=setTimeout(function(){b.active=!1,b.id=null,a()},this.idle)}},clear:function(){c.number(this.id)&&(clearTimeout(this.id),this.active=!1,this.id=null)}}))}(FooGallery.utils.$,FooGallery.utils,FooGallery.utils.is),function(a,b,c,d,e){b.debug=new c.Debugger("__FooGallery__"),c.selectify=function(b){if(d.hash(b)){var e,f={};for(var g in b)b.hasOwnProperty(g)&&(e=c.selectify(b[g]))&&(f[g]=e);return f}return d.string(b)||d.array(b)?(d.string(b)&&(b=[b]),a.map(b,function(a){return d.string(a)?"."+a.split(/\s/g).join("."):null}).join(",")):null},b.emptyImage="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",b.dataTemplate="__FooGallery__",b.dataItem="__FooGalleryItem__",b.init=function(a,c){return b.template.make(a,c).initialize()},b.initAll=function(c){return e.when(a(".foogallery").map(function(a,d){return b.init(c,d)}).get())},b.parseSrc=function(b,c,e,f,g,h){if(!d.string(b))return null;if(!d.string(f))return b;var i=a.map(f.replace(/(\s[\d.]+[whx]),/g,"$1 @,@ ").split(" @,@ "),function(a){return{url:/^\s*(\S*)/.exec(a)[1],w:parseFloat((/\S\s+(\d+)w/.exec(a)||[0,1/0])[1]),h:parseFloat((/\S\s+(\d+)h/.exec(a)||[0,1/0])[1]),x:parseFloat((/\S\s+([\d.]+)x/.exec(a)||[0,1])[1])}});if(!i.length)return b;i.unshift({url:b,w:i[0].w!==1/0&&i[0].h===1/0?c:1/0,h:i[0].h!==1/0&&i[0].w===1/0?e:1/0,x:1});var j,k=window.devicePixelRatio||1,l={w:g*k,h:h*k,x:k};for(j in l)l.hasOwnProperty(j)&&(i=a.grep(i,function(a,b){return function(c){return c[a]>=l[a]||c[a]===b}}(j,Math.max.apply(null,a.map(i,function(a){return a[j]})))));for(j in l)l.hasOwnProperty(j)&&(i=a.grep(i,function(a,b){return function(c){return c[a]===b}}(j,Math.min.apply(null,a.map(i,function(a){return a[j]})))));return i[0].url},a.fn.foogallery=function(c,e){return this.filter(".foogallery").each(function(f,g){if(d.string(c)){var h=a.data(g,b.dataTemplate);if(h instanceof b.Template)switch(c){case"layout":return void h.layout();case"destroy":return void h.destroy()}}else b.template.make(c,g).initialize().then(function(a){d.fn(e)&&e(a)})})},a(function(){a('[id^="foogallery-"]').foogallery()})}(FooGallery.$,FooGallery,FooGallery.utils,FooGallery.utils.is,FooGallery.utils.fn),function(a,b,c,d,e,f){b.TemplateFactory=c.Factory.extend({construct:function(){this.registered={}},register:function(a,b,c,e,f,g){var h=this,i=h._super(a,b,g);if(i){var j=h.registered;j[a].opt=d.hash(c)?c:{},j[a].cls=d.hash(e)?e:{},j[a].il8n=d.hash(f)?f:{}}return i},make:function(b,c){c=d.jq(c)?c:a(c),b=f.merge(b,c.data("foogallery"));var e=this,g=e.type(b,c);return e.contains(g)?(b=e.options(g,b),e._super(g,b,c)):null},type:function(b,e){e=d.jq(e)?e:a(e);var f=this,g=d.hash(b)&&d.hash(b)&&d.string(b.type)&&f.contains(b.type)?b.type:"core";if("core"===g&&e.length>0)for(var h=f.registered,i=f.names(!0),j=0,k=i.length;j<k;j++)if(h.hasOwnProperty(i[j])){var l=i[j],m=h[l].cls;if(d.string(m.container)){var n=c.selectify(m.container);if(e.is(n)){g=i[j];break}}}return g},configure:function(a,b,c,d){var e=this;if(e.contains(a)){var g=e.registered;f.extend(g[a].opt,b),f.extend(g[a].cls,c),f.extend(g[a].il8n,d)}},options:function(a,c){c=d.hash(c)?c:{};var e=this,g=e.registered,h=g.core.opt,i=g.core.cls,j=g.core.il8n;return c=b.paging.merge(c),"core"!==a&&e.contains(a)?(c=f.extend({},h,g[a].opt,c),c.cls=f.extend({},i,g[a].cls,c.cls),c.il8n=f.extend({},j,g[a].il8n,c.il8n)):(c=f.extend({},h,c),c.cls=f.extend({},i,c.cls),c.il8n=f.extend({},j,c.il8n)),c}}),b.template=new b.TemplateFactory}(FooGallery.$,FooGallery,FooGallery.utils,FooGallery.utils.is,FooGallery.utils.fn,FooGallery.utils.obj),function(a,b,c,d,e){a.PagingFactory=b.Factory.extend({construct:function(){this.registered={}},register:function(a,b,d,e,f,g,h){var i=this,j=i._super(a,b,h);if(j){var k=i.registered;k[a].ctrl=c.fn(d)?d:null,k[a].opt=c.hash(e)?e:{},k[a].cls=c.hash(f)?f:{},k[a].il8n=c.hash(g)?g:{}}return j},type:function(a){var b,d=this;return c.hash(a)&&c.hash(b=a.paging)&&c.string(b.type)&&d.contains(b.type)?b.type:null},merge:function(a){a=c.hash(a)?a:{};var b=this,d=b.type(a),f=b.registered,g=f.default.opt,h=f.default.cls,i=f.default.il8n,j=c.hash(a.paging)?a.paging:{},k=c.hash(a.cls)&&c.hash(a.cls.paging)?a.cls.paging:{},l=c.hash(a.il8n)&&c.hash(a.il8n.paging)?a.il8n.paging:{};return"default"!==d&&b.contains(d)?(a.paging=e.extend({},g,f[d].opt,j,{type:d}),a.cls=e.extend({},{paging:h},{paging:f[d].cls},{paging:k}),a.il8n=e.extend({},{paging:i},{paging:f[d].il8n},{paging:l})):(a.paging=e.extend({},g,j,{type:d}),a.cls=e.extend({},{paging:h},{paging:k}),a.il8n=e.extend({},{paging:i},{paging:l})),a},configure:function(a,b,c,d){var f=this;if(f.contains(a)){var g=f.registered;e.extend(g[a].opt,b),e.extend(g[a].cls,c),e.extend(g[a].il8n,d)}},options:function(a,b){b=c.hash(b)?b:{};var d=this,f=d.registered,g=f.default.opt,h=f.default.cls,i=f.default.il8n,j=c.hash(b.paging)?b.paging:{},k=c.hash(b.cls)&&c.hash(b.cls.paging)?b.cls.paging:{},l=c.hash(b.il8n)&&c.hash(b.il8n.paging)?b.il8n.paging:{};return"default"!==a&&d.contains(a)?(b.paging=e.extend({},g,f[a].opt,j,{type:a}),b.cls=e.extend({},{paging:h},{paging:f[a].cls},{paging:k}),b.il8n=e.extend({},{paging:i},{paging:f[a].il8n},{paging:l})):(b.paging=e.extend({},g,j,{type:a}),b.cls=e.extend({},{paging:h},{paging:k}),b.il8n=e.extend({},{paging:i},{paging:l})),b},hasCtrl:function(a){var b=this,d=b.registered[a];return c.hash(d)&&c.fn(d.ctrl)},makeCtrl:function(a,b,d,e){var f=this,g=f.registered[a];return c.hash(g)&&c.fn(g.ctrl)?new g.ctrl(b,d,e):null}}),a.paging=new a.PagingFactory}(FooGallery,FooGallery.utils,FooGallery.utils.is,FooGallery.utils.fn,FooGallery.utils.obj),function(a,b,c,d,e,f){b.Template=c.Class.extend({construct:function(e,f){var g=this;g.$el=d.jq(f)?f:a(f),g.opt=e,g.template=e.template,g.id=g.$el.prop("id")||e.id,g.createdSelf=!1,g.cls=e.cls,g.il8n=e.il8n,g.sel=c.selectify(g.cls),g.items=b.components.make("items",g),g.pages=b.paging.make(e.paging.type,g),g.state=b.components.make("state",g),g._throttle=new c.Throttle(g.opt.throttle),g._initialize=null,g.initializing=!1,g.initialized=!1,g.destroying=!1,g.destroyed=!1},initialize:function(c){var f=this;return d.promise(f._initialize)?f._initialize:(c=d.jq(c)?c:a(c),f._initialize=a.Deferred(function(g){if(f.initializing=!0,0===c.length&&0===f.$el.parent().length)return void g.reject("A parent element is required.");0===f.$el.length&&(f.$el=f.create(),f.createdSelf=!0),c.length>0&&f.$el.appendTo(c);var h,i=a.Deferred();f.$el.length>0&&(h=f.$el.data(b.dataTemplate))instanceof b.Template?i.then(function(){return h.destroy().then(function(){f.$el.data(b.dataTemplate,f)})}):f.$el.data(b.dataTemplate,f),i.then(function(){return f.destroying?e.rejectWith("destroy in progress"):(d.empty(f.opt.on)||f.$el.on(f.opt.on),f.raise("pre-init").isDefaultPrevented()?e.rejectWith("pre-init default prevented"):void 0)}).then(function(){return f.destroying?e.rejectWith("destroy in progress"):f.opt.delay<=0?e.resolved:a.Deferred(function(a){f._delay=setTimeout(function(){f._delay=null,a.resolve()},f.opt.delay)}).promise()}).then(function(){return f.destroying?e.rejectWith("destroy in progress"):f.raise("init").isDefaultPrevented()?e.rejectWith("init default prevented"):f.items.fetch()}).then(function(){if(f.destroying)return e.rejectWith("destroy in progress");if(f.raise("post-init").isDefaultPrevented())return e.rejectWith("post-init default prevented");var b=f.state.parse();f.state.set(d.empty(b)?f.state.initial():b),a(window).on("scroll.foogallery",{self:f},f.onWindowScroll).on("popstate.foogallery",{self:f},f.onWindowPopState)}).then(function(){return f.destroying?e.rejectWith("destroy in progress"):(f.raise("first-load"),f.loadAvailable())}).then(function(){if(f.destroying)return e.rejectWith("destroy in progress");f.initializing=!1,f.initialized=!0,f.raise("ready"),g.resolve(f)}).fail(function(a){g.reject(a)}),i.resolve()}).promise().fail(function(a){console.log("initialize failed",f,a),f.destroy()}))},create:function(){var b=this;return a("<div/>",{id:b.id,class:b.cls.container}).addClass(b.opt.classes)},destroy:function(){var a=this;return a.destroyed?e.resolved:(a.destroying=!0,a.initializing&&d.promise(a._initialize)?a._initialize.always(function(){a.destroying=!1,a._destroy()}):(a.destroying=!1,a._destroy(),e.resolved))},_destroy:function(){var c=this;c.destroyed||(c.raise("destroy"),a(window).off("popstate.foogallery",c.onWindowPopState).off("scroll.foogallery",c.onWindowScroll),c.state.destroy(),c.pages&&c.pages.destroy(),c.items.destroy(),d.empty(c.opt.on)||c.$el.off(c.opt.on),c.raise("destroyed"),c.$el.removeData(b.dataTemplate),c.createdSelf&&c.$el.remove(),c.$el=c.state=c.items=c.pages=null,c.destroyed=!0,c.initializing=!1,c.initialized=!1)},loadAvailable:function(){var a,b=this;return a=b.pages?b.pages.available():b.items.available(),b.items.load(a)},raise:function(c,e){if(!d.string(c)||d.empty(c))return null;e=d.array(e)?e:[];var g=this,h=c.split(".")[0],i=f.camel("on-"+h),j=a.Event(h+".foogallery");return e.unshift(g),g.$el.trigger(j,e),b.debug.logf("{id}|{name}:",{id:g.id,name:h},e),d.fn(g[i])&&(e.unshift(j),g[i].apply(g.$el.get(0),e)),j},layout:function(){var a=this;null!==a._initialize&&a.raise("layout")},onWindowPopState:function(a){var b=a.data.self,c=a.originalEvent.state;d.empty(c)||c.id!==b.id||(b.state.set(c),b.loadAvailable())},onWindowScroll:function(a){var b=a.data.self;b._throttle.limit(function(){b.loadAvailable()})}}),b.template.register("core",b.Template,{id:null,type:"core",classes:"",on:{},lazy:!0,viewport:200,items:[],delay:100,throttle:50,timeout:6e4,srcset:"data-srcset",src:"data-src",template:{}},{container:"foogallery"},{},-100)}(FooGallery.$,FooGallery,FooGallery.utils,FooGallery.utils.is,FooGallery.utils.fn,FooGallery.utils.str),function(a,b){a.Component=b.Class.extend({construct:function(a){this.tmpl=a},destroy:function(){this.tmpl=null}}),a.components=new b.Factory}(FooGallery,FooGallery.utils),function(a,b,c,d){b.State=b.Component.extend({construct:function(a){var b=this;b._super(a),b.apiEnabled=!!window.history&&!!history.replaceState,b.opt=b.tmpl.opt.state,b.enabled=b.opt.enabled,b.pushOrReplace=b.isPushOrReplace(b.opt.pushOrReplace)?b.opt.pushOrReplace:"replace";var c=d.escapeRegExp(b.tmpl.id),e=d.escapeRegExp(b.opt.values),f=d.escapeRegExp(b.opt.pair);b.regex={exists:new RegExp("^#"+c+"\\"+e+".+?"),values:new RegExp("(\\w+)"+f+"([^"+e+"]+)","g")}},destroy:function(){var a=this;a.clear(),a.opt=a.regex={},a._super()},isPushOrReplace:function(b){return-1!==a.inArray(b,["push","replace"])},exists:function(){return this.regex.exists.test(location.hash)&&this.regex.values.test(location.hash)},parse:function(){var b=this,d={};if(b.exists())if(b.enabled){d.id=b.tmpl.id;var e=location.hash.match(b.regex.values);a.each(e,function(e,f){var g=f.split(b.opt.pair);2===g.length&&(d[g[0]]=-1===g[1].indexOf(b.opt.array)?decodeURIComponent(g[1]):a.map(g[1].split(b.opt.array),function(a){return decodeURIComponent(a)}),c.string(d[g[0]])&&!isNaN(d[g[0]])&&(d[g[0]]=parseInt(d[g[0]])))})}else b.apiEnabled?history.replaceState(null,"",location.pathname+location.search):location.hash="#";return d},hashify:function(b){var d=this;if(c.hash(b)){var e=[];return a.each(b,function(b,f){c.empty(f)||"id"===b||(f=c.array(f)?a.map(f,function(a){return encodeURIComponent(a)}).join("+"):encodeURIComponent(f),e.push(b+d.opt.pair+f))}),e.length>0&&e.unshift("#"+d.tmpl.id),e.join(d.opt.values)}return""},replace:function(a){var b=this;if(b.enabled&&b.apiEnabled){a.id=b.tmpl.id;var d=b.hashify(a),e=c.empty(d);history.replaceState(e?null:a,"",e?location.pathname+location.search:d)}},push:function(a){var b=this;if(b.enabled&&b.apiEnabled){a.id=b.tmpl.id;var d=b.hashify(a),e=c.empty(d);history.pushState(e?null:a,"",e?location.pathname+location.search:d)}},update:function(a,b){var c=this;c.enabled&&c.apiEnabled&&(b=c.isPushOrReplace(b)?b:c.pushOrReplace,c[b](a))},clear:function(){this.exists()&&this.replace({})},initial:function(){var a=this,b=a.tmpl,c={};return b.pages&&b.pages.current>1&&(c.p=b.pages.current),c},get:function(a){var c=this,d=c.tmpl,e={};return a instanceof b.Item&&(e.i=a.id),d.pages&&d.pages.isValid(d.pages.current)&&(e.p=d.pages.current),e},set:function(a){var b=this,d=b.tmpl;if(c.hash(a)){d.items.reset();var e=d.items.get(a.i);if(d.pages){d.pages.rebuild();var f=d.pages.number(a.p);e&&!d.pages.contains(f,e)&&(f=d.pages.find(e),f=0!==f?f:1),d.pages.set(f,!c.empty(a),!1),e&&d.pages.contains(f,e)&&e.scrollTo()}else d.items.detach(d.items.all()),d.items.create(d.items.available(),!0),e&&e.scrollTo();c.empty(a.i)||(a.i=null,b.replace(a))}}}),b.template.configure("core",{state:{enabled:!1,pushOrReplace:"replace",values:"/",pair:":",array:"+"}}),b.components.register("state",b.State)}(FooGallery.$,FooGallery,FooGallery.utils.is,FooGallery.utils.str),function(a,b,c,d,e,f){b.Item=b.Component.extend({construct:function(a,b){var c=this;c._super(a),c.cls=a.cls.item,c.il8n=a.il8n.item,c.sel=a.sel.item,c.isAttached=!1,c.isCreated=!1,c.isLoading=!1,c.isLoaded=!1,c.isError=!1,c.isParsed=!1,c.$el=null,c.$inner=null,c.$anchor=null,c.$image=null,c.$caption=null,b=f.extend({},a.opt.item,b),c.id=b.id,c.href=b.href,c.src=b.src,c.srcset=b.srcset,c.width=b.width,c.height=b.height,c.title=b.title,c.alt=b.alt,c.caption=d.empty(b.caption)?c.title:b.caption,c.description=d.empty(b.description)?c.alt:b.description,c.attr=b.attr,c.tags=b.tags,c.maxWidth=b.maxWidth,c.maxCaptionLength=b.maxCaptionLength,c.maxDescriptionLength=b.maxDescriptionLength,c.showCaptionTitle=b.showCaptionTitle,c.showCaptionDescription=b.showCaptionDescription,c._thumbUrl=null,c._load=null},destroy:function(){var a=this;return a.tmpl.raise("destroy-item").isDefaultPrevented()||(a.isParsed&&!a.isAttached?a.append():!a.isParsed&&a.isAttached&&a.detach(),a._super()),null===a.tmpl},parse:function(c){var e=this,f=e.tmpl.opt,g=e.cls,h=e.sel,i=a(c);return!e.tmpl.raise("parse-item",[e,i]).isDefaultPrevented()&&(e.isCreated=i.is(h.elem))&&(e.$el=i.data(b.dataItem,e),e.$inner=e.$el.find(h.inner),e.$anchor=e.$el.find(h.anchor).on("click.foogallery",{self:e},e.onAnchorClick),e.$image=e.$anchor.find(h.image),e.$caption=e.$el.find(h.caption.elem).on("click.foogallery",{self:e},e.onCaptionClick),e.isAttached=e.$el.parent().length>0,e.isLoading=e.$el.is(h.loading),e.isLoaded=e.$el.is(h.loaded),e.isError=e.$el.is(h.error),e.id=e.$anchor.data("id"),e.tags=e.$anchor.data("tags"),e.href=e.$anchor.attr("href"),e.src=e.$image.attr(f.src),e.srcset=e.$image.attr(f.srcset),e.width=parseInt(e.$image.attr("width")),e.height=parseInt(e.$image.attr("height")),e.title=e.$image.attr("title"),e.alt=e.$image.attr("alt"),e.caption=e.$anchor.data("title")||e.$anchor.data("captionTitle"),e.description=e.$anchor.data("description")||e.$anchor.data("captionDesc"),d.empty(e.caption)&&(e.caption=e.title),d.empty(e.description)&&(e.description=e.alt),d.number(e.maxCaptionLength)&&e.maxCaptionLength>0&&!d.empty(e.caption)&&d.string(e.caption)&&e.caption.length>e.maxCaptionLength&&e.$caption.find(h.caption.title).html(e.caption.substr(0,e.maxCaptionLength)+"…"),d.number(e.maxDescriptionLength)&&e.maxDescriptionLength>0&&!d.empty(e.description)&&d.string(e.description)&&e.description.length>e.maxDescriptionLength&&e.$caption.find(h.caption.description).html(e.description.substr(0,e.maxDescriptionLength)+"…"),0===e.$el.find(h.loader).length&&e.$el.append(a("<div/>",{class:g.loader})),d.empty(e.$image.prop("src"))&&e.$image.prop("src",e.tmpl.items.placeholder(e.width,e.height)),!e.isCreated||!e.isAttached||e.isLoading||e.isLoaded||e.isError||e.$el.addClass(g.idle),e.fix(),e.isParsed=!0),e.isParsed&&e.tmpl.raise("parsed-item",[e]),e.isParsed},create:function(){var c=this;if(!c.isCreated&&d.string(c.href)&&d.string(c.src)&&d.number(c.width)&&d.number(c.height)){if(!c.tmpl.raise("create-item",[c]).isDefaultPrevented()){var e=c.tmpl.opt,f=c.cls,g=c.attr;g.elem.class=f.elem+" "+f.idle,g.inner.class=f.inner,g.anchor.class=f.anchor,g.anchor.href=c.href,g.anchor["data-id"]=c.id,g.anchor["data-title"]=c.caption,g.anchor["data-description"]=c.description,d.empty(c.tags)||(g.anchor["data-tags"]=JSON.stringify(c.tags)),g.image.class=f.image,g.image.src=c.tmpl.items.placeholder(c.width,c.height),g.image[e.src]=c.src,g.image[e.srcset]=c.srcset,g.image.width=c.width,g.image.height=c.height,g.image.title=c.title,g.image.alt=c.alt,c.$el=a("<div/>").attr(g.elem).data(b.dataItem,c),c.$inner=a("<figure/>").attr(g.inner).appendTo(c.$el),c.$anchor=a("<a/>").attr(g.anchor).appendTo(c.$inner).on("click.foogallery",{self:c},c.onAnchorClick),c.$image=a("<img/>").attr(g.image).appendTo(c.$anchor),f=c.cls.caption,g=c.attr.caption,g.elem.class=f.elem,
|
10 |
+
c.$caption=a("<figcaption/>").attr(g.elem).on("click.foogallery",{self:c},c.onCaptionClick);var h=!d.empty(c.caption),i=!d.empty(c.description);if(h||i){g.inner.class=f.inner,g.title.class=f.title,g.description.class=f.description;var j=a("<div/>").attr(g.inner).appendTo(c.$caption);if(h){var k;k=d.number(c.maxCaptionLength)&&c.maxCaptionLength>0&&d.string(c.caption)&&c.caption.length>c.maxCaptionLength?a("<div/>").attr(g.title).html(c.caption.substr(0,c.maxCaptionLength)+"…"):a("<div/>").attr(g.title).html(c.caption),j.append(k)}if(i){var l;l=d.number(c.maxDescriptionLength)&&c.maxDescriptionLength>0&&d.string(c.description)&&c.description.length>c.maxDescriptionLength?a("<div/>").attr(g.description).html(c.description.substr(0,c.maxDescriptionLength)+"…"):a("<div/>").attr(g.description).html(c.description),j.append(l)}}c.$caption.appendTo(c.$inner),0===c.$el.find(c.sel.loader).length&&c.$el.append(a("<div/>",{class:c.cls.loader})),c.isCreated=!0}c.isCreated&&c.tmpl.raise("created-item",[c])}return c.isCreated},append:function(){var a=this;if(a.isCreated&&!a.isAttached){a.tmpl.raise("append-item",[a]).isDefaultPrevented()||(a.tmpl.$el.append(a.$el),a.fix(),a.isAttached=!0),a.isAttached&&a.tmpl.raise("appended-item",[a])}return a.isAttached},detach:function(){var a=this;if(a.isCreated&&a.isAttached){a.tmpl.raise("detach-item",[a]).isDefaultPrevented()||(a.$el.detach(),a.unfix(),a.isAttached=!1),a.isAttached||a.tmpl.raise("detached-item",[a])}return!a.isAttached},load:function(){var b=this;if(d.promise(b._load))return b._load;if(!b.isCreated||!b.isAttached)return e.rejectWith("not created or attached");if(b.tmpl.raise("load-item",[b]).isDefaultPrevented())return e.rejectWith("default prevented");var c=b.cls,f=b.$image.get(0),g=f.src;return b.isLoading=!0,b.$el.removeClass(c.idle).removeClass(c.loaded).removeClass(c.error).addClass(c.loading),b._load=a.Deferred(function(a){d.undef(window.InstallTrigger)||(f.src=""),f.onload=function(){f.onload=f.onerror=null,b.isLoading=!1,b.isLoaded=!0,b.$el.removeClass(c.loading).addClass(c.loaded),b.unfix(),b.tmpl.raise("loaded-item",[b]),a.resolve(b)},f.onerror=function(){f.onload=f.onerror=null,b.isLoading=!1,b.isError=!0,b.$el.removeClass(c.loading).addClass(c.error),d.string(g)&&b.$image.prop("src",g),b.tmpl.raise("error-item",[b]),a.reject(b)},f.src=b.getThumbUrl()}).promise()},fix:function(){var a=this;if(a.isCreated&&!a.isLoading&&!a.isLoaded&&!a.isError){var b=a.width,c=a.height;if(!isNaN(b)&&!isNaN(c)){var e=d.fn(a.maxWidth)?a.maxWidth(a):a.$image.width();e<=0&&(e=b);var f=e/b,g=c*f;a.$image.css({width:e,height:g})}}return a},unfix:function(){var a=this;return a.isCreated&&a.$image.css({width:"",height:""}),a},getThumbUrl:function(a){a=!!d.boolean(a)&&a;var c=this;return!a&&d.string(c._thumbUrl)?c._thumbUrl:c._thumbUrl=b.parseSrc(c.src,c.width,c.height,c.srcset,c.$anchor.innerWidth(),c.$anchor.innerHeight())},scrollTo:function(a){var b=this;if(b.isAttached){var d=b.bounds(),e=c.getViewportBounds();switch(a){case"top":d.left+=d.width/2-e.width/2,d.top-=e.height/5;break;default:d.left+=d.width/2-e.width/2,d.top+=d.height/2-e.height/2}window.scrollTo(d.left,d.top)}return b},bounds:function(){return this.isAttached?c.getElementBounds(this.$el):null},intersects:function(a){return!!this.isAttached&&this.bounds().intersects(a)},onAnchorClick:function(a){var b=a.data.self,c=b.tmpl.state.get(b);b.tmpl.state.update(c)},onCaptionClick:function(b){var c=b.data.self;a(b.target).is(c.sel.caption.all)&&c.$anchor.length>0&&c.$anchor.get(0).click()}}),b.template.configure("core",{item:{id:"",href:"",src:"",srcset:"",width:0,height:0,title:"",alt:"",caption:"",description:"",tags:[],maxWidth:null,maxCaptionLength:0,maxDescriptionLength:0,showCaptionTitle:!0,showCaptionDescription:!0,attr:{elem:{},inner:{},anchor:{},image:{},caption:{elem:{},inner:{},title:{},description:{}}}}},{item:{elem:"fg-item",inner:"fg-item-inner",anchor:"fg-thumb",image:"fg-image",loader:"fg-loader",idle:"fg-idle",loading:"fg-loading",loaded:"fg-loaded",error:"fg-error",caption:{elem:"fg-caption",inner:"fg-caption-inner",title:"fg-caption-title",description:"fg-caption-desc"}}}),b.components.register("item",b.Item)}(FooGallery.$,FooGallery,FooGallery.utils,FooGallery.utils.is,FooGallery.utils.fn,FooGallery.utils.obj),function(a,b,c,d,e){b.Items=b.Component.extend({construct:function(a){var b=this;b._super(a),b.idMap={},b._fetched=null,b._arr=[],b._available=[],b._canvas=document.createElement("canvas");var d=b.tmpl.cls.item.caption;b.tmpl.sel.item.caption.all=c.selectify([d.elem,d.inner,d.title,d.description])},destroy:function(){var b=this,c=b.all(),d=[];c.length>0&&(b.tmpl.raise("destroy-items",[c]),d=a.map(c,function(a){return a.destroy()?a:null}),d.length>0&&b.tmpl.raise("destroyed-items",[d])),b.idMap={},b._canvas=b._fetched=null,b._arr=[],b._available=[],b._super()},fetch:function(b){var c=this;if(!b&&d.promise(c._fetched))return c._fetched;var e=c.tmpl,f=e.sel,g=e.opt.items,h=a.Deferred(),i=c.make(e.$el.find(f.item.elem));return d.empty(g)?(i.push.apply(i,c.make(window[e.id+"-items"])),h.resolve(i)):d.array(g)?(i.push.apply(i,c.make(g)),h.resolve(i)):d.string(g)?a.get(g).then(function(a){i.push.apply(i,c.make(a)),h.resolve(i)},function(a,b,c){console.log("FooGallery: GET items error.",g,a,b,c),h.resolve(i)}):h.resolve(i),h.then(function(a){c._arr=a,c.idMap=c.createIdMap(a),c.setAvailable(c.all())}),c._fetched=h.promise()},all:function(){return this._arr.slice()},available:function(){return this._available.slice()},get:function(a){return!d.empty(a)&&this.idMap[a]?this.idMap[a]:null},setAvailable:function(a){this._available=d.array(a)?a:[]},reset:function(){this.setAvailable(this.all())},placeholder:function(a,c){return this._canvas&&this._canvas.toDataURL&&d.number(a)&&d.number(c)?(this._canvas.width=a,this._canvas.height=c,this._canvas.toDataURL()):b.emptyImage},loadable:function(b){var e,f=this,g=f.tmpl.opt;return g.lazy&&(e=c.getViewportBounds(g.viewport)),d.array(b)?a.map(b,function(a){return a.isCreated&&a.isAttached&&!a.isLoading&&!a.isLoaded&&!a.isError&&(!g.lazy||g.lazy&&a.intersects(e))?a:null}):[]},creatable:function(c){return d.array(c)?a.map(c,function(a){return a instanceof b.Item&&!a.isCreated?a:null}):[]},appendable:function(c){return d.array(c)?a.map(c,function(a){return a instanceof b.Item&&a.isCreated&&!a.isAttached?a:null}):[]},detachable:function(c){return d.array(c)?a.map(c,function(a){return a instanceof b.Item&&a.isCreated&&a.isAttached?a:null}):[]},jquerify:function(b){return a(a.map(b,function(a){return a.$el.get()}))},make:function(c){var e=this,f=[];if(d.jq(c)||d.array(c)){var g=[],h=a.makeArray(c);if(0===h.length)return f;e.tmpl.raise("make-items",[h]).isDefaultPrevented()||(f=a.map(h,function(a){var c=b.components.make("item",e.tmpl,d.hash(a)?a:{});return d.element(a)?c.parse(a)?(g.push(c),c):null:c})),f.length>0&&e.tmpl.raise("made-items",[f]),g.length>0&&e.tmpl.raise("parsed-items",[g])}return f},create:function(b,c){var e=this,f=[],g=e.creatable(b);if(g.length>0){e.tmpl.raise("create-items",[g]).isDefaultPrevented()||(f=a.map(g,function(a){return a.create()?a:null})),f.length>0&&e.tmpl.raise("created-items",[f])}return d.boolean(c)&&c?e.append(b):f},append:function(b){var c=this,d=[],e=c.appendable(b);if(e.length>0){c.tmpl.raise("append-items",[e]).isDefaultPrevented()||(d=a.map(e,function(a){return a.append()?a:null})),d.length>0&&c.tmpl.raise("appended-items",[d])}return d},detach:function(b){var c=this,d=[],e=c.detachable(b);if(e.length>0){c.tmpl.raise("detach-items",[e]).isDefaultPrevented()||(d=a.map(e,function(a){return a.detach()?a:null})),d.length>0&&c.tmpl.raise("detached-items",[d])}return d},load:function(b){var c=this;if(b=c.loadable(b),b.length>0){if(!c.tmpl.raise("load-items",[b]).isDefaultPrevented()){var d=a.map(b,function(a){return a.load()});return e.when(d).done(function(a){c.tmpl.raise("loaded-items",[a])})}}return e.resolveWith([])},createIdMap:function(b){var c={};return a.each(b,function(a,b){d.empty(b.id)&&(b.id=""+(a+1)),c[b.id]=b}),c}}),b.components.register("items",b.Items)}(FooGallery.$,FooGallery,FooGallery.utils,FooGallery.utils.is,FooGallery.utils.fn,FooGallery.utils.str),function(a,b,c,d){b.Paging=b.Component.extend({construct:function(a){var b=this;b._super(a),b.opt=b.tmpl.opt.paging,b.cls=b.tmpl.cls.paging,b.il8n=b.tmpl.il8n.paging,b.sel=b.tmpl.sel.paging,b.pushOrReplace=b.opt.pushOrReplace,b.type=b.opt.type,b.theme=b.opt.theme,b.size=b.opt.size,b.position=b.opt.position,b.scrollToTop=b.opt.scrollToTop,b.current=0,b.total=0,b.ctrls=[],b._arr=[]},destroy:function(){var b=this;b._arr.splice(0,b._arr.length),a.each(b.ctrls.splice(0,b.ctrls.length),function(a,b){b.destroy()}),b._super()},build:function(){var a=this,c=a.tmpl.items.available();if(a.total=a.size>0&&c.length>0?Math.ceil(c.length/a.size):1,a.total<=1)a._arr.push(c),a.tmpl.items.detach(a._arr[0]);else for(var d=0;d<a.total;d++)a._arr.push(c.splice(0,a.size)),a.tmpl.items.detach(a._arr[d]);if(a.total>1&&b.paging.hasCtrl(a.type)){var e,f,g=a.position;"both"!==g&&"top"!==g||(e=b.paging.makeCtrl(a.type,a.tmpl,a,"top"),e.create()&&(e.append(),a.ctrls.push(e))),"both"!==g&&"bottom"!==g||(f=b.paging.makeCtrl(a.type,a.tmpl,a,"bottom"),f.create()&&(f.append(),a.ctrls.push(f)))}},rebuild:function(){var b=this;b.current=0,b.total=0,b._arr.splice(0,b._arr.length),a.each(b.ctrls.splice(0,b.ctrls.length),function(a,b){b.destroy()}),b.build()},all:function(){return this._arr.slice()},available:function(){return this.get(this.current)},controls:function(b){var c=this;c.isValid(b)&&a.each(c.ctrls,function(a,c){c.update(b)})},isValid:function(a){return d.number(a)&&a>0&&a<=this.total},number:function(a){return this.isValid(a)?a:0===this.current?1:this.current},create:function(a){var b=this;a=b.number(a);var c=a-1;b.tmpl.items.create(b._arr[c],!0);for(var d=0,e=b._arr.length;d<e;d++)d!==c&&b.tmpl.items.detach(b._arr[d]);b.current=a},get:function(a){var b=this;return b.isValid(a)?(a=b.number(a),b._arr[a-1]):[]},set:function(a,b,c){var e=this;if(e.isValid(a)){e.controls(a);var f,g=e.number(a);if(g!==e.current){var h=e.current,i=function(){if(c=!d.boolean(c)||c,c&&1===e.current&&!e.tmpl.state.exists()&&(f=e.tmpl.state.get(),e.tmpl.state.update(f,e.pushOrReplace)),e.create(g),c&&(f=e.tmpl.state.get(),e.tmpl.state.update(f,e.pushOrReplace)),e.scrollToTop&&d.boolean(b)&&b){var a=e.get(e.current);a.length>0&&a[0].scrollTo("top")}e.tmpl.raise("after-page-change",[e.current,h])};return!e.tmpl.raise("before-page-change",[e.current,g,i]).isDefaultPrevented()&&(i(),!0)}}return!1},find:function(b){for(var c=this,d=0,e=c._arr.length;d<e;d++)if(-1!==a.inArray(b,c._arr[d]))return d+1;return 0},contains:function(b,c){var d=this.get(b);return-1!==a.inArray(c,d)},first:function(){this.goto(1)},last:function(){this.goto(this._arr.length)},prev:function(){this.goto(this.current-1)},next:function(){this.goto(this.current+1)},goto:function(a){var b=this;b.set(a,!0)&&b.tmpl.loadAvailable()}}),b.PagingControl=b.Component.extend({construct:function(a,b,c){var d=this;d._super(a),d.pages=b,d.position=c,d.$container=null},create:function(){var b=this;return b.$container=a("<nav/>",{class:b.pages.cls.container}).addClass(b.pages.theme),!0},destroy:function(){var a=this;a.$container.remove(),a.$container=null},append:function(){var a=this;"top"===a.position?a.$container.insertBefore(a.tmpl.$el):a.$container.insertAfter(a.tmpl.$el)},update:function(a){}}),b.paging.register("default",b.Paging,null,{type:"none",theme:"fg-light",size:30,pushOrReplace:"push",position:"none",scrollToTop:!0},{container:"fg-paging-container"},null,-100)}(FooGallery.$,FooGallery,FooGallery.utils,FooGallery.utils.is),function(a,b,c,d){b.Dots=b.Paging.extend({}),b.DotsControl=b.PagingControl.extend({construct:function(b,c,d){this._super(b,c,d),this.$container=a(),this.$list=a(),this.$items=a()},create:function(){for(var b,c=this,d=c.pages.cls,e=c.pages.il8n,f=[],g=a("<ul/>",{class:d.list}),h=0,i=c.pages.total;h<i;h++)f.push(b=c.createItem(h+1,e.page)),g.append(b);return c.$list=g,c.$container=a("<nav/>",{class:d.container}).addClass(c.pages.theme).append(g),c.$items=a(a.map(f,function(a){return a.get()})),!0},append:function(){var a=this;"top"===a.position?a.$container.insertBefore(a.tmpl.$el):a.$container.insertAfter(a.tmpl.$el)},destroy:function(){var b=this,c=b.pages.sel;b.$list.find(c.link).off("click.foogallery",b.onLinkClick),b.$container.remove(),b.$container=a(),b.$list=a(),b.$items=a()},update:function(a){this.setSelected(a-1)},setSelected:function(b){var c=this,e=c.pages.cls,f=c.pages.il8n,g=c.pages.sel;c.$items.filter(g.selected).removeClass(e.selected).each(function(b,c){var e=a(c),f=e.data("label"),h=e.find(g.reader);d.string(f)&&0!==h.length&&h.html(f)}),c.$items.eq(b).addClass(e.selected).each(function(b,c){var e=a(c),h=e.find(g.reader),i=h.html();d.string(i)&&0!==h.length&&(e.data("label",i),h.html(f.current))})},createItem:function(b,c,e,f,g){e=d.string(e)?e:b,c=d.string(c)?c:"";var h=this,i=h.pages.opt,j=h.pages.cls,k=a("<a/>",{class:j.link,href:"#page-"+b}).html(e).on("click.foogallery",{self:h,page:b},h.onLinkClick);d.empty(c)||k.attr("title",c.replace(/\{PAGE}/g,b).replace(/\{LIMIT}/g,i.limit+"")),g=d.string(g)?g:c,d.empty(g)||k.prepend(a("<span/>",{class:j.reader,text:g.replace(/\{PAGE}/g,"").replace(/\{LIMIT}/g,i.limit+"")}));var l=a("<li/>",{class:j.item}).append(k);return f=d.string(f)?f:"",d.empty(f)||l.addClass(f),l},onLinkClick:function(b){b.preventDefault();var c=b.data.self,d=b.data.page,e=c.pages.sel;a(this).closest(e.item).is(e.disabled)||(c.pages.set(d,!0),c.tmpl.loadAvailable())}}),b.paging.register("dots",b.Dots,b.DotsControl,{type:"dots",position:"both",pushOrReplace:"push"},{list:"fg-dots",item:"fg-dot-item",link:"fg-dot-link",disabled:"fg-disabled",selected:"fg-selected",visible:"fg-visible",reader:"fg-sr-only"},{current:"Current page",page:"Page {PAGE}"})}(FooGallery.$,FooGallery,FooGallery.utils,FooGallery.utils.is),function(a,b,c){b.DefaultTemplate=b.Template.extend({}),b.template.register("default",b.DefaultTemplate,null,{container:"foogallery fg-default"})}(FooGallery.$,FooGallery,FooGallery.utils),function(a,b,c,d){b.MasonryTemplate=b.Template.extend({construct:function(a,b){this._super(a,b),this.masonry=null,this.style=null,this.$columnWidth=null},createStylesheet:function(){var a=this;return a.style=document.createElement("style"),a.style.appendChild(document.createTextNode("")),document.head.appendChild(a.style),a.style.sheet},onPreInit:function(b,c){var e=c.sel,f=c.cls;f.layouts=a.map(f.layout,function(a){return a}).join(" "),d.string(f.layout[c.template.layout])||(c.template.layout="col4");var g="fixed"===c.template.layout;if(c.template.isFitWidth=g,c.template.percentPosition=!g,c.template.transitionDuration=0,c.template.itemSelector=e.item.elem,c.$el.removeClass(f.layouts).addClass(f.layout[c.template.layout]),g||(0===c.$el.find(e.gutterWidth).length&&c.$el.prepend(a("<div/>").addClass(f.gutterWidth)),c.template.gutter=e.gutterWidth),0===c.$el.find(e.columnWidth).length&&c.$el.prepend(a("<div/>").addClass(f.columnWidth)),d.number(c.template.columnWidth)&&c.$el.find(e.columnWidth).width(c.template.columnWidth),c.template.columnWidth=e.columnWidth,g&&d.number(c.template.gutter)){var h=c.createStylesheet(),i="#"+c.id+e.container+" "+e.item.elem+" { margin-bottom: "+c.template.gutter+"px; }";h.insertRule(i,0)}c.masonry=new Masonry(c.$el.get(0),c.template)},onReady:function(a,b){b.masonry.layout()},onDestroy:function(a,b){b.$el.find(b.sel.columnWidth).remove(),b.$el.find(b.sel.gutterWidth).remove(),b.masonry instanceof Masonry&&b.masonry.destroy(),b.style&&b.style.parentNode&&b.style.parentNode.removeChild(b.style)},onLayout:function(a,b){b.masonry.layout()},onParsedItems:function(a,b,c){b.masonry.layout()},onAppendedItems:function(a,b,c){c=b.items.jquerify(c),c=b.masonry.addItems(c),b.masonry.layoutItems(c,!0)},onDetachItem:function(a,b,c){a.isDefaultPrevented()||(a.preventDefault(),b.masonry.remove(c.$el),c.isAttached=!1,c.unfix())},onDetachedItems:function(a,b,c){b.masonry.layout()}}),b.template.register("masonry",b.MasonryTemplate,{template:{layout:"col4"}},{container:"foogallery fg-masonry",columnWidth:"fg-column-width",gutterWidth:"fg-gutter-width",layout:{fixed:"fg-masonry-fixed",col2:"fg-masonry-2col",col3:"fg-masonry-3col",col4:"fg-masonry-4col",col5:"fg-masonry-5col"}})}(FooGallery.$,FooGallery,FooGallery.utils,FooGallery.utils.is),function(a,b,c,d){b.Justified=c.Class.extend({construct:function(c,d){this.$el=a(c),this.options=a.extend(!0,{},b.Justified.defaults,d),this._items=[]},init:function(){var b=this;d.string(b.options.maxRowHeight)&&(b.options.maxRowHeight.indexOf("%")?b.options.maxRowHeight=b.options.rowHeight*(parseInt(b.options.maxRowHeight)/100):b.options.maxRowHeight=parseInt(b.options.maxRowHeight)),b.layout(!0),a(window).on("resize.justified",{self:b},b.onWindowResize)},destroy:function(){a(window).off("resize.justified"),a.each(this._items,function(a,b){b.$item.removeAttr("style").removeClass("fg-positioned")}),this.$el.removeAttr("style")},parse:function(){var b=this;return b._items=b.$el.find(b.options.itemSelector).removeAttr("style").removeClass("fg-positioned").map(function(c,d){var e=a(d),f=e.outerWidth(),g=e.outerHeight();return{index:c,width:f*(b.options.rowHeight/g),height:b.options.rowHeight,top:0,left:0,$item:e}}).get()},round:function(a){return Math.round(a)},layout:function(a,b){a=!!d.boolean(a)&&a,b=!d.boolean(b)||b,(a||0===this._items.length)&&this.parse();for(var c,e=this,f=e.$el.width(),g=e.rows(f),h=0,i=0,j=g.length;i<j;i++)c=g[i],h=i===j-1?e.lastRow(c,f,h):e.justify(c,f,h),e.render(c);e.$el.height(h),b&&e.$el.width()<f&&e.layout(!1,!1)},render:function(a){for(var b,c=0,d=a.items.length;c<d;c++)b=a.items[c],a.visible?b.$item.css({width:b.width,height:b.height,top:b.top,left:b.left,display:"",maxHeight:this.options.maxRowHeight>0?this.options.maxRowHeight:""}).addClass("fg-positioned"):b.$item.css("display","none")},lastRow:function(a,b,c){var d=this;switch(d.options.lastRow){case"hide":a.visible=!1;break;case"justify":c=d.justify(a,b,c);break;case"nojustify":c=a.width/b>d.options.justifyThreshold?d.justify(a,b,c):d.position(a,b,c,"left");break;case"right":case"center":case"left":c=d.position(a,b,c,d.options.lastRow);break;default:c=d.position(a,b,c,"left")}return c},justify:function(a,b,c){var d=this,e=0,f=d.options.margins*(a.items.length-1),g=(b-f)/a.width;a.index>0&&(c+=d.options.margins),a.top=c,a.width=d.round(a.width*g),a.height=d.round(a.height*g);for(var h,i=0,j=a.items.length;i<j;i++)h=a.items[i],h.width=d.round(h.width*g),h.height=d.round(h.height*g),h.top=c,i>0&&(e+=d.options.margins),h.left=e,e+=h.width;return c+(a.height>d.options.maxRowHeight?d.options.maxRowHeight:a.height)},position:function(a,b,c,d){var e=this,f=a.items[a.items.length-1],g=b-(f.left+f.width);a.index>0&&(c+=e.options.margins),a.top=c;for(var h,i=0,j=a.items.length;i<j;i++)h=a.items[i],h.top=c,"center"===d?h.left+=g/2:"right"===d&&(h.left+=g);return c+a.height},items:function(){return a.map(this._items,function(a){return{index:a.index,width:a.width,height:a.height,$item:a.$item,top:a.top,left:a.left}})},rows:function(a){for(var b=this,c=b.items(),d=[],e=c.length>0,f=-1,g=0;e;){f+=1,f>0&&(g+=b.options.margins);for(var h,i,j,k={index:f,visible:!0,top:g,width:0,height:b.options.rowHeight,items:[]},l=[],m=0,n=0,o=c.length;n<o&&(i=c[n],!((h=k.width+i.width)>a&&n>0));n++)h>a&&0==n&&(h=a,j=a/i.width,i.width=b.round(i.width*j),i.height=b.round(i.height*j),k.height=i.height),i.top=k.top,n>0&&(m+=b.options.margins),i.left=m,m+=i.width,k.width=h,k.items.push(i),l.push(n);if(0===l.length){e=!1;break}l.sort(function(a,b){return b-a});for(var p=0,q=l.length;p<q;p++)c.splice(l[p],1);d.push(k),e=c.length>0}return d},onWindowResize:function(a){a.data.self.layout()}}),b.Justified.defaults={itemSelector:".fg-item",rowHeight:150,maxRowHeight:"200%",margins:0,lastRow:"center",justifyThreshold:.5}}(FooGallery.$,FooGallery,FooGallery.utils,FooGallery.utils.is),function(a,b,c){b.JustifiedTemplate=b.Template.extend({onPreInit:function(a,c){c.justified=new b.Justified(c.$el.get(0),c.template)},onInit:function(a,b){b.justified.init()},onReady:function(a,b){b.justified.layout(!0)},onDestroy:function(a,b){b.justified.destroy()},onLayout:function(a,b){b.justified.layout(!0)},onParsedItems:function(a,b,c){b.justified.layout()},onAppendedItems:function(a,b,c){b.justified.layout(!0)},onDetachedItems:function(a,b,c){b.justified.layout(!0)}}),b.template.register("justified",b.JustifiedTemplate,null,{container:"foogallery fg-justified"})}(FooGallery.$,FooGallery,FooGallery.utils),function(a,b,c,d){b.Portfolio=c.Class.extend({construct:function(c,d){this.$el=a(c),this.options=a.extend(!0,{},b.Portfolio.defaults,d),this._items=[]},init:function(){var b=this;a(window).on("resize.portfolio",{self:b},b.onWindowResize),b.layout(!0)},destroy:function(){a(window).off("resize.portfolio"),a.each(this._items,function(a,b){b.$item.removeAttr("style").removeClass("fg-positioned")}),this.$el.removeAttr("style")},parse:function(){var b=this;return b._items=b.$el.find(".fg-item").removeAttr("style").removeClass("fg-positioned").map(function(b,c){var d=a(c),e=d.find(".fg-thumb"),f=e.find(".fg-image");return d.find(".fg-caption").css("max-width",f.width()),{index:b,width:d.outerWidth(),height:d.outerHeight(),top:0,left:0,$item:d,$thumb:e}}).get()},round:function(a){return Math.round(2*a)/2},layout:function(a,b){a=!!d.boolean(a)&&a,b=!d.boolean(b)||b,(a||0===this._items.length)&&this.parse();for(var c,e=this,f=e.$el.width(),g=e.rows(f),h=0,i=0,j=g.length;i<j;i++)c=g[i],h=e.position(c,f,h,"center"),e.render(c);e.$el.height(h),b&&e.$el.width()<f&&e.layout(!1,!1)},render:function(a){for(var b,c=0,d=a.items.length;c<d;c++)b=a.items[c],a.visible?b.$item.css({width:b.width,height:a.height,top:b.top,left:b.left,display:""}).addClass("fg-positioned"):b.$item.css("display","none")},position:function(a,b,c,d){var e=this,f=a.items[a.items.length-1],g=b-(f.left+f.width);a.index>0&&(c+=e.options.gutter),a.top=c;for(var h,i=0,j=a.items.length;i<j;i++)h=a.items[i],h.top=c,"center"===d?h.left+=g/2:"right"===d&&(h.left+=g);return c+a.height},items:function(){return a.map(this._items,function(a){return{index:a.index,width:a.width,height:a.height,$item:a.$item,$thumb:a.$thumb,top:a.top,left:a.left}})},rows:function(a){for(var b=this,c=b.items(),d=[],e=c.length>0,f=-1,g=0;e;){f+=1,f>0&&(g+=b.options.gutter);for(var h,i,j,k={index:f,visible:!0,top:g,width:0,height:0,items:[]},l=[],m=0,n=0,o=c.length;n<o&&(i=c[n],!((h=k.width+i.width)>a&&n>0));n++)h>a&&0==n&&(h=a,j=a/i.width,i.width=b.round(i.width*j),i.height=b.round(i.height*j),k.height=i.height),i.top=k.top,n>0&&(m+=b.options.gutter),n!==o-1&&(h+=b.options.gutter),i.left=m,m+=i.width,i.height>k.height&&(k.height=i.height),k.width=h,k.items.push(i),l.push(n);if(0===l.length){e=!1;break}l.sort(function(a,b){return b-a});for(var p=0,q=l.length;p<q;p++)c.splice(l[p],1);d.push(k),e=c.length>0}return d},onWindowResize:function(a){a.data.self.layout()}}),b.Portfolio.defaults={gutter:40,align:"center"}}(FooGallery.$,FooGallery,FooGallery.utils,FooGallery.utils.is),function(a,b,c){b.PortfolioTemplate=b.Template.extend({construct:function(a,b){this._super(a,b),this.portfolio=null},onPreInit:function(a,c){c.portfolio=new b.Portfolio(c.$el.get(0),c.template)},onInit:function(a,b){b.portfolio.init()},onDestroy:function(a,b){b.portfolio.destroy()},onLayout:function(a,b){b.portfolio.layout(!0)},onParsedItems:function(a,b,c){b.portfolio.layout()},onAppendedItems:function(a,b,c){b.portfolio.layout(!0)},onDetachedItems:function(a,b,c){b.portfolio.layout(!0)}}),b.template.register("simple_portfolio",b.PortfolioTemplate,{gutter:40},{container:"foogallery fg-simple_portfolio"})}(FooGallery.$,FooGallery,FooGallery.utils),function(a,b,c,d){b.ImageViewerTemplate=b.Template.extend({construct:function(a,b){this._super(d.extend({},a,{paging:{pushOrReplace:"replace",theme:"fg-light",type:"default",size:1,position:"none",scrollToTop:!1}}),b),this.$inner=this.$el.find(".fiv-inner-container"),this.$current=this.$el.find(".fiv-count-current"),this.$total=this.$el.find(".fiv-count-total"),this.$prev=this.$el.find(".fiv-prev"),this.$next=this.$el.find(".fiv-next")},onInit:function(a,b){b.template.attachFooBox&&b.$el.on("foobox.previous",{self:b},b.onFooBoxPrev).on("foobox.next",{self:b},b.onFooBoxNext),b.$prev.on("click",{self:b},b.onPrevClick),b.$next.on("click",{self:b},b.onNextClick)},onFirstLoad:function(a,b){b.update()},onDestroy:function(a,b){b.template.attachFooBox&&b.$el.off({"foobox.previous":b.onFooBoxPrev,"foobox.next":b.onFooBoxNext}),b.$prev.off("click",b.onPrevClick),b.$next.off("click",b.onNextClick)},onAppendItem:function(a,b,c){a.preventDefault(),b.$inner.append(c.$el),c.fix(),c.isAttached=!0},update:function(){this.pages&&(this.$current.text(this.pages.current),this.$total.text(this.pages.total))},prev:function(){this.pages&&(this.pages.prev(),this.update())},next:function(){this.pages&&(this.pages.next(),this.update())},onFooBoxPrev:function(a){a.data.self.prev()},onFooBoxNext:function(a){a.data.self.next()},onPrevClick:function(a){a.preventDefault(),a.stopPropagation(),a.data.self.prev()},onNextClick:function(a){a.preventDefault(),a.stopPropagation(),a.data.self.next()}}),b.template.register("image-viewer",b.ImageViewerTemplate,{template:{attachFooBox:!1}},{container:"foogallery fg-image-viewer"})}(FooGallery.$,FooGallery,FooGallery.utils,FooGallery.utils.obj),function(a,b,c){b.ThumbnailTemplate=b.Template.extend({construct:function(a,b){this._super(c.extend({},a,{paging:{type:"none"}}),b)}}),b.template.register("thumbnail",b.ThumbnailTemplate,null,{container:"foogallery fg-thumbnail"})}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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
if ( !class_exists( 'FooGallery_Simple_Portfolio_Gallery_Template' ) ) {
|
4 |
+
|
5 |
+
define('FOOGALLERY_SIMPLE_PORTFOLIO_GALLERY_TEMPLATE_URL', plugin_dir_url( __FILE__ ));
|
6 |
+
|
7 |
+
class FooGallery_Simple_Portfolio_Gallery_Template {
|
8 |
+
/**
|
9 |
+
* Wire up everything we need to run the extension
|
10 |
+
*/
|
11 |
+
function __construct() {
|
12 |
+
add_filter( 'foogallery_gallery_templates', array( $this, 'add_template' ) );
|
13 |
+
add_filter( 'foogallery_gallery_templates_files', array( $this, 'register_myself' ) );
|
14 |
+
|
15 |
+
add_filter( 'foogallery_located_template-simple_portfolio', array( $this, 'enqueue_dependencies' ) );
|
16 |
+
|
17 |
+
//add extra fields to the templates
|
18 |
+
add_filter( 'foogallery_override_gallery_template_fields-simple_portfolio', array( $this, 'add_common_thumbnail_fields' ), 10, 2 );
|
19 |
+
|
20 |
+
//add the data options needed for simple portfolio
|
21 |
+
add_filter( 'foogallery_build_container_data_options-simple_portfolio', array( $this, 'add_data_options' ), 10, 3 );
|
22 |
+
|
23 |
+
//override specific settings when saving the gallery
|
24 |
+
add_filter( 'foogallery_save_gallery_settings-simple_portfolio', array( $this, 'override_settings'), 10, 3 );
|
25 |
+
|
26 |
+
//build up any preview arguments
|
27 |
+
add_filter( 'foogallery_preview_arguments-simple_portfolio', array( $this, 'preview_arguments' ), 10, 2 );
|
28 |
+
|
29 |
+
//build up the thumb dimensions from some arguments
|
30 |
+
add_filter( 'foogallery_calculate_thumbnail_dimensions-simple_portfolio', array( $this, 'build_thumbnail_dimensions_from_arguments' ), 10, 2 );
|
31 |
+
|
32 |
+
//build up the thumb dimensions on save
|
33 |
+
add_filter( 'foogallery_template_thumbnail_dimensions-simple_portfolio', array( $this, 'get_thumbnail_dimensions' ), 10, 2 );
|
34 |
+
}
|
35 |
+
|
36 |
+
/**
|
37 |
+
* Register myself so that all associated JS and CSS files can be found and automatically included
|
38 |
+
* @param $extensions
|
39 |
+
*
|
40 |
+
* @return array
|
41 |
+
*/
|
42 |
+
function register_myself( $extensions ) {
|
43 |
+
$extensions[] = __FILE__;
|
44 |
+
return $extensions;
|
45 |
+
}
|
46 |
+
|
47 |
+
/**
|
48 |
+
* Add our gallery template to the list of templates available for every gallery
|
49 |
+
* @param $gallery_templates
|
50 |
+
*
|
51 |
+
* @return array
|
52 |
+
*/
|
53 |
+
function add_template( $gallery_templates ) {
|
54 |
+
$gallery_templates[] = array(
|
55 |
+
'slug' => 'simple_portfolio',
|
56 |
+
'name' => __( 'Simple Portfolio', 'foogallery' ),
|
57 |
+
'preview_support' => true,
|
58 |
+
'common_fields_support' => true,
|
59 |
+
'lazyload_support' => true,
|
60 |
+
'paging_support' => true,
|
61 |
+
'mandatory_classes' => 'fg-simple_portfolio',
|
62 |
+
'thumbnail_dimensions' => true,
|
63 |
+
'fields' => array(
|
64 |
+
array(
|
65 |
+
'id' => 'help',
|
66 |
+
'title' => __( 'Tip', 'foogallery' ),
|
67 |
+
'section' => __( 'General', 'foogallery' ),
|
68 |
+
'type' => 'html',
|
69 |
+
'help' => true,
|
70 |
+
'desc' => __( 'The Simple Portfolio template works best when you have <strong>captions and descriptions</strong> set for every attachment in the gallery. To change captions and descriptions, simply hover over the thumbnail above and click the "i" icon.', 'foogallery' ),
|
71 |
+
),
|
72 |
+
array(
|
73 |
+
'id' => 'thumbnail_dimensions',
|
74 |
+
'title' => __( 'Thumbnail Size', 'foogallery' ),
|
75 |
+
'desc' => __( 'Choose the size of your thumbnails.', 'foogallery' ),
|
76 |
+
'section' => __( 'General', 'foogallery' ),
|
77 |
+
'type' => 'thumb_size_no_crop',
|
78 |
+
'default' => array(
|
79 |
+
'width' => 250,
|
80 |
+
'height' => 200
|
81 |
+
),
|
82 |
+
'row_data'=> array(
|
83 |
+
'data-foogallery-change-selector' => 'input',
|
84 |
+
'data-foogallery-preview' => 'shortcode'
|
85 |
+
)
|
86 |
+
),
|
87 |
+
array(
|
88 |
+
'id' => 'thumbnail_link',
|
89 |
+
'title' => __( 'Thumbnail Link', 'foogallery' ),
|
90 |
+
'section' => __( 'General', 'foogallery' ),
|
91 |
+
'default' => 'image',
|
92 |
+
'type' => 'thumb_link',
|
93 |
+
'desc' => __( 'You can choose to link each thumbnail to the full size image, or to the image\'s attachment page, or you can choose to not link to anything.', 'foogallery' )
|
94 |
+
),
|
95 |
+
array(
|
96 |
+
'id' => 'lightbox',
|
97 |
+
'title' => __( 'Lightbox', 'foogallery' ),
|
98 |
+
'desc' => __( 'Choose which lightbox you want to display images with. The lightbox will only work if you set the thumbnail link to "Full Size Image".', 'foogallery' ),
|
99 |
+
'section' => __( 'General', 'foogallery' ),
|
100 |
+
'type' => 'lightbox',
|
101 |
+
'default' => 'none',
|
102 |
+
),
|
103 |
+
array(
|
104 |
+
'id' => 'gutter',
|
105 |
+
'title' => __( 'Gutter', 'foogallery' ),
|
106 |
+
'desc' => __( 'The spacing between each thumbnail in the gallery.', 'foogallery' ),
|
107 |
+
'section' => __( 'General', 'foogallery' ),
|
108 |
+
'type' => 'number',
|
109 |
+
'class' => 'small-text',
|
110 |
+
'default' => 40,
|
111 |
+
'step' => '1',
|
112 |
+
'min' => '0',
|
113 |
+
'row_data'=> array(
|
114 |
+
'data-foogallery-change-selector' => 'input',
|
115 |
+
'data-foogallery-value-selector' => 'input',
|
116 |
+
'data-foogallery-preview' => 'shortcode',
|
117 |
+
)
|
118 |
+
),
|
119 |
+
array(
|
120 |
+
'id' => 'caption_position',
|
121 |
+
'title' => __('Caption Position', 'foogallery'),
|
122 |
+
'desc' => __('Where the captions are displayed in relation to the thumbnail.', 'foogallery'),
|
123 |
+
'section' => __( 'Captions', 'foogallery' ),
|
124 |
+
'default' => '',
|
125 |
+
'type' => 'radio',
|
126 |
+
'spacer' => '<span class="spacer"></span>',
|
127 |
+
'choices' => array(
|
128 |
+
'' => __( 'Below', 'foogallery' ),
|
129 |
+
'fg-captions-top' => __( 'Above', 'foogallery' )
|
130 |
+
),
|
131 |
+
'row_data'=> array(
|
132 |
+
'data-foogallery-change-selector' => 'input:radio',
|
133 |
+
'data-foogallery-value-selector' => 'input:checked',
|
134 |
+
'data-foogallery-preview' => 'class'
|
135 |
+
)
|
136 |
+
),
|
137 |
+
),
|
138 |
+
);
|
139 |
+
|
140 |
+
return $gallery_templates;
|
141 |
+
}
|
142 |
+
|
143 |
+
/**
|
144 |
+
* Enqueue scripts that the simple portfolio template relies on
|
145 |
+
*/
|
146 |
+
function enqueue_dependencies() {
|
147 |
+
//enqueue core files
|
148 |
+
foogallery_enqueue_core_gallery_template_style();
|
149 |
+
foogallery_enqueue_core_gallery_template_script();
|
150 |
+
}
|
151 |
+
|
152 |
+
/**
|
153 |
+
* Add thumbnail fields to the gallery template
|
154 |
+
*
|
155 |
+
* @uses "foogallery_override_gallery_template_fields"
|
156 |
+
* @param $fields
|
157 |
+
* @param $template
|
158 |
+
*
|
159 |
+
* @return array
|
160 |
+
*/
|
161 |
+
function add_common_thumbnail_fields( $fields, $template ) {
|
162 |
+
//update specific fields
|
163 |
+
foreach ($fields as &$field) {
|
164 |
+
if ( 'hover_effect_caption_visibility' === $field['id'] ) {
|
165 |
+
$field['default'] = 'fg-caption-always';
|
166 |
+
$field['choices'] = array(
|
167 |
+
'fg-caption-always' => __( 'Always Visible', 'foogallery' ),
|
168 |
+
);
|
169 |
+
$field['row_data'] = array(
|
170 |
+
'data-foogallery-change-selector' => 'input:radio',
|
171 |
+
'data-foogallery-hidden' => true,
|
172 |
+
'data-foogallery-preview' => 'class'
|
173 |
+
);
|
174 |
+
} else if ( 'hover_effect_help' == $field['id'] ||
|
175 |
+
'captions_help' == $field['id']) {
|
176 |
+
$field['row_data'] = array(
|
177 |
+
'data-foogallery-hidden' => true
|
178 |
+
);
|
179 |
+
}
|
180 |
+
}
|
181 |
+
|
182 |
+
return $fields;
|
183 |
+
}
|
184 |
+
|
185 |
+
/**
|
186 |
+
* Add the required data options if needed
|
187 |
+
*
|
188 |
+
* @param $options
|
189 |
+
* @param $gallery FooGallery
|
190 |
+
*
|
191 |
+
* @param $attributes array
|
192 |
+
*
|
193 |
+
* @return array
|
194 |
+
*/
|
195 |
+
function add_data_options($options, $gallery, $attributes) {
|
196 |
+
$gutter = foogallery_gallery_template_setting( 'gutter', 40 );
|
197 |
+
$options['template']['gutter'] = intval($gutter);
|
198 |
+
return $options;
|
199 |
+
}
|
200 |
+
|
201 |
+
/**
|
202 |
+
* Override specific settings so that the gallery template will always work
|
203 |
+
*
|
204 |
+
* @param $settings
|
205 |
+
* @param $post_id
|
206 |
+
* @param $form_data
|
207 |
+
*
|
208 |
+
* @return mixed
|
209 |
+
*/
|
210 |
+
function override_settings($settings, $post_id, $form_data) {
|
211 |
+
$settings['simple_portfolio_hover_effect_preset'] = 'fg-custom';
|
212 |
+
$settings['simple_portfolio_hover_effect_caption_visibility'] = 'fg-caption-always';
|
213 |
+
|
214 |
+
return $settings;
|
215 |
+
}
|
216 |
+
|
217 |
+
/**
|
218 |
+
* Build up a arguments used in the preview of the gallery
|
219 |
+
* @param $args
|
220 |
+
* @param $post_data
|
221 |
+
*
|
222 |
+
* @return mixed
|
223 |
+
*/
|
224 |
+
function preview_arguments( $args, $post_data ) {
|
225 |
+
$args['thumbnail_dimensions'] = $post_data[FOOGALLERY_META_SETTINGS]['simple_portfolio_thumbnail_dimensions'];
|
226 |
+
$args['gutter'] = $post_data[FOOGALLERY_META_SETTINGS]['simple_portfolio_gutter'];
|
227 |
+
return $args;
|
228 |
+
}
|
229 |
+
|
230 |
+
/**
|
231 |
+
* Builds thumb dimensions from arguments
|
232 |
+
*
|
233 |
+
* @param array $dimensions
|
234 |
+
* @param array $arguments
|
235 |
+
*
|
236 |
+
* @return mixed
|
237 |
+
*/
|
238 |
+
function build_thumbnail_dimensions_from_arguments( $dimensions, $arguments ) {
|
239 |
+
return array(
|
240 |
+
'height' => intval( $arguments['thumbnail_dimensions']['height'] ),
|
241 |
+
'width' => intval( $arguments['thumbnail_dimensions']['width'] ),
|
242 |
+
'crop' => '1'
|
243 |
+
);
|
244 |
+
}
|
245 |
+
|
246 |
+
/**
|
247 |
+
* Get the thumb dimensions arguments saved for the gallery for this gallery template
|
248 |
+
*
|
249 |
+
* @param array $dimensions
|
250 |
+
* @param FooGallery $foogallery
|
251 |
+
*
|
252 |
+
* @return mixed
|
253 |
+
*/
|
254 |
+
function get_thumbnail_dimensions( $dimensions, $foogallery ) {
|
255 |
+
$dimensions = $foogallery->get_meta( 'simple_portfolio_thumbnail_dimensions', array(
|
256 |
+
'width' => 250,
|
257 |
+
'height' => 200
|
258 |
+
) );
|
259 |
+
$dimensions['crop'] = true;
|
260 |
+
return $dimensions;
|
261 |
+
}
|
262 |
+
}
|
263 |
+
}
|
extensions/default-templates/simple-portfolio/gallery-simple_portfolio.php
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* FooGallery portfolio gallery template
|
4 |
+
*/
|
5 |
+
global $current_foogallery;
|
6 |
+
global $current_foogallery_arguments;
|
7 |
+
|
8 |
+
$args = foogallery_gallery_template_setting( 'thumbnail_dimensions', array() );
|
9 |
+
$args['crop'] = '1'; //we now force thumbs to be cropped
|
10 |
+
$args['link'] = foogallery_gallery_template_setting( 'thumbnail_link', 'image' );
|
11 |
+
$args['image_attributes'] = array(
|
12 |
+
'class' => 'bf-img',
|
13 |
+
'height' => $args['height']
|
14 |
+
);
|
15 |
+
$args['link_attributes'] = array( 'class' => 'foogallery-thumb' );
|
16 |
+
$lightbox = foogallery_gallery_template_setting( 'lightbox', 'unknown' );
|
17 |
+
|
18 |
+
$caption_position = foogallery_gallery_template_setting( 'caption_position', '' );
|
19 |
+
|
20 |
+
$foogallery_portfolio_classes = foogallery_build_class_attribute_safe( $current_foogallery, $caption_position, 'foogallery-lightbox-' . $lightbox );
|
21 |
+
$foogallery_portfolio_attributes = foogallery_build_container_attributes_safe( $current_foogallery, array( 'class' => $foogallery_portfolio_classes ) );
|
22 |
+
|
23 |
+
?><div <?php echo $foogallery_portfolio_attributes; ?>>
|
24 |
+
<?php foreach ( $current_foogallery->attachments() as $attachment ) {
|
25 |
+
echo foogallery_attachment_html( $attachment, $args );
|
26 |
+
} ?>
|
27 |
+
</div>
|
extensions/default-templates/thumbnail/class-thumbnail-gallery-template.php
ADDED
@@ -0,0 +1,193 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
if ( !class_exists( 'FooGallery_Thumbnail_Gallery_Template' ) ) {
|
4 |
+
|
5 |
+
define('FOOGALLERY_THUMBNAIL_GALLERY_TEMPLATE_URL', plugin_dir_url( __FILE__ ));
|
6 |
+
|
7 |
+
class FooGallery_Thumbnail_Gallery_Template {
|
8 |
+
/**
|
9 |
+
* Wire up everything we need to run the extension
|
10 |
+
*/
|
11 |
+
function __construct() {
|
12 |
+
add_filter( 'foogallery_gallery_templates', array( $this, 'add_template' ) );
|
13 |
+
add_filter( 'foogallery_gallery_templates_files', array( $this, 'register_myself' ) );
|
14 |
+
|
15 |
+
add_filter( 'foogallery_located_template-thumbnail', array( $this, 'enqueue_dependencies' ) );
|
16 |
+
|
17 |
+
//build up any preview arguments
|
18 |
+
add_filter( 'foogallery_preview_arguments-thumbnail', array( $this, 'preview_arguments' ), 10, 2 );
|
19 |
+
|
20 |
+
//build up the thumb dimensions from some arguments
|
21 |
+
add_filter( 'foogallery_calculate_thumbnail_dimensions-thumbnail', array( $this, 'build_thumbnail_dimensions_from_arguments' ), 10, 2 );
|
22 |
+
|
23 |
+
//build up the thumb dimensions on save
|
24 |
+
add_filter( 'foogallery_template_thumbnail_dimensions-thumbnail', array( $this, 'get_thumbnail_dimensions' ), 10, 2 );
|
25 |
+
}
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Register myself so that all associated JS and CSS files can be found and automatically included
|
29 |
+
* @param $extensions
|
30 |
+
*
|
31 |
+
* @return array
|
32 |
+
*/
|
33 |
+
function register_myself( $extensions ) {
|
34 |
+
$extensions[] = __FILE__;
|
35 |
+
return $extensions;
|
36 |
+
}
|
37 |
+
|
38 |
+
/**
|
39 |
+
* Add our gallery template to the list of templates available for every gallery
|
40 |
+
* @param $gallery_templates
|
41 |
+
*
|
42 |
+
* @return array
|
43 |
+
*/
|
44 |
+
function add_template( $gallery_templates ) {
|
45 |
+
$gallery_templates[] = array(
|
46 |
+
'slug' => 'thumbnail',
|
47 |
+
'name' => __( 'Single Thumbnail Gallery', 'foogallery' ),
|
48 |
+
'preview_support' => true,
|
49 |
+
'common_fields_support' => true,
|
50 |
+
'lazyload_support' => true,
|
51 |
+
'mandatory_classes' => 'fg-thumbnail',
|
52 |
+
'thumbnail_dimensions' => true,
|
53 |
+
'fields' => array(
|
54 |
+
array(
|
55 |
+
'id' => 'help',
|
56 |
+
'type' => 'html',
|
57 |
+
'section' => __( 'General', 'foogallery' ),
|
58 |
+
'help' => true,
|
59 |
+
'desc' => __( 'This gallery template only shows a single thumbnail, but the true power shines through when the thumbnail is clicked, because then the lightbox takes over and the user can view all the images in the gallery.', 'foogallery' ),
|
60 |
+
),
|
61 |
+
array(
|
62 |
+
'id' => 'thumbnail_dimensions',
|
63 |
+
'title' => __( 'Size', 'foogallery' ),
|
64 |
+
'desc' => __( 'Choose the size of your thumbnail.', 'foogallery' ),
|
65 |
+
'section' => __( 'General', 'foogallery' ),
|
66 |
+
'type' => 'thumb_size_no_crop',
|
67 |
+
'default' => array(
|
68 |
+
'width' => 250,
|
69 |
+
'height' => 200
|
70 |
+
),
|
71 |
+
'row_data'=> array(
|
72 |
+
'data-foogallery-change-selector' => 'input',
|
73 |
+
'data-foogallery-preview' => 'shortcode'
|
74 |
+
)
|
75 |
+
),
|
76 |
+
array(
|
77 |
+
'id' => 'position',
|
78 |
+
'title' => __( 'Position', 'foogallery' ),
|
79 |
+
'desc' => __( 'The position of the thumbnail related to the content around it.', 'foogallery' ),
|
80 |
+
'section' => __( 'General', 'foogallery' ),
|
81 |
+
'default' => 'position-block',
|
82 |
+
'type' => 'select',
|
83 |
+
'choices' => array(
|
84 |
+
'fg-center' => __( 'Full Width (block)', 'foogallery' ),
|
85 |
+
'fg-left' => __( 'Float Left', 'foogallery' ),
|
86 |
+
'fg-right' => __( 'Float Right', 'foogallery' ),
|
87 |
+
),
|
88 |
+
'row_data'=> array(
|
89 |
+
'data-foogallery-change-selector' => 'select',
|
90 |
+
'data-foogallery-preview' => 'class'
|
91 |
+
)
|
92 |
+
),
|
93 |
+
array(
|
94 |
+
'id' => 'link_custom_url',
|
95 |
+
'title' => __( 'Link To Custom URL', 'foogallery' ),
|
96 |
+
'section' => __( 'General', 'foogallery' ),
|
97 |
+
'default' => '',
|
98 |
+
'type' => 'checkbox',
|
99 |
+
'desc' => __( 'You can link your thumbnails to Custom URL\'s (if they are set on your attachments). Fallback will be to the full size image.', 'foogallery' )
|
100 |
+
),
|
101 |
+
array(
|
102 |
+
'id' => 'lightbox',
|
103 |
+
'title' => __( 'Lightbox', 'foogallery' ),
|
104 |
+
'section' => __( 'General', 'foogallery' ),
|
105 |
+
'desc' => __( 'Choose which lightbox you want to use.', 'foogallery' ),
|
106 |
+
'type' => 'lightbox',
|
107 |
+
'default' => 'none',
|
108 |
+
),
|
109 |
+
array(
|
110 |
+
'id' => 'caption_title',
|
111 |
+
'title' => __('Override Title', 'foogallery'),
|
112 |
+
'section' => __( 'Captions', 'foogallery' ),
|
113 |
+
'desc' => __('Leave blank if you do not want a caption title.', 'foogallery'),
|
114 |
+
'type' => 'text',
|
115 |
+
'row_data'=> array(
|
116 |
+
'data-foogallery-change-selector' => 'input',
|
117 |
+
'data-foogallery-preview' => 'shortcode'
|
118 |
+
)
|
119 |
+
),
|
120 |
+
array(
|
121 |
+
'id' => 'caption_description',
|
122 |
+
'title' => __('Override Description', 'foogallery'),
|
123 |
+
'section' => __( 'Captions', 'foogallery' ),
|
124 |
+
'desc' => __('Leave blank if you do not want a caption description.', 'foogallery'),
|
125 |
+
'type' => 'textarea',
|
126 |
+
'row_data'=> array(
|
127 |
+
'data-foogallery-change-selector' => 'textarea',
|
128 |
+
'data-foogallery-preview' => 'shortcode'
|
129 |
+
)
|
130 |
+
)
|
131 |
+
)
|
132 |
+
);
|
133 |
+
|
134 |
+
return $gallery_templates;
|
135 |
+
}
|
136 |
+
|
137 |
+
/**
|
138 |
+
* Enqueue scripts that the masonry gallery template relies on
|
139 |
+
*/
|
140 |
+
function enqueue_dependencies() {
|
141 |
+
//enqueue core files
|
142 |
+
foogallery_enqueue_core_gallery_template_style();
|
143 |
+
foogallery_enqueue_core_gallery_template_script();
|
144 |
+
}
|
145 |
+
|
146 |
+
/**
|
147 |
+
* Build up a arguments used in the preview of the gallery
|
148 |
+
* @param $args
|
149 |
+
* @param $post_data
|
150 |
+
*
|
151 |
+
* @return mixed
|
152 |
+
*/
|
153 |
+
function preview_arguments( $args, $post_data ) {
|
154 |
+
$args['thumbnail_dimensions'] = $post_data[FOOGALLERY_META_SETTINGS]['thumbnail_thumbnail_dimensions'];
|
155 |
+
$args['caption_title'] = $post_data[FOOGALLERY_META_SETTINGS]['thumbnail_caption_title'];
|
156 |
+
$args['caption_description'] = $post_data[FOOGALLERY_META_SETTINGS]['thumbnail_caption_description'];
|
157 |
+
return $args;
|
158 |
+
}
|
159 |
+
|
160 |
+
/**
|
161 |
+
* Builds thumb dimensions from arguments
|
162 |
+
*
|
163 |
+
* @param array $dimensions
|
164 |
+
* @param array $arguments
|
165 |
+
*
|
166 |
+
* @return mixed
|
167 |
+
*/
|
168 |
+
function build_thumbnail_dimensions_from_arguments( $dimensions, $arguments ) {
|
169 |
+
return array(
|
170 |
+
'height' => intval( $arguments['thumbnail_dimensions']['height'] ),
|
171 |
+
'width' => intval( $arguments['thumbnail_dimensions']['width'] ),
|
172 |
+
'crop' => '1'
|
173 |
+
);
|
174 |
+
}
|
175 |
+
|
176 |
+
/**
|
177 |
+
* Get the thumb dimensions arguments saved for the gallery for this gallery template
|
178 |
+
*
|
179 |
+
* @param array $dimensions
|
180 |
+
* @param FooGallery $foogallery
|
181 |
+
*
|
182 |
+
* @return mixed
|
183 |
+
*/
|
184 |
+
function get_thumbnail_dimensions( $dimensions, $foogallery ) {
|
185 |
+
$dimensions = $foogallery->get_meta( 'thumbnail_thumbnail_dimensions', array(
|
186 |
+
'width' => get_option( 'thumbnail_size_w' ),
|
187 |
+
'height' => get_option( 'thumbnail_size_h' )
|
188 |
+
) );
|
189 |
+
$dimensions['crop'] = true;
|
190 |
+
return $dimensions;
|
191 |
+
}
|
192 |
+
}
|
193 |
+
}
|
extensions/default-templates/thumbnail/gallery-thumbnail.php
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* FooGallery single thumbnail gallery template
|
4 |
+
*/
|
5 |
+
global $current_foogallery;
|
6 |
+
global $current_foogallery_arguments;
|
7 |
+
$args = foogallery_gallery_template_setting( 'thumbnail_dimensions', array() );
|
8 |
+
$args['crop'] = '1'; //we now force thumbs to be cropped
|
9 |
+
$lightbox = foogallery_gallery_template_setting( 'lightbox', 'unknown' );
|
10 |
+
$position = foogallery_gallery_template_setting( 'position', 'fg-center' );
|
11 |
+
|
12 |
+
$caption_bgcolor = foogallery_gallery_template_setting( 'caption_bgcolor', 'rgba(0, 0, 0, 0.8)' );
|
13 |
+
$caption_color = foogallery_gallery_template_setting( 'caption_color', '#fff' );
|
14 |
+
$featured_attachment = $current_foogallery->featured_attachment( $args );
|
15 |
+
$args['override_caption_title'] = $featured_attachment->caption = foogallery_gallery_template_setting( 'caption_title', '' );
|
16 |
+
$args['override_caption_desc'] = $featured_attachment->description = foogallery_gallery_template_setting( 'caption_description', '' );
|
17 |
+
|
18 |
+
$thumb_url = $featured_attachment->url;
|
19 |
+
if ( foogallery_gallery_template_setting( 'link_custom_url', '' ) == 'on' ) {
|
20 |
+
if ( !empty( $featured_attachment->custom_url ) ) {
|
21 |
+
$thumb_url = $featured_attachment->custom_url;
|
22 |
+
}
|
23 |
+
$args['link'] = 'custom';
|
24 |
+
}
|
25 |
+
$args['link_attributes'] = array(
|
26 |
+
'rel' => 'foobox[' . $current_foogallery->ID . ']'
|
27 |
+
);
|
28 |
+
$foogallery_single_thumbnail_classes = foogallery_build_class_attribute_safe( $current_foogallery, 'foogallery-single-thumbnail', 'foogallery-lightbox-' . $lightbox, $position );
|
29 |
+
$foogallery_single_thumbnail_attributes = foogallery_build_container_attributes_safe( $current_foogallery, array( 'class' => $foogallery_single_thumbnail_classes ) );
|
30 |
+
?>
|
31 |
+
<div <?php echo $foogallery_single_thumbnail_attributes; ?>>
|
32 |
+
<?php echo foogallery_attachment_html( $featured_attachment, $args ); ?>
|
33 |
+
<div class="fg-st-hidden">
|
34 |
+
<?php foreach ( $current_foogallery->attachments() as $attachment ) {
|
35 |
+
if ( $attachment->ID !== $featured_attachment->ID ) {
|
36 |
+
echo $attachment->html( $args, false, true );
|
37 |
+
}
|
38 |
+
} ?>
|
39 |
+
</div>
|
40 |
+
</div>
|
extensions/default-templates/thumbnail/js/admin-gallery-thumbnail.js
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
(function (FOOGALLERY_THUMBNAIL_TEMPLATE, $, undefined) {
|
2 |
+
|
3 |
+
FOOGALLERY_THUMBNAIL_TEMPLATE.setPreviewClasses = function() {
|
4 |
+
|
5 |
+
var $previewImage = $('.foogallery-thumbnail-preview'),
|
6 |
+
border_style = $('input[name="foogallery_settings[thumbnail_border-style]"]:checked').val(),
|
7 |
+
hover_effect = $('input[name="foogallery_settings[thumbnail_hover-effect]"]:checked').val();
|
8 |
+
|
9 |
+
$previewImage.attr('class' ,'foogallery-thumbnail-preview foogallery-container foogallery-thumbnail ' + hover_effect + ' ' + border_style);
|
10 |
+
};
|
11 |
+
|
12 |
+
FOOGALLERY_THUMBNAIL_TEMPLATE.adminReady = function () {
|
13 |
+
$('body').on('foogallery-gallery-template-changed-thumbnail', function() {
|
14 |
+
FOOGALLERY_THUMBNAIL_TEMPLATE.setPreviewClasses();
|
15 |
+
});
|
16 |
+
|
17 |
+
$('input[name="foogallery_settings[thumbnail_border-style]"], input[name="foogallery_settings[thumbnail_hover-effect]"]').change(function() {
|
18 |
+
FOOGALLERY_THUMBNAIL_TEMPLATE.setPreviewClasses();
|
19 |
+
});
|
20 |
+
|
21 |
+
$('.foogallery-thumbnail-preview').click(function(e) {
|
22 |
+
e.preventDefault();
|
23 |
+
});
|
24 |
+
};
|
25 |
+
|
26 |
+
}(window.FOOGALLERY_THUMBNAIL_TEMPLATE = window.FOOGALLERY_THUMBNAIL_TEMPLATE || {}, jQuery));
|
27 |
+
|
28 |
+
jQuery(function () {
|
29 |
+
FOOGALLERY_THUMBNAIL_TEMPLATE.adminReady();
|
30 |
+
});
|
extensions/extensions.json.js
ADDED
@@ -0,0 +1,118 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
[
|
2 |
+
{
|
3 |
+
"slug": "default_templates",
|
4 |
+
"class": "FooGallery_Default_Templates_Extension",
|
5 |
+
"categories": ["Featured" , "Free"],
|
6 |
+
"title": "Default Templates",
|
7 |
+
"description": "The bundled gallery templates.",
|
8 |
+
"author": "FooPlugins",
|
9 |
+
"author_url": "http://fooplugins.com",
|
10 |
+
"thumbnail": "/assets/extension_bg.png",
|
11 |
+
"tags": ["template"],
|
12 |
+
"source": "bundled",
|
13 |
+
"activated_by_default": true
|
14 |
+
},
|
15 |
+
{
|
16 |
+
"slug": "albums",
|
17 |
+
"class": "FooGallery_Albums_Extension",
|
18 |
+
"title": "Albums",
|
19 |
+
"categories": ["Featured" , "Free"],
|
20 |
+
"description": "Group your galleries into albums. Boom!",
|
21 |
+
"html": "Group your galleries into albums. Boom!",
|
22 |
+
"author": "FooPlugins",
|
23 |
+
"author_url": "http://fooplugins.com",
|
24 |
+
"thumbnail": "/extensions/albums/foogallery-albums.png",
|
25 |
+
"tags": ["functionality"],
|
26 |
+
"source": "bundled",
|
27 |
+
"css_class": "coming_soon"
|
28 |
+
},
|
29 |
+
{
|
30 |
+
"slug": "media_categories",
|
31 |
+
"class": "FooGallery_Media_Categories_Extension",
|
32 |
+
"categories": ["Featured" , "Free"],
|
33 |
+
"title": "Media Categories",
|
34 |
+
"description": "Categorize Your Media.",
|
35 |
+
"author": "FooPlugins",
|
36 |
+
"author_url": "http://fooplugins.com",
|
37 |
+
"thumbnail": "/assets/extension_bg.png",
|
38 |
+
"tags": ["functionality"],
|
39 |
+
"source": "bundled"
|
40 |
+
},
|
41 |
+
{
|
42 |
+
"slug": "foobox-image-lightbox",
|
43 |
+
"class": "FooGallery_FooBox_Free_Extension",
|
44 |
+
"categories": ["Featured" , "Free"],
|
45 |
+
"file": "foobox-free.php",
|
46 |
+
"title": "FooBox FREE",
|
47 |
+
"description": "The best lightbox for WordPress. Free",
|
48 |
+
"author": "FooPlugins",
|
49 |
+
"author_url": "http://fooplugins.com",
|
50 |
+
"thumbnail": "/assets/extension_bg.png",
|
51 |
+
"tags": ["lightbox"],
|
52 |
+
"source": "repo",
|
53 |
+
"activated_by_default": true,
|
54 |
+
"minimum_version": "1.0.2.1"
|
55 |
+
},
|
56 |
+
{
|
57 |
+
"slug": "foobox",
|
58 |
+
"class": "FooGallery_FooBox_Extension",
|
59 |
+
"categories": ["Featured" , "Premium"],
|
60 |
+
"file": "foobox.php",
|
61 |
+
"title": "FooBox PRO",
|
62 |
+
"description": "The best lightbox for WordPress just got even better!",
|
63 |
+
"price": "$27",
|
64 |
+
"author": "FooPlugins",
|
65 |
+
"author_url": "http://fooplugins.com",
|
66 |
+
"thumbnail": "/assets/extension_bg.png",
|
67 |
+
"tags": ["premium", "lightbox"],
|
68 |
+
"source": "fooplugins",
|
69 |
+
"download_button": {
|
70 |
+
"text": "Buy - $27",
|
71 |
+
"target": "_blank",
|
72 |
+
"href": "http://fooplugins.com/plugins/foobox",
|
73 |
+
"confirm": false
|
74 |
+
},
|
75 |
+
"activated_by_default": true,
|
76 |
+
"minimum_version": "2.3.2"
|
77 |
+
},
|
78 |
+
{
|
79 |
+
"slug": "polaroid_template",
|
80 |
+
"class": "FooGallery_Polaroid_Template_Extension",
|
81 |
+
"categories": ["Featured" , "Free"],
|
82 |
+
"file": "foogallery-polaroid-template.php",
|
83 |
+
"title": "Polaroid Template",
|
84 |
+
"description": "A cool retro Polaroid gallery layout",
|
85 |
+
"author": "FooPlugins",
|
86 |
+
"author_url": "http://fooplugins.com",
|
87 |
+
"thumbnail": "/assets/extension_bg.png",
|
88 |
+
"tags": ["template"],
|
89 |
+
"source": "github",
|
90 |
+
"download_link": "https://github.com/fooplugins/foogallery-polaroid-template/archive/master.zip"
|
91 |
+
},
|
92 |
+
{
|
93 |
+
"slug": "nextgen",
|
94 |
+
"class": "FooGallery_Nextgen_Gallery_Importer_Extension",
|
95 |
+
"categories": ["Free"],
|
96 |
+
"title": "NextGen Importer",
|
97 |
+
"description": "Imports all your existing NextGen galleries",
|
98 |
+
"author": "FooPlugins",
|
99 |
+
"author_url": "http://fooplugins.com",
|
100 |
+
"thumbnail": "/assets/extension_bg.png",
|
101 |
+
"tags": ["tools"],
|
102 |
+
"source": "bundled"
|
103 |
+
},
|
104 |
+
{
|
105 |
+
"slug": "media_menu",
|
106 |
+
"class": "FooGallery_Media_Menu_Extension",
|
107 |
+
"categories": ["Free"],
|
108 |
+
"file": "foogallery-media-menu.php",
|
109 |
+
"title": "Use Media Menu",
|
110 |
+
"description": "Move FooGallery menu items underneath the Media menu rather",
|
111 |
+
"author": "FooPlugins",
|
112 |
+
"author_url": "http://fooplugins.com",
|
113 |
+
"thumbnail": "/assets/extension_bg.png",
|
114 |
+
"tags": ["admin"],
|
115 |
+
"source": "github",
|
116 |
+
"download_link": "https://github.com/fooplugins/foogallery-media-menu/archive/master.zip"
|
117 |
+
}
|
118 |
+
]
|
extensions/media-categories/class-media-categories-extension.php
ADDED
@@ -0,0 +1,237 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( ! class_exists( 'FooGallery_Media_Categories_Extension' ) ) {
|
3 |
+
|
4 |
+
define( 'FOOGALLERY_MEDIA_CATEGORIES_EXTENSION_TAXONOMY', 'foogallery_media_category' );
|
5 |
+
define( 'FOOGALLERY_MEDIA_CATEGORIES_EXTENSION_SLUG', 'foogallery_media_categories' );
|
6 |
+
define( 'FOOGALLERY_MEDIA_CATEGORIES_INPUT_TYPE', 'category_checkboxlist' );
|
7 |
+
|
8 |
+
class FooGallery_Media_Categories_Extension {
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Class Constructor
|
12 |
+
*/
|
13 |
+
function __construct() {
|
14 |
+
add_action( 'init', array( $this, 'add_categories_to_attachments' ) );
|
15 |
+
if ( is_admin() ) {
|
16 |
+
add_filter( 'foogallery_attachment_custom_fields', array( $this, 'add_media_category_field' ) );
|
17 |
+
add_filter( 'foogallery_attachment_add_fields', array( $this, 'remove_taxonomy_media_category_field') );
|
18 |
+
add_filter( 'foogallery_attachment_field_' . FOOGALLERY_MEDIA_CATEGORIES_EXTENSION_SLUG, array( $this, 'customize_media_category_field'), 10, 2 );
|
19 |
+
add_filter( 'foogallery_attachment_save_field_' . FOOGALLERY_MEDIA_CATEGORIES_INPUT_TYPE, array( $this, 'save_media_category_field' ), 10, 4 );
|
20 |
+
add_action( 'restrict_manage_posts', array( $this, 'add_category_filter' ) );
|
21 |
+
}
|
22 |
+
}
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Register the category taxonomy for attachments
|
26 |
+
*/
|
27 |
+
function add_categories_to_attachments() {
|
28 |
+
$labels = array(
|
29 |
+
'name' => __( 'Categories', 'foogallery' ),
|
30 |
+
'singular_name' => __( 'Category', 'foogallery' ),
|
31 |
+
'search_items' => __( 'Search Categories', 'foogallery' ),
|
32 |
+
'all_items' => __( 'All Categories', 'foogallery' ),
|
33 |
+
'parent_item' => __( 'Parent Category', 'foogallery' ),
|
34 |
+
'parent_item_colon' => __( 'Parent Category:', 'foogallery' ),
|
35 |
+
'edit_item' => __( 'Edit Category', 'foogallery' ),
|
36 |
+
'update_item' => __( 'Update Category', 'foogallery' ),
|
37 |
+
'add_new_item' => __( 'Add New Category', 'foogallery' ),
|
38 |
+
'new_item_name' => __( 'New Category Name', 'foogallery' ),
|
39 |
+
'menu_name' => __( 'Categories', 'foogallery' )
|
40 |
+
);
|
41 |
+
|
42 |
+
$args = array(
|
43 |
+
'labels' => $labels,
|
44 |
+
'hierarchical' => true,
|
45 |
+
'query_var' => true,
|
46 |
+
'rewrite' => false,
|
47 |
+
'show_admin_column' => 'true'
|
48 |
+
);
|
49 |
+
|
50 |
+
register_taxonomy( FOOGALLERY_MEDIA_CATEGORIES_EXTENSION_TAXONOMY, 'attachment', $args );
|
51 |
+
}
|
52 |
+
|
53 |
+
/**
|
54 |
+
* Add a new category field to the attachments
|
55 |
+
*
|
56 |
+
* @param $fields array All fields that will be added to the media modal
|
57 |
+
*
|
58 |
+
* @return mixed
|
59 |
+
*/
|
60 |
+
function add_media_category_field( $fields ) {
|
61 |
+
$args = array(
|
62 |
+
'orderby' => 'name',
|
63 |
+
'order' => 'ASC',
|
64 |
+
'hide_empty' => false
|
65 |
+
);
|
66 |
+
|
67 |
+
//pull all terms
|
68 |
+
$terms = get_terms( FOOGALLERY_MEDIA_CATEGORIES_EXTENSION_TAXONOMY, $args );
|
69 |
+
|
70 |
+
$media_categories = array();
|
71 |
+
|
72 |
+
foreach ( $terms as $term ) {
|
73 |
+
$media_categories[ $term->term_id ] = $term->name;
|
74 |
+
}
|
75 |
+
|
76 |
+
$fields[FOOGALLERY_MEDIA_CATEGORIES_EXTENSION_SLUG] = array(
|
77 |
+
'label' => __( 'Categories', 'foogallery' ),
|
78 |
+
'input' => FOOGALLERY_MEDIA_CATEGORIES_INPUT_TYPE,
|
79 |
+
'helps' => __( 'Categorize your attachments', 'foogallery' ),
|
80 |
+
'options' => $media_categories,
|
81 |
+
'exclusions' => array()
|
82 |
+
);
|
83 |
+
|
84 |
+
return $fields;
|
85 |
+
}
|
86 |
+
|
87 |
+
/**
|
88 |
+
* Remove the automatically added media category field
|
89 |
+
* @param $fields
|
90 |
+
*
|
91 |
+
* @return mixed
|
92 |
+
*/
|
93 |
+
function remove_taxonomy_media_category_field( $fields ) {
|
94 |
+
if ( array_key_exists( FOOGALLERY_MEDIA_CATEGORIES_EXTENSION_TAXONOMY, $fields ) ) {
|
95 |
+
unset( $fields[FOOGALLERY_MEDIA_CATEGORIES_EXTENSION_TAXONOMY] );
|
96 |
+
}
|
97 |
+
|
98 |
+
return $fields;
|
99 |
+
}
|
100 |
+
|
101 |
+
/**
|
102 |
+
* Customize the media category field to make sure we output a checkboxlist
|
103 |
+
* @param $field_values
|
104 |
+
*
|
105 |
+
* @return mixed
|
106 |
+
*/
|
107 |
+
function customize_media_category_field( $field_values, $post_id ) {
|
108 |
+
|
109 |
+
$media_categories = array();
|
110 |
+
|
111 |
+
//get the terms linked to the attachment
|
112 |
+
$terms = get_the_terms( $post_id, FOOGALLERY_MEDIA_CATEGORIES_EXTENSION_TAXONOMY );
|
113 |
+
if ( $terms && ! is_wp_error( $terms ) ) {
|
114 |
+
foreach ( $terms as $term ) {
|
115 |
+
$media_categories[ $term->term_id ] = $term->name;
|
116 |
+
}
|
117 |
+
}
|
118 |
+
|
119 |
+
//set to html
|
120 |
+
$field_values['input'] = 'html';
|
121 |
+
|
122 |
+
$html = '';
|
123 |
+
$i = 0;
|
124 |
+
|
125 |
+
if ( ! empty( $field_values['options'] ) ) {
|
126 |
+
|
127 |
+
foreach ( $field_values['options'] as $k => $v ) {
|
128 |
+
if ( array_key_exists( $k, $media_categories ) ) {
|
129 |
+
$checked = ' checked="checked"';
|
130 |
+
} else {
|
131 |
+
$checked = '';
|
132 |
+
}
|
133 |
+
|
134 |
+
$html .= '<input' . $checked . ' value="' . $k . '" type="checkbox" name="attachments[' . $post_id . '][' . FOOGALLERY_MEDIA_CATEGORIES_EXTENSION_SLUG . '][' . $k . ']" id="' . sanitize_key( FOOGALLERY_MEDIA_CATEGORIES_EXTENSION_SLUG . '_' . $post_id . '_' . $i ) . '" /> <label for="' . sanitize_key( FOOGALLERY_MEDIA_CATEGORIES_EXTENSION_SLUG . '_' . $post_id . '_' . $i ) . '">' . $v . '</label> ';
|
135 |
+
$i++;
|
136 |
+
}
|
137 |
+
}
|
138 |
+
|
139 |
+
if ( 0 === $i ) {
|
140 |
+
$html .= __( 'No Categories Available!', 'foogallery' );
|
141 |
+
}
|
142 |
+
|
143 |
+
$html .= '<style>.compat-field-foogallery_media_categories .field input {margin-right: 0px;} .compat-field-foogallery_media_categories .field label {vertical-align: bottom; margin-right: 10px;}</style>';
|
144 |
+
|
145 |
+
$html .= '<br /><a target="_blank" href="' . admin_url( 'edit-tags.php?taxonomy=' . FOOGALLERY_MEDIA_CATEGORIES_EXTENSION_TAXONOMY . '&post_type=attachment' ) . '">' . __( 'Manage Categories', 'foogallery' ) . '</a>';
|
146 |
+
|
147 |
+
$field_values['value'] = '';
|
148 |
+
$field_values['html'] = $html;
|
149 |
+
|
150 |
+
return $field_values;
|
151 |
+
}
|
152 |
+
|
153 |
+
/**
|
154 |
+
* Save the categories for the attachment
|
155 |
+
*
|
156 |
+
* @param $field
|
157 |
+
* @param $values
|
158 |
+
* @param $post
|
159 |
+
* @param $attachment
|
160 |
+
*/
|
161 |
+
function save_media_category_field($field, $values, $post, $attachment) {
|
162 |
+
$post_id = $post['ID'];
|
163 |
+
|
164 |
+
//first clear any categories for the post
|
165 |
+
wp_delete_object_term_relationships( $post_id, FOOGALLERY_MEDIA_CATEGORIES_EXTENSION_TAXONOMY );
|
166 |
+
|
167 |
+
$category_ids = $attachment[ $field ];
|
168 |
+
|
169 |
+
if ( !empty( $category_ids ) ) {
|
170 |
+
//clean category ids
|
171 |
+
$category_ids = array_keys( $category_ids );
|
172 |
+
$category_ids = array_map( 'intval', $category_ids );
|
173 |
+
$category_ids = array_unique( $category_ids );
|
174 |
+
|
175 |
+
$term_taxonomy_ids = wp_set_object_terms( $post_id, $category_ids, FOOGALLERY_MEDIA_CATEGORIES_EXTENSION_TAXONOMY );
|
176 |
+
|
177 |
+
if ( is_wp_error( $term_taxonomy_ids ) ) {
|
178 |
+
// There was an error somewhere and the terms couldn't be set.
|
179 |
+
$post['errors'][ $field ]['errors'][] = __( 'Error saving the categories for the attachment!', 'foogallery' );
|
180 |
+
}
|
181 |
+
}
|
182 |
+
}
|
183 |
+
|
184 |
+
|
185 |
+
/***
|
186 |
+
*
|
187 |
+
* Add a category filter
|
188 |
+
*/
|
189 |
+
function add_category_filter() {
|
190 |
+
global $pagenow;
|
191 |
+
if ( 'upload.php' == $pagenow ) {
|
192 |
+
|
193 |
+
$dropdown_options = array(
|
194 |
+
'taxonomy' => FOOGALLERY_MEDIA_CATEGORIES_EXTENSION_TAXONOMY,
|
195 |
+
'show_option_all' => __( 'View all categories' ),
|
196 |
+
'hide_empty' => false,
|
197 |
+
'hierarchical' => true,
|
198 |
+
'orderby' => 'name',
|
199 |
+
'show_count' => true,
|
200 |
+
//'walker' => new foogallery_walker_category_dropdown(),
|
201 |
+
'value' => 'slug'
|
202 |
+
);
|
203 |
+
|
204 |
+
wp_dropdown_categories( $dropdown_options );
|
205 |
+
}
|
206 |
+
}
|
207 |
+
}
|
208 |
+
}
|
209 |
+
|
210 |
+
/** Custom walker for wp_dropdown_categories, based on https://gist.github.com/stephenh1988/2902509 */
|
211 |
+
class foogallery_walker_category_dropdown extends Walker_CategoryDropdown{
|
212 |
+
|
213 |
+
function start_el( &$output, $category, $depth = 0, $args = array(), $id = 0 ) {
|
214 |
+
$pad = str_repeat( ' ', $depth * 3 );
|
215 |
+
$cat_name = apply_filters( 'list_cats', $category->name, $category );
|
216 |
+
|
217 |
+
if( ! isset( $args['value'] ) ) {
|
218 |
+
$args['value'] = ( $category->taxonomy != 'category' ? 'slug' : 'id' );
|
219 |
+
}
|
220 |
+
|
221 |
+
$value = ( $args['value']=='slug' ? $category->slug : $category->term_id );
|
222 |
+
if ( 0 == $args['selected'] && isset( $_GET['category_media'] ) && '' != $_GET['category_media'] ) {
|
223 |
+
$args['selected'] = $_GET['category_media'];
|
224 |
+
}
|
225 |
+
|
226 |
+
$output .= '<option class="level-' . $depth . '" value="' . $value . '"';
|
227 |
+
if ( $value === (string) $args['selected'] ) {
|
228 |
+
$output .= ' selected="selected"';
|
229 |
+
}
|
230 |
+
$output .= '>';
|
231 |
+
$output .= $pad . $cat_name;
|
232 |
+
if ( $args['show_count'] )
|
233 |
+
$output .= ' (' . $category->count . ')';
|
234 |
+
|
235 |
+
$output .= "</option>\n";
|
236 |
+
}
|
237 |
+
}
|
extensions/nextgen-importer/class-nextgen-gallery-importer-extension.php
ADDED
@@ -0,0 +1,171 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @TODO
|
4 |
+
*/
|
5 |
+
if ( ! class_exists( 'FooGallery_Nextgen_Gallery_Importer_Extension' ) ) {
|
6 |
+
|
7 |
+
require_once 'class-nextgen-helper.php';
|
8 |
+
require_once 'class-nextgen-import-progress.php';
|
9 |
+
require_once 'class-nextgen-import-progress-album.php';
|
10 |
+
|
11 |
+
class FooGallery_Nextgen_Gallery_Importer_Extension {
|
12 |
+
|
13 |
+
/**
|
14 |
+
* @var FooGallery_NextGen_Helper
|
15 |
+
*/
|
16 |
+
private $nextgen;
|
17 |
+
|
18 |
+
function __construct() {
|
19 |
+
$this->nextgen = new FooGallery_NextGen_Helper();
|
20 |
+
|
21 |
+
//always show the menu
|
22 |
+
add_action( 'foogallery_admin_menu_after', array( $this, 'add_menu' ) );
|
23 |
+
add_action( 'foogallery_extension_activated-nextgen', array( $this, 'add_menu' ) );
|
24 |
+
|
25 |
+
//hook into the foogallery menu
|
26 |
+
add_action( 'foogallery_admin_help_after_section_one', array( $this, 'show_nextgen_import_help' ) );
|
27 |
+
|
28 |
+
// Ajax calls for importing galleries
|
29 |
+
add_action( 'wp_ajax_foogallery_nextgen_import', array( $this, 'ajax_nextgen_start_import' ) );
|
30 |
+
add_action( 'wp_ajax_foogallery_nextgen_import_refresh', array( $this, 'ajax_nextgen_continue_import' ) );
|
31 |
+
add_action( 'wp_ajax_foogallery_nextgen_import_cancel', array( $this, 'ajax_nextgen_cancel_import' ) );
|
32 |
+
add_action( 'wp_ajax_foogallery_nextgen_import_reset', array( $this, 'ajax_nextgen_reset_import' ) );
|
33 |
+
|
34 |
+
// Ajax calls for importing albums
|
35 |
+
add_action( 'wp_ajax_foogallery_nextgen_album_import_reset', array( $this, 'ajax_nextgen_reset_album_import' ) );
|
36 |
+
add_action( 'wp_ajax_foogallery_nextgen_album_import', array( $this, 'ajax_nextgen_start_album_import' ) );
|
37 |
+
}
|
38 |
+
|
39 |
+
function add_menu() {
|
40 |
+
foogallery_add_submenu_page( __( 'NextGen Importer', 'foogallery' ), 'manage_options', 'foogallery-nextgen-importer', array(
|
41 |
+
$this,
|
42 |
+
'render_view',
|
43 |
+
) );
|
44 |
+
}
|
45 |
+
|
46 |
+
function render_view() {
|
47 |
+
require_once 'view-importer.php';
|
48 |
+
}
|
49 |
+
|
50 |
+
function ajax_nextgen_start_import() {
|
51 |
+
if ( check_admin_referer( 'foogallery_nextgen_import', 'foogallery_nextgen_import' ) ) {
|
52 |
+
|
53 |
+
$this->nextgen->ignore_previously_imported_galleries();
|
54 |
+
|
55 |
+
if ( array_key_exists( 'nextgen-id', $_POST ) ) {
|
56 |
+
|
57 |
+
$nextgen_gallery_ids = $_POST['nextgen-id'];
|
58 |
+
|
59 |
+
foreach ( $nextgen_gallery_ids as $gid ) {
|
60 |
+
$foogallery_title = stripslashes( $_POST[ 'foogallery-name-' . $gid ] );
|
61 |
+
|
62 |
+
//init the start progress of the import for the gallery
|
63 |
+
$this->nextgen->init_import_progress( $gid, $foogallery_title );
|
64 |
+
}
|
65 |
+
|
66 |
+
$this->nextgen->start_import();
|
67 |
+
|
68 |
+
} else {
|
69 |
+
|
70 |
+
}
|
71 |
+
}
|
72 |
+
|
73 |
+
$this->nextgen->render_import_form();
|
74 |
+
|
75 |
+
die();
|
76 |
+
|
77 |
+
}
|
78 |
+
|
79 |
+
function ajax_nextgen_continue_import() {
|
80 |
+
if ( check_admin_referer( 'foogallery_nextgen_import_refresh', 'foogallery_nextgen_import_refresh' ) ) {
|
81 |
+
|
82 |
+
$this->nextgen->continue_import();
|
83 |
+
|
84 |
+
$this->nextgen->render_import_form();
|
85 |
+
|
86 |
+
}
|
87 |
+
|
88 |
+
die();
|
89 |
+
|
90 |
+
}
|
91 |
+
|
92 |
+
function ajax_nextgen_cancel_import() {
|
93 |
+
if ( check_admin_referer( 'foogallery_nextgen_import_cancel', 'foogallery_nextgen_import_cancel' ) ) {
|
94 |
+
|
95 |
+
$this->nextgen->cancel_import();
|
96 |
+
|
97 |
+
$this->nextgen->render_import_form();
|
98 |
+
|
99 |
+
}
|
100 |
+
die();
|
101 |
+
}
|
102 |
+
|
103 |
+
function ajax_nextgen_reset_import() {
|
104 |
+
if ( check_admin_referer( 'foogallery_nextgen_reset', 'foogallery_nextgen_reset' ) ) {
|
105 |
+
|
106 |
+
$this->nextgen->reset_import();
|
107 |
+
|
108 |
+
$this->nextgen->render_import_form();
|
109 |
+
|
110 |
+
}
|
111 |
+
die();
|
112 |
+
}
|
113 |
+
|
114 |
+
function ajax_nextgen_start_album_import() {
|
115 |
+
if ( check_admin_referer( 'foogallery_nextgen_album_import', 'foogallery_nextgen_album_import' ) ) {
|
116 |
+
|
117 |
+
if ( array_key_exists( 'nextgen_album_id', $_POST ) ) {
|
118 |
+
|
119 |
+
$nextgen_album_id = $_POST['nextgen_album_id'];
|
120 |
+
$foogallery_album_title = stripslashes( $_POST[ 'foogallery_album_name' ] );
|
121 |
+
|
122 |
+
//import the album
|
123 |
+
$this->nextgen->import_album( $nextgen_album_id, $foogallery_album_title );
|
124 |
+
|
125 |
+
} else {
|
126 |
+
|
127 |
+
}
|
128 |
+
}
|
129 |
+
|
130 |
+
$this->nextgen->render_album_import_form();
|
131 |
+
|
132 |
+
die();
|
133 |
+
}
|
134 |
+
|
135 |
+
function ajax_nextgen_reset_album_import() {
|
136 |
+
if ( check_admin_referer( 'foogallery_nextgen_album_reset', 'foogallery_nextgen_album_reset' ) ) {
|
137 |
+
|
138 |
+
//$this->nextgen->reset_import();
|
139 |
+
|
140 |
+
$this->nextgen->render_album_import_form();
|
141 |
+
|
142 |
+
}
|
143 |
+
die();
|
144 |
+
}
|
145 |
+
|
146 |
+
function show_nextgen_import_help() {
|
147 |
+
?>
|
148 |
+
<div class="changelog">
|
149 |
+
|
150 |
+
<div class="feature-section">
|
151 |
+
<img src="<?php echo FOOGALLERY_URL . 'assets/screenshots/admin-nextgen-import.jpg'; ?>"
|
152 |
+
class="foogallery-help-screenshot"/>
|
153 |
+
|
154 |
+
<h2><?php _e( 'Import Your NextGen Galleries', 'foogallery' ); ?></h2>
|
155 |
+
|
156 |
+
<h4><?php _e( 'Import Galleries', 'foogallery' ); ?></h4>
|
157 |
+
|
158 |
+
|
159 |
+
|
160 |
+
<p><?php printf( __( 'Import all your NextGen galleries in a single click, or choose the galleries you would like to migrate over to %s.', 'foogallery' ), foogallery_plugin_name() ); ?></p>
|
161 |
+
|
162 |
+
<h4><?php _e( 'Import Images', 'foogallery' ); ?></h4>
|
163 |
+
|
164 |
+
<p><?php _e( 'NextGen gallery images are imported into your WordPress media library, where they should be!', 'foogallery' ); ?></p>
|
165 |
+
|
166 |
+
</div>
|
167 |
+
</div>
|
168 |
+
<?php
|
169 |
+
}
|
170 |
+
}
|
171 |
+
}
|
extensions/nextgen-importer/class-nextgen-helper.php
ADDED
@@ -0,0 +1,578 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
if ( ! class_exists( 'FooGallery_NextGen_Helper' ) ) {
|
4 |
+
|
5 |
+
class FooGallery_NextGen_Helper {
|
6 |
+
|
7 |
+
const NEXTGEN_TABLE_GALLERY = 'ngg_gallery';
|
8 |
+
const NEXTGEN_TABLE_PICTURES = 'ngg_pictures';
|
9 |
+
const NEXTGEN_TABLE_ALBUMS = 'ngg_album';
|
10 |
+
|
11 |
+
const NEXTGEN_OPTION_IMPORT_CURRENT = 'foogallery_nextgen_import-current';
|
12 |
+
const NEXTGEN_OPTION_IMPORT_PROGRESS = 'foogallery_nextgen_import-progress';
|
13 |
+
const NEXTGEN_OPTION_IMPORT_IN_PROGRESS = 'foogallery_nextgen_import-importing';
|
14 |
+
|
15 |
+
const NEXTGEN_OPTION_IMPORT_CURRENT_ALBUM = 'foogallery_nextgen_import-current-album';
|
16 |
+
const NEXTGEN_OPTION_IMPORT_PROGRESS_ALBUM = 'foogallery_nextgen_import-progress-album';
|
17 |
+
|
18 |
+
/**
|
19 |
+
* @TODO
|
20 |
+
*/
|
21 |
+
function is_nextgen_installed() {
|
22 |
+
return class_exists( 'C_NextGEN_Bootstrap' ) || class_exists( 'nggLoader' );
|
23 |
+
}
|
24 |
+
|
25 |
+
function get_galleries() {
|
26 |
+
global $wpdb;
|
27 |
+
$gallery_table = $wpdb->prefix . self::NEXTGEN_TABLE_GALLERY;
|
28 |
+
$picture_table = $wpdb->prefix . self::NEXTGEN_TABLE_PICTURES;
|
29 |
+
|
30 |
+
return $wpdb->get_results( "select gal.gid, gal.name, gal.title, gal.galdesc, count(pic.pid) 'image_count'
|
31 |
+
from {$gallery_table} gal
|
32 |
+
join {$picture_table} pic on gal.gid = pic.galleryid
|
33 |
+
group by gal.gid, gal.name, gal.title, gal.galdesc" );
|
34 |
+
}
|
35 |
+
|
36 |
+
function get_albums() {
|
37 |
+
global $wpdb;
|
38 |
+
$album_table = $wpdb->prefix . self::NEXTGEN_TABLE_ALBUMS;
|
39 |
+
return $wpdb->get_results(" select * from {$album_table}");
|
40 |
+
}
|
41 |
+
|
42 |
+
function get_album( $id ) {
|
43 |
+
global $wpdb;
|
44 |
+
$album_table = $wpdb->prefix . self::NEXTGEN_TABLE_ALBUMS;
|
45 |
+
|
46 |
+
return $wpdb->get_row( $wpdb->prepare( "select * from {$album_table} where id = %d", $id ) );
|
47 |
+
}
|
48 |
+
|
49 |
+
function get_gallery( $id ) {
|
50 |
+
global $wpdb;
|
51 |
+
$gallery_table = $wpdb->prefix . self::NEXTGEN_TABLE_GALLERY;
|
52 |
+
$picture_table = $wpdb->prefix . self::NEXTGEN_TABLE_PICTURES;
|
53 |
+
|
54 |
+
return $wpdb->get_row( $wpdb->prepare( "select gid, name, title, galdesc, path, author,
|
55 |
+
(select count(*) from {$picture_table} where galleryid = gid) 'image_count'
|
56 |
+
from {$gallery_table}
|
57 |
+
where gid = %d", $id ) );
|
58 |
+
}
|
59 |
+
|
60 |
+
function get_gallery_images( $id ) {
|
61 |
+
global $wpdb;
|
62 |
+
$picture_table = $wpdb->prefix . self::NEXTGEN_TABLE_PICTURES;
|
63 |
+
|
64 |
+
return $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$picture_table} WHERE galleryid = %d", $id ) );
|
65 |
+
}
|
66 |
+
|
67 |
+
/**
|
68 |
+
*
|
69 |
+
* @return FooGallery_NextGen_Import_Progress
|
70 |
+
*/
|
71 |
+
function get_import_progress( $nextgen_gallery_id ) {
|
72 |
+
$progress = get_option( self::NEXTGEN_OPTION_IMPORT_PROGRESS );
|
73 |
+
if ( false !== $progress ) {
|
74 |
+
if ( false !== $nextgen_gallery_id && array_key_exists( $nextgen_gallery_id, $progress ) ) {
|
75 |
+
return $progress[ $nextgen_gallery_id ];
|
76 |
+
}
|
77 |
+
}
|
78 |
+
|
79 |
+
return new FooGallery_NextGen_Import_Progress();
|
80 |
+
}
|
81 |
+
|
82 |
+
function set_import_progress( $nextgen_gallery_id, FooGallery_NextGen_Import_Progress $progress ) {
|
83 |
+
$all_progress = get_option( self::NEXTGEN_OPTION_IMPORT_PROGRESS, array() );
|
84 |
+
$all_progress[ $nextgen_gallery_id ] = $progress;
|
85 |
+
update_option( self::NEXTGEN_OPTION_IMPORT_PROGRESS, $all_progress );
|
86 |
+
}
|
87 |
+
|
88 |
+
/**
|
89 |
+
* @param int $nextgen_gallery_id
|
90 |
+
* @param string $foogallery_title
|
91 |
+
*/
|
92 |
+
function init_import_progress( $nextgen_gallery_id, $foogallery_title ) {
|
93 |
+
$progress = new FooGallery_NextGen_Import_Progress();
|
94 |
+
$progress->init( $nextgen_gallery_id, $foogallery_title );
|
95 |
+
$this->set_import_progress( $nextgen_gallery_id, $progress );
|
96 |
+
}
|
97 |
+
|
98 |
+
function start_import() {
|
99 |
+
delete_option( self::NEXTGEN_OPTION_IMPORT_CURRENT );
|
100 |
+
update_option( self::NEXTGEN_OPTION_IMPORT_IN_PROGRESS, true );
|
101 |
+
}
|
102 |
+
|
103 |
+
function cancel_import() {
|
104 |
+
delete_option( self::NEXTGEN_OPTION_IMPORT_CURRENT );
|
105 |
+
delete_option( self::NEXTGEN_OPTION_IMPORT_IN_PROGRESS );
|
106 |
+
}
|
107 |
+
|
108 |
+
function reset_import() {
|
109 |
+
delete_option( self::NEXTGEN_OPTION_IMPORT_CURRENT );
|
110 |
+
delete_option( self::NEXTGEN_OPTION_IMPORT_IN_PROGRESS );
|
111 |
+
delete_option( self::NEXTGEN_OPTION_IMPORT_PROGRESS );
|
112 |
+
}
|
113 |
+
|
114 |
+
function import_in_progress() {
|
115 |
+
return true == get_option( self::NEXTGEN_OPTION_IMPORT_IN_PROGRESS );
|
116 |
+
}
|
117 |
+
|
118 |
+
function continue_import() {
|
119 |
+
//get the current gallery being imported
|
120 |
+
$current_nextgen_id = get_option( self::NEXTGEN_OPTION_IMPORT_CURRENT, 0 );
|
121 |
+
|
122 |
+
if ( 0 === $current_nextgen_id ) {
|
123 |
+
//try and get the next gallery to import
|
124 |
+
$current_nextgen_id = $this->get_next_gallery_to_import();
|
125 |
+
|
126 |
+
//if we still have no current then do nothing
|
127 |
+
if ( 0 === $current_nextgen_id ) {
|
128 |
+
$this->cancel_import();
|
129 |
+
return;
|
130 |
+
} else {
|
131 |
+
update_option( self::NEXTGEN_OPTION_IMPORT_CURRENT, $current_nextgen_id );
|
132 |
+
}
|
133 |
+
}
|
134 |
+
|
135 |
+
$progress = $this->get_import_progress( $current_nextgen_id );
|
136 |
+
|
137 |
+
if ( ! $progress->has_started() ) {
|
138 |
+
$progress->start();
|
139 |
+
}
|
140 |
+
|
141 |
+
//import the next picture
|
142 |
+
$progress->import_next_picture();
|
143 |
+
|
144 |
+
//update our progress
|
145 |
+
$this->set_import_progress( $current_nextgen_id, $progress );
|
146 |
+
|
147 |
+
//if the percentage complete is 100 then clear the current gallery
|
148 |
+
if ( $progress->is_completed() ) {
|
149 |
+
delete_option( self::NEXTGEN_OPTION_IMPORT_CURRENT );
|
150 |
+
}
|
151 |
+
}
|
152 |
+
|
153 |
+
function get_overall_progress() {
|
154 |
+
$all_progress = get_option( self::NEXTGEN_OPTION_IMPORT_PROGRESS, array() );
|
155 |
+
$total = 0;
|
156 |
+
$imported = 0;
|
157 |
+
foreach ( $all_progress as $id => $progress ) {
|
158 |
+
if ( $progress->is_part_of_current_import ) {
|
159 |
+
$total += $progress->import_count;
|
160 |
+
$imported += count( $progress->attachments );
|
161 |
+
}
|
162 |
+
}
|
163 |
+
if ( 0 === $total ) {
|
164 |
+
return 100;
|
165 |
+
}
|
166 |
+
return $imported / $total * 100;
|
167 |
+
}
|
168 |
+
|
169 |
+
function get_next_gallery_to_import() {
|
170 |
+
$all_progress = get_option( self::NEXTGEN_OPTION_IMPORT_PROGRESS, array() );
|
171 |
+
|
172 |
+
foreach ( $all_progress as $id => $progress ) {
|
173 |
+
if ( $progress->can_import() ) {
|
174 |
+
return $id;
|
175 |
+
}
|
176 |
+
}
|
177 |
+
|
178 |
+
return 0;
|
179 |
+
}
|
180 |
+
|
181 |
+
function ignore_previously_imported_galleries() {
|
182 |
+
$all_progress = get_option( self::NEXTGEN_OPTION_IMPORT_PROGRESS, array() );
|
183 |
+
foreach ( $all_progress as $id => $progress ) {
|
184 |
+
if ( $progress->is_completed() ) {
|
185 |
+
$progress->is_part_of_current_import = false;
|
186 |
+
}
|
187 |
+
}
|
188 |
+
update_option( self::NEXTGEN_OPTION_IMPORT_PROGRESS, $all_progress );
|
189 |
+
}
|
190 |
+
|
191 |
+
function import_picture( $nextgen_gallery_path, $picture ) {
|
192 |
+
$picture_url = trailingslashit( site_url() ) . trailingslashit( $nextgen_gallery_path ) . $picture->filename;
|
193 |
+
|
194 |
+
// Get the contents of the picture
|
195 |
+
$response = wp_remote_get( $picture_url );
|
196 |
+
$contents = wp_remote_retrieve_body( $response );
|
197 |
+
|
198 |
+
// Upload and get file data
|
199 |
+
$upload = wp_upload_bits( basename( $picture_url ), null, $contents );
|
200 |
+
$guid = $upload['url'];
|
201 |
+
$file = $upload['file'];
|
202 |
+
$file_type = wp_check_filetype( basename( $file ), null );
|
203 |
+
|
204 |
+
// Create attachment
|
205 |
+
$attachment = array(
|
206 |
+
'ID' => 0,
|
207 |
+
'guid' => $guid,
|
208 |
+
'post_title' => $picture->alttext != '' ? $picture->alttext : $picture->image_slug,
|
209 |
+
'post_excerpt' => $picture->description,
|
210 |
+
'post_content' => $picture->description,
|
211 |
+
'post_date' => '',
|
212 |
+
'post_mime_type' => $file_type['type'],
|
213 |
+
);
|
214 |
+
|
215 |
+
// Include image.php so we can call wp_generate_attachment_metadata()
|
216 |
+
require_once( ABSPATH . 'wp-admin/includes/image.php' );
|
217 |
+
|
218 |
+
// Insert the attachment
|
219 |
+
$attachment_id = wp_insert_attachment( $attachment, $file, 0 );
|
220 |
+
$attachment_data = wp_generate_attachment_metadata( $attachment_id, $file );
|
221 |
+
wp_update_attachment_metadata( $attachment_id, $attachment_data );
|
222 |
+
|
223 |
+
// Save alt text in the post meta
|
224 |
+
update_post_meta( $attachment_id, '_wp_attachment_image_alt', $picture->alttext );
|
225 |
+
|
226 |
+
return $attachment_id;
|
227 |
+
}
|
228 |
+
|
229 |
+
function render_import_form( $galleries = false ) {
|
230 |
+
if ( false === $galleries ) {
|
231 |
+
$galleries = $this->get_galleries();
|
232 |
+
}
|
233 |
+
$has_imports = get_option( self::NEXTGEN_OPTION_IMPORT_PROGRESS );
|
234 |
+
$overall_progress = $this->get_overall_progress();
|
235 |
+
$all_imports_completed = 100 === $overall_progress;
|
236 |
+
$import_has_started = $this->import_in_progress();
|
237 |
+
$importing = $import_has_started && defined( 'DOING_AJAX' ) && DOING_AJAX;
|
238 |
+
$current_nextgen_id = get_option( self::NEXTGEN_OPTION_IMPORT_CURRENT, 0 );
|
239 |
+
?>
|
240 |
+
<table class="wp-list-table widefat" cellspacing="0">
|
241 |
+
<thead>
|
242 |
+
<tr>
|
243 |
+
<th scope="col" id="cb" class="manage-column column-cb check-column">
|
244 |
+
<?php if ( ! $importing && $all_imports_completed ) { ?>
|
245 |
+
<label class="screen-reader-text" for="cb-select-all-1"><?php _e( 'Select All', 'foogallery' ); ?></label>
|
246 |
+
<input id="cb-select-all-1" type="checkbox" <?php echo $importing ? 'disabled="disabled"' : ''; ?> checked="checked" />
|
247 |
+
<?php } ?>
|
248 |
+
</th>
|
249 |
+
<th scope="col" class="manage-column">
|
250 |
+
<span><?php _e( 'NextGen Gallery', 'foogallery' ); ?></span>
|
251 |
+
</th>
|
252 |
+
<th scope="col" id="title" class="manage-column">
|
253 |
+
<span><?php printf( __( '%s Name', 'foogallery' ), foogallery_plugin_name() ); ?></span>
|
254 |
+
</th>
|
255 |
+
<th scope="col" id="title" class="manage-column">
|
256 |
+
<span><?php _e( 'Import Progress', 'foogallery' ); ?></span>
|
257 |
+
</th>
|
258 |
+
</tr>
|
259 |
+
</thead>
|
260 |
+
<tbody>
|
261 |
+
<?php
|
262 |
+
|
263 |
+
require_once( plugin_dir_path( __FILE__ ) . 'class-nextgen-pagination.php' );
|
264 |
+
|
265 |
+
$url = add_query_arg( 'page', 'foogallery-nextgen-importer' );
|
266 |
+
$page = 1;
|
267 |
+
if ( defined( 'DOING_AJAX' ) ) {
|
268 |
+
if ( isset( $_POST['foogallery_nextgen_import_paged'] ) ) {
|
269 |
+
$url = $_POST['foogallery_nextgen_import_url'];
|
270 |
+
$page = $_POST['foogallery_nextgen_import_paged'];
|
271 |
+
} else {
|
272 |
+
$url = wp_get_referer();
|
273 |
+
$parts = parse_url($url);
|
274 |
+
parse_str( $parts['query'], $query );
|
275 |
+
$page = $query['paged'];
|
276 |
+
}
|
277 |
+
} elseif ( isset( $_GET['paged'] ) ) {
|
278 |
+
$page = $_GET['paged'];
|
279 |
+
}
|
280 |
+
$url = add_query_arg( 'paged', $page, $url );
|
281 |
+
$gallery_count = count($galleries);
|
282 |
+
$page_size = apply_filters( 'foogallery_nextgen_import_page_size', 10);
|
283 |
+
|
284 |
+
$pagination = new FooGalleryNextGenPagination();
|
285 |
+
$pagination->items( $gallery_count );
|
286 |
+
$pagination->limit( $page_size ); // Limit entries per page
|
287 |
+
$pagination->url = $url;
|
288 |
+
$pagination->currentPage( $page );
|
289 |
+
$pagination->calculate();
|
290 |
+
|
291 |
+
for ($counter = $pagination->start; $counter <= $pagination->end; $counter++ ) {
|
292 |
+
if ( $counter >= $gallery_count ) {
|
293 |
+
break;
|
294 |
+
}
|
295 |
+
$gallery = $galleries[$counter];
|
296 |
+
$progress = $this->get_import_progress( $gallery->gid );
|
297 |
+
$done = $progress->is_completed();
|
298 |
+
$edit_link = '';
|
299 |
+
$foogallery = false;
|
300 |
+
if ( $progress->foogallery_id > 0 ) {
|
301 |
+
$foogallery = FooGallery::get_by_id( $progress->foogallery_id );
|
302 |
+
if ( $foogallery ) {
|
303 |
+
$edit_link = '<a href="' . admin_url( 'post.php?post=' . $progress->foogallery_id . '&action=edit' ) . '">' . $foogallery->name . '</a>';
|
304 |
+
} else {
|
305 |
+
$done = false;
|
306 |
+
}
|
307 |
+
} ?>
|
308 |
+
<tr class="<?php echo ($counter % 2 === 0) ? 'alternate' : ''; ?>">
|
309 |
+
<?php if ( ! $importing && ! $done && $all_imports_completed ) { ?>
|
310 |
+
<th scope="row" class="column-cb check-column">
|
311 |
+
<input name="nextgen-id[]" type="checkbox" checked="checked" value="<?php echo $gallery->gid; ?>">
|
312 |
+
</th>
|
313 |
+
<?php } else if ( $importing && $gallery->gid == $current_nextgen_id ) { ?>
|
314 |
+
<th>
|
315 |
+
<div class="dashicons dashicons-arrow-right"></div>
|
316 |
+
</th>
|
317 |
+
<?php } else { ?>
|
318 |
+
<th>
|
319 |
+
</th>
|
320 |
+
<?php } ?>
|
321 |
+
<td>
|
322 |
+
<?php echo $gallery->gid . '. '; ?>
|
323 |
+
<strong><?php echo $gallery->title; ?></strong>
|
324 |
+
<?php echo ' ' . sprintf( __( '(%s images)', 'foogallery' ), $gallery->image_count ); ?>
|
325 |
+
</td>
|
326 |
+
<td>
|
327 |
+
<?php if ( $foogallery ) {
|
328 |
+
echo $edit_link;
|
329 |
+
} else { ?>
|
330 |
+
<input name="foogallery-name-<?php echo $gallery->gid; ?>" value="<?php echo $gallery->title; ?>">
|
331 |
+
<?php } ?>
|
332 |
+
</td>
|
333 |
+
<td class="nextgen-import-progress nextgen-import-progress-<?php echo $progress->status; ?>">
|
334 |
+
<?php echo $progress->message(); ?>
|
335 |
+
</td>
|
336 |
+
</tr>
|
337 |
+
<?php
|
338 |
+
}
|
339 |
+
?>
|
340 |
+
</tbody>
|
341 |
+
</table>
|
342 |
+
<div class="tablenav bottom">
|
343 |
+
<div class="tablenav-pages">
|
344 |
+
<?php echo $pagination->render(); ?>
|
345 |
+
</div>
|
346 |
+
</div>
|
347 |
+
|
348 |
+
<?php
|
349 |
+
//hidden fields used for pagination
|
350 |
+
echo '<input type="hidden" name="foogallery_nextgen_import_paged" value="' . esc_attr( $page ) . '" />';
|
351 |
+
echo '<input type="hidden" name="foogallery_nextgen_import_url" value="' . esc_url( $url ) . '" />';
|
352 |
+
|
353 |
+
echo '<input type="hidden" id="nextgen_import_progress" value="' . $overall_progress . '" />';
|
354 |
+
wp_nonce_field( 'foogallery_nextgen_import', 'foogallery_nextgen_import' );
|
355 |
+
wp_nonce_field( 'foogallery_nextgen_import_refresh', 'foogallery_nextgen_import_refresh', false );
|
356 |
+
wp_nonce_field( 'foogallery_nextgen_import_cancel', 'foogallery_nextgen_import_cancel', false );
|
357 |
+
wp_nonce_field( 'foogallery_nextgen_import_reset', 'foogallery_nextgen_import_reset', false );
|
358 |
+
if ( ! $import_has_started && ! $importing ) {
|
359 |
+
?>
|
360 |
+
<input type="submit" class="button button-primary start_import"
|
361 |
+
value="<?php _e( 'Start Import', 'foogallery' ); ?>">
|
362 |
+
<?php } else if ( $import_has_started && ! $importing ) { ?>
|
363 |
+
<input type="submit" class="button button-primary continue_import" value="<?php _e( 'Resume Import', 'foogallery' ); ?>">
|
364 |
+
<?php } else { ?>
|
365 |
+
<input type="submit" class="button cancel_import" value="<?php _e( 'Stop Import', 'foogallery' ); ?>">
|
366 |
+
<?php
|
367 |
+
}
|
368 |
+
if ( $has_imports && ! $importing ) { ?>
|
369 |
+
<input type="submit" name="foogallery_nextgen_reset" class="button reset_import" value="<?php _e( 'Reset All Gallery Imports', 'foogallery' ); ?>">
|
370 |
+
<?php }
|
371 |
+
?>
|
372 |
+
<div id="import_spinner" style="width:20px">
|
373 |
+
<span class="spinner"></span>
|
374 |
+
</div>
|
375 |
+
<?php if ( $importing ) { ?>
|
376 |
+
<div class="nextgen-import-progressbar">
|
377 |
+
<span style="width:<?php echo $overall_progress; ?>%"></span>
|
378 |
+
</div>
|
379 |
+
<?php echo intval( $overall_progress ); ?>%
|
380 |
+
<div style="width:20px; display: inline-block;">
|
381 |
+
<span class="spinner shown"></span>
|
382 |
+
</div>
|
383 |
+
<?php }
|
384 |
+
}
|
385 |
+
|
386 |
+
function render_album_import_form( $albums = false ) {
|
387 |
+
if ( false === $albums ) {
|
388 |
+
$albums = $this->get_albums();
|
389 |
+
}
|
390 |
+
$has_imports = get_option( self::NEXTGEN_OPTION_IMPORT_PROGRESS_ALBUM );
|
391 |
+
?>
|
392 |
+
<table class="wp-list-table widefat" cellspacing="0">
|
393 |
+
<thead>
|
394 |
+
<tr>
|
395 |
+
<th scope="col" class="manage-column">
|
396 |
+
<span><?php _e( 'NextGen Album', 'foogallery' ); ?></span>
|
397 |
+
</th>
|
398 |
+
<th scope="col" class="manage-column">
|
399 |
+
<span><?php _e( 'Album Name', 'foogallery' ); ?></span>
|
400 |
+
</th>
|
401 |
+
<th scope="col" class="manage-column">
|
402 |
+
<span><?php _e( 'NextGen Galleries', 'foogallery' ); ?></span>
|
403 |
+
</th>
|
404 |
+
<th scope="col" class="manage-column">
|
405 |
+
<span><?php _e( 'Import Options', 'foogallery' ); ?></span>
|
406 |
+
</th>
|
407 |
+
</tr>
|
408 |
+
</thead>
|
409 |
+
<tbody>
|
410 |
+
<?php
|
411 |
+
$counter = 0;
|
412 |
+
foreach ( $albums as $album ) {
|
413 |
+
$counter++;
|
414 |
+
$progress = $this->get_import_progress_for_album( $album->id );
|
415 |
+
$done = $progress->is_completed();
|
416 |
+
$edit_link = '';
|
417 |
+
$galleries = $this->nextgen_unserialize( $album->sortorder );
|
418 |
+
$foogallery_album = false;
|
419 |
+
if ( $progress->foogallery_album_id > 0 ) {
|
420 |
+
$foogallery_album = FooGalleryAlbum::get_by_id( $progress->foogallery_album_id );
|
421 |
+
if ( $foogallery_album ) {
|
422 |
+
$edit_link = '<a href="' . admin_url( 'post.php?post=' . $progress->foogallery_album_id . '&action=edit' ) . '">' . $foogallery_album->name . '</a>';
|
423 |
+
} else {
|
424 |
+
$done = false;
|
425 |
+
}
|
426 |
+
} ?>
|
427 |
+
<tr class="<?php echo ($counter % 2 === 0) ? 'alternate' : ''; ?>">
|
428 |
+
<td>
|
429 |
+
<?php echo $album->name; ?>
|
430 |
+
<input type="hidden" class="foogallery-album-id" value="<?php echo $album->id; ?>">
|
431 |
+
</td>
|
432 |
+
<td>
|
433 |
+
<?php if ( $foogallery_album ) {
|
434 |
+
echo $edit_link;
|
435 |
+
} else { ?>
|
436 |
+
<input class="foogallery-album-name" value="<?php echo $album->name; ?>">
|
437 |
+
<?php } ?>
|
438 |
+
</td>
|
439 |
+
<td>
|
440 |
+
<ul class="ul-disc" style="margin: 0 0 0 20px;">
|
441 |
+
<?php
|
442 |
+
$import_gallery_count = 0;
|
443 |
+
if ( is_array( $galleries ) ) {
|
444 |
+
foreach ( $galleries as $gallery_id ) {
|
445 |
+
if ( 'a' === substr( $gallery_id, 0, 1 ) ) {
|
446 |
+
//we are dealing with an album inside the album
|
447 |
+
$nested_album = $this->get_album( substr( $gallery_id, 1 ) );
|
448 |
+
if ( $nested_album ) {
|
449 |
+
echo '<li>';
|
450 |
+
echo __( '[Album] ', 'foogallery' );
|
451 |
+
echo ' <span style="text-decoration:line-through">';
|
452 |
+
echo $nested_album->name;
|
453 |
+
echo '</span>';
|
454 |
+
echo ' (<span class="nextgen-import-progress-' . FooGallery_NextGen_Import_Progress::PROGRESS_ERROR . '">';
|
455 |
+
echo __( 'nested albums not supported', 'foogallery' );
|
456 |
+
echo '</span>)</li>';
|
457 |
+
}
|
458 |
+
} else {
|
459 |
+
$nextgen_gallery = $this->get_gallery( $gallery_id );
|
460 |
+
echo '<li>';
|
461 |
+
$gallery_progress = $this->get_import_progress( $gallery_id );
|
462 |
+
$gallery_completed = $gallery_progress->is_completed();
|
463 |
+
if ( $gallery_completed ) {
|
464 |
+
$import_gallery_count ++;
|
465 |
+
}
|
466 |
+
echo $gallery_completed ? '' : '<span style="text-decoration:line-through">';
|
467 |
+
echo $nextgen_gallery->title;
|
468 |
+
echo $gallery_completed ? '' : '</span>';
|
469 |
+
echo ' (<span class="nextgen-import-progress-' . $gallery_progress->status . '">';
|
470 |
+
echo $gallery_completed ? __( 'imported', 'foogallery' ) : __( 'not imported', 'foogallery' );
|
471 |
+
echo '</span>)</li>';
|
472 |
+
}
|
473 |
+
}
|
474 |
+
} else {
|
475 |
+
_e('No galleries in album!');
|
476 |
+
}
|
477 |
+
?>
|
478 |
+
</ul>
|
479 |
+
</td>
|
480 |
+
<td>
|
481 |
+
<span class="nextgen-import-progress nextgen-import-progress-<?php echo $progress->status; ?>">
|
482 |
+
<?php echo $progress->message(); ?>
|
483 |
+
</span>
|
484 |
+
<?php
|
485 |
+
|
486 |
+
echo '<br />';
|
487 |
+
if ( !$progress->is_completed() ) {
|
488 |
+
if ( $import_gallery_count > 0 ) {
|
489 |
+
echo '<input type="submit" class="button button-primary start_album_import" value="Import Album">';
|
490 |
+
echo '<div class="inline" style="width:20px"><span class="spinner"></span></div>';
|
491 |
+
echo '<br />';
|
492 |
+
if ( $import_gallery_count === count( $galleries ) ) {
|
493 |
+
_e( 'All galleries will be linked', 'foogallery' );
|
494 |
+
} else {
|
495 |
+
echo sprintf( __( '%d/%d galleries will be linked', 'foogallery' ), $import_gallery_count, count( $galleries ) );
|
496 |
+
echo '<br />';
|
497 |
+
_e ( '(Only previously imported galleries can be linked)', 'foogallery' );
|
498 |
+
}
|
499 |
+
} else {
|
500 |
+
_e( 'No galleries imported yet!!', 'foogallery' );
|
501 |
+
}
|
502 |
+
}
|
503 |
+
|
504 |
+
?>
|
505 |
+
</td>
|
506 |
+
</tr>
|
507 |
+
<?php
|
508 |
+
}
|
509 |
+
?>
|
510 |
+
</tbody>
|
511 |
+
</table>
|
512 |
+
<?php
|
513 |
+
wp_nonce_field( 'foogallery_nextgen_album_reset', 'foogallery_nextgen_album_reset', false );
|
514 |
+
wp_nonce_field( 'foogallery_nextgen_album_import', 'foogallery_nextgen_album_import', false );
|
515 |
+
|
516 |
+
if ( $has_imports ) { ?>
|
517 |
+
<br />
|
518 |
+
<input type="submit" name="foogallery_nextgen_reset_album" class="button reset_album_import" value="<?php _e( 'Reset All Album Imports', 'foogallery' ); ?>">
|
519 |
+
<?php }
|
520 |
+
}
|
521 |
+
|
522 |
+
function get_import_progress_for_album( $nextgen_gallery_album_id ) {
|
523 |
+
$progress = get_option( self::NEXTGEN_OPTION_IMPORT_PROGRESS_ALBUM );
|
524 |
+
if ( false !== $progress ) {
|
525 |
+
if ( false !== $nextgen_gallery_album_id && array_key_exists( $nextgen_gallery_album_id, $progress ) ) {
|
526 |
+
return $progress[ $nextgen_gallery_album_id ];
|
527 |
+
}
|
528 |
+
}
|
529 |
+
|
530 |
+
return new FooGallery_NextGen_Import_Progress_Album();
|
531 |
+
}
|
532 |
+
|
533 |
+
function import_album( $nextgen_gallery_album_id, $foogallery_album_name ) {
|
534 |
+
$progress = new FooGallery_NextGen_Import_Progress_Album();
|
535 |
+
$progress->nextgen_album_id = $nextgen_gallery_album_id;
|
536 |
+
$progress->foogallery_album_title = $foogallery_album_name;
|
537 |
+
|
538 |
+
//create a new foogallery album
|
539 |
+
$progress->import();
|
540 |
+
|
541 |
+
$overall_progress = get_option( self::NEXTGEN_OPTION_IMPORT_PROGRESS_ALBUM );
|
542 |
+
$overall_progress[ $nextgen_gallery_album_id ] = $progress;
|
543 |
+
update_option( self::NEXTGEN_OPTION_IMPORT_PROGRESS_ALBUM, $overall_progress );
|
544 |
+
}
|
545 |
+
|
546 |
+
function reset_album_import() {
|
547 |
+
delete_option( self::NEXTGEN_OPTION_IMPORT_PROGRESS_ALBUM );
|
548 |
+
}
|
549 |
+
|
550 |
+
/**
|
551 |
+
* Unserialize NextGEN data
|
552 |
+
*/
|
553 |
+
function nextgen_unserialize($value) {
|
554 |
+
$retval = NULL;
|
555 |
+
|
556 |
+
if ( is_string( $value ) ) {
|
557 |
+
$retval = stripcslashes( $value );
|
558 |
+
|
559 |
+
if ( strlen( $value ) > 1 ) {
|
560 |
+
// We can't always rely on base64_decode() or json_decode() to return FALSE as their documentation
|
561 |
+
// claims so check if $retval begins with a: as that indicates we have a serialized PHP object.
|
562 |
+
if ( strpos( $retval, 'a:' ) === 0 ) {
|
563 |
+
$er = error_reporting(0);
|
564 |
+
$retval = unserialize($value);
|
565 |
+
error_reporting($er);
|
566 |
+
} else {
|
567 |
+
// We use json_decode() here because PHP's unserialize() is not Unicode safe.
|
568 |
+
$retval = json_decode(base64_decode($retval), TRUE);
|
569 |
+
}
|
570 |
+
}
|
571 |
+
}
|
572 |
+
|
573 |
+
return $retval;
|
574 |
+
}
|
575 |
+
|
576 |
+
}
|
577 |
+
|
578 |
+
}
|
extensions/nextgen-importer/class-nextgen-import-progress-album.php
ADDED
@@ -0,0 +1,81 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
if ( ! class_exists( 'FooGallery_NextGen_Import_Progress_Album' ) ) {
|
4 |
+
|
5 |
+
class FooGallery_NextGen_Import_Progress_Album extends stdClass {
|
6 |
+
|
7 |
+
const PROGRESS_NOT_STARTED = 'not_started';
|
8 |
+
const PROGRESS_COMPLETED = 'completed';
|
9 |
+
const PROGRESS_ERROR = 'error';
|
10 |
+
|
11 |
+
function __construct() {
|
12 |
+
$this->nextgen_album_id = 0;
|
13 |
+
$this->foogallery_album_id = 0;
|
14 |
+
$this->foogallery_album_title = '';
|
15 |
+
$this->galleries_count = 0;
|
16 |
+
$this->nextgen_album = false;
|
17 |
+
$this->status = self::PROGRESS_NOT_STARTED;
|
18 |
+
}
|
19 |
+
|
20 |
+
function message() {
|
21 |
+
switch ( $this->status ) {
|
22 |
+
case self::PROGRESS_NOT_STARTED:
|
23 |
+
return __( 'Album not imported', 'foogallery' );
|
24 |
+
break;
|
25 |
+
case self::PROGRESS_COMPLETED:
|
26 |
+
return sprintf( __( 'Done! %d galleries(s) linked', 'foogallery' ), $this->galleries_count );
|
27 |
+
break;
|
28 |
+
}
|
29 |
+
|
30 |
+
return __( 'Unknown status!', 'foogallery' );
|
31 |
+
}
|
32 |
+
|
33 |
+
function is_completed() {
|
34 |
+
return $this->status === self::PROGRESS_COMPLETED;
|
35 |
+
}
|
36 |
+
|
37 |
+
function not_started() {
|
38 |
+
return $this->status === self::PROGRESS_NOT_STARTED;
|
39 |
+
}
|
40 |
+
|
41 |
+
function import() {
|
42 |
+
//create an empty foogallery album
|
43 |
+
$foogallery_album_args = array(
|
44 |
+
'post_title' => $this->foogallery_album_title,
|
45 |
+
'post_type' => FOOGALLERY_CPT_ALBUM,
|
46 |
+
'post_status' => 'publish',
|
47 |
+
);
|
48 |
+
$this->foogallery_album_id = wp_insert_post( $foogallery_album_args );
|
49 |
+
|
50 |
+
//set a default gallery template
|
51 |
+
add_post_meta( $this->foogallery_album_id, FOOGALLERY_ALBUM_META_TEMPLATE, foogallery_default_album_template(), true );
|
52 |
+
|
53 |
+
$nextgen = new FooGallery_NextGen_Helper();
|
54 |
+
|
55 |
+
//link all galleries that can be linked
|
56 |
+
$album = $nextgen->get_album( $this->nextgen_album_id );
|
57 |
+
$galleries = $nextgen->nextgen_unserialize( $album->sortorder );
|
58 |
+
$gallery_ids = array();
|
59 |
+
foreach ( $galleries as $gallery_id ) {
|
60 |
+
$gallery_progress = $nextgen->get_import_progress( $gallery_id );
|
61 |
+
if ( $gallery_progress->is_completed() ) {
|
62 |
+
$gallery_ids[] = $gallery_progress->foogallery_id;
|
63 |
+
$this->galleries_count++;
|
64 |
+
}
|
65 |
+
}
|
66 |
+
|
67 |
+
//link all galleries to the foogallery album
|
68 |
+
add_post_meta( $this->foogallery_album_id, FOOGALLERY_ALBUM_META_GALLERIES, $gallery_ids );
|
69 |
+
|
70 |
+
$this->status = self::PROGRESS_COMPLETED;
|
71 |
+
}
|
72 |
+
|
73 |
+
function can_import() {
|
74 |
+
if ( $this->status === self::PROGRESS_NOT_STARTED ) {
|
75 |
+
return count( $this->nextgen_galleries ) > 0;
|
76 |
+
}
|
77 |
+
|
78 |
+
return false;
|
79 |
+
}
|
80 |
+
}
|
81 |
+
}
|
extensions/nextgen-importer/class-nextgen-import-progress.php
ADDED
@@ -0,0 +1,154 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
if ( ! class_exists( 'FooGallery_NextGen_Import_Progress' ) ) {
|
4 |
+
|
5 |
+
class FooGallery_NextGen_Import_Progress extends stdClass {
|
6 |
+
|
7 |
+
const PROGRESS_NOT_STARTED = 'not_started';
|
8 |
+
const PROGRESS_QUEUED = 'queued';
|
9 |
+
const PROGRESS_STARTED = 'started';
|
10 |
+
const PROGRESS_COMPLETED = 'completed';
|
11 |
+
const PROGRESS_ERROR = 'error';
|
12 |
+
|
13 |
+
function __construct() {
|
14 |
+
$this->nextgen_gallery_id = 0;
|
15 |
+
$this->percentage_complete = 0;
|
16 |
+
$this->foogallery_id = 0;
|
17 |
+
$this->foogallery_title = '';
|
18 |
+
$this->import_count = 0;
|
19 |
+
$this->attachments = array();
|
20 |
+
$this->nextgen_gallery = false;
|
21 |
+
$this->nextgen_pictures = array();
|
22 |
+
$this->status = self::PROGRESS_NOT_STARTED;
|
23 |
+
$this->is_part_of_current_import = false;
|
24 |
+
}
|
25 |
+
|
26 |
+
function init( $nextgen_gallery_id, $foogallery_title ) {
|
27 |
+
$this->nextgen_gallery_id = $nextgen_gallery_id;
|
28 |
+
$this->foogallery_title = $foogallery_title;
|
29 |
+
$this->status = self::PROGRESS_QUEUED;
|
30 |
+
|
31 |
+
$nextgen = new FooGallery_NextGen_Helper();
|
32 |
+
|
33 |
+
//load the gallery and pictures
|
34 |
+
$this->nextgen_gallery = $nextgen->get_gallery( $this->nextgen_gallery_id );
|
35 |
+
$this->nextgen_pictures = $nextgen->get_gallery_images( $this->nextgen_gallery_id );
|
36 |
+
|
37 |
+
$this->import_count = count( $this->nextgen_pictures );
|
38 |
+
|
39 |
+
//check for zero images
|
40 |
+
if ( 0 === $this->import_count ) {
|
41 |
+
$this->status = self::PROGRESS_ERROR;
|
42 |
+
}
|
43 |
+
|
44 |
+
$this->is_part_of_current_import = true;
|
45 |
+
}
|
46 |
+
|
47 |
+
function message() {
|
48 |
+
switch ( $this->status ) {
|
49 |
+
case self::PROGRESS_NOT_STARTED:
|
50 |
+
return __( 'Not imported', 'foogallery' );
|
51 |
+
break;
|
52 |
+
case self::PROGRESS_QUEUED:
|
53 |
+
return __( 'Queued for import', 'foogallery' );
|
54 |
+
break;
|
55 |
+
case self::PROGRESS_STARTED:
|
56 |
+
return sprintf( __( 'Imported %d of %d image(s)', 'foogallery' ),
|
57 |
+
count( $this->attachments ), $this->import_count );
|
58 |
+
break;
|
59 |
+
case self::PROGRESS_COMPLETED:
|
60 |
+
return sprintf( __( 'Done! %d image(s) imported', 'foogallery' ), $this->import_count );
|
61 |
+
break;
|
62 |
+
case self::PROGRESS_ERROR:
|
63 |
+
if ( 0 === $this->import_count ) {
|
64 |
+
return __( 'No images to import!', 'foogallery' );
|
65 |
+
} else {
|
66 |
+
return __( 'Error while importing!', 'foogallery' );
|
67 |
+
}
|
68 |
+
break;
|
69 |
+
}
|
70 |
+
|
71 |
+
return __( 'Unknown status!', 'foogallery' );
|
72 |
+
}
|
73 |
+
|
74 |
+
function queued_for_import() {
|
75 |
+
return $this->status === self::PROGRESS_QUEUED;
|
76 |
+
}
|
77 |
+
|
78 |
+
function has_started() {
|
79 |
+
return $this->status === self::PROGRESS_STARTED;
|
80 |
+
}
|
81 |
+
|
82 |
+
function is_completed() {
|
83 |
+
return $this->status === self::PROGRESS_COMPLETED;
|
84 |
+
}
|
85 |
+
|
86 |
+
function not_started() {
|
87 |
+
return $this->status === self::PROGRESS_NOT_STARTED;
|
88 |
+
}
|
89 |
+
|
90 |
+
function start() {
|
91 |
+
$this->status = self::PROGRESS_STARTED;
|
92 |
+
|
93 |
+
//create an empty foogallery
|
94 |
+
$foogallery_args = array(
|
95 |
+
'post_title' => $this->foogallery_title,
|
96 |
+
'post_type' => FOOGALLERY_CPT_GALLERY,
|
97 |
+
'post_status' => 'publish',
|
98 |
+
);
|
99 |
+
$this->foogallery_id = wp_insert_post( $foogallery_args );
|
100 |
+
|
101 |
+
//set a default gallery template
|
102 |
+
add_post_meta( $this->foogallery_id, FOOGALLERY_META_TEMPLATE, foogallery_default_gallery_template(), true );
|
103 |
+
|
104 |
+
//set default settings if there are any
|
105 |
+
$default_gallery_id = foogallery_get_setting( 'default_gallery_settings' );
|
106 |
+
if ( $default_gallery_id ) {
|
107 |
+
$settings = get_post_meta( $default_gallery_id, FOOGALLERY_META_SETTINGS, true );
|
108 |
+
add_post_meta( $this->foogallery_id, FOOGALLERY_META_SETTINGS, $settings, true );
|
109 |
+
}
|
110 |
+
}
|
111 |
+
|
112 |
+
function can_import() {
|
113 |
+
if ( $this->status === self::PROGRESS_QUEUED ) {
|
114 |
+
return true;
|
115 |
+
} else if ( $this->status === self::PROGRESS_STARTED ) {
|
116 |
+
return count( $this->nextgen_pictures ) > 0;
|
117 |
+
}
|
118 |
+
|
119 |
+
return false;
|
120 |
+
}
|
121 |
+
|
122 |
+
function import_next_picture() {
|
123 |
+
$picture = array_pop( $this->nextgen_pictures );
|
124 |
+
|
125 |
+
$nextgen = new FooGallery_NextGen_Helper();
|
126 |
+
|
127 |
+
$attachment_id = $nextgen->import_picture( $this->nextgen_gallery->path, $picture );
|
128 |
+
|
129 |
+
$attachment_ids = get_post_meta( $this->foogallery_id, FOOGALLERY_META_ATTACHMENTS, true );
|
130 |
+
|
131 |
+
if ( empty( $attachment_ids ) ) {
|
132 |
+
$attachment_ids = array();
|
133 |
+
}
|
134 |
+
|
135 |
+
$attachment_ids[] = $attachment_id;
|
136 |
+
|
137 |
+
//link all attachments to foogallery
|
138 |
+
update_post_meta( $this->foogallery_id, FOOGALLERY_META_ATTACHMENTS, $attachment_ids );
|
139 |
+
|
140 |
+
//update our list of imported attachments
|
141 |
+
$this->attachments[] = $attachment_id;
|
142 |
+
|
143 |
+
//update our percentage complete
|
144 |
+
if ( $this->import_count > 0 ) {
|
145 |
+
$this->percentage_complete = count( $this->attachments ) / $this->import_count * 100;
|
146 |
+
}
|
147 |
+
|
148 |
+
//update our status if 100%
|
149 |
+
if ( 100 === $this->perc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://www.mis-algoritmos.com/2007/05/27/digg-style-pagination-class/
|
4 |
+
* Original author: Victor De la Rocha
|
5 |
+
* Date: 28/11/2015
|
6 |
+
*/
|
7 |
+
if ( ! class_exists( 'FooGalleryNextGenPagination' ) ) {
|
8 |
+
|
9 |
+
class FooGalleryNextGenPagination {
|
10 |
+
|
11 |
+
/* Default values */
|
12 |
+
var $item_count = 100;
|
13 |
+
var $limit = 10;
|
14 |
+
var $target = "";
|
15 |
+
var $page = 1;
|
16 |
+
var $adjacents = 2;
|
17 |
+
var $parameterName = "paged";
|
18 |
+
var $urlF = false;//urlFriendly
|
19 |
+
var $start = -1;
|
20 |
+
var $end = -1;
|
21 |
+
var $page_count = 10;
|
22 |
+
var $url = false;
|
23 |
+
|
24 |
+
/* Next and previous buttons */
|
25 |
+
var $nextI = "›";
|
26 |
+
var $prevI = "‹";
|
27 |
+
|
28 |
+
/* Processing variables */
|
29 |
+
var $calculate = false;
|
30 |
+
var $pagination = '';
|
31 |
+
var $errors = false;
|
32 |
+
|
33 |
+
#Total items
|
34 |
+
function items( $value ) {
|
35 |
+
$this->item_count = (int) $value;
|
36 |
+
}
|
37 |
+
|
38 |
+
#how many items to show per page
|
39 |
+
function limit( $value ) {
|
40 |
+
$this->limit = (int) $value;
|
41 |
+
}
|
42 |
+
|
43 |
+
#Page to sent the page value
|
44 |
+
function target( $value ) {
|
45 |
+
$this->target = $value;
|
46 |
+
}
|
47 |
+
|
48 |
+
#Current page
|
49 |
+
function currentPage( $value ) {
|
50 |
+
$this->page = (int) $value;
|
51 |
+
}
|
52 |
+
|
53 |
+
#How many adjacent pages should be shown on each side of the current page?
|
54 |
+
function adjacents( $value ) {
|
55 |
+
$this->adjacents = (int) $value;
|
56 |
+
}
|
57 |
+
|
58 |
+
#show counter?
|
59 |
+
function showCounter( $value = "" ) {
|
60 |
+
$this->showCounter = ( $value === true ) ? true : false;
|
61 |
+
}
|
62 |
+
|
63 |
+
#to change the class name of the pagination div
|
64 |
+
function changeClass( $value = "" ) {
|
65 |
+
$this->className = $value;
|
66 |
+
}
|
67 |
+
|
68 |
+
function nextLabel( $value ) {
|
69 |
+
$this->nextT = $value;
|
70 |
+
}
|
71 |
+
|
72 |
+
function nextIcon( $value ) {
|
73 |
+
$this->nextI = $value;
|
74 |
+
}
|
75 |
+
|
76 |
+
function prevLabel( $value ) {
|
77 |
+
$this->prevT = $value;
|
78 |
+
}
|
79 |
+
|
80 |
+
function prevIcon( $value ) {
|
81 |
+
$this->prevI = $value;
|
82 |
+
}
|
83 |
+
|
84 |
+
#to change the class name of the pagination div
|
85 |
+
function parameterName( $value = "" ) {
|
86 |
+
$this->parameterName = $value;
|
87 |
+
}
|
88 |
+
|
89 |
+
function render($echo = true) {
|
90 |
+
if ( ! $this->calculate ) {
|
91 |
+
$this->calculate();
|
92 |
+
}
|
93 |
+
if ( $echo ) {
|
94 |
+
echo $this->pagination;
|
95 |
+
} else {
|
96 |
+
return $this->pagination;
|
97 |
+
}
|
98 |
+
}
|
99 |
+
|
100 |
+
function get_page_number_url( $page_number ) {
|
101 |
+
return esc_url( add_query_arg( $this->parameterName, $page_number, $this->url ) );
|
102 |
+
}
|
103 |
+
|
104 |
+
function calculate() {
|
105 |
+
$this->pagination = "";
|
106 |
+
$this->calculate = true;
|
107 |
+
$this->errors = false;
|
108 |
+
|
109 |
+
if ( $this->urlF and $this->urlF != '%' and strpos( $this->target, $this->urlF ) === false ) {
|
110 |
+
//Es necesario especificar el comodin para sustituir
|
111 |
+
$this->errors = "Especificaste un wildcard para sustituir, pero no existe en el target";
|
112 |
+
return;
|
113 |
+
} elseif ( $this->urlF and $this->urlF == '%' and strpos( $this->target, $this->urlF ) === false ) {
|
114 |
+
$this->errors = "Es necesario especificar en el target el comodin % para sustituir el n�mero de p�gina";
|
115 |
+
return;
|
116 |
+
}
|
117 |
+
|
118 |
+
$n = $this->nextI;
|
119 |
+
$p = $this->prevI;
|
120 |
+
|
121 |
+
/* Setup vars for query. */
|
122 |
+
if ( $this->page ) {
|
123 |
+
$this->start = ( $this->page - 1 ) * $this->limit; //first item to display on this page
|
124 |
+
$this->end = $this->start + $this->limit - 1;
|
125 |
+
} else {
|
126 |
+
$this->start = 0; //if no page var is given, set start to 0
|
127 |
+
$this->end = $this->limit - 1;
|
128 |
+
}
|
129 |
+
|
130 |
+
/* Setup page vars for display. */
|
131 |
+
$counter = 1;
|
132 |
+
$prev = $this->page - 1; //previous page is page - 1
|
133 |
+
$next = $this->page + 1; //next page is page + 1
|
134 |
+
$this->page_count = ceil( $this->item_count / $this->limit ); //lastpage is = total pages / items per page, rounded up.
|
135 |
+
$lpm1 = $this->page_count - 1; //last page minus 1
|
136 |
+
|
137 |
+
/*
|
138 |
+
Now we apply our rules and draw the pagination object.
|
139 |
+
We're actually saving the code to a variable in case we want to draw it more than once.
|
140 |
+
*/
|
141 |
+
|
142 |
+
if ( $this->page_count > 1 ) {
|
143 |
+
if ( $this->page ) {
|
144 |
+
//anterior button
|
145 |
+
if ( $this->page > 1 ) {
|
146 |
+
$this->pagination .= "<a href=\"" . $this->get_page_number_url( $prev ) . "\" class=\"prev\">$p</a>";
|
147 |
+
} else {
|
148 |
+
$this->pagination .= "<span class=\"disabled\">$p</span>";
|
149 |
+
}
|
150 |
+
}
|
151 |
+
//pages
|
152 |
+
if ( $this->page_count < 7 + ( $this->adjacents * 2 ) ) {//not enough pages to bother breaking it up
|
153 |
+
for ( $counter = 1; $counter <= $this->page_count; $counter ++ ) {
|
154 |
+
if ( $counter == $this->page ) {
|
155 |
+
$this->pagination .= "<span class=\"selected-page\">$counter</span>";
|
156 |
+
} else {
|
157 |
+
$this->pagination .= "<a href=\"" . $this->get_page_number_url( $counter ) . "\">$counter</a>";
|
158 |
+
}
|
159 |
+
}
|
160 |
+
} elseif ( $this->page_count > 5 + ( $this->adjacents * 2 ) ) {//enough pages to hide some
|
161 |
+
//close to beginning; only hide later pages
|
162 |
+
if ( $this->page < 1 + ( $this->adjacents * 2 ) ) {
|
163 |
+
for ( $counter = 1; $counter < 4 + ( $this->adjacents * 2 ); $counter ++ ) {
|
164 |
+
if ( $counter == $this->page ) {
|
165 |
+
$this->pagination .= "<span class=\"selected-page\">$counter</span>";
|
166 |
+
} else {
|
167 |
+
$this->pagination .= "<a href=\"" . $this->get_page_number_url( $counter ) . "\">$counter</a>";
|
168 |
+
}
|
169 |
+
}
|
170 |
+
$this->pagination .= "...";
|
171 |
+
$this->pagination .= "<a href=\"" . $this->get_page_number_url( $lpm1 ) . "\">$lpm1</a>";
|
172 |
+
$this->pagination .= "<a href=\"" . $this->get_page_number_url( $this->page_count ) . "\">$this->page_count</a>";
|
173 |
+
} //in middle; hide some front and some back
|
174 |
+
elseif ( $this->page_count - ( $this->adjacents * 2 ) > $this->page && $this->page > ( $this->adjacents * 2 ) ) {
|
175 |
+
$this->pagination .= "<a href=\"" . $this->get_page_number_url( 1 ) . "\">1</a>";
|
176 |
+
$this->pagination .= "<a href=\"" . $this->get_page_number_url( 2 ) . "\">2</a>";
|
177 |
+
$this->pagination .= "...";
|
178 |
+
for ( $counter = $this->page - $this->adjacents; $counter <= $this->page + $this->adjacents; $counter ++ ) {
|
179 |
+
if ( $counter == $this->page ) {
|
180 |
+
$this->pagination .= "<span class=\"selected-page\">$counter</span>";
|
181 |
+
} else {
|
182 |
+
$this->pagination .= "<a href=\"" . $this->get_page_number_url( $counter ) . "\">$counter</a>";
|
183 |
+
}
|
184 |
+
}
|
185 |
+
$this->pagination .= "...";
|
186 |
+
$this->pagination .= "<a href=\"" . $this->get_page_number_url( $lpm1 ) . "\">$lpm1</a>";
|
187 |
+
$this->pagination .= "<a href=\"" . $this->get_page_number_url( $this->page_count ) . "\">$this->page_count</a>";
|
188 |
+
} //close to end; only hide early pages
|
189 |
+
else {
|
190 |
+
$this->pagination .= "<a href=\"" . $this->get_page_number_url( 1 ) . "\">1</a>";
|
191 |
+
$this->pagination .= "<a href=\"" . $this->get_page_number_url( 2 ) . "\">2</a>";
|
192 |
+
$this->pagination .= "...";
|
193 |
+
for ( $counter = $this->page_count - ( 2 + ( $this->adjacents * 2 ) ); $counter <= $this->page_count; $counter ++ ) {
|
194 |
+
if ( $counter == $this->page ) {
|
195 |
+
$this->pagination .= "<span class=\"selected-page\">$counter</span>";
|
196 |
+
} else {
|
197 |
+
$this->pagination .= "<a href=\"" . $this->get_page_number_url( $counter ) . "\">$counter</a>";
|
198 |
+
}
|
199 |
+
}
|
200 |
+
}
|
201 |
+
}
|
202 |
+
if ( $this->page ) {
|
203 |
+
//siguiente button
|
204 |
+
if ( $this->page < $counter - 1 ) {
|
205 |
+
$this->pagination .= "<a href=\"" . $this->get_page_number_url( $next ) . "\" class=\"next\">$n</a>";
|
206 |
+
} else {
|
207 |
+
$this->pagination .= "<span class=\"disabled\">$n</span>";
|
208 |
+
}
|
209 |
+
}
|
210 |
+
}
|
211 |
+
}
|
212 |
+
}
|
213 |
+
}
|
extensions/nextgen-importer/view-importer.php
ADDED
@@ -0,0 +1,280 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$nextgen = new FooGallery_NextGen_Helper();
|
3 |
+
if ( isset( $_POST['foogallery_nextgen_reset'] ) ) {
|
4 |
+
|
5 |
+
if ( check_admin_referer( 'foogallery_nextgen_import_reset', 'foogallery_nextgen_import_reset' ) ) {
|
6 |
+
$nextgen->reset_import();
|
7 |
+
}
|
8 |
+
} else if ( isset( $_POST['foogallery_nextgen_reset_album'] ) ) {
|
9 |
+
|
10 |
+
if ( check_admin_referer( 'foogallery_nextgen_album_reset', 'foogallery_nextgen_album_reset' ) ) {
|
11 |
+
$nextgen->reset_album_import();
|
12 |
+
}
|
13 |
+
}
|
14 |
+
?>
|
15 |
+
<style>
|
16 |
+
.foo-nav-tabs a:focus {
|
17 |
+
-webkit-box-shadow: none;
|
18 |
+
box-shadow: none;
|
19 |
+
}
|
20 |
+
|
21 |
+
.spinner.shown {
|
22 |
+
display: inline !important;
|
23 |
+
margin: 0;
|
24 |
+
}
|
25 |
+
|
26 |
+
.nextgen-import-progress-error {
|
27 |
+
color: #f00 !important;
|
28 |
+
}
|
29 |
+
|
30 |
+
.nextgen-import-progress-not_started {
|
31 |
+
color: #f60 !important;
|
32 |
+
}
|
33 |
+
|
34 |
+
.nextgen-import-progress-started {
|
35 |
+
color: #f80 !important;
|
36 |
+
}
|
37 |
+
|
38 |
+
.nextgen-import-progress-completed {
|
39 |
+
color: #080 !important;
|
40 |
+
}
|
41 |
+
|
42 |
+
.nextgen-import-progressbar {
|
43 |
+
margin-top: 10px;
|
44 |
+
display: inline-block;
|
45 |
+
width: 500px;
|
46 |
+
height: 10px;
|
47 |
+
background: #ddd;
|
48 |
+
position: relative;
|
49 |
+
}
|
50 |
+
|
51 |
+
.nextgen-import-progressbar span {
|
52 |
+
position: absolute;
|
53 |
+
height: 100%;
|
54 |
+
left: 0;
|
55 |
+
background: #888;
|
56 |
+
}
|
57 |
+
|
58 |
+
#nextgen_import_form .dashicons-arrow-right {
|
59 |
+
font-size: 2em;
|
60 |
+
margin-top: -0.2em;
|
61 |
+
}
|
62 |
+
|
63 |
+
.nextgen_import_container {
|
64 |
+
margin-top: 10px;
|
65 |
+
}
|
66 |
+
|
67 |
+
.tablenav .tablenav-pages a,
|
68 |
+
.tablenav .tablenav-pages span {
|
69 |
+
margin: 0 3px;
|
70 |
+
padding: 5px;
|
71 |
+
}
|
72 |
+
|
73 |
+
.tablenav-pages span {
|
74 |
+
display: inline-block;
|
75 |
+
min-width: 17px;
|
76 |
+
border: 1px solid #d2d2d2;
|
77 |
+
background: #e4e4e4;
|
78 |
+
font-size: 16px;
|
79 |
+
line-height: 1;
|
80 |
+
font-weight: normal;
|
81 |
+
text-align: center;
|
82 |
+
}
|
83 |
+
|
84 |
+
.tablenav-pages span.selected-page {
|
85 |
+
border-color: #5b9dd9;
|
86 |
+
color: #fff;
|
87 |
+
background: #00a0d2;
|
88 |
+
-webkit-box-shadow: none;
|
89 |
+
box-shadow: none;
|
90 |
+
outline: none;
|
91 |
+
}
|
92 |
+
|
93 |
+
.tablenav-pages span.disabled {
|
94 |
+
color: #888;
|
95 |
+
}
|
96 |
+
|
97 |
+
.foogallery-help {
|
98 |
+
margin-bottom: 10px;
|
99 |
+
}
|
100 |
+
|
101 |
+
</style>
|
102 |
+
<script>
|
103 |
+
jQuery(function ($) {
|
104 |
+
|
105 |
+
function nextgen_ajax(action, success_callback) {
|
106 |
+
var data = jQuery("#nextgen_import_form").serialize();
|
107 |
+
|
108 |
+
$.ajax({
|
109 |
+
type: "POST",
|
110 |
+
url: ajaxurl,
|
111 |
+
data: data + "&action=" + action,
|
112 |
+
success: success_callback,
|
113 |
+
error: function() {
|
114 |
+
//something went wrong! Alert the user and reload the page
|
115 |
+
alert('<?php _e( 'Something went wrong with the import and the page will now reload. Once it has reloaded, click "Resume Import" to continue with the import.', 'foogallery' ); ?>');
|
116 |
+
location.reload();
|
117 |
+
}
|
118 |
+
});
|
119 |
+
}
|
120 |
+
|
121 |
+
function nextgen_import_continue(dont_check_progress) {
|
122 |
+
nextgen_ajax('foogallery_nextgen_import_refresh', function (data) {
|
123 |
+
$('#nextgen_import_form').html(data);
|
124 |
+
|
125 |
+
if (dont_check_progress != true) {
|
126 |
+
//check if we need to carry on polling
|
127 |
+
var percentage = parseInt($('#nextgen_import_progress').val());
|
128 |
+
if (percentage < 100) {
|
129 |
+
nextgen_import_continue();
|
130 |
+
} else {
|
131 |
+
nextgen_import_continue(true);
|
132 |
+
}
|
133 |
+
}
|
134 |
+
});
|
135 |
+
}
|
136 |
+
|
137 |
+
$('#nextgen_import_form').on('click', '.start_import', function (e) {
|
138 |
+
e.preventDefault();
|
139 |
+
|
140 |
+
//show the spinner
|
141 |
+
$('#nextgen_import_form .button').hide();
|
142 |
+
$('#import_spinner .spinner').addClass('is-active');
|
143 |
+
|
144 |
+
nextgen_ajax('foogallery_nextgen_import', function (data) {
|
145 |
+
$('#nextgen_import_form').html(data);
|
146 |
+
nextgen_import_continue();
|
147 |
+
});
|
148 |
+
});
|
149 |
+
|
150 |
+
$('#nextgen_import_form').on('click', '.continue_import', function (e) {
|
151 |
+
e.preventDefault();
|
152 |
+
nextgen_import_continue();
|
153 |
+
});
|
154 |
+
|
155 |
+
$('#nextgen_import_form').on('click', '.cancel_import', function (e) {
|
156 |
+
if (!confirm('<?php _e( 'Are you sure you want to cancel?', 'foogallery' ); ?>')) {
|
157 |
+
e.preventDefault();
|
158 |
+
return false;
|
159 |
+
}
|
160 |
+
});
|
161 |
+
|
162 |
+
$('#nextgen_import_form').on('click', '.reset_import', function (e) {
|
163 |
+
if (!confirm('<?php _e( 'Are you sure you want to reset all NextGen gallery import data? This may result in duplicate galleries and media attachments!', 'foogallery' ); ?>')) {
|
164 |
+
e.preventDefault();
|
165 |
+
return false;
|
166 |
+
}
|
167 |
+
});
|
168 |
+
|
169 |
+
$('#nextgen_import_album_form').on('click', '.reset_album_import', function (e) {
|
170 |
+
if (!confirm('<?php _e( 'Are you sure you want to reset all NextGen album import data? This may result in duplicate albums if you decide to import again!', 'foogallery' ); ?>')) {
|
171 |
+
e.preventDefault();
|
172 |
+
return false;
|
173 |
+
}
|
174 |
+
});
|
175 |
+
|
176 |
+
$('#nextgen_import_album_form').on('click', '.start_album_import', function (e) {
|
177 |
+
e.preventDefault();
|
178 |
+
|
179 |
+
//show the spinner
|
180 |
+
$(this).hide();
|
181 |
+
var $tr = $(this).parents('tr:first');
|
182 |
+
$tr.find('.spinner:first').addClass('is-active');
|
183 |
+
|
184 |
+
var data = {
|
185 |
+
action: 'foogallery_nextgen_album_import',
|
186 |
+
foogallery_nextgen_album_import: $('#foogallery_nextgen_album_import').val(),
|
187 |
+
nextgen_album_id: $tr.find('.foogallery-album-id').val(),
|
188 |
+
foogallery_album_name: $tr.find('.foogallery-album-name').val()
|
189 |
+
};
|
190 |
+
|
191 |
+
$.ajax({
|
192 |
+
type: "POST",
|
193 |
+
url: ajaxurl,
|
194 |
+
data: data,
|
195 |
+
success: function(data) {
|
196 |
+
$('#nextgen_import_album_form').html(data);
|
197 |
+
},
|
198 |
+
error: function() {
|
199 |
+
//something went wrong! Alert the user and reload the page
|
200 |
+
alert('<?php _e( 'Something went wrong with the import and the page will now reload.', 'foogallery' ); ?>');
|
201 |
+
location.reload();
|
202 |
+
}
|
203 |
+
});
|
204 |
+
});
|
205 |
+
|
206 |
+
$('.foo-nav-tabs').on('click', 'a', function (e) {
|
207 |
+
$('.nextgen_import_container').hide();
|
208 |
+
var tab = $(this).data('tab');
|
209 |
+
$('#' + tab).show();
|
210 |
+
$('.nav-tab').removeClass('nav-tab-active');
|
211 |
+
$(this).addClass('nav-tab-active');
|
212 |
+
});
|
213 |
+
|
214 |
+
if (window.location.hash) {
|
215 |
+
$('.foo-nav-tabs a[href="' + window.location.hash + '"]').click();
|
216 |
+
}
|
217 |
+
});
|
218 |
+
</script>
|
219 |
+
<div class="wrap about-wrap">
|
220 |
+
<?php
|
221 |
+
$galleries = $nextgen->get_galleries();
|
222 |
+
$albums = $nextgen->get_albums();
|
223 |
+
$gallery_count = '';
|
224 |
+
if ( count( $galleries ) > 0 ) {
|
225 |
+
$gallery_count = ' (' . count( $galleries ) . ')';
|
226 |
+
}
|
227 |
+
$album_count = '';
|
228 |
+
if ( count( $albums ) > 0 ) {
|
229 |
+
$album_count = ' (' . count( $albums ) . ')';
|
230 |
+
}
|
231 |
+
?>
|
232 |
+
|
233 |
+
<h2><?php _e( 'NextGen Gallery And Album Importer', 'foogallery' ); ?></h2>
|
234 |
+
|
235 |
+
<h2 class="foo-nav-tabs nav-tab-wrapper">
|
236 |
+
<a href="#galleries" data-tab="nextgen_import_galleries" class="nav-tab nav-tab-active"><?php _e('Galleries', 'foogallery'); ?><?php echo $gallery_count; ?></a>
|
237 |
+
<a href="#albums" data-tab="nextgen_import_albums" class="nav-tab"><?php _e('Albums', 'foogallery'); ?><?php echo $album_count; ?></a>
|
238 |
+
</h2>
|
239 |
+
|
240 |
+
<div class="nextgen_import_container" id="nextgen_import_galleries">
|
241 |
+
<?php
|
242 |
+
if ( ! $galleries ) {
|
243 |
+
_e( 'There are no NextGen galleries to import!', 'foogallery' );
|
244 |
+
} else { ?>
|
245 |
+
<div class="foogallery-help">
|
246 |
+
<?php _e( 'Importing galleries is really simple:', 'foogallery' ); ?>
|
247 |
+
<ol>
|
248 |
+
<li><?php printf( __( 'Choose the NextGen galleries you want to import into %s by checking their checkboxes.', 'foogallery' ), foogallery_plugin_name() ); ?></li>
|
249 |
+
<li><?php _e( 'Click the Start Import button to start the import process.', 'foogallery' ); ?></li>
|
250 |
+
<li><?php printf( __( 'Once a gallery is imported, you can click on the link under the %s Name column to edit the gallery.', 'foogallery' ), foogallery_plugin_name() ); ?></li>
|
251 |
+
</ol>
|
252 |
+
<?php _e('Please note: importing large galleries with lots of images can take a while!', 'foogallery' ); ?>
|
253 |
+
</div>
|
254 |
+
|
255 |
+
<form id="nextgen_import_form" method="POST">
|
256 |
+
<?php $nextgen->render_import_form( $galleries ); ?>
|
257 |
+
</form>
|
258 |
+
<?php } ?>
|
259 |
+
</div>
|
260 |
+
<div class="nextgen_import_container" id="nextgen_import_albums" style="display: none">
|
261 |
+
<?php
|
262 |
+
if ( ! $albums ) {
|
263 |
+
_e( 'There are no NextGen albums to import!', 'foogallery' );
|
264 |
+
} else { ?>
|
265 |
+
<div class="foogallery-help">
|
266 |
+
<?php _e( 'Importing albums is also really simple:', 'foogallery' ); ?>
|
267 |
+
<ol>
|
268 |
+
<li><?php _e( __( 'For all the albums you wish to import, make sure all the galleries have been imported FIRST. If not, then go back to the Galleries tab.', 'foogallery' )); ?></li>
|
269 |
+
<li><?php _e( 'Click the Import Album button for each album to import the album and link all the galleries. If you do not see the button, then that means you first need to import the galleries.', 'foogallery' ); ?></li>
|
270 |
+
<li><?php _e( 'Once an album is imported, you can click on the link under the Album Name column to edit the album.', 'foogallery'); ?></li>
|
271 |
+
</ol>
|
272 |
+
</div>
|
273 |
+
|
274 |
+
<form id="nextgen_import_album_form" method="POST">
|
275 |
+
<?php $nextgen->render_album_import_form( $albums ); ?>
|
276 |
+
</form>
|
277 |
+
<?php } ?>
|
278 |
+
</div>
|
279 |
+
|
280 |
+
</div>
|
foogallery.php
ADDED
@@ -0,0 +1,306 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
Plugin Name: FooGallery
|
5 |
+
Description: FooGallery is the most intuitive and extensible gallery management tool ever created for WordPress
|
6 |
+
Version: 1.3.29
|
7 |
+
Author: FooPlugins
|
8 |
+
Plugin URI: https://foo.gallery
|
9 |
+
Author URI: http://fooplugins.com
|
10 |
+
Text Domain: foogallery
|
11 |
+
License: GPL-2.0+
|
12 |
+
Domain Path: /languages
|
13 |
+
|
14 |
+
@fs_premium_only /pro/
|
15 |
+
*/
|
16 |
+
// If this file is called directly, abort.
|
17 |
+
if ( !defined( 'WPINC' ) ) {
|
18 |
+
die;
|
19 |
+
}
|
20 |
+
|
21 |
+
if ( !class_exists( 'FooGallery_Plugin' ) ) {
|
22 |
+
define( 'FOOGALLERY_SLUG', 'foogallery' );
|
23 |
+
define( 'FOOGALLERY_PATH', plugin_dir_path( __FILE__ ) );
|
24 |
+
define( 'FOOGALLERY_URL', plugin_dir_url( __FILE__ ) );
|
25 |
+
define( 'FOOGALLERY_FILE', __FILE__ );
|
26 |
+
define( 'FOOGALLERY_VERSION', '1.3.29' );
|
27 |
+
define( 'FOOGALLERY_SETTINGS_VERSION', '2' );
|
28 |
+
require_once FOOGALLERY_PATH . 'includes/constants.php';
|
29 |
+
// Create a helper function for easy SDK access.
|
30 |
+
function foogallery_fs()
|
31 |
+
{
|
32 |
+
global $foogallery_fs ;
|
33 |
+
|
34 |
+
if ( !isset( $foogallery_fs ) ) {
|
35 |
+
// Include Freemius SDK.
|
36 |
+
require_once dirname( __FILE__ ) . '/freemius/start.php';
|
37 |
+
$foogallery_fs = fs_dynamic_init( array(
|
38 |
+
'id' => '843',
|
39 |
+
'slug' => 'foogallery',
|
40 |
+
'type' => 'plugin',
|
41 |
+
'public_key' => 'pk_d87616455a835af1d0658699d0192',
|
42 |
+
'is_premium' => false,
|
43 |
+
'has_addons' => false,
|
44 |
+
'has_paid_plans' => true,
|
45 |
+
'trial' => array(
|
46 |
+
'days' => 7,
|
47 |
+
'is_require_payment' => false,
|
48 |
+
),
|
49 |
+
'menu' => array(
|
50 |
+
'slug' => 'edit.php?post_type=' . FOOGALLERY_CPT_GALLERY,
|
51 |
+
'first-path' => 'edit.php?post_type=' . FOOGALLERY_CPT_GALLERY . '&page=' . FOOGALLERY_ADMIN_MENU_HELP_SLUG,
|
52 |
+
'account' => true,
|
53 |
+
'contact' => false,
|
54 |
+
'support' => false,
|
55 |
+
),
|
56 |
+
'is_live' => true,
|
57 |
+
) );
|
58 |
+
}
|
59 |
+
|
60 |
+
return $foogallery_fs;
|
61 |
+
}
|
62 |
+
|
63 |
+
// Init Freemius.
|
64 |
+
foogallery_fs();
|
65 |
+
// Signal that SDK was initiated.
|
66 |
+
do_action( 'foogallery_fs_loaded' );
|
67 |
+
require_once FOOGALLERY_PATH . 'includes/foopluginbase/bootstrapper.php';
|
68 |
+
/**
|
69 |
+
* FooGallery_Plugin class
|
70 |
+
*
|
71 |
+
* @package FooGallery
|
72 |
+
* @author Brad Vincent <brad@fooplugins.com>
|
73 |
+
* @license GPL-2.0+
|
74 |
+
* @link https://github.com/fooplugins/foogallery
|
75 |
+
* @copyright 2013 FooPlugins LLC
|
76 |
+
*/
|
77 |
+
class FooGallery_Plugin extends Foo_Plugin_Base_v2_4
|
78 |
+
{
|
79 |
+
private static $instance ;
|
80 |
+
public static function get_instance()
|
81 |
+
{
|
82 |
+
if ( !isset( self::$instance ) && !self::$instance instanceof FooGallery_Plugin ) {
|
83 |
+
self::$instance = new FooGallery_Plugin();
|
84 |
+
}
|
85 |
+
return self::$instance;
|
86 |
+
}
|
87 |
+
|
88 |
+
/**
|
89 |
+
* Initialize the plugin by setting localization, filters, and administration functions.
|
90 |
+
*/
|
91 |
+
private function __construct()
|
92 |
+
{
|
93 |
+
//include everything we need!
|
94 |
+
require_once FOOGALLERY_PATH . 'includes/includes.php';
|
95 |
+
register_activation_hook( __FILE__, array( 'FooGallery_Plugin', 'activate' ) );
|
96 |
+
//init FooPluginBase
|
97 |
+
$this->init(
|
98 |
+
FOOGALLERY_FILE,
|
99 |
+
FOOGALLERY_SLUG,
|
100 |
+
FOOGALLERY_VERSION,
|
101 |
+
'FooGallery'
|
102 |
+
);
|
103 |
+
//setup text domain
|
104 |
+
$this->load_plugin_textdomain();
|
105 |
+
//setup gallery post type
|
106 |
+
new FooGallery_PostTypes();
|
107 |
+
//load any extensions
|
108 |
+
new FooGallery_Extensions_Loader();
|
109 |
+
|
110 |
+
if ( is_admin() ) {
|
111 |
+
new FooGallery_Admin();
|
112 |
+
add_action( 'wpmu_new_blog', array( $this, 'set_default_extensions_for_multisite_network_activated' ) );
|
113 |
+
add_action( 'admin_page_access_denied', array( $this, 'check_for_access_denied' ) );
|
114 |
+
foogallery_fs()->add_filter(
|
115 |
+
'connect_message_on_update',
|
116 |
+
array( $this, 'override_connect_message_on_update' ),
|
117 |
+
10,
|
118 |
+
6
|
119 |
+
);
|
120 |
+
add_action( 'foogallery_admin_menu_before', array( $this, 'add_freemius_activation_menu' ) );
|
121 |
+
} else {
|
122 |
+
new FooGallery_Public();
|
123 |
+
}
|
124 |
+
|
125 |
+
new FooGallery_Thumbnails();
|
126 |
+
new FooGallery_Polylang_Compatibility();
|
127 |
+
new FooGallery_Attachment_Filters();
|
128 |
+
new FooGallery_Retina();
|
129 |
+
new FooGallery_WPThumb_Enhancements();
|
130 |
+
new FooGallery_Animated_Gif_Support();
|
131 |
+
new FooGallery_Cache();
|
132 |
+
new FooGallery_Common_Fields();
|
133 |
+
new FooGallery_LazyLoad();
|
134 |
+
new FooGallery_Paging();
|
135 |
+
new FooGallery_Thumbnail_Dimensions();
|
136 |
+
new FooGallery_FooBox_Support();
|
137 |
+
new FooGallery_Responsive_Lightbox_dFactory_Support();
|
138 |
+
new FooGallery_Attachment_Custom_Class();
|
139 |
+
new FooGallery_Upgrade();
|
140 |
+
new FooGallery_Extensions_Compatibility();
|
141 |
+
$checker = new FooGallery_Version_Check();
|
142 |
+
$checker->wire_up_checker();
|
143 |
+
}
|
144 |
+
|
145 |
+
/**
|
146 |
+
* Checks for the access denied page after we have activated/updated the plugin
|
147 |
+
*/
|
148 |
+
function check_for_access_denied()
|
149 |
+
{
|
150 |
+
global $plugin_page ;
|
151 |
+
if ( FOOGALLERY_ADMIN_MENU_HELP_SLUG === $plugin_page || FOOGALLERY_ADMIN_MENU_SETTINGS_SLUG === $plugin_page || FOOGALLERY_ADMIN_MENU_EXTENSIONS_SLUG === $plugin_page || FOOGALLERY_ADMIN_MENU_SYSTEMINFO_SLUG === $plugin_page ) {
|
152 |
+
fs_redirect( 'admin.php?page=' . FOOGALLERY_SLUG );
|
153 |
+
}
|
154 |
+
}
|
155 |
+
|
156 |
+
/**
|
157 |
+
*
|
158 |
+
*/
|
159 |
+
function override_connect_message_on_update(
|
160 |
+
$original,
|
161 |
+
$first_name,
|
162 |
+
$plugin_name,
|
163 |
+
$login,
|
164 |
+
$link,
|
165 |
+
$freemius_link
|
166 |
+
)
|
167 |
+
{
|
168 |
+
return sprintf( __( 'Hey %s', 'foogallery' ), $first_name ) . '<br>' . sprintf(
|
169 |
+
__( '<h2>Thank you for updating to %1$s v%5$s!</h2>Our goal with this update is to make %1$s the best gallery plugin for WordPress, but we need your help!<br><br>We have introduced this opt-in so that you can help us improve %1$s by simply clicking <strong>Allow & Continue</strong>.<br><br>If you opt-in, some data about your usage of %1$s will be sent to %4$s. If you skip this, that\'s okay! %1$s will still work just fine.', 'foogallery' ),
|
170 |
+
'<b>' . $plugin_name . '</b>',
|
171 |
+
'<b>' . $login . '</b>',
|
172 |
+
$link,
|
173 |
+
$freemius_link,
|
174 |
+
FOOGALLERY_VERSION
|
175 |
+
);
|
176 |
+
}
|
177 |
+
|
178 |
+
function add_freemius_activation_menu()
|
179 |
+
{
|
180 |
+
global $foogallery_fs ;
|
181 |
+
$parent_slug = foogallery_admin_menu_parent_slug();
|
182 |
+
if ( !$foogallery_fs->is_registered() ) {
|
183 |
+
add_submenu_page(
|
184 |
+
$parent_slug,
|
185 |
+
__( 'FooGallery Opt-In', 'foogallery' ),
|
186 |
+
__( 'Activation', 'foogallery' ),
|
187 |
+
'manage_options',
|
188 |
+
'foogallery-optin',
|
189 |
+
array( $foogallery_fs, '_connect_page_render' )
|
190 |
+
);
|
191 |
+
}
|
192 |
+
}
|
193 |
+
|
194 |
+
/**
|
195 |
+
* Set default extensions when a new site is created in multisite and FooGallery is network activated
|
196 |
+
*
|
197 |
+
* @since 1.2.5
|
198 |
+
*
|
199 |
+
* @param int $blog_id The ID of the newly created site
|
200 |
+
*/
|
201 |
+
public function set_default_extensions_for_multisite_network_activated( $blog_id )
|
202 |
+
{
|
203 |
+
switch_to_blog( $blog_id );
|
204 |
+
|
205 |
+
if ( false === get_option( FOOGALLERY_EXTENSIONS_AUTO_ACTIVATED_OPTIONS_KEY, false ) ) {
|
206 |
+
$api = new FooGallery_Extensions_API();
|
207 |
+
$api->auto_activate_extensions();
|
208 |
+
update_option( FOOGALLERY_EXTENSIONS_AUTO_ACTIVATED_OPTIONS_KEY, true );
|
209 |
+
}
|
210 |
+
|
211 |
+
restore_current_blog();
|
212 |
+
}
|
213 |
+
|
214 |
+
/**
|
215 |
+
* Fired when the plugin is activated.
|
216 |
+
*
|
217 |
+
* @since 1.0.0
|
218 |
+
*
|
219 |
+
* @param boolean $network_wide True if WPMU superadmin uses
|
220 |
+
* "Network Activate" action, false if
|
221 |
+
* WPMU is disabled or plugin is
|
222 |
+
* activated on an individual blog.
|
223 |
+
*/
|
224 |
+
public static function activate( $network_wide )
|
225 |
+
{
|
226 |
+
|
227 |
+
if ( function_exists( 'is_multisite' ) && is_multisite() ) {
|
228 |
+
|
229 |
+
if ( $network_wide ) {
|
230 |
+
// Get all blog ids
|
231 |
+
$blog_ids = self::get_blog_ids();
|
232 |
+
|
233 |
+
if ( is_array( $blog_ids ) ) {
|
234 |
+
foreach ( $blog_ids as $blog_id ) {
|
235 |
+
switch_to_blog( $blog_id );
|
236 |
+
self::single_activate();
|
237 |
+
}
|
238 |
+
restore_current_blog();
|
239 |
+
}
|
240 |
+
|
241 |
+
} else {
|
242 |
+
self::single_activate();
|
243 |
+
}
|
244 |
+
|
245 |
+
} else {
|
246 |
+
self::single_activate( false );
|
247 |
+
}
|
248 |
+
|
249 |
+
}
|
250 |
+
|
251 |
+
/**
|
252 |
+
* Fired for each blog when the plugin is activated.
|
253 |
+
*
|
254 |
+
* @since 1.0.0
|
255 |
+
*/
|
256 |
+
private static function single_activate( $multisite = true )
|
257 |
+
{
|
258 |
+
|
259 |
+
if ( false === get_option( FOOGALLERY_EXTENSIONS_AUTO_ACTIVATED_OPTIONS_KEY, false ) ) {
|
260 |
+
$api = new FooGallery_Extensions_API();
|
261 |
+
$api->auto_activate_extensions();
|
262 |
+
update_option( FOOGALLERY_EXTENSIONS_AUTO_ACTIVATED_OPTIONS_KEY, true );
|
263 |
+
}
|
264 |
+
|
265 |
+
if ( false === $multisite ) {
|
266 |
+
//Make sure we redirect to the welcome page
|
267 |
+
set_transient( FOOGALLERY_ACTIVATION_REDIRECT_TRANSIENT_KEY, true, 30 );
|
268 |
+
}
|
269 |
+
//force a version check on activation to make sure housekeeping is performed
|
270 |
+
foogallery_perform_version_check();
|
271 |
+
}
|
272 |
+
|
273 |
+
/**
|
274 |
+
* Get all blog ids of blogs in the current network that are:
|
275 |
+
* - not archived
|
276 |
+
* - not spam
|
277 |
+
* - not deleted
|
278 |
+
*
|
279 |
+
* @since 1.0.0
|
280 |
+
*
|
281 |
+
* @return array|false The blog ids, false if no matches.
|
282 |
+
*/
|
283 |
+
private static function get_blog_ids()
|
284 |
+
{
|
285 |
+
|
286 |
+
if ( function_exists( 'wp_get_sites' ) ) {
|
287 |
+
$sites = wp_get_sites();
|
288 |
+
$blog_ids = array();
|
289 |
+
foreach ( $sites as $site ) {
|
290 |
+
$blog_ids[] = $site['blog_id'];
|
291 |
+
}
|
292 |
+
return $blog_ids;
|
293 |
+
} else {
|
294 |
+
//pre WP 3.7 - do this the old way!
|
295 |
+
global $wpdb ;
|
296 |
+
// get an array of blog ids
|
297 |
+
$sql = "SELECT blog_id FROM {$wpdb->blogs} WHERE archived = '0' AND spam = '0' AND deleted = '0'";
|
298 |
+
return $wpdb->get_col( $sql );
|
299 |
+
}
|
300 |
+
|
301 |
+
}
|
302 |
+
|
303 |
+
}
|
304 |
+
}
|
305 |
+
|
306 |
+
FooGallery_Plugin::get_instance();
|
freemius/.codeclimate.yml
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
engines:
|
2 |
+
phpcodesniffer:
|
3 |
+
enabled: true
|
4 |
+
config:
|
5 |
+
standard: "WordPress"
|
6 |
+
checks:
|
7 |
+
Squiz Commenting InlineComment InvalidEndChar:
|
8 |
+
enabled: false
|
9 |
+
Squiz Commenting InlineComment SpacingBefore:
|
10 |
+
enabled: false
|
11 |
+
Squiz Commenting InlineComment WrongStyle:
|
12 |
+
enabled: false
|
13 |
+
Generic Commenting DocComment MissingShort:
|
14 |
+
enabled: false
|
15 |
+
Generic WhiteSpace ScopeIndent IncorrectExact:
|
16 |
+
enabled: false
|
17 |
+
ratings:
|
18 |
+
paths:
|
19 |
+
- "**.php"
|
freemius/.github/ISSUE_TEMPLATE.md
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
**Actual Behavior**:
|
2 |
+
- `What is the issue? (*)`
|
3 |
+
- `What is the expected behavior?`
|
4 |
+
|
5 |
+
**Versions**: (*)
|
6 |
+
- `Freemius SDK Version:`
|
7 |
+
- `WordPress Version:`
|
8 |
+
- `PHP Version:`
|
9 |
+
|
10 |
+
**Plugin / Theme**: (*)
|
11 |
+
- `Name:`
|
12 |
+
- `Slug:`
|
13 |
+
- `Freemius ID:`
|
14 |
+
|
15 |
+
**Additional Information**:
|
16 |
+
- `Browser Type: (*)`
|
17 |
+
- `Browser Version: (*)`
|
18 |
+
- `OS: (*)`
|
19 |
+
- `Stack Traces:`
|
20 |
+
|
21 |
+
----
|
22 |
+
**Note:** `(*)` indicates required information. Without this information, your issue may be auto-closed.
|
23 |
+
|
24 |
+
> You can find your Freemius SDK version at `/freemius/start.php`
|
25 |
+
|
26 |
+
> You can find your Freemius product ID in the Freemius dashboard: `SETTINGS -> INTEGRATION`.
|
27 |
+
|
28 |
+
> Do not modify the titles or questions. Simply add your responses to the ends of the questions.
|
29 |
+
Add more lines if needed.
|
freemius/.travis.yml
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
sudo: false
|
2 |
+
|
3 |
+
language: php
|
4 |
+
|
5 |
+
php:
|
6 |
+
- 5.3
|
7 |
+
- 5.4
|
8 |
+
- 5.5
|
9 |
+
- 5.6
|
10 |
+
- 7.0
|
11 |
+
- hhvm
|
freemius/LICENSE.txt
ADDED
@@ -0,0 +1,674 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
GNU GENERAL PUBLIC LICENSE
|
2 |
+
Version 3, 29 June 2007
|
3 |
+
|
4 |
+
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
5 |
+
Everyone is permitted to copy and distribute verbatim copies
|
6 |
+
of this license document, but changing it is not allowed.
|
7 |
+
|
8 |
+
Preamble
|
9 |
+
|
10 |
+
The GNU General Public License is a free, copyleft license for
|
11 |
+
software and other kinds of works.
|
12 |
+
|
13 |
+
The licenses for most software and other practical works are designed
|
14 |
+
to take away your freedom to share and change the works. By contrast,
|
15 |
+
the GNU General Public License is intended to guarantee your freedom to
|
16 |
+
share and change all versions of a program--to make sure it remains free
|
17 |
+
software for all its users. We, the Free Software Foundation, use the
|
18 |
+
GNU General Public License for most of our software; it applies also to
|
19 |
+
any other work released this way by its authors. You can apply it to
|
20 |
+
your programs, too.
|
21 |
+
|
22 |
+
When we speak of free software, we are referring to freedom, not
|
23 |
+
price. Our General Public Licenses are designed to make sure that you
|
24 |
+
have the freedom to distribute copies of free software (and charge for
|
25 |
+
them if you wish), that you receive source code or can get it if you
|
26 |
+
want it, that you can change the software or use pieces of it in new
|
27 |
+
free programs, and that you know you can do these things.
|
28 |
+
|
29 |
+
To protect your rights, we need to prevent others from denying you
|
30 |
+
these rights or asking you to surrender the rights. Therefore, you have
|
31 |
+
certain responsibilities if you distribute copies of the software, or if
|
32 |
+
you modify it: responsibilities to respect the freedom of others.
|
33 |
+
|
34 |
+
For example, if you distribute copies of such a program, whether
|
35 |
+
gratis or for a fee, you must pass on to the recipients the same
|
36 |
+
freedoms that you received. You must make sure that they, too, receive
|
37 |
+
or can get the source code. And you must show them these terms so they
|
38 |
+
know their rights.
|
39 |
+
|
40 |
+
Developers that use the GNU GPL protect your rights with two steps:
|
41 |
+
(1) assert copyright on the software, and (2) offer you this License
|
42 |
+
giving you legal permission to copy, distribute and/or modify it.
|
43 |
+
|
44 |
+
For the developers' and authors' protection, the GPL clearly explains
|
45 |
+
that there is no warranty for this free software. For both users' and
|
46 |
+
authors' sake, the GPL requires that modified versions be marked as
|
47 |
+
changed, so that their problems will not be attributed erroneously to
|
48 |
+
authors of previous versions.
|
49 |
+
|
50 |
+
Some devices are designed to deny users access to install or run
|
51 |
+
modified versions of the software inside them, although the manufacturer
|
52 |
+
can do so. This is fundamentally incompatible with the aim of
|
53 |
+
protecting users' freedom to change the software. The systematic
|
54 |
+
pattern of such abuse occurs in the area of products for individuals to
|
55 |
+
use, which is precisely where it is most unacceptable. Therefore, we
|
56 |
+
have designed this version of the GPL to prohibit the practice for those
|
57 |
+
products. If such problems arise substantially in other domains, we
|
58 |
+
stand ready to extend this provision to those domains in future versions
|
59 |
+
of the GPL, as needed to protect the freedom of users.
|
60 |
+
|
61 |
+
Finally, every program is threatened constantly by software patents.
|
62 |
+
States should not allow patents to restrict development and use of
|
63 |
+
software on general-purpose computers, but in those that do, we wish to
|
64 |
+
avoid the special danger that patents applied to a free program could
|
65 |
+
make it effectively proprietary. To prevent this, the GPL assures that
|
66 |
+
patents cannot be used to render the program non-free.
|
67 |
+
|
68 |
+
The precise terms and conditions for copying, distribution and
|
69 |
+
modification follow.
|
70 |
+
|
71 |
+
TERMS AND CONDITIONS
|
72 |
+
|
73 |
+
0. Definitions.
|
74 |
+
|
75 |
+
"This License" refers to version 3 of the GNU General Public License.
|
76 |
+
|
77 |
+
"Copyright" also means copyright-like laws that apply to other kinds of
|
78 |
+
works, such as semiconductor masks.
|
79 |
+
|
80 |
+
"The Program" refers to any copyrightable work licensed under this
|
81 |
+
License. Each licensee is addressed as "you". "Licensees" and
|
82 |
+
"recipients" may be individuals or organizations.
|
83 |
+
|
84 |
+
To "modify" a work means to copy from or adapt all or part of the work
|
85 |
+
in a fashion requiring copyright permission, other than the making of an
|
86 |
+
exact copy. The resulting work is called a "modified version" of the
|
87 |
+
earlier work or a work "based on" the earlier work.
|
88 |
+
|
89 |
+
A "covered work" means either the unmodified Program or a work based
|
90 |
+
on the Program.
|
91 |
+
|
92 |
+
To "propagate" a work means to do anything with it that, without
|
93 |
+
permission, would make you directly or secondarily liable for
|
94 |
+
infringement under applicable copyright law, except executing it on a
|
95 |
+
computer or modifying a private copy. Propagation includes copying,
|
96 |
+
distribution (with or without modification), making available to the
|
97 |
+
public, and in some countries other activities as well.
|
98 |
+
|
99 |
+
To "convey" a work means any kind of propagation that enables other
|
100 |
+
parties to make or receive copies. Mere interaction with a user through
|
101 |
+
a computer network, with no transfer of a copy, is not conveying.
|
102 |
+
|
103 |
+
An interactive user interface displays "Appropriate Legal Notices"
|
104 |
+
to the extent that it includes a convenient and prominently visible
|
105 |
+
feature that (1) displays an appropriate copyright notice, and (2)
|
106 |
+
tells the user that there is no warranty for the work (except to the
|
107 |
+
extent that warranties are provided), that licensees may convey the
|
108 |
+
work under this License, and how to view a copy of this License. If
|
109 |
+
the interface presents a list of user commands or options, such as a
|
110 |
+
menu, a prominent item in the list meets this criterion.
|
111 |
+
|
112 |
+
1. Source Code.
|
113 |
+
|
114 |
+
The "source code" for a work means the preferred form of the work
|
115 |
+
for making modifications to it. "Object code" means any non-source
|
116 |
+
form of a work.
|
117 |
+
|
118 |
+
A "Standard Interface" means an interface that either is an official
|
119 |
+
standard defined by a recognized standards body, or, in the case of
|
120 |
+
interfaces specified for a particular programming language, one that
|
121 |
+
is widely used among developers working in that language.
|
122 |
+
|
123 |
+
The "System Libraries" of an executable work include anything, other
|
124 |
+
than the work as a whole, that (a) is included in the normal form of
|
125 |
+
packaging a Major Component, but which is not part of that Major
|
126 |
+
Component, and (b) serves only to enable use of the work with that
|
127 |
+
Major Component, or to implement a Standard Interface for which an
|
128 |
+
implementation is available to the public in source code form. A
|
129 |
+
"Major Component", in this context, means a major essential component
|
130 |
+
(kernel, window system, and so on) of the specific operating system
|
131 |
+
(if any) on which the executable work runs, or a compiler used to
|
132 |
+
produce the work, or an object code interpreter used to run it.
|
133 |
+
|
134 |
+
The "Corresponding Source" for a work in object code form means all
|
135 |
+
the source code needed to generate, install, and (for an executable
|
136 |
+
work) run the object code and to modify the work, including scripts to
|
137 |
+
control those activities. However, it does not include the work's
|
138 |
+
System Libraries, or general-purpose tools or generally available free
|
139 |
+
programs which are used unmodified in performing those activities but
|
140 |
+
which are not part of the work. For example, Corresponding Source
|
141 |
+
includes interface definition files associated with source files for
|
142 |
+
the work, and the source code for shared libraries and dynamically
|
143 |
+
linked subprograms that the work is specifically designed to require,
|
144 |
+
such as by intimate data communication or control flow between those
|
145 |
+
subprograms and other parts of the work.
|
146 |
+
|
147 |
+
The Corresponding Source need not include anything that users
|
148 |
+
can regenerate automatically from other parts of the Corresponding
|
149 |
+
Source.
|
150 |
+
|
151 |
+
The Corresponding Source for a work in source code form is that
|
152 |
+
same work.
|
153 |
+
|
154 |
+
2. Basic Permissions.
|
155 |
+
|
156 |
+
All rights granted under this License are granted for the term of
|
157 |
+
copyright on the Program, and are irrevocable provided the stated
|
158 |
+
conditions are met. This License explicitly affirms your unlimited
|
159 |
+
permission to run the unmodified Program. The output from running a
|
160 |
+
covered work is covered by this License only if the output, given its
|
161 |
+
content, constitutes a covered work. This License acknowledges your
|
162 |
+
rights of fair use or other equivalent, as provided by copyright law.
|
163 |
+
|
164 |
+
You may make, run and propagate covered works that you do not
|
165 |
+
convey, without conditions so long as your license otherwise remains
|
166 |
+
in force. You may convey covered works to others for the sole purpose
|
167 |
+
of having them make modifications exclusively for you, or provide you
|
168 |
+
with facilities for running those works, provided that you comply with
|
169 |
+
the terms of this License in conveying all material for which you do
|
170 |
+
not control copyright. Those thus making or running the covered works
|
171 |
+
for you must do so exclusively on your behalf, under your direction
|
172 |
+
and control, on terms that prohibit them from making any copies of
|
173 |
+
your copyrighted material outside their relationship with you.
|
174 |
+
|
175 |
+
Conveying under any other circumstances is permitted solely under
|
176 |
+
the conditions stated below. Sublicensing is not allowed; section 10
|
177 |
+
makes it unnecessary.
|
178 |
+
|
179 |
+
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
180 |
+
|
181 |
+
No covered work shall be deemed part of an effective technological
|
182 |
+
measure under any applicable law fulfilling obligations under article
|
183 |
+
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
184 |
+
similar laws prohibiting or restricting circumvention of such
|
185 |
+
measures.
|
186 |
+
|
187 |
+
When you convey a covered work, you waive any legal power to forbid
|
188 |
+
circumvention of technological measures to the extent such circumvention
|
189 |
+
is effected by exercising rights under this License with respect to
|
190 |
+
the covered work, and you disclaim any intention to limit operation or
|
191 |
+
modification of the work as a means of enforcing, against the work's
|
192 |
+
users, your or third parties' legal rights to forbid circumvention of
|
193 |
+
technological measures.
|
194 |
+
|
195 |
+
4. Conveying Verbatim Copies.
|
196 |
+
|
197 |
+
You may convey verbatim copies of the Program's source code as you
|
198 |
+
receive it, in any medium, provided that you conspicuously and
|
199 |
+
appropriately publish on each copy an appropriate copyright notice;
|
200 |
+
keep intact all notices stating that this License and any
|
201 |
+
non-permissive terms added in accord with section 7 apply to the code;
|
202 |
+
keep intact all notices of the absence of any warranty; and give all
|
203 |
+
recipients a copy of this License along with the Program.
|
204 |
+
|
205 |
+
You may charge any price or no price for each copy that you convey,
|
206 |
+
and you may offer support or warranty protection for a fee.
|
207 |
+
|
208 |
+
5. Conveying Modified Source Versions.
|
209 |
+
|
210 |
+
You may convey a work based on the Program, or the modifications to
|
211 |
+
produce it from the Program, in the form of source code under the
|
212 |
+
terms of section 4, provided that you also meet all of these conditions:
|
213 |
+
|
214 |
+
a) The work must carry prominent notices stating that you modified
|
215 |
+
it, and giving a relevant date.
|
216 |
+
|
217 |
+
b) The work must carry prominent notices stating that it is
|
218 |
+
released under this License and any conditions added under section
|
219 |
+
7. This requirement modifies the requirement in section 4 to
|
220 |
+
"keep intact all notices".
|
221 |
+
|
222 |
+
c) You must license the entire work, as a whole, under this
|
223 |
+
License to anyone who comes into possession of a copy. This
|
224 |
+
License will therefore apply, along with any applicable section 7
|
225 |
+
additional terms, to the whole of the work, and all its parts,
|
226 |
+
regardless of how they are packaged. This License gives no
|
227 |
+
permission to license the work in any other way, but it does not
|
228 |
+
invalidate such permission if you have separately received it.
|
229 |
+
|
230 |
+
d) If the work has interactive user interfaces, each must display
|
231 |
+
Appropriate Legal Notices; however, if the Program has interactive
|
232 |
+
interfaces that do not display Appropriate Legal Notices, your
|
233 |
+
work need not make them do so.
|
234 |
+
|
235 |
+
A compilation of a covered work with other separate and independent
|
236 |
+
works, which are not by their nature extensions of the covered work,
|
237 |
+
and which are not combined with it such as to form a larger program,
|
238 |
+
in or on a volume of a storage or distribution medium, is called an
|
239 |
+
"aggregate" if the compilation and its resulting copyright are not
|
240 |
+
used to limit the access or legal rights of the compilation's users
|
241 |
+
beyond what the individual works permit. Inclusion of a covered work
|
242 |
+
in an aggregate does not cause this License to apply to the other
|
243 |
+
parts of the aggregate.
|
244 |
+
|
245 |
+
6. Conveying Non-Source Forms.
|
246 |
+
|
247 |
+
You may convey a covered work in object code form under the terms
|
248 |
+
of sections 4 and 5, provided that you also convey the
|
249 |
+
machine-readable Corresponding Source under the terms of this License,
|
250 |
+
in one of these ways:
|
251 |
+
|
252 |
+
a) Convey the object code in, or embodied in, a physical product
|
253 |
+
(including a physical distribution medium), accompanied by the
|
254 |
+
Corresponding Source fixed on a durable physical medium
|
255 |
+
customarily used for software interchange.
|
256 |
+
|
257 |
+
b) Convey the object code in, or embodied in, a physical product
|
258 |
+
(including a physical distribution medium), accompanied by a
|
259 |
+
written offer, valid for at least three years and valid for as
|
260 |
+
long as you offer spare parts or customer support for that product
|
261 |
+
model, to give anyone who possesses the object code either (1) a
|
262 |
+
copy of the Corresponding Source for all the software in the
|
263 |
+
product that is covered by this License, on a durable physical
|
264 |
+
medium customarily used for software interchange, for a price no
|
265 |
+
more than your reasonable cost of physically performing this
|
266 |
+
conveying of source, or (2) access to copy the
|
267 |
+
Corresponding Source from a network server at no charge.
|
268 |
+
|
269 |
+
c) Convey individual copies of the object code with a copy of the
|
270 |
+
written offer to provide the Corresponding Source. This
|
271 |
+
alternative is allowed only occasionally and noncommercially, and
|
272 |
+
only if you received the object code with such an offer, in accord
|
273 |
+
with subsection 6b.
|
274 |
+
|
275 |
+
d) Convey the object code by offering access from a designated
|
276 |
+
place (gratis or for a charge), and offer equivalent access to the
|
277 |
+
Corresponding Source in the same way through the same place at no
|
278 |
+
further charge. You need not require recipients to copy the
|
279 |
+
Corresponding Source along with the object code. If the place to
|
280 |
+
copy the object code is a network server, the Corresponding Source
|
281 |
+
may be on a different server (operated by you or a third party)
|
282 |
+
that supports equivalent copying facilities, provided you maintain
|
283 |
+
clear directions next to the object code saying where to find the
|
284 |
+
Corresponding Source. Regardless of what server hosts the
|
285 |
+
Corresponding Source, you remain obligated to ensure that it is
|
286 |
+
available for as long as needed to satisfy these requirements.
|
287 |
+
|
288 |
+
e) Convey the object code using peer-to-peer transmission, provided
|
289 |
+
you inform other peers where the object code and Corresponding
|
290 |
+
Source of the work are being offered to the general public at no
|
291 |
+
charge under subsection 6d.
|
292 |
+
|
293 |
+
A separable portion of the object code, whose source code is excluded
|
294 |
+
from the Corresponding Source as a System Library, need not be
|
295 |
+
included in conveying the object code work.
|
296 |
+
|
297 |
+
A "User Product" is either (1) a "consumer product", which means any
|
298 |
+
tangible personal property which is normally used for personal, family,
|
299 |
+
or household purposes, or (2) anything designed or sold for incorporation
|
300 |
+
into a dwelling. In determining whether a product is a consumer product,
|
301 |
+
doubtful cases shall be resolved in favor of coverage. For a particular
|
302 |
+
product received by a particular user, "normally used" refers to a
|
303 |
+
typical or common use of that class of product, regardless of the status
|
304 |
+
of the particular user or of the way in which the particular user
|
305 |
+
actually uses, or expects or is expected to use, the product. A product
|
306 |
+
is a consumer product regardless of whether the product has substantial
|
307 |
+
commercial, industrial or non-consumer uses, unless such uses represent
|
308 |
+
the only significant mode of use of the product.
|
309 |
+
|
310 |
+
"Installation Information" for a User Product means any methods,
|
311 |
+
procedures, authorization keys, or other information required to install
|
312 |
+
and execute modified versions of a covered work in that User Product from
|
313 |
+
a modified version of its Corresponding Source. The information must
|
314 |
+
suffice to ensure that the continued functioning of the modified object
|
315 |
+
code is in no case prevented or interfered with solely because
|
316 |
+
modification has been made.
|
317 |
+
|
318 |
+
If you convey an object code work under this section in, or with, or
|
319 |
+
specifically for use in, a User Product, and the conveying occurs as
|
320 |
+
part of a transaction in which the right of possession and use of the
|
321 |
+
User Product is transferred to the recipient in perpetuity or for a
|
322 |
+
fixed term (regardless of how the transaction is characterized), the
|
323 |
+
Corresponding Source conveyed under this section must be accompanied
|
324 |
+
by the Installation Information. But this requirement does not apply
|
325 |
+
if neither you nor any third party retains the ability to install
|
326 |
+
modified object code on the User Product (for example, the work has
|
327 |
+
been installed in ROM).
|
328 |
+
|
329 |
+
The requirement to provide Installation Information does not include a
|
330 |
+
requirement to continue to provide support service, warranty, or updates
|
331 |
+
for a work that has been modified or installed by the recipient, or for
|
332 |
+
the User Product in which it has been modified or installed. Access to a
|
333 |
+
network may be denied when the modification itself materially and
|
334 |
+
adversely affects the operation of the network or violates the rules and
|
335 |
+
protocols for communication across the network.
|
336 |
+
|
337 |
+
Corresponding Source conveyed, and Installation Information provided,
|
338 |
+
in accord with this section must be in a format that is publicly
|
339 |
+
documented (and with an implementation available to the public in
|
340 |
+
source code form), and must require no special password or key for
|
341 |
+
unpacking, reading or copying.
|
342 |
+
|
343 |
+
7. Additional Terms.
|
344 |
+
|
345 |
+
"Additional permissions" are terms that supplement the terms of this
|
346 |
+
License by making exceptions from one or more of its conditions.
|
347 |
+
Additional permissions that are applicable to the entire Program shall
|
348 |
+
be treated as though they were included in this License, to the extent
|
349 |
+
that they are valid under applicable law. If additional permissions
|
350 |
+
apply only to part of the Program, that part may be used separately
|
351 |
+
under those permissions, but the entire Program remains governed by
|
352 |
+
this License without regard to the additional permissions.
|
353 |
+
|
354 |
+
When you convey a copy of a covered work, you may at your option
|
355 |
+
remove any additional permissions from that copy, or from any part of
|
356 |
+
it. (Additional permissions may be written to require their own
|
357 |
+
removal in certain cases when you modify the work.) You may place
|
358 |
+
additional permissions on material, added by you to a covered work,
|
359 |
+
for which you have or can give appropriate copyright permission.
|
360 |
+
|
361 |
+
Notwithstanding any other provision of this License, for material you
|
362 |
+
add to a covered work, you may (if authorized by the copyright holders of
|
363 |
+
that material) supplement the terms of this License with terms:
|
364 |
+
|
365 |
+
a) Disclaiming warranty or limiting liability differently from the
|
366 |
+
terms of sections 15 and 16 of this License; or
|
367 |
+
|
368 |
+
b) Requiring preservation of specified reasonable legal notices or
|
369 |
+
author attributions in that material or in the Appropriate Legal
|
370 |
+
Notices displayed by works containing it; or
|
371 |
+
|
372 |
+
c) Prohibiting misrepresentation of the origin of that material, or
|
373 |
+
requiring that modified versions of such material be marked in
|
374 |
+
reasonable ways as different from the original version; or
|
375 |
+
|
376 |
+
d) Limiting the use for publicity purposes of names of licensors or
|
377 |
+
authors of the material; or
|
378 |
+
|
379 |
+
e) Declining to grant rights under trademark law for use of some
|
380 |
+
trade names, trademarks, or service marks; or
|
381 |
+
|
382 |
+
f) Requiring indemnification of licensors and authors of that
|
383 |
+
material by anyone who conveys the material (or modified versions of
|
384 |
+
it) with contractual assumptions of liability to the recipient, for
|
385 |
+
any liability that these contractual assumptions directly impose on
|
386 |
+
those licensors and authors.
|
387 |
+
|
388 |
+
All other non-permissive additional terms are considered "further
|
389 |
+
restrictions" within the meaning of section 10. If the Program as you
|
390 |
+
received it, or any part of it, contains a notice stating that it is
|
391 |
+
governed by this License along with a term that is a further
|
392 |
+
restriction, you may remove that term. If a license document contains
|
393 |
+
a further restriction but permits relicensing or conveying under this
|
394 |
+
License, you may add to a covered work material governed by the terms
|
395 |
+
of that license document, provided that the further restriction does
|
396 |
+
not survive such relicensing or conveying.
|
397 |
+
|
398 |
+
If you add terms to a covered work in accord with this section, you
|
399 |
+
must place, in the relevant source files, a statement of the
|
400 |
+
additional terms that apply to those files, or a notice indicating
|
401 |
+
where to find the applicable terms.
|
402 |
+
|
403 |
+
Additional terms, permissive or non-permissive, may be stated in the
|
404 |
+
form of a separately written license, or stated as exceptions;
|
405 |
+
the above requirements apply either way.
|
406 |
+
|
407 |
+
8. Termination.
|
408 |
+
|
409 |
+
You may not propagate or modify a covered work except as expressly
|
410 |
+
provided under this License. Any attempt otherwise to propagate or
|
411 |
+
modify it is void, and will automatically terminate your rights under
|
412 |
+
this License (including any patent licenses granted under the third
|
413 |
+
paragraph of section 11).
|
414 |
+
|
415 |
+
However, if you cease all violation of this License, then your
|
416 |
+
license from a particular copyright holder is reinstated (a)
|
417 |
+
provisionally, unless and until the copyright holder explicitly and
|
418 |
+
finally terminates your license, and (b) permanently, if the copyright
|
419 |
+
holder fails to notify you of the violation by some reasonable means
|
420 |
+
prior to 60 days after the cessation.
|
421 |
+
|
422 |
+
Moreover, your license from a particular copyright holder is
|
423 |
+
reinstated permanently if the copyright holder notifies you of the
|
424 |
+
violation by some reasonable means, this is the first time you have
|
425 |
+
received notice of violation of this License (for any work) from that
|
426 |
+
copyright holder, and you cure the violation prior to 30 days after
|
427 |
+
your receipt of the notice.
|
428 |
+
|
429 |
+
Termination of your rights under this section does not terminate the
|
430 |
+
licenses of parties who have received copies or rights from you under
|
431 |
+
this License. If your rights have been terminated and not permanently
|
432 |
+
reinstated, you do not qualify to receive new licenses for the same
|
433 |
+
material under section 10.
|
434 |
+
|
435 |
+
9. Acceptance Not Required for Having Copies.
|
436 |
+
|
437 |
+
You are not required to accept this License in order to receive or
|
438 |
+
run a copy of the Program. Ancillary propagation of a covered work
|
439 |
+
occurring solely as a consequence of using peer-to-peer transmission
|
440 |
+
to receive a copy likewise does not require acceptance. However,
|
441 |
+
nothing other than this License grants you permission to propagate or
|
442 |
+
modify any covered work. These actions infringe copyright if you do
|
443 |
+
not accept this License. Therefore, by modifying or propagating a
|
444 |
+
covered work, you indicate your acceptance of this License to do so.
|
445 |
+
|
446 |
+
10. Automatic Licensing of Downstream Recipients.
|
447 |
+
|
448 |
+
Each time you convey a covered work, the recipient automatically
|
449 |
+
receives a license from the original licensors, to run, modify and
|
450 |
+
propagate that work, subject to this License. You are not responsible
|
451 |
+
for enforcing compliance by third parties with this License.
|
452 |
+
|
453 |
+
An "entity transaction" is a transaction transferring control of an
|
454 |
+
organization, or substantially all assets of one, or subdividing an
|
455 |
+
organization, or merging organizations. If propagation of a covered
|
456 |
+
work results from an entity transaction, each party to that
|
457 |
+
transaction who receives a copy of the work also receives whatever
|
458 |
+
licenses to the work the party's predecessor in interest had or could
|
459 |
+
give under the previous paragraph, plus a right to possession of the
|
460 |
+
Corresponding Source of the work from the predecessor in interest, if
|
461 |
+
the predecessor has it or can get it with reasonable efforts.
|
462 |
+
|
463 |
+
You may not impose any further restrictions on the exercise of the
|
464 |
+
rights granted or affirmed under this License. For example, you may
|
465 |
+
not impose a license fee, royalty, or other charge for exercise of
|
466 |
+
rights granted under this License, and you may not initiate litigation
|
467 |
+
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
468 |
+
any patent claim is infringed by making, using, selling, offering for
|
469 |
+
sale, or importing the Program or any portion of it.
|
470 |
+
|
471 |
+
11. Patents.
|
472 |
+
|
473 |
+
A "contributor" is a copyright holder who authorizes use under this
|
474 |
+
License of the Program or a work on which the Program is based. The
|
475 |
+
work thus licensed is called the contributor's "contributor version".
|
476 |
+
|
477 |
+
A contributor's "essential patent claims" are all patent claims
|
478 |
+
owned or controlled by the contributor, whether already acquired or
|
479 |
+
hereafter acquired, that would be infringed by some manner, permitted
|
480 |
+
by this License, of making, using, or selling its contributor version,
|
481 |
+
but do not include claims that would be infringed only as a
|
482 |
+
consequence of further modification of the contributor version. For
|
483 |
+
purposes of this definition, "control" includes the right to grant
|
484 |
+
patent sublicenses in a manner consistent with the requirements of
|
485 |
+
this License.
|
486 |
+
|
487 |
+
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
488 |
+
patent license under the contributor's essential patent claims, to
|
489 |
+
make, use, sell, offer for sale, import and otherwise run, modify and
|
490 |
+
propagate the contents of its contributor version.
|
491 |
+
|
492 |
+
In the following three paragraphs, a "patent license" is any express
|
493 |
+
agreement or commitment, however denominated, not to enforce a patent
|
494 |
+
(such as an express permission to practice a patent or covenant not to
|
495 |
+
sue for patent infringement). To "grant" such a patent license to a
|
496 |
+
party means to make such an agreement or commitment not to enforce a
|
497 |
+
patent against the party.
|
498 |
+
|
499 |
+
If you convey a covered work, knowingly relying on a patent license,
|
500 |
+
and the Corresponding Source of the work is not available for anyone
|
501 |
+
to copy, free of charge and under the terms of this License, through a
|
502 |
+
publicly available network server or other readily accessible means,
|
503 |
+
then you must either (1) cause the Corresponding Source to be so
|
504 |
+
available, or (2) arrange to deprive yourself of the benefit of the
|
505 |
+
patent license for this particular work, or (3) arrange, in a manner
|
506 |
+
consistent with the requirements of this License, to extend the patent
|
507 |
+
license to downstream recipients. "Knowingly relying" means you have
|
508 |
+
actual knowledge that, but for the patent license, your conveying the
|
509 |
+
covered work in a country, or your recipient's use of the covered work
|
510 |
+
in a country, would infringe one or more identifiable patents in that
|
511 |
+
country that you have reason to believe are valid.
|
512 |
+
|
513 |
+
If, pursuant to or in connection with a single transaction or
|
514 |
+
arrangement, you convey, or propagate by procuring conveyance of, a
|
515 |
+
covered work, and grant a patent license to some of the parties
|
516 |
+
receiving the covered work authorizing them to use, propagate, modify
|
517 |
+
or convey a specific copy of the covered work, then the patent license
|
518 |
+
you grant is automatically extended to all recipients of the covered
|
519 |
+
work and works based on it.
|
520 |
+
|
521 |
+
A patent license is "discriminatory" if it does not include within
|
522 |
+
the scope of its coverage, prohibits the exercise of, or is
|
523 |
+
conditioned on the non-exercise of one or more of the rights that are
|
524 |
+
specifically granted under this License. You may not convey a covered
|
525 |
+
work if you are a party to an arrangement with a third party that is
|
526 |
+
in the business of distributing software, under which you make payment
|
527 |
+
to the third party based on the extent of your activity of conveying
|
528 |
+
the work, and under which the third party grants, to any of the
|
529 |
+
parties who would receive the covered work from you, a discriminatory
|
530 |
+
patent license (a) in connection with copies of the covered work
|
531 |
+
conveyed by you (or copies made from those copies), or (b) primarily
|
532 |
+
for and in connection with specific products or compilations that
|
533 |
+
contain the covered work, unless you entered into that arrangement,
|
534 |
+
or that patent license was granted, prior to 28 March 2007.
|
535 |
+
|
536 |
+
Nothing in this License shall be construed as excluding or limiting
|
537 |
+
any implied license or other defenses to infringement that may
|
538 |
+
otherwise be available to you under applicable patent law.
|
539 |
+
|
540 |
+
12. No Surrender of Others' Freedom.
|
541 |
+
|
542 |
+
If conditions are imposed on you (whether by court order, agreement or
|
543 |
+
otherwise) that contradict the conditions of this License, they do not
|
544 |
+
excuse you from the conditions of this License. If you cannot convey a
|
545 |
+
covered work so as to satisfy simultaneously your obligations under this
|
546 |
+
License and any other pertinent obligations, then as a consequence you may
|
547 |
+
not convey it at all. For example, if you agree to terms that obligate you
|
548 |
+
to collect a royalty for further conveying from those to whom you convey
|
549 |
+
the Program, the only way you could satisfy both those terms and this
|
550 |
+
License would be to refrain entirely from conveying the Program.
|
551 |
+
|
552 |
+
13. Use with the GNU Affero General Public License.
|
553 |
+
|
554 |
+
Notwithstanding any other provision of this License, you have
|
555 |
+
permission to link or combine any covered work with a work licensed
|
556 |
+
under version 3 of the GNU Affero General Public License into a single
|
557 |
+
combined work, and to convey the resulting work. The terms of this
|
558 |
+
License will continue to apply to the part which is the covered work,
|
559 |
+
but the special requirements of the GNU Affero General Public License,
|
560 |
+
section 13, concerning interaction through a network will apply to the
|
561 |
+
combination as such.
|
562 |
+
|
563 |
+
14. Revised Versions of this License.
|
564 |
+
|
565 |
+
The Free Software Foundation may publish revised and/or new versions of
|
566 |
+
the GNU General Public License from time to time. Such new versions will
|
567 |
+
be similar in spirit to the present version, but may differ in detail to
|
568 |
+
address new problems or concerns.
|
569 |
+
|
570 |
+
Each version is given a distinguishing version number. If the
|
571 |
+
Program specifies that a certain numbered version of the GNU General
|
572 |
+
Public License "or any later version" applies to it, you have the
|
573 |
+
option of following the terms and conditions either of that numbered
|
574 |
+
version or of any later version published by the Free Software
|
575 |
+
Foundation. If the Program does not specify a version number of the
|
576 |
+
GNU General Public License, you may choose any version ever published
|
577 |
+
by the Free Software Foundation.
|
578 |
+
|
579 |
+
If the Program specifies that a proxy can decide which future
|
580 |
+
versions of the GNU General Public License can be used, that proxy's
|
581 |
+
public statement of acceptance of a version permanently authorizes you
|
582 |
+
to choose that version for the Program.
|
583 |
+
|
584 |
+
Later license versions may give you additional or different
|
585 |
+
permissions. However, no additional obligations are imposed on any
|
586 |
+
author or copyright holder as a result of your choosing to follow a
|
587 |
+
later version.
|
588 |
+
|
589 |
+
15. Disclaimer of Warranty.
|
590 |
+
|
591 |
+
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
592 |
+
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
593 |
+
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
594 |
+
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
595 |
+
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
596 |
+
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
597 |
+
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
598 |
+
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
599 |
+
|
600 |
+
16. Limitation of Liability.
|
601 |
+
|
602 |
+
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
603 |
+
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
604 |
+
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
605 |
+
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
606 |
+
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
607 |
+
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
608 |
+
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
609 |
+
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
610 |
+
SUCH DAMAGES.
|
611 |
+
|
612 |
+
17. Interpretation of Sections 15 and 16.
|
613 |
+
|
614 |
+
If the disclaimer of warranty and limitation of liability provided
|
615 |
+
above cannot be given local legal effect according to their terms,
|
616 |
+
reviewing courts shall apply local law that most closely approximates
|
617 |
+
an absolute waiver of all civil liability in connection with the
|
618 |
+
Program, unless a warranty or assumption of liability accompanies a
|
619 |
+
copy of the Program in return for a fee.
|
620 |
+
|
621 |
+
END OF TERMS AND CONDITIONS
|
622 |
+
|
623 |
+
How to Apply These Terms to Your New Programs
|
624 |
+
|
625 |
+
If you develop a new program, and you want it to be of the greatest
|
626 |
+
possible use to the public, the best way to achieve this is to make it
|
627 |
+
free software which everyone can redistribute and change under these terms.
|
628 |
+
|
629 |
+
To do so, attach the following notices to the program. It is safest
|
630 |
+
to attach them to the start of each source file to most effectively
|
631 |
+
state the exclusion of warranty; and each file should have at least
|
632 |
+
the "copyright" line and a pointer to where the full notice is found.
|
633 |
+
|
634 |
+
{one line to give the program's name and a brief idea of what it does.}
|
635 |
+
Copyright (C) {year} {name of author}
|
636 |
+
|
637 |
+
This program is free software: you can redistribute it and/or modify
|
638 |
+
it under the terms of the GNU General Public License as published by
|
639 |
+
the Free Software Foundation, either version 3 of the License, or
|
640 |
+
(at your option) any later version.
|
641 |
+
|
642 |
+
This program is distributed in the hope that it will be useful,
|
643 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
644 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
645 |
+
GNU General Public License for more details.
|
646 |
+
|
647 |
+
You should have received a copy of the GNU General Public License
|
648 |
+
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
649 |
+
|
650 |
+
Also add information on how to contact you by electronic and paper mail.
|
651 |
+
|
652 |
+
If the program does terminal interaction, make it output a short
|
653 |
+
notice like this when it starts in an interactive mode:
|
654 |
+
|
655 |
+
{project} Copyright (C) {year} {fullname}
|
656 |
+
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
657 |
+
This is free software, and you are welcome to redistribute it
|
658 |
+
under certain conditions; type `show c' for details.
|
659 |
+
|
660 |
+
The hypothetical commands `show w' and `show c' should show the appropriate
|
661 |
+
parts of the General Public License. Of course, your program's commands
|
662 |
+
might be different; for a GUI interface, you would use an "about box".
|
663 |
+
|
664 |
+
You should also get your employer (if you work as a programmer) or school,
|
665 |
+
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
666 |
+
For more information on this, and how to apply and follow the GNU GPL, see
|
667 |
+
<http://www.gnu.org/licenses/>.
|
668 |
+
|
669 |
+
The GNU General Public License does not permit incorporating your program
|
670 |
+
into proprietary programs. If your program is a subroutine library, you
|
671 |
+
may consider it more useful to permit linking proprietary applications with
|
672 |
+
the library. If this is what you want to do, use the GNU Lesser General
|
673 |
+
Public License instead of this License. But first, please read
|
674 |
+
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
freemius/README.md
ADDED
@@ -0,0 +1,253 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Freemius WordPress SDK
|
2 |
+
======================
|
3 |
+
|
4 |
+
[Monetization](https://freemius.com/wordpress/), [analytics](https://freemius.com/wordpress/insights/), and marketing automation platform for plugin & theme developers. Freemius empower developers to create prosperous subscription based businesses.
|
5 |
+
|
6 |
+
You can see some of the WordPress.org plugins & themes that are utilizing the power of Freemius here:
|
7 |
+
|
8 |
+
https://includewp.com/freemius/#focus
|
9 |
+
|
10 |
+
If you are a WordPress plugin or theme developer and you are interested to monetize with Freemius you can [sign-up here for free](https://dashboard.freemius.com/register/):
|
11 |
+
|
12 |
+
https://dashboard.freemius.com/register/
|
13 |
+
|
14 |
+
**Below you'll find the integration instructions for our WordPress SDK.**
|
15 |
+
|
16 |
+
## Code Documentation
|
17 |
+
|
18 |
+
You can find the SDK's PHP-Doc documentation here:
|
19 |
+
https://codedoc.pub/freemius/wordpress-sdk/master/
|
20 |
+
|
21 |
+
## Initializing the SDK
|
22 |
+
|
23 |
+
Copy the code below and paste it into the top of your main plugin's PHP file, right after the plugin's header comment:
|
24 |
+
|
25 |
+
```php
|
26 |
+
<?php
|
27 |
+
// Create a helper function for easy SDK access.
|
28 |
+
function my_prefix_fs() {
|
29 |
+
global $my_prefix_fs;
|
30 |
+
if ( ! isset( $my_prefix_fs ) ) {
|
31 |
+
// Include Freemius SDK.
|
32 |
+
require_once dirname(__FILE__) . '/freemius/start.php';
|
33 |
+
|
34 |
+
$my_prefix_fs = fs_dynamic_init( array(
|
35 |
+
'id' => '1234',
|
36 |
+
'slug' => 'my-plugin-slug',
|
37 |
+
'menu_slug' => 'my_menu_slug', // You can also use __FILE__
|
38 |
+
'public_key' => 'pk_MY_PUBLIC_KEY',
|
39 |
+
'is_live' => true,
|
40 |
+
'is_premium' => true,
|
41 |
+
'has_addons' => false,
|
42 |
+
'has_paid_plans' => false,
|
43 |
+
// Set the SDK to work in a sandbox mode (for development & testing).
|
44 |
+
// IMPORTANT: MAKE SURE TO REMOVE SECRET KEY BEFORE DEPLOYMENT.
|
45 |
+
'secret_key' => 'sk_MY_SECRET_KEY',
|
46 |
+
) );
|
47 |
+
}
|
48 |
+
|
49 |
+
return $my_prefix_fs;
|
50 |
+
}
|
51 |
+
|
52 |
+
// Init Freemius.
|
53 |
+
my_prefix_fs();
|
54 |
+
?>
|
55 |
+
```
|
56 |
+
|
57 |
+
- **1234** - Replace with your plugin's ID.
|
58 |
+
- **pk_MY_PUBLIC_KEY** - Replace with your plugin's public key.
|
59 |
+
- **sk_MY_SECRET_KEY** - Replace with your plugin's secret key.
|
60 |
+
- **my-plugin-slug** - Replace with your plugin's WordPress.org slug.
|
61 |
+
- **my_menu_slug** - Replace with your admin dashboard settings menu slug.
|
62 |
+
|
63 |
+
|
64 |
+
## Usage example
|
65 |
+
|
66 |
+
You can call the SDK by using the shortcode function:
|
67 |
+
|
68 |
+
```php
|
69 |
+
<?php my_prefix_fs()->get_upgrade_url(); ?>
|
70 |
+
```
|
71 |
+
|
72 |
+
Or when calling Freemius multiple times in a scope, it's recommended to use it with the global variable:
|
73 |
+
|
74 |
+
```php
|
75 |
+
<?php
|
76 |
+
global $my_prefix_fs;
|
77 |
+
$my_prefix_fs->get_account_url();
|
78 |
+
?>
|
79 |
+
```
|
80 |
+
|
81 |
+
## Adding license based logic examples
|
82 |
+
|
83 |
+
Add marketing content to encourage your users to upgrade for your paid version:
|
84 |
+
|
85 |
+
```php
|
86 |
+
<?php
|
87 |
+
if ( my_prefix_fs()->is_not_paying() ) {
|
88 |
+
echo '<section><h1>' . esc_html__('Awesome Premium Features', 'my-plugin-slug') . '</h1>';
|
89 |
+
echo '<a href="' . my_prefix_fs()->get_upgrade_url() . '">' .
|
90 |
+
esc_html__('Upgrade Now!', 'my-plugin-slug') .
|
91 |
+
'</a>';
|
92 |
+
echo '</section>';
|
93 |
+
}
|
94 |
+
?>
|
95 |
+
```
|
96 |
+
|
97 |
+
Add logic which will only be available in your premium plugin version:
|
98 |
+
|
99 |
+
```php
|
100 |
+
<?php
|
101 |
+
// This "if" block will be auto removed from the Free version.
|
102 |
+
if ( my_prefix_fs()->is__premium_only() ) {
|
103 |
+
|
104 |
+
// ... premium only logic ...
|
105 |
+
|
106 |
+
}
|
107 |
+
?>
|
108 |
+
```
|
109 |
+
|
110 |
+
To add a function which will only be available in your premium plugin version, simply add __premium_only as the suffix of the function name. Just make sure that all lines that call that method directly or by hooks, are also wrapped in premium only logic:
|
111 |
+
|
112 |
+
```php
|
113 |
+
<?php
|
114 |
+
class My_Plugin {
|
115 |
+
function init() {
|
116 |
+
...
|
117 |
+
|
118 |
+
// This "if" block will be auto removed from the free version.
|
119 |
+
if ( my_prefix_fs()->is__premium_only() ) {
|
120 |
+
// Init premium version.
|
121 |
+
$this->admin_init__premium_only();
|
122 |
+
|
123 |
+
add_action( 'admin_init', array( &$this, 'admin_init_hook__premium_only' );
|
124 |
+
}
|
125 |
+
|
126 |
+
...
|
127 |
+
}
|
128 |
+
|
129 |
+
// This method will be only included in the premium version.
|
130 |
+
function admin_init__premium_only() {
|
131 |
+
...
|
132 |
+
}
|
133 |
+
|
134 |
+
// This method will be only included in the premium version.
|
135 |
+
function admin_init_hook__premium_only() {
|
136 |
+
...
|
137 |
+
}
|
138 |
+
}
|
139 |
+
?>
|
140 |
+
```
|
141 |
+
|
142 |
+
Add logic which will only be executed for customers in your 'professional' plan:
|
143 |
+
|
144 |
+
```php
|
145 |
+
<?php
|
146 |
+
if ( my_prefix_fs()->is_plan('professional', true) ) {
|
147 |
+
// .. logic related to Professional plan only ...
|
148 |
+
}
|
149 |
+
?>
|
150 |
+
```
|
151 |
+
|
152 |
+
Add logic which will only be executed for customers in your 'professional' plan or higher plans:
|
153 |
+
|
154 |
+
```php
|
155 |
+
<?php
|
156 |
+
if ( my_prefix_fs()->is_plan('professional') ) {
|
157 |
+
// ... logic related to Professional plan and higher plans ...
|
158 |
+
}
|
159 |
+
?>
|
160 |
+
```
|
161 |
+
|
162 |
+
Add logic which will only be available in your premium plugin version AND will only be executed for customers in your 'professional' plan (and higher plans):
|
163 |
+
|
164 |
+
```php
|
165 |
+
<?php
|
166 |
+
// This "if" block will be auto removed from the Free version.
|
167 |
+
if ( my_prefix_fs()->is_plan__premium_only('professional') ) {
|
168 |
+
// ... logic related to Professional plan and higher plans ...
|
169 |
+
}
|
170 |
+
?>
|
171 |
+
```
|
172 |
+
|
173 |
+
Add logic only for users in trial:
|
174 |
+
|
175 |
+
```php
|
176 |
+
<?php
|
177 |
+
if ( my_prefix_fs()->is_trial() ) {
|
178 |
+
// ... logic for users in trial ...
|
179 |
+
}
|
180 |
+
?>
|
181 |
+
```
|
182 |
+
|
183 |
+
Add logic for specified paid plan:
|
184 |
+
|
185 |
+
```php
|
186 |
+
<?php
|
187 |
+
// This "if" block will be auto removed from the Free version.
|
188 |
+
if ( my_prefix_fs()->is__premium_only() ) {
|
189 |
+
if ( my_prefix_fs()->is_plan( 'professional', true ) ) {
|
190 |
+
|
191 |
+
// ... logic related to Professional plan only ...
|
192 |
+
|
193 |
+
} else if ( my_prefix_fs()->is_plan( 'business' ) ) {
|
194 |
+
|
195 |
+
// ... logic related to Business plan and higher plans ...
|
196 |
+
|
197 |
+
}
|
198 |
+
}
|
199 |
+
?>
|
200 |
+
```
|
201 |
+
|
202 |
+
## Excluding files and folders from the free plugin version
|
203 |
+
There are two ways to exclude files from your free version.
|
204 |
+
|
205 |
+
1. Add `__premium_only` just before the file extension. For example, functions__premium_only.php will be only included in the premium plugin version. This works for all type of files, not only PHP.
|
206 |
+
2. Add `@fs_premium_only` a sepcial meta tag to the plugin's main PHP file header. Example:
|
207 |
+
```php
|
208 |
+
<?php
|
209 |
+
/**
|
210 |
+
* Plugin Name: My Very Awesome Plugin
|
211 |
+
* Plugin URI: http://my-awesome-plugin.com
|
212 |
+
* Description: Create and manage Awesomeness right in WordPress.
|
213 |
+
* Version: 1.0.0
|
214 |
+
* Author: Awesomattic
|
215 |
+
* Author URI: http://my-awesome-plugin.com/me/
|
216 |
+
* License: GPLv2
|
217 |
+
* Text Domain: myplugin
|
218 |
+
* Domain Path: /langs
|
219 |
+
*
|
220 |
+
* @fs_premium_only /lib/functions.php, /premium-files/
|
221 |
+
*/
|
222 |
+
|
223 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
224 |
+
exit;
|
225 |
+
}
|
226 |
+
|
227 |
+
// ... my code ...
|
228 |
+
?>
|
229 |
+
```
|
230 |
+
The file `/lib/functions.php` and the directory `/premium-files/` will be removed from the free plugin version.
|
231 |
+
|
232 |
+
# WordPress.org Compliance
|
233 |
+
Based on [WordPress.org Guidelines](https://wordpress.org/plugins/about/guidelines/) you are not allowed to submit a plugin that has premium code in it:
|
234 |
+
> All code hosted by WordPress.org servers must be free and fully-functional. If you want to sell advanced features for a plugin (such as a "pro" version), then you must sell and serve that code from your own site, we will not host it on our servers.
|
235 |
+
|
236 |
+
Therefore, if you want to deploy your free plugin's version to WordPress.org, make sure you wrap all your premium code with `if ( my_prefix_fs()->{{ method }}__premium_only() )` or the other methods provided to exclude premium features & files from the free version.
|
237 |
+
|
238 |
+
## Deployment
|
239 |
+
Zip your plugin's root folder and upload it in the Deployment section in the *Freemius Developer's Dashboard*.
|
240 |
+
The plugin will be scanned and processed by a custom developed *PHP Processor* which will auto-generate two versions of your plugin:
|
241 |
+
|
242 |
+
1. **Premium version**: Identical to your uploaded version, including all code (except your `secret_key`). Will be enabled for download ONLY for your paying or in trial customers.
|
243 |
+
2. **Free version**: The code stripped from all your paid features (based on the logic added wrapped in `{ method }__premium_only()`).
|
244 |
+
|
245 |
+
The free version is the one that you should give your users to download. Therefore, download the free generated version and upload to your site. Or, if your plugin was WordPress.org complaint and you made sure to exclude all your premium code with the different provided techniques, you can deploy the downloaded free version to the .org repo.
|
246 |
+
|
247 |
+
## Reporting Bugs
|
248 |
+
Email dev [at] freemius [dot] com
|
249 |
+
|
250 |
+
## FAQ
|
251 |
+
|
252 |
+
## Copyright
|
253 |
+
Freemius, Inc.
|
freemius/assets/css/admin/account.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
#fs_account .postbox,#fs_account .widefat{max-width:700px}#fs_account h3{font-size:1.3em;padding:12px 15px;margin:0 0 12px 0;line-height:1.4;border-bottom:1px solid #F1F1F1}#fs_account h3 .dashicons{width:26px;height:26px;font-size:1.3em}#fs_account i.dashicons{font-size:1.2em;height:1.2em;width:1.2em}#fs_account .button i.dashicons{vertical-align:middle}#fs_account .fs-header-actions{position:absolute;top:17px;right:15px;font-size:0.9em}#fs_account .fs-header-actions ul{margin:0}#fs_account .fs-header-actions li{float:left}#fs_account .fs-header-actions li form{display:inline-block}#fs_account .fs-header-actions li a{text-decoration:none}#fs_account_details .button-group{float:right}.rtl #fs_account .fs-header-actions{left:15px;right:auto}.fs-key-value-table{width:100%}.fs-key-value-table form{display:inline-block}.fs-key-value-table tr td:first-child{text-align:right}.fs-key-value-table tr td:first-child nobr{font-weight:bold}.fs-key-value-table tr td:first-child form{display:block}.fs-key-value-table tr td.fs-right{text-align:right}.fs-key-value-table tr.fs-odd{background:#ebebeb}.fs-key-value-table td,.fs-key-value-table th{padding:10px}.fs-key-value-table code{line-height:28px}.fs-key-value-table var,.fs-key-value-table code,.fs-key-value-table input[type="text"]{color:#0073AA;font-size:16px;background:none}.fs-key-value-table input[type="text"]{width:100%;font-weight:bold}label.fs-tag{background:#ffba00;color:#fff;display:inline-block;border-radius:3px;padding:5px;font-size:11px;line-height:11px;vertical-align:baseline}label.fs-tag.fs-warn{background:#ffba00}label.fs-tag.fs-success{background:#46b450}label.fs-tag.fs-error{background:#dc3232}#fs_addons h3{border:none;margin-bottom:0;padding:4px 5px}#fs_addons td{vertical-align:middle}#fs_addons thead{white-space:nowrap}#fs_addons td:first-child,#fs_addons th:first-child{text-align:left;font-weight:bold}#fs_addons td:last-child,#fs_addons th:last-child{text-align:right}#fs_addons th{font-weight:bold}#fs_billing_address{width:100%}#fs_billing_address tr td{width:50%;padding:5px}#fs_billing_address tr:first-of-type td{padding-top:0}#fs_billing_address span{font-weight:bold}#fs_billing_address input,#fs_billing_address select{display:block;width:100%;margin-top:5px}#fs_billing_address input::-moz-placeholder,#fs_billing_address select::-moz-placeholder{color:transparent;opacity:1}#fs_billing_address input:-ms-input-placeholder,#fs_billing_address select:-ms-input-placeholder{color:transparent}#fs_billing_address input::-webkit-input-placeholder,#fs_billing_address select::-webkit-input-placeholder{color:transparent}#fs_billing_address input.fs-read-mode,#fs_billing_address select.fs-read-mode{border-color:transparent;color:#777;border-bottom:1px dashed #ccc;padding-left:0;background:none}#fs_billing_address.fs-read-mode td span{display:none}#fs_billing_address.fs-read-mode input,#fs_billing_address.fs-read-mode select{border-color:transparent;color:#777;border-bottom:1px dashed #ccc;padding-left:0;background:none}#fs_billing_address.fs-read-mode input::-moz-placeholder,#fs_billing_address.fs-read-mode select::-moz-placeholder{color:#ccc;opacity:1}#fs_billing_address.fs-read-mode input:-ms-input-placeholder,#fs_billing_address.fs-read-mode select:-ms-input-placeholder{color:#ccc}#fs_billing_address.fs-read-mode input::-webkit-input-placeholder,#fs_billing_address.fs-read-mode select::-webkit-input-placeholder{color:#ccc}#fs_billing_address button{display:block;width:100%}
|
freemius/assets/css/admin/add-ons.css
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
1 |
+
#fs_addons .fs-cards-list{list-style:none}#fs_addons .fs-cards-list .fs-card{float:left;height:152px;width:310px;padding:0;margin:0 0 30px 30px;font-size:14px;list-style:none;border:1px solid #ddd;cursor:pointer;position:relative}#fs_addons .fs-cards-list .fs-card .fs-overlay{position:absolute;left:0;right:0;bottom:0;top:0;z-index:9}#fs_addons .fs-cards-list .fs-card .fs-inner{background-color:#fff;overflow:hidden;height:100%;position:relative}#fs_addons .fs-cards-list .fs-card .fs-inner ul{-moz-transition:all,0.15s;-o-transition:all,0.15s;-ms-transition:all,0.15s;-webkit-transition:all,0.15s;transition:all,0.15s;left:0;right:0;top:0;position:absolute}#fs_addons .fs-cards-list .fs-card .fs-inner li{list-style:none;line-height:18px;padding:0 15px;width:100%;display:block;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-card-banner{padding:0;margin:0;line-height:0;display:block;height:100px;background-repeat:repeat-x;background-size:100% 100%;-moz-transition:all,0.15s;-o-transition:all,0.15s;-ms-transition:all,0.15s;-webkit-transition:all,0.15s;transition:all,0.15s}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-title{margin:10px 0 0 0;height:18px;overflow:hidden;color:#000;white-space:nowrap;text-overflow:ellipsis;font-weight:bold}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-offer{font-size:0.9em}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-description{background-color:#f9f9f9;padding:10px 15px 100px 15px;border-top:1px solid #eee;margin:0 0 10px 0;color:#777}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-tag{position:absolute;top:10px;right:0px;background:greenyellow;display:block;padding:2px 10px;-moz-box-shadow:1px 1px 1px rgba(0,0,0,0.3);-webkit-box-shadow:1px 1px 1px rgba(0,0,0,0.3);box-shadow:1px 1px 1px rgba(0,0,0,0.3);text-transform:uppercase;font-size:0.9em;font-weight:bold}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-cta .button{position:absolute;top:112px;right:10px}@media screen and (min-width: 960px){#fs_addons .fs-cards-list .fs-card:hover .fs-overlay{border:2px solid #29abe1;margin-left:-1px;margin-top:-1px}#fs_addons .fs-cards-list .fs-card:hover .fs-inner ul{top:-100px}#fs_addons .fs-cards-list .fs-card:hover .fs-inner .fs-title,#fs_addons .fs-cards-list .fs-card:hover .fs-inner .fs-offer{color:#29abe1}}
|
2 |
+
#TB_window,#TB_window iframe{width:772px !important}#plugin-information #section-description h2,#plugin-information #section-description h3,#plugin-information #section-description p,#plugin-information #section-description b,#plugin-information #section-description i,#plugin-information #section-description blockquote,#plugin-information #section-description li,#plugin-information #section-description ul,#plugin-information #section-description ol{clear:none}#plugin-information #section-description .fs-selling-points{padding-bottom:10px;border-bottom:1px solid #ddd}#plugin-information #section-description .fs-selling-points ul{margin:0}#plugin-information #section-description .fs-selling-points ul li{padding:0;list-style:none outside none}#plugin-information #section-description .fs-selling-points ul li i.dashicons{color:#71ae00;font-size:3em;vertical-align:middle;line-height:30px;float:left;margin:0 0 0 -15px}#plugin-information #section-description .fs-selling-points ul li h3{margin:1em 30px !important}#plugin-information #section-description .fs-screenshots:after{content:"";display:table;clear:both}#plugin-information #section-description .fs-screenshots ul{list-style:none;margin:0}#plugin-information #section-description .fs-screenshots ul li{width:225px;height:225px;float:left;margin-bottom:20px;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}#plugin-information #section-description .fs-screenshots ul li a{display:block;width:100%;height:100%;border:1px solid;-moz-box-shadow:1px 1px 1px rgba(0,0,0,0.2);-webkit-box-shadow:1px 1px 1px rgba(0,0,0,0.2);box-shadow:1px 1px 1px rgba(0,0,0,0.2);background-size:cover}#plugin-information #section-description .fs-screenshots ul li.odd{margin-right:20px}#plugin-information .plugin-information-pricing{margin:-16px;border-bottom:1px solid #ddd}#plugin-information .plugin-information-pricing .fs-plan h3{margin-top:0;padding:20px;font-size:16px}#plugin-information .plugin-information-pricing .fs-plan .nav-tab-wrapper{border-bottom:1px solid #ddd}#plugin-information .plugin-information-pricing .fs-plan .nav-tab-wrapper .nav-tab{cursor:pointer;position:relative;padding:0 10px;font-size:0.9em}#plugin-information .plugin-information-pricing .fs-plan .nav-tab-wrapper .nav-tab label{text-transform:uppercase;color:green;background:greenyellow;position:absolute;left:-1px;right:-1px;bottom:100%;border:1px solid darkgreen;padding:2px;text-align:center;font-size:0.9em;line-height:1em}#plugin-information .plugin-information-pricing .fs-plan .nav-tab-wrapper .nav-tab.nav-tab-active{cursor:default;background:#fffeec;border-bottom-color:#fffeec}#plugin-information .plugin-information-pricing .fs-plan.fs-single-cycle h3{background:#fffeec;margin:0;padding-bottom:0;color:#0073aa}#plugin-information .plugin-information-pricing .fs-plan.fs-single-cycle .nav-tab-wrapper,#plugin-information .plugin-information-pricing .fs-plan.fs-single-cycle .fs-billing-frequency{display:none}#plugin-information .plugin-information-pricing .fs-plan .fs-pricing-body{background:#fffeec;padding:20px}#plugin-information .plugin-information-pricing .fs-plan .button{width:100%;text-align:center;font-weight:bold;text-transform:uppercase;font-size:1.1em}#plugin-information .plugin-information-pricing .fs-plan label{white-space:nowrap}#plugin-information .plugin-information-pricing .fs-plan var{font-style:normal}#plugin-information .plugin-information-pricing .fs-plan .fs-billing-frequency,#plugin-information .plugin-information-pricing .fs-plan .fs-annual-discount{text-align:center;display:block;font-weight:bold;margin-bottom:10px;text-transform:uppercase;background:#F3F3F3;padding:2px;border:1px solid #ccc}#plugin-information .plugin-information-pricing .fs-plan .fs-annual-discount{text-transform:none;color:green;background:greenyellow}#plugin-information .plugin-information-pricing .fs-plan ul.fs-trial-terms{font-size:0.9em}#plugin-information .plugin-information-pricing .fs-plan ul.fs-trial-terms i{float:left;margin:0 0 0 -15px}#plugin-information .plugin-information-pricing .fs-plan ul.fs-trial-terms li{margin:10px 0 0 0}#plugin-information #section-features .fs-features{margin:-20px -26px}#plugin-information #section-features table{width:100%;border-spacing:0;border-collapse:separate}#plugin-information #section-features table thead th{padding:10px 0}#plugin-information #section-features table thead .fs-price{color:#71ae00;font-weight:normal;display:block;text-align:center}#plugin-information #section-features table tbody td{border-top:1px solid #ccc;padding:10px 0;text-align:center;width:100px;color:#71ae00}#plugin-information #section-features table tbody td:first-child{text-align:left;width:auto;color:inherit;padding-left:26px}#plugin-information #section-features table tbody tr.fs-odd td{background:#fefefe}#plugin-information #section-features .dashicons-yes{width:30px;height:30px;font-size:30px}@media screen and (max-width: 961px){#fs_addons .fs-cards-list .fs-card{height:265px}}
|
freemius/assets/css/admin/checkout.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
@media screen and (max-width: 782px){#wpbody-content{padding-bottom:0 !important}}
|
freemius/assets/css/admin/common.css
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
1 |
+
.theme-browser .theme .fs-premium-theme-badge{position:absolute;top:10px;right:0;background:#71ae00;color:#fff;text-transform:uppercase;padding:5px 10px;-moz-border-radius:3px 0 0 3px;-webkit-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px;font-weight:bold;border-right:0;-moz-box-shadow:0 2px 1px -1px rgba(0,0,0,0.3);-webkit-box-shadow:0 2px 1px -1px rgba(0,0,0,0.3);box-shadow:0 2px 1px -1px rgba(0,0,0,0.3);font-size:1.1em}#iframe{line-height:0;font-size:0}.fs-full-size-wrapper{margin:40px 0 -65px -20px}@media (max-width: 600px){.fs-full-size-wrapper{margin:0 0 -65px -10px}}
|
2 |
+
.fs-notice{position:relative}.fs-notice.fs-has-title{margin-bottom:30px !important}.fs-notice.success{color:green}.fs-notice.promotion{border-color:#00a0d2 !important;background-color:#f2fcff !important}.fs-notice .fs-notice-body{margin:.5em 0;padding:2px}.fs-notice .fs-close{cursor:pointer;color:#aaa;float:right}.fs-notice .fs-close:hover{color:#666}.fs-notice .fs-close>*{margin-top:7px;display:inline-block}.fs-notice label.fs-plugin-title{background:rgba(0,0,0,0.3);color:#fff;padding:2px 10px;position:absolute;top:100%;bottom:auto;right:auto;-moz-border-radius:0 0 3px 3px;-webkit-border-radius:0 0 3px 3px;border-radius:0 0 3px 3px;left:10px;font-size:12px;font-weight:bold;cursor:auto}div.fs-notice.updated,div.fs-notice.success,div.fs-notice.promotion{display:block !important}.rtl .fs-notice .fs-close{float:left}.fs-secure-notice{position:fixed;top:32px;left:160px;right:0;background:#ebfdeb;padding:10px 20px;color:green;z-index:9999;-moz-box-shadow:0 2px 2px rgba(6,113,6,0.3);-webkit-box-shadow:0 2px 2px rgba(6,113,6,0.3);box-shadow:0 2px 2px rgba(6,113,6,0.3);opacity:0.95;filter:alpha(opacity=95)}.fs-secure-notice:hover{opacity:1;filter:alpha(opacity=100)}.fs-secure-notice a.fs-security-proof{color:green;text-decoration:none}@media screen and (max-width: 960px){.fs-secure-notice{left:36px}}@media screen and (max-width: 600px){.fs-secure-notice{display:none}}@media screen and (max-width: 500px){#fs_promo_tab{display:none}}@media screen and (max-width: 782px){.fs-secure-notice{left:0;top:46px;text-align:center}}span.fs-submenu-item.fs-sub:before{content:'\21B3';padding:0 5px}.rtl span.fs-submenu-item.fs-sub:before{content:'\21B2'}.fs-submenu-item.pricing.upgrade-mode{color:greenyellow}.fs-submenu-item.pricing.trial-mode{color:#83e2ff}#adminmenu .update-plugins.fs-trial{background-color:#00b9eb}.fs-ajax-spinner{border:0;width:20px;height:20px;margin-right:5px;vertical-align:sub;display:inline-block;background:url("../../../../../../../wp-admin/images/wpspin_light-2x.gif");background-size:contain}.wrap.fs-section h2{text-align:left}
|
freemius/assets/css/admin/connect.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
#fs_connect{width:480px;-moz-box-shadow:0px 1px 2px rgba(0,0,0,0.3);-webkit-box-shadow:0px 1px 2px rgba(0,0,0,0.3);box-shadow:0px 1px 2px rgba(0,0,0,0.3);margin:20px 0}@media screen and (max-width: 479px){#fs_connect{-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none;width:auto;margin:0 0 0 -10px}}#fs_connect .fs-content{background:#fff;padding:15px 20px}#fs_connect .fs-content .fs-error{background:snow;color:#d3135a;border:1px solid #d3135a;-moz-box-shadow:0 1px 1px 0 rgba(0,0,0,0.1);-webkit-box-shadow:0 1px 1px 0 rgba(0,0,0,0.1);box-shadow:0 1px 1px 0 rgba(0,0,0,0.1);text-align:center;padding:5px;margin-bottom:10px}#fs_connect .fs-content p{margin:0;padding:0;font-size:1.2em}#fs_connect .fs-license-key-container{position:relative;width:280px;margin:10px auto 0 auto}#fs_connect .fs-license-key-container input{width:100%}#fs_connect .fs-license-key-container .dashicons{position:absolute;top:5px;right:5px}#fs_connect .fs-actions{padding:10px 20px;background:#C0C7CA}#fs_connect .fs-actions .button{padding:0 10px 1px;line-height:35px;height:37px;font-size:16px;margin-bottom:0}#fs_connect .fs-actions .button .dashicons{font-size:37px;margin-left:-8px;margin-right:12px}#fs_connect .fs-actions .button.button-primary{padding-right:15px;padding-left:15px}#fs_connect .fs-actions .button.button-primary:after{content:' \279C'}#fs_connect .fs-actions .button.button-primary.fs-loading:after{content:''}#fs_connect .fs-actions .button.button-secondary{float:right}#fs_connect.fs-anonymous-disabled .fs-actions .button.button-primary{width:100%}#fs_connect .fs-permissions{padding:10px 20px;background:#FEFEFE;-moz-transition:background 0.5s ease;-o-transition:background 0.5s ease;-ms-transition:background 0.5s ease;-webkit-transition:background 0.5s ease;transition:background 0.5s ease}#fs_connect .fs-permissions .fs-license-sync-disclaimer{text-align:center;margin-top:0}#fs_connect .fs-permissions .fs-trigger{font-size:0.9em;text-decoration:none;text-align:center;display:block}#fs_connect .fs-permissions ul{height:0;overflow:hidden;margin:0}#fs_connect .fs-permissions ul li{margin-bottom:12px}#fs_connect .fs-permissions ul li:last-child{margin-bottom:0}#fs_connect .fs-permissions ul li i.dashicons{float:left;font-size:40px;width:40px;height:40px}#fs_connect .fs-permissions ul li div{margin-left:55px}#fs_connect .fs-permissions ul li div span{font-weight:bold;text-transform:uppercase;color:#23282d}#fs_connect .fs-permissions ul li div p{margin:2px 0 0 0}#fs_connect .fs-permissions.fs-open{background:#fff}#fs_connect .fs-permissions.fs-open ul{height:auto;margin:20px 20px 10px 20px}@media screen and (max-width: 479px){#fs_connect .fs-permissions{background:#fff}#fs_connect .fs-permissions .fs-trigger{display:none}#fs_connect .fs-permissions ul{height:auto;margin:20px}}#fs_connect .fs-freemium-licensing{padding:8px;background:#777;color:#fff}#fs_connect .fs-freemium-licensing p{text-align:center;display:block;margin:0;padding:0}#fs_connect .fs-freemium-licensing a{color:#C2EEFF;text-decoration:underline}#fs_connect .fs-visual{padding:12px;line-height:0;background:#fafafa;height:80px;position:relative}#fs_connect .fs-visual .fs-site-icon{position:absolute;left:20px;top:10px}#fs_connect .fs-visual .fs-connect-logo{position:absolute;right:20px;top:10px}#fs_connect .fs-visual .fs-plugin-icon{position:absolute;top:10px;left:50%;margin-left:-40px}#fs_connect .fs-visual .fs-plugin-icon,#fs_connect .fs-visual .fs-site-icon,#fs_connect .fs-visual img,#fs_connect .fs-visual object{width:80px;height:80px}#fs_connect .fs-visual .dashicons-wordpress{font-size:64px;background:#01749a;color:#fff;width:64px;height:64px;padding:8px}#fs_connect .fs-visual .dashicons-plus{position:absolute;top:50%;font-size:30px;margin-top:-10px;color:#bbb}#fs_connect .fs-visual .dashicons-plus.fs-first{left:28%}#fs_connect .fs-visual .dashicons-plus.fs-second{left:65%}#fs_connect .fs-visual .fs-plugin-icon,#fs_connect .fs-visual .fs-connect-logo,#fs_connect .fs-visual .fs-site-icon{border:1px solid #ccc;padding:1px;background:#fff}#fs_connect .fs-terms{text-align:center;font-size:0.85em;padding:5px;background:rgba(0,0,0,0.05)}#fs_connect .fs-terms,#fs_connect .fs-terms a{color:#999}#fs_connect .fs-terms a{text-decoration:none}.rtl #fs_connect .fs-actions{padding:10px 20px;background:#C0C7CA}.rtl #fs_connect .fs-actions .button .dashicons{font-size:37px;margin-left:-8px;margin-right:12px}.rtl #fs_connect .fs-actions .button.button-primary:after{content:' \000bb'}.rtl #fs_connect .fs-actions .button.button-primary.fs-loading:after{content:''}.rtl #fs_connect .fs-actions .button.button-secondary{float:left}.rtl #fs_connect .fs-permissions ul li div{margin-right:55px;margin-left:0}.rtl #fs_connect .fs-permissions ul li i.dashicons{float:right}.rtl #fs_connect .fs-visual .fs-site-icon{right:20px;left:auto}.rtl #fs_connect .fs-visual .fs-connect-logo{right:auto;left:20px}#fs_theme_connect_wrapper{position:fixed;top:0;height:100%;width:100%;z-index:99990;background:rgba(0,0,0,0.75);text-align:center;overflow-y:auto}#fs_theme_connect_wrapper:before{content:"";display:inline-block;vertical-align:middle;height:100%}#fs_theme_connect_wrapper>button.close{color:white;cursor:pointer;height:40px;width:40px;position:absolute;right:0;border:0;background-color:transparent;top:32px}#fs_theme_connect_wrapper #fs_connect{top:0;text-align:left;display:inline-block;vertical-align:middle;margin-top:52px;margin-bottom:20px}#fs_theme_connect_wrapper #fs_connect .fs-terms{background:rgba(140,140,140,0.64)}#fs_theme_connect_wrapper #fs_connect .fs-terms,#fs_theme_connect_wrapper #fs_connect .fs-terms a{color:#c5c5c5}.wp-pointer-content #fs_connect{margin:0;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none}.fs-opt-in-pointer .wp-pointer-content{padding:0}.fs-opt-in-pointer.wp-pointer-top .wp-pointer-arrow{border-bottom-color:#dfdfdf}.fs-opt-in-pointer.wp-pointer-top .wp-pointer-arrow-inner{border-bottom-color:#fafafa}.fs-opt-in-pointer.wp-pointer-bottom .wp-pointer-arrow{border-top-color:#dfdfdf}.fs-opt-in-pointer.wp-pointer-bottom .wp-pointer-arrow-inner{border-top-color:#fafafa}.fs-opt-in-pointer.wp-pointer-left .wp-pointer-arrow{border-right-color:#dfdfdf}.fs-opt-in-pointer.wp-pointer-left .wp-pointer-arrow-inner{border-right-color:#fafafa}.fs-opt-in-pointer.wp-pointer-right .wp-pointer-arrow{border-left-color:#dfdfdf}.fs-opt-in-pointer.wp-pointer-right .wp-pointer-arrow-inner{border-left-color:#fafafa}
|
freemius/assets/css/admin/deactivation-feedback.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
.fs-modal{position:fixed;overflow:auto;height:100%;width:100%;top:0;z-index:100000;display:none;background:rgba(0,0,0,0.6)}.fs-modal .fs-modal-dialog{background:transparent;position:absolute;left:50%;margin-left:-298px;padding-bottom:30px;top:-100%;z-index:100001;width:596px}@media (max-width: 650px){.fs-modal .fs-modal-dialog{margin-left:-50%;box-sizing:border-box;padding-left:10px;padding-right:10px;width:100%}.fs-modal .fs-modal-dialog .fs-modal-panel>h3>strong{font-size:1.3em}.fs-modal .fs-modal-dialog li.reason{margin-bottom:10px}.fs-modal .fs-modal-dialog li.reason .reason-input,.fs-modal .fs-modal-dialog li.reason .internal-message{margin-left:29px}.fs-modal .fs-modal-dialog li.reason label{display:table}.fs-modal .fs-modal-dialog li.reason label>span{display:table-cell;font-size:1.3em}}.fs-modal.active{display:block}.fs-modal.active:before{display:block}.fs-modal.active .fs-modal-dialog{top:10%}.fs-modal .fs-modal-body,.fs-modal .fs-modal-footer{border:0;background:#fefefe;padding:20px}.fs-modal .fs-modal-body{border-bottom:0}.fs-modal .fs-modal-body h2{font-size:20px}.fs-modal .fs-modal-body>div{margin-top:10px}.fs-modal .fs-modal-body>div h2{font-weight:bold;font-size:20px;margin-top:0}.fs-modal .fs-modal-footer{border-top:#eeeeee solid 1px;text-align:right}.fs-modal .fs-modal-footer>.button{margin:0 7px}.fs-modal .fs-modal-footer>.button:first-child{margin:0}.fs-modal .fs-modal-panel:not(.active){display:none}.fs-modal .reason-input,.fs-modal .internal-message{margin:3px 0 3px 22px}.fs-modal .reason-input input,.fs-modal .reason-input textarea,.fs-modal .internal-message input,.fs-modal .internal-message textarea{width:100%}.fs-modal li.reason.has-internal-message .internal-message{border:1px solid #ccc;padding:7px;display:none}body.has-fs-modal{overflow:hidden}#the-list .deactivate>.fs-slug{display:none}
|
freemius/assets/css/admin/debug.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
.switch{position:relative;display:inline-block;font-size:1.6em;font-weight:bold;color:#ccc;text-shadow:0px 1px 1px rgba(255,255,255,0.8);height:18px;padding:6px 6px 5px 6px;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);border-radius:4px;background:#ececec;box-shadow:0px 0px 4px rgba(0,0,0,0.1),inset 0px 1px 3px 0px rgba(0,0,0,0.1);cursor:pointer}.switch span{display:inline-block;width:35px;text-transform:uppercase}.switch span.on{color:#6bc406}.switch .toggle{position:absolute;top:1px;width:37px;height:25px;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.3);border-radius:4px;background:#fff;background:-moz-linear-gradient(top, #ececec 0%, #fff 100%);background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #ececec), color-stop(100%, #fff));background:-webkit-linear-gradient(top, #ececec 0%, #fff 100%);background:-o-linear-gradient(top, #ececec 0%, #fff 100%);background:-ms-linear-gradient(top, #ececec 0%, #fff 100%);background:linear-gradient(top, #ececec 0%, #fff 100%);box-shadow:inset 0px 1px 0px 0px rgba(255,255,255,0.5);z-index:999;-moz-transition:all 0.15s ease-in-out;-o-transition:all 0.15s ease-in-out;-ms-transition:all 0.15s ease-in-out;-webkit-transition:all 0.15s ease-in-out;transition:all 0.15s ease-in-out}.switch.on .toggle{left:2%}.switch.off .toggle{left:54%}.switch.round{padding:0px 20px;border-radius:40px}.switch.round .toggle{border-radius:40px;width:14px;height:14px}.switch.round.on .toggle{left:3%;background:#6bc406}.switch.round.off .toggle{left:58%}.switch-label{font-size:20px;line-height:31px;margin:0 5px}#fs_log_book table{font-family:Consolas,Monaco,monospace;font-size:12px}#fs_log_book table th{color:#ccc}#fs_log_book table tr{background:#232525}#fs_log_book table tr.alternate{background:#2b2b2b}#fs_log_book table tr td.fs-col--logger{color:#5a7435}#fs_log_book table tr td.fs-col--type{color:#ffc861}#fs_log_book table tr td.fs-col--function{color:#a7b7b1;font-weight:bold}#fs_log_book table tr td.fs-col--message,#fs_log_book table tr td.fs-col--message a{color:#9a73ac !important}#fs_log_book table tr td.fs-col--file{color:#d07922}#fs_log_book table tr td.fs-col--timestamp{color:#6596be}
|
freemius/assets/css/admin/dialog-boxes.css
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
1 |
+
.fs-modal{position:fixed;overflow:auto;height:100%;width:100%;top:0;z-index:100000;display:none;background:rgba(0,0,0,0.6)}.fs-modal .fs-modal-dialog{background:transparent;position:absolute;left:50%;margin-left:-298px;padding-bottom:30px;top:-100%;z-index:100001;width:596px}@media (max-width: 650px){.fs-modal .fs-modal-dialog{margin-left:-50%;box-sizing:border-box;padding-left:10px;padding-right:10px;width:100%}.fs-modal .fs-modal-dialog .fs-modal-panel>h3>strong{font-size:1.3em}}.fs-modal.active{display:block}.fs-modal.active:before{display:block}.fs-modal.active .fs-modal-dialog{top:10%}.fs-modal.fs-success .fs-modal-header{border-bottom-color:#46b450}.fs-modal.fs-success .fs-modal-body{background-color:#f7fff7}.fs-modal.fs-warn .fs-modal-header{border-bottom-color:#ffb900}.fs-modal.fs-warn .fs-modal-body{background-color:#fff8e5}.fs-modal.fs-error .fs-modal-header{border-bottom-color:#dc3232}.fs-modal.fs-error .fs-modal-body{background-color:#ffeaea}.fs-modal .fs-modal-body,.fs-modal .fs-modal-footer{border:0;background:#fefefe;padding:20px}.fs-modal .fs-modal-header{border-bottom:#eeeeee solid 1px;background:#fbfbfb;padding:15px 20px;position:relative;margin-bottom:-10px}.fs-modal .fs-modal-header h4{margin:0;padding:0;text-transform:uppercase;font-size:1.2em;font-weight:bold;color:#cacaca;text-shadow:1px 1px 1px #fff;letter-spacing:0.6px;-webkit-font-smoothing:antialiased}.fs-modal .fs-modal-header .fs-close{position:absolute;right:10px;top:12px;cursor:pointer;color:#bbb;-moz-border-radius:20px;-webkit-border-radius:20px;border-radius:20px;padding:3px;-moz-transition:all 0.2s ease-in-out;-o-transition:all 0.2s ease-in-out;-ms-transition:all 0.2s ease-in-out;-webkit-transition:all 0.2s ease-in-out;transition:all 0.2s ease-in-out}.fs-modal .fs-modal-header .fs-close:hover{color:#fff;background:#aaa}.fs-modal .fs-modal-body{border-bottom:0}.fs-modal .fs-modal-body p{font-size:14px}.fs-modal .fs-modal-body h2{font-size:20px;line-height:1.5em}.fs-modal .fs-modal-body>div{margin-top:10px}.fs-modal .fs-modal-body>div h2{font-weight:bold;font-size:20px;margin-top:0}.fs-modal .fs-modal-footer{border-top:#eeeeee solid 1px;text-align:right}.fs-modal .fs-modal-footer>.button{margin:0 7px}.fs-modal .fs-modal-footer>.button:first-child{margin:0}.fs-modal .fs-modal-panel>.notice.inline{margin:0;display:none}.fs-modal .fs-modal-panel:not(.active){display:none}.rtl .fs-modal .fs-modal-header .fs-close{right:auto;left:20px}body.has-fs-modal{overflow:hidden}.fs-modal.fs-modal-deactivation-feedback .reason-input,.fs-modal.fs-modal-deactivation-feedback .internal-message{margin:3px 0 3px 22px}.fs-modal.fs-modal-deactivation-feedback .reason-input input,.fs-modal.fs-modal-deactivation-feedback .reason-input textarea,.fs-modal.fs-modal-deactivation-feedback .internal-message input,.fs-modal.fs-modal-deactivation-feedback .internal-message textarea{width:100%}.fs-modal.fs-modal-deactivation-feedback li.reason.has-internal-message .internal-message{border:1px solid #ccc;padding:7px;display:none}@media (max-width: 650px){.fs-modal.fs-modal-deactivation-feedback li.reason li.reason{margin-bottom:10px}.fs-modal.fs-modal-deactivation-feedback li.reason li.reason .reason-input,.fs-modal.fs-modal-deactivation-feedback li.reason li.reason .internal-message{margin-left:29px}.fs-modal.fs-modal-deactivation-feedback li.reason li.reason label{display:table}.fs-modal.fs-modal-deactivation-feedback li.reason li.reason label>span{display:table-cell;font-size:1.3em}}.fs-modal.fs-modal-deactivation-feedback .anonymous-feedback-label{float:left}.fs-modal.fs-modal-deactivation-feedback .fs-modal-panel{margin-top:0 !important}.fs-modal.fs-modal-deactivation-feedback .fs-modal-panel h3{margin-top:0;line-height:1.5em}#the-list .deactivate>.fs-slug{display:none}.fs-modal.fs-modal-license-activation .fs-modal-body input.license_key{width:100%}.fs-modal.fs-modal-license-key-resend .email-address-container{overflow:hidden;padding-right:2px}.fs-modal.fs-modal-license-key-resend.fs-freemium input.email-address{width:300px}.fs-modal.fs-modal-license-key-resend.fs-freemium label{display:block;margin-bottom:10px}.fs-modal.fs-modal-license-key-resend.fs-premium input.email-address{width:100%}.fs-modal.fs-modal-license-key-resend.fs-premium .button-container{float:right;margin-left:7px}@media (max-width: 650px){.fs-modal.fs-modal-license-key-resend.fs-premium .button-container{margin-top:2px}}
|
2 |
+
.rtl .fs-modal.fs-modal-license-key-resend .fs-modal-body .input-container>.email-address-container{padding-left:2px;padding-right:0}.rtl .fs-modal.fs-modal-license-key-resend .fs-modal-body .button-container{float:left;margin-right:7px;margin-left:0}a.show-license-resend-modal{margin-top:4px;display:inline-block}.fs-ajax-loader{position:relative;width:170px;height:20px;margin:auto}.fs-ajax-loader .fs-ajax-loader-bar{position:absolute;top:0;background-color:#0074a3;width:20px;height:20px;-webkit-animation-name:bounce_ajaxLoader;-moz-animation-name:bounce_ajaxLoader;-ms-animation-name:bounce_ajaxLoader;-o-animation-name:bounce_ajaxLoader;animation-name:bounce_ajaxLoader;-webkit-animation-duration:1.5s;-moz-animation-duration:1.5s;-ms-animation-duration:1.5s;-o-animation-duration:1.5s;animation-duration:1.5s;animation-iteration-count:infinite;-o-animation-iteration-count:infinite;-ms-animation-iteration-count:infinite;-webkit-animation-iteration-count:infinite;-moz-animation-iteration-count:infinite;-webkit-animation-direction:normal;-moz-animation-direction:normal;-ms-animation-direction:normal;-o-animation-direction:normal;animation-direction:normal;-moz-transform:0.3;-o-transform:0.3;-ms-transform:0.3;-webkit-transform:0.3;transform:0.3}.fs-ajax-loader .fs-ajax-loader-bar-1{left:0px;animation-delay:0.6s;-o-animation-delay:0.6s;-ms-animation-delay:0.6s;-webkit-animation-delay:0.6s;-moz-animation-delay:0.6s}.fs-ajax-loader .fs-ajax-loader-bar-2{left:19px;animation-delay:0.75s;-o-animation-delay:0.75s;-ms-animation-delay:0.75s;-webkit-animation-delay:0.75s;-moz-animation-delay:0.75s}.fs-ajax-loader .fs-ajax-loader-bar-3{left:38px;animation-delay:0.9s;-o-animation-delay:0.9s;-ms-animation-delay:0.9s;-webkit-animation-delay:0.9s;-moz-animation-delay:0.9s}.fs-ajax-loader .fs-ajax-loader-bar-4{left:57px;animation-delay:1.05s;-o-animation-delay:1.05s;-ms-animation-delay:1.05s;-webkit-animation-delay:1.05s;-moz-animation-delay:1.05s}.fs-ajax-loader .fs-ajax-loader-bar-5{left:76px;animation-delay:1.2s;-o-animation-delay:1.2s;-ms-animation-delay:1.2s;-webkit-animation-delay:1.2s;-moz-animation-delay:1.2s}.fs-ajax-loader .fs-ajax-loader-bar-6{left:95px;animation-delay:1.35s;-o-animation-delay:1.35s;-ms-animation-delay:1.35s;-webkit-animation-delay:1.35s;-moz-animation-delay:1.35s}.fs-ajax-loader .fs-ajax-loader-bar-7{left:114px;animation-delay:1.5s;-o-animation-delay:1.5s;-ms-animation-delay:1.5s;-webkit-animation-delay:1.5s;-moz-animation-delay:1.5s}.fs-ajax-loader .fs-ajax-loader-bar-8{left:133px;animation-delay:1.65s;-o-animation-delay:1.65s;-ms-animation-delay:1.65s;-webkit-animation-delay:1.65s;-moz-animation-delay:1.65s}@-moz-keyframes bounce_ajaxLoader{0%{-moz-transform:scale(1);-o-transform:scale(1);-ms-transform:scale(1);-webkit-transform:scale(1);transform:scale(1);background-color:#0074a3}100%{-moz-transform:scale(0.3);-o-transform:scale(0.3);-ms-transform:scale(0.3);-webkit-transform:scale(0.3);transform:scale(0.3);background-color:#fff}}@-ms-keyframes bounce_ajaxLoader{0%{-moz-transform:scale(1);-o-transform:scale(1);-ms-transform:scale(1);-webkit-transform:scale(1);transform:scale(1);background-color:#0074a3}100%{-moz-transform:scale(0.3);-o-transform:scale(0.3);-ms-transform:scale(0.3);-webkit-transform:scale(0.3);transform:scale(0.3);background-color:#fff}}@-o-keyframes bounce_ajaxLoader{0%{-moz-transform:scale(1);-o-transform:scale(1);-ms-transform:scale(1);-webkit-transform:scale(1);transform:scale(1);background-color:#0074a3}100%{-moz-transform:scale(0.3);-o-transform:scale(0.3);-ms-transform:scale(0.3);-webkit-transform:scale(0.3);transform:scale(0.3);background-color:#fff}}@-webkit-keyframes bounce_ajaxLoader{0%{-moz-transform:scale(1);-o-transform:scale(1);-ms-transform:scale(1);-webkit-transform:scale(1);transform:scale(1);background-color:#0074a3}100%{-moz-transform:scale(0.3);-o-transform:scale(0.3);-ms-transform:scale(0.3);-webkit-transform:scale(0.3);transform:scale(0.3);background-color:#fff}}@keyframes bounce_ajaxLoader{0%{-moz-transform:scale(1);-o-transform:scale(1);-ms-transform:scale(1);-webkit-transform:scale(1);transform:scale(1);background-color:#0074a3}100%{-moz-transform:scale(0.3);-o-transform:scale(0.3);-ms-transform:scale(0.3);-webkit-transform:scale(0.3);transform:scale(0.3);background-color:#fff}}.fs-modal-auto-install #request-filesystem-credentials-form h2,.fs-modal-auto-install #request-filesystem-credentials-form .request-filesystem-credentials-action-buttons{display:none}.fs-modal-auto-install #request-filesystem-credentials-form input[type=password],.fs-modal-auto-install #request-filesystem-credentials-form input[type=email],.fs-modal-auto-install #request-filesystem-credentials-form input[type=text]{-webkit-appearance:none;padding:10px 10px 5px 10px;width:300px;max-width:100%}.fs-modal-auto-install #request-filesystem-credentials-form>div,.fs-modal-auto-install #request-filesystem-credentials-form label,.fs-modal-auto-install #request-filesystem-credentials-form fieldset{width:300px;max-width:100%;margin:0 auto;display:block}
|
freemius/assets/css/admin/license-activation.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
.fs-modal{position:fixed;overflow:auto;height:100%;width:100%;top:0;z-index:100000;display:none;background:rgba(0,0,0,0.6)}.fs-modal .fs-modal-dialog{background:transparent;position:absolute;left:50%;margin-left:-298px;padding-bottom:30px;top:-100%;z-index:100001;width:596px}@media (max-width: 650px){.fs-modal .fs-modal-dialog{margin-left:-50%;box-sizing:border-box;padding-left:10px;padding-right:10px;width:100%}.fs-modal .fs-modal-dialog .fs-modal-panel>h3>strong{font-size:1.3em}}.fs-modal.active{display:block}.fs-modal.active:before{display:block}.fs-modal.active .fs-modal-dialog{top:10%}.fs-modal .fs-modal-body,.fs-modal .fs-modal-footer{border:0;background:#fefefe;padding:20px}.fs-modal .fs-modal-body{border-bottom:0}.fs-modal .fs-modal-body .license-activation-message{margin:0;display:none}.fs-modal .fs-modal-body input.license_key{width:100%}.fs-modal .fs-modal-body p{font-size:14px}.fs-modal .fs-modal-body h2{font-size:20px}.fs-modal .fs-modal-body>div{margin-top:10px}.fs-modal .fs-modal-body>div h2{font-weight:bold;font-size:20px;margin-top:0}.fs-modal .fs-modal-footer{border-top:#eeeeee solid 1px;text-align:right}.fs-modal .fs-modal-footer>.button{margin:0 7px}.fs-modal .fs-modal-footer>.button:first-child{margin:0}.fs-modal .fs-modal-panel:not(.active){display:none}body.has-fs-modal{overflow:hidden}
|
freemius/assets/css/customizer.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
#fs_customizer_upsell .fs-customizer-plan{padding:10px 20px 20px 20px;border-radius:3px;background:#fff}#fs_customizer_upsell .fs-customizer-plan h2{position:relative;margin:0;line-height:2em;text-transform:uppercase}#fs_customizer_upsell .fs-customizer-plan h2 .button-link{top:-2px}#fs_customizer_upsell .fs-feature{position:relative}#fs_customizer_upsell .dashicons-yes{color:#0085ba;font-size:2em;vertical-align:bottom;margin-left:-7px;margin-right:10px}.rtl #fs_customizer_upsell .dashicons-yes{margin-left:10px;margin-right:-7px}#fs_customizer_upsell .dashicons-editor-help{color:#bbb;cursor:help}#fs_customizer_upsell .dashicons-editor-help .fs-feature-desc{opacity:0;visibility:hidden;-moz-transition:opacity 0.3s ease-in-out;-o-transition:opacity 0.3s ease-in-out;-ms-transition:opacity 0.3s ease-in-out;-webkit-transition:opacity 0.3s ease-in-out;transition:opacity 0.3s ease-in-out;position:absolute;background:#000;color:#fff;font-family:'arial', serif;font-size:12px;padding:10px;z-index:999999;bottom:100%;margin-bottom:5px;left:0;right:0;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;-moz-box-shadow:1px 1px 1px rgba(0,0,0,0.2);-webkit-box-shadow:1px 1px 1px rgba(0,0,0,0.2);box-shadow:1px 1px 1px rgba(0,0,0,0.2);line-height:1.3em;font-weight:bold;text-align:left}.rtl #fs_customizer_upsell .dashicons-editor-help .fs-feature-desc{text-align:right}#fs_customizer_upsell .dashicons-editor-help .fs-feature-desc::after{content:' ';display:block;width:0;height:0;border-style:solid;border-width:5px 5px 0 5px;border-color:#000 transparent transparent transparent;position:absolute;top:100%;left:21px}.rtl #fs_customizer_upsell .dashicons-editor-help .fs-feature-desc::after{right:21px;left:auto}#fs_customizer_upsell .dashicons-editor-help:hover .fs-feature-desc{visibility:visible;opacity:1}#fs_customizer_upsell .button-primary{display:block;text-align:center;margin-top:10px}#fs_customizer_support{display:block !important}#fs_customizer_support .button{float:right}#fs_customizer_support .button-group{width:100%;display:block;margin-top:10px}#fs_customizer_support .button-group .button{float:none;width:50%;text-align:center}
|
freemius/assets/img/foogallery.png
ADDED
Binary file
|
freemius/assets/img/plugin-icon.png
ADDED
Binary file
|
freemius/assets/img/theme-icon.png
ADDED
Binary file
|
freemius/assets/index.php
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
// Silence is golden.
|
3 |
+
// Hide file structure from users on unprotected servers.
|
freemius/assets/js/nojquery.ba-postmessage.js
ADDED
@@ -0,0 +1,140 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*!
|
2 |
+
* jQuery postMessage - v0.5 - 9/11/2009
|
3 |
+
* http://benalman.com/projects/jquery-postmessage-plugin/
|
4 |
+
*
|
5 |
+
* Copyright (c) 2009 "Cowboy" Ben Alman
|
6 |
+
* Dual licensed under the MIT and GPL licenses.
|
7 |
+
* http://benalman.com/about/license/
|
8 |
+
*
|
9 |
+
* Non-jQuery fork by Jeff Lee
|
10 |
+
*
|
11 |
+
* This fork consists of the following changes:
|
12 |
+
* 1. Basic code cleanup and restructuring, for legibility.
|
13 |
+
* 2. The `postMessage` and `receiveMessage` functions can be bound arbitrarily,
|
14 |
+
* in terms of both function names and object scope. Scope is specified by
|
15 |
+
* the the "this" context of NoJQueryPostMessageMixin();
|
16 |
+
* 3. I've removed the check for Opera 9.64, which used `$.browser`. There were
|
17 |
+
* at least three different GitHub users requesting the removal of this
|
18 |
+
* "Opera sniff" on the original project's Issues page, so I figured this
|
19 |
+
* would be a relatively safe change.
|
20 |
+
* 4. `postMessage` no longer uses `$.param` to serialize messages that are not
|
21 |
+
* strings. I actually prefer this structure anyway. `receiveMessage` does
|
22 |
+
* not implement a corresponding deserialization step, and as such it seems
|
23 |
+
* cleaner and more symmetric to leave both data serialization and
|
24 |
+
* deserialization to the client.
|
25 |
+
* 5. The use of `$.isFunction` is replaced by a functionally-identical check.
|
26 |
+
* 6. The `$:nomunge` YUI option is no longer necessary.
|
27 |
+
*/
|
28 |
+
|
29 |
+
function NoJQueryPostMessageMixin(postBinding, receiveBinding) {
|
30 |
+
|
31 |
+
var setMessageCallback, unsetMessageCallback, currentMsgCallback,
|
32 |
+
intervalId, lastHash, cacheBust = 1;
|
33 |
+
|
34 |
+
if (window.postMessage) {
|
35 |
+
|
36 |
+
if (window.addEventListener) {
|
37 |
+
setMessageCallback = function(callback) {
|
38 |
+
window.addEventListener('message', callback, false);
|
39 |
+
}
|
40 |
+
|
41 |
+
unsetMessageCallback = function(callback) {
|
42 |
+
window.removeEventListener('message', callback, false);
|
43 |
+
}
|
44 |
+
} else {
|
45 |
+
setMessageCallback = function(callback) {
|
46 |
+
window.attachEvent('onmessage', callback);
|
47 |
+
}
|
48 |
+
|
49 |
+
unsetMessageCallback = function(callback) {
|
50 |
+
window.detachEvent('onmessage', callback);
|
51 |
+
}
|
52 |
+
}
|
53 |
+
|
54 |
+
this[postBinding] = function(message, targetUrl, target) {
|
55 |
+
if (!targetUrl) {
|
56 |
+
return;
|
57 |
+
}
|
58 |
+
|
59 |
+
// The browser supports window.postMessage, so call it with a targetOrigin
|
60 |
+
// set appropriately, based on the targetUrl parameter.
|
61 |
+
target.postMessage( message, targetUrl.replace( /([^:]+:\/\/[^\/]+).*/, '$1' ) );
|
62 |
+
}
|
63 |
+
|
64 |
+
// Since the browser supports window.postMessage, the callback will be
|
65 |
+
// bound to the actual event associated with window.postMessage.
|
66 |
+
this[receiveBinding] = function(callback, sourceOrigin, delay) {
|
67 |
+
// Unbind an existing callback if it exists.
|
68 |
+
if (currentMsgCallback) {
|
69 |
+
unsetMessageCallback(currentMsgCallback);
|
70 |
+
currentMsgCallback = null;
|
71 |
+
}
|
72 |
+
|
73 |
+
if (!callback) {
|
74 |
+
return false;
|
75 |
+
}
|
76 |
+
|
77 |
+
// Bind the callback. A reference to the callback is stored for ease of
|
78 |
+
// unbinding.
|
79 |
+
currentMsgCallback = setMessageCallback(function(e) {
|
80 |
+
switch(Object.prototype.toString.call(sourceOrigin)) {
|
81 |
+
case '[object String]':
|
82 |
+
if (sourceOrigin !== e.origin) {
|
83 |
+
return false;
|
84 |
+
}
|
85 |
+
break;
|
86 |
+
case '[object Function]':
|
87 |
+
if (sourceOrigin(e.origin)) {
|
88 |
+
return false;
|
89 |
+
}
|
90 |
+
break;
|
91 |
+
}
|
92 |
+
|
93 |
+
callback(e);
|
94 |
+
});
|
95 |
+
};
|
96 |
+
|
97 |
+
} else {
|
98 |
+
|
99 |
+
this[postBinding] = function(message, targetUrl, target) {
|
100 |
+
if (!targetUrl) {
|
101 |
+
return;
|
102 |
+
}
|
103 |
+
|
104 |
+
// The browser does not support window.postMessage, so set the location
|
105 |
+
// of the target to targetUrl#message. A bit ugly, but it works! A cache
|
106 |
+
// bust parameter is added to ensure that repeat messages trigger the
|
107 |
+
// callback.
|
108 |
+
target.location = targetUrl.replace( /#.*$/, '' ) + '#' + (+new Date) + (cacheBust++) + '&' + message;
|
109 |
+
}
|
110 |
+
|
111 |
+
// Since the browser sucks, a polling loop will be started, and the
|
112 |
+
// callback will be called whenever the location.hash changes.
|
113 |
+
this[receiveBinding] = function(callback, sourceOrigin, delay) {
|
114 |
+
if (intervalId) {
|
115 |
+
clearInterval(intervalId);
|
116 |
+
intervalId = null;
|
117 |
+
}
|
118 |
+
|
119 |
+
if (callback) {
|
120 |
+
delay = typeof sourceOrigin === 'number'
|
121 |
+
? sourceOrigin
|
122 |
+
: typeof delay === 'number'
|
123 |
+
? delay
|
124 |
+
: 100;
|
125 |
+
|
126 |
+
intervalId = setInterval(function(){
|
127 |
+
var hash = document.location.hash,
|
128 |
+
re = /^#?\d+&/;
|
129 |
+
if ( hash !== lastHash && re.test( hash ) ) {
|
130 |
+
lastHash = hash;
|
131 |
+
callback({ data: hash.replace( re, '' ) });
|
132 |
+
}
|
133 |
+
}, delay );
|
134 |
+
}
|
135 |
+
};
|
136 |
+
|
137 |
+
}
|
138 |
+
|
139 |
+
return this;
|
140 |
+
}
|
freemius/assets/js/nojquery.ba-postmessage.min.js
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
* nojquery-postmessage by Jeff Lee
|
3 |
+
* a non-jQuery fork of:
|
4 |
+
*
|
5 |
+
* jQuery postMessage - v0.5 - 9/11/2009
|
6 |
+
* http://benalman.com/projects/jquery-postmessage-plugin/
|
7 |
+
*
|
8 |
+
* Copyright (c) 2009 "Cowboy" Ben Alman
|
9 |
+
* Dual licensed under the MIT and GPL licenses.
|
10 |
+
* http://benalman.com/about/license/
|
11 |
+
*/
|
12 |
+
function NoJQueryPostMessageMixin(g,a){var b,h,e,d,f,c=1;if(window.postMessage){if(window.addEventListener){b=function(i){window.addEventListener("message",i,false)};h=function(i){window.removeEventListener("message",i,false)}}else{b=function(i){window.attachEvent("onmessage",i)};h=function(i){window.detachEvent("onmessage",i)}}this[g]=function(i,k,j){if(!k){return}j.postMessage(i,k.replace(/([^:]+:\/\/[^\/]+).*/,"$1"))};this[a]=function(k,j,i){if(e){h(e);e=null}if(!k){return false}e=b(function(l){switch(Object.prototype.toString.call(j)){case"[object String]":if(j!==l.origin){return false}break;case"[object Function]":if(j(l.origin)){return false}break}k(l)})}}else{this[g]=function(i,k,j){if(!k){return}j.location=k.replace(/#.*$/,"")+"#"+(+new Date)+(c++)+"&"+i};this[a]=function(k,j,i){if(d){clearInterval(d);d=null}if(k){i=typeof j==="number"?j:typeof i==="number"?i:100;d=setInterval(function(){var m=document.location.hash,l=/^#?\d+&/;if(m!==f&&l.test(m)){f=m;k({data:m.replace(l,"")})}},i)}}}return this};
|
freemius/assets/js/postmessage.js
ADDED
@@ -0,0 +1,135 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
(function ($, undef) {
|
2 |
+
var global = this;
|
3 |
+
|
4 |
+
// Namespace.
|
5 |
+
global.FS = global.FS || {};
|
6 |
+
|
7 |
+
global.FS.PostMessage = function ()
|
8 |
+
{
|
9 |
+
var
|
10 |
+
_is_child = false,
|
11 |
+
_postman = new NoJQueryPostMessageMixin('postMessage', 'receiveMessage'),
|
12 |
+
_callbacks = {},
|
13 |
+
_base_url,
|
14 |
+
_parent_url = decodeURIComponent(document.location.hash.replace(/^#/, '')),
|
15 |
+
_parent_subdomain = _parent_url.substring(0, _parent_url.indexOf('/', ('https://' === _parent_url.substring(0, ('https://').length)) ? 8 : 7)),
|
16 |
+
_init = function () {
|
17 |
+
_postman.receiveMessage(function (e) {
|
18 |
+
var data = JSON.parse(e.data);
|
19 |
+
|
20 |
+
if (_callbacks[data.type]) {
|
21 |
+
for (var i = 0; i < _callbacks[data.type].length; i++) {
|
22 |
+
// Execute type callbacks.
|
23 |
+
_callbacks[data.type][i](data.data);
|
24 |
+
}
|
25 |
+
}
|
26 |
+
}, _base_url);
|
27 |
+
},
|
28 |
+
_hasParent = ('' !== _parent_url),
|
29 |
+
$window = $(window),
|
30 |
+
$html = $('html');
|
31 |
+
|
32 |
+
return {
|
33 |
+
init : function (url, iframes)
|
34 |
+
{
|
35 |
+
_base_url = url;
|
36 |
+
_init();
|
37 |
+
|
38 |
+
// Automatically receive forward messages.
|
39 |
+
FS.PostMessage.receiveOnce('forward', function (data){
|
40 |
+
window.location = data.url;
|
41 |
+
});
|
42 |
+
|
43 |
+
iframes = iframes || [];
|
44 |
+
|
45 |
+
if (iframes.length > 0) {
|
46 |
+
$window.on('scroll', function () {
|
47 |
+
for (var i = 0; i < iframes.length; i++) {
|
48 |
+
FS.PostMessage.postScroll(iframes[i]);
|
49 |
+
}
|
50 |
+
});
|
51 |
+
}
|
52 |
+
},
|
53 |
+
init_child : function ()
|
54 |
+
{
|
55 |
+
this.init(_parent_subdomain);
|
56 |
+
|
57 |
+
_is_child = true;
|
58 |
+
|
59 |
+
// Post height of a child right after window is loaded.
|
60 |
+
$(window).bind('load', function () {
|
61 |
+
FS.PostMessage.postHeight();
|
62 |
+
|
63 |
+
// Post message that window was loaded.
|
64 |
+
FS.PostMessage.post('loaded');
|
65 |
+
});
|
66 |
+
},
|
67 |
+
hasParent : function ()
|
68 |
+
{
|
69 |
+
return _hasParent;
|
70 |
+
},
|
71 |
+
postHeight : function (diff, wrapper) {
|
72 |
+
diff = diff || 0;
|
73 |
+
wrapper = wrapper || '#wrap_section';
|
74 |
+
this.post('height', {
|
75 |
+
height: diff + $(wrapper).outerHeight(true)
|
76 |
+
});
|
77 |
+
},
|
78 |
+
postScroll : function (iframe) {
|
79 |
+
this.post('scroll', {
|
80 |
+
top: $window.scrollTop(),
|
81 |
+
height: ($window.height() - parseFloat($html.css('paddingTop')) - parseFloat($html.css('marginTop')))
|
82 |
+
}, iframe);
|
83 |
+
},
|
84 |
+
post : function (type, data, iframe)
|
85 |
+
{
|
86 |
+
console.debug('PostMessage.post', type);
|
87 |
+
|
88 |
+
if (iframe)
|
89 |
+
{
|
90 |
+
// Post to iframe.
|
91 |
+
_postman.postMessage(JSON.stringify({
|
92 |
+
type: type,
|
93 |
+
data: data
|
94 |
+
}), iframe.src, iframe.contentWindow);
|
95 |
+
}
|
96 |
+
else {
|
97 |
+
// Post to parent.
|
98 |
+
_postman.postMessage(JSON.stringify({
|
99 |
+
type: type,
|
100 |
+
data: data
|
101 |
+
}), _parent_url, window.parent);
|
102 |
+
}
|
103 |
+
},
|
104 |
+
receive: function (type, callback)
|
105 |
+
{
|
106 |
+
console.debug('PostMessage.receive', type);
|
107 |
+
|
108 |
+
if (undef === _callbacks[type])
|
109 |
+
_callbacks[type] = [];
|
110 |
+
|
111 |
+
_callbacks[type].push(callback);
|
112 |
+
},
|
113 |
+
receiveOnce: function (type, callback)
|
114 |
+
{
|
115 |
+
if (this.is_set(type))
|
116 |
+
return;
|
117 |
+
|
118 |
+
this.receive(type, callback);
|
119 |
+
},
|
120 |
+
// Check if any callbacks assigned to a specified message type.
|
121 |
+
is_set: function (type)
|
122 |
+
{
|
123 |
+
return (undef != _callbacks[type]);
|
124 |
+
},
|
125 |
+
parent_url: function ()
|
126 |
+
{
|
127 |
+
return _parent_url;
|
128 |
+
},
|
129 |
+
parent_subdomain: function ()
|
130 |
+
{
|
131 |
+
return _parent_subdomain;
|
132 |
+
}
|
133 |
+
};
|
134 |
+
}();
|
135 |
+
})(jQuery);
|
freemius/assets/scss/_colors.scss
ADDED
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
$menu-hover-color: #333;
|
2 |
+
$darkest-color: #000;
|
3 |
+
$fms-live-color: #71ae00;
|
4 |
+
$fms-test-color: #f7941d;
|
5 |
+
$fms-link-color: #29abe1;
|
6 |
+
$fms-link-hover-color: darken(#29abe1, 10%);
|
7 |
+
$body-bkg: #111;
|
8 |
+
$special-color: #d3135a;
|
9 |
+
$body-color: #f1f1f1;
|
10 |
+
$fms-white: #f1f1f1;
|
11 |
+
$container-bkg: #222;
|
12 |
+
$container-bkg-odd: #262626;
|
13 |
+
$container-border-color: #333;
|
14 |
+
$table-head-bkg: #333;
|
15 |
+
$table-head-color: #999;
|
16 |
+
$info-color: #999;
|
17 |
+
$error-color: #ff0000;
|
18 |
+
|
19 |
+
$fs-logo-blue-color: #29abe1;
|
20 |
+
$fs-logo-green-color: #71ae00;
|
21 |
+
$fs-logo-magenta-color: #d3135a;
|
22 |
+
|
23 |
+
// WordPress colors.
|
24 |
+
$page-header-bkg: #333;
|
25 |
+
$page-header-color: $fms-white;
|
26 |
+
$text-dark-color: #333;
|
27 |
+
$text-light-color: #666;
|
28 |
+
$text-lightest-color: #999;
|
29 |
+
|
30 |
+
// Notices.
|
31 |
+
$wp-notice-success-color: #f7fff7;
|
32 |
+
$wp-notice-success-dark-color: #46b450;
|
33 |
+
$wp-notice-error-color: #ffeaea;
|
34 |
+
$wp-notice-error-dark-color: #dc3232;
|
35 |
+
$wp-notice-warn-color: #fff8e5;
|
36 |
+
$wp-notice-warn-dark-color: #ffb900;
|
37 |
+
$fs-notice-promotion-border-color: #00a0d2;
|
38 |
+
$fs-notice-promotion-bkg: #f2fcff;
|
39 |
+
|
40 |
+
// WP Buttons.
|
41 |
+
$button-primary-bkg: #6bc406;
|
42 |
+
$button-primary-color: $fms-white;
|
43 |
+
$button-secondary-bkg: #333;
|
44 |
+
$button-secondary-color: $fms-white;
|
45 |
+
$featured-color: #6bc406;
|
46 |
+
$wp-selected-color: #0074a3;
|
47 |
+
|
48 |
+
$wordpress_color: #01749A;
|
49 |
+
$blogger_color: #ff8100;
|
50 |
+
$wix_color: #fac102;
|
51 |
+
$shopify_color: #80d100;
|
52 |
+
$addthis_color: #fe6d4e;
|
53 |
+
$tumblr_color: #34506b;
|
54 |
+
$zepo_color: #00baf2;
|
55 |
+
$jquery_color: #000919;
|
56 |
+
$javascript_color: #00baf2;
|
57 |
+
$squarespace_color: #000;
|
58 |
+
|
59 |
+
$blog_color: #ff6600;
|
60 |
+
$facebook_color: #3b5998;
|
61 |
+
$twitter_color: #4099ff;
|
62 |
+
$linkedin_color: #4875b4;
|
63 |
+
$youtube_color: #ff3333;
|
64 |
+
$gplus_color: #c63d2d;
|
65 |
+
|
freemius/assets/scss/_functions.scss
ADDED
File without changes
|
freemius/assets/scss/_load.scss
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
@import 'mixins';
|
2 |
+
@import "vars";
|
3 |
+
@import "functions";
|
4 |
+
@import "colors";
|
freemius/assets/scss/_mixins.scss
ADDED
@@ -0,0 +1,283 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// ---- CSS3 SASS MIXINS ----
|
2 |
+
// https://github.com/madr/css3-sass-mixins
|
3 |
+
//
|
4 |
+
// Copyright (C) 2011 by Anders Ytterström
|
5 |
+
//
|
6 |
+
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
7 |
+
// of this software and associated documentation files (the "Software"), to deal
|
8 |
+
// in the Software without restriction, including without limitation the rights
|
9 |
+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10 |
+
// copies of the Software, and to permit persons to whom the Software is
|
11 |
+
// furnished to do so, subject to the following conditions:
|
12 |
+
//
|
13 |
+
// The above copyright notice and this permission notice shall be included in
|
14 |
+
// all copies or substantial portions of the Software.
|
15 |
+
//
|
16 |
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17 |
+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18 |
+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19 |
+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20 |
+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21 |
+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
22 |
+
// THE SOFTWARE.
|
23 |
+
//
|
24 |
+
|
25 |
+
// ---- LEGACY IE SUPPORT USING FILTERS ----
|
26 |
+
// Should IE filters be used or not?
|
27 |
+
// PROS: gradients, drop shadows etc will be handled by css.
|
28 |
+
// CONS: will harm the site performance badly,
|
29 |
+
// especially on sites with heavy rendering and scripting.
|
30 |
+
$useIEFilters: 0;
|
31 |
+
// might be 0 or 1. disabled by default.
|
32 |
+
// ---- /LEGACY IE SUPPORT USING FILTERS ----
|
33 |
+
|
34 |
+
|
35 |
+
@mixin background-size ($value) {
|
36 |
+
-webkit-background-size: $value;
|
37 |
+
background-size: $value;
|
38 |
+
}
|
39 |
+
|
40 |
+
@mixin border-image ($path, $offsets, $repeats) {
|
41 |
+
-moz-border-image: $path $offsets $repeats;
|
42 |
+
-o-border-image: $path $offsets $repeats;
|
43 |
+
-webkit-border-image: $path $offsets $repeats;
|
44 |
+
border-image: $path $offsets $repeats;
|
45 |
+
}
|
46 |
+
|
47 |
+
@mixin border-radius ($values...) {
|
48 |
+
-moz-border-radius: $values;
|
49 |
+
-webkit-border-radius: $values;
|
50 |
+
border-radius: $values;
|
51 |
+
/*-moz-background-clip: padding;
|
52 |
+
-webkit-background-clip: padding-box;
|
53 |
+
background-clip: padding-box;*/
|
54 |
+
}
|
55 |
+
|
56 |
+
@mixin box-shadow ($values...) {
|
57 |
+
-moz-box-shadow: $values;
|
58 |
+
-webkit-box-shadow: $values;
|
59 |
+
box-shadow: $values;
|
60 |
+
}
|
61 |
+
|
62 |
+
//@mixin box-shadow ($x, $y, $offset, $hex, $ie: $useIEFilters, $inset: null, $spread:null) {
|
63 |
+
// -moz-box-shadow: $x $y $offset $spread $hex $inset;
|
64 |
+
// -webkit-box-shadow: $x $y $offset $spread $hex $inset;
|
65 |
+
// box-shadow: $x $y $offset $spread $hex $inset;
|
66 |
+
//
|
67 |
+
// @if $ie == 1 {
|
68 |
+
// $iecolor: '#' + red($hex) + green($hex) + blue($hex);
|
69 |
+
// filter: progid:DXImageTransform.Microsoft.dropshadow(OffX=#{$x}, OffY=#{$y}, Color='#{$iecolor}');
|
70 |
+
// -ms-filter: quote(progid:DXImageTransform.Microsoft.dropshadow(OffX=#{$x}, OffY=#{$y}, Color='#{$iecolor}'));
|
71 |
+
// }
|
72 |
+
//}
|
73 |
+
|
74 |
+
@mixin box-sizing($value) {
|
75 |
+
-moz-box-sizing: $value;
|
76 |
+
-webkit-box-sizing: $value;
|
77 |
+
box-sizing: $value;
|
78 |
+
}
|
79 |
+
|
80 |
+
// requires sass 3.2
|
81 |
+
@mixin keyframes($name){
|
82 |
+
@-moz-keyframes #{$name} { @content; }
|
83 |
+
@-ms-keyframes #{$name} { @content; }
|
84 |
+
@-o-keyframes #{$name} { @content; }
|
85 |
+
@-webkit-keyframes #{$name} { @content; }
|
86 |
+
@keyframes #{$name} { @content; }
|
87 |
+
}
|
88 |
+
|
89 |
+
@mixin linear-gradient($from, $to, $ie: $useIEFilters) {
|
90 |
+
@if $ie != 1 { background-color: $to; }
|
91 |
+
|
92 |
+
background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, $from),color-stop(1, $to));
|
93 |
+
background-image: -webkit-linear-gradient(top, $from, $to);
|
94 |
+
background-image: -moz-linear-gradient(top, $from, $to);
|
95 |
+
background-image: -ms-linear-gradient(top, $from, $to);
|
96 |
+
background-image: -o-linear-gradient(top, $from, $to);
|
97 |
+
background-image: linear-gradient(top, bottom, $from, $to);
|
98 |
+
|
99 |
+
@if $ie == 1 {
|
100 |
+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{$from}', endColorstr='#{$to}');
|
101 |
+
}
|
102 |
+
}
|
103 |
+
|
104 |
+
@mixin horizontal-gradient($startColor: #555, $endColor: #333, $ie: $useIEFilters) {
|
105 |
+
@if $ie != 1 { background-color: $endColor; }
|
106 |
+
|
107 |
+
background-color: $endColor;
|
108 |
+
background-image: -webkit-gradient(linear, 0 0, 100% 0, from($startColor), to($endColor)); // Safari 4+, Chrome 2+
|
109 |
+
background-image: -webkit-linear-gradient(left, $startColor, $endColor); // Safari 5.1+, Chrome 10+
|
110 |
+
background-image: -moz-linear-gradient(left, $startColor, $endColor); // FF 3.6+
|
111 |
+
background-image: -o-linear-gradient(left, $startColor, $endColor); // Opera 11.10
|
112 |
+
background-image: linear-gradient(to right, $startColor, $endColor); // Standard, IE10
|
113 |
+
background-repeat: repeat-x;
|
114 |
+
@if $ie == 1 {
|
115 |
+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{$startColor}', endColorstr='#{$endColor}', GradientType=1);
|
116 |
+
}
|
117 |
+
}
|
118 |
+
|
119 |
+
@mixin radial-gradient($from, $to, $ie: $useIEFilters) {
|
120 |
+
@if $ie != 1 { background-color: $to; }
|
121 |
+
|
122 |
+
background: -moz-radial-gradient(center, circle cover, $from 0%, $to 100%);
|
123 |
+
background: -webkit-gradient(radial, center center, 0px, center center, 100%, color-stop(0%, $from), color-stop(100%, $to));
|
124 |
+
background: -webkit-radial-gradient(center, circle cover, $from 0%, $to 100%);
|
125 |
+
background: -o-radial-gradient(center, circle cover, $from 0%, $to 100%);
|
126 |
+
background: -ms-radial-gradient(center, circle cover, $from 0%, $to 100%);
|
127 |
+
background: radial-gradient(center, circle cover, $from 0%, $to 100%);
|
128 |
+
background-color: $from;
|
129 |
+
|
130 |
+
@if $ie == 1 {
|
131 |
+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{$from}', endColorstr='#{$to}', GradientType=1); /* IE6-9 fallback on horizontal gradient */
|
132 |
+
}
|
133 |
+
}
|
134 |
+
|
135 |
+
/*@mixin rgba-bg ($hex, $alpha, $ie: $useIEFilters) {
|
136 |
+
@if $ie == 1 {
|
137 |
+
background-color: none;
|
138 |
+
$hexopac: ie-hex-str(rgba($hex, $alpha));
|
139 |
+
filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#{$hexopac}',EndColorStr='#{$hexopac}}');
|
140 |
+
-ms-filter: quote(progid:DXImageTransform.Microsoft.gradient(startColorStr='#{$hexopac}',EndColorStr='#{$hexopac}'));
|
141 |
+
}
|
142 |
+
@else {
|
143 |
+
background-color: $hex;
|
144 |
+
background-color: rgba($hex, $alpha);
|
145 |
+
}
|
146 |
+
}*/
|
147 |
+
|
148 |
+
@mixin perspective($perspective) {
|
149 |
+
-moz-perspective: $perspective;
|
150 |
+
-ms-perspective: $perspective;
|
151 |
+
-webkit-perspective: $perspective;
|
152 |
+
perspective: $perspective;
|
153 |
+
-moz-transform-style: preserve-3d;
|
154 |
+
-ms-transform-style: preserve-3d;
|
155 |
+
-webkit-transform-style: preserve-3d;
|
156 |
+
transform-style: preserve-3d;
|
157 |
+
}
|
158 |
+
|
159 |
+
@mixin transform ($transforms) {
|
160 |
+
-moz-transform: $transforms;
|
161 |
+
-o-transform: $transforms;
|
162 |
+
-ms-transform: $transforms;
|
163 |
+
-webkit-transform: $transforms;
|
164 |
+
transform: $transforms;
|
165 |
+
}
|
166 |
+
|
167 |
+
@mixin matrix ($a, $b, $c, $d, $e, $f) {
|
168 |
+
-moz-transform: matrix($a, $b, $c, $d, #{$e}px, #{$f}px);
|
169 |
+
-o-transform: matrix($a, $b, $c, $d, $e, $f);
|
170 |
+
-ms-transform: matrix($a, $b, $c, $d, $e, $f);
|
171 |
+
-webkit-transform: matrix($a, $b, $c, $d, $e, $f);
|
172 |
+
transform: matrix($a, $b, $c, $d, $e, $f);
|
173 |
+
}
|
174 |
+
|
175 |
+
@mixin rotate ($deg) {
|
176 |
+
@include transform(rotate(#{$deg}deg));
|
177 |
+
}
|
178 |
+
|
179 |
+
@mixin scale ($size) {
|
180 |
+
@include transform(scale(#{$size}));
|
181 |
+
}
|
182 |
+
|
183 |
+
@mixin translate ($x, $y) {
|
184 |
+
@include transform(translate($x, $y));
|
185 |
+
}
|
186 |
+
|
187 |
+
@mixin transition ($value...) {
|
188 |
+
-moz-transition: $value;
|
189 |
+
-o-transition: $value;
|
190 |
+
-ms-transition: $value;
|
191 |
+
-webkit-transition: $value;
|
192 |
+
transition: $value;
|
193 |
+
}
|
194 |
+
|
195 |
+
@mixin animation($str) {
|
196 |
+
-webkit-animation: #{$str};
|
197 |
+
-moz-animation: #{$str};
|
198 |
+
-ms-animation: #{$str};
|
199 |
+
-o-animation: #{$str};
|
200 |
+
animation: #{$str};
|
201 |
+
}
|
202 |
+
|
203 |
+
@mixin animation-name($str) {
|
204 |
+
-webkit-animation-name: #{$str};
|
205 |
+
-moz-animation-name: #{$str};
|
206 |
+
-ms-animation-name: #{$str};
|
207 |
+
-o-animation-name: #{$str};
|
208 |
+
animation-name: #{$str};
|
209 |
+
}
|
210 |
+
|
211 |
+
@mixin animation-duration($str) {
|
212 |
+
-webkit-animation-duration: #{$str};
|
213 |
+
-moz-animation-duration: #{$str};
|
214 |
+
-ms-animation-duration: #{$str};
|
215 |
+
-o-animation-duration: #{$str};
|
216 |
+
animation-duration: #{$str};
|
217 |
+
}
|
218 |
+
|
219 |
+
@mixin animation-direction($str) {
|
220 |
+
-webkit-animation-direction: #{$str};
|
221 |
+
-moz-animation-direction: #{$str};
|
222 |
+
-ms-animation-direction: #{$str};
|
223 |
+
-o-animation-direction: #{$str};
|
224 |
+
animation-direction: #{$str};
|
225 |
+
}
|
226 |
+
|
227 |
+
@mixin animation-delay($str) {
|
228 |
+
animation-delay:#{$str};
|
229 |
+
-o-animation-delay:#{$str};
|
230 |
+
-ms-animation-delay:#{$str};
|
231 |
+
-webkit-animation-delay:#{$str};
|
232 |
+
-moz-animation-delay:#{$str};
|
233 |
+
}
|
234 |
+
|
235 |
+
@mixin animation-iteration-count($str) {
|
236 |
+
animation-iteration-count:#{$str};
|
237 |
+
-o-animation-iteration-count:#{$str};
|
238 |
+
-ms-animation-iteration-count:#{$str};
|
239 |
+
-webkit-animation-iteration-count:#{$str};
|
240 |
+
-moz-animation-iteration-count:#{$str};
|
241 |
+
}
|
242 |
+
|
243 |
+
@mixin animation-timing-function($str) {
|
244 |
+
-webkit-animation-timing-function: #{$str};
|
245 |
+
-moz-animation-timing-function: #{$str};
|
246 |
+
-ms-animation-timing-function: #{$str};
|
247 |
+
-o-animation-timing-function: #{$str};
|
248 |
+
animation-timing-function: #{$str};
|
249 |
+
}
|
250 |
+
|
251 |
+
// ==== /CSS3 SASS MIXINS ====
|
252 |
+
|
253 |
+
@mixin opacity($opacity) {
|
254 |
+
opacity: $opacity;
|
255 |
+
$opacity-ie: $opacity * 100;
|
256 |
+
filter: alpha(opacity=$opacity-ie); //IE8
|
257 |
+
}
|
258 |
+
|
259 |
+
@mixin size($width, $height: $width)
|
260 |
+
{
|
261 |
+
width: $width;
|
262 |
+
height: $height;
|
263 |
+
}
|
264 |
+
|
265 |
+
@mixin clearfix
|
266 |
+
{
|
267 |
+
&:after {
|
268 |
+
content: "";
|
269 |
+
display: table;
|
270 |
+
clear: both;
|
271 |
+
}
|
272 |
+
}
|
273 |
+
|
274 |
+
// Placeholder text
|
275 |
+
@mixin placeholder($color: $input-color-placeholder) {
|
276 |
+
// Firefox
|
277 |
+
&::-moz-placeholder {
|
278 |
+
color: $color;
|
279 |
+
opacity: 1; // Override Firefox's unusual default opacity; see https://github.com/twbs/bootstrap/pull/11526
|
280 |
+
}
|
281 |
+
&:-ms-input-placeholder { color: $color; } // Internet Explorer 10+
|
282 |
+
&::-webkit-input-placeholder { color: $color; } // Safari and Chrome
|
283 |
+
}
|
freemius/assets/scss/_start.scss
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
@import "vars";
|
2 |
+
@import "colors";
|
3 |
+
@import "mixins";
|
4 |
+
@import "functions";
|
freemius/assets/scss/_vars.scss
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
$is_production: true;
|
2 |
+
|
3 |
+
$img_common: if($is_production == true, '//img.freemius.com', 'http://img.freemius:8080');
|
4 |
+
|
5 |
+
$layout_width: 960px;
|
6 |
+
$admin_mobile_max_width: 782px;
|
freemius/assets/scss/admin/_ajax-loader.scss
ADDED
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
$color: $wp-selected-color;
|
2 |
+
$bkg-color: #fff;
|
3 |
+
$size: 20;
|
4 |
+
|
5 |
+
.fs-ajax-loader
|
6 |
+
{
|
7 |
+
position: relative;
|
8 |
+
width: #{8*$size + 10}px;
|
9 |
+
height: #{$size}px;
|
10 |
+
margin: auto;
|
11 |
+
|
12 |
+
.fs-ajax-loader-bar
|
13 |
+
{
|
14 |
+
position: absolute;
|
15 |
+
top: 0;
|
16 |
+
background-color: $color;
|
17 |
+
width: #{$size}px;
|
18 |
+
height: #{$size}px;
|
19 |
+
@include animation-name(bounce_ajaxLoader);
|
20 |
+
@include animation-duration(1.5s);
|
21 |
+
@include animation-iteration-count(infinite);
|
22 |
+
@include animation-direction(normal);
|
23 |
+
@include transform(.3);
|
24 |
+
}
|
25 |
+
|
26 |
+
@for $i from 0 through 7
|
27 |
+
{
|
28 |
+
.fs-ajax-loader-bar-#{$i + 1}
|
29 |
+
{
|
30 |
+
left: #{$i*($size - 1)}px;
|
31 |
+
@include animation-delay(#{0.6 + $i*0.15}s);
|
32 |
+
}
|
33 |
+
}
|
34 |
+
}
|
35 |
+
|
36 |
+
@include keyframes(bounce_ajaxLoader)
|
37 |
+
{
|
38 |
+
0%
|
39 |
+
{
|
40 |
+
@include transform(scale(1));
|
41 |
+
background-color: $color;
|
42 |
+
}
|
43 |
+
|
44 |
+
100%
|
45 |
+
{
|
46 |
+
@include transform(scale(.3));
|
47 |
+
background-color: $bkg-color;
|
48 |
+
}
|
49 |
+
}
|
freemius/assets/scss/admin/_auto-install.scss
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.fs-modal-auto-install
|
2 |
+
{
|
3 |
+
$max-width: 300px;
|
4 |
+
|
5 |
+
#request-filesystem-credentials-form
|
6 |
+
{
|
7 |
+
h2,
|
8 |
+
.request-filesystem-credentials-action-buttons
|
9 |
+
{
|
10 |
+
display: none;
|
11 |
+
}
|
12 |
+
|
13 |
+
input[type=password],
|
14 |
+
input[type=email],
|
15 |
+
input[type=text]
|
16 |
+
{
|
17 |
+
-webkit-appearance: none;
|
18 |
+
padding: 10px 10px 5px 10px;
|
19 |
+
width: $max-width;
|
20 |
+
max-width: 100%;
|
21 |
+
}
|
22 |
+
|
23 |
+
> div,
|
24 |
+
label,
|
25 |
+
fieldset
|
26 |
+
{
|
27 |
+
width: $max-width;
|
28 |
+
max-width: 100%;
|
29 |
+
margin: 0 auto;
|
30 |
+
display: block;
|
31 |
+
}
|
32 |
+
}
|
33 |
+
}
|
freemius/assets/scss/admin/_deactivation-feedback.scss
ADDED
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
@import "../colors";
|
2 |
+
|
3 |
+
.fs-modal.fs-modal-deactivation-feedback {
|
4 |
+
.reason-input, .internal-message {
|
5 |
+
margin: 3px 0 3px 22px;
|
6 |
+
|
7 |
+
input, textarea {
|
8 |
+
width: 100%;
|
9 |
+
}
|
10 |
+
}
|
11 |
+
|
12 |
+
li.reason {
|
13 |
+
&.has-internal-message .internal-message {
|
14 |
+
border: 1px solid lighten($darkest-color, 80%);
|
15 |
+
padding: 7px;
|
16 |
+
display: none;
|
17 |
+
}
|
18 |
+
|
19 |
+
@media (max-width: 650px) {
|
20 |
+
li.reason {
|
21 |
+
margin-bottom: 10px;
|
22 |
+
|
23 |
+
.reason-input, .internal-message {
|
24 |
+
margin-left: 29px;
|
25 |
+
}
|
26 |
+
|
27 |
+
label {
|
28 |
+
display: table;
|
29 |
+
|
30 |
+
> span {
|
31 |
+
display: table-cell;
|
32 |
+
font-size: 1.3em;
|
33 |
+
}
|
34 |
+
}
|
35 |
+
}
|
36 |
+
}
|
37 |
+
}
|
38 |
+
|
39 |
+
.anonymous-feedback-label {
|
40 |
+
float: left;
|
41 |
+
}
|
42 |
+
|
43 |
+
.fs-modal-panel {
|
44 |
+
margin-top: 0 !important;
|
45 |
+
|
46 |
+
h3 {
|
47 |
+
margin-top: 0;
|
48 |
+
line-height: 1.5em;
|
49 |
+
}
|
50 |
+
}
|
51 |
+
}
|
52 |
+
|
53 |
+
#the-list .deactivate > .fs-slug {
|
54 |
+
display: none;
|
55 |
+
}
|
freemius/assets/scss/admin/_license-activation.scss
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.fs-modal.fs-modal-license-activation {
|
2 |
+
.fs-modal-body {
|
3 |
+
input.license_key {
|
4 |
+
width: 100%;
|
5 |
+
}
|
6 |
+
}
|
7 |
+
}
|
freemius/assets/scss/admin/_license-key-resend.scss
ADDED
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.fs-modal.fs-modal-license-key-resend
|
2 |
+
{
|
3 |
+
.email-address-container
|
4 |
+
{
|
5 |
+
overflow: hidden;
|
6 |
+
padding-right: 2px;
|
7 |
+
}
|
8 |
+
|
9 |
+
&.fs-freemium
|
10 |
+
{
|
11 |
+
input.email-address
|
12 |
+
{
|
13 |
+
width: 300px;
|
14 |
+
}
|
15 |
+
|
16 |
+
label
|
17 |
+
{
|
18 |
+
display: block;
|
19 |
+
margin-bottom: 10px;
|
20 |
+
}
|
21 |
+
}
|
22 |
+
|
23 |
+
&.fs-premium
|
24 |
+
{
|
25 |
+
input.email-address
|
26 |
+
{
|
27 |
+
width: 100%;
|
28 |
+
}
|
29 |
+
|
30 |
+
.button-container
|
31 |
+
{
|
32 |
+
float: right;
|
33 |
+
margin-left: 7px;
|
34 |
+
|
35 |
+
@media (max-width: 650px) {
|
36 |
+
margin-top: 2px;
|
37 |
+
}
|
38 |
+
}
|
39 |
+
}
|
40 |
+
}
|
41 |
+
|
42 |
+
.rtl
|
43 |
+
{
|
44 |
+
.fs-modal.fs-modal-license-key-resend
|
45 |
+
{
|
46 |
+
.fs-modal-body
|
47 |
+
{
|
48 |
+
.input-container > .email-address-container
|
49 |
+
{
|
50 |
+
padding-left: 2px;
|
51 |
+
padding-right: 0;
|
52 |
+
}
|
53 |
+
|
54 |
+
.button-container
|
55 |
+
{
|
56 |
+
float: left;
|
57 |
+
margin-right: 7px;
|
58 |
+
margin-left: 0;
|
59 |
+
}
|
60 |
+
}
|
61 |
+
}
|
62 |
+
}
|
63 |
+
|
64 |
+
a.show-license-resend-modal
|
65 |
+
{
|
66 |
+
margin-top: 4px;
|
67 |
+
display: inline-block;
|
68 |
+
}
|
freemius/assets/scss/admin/_modal-common.scss
ADDED
@@ -0,0 +1,186 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
@import "../colors";
|
2 |
+
@import "../mixins";
|
3 |
+
|
4 |
+
.fs-modal {
|
5 |
+
position: fixed;
|
6 |
+
overflow: auto;
|
7 |
+
height: 100%;
|
8 |
+
width: 100%;
|
9 |
+
top: 0;
|
10 |
+
z-index: 100000;
|
11 |
+
display: none;
|
12 |
+
background: rgba(0, 0, 0, 0.6);
|
13 |
+
|
14 |
+
.fs-modal-dialog {
|
15 |
+
background: transparent;
|
16 |
+
position: absolute;
|
17 |
+
left: 50%;
|
18 |
+
margin-left: -298px;
|
19 |
+
padding-bottom: 30px;
|
20 |
+
top: -100%;
|
21 |
+
z-index: 100001;
|
22 |
+
width: 596px;
|
23 |
+
|
24 |
+
@media (max-width: 650px) {
|
25 |
+
margin-left: -50%;
|
26 |
+
box-sizing: border-box;
|
27 |
+
padding-left: 10px;
|
28 |
+
padding-right: 10px;
|
29 |
+
width: 100%;
|
30 |
+
|
31 |
+
.fs-modal-panel > h3 > strong {
|
32 |
+
font-size: 1.3em;
|
33 |
+
}
|
34 |
+
}
|
35 |
+
}
|
36 |
+
|
37 |
+
&.active {
|
38 |
+
display: block;
|
39 |
+
|
40 |
+
&:before {
|
41 |
+
display: block;
|
42 |
+
}
|
43 |
+
|
44 |
+
.fs-modal-dialog {
|
45 |
+
top: 10%;
|
46 |
+
}
|
47 |
+
}
|
48 |
+
|
49 |
+
&.fs-success {
|
50 |
+
.fs-modal-header {
|
51 |
+
border-bottom-color: $wp-notice-success-dark-color;
|
52 |
+
}
|
53 |
+
|
54 |
+
.fs-modal-body {
|
55 |
+
background-color: $wp-notice-success-color;
|
56 |
+
}
|
57 |
+
}
|
58 |
+
|
59 |
+
&.fs-warn {
|
60 |
+
.fs-modal-header {
|
61 |
+
border-bottom-color: $wp-notice-warn-dark-color;
|
62 |
+
}
|
63 |
+
|
64 |
+
.fs-modal-body {
|
65 |
+
background-color: $wp-notice-warn-color;
|
66 |
+
}
|
67 |
+
}
|
68 |
+
|
69 |
+
&.fs-error {
|
70 |
+
.fs-modal-header {
|
71 |
+
border-bottom-color: $wp-notice-error-dark-color;
|
72 |
+
}
|
73 |
+
|
74 |
+
.fs-modal-body {
|
75 |
+
background-color: $wp-notice-error-color;
|
76 |
+
}
|
77 |
+
}
|
78 |
+
|
79 |
+
|
80 |
+
.fs-modal-body,
|
81 |
+
.fs-modal-footer {
|
82 |
+
border: 0;
|
83 |
+
background: #fefefe;
|
84 |
+
padding: 20px;
|
85 |
+
}
|
86 |
+
|
87 |
+
.fs-modal-header {
|
88 |
+
border-bottom: #eeeeee solid 1px;
|
89 |
+
background: #fbfbfb;
|
90 |
+
padding: 15px 20px;
|
91 |
+
position: relative;
|
92 |
+
margin-bottom: -10px;
|
93 |
+
// z-index: 2;
|
94 |
+
|
95 |
+
h4 {
|
96 |
+
margin: 0;
|
97 |
+
padding: 0;
|
98 |
+
text-transform: uppercase;
|
99 |
+
font-size: 1.2em;
|
100 |
+
font-weight: bold;
|
101 |
+
color: #cacaca;
|
102 |
+
text-shadow: 1px 1px 1px #fff;
|
103 |
+
letter-spacing: 0.6px;
|
104 |
+
-webkit-font-smoothing: antialiased;
|
105 |
+
}
|
106 |
+
|
107 |
+
.fs-close {
|
108 |
+
position: absolute;
|
109 |
+
right: 10px;
|
110 |
+
top: 12px;
|
111 |
+
cursor: pointer;
|
112 |
+
color: #bbb;
|
113 |
+
@include border-radius(20px);
|
114 |
+
padding: 3px;
|
115 |
+
@include transition(all 0.2s ease-in-out);
|
116 |
+
|
117 |
+
&:hover {
|
118 |
+
color: #fff;
|
119 |
+
background: #aaa;
|
120 |
+
}
|
121 |
+
}
|
122 |
+
}
|
123 |
+
|
124 |
+
.fs-modal-body {
|
125 |
+
border-bottom: 0;
|
126 |
+
|
127 |
+
p {
|
128 |
+
font-size: 14px;
|
129 |
+
}
|
130 |
+
|
131 |
+
h2 {
|
132 |
+
font-size: 20px;
|
133 |
+
line-height: 1.5em;
|
134 |
+
}
|
135 |
+
|
136 |
+
> div {
|
137 |
+
margin-top: 10px;
|
138 |
+
|
139 |
+
h2 {
|
140 |
+
font-weight: bold;
|
141 |
+
font-size: 20px;
|
142 |
+
margin-top: 0;
|
143 |
+
}
|
144 |
+
}
|
145 |
+
}
|
146 |
+
|
147 |
+
.fs-modal-footer {
|
148 |
+
border-top: #eeeeee solid 1px;
|
149 |
+
text-align: right;
|
150 |
+
|
151 |
+
> .button {
|
152 |
+
margin: 0 7px;
|
153 |
+
|
154 |
+
&:first-child {
|
155 |
+
margin: 0;
|
156 |
+
}
|
157 |
+
}
|
158 |
+
}
|
159 |
+
|
160 |
+
.fs-modal-panel {
|
161 |
+
> .notice.inline {
|
162 |
+
margin: 0;
|
163 |
+
display: none;
|
164 |
+
}
|
165 |
+
|
166 |
+
&:not(.active) {
|
167 |
+
display: none;
|
168 |
+
}
|
169 |
+
}
|
170 |
+
}
|
171 |
+
|
172 |
+
.rtl
|
173 |
+
{
|
174 |
+
.fs-modal {
|
175 |
+
.fs-modal-header {
|
176 |
+
.fs-close {
|
177 |
+
right: auto;
|
178 |
+
left: 20px;
|
179 |
+
}
|
180 |
+
}
|
181 |
+
}
|
182 |
+
}
|
183 |
+
|
184 |
+
body.has-fs-modal {
|
185 |
+
overflow: hidden;
|
186 |
+
}
|
freemius/assets/scss/admin/_themes.scss
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.theme-browser
|
2 |
+
{
|
3 |
+
.theme
|
4 |
+
{
|
5 |
+
.fs-premium-theme-badge
|
6 |
+
{
|
7 |
+
position: absolute;
|
8 |
+
top: 10px;
|
9 |
+
right: 0;
|
10 |
+
background: $fs-logo-green-color;
|
11 |
+
color: #fff;
|
12 |
+
text-transform: uppercase;
|
13 |
+
padding: 5px 10px;
|
14 |
+
@include border-radius(3px 0 0 3px);
|
15 |
+
font-weight: bold;
|
16 |
+
border-right: 0;
|
17 |
+
@include box-shadow(0 2px 1px -1px rgba(0, 0, 0, .3));
|
18 |
+
font-size: 1.1em;
|
19 |
+
}
|
20 |
+
}
|
21 |
+
}
|
freemius/assets/scss/admin/account.scss
ADDED
@@ -0,0 +1,256 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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.3em;
|
14 |
+
padding: 12px 15px;
|
15 |
+
margin: 0 0 12px 0;
|
16 |
+
line-height: 1.4;
|
17 |
+
border-bottom: 1px solid #F1F1F1;
|
18 |
+
|
19 |
+
.dashicons {
|
20 |
+
width: 26px;
|
21 |
+
height: 26px;
|
22 |
+
font-size: 1.3em;
|
23 |
+
}
|
24 |
+
}
|
25 |
+
|
26 |
+
i.dashicons
|
27 |
+
{
|
28 |
+
font-size: 1.2em;
|
29 |
+
height: 1.2em;
|
30 |
+
width: 1.2em;
|
31 |
+
}
|
32 |
+
|
33 |
+
.button
|
34 |
+
{
|
35 |
+
i.dashicons
|
36 |
+
{
|
37 |
+
vertical-align: middle;
|
38 |
+
}
|
39 |
+
}
|
40 |
+
|
41 |
+
.fs-header-actions
|
42 |
+
{
|
43 |
+
position: absolute;
|
44 |
+
top: 17px;
|
45 |
+
right: 15px;
|
46 |
+
font-size: 0.9em;
|
47 |
+
|
48 |
+
ul
|
49 |
+
{
|
50 |
+
margin: 0;
|
51 |
+
}
|
52 |
+
|
53 |
+
li
|
54 |
+
{
|
55 |
+
form
|
56 |
+
{
|
57 |
+
display: inline-block;
|
58 |
+
}
|
59 |
+
|
60 |
+
float: left;
|
61 |
+
a
|
62 |
+
{
|
63 |
+
text-decoration: none;
|
64 |
+
}
|
65 |
+
}
|
66 |
+
}
|
67 |
+
}
|
68 |
+
|
69 |
+
#fs_account_details .button-group {
|
70 |
+
float: right;
|
71 |
+
}
|
72 |
+
|
73 |
+
.rtl #fs_account .fs-header-actions
|
74 |
+
{
|
75 |
+
left: 15px;
|
76 |
+
right: auto;
|
77 |
+
}
|
78 |
+
|
79 |
+
.fs-key-value-table
|
80 |
+
{
|
81 |
+
width: 100%;
|
82 |
+
|
83 |
+
form
|
84 |
+
{
|
85 |
+
display: inline-block;
|
86 |
+
}
|
87 |
+
|
88 |
+
tr
|
89 |
+
{
|
90 |
+
td:first-child
|
91 |
+
{
|
92 |
+
nobr
|
93 |
+
{
|
94 |
+
font-weight: bold;
|
95 |
+
}
|
96 |
+
|
97 |
+
text-align: right;
|
98 |
+
|
99 |
+
form
|
100 |
+
{
|
101 |
+
display: block;
|
102 |
+
}
|
103 |
+
}
|
104 |
+
|
105 |
+
td.fs-right
|
106 |
+
{
|
107 |
+
text-align: right;
|
108 |
+
}
|
109 |
+
|
110 |
+
&.fs-odd
|
111 |
+
{
|
112 |
+
background: #ebebeb;
|
113 |
+
}
|
114 |
+
}
|
115 |
+
|
116 |
+
td, th
|
117 |
+
{
|
118 |
+
padding: 10px;
|
119 |
+
}
|
120 |
+
|
121 |
+
code {
|
122 |
+
line-height: 28px;
|
123 |
+
}
|
124 |
+
|
125 |
+
var, code, input[type="text"]
|
126 |
+
{
|
127 |
+
color: #0073AA;
|
128 |
+
font-size: 16px;
|
129 |
+
background: none;
|
130 |
+
}
|
131 |
+
|
132 |
+
input[type="text"] {
|
133 |
+
width: 100%;
|
134 |
+
font-weight: bold;
|
135 |
+
}
|
136 |
+
}
|
137 |
+
|
138 |
+
label.fs-tag
|
139 |
+
{
|
140 |
+
background: #ffba00;
|
141 |
+
color: #fff;
|
142 |
+
display: inline-block;
|
143 |
+
border-radius: 3px;
|
144 |
+
padding: 5px;
|
145 |
+
font-size: 11px;
|
146 |
+
line-height: 11px;
|
147 |
+
vertical-align: baseline;
|
148 |
+
|
149 |
+
&.fs-warn
|
150 |
+
{
|
151 |
+
background: #ffba00;
|
152 |
+
}
|
153 |
+
&.fs-success
|
154 |
+
{
|
155 |
+
background: #46b450;
|
156 |
+
}
|
157 |
+
&.fs-error
|
158 |
+
{
|
159 |
+
background: #dc3232;
|
160 |
+
}
|
161 |
+
}
|
162 |
+
|
163 |
+
#fs_addons
|
164 |
+
{
|
165 |
+
h3
|
166 |
+
{
|
167 |
+
border: none;
|
168 |
+
margin-bottom: 0;
|
169 |
+
padding: 4px 5px;
|
170 |
+
}
|
171 |
+
|
172 |
+
td
|
173 |
+
{
|
174 |
+
vertical-align: middle;
|
175 |
+
}
|
176 |
+
|
177 |
+
thead {
|
178 |
+
white-space: nowrap;
|
179 |
+
}
|
180 |
+
|
181 |
+
td:first-child,
|
182 |
+
th:first-child
|
183 |
+
{
|
184 |
+
text-align: left;
|
185 |
+
font-weight: bold;
|
186 |
+
}
|
187 |
+
td:last-child,
|
188 |
+
th:last-child
|
189 |
+
{
|
190 |
+
text-align: right;
|
191 |
+
}
|
192 |
+
th
|
193 |
+
{
|
194 |
+
font-weight: bold;
|
195 |
+
}
|
196 |
+
}
|
197 |
+
|
198 |
+
#fs_billing_address {
|
199 |
+
width: 100%;
|
200 |
+
|
201 |
+
tr {
|
202 |
+
td {
|
203 |
+
width: 50%;
|
204 |
+
padding: 5px;
|
205 |
+
}
|
206 |
+
|
207 |
+
&:first-of-type {
|
208 |
+
td {
|
209 |
+
padding-top: 0;
|
210 |
+
}
|
211 |
+
}
|
212 |
+
}
|
213 |
+
|
214 |
+
@mixin read-mode {
|
215 |
+
border-color: transparent;
|
216 |
+
color: #777;
|
217 |
+
border-bottom: 1px dashed #ccc;
|
218 |
+
padding-left: 0;
|
219 |
+
background: none;
|
220 |
+
}
|
221 |
+
|
222 |
+
span {
|
223 |
+
font-weight: bold;
|
224 |
+
}
|
225 |
+
|
226 |
+
input, select {
|
227 |
+
@include placeholder(transparent);
|
228 |
+
|
229 |
+
display: block;
|
230 |
+
width: 100%;
|
231 |
+
margin-top: 5px;
|
232 |
+
|
233 |
+
&.fs-read-mode {
|
234 |
+
@include read-mode();
|
235 |
+
}
|
236 |
+
}
|
237 |
+
|
238 |
+
|
239 |
+
&.fs-read-mode {
|
240 |
+
td span {
|
241 |
+
display: none;
|
242 |
+
}
|
243 |
+
|
244 |
+
input, select
|
245 |
+
{
|
246 |
+
@include read-mode();
|
247 |
+
@include placeholder(#ccc);
|
248 |
+
}
|
249 |
+
}
|
250 |
+
|
251 |
+
|
252 |
+
button {
|
253 |
+
display: block;
|
254 |
+
width: 100%;
|
255 |
+
}
|
256 |
+
}
|
freemius/assets/scss/admin/add-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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
@import "../start";
|
2 |
+
|
3 |
+
#fs_addons
|
4 |
+
{
|
5 |
+
.fs-cards-list
|
6 |
+
{
|
7 |
+
list-style: none;
|
8 |
+
|
9 |
+
.fs-card
|
10 |
+
{
|
11 |
+
float: left;
|
12 |
+
// height: 185px; // With reviews/ratings
|
13 |
+
height: 152px;
|
14 |
+
width: 310px;
|
15 |
+
padding: 0;
|
16 |
+
margin: 0 0 30px 30px;
|
17 |
+
font-size: 14px;
|
18 |
+
list-style: none;
|
19 |
+
border: 1px solid #ddd;
|
20 |
+
cursor: pointer;
|
21 |
+
position: relative;
|
22 |
+
|
23 |
+
.fs-overlay
|
24 |
+
{
|
25 |
+
position: absolute;
|
26 |
+
left: 0;
|
27 |
+
right: 0;
|
28 |
+
bottom: 0;
|
29 |
+
top: 0;
|
30 |
+
z-index: 9;
|
31 |
+
}
|
32 |
+
|
33 |
+
.fs-inner
|
34 |
+
{
|
35 |
+
background-color: #fff;
|
36 |
+
overflow: hidden;
|
37 |
+
height: 100%;
|
38 |
+
position: relative;
|
39 |
+
|
40 |
+
ul
|
41 |
+
{
|
42 |
+
@include transition(all, 0.15s);
|
43 |
+
left: 0;
|
44 |
+
right: 0;
|
45 |
+
top: 0;
|
46 |
+
position: absolute;
|
47 |
+
}
|
48 |
+
|
49 |
+
li
|
50 |
+
{
|
51 |
+
list-style: none;
|
52 |
+
line-height: 18px;
|
53 |
+
padding: 0 15px;
|
54 |
+
width: 100%;
|
55 |
+
display: block;
|
56 |
+
@include box-sizing(border-box);
|
57 |
+
}
|
58 |
+
|
59 |
+
.fs-card-banner
|
60 |
+
{
|
61 |
+
padding: 0;
|
62 |
+
margin: 0;
|
63 |
+
line-height: 0;
|
64 |
+
display: block;
|
65 |
+
height: 100px;
|
66 |
+
background-repeat: repeat-x;
|
67 |
+
background-size: 100% 100%;
|
68 |
+
@include transition(all, 0.15s);
|
69 |
+
}
|
70 |
+
|
71 |
+
.fs-title
|
72 |
+
{
|
73 |
+
margin: 10px 0 0 0;
|
74 |
+
height: 18px;
|
75 |
+
overflow: hidden;
|
76 |
+
color: #000;
|
77 |
+
white-space: nowrap;
|
78 |
+
text-overflow: ellipsis;
|
79 |
+
font-weight: bold;
|
80 |
+
}
|
81 |
+
|
82 |
+
.fs-offer
|
83 |
+
{
|
84 |
+
font-size: 0.9em;
|
85 |
+
}
|
86 |
+
|
87 |
+
.fs-description
|
88 |
+
{
|
89 |
+
background-color: #f9f9f9;
|
90 |
+
padding: 10px 15px 100px 15px;
|
91 |
+
border-top: 1px solid #eee;
|
92 |
+
margin: 0 0 10px 0;
|
93 |
+
color: #777;
|
94 |
+
}
|
95 |
+
|
96 |
+
.fs-tag
|
97 |
+
{
|
98 |
+
position: absolute;
|
99 |
+
top: 10px;
|
100 |
+
right: 0px;
|
101 |
+
background: greenyellow;
|
102 |
+
display: block;
|
103 |
+
padding: 2px 10px;
|
104 |
+
@include box-shadow(1px 1px 1px rgba(0,0,0,0.3));
|
105 |
+
text-transform: uppercase;
|
106 |
+
font-size: 0.9em;
|
107 |
+
font-weight: bold;
|
108 |
+
}
|
109 |
+
|
110 |
+
.fs-cta
|
111 |
+
{
|
112 |
+
.button
|
113 |
+
{
|
114 |
+
position: absolute;
|
115 |
+
top: 112px;
|
116 |
+
right: 10px;
|
117 |
+
}
|
118 |
+
}
|
119 |
+
}
|
120 |
+
|
121 |
+
@media screen and (min-width: 960px) {
|
122 |
+
&:hover
|
123 |
+
{
|
124 |
+
.fs-overlay
|
125 |
+
{
|
126 |
+
border: 2px solid $fms-link-color;
|
127 |
+
margin-left: -1px;
|
128 |
+
margin-top: -1px;
|
129 |
+
}
|
130 |
+
|
131 |
+
.fs-inner
|
132 |
+
{
|
133 |
+
ul
|
134 |
+
{
|
135 |
+
top: -100px;
|
136 |
+
}
|
137 |
+
|
138 |
+
.fs-card-banner
|
139 |
+
{
|
140 |
+
// background-position: 50% -100px;
|
141 |
+
}
|
142 |
+
|
143 |
+
.fs-title,
|
144 |
+
.fs-offer
|
145 |
+
{
|
146 |
+
color: $fms-link-color;
|
147 |
+
}
|
148 |
+
}
|
149 |
+
}
|
150 |
+
}
|
151 |
+
}
|
152 |
+
}
|
153 |
+
}
|
154 |
+
|
155 |
+
#TB_window
|
156 |
+
{
|
157 |
+
&, iframe
|
158 |
+
{
|
159 |
+
width: 772px !important;
|
160 |
+
}
|
161 |
+
}
|
162 |
+
|
163 |
+
#plugin-information
|
164 |
+
{
|
165 |
+
#section-description
|
166 |
+
{
|
167 |
+
h2, h3, p, b, i, blockquote, li, ul, ol
|
168 |
+
{
|
169 |
+
clear: none;
|
170 |
+
}
|
171 |
+
|
172 |
+
.fs-selling-points
|
173 |
+
{
|
174 |
+
padding-bottom: 10px;
|
175 |
+
border-bottom: 1px solid #ddd;
|
176 |
+
|
177 |
+
ul
|
178 |
+
{
|
179 |
+
margin: 0;
|
180 |
+
|
181 |
+
li
|
182 |
+
{
|
183 |
+
padding: 0;
|
184 |
+
list-style: none outside none;
|
185 |
+
|
186 |
+
i.dashicons
|
187 |
+
{
|
188 |
+
color: $fs-logo-green-color;
|
189 |
+
font-size: 3em;
|
190 |
+
vertical-align: middle;
|
191 |
+
line-height: 30px;
|
192 |
+
float: left;
|
193 |
+
margin: 0 0 0 -15px;
|
194 |
+
}
|
195 |
+
|
196 |
+
h3
|
197 |
+
{
|
198 |
+
margin: 1em 30px !important;
|
199 |
+
}
|
200 |
+
}
|
201 |
+
}
|
202 |
+
}
|
203 |
+
|
204 |
+
.fs-screenshots
|
205 |
+
{
|
206 |
+
@include clearfix();
|
207 |
+
ul
|
208 |
+
{
|
209 |
+
list-style: none;
|
210 |
+
margin: 0;
|
211 |
+
|
212 |
+
li
|
213 |
+
{
|
214 |
+
width: 225px;
|
215 |
+
height: 225px;
|
216 |
+
float: left;
|
217 |
+
margin-bottom: 20px;
|
218 |
+
@include box-sizing(content-box);
|
219 |
+
|
220 |
+
a
|
221 |
+
{
|
222 |
+
display: block;
|
223 |
+
width: 100%;
|
224 |
+
height: 100%;
|
225 |
+
border: 1px solid;
|
226 |
+
@include box-shadow(1px 1px 1px rgba(0, 0, 0, 0.2));
|
227 |
+
background-size: cover;
|
228 |
+
}
|
229 |
+
|
230 |
+
&.odd
|
231 |
+
{
|
232 |
+
margin-right: 20px;
|
233 |
+
}
|
234 |
+
}
|
235 |
+
}
|
236 |
+
}
|
237 |
+
}
|
238 |
+
|
239 |
+
.plugin-information-pricing
|
240 |
+
{
|
241 |
+
$pricing_color: #FFFEEC;
|
242 |
+
$borders_color: #DDD;
|
243 |
+
margin: -16px;
|
244 |
+
// padding: 20px;
|
245 |
+
border-bottom: 1px solid $borders_color;
|
246 |
+
|
247 |
+
.fs-plan
|
248 |
+
{
|
249 |
+
|
250 |
+
h3
|
251 |
+
{
|
252 |
+
margin-top: 0;
|
253 |
+
padding: 20px;
|
254 |
+
font-size: 16px;
|
255 |
+
}
|
256 |
+
|
257 |
+
.nav-tab-wrapper
|
258 |
+
{
|
259 |
+
border-bottom: 1px solid $borders_color;
|
260 |
+
|
261 |
+
.nav-tab
|
262 |
+
{
|
263 |
+
cursor: pointer;
|
264 |
+
position: relative;
|
265 |
+
padding: 0 10px;
|
266 |
+
font-size: 0.9em;
|
267 |
+
|
268 |
+
label
|
269 |
+
{
|
270 |
+
text-transform: uppercase;
|
271 |
+
color: green;
|
272 |
+
background: greenyellow;
|
273 |
+
position: absolute;
|
274 |
+
left: -1px;
|
275 |
+
right: -1px;
|
276 |
+
bottom: 100%;
|
277 |
+
border: 1px solid darkgreen;
|
278 |
+
padding: 2px;
|
279 |
+
text-align: center;
|
280 |
+
font-size: 0.9em;
|
281 |
+
line-height: 1em;
|
282 |
+
}
|
283 |
+
|
284 |
+
&.nav-tab-active
|
285 |
+
{
|
286 |
+
cursor: default;
|
287 |
+
background: $pricing_color;
|
288 |
+
border-bottom-color: $pricing_color;
|
289 |
+
}
|
290 |
+
}
|
291 |
+
}
|
292 |
+
|
293 |
+
&.fs-single-cycle
|
294 |
+
{
|
295 |
+
h3
|
296 |
+
{
|
297 |
+
background: $pricing_color;
|
298 |
+
margin: 0;
|
299 |
+
padding-bottom: 0;
|
300 |
+
color: #0073aa;
|
301 |
+
}
|
302 |
+
|
303 |
+
.nav-tab-wrapper,
|
304 |
+
.fs-billing-frequency
|
305 |
+
{
|
306 |
+
display: none;
|
307 |
+
}
|
308 |
+
}
|
309 |
+
|
310 |
+
.fs-pricing-body
|
311 |
+
{
|
312 |
+
background: $pricing_color;
|
313 |
+
padding: 20px;
|
314 |
+
}
|
315 |
+
|
316 |
+
.button
|
317 |
+
{
|
318 |
+
width: 100%;
|
319 |
+
text-align: center;
|
320 |
+
font-weight: bold;
|
321 |
+
text-transform: uppercase;
|
322 |
+
font-size: 1.1em;
|
323 |
+
}
|
324 |
+
|
325 |
+
label
|
326 |
+
{
|
327 |
+
white-space: nowrap;
|
328 |
+
}
|
329 |
+
|
330 |
+
var {
|
331 |
+
font-style: normal;
|
332 |
+
}
|
333 |
+
|
334 |
+
.fs-billing-frequency,
|
335 |
+
.fs-annual-discount
|
336 |
+
{
|
337 |
+
text-align: center;
|
338 |
+
display: block;
|
339 |
+
font-weight: bold;
|
340 |
+
margin-bottom: 10px;
|
341 |
+
text-transform: uppercase;
|
342 |
+
background: #F3F3F3;
|
343 |
+
padding: 2px;
|
344 |
+
border: 1px solid #ccc;
|
345 |
+
}
|
346 |
+
|
347 |
+
.fs-annual-discount
|
348 |
+
{
|
349 |
+
text-transform: none;
|
350 |
+
color: green;
|
351 |
+
background: greenyellow;
|
352 |
+
}
|
353 |
+
|
354 |
+
ul.fs-trial-terms
|
355 |
+
{
|
356 |
+
font-size: 0.9em;
|
357 |
+
|
358 |
+
i
|
359 |
+
{
|
360 |
+
float: left;
|
361 |
+
margin: 0 0 0 -15px;
|
362 |
+
}
|
363 |
+
|
364 |
+
li
|
365 |
+
{
|
366 |
+
margin: 10px 0 0 0;
|
367 |
+
}
|
368 |
+
}
|
369 |
+
}
|
370 |
+
}
|
371 |
+
|
372 |
+
#section-features
|
373 |
+
{
|
374 |
+
.fs-features
|
375 |
+
{
|
376 |
+
margin: -20px -26px;
|
377 |
+
}
|
378 |
+
|
379 |
+
table
|
380 |
+
{
|
381 |
+
width: 100%;
|
382 |
+
border-spacing: 0;
|
383 |
+
border-collapse: separate;
|
384 |
+
|
385 |
+
thead
|
386 |
+
{
|
387 |
+
th
|
388 |
+
{
|
389 |
+
padding: 10px 0;
|
390 |
+
}
|
391 |
+
|
392 |
+
.fs-price
|
393 |
+
{
|
394 |
+
color: $fs-logo-green-color;
|
395 |
+
font-weight: normal;
|
396 |
+
display: block;
|
397 |
+
text-align: center;
|
398 |
+
}
|
399 |
+
}
|
400 |
+
|
401 |
+
tbody
|
402 |
+
{
|
403 |
+
td
|
404 |
+
{
|
405 |
+
border-top: 1px solid #ccc;
|
406 |
+
padding: 10px 0;
|
407 |
+
text-align: center;
|
408 |
+
width: 100px;
|
409 |
+
color: $fs-logo-green-color;
|
410 |
+
|
411 |
+
&:first-child
|
412 |
+
{
|
413 |
+
text-align: left;
|
414 |
+
width: auto;
|
415 |
+
color: inherit;
|
416 |
+
padding-left: 26px;
|
417 |
+
}
|
418 |
+
}
|
419 |
+
tr.fs-odd
|
420 |
+
{
|
421 |
+
td
|
422 |
+
{
|
423 |
+
background: #fefefe;
|
424 |
+
}
|
425 |
+
}
|
426 |
+
}
|
427 |
+
}
|
428 |
+
|
429 |
+
.dashicons-yes
|
430 |
+
{
|
431 |
+
width: 30px;
|
432 |
+
height: 30px;
|
433 |
+
font-size: 30px;
|
434 |
+
}
|
435 |
+
}
|
436 |
+
}
|
437 |
+
|
438 |
+
@media screen and (max-width: 961px) {
|
439 |
+
#fs_addons
|
440 |
+
{
|
441 |
+
.fs-cards-list
|
442 |
+
{
|
443 |
+
.fs-card
|
444 |
+
{
|
445 |
+
height: 265px;
|
446 |
+
}
|
447 |
+
}
|
448 |
+
}
|
449 |
+
}
|
freemius/assets/scss/admin/checkout.scss
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
@media screen and (max-width: 782px) {
|
2 |
+
#wpbody-content {
|
3 |
+
padding-bottom: 0 !important;
|
4 |
+
}
|
5 |
+
}
|
freemius/assets/scss/admin/common.scss
ADDED
@@ -0,0 +1,218 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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18 |
+
|
19 |
+
.fs-notice
|
20 |
+
{
|
21 |
+
position: relative;
|
22 |
+
|
23 |
+
&.fs-has-title
|
24 |
+
{
|
25 |
+
margin-bottom: 30px !important;
|
26 |
+
}
|
27 |
+
|
28 |
+
&.success
|
29 |
+
{
|
30 |
+
color: green;
|
31 |
+
// font-weight: normal;
|
32 |
+
}
|
33 |
+
|
34 |
+
&.promotion
|
35 |
+
{
|
36 |
+
border-color: $fs-notice-promotion-border-color !important;
|
37 |
+
background-color: $fs-notice-promotion-bkg !important;
|
38 |
+
}
|
39 |
+
|
40 |
+
.fs-notice-body
|
41 |
+
{
|
42 |
+
margin: .5em 0;
|
43 |
+
padding: 2px;
|
44 |
+
}
|
45 |
+
|
46 |
+
.fs-close
|
47 |
+
{
|
48 |
+
// position: absolute;
|
49 |
+
// top: 2px;
|
50 |
+
// bottom: 2px;
|
51 |
+
// right: 2px;
|
52 |
+
// min-width: 100px;
|
53 |
+
// text-align: center;
|
54 |
+
// padding-right: 2px;
|
55 |
+
cursor: pointer;
|
56 |
+
color: #aaa;
|
57 |
+
float: right;
|
58 |
+
|
59 |
+
&:hover
|
60 |
+
{
|
61 |
+
color: #666;
|
62 |
+
// background: #A9A9A9;
|
63 |
+
}
|
64 |
+
|
65 |
+
> *
|
66 |
+
{
|
67 |
+
margin-top: 7px;
|
68 |
+
display: inline-block;
|
69 |
+
}
|
70 |
+
}
|
71 |
+
|
72 |
+
label.fs-plugin-title
|
73 |
+
{
|
74 |
+
background: rgba(0, 0, 0, 0.3);
|
75 |
+
color: #fff;
|
76 |
+
padding: 2px 10px;
|
77 |
+
position: absolute;
|
78 |
+
top: 100%;
|
79 |
+
bottom: auto;
|
80 |
+
right: auto;
|
81 |
+
@include border-radius(0 0 3px 3px);
|
82 |
+
left: 10px;
|
83 |
+
font-size: 12px;
|
84 |
+
font-weight: bold;
|
85 |
+
cursor: auto;
|
86 |
+
}
|
87 |
+
}
|
88 |
+
|
89 |
+
div.fs-notice
|
90 |
+
{
|
91 |
+
&.updated,
|
92 |
+
&.success,
|
93 |
+
&.promotion
|
94 |
+
{
|
95 |
+
display: block !important;
|
96 |
+
}
|
97 |
+
}
|
98 |
+
|
99 |
+
.rtl .fs-notice
|
100 |
+
{
|
101 |
+
.fs-close
|
102 |
+
{
|
103 |
+
// left: 2px;
|
104 |
+
// right: auto;
|
105 |
+
// padding-right: 0;
|
106 |
+
// padding-left: 2px;
|
107 |
+
float: left;
|
108 |
+
}
|
109 |
+
}
|
110 |
+
|
111 |
+
.fs-secure-notice
|
112 |
+
{
|
113 |
+
position: fixed;
|
114 |
+
top: 32px;
|
115 |
+
left: 160px;
|
116 |
+
right: 0;
|
117 |
+
background: rgb(235, 253, 235);
|
118 |
+
padding: 10px 20px;
|
119 |
+
color: green;
|
120 |
+
z-index: 9999;
|
121 |
+
@include box-shadow(0 2px 2px rgba(6, 113, 6, 0.3));
|
122 |
+
@include opacity(0.95);
|
123 |
+
|
124 |
+
&:hover
|
125 |
+
{
|
126 |
+
@include opacity(1);
|
127 |
+
}
|
128 |
+
|
129 |
+
a.fs-security-proof
|
130 |
+
{
|
131 |
+
color: green;
|
132 |
+
text-decoration: none;
|
133 |
+
}
|
134 |
+
}
|
135 |
+
|
136 |
+
@media screen and (max-width: 960px) {
|
137 |
+
.fs-secure-notice
|
138 |
+
{
|
139 |
+
left: 36px;
|
140 |
+
}
|
141 |
+
}
|
142 |
+
|
143 |
+
@media screen and (max-width: 600px) {
|
144 |
+
.fs-secure-notice
|
145 |
+
{
|
146 |
+
display: none;
|
147 |
+
}
|
148 |
+
}
|
149 |
+
|
150 |
+
@media screen and (max-width: 500px) {
|
151 |
+
#fs_promo_tab
|
152 |
+
{
|
153 |
+
display: none;
|
154 |
+
}
|
155 |
+
}
|
156 |
+
|
157 |
+
@media screen and (max-width: 782px) {
|
158 |
+
.fs-secure-notice
|
159 |
+
{
|
160 |
+
left: 0;
|
161 |
+
top: 46px;
|
162 |
+
text-align: center;
|
163 |
+
}
|
164 |
+
}
|
165 |
+
|
166 |
+
span.fs-submenu-item.fs-sub:before
|
167 |
+
{
|
168 |
+
// Add small arrow.
|
169 |
+
content: '\21B3';
|
170 |
+
padding: 0 5px;
|
171 |
+
}
|
172 |
+
|
173 |
+
.rtl
|
174 |
+
{
|
175 |
+
span.fs-submenu-item.fs-sub:before
|
176 |
+
{
|
177 |
+
// Add small RTL arrow.
|
178 |
+
content: '\21B2';
|
179 |
+
}
|
180 |
+
}
|
181 |
+
|
182 |
+
.fs-submenu-item
|
183 |
+
{
|
184 |
+
&.pricing
|
185 |
+
{
|
186 |
+
&.upgrade-mode
|
187 |
+
{
|
188 |
+
color: greenyellow;
|
189 |
+
}
|
190 |
+
|
191 |
+
&.trial-mode
|
192 |
+
{
|
193 |
+
color: #83e2ff;
|
194 |
+
}
|
195 |
+
}
|
196 |
+
}
|
197 |
+
|
198 |
+
#adminmenu .update-plugins.fs-trial
|
199 |
+
{
|
200 |
+
background-color: #00b9eb;
|
201 |
+
}
|
202 |
+
.fs-ajax-spinner
|
203 |
+
{
|
204 |
+
border: 0;
|
205 |
+
width: 20px;
|
206 |
+
height: 20px;
|
207 |
+
margin-right: 5px;
|
208 |
+
vertical-align: sub;
|
209 |
+
display: inline-block;
|
210 |
+
background: url('../../../../../../../wp-admin/images/wpspin_light-2x.gif');
|
211 |
+
background-size: contain;
|
212 |
+
}
|
213 |
+
|
214 |
+
.wrap.fs-section {
|
215 |
+
h2 {
|
216 |
+
text-align: left;
|
217 |
+
}
|
218 |
+
}
|
freemius/assets/scss/admin/connect.scss
ADDED
@@ -0,0 +1,520 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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_width - 1)) {
|
12 |
+
@include box-shadow(none);
|
13 |
+
width: auto;
|
14 |
+
margin: 0 0 0 -10px;
|
15 |
+
}
|
16 |
+
|
17 |
+
.fs-content
|
18 |
+
{
|
19 |
+
background: #fff;
|
20 |
+
padding: 15px 20px;
|
21 |
+
|
22 |
+
.fs-error {
|
23 |
+
background: snow;
|
24 |
+
color: $fs-logo-magenta-color;
|
25 |
+
border: 1px solid $fs-logo-magenta-color;
|
26 |
+
@include box-shadow(0 1px 1px 0 rgba(0,0,0,.1));
|
27 |
+
text-align: center;
|
28 |
+
padding: 5px;
|
29 |
+
margin-bottom: 10px;
|
30 |
+
}
|
31 |
+
|
32 |
+
p
|
33 |
+
{
|
34 |
+
margin: 0;
|
35 |
+
padding: 0;
|
36 |
+
font-size: 1.2em;
|
37 |
+
}
|
38 |
+
}
|
39 |
+
|
40 |
+
.fs-license-key-container {
|
41 |
+
position: relative;
|
42 |
+
width: 280px;
|
43 |
+
margin: 10px auto 0 auto;
|
44 |
+
|
45 |
+
input {
|
46 |
+
width: 100%;
|
47 |
+
}
|
48 |
+
|
49 |
+
.dashicons {
|
50 |
+
position: absolute;
|
51 |
+
top: 5px;
|
52 |
+
right: 5px;
|
53 |
+
}
|
54 |
+
}
|
55 |
+
|
56 |
+
.fs-actions
|
57 |
+
{
|
58 |
+
padding: 10px 20px;
|
59 |
+
background: #C0C7CA;
|
60 |
+
|
61 |
+
.button
|
62 |
+
{
|
63 |
+
padding: 0 10px 1px;
|
64 |
+
line-height: 35px;
|
65 |
+
height: 37px;
|
66 |
+
font-size: 16px;
|
67 |
+
margin-bottom: 0;
|
68 |
+
|
69 |
+
.dashicons
|
70 |
+
{
|
71 |
+
font-size: 37px;
|
72 |
+
margin-left: -8px;
|
73 |
+
margin-right: 12px;
|
74 |
+
}
|
75 |
+
|
76 |
+
&.button-primary
|
77 |
+
{
|
78 |
+
padding-right: 15px;
|
79 |
+
padding-left: 15px;
|
80 |
+
|
81 |
+
&:after
|
82 |
+
{
|
83 |
+
content: ' \279C';
|
84 |
+
}
|
85 |
+
|
86 |
+
&.fs-loading
|
87 |
+
{
|
88 |
+
&:after
|
89 |
+
{
|
90 |
+
content: '';
|
91 |
+
}
|
92 |
+
}
|
93 |
+
}
|
94 |
+
|
95 |
+
&.button-secondary
|
96 |
+
{
|
97 |
+
float: right;
|
98 |
+
}
|
99 |
+
}
|
100 |
+
|
101 |
+
// .fs-skip
|
102 |
+
// {
|
103 |
+
// line-height: 38px;
|
104 |
+
// vertical-align: middle;
|
105 |
+
// text-decoration: none;
|
106 |
+
// margin-left: 10px;
|
107 |
+
// }
|
108 |
+
}
|
109 |
+
|
110 |
+
&.fs-anonymous-disabled
|
111 |
+
{
|
112 |
+
.fs-actions
|
113 |
+
{
|
114 |
+
.button.button-primary
|
115 |
+
{
|
116 |
+
width: 100%;
|
117 |
+
}
|
118 |
+
}
|
119 |
+
}
|
120 |
+
|
121 |
+
.fs-permissions
|
122 |
+
{
|
123 |
+
padding: 10px 20px;
|
124 |
+
background: #FEFEFE;
|
125 |
+
// background: #F1F1F1;
|
126 |
+
@include transition(background 0.5s ease);
|
127 |
+
|
128 |
+
.fs-license-sync-disclaimer {
|
129 |
+
text-align: center;
|
130 |
+
margin-top: 0;
|
131 |
+
}
|
132 |
+
|
133 |
+
.fs-trigger
|
134 |
+
{
|
135 |
+
font-size: 0.9em;
|
136 |
+
text-decoration: none;
|
137 |
+
text-align: center;
|
138 |
+
display: block;
|
139 |
+
}
|
140 |
+
|
141 |
+
ul
|
142 |
+
{
|
143 |
+
height: 0;
|
144 |
+
overflow: hidden;
|
145 |
+
margin: 0;
|
146 |
+
|
147 |
+
li
|
148 |
+
{
|
149 |
+
margin-bottom: 12px;
|
150 |
+
|
151 |
+
&:last-child
|
152 |
+
{
|
153 |
+
margin-bottom: 0;
|
154 |
+
}
|
155 |
+
|
156 |
+
i.dashicons
|
157 |
+
{
|
158 |
+
float: left;
|
159 |
+
font-size: 40px;
|
160 |
+
width: 40px;
|
161 |
+
height: 40px;
|
162 |
+
}
|
163 |
+
|
164 |
+
div
|
165 |
+
{
|
166 |
+
margin-left: 55px;
|
167 |
+
|
168 |
+
span
|
169 |
+
{
|
170 |
+
font-weight: bold;
|
171 |
+
text-transform: uppercase;
|
172 |
+
color: #23282d;
|
173 |
+
}
|
174 |
+
|
175 |
+
p
|
176 |
+
{
|
177 |
+
margin: 2px 0 0 0;
|
178 |
+
}
|
179 |
+
}
|
180 |
+
}
|
181 |
+
}
|
182 |
+
|
183 |
+
&.fs-open
|
184 |
+
{
|
185 |
+
background: #fff;
|
186 |
+
|
187 |
+
ul
|
188 |
+
{
|
189 |
+
height: auto;
|
190 |
+
margin: 20px 20px 10px 20px;
|
191 |
+
}
|
192 |
+
}
|
193 |
+
|
194 |
+
@media screen and (max-width: ($form_width - 1)) {
|
195 |
+
background: #fff;
|
196 |
+
|
197 |
+
.fs-trigger
|
198 |
+
{
|
199 |
+
display: none;
|
200 |
+
}
|
201 |
+
|
202 |
+
ul
|
203 |
+
{
|
204 |
+
height: auto;
|
205 |
+
margin: 20px;
|
206 |
+
}
|
207 |
+
}
|
208 |
+
}
|
209 |
+
|
210 |
+
.fs-freemium-licensing {
|
211 |
+
padding: 8px;
|
212 |
+
// background: #0085BA;
|
213 |
+
background: #777;
|
214 |
+
color: #fff;
|
215 |
+
|
216 |
+
p {
|
217 |
+
text-align: center;
|
218 |
+
display: block;
|
219 |
+
margin: 0;
|
220 |
+
padding: 0;
|
221 |
+
}
|
222 |
+
|
223 |
+
a {
|
224 |
+
color: #C2EEFF;
|
225 |
+
text-decoration: underline;
|
226 |
+
}
|
227 |
+
}
|
228 |
+
|
229 |
+
$icon_size: 80px;
|
230 |
+
$wp_logo_padding: $icon_size / 10;
|
231 |
+
$icons_top: 10px;
|
232 |
+
|
233 |
+
.fs-visual
|
234 |
+
{
|
235 |
+
padding: 12px;
|
236 |
+
line-height: 0;
|
237 |
+
background: #fafafa;
|
238 |
+
height: $icon_size;
|
239 |
+
position: relative;
|
240 |
+
|
241 |
+
.fs-site-icon
|
242 |
+
{
|
243 |
+
position: absolute;
|
244 |
+
left: 20px;
|
245 |
+
top: $icons_top;
|
246 |
+
}
|
247 |
+
|
248 |
+
.fs-connect-logo
|
249 |
+
{
|
250 |
+
position: absolute;
|
251 |
+
right: 20px;
|
252 |
+
top: $icons_top;
|
253 |
+
}
|
254 |
+
|
255 |
+
.fs-plugin-icon
|
256 |
+
{
|
257 |
+
position: absolute;
|
258 |
+
top: $icons_top;
|
259 |
+
left: 50%;
|
260 |
+
margin-left: - ($icon_size / 2);
|
261 |
+
}
|
262 |
+
|
263 |
+
.fs-plugin-icon,
|
264 |
+
.fs-site-icon,
|
265 |
+
img,
|
266 |
+
object
|
267 |
+
{
|
268 |
+
width: $icon_size;
|
269 |
+
height: $icon_size;
|
270 |
+
}
|
271 |
+
|
272 |
+
.dashicons-wordpress
|
273 |
+
{
|
274 |
+
font-size: $icon_size - ($wp_logo_padding * 2);
|
275 |
+
background: $wordpress_color;
|
276 |
+
color: #fff;
|
277 |
+
width: $icon_size - ($wp_logo_padding * 2);
|
278 |
+
height: $icon_size - ($wp_logo_padding * 2);
|
279 |
+
padding: $wp_logo_padding;
|
280 |
+
}
|
281 |
+
|
282 |
+
.dashicons-plus
|
283 |
+
{
|
284 |
+
position: absolute;
|
285 |
+
top: 50%;
|
286 |
+
font-size: 30px;
|
287 |
+
margin-top: -10px;
|
288 |
+
color: #bbb;
|
289 |
+
|
290 |
+
&.fs-first
|
291 |
+
{
|
292 |
+
left: 28%;
|
293 |
+
}
|
294 |
+
&.fs-second
|
295 |
+
{
|
296 |
+
left: 65%;
|
297 |
+
}
|
298 |
+
}
|
299 |
+
|
300 |
+
.fs-plugin-icon,
|
301 |
+
.fs-connect-logo,
|
302 |
+
.fs-site-icon
|
303 |
+
{
|
304 |
+
border: 1px solid #ccc;
|
305 |
+
padding: 1px;
|
306 |
+
background: #fff;
|
307 |
+
}
|
308 |
+
}
|
309 |
+
|
310 |
+
.fs-terms
|
311 |
+
{
|
312 |
+
text-align: center;
|
313 |
+
font-size: 0.85em;
|
314 |
+
padding: 5px;
|
315 |
+
background: rgba(0, 0, 0, 0.05);
|
316 |
+
|
317 |
+
&, a
|
318 |
+
{
|
319 |
+
color: #999;
|
320 |
+
}
|
321 |
+
|
322 |
+
a
|
323 |
+
{
|
324 |
+
text-decoration: none;
|
325 |
+
}
|
326 |
+
}
|
327 |
+
}
|
328 |
+
|
329 |
+
.rtl
|
330 |
+
{
|
331 |
+
#fs_connect
|
332 |
+
{
|
333 |
+
.fs-actions
|
334 |
+
{
|
335 |
+
padding: 10px 20px;
|
336 |
+
background: #C0C7CA;
|
337 |
+
|
338 |
+
.button
|
339 |
+
{
|
340 |
+
.dashicons
|
341 |
+
{
|
342 |
+
font-size: 37px;
|
343 |
+
margin-left: -8px;
|
344 |
+
margin-right: 12px;
|
345 |
+
}
|
346 |
+
|
347 |
+
&.button-primary
|
348 |
+
{
|
349 |
+
&:after
|
350 |
+
{
|
351 |
+
content: ' \000bb';
|
352 |
+
}
|
353 |
+
|
354 |
+
&.fs-loading
|
355 |
+
{
|
356 |
+
&:after
|
357 |
+
{
|
358 |
+
content: '';
|
359 |
+
}
|
360 |
+
}
|
361 |
+
}
|
362 |
+
|
363 |
+
&.button-secondary
|
364 |
+
{
|
365 |
+
float: left;
|
366 |
+
}
|
367 |
+
}
|
368 |
+
}
|
369 |
+
|
370 |
+
.fs-permissions
|
371 |
+
{
|
372 |
+
ul
|
373 |
+
{
|
374 |
+
li
|
375 |
+
{
|
376 |
+
div
|
377 |
+
{
|
378 |
+
margin-right: 55px;
|
379 |
+
margin-left: 0;
|
380 |
+
}
|
381 |
+
|
382 |
+
i.dashicons
|
383 |
+
{
|
384 |
+
float: right;
|
385 |
+
}
|
386 |
+
|
387 |
+
}
|
388 |
+
}
|
389 |
+
}
|
390 |
+
|
391 |
+
.fs-visual
|
392 |
+
{
|
393 |
+
.fs-site-icon
|
394 |
+
{
|
395 |
+
right: 20px;
|
396 |
+
left: auto;
|
397 |
+
}
|
398 |
+
|
399 |
+
.fs-connect-logo
|
400 |
+
{
|
401 |
+
right: auto;
|
402 |
+
left: 20px;
|
403 |
+
}
|
404 |
+
}
|
405 |
+
}
|
406 |
+
}
|
407 |
+
|
408 |
+
#fs_theme_connect_wrapper {
|
409 |
+
position: fixed;
|
410 |
+
top: 0;
|
411 |
+
height: 100%;
|
412 |
+
width: 100%;
|
413 |
+
z-index: 99990;
|
414 |
+
background: rgba(0, 0, 0, 0.75);
|
415 |
+
text-align: center;
|
416 |
+
overflow-y: auto;
|
417 |
+
|
418 |
+
&:before {
|
419 |
+
content: "";
|
420 |
+
display: inline-block;
|
421 |
+
vertical-align: middle;
|
422 |
+
height: 100%;
|
423 |
+
}
|
424 |
+
|
425 |
+
> button.close {
|
426 |
+
color: white;
|
427 |
+
cursor: pointer;
|
428 |
+
height: 40px;
|
429 |
+
width: 40px;
|
430 |
+
position: absolute;
|
431 |
+
right: 0;
|
432 |
+
border: 0;
|
433 |
+
background-color: transparent;
|
434 |
+
top: 32px;
|
435 |
+
}
|
436 |
+
|
437 |
+
#fs_connect {
|
438 |
+
top: 0;
|
439 |
+
text-align: left;
|
440 |
+
display: inline-block;
|
441 |
+
vertical-align: middle;
|
442 |
+
margin-top: 52px;
|
443 |
+
margin-bottom: 20px;
|
444 |
+
|
445 |
+
.fs-terms
|
446 |
+
{
|
447 |
+
background: rgba(140, 140, 140, 0.64);
|
448 |
+
|
449 |
+
&, a
|
450 |
+
{
|
451 |
+
color: #c5c5c5;
|
452 |
+
}
|
453 |
+
}
|
454 |
+
}
|
455 |
+
}
|
456 |
+
|
457 |
+
.wp-pointer-content
|
458 |
+
{
|
459 |
+
#fs_connect
|
460 |
+
{
|
461 |
+
margin: 0;
|
462 |
+
@include box-shadow(none);
|
463 |
+
}
|
464 |
+
}
|
465 |
+
|
466 |
+
.fs-opt-in-pointer
|
467 |
+
{
|
468 |
+
.wp-pointer-content
|
469 |
+
{
|
470 |
+
padding: 0;
|
471 |
+
}
|
472 |
+
|
473 |
+
&.wp-pointer-top
|
474 |
+
{
|
475 |
+
.wp-pointer-arrow
|
476 |
+
{
|
477 |
+
border-bottom-color: #dfdfdf;
|
478 |
+
}
|
479 |
+
.wp-pointer-arrow-inner
|
480 |
+
{
|
481 |
+
border-bottom-color: #fafafa;
|
482 |
+
}
|
483 |
+
}
|
484 |
+
|
485 |
+
&.wp-pointer-bottom
|
486 |
+
{
|
487 |
+
.wp-pointer-arrow
|
488 |
+
{
|
489 |
+
border-top-color: #dfdfdf;
|
490 |
+
}
|
491 |
+
.wp-pointer-arrow-inner
|
492 |
+
{
|
493 |
+
border-top-color: #fafafa;
|
494 |
+
}
|
495 |
+
}
|
496 |
+
|
497 |
+
&.wp-pointer-left
|
498 |
+
{
|
499 |
+
.wp-pointer-arrow
|
500 |
+
{
|
501 |
+
border-right-color: #dfdfdf;
|
502 |
+
}
|
503 |
+
.wp-pointer-arrow-inner
|
504 |
+
{
|
505 |
+
border-right-color: #fafafa;
|
506 |
+
}
|
507 |
+
}
|
508 |
+
|
509 |
+
&.wp-pointer-right
|
510 |
+
{
|
511 |
+
.wp-pointer-arrow
|
512 |
+
{
|
513 |
+
border-left-color: #dfdfdf;
|
514 |
+
}
|
515 |
+
.wp-pointer-arrow-inner
|
516 |
+
{
|
517 |
+
border-left-color: #fafafa;
|
518 |
+
}
|
519 |
+
}
|
520 |
+
}
|
freemius/assets/scss/admin/debug.scss
ADDED
@@ -0,0 +1,135 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
@import "../start";
|
2 |
+
|
3 |
+
.switch
|
4 |
+
{
|
5 |
+
position: relative;
|
6 |
+
display: inline-block;
|
7 |
+
font-size: 1.6em;
|
8 |
+
font-weight: bold;
|
9 |
+
color: #ccc;
|
10 |
+
text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.8);
|
11 |
+
height: 18px;
|
12 |
+
padding: 6px 6px 5px 6px;
|
13 |
+
border: 1px solid #ccc;
|
14 |
+
border: 1px solid rgba(0, 0, 0, 0.2);
|
15 |
+
border-radius: 4px;
|
16 |
+
background: #ececec;
|
17 |
+
box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.1), inset 0px 1px 3px 0px rgba(0, 0, 0, 0.1);
|
18 |
+
cursor: pointer;
|
19 |
+
|
20 |
+
span
|
21 |
+
{
|
22 |
+
display: inline-block; width: 35px;
|
23 |
+
text-transform: uppercase;
|
24 |
+
|
25 |
+
&.on
|
26 |
+
{
|
27 |
+
color: $button-primary-bkg;
|
28 |
+
}
|
29 |
+
}
|
30 |
+
|
31 |
+
.toggle
|
32 |
+
{
|
33 |
+
position: absolute;
|
34 |
+
top: 1px;
|
35 |
+
width: 37px;
|
36 |
+
height: 25px;
|
37 |
+
border: 1px solid #ccc;
|
38 |
+
border: 1px solid rgba(0, 0, 0, 0.3);
|
39 |
+
border-radius: 4px;
|
40 |
+
background: #fff;
|
41 |
+
background: -moz-linear-gradient(top, #ececec 0%, #fff 100%);
|
42 |
+
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #ececec), color-stop(100%, #fff));
|
43 |
+
background: -webkit-linear-gradient(top, #ececec 0%, #fff 100%);
|
44 |
+
background: -o-linear-gradient(top, #ececec 0%, #fff 100%);
|
45 |
+
background: -ms-linear-gradient(top, #ececec 0%, #fff 100%);
|
46 |
+
background: linear-gradient(top, #ececec 0%, #fff 100%);
|
47 |
+
box-shadow: inset 0px 1px 0px 0px rgba(255, 255, 255, 0.5);
|
48 |
+
z-index: 999;
|
49 |
+
@include transition(all 0.15s ease-in-out);
|
50 |
+
}
|
51 |
+
|
52 |
+
&.on .toggle
|
53 |
+
{
|
54 |
+
left: 2%;
|
55 |
+
}
|
56 |
+
&.off .toggle
|
57 |
+
{
|
58 |
+
left: 54%;
|
59 |
+
}
|
60 |
+
|
61 |
+
/* Round switch */
|
62 |
+
&.round
|
63 |
+
{
|
64 |
+
padding: 0px 20px;
|
65 |
+
border-radius: 40px;
|
66 |
+
|
67 |
+
.toggle
|
68 |
+
{
|
69 |
+
border-radius: 40px;
|
70 |
+
width: 14px;
|
71 |
+
height: 14px;
|
72 |
+
}
|
73 |
+
|
74 |
+
&.on .toggle
|
75 |
+
{
|
76 |
+
left: 3%;
|
77 |
+
background: $button-primary-bkg;
|
78 |
+
}
|
79 |
+
&.off .toggle
|
80 |
+
{
|
81 |
+
left: 58%;
|
82 |
+
}
|
83 |
+
}
|
84 |
+
}
|
85 |
+
|
86 |
+
.switch-label
|
87 |
+
{
|
88 |
+
font-size: 20px;
|
89 |
+
line-height: 31px;
|
90 |
+
margin: 0 5px;
|
91 |
+
}
|
92 |
+
|
93 |
+
#fs_log_book {
|
94 |
+
table {
|
95 |
+
font-family: Consolas,Monaco,monospace;
|
96 |
+
font-size: 12px;
|
97 |
+
|
98 |
+
th {
|
99 |
+
color: #ccc;
|
100 |
+
}
|
101 |
+
|
102 |
+
tr {
|
103 |
+
background: #232525;
|
104 |
+
|
105 |
+
&.alternate {
|
106 |
+
background: #2b2b2b;
|
107 |
+
}
|
108 |
+
|
109 |
+
td {
|
110 |
+
&.fs-col--logger {
|
111 |
+
color: #5a7435;
|
112 |
+
}
|
113 |
+
&.fs-col--type {
|
114 |
+
color: #ffc861;
|
115 |
+
}
|
116 |
+
&.fs-col--function {
|
117 |
+
color: #a7b7b1;
|
118 |
+
font-weight: bold;
|
119 |
+
}
|
120 |
+
&.fs-col--message {
|
121 |
+
&, a
|
122 |
+
{
|
123 |
+
color: #9a73ac !important;
|
124 |
+
}
|
125 |
+
}
|
126 |
+
&.fs-col--file {
|
127 |
+
color: #d07922;
|
128 |
+
}
|
129 |
+
&.fs-col--timestamp {
|
130 |
+
color: #6596be;
|
131 |
+
}
|
132 |
+
}
|
133 |
+
}
|
134 |
+
}
|
135 |
+
}
|
freemius/assets/scss/admin/dialog-boxes.scss
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
@import "../start";
|
2 |
+
@import "modal-common";
|
3 |
+
@import "deactivation-feedback";
|
4 |
+
@import "license-activation";
|
5 |
+
@import "license-key-resend";
|
6 |
+
@import "ajax-loader";
|
7 |
+
@import "auto-install";
|
freemius/assets/scss/customizer.scss
ADDED
@@ -0,0 +1,125 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
@import "start";
|
2 |
+
|
3 |
+
#fs_customizer_upsell {
|
4 |
+
.fs-customizer-plan {
|
5 |
+
padding: 10px 20px 20px 20px;
|
6 |
+
border-radius: 3px;
|
7 |
+
background: #fff;
|
8 |
+
|
9 |
+
h2 {
|
10 |
+
position: relative;
|
11 |
+
margin: 0;
|
12 |
+
line-height: 2em;
|
13 |
+
text-transform: uppercase;
|
14 |
+
|
15 |
+
.button-link {
|
16 |
+
top: -2px;
|
17 |
+
}
|
18 |
+
}
|
19 |
+
}
|
20 |
+
|
21 |
+
.fs-feature {
|
22 |
+
position: relative;
|
23 |
+
}
|
24 |
+
|
25 |
+
.dashicons-yes {
|
26 |
+
color: #0085ba;
|
27 |
+
font-size: 2em;
|
28 |
+
vertical-align: bottom;
|
29 |
+
margin-left: -7px;
|
30 |
+
margin-right: 10px;
|
31 |
+
|
32 |
+
.rtl & {
|
33 |
+
margin-left: 10px;
|
34 |
+
margin-right: -7px;
|
35 |
+
}
|
36 |
+
}
|
37 |
+
|
38 |
+
.dashicons-editor-help
|
39 |
+
{
|
40 |
+
color: #bbb;
|
41 |
+
cursor: help;
|
42 |
+
|
43 |
+
$tooltip-color: #000;
|
44 |
+
|
45 |
+
.fs-feature-desc {
|
46 |
+
opacity: 0;
|
47 |
+
visibility: hidden;
|
48 |
+
@include transition(opacity 0.3s ease-in-out);
|
49 |
+
|
50 |
+
position: absolute;
|
51 |
+
background: $tooltip-color;
|
52 |
+
color: #fff;
|
53 |
+
font-family: 'arial', serif;
|
54 |
+
font-size: 12px;
|
55 |
+
padding: 10px;
|
56 |
+
z-index: 999999;
|
57 |
+
bottom: 100%;
|
58 |
+
margin-bottom: 5px;
|
59 |
+
left: 0;
|
60 |
+
right: 0;
|
61 |
+
@include border-radius(5px);
|
62 |
+
@include box-shadow(1px 1px 1px rgba(0,0,0,0.2));
|
63 |
+
line-height: 1.3em;
|
64 |
+
font-weight: bold;
|
65 |
+
text-align: left;
|
66 |
+
|
67 |
+
.rtl &
|
68 |
+
{
|
69 |
+
text-align: right;
|
70 |
+
}
|
71 |
+
|
72 |
+
&::after {
|
73 |
+
content: ' ';
|
74 |
+
display: block;
|
75 |
+
width: 0;
|
76 |
+
height: 0;
|
77 |
+
border-style: solid;
|
78 |
+
border-width: 5px 5px 0 5px;
|
79 |
+
border-color: $tooltip-color transparent transparent transparent;
|
80 |
+
position: absolute;
|
81 |
+
top: 100%;
|
82 |
+
left: 21px;
|
83 |
+
|
84 |
+
.rtl & {
|
85 |
+
right: 21px;
|
86 |
+
left: auto;
|
87 |
+
}
|
88 |
+
}
|
89 |
+
}
|
90 |
+
|
91 |
+
&:hover {
|
92 |
+
.fs-feature-desc {
|
93 |
+
visibility: visible;
|
94 |
+
opacity: 1;
|
95 |
+
}
|
96 |
+
}
|
97 |
+
}
|
98 |
+
|
99 |
+
.button-primary {
|
100 |
+
display: block;
|
101 |
+
text-align: center;
|
102 |
+
margin-top: 10px;
|
103 |
+
}
|
104 |
+
}
|
105 |
+
|
106 |
+
#fs_customizer_support
|
107 |
+
{
|
108 |
+
display: block !important;
|
109 |
+
|
110 |
+
.button {
|
111 |
+
float: right;
|
112 |
+
}
|
113 |
+
|
114 |
+
.button-group {
|
115 |
+
width: 100%;
|
116 |
+
display: block;
|
117 |
+
margin-top: 10px;
|
118 |
+
|
119 |
+
.button {
|
120 |
+
float: none;
|
121 |
+
width: 50%;
|
122 |
+
text-align: center;
|
123 |
+
}
|
124 |
+
}
|
125 |
+
}
|
freemius/composer.json
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"name": "freemius/wordpress-sdk",
|
3 |
+
"description": "Freemius WordPress SDK",
|
4 |
+
"keywords": ["freemius", "wordpress", "plugin", "sdk"],
|
5 |
+
"homepage": "https://freemius.com",
|
6 |
+
"license": "GPL-2.0+",
|
7 |
+
"require": {
|
8 |
+
"php": ">=5.2"
|
9 |
+
}
|
10 |
+
}
|
freemius/config.php
ADDED
@@ -0,0 +1,328 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Freemius
|
4 |
+
* @copyright Copyright (c) 2015, Freemius, Inc.
|
5 |
+
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
6 |
+
* @since 1.0.4
|
7 |
+
*/
|
8 |
+
|
9 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
10 |
+
exit;
|
11 |
+
}
|
12 |
+
|
13 |
+
if ( ! defined( 'WP_FS__SLUG' ) ) {
|
14 |
+
define( 'WP_FS__SLUG', 'freemius' );
|
15 |
+
}
|
16 |
+
if ( ! defined( 'WP_FS__DEV_MODE' ) ) {
|
17 |
+
define( 'WP_FS__DEV_MODE', false );
|
18 |
+
}
|
19 |
+
|
20 |
+
#--------------------------------------------------------------------------------
|
21 |
+
#region API Connectivity Issues Simulation
|
22 |
+
#--------------------------------------------------------------------------------
|
23 |
+
|
24 |
+
if ( ! defined( 'WP_FS__SIMULATE_NO_API_CONNECTIVITY' ) ) {
|
25 |
+
define( 'WP_FS__SIMULATE_NO_API_CONNECTIVITY', false );
|
26 |
+
}
|
27 |
+
if ( ! defined( 'WP_FS__SIMULATE_NO_CURL' ) ) {
|
28 |
+
define( 'WP_FS__SIMULATE_NO_CURL', false );
|
29 |
+
}
|
30 |
+
if ( ! defined( 'WP_FS__SIMULATE_NO_API_CONNECTIVITY_CLOUDFLARE' ) ) {
|
31 |
+
define( 'WP_FS__SIMULATE_NO_API_CONNECTIVITY_CLOUDFLARE', false );
|
32 |
+
}
|
33 |
+
if ( ! defined( 'WP_FS__SIMULATE_NO_API_CONNECTIVITY_SQUID_ACL' ) ) {
|
34 |
+
define( 'WP_FS__SIMULATE_NO_API_CONNECTIVITY_SQUID_ACL', false );
|
35 |
+
}
|
36 |
+
if ( WP_FS__SIMULATE_NO_CURL ) {
|
37 |
+
define( 'FS_SDK__SIMULATE_NO_CURL', true );
|
38 |
+
}
|
39 |
+
if ( WP_FS__SIMULATE_NO_API_CONNECTIVITY_CLOUDFLARE ) {
|
40 |
+
define( 'FS_SDK__SIMULATE_NO_API_CONNECTIVITY_CLOUDFLARE', true );
|
41 |
+
}
|
42 |
+
if ( WP_FS__SIMULATE_NO_API_CONNECTIVITY_SQUID_ACL ) {
|
43 |
+
define( 'FS_SDK__SIMULATE_NO_API_CONNECTIVITY_SQUID_ACL', true );
|
44 |
+
}
|
45 |
+
|
46 |
+
#endregion
|
47 |
+
|
48 |
+
if ( ! defined( 'WP_FS__SIMULATE_FREEMIUS_OFF' ) ) {
|
49 |
+
define( 'WP_FS__SIMULATE_FREEMIUS_OFF', false );
|
50 |
+
}
|
51 |
+
|
52 |
+
if ( ! defined( 'WP_FS__PING_API_ON_IP_OR_HOST_CHANGES' ) ) {
|
53 |
+
/**
|
54 |
+
* @since 1.1.7.3
|
55 |
+
* @author Vova Feldman (@svovaf)
|
56 |
+
*
|
57 |
+
* I'm not sure if shared servers periodically change IP, or the subdomain of the
|
58 |
+
* admin dashboard. Also, I've seen sites that have strange loop of switching
|
59 |
+
* between domains on a daily basis. Therefore, to eliminate the risk of
|
60 |
+
* multiple unwanted connectivity test pings, temporary ignore domain or
|
61 |
+
* server IP changes.
|
62 |
+
*/
|
63 |
+
define( 'WP_FS__PING_API_ON_IP_OR_HOST_CHANGES', false );
|
64 |
+
}
|
65 |
+
|
66 |
+
/**
|
67 |
+
* If your dev environment supports custom public
|