Version Description
- Apply quotes only around testimonial content
- FAQ 13 update
- FAQ 34 update
- FAQ 35 update
- Screenshot 8 replaced
- Simplified quotes handling
- Upgrade notification
Download this release
Release Info
Developer | saurabhd |
Plugin | Testimonials Widget |
Version | 2.7.3 |
Comparing to | |
See all releases |
Code changes from version 3.3.4 to 2.7.3
- .DS_Store +0 -0
- API.md +0 -271
- CHANGELOG.md +0 -1497
- CONTRIBUTING.md +0 -41
- DEPRECATED.md +0 -11
- EXAMPLES.md +0 -51
- LICENSE +0 -339
- README.md +0 -41
- UPGRADING.md +0 -188
- assets/css/images/bx_loader.gif +0 -0
- assets/css/images/controls.png +0 -0
- assets/css/jquery.bxslider.css +0 -204
- assets/css/testimonials-widget-2.14.0.css +0 -120
- assets/css/testimonials-widget-ie7.css +0 -15
- assets/css/testimonials-widget.css +0 -122
- assets/images/michael-cannon-red-square-300x2251.jpg +0 -0
- assets/js/jquery.bxslider.js +0 -1343
- assets/js/jquery.bxslider.min.js +0 -10
- assets/js/jquery.easing.1.3.js +0 -205
- assets/js/jquery.fitvids.js +0 -80
- assets/js/tw-admin-scripts.js +0 -14
- includes/class-testimonials-widget-archives-widget.php +0 -82
- includes/class-testimonials-widget-categories-widget.php +0 -92
- includes/class-testimonials-widget-recent-testimonials-widget.php +0 -85
- includes/class-testimonials-widget-settings.php +0 -1101
- includes/class-testimonials-widget-slider-widget.php +0 -113
- includes/class-testimonials-widget-tag-cloud-widget.php +0 -95
- includes/class-testimonials-widget-template-loader.php +0 -45
- includes/class-testimonials-widget-widget.php +0 -117
- includes/class-testimonials-widget.php +0 -2416
- includes/libraries/Gamajo-Template-Loader/CHANGELOG.md +0 -30
- includes/libraries/Gamajo-Template-Loader/LICENSE +0 -339
- includes/libraries/Gamajo-Template-Loader/README.md +0 -152
- includes/libraries/Gamajo-Template-Loader/class-gamajo-template-loader.php +0 -267
- includes/libraries/Gamajo-Template-Loader/class-meal-planner-template-loader.php +0 -58
- includes/libraries/Gamajo-Template-Loader/composer.json +0 -24
- includes/libraries/aihrus-framework/CHANGELOG.md +0 -177
- includes/libraries/aihrus-framework/LICENSE +0 -339
- includes/libraries/aihrus-framework/README.md +0 -81
- includes/libraries/aihrus-framework/aihrus-framework.php +0 -353
- includes/libraries/aihrus-framework/class-aihrus-common.php +0 -462
- includes/libraries/aihrus-framework/class-aihrus-licensing.php +0 -188
- includes/libraries/aihrus-framework/class-aihrus-settings.php +0 -757
- includes/libraries/aihrus-framework/class-aihrus-widget.php +0 -252
- includes/libraries/aihrus-framework/includes/class-aihrus-common.php +0 -782
- includes/libraries/aihrus-framework/includes/class-aihrus-licensing.php +0 -216
- includes/libraries/aihrus-framework/includes/class-aihrus-settings.php +0 -895
- includes/libraries/aihrus-framework/includes/class-aihrus-widget.php +0 -365
- includes/libraries/aihrus-framework/includes/interface-aihrus-common.php +0 -27
- includes/libraries/aihrus-framework/includes/interface-aihrus-licensing.php +0 -28
- includes/libraries/aihrus-framework/includes/interface-aihrus-widget.php +0 -33
- includes/libraries/aihrus-framework/includes/libraries/class-redrokk-metabox-class.php +0 -1471
- includes/libraries/aihrus-framework/includes/libraries/parsedown/LICENSE.txt +0 -20
- includes/libraries/aihrus-framework/includes/libraries/parsedown/Parsedown.php +0 -1528
- includes/libraries/aihrus-framework/includes/libraries/parsedown/README.md +0 -53
- includes/libraries/aihrus-framework/includes/libraries/parsedown/composer.json +0 -18
- includes/libraries/aihrus-framework/includes/libraries/parsedown/phpunit.xml.dist +0 -8
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/CommonMarkTest.php +0 -74
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/ParsedownTest.php +0 -159
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/Test.php +0 -65
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/TestParsedown.php +0 -5
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/bootstrap.php +0 -3
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/HTML_Comment.html +0 -5
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/HTML_Comment.md +0 -8
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/aesthetic_table.html +0 -18
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/aesthetic_table.md +0 -4
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/aligned_table.html +0 -21
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/aligned_table.md +0 -4
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/atx_heading.html +0 -9
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/atx_heading.md +0 -17
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/automatic_link.html +0 -1
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/automatic_link.md +0 -1
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/block-level_html.html +0 -12
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/block-level_html.md +0 -16
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/code_block.html +0 -8
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/code_block.md +0 -10
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/code_span.html +0 -6
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/code_span.md +0 -11
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/compound_blockquote.html +0 -9
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/compound_blockquote.md +0 -10
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/compound_emphasis.html +0 -2
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/compound_emphasis.md +0 -4
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/compound_list.html +0 -12
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/compound_list.md +0 -7
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/deeply_nested_list.html +0 -12
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/deeply_nested_list.md +0 -6
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/em_strong.html +0 -8
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/em_strong.md +0 -15
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/email.html +0 -1
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/email.md +0 -1
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/emphasis.html +0 -8
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/emphasis.md +0 -13
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/escaping.html +0 -6
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/escaping.md +0 -11
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/fenced_code_block.html +0 -6
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/fenced_code_block.md +0 -14
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/horizontal_rule.html +0 -5
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/horizontal_rule.md +0 -9
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/html_entity.html +0 -1
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/html_entity.md +0 -1
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/image_reference.html +0 -2
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/image_reference.md +0 -5
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/image_title.html +0 -2
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/image_title.md +0 -3
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/implicit_reference.html +0 -4
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/implicit_reference.md +0 -13
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/inline_link.html +0 -6
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/inline_link.md +0 -11
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/inline_link_title.html +0 -6
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/inline_link_title.md +0 -11
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/inline_title.html +0 -1
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/inline_title.md +0 -1
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/lazy_blockquote.html +0 -6
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/lazy_blockquote.md +0 -5
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/lazy_list.html +0 -4
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/lazy_list.md +0 -2
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/line_break.html +0 -2
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/line_break.md +0 -2
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/multiline_list_paragraph.html +0 -7
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/multiline_list_paragraph.md +0 -4
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/nested_block-level_html.html +0 -10
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/nested_block-level_html.md +0 -11
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/ordered_list.html +0 -13
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/ordered_list.md +0 -11
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/paragraph_list.html +0 -12
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/paragraph_list.md +0 -9
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/reference_title.html +0 -2
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/reference_title.md +0 -6
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/self-closing_html.html +0 -12
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/self-closing_html.md +0 -12
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/separated_nested_list.html +0 -9
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/separated_nested_list.md +0 -4
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/setext_header.html +0 -5
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/setext_header.md +0 -12
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/simple_blockquote.html +0 -11
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/simple_blockquote.md +0 -7
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/simple_table.html +0 -37
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/simple_table.md +0 -11
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/span-level_html.html +0 -5
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/span-level_html.md +0 -8
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/sparse_dense_list.html +0 -7
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/sparse_dense_list.md +0 -4
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/sparse_html.html +0 -8
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/sparse_html.md +0 -8
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/sparse_list.html +0 -15
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/sparse_list.md +0 -9
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/special_characters.html +0 -6
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/special_characters.md +0 -13
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/strikethrough.html +0 -3
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/strikethrough.md +0 -5
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/strong_em.html +0 -6
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/strong_em.md +0 -11
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/tab-indented_code_block.html +0 -6
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/tab-indented_code_block.md +0 -6
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/table_inline_markdown.html +0 -22
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/table_inline_markdown.md +0 -5
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/text_reference.html +0 -8
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/text_reference.md +0 -21
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/unordered_list.html +0 -10
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/unordered_list.md +0 -8
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/untidy_table.html +0 -18
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/untidy_table.md +0 -4
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/url_autolinking.html +0 -3
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/url_autolinking.md +0 -5
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/whitespace.html +0 -1
- includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/whitespace.md +0 -5
- includes/libraries/aihrus-framework/includes/libraries/wp_custom_post_status.php +0 -234
- includes/libraries/aihrus-framework/interface-aihrus-common.php +0 -27
- includes/libraries/aihrus-framework/interface-aihrus-licensing.php +0 -28
- includes/libraries/aihrus-framework/interface-aihrus-widget.php +0 -33
- includes/libraries/aihrus-framework/requirements.php +0 -270
- includes/libraries/bxslider-4/.jshintrc +0 -16
- includes/libraries/bxslider-4/CONTRIBUTING.md +0 -118
- includes/libraries/bxslider-4/Gruntfile.js +0 -326
- includes/libraries/bxslider-4/Gulpfile.js +0 -82
- includes/libraries/bxslider-4/LICENSE.md +0 -12
- includes/libraries/bxslider-4/_config.json +0 -21
- includes/libraries/bxslider-4/bower.json +0 -29
- includes/libraries/bxslider-4/dist/LICENSE.md +0 -12
- includes/libraries/bxslider-4/dist/README.md +0 -748
- includes/libraries/bxslider-4/dist/images/bx_loader.gif +0 -0
- includes/libraries/bxslider-4/dist/images/controls.png +0 -0
- includes/libraries/bxslider-4/dist/jquery.bxslider.css +0 -184
- includes/libraries/bxslider-4/dist/jquery.bxslider.js +0 -1614
- includes/libraries/bxslider-4/dist/jquery.bxslider.min.css +0 -10
- includes/libraries/bxslider-4/dist/jquery.bxslider.min.js +0 -9
- includes/libraries/bxslider-4/dist/vendor/jquery.easing.1.3.js +0 -205
- includes/libraries/bxslider-4/dist/vendor/jquery.fitvids.js +0 -80
- includes/libraries/bxslider-4/docs_src/assets/img/bx-logo.png +0 -0
- includes/libraries/bxslider-4/docs_src/assets/img/photo1-cropped.jpeg +0 -0
- includes/libraries/bxslider-4/docs_src/assets/img/photo1.jpeg +0 -0
- includes/libraries/bxslider-4/docs_src/assets/img/photo2-cropped.jpeg +0 -0
- includes/libraries/bxslider-4/docs_src/assets/img/photo2.jpeg +0 -0
- includes/libraries/bxslider-4/docs_src/assets/img/photo3-cropped.jpeg +0 -0
- includes/libraries/bxslider-4/docs_src/assets/img/photo3.jpeg +0 -0
- includes/libraries/bxslider-4/docs_src/assets/img/photo4.jpeg +0 -0
- includes/libraries/bxslider-4/docs_src/assets/img/photo5.jpeg +0 -0
- includes/libraries/bxslider-4/docs_src/assets/img/photo6.jpeg +0 -0
- includes/libraries/bxslider-4/docs_src/assets/js/app.js +0 -234
- includes/libraries/bxslider-4/docs_src/assets/less/docs.less +0 -112
- includes/libraries/bxslider-4/docs_src/assets/vendors/jquery.min.js +0 -5
- includes/libraries/bxslider-4/docs_src/assets/vendors/jquery.min.map +0 -1
.DS_Store
DELETED
Binary file
|
API.md
DELETED
@@ -1,271 +0,0 @@
|
|
1 |
-
# API - Testimonials Widget
|
2 |
-
|
3 |
-
The [Testimonials Widget plugin](http://wordpress.org/plugins/testimonials-widget/) comes with its own set of actions and filters, as described below.
|
4 |
-
|
5 |
-
## Actions
|
6 |
-
|
7 |
-
* `tw_settings_add_help_tabs`
|
8 |
-
|
9 |
-
Modify the settings page help tabs.
|
10 |
-
|
11 |
-
* `tw_scripts`
|
12 |
-
|
13 |
-
Make additional `wp_register_script` and `wp_enqueue_script` calls as needed.
|
14 |
-
|
15 |
-
* `tw_styles`
|
16 |
-
|
17 |
-
Make additional `wp_register_style` and `wp_enqueue_style` calls as needed.
|
18 |
-
|
19 |
-
* `tw_update`
|
20 |
-
|
21 |
-
Make additional update related calls as needed.
|
22 |
-
|
23 |
-
## Filters
|
24 |
-
|
25 |
-
### Frontend
|
26 |
-
|
27 |
-
* `tw_cite_html`
|
28 |
-
|
29 |
-
Adjust cite contents. [example](https://nodedesk.zendesk.com/hc/en-us/articles/202295462)
|
30 |
-
|
31 |
-
* `tw_content_more`
|
32 |
-
|
33 |
-
More content ellipsis. [example](https://nodedesk.zendesk.com/hc/en-us/articles/202300032)
|
34 |
-
|
35 |
-
* `tw_get_testimonials_html`
|
36 |
-
|
37 |
-
Customize the contents and layout within `get_testimonials_html`.
|
38 |
-
|
39 |
-
* `tw_get_testimonial_html`
|
40 |
-
|
41 |
-
Customize testimonial contents and layout within `get_testimonial_html`. Useful for moving processed parts around than regenerating everything from scratch. [example](https://nodedesk.zendesk.com/hc/en-us/articles/202385211)
|
42 |
-
|
43 |
-
* `tw_gravatar_size`
|
44 |
-
|
45 |
-
Change the Gravatar size. [example](https://nodedesk.zendesk.com/hc/en-us/articles/202300072)
|
46 |
-
|
47 |
-
* `tw_image_size`
|
48 |
-
|
49 |
-
Change the image size. [example](https://nodedesk.zendesk.com/hc/en-us/articles/202379911)
|
50 |
-
|
51 |
-
* `tw_next_posts_link_text`
|
52 |
-
|
53 |
-
Configure Next page indicator. [example](https://nodedesk.zendesk.com/hc/en-us/articles/202385431)
|
54 |
-
|
55 |
-
* `tw_previous_posts_link_text`
|
56 |
-
|
57 |
-
Configure Previous page indicator. [example](https://nodedesk.zendesk.com/hc/en-us/articles/202385431)
|
58 |
-
|
59 |
-
* `tw_testimonial_html_single_content`
|
60 |
-
|
61 |
-
Customize single view content before appending filter `tw_testimonial_html_single` results. [example](https://gist.github.com/michael-cannon/5833657)
|
62 |
-
|
63 |
-
* `tw_testimonial_html_single`
|
64 |
-
|
65 |
-
Customize testimonials single view output post `get_testimonial_html`. [example](https://nodedesk.zendesk.com/hc/en-us/articles/202331941)
|
66 |
-
|
67 |
-
* `tw_testimonial_html`
|
68 |
-
|
69 |
-
Customize testimonials list and widget output post `get_testimonial_html`. [example](https://nodedesk.zendesk.com/hc/en-us/articles/202380281)
|
70 |
-
|
71 |
-
* `tw_get_testimonial_html_class`
|
72 |
-
|
73 |
-
Alter dynamically generated CSS per testimonial
|
74 |
-
|
75 |
-
* `tw_testimonials_css`
|
76 |
-
|
77 |
-
Alter dynamically generated CSS
|
78 |
-
|
79 |
-
* `tw_testimonials_js`
|
80 |
-
|
81 |
-
Alter dynamically generated JavaScript. [example](https://gist.github.com/michael-cannon/5833678)
|
82 |
-
|
83 |
-
* `tw_testimonials_js_internal`
|
84 |
-
|
85 |
-
Inject dynamically generated JavaScript to `active/next` functional area..
|
86 |
-
|
87 |
-
* `tw_wp_pagenavi`
|
88 |
-
|
89 |
-
Configure WP-PageNavi specifically for Testimonial Widgets. [example](https://nodedesk.zendesk.com/hc/en-us/articles/202379891)
|
90 |
-
|
91 |
-
* `tw_review_name_length`
|
92 |
-
|
93 |
-
Maximium length of review schema's name. Default is 156 characters.
|
94 |
-
|
95 |
-
* `tw_schema`
|
96 |
-
|
97 |
-
Customize schema contents.
|
98 |
-
|
99 |
-
* `tw_schema_review`
|
100 |
-
|
101 |
-
Customize schema review meta contents.
|
102 |
-
|
103 |
-
* `tw_schema_agg_rating`
|
104 |
-
|
105 |
-
Customize schema aggregate rating for item.
|
106 |
-
|
107 |
-
* `tw_schema_author`
|
108 |
-
|
109 |
-
Customize schema author contents.
|
110 |
-
|
111 |
-
* `tw_schema_item`
|
112 |
-
|
113 |
-
Customize schema reviewed item contents.
|
114 |
-
|
115 |
-
* `tw_get_template_part`
|
116 |
-
|
117 |
-
Allow template choices to be filtered. [Usage](https://github.com/GaryJones/Gamajo-Template-Loader/blob/develop/class-gamajo-template-loader.php#L120)
|
118 |
-
|
119 |
-
* `tw_template_paths`
|
120 |
-
|
121 |
-
Allow ordered list of template paths to be amended. [Usage](https://github.com/GaryJones/Gamajo-Template-Loader/blob/develop/class-gamajo-template-loader.php#L201)
|
122 |
-
|
123 |
-
* `tw_categories_dropdown_args`
|
124 |
-
|
125 |
-
Used for modifying [wp_dropdown_categories](http://codex.wordpress.org/Function_Reference/wp_dropdown_categories) as part of the testimonials' categories widget.
|
126 |
-
|
127 |
-
* `tw_categories_args`
|
128 |
-
|
129 |
-
Used for modifying [wp_list_categories](http://codex.wordpress.org/Function_Reference/wp_list_categories) as part of the testimonials' categories widget.
|
130 |
-
|
131 |
-
* `tw_tag_cloud_args`
|
132 |
-
|
133 |
-
Used for modifying [wp_tag_cloud](http://codex.wordpress.org/Function_Reference/wp_tag_cloud) as part of the testimonials' tag cloud widget.
|
134 |
-
|
135 |
-
* `tw_recent_testimonials_args`
|
136 |
-
|
137 |
-
Used for modifying [WP_Query](http://codex.wordpress.org/Function_Reference/WP_Query) as part of the recent testimonials widget.
|
138 |
-
|
139 |
-
* `tw_archives_dropdown_args`
|
140 |
-
|
141 |
-
Used for modifying [wp_get_archives](http://codex.wordpress.org/Function_Reference/wp_get_archives) as part of the testimonials archive widget.
|
142 |
-
|
143 |
-
* `tw_archives_args`
|
144 |
-
|
145 |
-
Used for modifying [wp_get_archives](http://codex.wordpress.org/Function_Reference/wp_get_archives) as part of the testimonials archive widget.
|
146 |
-
|
147 |
-
### Backend
|
148 |
-
|
149 |
-
* `tw_cache_get`
|
150 |
-
|
151 |
-
Caching grabber. [example](https://gist.github.com/michael-cannon/5833685)
|
152 |
-
|
153 |
-
* `tw_cache_set`
|
154 |
-
|
155 |
-
Caching setter. [example](https://gist.github.com/michael-cannon/5833685)
|
156 |
-
|
157 |
-
* `tw_columns`
|
158 |
-
|
159 |
-
Customize testimonial posts column headers. [example](https://gist.github.com/michael-cannon/5833693)
|
160 |
-
|
161 |
-
* `tw_content`
|
162 |
-
|
163 |
-
Testimonial content parser helper. [example](https://gist.github.com/michael-cannon/5833700)
|
164 |
-
|
165 |
-
* `tw_data`
|
166 |
-
|
167 |
-
Process testimonials data before display processing. [example](https://nodedesk.zendesk.com/hc/en-us/articles/202385251)
|
168 |
-
|
169 |
-
* `tw_defaults_single`
|
170 |
-
|
171 |
-
Create a global or central Testimonials configuration for single view. [example](https://nodedesk.zendesk.com/hc/en-us/articles/202385321). [example](https://nodedesk.zendesk.com/hc/en-us/articles/202385331)
|
172 |
-
|
173 |
-
* `tw_defaults`
|
174 |
-
|
175 |
-
Create a global or central Testimonials configuration. [example](https://nodedesk.zendesk.com/hc/en-us/articles/202385411)
|
176 |
-
|
177 |
-
* `tw_meta_box`
|
178 |
-
|
179 |
-
Modify Testimonial Data fields. [example](https://gist.github.com/michael-cannon/5833704). [Configuration examples](https://github.com/michael-cannon/aihrus-framework/blob/master/includes/libraries/class-redrokk-metabox-class.php#L815)
|
180 |
-
|
181 |
-
* `tw_posts_custom_column`
|
182 |
-
|
183 |
-
Customize testimonial posts column contents. [example](https://gist.github.com/michael-cannon/5833716)
|
184 |
-
|
185 |
-
* `tw_query_args`
|
186 |
-
|
187 |
-
Alter WP_Query arguments for testimonial selection. [example](https://gist.github.com/michael-cannon/5833740)
|
188 |
-
|
189 |
-
* `tw_sections`
|
190 |
-
|
191 |
-
Alter section options. [example](https://gist.github.com/michael-cannon/5833757)
|
192 |
-
|
193 |
-
* `tw_settings`
|
194 |
-
|
195 |
-
Alter setting options. [example](https://gist.github.com/michael-cannon/5833757)
|
196 |
-
|
197 |
-
* `tw_testimonial_query`
|
198 |
-
|
199 |
-
Alter testimonials WP_Query within `get_testimonials`
|
200 |
-
|
201 |
-
* `tw_validate_settings`
|
202 |
-
|
203 |
-
Validate settings helper. [example](https://gist.github.com/michael-cannon/5833768)
|
204 |
-
|
205 |
-
* `tw_version`
|
206 |
-
|
207 |
-
Version tracking for settings. [example](https://gist.github.com/michael-cannon/5833774)
|
208 |
-
|
209 |
-
* `tw_slider_widget_options`
|
210 |
-
|
211 |
-
Alters displayed widget options. [example](https://gist.github.com/michael-cannon/5833782)
|
212 |
-
|
213 |
-
* `tw_categories_widget_options`
|
214 |
-
|
215 |
-
Used for modifying widget options as part of the testimonials' categories widget. [similar example](https://gist.github.com/michael-cannon/5833782)
|
216 |
-
|
217 |
-
* `tw_tag_cloud_widget_options`
|
218 |
-
|
219 |
-
Used for modifying widget options as part of the testimonials' tag cloud widget. [similar example](https://gist.github.com/michael-cannon/5833782)
|
220 |
-
|
221 |
-
* `tw_recent_testimonials_widget_options`
|
222 |
-
|
223 |
-
Used for modifying widget options as part of the recent testimonials widget. [similar example](https://gist.github.com/michael-cannon/5833782)
|
224 |
-
|
225 |
-
* `tw_archives_widget_options`
|
226 |
-
|
227 |
-
Used for modifying widget options as part of the testimonials archives widget. [similar example](https://gist.github.com/michael-cannon/5833782)
|
228 |
-
|
229 |
-
* `tw_display_setting`
|
230 |
-
|
231 |
-
Alows for display of custom input types.
|
232 |
-
|
233 |
-
* `tw_settings_defaults`
|
234 |
-
|
235 |
-
Override settings defaults with your own.
|
236 |
-
|
237 |
-
* `tw_register_post_type_args`
|
238 |
-
|
239 |
-
Overrides `register_post_type` arguments. [example](https://gist.github.com/michael-cannon/8fc217199ae1e8d5eecb)
|
240 |
-
|
241 |
-
* `tw_register_category_args`
|
242 |
-
|
243 |
-
Overrides `register_taxonomy` arguments.
|
244 |
-
|
245 |
-
* `tw_register_tags_args`
|
246 |
-
|
247 |
-
Overrides `register_taxonomy` arguments.
|
248 |
-
|
249 |
-
* `tw_examples_html`
|
250 |
-
|
251 |
-
Enhance or override examples HTML.
|
252 |
-
|
253 |
-
* `tw_used_with_codes`
|
254 |
-
|
255 |
-
Enhance or override primary widgets shortcode and theme function accessibility.
|
256 |
-
|
257 |
-
* `tw_options_widgets`
|
258 |
-
|
259 |
-
Enhance or override widgets included for options documentation.
|
260 |
-
|
261 |
-
* `tw_used_with_codes_widgets`
|
262 |
-
|
263 |
-
Enhance or override additionally widgets shortcode and theme function accessibility.
|
264 |
-
|
265 |
-
* `tw_options_html`
|
266 |
-
|
267 |
-
Enhance or override options HTML.
|
268 |
-
|
269 |
-
## Need More?
|
270 |
-
|
271 |
-
Further examples and more can be found by reading and searching the [Testimonials Knowledge Base](https://nodedesk.zendesk.com/hc/en-us/sections/200861112) and [source code](https://github.com/michael-cannon/testimonials-widget).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CHANGELOG.md
DELETED
@@ -1,1497 +0,0 @@
|
|
1 |
-
# CHANGELOG - Testimonials Widget
|
2 |
-
|
3 |
-
## master
|
4 |
-
|
5 |
-
## 3.3.4
|
6 |
-
* Change verbiage for schema notice
|
7 |
-
* Confirm WordPress 4.6 compatibility
|
8 |
-
|
9 |
-
## 3.3.3
|
10 |
-
* Fix `Fatal error: Can't use function return value in write context`
|
11 |
-
|
12 |
-
## 3.3.1
|
13 |
-
* Add notice for existing users about review schema
|
14 |
-
* Confirm WordPress 4.5.3 compatibility
|
15 |
-
* Confirm PHP7 compatibility
|
16 |
-
* Disable use of review schema by default
|
17 |
-
* Update Gamajo-Template-Loader library
|
18 |
-
|
19 |
-
## 3.3.0
|
20 |
-
* Change support email address to support@axelerant.com
|
21 |
-
* Confirm WordPress 4.4 compatibility
|
22 |
-
* Fix aggregate rating count
|
23 |
-
* Fix coding standards for CI
|
24 |
-
* Remove option to disable the license not saved notice rather set sslverify to false.
|
25 |
-
* Remove the use of deprecated function `wp_htmledit_pre()` and use `format_for_editor()` instead.
|
26 |
-
* Require Aihrus Framework 1.2.4
|
27 |
-
* RESOLVE #178 Provide ways to display the testimonial title on top of the testimonial content
|
28 |
-
* RESOLVE #180 Add missing required `ratingValue` for AggregateRating schema property
|
29 |
-
* RESOLVE #183 Rename core class name to prevent fatal errors
|
30 |
-
* RESOLVE #193 Warning in Google's structured data testing tool for `aggregateRating` in testimonials
|
31 |
-
* RESOLVE Replace deprecated 'post_permalink' with 'get_permalink'
|
32 |
-
* Update Gamajo-Template-Loader
|
33 |
-
|
34 |
-
## 3.2.0
|
35 |
-
* Add filter tw_testimonial_query to alter WP_Query in get_testimonials
|
36 |
-
* Require Aihrus Framework 1.2.2
|
37 |
-
* RESOLVE #168 Auto save options and clear permalinks on updating
|
38 |
-
* RESOLVE #173 prevent_slug_conflict runs on front end page load
|
39 |
-
* Store branding updates
|
40 |
-
* Update bxslider library to v4.2.5
|
41 |
-
|
42 |
-
## 3.1.1
|
43 |
-
* Redo SVN release
|
44 |
-
|
45 |
-
## 3.1.0
|
46 |
-
* Change brand name from Aihrus to Axelerant
|
47 |
-
* Change copyright text
|
48 |
-
* Require Aihrus Framework 1.2.1
|
49 |
-
* RESOLVE bxslider-4 CSS change for .bx-wrapper border showing
|
50 |
-
* RESOLVE bxslider-4 library pathing
|
51 |
-
* Update library Gamajo-Template-Loader
|
52 |
-
* WordPress 4.2 compatible
|
53 |
-
|
54 |
-
## 3.0.4
|
55 |
-
* RESOLVE Warning: Illegal string offset 'random'
|
56 |
-
* Update copyright year
|
57 |
-
* Update Structured Data Testing Tool link
|
58 |
-
|
59 |
-
## 3.0.3
|
60 |
-
* Add demo link to examples
|
61 |
-
* Require Aihrus Framework 1.1.7
|
62 |
-
* RESOLVE #150 URL target doesn't work
|
63 |
-
* RESOLVE #155 Aggregate data is off per Google
|
64 |
-
* RESOLVE #159 Under 'Selection Options', 'Tag Filter', the description should say 'Comma separated tag SLUGS or IDs.'
|
65 |
-
* RESOLVE #165 Stack of testimonials appear on load
|
66 |
-
* RESOLVE PHP Notice: Undefined index: enable_video
|
67 |
-
* RESOLVE PHP Notice: Undefined index: post_id
|
68 |
-
* RESOLVE PHP Notice: Use of undefined constant Testimonials_Widget - assumed 'Testimonials_Widget'
|
69 |
-
* Update FAQ on shortcodes
|
70 |
-
|
71 |
-
## 3.0.2
|
72 |
-
* RESOLVE Pager always showing
|
73 |
-
|
74 |
-
## 3.0.1
|
75 |
-
* Add Documentation section to readme
|
76 |
-
* FAQ Got `The plugin does not have a valid header` error?
|
77 |
-
* Require Aihrus Framework 1.1.6
|
78 |
-
* RESOLVE #158 Minify JS
|
79 |
-
* RESOLVE is_array( $args['tax_query'] ) notice
|
80 |
-
* RESOLVE Missing slideWidth 0
|
81 |
-
* RESOLVE Notice: Undefined index: tag_slug__in
|
82 |
-
* RESOLVE Slide Width stuck on 200 pixels
|
83 |
-
* RESOLVE The plugin does not have a valid header - remove blank lines between header comments
|
84 |
-
* Restore settings page name as Testimonials Widget Settings
|
85 |
-
* Swap Shortcode Examples and Attributes tab positions
|
86 |
-
|
87 |
-
## 3.0.0
|
88 |
-
* Add DEPRECATED.md, EXAMPLES.md, and UPGRADING.md documentation
|
89 |
-
* Add filter `tw_examples_html`
|
90 |
-
* Add filter `tw_examples`
|
91 |
-
* Add filter `tw_get_template_part`
|
92 |
-
* Add filter `tw_options_html`
|
93 |
-
* Add filter `tw_options_widgets`
|
94 |
-
* Add filter `tw_template_paths`
|
95 |
-
* Add filter `tw_used_with_codes_widgets`
|
96 |
-
* Add filter `tw_used_with_codes`
|
97 |
-
* Add filter `tw_widget_categories_args`
|
98 |
-
* Add filter `tw_widget_categories_dropdown_args`
|
99 |
-
* Add filter `tw_widget_categories_options`
|
100 |
-
* Add filter `tw_widget_recent_testimonials_args`
|
101 |
-
* Add filter `tw_widget_recent_testimonials_options`
|
102 |
-
* Add filter `tw_widget_tag_cloud_args`
|
103 |
-
* Add filter `tw_widget_tag_cloud_options`
|
104 |
-
* Add more shortcode examples
|
105 |
-
* Add Plugin Deactivation & Deletion section to readme
|
106 |
-
* Add shortcode and theme function `testimonials_archives`
|
107 |
-
* Add shortcode and theme function `testimonials_categories`
|
108 |
-
* Add shortcode and theme function `testimonials_examples`
|
109 |
-
* Add shortcode and theme function `testimonials_options`
|
110 |
-
* Add shortcode and theme function `testimonials_recent`
|
111 |
-
* Add shortcode and theme function `testimonials_tag_cloud`
|
112 |
-
* Added recent testimonials widget
|
113 |
-
* Added testimonials category widget
|
114 |
-
* Added testimonials tag cloud widget
|
115 |
-
* API link updates
|
116 |
-
* Author field to override title when it's not the testimonial source
|
117 |
-
* Begin updating to WordPress-VIP coding standards
|
118 |
-
* Don't shortcode attribute for global level options
|
119 |
-
* Link help to FAQ
|
120 |
-
* Moved aggregate review schema data to premium
|
121 |
-
* Moved email column and data input before URL
|
122 |
-
* Moved Tutorials to below Usage section in readme
|
123 |
-
* Put latest Update Notice in readme.txt
|
124 |
-
* Readme.txt updates
|
125 |
-
* Remove `show_code` examples from settings entries
|
126 |
-
* Removed customized edit title
|
127 |
-
* Removed options: `include_ie7_css`,`use_bxslider`, `disable_animation`, `fade_out_speed`, `fade_in_speed`, `height`, `min_height`, `max_height`
|
128 |
-
* Removed pre-2.0.0 migration code
|
129 |
-
* Removed shortcodes: `testimonialswidget_list`, `testimonialswidget_widget`
|
130 |
-
* Reorganize settings
|
131 |
-
* Replace "Source" with "Author"
|
132 |
-
* Replace "Source" with "Author"
|
133 |
-
* Replace `tw_shortcodes` with `tw_examples`
|
134 |
-
* Require Aihrus Framework 1.1.5
|
135 |
-
* RESOLVE #103 Example of every option
|
136 |
-
* RESOLVE #104 Include help in the plugin
|
137 |
-
* RESOLVE #111 bottom_text=false shows false
|
138 |
-
* RESOLVE #112 Remove deprecated methods
|
139 |
-
* RESOLVE #113 Replace testimonials_widget_ of actions, filters, and functions with tw_
|
140 |
-
* RESOLVE #117 Revise benefits content
|
141 |
-
* RESOLVE #119 Confirm WPML integration works
|
142 |
-
* RESOLVE #120 Implement ease of use
|
143 |
-
* RESOLVE #121 Updated screenshots
|
144 |
-
* RESOLVE #123 Revise installation and usage instructions for ease of use
|
145 |
-
* RESOLVE #124 Optionally include testimonials in category archives
|
146 |
-
* RESOLVE #127 Use category and tag IDs in addition to names for testimonials selection
|
147 |
-
* RESOLVE #128 Move bxSlider to being library
|
148 |
-
* RESOLVE #129 Testimonials Archive widget
|
149 |
-
* RESOLVE #130 Recent Testimonials widget
|
150 |
-
* RESOLVE #131 Implement widget content caching
|
151 |
-
* RESOLVE #132 Implement shortcodes for all widgets
|
152 |
-
* RESOLVE #134 Implement testimonials date archives
|
153 |
-
* RESOLVE #137 Simple aggregrate numbers needed in freebie
|
154 |
-
* RESOLVE #138 Add shortcode attributes example tab to settings page
|
155 |
-
* RESOLVE #139 Auto-generate option examples
|
156 |
-
* RESOLVE #149 Restore deprecated shortcodes and theme functions to TW
|
157 |
-
* RESOLVE #18 Testimonials category/tag list/cloud widget
|
158 |
-
* RESOLVE #19 Template engine
|
159 |
-
* RESOLVE #23 Reorganize meta data fields - Author to top
|
160 |
-
* RESOLVE Flush rewrite rules if baseline taxonomy changes
|
161 |
-
* RESOLVE Videos not showing in single view
|
162 |
-
* Restore Testimonials Widget branding
|
163 |
-
* Restore Testimonials Widget Premium branding
|
164 |
-
* Revise descriptions
|
165 |
-
* Revise upgrade notice
|
166 |
-
* Revise widget class and files names
|
167 |
-
* Simplify Review schema handling
|
168 |
-
* Slider schema enabled by default
|
169 |
-
* Update keywords
|
170 |
-
* Update licensing entries
|
171 |
-
* Update shortcode examples with description first
|
172 |
-
* Update widget title handling
|
173 |
-
* Update [bxSlider 4.1.2](https://github.com/stevenwanderski/bxslider-4)
|
174 |
-
* Use [bxSlider](https://github.com/stevenwanderski/bxslider-4) as a library
|
175 |
-
|
176 |
-
## 2.19.9
|
177 |
-
* Add example for `tw_register_post_type_args`
|
178 |
-
* Add FAQ Gravity Forms
|
179 |
-
* Add filter `tw_register_category_args`
|
180 |
-
* Add filter `tw_register_post_type_args`
|
181 |
-
* Add filter `tw_register_tags_args`
|
182 |
-
* Add `margin-bottom: 2em;` to `.testimonials-widget-testimonial.list`
|
183 |
-
|
184 |
-
## 2.19.8
|
185 |
-
* Add Configuration examples for filter tw_meta_box
|
186 |
-
* Add option Exclude default CSS?
|
187 |
-
* Disable WordPress.WhiteSpace.ControlStructureSpacing coding standard
|
188 |
-
* RESOLVE #95 Incoming YouTube links not embedded
|
189 |
-
* RESOLVE #99 Swap location and company data placements
|
190 |
-
|
191 |
-
## 2.19.7
|
192 |
-
* RESOLVE Testimonials content has the_content filter applied
|
193 |
-
|
194 |
-
## 2.19.6
|
195 |
-
* RESOLVE #92 Embed YouTube videos in reviews
|
196 |
-
* Revise readme description
|
197 |
-
|
198 |
-
## 2.19.5.1
|
199 |
-
* Add tutorial videos
|
200 |
-
* Tested up to: 4.0.0
|
201 |
-
|
202 |
-
## 2.19.5
|
203 |
-
* Remove Testimonials menu for authors removal code
|
204 |
-
* Require Aihrus Framework 1.1.4
|
205 |
-
* Revise premium introduction
|
206 |
-
* Update premium links
|
207 |
-
|
208 |
-
## 2.19.4
|
209 |
-
* Add Testimonials to Dashboard's At a Glance
|
210 |
-
* Hide version based options is bxSlider is enabled
|
211 |
-
* RELATED #78 Show revert link in deactivation admin notice
|
212 |
-
* RESOLVE #71 Permissions for Contributor
|
213 |
-
* RESOLVE Authors seeing more than own testimonials for editing
|
214 |
-
* Require Aihrus Framework 1.1.3
|
215 |
-
* Revise readme options layout
|
216 |
-
* Revise screenshots
|
217 |
-
|
218 |
-
## 2.19.3
|
219 |
-
* Refactor get_defaults
|
220 |
-
* Replace [[/]] with [/]
|
221 |
-
* Require Aihrus Framework 1.1.2
|
222 |
-
* RESOLVE #80 DB Performance Issues
|
223 |
-
* Revise FAQ section
|
224 |
-
* Update settings page detection
|
225 |
-
|
226 |
-
## 2.19.2
|
227 |
-
* Force WordPress to update files
|
228 |
-
|
229 |
-
## 2.19.1
|
230 |
-
* Please resave your Testimonials > Settings and Widget options for defaults to be corrected
|
231 |
-
* Remove unsued `widget_options`
|
232 |
-
* Require Aihrus Framework 1.1.1
|
233 |
-
|
234 |
-
## 2.19.0
|
235 |
-
* Add screenshot 22. Testimonials Settings > Columns tab
|
236 |
-
* Check system requirements after update
|
237 |
-
* CSS class `.title` is now `.job-title`. Thank you Mark
|
238 |
-
* Enable adaptive slider height
|
239 |
-
* Only check system requirements once a week
|
240 |
-
* Please resave your WordPress Admin > Testimonials > Settings so that missing aoptions are included again.
|
241 |
-
* RELATE #64 Remove deprecated options and codes
|
242 |
-
* Require Aihrus Framework 1.1.0
|
243 |
-
* RESOLVE #20 Simplify shortcodes
|
244 |
-
* RESOLVE #45 Plugin Disables Itself
|
245 |
-
* RESOLVE #56 Prevent edit page column overload
|
246 |
-
* RESOLVE #67 Use .job-title than .title for job title span class
|
247 |
-
* RESOLVE #76 Undefined index: hide_image_single
|
248 |
-
* Revise Aihrus framework includes
|
249 |
-
* Revise version_check
|
250 |
-
* Shortcode and theme function `testimonialswidget_list` being deprecated by `testimonials`
|
251 |
-
* Shortcode and theme function `testimonialswidget_widget` being deprecated by `testimonials_slider`
|
252 |
-
* Update BxSlider v4.1.2
|
253 |
-
* Use aihr_deactivate_plugin call to deactivate
|
254 |
-
|
255 |
-
## 2.18.4
|
256 |
-
* RESOLVE #69 Disallow .display-none when only 1 testimonials or no refresh_interval
|
257 |
-
|
258 |
-
## 2.18.3
|
259 |
-
* Add option "Exclude bxSlider CSS?"
|
260 |
-
* Exit if accessed directly
|
261 |
-
* Initially no show bxSlider widget testimonials entries
|
262 |
-
* RESOLVE #61 Horizontal transitions not working in widget
|
263 |
-
* RESOLVE #62 Bootstrap class name hide conflict
|
264 |
-
* RESOLVE #65 Widget blank options aren't saving correctly
|
265 |
-
* Update copyright year
|
266 |
-
|
267 |
-
## 2.18.2
|
268 |
-
* RESOLVE #57 Testimonials Stacking on first load
|
269 |
-
|
270 |
-
## 2.18.1
|
271 |
-
* Add FAQ How do I create a testimonial record?
|
272 |
-
* Add screenshot 21. Shortcode helpers on category and tag admin screens
|
273 |
-
* Correct Codeship image include
|
274 |
-
* jQuery 1.10+ note
|
275 |
-
* Remove "Use bxSlider?" and "Include IE7 CSS" from widget options
|
276 |
-
* Remove option "Always Load CSS?" `force_css_loading`
|
277 |
-
* Remove Travis CI configuration. Using Codeship.io instead
|
278 |
-
* Require Aihrus Framework 1.0.3
|
279 |
-
* RESOLVE #2 Add shortcode column to categories page
|
280 |
-
* RESOLVE #3 Add shortcode column to tags page
|
281 |
-
* RESOLVE #54 Notice: Constant TW_AIHR_VERSION already defined
|
282 |
-
* RESOLVE #8 Validate HTML
|
283 |
-
* RESOLVE Featured image via Gravatar not saving correctly
|
284 |
-
* RESOLVE Not passing requirements failure to premium plugin
|
285 |
-
* RESOLVE Schema output cluttered up single view
|
286 |
-
* RESOLVE Scripts not loading in footer
|
287 |
-
* Support JetPack's Publicize module
|
288 |
-
* Verbiage updates
|
289 |
-
* Widgets don't rotate notice
|
290 |
-
|
291 |
-
## 2.18.0
|
292 |
-
* Add Codeship.io status
|
293 |
-
* Check for init and theme functions to exist
|
294 |
-
* CLOSE #11 Conflicts with "Re-order posts within Categories"
|
295 |
-
* Link to Testimonials by WooThemes migrator
|
296 |
-
* Move ci to tests
|
297 |
-
* Move CSS to assets
|
298 |
-
* Move files to assets
|
299 |
-
* Move lib to includes/libraries
|
300 |
-
* Move main class to own class file
|
301 |
-
* Remove Travis CI status
|
302 |
-
* RESOLVE #43 hatom feed errors
|
303 |
-
* RESOLVE #45 Plugin Disables Itself
|
304 |
-
* RESOLVE #7 Support subdirectory testimonial landing page
|
305 |
-
* RESOLVE Non-SSL protocol used for scripts and styles
|
306 |
-
* Revise required file paths
|
307 |
-
* Specify a “Text Domain” and “Domain Path”
|
308 |
-
* Update shortcode examples
|
309 |
-
* Update verbiage
|
310 |
-
* Use $plugin_assets than $plugin_path
|
311 |
-
|
312 |
-
## 2.17.3
|
313 |
-
* RESOLVE #44 Blank testimonial between each rotating testimonial
|
314 |
-
|
315 |
-
## 2.17.2
|
316 |
-
* RESOLVE Testimonials Widget Premium load issue
|
317 |
-
* RESOLVE [Testimonial box displays as all white in widget on IE9](http://wordpress.org/support/topic/testimonial-box-displays-as-all-white-in-widget-on-ie9). Thank you [jbmoore](http://wordpress.org/support/profile/jbmoore)
|
318 |
-
|
319 |
-
## 2.17.1
|
320 |
-
* No show premium link when it's installed
|
321 |
-
* RESOLVE #34 Non-SSL protocol used for image inclusion
|
322 |
-
* Use Aihrus Framework 1.0.1
|
323 |
-
* Use aihr_check_aihrus_framework
|
324 |
-
* Use strip_protocol
|
325 |
-
|
326 |
-
## 2.17.0
|
327 |
-
* BUGFIX No notices on deactivation
|
328 |
-
* Convert TODO to https://github.com/michael-cannon/testimonials-widget/issues
|
329 |
-
* Implement PHP version checking
|
330 |
-
* Implement WordPress version checking
|
331 |
-
* Restructure readme
|
332 |
-
* Tested up to 3.9.0
|
333 |
-
|
334 |
-
## 2.16.6
|
335 |
-
* BUGFIX Widget title is same as link
|
336 |
-
|
337 |
-
## 2.16.5
|
338 |
-
* BUGFIX Setting's defaults missing during validation
|
339 |
-
|
340 |
-
## 2.16.4
|
341 |
-
* BUGFIX #1 Widget title displays "array" than link
|
342 |
-
* BUGUnreproducible Call to undefined method Testimonials_Widget::clean_string
|
343 |
-
|
344 |
-
## 2.16.3
|
345 |
-
* Check for PHP 5.3
|
346 |
-
* Move helper methods to Aihrus_Common
|
347 |
-
* Restore pre-2.0.0 auto-migration
|
348 |
-
* Use Aihrus_Common::add_media
|
349 |
-
|
350 |
-
## 2.16.2
|
351 |
-
* **Version 2.16.0 requires PHP 5.3+**
|
352 |
-
|
353 |
-
## 2.16.1
|
354 |
-
* $this to __CLASS__
|
355 |
-
|
356 |
-
## 2.16.0
|
357 |
-
* Add Expand/Collapse All Options helper for widget options - Thank you Scott Hendison
|
358 |
-
* Add Shortcodes helper page - Thank you Scott Hendison
|
359 |
-
* Add screenshot 20. Testimonials Shortcode Examples page
|
360 |
-
* Add version_check
|
361 |
-
* BUGFIX Donate notice shows despite `disable_donate` set
|
362 |
-
* BUGFIX JavaScript generated even when no testimonials
|
363 |
-
* BUGFIX Page Display of Testimonial duplicating Text - Elegant Themes' Trim theme
|
364 |
-
* BUGFIX Saving settings doesn't show update notice
|
365 |
-
* Delete notices on deactivation
|
366 |
-
* Disable schemas by default for widgets
|
367 |
-
* Enabled resetting widget options
|
368 |
-
* Mark cacheables with similar key for easier cleanup
|
369 |
-
* Rebrand Testimonials Widget as Testimonials
|
370 |
-
* Removed Testimonials Widget pre-2.0.0 migration code
|
371 |
-
* Rename no_code to show_code
|
372 |
-
* Replace JS_KEY with SLUG
|
373 |
-
* Revise Shortcode Examples formatting
|
374 |
-
* Revise short description
|
375 |
-
* Simplify display_setting
|
376 |
-
* Update TODO
|
377 |
-
* Update readme verbiage
|
378 |
-
* Update to use `TW_PLUGIN_DIR_LIB`
|
379 |
-
* Use abstract class Aihrus_Settings
|
380 |
-
* Use abstract class Aihrus_Widget
|
381 |
-
* Use aihrus framework
|
382 |
-
|
383 |
-
## 2.15.1
|
384 |
-
* BUGFIX Fatal error: Access to undeclared static property: Testimonials_Widget_Settings::$cpt_category
|
385 |
-
* Encapsulate shortcodes
|
386 |
-
* [BUGFIX](http://wordpress.org/support/topic/2151-warning-illegal-offset-type-in-isset-or-empty?replies=3) Warning: Illegal offset type in isset or empty
|
387 |
-
|
388 |
-
## 2.15.0
|
389 |
-
* Add 2.15.0 upgrade notice
|
390 |
-
* Add filter `tw_get_testimonials_html`
|
391 |
-
* Add option Always Load CSS?
|
392 |
-
* Add option Enable Video?
|
393 |
-
* Add option Start/Stop
|
394 |
-
* Add option Transition Mode
|
395 |
-
* BUGFIX JS slider_var not global
|
396 |
-
* BUGFIX active and display-none classes still included though using bxSlider
|
397 |
-
* Bump $2 donation request to $5
|
398 |
-
* Hide non-widget settings
|
399 |
-
* If upgrading, bxSlider will not be enabled by default. You must enable it in your widget and global settings. CSS customizations must be reviewed to have the `.active` and `.display-none` classes removed. The main `.testimonials-widget-testimonial` class also need the `display: none;` and `clear: left;` removed.
|
400 |
-
* Match transition defaults to those of current testimonials widget
|
401 |
-
* Move 2.14.0 transition options to Compatibility tab
|
402 |
-
* Move height options to Compatibility tab
|
403 |
-
* Moved testimonials-widget-2.14.0.css -> css/testimonials-widget-2.14.0.css
|
404 |
-
* Moved testimonials-widget-ie7.css -> css/testimonials-widget-ie7.css
|
405 |
-
* Reduce `empty` usage
|
406 |
-
* Require at least WordPress 3.6
|
407 |
-
* Simplify `wp_enqueue_style` handling
|
408 |
-
* Update .travis for phpmd exclusions
|
409 |
-
* Update FAQ
|
410 |
-
* Update PHPCS config
|
411 |
-
* Update TODO
|
412 |
-
* Use const JS_KEY
|
413 |
-
* [Auto-suggest category and tag options](http://wordpress.org/support/topic/feature-request-menus-in-the-widget)
|
414 |
-
* [Responsively set height](http://wordpress.org/support/topic/better-set-height?replies=3#post-4788316)
|
415 |
-
* [Use bxSlider JavaScript slider](http://bxslider.com/examples/auto-show-start-stop-controls) to make the transitions and navigation more slider like with a [pause button on testimonials](http://wordpress.org/support/topic/play-pause-icon-on-testimonial)
|
416 |
-
|
417 |
-
## 2.14.0
|
418 |
-
* Abstact schema generation
|
419 |
-
* Add API action tw_styles
|
420 |
-
* Add API action tw_update
|
421 |
-
* Add API filter tw_display_setting
|
422 |
-
* Add API filter tw_review_name_length
|
423 |
-
* Add API filter tw_schema
|
424 |
-
* Add API filter tw_schema_agg_rating
|
425 |
-
* Add API filter tw_schema_author
|
426 |
-
* Add API filter tw_schema_item
|
427 |
-
* Add API filter tw_schema_review
|
428 |
-
* Add Review schema date modified
|
429 |
-
* Add aggregate review data
|
430 |
-
* Add item reviewed name and url to Review schema
|
431 |
-
* Add screenshot 19. Using Review and AggregateRating schema data structures
|
432 |
-
* Added shortcode option variable names on Settings screen
|
433 |
-
* Added validate case is_true
|
434 |
-
* Auto create Review schema name from post content - like excerpt
|
435 |
-
* BUGFIX Errors show when no testimonials
|
436 |
-
* BUGFIX Javascript and CSS not carried through when testimonials are cached
|
437 |
-
* BUGFIX PHP Notice `no_code`
|
438 |
-
* BUGFIX Schema properties contain HTML and entities
|
439 |
-
* BUGFIX Testimonials go blank during rotations (javacript var)
|
440 |
-
* BUGFIX aggregate data prevents testimonials from recycling
|
441 |
-
* BUGFIX animation transitions aren't smooth
|
442 |
-
* BUGFIX correct aggregate total
|
443 |
-
* BUGFIX gravatar size not based upon image size
|
444 |
-
* BUGFIX has_archive option network_site_url
|
445 |
-
* BUGFIX missing space after itemprop="image"
|
446 |
-
* BUGFIX paging arrows not positioned correctly
|
447 |
-
* BUGFIX schema meta method doesn't handle schema property wrapping
|
448 |
-
* BUGFIX single content not wrapped with review schema
|
449 |
-
* BUGFIX single view doesn't support caching
|
450 |
-
* BUGFIX styles not included for `get_single`
|
451 |
-
* CSS wp_register_style and wp_enqueue_style slug changed from 'testimonials-widget' to 'Testimonials_Widget'
|
452 |
-
* Clean up JavaScript
|
453 |
-
* Correct Review schema name usage
|
454 |
-
* Default `do_shortcode` on
|
455 |
-
* Default enable custom taxonomy 'show_admin_column'
|
456 |
-
* Enable [rich snippets/structured data](http://wordpress.org/support/topic/lots-of-options-4?replies=3#post-4754108) per [review schema](http://schema.org/Review)
|
457 |
-
* Gravatars saved as featured images to testimonials when no featured image exists
|
458 |
-
* Implement AggregateRating, Organization, Person, Place, Review, and Thing structured data
|
459 |
-
* Move Review schema image to `get_schema`
|
460 |
-
* Prevent `has_archive` and `rewrite_slug` matching existing slugs and same
|
461 |
-
* Refactor Review schema handling with easier API use
|
462 |
-
* Refactored CSS/JS generation and inclusion
|
463 |
-
* Refactored scripts and styles handling
|
464 |
-
* Remove `refresh_interval=0`'s automatic setting of `limit=1` - Thank you Phillip Gapp
|
465 |
-
* Remove default overrides for custom post type
|
466 |
-
* Scripts `ksort` removed. Use `array_unshift` in your `tw_testimonials_js` filters instead.
|
467 |
-
* Travis ignore WordPress.WhiteSpace.ControlStructureSpacing - false positives
|
468 |
-
* Update FAQ
|
469 |
-
* Update TODO
|
470 |
-
* Update examples
|
471 |
-
* Update readme option ordering
|
472 |
-
* Update screenshots
|
473 |
-
* Update screenshots
|
474 |
-
* Update verbiage
|
475 |
-
* Validate reviewed_item_url as url
|
476 |
-
* [Load scripts and stylesheets only on Testimonials Page](http://wordpress.org/support/topic/load-scripts-and-stylesheets-only-on-testimonials-page)
|
477 |
-
* https jQuery transport
|
478 |
-
|
479 |
-
## 2.13.6
|
480 |
-
* Add IDs column to edit testimonials listing page
|
481 |
-
* Add filter `tw_settings_add_help_tabs`
|
482 |
-
* Add option Fade In Speed
|
483 |
-
* Add option Fade Out Speed
|
484 |
-
* Add settings page help tab
|
485 |
-
* BUGFIX index has_archive and rewrite_slug not set
|
486 |
-
* BUGFIX plugin_row_meta not returning default state
|
487 |
-
* IE7 CSS moved to separate file. Include via Testimonials > Settings if needed
|
488 |
-
* Localize text
|
489 |
-
* Pass YSlow and Google PageSpeed testing
|
490 |
-
* Performance optimizations
|
491 |
-
* Prevent Testimonials Widget custom post type URL slug naming conflicts
|
492 |
-
* Update premium shortcodes
|
493 |
-
* Validate URL submissions
|
494 |
-
* [Begin CSS testing](http://www.netmagazine.com/tutorials/4-tools-automatic-css-testing)
|
495 |
-
|
496 |
-
## 2.13.5
|
497 |
-
* BUGFIX Caching defaults not correct
|
498 |
-
|
499 |
-
## 2.13.4
|
500 |
-
* Add $atts parameter to filter `tw_data`
|
501 |
-
* Add action `tw_scripts`
|
502 |
-
* Add filter `tw_get_testimonial_html_class`
|
503 |
-
* Add filter `tw_testimonials_js_internal`
|
504 |
-
* BUGFIX instance numbers breaking caching
|
505 |
-
* BUGFIX settings page missing page title
|
506 |
-
* Change &$this variable calls to $this
|
507 |
-
* Enabling sorting of scripts for precedence
|
508 |
-
* Remove unused first parameter from `tw_cache_get` filter call
|
509 |
-
* Tie-in premium disable_donate option
|
510 |
-
|
511 |
-
## 2.13.3
|
512 |
-
* [Add shortcode category example](http://wordpress.org/support/topic/category-shortcode-1?replies=2#post-4550244) - Thank you ashleynlinares
|
513 |
-
* Add do shortcodes option inside of testimonials content
|
514 |
-
* BUGFIX keep shortcodes inside of widgets, let theme function handle to do them or not
|
515 |
-
* Expand FAQ section
|
516 |
-
* Rename Title to Job Title as appropriate
|
517 |
-
* Update POT
|
518 |
-
* Update TODO
|
519 |
-
|
520 |
-
## 2.13.2
|
521 |
-
* Add StillMaintained.com notice
|
522 |
-
* BUGFIX Extra meta box fields are no show
|
523 |
-
* Disengaged from hard coded wp-content path
|
524 |
-
* Escape translations
|
525 |
-
|
526 |
-
## 2.13.1
|
527 |
-
* Add demo link
|
528 |
-
* Add shortcode example explanations
|
529 |
-
* Add video introduction
|
530 |
-
* Disable animation by default
|
531 |
-
* Move localization load to init()
|
532 |
-
* Update donation request text
|
533 |
-
* Update premium features
|
534 |
-
|
535 |
-
## 2.13.0
|
536 |
-
* Add PHP Copy and Paste Detector
|
537 |
-
* Add PHP run-time checks
|
538 |
-
* Add Travis CI with PHP Code Sniffer
|
539 |
-
* Add developer README and CONTRIBUTING docs
|
540 |
-
* BUGFIX DOM Element error on last testimonial rotation
|
541 |
-
* BUGFIX Data delete on uninstall not firing
|
542 |
-
* BUGFIX Testimonials Widget edit page doesn't display custom taxonomies
|
543 |
-
* Beta test update text
|
544 |
-
* Coding standards updates
|
545 |
-
* Create TODO doc
|
546 |
-
* Disabled PHP Mess Detector
|
547 |
-
* Don't escape already escaped text
|
548 |
-
* Don't load plugin till all are loaded
|
549 |
-
* FEATURE [Animated widget rotation](http://wordpress.org/support/topic/animate-jumpy-widget)
|
550 |
-
* OPTION Add Disable animation?
|
551 |
-
* Relocate activation, deactivation, and uninstall hooks
|
552 |
-
* Remove WP_UNINSTALL_PLUGIN reference
|
553 |
-
* Remove class from settings page link
|
554 |
-
* Rename class-settings-testimonials-widget.php to class-testimonials-widget-settings.php
|
555 |
-
* Revise API doc headings
|
556 |
-
* Revise instance creators to only fire when ready
|
557 |
-
* Update Filters listing to API document
|
558 |
-
* Update POT
|
559 |
-
|
560 |
-
## 2.12.8
|
561 |
-
* Add filter `tw_cite_html` to adjust cite contents - Thank you [Dimitrios](http://visualweb.gr/) for the suggestion
|
562 |
-
* BUGFIX Warning: Illegal string offset 'exclude'
|
563 |
-
* Replace __ with esc_html__
|
564 |
-
* Update Premium features
|
565 |
-
|
566 |
-
## 2.12.7
|
567 |
-
* BUGFIX Link targets affected page navigation
|
568 |
-
* Removed donate monthly show code
|
569 |
-
|
570 |
-
## 2.12.6
|
571 |
-
* BUGFIX If no refresh_interval, then LIMIT 1
|
572 |
-
* Change donate from $1 to $2 due to fees
|
573 |
-
* Dashboard testimonials count statistics
|
574 |
-
* Display donate on major/minor version release or if it's been a month
|
575 |
-
* Remove braces from simple if/else structures
|
576 |
-
* Settings page inheritance note
|
577 |
-
* Update premium features listing
|
578 |
-
* Use donate button than text
|
579 |
-
|
580 |
-
## 2.12.5
|
581 |
-
* BUGFIX Correct loose vs strict comparison for intval and absint
|
582 |
-
* If no refresh_interval, then LIMIT 1
|
583 |
-
|
584 |
-
## 2.12.4
|
585 |
-
* BUGFIX Settings jQuery UI Tabs conflict
|
586 |
-
* NOT BUG [WPML bug](http://wordpress.org/support/topic/wpml-bug?replies=1)
|
587 |
-
* Remove settings.css
|
588 |
-
* Settings about section height fix
|
589 |
-
* TODOs update
|
590 |
-
* Update Premium product page URL
|
591 |
-
* Update WPML configuration
|
592 |
-
* Use PayPal donate image in settings
|
593 |
-
|
594 |
-
## 2.12.3
|
595 |
-
* BUGFIX Import option constantly overrides settings
|
596 |
-
* BUGFIX [Error When Database Does Not Exist Yet](http://wordpress.org/support/topic/error-when-database-does-not-exist-yet)
|
597 |
-
|
598 |
-
## 2.12.2
|
599 |
-
* $1 donation link admin_notice on installation or major/minor update
|
600 |
-
* Add forum responses cheat sheet
|
601 |
-
* Auto flush URLs if archive or testimonial slugs change
|
602 |
-
* BUGFIX Respect attribute settings by preventing reset_defaults and importexport activating on front-end
|
603 |
-
* Convert slug, slugs, and term setting items to lowercase on save
|
604 |
-
* Correctly delete all testimonials options on delete
|
605 |
-
* Don't create class instance unless plugin is activated
|
606 |
-
* FEATURE Allow for custom post type categories and tags [Idea via crdunst](http://wordpress.org/support/topic/feedback-tagscategories?replies=3#post-4160839)
|
607 |
-
* Prevent same has_archive and rewrite_slug which causes URL problems
|
608 |
-
* Remove excess FAQ text
|
609 |
-
* Remove unused settings and methods
|
610 |
-
* Remove unused testing settings
|
611 |
-
* Set version for which admin notice to display
|
612 |
-
|
613 |
-
## 2.12.1
|
614 |
-
* BUGFIX Settings memory leak [Sites hosed after update 2.12.0](http://wordpress.org/support/topic/premium-sites-hosed-after-update-2120)
|
615 |
-
* BUGFIX [importexport settings failure](http://wordpress.org/support/topic/errors-after-updating)
|
616 |
-
* Change update warning verbiage
|
617 |
-
* Update FAQ & support links to knowledge base
|
618 |
-
|
619 |
-
## 2.12.0
|
620 |
-
* Add file headers to lib/class*
|
621 |
-
* Add filter tw_widget_options to alter displayed widget options
|
622 |
-
* BUGFIX Correct settings required validation `break 2`
|
623 |
-
* BUGFIX Non-static method Testimonials_Widget::get_testimonials_html() should not be called statically
|
624 |
-
* CSS rename testimonialswidget_testimonial(s) to testimonials-widget-testimonial(s)
|
625 |
-
* Correct static get_testimonials_html, get_testimonials_htmls, widget_options function declaration
|
626 |
-
* Correct static validators call
|
627 |
-
* Explain options inheritance
|
628 |
-
* FEATURE Remove Plugin Data on Deletion? - Delete all Testimonials Widget data and options from database on plugin deletion
|
629 |
-
* FEATURE Settings export/import
|
630 |
-
* Refactor out get_quote and get_cite from get_testimonial_html
|
631 |
-
* Refactor excess settings grab in widget_options
|
632 |
-
* Remove $blank from testimonials_truncate()
|
633 |
-
* Remove unused code
|
634 |
-
* Rename metabox.class.php class-redrokk-metabox-class.php
|
635 |
-
* Rename settings.testimonials-widget.php class-settings-testimonials-widget.php
|
636 |
-
* Rename testimonials-widget-widget.php class-testimonials-widget-widget.php
|
637 |
-
* Revise FAQ
|
638 |
-
* SCREENSHOT 17. Testimonials Widget Settings > Compatibility & Reset tab
|
639 |
-
* Show latest updates notice on activation
|
640 |
-
* Spellcheck readme.txt
|
641 |
-
* Update CSS for WordPress Coding standards
|
642 |
-
* Update FAQ
|
643 |
-
* Update JavaScript for WordPress Coding standards
|
644 |
-
* Update PHP for WordPress Coding Standards
|
645 |
-
* Update POT
|
646 |
-
* Update TODOs
|
647 |
-
* Update premium features
|
648 |
-
* Update rulesets
|
649 |
-
* Use ID for widget
|
650 |
-
|
651 |
-
## 2.11.3
|
652 |
-
* BUGFIX [Can't set featured image](http://wordpress.org/support/topic/cant-set-featured-image-3)
|
653 |
-
* Begin WordPress coding standard cleanup
|
654 |
-
* Bold option headers
|
655 |
-
* Change `has_archive` default from `testimonials` to `testimonials-archive`
|
656 |
-
* Clean up static method calls to prevent PHP Strict notices
|
657 |
-
* Correct filter name `tw_next_posts_link` to `tw_next_posts_link_text`
|
658 |
-
* Correct static methods calling
|
659 |
-
* Secure activation, deactivation, uninstall operations
|
660 |
-
* Update POT
|
661 |
-
* Update profile
|
662 |
-
|
663 |
-
## 2.11.2
|
664 |
-
* Add `min1` and `nozero` validation
|
665 |
-
* Always include settings class
|
666 |
-
* BUGFIX Don't prepend http to email addresses
|
667 |
-
* Move lesser used widget options to expandable Additional Widget Options section
|
668 |
-
* Move settings setup to `init`
|
669 |
-
* Revise `absint` and `intval` validation to default on blank entry
|
670 |
-
* Update POT
|
671 |
-
* Update TODO
|
672 |
-
* Update text domain for localization and POT
|
673 |
-
* Use `links_add_target` for widget title link
|
674 |
-
|
675 |
-
## 2.11.1
|
676 |
-
* BUGFIX [Fatal error: Testimonials_Widget_Settings](http://wordpress.org/support/topic/fatal-error-tw_settings)
|
677 |
-
|
678 |
-
## 2.11.0
|
679 |
-
* Add Option "Hide Image in Single View?" `hide_image_single`
|
680 |
-
* Add `.author` and `.email` to CSS
|
681 |
-
* Add `.single` to single view testimonials
|
682 |
-
* Add location to meta_key ordering options
|
683 |
-
* BUGFIX [Convert q tags to blockquote](http://wordpress.org/support/topic/open-link-in-new-tab-html-validation) [Why?](http://www.w3schools.com/tags/tag_blockquote.asp)
|
684 |
-
* BUGFIX [Fix cite tag usage - it's title, not source](http://www.w3.org/html/wg/drafts/html/master/text-level-semantics.html#the-cite-element) using [T](http://html5doctor.com/blockquote-q-cite/) [BD](http://oli.jp/2011/blockquote/)
|
685 |
-
* Beta testers needed section added
|
686 |
-
* Disable self-generated quotation marks
|
687 |
-
* Enable backwards compatibility for default options
|
688 |
-
* Ignore init() during AJAX and autosave operations
|
689 |
-
* Optimize DB after uninstall
|
690 |
-
* Rename CSS attributes to credit
|
691 |
-
* Revise README verbiage in general
|
692 |
-
* Simplify CSS naming
|
693 |
-
* Update Allow Comments verbiage
|
694 |
-
* Update TODOs
|
695 |
-
* Update features listing
|
696 |
-
* Update options listing
|
697 |
-
* Update premium features
|
698 |
-
* Update readme formatting
|
699 |
-
|
700 |
-
## 2.10.3
|
701 |
-
* Add "Menu Order" to Order By options
|
702 |
-
* Add Height option to automatically set min and max height
|
703 |
-
* BUGFIX [Only one testimonial displaying](http://wordpress.org/support/topic/only-one-testimonial-displaying)
|
704 |
-
* BUGFIX [Post Types Order](http://wordpress.org/support/topic/random-order-doesnt-work) - sorting conflict
|
705 |
-
* Delete data on uninstall
|
706 |
-
* Enable quotes and join for IE7 - Thank you [SFMichael](http://wordpress.org/support/topic/ie-7-quotes-fix)
|
707 |
-
* Flush URLs on deactivation
|
708 |
-
* Revise self::$base usage
|
709 |
-
* Revise settings_link handling
|
710 |
-
* Screenshot 16 Testimonials Widget Settings > Widget tab
|
711 |
-
* Update Premium link
|
712 |
-
* Update TODOs
|
713 |
-
|
714 |
-
## 2.10.2
|
715 |
-
* BUGFIX Settings initialization overwrote previous settings
|
716 |
-
|
717 |
-
## 2.10.1
|
718 |
-
* Moved [FAQ](http://aihr.us/testimonials-widget/faq/)
|
719 |
-
* Removed premium screenshots
|
720 |
-
* Rename screenshot-3.png screenshot-2.png
|
721 |
-
* Rename screenshot-4.png screenshot-3.png
|
722 |
-
* Rename screenshot-5.png screenshot-4.png
|
723 |
-
* Rename screenshot-6.png screenshot-5.png
|
724 |
-
* Rename screenshot-7.png screenshot-6.png
|
725 |
-
* Rename screenshot-8.png screenshot-7.png
|
726 |
-
* Rename screenshot-13.png screenshot-8.png
|
727 |
-
* Rename screenshot-14.png screenshot-9.png
|
728 |
-
* Rename screenshot-21.png screenshot-10.png
|
729 |
-
* Rename screenshot-22.png screenshot-11.png
|
730 |
-
* Rename screenshot-23.png screenshot-12.png
|
731 |
-
* Rename screenshot-24.png screenshot-13.png
|
732 |
-
* Rename screenshot-25.png screenshot-14.png
|
733 |
-
* Rename screenshot-26.png screenshot-15.png
|
734 |
-
* Screenshot 2 removed
|
735 |
-
* Screenshot 9 removed
|
736 |
-
* Screenshot 10 removed
|
737 |
-
* Screenshot 11 removed
|
738 |
-
* Screenshot 12 removed
|
739 |
-
* Screenshot 15 removed
|
740 |
-
* Screenshot 16 removed
|
741 |
-
* Screenshot 17 removed
|
742 |
-
* Screenshot 18 removed
|
743 |
-
* Screenshot 19 removed
|
744 |
-
* Screenshot 20 removed
|
745 |
-
* Screenshot 27 removed
|
746 |
-
* Screenshot 28 removed
|
747 |
-
|
748 |
-
## 2.10.0
|
749 |
-
* Add `hide_content` option verbiage
|
750 |
-
* Add screenshot 27 `[[testimonialswidgetpremium_form]]` – Add a Testimonial
|
751 |
-
* Add screenshot 28 Testimonials Widget Settings > Entry Form tab
|
752 |
-
* Added rel="nofollow" to URL - Thank you Nicholas Corrieri for the suggestion
|
753 |
-
* Convert validation to configuration
|
754 |
-
* Correct breakline on radio settings display
|
755 |
-
* Correct checkbox checking
|
756 |
-
* Correct paging handling
|
757 |
-
* Correct post_status selection for single view
|
758 |
-
* Describe settings defaults
|
759 |
-
* Dutch translation by Bjorn Robijns
|
760 |
-
* Enable echo/return for display_setting
|
761 |
-
* Enable file input for settings
|
762 |
-
* Enable widget options no-show
|
763 |
-
* Finish validation configuration move
|
764 |
-
* Form demo link
|
765 |
-
* Move Changelog to changelog.txt
|
766 |
-
* Rename load_sections > _sections
|
767 |
-
* Rename load_settings > settings
|
768 |
-
* Save option defaults
|
769 |
-
* Set missing checkbox values to 0 on validate
|
770 |
-
* TODO Delete data option on deactivation
|
771 |
-
* Update Premium description
|
772 |
-
* Update WPML configuration
|
773 |
-
|
774 |
-
## 2.9.1
|
775 |
-
* BUGFIX Assigning the return value of new by reference is deprecated in metabox.class.php
|
776 |
-
|
777 |
-
## 2.9.0
|
778 |
-
* Add location meta field after title
|
779 |
-
* Add location related options
|
780 |
-
* FAQ 18, 34, 35 update
|
781 |
-
* Screenshot 2, 4, 5 updated
|
782 |
-
* Update POT
|
783 |
-
|
784 |
-
## 2.8.4
|
785 |
-
* BUGFIX [Title link does not allow a relative link](http://wordpress.org/support/topic/title-link-does-not-allow-a-relative-link)
|
786 |
-
|
787 |
-
## 2.8.3
|
788 |
-
* BUGFIX [Selection > Category Filter doesn't remember >1 category](http://wordpress.org/support/topic/selection-category-filter-doesnt-remember-1-category)
|
789 |
-
* FAQ 67 testimonials paging doesn't work
|
790 |
-
* FAQ 68 feature XYZ
|
791 |
-
|
792 |
-
## 2.8.2
|
793 |
-
* Add filter `tw_version`
|
794 |
-
* Screenshot 11/16 updated
|
795 |
-
* Update POT
|
796 |
-
* Update Premium features
|
797 |
-
* Version tracking for default settings
|
798 |
-
|
799 |
-
## 2.8.1
|
800 |
-
* Customizable archive and testimonial URLs
|
801 |
-
* FAQ 66 Change the testimonials archive or single view URL
|
802 |
-
* Optional commenting on testimonial single-view pages
|
803 |
-
* Screenshot 26 Testimonials Widget Settings > Post Type tab
|
804 |
-
* Update POT
|
805 |
-
|
806 |
-
## 2.8.0
|
807 |
-
* Merge in settings branch
|
808 |
-
* Add `tw_get_options`
|
809 |
-
* Add filter `tw_sections` – Alter section options
|
810 |
-
* Add filter `tw_settings` – Alter setting options
|
811 |
-
* Add settings page 'Selection', 'Ordering', and 'Widget' tabs
|
812 |
-
* BUG with "Post Types Order"
|
813 |
-
* BUGFIX paging when not in singular view
|
814 |
-
* Configure settings within Testimonials_Widget_Settings class
|
815 |
-
* Enable 'Expand/Collapse' view in Widget options
|
816 |
-
* FAQ 65 Disable the stylesheet
|
817 |
-
* FEATURE Remove `.hentry` CSS?
|
818 |
-
* FEATURE Testimonials Widget Settings screen
|
819 |
-
* Removed filters `tw_options_update`, `tw_options_form`
|
820 |
-
* Rename `widget_text` to `bottom_text`
|
821 |
-
* Revise About page content
|
822 |
-
* Revise Settings page footer
|
823 |
-
* Revise widget options update and validation
|
824 |
-
* Screenshot 11 updated
|
825 |
-
* Screenshot 16 updated
|
826 |
-
* Screenshot 2 updated
|
827 |
-
* Screenshot 22 Testimonials Widget Settings > General tab
|
828 |
-
* Screenshot 23 Expanded 'Selection Options' Testimonials Widget
|
829 |
-
* Screenshot 24 Expanded 'Ordering Options' Testimonials Widget
|
830 |
-
* Screenshot 25 Testimonials Widget Settings > Selection tab
|
831 |
-
* Screenshot 3 updated
|
832 |
-
* Screenshot 4 updated, Expanded 'General Options' Testimonials Widget
|
833 |
-
* Update "Shortcode and Widget Options" verbiage
|
834 |
-
* Update POT file
|
835 |
-
* Use defaults via Testimonials_Widget_Settings class
|
836 |
-
* Validate shortcode and widget options via Testimonials_Widget_Settings::validate_settings
|
837 |
-
* Verbiage updates
|
838 |
-
|
839 |
-
## 2.7.17
|
840 |
-
* Add purchase Testimonials Widget Premium plugin meta link
|
841 |
-
* Begin settings screen work
|
842 |
-
* FAQ 20 Update
|
843 |
-
* FAQ 31 Update
|
844 |
-
* FAQ 63 Remove the cite –
|
845 |
-
* FAQ 64 Plugin conflict
|
846 |
-
* Screenshot 21 Poedit Catalog properties
|
847 |
-
* TODO class removal
|
848 |
-
* Update localization verbiage
|
849 |
-
|
850 |
-
## 2.7.16
|
851 |
-
* Add comments panel to edit screen - [Thank you BarrieSpence](http://wordpress.org/support/topic/disable-comments-10?replies=1)
|
852 |
-
* TODO Admin panel
|
853 |
-
|
854 |
-
## 2.7.15
|
855 |
-
* Add "CSS class" to widget options window
|
856 |
-
* FAQ 31/34/35/50/53/55 updates
|
857 |
-
* FAQ 61 Determine .testimonialswidget_testimonialsNNN
|
858 |
-
* FAQ 62 Category and tag selection
|
859 |
-
* Feature updates
|
860 |
-
* Localization, Hebrew
|
861 |
-
* Screenshot 3 updated
|
862 |
-
|
863 |
-
## 2.7.14
|
864 |
-
* BUGFIX [Testimonials archive view URL conflicts with Page slug](http://wordpress.org/support/topic/testimonials-archive-view-url-conflicts-with-page-slug)
|
865 |
-
* FAQ 1 Update - Thank you [aaaronscat](http://wordpress.org/support/topic/writing-php-to-display-rotating-widget-in-a-template) for the inspiration
|
866 |
-
* FAQ 60 Download older versions of Testimonials Widget
|
867 |
-
* Premium feature update
|
868 |
-
* Screenshot 20 added
|
869 |
-
|
870 |
-
## 2.7.13
|
871 |
-
* Adapt for `mb_strcut` and `mb_strlen` alternatives
|
872 |
-
* BUGFIX [Widget doesn't appear](http://wordpress.org/support/topic/widget-doesnt-appear-1)
|
873 |
-
* Update POT
|
874 |
-
|
875 |
-
## 2.7.12
|
876 |
-
* Change Aihrus support email to contact form
|
877 |
-
* FAQ 1 Update - Thank you [aaaronscat](http://wordpress.org/support/topic/writing-php-to-display-rotating-widget-in-a-template) for the inspiration
|
878 |
-
* Update Testimonials Widget Premium URL
|
879 |
-
|
880 |
-
## 2.7.11
|
881 |
-
* Citation styling note
|
882 |
-
* Removed sub-category shortcode example
|
883 |
-
* Thanks to Joe Weber for asset header
|
884 |
-
* Update premium URL
|
885 |
-
* Update premium features
|
886 |
-
* Update premium purchase URL
|
887 |
-
|
888 |
-
## 2.7.10
|
889 |
-
* BUGFIX extra excerpt in single view
|
890 |
-
* Screenshot 11 updated
|
891 |
-
* Update premium features
|
892 |
-
|
893 |
-
## 2.7.9
|
894 |
-
* Revise content truncation to respect HTML tags
|
895 |
-
* Update premium description
|
896 |
-
* Update premium features
|
897 |
-
|
898 |
-
## 2.7.8
|
899 |
-
* Add `before` and `after` options to `paging`
|
900 |
-
* FAQ 58 Specify testimonials per page or section
|
901 |
-
* FAQ 59 Rotating widget show all testimonials than only one at a time
|
902 |
-
* Revert on-demand CSS to always included
|
903 |
-
* Support process and donation update
|
904 |
-
* Thank you to [mkearns](http://wordpress.org/support/topic/just-excellent-3) for specifying a sub-category shortcode example
|
905 |
-
* Update premium URL
|
906 |
-
* Update premium features
|
907 |
-
|
908 |
-
## 2.7.7
|
909 |
-
* FAQ 13 Update
|
910 |
-
* FAQ 31 Update
|
911 |
-
* Shortcode examples "[[" to "["
|
912 |
-
|
913 |
-
## 2.7.6
|
914 |
-
* Add `[[testimonialswidget_widget]]` to Shortcodes column
|
915 |
-
* CSS cite `margin-top` adjustment
|
916 |
-
* Enable testimonials archive view
|
917 |
-
* FAQ 1 Update
|
918 |
-
* FAQ 52 Update
|
919 |
-
* FAQ 53 Update
|
920 |
-
* FAQ 55 Style page and instance testimonials
|
921 |
-
* FAQ 56 Testimonials archive view URL
|
922 |
-
* FAQ 57 Testimonial single view URL
|
923 |
-
* Only include CSS if testimonials instance called
|
924 |
-
* Screenshot 19 `[[testimonialswidget_widget unique=true]]` Show multiple testimonials in rotation
|
925 |
-
* Set arg defaults via `defaults`
|
926 |
-
|
927 |
-
## 2.7.5
|
928 |
-
* BUGFIX PHP Warning for new fields in widget when widget already exists
|
929 |
-
* Exclude IDs option
|
930 |
-
* Implement instance tracking
|
931 |
-
* Protect shortcode examples
|
932 |
-
* Update asset header size
|
933 |
-
* Update premium features
|
934 |
-
|
935 |
-
## 2.7.4
|
936 |
-
* Asset header help request
|
937 |
-
* Premium feature updates
|
938 |
-
* Screenshot 9 updated
|
939 |
-
* Screenshot 10 replaced
|
940 |
-
* Screenshot 11 updated
|
941 |
-
* Screenshot 15 updated
|
942 |
-
* Screenshot 17 Single `[[testimonialswidget_list]]` entry with and without 'Read more' link
|
943 |
-
* Screenshot 18 `[[testimonialswidgetpremium_count]]` Examples
|
944 |
-
|
945 |
-
## 2.7.3
|
946 |
-
* Apply quotes only around testimonial content
|
947 |
-
* FAQ 13 update
|
948 |
-
* FAQ 34 update
|
949 |
-
* FAQ 35 update
|
950 |
-
* Screenshot 8 replaced
|
951 |
-
* Simplified quotes handling
|
952 |
-
* Upgrade notification
|
953 |
-
|
954 |
-
## 2.7.2
|
955 |
-
* FAQ 54 update
|
956 |
-
* Screenshot 12 update
|
957 |
-
* Screenshot 16 Edit testimonial with "Excerpt" and "Read More Link" fields - Testimonials Widget Premium plugin
|
958 |
-
|
959 |
-
## 2.7.1
|
960 |
-
* Description update
|
961 |
-
* FAQ 1 update
|
962 |
-
* FAQ 2 update
|
963 |
-
* FAQ 4 update
|
964 |
-
* FAQ 5 update
|
965 |
-
* FAQ 6 update
|
966 |
-
* FAQ 7 update
|
967 |
-
* FAQ 8 update
|
968 |
-
* FAQ 9 update
|
969 |
-
* FAQ 12 update
|
970 |
-
* FAQ 14 update
|
971 |
-
* FAQ 15 update
|
972 |
-
* FAQ 17 update
|
973 |
-
* FAQ 22 update
|
974 |
-
* FAQ 25 update
|
975 |
-
* FAQ 26 update
|
976 |
-
* FAQ 30 update
|
977 |
-
* FAQ 32 update
|
978 |
-
* FAQ 34 update
|
979 |
-
* FAQ 35 update
|
980 |
-
* FAQ 37 update
|
981 |
-
* FAQ 53 update
|
982 |
-
* Feature update
|
983 |
-
* Installation update
|
984 |
-
* Screenshot 1 update
|
985 |
-
* Screenshot 2 update
|
986 |
-
* Screenshot 3 update
|
987 |
-
* Screenshot 4 update
|
988 |
-
* Screenshot 5 update
|
989 |
-
* Screenshot 6 update
|
990 |
-
* Screenshot 7 update
|
991 |
-
* Screenshot 8 replaced
|
992 |
-
* Screenshot 9 replaced
|
993 |
-
* Screenshot 12 update
|
994 |
-
* Screenshot 15 update
|
995 |
-
* Screenshot 16 removed
|
996 |
-
* Screenshot 17 removed
|
997 |
-
* Screenshot 18 removed
|
998 |
-
|
999 |
-
## 2.7.0
|
1000 |
-
* FAQ 13 Update
|
1001 |
-
* FAQ 54 Release early. Release often.
|
1002 |
-
* Redo content opening and closing quotes display
|
1003 |
-
* Upgrade notification for 2.7.0
|
1004 |
-
|
1005 |
-
## 2.6.6
|
1006 |
-
* Remove CSS `overflow: auto` - too many complaints
|
1007 |
-
* FAQ 53 Scroll widget based testimonial content
|
1008 |
-
|
1009 |
-
## 2.6.5
|
1010 |
-
* BUGFIX: overflow auto than scroll
|
1011 |
-
* Correct screenshot 11 & 18
|
1012 |
-
|
1013 |
-
## 2.6.4
|
1014 |
-
* Add filters `tw_posts_custom_column`, `tw_columns`, `tw_meta_box`
|
1015 |
-
* BUGFIX Testimonial posts page column URL now correctly clickable
|
1016 |
-
* Code spacing cleanup
|
1017 |
-
* Enabled [scrolling text](http://wordpress.org/support/topic/plugin-testimonials-widget-scroll-for-a-single-but-long-testimonial) for maximum height restricted testimonial widgets
|
1018 |
-
* FAQ 34/35 CSS styling update
|
1019 |
-
* Scrolling testimonials for maximum height restricted widgets
|
1020 |
-
* Testimonials have `get_post_class` applied
|
1021 |
-
* Update premium features
|
1022 |
-
|
1023 |
-
## 2.6.3
|
1024 |
-
* Add filter `tw_query_args`
|
1025 |
-
* Add filters `tw_testimonials_css`, `tw_testimonials_js`
|
1026 |
-
* Allow `limit=-1`
|
1027 |
-
* BUGFIX Repeated footer CSS and JavaScript
|
1028 |
-
* CSS - block disply widget image
|
1029 |
-
* FAQ 52 Include testimonies in archive view
|
1030 |
-
* Refactor `get_query_args` out of `get_testimonials`
|
1031 |
-
* Revise JavaScript handling
|
1032 |
-
* Screenshot 17 `require_image`, `minimum_length` and `maximum_length` shortcode option examples
|
1033 |
-
* Screenshot 18 Widget with 'Next testimonial…' link
|
1034 |
-
* Update POT
|
1035 |
-
* Update premium features
|
1036 |
-
* Update premium screenshots
|
1037 |
-
|
1038 |
-
## 2.6.2
|
1039 |
-
* Compatible with WordPress 3.6
|
1040 |
-
* Fix single view PHP warning
|
1041 |
-
|
1042 |
-
## 2.6.1
|
1043 |
-
* Add filter `tw_testimonial_html_single_content`
|
1044 |
-
* Add `force_pad` option to `testimonials_truncate`
|
1045 |
-
* Copyright year update
|
1046 |
-
* Update Premium features
|
1047 |
-
|
1048 |
-
## 2.6.0
|
1049 |
-
* Add FAQ 51 filter `tw_get_testimonial_html` usage
|
1050 |
-
* FAQ 50 Revise
|
1051 |
-
* Reorganize `get_testimonial_html`
|
1052 |
-
|
1053 |
-
## 2.5.6
|
1054 |
-
* Add FAQ 50 Example to set widget gradient background color
|
1055 |
-
* FAQ 13 Update
|
1056 |
-
* FAQ 20 Add PHP tags
|
1057 |
-
* FAQ 48 Code correction
|
1058 |
-
* FAQ 49 Code correction
|
1059 |
-
|
1060 |
-
## 2.5.5
|
1061 |
-
* Enable widget caching
|
1062 |
-
* Refactor `get_testimonials_html` to break out CSS/JS generation
|
1063 |
-
* Respect [meta capabilities](http://wordpress.org/support/topic/plugin-testimonials-widget-version-20-rewrite-suggestions-request?replies=18#post-3359157)
|
1064 |
-
* Revise TODO text
|
1065 |
-
* TODO remove Template engine - see `tw_testimonial_html*` filters
|
1066 |
-
|
1067 |
-
## 2.5.4
|
1068 |
-
* Add filter `tw_testimonial_html_single`
|
1069 |
-
* Add filter `tw_testimonial_html`
|
1070 |
-
* Aihrus testimonial URL correction
|
1071 |
-
* FAQ 34 Find `testimonialswidget_testimonialsNNN` instance naming
|
1072 |
-
* FAQ 48 Customize testimonial list/widget output
|
1073 |
-
* FAQ 49 Customize testimonial single output
|
1074 |
-
|
1075 |
-
## 2.5.3
|
1076 |
-
* Add donate link in plugin section
|
1077 |
-
* Donate links
|
1078 |
-
|
1079 |
-
## 2.5.2
|
1080 |
-
* Aihrus branding
|
1081 |
-
|
1082 |
-
## 2.5.1
|
1083 |
-
* Update POT file
|
1084 |
-
|
1085 |
-
## 2.5.0
|
1086 |
-
* Add option Keep whitespace? - Thank you [kangchenjunga](http://wordpress.org/support/topic/optional-wpautop-functionality-for-better-formatting?replies=2) for the suggestion
|
1087 |
-
* Revise FAQ 47
|
1088 |
-
* Screenshot 16 - Widget whitespace kept
|
1089 |
-
* Update Author URL
|
1090 |
-
|
1091 |
-
## 2.4.8
|
1092 |
-
* Donate to purchase verbiage change - One bad experience ruins it for all
|
1093 |
-
* FAQ 47 testimonials list in a widget
|
1094 |
-
* TODO Add location field
|
1095 |
-
* TODO Add plugin donate link
|
1096 |
-
* [CleanCSS](http://cleancss.com/) the CSS
|
1097 |
-
|
1098 |
-
## 2.4.7
|
1099 |
-
* Add filter `tw_defaults_single`
|
1100 |
-
* TODO clean up for premium version
|
1101 |
-
* TODO Optional wpautop functionality for better formatting
|
1102 |
-
|
1103 |
-
## 2.4.6
|
1104 |
-
* Add 'No order' as an Order By widget option
|
1105 |
-
* Add FAQ 45 testimonial character limit
|
1106 |
-
* Add Recommendation heading
|
1107 |
-
* FAQ 23 mention 404
|
1108 |
-
* FAQ 46 testimonial ordering by given IDs
|
1109 |
-
* Update filters listing
|
1110 |
-
* Use `posts_results` filter to put posts in same orders as post__in when orderby=none
|
1111 |
-
|
1112 |
-
## 2.4.5
|
1113 |
-
* BUGFIX Missing CSS for testimonialswidget_join_title
|
1114 |
-
* FAQ 44 Refresh interval - Thank you [biztips](http://wordpress.org/support/topic/fatal-error-558?replies=6#post-3475595)
|
1115 |
-
|
1116 |
-
## 2.4.4
|
1117 |
-
* Add screenshot 15
|
1118 |
-
* FAQ 34 Update CSS
|
1119 |
-
* FAQ 35 Update CSS
|
1120 |
-
* FAQ 42 Exclude testimonial categories from Category widget
|
1121 |
-
* FAQ 43 Exclude testimonial categories from my sitemap
|
1122 |
-
* Update premium features
|
1123 |
-
|
1124 |
-
## 2.4.3
|
1125 |
-
* Adjust default `limit` to 10 from 25
|
1126 |
-
* Add CSS `margin-top` to `cite`, `.testimonialswidget_extra` and `.testimonialswidget_text`
|
1127 |
-
* BUGFIX [Keep `widget_text` with each testimonial](http://wordpress.org/support/topic/images-not-showin?replies=10)
|
1128 |
-
* Donate link update
|
1129 |
-
* FAQ 41 Widget height consistency
|
1130 |
-
|
1131 |
-
## 2.4.2
|
1132 |
-
* BUGFIX [No image](http://wordpress.org/support/topic/update-17?replies=4) in [widget](http://wordpress.org/support/topic/plugin-testimonials-widget-short-rotating-testimonial-link-to-the-full-testimonial?replies=16)
|
1133 |
-
* TODO Add refactor `get_testimonials_html`
|
1134 |
-
|
1135 |
-
## 2.4.1
|
1136 |
-
* BUGFIX `testimonialswidget_widget` always random
|
1137 |
-
* Comment and verbiage cleanups
|
1138 |
-
* Minor refactor of `get_testimonial_html`
|
1139 |
-
* TODO Added Template engine
|
1140 |
-
|
1141 |
-
## 2.4.0
|
1142 |
-
* FAQ 39 Style the custom widget text
|
1143 |
-
* FAQ 40 Page number pagination
|
1144 |
-
* FEATURE Custom widget text
|
1145 |
-
* FEATURE Make the widget title clickable
|
1146 |
-
* FEATURE Page numbers via WP-PageNavi
|
1147 |
-
* Refactor paging to use WordPress functions
|
1148 |
-
* SCREENSHOT 12 recrop
|
1149 |
-
* SCREENSHOT 13 Widget with clickable title and custom text/HTML on bottom
|
1150 |
-
* SCREENSHOT 14 WP-PageNavi compatible for page numbers than default arrows
|
1151 |
-
* SCREENSHOT 3 update
|
1152 |
-
* SCREENSHOT 4 update
|
1153 |
-
* TODO Remove Custom widget text - added
|
1154 |
-
* TODO Remove Make the widget title clickable - added
|
1155 |
-
* TODO Remove Page numbers - added
|
1156 |
-
* TODO Remove fields to show - done via theme
|
1157 |
-
|
1158 |
-
## 2.3.4
|
1159 |
-
* BUGFIX [Testimonial plugin means Set Feature Image Not Displaying](http://wordpress.org/support/topic/testimonial-plugin-means-set-feature-image-not-displaying)
|
1160 |
-
* Test with WordPress 3.5.0RC1
|
1161 |
-
* TODO remove Publish & New - just click 'New Testimonial' after Publishing
|
1162 |
-
* Update donate link
|
1163 |
-
|
1164 |
-
## 2.3.3
|
1165 |
-
* FEATURE Improved single page view
|
1166 |
-
* SCREENSHOT Single testimonial view
|
1167 |
-
* TODO Meta capabilities
|
1168 |
-
|
1169 |
-
## 2.3.2
|
1170 |
-
* Add filters `tw_options_update`, `tw_options_form`
|
1171 |
-
* BUGFIX ["featured image" module disappeared](http://wordpress.org/support/topic/no-image-upload?replies=12#post-3423001)
|
1172 |
-
* Clean up tags per [plugin guidelines](http://wordpress.org/extend/plugins/about/guidelines/)
|
1173 |
-
* Combine source and url display when no email or company
|
1174 |
-
* FAQ renumber second 36 to 37
|
1175 |
-
* FAQ 38 Use filter `tw_defaults`
|
1176 |
-
* FEATURE Centralized defaults via filter `tw_defaults`
|
1177 |
-
* Only grab `paged` information once
|
1178 |
-
* Prepend HTTP protocol if missing in URL
|
1179 |
-
* SCREENSHOT Widget Premium Options
|
1180 |
-
* Simplify filter `tw_content`
|
1181 |
-
* Simplify read more ellipsis
|
1182 |
-
* Trim content after formatting
|
1183 |
-
|
1184 |
-
## 2.3.1
|
1185 |
-
* BUGFIX [No image upload](http://wordpress.org/support/topic/no-image-upload)
|
1186 |
-
* FAQ 36 Why donate?
|
1187 |
-
|
1188 |
-
## 2.3.0
|
1189 |
-
* BUGFIX No paging when cached
|
1190 |
-
* FAQ 3 Check for empty $data
|
1191 |
-
* FAQ 33 Change more content ellipsis
|
1192 |
-
* FAQ 34/35 Clarify CSS classes
|
1193 |
-
* FAQ 36 Configure Next and Previous page indicators
|
1194 |
-
* FEATURE (Premium) [Read More links](http://wordpress.org/support/topic/plugin-testimonials-widget-short-rotating-testimonial-link-to-the-full-testimonial) to [full testimonial page](http://wordpress.org/support/topic/very-easy-to-use-moderately-easy-to-style)
|
1195 |
-
* FEATURE Easier to configure Next and Previous page indicators
|
1196 |
-
* Refactor `get_testimonial_html`
|
1197 |
-
* Refactor testimonial HTML creation methods
|
1198 |
-
* Remove "Read more…" preparations
|
1199 |
-
* Replace `testimonials_truncate` with WordPress's `wp_trim_words`
|
1200 |
-
* SCREENSHOTS 'Read more' links
|
1201 |
-
* Sanitize names
|
1202 |
-
* TEMP Prevent widget caching
|
1203 |
-
* TODO Clarify 'Read more'
|
1204 |
-
* TODO Remove - CSV Export
|
1205 |
-
* TODO Updates
|
1206 |
-
* Update POT file
|
1207 |
-
|
1208 |
-
## 2.2.9
|
1209 |
-
* BUGFIX [Testimonial List Loading 2nd Blank Box](http://wordpress.org/support/topic/testimonial-list-loading-2nd-blank-box)
|
1210 |
-
|
1211 |
-
## 2.2.8
|
1212 |
-
* Begin "Read more…" preparations
|
1213 |
-
* Correct content display processing
|
1214 |
-
* FAQ 32 Min-height usage
|
1215 |
-
* FAQ 4 Custom code placement clarification
|
1216 |
-
* TODO Updates
|
1217 |
-
* Widgets display content sans `wpautop` formatting
|
1218 |
-
|
1219 |
-
## 2.2.7
|
1220 |
-
* Catch widget number in cache
|
1221 |
-
* FAQ Custom query code. Thank you [tcwebguru](http://wordpress.org/support/topic/display-on-page-without-widget)
|
1222 |
-
* FAQ Change Testimonials Widget text labels
|
1223 |
-
* Language verbiage correction
|
1224 |
-
* PHP notice fix - esc_attr
|
1225 |
-
* Remove premium code include
|
1226 |
-
|
1227 |
-
## 2.2.6
|
1228 |
-
* BUGFIX Widget config not saving correctly
|
1229 |
-
* FAQ Export/import
|
1230 |
-
* TODO Updates
|
1231 |
-
|
1232 |
-
## 2.2.5
|
1233 |
-
* Adapt for [Testimonials Widget Premium plugin](https://store.axelerant.com/downloads/testimonials-widget-premium-wordpress-plugin/)
|
1234 |
-
* Add support text
|
1235 |
-
* Correct verbiage spacing
|
1236 |
-
* Explain `limit`
|
1237 |
-
* TODO revisions
|
1238 |
-
|
1239 |
-
## 2.2.4
|
1240 |
-
* BUGFIX [Tags - no more than 2?](http://wordpress.org/support/topic/tags-no-more-than-2)
|
1241 |
-
* Clean up PHP notices
|
1242 |
-
* Fix Changelog link
|
1243 |
-
* PREMIUM Implement testimonials query and content caching
|
1244 |
-
* TODO update
|
1245 |
-
|
1246 |
-
## 2.2.3
|
1247 |
-
* Begin premium plugin adaptions
|
1248 |
-
* BUGFIX [Tags - no more than 2?](http://wordpress.org/support/topic/tags-no-more-than-2)
|
1249 |
-
* BUGFIX [Updated - Now getting fatal error when using testimonialswidget_list()](http://wordpress.org/support/topic/updated-now-getting-fatal-error-when-using-testimonialswidget_list)
|
1250 |
-
* Clean up links in readme.txt
|
1251 |
-
* Correct company and URL link usage
|
1252 |
-
* [Correct readme.txt to standard](http://wordpress.org/extend/plugins/about/readme.txt)
|
1253 |
-
* Don't rotate testimonial if only 1
|
1254 |
-
* TODO updates
|
1255 |
-
|
1256 |
-
## 2.2.2
|
1257 |
-
* BUGFIX [Now getting fatal error when using testimonialswidget_list()](http://wordpress.org/support/topic/updated-now-getting-fatal-error-when-using-testimonialswidget_list)
|
1258 |
-
* Theme function defaults
|
1259 |
-
* TODO updates
|
1260 |
-
* URL pointing update
|
1261 |
-
|
1262 |
-
## 2.2.1
|
1263 |
-
* Number FAQ Entries
|
1264 |
-
* Revise Installation Usage text
|
1265 |
-
* Revise Shortcode and Widget Options text
|
1266 |
-
|
1267 |
-
## 2.2.0
|
1268 |
-
* FAQ `testimonialswidget_widget()` example
|
1269 |
-
* Multisite compatible
|
1270 |
-
* Reversion as 2.1.10 was a minor release than only bug fixes
|
1271 |
-
|
1272 |
-
## 2.1.10
|
1273 |
-
* [Add title field ](http://wordpress.org/support/topic/plugin-testimonials-widget-just-tried-216-thoughts-suggestions)
|
1274 |
-
* Consolidate defaults to simplify code maintenance
|
1275 |
-
* Correct CSS testimonial list spacing
|
1276 |
-
* Debug true - clear out PHP notices and such
|
1277 |
-
* Default minimum height removed for widgets, now optional
|
1278 |
-
* Maximum height setting
|
1279 |
-
* [Remove CSS `position` attributes `.testimonialswidget_testimonial { position: absolute; }`](http://wordpress.org/support/topic/testimonials-widget-not-showing-correctly-on-sub-pages)
|
1280 |
-
* TODO cleanup
|
1281 |
-
* Update language POT
|
1282 |
-
* Update screenshots
|
1283 |
-
* Update WPML
|
1284 |
-
* Widget options dropdown for ORDER BY entries
|
1285 |
-
|
1286 |
-
## 2.1.9
|
1287 |
-
* Allow min_height 0
|
1288 |
-
* FAQ - How do I use the theme function `testimonialswidget_list()`?
|
1289 |
-
* Move CSS include to header
|
1290 |
-
|
1291 |
-
## 2.1.8
|
1292 |
-
* Remove testimonialswidget_widget char_limit default
|
1293 |
-
* TODO - debug true
|
1294 |
-
|
1295 |
-
## 2.1.7
|
1296 |
-
* [0 disables char_limit](http://wordpress.org/support/topic/plugin-testimonials-widget-more-than-one-testimonial-appears-overlaps-content-below-the-widget)
|
1297 |
-
* [Set link target](http://wordpress.org/support/topic/plugin-testimonials-widget-just-tried-216-thoughts-suggestions)
|
1298 |
-
* Update widget option top screenshot
|
1299 |
-
|
1300 |
-
## 2.1.6
|
1301 |
-
* FAQ: `ORDER BY` explanation
|
1302 |
-
* FAQ: `testimonial_extra` explanation
|
1303 |
-
* [Moved CSS to footer](http://wordpress.org/support/topic/plugin-testimonials-widget-html-validation)
|
1304 |
-
* Next testimonial link idea
|
1305 |
-
* Option: Add `hide_not_found` to prevent showing "No testimonials found"
|
1306 |
-
* Revise theme methods as functions
|
1307 |
-
* Screenshot: Update upper widget options
|
1308 |
-
* Staged widget testimonials are initially `display: none` via CSS `.testimonialswidget_display_none`
|
1309 |
-
* TODO updates
|
1310 |
-
* Verbiage: Refresh Interval to Rotation Speed
|
1311 |
-
* Widget option explanations
|
1312 |
-
|
1313 |
-
## 2.1.5
|
1314 |
-
* Always apply min-height
|
1315 |
-
|
1316 |
-
## 2.1.4
|
1317 |
-
* Enable WPML
|
1318 |
-
* Idea - Maximum height setting
|
1319 |
-
* Revise description
|
1320 |
-
* Revise TODO
|
1321 |
-
|
1322 |
-
## 2.1.3
|
1323 |
-
* Allow commas in meta_key
|
1324 |
-
* FAQ on page not found
|
1325 |
-
* Fix widget Random order always true condition
|
1326 |
-
* Increase bottom margin spacing for listed testimonials
|
1327 |
-
* TODO vote casting note
|
1328 |
-
* Update localization pot file
|
1329 |
-
|
1330 |
-
## 2.1.2
|
1331 |
-
* Add `hide_gravatar` option
|
1332 |
-
* Add apply_filters( 'tw_data', $testimonial_data ) to process data before display
|
1333 |
-
* Add right margin to gravatar image
|
1334 |
-
* Added empty testimonial data field `testimonial_extra` for customization in testimonials
|
1335 |
-
* Allow widget and shortcode sorting by post meta values via `meta_key`
|
1336 |
-
* Correct PHP static accessors
|
1337 |
-
* Update FAQ
|
1338 |
-
* Update widget options screenshots
|
1339 |
-
* Working full testimonial URLs
|
1340 |
-
|
1341 |
-
## 2.1.1
|
1342 |
-
* Add [[testimonialswidget_list]] paging screenshot
|
1343 |
-
|
1344 |
-
## 2.1.0
|
1345 |
-
* Enable paging for [[testimonialswidget_list]] shortcode
|
1346 |
-
* Flush rewrite rules on activation
|
1347 |
-
* Disallow paging in widget and [[testimonialswidget_widget]] shortcode
|
1348 |
-
|
1349 |
-
## 2.0.6
|
1350 |
-
* Update shortcode option directions
|
1351 |
-
|
1352 |
-
## 2.0.5
|
1353 |
-
* Ignore already imported
|
1354 |
-
* Mark `testimonialswidget_widget() $number` argument as optional
|
1355 |
-
|
1356 |
-
## 2.0.4
|
1357 |
-
* Allow for 0 refresh_interval in get_testimonials_html
|
1358 |
-
|
1359 |
-
## 2.0.3
|
1360 |
-
* Allow for 0 refresh_interval in widget
|
1361 |
-
|
1362 |
-
## 2.0.2
|
1363 |
-
* BUGFIX [Warning: call_user_func_array() ??](http://wordpress.org/support/topic/plugin-testimonials-widget-warning-call_user_func_array)
|
1364 |
-
* Added Testimonials_Widget_Widget::get_testimonials_scripts for use with add_filter for wp_footer
|
1365 |
-
|
1366 |
-
## 2.0.1
|
1367 |
-
* Verbiage updates
|
1368 |
-
* Readme.txt validation
|
1369 |
-
* widget q p tag display inline
|
1370 |
-
* GPL2 licensing
|
1371 |
-
* Move upgrade notice text towards installation
|
1372 |
-
* Reorder screenshots
|
1373 |
-
* Apply 'the_content' filters directly to prevent plugin baggage
|
1374 |
-
* Update screenshot-7.png
|
1375 |
-
|
1376 |
-
## 2.0.0
|
1377 |
-
* Major rewrite
|
1378 |
-
* Add filters for image & gravatar sizes
|
1379 |
-
* Admin bar New > Testimonial
|
1380 |
-
* Authors and lower can manage their own testimonials
|
1381 |
-
* Auto-migration from old to new format upon install
|
1382 |
-
* Public > Published
|
1383 |
-
* Not public > Private
|
1384 |
-
* Categories - product, project, service
|
1385 |
-
* Clean up verbiage
|
1386 |
-
* Cleaner widget class
|
1387 |
-
* Custom columns list view
|
1388 |
-
* Image
|
1389 |
-
* Source
|
1390 |
-
* Shortcode
|
1391 |
-
* Email
|
1392 |
-
* Company
|
1393 |
-
* URL
|
1394 |
-
* Published by
|
1395 |
-
* Category
|
1396 |
-
* Tags
|
1397 |
-
* Date
|
1398 |
-
* Custom fields metabox
|
1399 |
-
* Email
|
1400 |
-
* Company
|
1401 |
-
* URL
|
1402 |
-
* Custom post-type
|
1403 |
-
* Default fields - source, email, company, URL
|
1404 |
-
* Editors and higher can manage all testimonials and edit testimonial publisher
|
1405 |
-
* Enable categories and tags
|
1406 |
-
* Enable full shortcode options in widget
|
1407 |
-
* Gravatar
|
1408 |
-
* HTML content allowed
|
1409 |
-
* Images
|
1410 |
-
* JavaScript in footer
|
1411 |
-
* Localization
|
1412 |
-
* Reference shortcode column
|
1413 |
-
* Reorganize widget options panel
|
1414 |
-
* Rotation JavaScript in footer than body
|
1415 |
-
* Shortcode options validation
|
1416 |
-
* WP_Query for get_testimonials()
|
1417 |
-
* Widget image on own line
|
1418 |
-
* Widget options
|
1419 |
-
* Title
|
1420 |
-
* Category filter
|
1421 |
-
* Tags filter
|
1422 |
-
* Require all tags
|
1423 |
-
* Advanced options
|
1424 |
-
* Hide image?
|
1425 |
-
* Hide source?
|
1426 |
-
* Hide email?
|
1427 |
-
* Hide company?
|
1428 |
-
* Hide URL?
|
1429 |
-
* Character limit
|
1430 |
-
* IDs filter
|
1431 |
-
* Limit
|
1432 |
-
* Maximum Height
|
1433 |
-
* Minimum Height
|
1434 |
-
* ORDER BY
|
1435 |
-
* ORDER BY Order
|
1436 |
-
* Random order
|
1437 |
-
* Rotation Speed
|
1438 |
-
* Move caching to ideas
|
1439 |
-
* Add theme function `testimonialswidget_widget()` doc
|
1440 |
-
* Update POT
|
1441 |
-
* [[testimonialswidget_widget]] shortcode
|
1442 |
-
* Match [[testimonialswidget_widget]] shortcode option defaults to widget
|
1443 |
-
* Update screenshots
|
1444 |
-
* Readd Minimum Height - need help getting around this
|
1445 |
-
|
1446 |
-
## 0.2.13
|
1447 |
-
* Clean up CSS
|
1448 |
-
* Remove q & cite p wrapper
|
1449 |
-
|
1450 |
-
## 0.2.12
|
1451 |
-
* the_title filter fix
|
1452 |
-
|
1453 |
-
## 0.2.11
|
1454 |
-
* Enable character limit for shortcode
|
1455 |
-
|
1456 |
-
## 0.2.10
|
1457 |
-
* Character limit nows forces text truncation than preventing of testimonial to show
|
1458 |
-
* Add option - Limit number of testimonials to pull at a time
|
1459 |
-
* Sanitize widget variables
|
1460 |
-
* Fix random_order issue on testimonials widget
|
1461 |
-
|
1462 |
-
## 0.2.9
|
1463 |
-
* Require Editor role for managing Testimonials
|
1464 |
-
|
1465 |
-
## 0.2.8
|
1466 |
-
* CSS testimonialswidget_testimonial_list fix #2
|
1467 |
-
|
1468 |
-
## 0.2.7
|
1469 |
-
* CSS testimonialswidget_testimonial_list fix
|
1470 |
-
|
1471 |
-
## 0.2.6
|
1472 |
-
* CSS updates for widgets and lists
|
1473 |
-
|
1474 |
-
## 0.2.5
|
1475 |
-
* Add span.testimonialswidget_join for author , join text
|
1476 |
-
* Add nl2br for testimonials display on a page
|
1477 |
-
|
1478 |
-
## 0.2.4
|
1479 |
-
* Shortcode added - Thank you Hal Gatewood
|
1480 |
-
|
1481 |
-
## 0.2.3
|
1482 |
-
* Allow testimonials to have multiple tags
|
1483 |
-
* Show only quotes with all tags
|
1484 |
-
|
1485 |
-
## 0.2.2
|
1486 |
-
* Show newest testimonials first in admin list by default
|
1487 |
-
* Quick locallization
|
1488 |
-
* Quotes Collection recommendation
|
1489 |
-
|
1490 |
-
## 2011-10-03: Version 0.2
|
1491 |
-
* Multi-widget enabled
|
1492 |
-
* Testimonial, author & source text are clickable automatically
|
1493 |
-
* Allow 0 refresh to make widget static
|
1494 |
-
* Allow pressing return when editing testimonial to save record
|
1495 |
-
|
1496 |
-
## 2011-08-12: Version 0.1
|
1497 |
-
* initial release
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CONTRIBUTING.md
DELETED
@@ -1,41 +0,0 @@
|
|
1 |
-
# CONTRIBUTE - Testimonials Widget
|
2 |
-
|
3 |
-
Community made patches, localisation, bug reports and contributions are very welcome and help make Testimonials Widget the #1 testimonials plugin for WordPress.
|
4 |
-
|
5 |
-
When contributing please ensure you follow the guidelines below so that we can keep on top of things.
|
6 |
-
|
7 |
-
**Please Note:** GitHub is for bug reports and contributions only - if you have a support question or a request for a customisation don't post here, go to our [Support Forum](http://wordpress.org/support/plugin/testimonials-widget) instead.
|
8 |
-
|
9 |
-
For localization, please refer to [How do I change Testimonials text labels?](https://nodedesk.zendesk.com/hc/en-us/articles/202294892), though bugs with strings that can't be translated are welcome here.
|
10 |
-
|
11 |
-
## Getting Started
|
12 |
-
|
13 |
-
* Submit a ticket for your issue, assuming one does not already exist.
|
14 |
-
* Raise it on our [Issue Tracker](https://github.com/michael-cannon/testimonials-widget/issues)
|
15 |
-
* Clearly describe the issue including steps to reproduce the bug.
|
16 |
-
* Make sure you fill in the earliest version that you know has the issue as well as the version of WordPress you're using.
|
17 |
-
|
18 |
-
## Making Changes
|
19 |
-
|
20 |
-
* Fork the repository on GitHub
|
21 |
-
* Make the changes to your forked repository
|
22 |
-
* Ensure you stick to the [WordPress Coding Standards](http://codex.wordpress.org/WordPress_Coding_Standards) and have properly documented any new functions.
|
23 |
-
* When committing, reference your issue (if present) and include a note about the fix.
|
24 |
-
* Push the changes to your fork and submit a pull request to the 'master' branch of the Testimonials Widget repository.
|
25 |
-
|
26 |
-
## Code Documentation
|
27 |
-
|
28 |
-
* Try to ensure that every Testimonials Widget function is documented well and follows the standards set by phpDoc.
|
29 |
-
* An example function, by Yoast, can be found [here](https://gist.github.com/jdevalk/5574677)
|
30 |
-
* Please make sure that every function is documented so that when we update our API Documentation things don't go awry!
|
31 |
-
* Finally, please use tabs and not spaces. The tab indent size should be 4 for all Testimonials Widget code.
|
32 |
-
|
33 |
-
At this point you're waiting on us to merge your pull request. We'll review all pull requests, and make suggestions and changes if necessary.
|
34 |
-
|
35 |
-
|
36 |
-
## Additional Resources
|
37 |
-
|
38 |
-
* [Testimonials Widget API](https://github.com/michael-cannon/testimonials-widget/blob/master/API.md)
|
39 |
-
* [Testimonials Widget DEPRECATED](https://github.com/michael-cannon/testimonials-widget/blob/master/DEPRECATED.md)
|
40 |
-
* [General GitHub Help](http://help.github.com/)
|
41 |
-
* [GitHub Pull Request](http://help.github.com/send-pull-requests/)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DEPRECATED.md
DELETED
@@ -1,11 +0,0 @@
|
|
1 |
-
# Deprecation Notices - Testimonials Widget
|
2 |
-
|
3 |
-
## Deprecated Shortcodes
|
4 |
-
|
5 |
-
* `[testimonialswidget_list]` use `[testimonials]` instead as of 2.19.0
|
6 |
-
* `[testimonialswidget_widget]` use `[testimonials_slider]` instead as of 2.19.0
|
7 |
-
|
8 |
-
## Deprecated Theme Functions
|
9 |
-
|
10 |
-
* `testimonialswidget_list()` use `testimonials()` instead as of 2.19.0
|
11 |
-
* `testimonialswidget_widget()` use `testimonials_slider()` instead as of 2.19.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
EXAMPLES.md
DELETED
@@ -1,51 +0,0 @@
|
|
1 |
-
# Shortcode Examples - Testimonials Widget
|
2 |
-
|
3 |
-
## [testimonials] - Listings with paging
|
4 |
-
|
5 |
-
* List of testimonials only 200 characters long with only source shown in credit box - `[testimonialswidget_list char_limit=200 hide_title=true hide_email=true hide_url=true hide_location=true hide_company=true]`
|
6 |
-
* List testimonials by post title - `[testimonials order=ASC orderby=title]`
|
7 |
-
* Select testimonials tagged with either "test" or "fun", in random order, but ignore those of the excluded ids - `[testimonials tags="test,fun" random=true exclude="2,22,333"]`
|
8 |
-
* Show 15 testimonials, in company order - `[testimonials meta_key=testimonials-widget-company order=asc limit=15]`
|
9 |
-
* Show 3 full-length testimonials, with opening and closing quote marks removed - `[testimonials char_limit=0 target=_new limit=3 disable_quotes=true]`
|
10 |
-
* Show 5 full-length testimonials, with paging - `[testimonials limit=5 paging=true char_limit=0]`
|
11 |
-
* Show all testimonials on one page - `[testimonials char_limit=0 limit=-1]`
|
12 |
-
* Show one random testimonial - `[testimonials limit=1 no_cache=true random=true]`
|
13 |
-
* Show only these 3 testimonials - `[testimonials ids="1,11,111" paging=false]`
|
14 |
-
* Show testimonial list with source and urls hidden - `[testimonials hide_source=true hide_url=true]`
|
15 |
-
* Show the single testimonial of ID 123 on a page - `[testimonials ids="123" paging=false]`
|
16 |
-
* Testimonial list by category - `[testimonials category="category-name"]`
|
17 |
-
* Testimonial list by category and hide "No testimonials found" message - `[testimonials category=product hide_not_found=true]`
|
18 |
-
* Testimonial list by category ID 123 - `[testimonials category=123]`
|
19 |
-
* Testimonial list by tag, showing 5 at most - `[testimonials category=product tags=widget limit=5]`
|
20 |
-
|
21 |
-
## [testimonials_archives] - A monthly archive of your site's testimonials
|
22 |
-
|
23 |
-
* Testimonial's archive as dropdown with monthly count - `[testimonials_archives dropdown=true count=true]`
|
24 |
-
|
25 |
-
## [testimonials_categories] - A list or dropdown of testimonials' categories
|
26 |
-
|
27 |
-
* Testimonial's categories as hierarchical with monthly count - `[testimonials_categories count=true hierarchical=true]`
|
28 |
-
|
29 |
-
## [testimonials_recent] - Your site's most recent testimonials
|
30 |
-
|
31 |
-
* The 3 most recent testimonials with dates - `[testimonials_recent number=3 show_date=true]`
|
32 |
-
|
33 |
-
## [testimonials_slider] - Displays rotating testimonials or statically
|
34 |
-
|
35 |
-
* Change rotation speed to 3 seconds - `[testimonialswidget_widget refresh_interval=3]`
|
36 |
-
* Show "liposuction" testimonials in oldest first sorting - `[testimonials_slider category=liposculpture order=asc]`
|
37 |
-
* Show random "dreamweaver" testimonials - `[testimonials_slider category="dreamweaver" random="true"]`
|
38 |
-
* Show rotating testimonials, of the product category, lowest post ids first - `[testimonials_slider category=product order=asc]`
|
39 |
-
* Show rotating, random testimonials having tag "sometag" - `[testimonials_slider tags=sometag random=true]`
|
40 |
-
|
41 |
-
## [testimonials_tag_cloud] - A cloud of your most used testimonials' tags
|
42 |
-
|
43 |
-
* Show testimonials post tag cloud - `[testimonials_tag_cloud]`
|
44 |
-
|
45 |
-
## [testimonials_examples] - Displays examples of commonly used testimonials' shortcodes with attributes
|
46 |
-
|
47 |
-
* Show testimonials' shortcodes with attributes - `[testimonials_examples]`
|
48 |
-
|
49 |
-
## [testimonials_options] - Displays summary of testimonials' settings for use with shortcodes and theme functions
|
50 |
-
|
51 |
-
* Show summary of testimonials shortcode and theme function attributes - `[testimonials_options]`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
LICENSE
DELETED
@@ -1,339 +0,0 @@
|
|
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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-1,41 +0,0 @@
|
|
1 |
-
# Developer Readme - Testimonials Widget
|
2 |
-
|
3 |
-
[![Codeship status](https://www.codeship.io/projects/b5524630-43f6-0131-3b4d-76a8e32a74d4/status)](https://www.codeship.io/projects/10739)
|
4 |
-
|
5 |
-
## Welcome to the Testimonials Widget Github repository
|
6 |
-
|
7 |
-
Testimonials Widget plugin allows you to display random or selected portfolio, quotes, reviews, showcases, or text with images on your WordPress blog.
|
8 |
-
|
9 |
-
While the documentation for the [Testimonials Widget plugin](http://wordpress.org/plugins/testimonials-widget/) can be found at WordPress.org Plugin Directory, here you can browse the source of the project, find and discuss open issues and, even [contribute yourself](https://github.com/michael-cannon/testimonials-widget/blob/master/CONTRIBUTING.md).
|
10 |
-
|
11 |
-
## Installation
|
12 |
-
|
13 |
-
Here's a [guide on how to install Testimonials Widget in your WordPress site](http://wordpress.org/plugins/testimonials-widget/installation/). If you want to run the Git version though, you have two options:
|
14 |
-
|
15 |
-
* You can clone the GitHub repository: https://github.com/michael-cannon/testimonials-widget.git
|
16 |
-
* Download it directly as a ZIP file: https://github.com/michael-cannon/testimonials-widget/archive/master.zip
|
17 |
-
|
18 |
-
This will download the latest development version of Testimonials Widget. While this version is usually stable, it is not recommended for use in a production environment.
|
19 |
-
|
20 |
-
## Bugs
|
21 |
-
|
22 |
-
If you find an issue, [let us know here](https://github.com/michael-cannon/testimonials-widget/issues/new)!
|
23 |
-
|
24 |
-
## Support
|
25 |
-
|
26 |
-
This is a developer's portal for Testimonials Widget and should not be used for support. Please visit the [Testimonials Widget Knowledge Base](https://nodedesk.zendesk.com/hc/en-us/sections/200861112) for frequently asked questions, offering ideas, or getting support.
|
27 |
-
|
28 |
-
## Contributions
|
29 |
-
|
30 |
-
Anyone is welcome to contribute to Testimonials Widget. Please [read the guidelines](https://github.com/michael-cannon/testimonials-widget/blob/master/CONTRIBUTING.md) for contributing to this repository.
|
31 |
-
|
32 |
-
There are various ways you can contribute:
|
33 |
-
|
34 |
-
* [Raise an issue](https://github.com/michael-cannon/testimonials-widget/issues) on GitHub.
|
35 |
-
* Fork Testimonials Widget and send a Pull Request with your bug fixes and/or new features.
|
36 |
-
* [Translate Testimonials Widget into different languages](https://nodedesk.zendesk.com/hc/en-us/articles/202294892).
|
37 |
-
* Provide feedback and [suggestions on enhancements](https://github.com/michael-cannon/testimonials-widget/issues?direction=desc&labels=Enhancement&page=1&sort=created&state=open).
|
38 |
-
|
39 |
-
## Thank You
|
40 |
-
|
41 |
-
* Thank you [WordPress SEO by Yoast](https://github.com/jdevalk/wordpress-seo/blob/master/README.md) for this README.md and like inspirations.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UPGRADING.md
DELETED
@@ -1,188 +0,0 @@
|
|
1 |
-
# Upgrade Notices - Testimonials Widget
|
2 |
-
|
3 |
-
## 3.3.0
|
4 |
-
|
5 |
-
This is an overhaul **without** backwards compliance.
|
6 |
-
|
7 |
-
If you use the template system, class, methods, global variables of the plugin to modify Testimonials Widget and Testimonials Widget Premium output, this upgrade will not be compatible with those modifications until corrections are made.
|
8 |
-
|
9 |
-
The changes and helpers below are intended to help you update your customizations quickly. If further help is required, please request it via the support forum.
|
10 |
-
|
11 |
-
### Changes
|
12 |
-
|
13 |
-
* Class names below and all the references to these inside the plugin have been prepended with `Axl_`.
|
14 |
-
* `Testimonials_Widget` > `Axl_Testimonials_Widget`
|
15 |
-
* `Testimonials_Widget_Slider_Widget` > `Axl_Testimonials_Widget_Slider_Widget`
|
16 |
-
* `Testimonials_Widget_Archives_Widget` > `Axl_Testimonials_Widget_Archives_Widget`
|
17 |
-
* `Testimonials_Widget_Tag_Cloud_Widget` > `Axl_Testimonials_Widget_Tag_Cloud_Widget`
|
18 |
-
* `Testimonials_Widget_Categories_Widget` > `Axl_Testimonials_Widget_Categories_Widget`
|
19 |
-
* `Testimonials_Widget_Recent_Testimonials_Widget` > `Axl_Testimonials_Widget_Recent_Testimonials_Widget`
|
20 |
-
* `Testimonials_Widget_Settings` > `Axl_Testimonials_Widget_Settings`
|
21 |
-
* `Testimonials_Widget_Template_Loader` > `Axl_Testimonials_Widget_Template_Loader`
|
22 |
-
* Global variables below have been prepended with `Axl_`.
|
23 |
-
* `$Testimonials_Widget_Settings` > `$Axl_Testimonials_Widget_Settings`
|
24 |
-
* `$Testimonials_Widget` > `$Axl_Testimonials_Widget`
|
25 |
-
|
26 |
-
### Helpers
|
27 |
-
|
28 |
-
*Replace `Testimonials_Widget` with `Axl_Testimonials_Widget` through out all your custom plugins and themes which customize Testimonials Widget's output. Please take backup measures beforehand.*
|
29 |
-
|
30 |
-
* `find . -type f \( -name "*.php" -o -name "*.txt" -o -name "*.md" \) -exec perl -pi -e "s#\b(Testimonials_Widget)#Axl_\1#g" {} \;`
|
31 |
-
|
32 |
-
## 3.0.0
|
33 |
-
|
34 |
-
This is a major overhaul *without* backwards compliance of over 80 changes. Please read the [Testimonials Widget 3.0 and Testimonials Widget Premium 2.0 Upgrade Notice](https://nodedesk.zendesk.com/hc/en-us/articles/202476552) for more help.
|
35 |
-
|
36 |
-
If you use custom CSS, actions, or filters to modify Testimonials Widget and Testimonials Widget Premium actions or output, this upgrade will not be compatible with those modifications until corrections are made.
|
37 |
-
|
38 |
-
The changes and helpers below are intended to help you update your customizations quickly. If further help is required, please request it via commenting upon the [Testimonials Widget 3.0 and Testimonials Widget Premium 2.0 Upgrade Notice](https://nodedesk.zendesk.com/hc/en-us/articles/202476552).
|
39 |
-
|
40 |
-
### Changes
|
41 |
-
|
42 |
-
* As [Internet Explorer 7.0 usage](http://www.w3schools.com/browsers/browsers_explorer.asp) is under 0.5% of Internet traffic, support for it is discontinued. Option `include_ie7_css` is removed.
|
43 |
-
* Deprecated functions and API hooks of Testimonials Widget 2.19.0 and Testimonials Widget Premium 1.20.0 are removed. Read DEPRECATED.md for details.
|
44 |
-
* Replace `testimonials_widget_premium_` of actions, filters, and functions with `twp_`
|
45 |
-
* Replace `testimonials_widget_` of actions, filters, and functions with `tw_`
|
46 |
-
* Replaced `tba_` of actions, filters, and functions with `tw_`
|
47 |
-
* Replaced `tw_shortcodes` with `tw_examples`
|
48 |
-
* Replaced `tw_widget_options` with `tw_slider_widget_options`
|
49 |
-
* Testimonials Widget pre-2.0.0 automatic migration has been removed. Install and activate Testimonials Widget 2.19.0 before installing the latest Testimonials Widget.
|
50 |
-
* Testimonials Widget pre-2.15.0 JavaScript slider code has been replaced with [bxSlider](http://bxslider.com/) and is now removed. Options `use_bxslider`, `disable_animation`, `fade_out_speed`, `fade_in_speed`, `height`, `min_height`, and `max_height` are removed.
|
51 |
-
|
52 |
-
### Helpers
|
53 |
-
|
54 |
-
*The ordering of the helper code below is important to prevent corruption.*
|
55 |
-
|
56 |
-
* `find . -type f \( -name "*.php" -o -name "*.txt" -o -name "*.md" \) -exec perl -pi -e "s#testimonials_widget_premium_#twp_#g" {} \;`
|
57 |
-
* `find . -type f \( -name "*.php" -o -name "*.txt" -o -name "*.md" \) -exec perl -pi -e "s#testimonials_widget_#tw_#g" {} \;`
|
58 |
-
* `find . -type f \( -name "*.php" -o -name "*.txt" -o -name "*.md" \) -exec perl -pi -e "s#tba_#tw_#g" {} \;`
|
59 |
-
* `find . -type f \( -name "*.php" -o -name "*.txt" -o -name "*.md" \) -exec perl -pi -e "s#tw_widget_options#tw_slider_widget_options#g" {} \;`
|
60 |
-
* `find . -type f \( -name "*.php" -o -name "*.txt" -o -name "*.md" \) -exec perl -pi -e "s#tw_shortcodes#tw_examples#g" {} \;`
|
61 |
-
|
62 |
-
## 2.19.9
|
63 |
-
|
64 |
-
* Added `margin-bottom: 2em;` to `.testimonials-widget-testimonial.list`
|
65 |
-
|
66 |
-
## 2.19.8
|
67 |
-
|
68 |
-
* Cite fields for company and location are swapped
|
69 |
-
|
70 |
-
## 2.19.6
|
71 |
-
|
72 |
-
* Enable Video also means enable video embedding and display
|
73 |
-
|
74 |
-
## 2.19.0
|
75 |
-
|
76 |
-
* CSS class `.title` is now `.job-title`. Thank you Mark
|
77 |
-
* Please resave your WordPress Admin > Testimonials > Settings so that missing aoptions are included again.
|
78 |
-
* Shortcode and theme function `testimonialswidget_list` being deprecated by `testimonials`
|
79 |
-
* Shortcode and theme function `testimonialswidget_widget` being deprecated by `testimonials_slider`
|
80 |
-
|
81 |
-
## 2.18.3
|
82 |
-
|
83 |
-
* CSS class `.hide` renamed `.display-none`
|
84 |
-
* This is the last version supporting pre-bxSlider options
|
85 |
-
|
86 |
-
## 2.18.2
|
87 |
-
|
88 |
-
* CSS class `.display-none` renamed `.hide`
|
89 |
-
|
90 |
-
## 2.18.1
|
91 |
-
|
92 |
-
* CSS is back to being always loaded in the header
|
93 |
-
* Removed "Use bxSlider?" and "Include IE7 CSS" from widget options
|
94 |
-
|
95 |
-
## 2.18.0
|
96 |
-
|
97 |
-
* `remove_hentry` is now true by default
|
98 |
-
|
99 |
-
## 2.16.0
|
100 |
-
|
101 |
-
* [Requires PHP 5.3+](https://nodedesk.zendesk.com/hc/en-us/articles/202331041)
|
102 |
-
|
103 |
-
## 2.15.0
|
104 |
-
|
105 |
-
* If upgrading, bxSlider will not be enabled by default. You must enable it in your widget and global settings. CSS customizations must be reviewed to have the `.active` and `.display-none` classes removed. The main `.testimonials-widget-testimonial` class also need the `display: none;` and `clear: left;` removed.
|
106 |
-
|
107 |
-
## 2.14.0
|
108 |
-
|
109 |
-
* **60 modifications** See [Changelog](https://github.com/michael-cannon/testimonials-widget/blob/master/CHANGELOG.md)
|
110 |
-
* CSS wp_register_style and wp_enqueue_style slug changed from 'testimonials-widget' to 'Axl_Testimonials_Widget'
|
111 |
-
* Gravatar image size now based upon Thumbnail size in Media Settings
|
112 |
-
* Scripts `ksort` removed. Use `array_unshift` in your `tw_testimonials_js` filters instead.
|
113 |
-
* Testimonials > Settings, General tab, option Enable Review Schema? is enabled by default.
|
114 |
-
|
115 |
-
## 2.13.6
|
116 |
-
|
117 |
-
* IE 7 CSS moved to separate file. Include via Testimonials > Settings if needed
|
118 |
-
|
119 |
-
## 2.12.0
|
120 |
-
|
121 |
-
* CSS and JavaScript renaming
|
122 |
-
* `bottom_text` renamed to `bottom-text`
|
123 |
-
* `close_quote` renamed to `close-quote`
|
124 |
-
* `display_none` renamed to `display-none`
|
125 |
-
* `join_location` renamed to `join-location`
|
126 |
-
* `join_title` renamed to `join-title`
|
127 |
-
* `open_quote` renamed to `open-quote`
|
128 |
-
* `testimonialswidget_testimonial` renamed to `testimonials-widget-testimonial`
|
129 |
-
* `testimonialswidget_testimonials` renamed to `testimonials-widget-testimonials`
|
130 |
-
|
131 |
-
## 2.11.3
|
132 |
-
|
133 |
-
* Correct filter name `tw_next_posts_link` to `tw_next_posts_link_text`
|
134 |
-
|
135 |
-
## 2.11.0
|
136 |
-
|
137 |
-
* CSS class names are simplified. For the most part, other than `testimonialswidget_testimonial` remove `testimonialswidget_` from the CSS class name in your CSS customizations.
|
138 |
-
* Ex: `.testimonialswidget_join` becomes `.join`
|
139 |
-
* Ex: `.testimonialswidget_author` becomes `.author`
|
140 |
-
* Testimonials are now formatted using `blockquote` than `q` for HTML5 compliance. If you need `q` tag formatting, enable it at WP Admin > Testimonials > Settings, Compatibility & Reset tab
|
141 |
-
* `cite` is now `div.credit`
|
142 |
-
|
143 |
-
## 2.8.0
|
144 |
-
|
145 |
-
* Deprecated
|
146 |
-
* `hide_author` now `hide_source`
|
147 |
-
* Removed filters `tw_options_update`, `tw_options_form`
|
148 |
-
* Use `tw_validate_settings` and `tw_settings` instead
|
149 |
-
* Renamed variable and related class `widget_text` to `bottom_text`
|
150 |
-
|
151 |
-
## 2.7.3
|
152 |
-
|
153 |
-
* Quotes are no longer handled via `q`, `p:before`, or `p:after` CSS. It's handled via `.testimonialswidget_testimonial .testimonialswidget_open_quote:before` and `.testimonialswidget_testimonial .testimonialswidget_close_quote:after`
|
154 |
-
* This change was made to keep consistency in how quotes were managed and to reduce the number of exception cases. In the end, this is simpler.
|
155 |
-
|
156 |
-
## 2.7.0
|
157 |
-
|
158 |
-
* Quotes with `keep_whitespace=true` aren't applied via CSS `.testimonialswidget_testimonial q` tag anymore, but `.testimonialswidget_testimonial q p:first-child:before` and `.testimonialswidget_testimonial q p:last-child:after`
|
159 |
-
* Widget testimonial `p` tags are no longer CSS `display: inline`, `display: block` as expected
|
160 |
-
|
161 |
-
## 2.4.1
|
162 |
-
|
163 |
-
* Paging is on by default, except for widgets
|
164 |
-
|
165 |
-
## 2.0.0
|
166 |
-
|
167 |
-
* CSS
|
168 |
-
* Class `testimonialswidget_company` replaces `testimonialswidget_source`
|
169 |
-
* Class `testimonialswidget_source` replaces `testimonialswidget_author`
|
170 |
-
* The tighten widget display up, p tags within q are displayed inline.
|
171 |
-
* JavaScript
|
172 |
-
* The JavaScript for rotating testimonials is moved to the footer. As such, your theme requires `wp_footer()` in the footer.
|
173 |
-
* Shortcode options
|
174 |
-
* `hide_source` replaced by `hide_url`
|
175 |
-
* `hide_author` replaced by `hide_source`
|
176 |
-
* Testimonials
|
177 |
-
* Migration from the old custom table to new custom post type is automatically done. Import might take a few moments to complete.
|
178 |
-
* Company, URL and email details are attempted to be identified and placed properly based upon the original author and source fields. The company is "guessed" from the `author` field when there's a ", " or " of " context. If the `source` is an email, it's saved as such. Otherwise, it's assumed to be a URL.
|
179 |
-
* Public testimonials are saved as Published. Non-public testimonials are marked as Private.
|
180 |
-
* Widget options
|
181 |
-
* "Show author" and "Show source" options are replaced by "Hide source" and "Hide URL" respectively. There's no backwards compatibility for these changes.
|
182 |
-
* Default `min-height` is now 250px than 150px.
|
183 |
-
|
184 |
-
## Version 2.0 Background
|
185 |
-
|
186 |
-
Version 2.0.0 of Testimonials is a complete rewrite based upon a composite of ideas from user feedback and grokking the plugins [Imperfect Quotes](http://www.swarmstrategies.com/imperfect-quotes/), [IvyCat Ajax Testimonials](http://wordpress.org/extend/plugins/ivycat-ajax-testimonials/), [Quotes Collection](http://srinig.com/wordpress/plugins/quotes-collection/), and [TB Testimonials](http://travisballard.com/wordpress/tb-testimonials/). Thank you to these plugin developers for their efforts that have helped inspire this rewrite.
|
187 |
-
|
188 |
-
Prior to version 2.0.0, this plugin was a fork of [Quotes Collection](http://srinig.com/wordpress/plugins/quotes-collection/) by [Srini G](http://wordpress.org/support/profile/SriniG) with additional contributions from [j0hnsmith](http://wordpress.org/support/profile/j0hnsmith), [ChrisCree](http://wordpress.org/support/profile/ChrisCree) and [comprock](http://wordpress.org/support/profile/comprock).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/css/images/bx_loader.gif
DELETED
Binary file
|
assets/css/images/controls.png
DELETED
Binary file
|
assets/css/jquery.bxslider.css
DELETED
@@ -1,204 +0,0 @@
|
|
1 |
-
/**
|
2 |
-
* BxSlider v4.1.2 - Fully loaded, responsive content slider
|
3 |
-
* http://bxslider.com
|
4 |
-
*
|
5 |
-
* Written by: Steven Wanderski, 2014
|
6 |
-
* http://stevenwanderski.com
|
7 |
-
* (while drinking Belgian ales and listening to jazz)
|
8 |
-
*
|
9 |
-
* CEO and founder of bxCreative, LTD
|
10 |
-
* http://bxcreative.com
|
11 |
-
*/
|
12 |
-
|
13 |
-
|
14 |
-
/** RESET AND LAYOUT
|
15 |
-
===================================*/
|
16 |
-
|
17 |
-
.bx-wrapper {
|
18 |
-
position: relative;
|
19 |
-
margin: 0 auto 60px;
|
20 |
-
padding: 0;
|
21 |
-
*zoom: 1;
|
22 |
-
}
|
23 |
-
|
24 |
-
.bx-wrapper img {
|
25 |
-
max-width: 100%;
|
26 |
-
display: block;
|
27 |
-
}
|
28 |
-
|
29 |
-
/** THEME
|
30 |
-
===================================*/
|
31 |
-
|
32 |
-
.bx-wrapper .bx-viewport {
|
33 |
-
-moz-box-shadow: 0 0 5px #ccc;
|
34 |
-
-webkit-box-shadow: 0 0 5px #ccc;
|
35 |
-
box-shadow: 0 0 5px #ccc;
|
36 |
-
border: 5px solid #fff;
|
37 |
-
left: -5px;
|
38 |
-
background: #fff;
|
39 |
-
|
40 |
-
/*fix other elements on the page moving (on Chrome)*/
|
41 |
-
-webkit-transform: translatez(0);
|
42 |
-
-moz-transform: translatez(0);
|
43 |
-
-ms-transform: translatez(0);
|
44 |
-
-o-transform: translatez(0);
|
45 |
-
transform: translatez(0);
|
46 |
-
}
|
47 |
-
|
48 |
-
.bx-wrapper .bx-pager,
|
49 |
-
.bx-wrapper .bx-controls-auto {
|
50 |
-
position: absolute;
|
51 |
-
bottom: -30px;
|
52 |
-
width: 100%;
|
53 |
-
}
|
54 |
-
|
55 |
-
/* LOADER */
|
56 |
-
|
57 |
-
.bx-wrapper .bx-loading {
|
58 |
-
min-height: 50px;
|
59 |
-
background: url(images/bx_loader.gif) center center no-repeat #fff;
|
60 |
-
height: 100%;
|
61 |
-
width: 100%;
|
62 |
-
position: absolute;
|
63 |
-
top: 0;
|
64 |
-
left: 0;
|
65 |
-
z-index: 2000;
|
66 |
-
}
|
67 |
-
|
68 |
-
/* PAGER */
|
69 |
-
|
70 |
-
.bx-wrapper .bx-pager {
|
71 |
-
text-align: center;
|
72 |
-
font-size: .85em;
|
73 |
-
font-family: Arial;
|
74 |
-
font-weight: bold;
|
75 |
-
color: #666;
|
76 |
-
padding-top: 20px;
|
77 |
-
}
|
78 |
-
|
79 |
-
.bx-wrapper .bx-pager .bx-pager-item,
|
80 |
-
.bx-wrapper .bx-controls-auto .bx-controls-auto-item {
|
81 |
-
display: inline-block;
|
82 |
-
*zoom: 1;
|
83 |
-
*display: inline;
|
84 |
-
}
|
85 |
-
|
86 |
-
.bx-wrapper .bx-pager.bx-default-pager a {
|
87 |
-
background: #666;
|
88 |
-
text-indent: -9999px;
|
89 |
-
display: block;
|
90 |
-
width: 10px;
|
91 |
-
height: 10px;
|
92 |
-
margin: 0 5px;
|
93 |
-
outline: 0;
|
94 |
-
-moz-border-radius: 5px;
|
95 |
-
-webkit-border-radius: 5px;
|
96 |
-
border-radius: 5px;
|
97 |
-
}
|
98 |
-
|
99 |
-
.bx-wrapper .bx-pager.bx-default-pager a:hover,
|
100 |
-
.bx-wrapper .bx-pager.bx-default-pager a.active {
|
101 |
-
background: #000;
|
102 |
-
}
|
103 |
-
|
104 |
-
/* DIRECTION CONTROLS (NEXT / PREV) */
|
105 |
-
|
106 |
-
.bx-wrapper .bx-prev {
|
107 |
-
left: 10px;
|
108 |
-
background: url(images/controls.png) no-repeat 0 -32px;
|
109 |
-
}
|
110 |
-
|
111 |
-
.bx-wrapper .bx-next {
|
112 |
-
right: 10px;
|
113 |
-
background: url(images/controls.png) no-repeat -43px -32px;
|
114 |
-
}
|
115 |
-
|
116 |
-
.bx-wrapper .bx-prev:hover {
|
117 |
-
background-position: 0 0;
|
118 |
-
}
|
119 |
-
|
120 |
-
.bx-wrapper .bx-next:hover {
|
121 |
-
background-position: -43px 0;
|
122 |
-
}
|
123 |
-
|
124 |
-
.bx-wrapper .bx-controls-direction a {
|
125 |
-
position: absolute;
|
126 |
-
top: 50%;
|
127 |
-
margin-top: -16px;
|
128 |
-
outline: 0;
|
129 |
-
width: 32px;
|
130 |
-
height: 32px;
|
131 |
-
text-indent: -9999px;
|
132 |
-
z-index: 9999;
|
133 |
-
}
|
134 |
-
|
135 |
-
.bx-wrapper .bx-controls-direction a.disabled {
|
136 |
-
display: none;
|
137 |
-
}
|
138 |
-
|
139 |
-
/* AUTO CONTROLS (START / STOP) */
|
140 |
-
|
141 |
-
.bx-wrapper .bx-controls-auto {
|
142 |
-
text-align: center;
|
143 |
-
}
|
144 |
-
|
145 |
-
.bx-wrapper .bx-controls-auto .bx-start {
|
146 |
-
display: block;
|
147 |
-
text-indent: -9999px;
|
148 |
-
width: 10px;
|
149 |
-
height: 11px;
|
150 |
-
outline: 0;
|
151 |
-
background: url(images/controls.png) -86px -11px no-repeat;
|
152 |
-
margin: 0 3px;
|
153 |
-
}
|
154 |
-
|
155 |
-
.bx-wrapper .bx-controls-auto .bx-start:hover,
|
156 |
-
.bx-wrapper .bx-controls-auto .bx-start.active {
|
157 |
-
background-position: -86px 0;
|
158 |
-
}
|
159 |
-
|
160 |
-
.bx-wrapper .bx-controls-auto .bx-stop {
|
161 |
-
display: block;
|
162 |
-
text-indent: -9999px;
|
163 |
-
width: 9px;
|
164 |
-
height: 11px;
|
165 |
-
outline: 0;
|
166 |
-
background: url(images/controls.png) -86px -44px no-repeat;
|
167 |
-
margin: 0 3px;
|
168 |
-
}
|
169 |
-
|
170 |
-
.bx-wrapper .bx-controls-auto .bx-stop:hover,
|
171 |
-
.bx-wrapper .bx-controls-auto .bx-stop.active {
|
172 |
-
background-position: -86px -33px;
|
173 |
-
}
|
174 |
-
|
175 |
-
/* PAGER WITH AUTO-CONTROLS HYBRID LAYOUT */
|
176 |
-
|
177 |
-
.bx-wrapper .bx-controls.bx-has-controls-auto.bx-has-pager .bx-pager {
|
178 |
-
text-align: left;
|
179 |
-
width: 80%;
|
180 |
-
}
|
181 |
-
|
182 |
-
.bx-wrapper .bx-controls.bx-has-controls-auto.bx-has-pager .bx-controls-auto {
|
183 |
-
right: 0;
|
184 |
-
width: 35px;
|
185 |
-
}
|
186 |
-
|
187 |
-
/* IMAGE CAPTIONS */
|
188 |
-
|
189 |
-
.bx-wrapper .bx-caption {
|
190 |
-
position: absolute;
|
191 |
-
bottom: 0;
|
192 |
-
left: 0;
|
193 |
-
background: #666\9;
|
194 |
-
background: rgba(80, 80, 80, 0.75);
|
195 |
-
width: 100%;
|
196 |
-
}
|
197 |
-
|
198 |
-
.bx-wrapper .bx-caption span {
|
199 |
-
color: #fff;
|
200 |
-
font-family: Arial;
|
201 |
-
display: block;
|
202 |
-
font-size: .85em;
|
203 |
-
padding: 10px;
|
204 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/css/testimonials-widget-2.14.0.css
DELETED
@@ -1,120 +0,0 @@
|
|
1 |
-
.testimonials-widget-testimonials {
|
2 |
-
/* testimonials wrapper */
|
3 |
-
}
|
4 |
-
|
5 |
-
.testimonials-widget-testimonial {
|
6 |
-
clear: left;
|
7 |
-
display: none;
|
8 |
-
margin: 0 0 1.4em;
|
9 |
-
}
|
10 |
-
|
11 |
-
.testimonials-widget-testimonials .active {
|
12 |
-
/* active testimonials */
|
13 |
-
display: block;
|
14 |
-
}
|
15 |
-
|
16 |
-
.testimonials-widget-testimonials .display-none {
|
17 |
-
/* staged testimonials */
|
18 |
-
display: none;
|
19 |
-
}
|
20 |
-
|
21 |
-
.testimonials-widget-testimonials .paging {
|
22 |
-
clear: both;
|
23 |
-
font-weight: 700;
|
24 |
-
height: 1.4em;
|
25 |
-
}
|
26 |
-
|
27 |
-
.testimonials-widget-testimonials .paging.prepend {
|
28 |
-
margin-bottom: 1em;
|
29 |
-
}
|
30 |
-
|
31 |
-
.testimonials-widget-testimonials .paging.append {
|
32 |
-
margin-top: 1em;
|
33 |
-
}
|
34 |
-
|
35 |
-
.testimonials-widget-testimonials .alignleft {
|
36 |
-
float: left;
|
37 |
-
}
|
38 |
-
|
39 |
-
.testimonials-widget-testimonials .alignright {
|
40 |
-
float: right;
|
41 |
-
}
|
42 |
-
|
43 |
-
.testimonials-widget-testimonial.list,
|
44 |
-
.testimonials-widget-testimonial.single {
|
45 |
-
display: block;
|
46 |
-
}
|
47 |
-
|
48 |
-
.testimonials-widget-testimonial .image {
|
49 |
-
float: left;
|
50 |
-
margin-bottom: .4em;
|
51 |
-
margin-right: .2em;
|
52 |
-
}
|
53 |
-
|
54 |
-
.widget .testimonials-widget-testimonial .image {
|
55 |
-
display: block;
|
56 |
-
float: none;
|
57 |
-
}
|
58 |
-
|
59 |
-
.testimonials-widget-testimonial q,
|
60 |
-
.testimonials-widget-testimonial blockquote {
|
61 |
-
/* the testimonial itself */
|
62 |
-
quotes: none;
|
63 |
-
}
|
64 |
-
|
65 |
-
.testimonials-widget-testimonial .open-quote:before {
|
66 |
-
content: '\201C';
|
67 |
-
}
|
68 |
-
|
69 |
-
.testimonials-widget-testimonial .close-quote:after {
|
70 |
-
content: '\201D';
|
71 |
-
}
|
72 |
-
|
73 |
-
.testimonials-widget-testimonial cite,
|
74 |
-
.testimonials-widget-testimonial div.credit {
|
75 |
-
/* outer wrapper for source & company */
|
76 |
-
display: block; /* To display source and company on a new line */
|
77 |
-
margin-top: .2em;
|
78 |
-
text-align: right;
|
79 |
-
}
|
80 |
-
|
81 |
-
.widget .testimonials-widget-testimonial cite,
|
82 |
-
.widget .testimonials-widget-testimonial div.credit {
|
83 |
-
margin-top: .8em;
|
84 |
-
}
|
85 |
-
|
86 |
-
.widget .testimonials-widget-testimonial .whitespace cite,
|
87 |
-
.widget .whitespace cite,
|
88 |
-
.widget .testimonials-widget-testimonial .whitespace div.credit,
|
89 |
-
.widget .whitespace div.credit {
|
90 |
-
margin-top: .2em;
|
91 |
-
}
|
92 |
-
|
93 |
-
.testimonials-widget-testimonial cite:before,
|
94 |
-
.testimonials-widget-testimonial div.credit:before {
|
95 |
-
content: "– "
|
96 |
-
}
|
97 |
-
|
98 |
-
.testimonials-widget-testimonial .join-title:before,
|
99 |
-
.testimonials-widget-testimonial .join-location:before,
|
100 |
-
.testimonials-widget-testimonial .join:before {
|
101 |
-
/* join text */
|
102 |
-
content: ", "
|
103 |
-
}
|
104 |
-
|
105 |
-
.testimonials-widget-testimonial .author,
|
106 |
-
.testimonials-widget-testimonial .email,
|
107 |
-
.testimonials-widget-testimonial .job-title,
|
108 |
-
.testimonials-widget-testimonial .location,
|
109 |
-
.testimonials-widget-testimonial .company,
|
110 |
-
.testimonials-widget-testimonial .url {
|
111 |
-
/* testimonial title, company and url informaiton */
|
112 |
-
}
|
113 |
-
|
114 |
-
.testimonials-widget-testimonial .extra {
|
115 |
-
margin-top: .8em;
|
116 |
-
}
|
117 |
-
|
118 |
-
.testimonials-widget-testimonial .bottom_text {
|
119 |
-
margin-top: 1.4em;
|
120 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/css/testimonials-widget-ie7.css
DELETED
@@ -1,15 +0,0 @@
|
|
1 |
-
/*csslint star-property-hack: false*/
|
2 |
-
.testimonials-widget-testimonial .open-quote {
|
3 |
-
*zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '“' );
|
4 |
-
}
|
5 |
-
|
6 |
-
.testimonials-widget-testimonial .close-quote {
|
7 |
-
*zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '”' );
|
8 |
-
}
|
9 |
-
|
10 |
-
.testimonials-widget-testimonial .join-title,
|
11 |
-
.testimonials-widget-testimonial .join-location,
|
12 |
-
.testimonials-widget-testimonial .join {
|
13 |
-
/* section between source and company information */
|
14 |
-
*zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ', ' );
|
15 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/css/testimonials-widget.css
DELETED
@@ -1,122 +0,0 @@
|
|
1 |
-
.testimonials-widget-testimonials {
|
2 |
-
}
|
3 |
-
|
4 |
-
.testimonials-widget-testimonial {
|
5 |
-
}
|
6 |
-
|
7 |
-
.testimonials-widget-testimonials .paging {
|
8 |
-
clear: both;
|
9 |
-
font-weight: 700;
|
10 |
-
height: 1.4em;
|
11 |
-
}
|
12 |
-
|
13 |
-
.testimonials-widget-testimonials .paging.prepend {
|
14 |
-
margin-bottom: 1em;
|
15 |
-
}
|
16 |
-
|
17 |
-
.testimonials-widget-testimonials .paging.append {
|
18 |
-
margin-top: 1em;
|
19 |
-
}
|
20 |
-
|
21 |
-
.testimonials-widget-testimonials .alignleft {
|
22 |
-
float: left;
|
23 |
-
}
|
24 |
-
|
25 |
-
.testimonials-widget-testimonials .alignright {
|
26 |
-
float: right;
|
27 |
-
}
|
28 |
-
|
29 |
-
.testimonials-widget-testimonial.list {
|
30 |
-
clear: left;
|
31 |
-
margin-bottom: 2em;
|
32 |
-
}
|
33 |
-
|
34 |
-
.testimonials-widget-testimonial.single {
|
35 |
-
clear: left;
|
36 |
-
}
|
37 |
-
|
38 |
-
.testimonials-widget-testimonial .image {
|
39 |
-
float: left;
|
40 |
-
margin-bottom: .4em;
|
41 |
-
margin-right: .2em;
|
42 |
-
}
|
43 |
-
|
44 |
-
.widget .testimonials-widget-testimonial .image {
|
45 |
-
display: block;
|
46 |
-
float: none;
|
47 |
-
}
|
48 |
-
|
49 |
-
.testimonials-widget-testimonial .list-title {
|
50 |
-
font-weight: bold;
|
51 |
-
}
|
52 |
-
|
53 |
-
.testimonials-widget-testimonial q,
|
54 |
-
.testimonials-widget-testimonial blockquote {
|
55 |
-
/* the testimonial itself */
|
56 |
-
quotes: none;
|
57 |
-
}
|
58 |
-
|
59 |
-
.testimonials-widget-testimonial .open-quote:before {
|
60 |
-
content: '\201C';
|
61 |
-
}
|
62 |
-
|
63 |
-
.testimonials-widget-testimonial .close-quote:after {
|
64 |
-
content: '\201D';
|
65 |
-
}
|
66 |
-
|
67 |
-
.testimonials-widget-testimonial cite,
|
68 |
-
.testimonials-widget-testimonial div.credit {
|
69 |
-
/* outer wrapper for source & company */
|
70 |
-
display: block; /* To display source and company on a new line */
|
71 |
-
margin-top: .2em;
|
72 |
-
text-align: right;
|
73 |
-
}
|
74 |
-
|
75 |
-
.widget .testimonials-widget-testimonial cite,
|
76 |
-
.widget .testimonials-widget-testimonial div.credit {
|
77 |
-
margin-top: .8em;
|
78 |
-
}
|
79 |
-
|
80 |
-
.widget .testimonials-widget-testimonial .whitespace cite,
|
81 |
-
.widget .whitespace cite,
|
82 |
-
.widget .testimonials-widget-testimonial .whitespace div.credit,
|
83 |
-
.widget .whitespace div.credit {
|
84 |
-
margin-top: .2em;
|
85 |
-
}
|
86 |
-
|
87 |
-
.testimonials-widget-testimonial cite:before,
|
88 |
-
.testimonials-widget-testimonial div.credit:before {
|
89 |
-
content: "– "
|
90 |
-
}
|
91 |
-
|
92 |
-
.testimonials-widget-testimonial .join-title:before,
|
93 |
-
.testimonials-widget-testimonial .join-location:before,
|
94 |
-
.testimonials-widget-testimonial .join:before {
|
95 |
-
/* join text */
|
96 |
-
content: ", "
|
97 |
-
}
|
98 |
-
|
99 |
-
.testimonials-widget-testimonial .author,
|
100 |
-
.testimonials-widget-testimonial .email,
|
101 |
-
.testimonials-widget-testimonial .job-title,
|
102 |
-
.testimonials-widget-testimonial .location,
|
103 |
-
.testimonials-widget-testimonial .company,
|
104 |
-
.testimonials-widget-testimonial .url {
|
105 |
-
/* testimonial title, company and url informaiton */
|
106 |
-
}
|
107 |
-
|
108 |
-
.testimonials-widget-testimonial .extra {
|
109 |
-
margin-top: .8em;
|
110 |
-
}
|
111 |
-
|
112 |
-
.testimonials-widget-testimonial .bottom_text {
|
113 |
-
margin-top: 1.4em;
|
114 |
-
}
|
115 |
-
|
116 |
-
.bx-wrapper {
|
117 |
-
-moz-box-shadow: none;
|
118 |
-
-webkit-box-shadow: none;
|
119 |
-
box-shadow: none;
|
120 |
-
border: none;
|
121 |
-
background: transparent !important;
|
122 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/images/michael-cannon-red-square-300x2251.jpg
DELETED
Binary file
|
assets/js/jquery.bxslider.js
DELETED
@@ -1,1343 +0,0 @@
|
|
1 |
-
/**
|
2 |
-
* BxSlider v4.1.2 - Fully loaded, responsive content slider
|
3 |
-
* http://bxslider.com
|
4 |
-
*
|
5 |
-
* Copyright 2014, Steven Wanderski - http://stevenwanderski.com - http://bxcreative.com
|
6 |
-
* Written while drinking Belgian ales and listening to jazz
|
7 |
-
*
|
8 |
-
* Released under the MIT license - http://opensource.org/licenses/MIT
|
9 |
-
*/
|
10 |
-
|
11 |
-
;(function($){
|
12 |
-
|
13 |
-
var plugin = {};
|
14 |
-
|
15 |
-
var defaults = {
|
16 |
-
|
17 |
-
// GENERAL
|
18 |
-
mode: 'horizontal',
|
19 |
-
slideSelector: '',
|
20 |
-
infiniteLoop: true,
|
21 |
-
hideControlOnEnd: false,
|
22 |
-
speed: 500,
|
23 |
-
easing: null,
|
24 |
-
slideMargin: 0,
|
25 |
-
startSlide: 0,
|
26 |
-
randomStart: false,
|
27 |
-
captions: false,
|
28 |
-
ticker: false,
|
29 |
-
tickerHover: false,
|
30 |
-
adaptiveHeight: false,
|
31 |
-
adaptiveHeightSpeed: 500,
|
32 |
-
video: false,
|
33 |
-
useCSS: true,
|
34 |
-
preloadImages: 'visible',
|
35 |
-
responsive: true,
|
36 |
-
slideZIndex: 50,
|
37 |
-
wrapperClass: 'bx-wrapper',
|
38 |
-
|
39 |
-
// TOUCH
|
40 |
-
touchEnabled: true,
|
41 |
-
swipeThreshold: 50,
|
42 |
-
oneToOneTouch: true,
|
43 |
-
preventDefaultSwipeX: true,
|
44 |
-
preventDefaultSwipeY: false,
|
45 |
-
|
46 |
-
// PAGER
|
47 |
-
pager: true,
|
48 |
-
pagerType: 'full',
|
49 |
-
pagerShortSeparator: ' / ',
|
50 |
-
pagerSelector: null,
|
51 |
-
buildPager: null,
|
52 |
-
pagerCustom: null,
|
53 |
-
|
54 |
-
// CONTROLS
|
55 |
-
controls: true,
|
56 |
-
nextText: 'Next',
|
57 |
-
prevText: 'Prev',
|
58 |
-
nextSelector: null,
|
59 |
-
prevSelector: null,
|
60 |
-
autoControls: false,
|
61 |
-
startText: 'Start',
|
62 |
-
stopText: 'Stop',
|
63 |
-
autoControlsCombine: false,
|
64 |
-
autoControlsSelector: null,
|
65 |
-
|
66 |
-
// AUTO
|
67 |
-
auto: false,
|
68 |
-
pause: 4000,
|
69 |
-
autoStart: true,
|
70 |
-
autoDirection: 'next',
|
71 |
-
autoHover: false,
|
72 |
-
autoDelay: 0,
|
73 |
-
autoSlideForOnePage: false,
|
74 |
-
|
75 |
-
// CAROUSEL
|
76 |
-
minSlides: 1,
|
77 |
-
maxSlides: 1,
|
78 |
-
moveSlides: 0,
|
79 |
-
slideWidth: 0,
|
80 |
-
|
81 |
-
// CALLBACKS
|
82 |
-
onSliderLoad: function() {},
|
83 |
-
onSlideBefore: function() {},
|
84 |
-
onSlideAfter: function() {},
|
85 |
-
onSlideNext: function() {},
|
86 |
-
onSlidePrev: function() {},
|
87 |
-
onSliderResize: function() {}
|
88 |
-
}
|
89 |
-
|
90 |
-
$.fn.bxSlider = function(options){
|
91 |
-
|
92 |
-
if(this.length == 0) return this;
|
93 |
-
|
94 |
-
// support mutltiple elements
|
95 |
-
if(this.length > 1){
|
96 |
-
this.each(function(){$(this).bxSlider(options)});
|
97 |
-
return this;
|
98 |
-
}
|
99 |
-
|
100 |
-
// create a namespace to be used throughout the plugin
|
101 |
-
var slider = {};
|
102 |
-
// set a reference to our slider element
|
103 |
-
var el = this;
|
104 |
-
plugin.el = this;
|
105 |
-
|
106 |
-
/**
|
107 |
-
* Makes slideshow responsive
|
108 |
-
*/
|
109 |
-
// first get the original window dimens (thanks alot IE)
|
110 |
-
var windowWidth = $(window).width();
|
111 |
-
var windowHeight = $(window).height();
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
/**
|
116 |
-
* ===================================================================================
|
117 |
-
* = PRIVATE FUNCTIONS
|
118 |
-
* ===================================================================================
|
119 |
-
*/
|
120 |
-
|
121 |
-
/**
|
122 |
-
* Initializes namespace settings to be used throughout plugin
|
123 |
-
*/
|
124 |
-
var init = function(){
|
125 |
-
// merge user-supplied options with the defaults
|
126 |
-
slider.settings = $.extend({}, defaults, options);
|
127 |
-
// parse slideWidth setting
|
128 |
-
slider.settings.slideWidth = parseInt(slider.settings.slideWidth);
|
129 |
-
// store the original children
|
130 |
-
slider.children = el.children(slider.settings.slideSelector);
|
131 |
-
// check if actual number of slides is less than minSlides / maxSlides
|
132 |
-
if(slider.children.length < slider.settings.minSlides) slider.settings.minSlides = slider.children.length;
|
133 |
-
if(slider.children.length < slider.settings.maxSlides) slider.settings.maxSlides = slider.children.length;
|
134 |
-
// if random start, set the startSlide setting to random number
|
135 |
-
if(slider.settings.randomStart) slider.settings.startSlide = Math.floor(Math.random() * slider.children.length);
|
136 |
-
// store active slide information
|
137 |
-
slider.active = { index: slider.settings.startSlide }
|
138 |
-
// store if the slider is in carousel mode (displaying / moving multiple slides)
|
139 |
-
slider.carousel = slider.settings.minSlides > 1 || slider.settings.maxSlides > 1;
|
140 |
-
// if carousel, force preloadImages = 'all'
|
141 |
-
if(slider.carousel) slider.settings.preloadImages = 'all';
|
142 |
-
// calculate the min / max width thresholds based on min / max number of slides
|
143 |
-
// used to setup and update carousel slides dimensions
|
144 |
-
slider.minThreshold = (slider.settings.minSlides * slider.settings.slideWidth) + ((slider.settings.minSlides - 1) * slider.settings.slideMargin);
|
145 |
-
slider.maxThreshold = (slider.settings.maxSlides * slider.settings.slideWidth) + ((slider.settings.maxSlides - 1) * slider.settings.slideMargin);
|
146 |
-
// store the current state of the slider (if currently animating, working is true)
|
147 |
-
slider.working = false;
|
148 |
-
// initialize the controls object
|
149 |
-
slider.controls = {};
|
150 |
-
// initialize an auto interval
|
151 |
-
slider.interval = null;
|
152 |
-
// determine which property to use for transitions
|
153 |
-
slider.animProp = slider.settings.mode == 'vertical' ? 'top' : 'left';
|
154 |
-
// determine if hardware acceleration can be used
|
155 |
-
slider.usingCSS = slider.settings.useCSS && slider.settings.mode != 'fade' && (function(){
|
156 |
-
// create our test div element
|
157 |
-
var div = document.createElement('div');
|
158 |
-
// css transition properties
|
159 |
-
var props = ['WebkitPerspective', 'MozPerspective', 'OPerspective', 'msPerspective'];
|
160 |
-
// test for each property
|
161 |
-
for(var i in props){
|
162 |
-
if(div.style[props[i]] !== undefined){
|
163 |
-
slider.cssPrefix = props[i].replace('Perspective', '').toLowerCase();
|
164 |
-
slider.animProp = '-' + slider.cssPrefix + '-transform';
|
165 |
-
return true;
|
166 |
-
}
|
167 |
-
}
|
168 |
-
return false;
|
169 |
-
}());
|
170 |
-
// if vertical mode always make maxSlides and minSlides equal
|
171 |
-
if(slider.settings.mode == 'vertical') slider.settings.maxSlides = slider.settings.minSlides;
|
172 |
-
// save original style data
|
173 |
-
el.data("origStyle", el.attr("style"));
|
174 |
-
el.children(slider.settings.slideSelector).each(function() {
|
175 |
-
$(this).data("origStyle", $(this).attr("style"));
|
176 |
-
});
|
177 |
-
// perform all DOM / CSS modifications
|
178 |
-
setup();
|
179 |
-
}
|
180 |
-
|
181 |
-
/**
|
182 |
-
* Performs all DOM and CSS modifications
|
183 |
-
*/
|
184 |
-
var setup = function(){
|
185 |
-
// wrap el in a wrapper
|
186 |
-
el.wrap('<div class="' + slider.settings.wrapperClass + '"><div class="bx-viewport"></div></div>');
|
187 |
-
// store a namspace reference to .bx-viewport
|
188 |
-
slider.viewport = el.parent();
|
189 |
-
// add a loading div to display while images are loading
|
190 |
-
slider.loader = $('<div class="bx-loading" />');
|
191 |
-
slider.viewport.prepend(slider.loader);
|
192 |
-
// set el to a massive width, to hold any needed slides
|
193 |
-
// also strip any margin and padding from el
|
194 |
-
el.css({
|
195 |
-
width: slider.settings.mode == 'horizontal' ? (slider.children.length * 100 + 215) + '%' : 'auto',
|
196 |
-
position: 'relative'
|
197 |
-
});
|
198 |
-
// if using CSS, add the easing property
|
199 |
-
if(slider.usingCSS && slider.settings.easing){
|
200 |
-
el.css('-' + slider.cssPrefix + '-transition-timing-function', slider.settings.easing);
|
201 |
-
// if not using CSS and no easing value was supplied, use the default JS animation easing (swing)
|
202 |
-
}else if(!slider.settings.easing){
|
203 |
-
slider.settings.easing = 'swing';
|
204 |
-
}
|
205 |
-
var slidesShowing = getNumberSlidesShowing();
|
206 |
-
// make modifications to the viewport (.bx-viewport)
|
207 |
-
slider.viewport.css({
|
208 |
-
width: '100%',
|
209 |
-
overflow: 'hidden',
|
210 |
-
position: 'relative'
|
211 |
-
});
|
212 |
-
slider.viewport.parent().css({
|
213 |
-
maxWidth: getViewportMaxWidth()
|
214 |
-
});
|
215 |
-
// make modification to the wrapper (.bx-wrapper)
|
216 |
-
if(!slider.settings.pager) {
|
217 |
-
slider.viewport.parent().css({
|
218 |
-
margin: '0 auto 0px'
|
219 |
-
});
|
220 |
-
}
|
221 |
-
// apply css to all slider children
|
222 |
-
slider.children.css({
|
223 |
-
'float': slider.settings.mode == 'horizontal' ? 'left' : 'none',
|
224 |
-
listStyle: 'none',
|
225 |
-
position: 'relative'
|
226 |
-
});
|
227 |
-
// apply the calculated width after the float is applied to prevent scrollbar interference
|
228 |
-
slider.children.css('width', getSlideWidth());
|
229 |
-
// if slideMargin is supplied, add the css
|
230 |
-
if(slider.settings.mode == 'horizontal' && slider.settings.slideMargin > 0) slider.children.css('marginRight', slider.settings.slideMargin);
|
231 |
-
if(slider.settings.mode == 'vertical' && slider.settings.slideMargin > 0) slider.children.css('marginBottom', slider.settings.slideMargin);
|
232 |
-
// if "fade" mode, add positioning and z-index CSS
|
233 |
-
if(slider.settings.mode == 'fade'){
|
234 |
-
slider.children.css({
|
235 |
-
position: 'absolute',
|
236 |
-
zIndex: 0,
|
237 |
-
display: 'none'
|
238 |
-
});
|
239 |
-
// prepare the z-index on the showing element
|
240 |
-
slider.children.eq(slider.settings.startSlide).css({zIndex: slider.settings.slideZIndex, display: 'block'});
|
241 |
-
}
|
242 |
-
// create an element to contain all slider controls (pager, start / stop, etc)
|
243 |
-
slider.controls.el = $('<div class="bx-controls" />');
|
244 |
-
// if captions are requested, add them
|
245 |
-
if(slider.settings.captions) appendCaptions();
|
246 |
-
// check if startSlide is last slide
|
247 |
-
slider.active.last = slider.settings.startSlide == getPagerQty() - 1;
|
248 |
-
// if video is true, set up the fitVids plugin
|
249 |
-
if(slider.settings.video) el.fitVids();
|
250 |
-
// set the default preload selector (visible)
|
251 |
-
var preloadSelector = slider.children.eq(slider.settings.startSlide);
|
252 |
-
if (slider.settings.preloadImages == "all") preloadSelector = slider.children;
|
253 |
-
// only check for control addition if not in "ticker" mode
|
254 |
-
if(!slider.settings.ticker){
|
255 |
-
// if pager is requested, add it
|
256 |
-
if(slider.settings.pager) appendPager();
|
257 |
-
// if controls are requested, add them
|
258 |
-
if(slider.settings.controls) appendControls();
|
259 |
-
// if auto is true, and auto controls are requested, add them
|
260 |
-
if(slider.settings.auto && slider.settings.autoControls) appendControlsAuto();
|
261 |
-
// if any control option is requested, add the controls wrapper
|
262 |
-
if(slider.settings.controls || slider.settings.autoControls || slider.settings.pager) slider.viewport.after(slider.controls.el);
|
263 |
-
// if ticker mode, do not allow a pager
|
264 |
-
}else{
|
265 |
-
slider.settings.pager = false;
|
266 |
-
}
|
267 |
-
// preload all images, then perform final DOM / CSS modifications that depend on images being loaded
|
268 |
-
loadElements(preloadSelector, start);
|
269 |
-
}
|
270 |
-
|
271 |
-
var loadElements = function(selector, callback){
|
272 |
-
var total = selector.find('img, iframe').length;
|
273 |
-
if (total == 0){
|
274 |
-
callback();
|
275 |
-
return;
|
276 |
-
}
|
277 |
-
var count = 0;
|
278 |
-
selector.find('img, iframe').each(function(){
|
279 |
-
$(this).one('load', function() {
|
280 |
-
if(++count == total) callback();
|
281 |
-
}).each(function() {
|
282 |
-
if(this.complete) $(this).load();
|
283 |
-
});
|
284 |
-
});
|
285 |
-
}
|
286 |
-
|
287 |
-
/**
|
288 |
-
* Start the slider
|
289 |
-
*/
|
290 |
-
var start = function(){
|
291 |
-
// if infinite loop, prepare additional slides
|
292 |
-
if(slider.settings.infiniteLoop && slider.settings.mode != 'fade' && !slider.settings.ticker){
|
293 |
-
var slice = slider.settings.mode == 'vertical' ? slider.settings.minSlides : slider.settings.maxSlides;
|
294 |
-
var sliceAppend = slider.children.slice(0, slice).clone().addClass('bx-clone');
|
295 |
-
var slicePrepend = slider.children.slice(-slice).clone().addClass('bx-clone');
|
296 |
-
el.append(sliceAppend).prepend(slicePrepend);
|
297 |
-
}
|
298 |
-
// remove the loading DOM element
|
299 |
-
slider.loader.remove();
|
300 |
-
// set the left / top position of "el"
|
301 |
-
setSlidePosition();
|
302 |
-
// if "vertical" mode, always use adaptiveHeight to prevent odd behavior
|
303 |
-
if (slider.settings.mode == 'vertical') slider.settings.adaptiveHeight = true;
|
304 |
-
// set the viewport height
|
305 |
-
slider.viewport.height(getViewportHeight());
|
306 |
-
// make sure everything is positioned just right (same as a window resize)
|
307 |
-
el.redrawSlider();
|
308 |
-
// onSliderLoad callback
|
309 |
-
slider.settings.onSliderLoad(slider.active.index);
|
310 |
-
// slider has been fully initialized
|
311 |
-
slider.initialized = true;
|
312 |
-
// bind the resize call to the window
|
313 |
-
if (slider.settings.responsive) $(window).bind('resize', resizeWindow);
|
314 |
-
// if auto is true and has more than 1 page, start the show
|
315 |
-
if (slider.settings.auto && slider.settings.autoStart && (getPagerQty() > 1 || slider.settings.autoSlideForOnePage)) initAuto();
|
316 |
-
// if ticker is true, start the ticker
|
317 |
-
if (slider.settings.ticker) initTicker();
|
318 |
-
// if pager is requested, make the appropriate pager link active
|
319 |
-
if (slider.settings.pager) updatePagerActive(slider.settings.startSlide);
|
320 |
-
// check for any updates to the controls (like hideControlOnEnd updates)
|
321 |
-
if (slider.settings.controls) updateDirectionControls();
|
322 |
-
// if touchEnabled is true, setup the touch events
|
323 |
-
if (slider.settings.touchEnabled && !slider.settings.ticker) initTouch();
|
324 |
-
}
|
325 |
-
|
326 |
-
/**
|
327 |
-
* Returns the calculated height of the viewport, used to determine either adaptiveHeight or the maxHeight value
|
328 |
-
*/
|
329 |
-
var getViewportHeight = function(){
|
330 |
-
var height = 0;
|
331 |
-
// first determine which children (slides) should be used in our height calculation
|
332 |
-
var children = $();
|
333 |
-
// if mode is not "vertical" and adaptiveHeight is false, include all children
|
334 |
-
if(slider.settings.mode != 'vertical' && !slider.settings.adaptiveHeight){
|
335 |
-
children = slider.children;
|
336 |
-
}else{
|
337 |
-
// if not carousel, return the single active child
|
338 |
-
if(!slider.carousel){
|
339 |
-
children = slider.children.eq(slider.active.index);
|
340 |
-
// if carousel, return a slice of children
|
341 |
-
}else{
|
342 |
-
// get the individual slide index
|
343 |
-
var currentIndex = slider.settings.moveSlides == 1 ? slider.active.index : slider.active.index * getMoveBy();
|
344 |
-
// add the current slide to the children
|
345 |
-
children = slider.children.eq(currentIndex);
|
346 |
-
// cycle through the remaining "showing" slides
|
347 |
-
for (i = 1; i <= slider.settings.maxSlides - 1; i++){
|
348 |
-
// if looped back to the start
|
349 |
-
if(currentIndex + i >= slider.children.length){
|
350 |
-
children = children.add(slider.children.eq(i - 1));
|
351 |
-
}else{
|
352 |
-
children = children.add(slider.children.eq(currentIndex + i));
|
353 |
-
}
|
354 |
-
}
|
355 |
-
}
|
356 |
-
}
|
357 |
-
// if "vertical" mode, calculate the sum of the heights of the children
|
358 |
-
if(slider.settings.mode == 'vertical'){
|
359 |
-
children.each(function(index) {
|
360 |
-
height += $(this).outerHeight();
|
361 |
-
});
|
362 |
-
// add user-supplied margins
|
363 |
-
if(slider.settings.slideMargin > 0){
|
364 |
-
height += slider.settings.slideMargin * (slider.settings.minSlides - 1);
|
365 |
-
}
|
366 |
-
// if not "vertical" mode, calculate the max height of the children
|
367 |
-
}else{
|
368 |
-
height = Math.max.apply(Math, children.map(function(){
|
369 |
-
return $(this).outerHeight(false);
|
370 |
-
}).get());
|
371 |
-
}
|
372 |
-
|
373 |
-
if(slider.viewport.css('box-sizing') == 'border-box'){
|
374 |
-
height += parseFloat(slider.viewport.css('padding-top')) + parseFloat(slider.viewport.css('padding-bottom')) +
|
375 |
-
parseFloat(slider.viewport.css('border-top-width')) + parseFloat(slider.viewport.css('border-bottom-width'));
|
376 |
-
}else if(slider.viewport.css('box-sizing') == 'padding-box'){
|
377 |
-
height += parseFloat(slider.viewport.css('padding-top')) + parseFloat(slider.viewport.css('padding-bottom'));
|
378 |
-
}
|
379 |
-
|
380 |
-
return height;
|
381 |
-
}
|
382 |
-
|
383 |
-
/**
|
384 |
-
* Returns the calculated width to be used for the outer wrapper / viewport
|
385 |
-
*/
|
386 |
-
var getViewportMaxWidth = function(){
|
387 |
-
var width = '100%';
|
388 |
-
if(slider.settings.slideWidth > 0){
|
389 |
-
if(slider.settings.mode == 'horizontal'){
|
390 |
-
width = (slider.settings.maxSlides * slider.settings.slideWidth) + ((slider.settings.maxSlides - 1) * slider.settings.slideMargin);
|
391 |
-
}else{
|
392 |
-
width = slider.settings.slideWidth;
|
393 |
-
}
|
394 |
-
}
|
395 |
-
return width;
|
396 |
-
}
|
397 |
-
|
398 |
-
/**
|
399 |
-
* Returns the calculated width to be applied to each slide
|
400 |
-
*/
|
401 |
-
var getSlideWidth = function(){
|
402 |
-
// start with any user-supplied slide width
|
403 |
-
var newElWidth = slider.settings.slideWidth;
|
404 |
-
// get the current viewport width
|
405 |
-
var wrapWidth = slider.viewport.width();
|
406 |
-
// if slide width was not supplied, or is larger than the viewport use the viewport width
|
407 |
-
if(slider.settings.slideWidth == 0 ||
|
408 |
-
(slider.settings.slideWidth > wrapWidth && !slider.carousel) ||
|
409 |
-
slider.settings.mode == 'vertical'){
|
410 |
-
newElWidth = wrapWidth;
|
411 |
-
// if carousel, use the thresholds to determine the width
|
412 |
-
}else if(slider.settings.maxSlides > 1 && slider.settings.mode == 'horizontal'){
|
413 |
-
if(wrapWidth > slider.maxThreshold){
|
414 |
-
// newElWidth = (wrapWidth - (slider.settings.slideMargin * (slider.settings.maxSlides - 1))) / slider.settings.maxSlides;
|
415 |
-
}else if(wrapWidth < slider.minThreshold){
|
416 |
-
newElWidth = (wrapWidth - (slider.settings.slideMargin * (slider.settings.minSlides - 1))) / slider.settings.minSlides;
|
417 |
-
}
|
418 |
-
}
|
419 |
-
return newElWidth;
|
420 |
-
}
|
421 |
-
|
422 |
-
/**
|
423 |
-
* Returns the number of slides currently visible in the viewport (includes partially visible slides)
|
424 |
-
*/
|
425 |
-
var getNumberSlidesShowing = function(){
|
426 |
-
var slidesShowing = 1;
|
427 |
-
if(slider.settings.mode == 'horizontal' && slider.settings.slideWidth > 0){
|
428 |
-
// if viewport is smaller than minThreshold, return minSlides
|
429 |
-
if(slider.viewport.width() < slider.minThreshold){
|
430 |
-
slidesShowing = slider.settings.minSlides;
|
431 |
-
// if viewport is larger than minThreshold, return maxSlides
|
432 |
-
}else if(slider.viewport.width() > slider.maxThreshold){
|
433 |
-
slidesShowing = slider.settings.maxSlides;
|
434 |
-
// if viewport is between min / max thresholds, divide viewport width by first child width
|
435 |
-
}else{
|
436 |
-
var childWidth = slider.children.first().width() + slider.settings.slideMargin;
|
437 |
-
slidesShowing = Math.floor((slider.viewport.width() +
|
438 |
-
slider.settings.slideMargin) / childWidth);
|
439 |
-
}
|
440 |
-
// if "vertical" mode, slides showing will always be minSlides
|
441 |
-
}else if(slider.settings.mode == 'vertical'){
|
442 |
-
slidesShowing = slider.settings.minSlides;
|
443 |
-
}
|
444 |
-
return slidesShowing;
|
445 |
-
}
|
446 |
-
|
447 |
-
/**
|
448 |
-
* Returns the number of pages (one full viewport of slides is one "page")
|
449 |
-
*/
|
450 |
-
var getPagerQty = function(){
|
451 |
-
var pagerQty = 0;
|
452 |
-
// if moveSlides is specified by the user
|
453 |
-
if(slider.settings.moveSlides > 0){
|
454 |
-
if(slider.settings.infiniteLoop){
|
455 |
-
pagerQty = Math.ceil(slider.children.length / getMoveBy());
|
456 |
-
}else{
|
457 |
-
// use a while loop to determine pages
|
458 |
-
var breakPoint = 0;
|
459 |
-
var counter = 0
|
460 |
-
// when breakpoint goes above children length, counter is the number of pages
|
461 |
-
while (breakPoint < slider.children.length){
|
462 |
-
++pagerQty;
|
463 |
-
breakPoint = counter + getNumberSlidesShowing();
|
464 |
-
counter += slider.settings.moveSlides <= getNumberSlidesShowing() ? slider.settings.moveSlides : getNumberSlidesShowing();
|
465 |
-
}
|
466 |
-
}
|
467 |
-
// if moveSlides is 0 (auto) divide children length by sides showing, then round up
|
468 |
-
}else{
|
469 |
-
pagerQty = Math.ceil(slider.children.length / getNumberSlidesShowing());
|
470 |
-
}
|
471 |
-
return pagerQty;
|
472 |
-
}
|
473 |
-
|
474 |
-
/**
|
475 |
-
* Returns the number of indivual slides by which to shift the slider
|
476 |
-
*/
|
477 |
-
var getMoveBy = function(){
|
478 |
-
// if moveSlides was set by the user and moveSlides is less than number of slides showing
|
479 |
-
if(slider.settings.moveSlides > 0 && slider.settings.moveSlides <= getNumberSlidesShowing()){
|
480 |
-
return slider.settings.moveSlides;
|
481 |
-
}
|
482 |
-
// if moveSlides is 0 (auto)
|
483 |
-
return getNumberSlidesShowing();
|
484 |
-
}
|
485 |
-
|
486 |
-
/**
|
487 |
-
* Sets the slider's (el) left or top position
|
488 |
-
*/
|
489 |
-
var setSlidePosition = function(){
|
490 |
-
// if last slide, not infinite loop, and number of children is larger than specified maxSlides
|
491 |
-
if(slider.children.length > slider.settings.maxSlides && slider.active.last && !slider.settings.infiniteLoop){
|
492 |
-
if (slider.settings.mode == 'horizontal'){
|
493 |
-
// get the last child's position
|
494 |
-
var lastChild = slider.children.last();
|
495 |
-
var position = lastChild.position();
|
496 |
-
// set the left position
|
497 |
-
setPositionProperty(-(position.left - (slider.viewport.width() - lastChild.outerWidth())), 'reset', 0);
|
498 |
-
}else if(slider.settings.mode == 'vertical'){
|
499 |
-
// get the last showing index's position
|
500 |
-
var lastShowingIndex = slider.children.length - slider.settings.minSlides;
|
501 |
-
var position = slider.children.eq(lastShowingIndex).position();
|
502 |
-
// set the top position
|
503 |
-
setPositionProperty(-position.top, 'reset', 0);
|
504 |
-
}
|
505 |
-
// if not last slide
|
506 |
-
}else{
|
507 |
-
// get the position of the first showing slide
|
508 |
-
var position = slider.children.eq(slider.active.index * getMoveBy()).position();
|
509 |
-
// check for last slide
|
510 |
-
if (slider.active.index == getPagerQty() - 1) slider.active.last = true;
|
511 |
-
// set the repective position
|
512 |
-
if (position != undefined){
|
513 |
-
if (slider.settings.mode == 'horizontal') setPositionProperty(-position.left, 'reset', 0);
|
514 |
-
else if (slider.settings.mode == 'vertical') setPositionProperty(-position.top, 'reset', 0);
|
515 |
-
}
|
516 |
-
}
|
517 |
-
}
|
518 |
-
|
519 |
-
/**
|
520 |
-
* Sets the el's animating property position (which in turn will sometimes animate el).
|
521 |
-
* If using CSS, sets the transform property. If not using CSS, sets the top / left property.
|
522 |
-
*
|
523 |
-
* @param value (int)
|
524 |
-
* - the animating property's value
|
525 |
-
*
|
526 |
-
* @param type (string) 'slider', 'reset', 'ticker'
|
527 |
-
* - the type of instance for which the function is being
|
528 |
-
*
|
529 |
-
* @param duration (int)
|
530 |
-
* - the amount of time (in ms) the transition should occupy
|
531 |
-
*
|
532 |
-
* @param params (array) optional
|
533 |
-
* - an optional parameter containing any variables that need to be passed in
|
534 |
-
*/
|
535 |
-
var setPositionProperty = function(value, type, duration, params){
|
536 |
-
// use CSS transform
|
537 |
-
if(slider.usingCSS){
|
538 |
-
// determine the translate3d value
|
539 |
-
var propValue = slider.settings.mode == 'vertical' ? 'translate3d(0, ' + value + 'px, 0)' : 'translate3d(' + value + 'px, 0, 0)';
|
540 |
-
// add the CSS transition-duration
|
541 |
-
el.css('-' + slider.cssPrefix + '-transition-duration', duration / 1000 + 's');
|
542 |
-
if(type == 'slide'){
|
543 |
-
// set the property value
|
544 |
-
el.css(slider.animProp, propValue);
|
545 |
-
// bind a callback method - executes when CSS transition completes
|
546 |
-
el.bind('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd', function(){
|
547 |
-
// unbind the callback
|
548 |
-
el.unbind('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd');
|
549 |
-
updateAfterSlideTransition();
|
550 |
-
});
|
551 |
-
}else if(type == 'reset'){
|
552 |
-
el.css(slider.animProp, propValue);
|
553 |
-
}else if(type == 'ticker'){
|
554 |
-
// make the transition use 'linear'
|
555 |
-
el.css('-' + slider.cssPrefix + '-transition-timing-function', 'linear');
|
556 |
-
el.css(slider.animProp, propValue);
|
557 |
-
// bind a callback method - executes when CSS transition completes
|
558 |
-
el.bind('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd', function(){
|
559 |
-
// unbind the callback
|
560 |
-
el.unbind('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd');
|
561 |
-
// reset the position
|
562 |
-
setPositionProperty(params['resetValue'], 'reset', 0);
|
563 |
-
// start the loop again
|
564 |
-
tickerLoop();
|
565 |
-
});
|
566 |
-
}
|
567 |
-
// use JS animate
|
568 |
-
}else{
|
569 |
-
var animateObj = {};
|
570 |
-
animateObj[slider.animProp] = value;
|
571 |
-
if(type == 'slide'){
|
572 |
-
el.animate(animateObj, duration, slider.settings.easing, function(){
|
573 |
-
updateAfterSlideTransition();
|
574 |
-
});
|
575 |
-
}else if(type == 'reset'){
|
576 |
-
el.css(slider.animProp, value)
|
577 |
-
}else if(type == 'ticker'){
|
578 |
-
el.animate(animateObj, speed, 'linear', function(){
|
579 |
-
setPositionProperty(params['resetValue'], 'reset', 0);
|
580 |
-
// run the recursive loop after animation
|
581 |
-
tickerLoop();
|
582 |
-
});
|
583 |
-
}
|
584 |
-
}
|
585 |
-
}
|
586 |
-
|
587 |
-
/**
|
588 |
-
* Populates the pager with proper amount of pages
|
589 |
-
*/
|
590 |
-
var populatePager = function(){
|
591 |
-
var pagerHtml = '';
|
592 |
-
var pagerQty = getPagerQty();
|
593 |
-
// loop through each pager item
|
594 |
-
for(var i=0; i < pagerQty; i++){
|
595 |
-
var linkContent = '';
|
596 |
-
// if a buildPager function is supplied, use it to get pager link value, else use index + 1
|
597 |
-
if(slider.settings.buildPager && $.isFunction(slider.settings.buildPager)){
|
598 |
-
linkContent = slider.settings.buildPager(i);
|
599 |
-
slider.pagerEl.addClass('bx-custom-pager');
|
600 |
-
}else{
|
601 |
-
linkContent = i + 1;
|
602 |
-
slider.pagerEl.addClass('bx-default-pager');
|
603 |
-
}
|
604 |
-
// var linkContent = slider.settings.buildPager && $.isFunction(slider.settings.buildPager) ? slider.settings.buildPager(i) : i + 1;
|
605 |
-
// add the markup to the string
|
606 |
-
pagerHtml += '<div class="bx-pager-item"><a href="" data-slide-index="' + i + '" class="bx-pager-link">' + linkContent + '</a></div>';
|
607 |
-
};
|
608 |
-
// populate the pager element with pager links
|
609 |
-
slider.pagerEl.html(pagerHtml);
|
610 |
-
}
|
611 |
-
|
612 |
-
/**
|
613 |
-
* Appends the pager to the controls element
|
614 |
-
*/
|
615 |
-
var appendPager = function(){
|
616 |
-
if(!slider.settings.pagerCustom){
|
617 |
-
// create the pager DOM element
|
618 |
-
slider.pagerEl = $('<div class="bx-pager" />');
|
619 |
-
// if a pager selector was supplied, populate it with the pager
|
620 |
-
if(slider.settings.pagerSelector){
|
621 |
-
$(slider.settings.pagerSelector).html(slider.pagerEl);
|
622 |
-
// if no pager selector was supplied, add it after the wrapper
|
623 |
-
}else{
|
624 |
-
slider.controls.el.addClass('bx-has-pager').append(slider.pagerEl);
|
625 |
-
}
|
626 |
-
// populate the pager
|
627 |
-
populatePager();
|
628 |
-
}else{
|
629 |
-
slider.pagerEl = $(slider.settings.pagerCustom);
|
630 |
-
}
|
631 |
-
// assign the pager click binding
|
632 |
-
slider.pagerEl.on('click', 'a', clickPagerBind);
|
633 |
-
}
|
634 |
-
|
635 |
-
/**
|
636 |
-
* Appends prev / next controls to the controls element
|
637 |
-
*/
|
638 |
-
var appendControls = function(){
|
639 |
-
slider.controls.next = $('<a class="bx-next" href="">' + slider.settings.nextText + '</a>');
|
640 |
-
slider.controls.prev = $('<a class="bx-prev" href="">' + slider.settings.prevText + '</a>');
|
641 |
-
// bind click actions to the controls
|
642 |
-
slider.controls.next.bind('click', clickNextBind);
|
643 |
-
slider.controls.prev.bind('click', clickPrevBind);
|
644 |
-
// if nextSlector was supplied, populate it
|
645 |
-
if(slider.settings.nextSelector){
|
646 |
-
$(slider.settings.nextSelector).append(slider.controls.next);
|
647 |
-
}
|
648 |
-
// if prevSlector was supplied, populate it
|
649 |
-
if(slider.settings.prevSelector){
|
650 |
-
$(slider.settings.prevSelector).append(slider.controls.prev);
|
651 |
-
}
|
652 |
-
// if no custom selectors were supplied
|
653 |
-
if(!slider.settings.nextSelector && !slider.settings.prevSelector){
|
654 |
-
// add the controls to the DOM
|
655 |
-
slider.controls.directionEl = $('<div class="bx-controls-direction" />');
|
656 |
-
// add the control elements to the directionEl
|
657 |
-
slider.controls.directionEl.append(slider.controls.prev).append(slider.controls.next);
|
658 |
-
// slider.viewport.append(slider.controls.directionEl);
|
659 |
-
slider.controls.el.addClass('bx-has-controls-direction').append(slider.controls.directionEl);
|
660 |
-
}
|
661 |
-
}
|
662 |
-
|
663 |
-
/**
|
664 |
-
* Appends start / stop auto controls to the controls element
|
665 |
-
*/
|
666 |
-
var appendControlsAuto = function(){
|
667 |
-
slider.controls.start = $('<div class="bx-controls-auto-item"><a class="bx-start" href="">' + slider.settings.startText + '</a></div>');
|
668 |
-
slider.controls.stop = $('<div class="bx-controls-auto-item"><a class="bx-stop" href="">' + slider.settings.stopText + '</a></div>');
|
669 |
-
// add the controls to the DOM
|
670 |
-
slider.controls.autoEl = $('<div class="bx-controls-auto" />');
|
671 |
-
// bind click actions to the controls
|
672 |
-
slider.controls.autoEl.on('click', '.bx-start', clickStartBind);
|
673 |
-
slider.controls.autoEl.on('click', '.bx-stop', clickStopBind);
|
674 |
-
// if autoControlsCombine, insert only the "start" control
|
675 |
-
if(slider.settings.autoControlsCombine){
|
676 |
-
slider.controls.autoEl.append(slider.controls.start);
|
677 |
-
// if autoControlsCombine is false, insert both controls
|
678 |
-
}else{
|
679 |
-
slider.controls.autoEl.append(slider.controls.start).append(slider.controls.stop);
|
680 |
-
}
|
681 |
-
// if auto controls selector was supplied, populate it with the controls
|
682 |
-
if(slider.settings.autoControlsSelector){
|
683 |
-
$(slider.settings.autoControlsSelector).html(slider.controls.autoEl);
|
684 |
-
// if auto controls selector was not supplied, add it after the wrapper
|
685 |
-
}else{
|
686 |
-
slider.controls.el.addClass('bx-has-controls-auto').append(slider.controls.autoEl);
|
687 |
-
}
|
688 |
-
// update the auto controls
|
689 |
-
updateAutoControls(slider.settings.autoStart ? 'stop' : 'start');
|
690 |
-
}
|
691 |
-
|
692 |
-
/**
|
693 |
-
* Appends image captions to the DOM
|
694 |
-
*/
|
695 |
-
var appendCaptions = function(){
|
696 |
-
// cycle through each child
|
697 |
-
slider.children.each(function(index){
|
698 |
-
// get the image title attribute
|
699 |
-
var title = $(this).find('img:first').attr('title');
|
700 |
-
// append the caption
|
701 |
-
if (title != undefined && ('' + title).length) {
|
702 |
-
$(this).append('<div class="bx-caption"><span>' + title + '</span></div>');
|
703 |
-
}
|
704 |
-
});
|
705 |
-
}
|
706 |
-
|
707 |
-
/**
|
708 |
-
* Click next binding
|
709 |
-
*
|
710 |
-
* @param e (event)
|
711 |
-
* - DOM event object
|
712 |
-
*/
|
713 |
-
var clickNextBind = function(e){
|
714 |
-
// if auto show is running, stop it
|
715 |
-
if (slider.settings.auto) el.stopAuto();
|
716 |
-
el.goToNextSlide();
|
717 |
-
e.preventDefault();
|
718 |
-
}
|
719 |
-
|
720 |
-
/**
|
721 |
-
* Click prev binding
|
722 |
-
*
|
723 |
-
* @param e (event)
|
724 |
-
* - DOM event object
|
725 |
-
*/
|
726 |
-
var clickPrevBind = function(e){
|
727 |
-
// if auto show is running, stop it
|
728 |
-
if (slider.settings.auto) el.stopAuto();
|
729 |
-
el.goToPrevSlide();
|
730 |
-
e.preventDefault();
|
731 |
-
}
|
732 |
-
|
733 |
-
/**
|
734 |
-
* Click start binding
|
735 |
-
*
|
736 |
-
* @param e (event)
|
737 |
-
* - DOM event object
|
738 |
-
*/
|
739 |
-
var clickStartBind = function(e){
|
740 |
-
el.startAuto();
|
741 |
-
e.preventDefault();
|
742 |
-
}
|
743 |
-
|
744 |
-
/**
|
745 |
-
* Click stop binding
|
746 |
-
*
|
747 |
-
* @param e (event)
|
748 |
-
* - DOM event object
|
749 |
-
*/
|
750 |
-
var clickStopBind = function(e){
|
751 |
-
el.stopAuto();
|
752 |
-
e.preventDefault();
|
753 |
-
}
|
754 |
-
|
755 |
-
/**
|
756 |
-
* Click pager binding
|
757 |
-
*
|
758 |
-
* @param e (event)
|
759 |
-
* - DOM event object
|
760 |
-
*/
|
761 |
-
var clickPagerBind = function(e){
|
762 |
-
// if auto show is running, stop it
|
763 |
-
if (slider.settings.auto) el.stopAuto();
|
764 |
-
var pagerLink = $(e.currentTarget);
|
765 |
-
if(pagerLink.attr('data-slide-index') !== undefined){
|
766 |
-
var pagerIndex = parseInt(pagerLink.attr('data-slide-index'));
|
767 |
-
// if clicked pager link is not active, continue with the goToSlide call
|
768 |
-
if(pagerIndex != slider.active.index) el.goToSlide(pagerIndex);
|
769 |
-
e.preventDefault();
|
770 |
-
}
|
771 |
-
}
|
772 |
-
|
773 |
-
/**
|
774 |
-
* Updates the pager links with an active class
|
775 |
-
*
|
776 |
-
* @param slideIndex (int)
|
777 |
-
* - index of slide to make active
|
778 |
-
*/
|
779 |
-
var updatePagerActive = function(slideIndex){
|
780 |
-
// if "short" pager type
|
781 |
-
var len = slider.children.length; // nb of children
|
782 |
-
if(slider.settings.pagerType == 'short'){
|
783 |
-
if(slider.settings.maxSlides > 1) {
|
784 |
-
len = Math.ceil(slider.children.length/slider.settings.maxSlides);
|
785 |
-
}
|
786 |
-
slider.pagerEl.html( (slideIndex + 1) + slider.settings.pagerShortSeparator + len);
|
787 |
-
return;
|
788 |
-
}
|
789 |
-
// remove all pager active classes
|
790 |
-
slider.pagerEl.find('a').removeClass('active');
|
791 |
-
// apply the active class for all pagers
|
792 |
-
slider.pagerEl.each(function(i, el) { $(el).find('a').eq(slideIndex).addClass('active'); });
|
793 |
-
}
|
794 |
-
|
795 |
-
/**
|
796 |
-
* Performs needed actions after a slide transition
|
797 |
-
*/
|
798 |
-
var updateAfterSlideTransition = function(){
|
799 |
-
// if infinte loop is true
|
800 |
-
if(slider.settings.infiniteLoop){
|
801 |
-
var position = '';
|
802 |
-
// first slide
|
803 |
-
if(slider.active.index == 0){
|
804 |
-
// set the new position
|
805 |
-
position = slider.children.eq(0).position();
|
806 |
-
// carousel, last slide
|
807 |
-
}else if(slider.active.index == getPagerQty() - 1 && slider.carousel){
|
808 |
-
position = slider.children.eq((getPagerQty() - 1) * getMoveBy()).position();
|
809 |
-
// last slide
|
810 |
-
}else if(slider.active.index == slider.children.length - 1){
|
811 |
-
position = slider.children.eq(slider.children.length - 1).position();
|
812 |
-
}
|
813 |
-
if(position){
|
814 |
-
if (slider.settings.mode == 'horizontal') { setPositionProperty(-position.left, 'reset', 0); }
|
815 |
-
else if (slider.settings.mode == 'vertical') { setPositionProperty(-position.top, 'reset', 0); }
|
816 |
-
}
|
817 |
-
}
|
818 |
-
// declare that the transition is complete
|
819 |
-
slider.working = false;
|
820 |
-
// onSlideAfter callback
|
821 |
-
slider.settings.onSlideAfter(slider.children.eq(slider.active.index), slider.oldIndex, slider.active.index);
|
822 |
-
}
|
823 |
-
|
824 |
-
/**
|
825 |
-
* Updates the auto controls state (either active, or combined switch)
|
826 |
-
*
|
827 |
-
* @param state (string) "start", "stop"
|
828 |
-
* - the new state of the auto show
|
829 |
-
*/
|
830 |
-
var updateAutoControls = function(state){
|
831 |
-
// if autoControlsCombine is true, replace the current control with the new state
|
832 |
-
if(slider.settings.autoControlsCombine){
|
833 |
-
slider.controls.autoEl.html(slider.controls[state]);
|
834 |
-
// if autoControlsCombine is false, apply the "active" class to the appropriate control
|
835 |
-
}else{
|
836 |
-
slider.controls.autoEl.find('a').removeClass('active');
|
837 |
-
slider.controls.autoEl.find('a:not(.bx-' + state + ')').addClass('active');
|
838 |
-
}
|
839 |
-
}
|
840 |
-
|
841 |
-
/**
|
842 |
-
* Updates the direction controls (checks if either should be hidden)
|
843 |
-
*/
|
844 |
-
var updateDirectionControls = function(){
|
845 |
-
if(getPagerQty() == 1){
|
846 |
-
slider.controls.prev.addClass('disabled');
|
847 |
-
slider.controls.next.addClass('disabled');
|
848 |
-
}else if(!slider.settings.infiniteLoop && slider.settings.hideControlOnEnd){
|
849 |
-
// if first slide
|
850 |
-
if (slider.active.index == 0){
|
851 |
-
slider.controls.prev.addClass('disabled');
|
852 |
-
slider.controls.next.removeClass('disabled');
|
853 |
-
// if last slide
|
854 |
-
}else if(slider.active.index == getPagerQty() - 1){
|
855 |
-
slider.controls.next.addClass('disabled');
|
856 |
-
slider.controls.prev.removeClass('disabled');
|
857 |
-
// if any slide in the middle
|
858 |
-
}else{
|
859 |
-
slider.controls.prev.removeClass('disabled');
|
860 |
-
slider.controls.next.removeClass('disabled');
|
861 |
-
}
|
862 |
-
}
|
863 |
-
}
|
864 |
-
|
865 |
-
/**
|
866 |
-
* Initialzes the auto process
|
867 |
-
*/
|
868 |
-
var initAuto = function(){
|
869 |
-
// if autoDelay was supplied, launch the auto show using a setTimeout() call
|
870 |
-
if(slider.settings.autoDelay > 0){
|
871 |
-
var timeout = setTimeout(el.startAuto, slider.settings.autoDelay);
|
872 |
-
// if autoDelay was not supplied, start the auto show normally
|
873 |
-
}else{
|
874 |
-
el.startAuto();
|
875 |
-
}
|
876 |
-
// if autoHover is requested
|
877 |
-
if(slider.settings.autoHover){
|
878 |
-
// on el hover
|
879 |
-
el.hover(function(){
|
880 |
-
// if the auto show is currently playing (has an active interval)
|
881 |
-
if(slider.interval){
|
882 |
-
// stop the auto show and pass true agument which will prevent control update
|
883 |
-
el.stopAuto(true);
|
884 |
-
// create a new autoPaused value which will be used by the relative "mouseout" event
|
885 |
-
slider.autoPaused = true;
|
886 |
-
}
|
887 |
-
}, function(){
|
888 |
-
// if the autoPaused value was created be the prior "mouseover" event
|
889 |
-
if(slider.autoPaused){
|
890 |
-
// start the auto show and pass true agument which will prevent control update
|
891 |
-
el.startAuto(true);
|
892 |
-
// reset the autoPaused value
|
893 |
-
slider.autoPaused = null;
|
894 |
-
}
|
895 |
-
});
|
896 |
-
}
|
897 |
-
}
|
898 |
-
|
899 |
-
/**
|
900 |
-
* Initialzes the ticker process
|
901 |
-
*/
|
902 |
-
var initTicker = function(){
|
903 |
-
var startPosition = 0;
|
904 |
-
// if autoDirection is "next", append a clone of the entire slider
|
905 |
-
if(slider.settings.autoDirection == 'next'){
|
906 |
-
el.append(slider.children.clone().addClass('bx-clone'));
|
907 |
-
// if autoDirection is "prev", prepend a clone of the entire slider, and set the left position
|
908 |
-
}else{
|
909 |
-
el.prepend(slider.children.clone().addClass('bx-clone'));
|
910 |
-
var position = slider.children.first().position();
|
911 |
-
startPosition = slider.settings.mode == 'horizontal' ? -position.left : -position.top;
|
912 |
-
}
|
913 |
-
setPositionProperty(startPosition, 'reset', 0);
|
914 |
-
// do not allow controls in ticker mode
|
915 |
-
slider.settings.pager = false;
|
916 |
-
slider.settings.controls = false;
|
917 |
-
slider.settings.autoControls = false;
|
918 |
-
// if autoHover is requested
|
919 |
-
if(slider.settings.tickerHover && !slider.usingCSS){
|
920 |
-
// on el hover
|
921 |
-
slider.viewport.hover(function(){
|
922 |
-
el.stop();
|
923 |
-
}, function(){
|
924 |
-
// calculate the total width of children (used to calculate the speed ratio)
|
925 |
-
var totalDimens = 0;
|
926 |
-
slider.children.each(function(index){
|
927 |
-
totalDimens += slider.settings.mode == 'horizontal' ? $(this).outerWidth(true) : $(this).outerHeight(true);
|
928 |
-
});
|
929 |
-
// calculate the speed ratio (used to determine the new speed to finish the paused animation)
|
930 |
-
var ratio = slider.settings.speed / totalDimens;
|
931 |
-
// determine which property to use
|
932 |
-
var property = slider.settings.mode == 'horizontal' ? 'left' : 'top';
|
933 |
-
// calculate the new speed
|
934 |
-
var newSpeed = ratio * (totalDimens - (Math.abs(parseInt(el.css(property)))));
|
935 |
-
tickerLoop(newSpeed);
|
936 |
-
});
|
937 |
-
}
|
938 |
-
// start the ticker loop
|
939 |
-
tickerLoop();
|
940 |
-
}
|
941 |
-
|
942 |
-
/**
|
943 |
-
* Runs a continuous loop, news ticker-style
|
944 |
-
*/
|
945 |
-
var tickerLoop = function(resumeSpeed){
|
946 |
-
speed = resumeSpeed ? resumeSpeed : slider.settings.speed;
|
947 |
-
var position = {left: 0, top: 0};
|
948 |
-
var reset = {left: 0, top: 0};
|
949 |
-
// if "next" animate left position to last child, then reset left to 0
|
950 |
-
if(slider.settings.autoDirection == 'next'){
|
951 |
-
position = el.find('.bx-clone').first().position();
|
952 |
-
// if "prev" animate left position to 0, then reset left to first non-clone child
|
953 |
-
}else{
|
954 |
-
reset = slider.children.first().position();
|
955 |
-
}
|
956 |
-
var animateProperty = slider.settings.mode == 'horizontal' ? -position.left : -position.top;
|
957 |
-
var resetValue = slider.settings.mode == 'horizontal' ? -reset.left : -reset.top;
|
958 |
-
var params = {resetValue: resetValue};
|
959 |
-
setPositionProperty(animateProperty, 'ticker', speed, params);
|
960 |
-
}
|
961 |
-
|
962 |
-
/**
|
963 |
-
* Initializes touch events
|
964 |
-
*/
|
965 |
-
var initTouch = function(){
|
966 |
-
// initialize object to contain all touch values
|
967 |
-
slider.touch = {
|
968 |
-
start: {x: 0, y: 0},
|
969 |
-
end: {x: 0, y: 0}
|
970 |
-
}
|
971 |
-
slider.viewport.bind('touchstart', onTouchStart);
|
972 |
-
}
|
973 |
-
|
974 |
-
/**
|
975 |
-
* Event handler for "touchstart"
|
976 |
-
*
|
977 |
-
* @param e (event)
|
978 |
-
* - DOM event object
|
979 |
-
*/
|
980 |
-
var onTouchStart = function(e){
|
981 |
-
if(slider.working){
|
982 |
-
e.preventDefault();
|
983 |
-
}else{
|
984 |
-
// record the original position when touch starts
|
985 |
-
slider.touch.originalPos = el.position();
|
986 |
-
var orig = e.originalEvent;
|
987 |
-
// record the starting touch x, y coordinates
|
988 |
-
slider.touch.start.x = orig.changedTouches[0].pageX;
|
989 |
-
slider.touch.start.y = orig.changedTouches[0].pageY;
|
990 |
-
// bind a "touchmove" event to the viewport
|
991 |
-
slider.viewport.bind('touchmove', onTouchMove);
|
992 |
-
// bind a "touchend" event to the viewport
|
993 |
-
slider.viewport.bind('touchend', onTouchEnd);
|
994 |
-
}
|
995 |
-
}
|
996 |
-
|
997 |
-
/**
|
998 |
-
* Event handler for "touchmove"
|
999 |
-
*
|
1000 |
-
* @param e (event)
|
1001 |
-
* - DOM event object
|
1002 |
-
*/
|
1003 |
-
var onTouchMove = function(e){
|
1004 |
-
var orig = e.originalEvent;
|
1005 |
-
// if scrolling on y axis, do not prevent default
|
1006 |
-
var xMovement = Math.abs(orig.changedTouches[0].pageX - slider.touch.start.x);
|
1007 |
-
var yMovement = Math.abs(orig.changedTouches[0].pageY - slider.touch.start.y);
|
1008 |
-
// x axis swipe
|
1009 |
-
if((xMovement * 3) > yMovement && slider.settings.preventDefaultSwipeX){
|
1010 |
-
e.preventDefault();
|
1011 |
-
// y axis swipe
|
1012 |
-
}else if((yMovement * 3) > xMovement && slider.settings.preventDefaultSwipeY){
|
1013 |
-
e.preventDefault();
|
1014 |
-
}
|
1015 |
-
if(slider.settings.mode != 'fade' && slider.settings.oneToOneTouch){
|
1016 |
-
var value = 0;
|
1017 |
-
// if horizontal, drag along x axis
|
1018 |
-
if(slider.settings.mode == 'horizontal'){
|
1019 |
-
var change = orig.changedTouches[0].pageX - slider.touch.start.x;
|
1020 |
-
value = slider.touch.originalPos.left + change;
|
1021 |
-
// if vertical, drag along y axis
|
1022 |
-
}else{
|
1023 |
-
var change = orig.changedTouches[0].pageY - slider.touch.start.y;
|
1024 |
-
value = slider.touch.originalPos.top + change;
|
1025 |
-
}
|
1026 |
-
setPositionProperty(value, 'reset', 0);
|
1027 |
-
}
|
1028 |
-
}
|
1029 |
-
|
1030 |
-
/**
|
1031 |
-
* Event handler for "touchend"
|
1032 |
-
*
|
1033 |
-
* @param e (event)
|
1034 |
-
* - DOM event object
|
1035 |
-
*/
|
1036 |
-
var onTouchEnd = function(e){
|
1037 |
-
slider.viewport.unbind('touchmove', onTouchMove);
|
1038 |
-
var orig = e.originalEvent;
|
1039 |
-
var value = 0;
|
1040 |
-
// record end x, y positions
|
1041 |
-
slider.touch.end.x = orig.changedTouches[0].pageX;
|
1042 |
-
slider.touch.end.y = orig.changedTouches[0].pageY;
|
1043 |
-
// if fade mode, check if absolute x distance clears the threshold
|
1044 |
-
if(slider.settings.mode == 'fade'){
|
1045 |
-
var distance = Math.abs(slider.touch.start.x - slider.touch.end.x);
|
1046 |
-
if(distance >= slider.settings.swipeThreshold){
|
1047 |
-
slider.touch.start.x > slider.touch.end.x ? el.goToNextSlide() : el.goToPrevSlide();
|
1048 |
-
el.stopAuto();
|
1049 |
-
}
|
1050 |
-
// not fade mode
|
1051 |
-
}else{
|
1052 |
-
var distance = 0;
|
1053 |
-
// calculate distance and el's animate property
|
1054 |
-
if(slider.settings.mode == 'horizontal'){
|
1055 |
-
distance = slider.touch.end.x - slider.touch.start.x;
|
1056 |
-
value = slider.touch.originalPos.left;
|
1057 |
-
}else{
|
1058 |
-
distance = slider.touch.end.y - slider.touch.start.y;
|
1059 |
-
value = slider.touch.originalPos.top;
|
1060 |
-
}
|
1061 |
-
// if not infinite loop and first / last slide, do not attempt a slide transition
|
1062 |
-
if(!slider.settings.infiniteLoop && ((slider.active.index == 0 && distance > 0) || (slider.active.last && distance < 0))){
|
1063 |
-
setPositionProperty(value, 'reset', 200);
|
1064 |
-
}else{
|
1065 |
-
// check if distance clears threshold
|
1066 |
-
if(Math.abs(distance) >= slider.settings.swipeThreshold){
|
1067 |
-
distance < 0 ? el.goToNextSlide() : el.goToPrevSlide();
|
1068 |
-
el.stopAuto();
|
1069 |
-
}else{
|
1070 |
-
// el.animate(property, 200);
|
1071 |
-
setPositionProperty(value, 'reset', 200);
|
1072 |
-
}
|
1073 |
-
}
|
1074 |
-
}
|
1075 |
-
slider.viewport.unbind('touchend', onTouchEnd);
|
1076 |
-
}
|
1077 |
-
|
1078 |
-
/**
|
1079 |
-
* Window resize event callback
|
1080 |
-
*/
|
1081 |
-
var resizeWindow = function(e){
|
1082 |
-
// don't do anything if slider isn't initialized.
|
1083 |
-
if(!slider.initialized) return;
|
1084 |
-
// get the new window dimens (again, thank you IE)
|
1085 |
-
var windowWidthNew = $(window).width();
|
1086 |
-
var windowHeightNew = $(window).height();
|
1087 |
-
// make sure that it is a true window resize
|
1088 |
-
// *we must check this because our dinosaur friend IE fires a window resize event when certain DOM elements
|
1089 |
-
// are resized. Can you just die already?*
|
1090 |
-
if(windowWidth != windowWidthNew || windowHeight != windowHeightNew){
|
1091 |
-
// set the new window dimens
|
1092 |
-
windowWidth = windowWidthNew;
|
1093 |
-
windowHeight = windowHeightNew;
|
1094 |
-
// update all dynamic elements
|
1095 |
-
el.redrawSlider();
|
1096 |
-
// Call user resize handler
|
1097 |
-
slider.settings.onSliderResize.call(el, slider.active.index);
|
1098 |
-
}
|
1099 |
-
}
|
1100 |
-
|
1101 |
-
/**
|
1102 |
-
* ===================================================================================
|
1103 |
-
* = PUBLIC FUNCTIONS
|
1104 |
-
* ===================================================================================
|
1105 |
-
*/
|
1106 |
-
|
1107 |
-
/**
|
1108 |
-
* Performs slide transition to the specified slide
|
1109 |
-
*
|
1110 |
-
* @param slideIndex (int)
|
1111 |
-
* - the destination slide's index (zero-based)
|
1112 |
-
*
|
1113 |
-
* @param direction (string)
|
1114 |
-
* - INTERNAL USE ONLY - the direction of travel ("prev" / "next")
|
1115 |
-
*/
|
1116 |
-
el.goToSlide = function(slideIndex, direction){
|
1117 |
-
// if plugin is currently in motion, ignore request
|
1118 |
-
if(slider.working || slider.active.index == slideIndex) return;
|
1119 |
-
// declare that plugin is in motion
|
1120 |
-
slider.working = true;
|
1121 |
-
// store the old index
|
1122 |
-
slider.oldIndex = slider.active.index;
|
1123 |
-
// if slideIndex is less than zero, set active index to last child (this happens during infinite loop)
|
1124 |
-
if(slideIndex < 0){
|
1125 |
-
slider.active.index = getPagerQty() - 1;
|
1126 |
-
// if slideIndex is greater than children length, set active index to 0 (this happens during infinite loop)
|
1127 |
-
}else if(slideIndex >= getPagerQty()){
|
1128 |
-
slider.active.index = 0;
|
1129 |
-
// set active index to requested slide
|
1130 |
-
}else{
|
1131 |
-
slider.active.index = slideIndex;
|
1132 |
-
}
|
1133 |
-
// onSlideBefore, onSlideNext, onSlidePrev callbacks
|
1134 |
-
slider.settings.onSlideBefore(slider.children.eq(slider.active.index), slider.oldIndex, slider.active.index);
|
1135 |
-
if(direction == 'next'){
|
1136 |
-
slider.settings.onSlideNext(slider.children.eq(slider.active.index), slider.oldIndex, slider.active.index);
|
1137 |
-
}else if(direction == 'prev'){
|
1138 |
-
slider.settings.onSlidePrev(slider.children.eq(slider.active.index), slider.oldIndex, slider.active.index);
|
1139 |
-
}
|
1140 |
-
// check if last slide
|
1141 |
-
slider.active.last = slider.active.index >= getPagerQty() - 1;
|
1142 |
-
// update the pager with active class
|
1143 |
-
if(slider.settings.pager) updatePagerActive(slider.active.index);
|
1144 |
-
// // check for direction control update
|
1145 |
-
if(slider.settings.controls) updateDirectionControls();
|
1146 |
-
// if slider is set to mode: "fade"
|
1147 |
-
if(slider.settings.mode == 'fade'){
|
1148 |
-
// if adaptiveHeight is true and next height is different from current height, animate to the new height
|
1149 |
-
if(slider.settings.adaptiveHeight && slider.viewport.height() != getViewportHeight()){
|
1150 |
-
slider.viewport.animate({height: getViewportHeight()}, slider.settings.adaptiveHeightSpeed);
|
1151 |
-
}
|
1152 |
-
// fade out the visible child and reset its z-index value
|
1153 |
-
slider.children.filter(':visible').fadeOut(slider.settings.speed).css({zIndex: 0});
|
1154 |
-
// fade in the newly requested slide
|
1155 |
-
slider.children.eq(slider.active.index).css('zIndex', slider.settings.slideZIndex+1).fadeIn(slider.settings.speed, function(){
|
1156 |
-
$(this).css('zIndex', slider.settings.slideZIndex);
|
1157 |
-
updateAfterSlideTransition();
|
1158 |
-
});
|
1159 |
-
// slider mode is not "fade"
|
1160 |
-
}else{
|
1161 |
-
// if adaptiveHeight is true and next height is different from current height, animate to the new height
|
1162 |
-
if(slider.settings.adaptiveHeight && slider.viewport.height() != getViewportHeight()){
|
1163 |
-
slider.viewport.animate({height: getViewportHeight()}, slider.settings.adaptiveHeightSpeed);
|
1164 |
-
}
|
1165 |
-
var moveBy = 0;
|
1166 |
-
var position = {left: 0, top: 0};
|
1167 |
-
// if carousel and not infinite loop
|
1168 |
-
if(!slider.settings.infiniteLoop && slider.carousel && slider.active.last){
|
1169 |
-
if(slider.settings.mode == 'horizontal'){
|
1170 |
-
// get the last child position
|
1171 |
-
var lastChild = slider.children.eq(slider.children.length - 1);
|
1172 |
-
position = lastChild.position();
|
1173 |
-
// calculate the position of the last slide
|
1174 |
-
moveBy = slider.viewport.width() - lastChild.outerWidth();
|
1175 |
-
}else{
|
1176 |
-
// get last showing index position
|
1177 |
-
var lastShowingIndex = slider.children.length - slider.settings.minSlides;
|
1178 |
-
position = slider.children.eq(lastShowingIndex).position();
|
1179 |
-
}
|
1180 |
-
// horizontal carousel, going previous while on first slide (infiniteLoop mode)
|
1181 |
-
}else if(slider.carousel && slider.active.last && direction == 'prev'){
|
1182 |
-
// get the last child position
|
1183 |
-
var eq = slider.settings.moveSlides == 1 ? slider.settings.maxSlides - getMoveBy() : ((getPagerQty() - 1) * getMoveBy()) - (slider.children.length - slider.settings.maxSlides);
|
1184 |
-
var lastChild = el.children('.bx-clone').eq(eq);
|
1185 |
-
position = lastChild.position();
|
1186 |
-
// if infinite loop and "Next" is clicked on the last slide
|
1187 |
-
}else if(direction == 'next' && slider.active.index == 0){
|
1188 |
-
// get the last clone position
|
1189 |
-
position = el.find('> .bx-clone').eq(slider.settings.maxSlides).position();
|
1190 |
-
slider.active.last = false;
|
1191 |
-
// normal non-zero requests
|
1192 |
-
}else if(slideIndex >= 0){
|
1193 |
-
var requestEl = slideIndex * getMoveBy();
|
1194 |
-
position = slider.children.eq(requestEl).position();
|
1195 |
-
}
|
1196 |
-
|
1197 |
-
/* If the position doesn't exist
|
1198 |
-
* (e.g. if you destroy the slider on a next click),
|
1199 |
-
* it doesn't throw an error.
|
1200 |
-
*/
|
1201 |
-
if ("undefined" !== typeof(position)) {
|
1202 |
-
var value = slider.settings.mode == 'horizontal' ? -(position.left - moveBy) : -position.top;
|
1203 |
-
// plugin values to be animated
|
1204 |
-
setPositionProperty(value, 'slide', slider.settings.speed);
|
1205 |
-
}
|
1206 |
-
}
|
1207 |
-
}
|
1208 |
-
|
1209 |
-
/**
|
1210 |
-
* Transitions to the next slide in the show
|
1211 |
-
*/
|
1212 |
-
el.goToNextSlide = function(){
|
1213 |
-
// if infiniteLoop is false and last page is showing, disregard call
|
1214 |
-
if (!slider.settings.infiniteLoop && slider.active.last) return;
|
1215 |
-
var pagerIndex = parseInt(slider.active.index) + 1;
|
1216 |
-
el.goToSlide(pagerIndex, 'next');
|
1217 |
-
}
|
1218 |
-
|
1219 |
-
/**
|
1220 |
-
* Transitions to the prev slide in the show
|
1221 |
-
*/
|
1222 |
-
el.goToPrevSlide = function(){
|
1223 |
-
// if infiniteLoop is false and last page is showing, disregard call
|
1224 |
-
if (!slider.settings.infiniteLoop && slider.active.index == 0) return;
|
1225 |
-
var pagerIndex = parseInt(slider.active.index) - 1;
|
1226 |
-
el.goToSlide(pagerIndex, 'prev');
|
1227 |
-
}
|
1228 |
-
|
1229 |
-
/**
|
1230 |
-
* Starts the auto show
|
1231 |
-
*
|
1232 |
-
* @param preventControlUpdate (boolean)
|
1233 |
-
* - if true, auto controls state will not be updated
|
1234 |
-
*/
|
1235 |
-
el.startAuto = function(preventControlUpdate){
|
1236 |
-
// if an interval already exists, disregard call
|
1237 |
-
if(slider.interval) return;
|
1238 |
-
// create an interval
|
1239 |
-
slider.interval = setInterval(function(){
|
1240 |
-
slider.settings.autoDirection == 'next' ? el.goToNextSlide() : el.goToPrevSlide();
|
1241 |
-
}, slider.settings.pause);
|
1242 |
-
// if auto controls are displayed and preventControlUpdate is not true
|
1243 |
-
if (slider.settings.autoControls && preventControlUpdate != true) updateAutoControls('stop');
|
1244 |
-
}
|
1245 |
-
|
1246 |
-
/**
|
1247 |
-
* Stops the auto show
|
1248 |
-
*
|
1249 |
-
* @param preventControlUpdate (boolean)
|
1250 |
-
* - if true, auto controls state will not be updated
|
1251 |
-
*/
|
1252 |
-
el.stopAuto = function(preventControlUpdate){
|
1253 |
-
// if no interval exists, disregard call
|
1254 |
-
if(!slider.interval) return;
|
1255 |
-
// clear the interval
|
1256 |
-
clearInterval(slider.interval);
|
1257 |
-
slider.interval = null;
|
1258 |
-
// if auto controls are displayed and preventControlUpdate is not true
|
1259 |
-
if (slider.settings.autoControls && preventControlUpdate != true) updateAutoControls('start');
|
1260 |
-
}
|
1261 |
-
|
1262 |
-
/**
|
1263 |
-
* Returns current slide index (zero-based)
|
1264 |
-
*/
|
1265 |
-
el.getCurrentSlide = function(){
|
1266 |
-
return slider.active.index;
|
1267 |
-
}
|
1268 |
-
|
1269 |
-
/**
|
1270 |
-
* Returns current slide element
|
1271 |
-
*/
|
1272 |
-
el.getCurrentSlideElement = function(){
|
1273 |
-
return slider.children.eq(slider.active.index);
|
1274 |
-
}
|
1275 |
-
|
1276 |
-
/**
|
1277 |
-
* Returns number of slides in show
|
1278 |
-
*/
|
1279 |
-
el.getSlideCount = function(){
|
1280 |
-
return slider.children.length;
|
1281 |
-
}
|
1282 |
-
|
1283 |
-
/**
|
1284 |
-
* Update all dynamic slider elements
|
1285 |
-
*/
|
1286 |
-
el.redrawSlider = function(){
|
1287 |
-
// resize all children in ratio to new screen size
|
1288 |
-
slider.children.add(el.find('.bx-clone')).width(getSlideWidth());
|
1289 |
-
// adjust the height
|
1290 |
-
slider.viewport.css('height', getViewportHeight());
|
1291 |
-
// update the slide position
|
1292 |
-
if(!slider.settings.ticker) setSlidePosition();
|
1293 |
-
// if active.last was true before the screen resize, we want
|
1294 |
-
// to keep it last no matter what screen size we end on
|
1295 |
-
if (slider.active.last) slider.active.index = getPagerQty() - 1;
|
1296 |
-
// if the active index (page) no longer exists due to the resize, simply set the index as last
|
1297 |
-
if (slider.active.index >= getPagerQty()) slider.active.last = true;
|
1298 |
-
// if a pager is being displayed and a custom pager is not being used, update it
|
1299 |
-
if(slider.settings.pager && !slider.settings.pagerCustom){
|
1300 |
-
populatePager();
|
1301 |
-
updatePagerActive(slider.active.index);
|
1302 |
-
}
|
1303 |
-
}
|
1304 |
-
|
1305 |
-
/**
|
1306 |
-
* Destroy the current instance of the slider (revert everything back to original state)
|
1307 |
-
*/
|
1308 |
-
el.destroySlider = function(){
|
1309 |
-
// don't do anything if slider has already been destroyed
|
1310 |
-
if(!slider.initialized) return;
|
1311 |
-
slider.initialized = false;
|
1312 |
-
$('.bx-clone', this).remove();
|
1313 |
-
slider.children.each(function() {
|
1314 |
-
$(this).data("origStyle") != undefined ? $(this).attr("style", $(this).data("origStyle")) : $(this).removeAttr('style');
|
1315 |
-
});
|
1316 |
-
$(this).data("origStyle") != undefined ? this.attr("style", $(this).data("origStyle")) : $(this).removeAttr('style');
|
1317 |
-
$(this).unwrap().unwrap();
|
1318 |
-
if(slider.controls.el) slider.controls.el.remove();
|
1319 |
-
if(slider.controls.next) slider.controls.next.remove();
|
1320 |
-
if(slider.controls.prev) slider.controls.prev.remove();
|
1321 |
-
if(slider.pagerEl && slider.settings.controls) slider.pagerEl.remove();
|
1322 |
-
$('.bx-caption', this).remove();
|
1323 |
-
if(slider.controls.autoEl) slider.controls.autoEl.remove();
|
1324 |
-
clearInterval(slider.interval);
|
1325 |
-
if(slider.settings.responsive) $(window).unbind('resize', resizeWindow);
|
1326 |
-
}
|
1327 |
-
|
1328 |
-
/**
|
1329 |
-
* Reload the slider (revert all DOM changes, and re-initialize)
|
1330 |
-
*/
|
1331 |
-
el.reloadSlider = function(settings){
|
1332 |
-
if (settings != undefined) options = settings;
|
1333 |
-
el.destroySlider();
|
1334 |
-
init();
|
1335 |
-
}
|
1336 |
-
|
1337 |
-
init();
|
1338 |
-
|
1339 |
-
// returns the current jQuery object
|
1340 |
-
return this;
|
1341 |
-
}
|
1342 |
-
|
1343 |
-
})(jQuery);
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/jquery.bxslider.min.js
DELETED
@@ -1,10 +0,0 @@
|
|
1 |
-
/**
|
2 |
-
* BxSlider v4.1.2 - Fully loaded, responsive content slider
|
3 |
-
* http://bxslider.com
|
4 |
-
*
|
5 |
-
* Copyright 2014, Steven Wanderski - http://stevenwanderski.com - http://bxcreative.com
|
6 |
-
* Written while drinking Belgian ales and listening to jazz
|
7 |
-
*
|
8 |
-
* Released under the MIT license - http://opensource.org/licenses/MIT
|
9 |
-
*/
|
10 |
-
!function(t){var e={},s={mode:"horizontal",slideSelector:"",infiniteLoop:!0,hideControlOnEnd:!1,speed:500,easing:null,slideMargin:0,startSlide:0,randomStart:!1,captions:!1,ticker:!1,tickerHover:!1,adaptiveHeight:!1,adaptiveHeightSpeed:500,video:!1,useCSS:!0,preloadImages:"visible",responsive:!0,slideZIndex:50,touchEnabled:!0,swipeThreshold:50,oneToOneTouch:!0,preventDefaultSwipeX:!0,preventDefaultSwipeY:!1,pager:!0,pagerType:"full",pagerShortSeparator:" / ",pagerSelector:null,buildPager:null,pagerCustom:null,controls:!0,nextText:"Next",prevText:"Prev",nextSelector:null,prevSelector:null,autoControls:!1,startText:"Start",stopText:"Stop",autoControlsCombine:!1,autoControlsSelector:null,auto:!1,pause:4e3,autoStart:!0,autoDirection:"next",autoHover:!1,autoDelay:0,minSlides:1,maxSlides:1,moveSlides:0,slideWidth:0,onSliderLoad:function(){},onSlideBefore:function(){},onSlideAfter:function(){},onSlideNext:function(){},onSlidePrev:function(){},onSliderResize:function(){}};t.fn.bxSlider=function(n){if(0==this.length)return this;if(this.length>1)return this.each(function(){t(this).bxSlider(n)}),this;var o={},r=this;e.el=this;var a=t(window).width(),l=t(window).height(),d=function(){o.settings=t.extend({},s,n),o.settings.slideWidth=parseInt(o.settings.slideWidth),o.children=r.children(o.settings.slideSelector),o.children.length<o.settings.minSlides&&(o.settings.minSlides=o.children.length),o.children.length<o.settings.maxSlides&&(o.settings.maxSlides=o.children.length),o.settings.randomStart&&(o.settings.startSlide=Math.floor(Math.random()*o.children.length)),o.active={index:o.settings.startSlide},o.carousel=o.settings.minSlides>1||o.settings.maxSlides>1,o.carousel&&(o.settings.preloadImages="all"),o.minThreshold=o.settings.minSlides*o.settings.slideWidth+(o.settings.minSlides-1)*o.settings.slideMargin,o.maxThreshold=o.settings.maxSlides*o.settings.slideWidth+(o.settings.maxSlides-1)*o.settings.slideMargin,o.working=!1,o.controls={},o.interval=null,o.animProp="vertical"==o.settings.mode?"top":"left",o.usingCSS=o.settings.useCSS&&"fade"!=o.settings.mode&&function(){var t=document.createElement("div"),e=["WebkitPerspective","MozPerspective","OPerspective","msPerspective"];for(var i in e)if(void 0!==t.style[e[i]])return o.cssPrefix=e[i].replace("Perspective","").toLowerCase(),o.animProp="-"+o.cssPrefix+"-transform",!0;return!1}(),"vertical"==o.settings.mode&&(o.settings.maxSlides=o.settings.minSlides),r.data("origStyle",r.attr("style")),r.children(o.settings.slideSelector).each(function(){t(this).data("origStyle",t(this).attr("style"))}),c()},c=function(){r.wrap('<div class="bx-wrapper"><div class="bx-viewport"></div></div>'),o.viewport=r.parent(),o.loader=t('<div class="bx-loading" />'),o.viewport.prepend(o.loader),r.css({width:"horizontal"==o.settings.mode?100*o.children.length+215+"%":"auto",position:"relative"}),o.usingCSS&&o.settings.easing?r.css("-"+o.cssPrefix+"-transition-timing-function",o.settings.easing):o.settings.easing||(o.settings.easing="swing"),f(),o.viewport.css({width:"100%",overflow:"hidden",position:"relative"}),o.viewport.parent().css({maxWidth:p()}),o.settings.pager||o.viewport.parent().css({margin:"0 auto 0px"}),o.children.css({"float":"horizontal"==o.settings.mode?"left":"none",listStyle:"none",position:"relative"}),o.children.css("width",u()),"horizontal"==o.settings.mode&&o.settings.slideMargin>0&&o.children.css("marginRight",o.settings.slideMargin),"vertical"==o.settings.mode&&o.settings.slideMargin>0&&o.children.css("marginBottom",o.settings.slideMargin),"fade"==o.settings.mode&&(o.children.css({position:"absolute",zIndex:0,display:"none"}),o.children.eq(o.settings.startSlide).css({zIndex:o.settings.slideZIndex,display:"block"})),o.controls.el=t('<div class="bx-controls" />'),o.settings.captions&&P(),o.active.last=o.settings.startSlide==x()-1,o.settings.video&&r.fitVids();var e=o.children.eq(o.settings.startSlide);"all"==o.settings.preloadImages&&(e=o.children),o.settings.ticker?o.settings.pager=!1:(o.settings.pager&&T(),o.settings.controls&&C(),o.settings.auto&&o.settings.autoControls&&E(),(o.settings.controls||o.settings.autoControls||o.settings.pager)&&o.viewport.after(o.controls.el)),g(e,h)},g=function(e,i){var s=e.find("img, iframe").length;if(0==s)return i(),void 0;var n=0;e.find("img, iframe").each(function(){t(this).one("load",function(){++n==s&&i()}).each(function(){this.complete&&t(this).load()})})},h=function(){if(o.settings.infiniteLoop&&"fade"!=o.settings.mode&&!o.settings.ticker){var e="vertical"==o.settings.mode?o.settings.minSlides:o.settings.maxSlides,i=o.children.slice(0,e).clone().addClass("bx-clone"),s=o.children.slice(-e).clone().addClass("bx-clone");r.append(i).prepend(s)}o.loader.remove(),S(),"vertical"==o.settings.mode&&(o.settings.adaptiveHeight=!0),o.viewport.height(v()),r.redrawSlider(),o.settings.onSliderLoad(o.active.index),o.initialized=!0,o.settings.responsive&&t(window).bind("resize",Z),o.settings.auto&&o.settings.autoStart&&H(),o.settings.ticker&&L(),o.settings.pager&&q(o.settings.startSlide),o.settings.controls&&W(),o.settings.touchEnabled&&!o.settings.ticker&&O()},v=function(){var e=0,s=t();if("vertical"==o.settings.mode||o.settings.adaptiveHeight)if(o.carousel){var n=1==o.settings.moveSlides?o.active.index:o.active.index*m();for(s=o.children.eq(n),i=1;i<=o.settings.maxSlides-1;i++)s=n+i>=o.children.length?s.add(o.children.eq(i-1)):s.add(o.children.eq(n+i))}else s=o.children.eq(o.active.index);else s=o.children;return"vertical"==o.settings.mode?(s.each(function(){e+=t(this).outerHeight()}),o.settings.slideMargin>0&&(e+=o.settings.slideMargin*(o.settings.minSlides-1))):e=Math.max.apply(Math,s.map(function(){return t(this).outerHeight(!1)}).get()),e},p=function(){var t="100%";return o.settings.slideWidth>0&&(t="horizontal"==o.settings.mode?o.settings.maxSlides*o.settings.slideWidth+(o.settings.maxSlides-1)*o.settings.slideMargin:o.settings.slideWidth),t},u=function(){var t=o.settings.slideWidth,e=o.viewport.width();return 0==o.settings.slideWidth||o.settings.slideWidth>e&&!o.carousel||"vertical"==o.settings.mode?t=e:o.settings.maxSlides>1&&"horizontal"==o.settings.mode&&(e>o.maxThreshold||e<o.minThreshold&&(t=(e-o.settings.slideMargin*(o.settings.minSlides-1))/o.settings.minSlides)),t},f=function(){var t=1;if("horizontal"==o.settings.mode&&o.settings.slideWidth>0)if(o.viewport.width()<o.minThreshold)t=o.settings.minSlides;else if(o.viewport.width()>o.maxThreshold)t=o.settings.maxSlides;else{var e=o.children.first().width();t=Math.floor(o.viewport.width()/e)}else"vertical"==o.settings.mode&&(t=o.settings.minSlides);return t},x=function(){var t=0;if(o.settings.moveSlides>0)if(o.settings.infiniteLoop)t=o.children.length/m();else for(var e=0,i=0;e<o.children.length;)++t,e=i+f(),i+=o.settings.moveSlides<=f()?o.settings.moveSlides:f();else t=Math.ceil(o.children.length/f());return t},m=function(){return o.settings.moveSlides>0&&o.settings.moveSlides<=f()?o.settings.moveSlides:f()},S=function(){if(o.children.length>o.settings.maxSlides&&o.active.last&&!o.settings.infiniteLoop){if("horizontal"==o.settings.mode){var t=o.children.last(),e=t.position();b(-(e.left-(o.viewport.width()-t.width())),"reset",0)}else if("vertical"==o.settings.mode){var i=o.children.length-o.settings.minSlides,e=o.children.eq(i).position();b(-e.top,"reset",0)}}else{var e=o.children.eq(o.active.index*m()).position();o.active.index==x()-1&&(o.active.last=!0),void 0!=e&&("horizontal"==o.settings.mode?b(-e.left,"reset",0):"vertical"==o.settings.mode&&b(-e.top,"reset",0))}},b=function(t,e,i,s){if(o.usingCSS){var n="vertical"==o.settings.mode?"translate3d(0, "+t+"px, 0)":"translate3d("+t+"px, 0, 0)";r.css("-"+o.cssPrefix+"-transition-duration",i/1e3+"s"),"slide"==e?(r.css(o.animProp,n),r.bind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd",function(){r.unbind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd"),D()})):"reset"==e?r.css(o.animProp,n):"ticker"==e&&(r.css("-"+o.cssPrefix+"-transition-timing-function","linear"),r.css(o.animProp,n),r.bind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd",function(){r.unbind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd"),b(s.resetValue,"reset",0),N()}))}else{var a={};a[o.animProp]=t,"slide"==e?r.animate(a,i,o.settings.easing,function(){D()}):"reset"==e?r.css(o.animProp,t):"ticker"==e&&r.animate(a,speed,"linear",function(){b(s.resetValue,"reset",0),N()})}},w=function(){for(var e="",i=x(),s=0;i>s;s++){var n="";o.settings.buildPager&&t.isFunction(o.settings.buildPager)?(n=o.settings.buildPager(s),o.pagerEl.addClass("bx-custom-pager")):(n=s+1,o.pagerEl.addClass("bx-default-pager")),e+='<div class="bx-pager-item"><a href="" data-slide-index="'+s+'" class="bx-pager-link">'+n+"</a></div>"}o.pagerEl.html(e)},T=function(){o.settings.pagerCustom?o.pagerEl=t(o.settings.pagerCustom):(o.pagerEl=t('<div class="bx-pager" />'),o.settings.pagerSelector?t(o.settings.pagerSelector).html(o.pagerEl):o.controls.el.addClass("bx-has-pager").append(o.pagerEl),w()),o.pagerEl.on("click","a",I)},C=function(){o.controls.next=t('<a class="bx-next" href="">'+o.settings.nextText+"</a>"),o.controls.prev=t('<a class="bx-prev" href="">'+o.settings.prevText+"</a>"),o.controls.next.bind("click",y),o.controls.prev.bind("click",z),o.settings.nextSelector&&t(o.settings.nextSelector).append(o.controls.next),o.settings.prevSelector&&t(o.settings.prevSelector).append(o.controls.prev),o.settings.nextSelector||o.settings.prevSelector||(o.controls.directionEl=t('<div class="bx-controls-direction" />'),o.controls.directionEl.append(o.controls.prev).append(o.controls.next),o.controls.el.addClass("bx-has-controls-direction").append(o.controls.directionEl))},E=function(){o.controls.start=t('<div class="bx-controls-auto-item"><a class="bx-start" href="">'+o.settings.startText+"</a></div>"),o.controls.stop=t('<div class="bx-controls-auto-item"><a class="bx-stop" href="">'+o.settings.stopText+"</a></div>"),o.controls.autoEl=t('<div class="bx-controls-auto" />'),o.controls.autoEl.on("click",".bx-start",k),o.controls.autoEl.on("click",".bx-stop",M),o.settings.autoControlsCombine?o.controls.autoEl.append(o.controls.start):o.controls.autoEl.append(o.controls.start).append(o.controls.stop),o.settings.autoControlsSelector?t(o.settings.autoControlsSelector).html(o.controls.autoEl):o.controls.el.addClass("bx-has-controls-auto").append(o.controls.autoEl),A(o.settings.autoStart?"stop":"start")},P=function(){o.children.each(function(){var e=t(this).find("img:first").attr("title");void 0!=e&&(""+e).length&&t(this).append('<div class="bx-caption"><span>'+e+"</span></div>")})},y=function(t){o.settings.auto&&r.stopAuto(),r.goToNextSlide(),t.preventDefault()},z=function(t){o.settings.auto&&r.stopAuto(),r.goToPrevSlide(),t.preventDefault()},k=function(t){r.startAuto(),t.preventDefault()},M=function(t){r.stopAuto(),t.preventDefault()},I=function(e){o.settings.auto&&r.stopAuto();var i=t(e.currentTarget),s=parseInt(i.attr("data-slide-index"));s!=o.active.index&&r.goToSlide(s),e.preventDefault()},q=function(e){var i=o.children.length;return"short"==o.settings.pagerType?(o.settings.maxSlides>1&&(i=Math.ceil(o.children.length/o.settings.maxSlides)),o.pagerEl.html(e+1+o.settings.pagerShortSeparator+i),void 0):(o.pagerEl.find("a").removeClass("active"),o.pagerEl.each(function(i,s){t(s).find("a").eq(e).addClass("active")}),void 0)},D=function(){if(o.settings.infiniteLoop){var t="";0==o.active.index?t=o.children.eq(0).position():o.active.index==x()-1&&o.carousel?t=o.children.eq((x()-1)*m()).position():o.active.index==o.children.length-1&&(t=o.children.eq(o.children.length-1).position()),t&&("horizontal"==o.settings.mode?b(-t.left,"reset",0):"vertical"==o.settings.mode&&b(-t.top,"reset",0))}o.working=!1,o.settings.onSlideAfter(o.children.eq(o.active.index),o.oldIndex,o.active.index)},A=function(t){o.settings.autoControlsCombine?o.controls.autoEl.html(o.controls[t]):(o.controls.autoEl.find("a").removeClass("active"),o.controls.autoEl.find("a:not(.bx-"+t+")").addClass("active"))},W=function(){1==x()?(o.controls.prev.addClass("disabled"),o.controls.next.addClass("disabled")):!o.settings.infiniteLoop&&o.settings.hideControlOnEnd&&(0==o.active.index?(o.controls.prev.addClass("disabled"),o.controls.next.removeClass("disabled")):o.active.index==x()-1?(o.controls.next.addClass("disabled"),o.controls.prev.removeClass("disabled")):(o.controls.prev.removeClass("disabled"),o.controls.next.removeClass("disabled")))},H=function(){o.settings.autoDelay>0?setTimeout(r.startAuto,o.settings.autoDelay):r.startAuto(),o.settings.autoHover&&r.hover(function(){o.interval&&(r.stopAuto(!0),o.autoPaused=!0)},function(){o.autoPaused&&(r.startAuto(!0),o.autoPaused=null)})},L=function(){var e=0;if("next"==o.settings.autoDirection)r.append(o.children.clone().addClass("bx-clone"));else{r.prepend(o.children.clone().addClass("bx-clone"));var i=o.children.first().position();e="horizontal"==o.settings.mode?-i.left:-i.top}b(e,"reset",0),o.settings.pager=!1,o.settings.controls=!1,o.settings.autoControls=!1,o.settings.tickerHover&&!o.usingCSS&&o.viewport.hover(function(){r.stop()},function(){var e=0;o.children.each(function(){e+="horizontal"==o.settings.mode?t(this).outerWidth(!0):t(this).outerHeight(!0)});var i=o.settings.speed/e,s="horizontal"==o.settings.mode?"left":"top",n=i*(e-Math.abs(parseInt(r.css(s))));N(n)}),N()},N=function(t){speed=t?t:o.settings.speed;var e={left:0,top:0},i={left:0,top:0};"next"==o.settings.autoDirection?e=r.find(".bx-clone").first().position():i=o.children.first().position();var s="horizontal"==o.settings.mode?-e.left:-e.top,n="horizontal"==o.settings.mode?-i.left:-i.top,a={resetValue:n};b(s,"ticker",speed,a)},O=function(){o.touch={start:{x:0,y:0},end:{x:0,y:0}},o.viewport.bind("touchstart",X)},X=function(t){if(o.working)t.preventDefault();else{o.touch.originalPos=r.position();var e=t.originalEvent;o.touch.start.x=e.changedTouches[0].pageX,o.touch.start.y=e.changedTouches[0].pageY,o.viewport.bind("touchmove",Y),o.viewport.bind("touchend",V)}},Y=function(t){var e=t.originalEvent,i=Math.abs(e.changedTouches[0].pageX-o.touch.start.x),s=Math.abs(e.changedTouches[0].pageY-o.touch.start.y);if(3*i>s&&o.settings.preventDefaultSwipeX?t.preventDefault():3*s>i&&o.settings.preventDefaultSwipeY&&t.preventDefault(),"fade"!=o.settings.mode&&o.settings.oneToOneTouch){var n=0;if("horizontal"==o.settings.mode){var r=e.changedTouches[0].pageX-o.touch.start.x;n=o.touch.originalPos.left+r}else{var r=e.changedTouches[0].pageY-o.touch.start.y;n=o.touch.originalPos.top+r}b(n,"reset",0)}},V=function(t){o.viewport.unbind("touchmove",Y);var e=t.originalEvent,i=0;if(o.touch.end.x=e.changedTouches[0].pageX,o.touch.end.y=e.changedTouches[0].pageY,"fade"==o.settings.mode){var s=Math.abs(o.touch.start.x-o.touch.end.x);s>=o.settings.swipeThreshold&&(o.touch.start.x>o.touch.end.x?r.goToNextSlide():r.goToPrevSlide(),r.stopAuto())}else{var s=0;"horizontal"==o.settings.mode?(s=o.touch.end.x-o.touch.start.x,i=o.touch.originalPos.left):(s=o.touch.end.y-o.touch.start.y,i=o.touch.originalPos.top),!o.settings.infiniteLoop&&(0==o.active.index&&s>0||o.active.last&&0>s)?b(i,"reset",200):Math.abs(s)>=o.settings.swipeThreshold?(0>s?r.goToNextSlide():r.goToPrevSlide(),r.stopAuto()):b(i,"reset",200)}o.viewport.unbind("touchend",V)},Z=function(){var e=t(window).width(),i=t(window).height();(a!=e||l!=i)&&(a=e,l=i,r.redrawSlider(),o.settings.onSliderResize.call(r,o.active.index))};return r.goToSlide=function(e,i){if(!o.working&&o.active.index!=e)if(o.working=!0,o.oldIndex=o.active.index,o.active.index=0>e?x()-1:e>=x()?0:e,o.settings.onSlideBefore(o.children.eq(o.active.index),o.oldIndex,o.active.index),"next"==i?o.settings.onSlideNext(o.children.eq(o.active.index),o.oldIndex,o.active.index):"prev"==i&&o.settings.onSlidePrev(o.children.eq(o.active.index),o.oldIndex,o.active.index),o.active.last=o.active.index>=x()-1,o.settings.pager&&q(o.active.index),o.settings.controls&&W(),"fade"==o.settings.mode)o.settings.adaptiveHeight&&o.viewport.height()!=v()&&o.viewport.animate({height:v()},o.settings.adaptiveHeightSpeed),o.children.filter(":visible").fadeOut(o.settings.speed).css({zIndex:0}),o.children.eq(o.active.index).css("zIndex",o.settings.slideZIndex+1).fadeIn(o.settings.speed,function(){t(this).css("zIndex",o.settings.slideZIndex),D()});else{o.settings.adaptiveHeight&&o.viewport.height()!=v()&&o.viewport.animate({height:v()},o.settings.adaptiveHeightSpeed);var s=0,n={left:0,top:0};if(!o.settings.infiniteLoop&&o.carousel&&o.active.last)if("horizontal"==o.settings.mode){var a=o.children.eq(o.children.length-1);n=a.position(),s=o.viewport.width()-a.outerWidth()}else{var l=o.children.length-o.settings.minSlides;n=o.children.eq(l).position()}else if(o.carousel&&o.active.last&&"prev"==i){var d=1==o.settings.moveSlides?o.settings.maxSlides-m():(x()-1)*m()-(o.children.length-o.settings.maxSlides),a=r.children(".bx-clone").eq(d);n=a.position()}else if("next"==i&&0==o.active.index)n=r.find("> .bx-clone").eq(o.settings.maxSlides).position(),o.active.last=!1;else if(e>=0){var c=e*m();n=o.children.eq(c).position()}if("undefined"!=typeof n){var g="horizontal"==o.settings.mode?-(n.left-s):-n.top;b(g,"slide",o.settings.speed)}}},r.goToNextSlide=function(){if(o.settings.infiniteLoop||!o.active.last){var t=parseInt(o.active.index)+1;r.goToSlide(t,"next")}},r.goToPrevSlide=function(){if(o.settings.infiniteLoop||0!=o.active.index){var t=parseInt(o.active.index)-1;r.goToSlide(t,"prev")}},r.startAuto=function(t){o.interval||(o.interval=setInterval(function(){"next"==o.settings.autoDirection?r.goToNextSlide():r.goToPrevSlide()},o.settings.pause),o.settings.autoControls&&1!=t&&A("stop"))},r.stopAuto=function(t){o.interval&&(clearInterval(o.interval),o.interval=null,o.settings.autoControls&&1!=t&&A("start"))},r.getCurrentSlide=function(){return o.active.index},r.getCurrentSlideElement=function(){return o.children.eq(o.active.index)},r.getSlideCount=function(){return o.children.length},r.redrawSlider=function(){o.children.add(r.find(".bx-clone")).outerWidth(u()),o.viewport.css("height",v()),o.settings.ticker||S(),o.active.last&&(o.active.index=x()-1),o.active.index>=x()&&(o.active.last=!0),o.settings.pager&&!o.settings.pagerCustom&&(w(),q(o.active.index))},r.destroySlider=function(){o.initialized&&(o.initialized=!1,t(".bx-clone",this).remove(),o.children.each(function(){void 0!=t(this).data("origStyle")?t(this).attr("style",t(this).data("origStyle")):t(this).removeAttr("style")}),void 0!=t(this).data("origStyle")?this.attr("style",t(this).data("origStyle")):t(this).removeAttr("style"),t(this).unwrap().unwrap(),o.controls.el&&o.controls.el.remove(),o.controls.next&&o.controls.next.remove(),o.controls.prev&&o.controls.prev.remove(),o.pagerEl&&o.settings.controls&&o.pagerEl.remove(),t(".bx-caption",this).remove(),o.controls.autoEl&&o.controls.autoEl.remove(),clearInterval(o.interval),o.settings.responsive&&t(window).unbind("resize",Z))},r.reloadSlider=function(t){void 0!=t&&(n=t),r.destroySlider(),d()},d(),this}}(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/jquery.easing.1.3.js
DELETED
@@ -1,205 +0,0 @@
|
|
1 |
-
/*
|
2 |
-
* jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
|
3 |
-
*
|
4 |
-
* Uses the built in easing capabilities added In jQuery 1.1
|
5 |
-
* to offer multiple easing options
|
6 |
-
*
|
7 |
-
* TERMS OF USE - jQuery Easing
|
8 |
-
*
|
9 |
-
* Open source under the BSD License.
|
10 |
-
*
|
11 |
-
* Copyright © 2008 George McGinley Smith
|
12 |
-
* All rights reserved.
|
13 |
-
*
|
14 |
-
* Redistribution and use in source and binary forms, with or without modification,
|
15 |
-
* are permitted provided that the following conditions are met:
|
16 |
-
*
|
17 |
-
* Redistributions of source code must retain the above copyright notice, this list of
|
18 |
-
* conditions and the following disclaimer.
|
19 |
-
* Redistributions in binary form must reproduce the above copyright notice, this list
|
20 |
-
* of conditions and the following disclaimer in the documentation and/or other materials
|
21 |
-
* provided with the distribution.
|
22 |
-
*
|
23 |
-
* Neither the name of the author nor the names of contributors may be used to endorse
|
24 |
-
* or promote products derived from this software without specific prior written permission.
|
25 |
-
*
|
26 |
-
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
27 |
-
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
28 |
-
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
29 |
-
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
30 |
-
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
31 |
-
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
32 |
-
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
33 |
-
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
34 |
-
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
35 |
-
*
|
36 |
-
*/
|
37 |
-
|
38 |
-
// t: current time, b: begInnIng value, c: change In value, d: duration
|
39 |
-
jQuery.easing['jswing'] = jQuery.easing['swing'];
|
40 |
-
|
41 |
-
jQuery.extend( jQuery.easing,
|
42 |
-
{
|
43 |
-
def: 'easeOutQuad',
|
44 |
-
swing: function (x, t, b, c, d) {
|
45 |
-
//alert(jQuery.easing.default);
|
46 |
-
return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
|
47 |
-
},
|
48 |
-
easeInQuad: function (x, t, b, c, d) {
|
49 |
-
return c*(t/=d)*t + b;
|
50 |
-
},
|
51 |
-
easeOutQuad: function (x, t, b, c, d) {
|
52 |
-
return -c *(t/=d)*(t-2) + b;
|
53 |
-
},
|
54 |
-
easeInOutQuad: function (x, t, b, c, d) {
|
55 |
-
if ((t/=d/2) < 1) return c/2*t*t + b;
|
56 |
-
return -c/2 * ((--t)*(t-2) - 1) + b;
|
57 |
-
},
|
58 |
-
easeInCubic: function (x, t, b, c, d) {
|
59 |
-
return c*(t/=d)*t*t + b;
|
60 |
-
},
|
61 |
-
easeOutCubic: function (x, t, b, c, d) {
|
62 |
-
return c*((t=t/d-1)*t*t + 1) + b;
|
63 |
-
},
|
64 |
-
easeInOutCubic: function (x, t, b, c, d) {
|
65 |
-
if ((t/=d/2) < 1) return c/2*t*t*t + b;
|
66 |
-
return c/2*((t-=2)*t*t + 2) + b;
|
67 |
-
},
|
68 |
-
easeInQuart: function (x, t, b, c, d) {
|
69 |
-
return c*(t/=d)*t*t*t + b;
|
70 |
-
},
|
71 |
-
easeOutQuart: function (x, t, b, c, d) {
|
72 |
-
return -c * ((t=t/d-1)*t*t*t - 1) + b;
|
73 |
-
},
|
74 |
-
easeInOutQuart: function (x, t, b, c, d) {
|
75 |
-
if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
|
76 |
-
return -c/2 * ((t-=2)*t*t*t - 2) + b;
|
77 |
-
},
|
78 |
-
easeInQuint: function (x, t, b, c, d) {
|
79 |
-
return c*(t/=d)*t*t*t*t + b;
|
80 |
-
},
|
81 |
-
easeOutQuint: function (x, t, b, c, d) {
|
82 |
-
return c*((t=t/d-1)*t*t*t*t + 1) + b;
|
83 |
-
},
|
84 |
-
easeInOutQuint: function (x, t, b, c, d) {
|
85 |
-
if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
|
86 |
-
return c/2*((t-=2)*t*t*t*t + 2) + b;
|
87 |
-
},
|
88 |
-
easeInSine: function (x, t, b, c, d) {
|
89 |
-
return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
|
90 |
-
},
|
91 |
-
easeOutSine: function (x, t, b, c, d) {
|
92 |
-
return c * Math.sin(t/d * (Math.PI/2)) + b;
|
93 |
-
},
|
94 |
-
easeInOutSine: function (x, t, b, c, d) {
|
95 |
-
return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
|
96 |
-
},
|
97 |
-
easeInExpo: function (x, t, b, c, d) {
|
98 |
-
return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
|
99 |
-
},
|
100 |
-
easeOutExpo: function (x, t, b, c, d) {
|
101 |
-
return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
|
102 |
-
},
|
103 |
-
easeInOutExpo: function (x, t, b, c, d) {
|
104 |
-
if (t==0) return b;
|
105 |
-
if (t==d) return b+c;
|
106 |
-
if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
|
107 |
-
return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
|
108 |
-
},
|
109 |
-
easeInCirc: function (x, t, b, c, d) {
|
110 |
-
return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
|
111 |
-
},
|
112 |
-
easeOutCirc: function (x, t, b, c, d) {
|
113 |
-
return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
|
114 |
-
},
|
115 |
-
easeInOutCirc: function (x, t, b, c, d) {
|
116 |
-
if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
|
117 |
-
return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
|
118 |
-
},
|
119 |
-
easeInElastic: function (x, t, b, c, d) {
|
120 |
-
var s=1.70158;var p=0;var a=c;
|
121 |
-
if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
|
122 |
-
if (a < Math.abs(c)) { a=c; var s=p/4; }
|
123 |
-
else var s = p/(2*Math.PI) * Math.asin (c/a);
|
124 |
-
return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
|
125 |
-
},
|
126 |
-
easeOutElastic: function (x, t, b, c, d) {
|
127 |
-
var s=1.70158;var p=0;var a=c;
|
128 |
-
if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
|
129 |
-
if (a < Math.abs(c)) { a=c; var s=p/4; }
|
130 |
-
else var s = p/(2*Math.PI) * Math.asin (c/a);
|
131 |
-
return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
|
132 |
-
},
|
133 |
-
easeInOutElastic: function (x, t, b, c, d) {
|
134 |
-
var s=1.70158;var p=0;var a=c;
|
135 |
-
if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5);
|
136 |
-
if (a < Math.abs(c)) { a=c; var s=p/4; }
|
137 |
-
else var s = p/(2*Math.PI) * Math.asin (c/a);
|
138 |
-
if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
|
139 |
-
return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
|
140 |
-
},
|
141 |
-
easeInBack: function (x, t, b, c, d, s) {
|
142 |
-
if (s == undefined) s = 1.70158;
|
143 |
-
return c*(t/=d)*t*((s+1)*t - s) + b;
|
144 |
-
},
|
145 |
-
easeOutBack: function (x, t, b, c, d, s) {
|
146 |
-
if (s == undefined) s = 1.70158;
|
147 |
-
return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
|
148 |
-
},
|
149 |
-
easeInOutBack: function (x, t, b, c, d, s) {
|
150 |
-
if (s == undefined) s = 1.70158;
|
151 |
-
if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
|
152 |
-
return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
|
153 |
-
},
|
154 |
-
easeInBounce: function (x, t, b, c, d) {
|
155 |
-
return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
|
156 |
-
},
|
157 |
-
easeOutBounce: function (x, t, b, c, d) {
|
158 |
-
if ((t/=d) < (1/2.75)) {
|
159 |
-
return c*(7.5625*t*t) + b;
|
160 |
-
} else if (t < (2/2.75)) {
|
161 |
-
return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
|
162 |
-
} else if (t < (2.5/2.75)) {
|
163 |
-
return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
|
164 |
-
} else {
|
165 |
-
return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
|
166 |
-
}
|
167 |
-
},
|
168 |
-
easeInOutBounce: function (x, t, b, c, d) {
|
169 |
-
if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
|
170 |
-
return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
|
171 |
-
}
|
172 |
-
});
|
173 |
-
|
174 |
-
/*
|
175 |
-
*
|
176 |
-
* TERMS OF USE - EASING EQUATIONS
|
177 |
-
*
|
178 |
-
* Open source under the BSD License.
|
179 |
-
*
|
180 |
-
* Copyright © 2001 Robert Penner
|
181 |
-
* All rights reserved.
|
182 |
-
*
|
183 |
-
* Redistribution and use in source and binary forms, with or without modification,
|
184 |
-
* are permitted provided that the following conditions are met:
|
185 |
-
*
|
186 |
-
* Redistributions of source code must retain the above copyright notice, this list of
|
187 |
-
* conditions and the following disclaimer.
|
188 |
-
* Redistributions in binary form must reproduce the above copyright notice, this list
|
189 |
-
* of conditions and the following disclaimer in the documentation and/or other materials
|
190 |
-
* provided with the distribution.
|
191 |
-
*
|
192 |
-
* Neither the name of the author nor the names of contributors may be used to endorse
|
193 |
-
* or promote products derived from this software without specific prior written permission.
|
194 |
-
*
|
195 |
-
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
196 |
-
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
197 |
-
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
198 |
-
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
199 |
-
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
200 |
-
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
201 |
-
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
202 |
-
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
203 |
-
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
204 |
-
*
|
205 |
-
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/jquery.fitvids.js
DELETED
@@ -1,80 +0,0 @@
|
|
1 |
-
/*global jQuery */
|
2 |
-
/*jshint multistr:true browser:true */
|
3 |
-
/*!
|
4 |
-
* FitVids 1.0
|
5 |
-
*
|
6 |
-
* Copyright 2011, Chris Coyier - http://css-tricks.com + Dave Rupert - http://daverupert.com
|
7 |
-
* Credit to Thierry Koblentz - http://www.alistapart.com/articles/creating-intrinsic-ratios-for-video/
|
8 |
-
* Released under the WTFPL license - http://sam.zoy.org/wtfpl/
|
9 |
-
*
|
10 |
-
* Date: Thu Sept 01 18:00:00 2011 -0500
|
11 |
-
*/
|
12 |
-
|
13 |
-
(function( $ ){
|
14 |
-
|
15 |
-
"use strict";
|
16 |
-
|
17 |
-
$.fn.fitVids = function( options ) {
|
18 |
-
var settings = {
|
19 |
-
customSelector: null
|
20 |
-
};
|
21 |
-
|
22 |
-
var div = document.createElement('div'),
|
23 |
-
ref = document.getElementsByTagName('base')[0] || document.getElementsByTagName('script')[0];
|
24 |
-
|
25 |
-
div.className = 'fit-vids-style';
|
26 |
-
div.innerHTML = '­<style> \
|
27 |
-
.fluid-width-video-wrapper { \
|
28 |
-
width: 100%; \
|
29 |
-
position: relative; \
|
30 |
-
padding: 0; \
|
31 |
-
} \
|
32 |
-
\
|
33 |
-
.fluid-width-video-wrapper iframe, \
|
34 |
-
.fluid-width-video-wrapper object, \
|
35 |
-
.fluid-width-video-wrapper embed { \
|
36 |
-
position: absolute; \
|
37 |
-
top: 0; \
|
38 |
-
left: 0; \
|
39 |
-
width: 100%; \
|
40 |
-
height: 100%; \
|
41 |
-
} \
|
42 |
-
</style>';
|
43 |
-
|
44 |
-
ref.parentNode.insertBefore(div,ref);
|
45 |
-
|
46 |
-
if ( options ) {
|
47 |
-
$.extend( settings, options );
|
48 |
-
}
|
49 |
-
|
50 |
-
return this.each(function(){
|
51 |
-
var selectors = [
|
52 |
-
"iframe[src*='player.vimeo.com']",
|
53 |
-
"iframe[src*='www.youtube.com']",
|
54 |
-
"iframe[src*='www.kickstarter.com']",
|
55 |
-
"object",
|
56 |
-
"embed"
|
57 |
-
];
|
58 |
-
|
59 |
-
if (settings.customSelector) {
|
60 |
-
selectors.push(settings.customSelector);
|
61 |
-
}
|
62 |
-
|
63 |
-
var $allVideos = $(this).find(selectors.join(','));
|
64 |
-
|
65 |
-
$allVideos.each(function(){
|
66 |
-
var $this = $(this);
|
67 |
-
if (this.tagName.toLowerCase() === 'embed' && $this.parent('object').length || $this.parent('.fluid-width-video-wrapper').length) { return; }
|
68 |
-
var height = ( this.tagName.toLowerCase() === 'object' || ($this.attr('height') && !isNaN(parseInt($this.attr('height'), 10))) ) ? parseInt($this.attr('height'), 10) : $this.height(),
|
69 |
-
width = !isNaN(parseInt($this.attr('width'), 10)) ? parseInt($this.attr('width'), 10) : $this.width(),
|
70 |
-
aspectRatio = height / width;
|
71 |
-
if(!$this.attr('id')){
|
72 |
-
var videoID = 'fitvid' + Math.floor(Math.random()*999999);
|
73 |
-
$this.attr('id', videoID);
|
74 |
-
}
|
75 |
-
$this.wrap('<div class="fluid-width-video-wrapper"></div>').parent('.fluid-width-video-wrapper').css('padding-top', (aspectRatio * 100)+"%");
|
76 |
-
$this.removeAttr('height').removeAttr('width');
|
77 |
-
});
|
78 |
-
});
|
79 |
-
};
|
80 |
-
})( jQuery );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/tw-admin-scripts.js
DELETED
@@ -1,14 +0,0 @@
|
|
1 |
-
(function ($) {
|
2 |
-
jQuery( document ).on('click', '.twp-schema-notice .notice-dismiss', function (e) {
|
3 |
-
jQuery.ajax({
|
4 |
-
type: 'POST',
|
5 |
-
url: ajaxurl,
|
6 |
-
data: {
|
7 |
-
action: 'tw_schema_notice',
|
8 |
-
nonce: tw_schema_notice.nonce
|
9 |
-
}
|
10 |
-
});
|
11 |
-
e.stopPropagation();
|
12 |
-
return false;
|
13 |
-
});
|
14 |
-
})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/class-testimonials-widget-archives-widget.php
DELETED
@@ -1,82 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
Testimonials Widget
|
4 |
-
Copyright (C) 2015 Axelerant
|
5 |
-
|
6 |
-
This program is free software; you can redistribute it and/or modify
|
7 |
-
it under the terms of the GNU General Public License as published by
|
8 |
-
the Free Software Foundation; either version 2 of the License, or
|
9 |
-
(at your option) any later version.
|
10 |
-
|
11 |
-
This program is distributed in the hope that it will be useful,
|
12 |
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 |
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14 |
-
GNU General Public License for more details.
|
15 |
-
|
16 |
-
You should have received a copy of the GNU General Public License along
|
17 |
-
with this program; if not, write to the Free Software Foundation, Inc.,
|
18 |
-
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
19 |
-
*/
|
20 |
-
|
21 |
-
require_once AIHR_DIR_INC . 'class-aihrus-widget.php';
|
22 |
-
|
23 |
-
if ( class_exists( 'Axl_Testimonials_Widget_Archives_Widget' ) ) {
|
24 |
-
return;
|
25 |
-
}
|
26 |
-
|
27 |
-
|
28 |
-
class Axl_Testimonials_Widget_Archives_Widget extends Aihrus_Widget {
|
29 |
-
const ID = 'tw_archives_widget';
|
30 |
-
|
31 |
-
public static $title;
|
32 |
-
|
33 |
-
|
34 |
-
public function __construct() {
|
35 |
-
$classname = __CLASS__;
|
36 |
-
$description = esc_html__( 'A monthly archive of your site\'s testimonials.', 'testimonials-widget' );
|
37 |
-
$id_base = self::ID;
|
38 |
-
self::$title = esc_html__( 'Testimonials Archives', 'testimonials-widget' );
|
39 |
-
|
40 |
-
parent::__construct( $classname, $description, $id_base, self::$title );
|
41 |
-
}
|
42 |
-
|
43 |
-
|
44 |
-
/**
|
45 |
-
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
46 |
-
*/
|
47 |
-
public static function get_content( $instance = null, $widget_number = null ) {
|
48 |
-
return Axl_Testimonials_Widget::testimonials_archives( $instance, $widget_number );
|
49 |
-
}
|
50 |
-
|
51 |
-
|
52 |
-
public static function form_parts( $instance = null, $number = null ) {
|
53 |
-
$form_parts = parent::form_parts( $instance, $number );
|
54 |
-
|
55 |
-
$form_parts['title']['std'] = self::$title;
|
56 |
-
|
57 |
-
$form_parts['dropdown'] = array(
|
58 |
-
'title' => esc_html__( 'Display as dropdown', 'testimonials-widget' ),
|
59 |
-
'type' => 'checkbox',
|
60 |
-
'validate' => 'is_true',
|
61 |
-
'std' => 0,
|
62 |
-
);
|
63 |
-
|
64 |
-
$form_parts['count'] = array(
|
65 |
-
'title' => esc_html__( 'Show post counts', 'testimonials-widget' ),
|
66 |
-
'type' => 'checkbox',
|
67 |
-
'validate' => 'is_true',
|
68 |
-
'std' => 0,
|
69 |
-
);
|
70 |
-
|
71 |
-
foreach ( $form_parts as $id => $parts ) {
|
72 |
-
$form_parts[ $id ] = wp_parse_args( $parts, self::$default );
|
73 |
-
}
|
74 |
-
|
75 |
-
$form_parts = apply_filters( 'tw_archives_widget_options', $form_parts );
|
76 |
-
|
77 |
-
return $form_parts;
|
78 |
-
}
|
79 |
-
}
|
80 |
-
|
81 |
-
|
82 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/class-testimonials-widget-categories-widget.php
DELETED
@@ -1,92 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
Testimonials Widget
|
4 |
-
Copyright (C) 2015 Axelerant
|
5 |
-
|
6 |
-
This program is free software; you can redistribute it and/or modify
|
7 |
-
it under the terms of the GNU General Public License as published by
|
8 |
-
the Free Software Foundation; either version 2 of the License, or
|
9 |
-
(at your option) any later version.
|
10 |
-
|
11 |
-
This program is distributed in the hope that it will be useful,
|
12 |
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 |
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14 |
-
GNU General Public License for more details.
|
15 |
-
|
16 |
-
You should have received a copy of the GNU General Public License along
|
17 |
-
with this program; if not, write to the Free Software Foundation, Inc.,
|
18 |
-
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
19 |
-
*/
|
20 |
-
|
21 |
-
require_once AIHR_DIR_INC . 'class-aihrus-widget.php';
|
22 |
-
|
23 |
-
if ( class_exists( 'Axl_Testimonials_Widget_Categories_Widget' ) ) {
|
24 |
-
return;
|
25 |
-
}
|
26 |
-
|
27 |
-
|
28 |
-
class Axl_Testimonials_Widget_Categories_Widget extends Aihrus_Widget {
|
29 |
-
const ID = 'tw_categories_widget';
|
30 |
-
|
31 |
-
public static $title;
|
32 |
-
|
33 |
-
|
34 |
-
public function __construct() {
|
35 |
-
$classname = __CLASS__;
|
36 |
-
$description = esc_html__( 'A list or dropdown of testimonials\' categories.', 'testimonials-widget' );
|
37 |
-
$id_base = self::ID;
|
38 |
-
self::$title = esc_html__( 'Testimonials Categories', 'testimonials-widget' );
|
39 |
-
|
40 |
-
parent::__construct( $classname, $description, $id_base, self::$title );
|
41 |
-
}
|
42 |
-
|
43 |
-
|
44 |
-
/**
|
45 |
-
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
46 |
-
*/
|
47 |
-
public static function get_content( $instance = null, $widget_number = null ) {
|
48 |
-
return Axl_Testimonials_Widget::testimonials_categories( $instance, $widget_number );
|
49 |
-
}
|
50 |
-
|
51 |
-
|
52 |
-
/**
|
53 |
-
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
54 |
-
*/
|
55 |
-
public static function form_parts( $instance = null, $number = null ) {
|
56 |
-
$form_parts = parent::form_parts( $instance, $number );
|
57 |
-
|
58 |
-
$form_parts['title']['std'] = self::$title;
|
59 |
-
|
60 |
-
$form_parts['dropdown'] = array(
|
61 |
-
'title' => esc_html__( 'Display as dropdown', 'testimonials-widget' ),
|
62 |
-
'type' => 'checkbox',
|
63 |
-
'validate' => 'is_true',
|
64 |
-
'std' => 0,
|
65 |
-
);
|
66 |
-
|
67 |
-
$form_parts['count'] = array(
|
68 |
-
'title' => esc_html__( 'Show post counts', 'testimonials-widget' ),
|
69 |
-
'type' => 'checkbox',
|
70 |
-
'validate' => 'is_true',
|
71 |
-
'std' => 0,
|
72 |
-
);
|
73 |
-
|
74 |
-
$form_parts['hierarchical'] = array(
|
75 |
-
'title' => esc_html__( 'Show hierarchy', 'testimonials-widget' ),
|
76 |
-
'type' => 'checkbox',
|
77 |
-
'validate' => 'is_true',
|
78 |
-
'std' => 0,
|
79 |
-
);
|
80 |
-
|
81 |
-
foreach ( $form_parts as $id => $parts ) {
|
82 |
-
$form_parts[ $id ] = wp_parse_args( $parts, self::$default );
|
83 |
-
}
|
84 |
-
|
85 |
-
$form_parts = apply_filters( 'tw_categories_widget_options', $form_parts );
|
86 |
-
|
87 |
-
return $form_parts;
|
88 |
-
}
|
89 |
-
}
|
90 |
-
|
91 |
-
|
92 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/class-testimonials-widget-recent-testimonials-widget.php
DELETED
@@ -1,85 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
Testimonials Widget
|
4 |
-
Copyright (C) 2015 Axelerant
|
5 |
-
|
6 |
-
This program is free software; you can redistribute it and/or modify
|
7 |
-
it under the terms of the GNU General Public License as published by
|
8 |
-
the Free Software Foundation; either version 2 of the License, or
|
9 |
-
(at your option) any later version.
|
10 |
-
|
11 |
-
This program is distributed in the hope that it will be useful,
|
12 |
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 |
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14 |
-
GNU General Public License for more details.
|
15 |
-
|
16 |
-
You should have received a copy of the GNU General Public License along
|
17 |
-
with this program; if not, write to the Free Software Foundation, Inc.,
|
18 |
-
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
19 |
-
*/
|
20 |
-
|
21 |
-
require_once AIHR_DIR_INC . 'class-aihrus-widget.php';
|
22 |
-
|
23 |
-
if ( class_exists( 'Axl_Testimonials_Widget_Recent_Testimonials_Widget' ) ) {
|
24 |
-
return;
|
25 |
-
}
|
26 |
-
|
27 |
-
|
28 |
-
class Axl_Testimonials_Widget_Recent_Testimonials_Widget extends Aihrus_Widget {
|
29 |
-
const ID = 'tw_recent_testimonials_widget';
|
30 |
-
|
31 |
-
public static $title;
|
32 |
-
|
33 |
-
|
34 |
-
public function __construct() {
|
35 |
-
$classname = __CLASS__;
|
36 |
-
$description = esc_html__( 'Your site\'s most recent testimonials.', 'testimonials-widget' );
|
37 |
-
$id_base = self::ID;
|
38 |
-
self::$title = esc_html__( 'Recent Testimonials', 'testimonials-widget' );
|
39 |
-
|
40 |
-
parent::__construct( $classname, $description, $id_base, self::$title );
|
41 |
-
}
|
42 |
-
|
43 |
-
|
44 |
-
/**
|
45 |
-
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
46 |
-
*/
|
47 |
-
public static function get_content( $instance = null, $widget_number = null ) {
|
48 |
-
return Axl_Testimonials_Widget::testimonials_recent( $instance, $widget_number );
|
49 |
-
}
|
50 |
-
|
51 |
-
|
52 |
-
/**
|
53 |
-
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
54 |
-
*/
|
55 |
-
public static function form_parts( $instance = null, $number = null ) {
|
56 |
-
$form_parts = parent::form_parts( $instance, $number );
|
57 |
-
|
58 |
-
$form_parts['title']['std'] = self::$title;
|
59 |
-
|
60 |
-
$form_parts['number'] = array(
|
61 |
-
'title' => esc_html__( 'Number of testimonials to show', 'testimonials-widget' ),
|
62 |
-
'type' => 'text',
|
63 |
-
'validate' => 'intval',
|
64 |
-
'std' => 5,
|
65 |
-
);
|
66 |
-
|
67 |
-
$form_parts['show_date'] = array(
|
68 |
-
'title' => esc_html__( 'Display testimonial date?', 'testimonials-widget' ),
|
69 |
-
'type' => 'checkbox',
|
70 |
-
'validate' => 'is_true',
|
71 |
-
'std' => 0,
|
72 |
-
);
|
73 |
-
|
74 |
-
foreach ( $form_parts as $id => $parts ) {
|
75 |
-
$form_parts[ $id ] = wp_parse_args( $parts, self::$default );
|
76 |
-
}
|
77 |
-
|
78 |
-
$form_parts = apply_filters( 'tw_recent_testimonials_widget_options', $form_parts );
|
79 |
-
|
80 |
-
return $form_parts;
|
81 |
-
}
|
82 |
-
}
|
83 |
-
|
84 |
-
|
85 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/class-testimonials-widget-settings.php
DELETED
@@ -1,1101 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
Testimonials Widget
|
4 |
-
Copyright (C) 2015 Axelerant
|
5 |
-
|
6 |
-
This program is free software; you can redistribute it and/or modify
|
7 |
-
it under the terms of the GNU General Public License as published by
|
8 |
-
the Free Software Foundation; either version 2 of the License, or
|
9 |
-
(at your option) any later version.
|
10 |
-
|
11 |
-
This program is distributed in the hope that it will be useful,
|
12 |
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 |
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14 |
-
GNU General Public License for more details.
|
15 |
-
|
16 |
-
You should have received a copy of the GNU General Public License along
|
17 |
-
with this program; if not, write to the Free Software Foundation, Inc.,
|
18 |
-
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
19 |
-
*/
|
20 |
-
|
21 |
-
/**
|
22 |
-
* Testimonials settings class
|
23 |
-
*
|
24 |
-
* Based upon http://alisothegeek.com/2011/01/wordpress-settings-api-tutorial-1/
|
25 |
-
*/
|
26 |
-
|
27 |
-
require_once AIHR_DIR_INC . 'class-aihrus-settings.php';
|
28 |
-
|
29 |
-
if ( class_exists( 'Axl_Testimonials_Widget_Settings' ) ) {
|
30 |
-
return;
|
31 |
-
}
|
32 |
-
|
33 |
-
|
34 |
-
class Axl_Testimonials_Widget_Settings extends Aihrus_Settings {
|
35 |
-
const ID = 'testimonialswidget_settings';
|
36 |
-
const NAME = 'Testimonials Widget Settings';
|
37 |
-
|
38 |
-
public static $admin_page;
|
39 |
-
public static $class = __CLASS__;
|
40 |
-
public static $defaults = array();
|
41 |
-
public static $plugin_assets;
|
42 |
-
public static $plugin_url = 'http://wordpress.org/plugins/testimonials-widget/';
|
43 |
-
public static $sections = array();
|
44 |
-
public static $settings = array();
|
45 |
-
public static $version;
|
46 |
-
|
47 |
-
public static $default = array(
|
48 |
-
'backwards' => array(
|
49 |
-
'version' => null, // below this version number, use std
|
50 |
-
'std' => null,
|
51 |
-
),
|
52 |
-
'choices' => array(), // key => value
|
53 |
-
'class' => null, // warning, etc.
|
54 |
-
'desc' => null,
|
55 |
-
'id' => null,
|
56 |
-
'maxlength' => null,
|
57 |
-
'placeholder' => null,
|
58 |
-
'section' => 'general',
|
59 |
-
'show_code' => true,
|
60 |
-
'std' => null, // default key or value
|
61 |
-
'suggest' => false, // attempt for auto-suggest on inputs
|
62 |
-
'title' => null,
|
63 |
-
'type' => 'text', // textarea, checkbox, radio, select, hidden, heading, password, expand_begin, expand_end
|
64 |
-
'validate' => null, // required, term, slug, slugs, ids, order, single paramater PHP functions
|
65 |
-
'widget' => 1, // show in widget options, 0 off
|
66 |
-
);
|
67 |
-
|
68 |
-
public function __construct() {
|
69 |
-
add_action( 'admin_init', array( __CLASS__, 'admin_init' ) );
|
70 |
-
add_action( 'admin_menu', array( __CLASS__, 'admin_menu' ) );
|
71 |
-
add_action( 'init', array( __CLASS__, 'init' ) );
|
72 |
-
}
|
73 |
-
|
74 |
-
|
75 |
-
public static function admin_init() {
|
76 |
-
add_filter( 'wp_unique_post_slug_is_bad_hierarchical_slug', array( __CLASS__, 'is_bad_hierarchical_slug' ), 10, 4 );
|
77 |
-
add_filter( 'wp_unique_post_slug_is_bad_flat_slug', array( __CLASS__, 'is_bad_flat_slug' ), 10, 3 );
|
78 |
-
|
79 |
-
$version = tw_get_option( 'version' );
|
80 |
-
self::$version = Axl_Testimonials_Widget::VERSION;
|
81 |
-
self::$version = apply_filters( 'tw_version', self::$version );
|
82 |
-
|
83 |
-
if ( $version != self::$version ) {
|
84 |
-
self::initialize_settings();
|
85 |
-
}
|
86 |
-
|
87 |
-
if ( ! Axl_Testimonials_Widget::do_load() ) {
|
88 |
-
return;
|
89 |
-
}
|
90 |
-
|
91 |
-
self::load_options();
|
92 |
-
self::register_settings();
|
93 |
-
}
|
94 |
-
|
95 |
-
|
96 |
-
public static function admin_menu() {
|
97 |
-
self::$admin_page = add_submenu_page( 'edit.php?post_type=' . Axl_Testimonials_Widget::PT, esc_html__( 'Testimonials Settings', 'testimonials-widget' ), esc_html__( 'Settings', 'testimonials-widget' ), 'manage_options', self::ID, array( __CLASS__, 'display_page' ) );
|
98 |
-
|
99 |
-
add_action( 'admin_print_scripts-' . self::$admin_page, array( __CLASS__, 'scripts' ) );
|
100 |
-
add_action( 'admin_print_styles-' . self::$admin_page, array( __CLASS__, 'styles' ) );
|
101 |
-
add_action( 'load-' . self::$admin_page, array( __CLASS__, 'settings_add_help_tabs' ) );
|
102 |
-
}
|
103 |
-
|
104 |
-
|
105 |
-
public static function init() {
|
106 |
-
load_plugin_textdomain( 'testimonials-widget', false, '/testimonials-widget/languages/' );
|
107 |
-
|
108 |
-
self::$plugin_assets = Axl_Testimonials_Widget::$plugin_assets;
|
109 |
-
}
|
110 |
-
|
111 |
-
|
112 |
-
public static function sections() {
|
113 |
-
self::$sections['general'] = esc_html__( 'General', 'testimonials-widget' );
|
114 |
-
self::$sections['fields'] = esc_html__( 'Fields', 'testimonials-widget' );
|
115 |
-
self::$sections['selection'] = esc_html__( 'Selection', 'testimonials-widget' );
|
116 |
-
self::$sections['ordering'] = esc_html__( 'Ordering', 'testimonials-widget' );
|
117 |
-
self::$sections['columns'] = esc_html__( 'Columns', 'testimonials-widget' );
|
118 |
-
self::$sections['post_type'] = esc_html__( 'Post Type', 'testimonials-widget' );
|
119 |
-
self::$sections['widget'] = esc_html__( 'Slider Widget', 'testimonials-widget' );
|
120 |
-
|
121 |
-
parent::sections();
|
122 |
-
|
123 |
-
self::$sections['options'] = esc_html__( 'Shortcode Attributes', 'testimonials-widget' );
|
124 |
-
self::$sections['examples'] = esc_html__( 'Shortcode Examples', 'testimonials-widget' );
|
125 |
-
|
126 |
-
self::$sections = apply_filters( 'tw_sections', self::$sections );
|
127 |
-
}
|
128 |
-
|
129 |
-
|
130 |
-
/**
|
131 |
-
*
|
132 |
-
*
|
133 |
-
* @SuppressWarnings(PHPMD.Superglobals)
|
134 |
-
*/
|
135 |
-
public static function settings() {
|
136 |
-
// Widget
|
137 |
-
self::$settings['title'] = array(
|
138 |
-
'section' => 'widget',
|
139 |
-
'title' => esc_html__( 'Title', 'testimonials-widget' ),
|
140 |
-
'std' => esc_html__( 'Testimonials', 'testimonials-widget' ),
|
141 |
-
'validate' => 'wp_kses_post',
|
142 |
-
);
|
143 |
-
|
144 |
-
self::$settings['title_link'] = array(
|
145 |
-
'section' => 'widget',
|
146 |
-
'title' => esc_html__( 'Title Link', 'testimonials-widget' ),
|
147 |
-
'desc' => esc_html__( 'URL, path, or post ID to link widget title to. Ex: http://example.com/stuff, /testimonials, or 123', 'testimonials-widget' ),
|
148 |
-
'validate' => 'wp_kses_data',
|
149 |
-
);
|
150 |
-
|
151 |
-
self::$settings['adaptive_height'] = array(
|
152 |
-
'section' => 'widget',
|
153 |
-
'title' => esc_html__( 'Adaptive Slider Height?', 'testimonials-widget' ),
|
154 |
-
'desc' => esc_html__( 'Dynamically adjust slider height based on each slide\'s height.', 'testimonials-widget' ),
|
155 |
-
'type' => 'checkbox',
|
156 |
-
'validate' => 'is_true',
|
157 |
-
'std' => 1,
|
158 |
-
);
|
159 |
-
|
160 |
-
self::$settings['bottom_text'] = array(
|
161 |
-
'section' => 'widget',
|
162 |
-
'title' => esc_html__( 'Bottom Text', 'testimonials-widget' ),
|
163 |
-
'desc' => esc_html__( 'Common text or HTML for bottom of testimonials.', 'testimonials-widget' ),
|
164 |
-
'type' => 'textarea',
|
165 |
-
'validate' => 'wp_kses_post',
|
166 |
-
);
|
167 |
-
|
168 |
-
self::$settings['char_limit'] = array(
|
169 |
-
'section' => 'widget',
|
170 |
-
'title' => esc_html__( 'Character Limit', 'testimonials-widget' ),
|
171 |
-
'desc' => esc_html__( 'Number of characters to limit non-single testimonial views to.', 'testimonials-widget' ),
|
172 |
-
'validate' => 'absint',
|
173 |
-
);
|
174 |
-
|
175 |
-
self::$settings['keep_whitespace'] = array(
|
176 |
-
'section' => 'widget',
|
177 |
-
'title' => esc_html__( 'Keep Whitespace?', 'testimonials-widget' ),
|
178 |
-
'desc' => esc_html__( 'Keeps testimonials looking as entered than sans auto-formatting.', 'testimonials-widget' ),
|
179 |
-
'type' => 'checkbox',
|
180 |
-
'validate' => 'is_true',
|
181 |
-
);
|
182 |
-
|
183 |
-
self::$settings['refresh_interval'] = array(
|
184 |
-
'section' => 'widget',
|
185 |
-
'title' => esc_html__( 'Rotation Speed', 'testimonials-widget' ),
|
186 |
-
'desc' => esc_html__( 'Number of seconds between testimonial rotations or 0 for no rotation at all refresh.', 'testimonials-widget' ),
|
187 |
-
'std' => 5,
|
188 |
-
'validate' => 'absint',
|
189 |
-
);
|
190 |
-
|
191 |
-
self::$settings['show_start_stop'] = array(
|
192 |
-
'section' => 'widget',
|
193 |
-
'title' => esc_html__( 'Show Play/Pause?', 'testimonials-widget' ),
|
194 |
-
'desc' => esc_html__( 'Display start and stop buttons underneath the testimonial slider.', 'testimonials-widget' ),
|
195 |
-
'type' => 'checkbox',
|
196 |
-
'validate' => 'is_true',
|
197 |
-
'std' => 1,
|
198 |
-
);
|
199 |
-
|
200 |
-
self::$settings['slide_width'] = array(
|
201 |
-
'section' => 'widget',
|
202 |
-
'title' => esc_html__( 'Slide Width?', 'testimonials-widget' ),
|
203 |
-
'desc' => esc_html__( 'Width of each testimonial. Increase to thumbnail width or greater for improved looks. Requried for horizontal transitions.', 'testimonials-widget' ),
|
204 |
-
'validate' => 'intval',
|
205 |
-
'std' => 0,
|
206 |
-
);
|
207 |
-
|
208 |
-
self::$settings['transition_mode'] = array(
|
209 |
-
'section' => 'widget',
|
210 |
-
'title' => esc_html__( 'Transition Mode?', 'testimonials-widget' ),
|
211 |
-
'desc' => esc_html__( 'Type of transition between slides.', 'testimonials-widget' ),
|
212 |
-
'type' => 'select',
|
213 |
-
'choices' => array(
|
214 |
-
'fade' => esc_html__( 'Fade', 'testimonials-widget' ),
|
215 |
-
'horizontal' => esc_html__( 'Horizontal', 'testimonials-widget' ),
|
216 |
-
'vertical' => esc_html__( 'Vertical', 'testimonials-widget' ),
|
217 |
-
),
|
218 |
-
'std' => 'fade',
|
219 |
-
);
|
220 |
-
|
221 |
-
self::$settings['widget_expand_all'] = array(
|
222 |
-
'section' => 'widget',
|
223 |
-
'type' => 'expand_all',
|
224 |
-
);
|
225 |
-
|
226 |
-
// General
|
227 |
-
self::$settings['general_expand_begin'] = array(
|
228 |
-
'desc' => esc_html__( 'General Options', 'testimonials-widget' ),
|
229 |
-
'type' => 'expand_begin',
|
230 |
-
);
|
231 |
-
|
232 |
-
self::$settings['item_reviewed'] = array(
|
233 |
-
'title' => esc_html__( 'Default Reviewed Item?', 'testimonials-widget' ),
|
234 |
-
'desc' => esc_html__( 'Name of thing being referenced in testimonials.', 'testimonials-widget' ),
|
235 |
-
'std' => get_option( 'blogname' ),
|
236 |
-
'widget' => 0,
|
237 |
-
'validate' => 'wp_kses_post',
|
238 |
-
);
|
239 |
-
|
240 |
-
self::$settings['item_reviewed_url'] = array(
|
241 |
-
'title' => esc_html__( 'Default Reviewed Item URL?', 'testimonials-widget' ),
|
242 |
-
'desc' => esc_html__( 'URL of thing being referenced in testimonials.', 'testimonials-widget' ),
|
243 |
-
'std' => network_site_url(),
|
244 |
-
'validate' => 'url',
|
245 |
-
'widget' => 0,
|
246 |
-
);
|
247 |
-
|
248 |
-
self::$settings['disable_quotes'] = array(
|
249 |
-
'title' => esc_html__( 'Disable built-in quotes?', 'testimonials-widget' ),
|
250 |
-
'desc' => esc_html__( 'Remove open and close quote span tags surrounding testimonial content.', 'testimonials-widget' ),
|
251 |
-
'type' => 'checkbox',
|
252 |
-
'validate' => 'is_true',
|
253 |
-
);
|
254 |
-
|
255 |
-
self::$settings['hide_not_found'] = array(
|
256 |
-
'title' => esc_html__( 'Disable "Testimonials Not Found"?', 'testimonials-widget' ),
|
257 |
-
'desc' => esc_html__( 'Remove "Testimonials Not Found" content when no testimonials are found to be displayed.', 'testimonials-widget' ),
|
258 |
-
'type' => 'checkbox',
|
259 |
-
'validate' => 'is_true',
|
260 |
-
);
|
261 |
-
|
262 |
-
self::$settings['paging'] = array(
|
263 |
-
'title' => esc_html__( 'Enable Paging?', 'testimonials-widget' ),
|
264 |
-
'desc' => esc_html__( 'Show paging controls for `[testimonials]` listing.', 'testimonials-widget' ),
|
265 |
-
'type' => 'select',
|
266 |
-
'choices' => array(
|
267 |
-
'' => esc_html__( 'Disable', 'testimonials-widget' ),
|
268 |
-
1 => esc_html__( 'Enable', 'testimonials-widget' ),
|
269 |
-
'before' => esc_html__( 'Before testimonials', 'testimonials-widget' ),
|
270 |
-
'after' => esc_html__( 'After testimonials', 'testimonials-widget' ),
|
271 |
-
),
|
272 |
-
'std' => 1,
|
273 |
-
'widget' => 0,
|
274 |
-
);
|
275 |
-
|
276 |
-
$desc = __( 'Adds HTML tag markup per the <a href="%s">Review schema</a> to testimonials. Search engines including Bing, Google, Yahoo! and Yandex rely on this markup to improve the display of search results.', 'testimonials-widget' );
|
277 |
-
|
278 |
-
self::$settings['enable_schema'] = array(
|
279 |
-
'title' => esc_html__( 'Enable Review Schema?', 'testimonials-widget' ),
|
280 |
-
'desc' => sprintf( $desc, 'http://schema.org/Review' ),
|
281 |
-
'type' => 'checkbox',
|
282 |
-
'validate' => 'is_true',
|
283 |
-
);
|
284 |
-
|
285 |
-
self::$settings['do_shortcode'] = array(
|
286 |
-
'title' => esc_html__( 'Enable [shortcodes]?', 'testimonials-widget' ),
|
287 |
-
'desc' => esc_html__( 'If unchecked, shortcodes are stripped.', 'testimonials-widget' ),
|
288 |
-
'type' => 'checkbox',
|
289 |
-
'validate' => 'is_true',
|
290 |
-
'std' => 1,
|
291 |
-
);
|
292 |
-
|
293 |
-
self::$settings['enable_video'] = array(
|
294 |
-
'title' => esc_html__( 'Enable Video?', 'testimonials-widget' ),
|
295 |
-
'desc' => esc_html__( 'Only enable when displaying video content.', 'testimonials-widget' ),
|
296 |
-
'type' => 'checkbox',
|
297 |
-
'validate' => 'is_true',
|
298 |
-
);
|
299 |
-
|
300 |
-
self::$settings['exclude_bxslider_css'] = array(
|
301 |
-
'title' => esc_html__( 'Exclude bxSlider CSS?', 'testimonials-widget' ),
|
302 |
-
'desc' => esc_html__( 'For a bare-bones, unthemed slider.', 'testimonials-widget' ),
|
303 |
-
'type' => 'checkbox',
|
304 |
-
'validate' => 'is_true',
|
305 |
-
'widget' => 0,
|
306 |
-
'show_code' => false,
|
307 |
-
);
|
308 |
-
|
309 |
-
self::$settings['exclude_css'] = array(
|
310 |
-
'title' => esc_html__( 'Exclude default CSS?', 'testimonials-widget' ),
|
311 |
-
'desc' => esc_html__( 'Prevent default CSS from being loaded.', 'testimonials-widget' ),
|
312 |
-
'type' => 'checkbox',
|
313 |
-
'validate' => 'is_true',
|
314 |
-
'widget' => 0,
|
315 |
-
'show_code' => false,
|
316 |
-
);
|
317 |
-
|
318 |
-
self::$settings['remove_hentry'] = array(
|
319 |
-
'title' => esc_html__( 'Remove `.hentry` CSS?', 'testimonials-widget' ),
|
320 |
-
'desc' => esc_html__( 'Some themes use class `.hentry` in a manner that breaks Testimonials\' CSS.', 'testimonials-widget' ),
|
321 |
-
'type' => 'checkbox',
|
322 |
-
'validate' => 'is_true',
|
323 |
-
'std' => 1,
|
324 |
-
);
|
325 |
-
|
326 |
-
self::$settings['target'] = array(
|
327 |
-
'title' => esc_html__( 'URL Target', 'testimonials-widget' ),
|
328 |
-
'desc' => esc_html__( 'Add target to all URLs; leave blank if none.', 'testimonials-widget' ),
|
329 |
-
'validate' => 'term',
|
330 |
-
);
|
331 |
-
|
332 |
-
self::$settings['use_quote_tag'] = array(
|
333 |
-
'title' => esc_html__( 'Use `<q>` tag?', 'testimonials-widget' ),
|
334 |
-
'desc' => esc_html__( 'Not HTML5 compliant.', 'testimonials-widget' ),
|
335 |
-
'type' => 'checkbox',
|
336 |
-
'validate' => 'is_true',
|
337 |
-
);
|
338 |
-
|
339 |
-
self::$settings['general_expand_end'] = array(
|
340 |
-
'type' => 'expand_end',
|
341 |
-
);
|
342 |
-
|
343 |
-
// Fields
|
344 |
-
self::$settings['fields_expand_begin'] = array(
|
345 |
-
'section' => 'fields',
|
346 |
-
'desc' => esc_html__( 'Field Options', 'testimonials-widget' ),
|
347 |
-
'type' => 'expand_begin',
|
348 |
-
);
|
349 |
-
|
350 |
-
self::$settings['hide_source_title'] = array(
|
351 |
-
'section' => 'fields',
|
352 |
-
'title' => esc_html__( 'Hide Title Above Content?', 'testimonials-widget' ),
|
353 |
-
'type' => 'checkbox',
|
354 |
-
'validate' => 'is_true',
|
355 |
-
'std' => 1,
|
356 |
-
'desc' => esc_html__( 'Don\'t display testimonial title above testimonial content.', 'testimonials-widget' ),
|
357 |
-
);
|
358 |
-
|
359 |
-
self::$settings['hide_source'] = array(
|
360 |
-
'section' => 'fields',
|
361 |
-
'title' => esc_html__( 'Hide Author?', 'testimonials-widget' ),
|
362 |
-
'type' => 'checkbox',
|
363 |
-
'validate' => 'is_true',
|
364 |
-
'desc' => esc_html__( 'Don\'t display testimonial title in cite.', 'testimonials-widget' ),
|
365 |
-
);
|
366 |
-
|
367 |
-
self::$settings['hide_company'] = array(
|
368 |
-
'section' => 'fields',
|
369 |
-
'title' => esc_html__( 'Hide Company?', 'testimonials-widget' ),
|
370 |
-
'type' => 'checkbox',
|
371 |
-
'validate' => 'is_true',
|
372 |
-
'desc' => esc_html__( 'Don\'t display testimonial company in cite.', 'testimonials-widget' ),
|
373 |
-
);
|
374 |
-
|
375 |
-
self::$settings['hide_content'] = array(
|
376 |
-
'section' => 'fields',
|
377 |
-
'title' => esc_html__( 'Hide Content?', 'testimonials-widget' ),
|
378 |
-
'type' => 'checkbox',
|
379 |
-
'validate' => 'is_true',
|
380 |
-
'desc' => esc_html__( 'Don\'t display testimonial content in a view.', 'testimonials-widget' ),
|
381 |
-
);
|
382 |
-
|
383 |
-
self::$settings['hide_email'] = array(
|
384 |
-
'section' => 'fields',
|
385 |
-
'title' => esc_html__( 'Hide Email?', 'testimonials-widget' ),
|
386 |
-
'type' => 'checkbox',
|
387 |
-
'validate' => 'is_true',
|
388 |
-
'std' => 1,
|
389 |
-
'desc' => esc_html__( 'Don\'t display or link to testimonial email in cite.', 'testimonials-widget' ),
|
390 |
-
);
|
391 |
-
|
392 |
-
self::$settings['hide_gravatar'] = array(
|
393 |
-
'section' => 'fields',
|
394 |
-
'title' => esc_html__( 'Hide Gravatar?', 'testimonials-widget' ),
|
395 |
-
'type' => 'checkbox',
|
396 |
-
'validate' => 'is_true',
|
397 |
-
'desc' => esc_html__( 'Don\'t display Gravatar image with testimonial.', 'testimonials-widget' ),
|
398 |
-
);
|
399 |
-
|
400 |
-
self::$settings['hide_image'] = array(
|
401 |
-
'section' => 'fields',
|
402 |
-
'title' => esc_html__( 'Hide Image?', 'testimonials-widget' ),
|
403 |
-
'type' => 'checkbox',
|
404 |
-
'validate' => 'is_true',
|
405 |
-
'desc' => esc_html__( 'Don\'t display featured image with testimonial.', 'testimonials-widget' ),
|
406 |
-
);
|
407 |
-
|
408 |
-
self::$settings['hide_image_single'] = array(
|
409 |
-
'section' => 'fields',
|
410 |
-
'title' => esc_html__( 'Hide Image in Single View?', 'testimonials-widget' ),
|
411 |
-
'type' => 'checkbox',
|
412 |
-
'validate' => 'is_true',
|
413 |
-
'widget' => 0,
|
414 |
-
);
|
415 |
-
|
416 |
-
self::$settings['hide_title'] = array(
|
417 |
-
'section' => 'fields',
|
418 |
-
'title' => esc_html__( 'Hide Job Title?', 'testimonials-widget' ),
|
419 |
-
'type' => 'checkbox',
|
420 |
-
'validate' => 'is_true',
|
421 |
-
'desc' => esc_html__( 'Don\'t display testimonial job title in cite.', 'testimonials-widget' ),
|
422 |
-
);
|
423 |
-
|
424 |
-
self::$settings['hide_location'] = array(
|
425 |
-
'section' => 'fields',
|
426 |
-
'title' => esc_html__( 'Hide Location?', 'testimonials-widget' ),
|
427 |
-
'type' => 'checkbox',
|
428 |
-
'validate' => 'is_true',
|
429 |
-
'desc' => esc_html__( 'Don\'t display testimonial location in cite.', 'testimonials-widget' ),
|
430 |
-
);
|
431 |
-
|
432 |
-
self::$settings['hide_url'] = array(
|
433 |
-
'section' => 'fields',
|
434 |
-
'title' => esc_html__( 'Hide URL?', 'testimonials-widget' ),
|
435 |
-
'type' => 'checkbox',
|
436 |
-
'validate' => 'is_true',
|
437 |
-
'desc' => esc_html__( 'Don\'t display or link to testimonial URL in cite.', 'testimonials-widget' ),
|
438 |
-
);
|
439 |
-
|
440 |
-
self::$settings['fields_expand_end'] = array(
|
441 |
-
'type' => 'expand_end',
|
442 |
-
);
|
443 |
-
|
444 |
-
// Selection
|
445 |
-
self::$settings['selection_expand_begin'] = array(
|
446 |
-
'section' => 'selection',
|
447 |
-
'desc' => esc_html__( 'Selection Options', 'testimonials-widget' ),
|
448 |
-
'type' => 'expand_begin',
|
449 |
-
);
|
450 |
-
|
451 |
-
self::$settings['category'] = array(
|
452 |
-
'section' => 'selection',
|
453 |
-
'title' => esc_html__( 'Category Filter', 'testimonials-widget' ),
|
454 |
-
'desc' => esc_html__( 'Comma separated category names or IDs.', 'testimonials-widget' ),
|
455 |
-
'validate' => 'terms',
|
456 |
-
'suggest' => true,
|
457 |
-
);
|
458 |
-
|
459 |
-
self::$settings['exclude'] = array(
|
460 |
-
'section' => 'selection',
|
461 |
-
'title' => esc_html__( 'Exclude IDs Filter', 'testimonials-widget' ),
|
462 |
-
'desc' => esc_html__( 'Comma separated testimonial IDs.', 'testimonials-widget' ),
|
463 |
-
'validate' => 'ids',
|
464 |
-
);
|
465 |
-
|
466 |
-
self::$settings['ids'] = array(
|
467 |
-
'section' => 'selection',
|
468 |
-
'title' => esc_html__( 'Include IDs Filter', 'testimonials-widget' ),
|
469 |
-
'desc' => esc_html__( 'Comma separated testimonial IDs.', 'testimonials-widget' ),
|
470 |
-
'validate' => 'ids',
|
471 |
-
);
|
472 |
-
|
473 |
-
self::$settings['limit'] = array(
|
474 |
-
'section' => 'selection',
|
475 |
-
'title' => esc_html__( 'Limit', 'testimonials-widget' ),
|
476 |
-
'desc' => esc_html__( 'Number of testimonials to select per instance.', 'testimonials-widget' ),
|
477 |
-
'std' => 10,
|
478 |
-
'validate' => 'nozero',
|
479 |
-
);
|
480 |
-
|
481 |
-
self::$settings['tags_all'] = array(
|
482 |
-
'section' => 'selection',
|
483 |
-
'title' => esc_html__( 'Require All Tags?', 'testimonials-widget' ),
|
484 |
-
'desc' => esc_html__( 'Select only testimonials with all of the given tags.', 'testimonials-widget' ),
|
485 |
-
'type' => 'checkbox',
|
486 |
-
'validate' => 'is_true',
|
487 |
-
);
|
488 |
-
|
489 |
-
self::$settings['tags'] = array(
|
490 |
-
'section' => 'selection',
|
491 |
-
'title' => esc_html__( 'Tags Filter', 'testimonials-widget' ),
|
492 |
-
'desc' => esc_html__( 'Comma separated tag slugs or IDs.', 'testimonials-widget' ),
|
493 |
-
'validate' => 'terms',
|
494 |
-
'suggest' => true,
|
495 |
-
);
|
496 |
-
|
497 |
-
self::$settings['selection_expand_end'] = array(
|
498 |
-
'section' => 'selection',
|
499 |
-
'type' => 'expand_end',
|
500 |
-
);
|
501 |
-
|
502 |
-
// Ordering
|
503 |
-
self::$settings['ordering_expand_begin'] = array(
|
504 |
-
'section' => 'ordering',
|
505 |
-
'desc' => esc_html__( 'Ordering Options', 'testimonials-widget' ),
|
506 |
-
'type' => 'expand_begin',
|
507 |
-
);
|
508 |
-
|
509 |
-
self::$settings['orderby'] = array(
|
510 |
-
'section' => 'ordering',
|
511 |
-
'title' => esc_html__( 'ORDER BY', 'testimonials-widget' ),
|
512 |
-
'desc' => esc_html__( 'Used when "Random Order" is disabled.', 'testimonials-widget' ),
|
513 |
-
'type' => 'select',
|
514 |
-
'choices' => array(
|
515 |
-
'ID' => esc_html__( 'Testimonial ID', 'testimonials-widget' ),
|
516 |
-
'author' => esc_html__( 'Author', 'testimonials-widget' ),
|
517 |
-
'date' => esc_html__( 'Date', 'testimonials-widget' ),
|
518 |
-
'menu_order' => esc_html__( 'Menu Order', 'testimonials-widget' ),
|
519 |
-
'title' => esc_html__( 'Author', 'testimonials-widget' ),
|
520 |
-
'none' => esc_html__( 'No order', 'testimonials-widget' ),
|
521 |
-
),
|
522 |
-
'std' => 'ID',
|
523 |
-
'validate' => 'term',
|
524 |
-
);
|
525 |
-
|
526 |
-
self::$settings['meta_key'] = array(
|
527 |
-
'section' => 'ordering',
|
528 |
-
'title' => esc_html__( 'ORDER BY meta_key', 'testimonials-widget' ),
|
529 |
-
'desc' => esc_html__( 'Used when "Random Order" is disabled and sorting by a testimonials meta key is needed. Overrides ORDER BY.', 'testimonials-widget' ),
|
530 |
-
'type' => 'select',
|
531 |
-
'choices' => array(
|
532 |
-
'' => esc_html__( 'None', 'testimonials-widget' ),
|
533 |
-
'testimonials-widget-title' => esc_html__( 'Job Title', 'testimonials-widget' ),
|
534 |
-
'testimonials-widget-email' => esc_html__( 'Email', 'testimonials-widget' ),
|
535 |
-
'testimonials-widget-location' => esc_html__( 'Location', 'testimonials-widget' ),
|
536 |
-
'testimonials-widget-company' => esc_html__( 'Company', 'testimonials-widget' ),
|
537 |
-
'testimonials-widget-url' => esc_html__( 'URL', 'testimonials-widget' ),
|
538 |
-
),
|
539 |
-
'validate' => 'slug',
|
540 |
-
);
|
541 |
-
|
542 |
-
self::$settings['order'] = array(
|
543 |
-
'section' => 'ordering',
|
544 |
-
'title' => esc_html__( 'ORDER BY Order', 'testimonials-widget' ),
|
545 |
-
'type' => 'select',
|
546 |
-
'choices' => array(
|
547 |
-
'DESC' => esc_html__( 'Descending', 'testimonials-widget' ),
|
548 |
-
'ASC' => esc_html__( 'Ascending', 'testimonials-widget' ),
|
549 |
-
),
|
550 |
-
'std' => 'DESC',
|
551 |
-
'validate' => 'order',
|
552 |
-
);
|
553 |
-
|
554 |
-
self::$settings['random'] = array(
|
555 |
-
'section' => 'ordering',
|
556 |
-
'title' => esc_html__( 'Random Order?', 'testimonials-widget' ),
|
557 |
-
'desc' => esc_html__( 'If checked, ignores ORDER BY, ORDER BY meta_key, and ORDER BY Order. Widgets are random by default automatically.', 'testimonials-widget' ),
|
558 |
-
'type' => 'checkbox',
|
559 |
-
'validate' => 'is_true',
|
560 |
-
);
|
561 |
-
|
562 |
-
self::$settings['ordering_expand_end'] = array(
|
563 |
-
'section' => 'ordering',
|
564 |
-
'type' => 'expand_end',
|
565 |
-
);
|
566 |
-
|
567 |
-
// Post Type
|
568 |
-
self::$settings['allow_comments'] = array(
|
569 |
-
'section' => 'post_type',
|
570 |
-
'title' => esc_html__( 'Allow Comments?', 'testimonials-widget' ),
|
571 |
-
'desc' => esc_html__( 'Only affects the Testimonials post edit page. Your theme controls the front-end view.', 'testimonials-widget' ),
|
572 |
-
'type' => 'checkbox',
|
573 |
-
'validate' => 'is_true',
|
574 |
-
'widget' => 0,
|
575 |
-
'show_code' => false,
|
576 |
-
);
|
577 |
-
|
578 |
-
$desc = __( 'URL slug-name for <a href="%1s">testimonials archive</a> page.', 'testimonials-widget' );
|
579 |
-
$has_archive = tw_get_option( 'has_archive', '' );
|
580 |
-
$site_url = network_site_url( '/' . $has_archive . '/' );
|
581 |
-
|
582 |
-
self::$settings['has_archive'] = array(
|
583 |
-
'section' => 'post_type',
|
584 |
-
'title' => esc_html__( 'Archive Page URL', 'testimonials-widget' ),
|
585 |
-
'desc' => sprintf( $desc, $site_url ),
|
586 |
-
'std' => 'testimonials-archive',
|
587 |
-
'validate' => 'slash_sanitize_title',
|
588 |
-
'widget' => 0,
|
589 |
-
'show_code' => false,
|
590 |
-
);
|
591 |
-
|
592 |
-
self::$settings['use_cpt_taxonomy'] = array(
|
593 |
-
'section' => 'post_type',
|
594 |
-
'title' => esc_html__( 'Disable Default Taxonomies?', 'testimonials-widget' ),
|
595 |
-
'type' => 'checkbox',
|
596 |
-
'validate' => 'is_true',
|
597 |
-
'desc' => esc_html__( 'If checked, use Testimonials\' own category and tag taxonomies than WordPress\' defaults.', 'testimonials-widget' ),
|
598 |
-
'widget' => 0,
|
599 |
-
'show_code' => false,
|
600 |
-
);
|
601 |
-
|
602 |
-
self::$settings['enable_archives'] = array(
|
603 |
-
'desc' => esc_html__( 'Include testimonials in archive and category views.', 'testimonials-widget' ),
|
604 |
-
'section' => 'post_type',
|
605 |
-
'show_code' => false,
|
606 |
-
'title' => esc_html__( 'Enable archives view?', 'testimonials-widget' ),
|
607 |
-
'type' => 'checkbox',
|
608 |
-
'validate' => 'is_true',
|
609 |
-
'widget' => 0,
|
610 |
-
);
|
611 |
-
|
612 |
-
$desc = esc_html__( 'URL slug-name for testimonial view pages. Shouldn\'t be the same as the Archive Page URL nor should it match a page URL slug.', 'testimonials-widget' );
|
613 |
-
|
614 |
-
self::$settings['rewrite_slug'] = array(
|
615 |
-
'section' => 'post_type',
|
616 |
-
'title' => esc_html__( 'Testimonial Page URL', 'testimonials-widget' ),
|
617 |
-
'desc' => $desc,
|
618 |
-
'std' => 'testimonial',
|
619 |
-
'validate' => 'slash_sanitize_title',
|
620 |
-
'widget' => 0,
|
621 |
-
'show_code' => false,
|
622 |
-
);
|
623 |
-
|
624 |
-
// Columns
|
625 |
-
self::$settings['columns_author'] = array(
|
626 |
-
'section' => 'columns',
|
627 |
-
'title' => esc_html__( 'Hide Author?', 'testimonials-widget', 'testimonials-widget' ),
|
628 |
-
'type' => 'checkbox',
|
629 |
-
'validate' => 'is_true',
|
630 |
-
'std' => 1,
|
631 |
-
'widget' => 0,
|
632 |
-
'show_code' => false,
|
633 |
-
);
|
634 |
-
|
635 |
-
self::$settings['columns_company'] = array(
|
636 |
-
'section' => 'columns',
|
637 |
-
'title' => esc_html__( 'Hide Company?', 'testimonials-widget' ),
|
638 |
-
'type' => 'checkbox',
|
639 |
-
'validate' => 'is_true',
|
640 |
-
'std' => 1,
|
641 |
-
'widget' => 0,
|
642 |
-
'show_code' => false,
|
643 |
-
);
|
644 |
-
|
645 |
-
self::$settings['columns_email'] = array(
|
646 |
-
'section' => 'columns',
|
647 |
-
'title' => esc_html__( 'Hide Email?', 'testimonials-widget' ),
|
648 |
-
'type' => 'checkbox',
|
649 |
-
'validate' => 'is_true',
|
650 |
-
'std' => 1,
|
651 |
-
'widget' => 0,
|
652 |
-
'show_code' => false,
|
653 |
-
);
|
654 |
-
|
655 |
-
self::$settings['columns_id'] = array(
|
656 |
-
'section' => 'columns',
|
657 |
-
'title' => esc_html__( 'Hide ID?', 'testimonials-widget' ),
|
658 |
-
'type' => 'checkbox',
|
659 |
-
'validate' => 'is_true',
|
660 |
-
'std' => 1,
|
661 |
-
'widget' => 0,
|
662 |
-
'show_code' => false,
|
663 |
-
);
|
664 |
-
|
665 |
-
self::$settings['columns_thumbnail'] = array(
|
666 |
-
'section' => 'columns',
|
667 |
-
'title' => esc_html__( 'Hide Image?', 'testimonials-widget' ),
|
668 |
-
'type' => 'checkbox',
|
669 |
-
'validate' => 'is_true',
|
670 |
-
'widget' => 0,
|
671 |
-
'show_code' => false,
|
672 |
-
);
|
673 |
-
|
674 |
-
self::$settings['columns_job_title'] = array(
|
675 |
-
'section' => 'columns',
|
676 |
-
'title' => esc_html__( 'Hide Job Title?', 'testimonials-widget' ),
|
677 |
-
'type' => 'checkbox',
|
678 |
-
'validate' => 'is_true',
|
679 |
-
'std' => 1,
|
680 |
-
'widget' => 0,
|
681 |
-
'show_code' => false,
|
682 |
-
);
|
683 |
-
|
684 |
-
self::$settings['columns_location'] = array(
|
685 |
-
'section' => 'columns',
|
686 |
-
'title' => esc_html__( 'Hide Location?', 'testimonials-widget' ),
|
687 |
-
'type' => 'checkbox',
|
688 |
-
'validate' => 'is_true',
|
689 |
-
'std' => 1,
|
690 |
-
'widget' => 0,
|
691 |
-
'show_code' => false,
|
692 |
-
);
|
693 |
-
|
694 |
-
self::$settings['columns_shortcode'] = array(
|
695 |
-
'section' => 'columns',
|
696 |
-
'title' => esc_html__( 'Hide Shortcode?', 'testimonials-widget' ),
|
697 |
-
'type' => 'checkbox',
|
698 |
-
'validate' => 'is_true',
|
699 |
-
'widget' => 0,
|
700 |
-
'show_code' => false,
|
701 |
-
);
|
702 |
-
|
703 |
-
self::$settings['columns_url'] = array(
|
704 |
-
'section' => 'columns',
|
705 |
-
'title' => esc_html__( 'Hide URL?', 'testimonials-widget' ),
|
706 |
-
'type' => 'checkbox',
|
707 |
-
'validate' => 'is_true',
|
708 |
-
'std' => 1,
|
709 |
-
'widget' => 0,
|
710 |
-
'show_code' => false,
|
711 |
-
);
|
712 |
-
|
713 |
-
// Reset
|
714 |
-
self::$settings['reset_expand_begin'] = array(
|
715 |
-
'section' => 'reset',
|
716 |
-
'desc' => esc_html__( 'Reset', 'testimonials-widget' ),
|
717 |
-
'type' => 'expand_begin',
|
718 |
-
);
|
719 |
-
|
720 |
-
parent::settings();
|
721 |
-
|
722 |
-
self::$settings['reset_expand_end'] = array(
|
723 |
-
'section' => 'reset',
|
724 |
-
'type' => 'expand_end',
|
725 |
-
);
|
726 |
-
|
727 |
-
self::$settings = apply_filters( 'tw_settings', self::$settings );
|
728 |
-
foreach ( self::$settings as $id => $parts ) {
|
729 |
-
self::$settings[ $id ] = wp_parse_args( $parts, self::$default );
|
730 |
-
}
|
731 |
-
|
732 |
-
if ( ! empty( $_REQUEST['page'] ) && 'testimonialswidget_settings' == $_REQUEST['page'] ) {
|
733 |
-
// Examples
|
734 |
-
self::$settings['examples'] = array(
|
735 |
-
'section' => 'examples',
|
736 |
-
'desc' => Axl_Testimonials_Widget::testimonials_examples(),
|
737 |
-
'type' => 'content',
|
738 |
-
'widget' => 0,
|
739 |
-
);
|
740 |
-
self::$settings['examples'] = wp_parse_args( self::$settings['examples'], self::$default );
|
741 |
-
|
742 |
-
// Shortcode Attributes
|
743 |
-
self::$settings['options'] = array(
|
744 |
-
'section' => 'options',
|
745 |
-
'type' => 'content',
|
746 |
-
'desc' => Axl_Testimonials_Widget::testimonials_options(),
|
747 |
-
'widget' => 0,
|
748 |
-
);
|
749 |
-
self::$settings['options'] = wp_parse_args( self::$settings['options'], self::$default );
|
750 |
-
}
|
751 |
-
}
|
752 |
-
|
753 |
-
|
754 |
-
public static function get_defaults( $mode = null, $old_version = null ) {
|
755 |
-
$old_version = tw_get_option( 'version' );
|
756 |
-
|
757 |
-
$defaults = parent::get_defaults( $mode, $old_version );
|
758 |
-
$defaults = apply_filters( 'tw_settings_defaults', $defaults );
|
759 |
-
|
760 |
-
return $defaults;
|
761 |
-
}
|
762 |
-
|
763 |
-
|
764 |
-
public static function display_page( $disable_donate = false ) {
|
765 |
-
$disable_donate = tw_get_option( 'disable_donate' );
|
766 |
-
|
767 |
-
parent::display_page( $disable_donate );
|
768 |
-
}
|
769 |
-
|
770 |
-
|
771 |
-
/**
|
772 |
-
*
|
773 |
-
*
|
774 |
-
* @SuppressWarnings(PHPMD.UnusedLocalVariable)
|
775 |
-
*/
|
776 |
-
public static function display_setting( $args = array(), $do_echo = true, $input = null ) {
|
777 |
-
$content = '';
|
778 |
-
switch ( $args['type'] ) {
|
779 |
-
default:
|
780 |
-
$content = apply_filters( 'tw_display_setting', $content, $args, $input );
|
781 |
-
break;
|
782 |
-
}
|
783 |
-
|
784 |
-
if ( empty( $content ) ) {
|
785 |
-
$content = parent::display_setting( $args, false, $input );
|
786 |
-
}
|
787 |
-
|
788 |
-
if ( ! $do_echo ) {
|
789 |
-
return $content;
|
790 |
-
}
|
791 |
-
|
792 |
-
echo $content;
|
793 |
-
}
|
794 |
-
|
795 |
-
|
796 |
-
public static function initialize_settings( $version = null ) {
|
797 |
-
$version = tw_get_option( 'version', self::$version );
|
798 |
-
|
799 |
-
parent::initialize_settings( $version );
|
800 |
-
}
|
801 |
-
|
802 |
-
|
803 |
-
/**
|
804 |
-
*
|
805 |
-
*
|
806 |
-
* @SuppressWarnings(PHPMD.Superglobals)
|
807 |
-
*/
|
808 |
-
public static function validate_settings( $input, $options = null, $do_errors = false ) {
|
809 |
-
$validated = parent::validate_settings( $input, $options, $do_errors );
|
810 |
-
|
811 |
-
if ( empty( $do_errors ) ) {
|
812 |
-
$input = $validated;
|
813 |
-
$errors = array();
|
814 |
-
} else {
|
815 |
-
$input = $validated['input'];
|
816 |
-
$errors = $validated['errors'];
|
817 |
-
}
|
818 |
-
|
819 |
-
$defaults = self::get_defaults();
|
820 |
-
if ( ! empty( $_REQUEST['page'] ) && 'testimonialswidget_settings' == $_REQUEST['page'] ) {
|
821 |
-
if ( ! empty( $input['has_archive'] ) ) {
|
822 |
-
$input['has_archive'] = self::prevent_slug_conflict( $input['has_archive'] );
|
823 |
-
} else {
|
824 |
-
$input['has_archive'] = $defaults['has_archive'];
|
825 |
-
}
|
826 |
-
|
827 |
-
if ( ! empty( $input['rewrite_slug'] ) ) {
|
828 |
-
$input['rewrite_slug'] = self::prevent_slug_conflict( $input['rewrite_slug'] );
|
829 |
-
} else {
|
830 |
-
$input['rewrite_slug'] = $defaults['rewrite_slug'];
|
831 |
-
}
|
832 |
-
|
833 |
-
$flush_rewrite_rules = false;
|
834 |
-
// same has_archive and rewrite_slug causes problems
|
835 |
-
if ( $input['has_archive'] == $input['rewrite_slug'] ) {
|
836 |
-
$input['has_archive'] = $defaults['has_archive'];
|
837 |
-
$input['rewrite_slug'] = $defaults['rewrite_slug'];
|
838 |
-
|
839 |
-
$flush_rewrite_rules = true;
|
840 |
-
}
|
841 |
-
|
842 |
-
// did URL slugs or taxonomy change?
|
843 |
-
$has_archive = tw_get_option( 'has_archive' );
|
844 |
-
$rewrite_slug = tw_get_option( 'rewrite_slug' );
|
845 |
-
$use_cpt_taxonomy = tw_get_option( 'use_cpt_taxonomy' );
|
846 |
-
if ( $has_archive != $input['has_archive'] || $rewrite_slug != $input['rewrite_slug'] || $use_cpt_taxonomy != $input['use_cpt_taxonomy'] ) {
|
847 |
-
$flush_rewrite_rules = true;
|
848 |
-
}
|
849 |
-
|
850 |
-
if ( $flush_rewrite_rules ) {
|
851 |
-
flush_rewrite_rules();
|
852 |
-
}
|
853 |
-
}
|
854 |
-
|
855 |
-
$input['version'] = self::$version;
|
856 |
-
$input['donate_version'] = Axl_Testimonials_Widget::VERSION;
|
857 |
-
|
858 |
-
$input = apply_filters( 'tw_validate_settings', $input, $errors );
|
859 |
-
if ( empty( $do_errors ) ) {
|
860 |
-
$validated = $input;
|
861 |
-
} else {
|
862 |
-
$validated = array(
|
863 |
-
'input' => $input,
|
864 |
-
'errors' => $errors,
|
865 |
-
);
|
866 |
-
}
|
867 |
-
|
868 |
-
return $validated;
|
869 |
-
}
|
870 |
-
|
871 |
-
|
872 |
-
public static function prevent_slug_conflict( $slug ) {
|
873 |
-
global $wpdb;
|
874 |
-
|
875 |
-
// slugs must be unique within their own trees
|
876 |
-
$check_sql = "SELECT post_name FROM $wpdb->posts WHERE post_name = %s AND post_parent = 0 LIMIT 1";
|
877 |
-
$slug_check = $wpdb->get_var( $wpdb->prepare( $check_sql, $slug ) );
|
878 |
-
if ( $slug_check ) {
|
879 |
-
$suffix = 2;
|
880 |
-
do {
|
881 |
-
$alt_slug = _truncate_post_slug( $slug, 200 - ( strlen( $suffix ) + 1 ) ) . "-$suffix";
|
882 |
-
$slug_check = $wpdb->get_var( $wpdb->prepare( $check_sql, $alt_slug ) );
|
883 |
-
$suffix++;
|
884 |
-
} while ( $slug_check );
|
885 |
-
|
886 |
-
$slug = $alt_slug;
|
887 |
-
}
|
888 |
-
|
889 |
-
return $slug;
|
890 |
-
}
|
891 |
-
|
892 |
-
|
893 |
-
/**
|
894 |
-
*
|
895 |
-
*
|
896 |
-
* @SuppressWarnings(PHPMD.LongVariable)
|
897 |
-
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
898 |
-
*/
|
899 |
-
public static function is_bad_hierarchical_slug( $is_bad_hierarchical_slug, $slug, $post_type, $post_parent ) {
|
900 |
-
// This post has no parent and is a "base" post
|
901 |
-
if ( ! $post_parent && self::is_cpt_slug( $slug ) ) {
|
902 |
-
return true;
|
903 |
-
}
|
904 |
-
|
905 |
-
return $is_bad_hierarchical_slug;
|
906 |
-
}
|
907 |
-
|
908 |
-
|
909 |
-
/**
|
910 |
-
*
|
911 |
-
*
|
912 |
-
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
913 |
-
*/
|
914 |
-
public static function is_bad_flat_slug( $is_bad_flat_slug, $slug, $post_type ) {
|
915 |
-
if ( self::is_cpt_slug( $slug ) ) {
|
916 |
-
return true;
|
917 |
-
}
|
918 |
-
|
919 |
-
return $is_bad_flat_slug;
|
920 |
-
}
|
921 |
-
|
922 |
-
|
923 |
-
public static function is_cpt_slug( $slug ) {
|
924 |
-
$has_archive = tw_get_option( 'has_archive' );
|
925 |
-
$rewrite_slug = tw_get_option( 'rewrite_slug' );
|
926 |
-
|
927 |
-
return in_array( $slug, array( $has_archive, $rewrite_slug ) );
|
928 |
-
}
|
929 |
-
|
930 |
-
|
931 |
-
public static function settings_add_help_tabs() {
|
932 |
-
$screen = get_current_screen();
|
933 |
-
if ( self::$admin_page != $screen->id ) {
|
934 |
-
return;
|
935 |
-
}
|
936 |
-
|
937 |
-
$screen->set_help_sidebar(
|
938 |
-
'<p>' .
|
939 |
-
esc_html__( 'These Testimonials Settings establish the default option values for shortcodes, theme functions, and widget instances. Widgets, once created no longer inherit these global settings. Therefore, you\'ll need to update each widget with the new settings. It might be easier to delete the widget and then recreate it.', 'testimonials-widget' ) .
|
940 |
-
'</p><p>' .
|
941 |
-
esc_html__( 'Shortcode option names are listed below each entry.', 'testimonials-widget' ) .
|
942 |
-
'</p><p>' .
|
943 |
-
sprintf(
|
944 |
-
__( 'View the <a href="%s">Testimonials documentation</a>.', 'testimonials-widget' ),
|
945 |
-
esc_url( self::$plugin_url . '/faq/' )
|
946 |
-
) .
|
947 |
-
'</p>'
|
948 |
-
);
|
949 |
-
|
950 |
-
$screen->add_help_tab(
|
951 |
-
array(
|
952 |
-
'id' => 'tw-general',
|
953 |
-
'title' => esc_html__( 'General', 'testimonials-widget' ),
|
954 |
-
'content' => '<p>' . esc_html__( 'General options.', 'testimonials-widget' ) . '</p>',
|
955 |
-
)
|
956 |
-
);
|
957 |
-
|
958 |
-
$screen->add_help_tab(
|
959 |
-
array(
|
960 |
-
'id' => 'tw-fields',
|
961 |
-
'title' => esc_html__( 'Fields', 'testimonials-widget' ),
|
962 |
-
'content' => '<p>' . esc_html__( 'Show or hide fields.', 'testimonials-widget' ) . '</p>',
|
963 |
-
)
|
964 |
-
);
|
965 |
-
|
966 |
-
$screen->add_help_tab(
|
967 |
-
array(
|
968 |
-
'id' => 'tw-selection',
|
969 |
-
'title' => esc_html__( 'Selection', 'testimonials-widget' ),
|
970 |
-
'content' => '<p>' . esc_html__( 'Options used to select testimonials.', 'testimonials-widget' ) . '</p>',
|
971 |
-
)
|
972 |
-
);
|
973 |
-
|
974 |
-
$screen->add_help_tab(
|
975 |
-
array(
|
976 |
-
'id' => 'tw-ordering',
|
977 |
-
'title' => esc_html__( 'Ordering', 'testimonials-widget' ),
|
978 |
-
'content' => '<p>' . esc_html__( 'Options used to determine displayed testimonials ordering.', 'testimonials-widget' ) . '</p>',
|
979 |
-
)
|
980 |
-
);
|
981 |
-
|
982 |
-
$screen->add_help_tab(
|
983 |
-
array(
|
984 |
-
'id' => 'tw-columns',
|
985 |
-
'title' => esc_html__( 'Columns', 'testimonials-widget' ),
|
986 |
-
'content' => '<p>' . esc_html__( 'Allowed columns to display on edit page.', 'testimonials-widget' ) . '</p>',
|
987 |
-
)
|
988 |
-
);
|
989 |
-
|
990 |
-
$screen->add_help_tab(
|
991 |
-
array(
|
992 |
-
'id' => 'tw-post_type',
|
993 |
-
'title' => esc_html__( 'Post Type', 'testimonials-widget' ),
|
994 |
-
'content' => '<p>' . esc_html__( 'Archive and singular page URL related testimonials options.', 'testimonials-widget' ) . '</p>',
|
995 |
-
)
|
996 |
-
);
|
997 |
-
|
998 |
-
$screen->add_help_tab(
|
999 |
-
array(
|
1000 |
-
'id' => 'tw-widget',
|
1001 |
-
'title' => esc_html__( 'Slider Widget', 'testimonials-widget' ),
|
1002 |
-
'content' => '<p>' . esc_html__( 'Options related to showing testimonials in widgets.', 'testimonials-widget' ) . '</p>',
|
1003 |
-
)
|
1004 |
-
);
|
1005 |
-
|
1006 |
-
$screen->add_help_tab(
|
1007 |
-
array(
|
1008 |
-
'id' => 'tw-reset',
|
1009 |
-
'title' => esc_html__( 'Reset', 'testimonials-widget' ),
|
1010 |
-
'content' => '<p>' . esc_html__( 'Backwards compatibility, import/export options, and reset options.', 'testimonials-widget' ) . '</p>',
|
1011 |
-
)
|
1012 |
-
);
|
1013 |
-
|
1014 |
-
do_action( 'tw_settings_add_help_tabs', $screen );
|
1015 |
-
}
|
1016 |
-
|
1017 |
-
|
1018 |
-
public static function get_suggest( $id, $suggest_id ) {
|
1019 |
-
wp_enqueue_script( 'suggest' );
|
1020 |
-
|
1021 |
-
$use_cpt_taxonomy = tw_get_option( 'use_cpt_taxonomy', false );
|
1022 |
-
|
1023 |
-
switch ( $id ) {
|
1024 |
-
case 'category':
|
1025 |
-
if ( ! $use_cpt_taxonomy ) {
|
1026 |
-
$taxonomy = 'category';
|
1027 |
-
} else {
|
1028 |
-
$taxonomy = Axl_Testimonials_Widget::$cpt_category;
|
1029 |
-
}
|
1030 |
-
|
1031 |
-
break;
|
1032 |
-
|
1033 |
-
case 'tags':
|
1034 |
-
if ( ! $use_cpt_taxonomy ) {
|
1035 |
-
$taxonomy = 'post_tag';
|
1036 |
-
} else {
|
1037 |
-
$taxonomy = Axl_Testimonials_Widget::$cpt_tags;
|
1038 |
-
}
|
1039 |
-
|
1040 |
-
break;
|
1041 |
-
}
|
1042 |
-
|
1043 |
-
$ajax_url = site_url() . '/wp-admin/admin-ajax.php';
|
1044 |
-
$suggest_js = "suggest( '{$ajax_url}?action=ajax-tag-search&tax={$taxonomy}', { delay: 500, minchars: 2, multiple: true, multipleSep: ', ' } )";
|
1045 |
-
|
1046 |
-
$scripts = <<<EOD
|
1047 |
-
<script type="text/javascript">
|
1048 |
-
jQuery(document).ready( function() {
|
1049 |
-
jQuery( '.{$suggest_id}' ).{$suggest_js};
|
1050 |
-
});
|
1051 |
-
</script>
|
1052 |
-
EOD;
|
1053 |
-
|
1054 |
-
return $scripts;
|
1055 |
-
}
|
1056 |
-
}
|
1057 |
-
|
1058 |
-
|
1059 |
-
function tw_get_options() {
|
1060 |
-
$options = get_option( Axl_Testimonials_Widget_Settings::ID );
|
1061 |
-
|
1062 |
-
if ( false === $options ) {
|
1063 |
-
$options = Axl_Testimonials_Widget_Settings::get_defaults();
|
1064 |
-
update_option( Axl_Testimonials_Widget_Settings::ID, $options );
|
1065 |
-
}
|
1066 |
-
|
1067 |
-
return $options;
|
1068 |
-
}
|
1069 |
-
|
1070 |
-
|
1071 |
-
function tw_get_option( $option, $default = null ) {
|
1072 |
-
$options = get_option( Axl_Testimonials_Widget_Settings::ID, null );
|
1073 |
-
|
1074 |
-
if ( isset( $options[ $option ] ) ) {
|
1075 |
-
return $options[ $option ];
|
1076 |
-
} else {
|
1077 |
-
return $default;
|
1078 |
-
}
|
1079 |
-
}
|
1080 |
-
|
1081 |
-
|
1082 |
-
function tw_set_option( $option, $value = null ) {
|
1083 |
-
$options = get_option( Axl_Testimonials_Widget_Settings::ID );
|
1084 |
-
|
1085 |
-
if ( ! is_array( $options ) ) {
|
1086 |
-
$options = array();
|
1087 |
-
}
|
1088 |
-
|
1089 |
-
$options[ $option ] = $value;
|
1090 |
-
update_option( Axl_Testimonials_Widget_Settings::ID, $options );
|
1091 |
-
}
|
1092 |
-
|
1093 |
-
|
1094 |
-
function tw_init_options() {
|
1095 |
-
$options = tw_get_options();
|
1096 |
-
$options = wp_parse_args( $options, Axl_Testimonials_Widget::get_defaults() );
|
1097 |
-
$options = Axl_Testimonials_Widget_Settings::validate_settings( $options );
|
1098 |
-
update_option( Axl_Testimonials_Widget_Settings::ID, $options );
|
1099 |
-
}
|
1100 |
-
|
1101 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/class-testimonials-widget-slider-widget.php
DELETED
@@ -1,113 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
Testimonials Widget
|
4 |
-
Copyright (C) 2015 Axelerant
|
5 |
-
|
6 |
-
This program is free software; you can redistribute it and/or modify
|
7 |
-
it under the terms of the GNU General Public License as published by
|
8 |
-
the Free Software Foundation; either version 2 of the License, or
|
9 |
-
(at your option) any later version.
|
10 |
-
|
11 |
-
This program is distributed in the hope that it will be useful,
|
12 |
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 |
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14 |
-
GNU General Public License for more details.
|
15 |
-
|
16 |
-
You should have received a copy of the GNU General Public License along
|
17 |
-
with this program; if not, write to the Free Software Foundation, Inc.,
|
18 |
-
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
19 |
-
*/
|
20 |
-
|
21 |
-
require_once AIHR_DIR_INC . 'class-aihrus-widget.php';
|
22 |
-
|
23 |
-
if ( class_exists( 'Axl_Testimonials_Widget_Slider_Widget' ) ) {
|
24 |
-
return;
|
25 |
-
}
|
26 |
-
|
27 |
-
|
28 |
-
class Axl_Testimonials_Widget_Slider_Widget extends Aihrus_Widget {
|
29 |
-
// should be tw_slider_widget, but for backwards compliance left alone
|
30 |
-
const ID = 'testimonials_widget';
|
31 |
-
|
32 |
-
|
33 |
-
public function __construct() {
|
34 |
-
$classname = __CLASS__;
|
35 |
-
$description = esc_html__( 'Displays rotating testimonials or statically.', 'testimonials-widget' );
|
36 |
-
$id_base = self::ID;
|
37 |
-
$title = esc_html__( 'Testimonials Slider', 'testimonials-widget' );
|
38 |
-
|
39 |
-
parent::__construct( $classname, $description, $id_base, $title );
|
40 |
-
}
|
41 |
-
|
42 |
-
|
43 |
-
public static function get_testimonials_css() {
|
44 |
-
Axl_Testimonials_Widget::get_testimonials_css();
|
45 |
-
}
|
46 |
-
|
47 |
-
|
48 |
-
public static function get_testimonials_scripts() {
|
49 |
-
Axl_Testimonials_Widget::get_testimonials_scripts();
|
50 |
-
}
|
51 |
-
|
52 |
-
|
53 |
-
public static function get_defaults() {
|
54 |
-
return Axl_Testimonials_Widget::get_defaults();
|
55 |
-
}
|
56 |
-
|
57 |
-
|
58 |
-
public static function get_content( $instance = null, $widget_number = null ) {
|
59 |
-
return Axl_Testimonials_Widget::testimonials_slider( $instance, $widget_number );
|
60 |
-
}
|
61 |
-
|
62 |
-
|
63 |
-
public static function form_instance( $instance ) {
|
64 |
-
$do_number = true;
|
65 |
-
if ( empty( $instance ) ) {
|
66 |
-
$do_number = false;
|
67 |
-
|
68 |
-
$instance['char_limit'] = 500;
|
69 |
-
$instance['random'] = 1;
|
70 |
-
} elseif ( ! empty( $instance['resetted'] ) ) {
|
71 |
-
if ( empty( $instance['char_limit'] ) ) {
|
72 |
-
$instance['char_limit'] = 500;
|
73 |
-
}
|
74 |
-
|
75 |
-
if ( empty( $instance['random'] ) ) {
|
76 |
-
$instance['random'] = 1;
|
77 |
-
}
|
78 |
-
}
|
79 |
-
|
80 |
-
$instance['do_number'] = $do_number;
|
81 |
-
|
82 |
-
return $instance;
|
83 |
-
}
|
84 |
-
|
85 |
-
|
86 |
-
public static function form_parts( $instance = null, $number = null ) {
|
87 |
-
$form_parts = Axl_Testimonials_Widget_Settings::get_settings();
|
88 |
-
|
89 |
-
if ( ! empty( $instance['do_number'] ) ) {
|
90 |
-
$std = ' .' . Axl_Testimonials_Widget::ID . $number;
|
91 |
-
|
92 |
-
$form_parts['css_class'] = array(
|
93 |
-
'section' => 'widget',
|
94 |
-
'type' => 'readonly',
|
95 |
-
'title' => esc_html__( 'CSS Class', 'testimonials-widget' ),
|
96 |
-
'desc' => esc_html__( 'This widget\'s unique CSS class for styling', 'testimonials-widget' ),
|
97 |
-
'std' => $std,
|
98 |
-
'widget' => 1,
|
99 |
-
);
|
100 |
-
}
|
101 |
-
|
102 |
-
$form_parts = apply_filters( 'tw_slider_widget_options', $form_parts );
|
103 |
-
|
104 |
-
return $form_parts;
|
105 |
-
}
|
106 |
-
|
107 |
-
|
108 |
-
public static function get_suggest( $id, $suggest_id ) {
|
109 |
-
return Axl_Testimonials_Widget_Settings::get_suggest( $id, $suggest_id );
|
110 |
-
}
|
111 |
-
}
|
112 |
-
|
113 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/class-testimonials-widget-tag-cloud-widget.php
DELETED
@@ -1,95 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
Testimonials Widget
|
4 |
-
Copyright (C) 2015 Axelerant
|
5 |
-
|
6 |
-
This program is free software; you can redistribute it and/or modify
|
7 |
-
it under the terms of the GNU General Public License as published by
|
8 |
-
the Free Software Foundation; either version 2 of the License, or
|
9 |
-
(at your option) any later version.
|
10 |
-
|
11 |
-
This program is distributed in the hope that it will be useful,
|
12 |
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 |
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14 |
-
GNU General Public License for more details.
|
15 |
-
|
16 |
-
You should have received a copy of the GNU General Public License along
|
17 |
-
with this program; if not, write to the Free Software Foundation, Inc.,
|
18 |
-
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
19 |
-
*/
|
20 |
-
|
21 |
-
require_once AIHR_DIR_INC . 'class-aihrus-widget.php';
|
22 |
-
|
23 |
-
if ( class_exists( 'Axl_Testimonials_Widget_Tag_Cloud_Widget' ) ) {
|
24 |
-
return;
|
25 |
-
}
|
26 |
-
|
27 |
-
|
28 |
-
class Axl_Testimonials_Widget_Tag_Cloud_Widget extends Aihrus_Widget {
|
29 |
-
const ID = 'tw_tag_cloud_widget';
|
30 |
-
|
31 |
-
public static $title;
|
32 |
-
|
33 |
-
|
34 |
-
public function __construct() {
|
35 |
-
$classname = __CLASS__;
|
36 |
-
$description = esc_html__( 'A cloud of your most used testimonials\' tags.', 'testimonials-widget' );
|
37 |
-
$id_base = self::ID;
|
38 |
-
self::$title = esc_html__( 'Testimonials Tag Cloud', 'testimonials-widget' );
|
39 |
-
|
40 |
-
parent::__construct( $classname, $description, $id_base, self::$title );
|
41 |
-
}
|
42 |
-
|
43 |
-
|
44 |
-
/**
|
45 |
-
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
46 |
-
*/
|
47 |
-
public static function get_content( $instance = null, $widget_number = null ) {
|
48 |
-
return Axl_Testimonials_Widget::testimonials_tag_cloud( $instance, $widget_number );
|
49 |
-
}
|
50 |
-
|
51 |
-
|
52 |
-
/**
|
53 |
-
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
54 |
-
*/
|
55 |
-
public static function form_parts( $instance = null, $number = null ) {
|
56 |
-
$form_parts = parent::form_parts( $instance, $number );
|
57 |
-
|
58 |
-
$form_parts['title']['std'] = self::$title;
|
59 |
-
|
60 |
-
$use_cpt_taxonomy = tw_get_option( 'use_cpt_taxonomy', false );
|
61 |
-
if ( ! $use_cpt_taxonomy ) {
|
62 |
-
$options = array(
|
63 |
-
'category' => esc_html__( 'Category', 'testimonials-widget' ),
|
64 |
-
'post_tag' => esc_html__( 'Tags', 'testimonials-widget' ),
|
65 |
-
);
|
66 |
-
|
67 |
-
$std = 'post_tag';
|
68 |
-
} else {
|
69 |
-
$options = array(
|
70 |
-
Axl_Testimonials_Widget::$cpt_category => esc_html__( 'Category', 'testimonials-widget' ),
|
71 |
-
Axl_Testimonials_Widget::$cpt_tags => esc_html__( 'Tags', 'testimonials-widget' ),
|
72 |
-
);
|
73 |
-
|
74 |
-
$std = Axl_Testimonials_Widget::$cpt_tags;
|
75 |
-
}
|
76 |
-
|
77 |
-
$form_parts['taxonomy'] = array(
|
78 |
-
'title' => esc_html__( 'Taxonomy', 'testimonials-widget' ),
|
79 |
-
'type' => 'select',
|
80 |
-
'choices' => $options,
|
81 |
-
'std' => $std,
|
82 |
-
);
|
83 |
-
|
84 |
-
foreach ( $form_parts as $id => $parts ) {
|
85 |
-
$form_parts[ $id ] = wp_parse_args( $parts, self::$default );
|
86 |
-
}
|
87 |
-
|
88 |
-
$form_parts = apply_filters( 'tw_tag_cloud_widget_options', $form_parts );
|
89 |
-
|
90 |
-
return $form_parts;
|
91 |
-
}
|
92 |
-
}
|
93 |
-
|
94 |
-
|
95 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/class-testimonials-widget-template-loader.php
DELETED
@@ -1,45 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
Testimonials Widget
|
4 |
-
Copyright (C) 2015 Axelerant
|
5 |
-
|
6 |
-
This program is free software; you can redistribute it and/or modify
|
7 |
-
it under the terms of the GNU General Public License as published by
|
8 |
-
the Free Software Foundation; either version 2 of the License, or
|
9 |
-
(at your option) any later version.
|
10 |
-
|
11 |
-
This program is distributed in the hope that it will be useful,
|
12 |
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 |
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14 |
-
GNU General Public License for more details.
|
15 |
-
|
16 |
-
You should have received a copy of the GNU General Public License along
|
17 |
-
with this program; if not, write to the Free Software Foundation, Inc.,
|
18 |
-
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
19 |
-
*/
|
20 |
-
|
21 |
-
/**
|
22 |
-
* Testimonials template loader class
|
23 |
-
*
|
24 |
-
* @ref https://github.com/GaryJones/Gamajo-Template-Loader
|
25 |
-
*/
|
26 |
-
|
27 |
-
require_once TW_DIR_LIB . 'Gamajo-Template-Loader/class-gamajo-template-loader.php';
|
28 |
-
|
29 |
-
if ( class_exists( 'Axl_Testimonials_Widget_Template_Loader' ) ) {
|
30 |
-
return;
|
31 |
-
}
|
32 |
-
|
33 |
-
|
34 |
-
/**
|
35 |
-
*
|
36 |
-
*
|
37 |
-
* @SuppressWarnings(PHPMD.LongVariable)
|
38 |
-
*/
|
39 |
-
class Axl_Testimonials_Widget_Template_Loader extends Gamajo_Template_Loader {
|
40 |
-
protected $filter_prefix = 'testimonials_widget';
|
41 |
-
protected $theme_template_directory = 'testimonials-widget';
|
42 |
-
protected $plugin_directory = TW_DIR;
|
43 |
-
}
|
44 |
-
|
45 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/class-testimonials-widget-widget.php
DELETED
@@ -1,117 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/*
|
3 |
-
Copyright 2014 Michael Cannon (email: mc@aihr.us)
|
4 |
-
|
5 |
-
This program is free software; you can redistribute it and/or modify
|
6 |
-
it under the terms of the GNU General Public License, version 2, as
|
7 |
-
published by the Free Software Foundation.
|
8 |
-
|
9 |
-
This program is distributed in the hope that it will be useful,
|
10 |
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11 |
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12 |
-
GNU General Public License for more details.
|
13 |
-
|
14 |
-
You should have received a copy of the GNU General Public License
|
15 |
-
along with this program; if not, write to the Free Software
|
16 |
-
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
17 |
-
*/
|
18 |
-
|
19 |
-
require_once AIHR_DIR_INC . 'class-aihrus-widget.php';
|
20 |
-
|
21 |
-
if ( class_exists( 'Testimonials_Widget_Widget' ) )
|
22 |
-
return;
|
23 |
-
|
24 |
-
|
25 |
-
class Testimonials_Widget_Widget extends Aihrus_Widget {
|
26 |
-
const ID = 'testimonials_widget';
|
27 |
-
|
28 |
-
public function __construct( $classname = null, $description = null, $id_base = null, $title = null ) {
|
29 |
-
$classname = 'Testimonials_Widget_Widget';
|
30 |
-
$description = esc_html__( 'Display testimonials with multiple selection and display options', 'testimonials-widget' );
|
31 |
-
$id_base = self::ID;
|
32 |
-
$title = esc_html__( 'Testimonials', 'testimonials-widget' );
|
33 |
-
|
34 |
-
parent::__construct( $classname, $description, $id_base, $title );
|
35 |
-
}
|
36 |
-
|
37 |
-
|
38 |
-
public static function get_testimonials_css() {
|
39 |
-
Testimonials_Widget::get_testimonials_css();
|
40 |
-
}
|
41 |
-
|
42 |
-
|
43 |
-
public static function get_testimonials_scripts() {
|
44 |
-
Testimonials_Widget::get_testimonials_scripts();
|
45 |
-
}
|
46 |
-
|
47 |
-
|
48 |
-
public static function get_defaults() {
|
49 |
-
return Testimonials_Widget::get_defaults();
|
50 |
-
}
|
51 |
-
|
52 |
-
|
53 |
-
public static function get_content( $instance, $widget_number ) {
|
54 |
-
return Testimonials_Widget::testimonials_slider( $instance, $widget_number );
|
55 |
-
}
|
56 |
-
|
57 |
-
|
58 |
-
public static function validate_settings( $instance ) {
|
59 |
-
return Testimonials_Widget_Settings::validate_settings( $instance );
|
60 |
-
}
|
61 |
-
|
62 |
-
|
63 |
-
public static function form_instance( $instance ) {
|
64 |
-
$do_number = true;
|
65 |
-
if ( empty( $instance ) ) {
|
66 |
-
$do_number = false;
|
67 |
-
|
68 |
-
$instance['char_limit'] = 500;
|
69 |
-
$instance['random'] = 1;
|
70 |
-
$instance['enable_schema'] = 0;
|
71 |
-
} elseif ( ! empty( $instance['resetted'] ) ) {
|
72 |
-
if ( empty( $instance['char_limit'] ) )
|
73 |
-
$instance['char_limit'] = 500;
|
74 |
-
|
75 |
-
if ( empty( $instance['random'] ) )
|
76 |
-
$instance['random'] = 1;
|
77 |
-
|
78 |
-
$instance['enable_schema'] = 0;
|
79 |
-
}
|
80 |
-
|
81 |
-
$instance['do_number'] = $do_number;
|
82 |
-
|
83 |
-
return $instance;
|
84 |
-
}
|
85 |
-
|
86 |
-
|
87 |
-
public static function form_parts( $instance, $number ) {
|
88 |
-
$form_parts = Testimonials_Widget_Settings::get_settings();
|
89 |
-
|
90 |
-
if ( ! empty( $instance['do_number'] ) ) {
|
91 |
-
$std = ' .' . Testimonials_Widget::ID . $number;
|
92 |
-
|
93 |
-
$form_parts['css_class'] = array(
|
94 |
-
'section' => 'widget',
|
95 |
-
'type' => 'readonly',
|
96 |
-
'title' => esc_html__( 'CSS Class', 'testimonials-widget' ),
|
97 |
-
'desc' => esc_html__( 'This widget\'s unique CSS class for styling', 'testimonials-widget' ),
|
98 |
-
'std' => $std,
|
99 |
-
'widget' => 1,
|
100 |
-
);
|
101 |
-
}
|
102 |
-
|
103 |
-
$form_parts = apply_filters( 'testimonials_widget_widget_options', $form_parts );
|
104 |
-
|
105 |
-
return $form_parts;
|
106 |
-
}
|
107 |
-
|
108 |
-
|
109 |
-
public static function get_suggest( $id, $suggest_id ) {
|
110 |
-
return Testimonials_Widget_Settings::get_suggest( $id, $suggest_id );
|
111 |
-
}
|
112 |
-
|
113 |
-
|
114 |
-
}
|
115 |
-
|
116 |
-
|
117 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/class-testimonials-widget.php
DELETED
@@ -1,2416 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
Testimonials Widget
|
4 |
-
Copyright (C) 2015 Axelerant
|
5 |
-
|
6 |
-
This program is free software; you can redistribute it and/or modify
|
7 |
-
it under the terms of the GNU General Public License as published by
|
8 |
-
the Free Software Foundation; either version 2 of the License, or
|
9 |
-
(at your option) any later version.
|
10 |
-
|
11 |
-
This program is distributed in the hope that it will be useful,
|
12 |
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 |
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14 |
-
GNU General Public License for more details.
|
15 |
-
|
16 |
-
You should have received a copy of the GNU General Public License along
|
17 |
-
with this program; if not, write to the Free Software Foundation, Inc.,
|
18 |
-
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
19 |
-
*/
|
20 |
-
|
21 |
-
require_once AIHR_DIR_INC . 'class-aihrus-common.php';
|
22 |
-
require_once AIHR_DIR_LIB . 'class-redrokk-metabox-class.php';
|
23 |
-
require_once TW_DIR_INC . 'class-testimonials-widget-archives-widget.php';
|
24 |
-
require_once TW_DIR_INC . 'class-testimonials-widget-categories-widget.php';
|
25 |
-
require_once TW_DIR_INC . 'class-testimonials-widget-recent-testimonials-widget.php';
|
26 |
-
require_once TW_DIR_INC . 'class-testimonials-widget-settings.php';
|
27 |
-
require_once TW_DIR_INC . 'class-testimonials-widget-slider-widget.php';
|
28 |
-
require_once TW_DIR_INC . 'class-testimonials-widget-tag-cloud-widget.php';
|
29 |
-
require_once TW_DIR_INC . 'class-testimonials-widget-template-loader.php';
|
30 |
-
|
31 |
-
if ( class_exists( 'Axl_Testimonials_Widget' ) ) {
|
32 |
-
return;
|
33 |
-
}
|
34 |
-
|
35 |
-
|
36 |
-
class Axl_Testimonials_Widget extends Aihrus_Common {
|
37 |
-
const BASE = TW_BASE;
|
38 |
-
const ID = 'testimonials-widget-testimonials';
|
39 |
-
const SLUG = 'tw_';
|
40 |
-
const VERSION = TW_VERSION;
|
41 |
-
|
42 |
-
const PT = 'testimonials-widget';
|
43 |
-
const NOTICE_KEY = 'tw_schema_notice';
|
44 |
-
|
45 |
-
public static $class = __CLASS__;
|
46 |
-
public static $cpt_category;
|
47 |
-
public static $cpt_tags;
|
48 |
-
public static $css = array();
|
49 |
-
public static $css_called = false;
|
50 |
-
public static $instance_number = 0;
|
51 |
-
public static $instance_widget = 0;
|
52 |
-
public static $library_assets;
|
53 |
-
public static $max_num_pages = 0;
|
54 |
-
public static $menu_shortcodes;
|
55 |
-
public static $notice_key;
|
56 |
-
public static $not_found = false;
|
57 |
-
public static $plugin_assets;
|
58 |
-
public static $post_count = 0;
|
59 |
-
public static $scripts = array();
|
60 |
-
public static $settings_link;
|
61 |
-
public static $tag_close_quote = '<span class="close-quote"></span>';
|
62 |
-
public static $tag_open_quote = '<span class="open-quote"></span>';
|
63 |
-
public static $template_loader;
|
64 |
-
public static $use_instance = false;
|
65 |
-
public static $widget_number = 100000;
|
66 |
-
public static $wp_query;
|
67 |
-
|
68 |
-
public static $aggregate_count = 'ratingCount';
|
69 |
-
public static $aggregate_data = array();
|
70 |
-
public static $aggregate_no_item = '__NO_ITEM__';
|
71 |
-
public static $aggregate_rating = 'aggregateRating';
|
72 |
-
public static $aggregate_review = 'reviewCount';
|
73 |
-
public static $aggregate_schema = 'http://schema.org/AggregateRating';
|
74 |
-
|
75 |
-
public static $rating_max = 5;
|
76 |
-
public static $rating_value = 'ratingValue';
|
77 |
-
|
78 |
-
public static $cw_author = 'author';
|
79 |
-
public static $cw_date = 'datePublished';
|
80 |
-
public static $cw_date_mod = 'dateModified';
|
81 |
-
public static $cw_review = 'review';
|
82 |
-
public static $cw_source_org = 'sourceOrganization';
|
83 |
-
|
84 |
-
public static $org_location = 'location';
|
85 |
-
public static $org_schema = 'http://schema.org/Organization';
|
86 |
-
|
87 |
-
public static $person_email = 'email';
|
88 |
-
public static $person_home = 'homeLocation';
|
89 |
-
public static $person_job_title = 'jobTitle';
|
90 |
-
public static $person_schema = 'http://schema.org/Person';
|
91 |
-
public static $person_member = 'memberOf';
|
92 |
-
|
93 |
-
public static $place_schema = 'http://schema.org/Place';
|
94 |
-
|
95 |
-
public static $review_body = 'reviewBody';
|
96 |
-
public static $review_item = 'itemReviewed';
|
97 |
-
public static $review_schema = 'http://schema.org/Review';
|
98 |
-
|
99 |
-
public static $schema_div_open = '<div itemscope itemtype="%1$s">';
|
100 |
-
public static $schema_div_prop = '<div itemprop="%1$s" itemscope itemtype="%2$s">%3$s</div>';
|
101 |
-
public static $schema_item_prop = 'itemprop="%1$s"';
|
102 |
-
public static $schema_meta = '<meta itemprop="%1$s" content="%2$s" />';
|
103 |
-
|
104 |
-
public static $thing_image = 'image';
|
105 |
-
public static $thing_name = 'name';
|
106 |
-
public static $thing_schema = 'http://schema.org/Thing';
|
107 |
-
public static $thing_url = 'url';
|
108 |
-
|
109 |
-
|
110 |
-
public function __construct() {
|
111 |
-
parent::__construct();
|
112 |
-
|
113 |
-
self::$library_assets = plugins_url( '/includes/libraries/', dirname( __FILE__ ) );
|
114 |
-
self::$library_assets = self::strip_protocol( self::$library_assets );
|
115 |
-
|
116 |
-
self::$plugin_assets = plugins_url( '/assets/', dirname( __FILE__ ) );
|
117 |
-
self::$plugin_assets = self::strip_protocol( self::$plugin_assets );
|
118 |
-
|
119 |
-
add_action( 'admin_init', array( __CLASS__, 'admin_init' ) );
|
120 |
-
add_action( 'admin_menu', array( __CLASS__, 'admin_menu' ) );
|
121 |
-
add_action( 'admin_notices', array( __CLASS__, 'notice_schema' ) );
|
122 |
-
add_action( 'admin_enqueue_scripts', array( __CLASS__, 'admin_scripts' ) );
|
123 |
-
add_action( 'wp_ajax_tw_schema_notice', array( __CLASS__, 'dismiss_schema_notice' ) );
|
124 |
-
add_action( 'dashboard_glance_items', array( __CLASS__, 'dashboard_glance_items' ) );
|
125 |
-
add_action( 'init', array( __CLASS__, 'init' ) );
|
126 |
-
add_action( 'widgets_init', array( __CLASS__, 'widgets_init' ) );
|
127 |
-
add_shortcode( 'testimonials', array( __CLASS__, 'testimonials' ) );
|
128 |
-
add_shortcode( 'testimonialswidget_list', array( __CLASS__, 'testimonials' ) );
|
129 |
-
add_shortcode( 'testimonialswidget_widget', array( __CLASS__, 'testimonials_slider' ) );
|
130 |
-
add_shortcode( 'testimonials_archives', array( __CLASS__, 'testimonials_archives' ) );
|
131 |
-
add_shortcode( 'testimonials_categories', array( __CLASS__, 'testimonials_categories' ) );
|
132 |
-
add_shortcode( 'testimonials_examples', array( __CLASS__, 'testimonials_examples' ) );
|
133 |
-
add_shortcode( 'testimonials_options', array( __CLASS__, 'testimonials_options' ) );
|
134 |
-
add_shortcode( 'testimonials_recent', array( __CLASS__, 'testimonials_recent' ) );
|
135 |
-
add_shortcode( 'testimonials_slider', array( __CLASS__, 'testimonials_slider' ) );
|
136 |
-
add_shortcode( 'testimonials_tag_cloud', array( __CLASS__, 'testimonials_tag_cloud' ) );
|
137 |
-
}
|
138 |
-
|
139 |
-
|
140 |
-
public static function admin_init() {
|
141 |
-
self::support_thumbnails();
|
142 |
-
|
143 |
-
self::$settings_link = '<a href="' . get_admin_url() . 'edit.php?post_type=' . self::PT . '&page=' . Axl_Testimonials_Widget_Settings::ID . '">' . esc_html__( 'Settings', 'testimonials-widget' ) . '</a>';
|
144 |
-
|
145 |
-
self::add_meta_box_testimonials_widget();
|
146 |
-
self::update();
|
147 |
-
|
148 |
-
add_action( 'manage_' . self::PT . '_posts_custom_column', array( __CLASS__, 'manage_posts_custom_column' ), 10, 2 );
|
149 |
-
add_action( 'right_now_content_table_end', array( __CLASS__, 'right_now_content_table_end' ) );
|
150 |
-
add_filter( 'manage_' . self::PT . '_posts_columns', array( __CLASS__, 'manage_posts_columns' ) );
|
151 |
-
add_filter( 'plugin_action_links', array( __CLASS__, 'plugin_action_links' ), 10, 2 );
|
152 |
-
add_filter( 'plugin_row_meta', array( __CLASS__, 'plugin_row_meta' ), 10, 2 );
|
153 |
-
add_filter( 'post_updated_messages', array( __CLASS__, 'post_updated_messages' ) );
|
154 |
-
add_filter( 'pre_get_posts', array( __CLASS__, 'pre_get_posts_author' ) );
|
155 |
-
|
156 |
-
if ( self::do_load() ) {
|
157 |
-
add_filter( 'manage_' . self::PT . '-category_custom_column', array( __CLASS__, 'category_column' ), 10, 3 );
|
158 |
-
add_filter( 'manage_' . self::PT . '-post_tag_custom_column', array( __CLASS__, 'post_tag_column' ), 10, 3 );
|
159 |
-
add_filter( 'manage_category_custom_column', array( __CLASS__, 'category_column' ), 10, 3 );
|
160 |
-
add_filter( 'manage_edit-' . self::PT . '-category_columns', array( __CLASS__, 'category_columns' ) );
|
161 |
-
add_filter( 'manage_edit-' . self::PT . '-post_tag_columns', array( __CLASS__, 'category_columns' ) );
|
162 |
-
add_filter( 'manage_edit-category_columns', array( __CLASS__, 'category_columns' ) );
|
163 |
-
add_filter( 'manage_edit-post_tag_columns', array( __CLASS__, 'category_columns' ) );
|
164 |
-
add_filter( 'manage_post_tag_custom_column', array( __CLASS__, 'post_tag_column' ), 10, 3 );
|
165 |
-
}
|
166 |
-
}
|
167 |
-
|
168 |
-
|
169 |
-
public static function admin_menu() {
|
170 |
-
}
|
171 |
-
|
172 |
-
|
173 |
-
public static function init() {
|
174 |
-
add_filter( 'the_content', array( __CLASS__, 'get_single' ) );
|
175 |
-
$enable_archives = tw_get_option( 'enable_archives' );
|
176 |
-
if ( $enable_archives ) {
|
177 |
-
add_filter( 'pre_get_posts', array( __CLASS__, 'pre_get_posts_allow_testimonials' ) );
|
178 |
-
}
|
179 |
-
|
180 |
-
load_plugin_textdomain( self::PT, false, 'testimonials-widget/languages' );
|
181 |
-
|
182 |
-
self::$cpt_category = self::PT . '-category';
|
183 |
-
self::$cpt_tags = self::PT . '-post_tag';
|
184 |
-
|
185 |
-
self::init_post_type();
|
186 |
-
self::styles();
|
187 |
-
|
188 |
-
add_action( 'generate_rewrite_rules', array( __CLASS__, 'generate_rewrite_rules' ) );
|
189 |
-
}
|
190 |
-
|
191 |
-
|
192 |
-
public static function plugin_action_links( $links, $file ) {
|
193 |
-
if ( self::BASE == $file ) {
|
194 |
-
array_unshift( $links, self::$settings_link );
|
195 |
-
}
|
196 |
-
|
197 |
-
return $links;
|
198 |
-
}
|
199 |
-
|
200 |
-
|
201 |
-
public static function add_instance() {
|
202 |
-
self::$use_instance = false;
|
203 |
-
self::$instance_number++;
|
204 |
-
|
205 |
-
return self::$instance_number;
|
206 |
-
}
|
207 |
-
|
208 |
-
|
209 |
-
public static function get_instance() {
|
210 |
-
return self::$use_instance ? self::$instance_number : self::$instance_widget;
|
211 |
-
}
|
212 |
-
|
213 |
-
|
214 |
-
public static function set_instance( $widget_number ) {
|
215 |
-
self::$use_instance = true;
|
216 |
-
self::$instance_widget = $widget_number;
|
217 |
-
}
|
218 |
-
|
219 |
-
|
220 |
-
public static function support_thumbnails() {
|
221 |
-
$feature = 'post-thumbnails';
|
222 |
-
$feature_level = get_theme_support( $feature );
|
223 |
-
|
224 |
-
if ( true === $feature_level ) {
|
225 |
-
// already enabled for all post types
|
226 |
-
return;
|
227 |
-
} elseif ( false === $feature_level ) {
|
228 |
-
// none allowed, only enable for our own
|
229 |
-
add_theme_support( $feature, array( self::PT ) );
|
230 |
-
} else {
|
231 |
-
// add our own to list of supported
|
232 |
-
$feature_level[0][] = self::PT;
|
233 |
-
add_theme_support( $feature, $feature_level[0] );
|
234 |
-
}
|
235 |
-
}
|
236 |
-
|
237 |
-
|
238 |
-
public static function get_single( $content ) {
|
239 |
-
global $post;
|
240 |
-
|
241 |
-
if ( ! is_single() || self::PT != $post->post_type ) {
|
242 |
-
return $content;
|
243 |
-
}
|
244 |
-
|
245 |
-
$atts = self::get_defaults( true );
|
246 |
-
$atts['hide_content'] = 1;
|
247 |
-
$atts['ids'] = $post->ID;
|
248 |
-
$atts['type'] = 'get_single';
|
249 |
-
|
250 |
-
$instance = self::add_instance();
|
251 |
-
$atts['widget_number'] = $instance;
|
252 |
-
|
253 |
-
$testimonials = array();
|
254 |
-
|
255 |
-
$text = apply_filters( 'tw_cache_get', false, $atts );
|
256 |
-
if ( false === $text ) {
|
257 |
-
$testimonials = self::get_testimonials( $atts );
|
258 |
-
$testimonial = $testimonials[0];
|
259 |
-
|
260 |
-
$details = self::get_testimonial_html( $testimonial, $atts );
|
261 |
-
$details = apply_filters( 'tw_testimonial_html_single', $details, $testimonial, $atts );
|
262 |
-
|
263 |
-
$content = self::do_video( $content, $atts );
|
264 |
-
$content = apply_filters( 'tw_testimonial_html_single_content', $content, $testimonial, $atts );
|
265 |
-
|
266 |
-
$text = $content . $details;
|
267 |
-
$text = apply_filters( 'tw_cache_set', $text, $atts );
|
268 |
-
}
|
269 |
-
|
270 |
-
self::call_scripts_styles( $testimonials, $atts, $instance );
|
271 |
-
|
272 |
-
return $text;
|
273 |
-
}
|
274 |
-
|
275 |
-
|
276 |
-
public static function activation() {
|
277 |
-
if ( ! current_user_can( 'activate_plugins' ) ) {
|
278 |
-
return;
|
279 |
-
}
|
280 |
-
|
281 |
-
self::init();
|
282 |
-
tw_init_options();
|
283 |
-
flush_rewrite_rules();
|
284 |
-
}
|
285 |
-
|
286 |
-
|
287 |
-
public static function deactivation() {
|
288 |
-
if ( ! current_user_can( 'activate_plugins' ) ) {
|
289 |
-
return;
|
290 |
-
}
|
291 |
-
|
292 |
-
self::reset_schema_notice();
|
293 |
-
flush_rewrite_rules();
|
294 |
-
}
|
295 |
-
|
296 |
-
|
297 |
-
public static function uninstall() {
|
298 |
-
if ( ! current_user_can( 'activate_plugins' ) ) {
|
299 |
-
return;
|
300 |
-
}
|
301 |
-
|
302 |
-
global $wpdb;
|
303 |
-
|
304 |
-
require_once TW_DIR_INC . 'class-testimonials-widget-settings.php';
|
305 |
-
|
306 |
-
$delete_data = tw_get_option( 'delete_data', false );
|
307 |
-
if ( $delete_data ) {
|
308 |
-
delete_option( Axl_Testimonials_Widget_Settings::ID );
|
309 |
-
$wpdb->query( 'OPTIMIZE TABLE `' . $wpdb->options . '`' );
|
310 |
-
|
311 |
-
self::reset_schema_notice();
|
312 |
-
self::delete_testimonials();
|
313 |
-
}
|
314 |
-
}
|
315 |
-
|
316 |
-
|
317 |
-
public static function delete_testimonials() {
|
318 |
-
global $wpdb;
|
319 |
-
|
320 |
-
$query = "SELECT ID FROM {$wpdb->posts} WHERE post_type = '" . self::PT . "'";
|
321 |
-
$posts = $wpdb->get_results( $query );
|
322 |
-
|
323 |
-
foreach ( $posts as $post ) {
|
324 |
-
$post_id = $post->ID;
|
325 |
-
self::delete_attachments( $post_id );
|
326 |
-
|
327 |
-
// dels post, meta & comments
|
328 |
-
// true is force delete
|
329 |
-
wp_delete_post( $post_id, true );
|
330 |
-
}
|
331 |
-
|
332 |
-
$wpdb->query( 'OPTIMIZE TABLE `' . $wpdb->postmeta . '`' );
|
333 |
-
$wpdb->query( 'OPTIMIZE TABLE `' . $wpdb->posts . '`' );
|
334 |
-
}
|
335 |
-
|
336 |
-
|
337 |
-
public static function delete_attachments( $post_id = false ) {
|
338 |
-
global $wpdb;
|
339 |
-
|
340 |
-
$post_id = $post_id ? $post_id : 0;
|
341 |
-
$query = "SELECT ID FROM {$wpdb->posts} WHERE post_type = 'attachment' AND post_parent = {$post_id}";
|
342 |
-
$attachments = $wpdb->get_results( $query );
|
343 |
-
|
344 |
-
foreach ( $attachments as $attachment ) {
|
345 |
-
// true is force delete
|
346 |
-
wp_delete_attachment( $attachment->ID, true );
|
347 |
-
}
|
348 |
-
}
|
349 |
-
|
350 |
-
|
351 |
-
public static function plugin_row_meta( $input, $file ) {
|
352 |
-
if ( self::BASE != $file ) {
|
353 |
-
return $input;
|
354 |
-
}
|
355 |
-
|
356 |
-
$disable_donate = tw_get_option( 'disable_donate' );
|
357 |
-
if ( $disable_donate ) {
|
358 |
-
return $input;
|
359 |
-
}
|
360 |
-
|
361 |
-
$links = array(
|
362 |
-
self::$donate_link,
|
363 |
-
);
|
364 |
-
|
365 |
-
global $TW_Premium;
|
366 |
-
if ( ! isset( $TW_Premium ) ) {
|
367 |
-
$links[] = TW_PREMIUM_LINK;
|
368 |
-
}
|
369 |
-
|
370 |
-
$input = array_merge( $input, $links );
|
371 |
-
|
372 |
-
return $input;
|
373 |
-
}
|
374 |
-
|
375 |
-
|
376 |
-
public static function notice_2_12_0() {
|
377 |
-
$text = sprintf( __( 'If your Testimonials display has gone to funky town, please <a href="%s">read the FAQ</a> about possible CSS fixes.', 'testimonials-widget' ), esc_url( 'https://nodedesk.zendesk.com/hc/en-us/articles/202244392-Major-Changes-Since-2-10-0' ) );
|
378 |
-
|
379 |
-
aihr_notice_updated( $text );
|
380 |
-
}
|
381 |
-
|
382 |
-
|
383 |
-
/**
|
384 |
-
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
385 |
-
*/
|
386 |
-
public static function notice_donate( $disable_donate = null, $item_name = null ) {
|
387 |
-
$disable_donate = tw_get_option( 'disable_donate' );
|
388 |
-
|
389 |
-
parent::notice_donate( $disable_donate, TW_NAME );
|
390 |
-
}
|
391 |
-
|
392 |
-
|
393 |
-
public static function notice_schema() {
|
394 |
-
$notice_set = get_option( self::NOTICE_KEY );
|
395 |
-
|
396 |
-
if ( empty( $notice_set ) ) {
|
397 |
-
$settings_link = get_admin_url() . 'edit.php?post_type=' . self::PT . '&page=' . Axl_Testimonials_Widget_Settings::ID;
|
398 |
-
|
399 |
-
$text = sprintf( __( TW_NAME . ' uses <a href="http://schema.org/Review" target="_blank">Review schema</a> markup for the testimonials. A recent move by Google <a href="https://www.seroundtable.com/google-takes-action-on-flight-rich-snippet-markup-22029.html" target="_blank">may penalize your website for using improper schema snippets</a>. We recommend you <a href="%s">disable the Review schema</a> in settings.', 'testimonials-widget' ), esc_url( $settings_link ) );
|
400 |
-
|
401 |
-
$notice_content = '';
|
402 |
-
$notice_content .= '<div class="notice is-dismissible error twp-schema-notice"><p>';
|
403 |
-
$notice_content .= $text;
|
404 |
-
$notice_content .= '.</p></div>';
|
405 |
-
|
406 |
-
echo $notice_content;
|
407 |
-
}
|
408 |
-
}
|
409 |
-
|
410 |
-
|
411 |
-
/**
|
412 |
-
* @SuppressWarnings(PHPMD.Superglobals)
|
413 |
-
*/
|
414 |
-
public static function dismiss_schema_notice() {
|
415 |
-
$nonce = $_POST['nonce'];
|
416 |
-
|
417 |
-
if ( ! wp_verify_nonce( $nonce, 'tw_schema_notice' ) ) {
|
418 |
-
wp_die();
|
419 |
-
}
|
420 |
-
|
421 |
-
update_option( self::NOTICE_KEY, self::VERSION );
|
422 |
-
|
423 |
-
wp_die();
|
424 |
-
}
|
425 |
-
|
426 |
-
|
427 |
-
public static function reset_schema_notice() {
|
428 |
-
delete_option( self::NOTICE_KEY );
|
429 |
-
}
|
430 |
-
|
431 |
-
|
432 |
-
public static function update() {
|
433 |
-
$prior_version = tw_get_option( 'admin_notices' );
|
434 |
-
if ( $prior_version ) {
|
435 |
-
if ( $prior_version < '2.12.0' ) {
|
436 |
-
self::set_notice( 'notice_2_12_0' );
|
437 |
-
}
|
438 |
-
|
439 |
-
if ( $prior_version < '2.15.0' ) {
|
440 |
-
self::set_notice( 'notice_2_15_0' );
|
441 |
-
}
|
442 |
-
|
443 |
-
if ( $prior_version < self::VERSION ) {
|
444 |
-
tw_requirements_check( true );
|
445 |
-
tw_init_options();
|
446 |
-
self::reset_schema_notice();
|
447 |
-
self::init_post_type();
|
448 |
-
flush_rewrite_rules();
|
449 |
-
do_action( 'tw_update' );
|
450 |
-
}
|
451 |
-
|
452 |
-
tw_set_option( 'admin_notices' );
|
453 |
-
}
|
454 |
-
|
455 |
-
// display donate on major/minor version release
|
456 |
-
$donate_version = tw_get_option( 'donate_version', false );
|
457 |
-
if ( ! $donate_version || ( self::VERSION != $donate_version && preg_match( '#\.0$#', self::VERSION ) ) ) {
|
458 |
-
self::set_notice( 'notice_donate' );
|
459 |
-
tw_set_option( 'donate_version', self::VERSION );
|
460 |
-
}
|
461 |
-
}
|
462 |
-
|
463 |
-
|
464 |
-
public static function pre_get_posts_author( $query ) {
|
465 |
-
global $user_ID;
|
466 |
-
|
467 |
-
// author's and below
|
468 |
-
if ( $query->is_admin ) {
|
469 |
-
if ( empty( $query->is_main_query ) ) {
|
470 |
-
if ( $query->is_post_type_archive( self::PT ) ) {
|
471 |
-
if ( ! current_user_can( 'edit_others_posts' ) ) {
|
472 |
-
$query->set( 'post_author', $user_ID );
|
473 |
-
}
|
474 |
-
}
|
475 |
-
}
|
476 |
-
}
|
477 |
-
|
478 |
-
return $query;
|
479 |
-
}
|
480 |
-
|
481 |
-
|
482 |
-
public static function manage_posts_custom_column( $column, $post_id ) {
|
483 |
-
$result = false;
|
484 |
-
|
485 |
-
switch ( $column ) {
|
486 |
-
case 'id':
|
487 |
-
$result = $post_id;
|
488 |
-
break;
|
489 |
-
|
490 |
-
case 'shortcode':
|
491 |
-
$result = '[testimonials ids="';
|
492 |
-
$result .= $post_id;
|
493 |
-
$result .= '"]';
|
494 |
-
$result .= '<br />';
|
495 |
-
$result .= '[testimonials_slider ids="';
|
496 |
-
$result .= $post_id;
|
497 |
-
$result .= '"]';
|
498 |
-
break;
|
499 |
-
|
500 |
-
case 'testimonials-widget-author':
|
501 |
-
case 'testimonials-widget-company':
|
502 |
-
case 'testimonials-widget-location':
|
503 |
-
case 'testimonials-widget-title':
|
504 |
-
$result = get_post_meta( $post_id, $column, true );
|
505 |
-
break;
|
506 |
-
|
507 |
-
case 'testimonials-widget-email':
|
508 |
-
case 'testimonials-widget-url':
|
509 |
-
$url = get_post_meta( $post_id, $column, true );
|
510 |
-
if ( ! empty( $url ) && ! is_email( $url ) && 0 === preg_match( '#https?://#', $url ) ) {
|
511 |
-
$url = 'http://' . $url;
|
512 |
-
}
|
513 |
-
|
514 |
-
$result = make_clickable( $url );
|
515 |
-
break;
|
516 |
-
|
517 |
-
case 'thumbnail':
|
518 |
-
$email = get_post_meta( $post_id, 'testimonials-widget-email', true );
|
519 |
-
|
520 |
-
if ( has_post_thumbnail( $post_id ) ) {
|
521 |
-
$result = get_the_post_thumbnail( $post_id, 'thumbnail' );
|
522 |
-
} elseif ( is_email( $email ) ) {
|
523 |
-
$result = get_avatar( $email );
|
524 |
-
} else {
|
525 |
-
$result = false;
|
526 |
-
}
|
527 |
-
break;
|
528 |
-
|
529 |
-
case self::$cpt_category:
|
530 |
-
case self::$cpt_tags:
|
531 |
-
$terms = get_the_terms( $post_id, $column );
|
532 |
-
$result = '';
|
533 |
-
if ( ! empty( $terms ) ) {
|
534 |
-
$out = array();
|
535 |
-
foreach ( $terms as $term ) {
|
536 |
-
$out[] = '<a href="' . admin_url( 'edit-tags.php?action=edit&taxonomy=' . $column . '&tag_ID=' . $term->term_id . '&post_type=' . self::PT ) . '">' . $term->name . '</a>';
|
537 |
-
}
|
538 |
-
|
539 |
-
$result = join( ', ', $out );
|
540 |
-
}
|
541 |
-
break;
|
542 |
-
}
|
543 |
-
|
544 |
-
$result = apply_filters( 'tw_posts_custom_column', $result, $column, $post_id );
|
545 |
-
|
546 |
-
if ( $result ) {
|
547 |
-
echo $result;
|
548 |
-
}
|
549 |
-
}
|
550 |
-
|
551 |
-
|
552 |
-
public static function manage_posts_columns( $columns ) {
|
553 |
-
// order of keys matches column ordering
|
554 |
-
$columns = array(
|
555 |
-
'cb' => '<input type="checkbox" />',
|
556 |
-
'title' => esc_html__( 'Author', 'testimonials-widget' ),
|
557 |
-
'author' => esc_html__( 'Published by', 'testimonials-widget' ),
|
558 |
-
'date' => esc_html__( 'Date', 'testimonials-widget' ),
|
559 |
-
);
|
560 |
-
|
561 |
-
$use_cpt_taxonomy = tw_get_option( 'use_cpt_taxonomy', false );
|
562 |
-
if ( ! $use_cpt_taxonomy ) {
|
563 |
-
$columns['categories'] = esc_html__( 'Category', 'testimonials-widget' );
|
564 |
-
$columns['tags'] = esc_html__( 'Tags', 'testimonials-widget' );
|
565 |
-
} else {
|
566 |
-
$columns[ self::$cpt_category ] = esc_html__( 'Category', 'testimonials-widget' );
|
567 |
-
$columns[ self::$cpt_tags ] = esc_html__( 'Tags', 'testimonials-widget' );
|
568 |
-
}
|
569 |
-
|
570 |
-
$show_id = tw_get_option( 'columns_id' );
|
571 |
-
if ( empty( $show_id ) ) {
|
572 |
-
$columns['id'] = esc_html__( 'ID', 'testimonials-widget' );
|
573 |
-
}
|
574 |
-
|
575 |
-
$show_thumbnail = tw_get_option( 'columns_thumbnail' );
|
576 |
-
if ( empty( $show_thumbnail ) ) {
|
577 |
-
$columns['thumbnail'] = esc_html__( 'Image', 'testimonials-widget' );
|
578 |
-
}
|
579 |
-
|
580 |
-
$show_shortcode = tw_get_option( 'columns_shortcode' );
|
581 |
-
if ( empty( $show_shortcode ) ) {
|
582 |
-
$columns['shortcode'] = esc_html__( 'Shortcodes', 'testimonials-widget' );
|
583 |
-
}
|
584 |
-
|
585 |
-
$show_author = tw_get_option( 'columns_author' );
|
586 |
-
if ( empty( $show_author ) ) {
|
587 |
-
$columns['testimonials-widget-author'] = esc_html__( 'Author', 'testimonials-widget' );
|
588 |
-
}
|
589 |
-
|
590 |
-
$show_job_title = tw_get_option( 'columns_job_title' );
|
591 |
-
if ( empty( $show_job_title ) ) {
|
592 |
-
$columns['testimonials-widget-title'] = esc_html__( 'Job Title', 'testimonials-widget' );
|
593 |
-
}
|
594 |
-
|
595 |
-
$show_location = tw_get_option( 'columns_location' );
|
596 |
-
if ( empty( $show_location ) ) {
|
597 |
-
$columns['testimonials-widget-location'] = esc_html__( 'Location', 'testimonials-widget' );
|
598 |
-
}
|
599 |
-
|
600 |
-
$show_company = tw_get_option( 'columns_company' );
|
601 |
-
if ( empty( $show_company ) ) {
|
602 |
-
$columns['testimonials-widget-company'] = esc_html__( 'Company', 'testimonials-widget' );
|
603 |
-
}
|
604 |
-
|
605 |
-
$show_email = tw_get_option( 'columns_email' );
|
606 |
-
if ( empty( $show_email ) ) {
|
607 |
-
$columns['testimonials-widget-email'] = esc_html__( 'Email', 'testimonials-widget' );
|
608 |
-
}
|
609 |
-
|
610 |
-
$show_url = tw_get_option( 'columns_url' );
|
611 |
-
if ( empty( $show_url ) ) {
|
612 |
-
$columns['testimonials-widget-url'] = esc_html__( 'URL', 'testimonials-widget' );
|
613 |
-
}
|
614 |
-
|
615 |
-
$columns = apply_filters( 'tw_columns', $columns );
|
616 |
-
|
617 |
-
return $columns;
|
618 |
-
}
|
619 |
-
|
620 |
-
|
621 |
-
public static function init_post_type() {
|
622 |
-
$labels = array(
|
623 |
-
'add_new' => esc_html__( 'Add New', 'testimonials-widget' ),
|
624 |
-
'add_new_item' => esc_html__( 'Add New Testimonial', 'testimonials-widget' ),
|
625 |
-
'edit_item' => esc_html__( 'Edit Testimonial', 'testimonials-widget' ),
|
626 |
-
'name' => esc_html__( 'Testimonials', 'testimonials-widget' ),
|
627 |
-
'new_item' => esc_html__( 'Add New Testimonial', 'testimonials-widget' ),
|
628 |
-
'not_found' => esc_html__( 'No testimonials found', 'testimonials-widget' ),
|
629 |
-
'not_found_in_trash' => esc_html__( 'No testimonials found in Trash', 'testimonials-widget' ),
|
630 |
-
'parent_item_colon' => null,
|
631 |
-
'search_items' => esc_html__( 'Search Testimonials', 'testimonials-widget' ),
|
632 |
-
'singular_name' => esc_html__( 'Testimonial', 'testimonials-widget' ),
|
633 |
-
'view_item' => esc_html__( 'View Testimonial', 'testimonials-widget' ),
|
634 |
-
);
|
635 |
-
|
636 |
-
$supports = array(
|
637 |
-
'title',
|
638 |
-
'editor',
|
639 |
-
'thumbnail',
|
640 |
-
'publicize',
|
641 |
-
);
|
642 |
-
|
643 |
-
$allow_comments = tw_get_option( 'allow_comments', false );
|
644 |
-
if ( $allow_comments ) {
|
645 |
-
$supports[] = 'comments';
|
646 |
-
}
|
647 |
-
|
648 |
-
$has_archive = tw_get_option( 'has_archive', true );
|
649 |
-
$rewrite_slug = tw_get_option( 'rewrite_slug', 'testimonial' );
|
650 |
-
$use_cpt_taxonomy = tw_get_option( 'use_cpt_taxonomy', false );
|
651 |
-
|
652 |
-
// editor's and up
|
653 |
-
if ( current_user_can( 'edit_others_posts' ) ) {
|
654 |
-
$supports[] = 'author';
|
655 |
-
}
|
656 |
-
|
657 |
-
if ( ! $use_cpt_taxonomy ) {
|
658 |
-
$do_register_taxonomy = false;
|
659 |
-
$taxonomies = array(
|
660 |
-
'category',
|
661 |
-
'post_tag',
|
662 |
-
);
|
663 |
-
} else {
|
664 |
-
$do_register_taxonomy = true;
|
665 |
-
$taxonomies = array(
|
666 |
-
self::$cpt_category,
|
667 |
-
self::$cpt_tags,
|
668 |
-
);
|
669 |
-
|
670 |
-
self::register_taxonomies();
|
671 |
-
}
|
672 |
-
|
673 |
-
$args = array(
|
674 |
-
'label' => esc_html__( 'Testimonials', 'testimonials-widget' ),
|
675 |
-
'capability_type' => 'post',
|
676 |
-
'has_archive' => $has_archive,
|
677 |
-
'hierarchical' => false,
|
678 |
-
'labels' => $labels,
|
679 |
-
'public' => true,
|
680 |
-
'publicly_queryable' => true,
|
681 |
-
'query_var' => true,
|
682 |
-
'rewrite' => array(
|
683 |
-
'slug' => $rewrite_slug,
|
684 |
-
'with_front' => false,
|
685 |
-
),
|
686 |
-
'supports' => $supports,
|
687 |
-
'taxonomies' => $taxonomies,
|
688 |
-
);
|
689 |
-
|
690 |
-
$args = apply_filters( 'tw_register_post_type_args', $args );
|
691 |
-
register_post_type( self::PT, $args );
|
692 |
-
|
693 |
-
if ( $do_register_taxonomy ) {
|
694 |
-
register_taxonomy_for_object_type( self::$cpt_category, self::PT );
|
695 |
-
register_taxonomy_for_object_type( self::$cpt_tags, self::PT );
|
696 |
-
}
|
697 |
-
}
|
698 |
-
|
699 |
-
|
700 |
-
public static function register_taxonomies() {
|
701 |
-
$args = array(
|
702 |
-
'hierarchical' => true,
|
703 |
-
'show_admin_column' => true,
|
704 |
-
);
|
705 |
-
$args = apply_filters( 'tw_register_category_args', $args );
|
706 |
-
register_taxonomy( self::$cpt_category, self::PT, $args );
|
707 |
-
|
708 |
-
$args = array(
|
709 |
-
'show_admin_column' => true,
|
710 |
-
'update_count_callback' => '_update_post_term_count',
|
711 |
-
);
|
712 |
-
$args = apply_filters( 'tw_register_tags_args', $args );
|
713 |
-
register_taxonomy( self::$cpt_tags, self::PT, $args );
|
714 |
-
}
|
715 |
-
|
716 |
-
|
717 |
-
public static function get_defaults( $single_view = false ) {
|
718 |
-
$options = tw_get_options();
|
719 |
-
if ( empty( $single_view ) ) {
|
720 |
-
$defaults = apply_filters( 'tw_defaults', $options );
|
721 |
-
} else {
|
722 |
-
$defaults = apply_filters( 'tw_defaults_single', $options );
|
723 |
-
}
|
724 |
-
|
725 |
-
return $defaults;
|
726 |
-
}
|
727 |
-
|
728 |
-
|
729 |
-
public static function testimonials( $atts ) {
|
730 |
-
$atts = wp_parse_args( $atts, self::get_defaults() );
|
731 |
-
$atts = Axl_Testimonials_Widget_Settings::validate_settings( $atts );
|
732 |
-
|
733 |
-
if ( get_query_var( 'paged' ) ) {
|
734 |
-
$atts['paged'] = get_query_var( 'paged' );
|
735 |
-
} elseif ( get_query_var( 'page' ) ) {
|
736 |
-
$atts['paged'] = get_query_var( 'page' );
|
737 |
-
} else {
|
738 |
-
$atts['paged'] = 1;
|
739 |
-
}
|
740 |
-
|
741 |
-
$atts['type'] = 'testimonials';
|
742 |
-
|
743 |
-
$instance = self::add_instance();
|
744 |
-
$atts['widget_number'] = $instance;
|
745 |
-
|
746 |
-
$testimonials = array();
|
747 |
-
|
748 |
-
$content = apply_filters( 'tw_cache_get', false, $atts );
|
749 |
-
if ( false === $content ) {
|
750 |
-
$testimonials = self::get_testimonials( $atts );
|
751 |
-
$content = self::get_testimonials_html( $testimonials, $atts );
|
752 |
-
$content = apply_filters( 'tw_cache_set', $content, $atts );
|
753 |
-
}
|
754 |
-
|
755 |
-
self::call_scripts_styles( $testimonials, $atts, $instance );
|
756 |
-
|
757 |
-
return $content;
|
758 |
-
}
|
759 |
-
|
760 |
-
|
761 |
-
public static function testimonials_slider( $atts, $widget_number = null ) {
|
762 |
-
if ( is_null( $atts ) || ! is_array( $atts ) ) {
|
763 |
-
$atts = array();
|
764 |
-
}
|
765 |
-
|
766 |
-
if ( empty( $widget_number ) ) {
|
767 |
-
$widget_number = self::$widget_number++;
|
768 |
-
|
769 |
-
if ( ! isset( $atts['random'] ) ) {
|
770 |
-
$atts['random'] = 1;
|
771 |
-
}
|
772 |
-
}
|
773 |
-
|
774 |
-
$atts = wp_parse_args( $atts, self::get_defaults() );
|
775 |
-
$atts = Axl_Testimonials_Widget_Settings::validate_settings( $atts );
|
776 |
-
|
777 |
-
$atts['paging'] = false;
|
778 |
-
$atts['type'] = 'testimonials_slider';
|
779 |
-
|
780 |
-
self::set_instance( $widget_number );
|
781 |
-
$atts['widget_number'] = $widget_number;
|
782 |
-
|
783 |
-
$testimonials = array();
|
784 |
-
|
785 |
-
$content = apply_filters( 'tw_cache_get', false, $atts );
|
786 |
-
if ( false === $content ) {
|
787 |
-
$testimonials = self::get_testimonials( $atts );
|
788 |
-
$content = self::get_testimonials_html( $testimonials, $atts, false, $widget_number );
|
789 |
-
$content = apply_filters( 'tw_cache_set', $content, $atts );
|
790 |
-
}
|
791 |
-
|
792 |
-
self::call_scripts_styles( $testimonials, $atts, $widget_number );
|
793 |
-
|
794 |
-
return $content;
|
795 |
-
}
|
796 |
-
|
797 |
-
|
798 |
-
public static function admin_scripts() {
|
799 |
-
wp_register_script( 'tw_admin_scripts', self::$plugin_assets . 'js/tw-admin-scripts.js', array( 'jquery' ), '1.0', true );
|
800 |
-
wp_enqueue_script( 'tw_admin_scripts' );
|
801 |
-
|
802 |
-
wp_localize_script(
|
803 |
-
'tw_admin_scripts',
|
804 |
-
'tw_schema_notice',
|
805 |
-
array(
|
806 |
-
'nonce' => wp_create_nonce( 'tw_schema_notice' ),
|
807 |
-
)
|
808 |
-
);
|
809 |
-
}
|
810 |
-
|
811 |
-
|
812 |
-
public static function scripts( $atts ) {
|
813 |
-
if ( is_admin() ) {
|
814 |
-
return;
|
815 |
-
}
|
816 |
-
|
817 |
-
wp_enqueue_script( 'jquery' );
|
818 |
-
|
819 |
-
if ( ! empty( $atts['enable_video'] ) ) {
|
820 |
-
wp_register_script( 'jquery.fitvids', self::$library_assets . 'bxslider-4/dist/vendor/jquery.fitvids.js', array( 'jquery' ), '1.0', true );
|
821 |
-
wp_enqueue_script( 'jquery.fitvids' );
|
822 |
-
}
|
823 |
-
|
824 |
-
wp_register_script( 'jquery.bxslider', self::$library_assets . 'bxslider-4/dist/jquery.bxslider.min.js', array( 'jquery' ), '4.1.2', true );
|
825 |
-
wp_enqueue_script( 'jquery.bxslider' );
|
826 |
-
|
827 |
-
do_action( 'tw_scripts', $atts );
|
828 |
-
}
|
829 |
-
|
830 |
-
|
831 |
-
public static function styles() {
|
832 |
-
if ( is_admin() ) {
|
833 |
-
return;
|
834 |
-
}
|
835 |
-
|
836 |
-
$exclude_bxslider_css = tw_get_option( 'exclude_bxslider_css' );
|
837 |
-
if ( empty( $exclude_bxslider_css ) ) {
|
838 |
-
wp_register_style( 'jquery.bxslider', self::$library_assets . 'bxslider-4/dist/jquery.bxslider.css' );
|
839 |
-
wp_enqueue_style( 'jquery.bxslider' );
|
840 |
-
}
|
841 |
-
|
842 |
-
wp_register_style( __CLASS__, self::$plugin_assets . 'css/testimonials-widget.css' );
|
843 |
-
|
844 |
-
$exclude_css = tw_get_option( 'exclude_css' );
|
845 |
-
if ( empty( $exclude_css ) ) {
|
846 |
-
wp_enqueue_style( __CLASS__ );
|
847 |
-
}
|
848 |
-
|
849 |
-
do_action( 'tw_styles' );
|
850 |
-
}
|
851 |
-
|
852 |
-
|
853 |
-
public static function get_testimonials_html_css( $atts, $widget_number = null ) {
|
854 |
-
$css = array();
|
855 |
-
$css = apply_filters( 'tw_testimonials_css', $css, $atts, $widget_number );
|
856 |
-
|
857 |
-
return $css;
|
858 |
-
}
|
859 |
-
|
860 |
-
|
861 |
-
public static function get_testimonials_html_js( $testimonials, $atts, $widget_number = null ) {
|
862 |
-
$not_found = self::get_not_found();
|
863 |
-
if ( $not_found ) {
|
864 |
-
return;
|
865 |
-
}
|
866 |
-
|
867 |
-
$scripts = array();
|
868 |
-
$scripts_internal = array();
|
869 |
-
|
870 |
-
$id = self::ID;
|
871 |
-
$id_base = $id . $widget_number;
|
872 |
-
|
873 |
-
switch ( $atts['type'] ) {
|
874 |
-
case 'testimonials_slider':
|
875 |
-
$javascript = '';
|
876 |
-
if ( 1 < count( $testimonials ) ) {
|
877 |
-
$refresh_interval = $atts['refresh_interval'];
|
878 |
-
|
879 |
-
$javascript .= '<script type="text/javascript">' . "\n";
|
880 |
-
|
881 |
-
$adaptive_height = $atts['adaptive_height'] ? 'true' : 'false';
|
882 |
-
$enable_video = $atts['enable_video'];
|
883 |
-
$show_start_stop = $atts['show_start_stop'];
|
884 |
-
$slide_width = empty( $atts['slide_width'] ) ? 0 : $atts['slide_width'];
|
885 |
-
$transition_mode = $atts['transition_mode'];
|
886 |
-
|
887 |
-
$auto = $refresh_interval ? 'true' : 'false';
|
888 |
-
$pause = $refresh_interval * 1000;
|
889 |
-
$video = $enable_video ? "video: true,\nuseCSS: false" : 'video: false';
|
890 |
-
|
891 |
-
$auto_controls = $show_start_stop ? 'autoControls: true,' : '';
|
892 |
-
|
893 |
-
$slider_var = self::SLUG . $widget_number;
|
894 |
-
$javascript .= <<<EOF
|
895 |
-
var {$slider_var} = null;
|
896 |
-
|
897 |
-
jQuery(document).ready(function() {
|
898 |
-
{$slider_var} = jQuery('.{$id_base}').bxSlider({
|
899 |
-
adaptiveHeight: {$adaptive_height},
|
900 |
-
auto: {$auto},
|
901 |
-
{$auto_controls}
|
902 |
-
autoHover: true,
|
903 |
-
controls: false,
|
904 |
-
mode: '{$transition_mode}',
|
905 |
-
pager: false,
|
906 |
-
pause: {$pause},
|
907 |
-
{$video},
|
908 |
-
slideMargin: 2,
|
909 |
-
slideWidth: {$slide_width}
|
910 |
-
});
|
911 |
-
});
|
912 |
-
EOF;
|
913 |
-
|
914 |
-
$javascript .= "\n" . '</script>';
|
915 |
-
$scripts[ $id_base ] = $javascript;
|
916 |
-
}
|
917 |
-
break;
|
918 |
-
}
|
919 |
-
|
920 |
-
$scripts = apply_filters( 'tw_testimonials_js', $scripts, $testimonials, $atts, $widget_number );
|
921 |
-
$scripts_internal = apply_filters( 'tw_testimonials_js_internal', $scripts_internal, $testimonials, $atts, $widget_number );
|
922 |
-
$internal_scripts = implode( "\n", $scripts_internal );
|
923 |
-
$scripts = str_replace( '{INTERNAL_SCRIPTS}', $internal_scripts, $scripts );
|
924 |
-
|
925 |
-
return $scripts;
|
926 |
-
}
|
927 |
-
|
928 |
-
|
929 |
-
public static function get_testimonials_html( $testimonials, $atts, $is_list = true, $widget_number = null ) {
|
930 |
-
global $tw_template_args;
|
931 |
-
|
932 |
-
$tw_template_args = compact( 'testimonials', 'atts', 'is_list', 'widget_number' );
|
933 |
-
|
934 |
-
$div_open = self::get_template_part( 'testimonials', 'open' );
|
935 |
-
|
936 |
-
$paging = Axl_Testimonials_Widget_Settings::is_true( $atts['paging'] );
|
937 |
-
$pre_paging = '';
|
938 |
-
if ( $paging || 'before' === strtolower( $atts['paging'] ) ) {
|
939 |
-
$pre_paging = self::get_testimonials_paging( $atts );
|
940 |
-
}
|
941 |
-
|
942 |
-
if ( empty( $testimonials ) && ! $atts['hide_not_found'] ) {
|
943 |
-
$testimonials = array(
|
944 |
-
array( 'testimonial_content' => esc_html__( 'No testimonials found', 'testimonials-widget' ) ),
|
945 |
-
);
|
946 |
-
|
947 |
-
self::set_not_found( true );
|
948 |
-
} else {
|
949 |
-
self::set_not_found();
|
950 |
-
}
|
951 |
-
|
952 |
-
$is_first = true;
|
953 |
-
$testimonial_content = '';
|
954 |
-
foreach ( $testimonials as $testimonial ) {
|
955 |
-
$content = self::get_testimonial_html( $testimonial, $atts, $is_list, $is_first, $widget_number );
|
956 |
-
$content = apply_filters( 'tw_testimonial_html', $content, $testimonial, $atts, $is_list, $is_first, $widget_number );
|
957 |
-
|
958 |
-
$testimonial_content .= $content;
|
959 |
-
|
960 |
-
$is_first = false;
|
961 |
-
}
|
962 |
-
|
963 |
-
$post_paging = '';
|
964 |
-
if ( $paging || 'after' === strtolower( $atts['paging'] ) ) {
|
965 |
-
$post_paging = self::get_testimonials_paging( $atts, false );
|
966 |
-
}
|
967 |
-
|
968 |
-
$div_close = self::get_template_part( 'testimonials', 'close' );
|
969 |
-
|
970 |
-
$html = $div_open
|
971 |
-
. $pre_paging
|
972 |
-
. $testimonial_content
|
973 |
-
. $post_paging
|
974 |
-
. $div_close;
|
975 |
-
|
976 |
-
$html = apply_filters( 'tw_get_testimonials_html', $html, $testimonials, $atts, $is_list, $widget_number, $div_open, $pre_paging, $testimonial_content, $post_paging, $div_close );
|
977 |
-
|
978 |
-
return $html;
|
979 |
-
}
|
980 |
-
|
981 |
-
|
982 |
-
public static function get_testimonial_html( $testimonial, $atts, $is_list = true, $is_first = false, $widget_number = null ) {
|
983 |
-
global $tw_template_args;
|
984 |
-
|
985 |
-
$tw_template_args = compact( 'testimonial', 'atts', 'is_list', 'is_first', 'widget_number' );
|
986 |
-
|
987 |
-
$div_open = self::get_template_part( 'testimonial', 'open' );
|
988 |
-
|
989 |
-
$image = '';
|
990 |
-
if ( ! $atts['hide_image'] && ! empty( $testimonial['testimonial_image'] ) ) {
|
991 |
-
if ( ! ( $atts['hide_image_single'] && 'get_single' == $atts['type'] ) ) {
|
992 |
-
$image = self::get_template_part( 'testimonial', 'image' );
|
993 |
-
}
|
994 |
-
}
|
995 |
-
|
996 |
-
$content = self::get_template_part( 'testimonial', 'content' );
|
997 |
-
|
998 |
-
$cite = '';
|
999 |
-
if ( 1 < count( $testimonial ) ) {
|
1000 |
-
$cite = self::get_template_part( 'testimonial', 'cite' );
|
1001 |
-
}
|
1002 |
-
|
1003 |
-
$extra = '';
|
1004 |
-
if ( ! empty( $testimonial['testimonial_extra'] ) ) {
|
1005 |
-
$extra = self::get_template_part( 'testimonial', 'extra' );
|
1006 |
-
}
|
1007 |
-
|
1008 |
-
$bottom_text = '';
|
1009 |
-
if ( ! empty( $atts['bottom_text'] ) && 'false' != $atts['bottom_text'] ) {
|
1010 |
-
$bottom_text = self::get_template_part( 'testimonial', 'bottom' );
|
1011 |
-
}
|
1012 |
-
|
1013 |
-
$do_target = $atts['target'];
|
1014 |
-
if ( $do_target ) {
|
1015 |
-
$content = links_add_target( $content, $do_target );
|
1016 |
-
$cite = links_add_target( $cite, $do_target );
|
1017 |
-
$extra = links_add_target( $extra, $do_target );
|
1018 |
-
$bottom_text = links_add_target( $bottom_text, $do_target );
|
1019 |
-
}
|
1020 |
-
|
1021 |
-
$schema = '';
|
1022 |
-
if ( $atts['enable_schema'] ) {
|
1023 |
-
$schema = self::get_schema( $testimonial, $atts );
|
1024 |
-
$schema .= "\n";
|
1025 |
-
}
|
1026 |
-
|
1027 |
-
$div_close = self::get_template_part( 'testimonial', 'close' );
|
1028 |
-
$div_close = $schema . $div_close;
|
1029 |
-
|
1030 |
-
$html = $div_open
|
1031 |
-
. $image
|
1032 |
-
. $content
|
1033 |
-
. $cite
|
1034 |
-
. $extra
|
1035 |
-
. $bottom_text
|
1036 |
-
. $div_close;
|
1037 |
-
|
1038 |
-
$html = apply_filters( 'tw_get_testimonial_html', $html, $testimonial, $atts, $is_list, $is_first, $widget_number, $div_open, $image, $content, $cite, $extra, $bottom_text, $div_close );
|
1039 |
-
|
1040 |
-
// not done sooner as tag_close_quote is used Testimonials Widget Premium
|
1041 |
-
if ( $atts['disable_quotes'] ) {
|
1042 |
-
$html = str_replace( self::$tag_open_quote, '', $html );
|
1043 |
-
$html = str_replace( self::$tag_close_quote, '', $html );
|
1044 |
-
}
|
1045 |
-
|
1046 |
-
return $html;
|
1047 |
-
}
|
1048 |
-
|
1049 |
-
|
1050 |
-
// Original PHP code as myTruncate2 by Chirp Internet: www.chirp.com.au
|
1051 |
-
public static function testimonials_truncate( $string, $char_limit = false, $pad = '…', $force_pad = false ) {
|
1052 |
-
if ( empty( $force_pad ) ) {
|
1053 |
-
if ( ! $char_limit ) {
|
1054 |
-
return $string;
|
1055 |
-
}
|
1056 |
-
|
1057 |
-
// return with no change if string is shorter than $char_limit
|
1058 |
-
if ( strlen( $string ) <= $char_limit ) {
|
1059 |
-
return $string;
|
1060 |
-
}
|
1061 |
-
}
|
1062 |
-
|
1063 |
-
if ( $char_limit ) {
|
1064 |
-
return self::truncate( $string, $char_limit, $pad, $force_pad );
|
1065 |
-
}
|
1066 |
-
|
1067 |
-
return $string . $pad;
|
1068 |
-
}
|
1069 |
-
|
1070 |
-
|
1071 |
-
/**
|
1072 |
-
* @SuppressWarnings(PHPMD.Superglobals)
|
1073 |
-
*/
|
1074 |
-
public static function format_content( $content, $widget_number, $atts ) {
|
1075 |
-
if ( empty( $content ) ) {
|
1076 |
-
return $content;
|
1077 |
-
}
|
1078 |
-
|
1079 |
-
$keep_whitespace = $atts['keep_whitespace'];
|
1080 |
-
$do_shortcode = $atts['do_shortcode'];
|
1081 |
-
|
1082 |
-
$content = self::do_video( $content, $atts );
|
1083 |
-
|
1084 |
-
// wrap our own quote class around the content before any formatting happens
|
1085 |
-
$temp_content = self::$tag_open_quote;
|
1086 |
-
$temp_content .= trim( $content );
|
1087 |
-
$temp_content .= self::$tag_close_quote;
|
1088 |
-
|
1089 |
-
$content = $temp_content;
|
1090 |
-
|
1091 |
-
$content = wptexturize( $content );
|
1092 |
-
$content = convert_smilies( $content );
|
1093 |
-
$content = convert_chars( $content );
|
1094 |
-
if ( is_null( $widget_number ) || $keep_whitespace ) {
|
1095 |
-
$content = wpautop( $content );
|
1096 |
-
}
|
1097 |
-
|
1098 |
-
$content = shortcode_unautop( $content );
|
1099 |
-
$content = str_replace( ']]>', ']]>', $content );
|
1100 |
-
if ( $do_shortcode ) {
|
1101 |
-
$content = do_shortcode( $content );
|
1102 |
-
} else {
|
1103 |
-
$content = strip_shortcodes( $content );
|
1104 |
-
}
|
1105 |
-
|
1106 |
-
return $content;
|
1107 |
-
}
|
1108 |
-
|
1109 |
-
|
1110 |
-
/**
|
1111 |
-
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
1112 |
-
*/
|
1113 |
-
public static function get_testimonials_paging( $atts, $prepend = true ) {
|
1114 |
-
global $tw_template_args;
|
1115 |
-
|
1116 |
-
$tw_template_args = compact( 'atts', 'prepend' );
|
1117 |
-
|
1118 |
-
$html = self::get_template_part( 'testimonials', 'paging' );
|
1119 |
-
|
1120 |
-
return $html;
|
1121 |
-
}
|
1122 |
-
|
1123 |
-
|
1124 |
-
public static function get_testimonials_css() {
|
1125 |
-
if ( empty( self::$css_called ) ) {
|
1126 |
-
foreach ( self::$css as $css ) {
|
1127 |
-
echo $css;
|
1128 |
-
}
|
1129 |
-
|
1130 |
-
self::$css_called = true;
|
1131 |
-
}
|
1132 |
-
}
|
1133 |
-
|
1134 |
-
|
1135 |
-
public static function get_testimonials_scripts() {
|
1136 |
-
if ( empty( self::$scripts_called ) ) {
|
1137 |
-
foreach ( self::$scripts as $script ) {
|
1138 |
-
echo $script;
|
1139 |
-
}
|
1140 |
-
|
1141 |
-
self::$scripts_called = true;
|
1142 |
-
}
|
1143 |
-
}
|
1144 |
-
|
1145 |
-
|
1146 |
-
/**
|
1147 |
-
*
|
1148 |
-
*
|
1149 |
-
* @SuppressWarnings(PHPMD.UnusedLocalVariable)
|
1150 |
-
*/
|
1151 |
-
public static function get_query_args( $atts ) {
|
1152 |
-
extract( $atts );
|
1153 |
-
|
1154 |
-
if ( has_filter( 'posts_orderby', 'CPTOrderPosts' ) ) {
|
1155 |
-
remove_filter( 'posts_orderby', 'CPTOrderPosts', 99, 2 );
|
1156 |
-
}
|
1157 |
-
|
1158 |
-
if ( empty( $fields ) ) {
|
1159 |
-
$fields = false;
|
1160 |
-
}
|
1161 |
-
|
1162 |
-
if ( $random ) {
|
1163 |
-
$orderby = 'rand';
|
1164 |
-
$order = false;
|
1165 |
-
}
|
1166 |
-
|
1167 |
-
$args = array(
|
1168 |
-
'fields' => $fields,
|
1169 |
-
'orderby' => $orderby,
|
1170 |
-
'post_status' => array(
|
1171 |
-
'publish',
|
1172 |
-
'private',
|
1173 |
-
),
|
1174 |
-
'post_type' => self::PT,
|
1175 |
-
'posts_per_page' => $limit,
|
1176 |
-
);
|
1177 |
-
|
1178 |
-
if ( is_single() ) {
|
1179 |
-
$args['post_status'][] = 'pending';
|
1180 |
-
$args['post_status'][] = 'draft';
|
1181 |
-
}
|
1182 |
-
|
1183 |
-
if ( $paging && ! empty( $atts['paged'] ) && is_singular() ) {
|
1184 |
-
$args['paged'] = $atts['paged'];
|
1185 |
-
}
|
1186 |
-
|
1187 |
-
if ( ! $random && $meta_key ) {
|
1188 |
-
$args['meta_key'] = $meta_key;
|
1189 |
-
$args['orderby'] = 'meta_value';
|
1190 |
-
}
|
1191 |
-
|
1192 |
-
if ( $order ) {
|
1193 |
-
$args['order'] = $order;
|
1194 |
-
}
|
1195 |
-
|
1196 |
-
if ( $ids ) {
|
1197 |
-
$ids = explode( ',', $ids );
|
1198 |
-
|
1199 |
-
$args['post__in'] = $ids;
|
1200 |
-
|
1201 |
-
if ( 'none' == $args['orderby'] ) {
|
1202 |
-
add_filter( 'posts_results', array( __CLASS__, 'posts_results_sort_none' ), 10, 2 );
|
1203 |
-
}
|
1204 |
-
}
|
1205 |
-
|
1206 |
-
if ( $exclude ) {
|
1207 |
-
$exclude = explode( ',', $exclude );
|
1208 |
-
$args['post__not_in'] = $exclude;
|
1209 |
-
}
|
1210 |
-
|
1211 |
-
$use_cpt_taxonomy = tw_get_option( 'use_cpt_taxonomy', false );
|
1212 |
-
if ( ! $use_cpt_taxonomy ) {
|
1213 |
-
if ( $category ) {
|
1214 |
-
if ( ! preg_match( '#^\d+$#', $category ) ) {
|
1215 |
-
$args['category_name'] = $category;
|
1216 |
-
} else {
|
1217 |
-
$args['cat'] = $category;
|
1218 |
-
}
|
1219 |
-
}
|
1220 |
-
|
1221 |
-
if ( $tags ) {
|
1222 |
-
$tags = explode( ',', $tags );
|
1223 |
-
foreach ( $tags as $tag ) {
|
1224 |
-
if ( ! preg_match( '#^\d+$#', $tag ) ) {
|
1225 |
-
if ( $tags_all ) {
|
1226 |
-
if ( empty( $args['tag_slug__and'] ) || ! is_array( $args['tag_slug__and'] ) ) {
|
1227 |
-
$args['tag_slug__and'] = array();
|
1228 |
-
}
|
1229 |
-
|
1230 |
-
$args['tag_slug__and'][] = $tag;
|
1231 |
-
} else {
|
1232 |
-
if ( empty( $args['tag_slug__in'] ) || ! is_array( $args['tag_slug__in'] ) ) {
|
1233 |
-
$args['tag_slug__in'] = array();
|
1234 |
-
}
|
1235 |
-
|
1236 |
-
$args['tag_slug__in'][] = $tag;
|
1237 |
-
}
|
1238 |
-
} else {
|
1239 |
-
if ( $tags_all ) {
|
1240 |
-
if ( empty( $args['tag__and'] ) || ! is_array( $args['tag__and'] ) ) {
|
1241 |
-
$args['tag__and'] = array();
|
1242 |
-
}
|
1243 |
-
|
1244 |
-
$args['tag__and'][] = $tag;
|
1245 |
-
} else {
|
1246 |
-
if ( empty( $args['tag__in'] ) || ! is_array( $args['tag__in'] ) ) {
|
1247 |
-
$args['tag__in'] = array();
|
1248 |
-
}
|
1249 |
-
|
1250 |
-
$args['tag__in'][] = $tag;
|
1251 |
-
}
|
1252 |
-
}
|
1253 |
-
}
|
1254 |
-
}
|
1255 |
-
} else {
|
1256 |
-
if ( empty( $args['tax_query'] ) || ! is_array( $args['tax_query'] ) ) {
|
1257 |
-
$args['tax_query'] = array();
|
1258 |
-
}
|
1259 |
-
|
1260 |
-
if ( $category ) {
|
1261 |
-
if ( ! preg_match( '#^\d+$#', $category ) ) {
|
1262 |
-
$args['tax_query'][] = array(
|
1263 |
-
'taxonomy' => self::$cpt_category,
|
1264 |
-
'terms' => array( $category ),
|
1265 |
-
'field' => 'slug',
|
1266 |
-
);
|
1267 |
-
} else {
|
1268 |
-
$args['tax_query'][] = array(
|
1269 |
-
'taxonomy' => self::$cpt_category,
|
1270 |
-
'terms' => array( $category ),
|
1271 |
-
'field' => 'id',
|
1272 |
-
);
|
1273 |
-
}
|
1274 |
-
}
|
1275 |
-
|
1276 |
-
if ( $tags ) {
|
1277 |
-
if ( $tags_all ) {
|
1278 |
-
$args['tax_query'] = array(
|
1279 |
-
'relation' => 'AND',
|
1280 |
-
);
|
1281 |
-
}
|
1282 |
-
|
1283 |
-
$tags = explode( ',', $tags );
|
1284 |
-
foreach ( $tags as $term ) {
|
1285 |
-
if ( ! preg_match( '#^\d+$#', $term ) ) {
|
1286 |
-
$args['tax_query'][] = array(
|
1287 |
-
'taxonomy' => self::$cpt_tags,
|
1288 |
-
'terms' => array( $term ),
|
1289 |
-
'field' => 'slug',
|
1290 |
-
);
|
1291 |
-
} else {
|
1292 |
-
$args['tax_query'][] = array(
|
1293 |
-
'taxonomy' => self::$cpt_tags,
|
1294 |
-
'terms' => array( $term ),
|
1295 |
-
'field' => 'id',
|
1296 |
-
);
|
1297 |
-
}
|
1298 |
-
}
|
1299 |
-
}
|
1300 |
-
}
|
1301 |
-
|
1302 |
-
$args = apply_filters( 'tw_query_args', $args, $atts );
|
1303 |
-
|
1304 |
-
return $args;
|
1305 |
-
}
|
1306 |
-
|
1307 |
-
|
1308 |
-
/**
|
1309 |
-
*
|
1310 |
-
*
|
1311 |
-
* @SuppressWarnings(PHPMD.LongVariable)
|
1312 |
-
*/
|
1313 |
-
public static function get_testimonials( $atts ) {
|
1314 |
-
$hide_gravatar = $atts['hide_gravatar'];
|
1315 |
-
|
1316 |
-
$args = self::get_query_args( $atts );
|
1317 |
-
$args['query'] = true;
|
1318 |
-
|
1319 |
-
$testimonials = apply_filters( 'tw_cache_get', false, $args );
|
1320 |
-
if ( false === $testimonials ) {
|
1321 |
-
$testimonials = new WP_Query( $args );
|
1322 |
-
$testimonials = apply_filters( 'tw_testimonials_query', $testimonials, $args );
|
1323 |
-
$testimonials = apply_filters( 'tw_cache_set', $testimonials, $args );
|
1324 |
-
}
|
1325 |
-
|
1326 |
-
if ( has_filter( 'posts_results', array( __CLASS__, 'posts_results_sort_none' ) ) ) {
|
1327 |
-
remove_filter( 'posts_results', array( __CLASS__, 'posts_results_sort_none' ) );
|
1328 |
-
}
|
1329 |
-
|
1330 |
-
self::$max_num_pages = $testimonials->max_num_pages;
|
1331 |
-
self::$post_count = $testimonials->post_count;
|
1332 |
-
self::$wp_query = $testimonials;
|
1333 |
-
|
1334 |
-
wp_reset_postdata();
|
1335 |
-
|
1336 |
-
$image_size = apply_filters( 'tw_image_size', 'thumbnail' );
|
1337 |
-
if ( ! is_array( $image_size ) ) {
|
1338 |
-
global $_wp_additional_image_sizes;
|
1339 |
-
if ( ! empty( $_wp_additional_image_sizes[ $image_size ] ) ) {
|
1340 |
-
$gravatar_size = $_wp_additional_image_sizes[ $image_size ]['width'];
|
1341 |
-
} else {
|
1342 |
-
$gravatar_size = get_option( $image_size . '_size_w' );
|
1343 |
-
}
|
1344 |
-
|
1345 |
-
$gravatar_size = apply_filters( 'tw_gravatar_size', $gravatar_size );
|
1346 |
-
} else {
|
1347 |
-
$gravatar_size = apply_filters( 'tw_gravatar_size', $image_size );
|
1348 |
-
}
|
1349 |
-
|
1350 |
-
$testimonial_data = array();
|
1351 |
-
|
1352 |
-
if ( empty( self::$post_count ) ) {
|
1353 |
-
return $testimonial_data;
|
1354 |
-
}
|
1355 |
-
|
1356 |
-
foreach ( $testimonials->posts as $row ) {
|
1357 |
-
$post_id = $row->ID;
|
1358 |
-
$email = get_post_meta( $post_id, 'testimonials-widget-email', true );
|
1359 |
-
|
1360 |
-
if ( has_post_thumbnail( $post_id ) ) {
|
1361 |
-
$image = get_the_post_thumbnail( $post_id, $image_size );
|
1362 |
-
} elseif ( ! $hide_gravatar && is_email( $email ) ) {
|
1363 |
-
$image = get_avatar( $email, $gravatar_size );
|
1364 |
-
|
1365 |
-
self::make_gravatar_featured( $post_id, $email );
|
1366 |
-
} else {
|
1367 |
-
$image = false;
|
1368 |
-
}
|
1369 |
-
|
1370 |
-
$image = self::strip_protocol( $image );
|
1371 |
-
|
1372 |
-
$url = get_post_meta( $post_id, 'testimonials-widget-url', true );
|
1373 |
-
if ( ! empty( $url ) && 0 === preg_match( '#https?://#', $url ) ) {
|
1374 |
-
$url = 'http://' . $url;
|
1375 |
-
}
|
1376 |
-
|
1377 |
-
$data = array(
|
1378 |
-
'post_id' => $post_id,
|
1379 |
-
'testimonial_author' => get_post_meta( $post_id, 'testimonials-widget-author', true ),
|
1380 |
-
'testimonial_company' => get_post_meta( $post_id, 'testimonials-widget-company', true ),
|
1381 |
-
'testimonial_content' => $row->post_content,
|
1382 |
-
'testimonial_email' => $email,
|
1383 |
-
'testimonial_extra' => '',
|
1384 |
-
'testimonial_image' => $image,
|
1385 |
-
'testimonial_location' => get_post_meta( $post_id, 'testimonials-widget-location', true ),
|
1386 |
-
'testimonial_source' => $row->post_title,
|
1387 |
-
'testimonial_title' => get_post_meta( $post_id, 'testimonials-widget-title', true ),
|
1388 |
-
'testimonial_url' => $url,
|
1389 |
-
);
|
1390 |
-
|
1391 |
-
$testimonial_data[] = $data;
|
1392 |
-
}
|
1393 |
-
|
1394 |
-
$testimonial_data = apply_filters( 'tw_data', $testimonial_data, $atts );
|
1395 |
-
|
1396 |
-
return $testimonial_data;
|
1397 |
-
}
|
1398 |
-
|
1399 |
-
|
1400 |
-
public static function posts_results_sort_none( $posts, $query ) {
|
1401 |
-
$order = $query->query_vars['post__in'];
|
1402 |
-
if ( empty( $order ) ) {
|
1403 |
-
return $posts;
|
1404 |
-
}
|
1405 |
-
|
1406 |
-
$posts_none_sorted = array();
|
1407 |
-
// put posts in same orders as post__in
|
1408 |
-
foreach ( $order as $id ) {
|
1409 |
-
foreach ( $posts as $key => $post ) {
|
1410 |
-
if ( $id == $post->ID ) {
|
1411 |
-
$posts_none_sorted[] = $post;
|
1412 |
-
unset( $posts[ $key ] );
|
1413 |
-
}
|
1414 |
-
}
|
1415 |
-
}
|
1416 |
-
|
1417 |
-
return $posts_none_sorted;
|
1418 |
-
}
|
1419 |
-
|
1420 |
-
|
1421 |
-
public static function widgets_init() {
|
1422 |
-
register_widget( 'Axl_Testimonials_Widget_Archives_Widget' );
|
1423 |
-
register_widget( 'Axl_Testimonials_Widget_Categories_Widget' );
|
1424 |
-
register_widget( 'Axl_Testimonials_Widget_Recent_Testimonials_Widget' );
|
1425 |
-
register_widget( 'Axl_Testimonials_Widget_Slider_Widget' );
|
1426 |
-
register_widget( 'Axl_Testimonials_Widget_Tag_Cloud_Widget' );
|
1427 |
-
}
|
1428 |
-
|
1429 |
-
|
1430 |
-
/**
|
1431 |
-
*
|
1432 |
-
*
|
1433 |
-
* @SuppressWarnings(PHPMD.UnusedLocalVariable)
|
1434 |
-
*/
|
1435 |
-
public static function add_meta_box_testimonials_widget() {
|
1436 |
-
$fields = array(
|
1437 |
-
array(
|
1438 |
-
'name' => esc_html__( 'Author', 'testimonials-widget' ),
|
1439 |
-
'id' => 'testimonials-widget-author',
|
1440 |
-
'type' => 'text',
|
1441 |
-
'desc' => esc_html__( 'Use when the testimonial title is not the authors\' name.', 'testimonials-widget' ),
|
1442 |
-
),
|
1443 |
-
array(
|
1444 |
-
'name' => esc_html__( 'Job Title', 'testimonials-widget' ),
|
1445 |
-
'id' => 'testimonials-widget-title',
|
1446 |
-
'type' => 'text',
|
1447 |
-
'desc' => '',
|
1448 |
-
),
|
1449 |
-
array(
|
1450 |
-
'name' => esc_html__( 'Location', 'testimonials-widget' ),
|
1451 |
-
'id' => 'testimonials-widget-location',
|
1452 |
-
'type' => 'text',
|
1453 |
-
'desc' => '',
|
1454 |
-
),
|
1455 |
-
array(
|
1456 |
-
'name' => esc_html__( 'Company', 'testimonials-widget' ),
|
1457 |
-
'id' => 'testimonials-widget-company',
|
1458 |
-
'type' => 'text',
|
1459 |
-
'desc' => '',
|
1460 |
-
),
|
1461 |
-
array(
|
1462 |
-
'name' => esc_html__( 'Email', 'testimonials-widget' ),
|
1463 |
-
'id' => 'testimonials-widget-email',
|
1464 |
-
'type' => 'text',
|
1465 |
-
'desc' => esc_html__( 'If an email is provided, but not an image, a Gravatar icon will be attempted to be loaded.', 'testimonials-widget' ),
|
1466 |
-
),
|
1467 |
-
array(
|
1468 |
-
'name' => esc_html__( 'URL', 'testimonials-widget' ),
|
1469 |
-
'id' => 'testimonials-widget-url',
|
1470 |
-
'type' => 'text',
|
1471 |
-
'desc' => '',
|
1472 |
-
),
|
1473 |
-
);
|
1474 |
-
|
1475 |
-
$fields = apply_filters( 'tw_meta_box', $fields );
|
1476 |
-
|
1477 |
-
$meta_box = redrokk_metabox_class::getInstance(
|
1478 |
-
self::ID,
|
1479 |
-
array(
|
1480 |
-
'title' => esc_html__( 'Testimonial Data', 'testimonials-widget' ),
|
1481 |
-
'description' => '',
|
1482 |
-
'_object_types' => 'testimonials-widget',
|
1483 |
-
'priority' => 'high',
|
1484 |
-
'_fields' => $fields,
|
1485 |
-
)
|
1486 |
-
);
|
1487 |
-
}
|
1488 |
-
|
1489 |
-
|
1490 |
-
/**
|
1491 |
-
* Update messages for custom post type
|
1492 |
-
*
|
1493 |
-
* Original author: Travis Ballard http://www.travisballard.com
|
1494 |
-
*
|
1495 |
-
* @SuppressWarnings(PHPMD.Superglobals)
|
1496 |
-
* @param mixed $m
|
1497 |
-
* @return mixed $m
|
1498 |
-
*/
|
1499 |
-
public static function post_updated_messages( $m ) {
|
1500 |
-
global $post;
|
1501 |
-
|
1502 |
-
$m[ self::PT ] = array(
|
1503 |
-
0 => '', // Unused. Messages start at index 1.
|
1504 |
-
1 => sprintf( __( 'Testimonial updated. <a href="%s">View testimonial</a>', 'testimonials-widget' ), esc_url( get_permalink( $post->ID ) ) ),
|
1505 |
-
2 => esc_html__( 'Custom field updated.', 'testimonials-widget' ),
|
1506 |
-
3 => esc_html__( 'Custom field deleted.', 'testimonials-widget' ),
|
1507 |
-
4 => esc_html__( 'Testimonial updated.', 'testimonials-widget' ),
|
1508 |
-
/* translators: %s: date and time of the revision */
|
1509 |
-
5 => isset( $_GET['revision'] ) ? sprintf( esc_html__( 'Testimonial restored to revision from %s', 'testimonials-widget' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
|
1510 |
-
6 => sprintf( __( 'Testimonial published. <a href="%s">View testimonial</a>', 'testimonials-widget' ), esc_url( get_permalink( $post->ID ) ) ),
|
1511 |
-
7 => esc_html__( 'Testimonial saved.', 'testimonials-widget' ),
|
1512 |
-
8 => sprintf( __( 'Testimonial submitted. <a target="_blank" href="%s">Preview testimonial</a>', 'testimonials-widget' ), esc_url( add_query_arg( 'preview', 'true', get_permalink( $post->ID ) ) ) ),
|
1513 |
-
9 => sprintf( __( 'Testimonial scheduled for: <strong>%1$s</strong>. <a target="_blank" href="%2$s">Preview testimonial</a>', 'testimonials-widget' ), date_i18n( 'M j, Y @ G:i', strtotime( $post->post_date ) ), esc_url( get_permalink( $post->ID ) ) ),
|
1514 |
-
10 => sprintf( __( 'Testimonial draft updated. <a target="_blank" href="%s">Preview testimonial</a>', 'testimonials-widget' ), esc_url( add_query_arg( 'preview', 'true', get_permalink( $post->ID ) ) ) ),
|
1515 |
-
);
|
1516 |
-
|
1517 |
-
return $m;
|
1518 |
-
}
|
1519 |
-
|
1520 |
-
|
1521 |
-
public static function right_now_content_table_end() {
|
1522 |
-
$content = '
|
1523 |
-
<tr>
|
1524 |
-
<td class="first b b-%1$s">%4$s%2$s%5$s</td>
|
1525 |
-
<td class="t %1$s">%4$s%3$s%5$s</td>
|
1526 |
-
</tr>';
|
1527 |
-
$posts = wp_count_posts( self::PT );
|
1528 |
-
$count = $posts->publish;
|
1529 |
-
$name = _n( 'Testimonial', 'Testimonials', $count, 'testimonials-widget' );
|
1530 |
-
$count_f = number_format_i18n( $count );
|
1531 |
-
$a_open = '<a href="edit.php?post_type=' . self::PT . '">';
|
1532 |
-
$a_close = '</a>';
|
1533 |
-
|
1534 |
-
if ( current_user_can( 'edit_others_posts' ) ) {
|
1535 |
-
$result = sprintf( $content, self::PT, $count_f, $name, $a_open, $a_close );
|
1536 |
-
} else {
|
1537 |
-
$result = sprintf( $content, self::PT, $count_f, $name, '', '' );
|
1538 |
-
}
|
1539 |
-
|
1540 |
-
echo $result;
|
1541 |
-
}
|
1542 |
-
|
1543 |
-
|
1544 |
-
/**
|
1545 |
-
*
|
1546 |
-
*
|
1547 |
-
* @SuppressWarnings(PHPMD.UnusedLocalVariable)
|
1548 |
-
*/
|
1549 |
-
public static function get_schema( $testimonial, $atts ) {
|
1550 |
-
if ( ! isset( $testimonial['post_id'] ) ) {
|
1551 |
-
return;
|
1552 |
-
}
|
1553 |
-
|
1554 |
-
foreach ( $testimonial as $key => $value ) {
|
1555 |
-
if ( 'testimonial_image' != $key ) {
|
1556 |
-
$testimonial[ $key ] = self::clean_string( $value );
|
1557 |
-
}
|
1558 |
-
}
|
1559 |
-
|
1560 |
-
extract( $testimonial );
|
1561 |
-
|
1562 |
-
$do_company = ! $atts['hide_company'] && ! empty( $testimonial_company );
|
1563 |
-
$do_content = ! empty( $testimonial['testimonial_content'] );
|
1564 |
-
$do_email = ! $atts['hide_email'] && ! empty( $testimonial_email ) && is_email( $testimonial_email );
|
1565 |
-
$do_image = ! $atts['hide_image'] && ! empty( $testimonial_image );
|
1566 |
-
$do_location = ! $atts['hide_location'] && ! empty( $testimonial_location );
|
1567 |
-
$do_source = ! $atts['hide_source'] && ! empty( $testimonial_source );
|
1568 |
-
$do_title = ! $atts['hide_title'] && ! empty( $testimonial_title );
|
1569 |
-
$do_url = ! $atts['hide_url'] && ! empty( $testimonial_url );
|
1570 |
-
|
1571 |
-
$item_reviewed = self::clean_string( $atts['item_reviewed'] );
|
1572 |
-
$item_reviewed_url = self::clean_string( $atts['item_reviewed_url'] );
|
1573 |
-
|
1574 |
-
$schema = sprintf( self::$schema_div_open, self::$review_schema );
|
1575 |
-
$schema .= "\n";
|
1576 |
-
|
1577 |
-
$author_meta = array();
|
1578 |
-
$item_meta = array();
|
1579 |
-
$location_meta = array();
|
1580 |
-
$org_meta = array();
|
1581 |
-
$review_meta = array();
|
1582 |
-
|
1583 |
-
if ( ! empty( $testimonial_author ) ) {
|
1584 |
-
$author_meta[ self::$thing_name ] = $testimonial_author;
|
1585 |
-
}
|
1586 |
-
|
1587 |
-
if ( $do_source ) {
|
1588 |
-
if ( empty( $testimonial_author ) ) {
|
1589 |
-
$author_meta[ self::$thing_name ] = $testimonial_source;
|
1590 |
-
} else {
|
1591 |
-
$review_meta[ self::$thing_name ] = $testimonial_source;
|
1592 |
-
}
|
1593 |
-
}
|
1594 |
-
|
1595 |
-
if ( $do_title ) {
|
1596 |
-
$author_meta[ self::$person_job_title ] = $testimonial_title;
|
1597 |
-
}
|
1598 |
-
|
1599 |
-
if ( $do_email ) {
|
1600 |
-
$author_meta[ self::$person_email ] = $testimonial_email;
|
1601 |
-
}
|
1602 |
-
|
1603 |
-
if ( ! $do_company ) {
|
1604 |
-
if ( $do_url ) {
|
1605 |
-
$author_meta[ self::$thing_url ] = $testimonial_url;
|
1606 |
-
}
|
1607 |
-
} else {
|
1608 |
-
if ( $do_url ) {
|
1609 |
-
$org_meta[ self::$thing_url ] = $testimonial_url;
|
1610 |
-
}
|
1611 |
-
|
1612 |
-
$org_meta[ self::$thing_name ] = $testimonial_company;
|
1613 |
-
}
|
1614 |
-
|
1615 |
-
if ( $do_location ) {
|
1616 |
-
$location_meta[ self::$thing_name ] = $testimonial_location;
|
1617 |
-
|
1618 |
-
if ( ! $do_company ) {
|
1619 |
-
$author_meta[ self::$person_home ] = array( self::$place_schema, $location_meta );
|
1620 |
-
} else {
|
1621 |
-
$org_meta[ self::$org_location ] = array( self::$place_schema, $location_meta );
|
1622 |
-
}
|
1623 |
-
}
|
1624 |
-
|
1625 |
-
if ( ! empty( $author_meta ) && ! empty( $org_meta ) ) {
|
1626 |
-
$author_meta[ self::$person_member ] = array( self::$org_schema, $org_meta );
|
1627 |
-
} elseif ( ! empty( $org_meta ) ) {
|
1628 |
-
$author_meta[ self::$cw_source_org ] = array( self::$org_schema, $org_meta );
|
1629 |
-
}
|
1630 |
-
|
1631 |
-
$author_meta = apply_filters( 'tw_schema_author', $author_meta, $testimonial, $atts );
|
1632 |
-
$author = self::create_schema_div_prop( self::$cw_author, self::$person_schema, $author_meta );
|
1633 |
-
$schema .= $author;
|
1634 |
-
$schema .= "\n";
|
1635 |
-
|
1636 |
-
$post = get_post( $testimonial['post_id'] );
|
1637 |
-
$the_date = mysql2date( 'Y-m-d', $post->post_date );
|
1638 |
-
$the_date_mod = mysql2date( 'Y-m-d', $post->post_modified );
|
1639 |
-
|
1640 |
-
$review_name_length = apply_filters( 'tw_review_name_length', 156 );
|
1641 |
-
|
1642 |
-
if ( $do_content ) {
|
1643 |
-
$review_meta[ self::$review_body ] = $testimonial['testimonial_content'];
|
1644 |
-
}
|
1645 |
-
|
1646 |
-
$review_meta[ self::$cw_date ] = $the_date;
|
1647 |
-
$review_meta[ self::$cw_date_mod ] = $the_date_mod;
|
1648 |
-
$review_meta[ self::$thing_url ] = get_permalink( $post->ID );
|
1649 |
-
if ( empty( $review_meta[ self::$thing_name ] ) ) {
|
1650 |
-
$review_meta[ self::$thing_name ] = self::testimonials_truncate( $testimonial_content, $review_name_length );
|
1651 |
-
}
|
1652 |
-
|
1653 |
-
if ( $do_image ) {
|
1654 |
-
$src = self::get_image_src( $testimonial_image );
|
1655 |
-
|
1656 |
-
$review_meta[ self::$thing_image ] = $src;
|
1657 |
-
}
|
1658 |
-
|
1659 |
-
$review_meta = apply_filters( 'tw_schema_review', $review_meta, $testimonial, $atts );
|
1660 |
-
$review = self::create_schema_meta( $review_meta );
|
1661 |
-
$schema .= $review;
|
1662 |
-
$schema .= "\n";
|
1663 |
-
|
1664 |
-
$item_meta[ self::$thing_name ] = $item_reviewed;
|
1665 |
-
$item_meta[ self::$thing_url ] = $item_reviewed_url;
|
1666 |
-
|
1667 |
-
$item_meta = apply_filters( 'tw_schema_item', $item_meta, $testimonial, $atts );
|
1668 |
-
$item = self::create_schema_div_prop( self::$review_item, self::$thing_schema, $item_meta );
|
1669 |
-
$schema .= $item;
|
1670 |
-
$schema .= "\n";
|
1671 |
-
|
1672 |
-
$schema .= '</div>';
|
1673 |
-
$schema .= "\n";
|
1674 |
-
|
1675 |
-
$schema = apply_filters( 'tw_schema', $schema, $testimonial, $atts );
|
1676 |
-
|
1677 |
-
return $schema;
|
1678 |
-
}
|
1679 |
-
|
1680 |
-
|
1681 |
-
public static function create_schema_meta( $meta_data ) {
|
1682 |
-
$meta = '';
|
1683 |
-
|
1684 |
-
if ( empty( $meta_data ) ) {
|
1685 |
-
return $meta;
|
1686 |
-
}
|
1687 |
-
|
1688 |
-
foreach ( $meta_data as $key => $value ) {
|
1689 |
-
if ( is_array( $value ) ) {
|
1690 |
-
$meta .= self::create_schema_div_prop( $key, $value[0], $value[1] );
|
1691 |
-
} else {
|
1692 |
-
$meta .= sprintf( self::$schema_meta, $key, $value );
|
1693 |
-
}
|
1694 |
-
|
1695 |
-
$meta .= "\n";
|
1696 |
-
}
|
1697 |
-
|
1698 |
-
return $meta;
|
1699 |
-
}
|
1700 |
-
|
1701 |
-
|
1702 |
-
public static function create_schema_div_prop( $property_name, $schema_name, $meta_data ) {
|
1703 |
-
$meta = '';
|
1704 |
-
$schema = '';
|
1705 |
-
|
1706 |
-
if ( empty( $meta_data ) ) {
|
1707 |
-
return $schema;
|
1708 |
-
}
|
1709 |
-
|
1710 |
-
if ( is_array( $meta_data ) ) {
|
1711 |
-
foreach ( $meta_data as $key => $value ) {
|
1712 |
-
if ( is_array( $value ) ) {
|
1713 |
-
$meta .= self::create_schema_div_prop( $key, $value[0], $value[1] );
|
1714 |
-
} else {
|
1715 |
-
$meta .= sprintf( self::$schema_meta, $key, $value );
|
1716 |
-
}
|
1717 |
-
|
1718 |
-
$meta .= "\n";
|
1719 |
-
}
|
1720 |
-
|
1721 |
-
$schema = sprintf( self::$schema_div_prop, $property_name, $schema_name, $meta );
|
1722 |
-
} else {
|
1723 |
-
$schema = sprintf( self::$schema_div_prop, $property_name, $schema_name, $meta_data );
|
1724 |
-
}
|
1725 |
-
|
1726 |
-
return $schema;
|
1727 |
-
}
|
1728 |
-
|
1729 |
-
|
1730 |
-
public static function generate_css( $atts, $widget_number = null ) {
|
1731 |
-
$atts['subtype'] = 'css';
|
1732 |
-
|
1733 |
-
$css = apply_filters( 'tw_cache_get', false, $atts );
|
1734 |
-
if ( false === $css ) {
|
1735 |
-
$css = self::get_testimonials_html_css( $atts, $widget_number );
|
1736 |
-
$css = apply_filters( 'tw_cache_set', $css, $atts );
|
1737 |
-
}
|
1738 |
-
|
1739 |
-
if ( ! empty( $css ) ) {
|
1740 |
-
self::$css = array_merge( $css, self::$css );
|
1741 |
-
add_action( 'wp_footer', array( __CLASS__, 'get_testimonials_css' ), 20 );
|
1742 |
-
}
|
1743 |
-
}
|
1744 |
-
|
1745 |
-
|
1746 |
-
public static function generate_js( $testimonials, $atts, $widget_number = null ) {
|
1747 |
-
$atts['subtype'] = 'js';
|
1748 |
-
|
1749 |
-
$js = apply_filters( 'tw_cache_get', false, $atts );
|
1750 |
-
if ( false === $js ) {
|
1751 |
-
$js = self::get_testimonials_html_js( $testimonials, $atts, $widget_number );
|
1752 |
-
$js = apply_filters( 'tw_cache_set', $js, $atts );
|
1753 |
-
}
|
1754 |
-
|
1755 |
-
if ( ! empty( $js ) ) {
|
1756 |
-
self::$scripts = array_merge( $js, self::$scripts );
|
1757 |
-
add_action( 'wp_footer', array( __CLASS__, 'get_testimonials_scripts' ), 20 );
|
1758 |
-
}
|
1759 |
-
}
|
1760 |
-
|
1761 |
-
|
1762 |
-
public static function call_scripts_styles( $testimonials, $atts, $widget_number = null ) {
|
1763 |
-
if ( is_null( $widget_number ) ) {
|
1764 |
-
$widget_number = self::get_instance();
|
1765 |
-
}
|
1766 |
-
|
1767 |
-
self::scripts( $atts );
|
1768 |
-
|
1769 |
-
self::generate_css( $atts );
|
1770 |
-
self::generate_js( $testimonials, $atts, $widget_number );
|
1771 |
-
}
|
1772 |
-
|
1773 |
-
|
1774 |
-
public static function make_gravatar_featured( $post_id, $email ) {
|
1775 |
-
$size = get_option( 'large_size_w' );
|
1776 |
-
$image = get_avatar( $email, $size );
|
1777 |
-
$src = self::get_image_src( $image, false );
|
1778 |
-
$file = sanitize_title( $email ) . '.jpeg';
|
1779 |
-
|
1780 |
-
self::add_media( $post_id, $src, $file );
|
1781 |
-
}
|
1782 |
-
|
1783 |
-
|
1784 |
-
public static function notice_2_15_0() {
|
1785 |
-
$text = sprintf( __( 'If your Testimonials display has gone to funky town, please <a href="%s">read the FAQ</a> about possible fixes.', 'testimonials-widget' ), esc_url( 'https://nodedesk.zendesk.com/hc/en-us/articles/202331821-Major-Change-for-2-15-0' ) );
|
1786 |
-
|
1787 |
-
aihr_notice_updated( $text );
|
1788 |
-
}
|
1789 |
-
|
1790 |
-
|
1791 |
-
public static function set_not_found( $not_found = false ) {
|
1792 |
-
self::$not_found = $not_found;
|
1793 |
-
}
|
1794 |
-
|
1795 |
-
|
1796 |
-
public static function get_not_found() {
|
1797 |
-
return self::$not_found;
|
1798 |
-
}
|
1799 |
-
|
1800 |
-
|
1801 |
-
public static function version_check() {
|
1802 |
-
$valid_version = true;
|
1803 |
-
if ( ! $valid_version ) {
|
1804 |
-
$deactivate_reason = esc_html__( 'Failed version check', 'testimonials-widget' );
|
1805 |
-
aihr_deactivate_plugin( self::BASE, TW_NAME, $deactivate_reason );
|
1806 |
-
self::check_notices();
|
1807 |
-
}
|
1808 |
-
|
1809 |
-
return $valid_version;
|
1810 |
-
}
|
1811 |
-
|
1812 |
-
|
1813 |
-
/**
|
1814 |
-
*
|
1815 |
-
*
|
1816 |
-
* @SuppressWarnings(PHPMD.Superglobals)
|
1817 |
-
*/
|
1818 |
-
public static function do_load() {
|
1819 |
-
$do_load = false;
|
1820 |
-
if ( ! empty( $GLOBALS['pagenow'] ) && in_array( $GLOBALS['pagenow'], array( 'options.php', 'widgets.php' ) ) ) {
|
1821 |
-
$do_load = true;
|
1822 |
-
} elseif ( ! empty( $_REQUEST['post_type'] ) && self::PT == $_REQUEST['post_type'] ) {
|
1823 |
-
if ( ! empty( $GLOBALS['pagenow'] ) && in_array( $GLOBALS['pagenow'], array( 'edit.php', 'edit-tags.php' ) ) ) {
|
1824 |
-
$do_load = true;
|
1825 |
-
} elseif ( ! empty( $_REQUEST['option_page'] ) && Axl_Testimonials_Widget_Settings::ID == $_REQUEST['option_page'] ) {
|
1826 |
-
$do_load = true;
|
1827 |
-
}
|
1828 |
-
}
|
1829 |
-
|
1830 |
-
return $do_load;
|
1831 |
-
}
|
1832 |
-
|
1833 |
-
|
1834 |
-
public static function category_columns( $columns ) {
|
1835 |
-
$columns['shortcode'] = esc_html__( 'Shortcode', 'testimonials-widget' );
|
1836 |
-
|
1837 |
-
return $columns;
|
1838 |
-
}
|
1839 |
-
|
1840 |
-
|
1841 |
-
public static function category_column( $result, $column_name, $term_id, $category = true ) {
|
1842 |
-
$attribute = $category ? 'category' : 'tags';
|
1843 |
-
|
1844 |
-
$use_cpt_taxonomy = tw_get_option( 'use_cpt_taxonomy', false );
|
1845 |
-
if ( ! $use_cpt_taxonomy ) {
|
1846 |
-
if ( $category ) {
|
1847 |
-
$term = get_term( $term_id, 'category' );
|
1848 |
-
} else {
|
1849 |
-
$term = get_term( $term_id, 'post_tag' );
|
1850 |
-
}
|
1851 |
-
} else {
|
1852 |
-
if ( $category ) {
|
1853 |
-
$term = get_term( $term_id, self::$cpt_category );
|
1854 |
-
} else {
|
1855 |
-
$term = get_term( $term_id, self::$cpt_tags );
|
1856 |
-
}
|
1857 |
-
}
|
1858 |
-
|
1859 |
-
switch ( $column_name ) {
|
1860 |
-
case 'shortcode':
|
1861 |
-
$result = '[testimonials ' . $attribute . '="' .$term->slug . '"]';
|
1862 |
-
$result .= '<br />';
|
1863 |
-
$result .= '[testimonials_slider ' . $attribute . '="' .$term->slug . '"]';
|
1864 |
-
break;
|
1865 |
-
}
|
1866 |
-
|
1867 |
-
return $result;
|
1868 |
-
}
|
1869 |
-
|
1870 |
-
|
1871 |
-
public static function post_tag_column( $result, $column_name, $term_id ) {
|
1872 |
-
return self::category_column( $result, $column_name, $term_id, false );
|
1873 |
-
}
|
1874 |
-
|
1875 |
-
|
1876 |
-
public static function dashboard_glance_items( $array ) {
|
1877 |
-
if ( ! current_user_can( 'edit_others_posts' ) ) {
|
1878 |
-
return $array;
|
1879 |
-
}
|
1880 |
-
|
1881 |
-
$count = apply_filters( 'tw_cache_get', false, 'dashboard_count' );
|
1882 |
-
if ( false === $count ) {
|
1883 |
-
$posts = wp_count_posts( self::PT );
|
1884 |
-
$count = $posts->publish;
|
1885 |
-
$count = apply_filters( 'tw_cache_set', $count, 'dashboard_count' );
|
1886 |
-
}
|
1887 |
-
|
1888 |
-
if ( $count ) {
|
1889 |
-
$content = '%1$s%2$s %3$s%4$s';
|
1890 |
-
$name = _n( 'Testimonial', 'Testimonials', $count, 'testimonials-widget-premium', 'testimonials-widget' );
|
1891 |
-
$count_f = number_format_i18n( $count );
|
1892 |
-
$a_open = '<a href="edit.php?post_type=' . self::PT . '">';
|
1893 |
-
$a_close = '</a>';
|
1894 |
-
|
1895 |
-
$array[] = sprintf( $content, $a_open, $count_f, $name, $a_close );
|
1896 |
-
}
|
1897 |
-
|
1898 |
-
return $array;
|
1899 |
-
}
|
1900 |
-
|
1901 |
-
|
1902 |
-
/**
|
1903 |
-
* @SuppressWarnings(PHPMD.Superglobals)
|
1904 |
-
*/
|
1905 |
-
public static function do_video( $content, $atts ) {
|
1906 |
-
$enable_video = $atts['enable_video'];
|
1907 |
-
if ( $enable_video && ! empty( $GLOBALS['wp_embed'] ) ) {
|
1908 |
-
$content = $GLOBALS['wp_embed']->autoembed( $content );
|
1909 |
-
$content = $GLOBALS['wp_embed']->run_shortcode( $content );
|
1910 |
-
}
|
1911 |
-
|
1912 |
-
return $content;
|
1913 |
-
}
|
1914 |
-
|
1915 |
-
|
1916 |
-
public static function get_template_part( $slug, $name = null ) {
|
1917 |
-
if ( is_null( self::$template_loader ) ) {
|
1918 |
-
self::$template_loader = new Axl_Testimonials_Widget_Template_Loader();
|
1919 |
-
}
|
1920 |
-
|
1921 |
-
ob_start();
|
1922 |
-
self::$template_loader->get_template_part( $slug, $name );
|
1923 |
-
$content = ob_get_clean();
|
1924 |
-
|
1925 |
-
return $content;
|
1926 |
-
}
|
1927 |
-
|
1928 |
-
|
1929 |
-
public static function pre_get_posts_allow_testimonials( $query ) {
|
1930 |
-
if ( $query->is_admin ) {
|
1931 |
-
return $query;
|
1932 |
-
} elseif ( ( $query->is_main_query() || is_feed() )
|
1933 |
-
&& ! is_page()
|
1934 |
-
&& ( ( ! empty( $query->query_vars['post_type'] ) && 'post' == $query->query_vars['post_type'] )
|
1935 |
-
|| is_archive() )
|
1936 |
-
) {
|
1937 |
-
$query->set( 'post_type', array( 'post', self::PT ) );
|
1938 |
-
}
|
1939 |
-
|
1940 |
-
return $query;
|
1941 |
-
}
|
1942 |
-
|
1943 |
-
|
1944 |
-
public static function testimonials_archives( $atts, $widget_number = null ) {
|
1945 |
-
$atts = wp_parse_args( $atts, Axl_Testimonials_Widget_Archives_Widget::get_defaults() );
|
1946 |
-
$atts = Axl_Testimonials_Widget_Archives_Widget::validate_settings( $atts );
|
1947 |
-
|
1948 |
-
$atts['type'] = 'testimonials_archives';
|
1949 |
-
|
1950 |
-
$instance = ! empty( $widget_number ) ? $widget_number : self::add_instance();
|
1951 |
-
$atts['widget_number'] = $instance;
|
1952 |
-
|
1953 |
-
$content = apply_filters( 'tw_cache_get', false, $atts );
|
1954 |
-
if ( false === $content ) {
|
1955 |
-
$content = self::get_archives_html( $atts );
|
1956 |
-
$content = apply_filters( 'tw_cache_set', $content, $atts );
|
1957 |
-
}
|
1958 |
-
|
1959 |
-
self::call_scripts_styles( array(), $atts, $instance );
|
1960 |
-
|
1961 |
-
return $content;
|
1962 |
-
}
|
1963 |
-
|
1964 |
-
|
1965 |
-
/**
|
1966 |
-
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
1967 |
-
*/
|
1968 |
-
public static function get_archives_html( $atts ) {
|
1969 |
-
global $tw_template_args;
|
1970 |
-
|
1971 |
-
$tw_template_args = compact( 'atts' );
|
1972 |
-
|
1973 |
-
$content = self::get_template_part( 'testimonials', 'archives' );
|
1974 |
-
|
1975 |
-
return $content;
|
1976 |
-
}
|
1977 |
-
|
1978 |
-
|
1979 |
-
public static function get_archives_link( $link_html ) {
|
1980 |
-
$home_url = home_url();
|
1981 |
-
$slug = Aihrus_Common::get_archive_slug( self::PT );
|
1982 |
-
$link_html = str_replace( $home_url, $home_url . '/' . $slug, $link_html );
|
1983 |
-
|
1984 |
-
return $link_html;
|
1985 |
-
}
|
1986 |
-
|
1987 |
-
|
1988 |
-
public static function generate_rewrite_rules( $wp_rewrite ) {
|
1989 |
-
$rules = Aihrus_Common::rewrite_rules_date_archives( self::PT, $wp_rewrite );
|
1990 |
-
$wp_rewrite->rules = $rules + $wp_rewrite->rules;
|
1991 |
-
|
1992 |
-
return $wp_rewrite;
|
1993 |
-
}
|
1994 |
-
|
1995 |
-
|
1996 |
-
/**
|
1997 |
-
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
1998 |
-
*/
|
1999 |
-
public static function getarchives_where( $where, $args ) {
|
2000 |
-
return "WHERE post_type = '" . Axl_Testimonials_Widget::PT . "' AND post_status = 'publish'";
|
2001 |
-
}
|
2002 |
-
|
2003 |
-
|
2004 |
-
public static function testimonials_categories( $atts, $widget_number = null ) {
|
2005 |
-
$atts = wp_parse_args( $atts, Axl_Testimonials_Widget_Categories_Widget::get_defaults() );
|
2006 |
-
$atts = Axl_Testimonials_Widget_Categories_Widget::validate_settings( $atts );
|
2007 |
-
|
2008 |
-
$atts['type'] = 'testimonials_categories';
|
2009 |
-
|
2010 |
-
$instance = ! empty( $widget_number ) ? $widget_number : self::add_instance();
|
2011 |
-
$atts['widget_number'] = $instance;
|
2012 |
-
|
2013 |
-
$content = apply_filters( 'tw_cache_get', false, $atts );
|
2014 |
-
if ( false === $content ) {
|
2015 |
-
$content = self::get_categories_html( $atts );
|
2016 |
-
$content = apply_filters( 'tw_cache_set', $content, $atts );
|
2017 |
-
}
|
2018 |
-
|
2019 |
-
self::call_scripts_styles( array(), $atts, $instance );
|
2020 |
-
|
2021 |
-
return $content;
|
2022 |
-
}
|
2023 |
-
|
2024 |
-
|
2025 |
-
/**
|
2026 |
-
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
2027 |
-
*/
|
2028 |
-
public static function get_categories_html( $atts ) {
|
2029 |
-
global $tw_template_args;
|
2030 |
-
|
2031 |
-
$tw_template_args = compact( 'atts' );
|
2032 |
-
|
2033 |
-
$content = self::get_template_part( 'testimonials', 'categories' );
|
2034 |
-
|
2035 |
-
return $content;
|
2036 |
-
}
|
2037 |
-
|
2038 |
-
|
2039 |
-
public static function testimonials_recent( $atts, $widget_number = null ) {
|
2040 |
-
$atts = wp_parse_args( $atts, Axl_Testimonials_Widget_Recent_Testimonials_Widget::get_defaults() );
|
2041 |
-
$atts = Axl_Testimonials_Widget_Recent_Testimonials_Widget::validate_settings( $atts );
|
2042 |
-
|
2043 |
-
$atts['type'] = 'testimonials_recent';
|
2044 |
-
|
2045 |
-
$instance = ! empty( $widget_number ) ? $widget_number : self::add_instance();
|
2046 |
-
$atts['widget_number'] = $instance;
|
2047 |
-
|
2048 |
-
$content = apply_filters( 'tw_cache_get', false, $atts );
|
2049 |
-
if ( false === $content ) {
|
2050 |
-
$content = self::get_recent_html( $atts );
|
2051 |
-
$content = apply_filters( 'tw_cache_set', $content, $atts );
|
2052 |
-
}
|
2053 |
-
|
2054 |
-
self::call_scripts_styles( array(), $atts, $instance );
|
2055 |
-
|
2056 |
-
return $content;
|
2057 |
-
}
|
2058 |
-
|
2059 |
-
|
2060 |
-
/**
|
2061 |
-
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
2062 |
-
*/
|
2063 |
-
public static function get_recent_html( $atts ) {
|
2064 |
-
global $tw_template_args;
|
2065 |
-
|
2066 |
-
$tw_template_args = compact( 'atts' );
|
2067 |
-
|
2068 |
-
$content = self::get_template_part( 'testimonials', 'recent' );
|
2069 |
-
|
2070 |
-
return $content;
|
2071 |
-
}
|
2072 |
-
|
2073 |
-
|
2074 |
-
public static function testimonials_tag_cloud( $atts, $widget_number = null ) {
|
2075 |
-
$atts = wp_parse_args( $atts, Axl_Testimonials_Widget_Tag_Cloud_Widget::get_defaults() );
|
2076 |
-
$atts = Axl_Testimonials_Widget_Tag_Cloud_Widget::validate_settings( $atts );
|
2077 |
-
|
2078 |
-
$atts['type'] = 'testimonials_tag_cloud';
|
2079 |
-
|
2080 |
-
$instance = ! empty( $widget_number ) ? $widget_number : self::add_instance();
|
2081 |
-
$atts['widget_number'] = $instance;
|
2082 |
-
|
2083 |
-
$content = apply_filters( 'tw_cache_get', false, $atts );
|
2084 |
-
if ( false === $content ) {
|
2085 |
-
$content = self::get_tag_cloud_html( $atts );
|
2086 |
-
$content = apply_filters( 'tw_cache_set', $content, $atts );
|
2087 |
-
}
|
2088 |
-
|
2089 |
-
self::call_scripts_styles( array(), $atts, $instance );
|
2090 |
-
|
2091 |
-
return $content;
|
2092 |
-
}
|
2093 |
-
|
2094 |
-
|
2095 |
-
/**
|
2096 |
-
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
2097 |
-
*/
|
2098 |
-
public static function get_tag_cloud_html( $atts ) {
|
2099 |
-
global $tw_template_args;
|
2100 |
-
|
2101 |
-
$tw_template_args = compact( 'atts' );
|
2102 |
-
|
2103 |
-
$content = self::get_template_part( 'testimonials', 'tag-cloud' );
|
2104 |
-
|
2105 |
-
return $content;
|
2106 |
-
}
|
2107 |
-
|
2108 |
-
|
2109 |
-
public static function get_review_count( $testimonial ) {
|
2110 |
-
self::$aggregate_data = apply_filters( 'tw_cache_get', self::$aggregate_data, 'tw_aggregate_data' );
|
2111 |
-
|
2112 |
-
$testimonial_item = ! empty( $testimonial['testimonial_item'] ) ? $testimonial['testimonial_item'] : self::$aggregate_no_item;
|
2113 |
-
if ( ! isset( self::$aggregate_data[ $testimonial_item ]['count'] ) ) {
|
2114 |
-
if ( self::$aggregate_no_item != $testimonial_item ) {
|
2115 |
-
// @codingStandardsIgnoreStart
|
2116 |
-
$query_args = array(
|
2117 |
-
'post_type' => Axl_Testimonials_Widget::PT,
|
2118 |
-
'posts_per_page' => -1,
|
2119 |
-
'meta_query' => array(
|
2120 |
-
'relation' => 'AND',
|
2121 |
-
array(
|
2122 |
-
'key' => 'testimonials-widget-item',
|
2123 |
-
'value' => $testimonial_item,
|
2124 |
-
'compare' => '=',
|
2125 |
-
),
|
2126 |
-
),
|
2127 |
-
);
|
2128 |
-
// @codingStandardsIgnoreEnd
|
2129 |
-
} else {
|
2130 |
-
// @codingStandardsIgnoreStart
|
2131 |
-
$query_args = array(
|
2132 |
-
'post_type' => Axl_Testimonials_Widget::PT,
|
2133 |
-
'posts_per_page' => -1,
|
2134 |
-
'meta_query' => array(
|
2135 |
-
'relation' => 'AND',
|
2136 |
-
array(
|
2137 |
-
'key' => 'testimonials-widget-item',
|
2138 |
-
'value' => '',
|
2139 |
-
'compare' => '=',
|
2140 |
-
),
|
2141 |
-
),
|
2142 |
-
);
|
2143 |
-
// @codingStandardsIgnoreEnd
|
2144 |
-
}
|
2145 |
-
|
2146 |
-
$count = 0;
|
2147 |
-
$query = new WP_Query( $query_args );
|
2148 |
-
while ( $query->have_posts() ) {
|
2149 |
-
$query->the_post();
|
2150 |
-
$count++;
|
2151 |
-
}
|
2152 |
-
|
2153 |
-
self::$aggregate_data[ $testimonial_item ]['count'] = $count;
|
2154 |
-
|
2155 |
-
self::$aggregate_data = apply_filters( 'tw_cache_set', self::$aggregate_data, 'tw_aggregate_data' );
|
2156 |
-
}
|
2157 |
-
|
2158 |
-
return self::$aggregate_data[ $testimonial_item ]['count'];
|
2159 |
-
}
|
2160 |
-
|
2161 |
-
|
2162 |
-
/**
|
2163 |
-
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
2164 |
-
*/
|
2165 |
-
public static function testimonials_examples( $atts = null ) {
|
2166 |
-
$atts = wp_parse_args( $atts, self::get_defaults() );
|
2167 |
-
|
2168 |
-
$atts['type'] = 'testimonials_examples';
|
2169 |
-
|
2170 |
-
$content = apply_filters( 'tw_cache_get', false, $atts );
|
2171 |
-
if ( false === $content ) {
|
2172 |
-
$content = self::get_testimonials_examples( $atts );
|
2173 |
-
$content = apply_filters( 'tw_cache_set', $content, $atts );
|
2174 |
-
}
|
2175 |
-
|
2176 |
-
self::call_scripts_styles( array(), $atts );
|
2177 |
-
|
2178 |
-
return $content;
|
2179 |
-
}
|
2180 |
-
|
2181 |
-
|
2182 |
-
/**
|
2183 |
-
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
2184 |
-
*/
|
2185 |
-
public static function get_testimonials_examples( $atts = null ) {
|
2186 |
-
$examples_file = TW_DIR . 'EXAMPLES.md';
|
2187 |
-
$examples_html = self::markdown2html( $examples_file );
|
2188 |
-
$examples_html = apply_filters( 'tw_examples_html', $examples_html );
|
2189 |
-
$examples_html = str_replace( '[[', '[', $examples_html );
|
2190 |
-
$examples_html = str_replace( ']]', ']', $examples_html );
|
2191 |
-
|
2192 |
-
return $examples_html;
|
2193 |
-
}
|
2194 |
-
|
2195 |
-
|
2196 |
-
/**
|
2197 |
-
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
2198 |
-
*/
|
2199 |
-
public static function testimonials_options( $atts = null ) {
|
2200 |
-
$atts = wp_parse_args( $atts, self::get_defaults() );
|
2201 |
-
|
2202 |
-
$atts['type'] = 'testimonials_options';
|
2203 |
-
|
2204 |
-
$content = apply_filters( 'tw_cache_get', false, $atts );
|
2205 |
-
if ( false === $content ) {
|
2206 |
-
$content = self::get_testimonials_options( $atts );
|
2207 |
-
$content = apply_filters( 'tw_cache_set', $content, $atts );
|
2208 |
-
}
|
2209 |
-
|
2210 |
-
self::call_scripts_styles( array(), $atts );
|
2211 |
-
|
2212 |
-
return $content;
|
2213 |
-
}
|
2214 |
-
|
2215 |
-
|
2216 |
-
/**
|
2217 |
-
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
2218 |
-
*/
|
2219 |
-
public static function get_testimonials_options( $atts = null ) {
|
2220 |
-
$sections = Axl_Testimonials_Widget_Settings::get_sections();
|
2221 |
-
$settings = Axl_Testimonials_Widget_Settings::get_settings();
|
2222 |
-
|
2223 |
-
$ignored_types = array( 'expand_begin', 'expand_end', 'expand_all', 'content' );
|
2224 |
-
|
2225 |
-
$do_continue = false;
|
2226 |
-
$do_used_with = false;
|
2227 |
-
|
2228 |
-
$first_dl = true;
|
2229 |
-
$open_dl = false;
|
2230 |
-
$html = '';
|
2231 |
-
foreach ( $settings as $setting => $parts ) {
|
2232 |
-
if ( in_array( $parts['type'], $ignored_types ) ) {
|
2233 |
-
continue;
|
2234 |
-
}
|
2235 |
-
|
2236 |
-
if ( empty( $parts['show_code'] ) ) {
|
2237 |
-
continue;
|
2238 |
-
}
|
2239 |
-
|
2240 |
-
// section header
|
2241 |
-
if ( ! empty( $sections[ $parts['section'] ] ) ) {
|
2242 |
-
if ( ! $first_dl ) {
|
2243 |
-
$html .= '</dl>';
|
2244 |
-
|
2245 |
-
$open_dl = false;
|
2246 |
-
}
|
2247 |
-
|
2248 |
-
$html .= '<h2>' . $sections[ $parts['section'] ] . '</h2>';
|
2249 |
-
|
2250 |
-
unset( $sections[ $parts['section'] ] );
|
2251 |
-
|
2252 |
-
$do_used_with = true;
|
2253 |
-
}
|
2254 |
-
|
2255 |
-
if ( 'heading' == $parts['type'] ) {
|
2256 |
-
if ( $open_dl ) {
|
2257 |
-
$html .= '</dl>';
|
2258 |
-
|
2259 |
-
$open_dl = false;
|
2260 |
-
}
|
2261 |
-
|
2262 |
-
$html .= '<h2>' . $parts['desc'] . '</h2>';
|
2263 |
-
|
2264 |
-
$do_continue = true;
|
2265 |
-
$do_used_with = true;
|
2266 |
-
}
|
2267 |
-
|
2268 |
-
if ( $do_used_with ) {
|
2269 |
-
$used_with_codes = self::get_used_with_codes( $parts );
|
2270 |
-
if ( ! empty( $used_with_codes ) ) {
|
2271 |
-
$used_with_codes = implode( '</code>, <code>', $used_with_codes );
|
2272 |
-
|
2273 |
-
$html .= '<p>' . esc_html__( 'Used with: ', 'testimonials-widget' );
|
2274 |
-
$html .= '<code>' . $used_with_codes . '</code>';
|
2275 |
-
$html .= '</p>';
|
2276 |
-
}
|
2277 |
-
|
2278 |
-
$do_used_with = false;
|
2279 |
-
}
|
2280 |
-
|
2281 |
-
if ( $do_continue ) {
|
2282 |
-
$do_continue = false;
|
2283 |
-
|
2284 |
-
continue;
|
2285 |
-
}
|
2286 |
-
|
2287 |
-
if ( empty( $open_dl ) ) {
|
2288 |
-
$html .= '<dl>';
|
2289 |
-
|
2290 |
-
$first_dl = false;
|
2291 |
-
$open_dl = true;
|
2292 |
-
}
|
2293 |
-
|
2294 |
-
// option name
|
2295 |
-
$html .= '<dt>' . $parts['title'] . '</dt>';
|
2296 |
-
|
2297 |
-
// description
|
2298 |
-
if ( ! empty( $parts['desc'] ) ) {
|
2299 |
-
$html .= '<dd>' . $parts['desc'] . '</dd>';
|
2300 |
-
}
|
2301 |
-
|
2302 |
-
// validation helpers
|
2303 |
-
$validate = self::define_options_validate( $parts );
|
2304 |
-
if ( ! empty( $validate ) ) {
|
2305 |
-
$html .= '<dd>' . $validate . '</dd>';
|
2306 |
-
}
|
2307 |
-
|
2308 |
-
$choices = self::define_options_choices( $parts );
|
2309 |
-
if ( ! empty( $choices ) ) {
|
2310 |
-
$html .= '<dd>' . esc_html__( 'Options: ', 'testimonials-widget' ) . '<code>' . $choices . '</code></dd>';
|
2311 |
-
}
|
2312 |
-
|
2313 |
-
$value = self::define_options_value( $setting, $parts );
|
2314 |
-
if ( ! empty( $value ) ) {
|
2315 |
-
$html .= '<dd>' . esc_html__( 'Usage: ', 'testimonials-widget' ) . '<code>' . $setting . '="' . $value . '"</code></dd>';
|
2316 |
-
}
|
2317 |
-
}
|
2318 |
-
|
2319 |
-
// remaining widgets
|
2320 |
-
$widgets = array(
|
2321 |
-
'Axl_Testimonials_Widget_Archives_Widget' => 'testimonials_archives',
|
2322 |
-
'Axl_Testimonials_Widget_Categories_Widget' => 'testimonials_categories',
|
2323 |
-
'Axl_Testimonials_Widget_Recent_Testimonials_Widget' => 'testimonials_recent',
|
2324 |
-
'Axl_Testimonials_Widget_Tag_Cloud_Widget' => 'testimonials_tag_cloud',
|
2325 |
-
);
|
2326 |
-
|
2327 |
-
$widgets = apply_filters( 'tw_options_widgets', $widgets );
|
2328 |
-
|
2329 |
-
foreach ( $widgets as $widget => $shortcode ) {
|
2330 |
-
$form_parts = $widget::form_parts();
|
2331 |
-
|
2332 |
-
// section header
|
2333 |
-
$html .= '</dl>';
|
2334 |
-
$html .= '<h2>' . $widget::$title . '</h2>';
|
2335 |
-
|
2336 |
-
$used_with_codes = array(
|
2337 |
-
'[' . $shortcode . ']',
|
2338 |
-
'' . $shortcode . '()',
|
2339 |
-
);
|
2340 |
-
|
2341 |
-
$used_with_codes = apply_filters( 'tw_used_with_codes_widgets', $used_with_codes, $widget, $shortcode );
|
2342 |
-
|
2343 |
-
if ( ! empty( $used_with_codes ) ) {
|
2344 |
-
$used_with_codes = implode( '</code>, <code>', $used_with_codes );
|
2345 |
-
|
2346 |
-
$html .= '<p>' . esc_html__( 'Used with: ', 'testimonials-widget' );
|
2347 |
-
$html .= '<code>' . $used_with_codes . '</code>';
|
2348 |
-
$html .= '</p>';
|
2349 |
-
}
|
2350 |
-
|
2351 |
-
$html .= '<dl>';
|
2352 |
-
|
2353 |
-
foreach ( $form_parts as $setting => $parts ) {
|
2354 |
-
if ( in_array( $parts['type'], $ignored_types ) ) {
|
2355 |
-
continue;
|
2356 |
-
}
|
2357 |
-
|
2358 |
-
// option name
|
2359 |
-
$html .= '<dt>' . $parts['title'] . '</dt>';
|
2360 |
-
|
2361 |
-
// description
|
2362 |
-
if ( ! empty( $parts['desc'] ) ) {
|
2363 |
-
$html .= '<dd>' . $parts['desc'] . '</dd>';
|
2364 |
-
}
|
2365 |
-
|
2366 |
-
// validation helpers
|
2367 |
-
$validate = self::define_options_validate( $parts );
|
2368 |
-
if ( ! empty( $validate ) ) {
|
2369 |
-
$html .= '<dd>' . $validate . '</dd>';
|
2370 |
-
}
|
2371 |
-
|
2372 |
-
$choices = self::define_options_choices( $parts );
|
2373 |
-
if ( ! empty( $choices ) ) {
|
2374 |
-
$html .= '<dd>' . esc_html__( 'Options: ', 'testimonials-widget' ) . '<code>' . $choices . '</code></dd>';
|
2375 |
-
}
|
2376 |
-
|
2377 |
-
$value = self::define_options_value( $setting, $parts );
|
2378 |
-
if ( ! empty( $value ) ) {
|
2379 |
-
$html .= '<dd>' . esc_html__( 'Usage: ', 'testimonials-widget' ) . '<code>' . $setting . '="' . $value . '"</code></dd>';
|
2380 |
-
}
|
2381 |
-
}
|
2382 |
-
|
2383 |
-
if ( $open_dl ) {
|
2384 |
-
$html .= '</dl>';
|
2385 |
-
}
|
2386 |
-
}
|
2387 |
-
|
2388 |
-
if ( $open_dl ) {
|
2389 |
-
$html .= '</dl>';
|
2390 |
-
}
|
2391 |
-
|
2392 |
-
$html = links_add_target( $html, '_tw' );
|
2393 |
-
$html = apply_filters( 'tw_options_html', $html );
|
2394 |
-
|
2395 |
-
return $html;
|
2396 |
-
}
|
2397 |
-
|
2398 |
-
|
2399 |
-
public static function get_used_with_codes( $parts ) {
|
2400 |
-
$used_with_codes = array(
|
2401 |
-
'[testimonials_slider]',
|
2402 |
-
'testimonials_slider()',
|
2403 |
-
);
|
2404 |
-
|
2405 |
-
if ( 'widget' != $parts['section'] ) {
|
2406 |
-
$used_with_codes[] = '[testimonials]';
|
2407 |
-
$used_with_codes[] = 'testimonials()';
|
2408 |
-
}
|
2409 |
-
|
2410 |
-
$used_with_codes = apply_filters( 'tw_used_with_codes', $used_with_codes, $parts );
|
2411 |
-
|
2412 |
-
return $used_with_codes;
|
2413 |
-
}
|
2414 |
-
}
|
2415 |
-
|
2416 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/Gamajo-Template-Loader/CHANGELOG.md
DELETED
@@ -1,30 +0,0 @@
|
|
1 |
-
# Change Log for Gamajo Template Loader
|
2 |
-
|
3 |
-
## [Unreleased]
|
4 |
-
|
5 |
-
## [1.2.0] - 2016-03-26
|
6 |
-
|
7 |
-
- Support adding custom template data.
|
8 |
-
- Add check around class definition if class exists.
|
9 |
-
- Added `composer.json`.
|
10 |
-
- Fix code standards.
|
11 |
-
- Improve README.
|
12 |
-
- Move example meal planner class into README.
|
13 |
-
|
14 |
-
## [1.1.0] - 2014-03-08
|
15 |
-
|
16 |
-
- Fix bug so that the more specific template is preferred.
|
17 |
-
- Cache template path in a local variable.
|
18 |
-
- Change access to `locate_template()` method to public.
|
19 |
-
- Add `$plugin_template_directory` property.
|
20 |
-
- Initialise `$templates` variable.
|
21 |
-
- Add check if class exists in example code.
|
22 |
-
- Improve README
|
23 |
-
|
24 |
-
## 1.0.0 - 2013-12-09
|
25 |
-
|
26 |
-
- Initial release.
|
27 |
-
|
28 |
-
[Unreleased]: https://github.com/GaryJones/Gamajo-Template-Loader/compare/1.2.0...HEAD
|
29 |
-
[1.2.0]: https://github.com/GaryJones/Gamajo-Template-Loader/compare/1.1.0...1.2.0
|
30 |
-
[1.1.0]: https://github.com/GaryJones/Gamajo-Template-Loader/compare/1.0.0...1.1.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/Gamajo-Template-Loader/LICENSE
DELETED
@@ -1,339 +0,0 @@
|
|
1 |
-
GNU GENERAL PUBLIC LICENSE
|
2 |
-
Version 2, June 1991
|
3 |
-
|
4 |
-
Copyright (C) 1989, 1991 Free Software Foundation, Inc., <http://fsf.org/>
|
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 |
-
{description}
|
294 |
-
Copyright (C) {year} {fullname}
|
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/Gamajo-Template-Loader/README.md
DELETED
@@ -1,152 +0,0 @@
|
|
1 |
-
# Gamajo Template Loader
|
2 |
-
|
3 |
-
[![Code Climate](https://codeclimate.com/github/GaryJones/Gamajo-Template-Loader/badges/gpa.svg)](https://codeclimate.com/github/GaryJones/Gamajo-Template-Loader)
|
4 |
-
|
5 |
-
A class to copy into your WordPress plugin, to allow loading template parts with fallback through the child theme > parent theme > plugin.
|
6 |
-
|
7 |
-
## Description
|
8 |
-
|
9 |
-
Easy Digital Downloads, WooCommerce, and Events Calendar plugins, amongst others, allow you to add files to your theme to override the default templates that come with the plugin. As a developer, adding this convenience in to your own plugin can be a little tricky.
|
10 |
-
|
11 |
-
The `get_template_part()` function in WordPress was never really designed with plugins in mind, since it relies on `locate_template()` which only checks child and parent themes. So we can add in a final fallback that uses the templates in the plugin, we have to use a custom `locate_template()` function, and a custom `get_template_part()` function. The solution here just wraps them up as a class for convenience.
|
12 |
-
|
13 |
-
## Installation
|
14 |
-
|
15 |
-
This isn't a WordPress plugin on its own, so the usual instructions don't apply. Instead:
|
16 |
-
|
17 |
-
1. Copy [`class-gamajo-template-loader.php`](class-gamajo-template-loader.php) into your plugin. It can be into a file in the plugin root, or better, an `includes` directory.
|
18 |
-
2. Create a new file, such as `class-your-plugin-template-loader.php`, in the same directory.
|
19 |
-
3. Create a class in that file that extends `Gamajo_Template_Loader`. You can see the Meal Planner Template Loader example class below as a starting point if it helps.
|
20 |
-
4. Override the class properties to suit your plugin. You could also override the `get_templates_dir()` method if it isn't right for you.
|
21 |
-
5. You can now instantiate your custom template loader class, and use it to call the `get_template_part()` method. This could be within a shortcode callback, or something you want theme developers to include in their files.
|
22 |
-
|
23 |
-
~~~php
|
24 |
-
// Template loader instantiated elsewhere, such as the main plugin file.
|
25 |
-
$meal_planner_template_loader = new Meal_Planner_Template_Loader;
|
26 |
-
~~~
|
27 |
-
* Use it to call the `get_template_part()` method. This could be within a shortcode callback, or something you want theme developers to include in their files.
|
28 |
-
|
29 |
-
~~~php
|
30 |
-
$meal_planner_template_loader->get_template_part( 'recipe' );
|
31 |
-
~~~
|
32 |
-
* If you want to pass data to the template, call the `set_template_data()` method with an array before calling `get_template_part()`.
|
33 |
-
|
34 |
-
~~~php
|
35 |
-
$data = array( 'foo' => 'bar', 'baz' => 'boom' );
|
36 |
-
$meal_planner_template_loader->set_template_data( $data );
|
37 |
-
$meal_planner_template_loader->get_template_part( 'recipe' );
|
38 |
-
~~~
|
39 |
-
|
40 |
-
The value of `bar` is now available inside the recipe template as `$data['foo']`.
|
41 |
-
|
42 |
-
If you wish to use a different variable name, add a second parameter to `set_template_data()`:
|
43 |
-
|
44 |
-
~~~php
|
45 |
-
$data = array( 'foo' => 'bar', 'baz' => 'boom' );
|
46 |
-
$meal_planner_template_loader->set_template_data( $data, 'context' );
|
47 |
-
$meal_planner_template_loader->get_template_part( 'recipe', 'ingredients' );
|
48 |
-
~~~
|
49 |
-
|
50 |
-
The value of `bar` is now available inside the recipe template as `$context['foo']`.
|
51 |
-
|
52 |
-
This will try to load up `wp-content/themes/my-theme/meal-planner/recipe-ingredients.php`, or `wp-content/themes/my-theme/meal-planner/recipe.php`, then fallback to `wp-content/plugins/meal-planner/templates/recipe-ingredients.php` or `wp-content/plugins/meal-planner/templates/recipe.php`.
|
53 |
-
|
54 |
-
### Meal Planner Example Class
|
55 |
-
|
56 |
-
```php
|
57 |
-
<?php
|
58 |
-
/**
|
59 |
-
* Meal Planner
|
60 |
-
*
|
61 |
-
* @package Meal_Planner
|
62 |
-
* @author Gary Jones
|
63 |
-
* @link http://example.com/meal-planner
|
64 |
-
* @copyright 2013 Gary Jones
|
65 |
-
* @license GPL-2.0+
|
66 |
-
*/
|
67 |
-
|
68 |
-
if ( ! class_exists( 'Gamajo_Template_Loader' ) ) {
|
69 |
-
require plugin_dir_path( __FILE__ ) . 'class-gamajo-template-loader.php';
|
70 |
-
}
|
71 |
-
|
72 |
-
/**
|
73 |
-
* Template loader for Meal Planner.
|
74 |
-
*
|
75 |
-
* Only need to specify class properties here.
|
76 |
-
*
|
77 |
-
* @package Meal_Planner
|
78 |
-
* @author Gary Jones
|
79 |
-
*/
|
80 |
-
class Meal_Planner_Template_Loader extends Gamajo_Template_Loader {
|
81 |
-
/**
|
82 |
-
* Prefix for filter names.
|
83 |
-
*
|
84 |
-
* @since 1.0.0
|
85 |
-
*
|
86 |
-
* @var string
|
87 |
-
*/
|
88 |
-
protected $filter_prefix = 'meal_planner';
|
89 |
-
|
90 |
-
/**
|
91 |
-
* Directory name where custom templates for this plugin should be found in the theme.
|
92 |
-
*
|
93 |
-
* @since 1.0.0
|
94 |
-
*
|
95 |
-
* @var string
|
96 |
-
*/
|
97 |
-
protected $theme_template_directory = 'meal-planner';
|
98 |
-
|
99 |
-
/**
|
100 |
-
* Reference to the root directory path of this plugin.
|
101 |
-
*
|
102 |
-
* Can either be a defined constant, or a relative reference from where the subclass lives.
|
103 |
-
*
|
104 |
-
* In this case, `MEAL_PLANNER_PLUGIN_DIR` would be defined in the root plugin file as:
|
105 |
-
*
|
106 |
-
* ~~~
|
107 |
-
* define( 'MEAL_PLANNER_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
|
108 |
-
* ~~~
|
109 |
-
*
|
110 |
-
* @since 1.0.0
|
111 |
-
*
|
112 |
-
* @var string
|
113 |
-
*/
|
114 |
-
protected $plugin_directory = MEAL_PLANNER_PLUGIN_DIR;
|
115 |
-
|
116 |
-
/**
|
117 |
-
* Directory name where templates are found in this plugin.
|
118 |
-
*
|
119 |
-
* Can either be a defined constant, or a relative reference from where the subclass lives.
|
120 |
-
*
|
121 |
-
* e.g. 'templates' or 'includes/templates', etc.
|
122 |
-
*
|
123 |
-
* @since 1.1.0
|
124 |
-
*
|
125 |
-
* @var string
|
126 |
-
*/
|
127 |
-
protected $plugin_template_directory = 'templates';
|
128 |
-
}
|
129 |
-
```
|
130 |
-
|
131 |
-
## Usage Example
|
132 |
-
|
133 |
-
The [Cue](https://github.com/AudioTheme/cue) plugin from [AudioTheme](http://audiotheme.com/) uses this class. Starting at [https://github.com/AudioTheme/cue/tree/develop/includes](https://github.com/AudioTheme/cue/tree/develop/includes), it has this class in the vendor directory, then the required subclass of my class in the `class-cue-template-loader.php` file, which sets a few basic properties. It also has a template in [https://github.com/AudioTheme/cue/tree/develop/templates](https://github.com/AudioTheme/cue/tree/develop/templates).
|
134 |
-
|
135 |
-
If you wanted the playlist to have different markup for your theme, you'd copy `templates/playlist.php` to `wp-content/themes/{your-active-theme}/cue/playlist.php` and do whatever changes you wanted. WordPress will look for that file first, before then checking a parent theme location (if your active theme is a child theme), before falling back to the default template that comes with the Cue plugin.
|
136 |
-
|
137 |
-
## Change Log
|
138 |
-
|
139 |
-
See the [change log](CHANGELOG.md).
|
140 |
-
|
141 |
-
## License
|
142 |
-
|
143 |
-
[GPL-2.0+](LICENSE).
|
144 |
-
|
145 |
-
## Contributions
|
146 |
-
|
147 |
-
Contributions are welcome - fork, fix and send pull requests against the `develop` branch please.
|
148 |
-
|
149 |
-
## Credits
|
150 |
-
|
151 |
-
Built by [Gary Jones](https://twitter.com/GaryJ)
|
152 |
-
Copyright 2013 [Gamajo Tech](https://gamajo.com)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/Gamajo-Template-Loader/class-gamajo-template-loader.php
DELETED
@@ -1,267 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Template Loader for Plugins.
|
4 |
-
*
|
5 |
-
* @package Gamajo_Template_Loader
|
6 |
-
* @author Gary Jones
|
7 |
-
* @link http://github.com/GaryJones/Gamajo-Template-Loader
|
8 |
-
* @copyright 2013 Gary Jones
|
9 |
-
* @license GPL-2.0+
|
10 |
-
* @version 1.2.0
|
11 |
-
*/
|
12 |
-
|
13 |
-
if ( ! class_exists( 'Gamajo_Template_Loader' ) ) {
|
14 |
-
|
15 |
-
/**
|
16 |
-
* Template loader.
|
17 |
-
*
|
18 |
-
* Originally based on functions in Easy Digital Downloads (thanks Pippin!).
|
19 |
-
*
|
20 |
-
* When using in a plugin, create a new class that extends this one and just overrides the properties.
|
21 |
-
*
|
22 |
-
* @package Gamajo_Template_Loader
|
23 |
-
* @author Gary Jones
|
24 |
-
*/
|
25 |
-
class Gamajo_Template_Loader {
|
26 |
-
/**
|
27 |
-
* Prefix for filter names.
|
28 |
-
*
|
29 |
-
* @since 1.0.0
|
30 |
-
*
|
31 |
-
* @var string
|
32 |
-
*/
|
33 |
-
protected $filter_prefix = 'your_plugin';
|
34 |
-
|
35 |
-
/**
|
36 |
-
* Directory name where custom templates for this plugin should be found in the theme.
|
37 |
-
*
|
38 |
-
* For example: 'your-plugin-templates'.
|
39 |
-
*
|
40 |
-
* @since 1.0.0
|
41 |
-
*
|
42 |
-
* @var string
|
43 |
-
*/
|
44 |
-
protected $theme_template_directory = 'plugin-templates';
|
45 |
-
|
46 |
-
/**
|
47 |
-
* Reference to the root directory path of this plugin.
|
48 |
-
*
|
49 |
-
* Can either be a defined constant, or a relative reference from where the subclass lives.
|
50 |
-
*
|
51 |
-
* e.g. YOUR_PLUGIN_TEMPLATE or plugin_dir_path( dirname( __FILE__ ) ); etc.
|
52 |
-
*
|
53 |
-
* @since 1.0.0
|
54 |
-
*
|
55 |
-
* @var string
|
56 |
-
*/
|
57 |
-
protected $plugin_directory = 'YOUR_PLUGIN_DIR';
|
58 |
-
|
59 |
-
/**
|
60 |
-
* Directory name where templates are found in this plugin.
|
61 |
-
*
|
62 |
-
* Can either be a defined constant, or a relative reference from where the subclass lives.
|
63 |
-
*
|
64 |
-
* e.g. 'templates' or 'includes/templates', etc.
|
65 |
-
*
|
66 |
-
* @since 1.1.0
|
67 |
-
*
|
68 |
-
* @var string
|
69 |
-
*/
|
70 |
-
protected $plugin_template_directory = 'templates';
|
71 |
-
|
72 |
-
/**
|
73 |
-
* Clean up template data.
|
74 |
-
*
|
75 |
-
* @since 1.2.0
|
76 |
-
*/
|
77 |
-
public function __destruct() {
|
78 |
-
$this->unset_template_data();
|
79 |
-
}
|
80 |
-
|
81 |
-
/**
|
82 |
-
* Retrieve a template part.
|
83 |
-
*
|
84 |
-
* @since 1.0.0
|
85 |
-
*
|
86 |
-
* @param string $slug Template slug.
|
87 |
-
* @param string $name Optional. Template variation name. Default null.
|
88 |
-
* @param bool $load Optional. Whether to load template. Default true.
|
89 |
-
*
|
90 |
-
* @return string
|
91 |
-
*/
|
92 |
-
public function get_template_part( $slug, $name = null, $load = true ) {
|
93 |
-
// Execute code for this part.
|
94 |
-
do_action( 'get_template_part_' . $slug, $slug, $name );
|
95 |
-
|
96 |
-
// Get files names of templates, for given slug and name.
|
97 |
-
$templates = $this->get_template_file_names( $slug, $name );
|
98 |
-
|
99 |
-
// Return the part that is found.
|
100 |
-
return $this->locate_template( $templates, $load, false );
|
101 |
-
}
|
102 |
-
|
103 |
-
/**
|
104 |
-
* Make custom data available to template.
|
105 |
-
*
|
106 |
-
* Data is available to the template as properties under the `$data` variable.
|
107 |
-
* i.e. A value provided here under `$data['foo']` is available as `$data->foo`.
|
108 |
-
*
|
109 |
-
* When an input key has a hyphen, you can use `$data->{foo-bar}` in the template.
|
110 |
-
*
|
111 |
-
* @since 1.2.0
|
112 |
-
*
|
113 |
-
* @param array $data Custom data for the template.
|
114 |
-
* @param string $var_name Optional. Variable under which the custom data is available in the template.
|
115 |
-
* Default is 'data'.
|
116 |
-
*/
|
117 |
-
public function set_template_data( array $data, $var_name = 'data' ) {
|
118 |
-
global $wp_query;
|
119 |
-
|
120 |
-
$wp_query->query_vars[ $var_name ] = (object) $data;
|
121 |
-
}
|
122 |
-
|
123 |
-
/**
|
124 |
-
* Remove access to custom data in template.
|
125 |
-
*
|
126 |
-
* Good to use once the final template part has been requested.
|
127 |
-
*
|
128 |
-
* @since 1.2.0
|
129 |
-
*/
|
130 |
-
public function unset_template_data() {
|
131 |
-
global $wp_query;
|
132 |
-
|
133 |
-
if ( isset( $wp_query->query_vars['data'] ) ) {
|
134 |
-
unset( $wp_query->query_vars['data'] );
|
135 |
-
}
|
136 |
-
}
|
137 |
-
|
138 |
-
/**
|
139 |
-
* Given a slug and optional name, create the file names of templates.
|
140 |
-
*
|
141 |
-
* @since 1.0.0
|
142 |
-
*
|
143 |
-
* @param string $slug Template slug.
|
144 |
-
* @param string $name Template variation name.
|
145 |
-
*
|
146 |
-
* @return array
|
147 |
-
*/
|
148 |
-
protected function get_template_file_names( $slug, $name ) {
|
149 |
-
$templates = array();
|
150 |
-
if ( isset( $name ) ) {
|
151 |
-
$templates[] = $slug . '-' . $name . '.php';
|
152 |
-
}
|
153 |
-
$templates[] = $slug . '.php';
|
154 |
-
|
155 |
-
/**
|
156 |
-
* Allow template choices to be filtered.
|
157 |
-
*
|
158 |
-
* The resulting array should be in the order of most specific first, to least specific last.
|
159 |
-
* e.g. 0 => recipe-instructions.php, 1 => recipe.php
|
160 |
-
*
|
161 |
-
* @since 1.0.0
|
162 |
-
*
|
163 |
-
* @param array $templates Names of template files that should be looked for, for given slug and name.
|
164 |
-
* @param string $slug Template slug.
|
165 |
-
* @param string $name Template variation name.
|
166 |
-
*/
|
167 |
-
return apply_filters( $this->filter_prefix . '_get_template_part', $templates, $slug, $name );
|
168 |
-
}
|
169 |
-
|
170 |
-
/**
|
171 |
-
* Retrieve the name of the highest priority template file that exists.
|
172 |
-
*
|
173 |
-
* Searches in the STYLESHEETPATH before TEMPLATEPATH so that themes which
|
174 |
-
* inherit from a parent theme can just overload one file. If the template is
|
175 |
-
* not found in either of those, it looks in the theme-compat folder last.
|
176 |
-
*
|
177 |
-
* @since 1.0.0
|
178 |
-
*
|
179 |
-
* @param string|array $template_names Template file(s) to search for, in order.
|
180 |
-
* @param bool $load If true the template file will be loaded if it is found.
|
181 |
-
* @param bool $require_once Whether to require_once or require. Default true.
|
182 |
-
* Has no effect if $load is false.
|
183 |
-
*
|
184 |
-
* @return string The template filename if one is located.
|
185 |
-
*/
|
186 |
-
public function locate_template( $template_names, $load = false, $require_once = true ) {
|
187 |
-
// No file found yet.
|
188 |
-
$located = false;
|
189 |
-
|
190 |
-
// Remove empty entries.
|
191 |
-
$template_names = array_filter( (array) $template_names );
|
192 |
-
$template_paths = $this->get_template_paths();
|
193 |
-
|
194 |
-
// Try to find a template file.
|
195 |
-
foreach ( $template_names as $template_name ) {
|
196 |
-
// Trim off any slashes from the template name.
|
197 |
-
$template_name = ltrim( $template_name, '/' );
|
198 |
-
|
199 |
-
// Try locating this template file by looping through the template paths.
|
200 |
-
foreach ( $template_paths as $template_path ) {
|
201 |
-
if ( file_exists( $template_path . $template_name ) ) {
|
202 |
-
$located = $template_path . $template_name;
|
203 |
-
break 2;
|
204 |
-
}
|
205 |
-
}
|
206 |
-
}
|
207 |
-
|
208 |
-
if ( $load && $located ) {
|
209 |
-
load_template( $located, $require_once );
|
210 |
-
}
|
211 |
-
|
212 |
-
return $located;
|
213 |
-
}
|
214 |
-
|
215 |
-
/**
|
216 |
-
* Return a list of paths to check for template locations.
|
217 |
-
*
|
218 |
-
* Default is to check in a child theme (if relevant) before a parent theme, so that themes which inherit from a
|
219 |
-
* parent theme can just overload one file. If the template is not found in either of those, it looks in the
|
220 |
-
* theme-compat folder last.
|
221 |
-
*
|
222 |
-
* @since 1.0.0
|
223 |
-
*
|
224 |
-
* @return mixed|void
|
225 |
-
*/
|
226 |
-
protected function get_template_paths() {
|
227 |
-
$theme_directory = trailingslashit( $this->theme_template_directory );
|
228 |
-
|
229 |
-
$file_paths = array(
|
230 |
-
10 => trailingslashit( get_template_directory() ) . $theme_directory,
|
231 |
-
100 => $this->get_templates_dir(),
|
232 |
-
);
|
233 |
-
|
234 |
-
// Only add this conditionally, so non-child themes don't redundantly check active theme twice.
|
235 |
-
if ( is_child_theme() ) {
|
236 |
-
$file_paths[1] = trailingslashit( get_stylesheet_directory() ) . $theme_directory;
|
237 |
-
}
|
238 |
-
|
239 |
-
/**
|
240 |
-
* Allow ordered list of template paths to be amended.
|
241 |
-
*
|
242 |
-
* @since 1.0.0
|
243 |
-
*
|
244 |
-
* @param array $var Default is directory in child theme at index 1, parent theme at 10, and plugin at 100.
|
245 |
-
*/
|
246 |
-
$file_paths = apply_filters( $this->filter_prefix . '_template_paths', $file_paths );
|
247 |
-
|
248 |
-
// Sort the file paths based on priority.
|
249 |
-
ksort( $file_paths, SORT_NUMERIC );
|
250 |
-
|
251 |
-
return array_map( 'trailingslashit', $file_paths );
|
252 |
-
}
|
253 |
-
|
254 |
-
/**
|
255 |
-
* Return the path to the templates directory in this plugin.
|
256 |
-
*
|
257 |
-
* May be overridden in subclass.
|
258 |
-
*
|
259 |
-
* @since 1.0.0
|
260 |
-
*
|
261 |
-
* @return string
|
262 |
-
*/
|
263 |
-
protected function get_templates_dir() {
|
264 |
-
return trailingslashit( $this->plugin_directory ) . $this->plugin_template_directory;
|
265 |
-
}
|
266 |
-
}
|
267 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/Gamajo-Template-Loader/class-meal-planner-template-loader.php
DELETED
@@ -1,58 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Meal Planner
|
4 |
-
*
|
5 |
-
* @package Meal_Planner
|
6 |
-
* @author Gary Jones
|
7 |
-
* @link http://example.com/meal-planner
|
8 |
-
* @copyright 2013 Gary Jones
|
9 |
-
* @license GPL-2.0+
|
10 |
-
*/
|
11 |
-
|
12 |
-
if( ! class_exists( 'Gamajo_Template_Loader' ) ) {
|
13 |
-
require plugin_dir_path( __FILE__ ) . 'class-gamajo-template-loader.php';
|
14 |
-
}
|
15 |
-
|
16 |
-
/**
|
17 |
-
* Template loader for Meal Planner.
|
18 |
-
*
|
19 |
-
* Only need to specify class properties here.
|
20 |
-
*
|
21 |
-
* @package Meal_Planner
|
22 |
-
* @author Gary Jones
|
23 |
-
*/
|
24 |
-
class Meal_Planner_Template_Loader extends Gamajo_Template_Loader {
|
25 |
-
|
26 |
-
/**
|
27 |
-
* Prefix for filter names.
|
28 |
-
*
|
29 |
-
* @since 1.0.0
|
30 |
-
* @type string
|
31 |
-
*/
|
32 |
-
protected $filter_prefix = 'meal_planner';
|
33 |
-
|
34 |
-
/**
|
35 |
-
* Directory name where custom templates for this plugin should be found in the theme.
|
36 |
-
*
|
37 |
-
* @since 1.0.0
|
38 |
-
* @type string
|
39 |
-
*/
|
40 |
-
protected $theme_template_directory = 'meal-planner';
|
41 |
-
|
42 |
-
/**
|
43 |
-
* Reference to the root directory path of this plugin.
|
44 |
-
*
|
45 |
-
* Can either be a defined constant, or a relative reference from where the subclass lives.
|
46 |
-
*
|
47 |
-
* In this case, `MEAL_PLANNER_PLUGIN_DIR` would be defined in the root plugin file as:
|
48 |
-
*
|
49 |
-
* ~~~
|
50 |
-
* define( 'MEAL_PLANNER_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
|
51 |
-
* ~~~
|
52 |
-
*
|
53 |
-
* @since 1.0.0
|
54 |
-
* @type string
|
55 |
-
*/
|
56 |
-
protected $plugin_directory = MEAL_PLANNER_PLUGIN_DIR;
|
57 |
-
|
58 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/Gamajo-Template-Loader/composer.json
DELETED
@@ -1,24 +0,0 @@
|
|
1 |
-
{
|
2 |
-
"name" : "gamajo/template-loader",
|
3 |
-
"description": "A class for your WordPress plugin, to allow loading template parts with fallback through the child theme > parent theme > plugin",
|
4 |
-
"keywords" : ["wordpress", "templates"],
|
5 |
-
"homepage" : "http://github.com/GaryJones/Gamajo-Template-Loader",
|
6 |
-
"license" : "GPL-2.0+",
|
7 |
-
"authors" : [
|
8 |
-
{
|
9 |
-
"name" : "Gary Jones",
|
10 |
-
"email" : "gamajo@gamajo.com",
|
11 |
-
"homepage": "http://gamajo.com",
|
12 |
-
"role" : "Developer"
|
13 |
-
}
|
14 |
-
],
|
15 |
-
"support" : {
|
16 |
-
"issues": "https://github.com/GaryJones/Gamajo-Template-Loader/issues"
|
17 |
-
},
|
18 |
-
"require" : {
|
19 |
-
"php": ">=5.2.4"
|
20 |
-
},
|
21 |
-
"autoload" : {
|
22 |
-
"classmap": ["class-gamajo-template-loader.php"]
|
23 |
-
}
|
24 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/CHANGELOG.md
DELETED
@@ -1,177 +0,0 @@
|
|
1 |
-
# CHANGELOG - Aihrus Framework
|
2 |
-
|
3 |
-
## master
|
4 |
-
|
5 |
-
## 1.2.4
|
6 |
-
* Change support email address to `support@axelerant.com`
|
7 |
-
* Fix coding standards for CI
|
8 |
-
* Remove option to disable the license not saved notice rather set sslverify to false
|
9 |
-
* Remove the use of deprecated function `wp_htmledit_pre()` and use `format_for_editor()` instead
|
10 |
-
|
11 |
-
## 1.2.3
|
12 |
-
* RELATES #7 Add option to disable the license not saved notice
|
13 |
-
* RESOLVE #8 Remove activation helpers
|
14 |
-
* RESOLVE michael-cannon/testimonials-widget#184 Remove deprecated constructor calls for WP_Widget
|
15 |
-
* Tested with WordPress 4.4
|
16 |
-
* Update Parsedown 1.5.4 library
|
17 |
-
|
18 |
-
## 1.2.2
|
19 |
-
* Add Inside Axelerant link
|
20 |
-
* Store branding updates
|
21 |
-
* Update about Axelerant verbiage
|
22 |
-
|
23 |
-
## 1.2.1
|
24 |
-
* RESOLVE PHP Fatal error: Access to undeclared static property: CLASS::$scripts_called
|
25 |
-
|
26 |
-
## 1.2.0
|
27 |
-
* Add Axelerant careers link
|
28 |
-
* Update about Axelerant data
|
29 |
-
* Update Axelerant support URLs
|
30 |
-
* Update branding from Aihrus to Axelerant
|
31 |
-
|
32 |
-
## 1.1.7
|
33 |
-
* RESOLVE michael-cannon/testimonials-widget#156 License not saving
|
34 |
-
* Update copyright year
|
35 |
-
|
36 |
-
## 1.1.6
|
37 |
-
* Denote included libraries
|
38 |
-
* RESOLVE michael-cannon/testimonials-widget#162 Error: This is not a valid feed template with WordPress SEO sitemap
|
39 |
-
* Use https for Aihrus store
|
40 |
-
|
41 |
-
## 1.1.5
|
42 |
-
* Abstract do_validate_settings for easier reuse
|
43 |
-
* Add 'content' option to settings display
|
44 |
-
* Add CPT date archives helper
|
45 |
-
* Add markdown2html helper
|
46 |
-
* Add suggest ability to text filed
|
47 |
-
* Add widget's form_parts method
|
48 |
-
* Auto-detect file_get_contents or curl availability
|
49 |
-
* Coding standards update
|
50 |
-
* Don't shortcode attribute for reset options
|
51 |
-
* Move get_suggest to widget abstract class from interface
|
52 |
-
* On aihr_notice_error usage, push to server error log
|
53 |
-
* Remove interface class usage
|
54 |
-
* RESOLVE #4 Enable std default for metabox class
|
55 |
-
* RESOLVE #5 Check for file_get_contents and curl_init before file grabbing
|
56 |
-
* RESOLVE Add widget option defaults
|
57 |
-
* RESOLVE form_parts not allowing no arguments
|
58 |
-
* RESOLVE michael-cannon/testimonials-widget#6 On widget options, switch labels expand/collapse when using them
|
59 |
-
* RESOLVE michael-cannon/testimonials-widget#78 Show revert link in deactivation admin notice
|
60 |
-
* RESOLVE Move form_instance to abstract class Aihrus_Widget
|
61 |
-
* RESOLVE Move get_suggest to abstract class Aihrus_Widget
|
62 |
-
* RESOLVE Remove tw- reference
|
63 |
-
* RESOLVE Space missing before Collapse
|
64 |
-
* RESOLVE Use widget args than globals
|
65 |
-
* Revise widget class for easier reuse
|
66 |
-
* Update licensing GPL 2.0
|
67 |
-
* Use parsedown for Markdown to HTML conversion
|
68 |
-
|
69 |
-
## 1.1.4
|
70 |
-
* Carry over core baseline methods
|
71 |
-
|
72 |
-
## 1.1.3
|
73 |
-
* Add check_user_role method
|
74 |
-
* RESOLVE michael-cannon/testimonials-widget#85 New testimonial rating field is blank
|
75 |
-
* RESOLVE Undefined index notice
|
76 |
-
|
77 |
-
## 1.1.2
|
78 |
-
* Add licensing status notices
|
79 |
-
* Code formatting
|
80 |
-
* Don't remove license from settings
|
81 |
-
* RESOLVE Undefined index
|
82 |
-
* Restore default wp_remote_get timeout
|
83 |
-
* Return if library class exists already
|
84 |
-
* Update settings page detection
|
85 |
-
|
86 |
-
## 1.1.1
|
87 |
-
* Remove unused `widget_options`
|
88 |
-
* RESOLVE michael-cannon/testimonials-widget#65 Widget blank options aren't saving correctly
|
89 |
-
|
90 |
-
## 1.1.0
|
91 |
-
* Abstract deactivate_plugins actual to aihr_deactivate_plugin_do
|
92 |
-
* Add class redrokk_metabox_class
|
93 |
-
* Add class wp_custom_post_status
|
94 |
-
* Add date, time, and datetime types to redrokk_metabox_class
|
95 |
-
* Add rich_editor type
|
96 |
-
* Add validate_email
|
97 |
-
* Consolidate deactivate_plugins activity into aihr_deactivate_plugin
|
98 |
-
* Don't esc_attr rich editor value
|
99 |
-
* Limit wp_custom_post_status to post type
|
100 |
-
* Move classes/interfaces to includes
|
101 |
-
* Register `jquery-style`
|
102 |
-
* Rename requirements.php to aihrus-framework.php
|
103 |
-
* RESOLVE michael-cannon/testimonials-widget#63 Unable to activate premium license
|
104 |
-
* RESOLVE michael-cannon/testimonials-widget#65 Widget blank options aren't saving correctly
|
105 |
-
* RESOLVE michael-cannon/testimonials-widget#76 Undefined index: hide_image_single
|
106 |
-
* RESOLVE redrokk_metabox_class prepare warning
|
107 |
-
* Revise get_styles handling
|
108 |
-
* Set AIHR_DIR* helpers
|
109 |
-
* Set defaults for validators
|
110 |
-
* Set premium license key for 2 years though it expires at 1
|
111 |
-
* Update copyright year
|
112 |
-
|
113 |
-
## 1.0.3
|
114 |
-
* RESOLVE Fatal error: Call to undefined function add_settings_error() in class-aihrus-settings.php on line 559
|
115 |
-
* RESOLVE Featured image via Gravatar not saving correctly
|
116 |
-
* Revise data deletion description - Thank you Mark
|
117 |
-
|
118 |
-
## 1.0.2
|
119 |
-
* Add phpunit.xml
|
120 |
-
* Add `slash_sanitize_title` verification helper
|
121 |
-
* Coding standards
|
122 |
-
* Display "Settings saved."
|
123 |
-
* Move ci to tests
|
124 |
-
* Remove Travis configuration
|
125 |
-
* RESOLVE michael-cannon/testimonials-widget#48 Activation on WP 3.6 not working
|
126 |
-
* RESOLVE michael-cannon/wootheme-testimonials-to-testimonials#2 No settings saved notice upon saving settings
|
127 |
-
* Update usage instructions
|
128 |
-
* Use $plugin_assets than $plugin_path
|
129 |
-
|
130 |
-
## 1.0.1
|
131 |
-
* Add strip_protocol
|
132 |
-
* Add valid_hash check
|
133 |
-
* Move relicensing to plugin level
|
134 |
-
|
135 |
-
## 1.0.0
|
136 |
-
* Enable aihr_check_aihrus_framework
|
137 |
-
|
138 |
-
## 0.0.0
|
139 |
-
* Abstract notice helper methods as functions
|
140 |
-
* Add TODO
|
141 |
-
* Add `add_media` post attachment helper
|
142 |
-
* Add `clean_string` trim, strip_shortcodes, and strip_tags a string
|
143 |
-
* Add `create_link( $link )`
|
144 |
-
* Add `create_nonce( $action )`
|
145 |
-
* Add `file_get_contents_curl`
|
146 |
-
* Add `get_image_src`
|
147 |
-
* Add `is_true`, terms, url validate cases
|
148 |
-
* Add `truncate`
|
149 |
-
* Add `verify_nonce( $nonce, $action )`
|
150 |
-
* Add abstract class Aihrus_Settings
|
151 |
-
* Add abstract class Aihrus_Widget
|
152 |
-
* Add aihr_notice_license
|
153 |
-
* Add name filed to aihr_check_php
|
154 |
-
* Add requirements helper
|
155 |
-
* Add shortcode id helpers
|
156 |
-
* Allow reset_defaults in widget
|
157 |
-
* BUGFIX Method version not static
|
158 |
-
* BUGFIX Widget title is same as link
|
159 |
-
* CLOSES #2 Disable purchase premium links if premium is active
|
160 |
-
* Check for PHP 5.3
|
161 |
-
* Convert TODO to https://github.com/michael-cannon/aihrus-framework/issues
|
162 |
-
* Display option values as is
|
163 |
-
* Encase pronouns in double-quotes
|
164 |
-
* RESOLVES #1 PHP Version checking
|
165 |
-
* RESOLVES #3 Add WordPress version check
|
166 |
-
* Remove unused methods
|
167 |
-
* Rename $options[$id] to $field_value
|
168 |
-
* Rename no_code to show_code
|
169 |
-
* Revise create_link parameters
|
170 |
-
* Settings link with null post_type
|
171 |
-
* Switch from require_once to require file inclusion
|
172 |
-
* Use `aihr_` as function prefix
|
173 |
-
* Widget title uses create_link
|
174 |
-
* static::ITEM_NAME to static::NAME
|
175 |
-
|
176 |
-
## 0.0.0
|
177 |
-
* Initial code release
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/LICENSE
DELETED
@@ -1,339 +0,0 @@
|
|
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/README.md
DELETED
@@ -1,81 +0,0 @@
|
|
1 |
-
# Aihrus Framework
|
2 |
-
|
3 |
-
Tested up to: 4.4.0
|
4 |
-
Stable tag: 1.2.4
|
5 |
-
|
6 |
-
A helper library for WordPress plugins by Aihrus and maintained by [Axelerant](//axelerant.com).
|
7 |
-
|
8 |
-
## Features
|
9 |
-
|
10 |
-
* Content truncation helper methods
|
11 |
-
* Donation links
|
12 |
-
* Image source and media attachment helper methods
|
13 |
-
* Licensing
|
14 |
-
* Link creation helper methods
|
15 |
-
* Nonce helper methods
|
16 |
-
* Notifications
|
17 |
-
* Validation helper methods
|
18 |
-
|
19 |
-
## Usage
|
20 |
-
|
21 |
-
* Change to plugin directory that's a Git clone
|
22 |
-
* Load and link the external library
|
23 |
-
|
24 |
-
```
|
25 |
-
git remote add aihrus https://github.com/michael-cannon/aihrus-framework.git
|
26 |
-
git subtree add -P include/libraries/aihrus-framework aihrus master
|
27 |
-
git commit -a -m "Read aihrus framework"
|
28 |
-
git push origin master
|
29 |
-
```
|
30 |
-
|
31 |
-
* Link plugin to libary
|
32 |
-
|
33 |
-
```
|
34 |
-
require WPS_DIR_LIB . '/aihrus-framework/class-aihrus-common.php';
|
35 |
-
```
|
36 |
-
|
37 |
-
* Extend plugin class to library
|
38 |
-
|
39 |
-
```
|
40 |
-
class Wordpress_Starter extends Aihrus_Common {
|
41 |
-
```
|
42 |
-
|
43 |
-
* Add class static members
|
44 |
-
|
45 |
-
```
|
46 |
-
public static $class = __CLASS__;
|
47 |
-
public static $notice_key;
|
48 |
-
```
|
49 |
-
|
50 |
-
* Set notices…
|
51 |
-
|
52 |
-
```
|
53 |
-
…
|
54 |
-
if ( $bad_version )
|
55 |
-
add_action( 'admin_notices', 'wps_notice_aihrus' );
|
56 |
-
…
|
57 |
-
function wps_notice_aihrus() {
|
58 |
-
$help_url = esc_url( 'https://nodedesk.zendesk.com/hc/en-us/articles/202381391' );
|
59 |
-
$help_link = sprintf( __( '<a href="%1$s">Update plugins</a>. <a href="%2$s">More information</a>.' ), self_admin_url( 'update-core.php' ), $help_url );
|
60 |
-
|
61 |
-
$text = sprintf( esc_html__( 'Plugin "%1$s" has been deactivated as it requires a current Aihrus Framework. Once corrected, "%1$s" can be activated. %2$s' ), WPS_NAME, $help_link );
|
62 |
-
|
63 |
-
aihr_notice_error( $text );
|
64 |
-
}
|
65 |
-
```
|
66 |
-
|
67 |
-
* Update the external library
|
68 |
-
|
69 |
-
```
|
70 |
-
git subtree pull -P include/libraries/aihrus-framework aihrus master
|
71 |
-
```
|
72 |
-
|
73 |
-
* Update the plugin repository
|
74 |
-
|
75 |
-
```
|
76 |
-
git push origin master
|
77 |
-
```
|
78 |
-
|
79 |
-
## Included Libraries
|
80 |
-
|
81 |
-
* [Parsedown](http://parsedown.org/)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/aihrus-framework.php
DELETED
@@ -1,353 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
Aihrus Framework
|
4 |
-
Copyright (C) 2015 Axelerant
|
5 |
-
|
6 |
-
This program is free software; you can redistribute it and/or modify
|
7 |
-
it under the terms of the GNU General Public License as published by
|
8 |
-
the Free Software Foundation; either version 2 of the License, or
|
9 |
-
(at your option) any later version.
|
10 |
-
|
11 |
-
This program is distributed in the hope that it will be useful,
|
12 |
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 |
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14 |
-
GNU General Public License for more details.
|
15 |
-
|
16 |
-
You should have received a copy of the GNU General Public License along
|
17 |
-
with this program; if not, write to the Free Software Foundation, Inc.,
|
18 |
-
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
19 |
-
*/
|
20 |
-
|
21 |
-
if ( ! defined( 'AIHR_BASE' ) ) {
|
22 |
-
define( 'AIHR_BASE', __FILE__ );
|
23 |
-
}
|
24 |
-
|
25 |
-
if ( ! defined( 'AIHR_DIR' ) ) {
|
26 |
-
define( 'AIHR_DIR', plugin_dir_path( __FILE__ ) );
|
27 |
-
}
|
28 |
-
|
29 |
-
if ( ! defined( 'AIHR_DIR_INC' ) ) {
|
30 |
-
define( 'AIHR_DIR_INC', AIHR_DIR . 'includes/' );
|
31 |
-
}
|
32 |
-
|
33 |
-
if ( ! defined( 'AIHR_DIR_LIB' ) ) {
|
34 |
-
define( 'AIHR_DIR_LIB', AIHR_DIR_INC . 'libraries/' );
|
35 |
-
}
|
36 |
-
|
37 |
-
if ( ! defined( 'AIHR_VERSION' ) ) {
|
38 |
-
define( 'AIHR_VERSION', '1.2.4' );
|
39 |
-
}
|
40 |
-
|
41 |
-
require_once ABSPATH . 'wp-admin/includes/plugin.php';
|
42 |
-
|
43 |
-
|
44 |
-
if ( ! function_exists( 'aihr_check_aihrus_framework' ) ) {
|
45 |
-
function aihr_check_aihrus_framework( $file = null, $name = null, $aihr_min = '1.0.0' ) {
|
46 |
-
if ( is_null( $file ) ) {
|
47 |
-
aihr_notice_error( __( '`aihr_check_aihrus_framework` requires $file argument' ) );
|
48 |
-
|
49 |
-
return false;
|
50 |
-
}
|
51 |
-
|
52 |
-
if ( ! defined( 'AIHR_VERSION' ) ) {
|
53 |
-
$check_okay = false;
|
54 |
-
} else {
|
55 |
-
$check_okay = version_compare( AIHR_VERSION, $aihr_min, '>=' );
|
56 |
-
}
|
57 |
-
|
58 |
-
$file = plugin_basename( $file );
|
59 |
-
if ( ! $check_okay && __FILE__ != $file ) {
|
60 |
-
if ( ! defined( 'AIHR_VERSION_FILE' ) ) {
|
61 |
-
define( 'AIHR_VERSION_FILE', $file );
|
62 |
-
}
|
63 |
-
|
64 |
-
if ( ! is_null( $name ) && ! defined( 'AIHR_VERSION_NAME' ) ) {
|
65 |
-
define( 'AIHR_VERSION_NAME', $name );
|
66 |
-
}
|
67 |
-
|
68 |
-
if ( ! defined( 'AIHR_VERSION_MIN' ) ) {
|
69 |
-
define( 'AIHR_VERSION_MIN', $aihr_min );
|
70 |
-
}
|
71 |
-
|
72 |
-
add_action( 'admin_notices', 'aihr_notice_aihrus_framework' );
|
73 |
-
}
|
74 |
-
|
75 |
-
return $check_okay;
|
76 |
-
}
|
77 |
-
}
|
78 |
-
|
79 |
-
if ( ! function_exists( 'aihr_notice_aihrus_framework' ) ) {
|
80 |
-
function aihr_notice_aihrus_framework() {
|
81 |
-
if ( defined( 'AIHR_VERSION_NAME' ) ) {
|
82 |
-
$name = AIHR_VERSION_NAME;
|
83 |
-
} else {
|
84 |
-
$name = basename( dirname( AIHR_VERSION_FILE ) );
|
85 |
-
$name = str_replace( '-', ' ', $name );
|
86 |
-
$name = ucwords( $name );
|
87 |
-
}
|
88 |
-
|
89 |
-
$help_url = esc_url( '//nodedesk.zendesk.com/hc/en-us/articles/202381391' );
|
90 |
-
$help_link = sprintf( __( '<a href="%1$s">Update plugins</a>. <a href="%2$s">More information</a>.' ), self_admin_url( 'update-core.php' ), $help_url );
|
91 |
-
|
92 |
-
$note = '';
|
93 |
-
if ( defined( 'AIHR_BASE' ) ) {
|
94 |
-
$plugin = plugin_basename( AIHR_BASE );
|
95 |
-
$plugin = explode( '/', $plugin );
|
96 |
-
|
97 |
-
$plugin_name = $plugin[0];
|
98 |
-
$plugin_name = str_replace( '-', ' ', $plugin_name );
|
99 |
-
$plugin_name = ucwords( $plugin_name );
|
100 |
-
|
101 |
-
$note = sprintf( esc_html__( 'Plugin "%1$s" is causing the out of date issue.' ), $plugin_name );
|
102 |
-
}
|
103 |
-
|
104 |
-
$aihr_version = defined( 'AIHR_VERSION' ) ? AIHR_VERSION : '0.0.0';
|
105 |
-
|
106 |
-
$text = sprintf( esc_html__( 'Plugin "%1$s" has been deactivated as it requires Aihrus Framework %2$s or newer. You\'re running Aihrus Framework %4$s. Once corrected, "%1$s" can be activated. %5$s %3$s' ), $name, AIHR_VERSION_MIN, $help_link, $aihr_version, $note );
|
107 |
-
|
108 |
-
aihr_notice_error( $text );
|
109 |
-
}
|
110 |
-
}
|
111 |
-
|
112 |
-
if ( ! function_exists( 'aihr_check_php' ) ) {
|
113 |
-
function aihr_check_php( $file = null, $name = null, $php_min = '5.3.0' ) {
|
114 |
-
if ( is_null( $file ) ) {
|
115 |
-
aihr_notice_error( __( '`aihr_check_php` requires $file argument' ) );
|
116 |
-
|
117 |
-
return false;
|
118 |
-
}
|
119 |
-
|
120 |
-
$check_okay = version_compare( PHP_VERSION, $php_min, '>=' );
|
121 |
-
$file = plugin_basename( $file );
|
122 |
-
if ( ! $check_okay && __FILE__ != $file ) {
|
123 |
-
if ( ! defined( 'AIHR_PHP_VERSION_FILE' ) ) {
|
124 |
-
define( 'AIHR_PHP_VERSION_FILE', $file );
|
125 |
-
}
|
126 |
-
|
127 |
-
if ( ! is_null( $name ) && ! defined( 'AIHR_PHP_VERSION_NAME' ) ) {
|
128 |
-
define( 'AIHR_PHP_VERSION_NAME', $name );
|
129 |
-
}
|
130 |
-
|
131 |
-
if ( ! defined( 'AIHR_PHP_VERSION_MIN' ) ) {
|
132 |
-
define( 'AIHR_PHP_VERSION_MIN', $php_min );
|
133 |
-
}
|
134 |
-
|
135 |
-
add_action( 'admin_notices', 'aihr_notice_php' );
|
136 |
-
}
|
137 |
-
|
138 |
-
return $check_okay;
|
139 |
-
}
|
140 |
-
}
|
141 |
-
|
142 |
-
if ( ! function_exists( 'aihr_notice_php' ) ) {
|
143 |
-
function aihr_notice_php() {
|
144 |
-
if ( defined( 'AIHR_PHP_VERSION_NAME' ) ) {
|
145 |
-
$name = AIHR_PHP_VERSION_NAME;
|
146 |
-
} else {
|
147 |
-
$name = basename( dirname( AIHR_PHP_VERSION_FILE ) );
|
148 |
-
$name = str_replace( '-', ' ', $name );
|
149 |
-
$name = ucwords( $name );
|
150 |
-
}
|
151 |
-
|
152 |
-
$help_url = esc_url( 'https://nodedesk.zendesk.com/hc/en-us/articles/202331041' );
|
153 |
-
|
154 |
-
$text = sprintf( __( 'Plugin "%1$s" has been deactivated as it requires PHP %2$s or newer. You\'re running PHP %4$s. Once corrected, "%1$s" can be activated. <a href="%3$s">More information</a>.' ), $name, AIHR_PHP_VERSION_MIN, $help_url, PHP_VERSION );
|
155 |
-
|
156 |
-
aihr_notice_error( $text );
|
157 |
-
}
|
158 |
-
}
|
159 |
-
|
160 |
-
if ( ! function_exists( 'aihr_check_wp' ) ) {
|
161 |
-
function aihr_check_wp( $file = null, $name = null, $wp_min = '3.6' ) {
|
162 |
-
if ( is_null( $file ) ) {
|
163 |
-
aihr_notice_error( __( '`aihr_check_wp` requires $file argument' ) );
|
164 |
-
|
165 |
-
return false;
|
166 |
-
}
|
167 |
-
|
168 |
-
global $wp_version;
|
169 |
-
|
170 |
-
$check_okay = version_compare( $wp_version, $wp_min, '>=' );
|
171 |
-
$file = plugin_basename( $file );
|
172 |
-
if ( ! $check_okay && __FILE__ != $file ) {
|
173 |
-
if ( ! defined( 'AIHR_WP_VERSION_FILE' ) ) {
|
174 |
-
define( 'AIHR_WP_VERSION_FILE', $file );
|
175 |
-
}
|
176 |
-
|
177 |
-
if ( ! is_null( $name ) && ! defined( 'AIHR_WP_VERSION_NAME' ) ) {
|
178 |
-
define( 'AIHR_WP_VERSION_NAME', $name );
|
179 |
-
}
|
180 |
-
|
181 |
-
if ( ! defined( 'AIHR_WP_VERSION_MIN' ) ) {
|
182 |
-
define( 'AIHR_WP_VERSION_MIN', $wp_min );
|
183 |
-
}
|
184 |
-
|
185 |
-
add_action( 'admin_notices', 'aihr_notice_wp' );
|
186 |
-
}
|
187 |
-
|
188 |
-
return $check_okay;
|
189 |
-
}
|
190 |
-
}
|
191 |
-
|
192 |
-
if ( ! function_exists( 'aihr_notice_wp' ) ) {
|
193 |
-
function aihr_notice_wp() {
|
194 |
-
global $wp_version;
|
195 |
-
|
196 |
-
if ( defined( 'AIHR_WP_VERSION_NAME' ) ) {
|
197 |
-
$name = AIHR_WP_VERSION_NAME;
|
198 |
-
} else {
|
199 |
-
$name = basename( dirname( AIHR_WP_VERSION_FILE ) );
|
200 |
-
$name = str_replace( '-', ' ', $name );
|
201 |
-
$name = ucwords( $name );
|
202 |
-
}
|
203 |
-
|
204 |
-
$help_url = network_admin_url( 'update-core.php' );
|
205 |
-
|
206 |
-
$text = sprintf( __( 'Plugin "%1$s" has been deactivated as it requires WordPress %2$s or newer. You\'re running WordPress %4$s. Once corrected, "%1$s" can be activated. <a href="%3$s">Update WordPress</a>.' ), $name, AIHR_WP_VERSION_MIN, $help_url, $wp_version );
|
207 |
-
|
208 |
-
aihr_notice_error( $text );
|
209 |
-
}
|
210 |
-
}
|
211 |
-
|
212 |
-
if ( ! function_exists( 'aihr_notice_error' ) ) {
|
213 |
-
function aihr_notice_error( $text ) {
|
214 |
-
aihr_notice_updated( $text, 'error' );
|
215 |
-
error_log( $text );
|
216 |
-
}
|
217 |
-
}
|
218 |
-
|
219 |
-
if ( ! function_exists( 'aihr_notice_updated' ) ) {
|
220 |
-
function aihr_notice_updated( $text, $class = 'updated' ) {
|
221 |
-
if ( 'updated' == $class ) {
|
222 |
-
$class .= ' fade';
|
223 |
-
}
|
224 |
-
|
225 |
-
$content = '';
|
226 |
-
$content .= '<div class="' . $class . '"><p>';
|
227 |
-
$content .= $text;
|
228 |
-
$content .= '</p></div>';
|
229 |
-
|
230 |
-
echo $content;
|
231 |
-
}
|
232 |
-
}
|
233 |
-
|
234 |
-
if ( ! function_exists( 'aihr_notice_version' ) ) {
|
235 |
-
function aihr_notice_version( $required_name, $required_version, $item_name ) {
|
236 |
-
$text = sprintf( __( 'Plugin "%2$s" has been deactivated. Please install and activate "%3$s" version %1$s or newer before activating "%2$s".' ), $required_version, $item_name, $required_name );
|
237 |
-
|
238 |
-
aihr_notice_error( $text );
|
239 |
-
}
|
240 |
-
}
|
241 |
-
|
242 |
-
if ( ! function_exists( 'aihr_notice_license' ) ) {
|
243 |
-
function aihr_notice_license( $post_type, $settings_id, $free_name, $purchase_url, $item_name, $product_id = null, $license = null ) {
|
244 |
-
if ( empty( $post_type ) ) {
|
245 |
-
$link = get_admin_url() . 'options-general.php?page=' . $settings_id;
|
246 |
-
} else {
|
247 |
-
$link = get_admin_url() . 'edit.php?post_type=' . $post_type . '&page=' . $settings_id;
|
248 |
-
}
|
249 |
-
|
250 |
-
$text = __( '<a href="%1$s">%2$s > Settings</a>, <em>Premium</em> tab, <em>License Key</em>' );
|
251 |
-
|
252 |
-
$settings_link = sprintf( $text, $link, $free_name );
|
253 |
-
|
254 |
-
$link = esc_url( 'https://nodedesk.zendesk.com/hc/en-us/articles/202333071' );
|
255 |
-
$text = __( '<a href="%s">Where\'s my license key?</a>' );
|
256 |
-
|
257 |
-
$faq_link = sprintf( $text, $link );
|
258 |
-
|
259 |
-
$link = esc_url( $purchase_url );
|
260 |
-
$text = __( '<a href="%1$s">Purchase</a>' );
|
261 |
-
|
262 |
-
$buy_link = sprintf( $text, $link, $item_name );
|
263 |
-
|
264 |
-
$renew_link = '';
|
265 |
-
if ( ! empty( $license ) ) {
|
266 |
-
$link = parse_url( $purchase_url );
|
267 |
-
$link = $link['host'];
|
268 |
-
$text = __( '%1$s/checkout/?edd_license_key=%2$s&download_id=%3$s' );
|
269 |
-
$renew_url = sprintf( $text, $link, $license, $product_id );
|
270 |
-
|
271 |
-
$link = esc_url( $renew_url );
|
272 |
-
$text = __( '<a href="%1$s">Renew</a> or ' );
|
273 |
-
|
274 |
-
$renew_link = sprintf( $text, $link, $item_name );
|
275 |
-
}
|
276 |
-
|
277 |
-
$text = sprintf( __( 'Plugin "%1$s" requires license activation for software updates and support. Please activate the license via %2$s. See %3$s for help. Alternately, %5$s%4$s a %1$s license.' ), $item_name, $settings_link, $faq_link, $buy_link, $renew_link );
|
278 |
-
$text = links_add_target( $text, '_blank' );
|
279 |
-
|
280 |
-
aihr_notice_error( $text );
|
281 |
-
}
|
282 |
-
}
|
283 |
-
|
284 |
-
if ( ! function_exists( 'aihr_deactivate_plugin' ) ) {
|
285 |
-
function aihr_deactivate_plugin( $file = null, $name = null, $reason = '' ) {
|
286 |
-
if ( is_null( $file ) ) {
|
287 |
-
aihr_notice_error( __( '`aihr_deactivate_plugin` requires $file argument' ) );
|
288 |
-
|
289 |
-
return false;
|
290 |
-
}
|
291 |
-
|
292 |
-
if ( is_null( $name ) && empty( $reason ) ) {
|
293 |
-
aihr_deactivate_plugin_do( $file );
|
294 |
-
return false;
|
295 |
-
}
|
296 |
-
|
297 |
-
if ( ! defined( 'AIHR_DEACTIVATE_REASON' ) ) {
|
298 |
-
define( 'AIHR_DEACTIVATE_REASON', $reason );
|
299 |
-
}
|
300 |
-
|
301 |
-
if ( ! defined( 'AIHR_DEACTIVATE_FILE' ) ) {
|
302 |
-
define( 'AIHR_DEACTIVATE_FILE', $file );
|
303 |
-
}
|
304 |
-
|
305 |
-
if ( ! is_null( $name ) && ! defined( 'AIHR_DEACTIVATE_NAME' ) ) {
|
306 |
-
define( 'AIHR_DEACTIVATE_NAME', $name );
|
307 |
-
}
|
308 |
-
|
309 |
-
add_action( 'admin_notices', 'aihr_notice_deactivate' );
|
310 |
-
}
|
311 |
-
}
|
312 |
-
|
313 |
-
if ( ! function_exists( 'aihr_notice_deactivate' ) ) {
|
314 |
-
function aihr_notice_deactivate() {
|
315 |
-
if ( defined( 'AIHR_DEACTIVATE_NAME' ) ) {
|
316 |
-
$name = AIHR_DEACTIVATE_NAME;
|
317 |
-
} else {
|
318 |
-
$name = basename( dirname( AIHR_DEACTIVATE_FILE ) );
|
319 |
-
$name = str_replace( '-', ' ', $name );
|
320 |
-
$name = ucwords( $name );
|
321 |
-
}
|
322 |
-
|
323 |
-
if ( defined( 'AIHR_DEACTIVATE_REASON' ) ) {
|
324 |
-
$reason = AIHR_DEACTIVATE_REASON;
|
325 |
-
} else {
|
326 |
-
$reason = esc_html__( 'Unknown' );
|
327 |
-
}
|
328 |
-
|
329 |
-
$file = AIHR_DEACTIVATE_FILE;
|
330 |
-
$plugin_slug = dirname( plugin_basename( $file ) );
|
331 |
-
$url = 'https://wordpress.org/plugins/' . $plugin_slug . '/developers/';
|
332 |
-
|
333 |
-
$text = sprintf( __( 'Plugin "%1$s" has been deactivated due to "%2$s". Once corrected, "%1$s" can be activated.</p><p>If you want to revert "%1$s", look for <a href="%3$s">older versions on WordPress</a> or <a href="mailto:support@axelerant.com?subject=Old+Plugin+Version+Request">email Axelerant support</a> if this is a premium plugin.' ), $name, $reason, $url );
|
334 |
-
|
335 |
-
aihr_notice_error( $text );
|
336 |
-
|
337 |
-
aihr_deactivate_plugin_do( $file );
|
338 |
-
}
|
339 |
-
}
|
340 |
-
|
341 |
-
if ( ! function_exists( 'aihr_deactivate_plugin_do' ) ) {
|
342 |
-
function aihr_deactivate_plugin_do( $file = null ) {
|
343 |
-
if ( is_null( $file ) ) {
|
344 |
-
aihr_notice_error( __( '`aihr_deactivate_plugin_do` requires $file argument' ) );
|
345 |
-
|
346 |
-
return false;
|
347 |
-
}
|
348 |
-
|
349 |
-
deactivate_plugins( $file );
|
350 |
-
}
|
351 |
-
}
|
352 |
-
|
353 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
includes/libraries/aihrus-framework/class-aihrus-common.php
DELETED
@@ -1,462 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/*
|
3 |
-
Copyright 2014 Michael Cannon (email: mc@aihr.us)
|
4 |
-
|
5 |
-
This program is free software; you can redistribute it and/or modify
|
6 |
-
it under the terms of the GNU General Public License, version 2, as
|
7 |
-
published by the Free Software Foundation.
|
8 |
-
|
9 |
-
This program is distributed in the hope that it will be useful,
|
10 |
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11 |
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12 |
-
GNU General Public License for more details.
|
13 |
-
|
14 |
-
You should have received a copy of the GNU General Public License
|
15 |
-
along with this program; if not, write to the Free Software
|
16 |
-
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
17 |
-
*/
|
18 |
-
|
19 |
-
if ( class_exists( 'Aihrus_Common' ) )
|
20 |
-
return;
|
21 |
-
|
22 |
-
require_once 'interface-aihrus-common.php';
|
23 |
-
|
24 |
-
|
25 |
-
abstract class Aihrus_Common implements Aihrus_Common_Interface {
|
26 |
-
public static $donate_button;
|
27 |
-
public static $donate_link;
|
28 |
-
|
29 |
-
|
30 |
-
public function __construct() {
|
31 |
-
self::set_notice_key();
|
32 |
-
|
33 |
-
self::$donate_button = <<<EOD
|
34 |
-
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
|
35 |
-
<input type="hidden" name="cmd" value="_s-xclick">
|
36 |
-
<input type="hidden" name="hosted_button_id" value="WM4F995W9LHXE">
|
37 |
-
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
|
38 |
-
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
|
39 |
-
</form>
|
40 |
-
EOD;
|
41 |
-
|
42 |
-
self::$donate_link = '<a href="http://aihr.us/about-aihrus/donate/"><img src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif" border="0" alt="PayPal - The safer, easier way to pay online!" /></a>';
|
43 |
-
|
44 |
-
add_action( 'admin_init', array( static::$class, 'check_notices' ), 9999 );
|
45 |
-
}
|
46 |
-
|
47 |
-
|
48 |
-
public static function set_notice( $notice_name, $frequency_limit = false ) {
|
49 |
-
$notice_key = self::get_notice_key();
|
50 |
-
|
51 |
-
$frequency_limit = intval( $frequency_limit );
|
52 |
-
if ( ! empty( $frequency_limit ) ) {
|
53 |
-
$fl_key = $notice_key . '_' . $notice_name;
|
54 |
-
$proceed = get_transient( $fl_key );
|
55 |
-
if ( false === $proceed ) {
|
56 |
-
delete_transient( $fl_key );
|
57 |
-
set_transient( $fl_key, time(), $frequency_limit );
|
58 |
-
} else {
|
59 |
-
return;
|
60 |
-
}
|
61 |
-
}
|
62 |
-
|
63 |
-
$notices = get_transient( $notice_key );
|
64 |
-
if ( false === $notices )
|
65 |
-
$notices = array();
|
66 |
-
|
67 |
-
$notices[] = $notice_name;
|
68 |
-
|
69 |
-
self::delete_notices();
|
70 |
-
set_transient( $notice_key, $notices, HOUR_IN_SECONDS );
|
71 |
-
}
|
72 |
-
|
73 |
-
|
74 |
-
public static function delete_notices() {
|
75 |
-
$notice_key = self::get_notice_key();
|
76 |
-
|
77 |
-
delete_transient( $notice_key );
|
78 |
-
}
|
79 |
-
|
80 |
-
|
81 |
-
public static function check_notices() {
|
82 |
-
$notice_key = self::get_notice_key();
|
83 |
-
|
84 |
-
$notices = get_transient( $notice_key );
|
85 |
-
if ( false === $notices )
|
86 |
-
return;
|
87 |
-
|
88 |
-
$notices = array_unique( $notices );
|
89 |
-
foreach ( $notices as $notice ) {
|
90 |
-
if ( function_exists( $notice ) ) {
|
91 |
-
add_action( 'admin_notices', $notice );
|
92 |
-
} elseif ( is_array( $notice ) ) {
|
93 |
-
add_action( 'admin_notices', $notice );
|
94 |
-
} else {
|
95 |
-
add_action( 'admin_notices', array( static::$class, $notice ) );
|
96 |
-
}
|
97 |
-
}
|
98 |
-
|
99 |
-
self::delete_notices();
|
100 |
-
}
|
101 |
-
|
102 |
-
|
103 |
-
public static function get_notice_key() {
|
104 |
-
if ( is_null( static::$notice_key ) )
|
105 |
-
self::set_notice_key();
|
106 |
-
|
107 |
-
return static::$notice_key;
|
108 |
-
}
|
109 |
-
|
110 |
-
|
111 |
-
public static function set_notice_key() {
|
112 |
-
static::$notice_key = static::SLUG . 'notices';
|
113 |
-
}
|
114 |
-
|
115 |
-
|
116 |
-
public static function version( $version ) {
|
117 |
-
$version .= '-' . static::ID . '-' . static::VERSION;
|
118 |
-
|
119 |
-
return $version;
|
120 |
-
}
|
121 |
-
|
122 |
-
|
123 |
-
/**
|
124 |
-
* flatten an arbitrarily deep multidimensional array
|
125 |
-
* into a list of its scalar values
|
126 |
-
* (may be inefficient for large structures)
|
127 |
-
* (will infinite recurse on self-referential structures)
|
128 |
-
* (could be extended to handle objects)
|
129 |
-
*
|
130 |
-
* @ref http://in1.php.net/manual/en/function.array-values.php#41967
|
131 |
-
*/
|
132 |
-
|
133 |
-
|
134 |
-
public static function array_values_recursive( $ary ) {
|
135 |
-
$lst = array();
|
136 |
-
foreach ( array_keys( $ary ) as $k ) {
|
137 |
-
$v = $ary[$k];
|
138 |
-
if ( is_scalar( $v ) ) {
|
139 |
-
$lst[] = $v;
|
140 |
-
} elseif ( is_array( $v ) ) {
|
141 |
-
$lst = array_merge(
|
142 |
-
$lst,
|
143 |
-
self::array_values_recursive( $v )
|
144 |
-
);
|
145 |
-
}
|
146 |
-
}
|
147 |
-
|
148 |
-
return $lst;
|
149 |
-
}
|
150 |
-
|
151 |
-
|
152 |
-
public static function notice_donate( $disable_donate = null, $item_name = null ) {
|
153 |
-
if ( $disable_donate )
|
154 |
-
return;
|
155 |
-
|
156 |
-
$text = sprintf( esc_html__( 'Please donate $5 towards ongoing free support and development of the "%1$s" plugin. %2$s' ), $item_name, self::$donate_button );
|
157 |
-
|
158 |
-
aihr_notice_updated( $text );
|
159 |
-
}
|
160 |
-
|
161 |
-
|
162 |
-
public static function get_scripts() {
|
163 |
-
if ( static::$scripts_called )
|
164 |
-
return;
|
165 |
-
|
166 |
-
foreach ( static::$scripts as $script )
|
167 |
-
echo $script;
|
168 |
-
|
169 |
-
static::$scripts_called = true;
|
170 |
-
}
|
171 |
-
|
172 |
-
|
173 |
-
public static function get_styles() {
|
174 |
-
if ( static::$styles_called )
|
175 |
-
return;
|
176 |
-
|
177 |
-
foreach ( static::$styles as $style )
|
178 |
-
echo $style;
|
179 |
-
|
180 |
-
static::$styles_called = true;
|
181 |
-
}
|
182 |
-
|
183 |
-
|
184 |
-
public static function create_nonce( $action ) {
|
185 |
-
$nonce = uniqid();
|
186 |
-
$uid = get_current_user_id();
|
187 |
-
$check = $uid . $action;
|
188 |
-
set_transient( $nonce, $check, HOUR_IN_SECONDS );
|
189 |
-
|
190 |
-
return $nonce;
|
191 |
-
}
|
192 |
-
|
193 |
-
|
194 |
-
public static function verify_nonce( $nonce, $action ) {
|
195 |
-
$active = get_transient( $nonce );
|
196 |
-
$uid = get_current_user_id();
|
197 |
-
$check = $uid . $action;
|
198 |
-
$valid = false;
|
199 |
-
|
200 |
-
if ( $active == $check ) {
|
201 |
-
delete_transient( $nonce );
|
202 |
-
$valid = true;
|
203 |
-
}
|
204 |
-
|
205 |
-
return $valid;
|
206 |
-
}
|
207 |
-
|
208 |
-
|
209 |
-
/**
|
210 |
-
* If incoming link is empty, then get_site_url() is used instead.
|
211 |
-
*/
|
212 |
-
public static function create_link( $link, $title = null, $target = null, $return_as_tag = true ) {
|
213 |
-
if ( empty( $link ) )
|
214 |
-
$link = get_site_url();
|
215 |
-
|
216 |
-
if ( preg_match( '#^\d+$#', $link ) ) {
|
217 |
-
$permalink = get_permalink( $link );
|
218 |
-
$tag_title = get_the_title( $link );
|
219 |
-
if ( empty( $title ) )
|
220 |
-
$title = $tag_title;
|
221 |
-
|
222 |
-
$tag = '<a href="';
|
223 |
-
$tag .= $permalink;
|
224 |
-
$tag .= '" title="';
|
225 |
-
$tag .= $tag_title;
|
226 |
-
$tag .= '">';
|
227 |
-
$tag .= $title;
|
228 |
-
$tag .= '</a>';
|
229 |
-
} else {
|
230 |
-
$orig_link = empty( $title ) ? $link : $title;
|
231 |
-
$do_http = true;
|
232 |
-
|
233 |
-
if ( 0 === strpos( $link, '/' ) )
|
234 |
-
$do_http = false;
|
235 |
-
|
236 |
-
if ( $do_http && 0 === preg_match( '#https?://#', $link ) )
|
237 |
-
$link = 'http://' . $link;
|
238 |
-
|
239 |
-
$permalink = $link;
|
240 |
-
|
241 |
-
$tag = '<a href="';
|
242 |
-
$tag .= $permalink;
|
243 |
-
$tag .= '">';
|
244 |
-
$tag .= $orig_link;
|
245 |
-
$tag .= '</a>';
|
246 |
-
}
|
247 |
-
|
248 |
-
if ( ! empty( $target ) && is_string( $target ) )
|
249 |
-
$tag = links_add_target( $tag, $target );
|
250 |
-
|
251 |
-
if ( $return_as_tag )
|
252 |
-
return $tag;
|
253 |
-
else
|
254 |
-
return array(
|
255 |
-
'link' => $permalink,
|
256 |
-
'tag' => $tag,
|
257 |
-
);
|
258 |
-
}
|
259 |
-
|
260 |
-
|
261 |
-
public static function add_media( $post_id, $media_src, $media_name = null, $featured_image = true ) {
|
262 |
-
require_once ABSPATH . 'wp-admin/includes/image.php';
|
263 |
-
|
264 |
-
if ( empty( $media_name ) )
|
265 |
-
$media_name = basename( $media_src );
|
266 |
-
|
267 |
-
$wp_filetype = wp_check_filetype( $media_name, null );
|
268 |
-
$attachment = array(
|
269 |
-
'post_mime_type' => $wp_filetype['type'],
|
270 |
-
'post_status' => 'inherit',
|
271 |
-
'post_title' => $media_name,
|
272 |
-
);
|
273 |
-
|
274 |
-
$file_move = wp_upload_bits( $media_name, null, self::file_get_contents_curl( $media_src ) );
|
275 |
-
$file_name = $file_move['file'];
|
276 |
-
|
277 |
-
$image_id = wp_insert_attachment( $attachment, $file_name, $post_id );
|
278 |
-
$metadata = wp_generate_attachment_metadata( $image_id, $file_name );
|
279 |
-
wp_update_attachment_metadata( $image_id, $metadata );
|
280 |
-
|
281 |
-
if ( $featured_image )
|
282 |
-
update_post_meta( $post_id, '_thumbnail_id', $image_id );
|
283 |
-
|
284 |
-
return $image_id;
|
285 |
-
}
|
286 |
-
|
287 |
-
|
288 |
-
/**
|
289 |
-
* Thank you Tobylewis
|
290 |
-
*
|
291 |
-
* file_get_contents support on some shared systems is turned off
|
292 |
-
*
|
293 |
-
* @ref http://wordpress.org/support/topic/plugin-flickr-shortcode-importer-file_get_contents-with-url-isp-does-not-support?replies=2#post-2878241
|
294 |
-
*/
|
295 |
-
public static function file_get_contents_curl( $url ) {
|
296 |
-
$ch = curl_init();
|
297 |
-
|
298 |
-
curl_setopt( $ch, CURLOPT_AUTOREFERER, true );
|
299 |
-
curl_setopt( $ch, CURLOPT_HEADER, 0 );
|
300 |
-
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
|
301 |
-
curl_setopt( $ch, CURLOPT_URL, $url );
|
302 |
-
curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, true );
|
303 |
-
|
304 |
-
$data = curl_exec( $ch );
|
305 |
-
curl_close( $ch );
|
306 |
-
|
307 |
-
return $data;
|
308 |
-
}
|
309 |
-
|
310 |
-
|
311 |
-
public static function get_image_src( $image, $strip_protocol = true ) {
|
312 |
-
$doc = new DOMDocument();
|
313 |
-
$doc->loadHTML( $image );
|
314 |
-
$xpath = new DOMXPath( $doc );
|
315 |
-
$src = $xpath->evaluate( 'string(//img/@src)' );
|
316 |
-
|
317 |
-
if ( $strip_protocol )
|
318 |
-
$src = self::strip_protocol( $src );
|
319 |
-
|
320 |
-
return $src;
|
321 |
-
}
|
322 |
-
|
323 |
-
|
324 |
-
public static function clean_string( $string ) {
|
325 |
-
if ( ! is_string( $string ) )
|
326 |
-
return $string;
|
327 |
-
|
328 |
-
return trim( strip_shortcodes( strip_tags( $string ) ) );
|
329 |
-
}
|
330 |
-
|
331 |
-
|
332 |
-
/**
|
333 |
-
* Truncate HTML, close opened tags. UTF-8 aware, and aware of unpaired tags
|
334 |
-
* (which don't need a matching closing tag)
|
335 |
-
*
|
336 |
-
* @param string $html
|
337 |
-
* @param int $max_length Maximum length of the characters of the string
|
338 |
-
* @param string $indicator Suffix to use if string was truncated.
|
339 |
-
* @param boolean $force_indicator Suffix to use if string was truncated.
|
340 |
-
* @return string
|
341 |
-
*
|
342 |
-
* @ref http://pastie.org/3084080
|
343 |
-
*/
|
344 |
-
public static function truncate( $html, $max_length, $indicator = '…', $force_indicator = false ) {
|
345 |
-
$output_length = 0; // number of counted characters stored so far in $output
|
346 |
-
$position = 0; // character offset within input string after last tag/entity
|
347 |
-
$tag_stack = array(); // stack of tags we've encountered but not closed
|
348 |
-
$output = '';
|
349 |
-
$truncated = false;
|
350 |
-
|
351 |
-
/**
|
352 |
-
* these tags don't have matching closing elements, in HTML (in XHTML they
|
353 |
-
* theoretically need a closing /> )
|
354 |
-
*
|
355 |
-
* @see http://www.netstrider.com/tutorials/HTMLRef/a_d.html
|
356 |
-
* @see http://www.w3schools.com/tags/default.asp
|
357 |
-
* @see http://stackoverflow.com/questions/3741896/what-do-you-call-tags-that-need-no-ending-tag
|
358 |
-
*/
|
359 |
-
$unpaired_tags = array(
|
360 |
-
'doctype',
|
361 |
-
'!doctype',
|
362 |
-
'area',
|
363 |
-
'base',
|
364 |
-
'basefont',
|
365 |
-
'bgsound',
|
366 |
-
'br',
|
367 |
-
'col',
|
368 |
-
'embed',
|
369 |
-
'frame',
|
370 |
-
'hr',
|
371 |
-
'img',
|
372 |
-
'input',
|
373 |
-
'link',
|
374 |
-
'meta',
|
375 |
-
'param',
|
376 |
-
'sound',
|
377 |
-
'spacer',
|
378 |
-
'wbr',
|
379 |
-
);
|
380 |
-
|
381 |
-
$func_strcut = function_exists( 'mb_strcut' ) ? 'mb_strcut' : 'substr';
|
382 |
-
$func_strlen = function_exists( 'mb_strlen' ) ? 'mb_strlen' : 'strlen';
|
383 |
-
|
384 |
-
// loop through, splitting at HTML entities or tags
|
385 |
-
while ( $output_length < $max_length && preg_match( '{</?([a-z]+)[^>]*>|&#?[a-zA-Z0-9]+;}', $html, $match, PREG_OFFSET_CAPTURE, $position ) ) {
|
386 |
-
list( $tag, $tag_position ) = $match[0];
|
387 |
-
|
388 |
-
// get text leading up to the tag, and store it – up to max_length
|
389 |
-
$text = $func_strcut( $html, $position, $tag_position - $position );
|
390 |
-
if ( $output_length + $func_strlen( $text ) > $max_length ) {
|
391 |
-
$output .= $func_strcut( $text, 0, $max_length - $output_length );
|
392 |
-
$truncated = true;
|
393 |
-
$output_length = $max_length;
|
394 |
-
break;
|
395 |
-
}
|
396 |
-
|
397 |
-
// store everything, it wasn't too long
|
398 |
-
$output .= $text;
|
399 |
-
$output_length += $func_strlen( $text );
|
400 |
-
|
401 |
-
if ( $tag[0] == '&' ) {
|
402 |
-
// Handle HTML entity by copying straight through
|
403 |
-
$output .= $tag;
|
404 |
-
$output_length++; // only counted as one character
|
405 |
-
} else {
|
406 |
-
// Handle HTML tag
|
407 |
-
$tag_inner = $match[1][0];
|
408 |
-
if ( $tag[1] == '/' ) {
|
409 |
-
// This is a closing tag.
|
410 |
-
$output .= $tag;
|
411 |
-
// If input tags aren't balanced, we leave the popped tag
|
412 |
-
// on the stack so hopefully we're not introducing more
|
413 |
-
// problems.
|
414 |
-
|
415 |
-
if ( end( $tag_stack ) == $tag_inner )
|
416 |
-
array_pop( $tag_stack );
|
417 |
-
} elseif ( $tag[$func_strlen( $tag ) - 2] == '/' || in_array( strtolower( $tag_inner ), $unpaired_tags ) ) {
|
418 |
-
// Self-closing or unpaired tag
|
419 |
-
$output .= $tag;
|
420 |
-
} else {
|
421 |
-
// Opening tag.
|
422 |
-
$output .= $tag;
|
423 |
-
$tag_stack[] = $tag_inner; // push tag onto the stack
|
424 |
-
}
|
425 |
-
}
|
426 |
-
|
427 |
-
// Continue after the tag we just found
|
428 |
-
$position = $tag_position + $func_strlen( $tag );
|
429 |
-
}
|
430 |
-
|
431 |
-
// Print any remaining text after the last tag, if there's room
|
432 |
-
|
433 |
-
if ( $output_length < $max_length && $position < $func_strlen( $html ) )
|
434 |
-
$output .= $func_strcut( $html, $position, $max_length - $output_length );
|
435 |
-
|
436 |
-
$truncated = $func_strlen( $html ) - $position > $max_length - $output_length;
|
437 |
-
|
438 |
-
// add terminator if it was truncated in loop or just above here
|
439 |
-
if ( $truncated || $force_indicator )
|
440 |
-
$output .= $indicator;
|
441 |
-
|
442 |
-
// Close any open tags
|
443 |
-
while ( ! empty( $tag_stack ) )
|
444 |
-
$output .= '</'.array_pop( $tag_stack ).'>';
|
445 |
-
|
446 |
-
return $output;
|
447 |
-
}
|
448 |
-
|
449 |
-
|
450 |
-
public static function strip_protocol( $link ) {
|
451 |
-
if ( ! empty( $link ) ) {
|
452 |
-
$link = preg_replace( '#https?:#', '', $link );
|
453 |
-
}
|
454 |
-
|
455 |
-
return $link;
|
456 |
-
}
|
457 |
-
|
458 |
-
|
459 |
-
}
|
460 |
-
|
461 |
-
|
462 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/class-aihrus-licensing.php
DELETED
@@ -1,188 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/*
|
3 |
-
Copyright 2014 Michael Cannon (email: mc@aihr.us)
|
4 |
-
|
5 |
-
This program is free software; you can redistribute it and/or modify
|
6 |
-
it under the terms of the GNU General Public License, version 2, as
|
7 |
-
published by the Free Software Foundation.
|
8 |
-
|
9 |
-
This program is distributed in the hope that it will be useful,
|
10 |
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11 |
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12 |
-
GNU General Public License for more details.
|
13 |
-
|
14 |
-
You should have received a copy of the GNU General Public License
|
15 |
-
along with this program; if not, write to the Free Software
|
16 |
-
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
17 |
-
*/
|
18 |
-
|
19 |
-
if ( class_exists( 'Aihrus_Licensing' ) )
|
20 |
-
return;
|
21 |
-
|
22 |
-
require_once 'interface-aihrus-licensing.php';
|
23 |
-
|
24 |
-
|
25 |
-
abstract class Aihrus_Licensing implements Aihrus_Licensing_Interface {
|
26 |
-
public $author;
|
27 |
-
public $item_name;
|
28 |
-
public $slug;
|
29 |
-
public $store_url;
|
30 |
-
|
31 |
-
|
32 |
-
public function __construct( $slug, $item_name, $author = 'Michael Cannon', $store_url = 'http://aihr.us' ) {
|
33 |
-
$this->author = $author;
|
34 |
-
$this->item_name = urlencode( $item_name );
|
35 |
-
$this->slug = $slug;
|
36 |
-
$this->store_url = $store_url;
|
37 |
-
}
|
38 |
-
|
39 |
-
|
40 |
-
public function license_key() {
|
41 |
-
$key = $this->slug . 'license_key';
|
42 |
-
|
43 |
-
return $key;
|
44 |
-
}
|
45 |
-
|
46 |
-
|
47 |
-
public function get_license() {
|
48 |
-
$key = $this->license_key();
|
49 |
-
$license = get_transient( $key );
|
50 |
-
|
51 |
-
return $license;
|
52 |
-
}
|
53 |
-
|
54 |
-
|
55 |
-
public function update_license( $value = null ) {
|
56 |
-
$license = $this->get_license();
|
57 |
-
if ( $license === $value )
|
58 |
-
return $value;
|
59 |
-
|
60 |
-
if ( $this->valid_hash( $value ) ) {
|
61 |
-
$this->set_license( $value );
|
62 |
-
$value = $this->activate_license();
|
63 |
-
$this->set_license( $value );
|
64 |
-
|
65 |
-
return $value;
|
66 |
-
} else {
|
67 |
-
$this->deactivate_license();
|
68 |
-
$this->delete_license();
|
69 |
-
|
70 |
-
return '';
|
71 |
-
}
|
72 |
-
}
|
73 |
-
|
74 |
-
|
75 |
-
public function set_license( $value = null ) {
|
76 |
-
$key = $this->license_key();
|
77 |
-
|
78 |
-
delete_transient( $key );
|
79 |
-
|
80 |
-
if ( ! is_null( $value ) )
|
81 |
-
set_transient( $key, $value, WEEK_IN_SECONDS );
|
82 |
-
}
|
83 |
-
|
84 |
-
|
85 |
-
public function valid_license() {
|
86 |
-
$license = $this->get_license();
|
87 |
-
if ( $this->valid_hash( $license ) )
|
88 |
-
return true;
|
89 |
-
else
|
90 |
-
return false;
|
91 |
-
}
|
92 |
-
|
93 |
-
|
94 |
-
public function get_api_call( $action ) {
|
95 |
-
$license = $this->get_license();
|
96 |
-
$api_params = array(
|
97 |
-
'edd_action' => $action,
|
98 |
-
'item_name' => $this->item_name,
|
99 |
-
'license' => $license,
|
100 |
-
);
|
101 |
-
|
102 |
-
$api_call = add_query_arg(
|
103 |
-
$api_params,
|
104 |
-
$this->store_url
|
105 |
-
);
|
106 |
-
|
107 |
-
return $api_call;
|
108 |
-
}
|
109 |
-
|
110 |
-
|
111 |
-
public function get_remote_get( $api_call ) {
|
112 |
-
$response = wp_remote_get(
|
113 |
-
$api_call,
|
114 |
-
array(
|
115 |
-
'timeout' => 10,
|
116 |
-
'sslverify' => false,
|
117 |
-
)
|
118 |
-
);
|
119 |
-
|
120 |
-
return $response;
|
121 |
-
}
|
122 |
-
|
123 |
-
|
124 |
-
public function activate_license() {
|
125 |
-
$license_data = $this->get_license_data( 'activate_license' );
|
126 |
-
if ( false !== $license_data ) {
|
127 |
-
if ( 'valid' == $license_data->license ) {
|
128 |
-
$license = $this->get_license();
|
129 |
-
|
130 |
-
return $license;
|
131 |
-
}
|
132 |
-
|
133 |
-
return $license_data->license;
|
134 |
-
}
|
135 |
-
|
136 |
-
return false;
|
137 |
-
}
|
138 |
-
|
139 |
-
|
140 |
-
public function get_license_data( $action = 'check_license' ) {
|
141 |
-
$api_call = $this->get_api_call( $action );
|
142 |
-
$response = $this->get_remote_get( $api_call );
|
143 |
-
if ( is_wp_error( $response ) )
|
144 |
-
return false;
|
145 |
-
|
146 |
-
$license_data = json_decode( wp_remote_retrieve_body( $response ) );
|
147 |
-
|
148 |
-
return $license_data;
|
149 |
-
}
|
150 |
-
|
151 |
-
|
152 |
-
public function deactivate_license() {
|
153 |
-
$license_data = $this->get_license_data( 'deactivate_license' );
|
154 |
-
if ( false !== $license_data ) {
|
155 |
-
if ( 'deactivated' == $license_data->license )
|
156 |
-
return true;
|
157 |
-
|
158 |
-
return $license_data->license;
|
159 |
-
}
|
160 |
-
|
161 |
-
return false;
|
162 |
-
}
|
163 |
-
|
164 |
-
|
165 |
-
public function delete_license() {
|
166 |
-
$this->set_license();
|
167 |
-
}
|
168 |
-
|
169 |
-
|
170 |
-
public function license_notice() {
|
171 |
-
$result = '<p><em>' . esc_html( 'Premium features require licensing to function.' ) . '</em></p>';
|
172 |
-
|
173 |
-
return $result;
|
174 |
-
}
|
175 |
-
|
176 |
-
|
177 |
-
public function valid_hash( $value = null ) {
|
178 |
-
if ( is_string( $value ) && preg_match( '#^[0-9a-f]{32}$#i', $value ) )
|
179 |
-
return true;
|
180 |
-
|
181 |
-
return false;
|
182 |
-
}
|
183 |
-
|
184 |
-
|
185 |
-
}
|
186 |
-
|
187 |
-
|
188 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/class-aihrus-settings.php
DELETED
@@ -1,757 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/*
|
3 |
-
Copyright 2014 Michael Cannon (email: mc@aihr.us)
|
4 |
-
|
5 |
-
This program is free software; you can redistribute it and/or modify
|
6 |
-
it under the terms of the GNU General Public License, version 2, as
|
7 |
-
published by the Free Software Foundation.
|
8 |
-
|
9 |
-
This program is distributed in the hope that it will be useful,
|
10 |
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11 |
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12 |
-
GNU General Public License for more details.
|
13 |
-
|
14 |
-
You should have received a copy of the GNU General Public License
|
15 |
-
along with this program; if not, write to the Free Software
|
16 |
-
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
17 |
-
*/
|
18 |
-
|
19 |
-
/**
|
20 |
-
* Aihrus Framework settings helper class
|
21 |
-
*
|
22 |
-
* Based upon http://alisothegeek.com/2011/01/wordpress-settings-api-tutorial-1/
|
23 |
-
*/
|
24 |
-
|
25 |
-
require_once ABSPATH . 'wp-admin/includes/template.php';
|
26 |
-
|
27 |
-
if ( class_exists( 'Aihrus_Settings' ) )
|
28 |
-
return;
|
29 |
-
|
30 |
-
|
31 |
-
abstract class Aihrus_Settings {
|
32 |
-
public static $default = array(
|
33 |
-
'backwards' => array(
|
34 |
-
'version' => null, // below this version number, use std
|
35 |
-
'std' => null,
|
36 |
-
),
|
37 |
-
'choices' => array(), // key => value
|
38 |
-
'class' => null, // warning, etc.
|
39 |
-
'desc' => null,
|
40 |
-
'id' => null,
|
41 |
-
'section' => 'general',
|
42 |
-
'show_code' => false,
|
43 |
-
'std' => null, // default key or value
|
44 |
-
'suggest' => false, // attempt for auto-suggest on inputs
|
45 |
-
'title' => null,
|
46 |
-
'type' => 'text', // textarea, checkbox, radio, select, hidden, heading, password, expand_begin, expand_end
|
47 |
-
'validate' => null, // required, term, slug, slugs, ids, order, single paramater PHP functions
|
48 |
-
'widget' => 1, // show in widget options, 0 off
|
49 |
-
);
|
50 |
-
|
51 |
-
|
52 |
-
public function __construct() {}
|
53 |
-
|
54 |
-
|
55 |
-
public static function load_options() {
|
56 |
-
static::sections();
|
57 |
-
static::settings();
|
58 |
-
}
|
59 |
-
|
60 |
-
|
61 |
-
public static function sections() {
|
62 |
-
static::$sections['reset'] = esc_html__( 'Reset' );
|
63 |
-
static::$sections['about'] = esc_html__( 'About' );
|
64 |
-
}
|
65 |
-
|
66 |
-
|
67 |
-
/**
|
68 |
-
*
|
69 |
-
*
|
70 |
-
* @SuppressWarnings(PHPMD.Superglobals)
|
71 |
-
*/
|
72 |
-
public static function settings() {
|
73 |
-
// Reset section defaults
|
74 |
-
$options = get_option( static::ID );
|
75 |
-
if ( ! empty( $options ) ) {
|
76 |
-
$serialized_options = serialize( $options );
|
77 |
-
$_SESSION['export'] = $serialized_options;
|
78 |
-
|
79 |
-
static::$settings['export'] = array(
|
80 |
-
'section' => 'reset',
|
81 |
-
'title' => esc_html__( 'Export Settings' ),
|
82 |
-
'type' => 'readonly',
|
83 |
-
'desc' => esc_html__( 'These are your current settings in a serialized format. Copy the contents to make a backup of your settings.' ),
|
84 |
-
'std' => $serialized_options,
|
85 |
-
'widget' => 0,
|
86 |
-
);
|
87 |
-
}
|
88 |
-
|
89 |
-
static::$settings['import'] = array(
|
90 |
-
'section' => 'reset',
|
91 |
-
'title' => esc_html__( 'Import Settings' ),
|
92 |
-
'type' => 'textarea',
|
93 |
-
'desc' => esc_html__( 'Paste new serialized settings here to overwrite your current configuration.' ),
|
94 |
-
'widget' => 0,
|
95 |
-
);
|
96 |
-
|
97 |
-
$desc = esc_html__( 'Delete all %s data and options from database on plugin deletion. Even if this option isn\'t checked, WordPress will still give a data deletion warning.' );
|
98 |
-
|
99 |
-
static::$settings['delete_data'] = array(
|
100 |
-
'section' => 'reset',
|
101 |
-
'title' => esc_html__( 'Remove Plugin Data on Deletion?' ),
|
102 |
-
'type' => 'checkbox',
|
103 |
-
'class' => 'warning',
|
104 |
-
'desc' => sprintf( $desc, static::NAME ),
|
105 |
-
'widget' => 0,
|
106 |
-
);
|
107 |
-
|
108 |
-
static::$settings['reset_defaults'] = array(
|
109 |
-
'section' => 'reset',
|
110 |
-
'title' => esc_html__( 'Reset to Defaults?' ),
|
111 |
-
'type' => 'checkbox',
|
112 |
-
'class' => 'warning',
|
113 |
-
'desc' => esc_html__( 'Check this box to reset options to their defaults' ),
|
114 |
-
);
|
115 |
-
}
|
116 |
-
|
117 |
-
|
118 |
-
public static function get_defaults( $mode = null, $old_version = null ) {
|
119 |
-
if ( empty( static::$defaults ) )
|
120 |
-
static::settings();
|
121 |
-
|
122 |
-
$do_backwards = false;
|
123 |
-
if ( 'backwards' == $mode ) {
|
124 |
-
if ( ! empty( $old_version ) )
|
125 |
-
$do_backwards = true;
|
126 |
-
}
|
127 |
-
|
128 |
-
foreach ( static::$settings as $id => $parts ) {
|
129 |
-
$std = isset( $parts['std'] ) ? $parts['std'] : '';
|
130 |
-
if ( $do_backwards ) {
|
131 |
-
$version = ! empty( $parts['backwards']['version'] ) ? $parts['backwards']['version'] : false;
|
132 |
-
if ( ! empty( $version ) ) {
|
133 |
-
if ( $old_version < $version )
|
134 |
-
$std = $parts['backwards']['std'];
|
135 |
-
}
|
136 |
-
}
|
137 |
-
|
138 |
-
static::$defaults[ $id ] = $std;
|
139 |
-
}
|
140 |
-
|
141 |
-
return static::$defaults;
|
142 |
-
}
|
143 |
-
|
144 |
-
|
145 |
-
public static function get_settings() {
|
146 |
-
if ( empty( static::$settings ) )
|
147 |
-
static::settings();
|
148 |
-
|
149 |
-
return static::$settings;
|
150 |
-
}
|
151 |
-
|
152 |
-
|
153 |
-
public static function initialize_settings( $version = null ) {
|
154 |
-
$defaults = static::get_defaults( 'backwards' );
|
155 |
-
$current = get_option( static::ID );
|
156 |
-
$current = wp_parse_args( $current, $defaults );
|
157 |
-
|
158 |
-
$current['admin_notices'] = $version;
|
159 |
-
$current['version'] = static::$version;
|
160 |
-
|
161 |
-
update_option( static::ID, $current );
|
162 |
-
}
|
163 |
-
|
164 |
-
|
165 |
-
/**
|
166 |
-
*
|
167 |
-
*
|
168 |
-
* @SuppressWarnings(PHPMD.UnusedLocalVariable)
|
169 |
-
*/
|
170 |
-
public static function create_setting( $args = array() ) {
|
171 |
-
extract( $args );
|
172 |
-
|
173 |
-
if ( preg_match( '#(_expand_begin|_expand_end)#', $id ) )
|
174 |
-
return;
|
175 |
-
|
176 |
-
$field_args = array(
|
177 |
-
'choices' => $choices,
|
178 |
-
'class' => $class,
|
179 |
-
'desc' => $desc,
|
180 |
-
'id' => $id,
|
181 |
-
'label_for' => $id,
|
182 |
-
'show_code' => $show_code,
|
183 |
-
'std' => $std,
|
184 |
-
'suggest' => $suggest,
|
185 |
-
'type' => $type,
|
186 |
-
);
|
187 |
-
|
188 |
-
static::$defaults[$id] = $std;
|
189 |
-
|
190 |
-
add_settings_field( $id, $title, array( static::$class, 'display_setting' ), static::ID, $section, $field_args );
|
191 |
-
}
|
192 |
-
|
193 |
-
|
194 |
-
public static function section_scripts() {
|
195 |
-
echo '
|
196 |
-
<script type="text/javascript">
|
197 |
-
jQuery(document).ready(function($) {
|
198 |
-
$( "#' . static::ID . '" ).tabs();
|
199 |
-
// This will make the "warning" checkbox class really stand out when checked.
|
200 |
-
$(".warning").change(function() {
|
201 |
-
if ($(this).is(":checked"))
|
202 |
-
$(this).parent().css("background", "#c00").css("color", "#fff").css("fontWeight", "bold");
|
203 |
-
else
|
204 |
-
$(this).parent().css("background", "inherit").css("color", "inherit").css("fontWeight", "inherit");
|
205 |
-
});
|
206 |
-
});
|
207 |
-
</script>
|
208 |
-
';
|
209 |
-
}
|
210 |
-
|
211 |
-
|
212 |
-
public static function do_settings_sections( $page ) {
|
213 |
-
global $wp_settings_sections, $wp_settings_fields;
|
214 |
-
|
215 |
-
if ( ! isset( $wp_settings_sections ) || ! isset( $wp_settings_sections[$page] ) )
|
216 |
-
return;
|
217 |
-
|
218 |
-
foreach ( (array) $wp_settings_sections[$page] as $section ) {
|
219 |
-
if ( $section['callback'] )
|
220 |
-
call_user_func( $section['callback'], $section );
|
221 |
-
|
222 |
-
if ( ! isset( $wp_settings_fields ) || ! isset( $wp_settings_fields[$page] ) || ! isset( $wp_settings_fields[$page][$section['id']] ) )
|
223 |
-
continue;
|
224 |
-
|
225 |
-
echo '<table id=' . $section['id'] . ' class="form-table">';
|
226 |
-
do_settings_fields( $page, $section['id'] );
|
227 |
-
echo '</table>';
|
228 |
-
}
|
229 |
-
}
|
230 |
-
|
231 |
-
|
232 |
-
public static function display_section() {}
|
233 |
-
|
234 |
-
|
235 |
-
public static function display_about() {
|
236 |
-
$name = str_replace( ' Settings', '', static::NAME );
|
237 |
-
$text = __( '<img class="alignright size-medium" src="%1$simages/michael-cannon-red-square-300x2251.jpg" alt="Michael in Red Square, Moscow, Russia" width="300" height="225" /><a href="%2$s">%3$s</a> is by <a href="%4$s">Michael Cannon</a>. He\'s <a href="%5$s">Peichi’s</a> smiling man, an adventurous <a href="%6$s" target="_blank">water-rat</a>, <a href="%7$s">chief people officer</a>, <a href="%8$s">cyclist</a>, <a href="%9$s">full stack developer</a>, <a href="%10$s">poet</a>, <a href="%11$s">WWOOF’er</a> and <a href="%12$s">world traveler</a>.' );
|
238 |
-
|
239 |
-
echo '<div id="about" style="width: 70%; min-height: 225px;"><p>';
|
240 |
-
echo sprintf(
|
241 |
-
$text,
|
242 |
-
static::$plugin_assets,
|
243 |
-
esc_url( static::$plugin_url ),
|
244 |
-
$name,
|
245 |
-
esc_url( 'http://aihr.us/resume/' ),
|
246 |
-
esc_url( 'http://peimic.com/t/peichi-liu/' ),
|
247 |
-
esc_url( 'http://www.chinesehoroscope.org/chinese_zodiac/rat/' ),
|
248 |
-
esc_url( 'http://axelerant.com/who-we-are' ),
|
249 |
-
esc_url( 'http://peimic.com/c/biking/' ),
|
250 |
-
esc_url( 'http://aihr.us/about-aihrus/' ),
|
251 |
-
esc_url( 'http://peimic.com/t/poetry/' ),
|
252 |
-
esc_url( 'http://peimic.com/t/WWOOF/' ),
|
253 |
-
esc_url( 'http://peimic.com/c/travel/' )
|
254 |
-
);
|
255 |
-
echo '</p></div>';
|
256 |
-
}
|
257 |
-
|
258 |
-
|
259 |
-
public static function display_page( $disable_donate = false ) {
|
260 |
-
echo '<div class="wrap">
|
261 |
-
<div class="icon32" id="icon-options-general"></div>
|
262 |
-
<h2>' . static::NAME . '</h2>';
|
263 |
-
|
264 |
-
echo '<form action="options.php" method="post">';
|
265 |
-
|
266 |
-
settings_errors( static::ID );
|
267 |
-
settings_fields( static::ID );
|
268 |
-
|
269 |
-
echo '<div id="' . static::ID . '">
|
270 |
-
<ul>';
|
271 |
-
|
272 |
-
foreach ( static::$sections as $section_slug => $section )
|
273 |
-
echo '<li><a href="#' . $section_slug . '">' . $section . '</a></li>';
|
274 |
-
|
275 |
-
echo '</ul>';
|
276 |
-
|
277 |
-
self::do_settings_sections( static::ID );
|
278 |
-
|
279 |
-
echo '
|
280 |
-
<p class="submit"><input name="Submit" type="submit" class="button-primary" value="' . esc_html__( 'Save Changes' ) . '" /></p>
|
281 |
-
</form>
|
282 |
-
</div>
|
283 |
-
';
|
284 |
-
|
285 |
-
if ( ! $disable_donate ) {
|
286 |
-
echo '<p>' .
|
287 |
-
sprintf(
|
288 |
-
__( 'If you like this plugin, please <a href="%1$s" title="Donate for Good Karma"><img src="%2$s" border="0" alt="Donate for Good Karma" /></a> or <a href="%3$s" title="purchase premium WordPress plugins from Aihrus ">purchase the Premium version</a> to help fund further development and <a href="%4$s" title="Support forums">support</a>.' ),
|
289 |
-
esc_url( 'http://aihr.us/about-aihrus/donate/' ),
|
290 |
-
esc_url( 'https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif' ),
|
291 |
-
esc_url( 'http://aihr.us/store/' ),
|
292 |
-
esc_url( 'https://aihrus.zendesk.com/home' )
|
293 |
-
) .
|
294 |
-
'</p>';
|
295 |
-
}
|
296 |
-
|
297 |
-
echo '<p class="copyright">' .
|
298 |
-
sprintf(
|
299 |
-
__( 'Copyright ©%1$s <a href="%2$s">Aihrus</a>.' ),
|
300 |
-
date( 'Y' ),
|
301 |
-
esc_url( 'http://aihr.us' )
|
302 |
-
) .
|
303 |
-
'</p>';
|
304 |
-
|
305 |
-
echo '</div>';
|
306 |
-
|
307 |
-
add_action( 'admin_footer', array( static::$class, 'section_scripts' ) );
|
308 |
-
}
|
309 |
-
|
310 |
-
|
311 |
-
public static function display_setting( $args = array(), $do_echo = true, $input = null ) {
|
312 |
-
$content = '';
|
313 |
-
|
314 |
-
extract( $args );
|
315 |
-
|
316 |
-
if ( is_null( $input ) )
|
317 |
-
$options = get_option( static::ID );
|
318 |
-
else {
|
319 |
-
$options = array();
|
320 |
-
$options[$id] = $input;
|
321 |
-
}
|
322 |
-
|
323 |
-
if ( ! isset( $options[$id] ) && $type != 'checkbox' )
|
324 |
-
$options[$id] = $std;
|
325 |
-
elseif ( ! isset( $options[$id] ) )
|
326 |
-
$options[$id] = 0;
|
327 |
-
|
328 |
-
$field_class = '';
|
329 |
-
if ( ! empty( $class ) )
|
330 |
-
$field_class = ' ' . $class;
|
331 |
-
|
332 |
-
// desc isn't escaped because it's might contain allowed html
|
333 |
-
$choices = array_map( 'esc_attr', $choices );
|
334 |
-
$field_class = esc_attr( $field_class );
|
335 |
-
$id = esc_attr( $id );
|
336 |
-
$field_value = esc_attr( $options[$id] );
|
337 |
-
$std = esc_attr( $std );
|
338 |
-
|
339 |
-
switch ( $type ) {
|
340 |
-
case 'checkbox':
|
341 |
-
$content .= '<input class="checkbox' . $field_class . '" type="checkbox" id="' . $id . '" name="' . static::ID . '[' . $id . ']" value="1" ' . checked( $field_value, 1, false ) . ' /> ';
|
342 |
-
|
343 |
-
if ( ! empty( $desc ) )
|
344 |
-
$content .= '<label for="' . $id . '"><span class="description">' . $desc . '</span></label>';
|
345 |
-
|
346 |
-
if ( $show_code )
|
347 |
-
$content .= '<br /><code>' . $id . '</code>';
|
348 |
-
break;
|
349 |
-
|
350 |
-
case 'file':
|
351 |
-
$content .= '<input class="regular-text' . $field_class . '" type="file" id="' . $id . '" name="' . static::ID . '[' . $id . ']" />';
|
352 |
-
|
353 |
-
if ( ! empty( $desc ) )
|
354 |
-
$content .= '<br /><span class="description">' . $desc . '</span>';
|
355 |
-
|
356 |
-
break;
|
357 |
-
|
358 |
-
case 'heading':
|
359 |
-
$content .= '</td></tr><tr valign="top"><td colspan="2"><h4>' . $desc . '</h4>';
|
360 |
-
break;
|
361 |
-
|
362 |
-
case 'hidden':
|
363 |
-
$content .= '<input type="hidden" id="' . $id . '" name="' . static::ID . '[' . $id . ']" value="' . $field_value . '" />';
|
364 |
-
|
365 |
-
break;
|
366 |
-
|
367 |
-
case 'password':
|
368 |
-
$content .= '<input class="regular-text' . $field_class . '" type="password" id="' . $id . '" name="' . static::ID . '[' . $id . ']" value="' . $field_value . '" />';
|
369 |
-
|
370 |
-
if ( ! empty( $desc ) )
|
371 |
-
$content .= '<br /><span class="description">' . $desc . '</span>';
|
372 |
-
|
373 |
-
break;
|
374 |
-
|
375 |
-
case 'radio':
|
376 |
-
$i = 1;
|
377 |
-
$count_choices = count( $choices );
|
378 |
-
foreach ( $choices as $value => $label ) {
|
379 |
-
$content .= '<input class="radio' . $field_class . '" type="radio" name="' . static::ID . '[' . $id . ']" id="' . $id . $i . '" value="' . $value . '" ' . checked( $field_value, $value, false ) . '> <label for="' . $id . $i . '">' . $label . '</label>';
|
380 |
-
|
381 |
-
if ( $i < $count_choices )
|
382 |
-
$content .= '<br />';
|
383 |
-
|
384 |
-
$i++;
|
385 |
-
}
|
386 |
-
|
387 |
-
if ( ! empty( $desc ) )
|
388 |
-
$content .= '<br /><span class="description">' . $desc . '</span>';
|
389 |
-
|
390 |
-
if ( $show_code )
|
391 |
-
$content .= '<br /><code>' . $id . '</code>';
|
392 |
-
break;
|
393 |
-
|
394 |
-
case 'readonly':
|
395 |
-
$content .= '<input class="regular-text' . $field_class . '" type="text" id="' . $id . '" name="' . static::ID . '[' . $id . ']" value="' . $field_value . '" readonly="readonly" />';
|
396 |
-
|
397 |
-
if ( ! empty( $desc ) )
|
398 |
-
$content .= '<br /><span class="description">' . $desc . '</span>';
|
399 |
-
|
400 |
-
break;
|
401 |
-
|
402 |
-
case 'select':
|
403 |
-
$content .= '<select class="select' . $field_class . '" id="' . $id . '" name="' . static::ID . '[' . $id . ']">';
|
404 |
-
|
405 |
-
foreach ( $choices as $value => $label )
|
406 |
-
$content .= '<option value="' . $value . '"' . selected( $field_value, $value, false ) . '>' . $label . '</option>';
|
407 |
-
|
408 |
-
$content .= '</select>';
|
409 |
-
|
410 |
-
if ( ! empty( $desc ) )
|
411 |
-
$content .= '<br /><span class="description">' . $desc . '</span>';
|
412 |
-
|
413 |
-
if ( $show_code )
|
414 |
-
$content .= '<br /><code>' . $id . '</code>';
|
415 |
-
break;
|
416 |
-
|
417 |
-
case 'text':
|
418 |
-
$content .= '<input class="regular-text' . $field_class . '" type="text" id="' . $id . '" name="' . static::ID . '[' . $id . ']" placeholder="' . $std . '" value="' . $field_value . '" />';
|
419 |
-
|
420 |
-
if ( ! empty( $desc ) )
|
421 |
-
$content .= '<br /><span class="description">' . $desc . '</span>';
|
422 |
-
|
423 |
-
if ( $show_code )
|
424 |
-
$content .= '<br /><code>' . $id . '</code>';
|
425 |
-
break;
|
426 |
-
|
427 |
-
case 'textarea':
|
428 |
-
$content .= '<textarea class="' . $field_class . '" id="' . $id . '" name="' . static::ID . '[' . $id . ']" placeholder="' . $std . '" rows="5" cols="30">' . $field_value . '</textarea>';
|
429 |
-
|
430 |
-
if ( ! empty( $desc ) )
|
431 |
-
$content .= '<br /><span class="description">' . $desc . '</span>';
|
432 |
-
|
433 |
-
if ( $show_code )
|
434 |
-
$content .= '<br /><code>' . $id . '</code>';
|
435 |
-
break;
|
436 |
-
|
437 |
-
default:
|
438 |
-
break;
|
439 |
-
}
|
440 |
-
|
441 |
-
if ( ! $do_echo )
|
442 |
-
return $content;
|
443 |
-
|
444 |
-
echo $content;
|
445 |
-
}
|
446 |
-
|
447 |
-
|
448 |
-
public static function register_settings() {
|
449 |
-
register_setting( static::ID, static::ID, array( static::$class, 'validate_settings' ) );
|
450 |
-
|
451 |
-
foreach ( static::$sections as $slug => $title ) {
|
452 |
-
if ( $slug == 'about' )
|
453 |
-
add_settings_section( $slug, $title, array( static::$class, 'display_about' ), static::ID );
|
454 |
-
else
|
455 |
-
add_settings_section( $slug, $title, array( static::$class, 'display_section' ), static::ID );
|
456 |
-
}
|
457 |
-
|
458 |
-
foreach ( static::$settings as $id => $setting ) {
|
459 |
-
$setting['id'] = $id;
|
460 |
-
static::create_setting( $setting );
|
461 |
-
}
|
462 |
-
}
|
463 |
-
|
464 |
-
|
465 |
-
public static function scripts() {
|
466 |
-
wp_enqueue_script( 'jquery-ui-tabs' );
|
467 |
-
}
|
468 |
-
|
469 |
-
|
470 |
-
public static function styles() {
|
471 |
-
wp_register_style( 'jquery-style', '//ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/themes/smoothness/jquery-ui.css' );
|
472 |
-
wp_enqueue_style( 'jquery-style' );
|
473 |
-
}
|
474 |
-
|
475 |
-
|
476 |
-
/**
|
477 |
-
*
|
478 |
-
*
|
479 |
-
* @SuppressWarnings(PHPMD.Superglobals)
|
480 |
-
*/
|
481 |
-
public static function validate_settings( $input, $options = null, $do_errors = false ) {
|
482 |
-
$errors = array();
|
483 |
-
|
484 |
-
$null_options = false;
|
485 |
-
if ( is_null( $options ) ) {
|
486 |
-
$null_options = true;
|
487 |
-
|
488 |
-
$defaults = static::get_defaults();
|
489 |
-
$options = self::get_settings();
|
490 |
-
|
491 |
-
if ( is_admin() ) {
|
492 |
-
if ( ! empty( $input['reset_defaults'] ) ) {
|
493 |
-
foreach ( $defaults as $id => $std )
|
494 |
-
$input[$id] = $std;
|
495 |
-
|
496 |
-
unset( $input['reset_defaults'] );
|
497 |
-
|
498 |
-
$input['resetted'] = true;
|
499 |
-
}
|
500 |
-
|
501 |
-
if ( ! empty( $input['import'] ) && $_SESSION['export'] != $input['import'] ) {
|
502 |
-
$import = $input['import'];
|
503 |
-
$unserialized = unserialize( $import );
|
504 |
-
if ( is_array( $unserialized ) ) {
|
505 |
-
foreach ( $unserialized as $id => $std )
|
506 |
-
$input[$id] = $std;
|
507 |
-
}
|
508 |
-
}
|
509 |
-
}
|
510 |
-
}
|
511 |
-
|
512 |
-
foreach ( $options as $id => $parts ) {
|
513 |
-
$default = $parts['std'];
|
514 |
-
$type = $parts['type'];
|
515 |
-
$validations = ! empty( $parts['validate'] ) ? $parts['validate'] : array();
|
516 |
-
if ( ! empty( $validations ) )
|
517 |
-
$validations = explode( ',', $validations );
|
518 |
-
|
519 |
-
if ( ! isset( $input[ $id ] ) ) {
|
520 |
-
if ( 'checkbox' != $type ) {
|
521 |
-
$input[ $id ] = $default;
|
522 |
-
} else {
|
523 |
-
if ( empty( $parts['widget'] ) ) {
|
524 |
-
continue;
|
525 |
-
} else {
|
526 |
-
$input[ $id ] = 0;
|
527 |
-
}
|
528 |
-
}
|
529 |
-
}
|
530 |
-
|
531 |
-
if ( $default == $input[ $id ] && ! in_array( 'required', $validations ) )
|
532 |
-
continue;
|
533 |
-
|
534 |
-
if ( 'checkbox' == $type ) {
|
535 |
-
if ( self::is_true( $input[ $id ] ) )
|
536 |
-
$input[ $id ] = 1;
|
537 |
-
else
|
538 |
-
$input[ $id ] = 0;
|
539 |
-
} elseif ( in_array( $type, array( 'radio', 'select' ) ) ) {
|
540 |
-
// single choices only
|
541 |
-
$keys = array_keys( $parts['choices'] );
|
542 |
-
|
543 |
-
if ( ! in_array( $input[ $id ], $keys ) ) {
|
544 |
-
if ( self::is_true( $input[ $id ] ) )
|
545 |
-
$input[ $id ] = 1;
|
546 |
-
else
|
547 |
-
$input[ $id ] = 0;
|
548 |
-
}
|
549 |
-
}
|
550 |
-
|
551 |
-
if ( ! empty( $validations ) ) {
|
552 |
-
foreach ( $validations as $validate )
|
553 |
-
self::validators( $validate, $id, $input, $default, $errors );
|
554 |
-
}
|
555 |
-
}
|
556 |
-
|
557 |
-
unset( $input['export'] );
|
558 |
-
unset( $input['import'] );
|
559 |
-
|
560 |
-
$hide_update_notice = false;
|
561 |
-
if ( isset( static::$hide_update_notice ) && ! empty( static::$hide_update_notice ) ) {
|
562 |
-
$hide_update_notice = true;
|
563 |
-
}
|
564 |
-
|
565 |
-
if ( $null_options && empty( $errors ) && ! $hide_update_notice ) {
|
566 |
-
add_settings_error( static::ID, 'settings_updated', esc_html__( 'Settings saved.' ), 'updated' );
|
567 |
-
set_transient( 'settings_errors', get_settings_errors(), 30 );
|
568 |
-
}
|
569 |
-
|
570 |
-
if ( empty( $do_errors ) ) {
|
571 |
-
$validated = $input;
|
572 |
-
} else {
|
573 |
-
$validated = array(
|
574 |
-
'input' => $input,
|
575 |
-
'errors' => $errors,
|
576 |
-
);
|
577 |
-
}
|
578 |
-
|
579 |
-
return $validated;
|
580 |
-
}
|
581 |
-
|
582 |
-
|
583 |
-
public static function validators( $validate, $id, &$input, $default, &$errors ) {
|
584 |
-
switch ( $validate ) {
|
585 |
-
case 'absint':
|
586 |
-
case 'intval':
|
587 |
-
if ( '' !== $input[ $id ] )
|
588 |
-
$input[ $id ] = $validate( $input[ $id ] );
|
589 |
-
else
|
590 |
-
$input[ $id ] = $default;
|
591 |
-
break;
|
592 |
-
|
593 |
-
case 'ids':
|
594 |
-
$input[ $id ] = self::validate_ids( $input[ $id ], $default );
|
595 |
-
break;
|
596 |
-
|
597 |
-
case 'is_true':
|
598 |
-
$input[ $id ] = self::is_true( $input[ $id ] );
|
599 |
-
break;
|
600 |
-
|
601 |
-
case 'min1':
|
602 |
-
$input[ $id ] = intval( $input[ $id ] );
|
603 |
-
if ( 0 >= $input[ $id ] )
|
604 |
-
$input[ $id ] = $default;
|
605 |
-
break;
|
606 |
-
|
607 |
-
case 'nozero':
|
608 |
-
$input[ $id ] = intval( $input[ $id ] );
|
609 |
-
if ( 0 === $input[ $id ] )
|
610 |
-
$input[ $id ] = $default;
|
611 |
-
break;
|
612 |
-
|
613 |
-
case 'order':
|
614 |
-
$input[ $id ] = self::validate_order( $input[ $id ], $default );
|
615 |
-
break;
|
616 |
-
|
617 |
-
case 'required':
|
618 |
-
if ( empty( $input[ $id ] ) )
|
619 |
-
$errors[ $id ] = esc_html__( 'Required' );
|
620 |
-
break;
|
621 |
-
|
622 |
-
case 'slash_sanitize_title':
|
623 |
-
$temp = explode( '/', $input[ $id ] );
|
624 |
-
$temp = array_map( 'sanitize_title', $temp );
|
625 |
-
$temp = implode( '/', $temp );
|
626 |
-
|
627 |
-
$input[ $id ] = $temp;
|
628 |
-
break;
|
629 |
-
|
630 |
-
case 'slug':
|
631 |
-
$input[ $id ] = self::validate_slug( $input[ $id ], $default );
|
632 |
-
$input[ $id ] = strtolower( $input[ $id ] );
|
633 |
-
break;
|
634 |
-
|
635 |
-
case 'slugs':
|
636 |
-
$input[ $id ] = self::validate_slugs( $input[ $id ], $default );
|
637 |
-
$input[ $id ] = strtolower( $input[ $id ] );
|
638 |
-
break;
|
639 |
-
|
640 |
-
case 'term':
|
641 |
-
$input[ $id ] = self::validate_term( $input[ $id ], $default );
|
642 |
-
$input[ $id ] = strtolower( $input[ $id ] );
|
643 |
-
break;
|
644 |
-
|
645 |
-
case 'terms':
|
646 |
-
$input[ $id ] = self::validate_terms( $input[ $id ], $default );
|
647 |
-
break;
|
648 |
-
|
649 |
-
case 'trim':
|
650 |
-
$options = explode( "\n", $input[ $id ] );
|
651 |
-
foreach ( $options as $key => $value )
|
652 |
-
$options[ $key ] = trim( $value );
|
653 |
-
|
654 |
-
$input[ $id ] = implode( "\n", $options );
|
655 |
-
break;
|
656 |
-
|
657 |
-
case 'url':
|
658 |
-
$input[ $id ] = self::validate_url( $input[ $id ], $default );
|
659 |
-
break;
|
660 |
-
|
661 |
-
default:
|
662 |
-
$input[ $id ] = $validate( $input[ $id ] );
|
663 |
-
break;
|
664 |
-
}
|
665 |
-
}
|
666 |
-
|
667 |
-
|
668 |
-
public static function validate_ids( $input, $default ) {
|
669 |
-
if ( preg_match( '#^\d+(,\s?\d+)*$#', $input ) )
|
670 |
-
return preg_replace( '#\s#', '', $input );
|
671 |
-
|
672 |
-
return $default;
|
673 |
-
}
|
674 |
-
|
675 |
-
|
676 |
-
public static function validate_order( $input, $default ) {
|
677 |
-
if ( preg_match( '#^desc|asc$#i', $input ) )
|
678 |
-
return $input;
|
679 |
-
|
680 |
-
return $default;
|
681 |
-
}
|
682 |
-
|
683 |
-
|
684 |
-
public static function validate_slugs( $input, $default ) {
|
685 |
-
if ( preg_match( '#^[\w-]+(,\s?[\w-]+)*$#', $input ) )
|
686 |
-
return preg_replace( '#\s#', '', $input );
|
687 |
-
|
688 |
-
return $default;
|
689 |
-
}
|
690 |
-
|
691 |
-
|
692 |
-
public static function validate_slug( $input, $default ) {
|
693 |
-
if ( preg_match( '#^[\w-]+$#', $input ) )
|
694 |
-
return $input;
|
695 |
-
|
696 |
-
return $default;
|
697 |
-
}
|
698 |
-
|
699 |
-
|
700 |
-
public static function validate_term( $input, $default ) {
|
701 |
-
if ( preg_match( '#^\w+$#', $input ) )
|
702 |
-
return $input;
|
703 |
-
|
704 |
-
return $default;
|
705 |
-
}
|
706 |
-
|
707 |
-
|
708 |
-
/**
|
709 |
-
* Let values like true, 'true', 1, 'on', and 'yes' to be true. Else, false
|
710 |
-
*/
|
711 |
-
public static function is_true( $value = null, $return_boolean = true ) {
|
712 |
-
if ( true === $value || 'true' == strtolower( $value ) || 1 == $value || 'on' == strtolower( $value ) || 'yes' == strtolower( $value ) ) {
|
713 |
-
if ( $return_boolean )
|
714 |
-
return true;
|
715 |
-
else
|
716 |
-
return 1;
|
717 |
-
} else {
|
718 |
-
if ( $return_boolean )
|
719 |
-
return false;
|
720 |
-
else
|
721 |
-
return 0;
|
722 |
-
}
|
723 |
-
}
|
724 |
-
|
725 |
-
|
726 |
-
public static function validate_terms( $input, $default ) {
|
727 |
-
if ( preg_match( '#^(([\w- ]+)(,\s?)?)+$#', $input ) )
|
728 |
-
return preg_replace( '#,\s*$#', '', $input );
|
729 |
-
|
730 |
-
return $default;
|
731 |
-
}
|
732 |
-
|
733 |
-
|
734 |
-
public static function validate_url( $input, $default ) {
|
735 |
-
if ( filter_var( $input, FILTER_VALIDATE_URL ) )
|
736 |
-
return $input;
|
737 |
-
|
738 |
-
return $default;
|
739 |
-
}
|
740 |
-
|
741 |
-
|
742 |
-
public static function get_scripts() {
|
743 |
-
foreach ( static::$scripts as $script )
|
744 |
-
echo $script;
|
745 |
-
}
|
746 |
-
|
747 |
-
|
748 |
-
public static function get_styles() {
|
749 |
-
foreach ( static::$styles as $style )
|
750 |
-
echo $style;
|
751 |
-
}
|
752 |
-
|
753 |
-
|
754 |
-
}
|
755 |
-
|
756 |
-
|
757 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/class-aihrus-widget.php
DELETED
@@ -1,252 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/*
|
3 |
-
Copyright 2014 Michael Cannon (email: mc@aihr.us)
|
4 |
-
|
5 |
-
This program is free software; you can redistribute it and/or modify
|
6 |
-
it under the terms of the GNU General Public License, version 2, as
|
7 |
-
published by the Free Software Foundation.
|
8 |
-
|
9 |
-
This program is distributed in the hope that it will be useful,
|
10 |
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11 |
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12 |
-
GNU General Public License for more details.
|
13 |
-
|
14 |
-
You should have received a copy of the GNU General Public License
|
15 |
-
along with this program; if not, write to the Free Software
|
16 |
-
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
17 |
-
*/
|
18 |
-
|
19 |
-
if ( class_exists( 'Aihrus_Widget' ) )
|
20 |
-
return;
|
21 |
-
|
22 |
-
require_once 'interface-aihrus-widget.php';
|
23 |
-
|
24 |
-
|
25 |
-
abstract class Aihrus_Widget extends WP_Widget implements Aihrus_Widget_Interface {
|
26 |
-
public static $suggest_id = 0;
|
27 |
-
|
28 |
-
|
29 |
-
public function __construct( $classname, $description, $id_base, $title ) {
|
30 |
-
// Widget settings
|
31 |
-
$widget_ops = array(
|
32 |
-
'classname' => $classname,
|
33 |
-
'description' => $description,
|
34 |
-
);
|
35 |
-
|
36 |
-
// Widget control settings
|
37 |
-
$control_ops = array(
|
38 |
-
'id_base' => $id_base,
|
39 |
-
);
|
40 |
-
|
41 |
-
// Create the widget
|
42 |
-
$this->WP_Widget(
|
43 |
-
static::ID,
|
44 |
-
$title,
|
45 |
-
$widget_ops,
|
46 |
-
$control_ops
|
47 |
-
);
|
48 |
-
}
|
49 |
-
|
50 |
-
|
51 |
-
public function widget( $args, $instance ) {
|
52 |
-
global $before_widget, $before_title, $after_title, $after_widget;
|
53 |
-
|
54 |
-
$args = wp_parse_args( $args, static::get_defaults() );
|
55 |
-
extract( $args );
|
56 |
-
|
57 |
-
// Our variables from the widget settings
|
58 |
-
$title = apply_filters( 'widget_title', $instance['title'], null );
|
59 |
-
$content = static::get_content( $instance, $this->number );
|
60 |
-
|
61 |
-
// Before widget (defined by themes)
|
62 |
-
echo $before_widget;
|
63 |
-
|
64 |
-
if ( ! empty( $instance['title_link'] ) ) {
|
65 |
-
$target = ! empty( $instance['target'] ) ? $instance['target'] : null;
|
66 |
-
$title = Aihrus_Common::create_link( $instance['title_link'], $title, $target );
|
67 |
-
}
|
68 |
-
|
69 |
-
// Display the widget title if one was input (before and after defined by themes)
|
70 |
-
if ( ! empty( $title ) )
|
71 |
-
echo $before_title . $title . $after_title;
|
72 |
-
|
73 |
-
// Display Widget
|
74 |
-
echo $content;
|
75 |
-
|
76 |
-
// After widget (defined by themes)
|
77 |
-
echo $after_widget;
|
78 |
-
}
|
79 |
-
|
80 |
-
|
81 |
-
/**
|
82 |
-
*
|
83 |
-
*
|
84 |
-
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
85 |
-
*/
|
86 |
-
|
87 |
-
|
88 |
-
public function update( $new_instance, $old_instance ) {
|
89 |
-
$instance = static::validate_settings( $new_instance );
|
90 |
-
|
91 |
-
return $instance;
|
92 |
-
}
|
93 |
-
|
94 |
-
|
95 |
-
public function form( $instance ) {
|
96 |
-
$instance = static::form_instance( $instance );
|
97 |
-
$defaults = static::get_defaults();
|
98 |
-
$instance = wp_parse_args( $instance, $defaults );
|
99 |
-
|
100 |
-
$form_parts = static::form_parts( $instance, $this->number );
|
101 |
-
foreach ( $form_parts as $key => $part ) {
|
102 |
-
$part[ 'id' ] = $key;
|
103 |
-
$this->display_setting( $part, $instance );
|
104 |
-
}
|
105 |
-
}
|
106 |
-
|
107 |
-
|
108 |
-
public static function widget_options( $options ) {
|
109 |
-
foreach ( $options as $id => $parts ) {
|
110 |
-
// remove non-widget parts
|
111 |
-
if ( empty( $parts['widget'] ) )
|
112 |
-
unset( $options[ $id ] );
|
113 |
-
}
|
114 |
-
|
115 |
-
return $options;
|
116 |
-
}
|
117 |
-
|
118 |
-
|
119 |
-
/**
|
120 |
-
*
|
121 |
-
*
|
122 |
-
* @SuppressWarnings(PHPMD.UnusedLocalVariable)
|
123 |
-
*/
|
124 |
-
public function display_setting( $args = array(), $options ) {
|
125 |
-
extract( $args );
|
126 |
-
|
127 |
-
$do_return = false;
|
128 |
-
switch ( $type ) {
|
129 |
-
case 'heading':
|
130 |
-
if ( ! empty( $desc ) )
|
131 |
-
echo '<h3>' . $desc . '</h3>';
|
132 |
-
|
133 |
-
$do_return = true;
|
134 |
-
break;
|
135 |
-
|
136 |
-
case 'expand_all':
|
137 |
-
if ( ! empty( $desc ) )
|
138 |
-
echo '<h3>' . $desc . '</h3>';
|
139 |
-
|
140 |
-
echo '<a id="' . $this->get_field_id( $id ) . '" style="cursor:pointer;" onclick="jQuery( \'.tw-collapsible-control\' ) . slideToggle(); jQuery( \'.tw-collapsible\' ) . slideToggle();">' . esc_html__( 'Expand/Collapse All Options' ) . ' »</a>';
|
141 |
-
|
142 |
-
$do_return = true;
|
143 |
-
break;
|
144 |
-
|
145 |
-
case 'expand_begin':
|
146 |
-
if ( ! empty( $desc ) )
|
147 |
-
echo '<h3>' . $desc . '</h3>';
|
148 |
-
|
149 |
-
echo '<a id="' . $this->get_field_id( $id ) . '" style="cursor:pointer;" onclick="jQuery( \'div#' . $this->get_field_id( $id ) . '\' ) . slideToggle();" class="tw-collapsible-control">' . esc_html__( 'Expand/Collapse' ) . ' »</a>';
|
150 |
-
echo '<div id="' . $this->get_field_id( $id ) . '" style="display:none" class="tw-collapsible">';
|
151 |
-
|
152 |
-
$do_return = true;
|
153 |
-
break;
|
154 |
-
|
155 |
-
case 'expand_end':
|
156 |
-
echo '</div>';
|
157 |
-
|
158 |
-
$do_return = true;
|
159 |
-
break;
|
160 |
-
|
161 |
-
default:
|
162 |
-
break;
|
163 |
-
}
|
164 |
-
|
165 |
-
if ( $do_return )
|
166 |
-
return;
|
167 |
-
|
168 |
-
if ( ! isset( $options[$id] ) && $type != 'checkbox' )
|
169 |
-
$options[$id] = $std;
|
170 |
-
elseif ( ! isset( $options[$id] ) )
|
171 |
-
$options[$id] = 0;
|
172 |
-
|
173 |
-
$field_class = '';
|
174 |
-
if ( ! empty( $class ) )
|
175 |
-
$field_class = ' ' . $class;
|
176 |
-
|
177 |
-
echo '<p>';
|
178 |
-
|
179 |
-
switch ( $type ) {
|
180 |
-
case 'checkbox':
|
181 |
-
echo '<input class="checkbox' . $field_class . '" type="checkbox" id="' . $this->get_field_id( $id ) . '" name="' . $this->get_field_name( $id ) . '" value="1" ' . checked( $options[$id], 1, false ) . ' /> ';
|
182 |
-
|
183 |
-
echo '<label for="' . $this->get_field_id( $id ) . '">' . $title . '</label>';
|
184 |
-
break;
|
185 |
-
|
186 |
-
case 'select':
|
187 |
-
echo '<label for="' . $this->get_field_id( $id ) . '">' . $title . '</label>';
|
188 |
-
echo '<select id="' . $this->get_field_id( $id ) . '"class="select' . $field_class . '" name="' . $this->get_field_name( $id ) . '">';
|
189 |
-
|
190 |
-
foreach ( $choices as $value => $label )
|
191 |
-
echo '<option value="' . esc_attr( $value ) . '"' . selected( $options[$id], $value, false ) . '>' . $label . '</option>';
|
192 |
-
|
193 |
-
echo '</select>';
|
194 |
-
break;
|
195 |
-
|
196 |
-
case 'radio':
|
197 |
-
$i = 0;
|
198 |
-
$count_options = count( $options ) - 1;
|
199 |
-
|
200 |
-
foreach ( $choices as $value => $label ) {
|
201 |
-
echo '<input class="radio' . $field_class . '" type="radio" name="' . $this->get_field_name( $id ) . '" id="' . $this->get_field_name( $id . $i ) . '" value="' . esc_attr( $value ) . '" ' . checked( $options[$id], $value, false ) . '> <label for="' . $this->get_field_name( $id . $i ) . '">' . $label . '</label>';
|
202 |
-
if ( $i < $count_options )
|
203 |
-
echo '<br />';
|
204 |
-
$i++;
|
205 |
-
}
|
206 |
-
|
207 |
-
echo '<label for="' . $this->get_field_id( $id ) . '">' . $title . '</label>';
|
208 |
-
break;
|
209 |
-
|
210 |
-
case 'textarea':
|
211 |
-
echo '<label for="' . $this->get_field_id( $id ) . '">' . $title . '</label>';
|
212 |
-
|
213 |
-
echo '<textarea class="widefat' . $field_class . '" id="' . $this->get_field_id( $id ) . '" name="' . $this->get_field_name( $id ) . '" placeholder="' . $std . '" rows="5" cols="30">' . wp_htmledit_pre( $options[$id] ) . '</textarea>';
|
214 |
-
break;
|
215 |
-
|
216 |
-
case 'password':
|
217 |
-
echo '<label for="' . $this->get_field_id( $id ) . '">' . $title . '</label>';
|
218 |
-
|
219 |
-
echo '<input class="widefat' . $field_class . '" type="password" id="' . $this->get_field_id( $id ) . '" name="' . $this->get_field_name( $id ) . '" value="' . esc_attr( $options[$id] ) . '" />';
|
220 |
-
break;
|
221 |
-
|
222 |
-
case 'readonly':
|
223 |
-
echo '<label for="' . $this->get_field_id( $id ) . '">' . $title . '</label>';
|
224 |
-
|
225 |
-
echo '<input class="widefat' . $field_class . '" type="text" id="' . $this->get_field_id( $id ) . '" name="' . $this->get_field_name( $id ) . '" value="' . esc_attr( $options[$id] ) . '" readonly="readonly" />';
|
226 |
-
break;
|
227 |
-
|
228 |
-
case 'text':
|
229 |
-
echo '<label for="' . $this->get_field_id( $id ) . '">' . $title . '</label>';
|
230 |
-
|
231 |
-
$suggest_id = 'suggest_' . self::$suggest_id++;
|
232 |
-
echo '<input class="widefat' . $field_class . ' ' . $suggest_id . '" type="text" id="' . $this->get_field_id( $id ) . '" name="' . $this->get_field_name( $id ) . '" placeholder="' . $std . '" value="' . esc_attr( $options[$id] ) . '" />';
|
233 |
-
|
234 |
-
if ( $suggest )
|
235 |
-
echo static::get_suggest( $id, $suggest_id );
|
236 |
-
break;
|
237 |
-
|
238 |
-
default:
|
239 |
-
break;
|
240 |
-
}
|
241 |
-
|
242 |
-
if ( ! empty( $desc ) )
|
243 |
-
echo '<br /><span class="setting-description"><small>' . $desc . '</small></span>';
|
244 |
-
|
245 |
-
echo '</p>';
|
246 |
-
}
|
247 |
-
|
248 |
-
|
249 |
-
}
|
250 |
-
|
251 |
-
|
252 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/class-aihrus-common.php
DELETED
@@ -1,782 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Aihrus Framework
|
4 |
-
* Copyright (C) 2015 Axelerant
|
5 |
-
* This program is free software; you can redistribute it and/or modify
|
6 |
-
* it under the terms of the GNU General Public License as published by
|
7 |
-
* the Free Software Foundation; either version 2 of the License, or
|
8 |
-
* (at your option) any later version.
|
9 |
-
* This program is distributed in the hope that it will be useful,
|
10 |
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11 |
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12 |
-
* GNU General Public License for more details.
|
13 |
-
* You should have received a copy of the GNU General Public License along
|
14 |
-
* with this program; if not, write to the Free Software Foundation, Inc.,
|
15 |
-
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
16 |
-
*/
|
17 |
-
|
18 |
-
|
19 |
-
if ( class_exists( 'Aihrus_Common' ) ) {
|
20 |
-
return;
|
21 |
-
}
|
22 |
-
|
23 |
-
|
24 |
-
abstract class Aihrus_Common {
|
25 |
-
public static $donate_button;
|
26 |
-
public static $donate_link;
|
27 |
-
public static $markdown_helper;
|
28 |
-
public static $scripts_called = false;
|
29 |
-
public static $value_check;
|
30 |
-
|
31 |
-
|
32 |
-
public function __construct() {
|
33 |
-
self::set_notice_key();
|
34 |
-
|
35 |
-
self::$donate_button = <<<EOD
|
36 |
-
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
|
37 |
-
<input type="hidden" name="cmd" value="_s-xclick">
|
38 |
-
<input type="hidden" name="hosted_button_id" value="WM4F995W9LHXE">
|
39 |
-
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
|
40 |
-
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
|
41 |
-
</form>
|
42 |
-
EOD;
|
43 |
-
|
44 |
-
self::$donate_link = '<a href="https://axelerant.com/about-axelerant/donate/"><img src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif" border="0" alt="PayPal - The safer, easier way to pay online!" /></a>';
|
45 |
-
|
46 |
-
add_action( 'admin_init', array( static::$class, 'check_notices' ), 9999 );
|
47 |
-
}
|
48 |
-
|
49 |
-
|
50 |
-
public static function set_notice( $notice_name, $frequency_limit = false ) {
|
51 |
-
$notice_key = self::get_notice_key();
|
52 |
-
|
53 |
-
$frequency_limit = intval( $frequency_limit );
|
54 |
-
if ( ! empty( $frequency_limit ) ) {
|
55 |
-
$fl_key = $notice_key . '_' . $notice_name;
|
56 |
-
$proceed = get_transient( $fl_key );
|
57 |
-
if ( false === $proceed ) {
|
58 |
-
delete_transient( $fl_key );
|
59 |
-
set_transient( $fl_key, time(), $frequency_limit );
|
60 |
-
} else {
|
61 |
-
return;
|
62 |
-
}
|
63 |
-
}
|
64 |
-
|
65 |
-
$notices = get_transient( $notice_key );
|
66 |
-
if ( false === $notices ) {
|
67 |
-
$notices = array();
|
68 |
-
}
|
69 |
-
|
70 |
-
$notices[] = $notice_name;
|
71 |
-
|
72 |
-
self::delete_notices();
|
73 |
-
set_transient( $notice_key, $notices, HOUR_IN_SECONDS );
|
74 |
-
}
|
75 |
-
|
76 |
-
|
77 |
-
public static function delete_notices() {
|
78 |
-
$notice_key = self::get_notice_key();
|
79 |
-
|
80 |
-
delete_transient( $notice_key );
|
81 |
-
}
|
82 |
-
|
83 |
-
|
84 |
-
public static function check_notices() {
|
85 |
-
$notice_key = self::get_notice_key();
|
86 |
-
|
87 |
-
$notices = get_transient( $notice_key );
|
88 |
-
if ( false === $notices ) {
|
89 |
-
return;
|
90 |
-
}
|
91 |
-
|
92 |
-
$notices = array_unique( $notices );
|
93 |
-
foreach ( $notices as $notice ) {
|
94 |
-
if ( function_exists( $notice ) ) {
|
95 |
-
add_action( 'admin_notices', $notice );
|
96 |
-
} elseif ( is_array( $notice ) ) {
|
97 |
-
add_action( 'admin_notices', $notice );
|
98 |
-
} else {
|
99 |
-
add_action( 'admin_notices', array( static::$class, $notice ) );
|
100 |
-
}
|
101 |
-
}
|
102 |
-
|
103 |
-
self::delete_notices();
|
104 |
-
}
|
105 |
-
|
106 |
-
|
107 |
-
public static function get_notice_key() {
|
108 |
-
if ( is_null( static::$notice_key ) ) {
|
109 |
-
self::set_notice_key();
|
110 |
-
}
|
111 |
-
|
112 |
-
return static::$notice_key;
|
113 |
-
}
|
114 |
-
|
115 |
-
|
116 |
-
public static function set_notice_key() {
|
117 |
-
static::$notice_key = static::SLUG . 'notices';
|
118 |
-
}
|
119 |
-
|
120 |
-
|
121 |
-
public static function version( $version ) {
|
122 |
-
$version .= '-' . static::ID . '-' . static::VERSION;
|
123 |
-
|
124 |
-
return $version;
|
125 |
-
}
|
126 |
-
|
127 |
-
|
128 |
-
/**
|
129 |
-
* flatten an arbitrarily deep multidimensional array
|
130 |
-
* into a list of its scalar values
|
131 |
-
* (may be inefficient for large structures)
|
132 |
-
* (will infinite recurse on self-referential structures)
|
133 |
-
* (could be extended to handle objects)
|
134 |
-
*
|
135 |
-
* @ref http://in1.php.net/manual/en/function.array-values.php#41967
|
136 |
-
*/
|
137 |
-
public static function array_values_recursive( $ary ) {
|
138 |
-
$lst = array();
|
139 |
-
foreach ( array_keys( $ary ) as $k ) {
|
140 |
-
$v = $ary[ $k ];
|
141 |
-
if ( is_scalar( $v ) ) {
|
142 |
-
$lst[] = $v;
|
143 |
-
} elseif ( is_array( $v ) ) {
|
144 |
-
$lst = array_merge(
|
145 |
-
$lst,
|
146 |
-
self::array_values_recursive( $v )
|
147 |
-
);
|
148 |
-
}
|
149 |
-
}
|
150 |
-
|
151 |
-
return $lst;
|
152 |
-
}
|
153 |
-
|
154 |
-
|
155 |
-
public static function notice_donate( $disable_donate = null, $item_name = null ) {
|
156 |
-
if ( $disable_donate ) {
|
157 |
-
return;
|
158 |
-
}
|
159 |
-
|
160 |
-
$text = sprintf( esc_html__( 'Please donate $5 towards ongoing free support and development of the "%1$s" plugin. %2$s' ), $item_name, self::$donate_button );
|
161 |
-
|
162 |
-
aihr_notice_updated( $text );
|
163 |
-
}
|
164 |
-
|
165 |
-
|
166 |
-
public static function get_scripts() {
|
167 |
-
if ( static::$scripts_called ) {
|
168 |
-
return;
|
169 |
-
}
|
170 |
-
|
171 |
-
foreach ( static::$scripts as $script ) {
|
172 |
-
echo $script;
|
173 |
-
}
|
174 |
-
|
175 |
-
static::$scripts_called = true;
|
176 |
-
}
|
177 |
-
|
178 |
-
|
179 |
-
public static function get_styles() {
|
180 |
-
if ( empty( self::$styles ) ) {
|
181 |
-
return;
|
182 |
-
}
|
183 |
-
|
184 |
-
if ( empty( self::$styles_called ) ) {
|
185 |
-
echo '<style>';
|
186 |
-
|
187 |
-
foreach ( self::$styles as $style ) {
|
188 |
-
echo $style;
|
189 |
-
}
|
190 |
-
|
191 |
-
echo '</style>';
|
192 |
-
|
193 |
-
self::$styles_called = true;
|
194 |
-
}
|
195 |
-
}
|
196 |
-
|
197 |
-
|
198 |
-
public static function create_nonce( $action ) {
|
199 |
-
$nonce = uniqid();
|
200 |
-
$uid = get_current_user_id();
|
201 |
-
$check = $uid . $action;
|
202 |
-
set_transient( $nonce, $check, HOUR_IN_SECONDS );
|
203 |
-
|
204 |
-
return $nonce;
|
205 |
-
}
|
206 |
-
|
207 |
-
|
208 |
-
public static function verify_nonce( $nonce, $action ) {
|
209 |
-
$active = get_transient( $nonce );
|
210 |
-
$uid = get_current_user_id();
|
211 |
-
$check = $uid . $action;
|
212 |
-
$valid = false;
|
213 |
-
|
214 |
-
if ( $active == $check ) {
|
215 |
-
delete_transient( $nonce );
|
216 |
-
$valid = true;
|
217 |
-
}
|
218 |
-
|
219 |
-
return $valid;
|
220 |
-
}
|
221 |
-
|
222 |
-
|
223 |
-
/**
|
224 |
-
* If incoming link is empty, then get_site_url() is used instead.
|
225 |
-
*/
|
226 |
-
public static function create_link( $link, $title = null, $target = null, $return_as_tag = true ) {
|
227 |
-
if ( empty( $link ) ) {
|
228 |
-
$link = get_site_url();
|
229 |
-
}
|
230 |
-
|
231 |
-
if ( preg_match( '#^\d+$#', $link ) ) {
|
232 |
-
$permalink = get_permalink( $link );
|
233 |
-
$tag_title = get_the_title( $link );
|
234 |
-
if ( empty( $title ) ) {
|
235 |
-
$title = $tag_title;
|
236 |
-
}
|
237 |
-
|
238 |
-
$tag = '<a href="';
|
239 |
-
$tag .= $permalink;
|
240 |
-
$tag .= '" title="';
|
241 |
-
$tag .= $tag_title;
|
242 |
-
$tag .= '">';
|
243 |
-
$tag .= $title;
|
244 |
-
$tag .= '</a>';
|
245 |
-
} else {
|
246 |
-
$orig_link = empty( $title ) ? $link : $title;
|
247 |
-
$do_http = true;
|
248 |
-
|
249 |
-
if ( 0 === strpos( $link, '/' ) ) {
|
250 |
-
$do_http = false;
|
251 |
-
}
|
252 |
-
|
253 |
-
if ( $do_http && 0 === preg_match( '#https?://#', $link ) ) {
|
254 |
-
$link = 'http://' . $link;
|
255 |
-
}
|
256 |
-
|
257 |
-
$permalink = $link;
|
258 |
-
|
259 |
-
$tag = '<a href="';
|
260 |
-
$tag .= $permalink;
|
261 |
-
$tag .= '">';
|
262 |
-
$tag .= $orig_link;
|
263 |
-
$tag .= '</a>';
|
264 |
-
}
|
265 |
-
|
266 |
-
if ( ! empty( $target ) && is_string( $target ) ) {
|
267 |
-
$tag = links_add_target( $tag, $target );
|
268 |
-
}
|
269 |
-
|
270 |
-
if ( $return_as_tag ) {
|
271 |
-
return $tag;
|
272 |
-
} else {
|
273 |
-
return array(
|
274 |
-
'link' => $permalink,
|
275 |
-
'tag' => $tag,
|
276 |
-
);
|
277 |
-
}
|
278 |
-
}
|
279 |
-
|
280 |
-
|
281 |
-
public static function add_media( $post_id, $media_src, $media_name = null, $featured_image = true ) {
|
282 |
-
require_once ABSPATH . 'wp-admin/includes/image.php';
|
283 |
-
|
284 |
-
if ( empty( $media_name ) ) {
|
285 |
-
$media_name = basename( $media_src );
|
286 |
-
}
|
287 |
-
|
288 |
-
$wp_filetype = wp_check_filetype( $media_name, null );
|
289 |
-
$attachment = array(
|
290 |
-
'post_mime_type' => $wp_filetype['type'],
|
291 |
-
'post_status' => 'inherit',
|
292 |
-
'post_title' => $media_name,
|
293 |
-
);
|
294 |
-
|
295 |
-
$file_contents = self::file_get_contents( $media_src );
|
296 |
-
$file_move = wp_upload_bits( $media_name, null, $file_contents );
|
297 |
-
$file_name = $file_move['file'];
|
298 |
-
|
299 |
-
$image_id = wp_insert_attachment( $attachment, $file_name, $post_id );
|
300 |
-
$metadata = wp_generate_attachment_metadata( $image_id, $file_name );
|
301 |
-
wp_update_attachment_metadata( $image_id, $metadata );
|
302 |
-
|
303 |
-
if ( $featured_image ) {
|
304 |
-
update_post_meta( $post_id, '_thumbnail_id', $image_id );
|
305 |
-
}
|
306 |
-
|
307 |
-
return $image_id;
|
308 |
-
}
|
309 |
-
|
310 |
-
|
311 |
-
/**
|
312 |
-
* Thank you Tobylewis
|
313 |
-
*
|
314 |
-
* @ref http://wordpress.org/support/topic/plugin-flickr-shortcode-importer-file_get_contents-with-url-isp-does-not-support?replies=2#post-2878241
|
315 |
-
*/
|
316 |
-
public static function file_get_contents_curl( $url ) {
|
317 |
-
$ch = curl_init();
|
318 |
-
|
319 |
-
curl_setopt( $ch, CURLOPT_AUTOREFERER, true );
|
320 |
-
curl_setopt( $ch, CURLOPT_HEADER, 0 );
|
321 |
-
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
|
322 |
-
curl_setopt( $ch, CURLOPT_URL, $url );
|
323 |
-
curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, true );
|
324 |
-
|
325 |
-
$data = curl_exec( $ch );
|
326 |
-
curl_close( $ch );
|
327 |
-
|
328 |
-
return $data;
|
329 |
-
}
|
330 |
-
|
331 |
-
|
332 |
-
/**
|
333 |
-
* file_get_contents support on some shared systems is turned off
|
334 |
-
*/
|
335 |
-
public static function file_get_contents( $url ) {
|
336 |
-
if ( function_exists( 'file_get_contents' ) ) {
|
337 |
-
return file_get_contents( $url );
|
338 |
-
} elseif ( function_exists( 'curl_init' ) ) {
|
339 |
-
return self::file_get_contents_curl( $url );
|
340 |
-
} else {
|
341 |
-
$text = esc_html__( 'cURL is not installed and file_get_contents is not accessible. Unable to retrieve URL %1$s.' );
|
342 |
-
$error = sprintf( $text, $url );
|
343 |
-
|
344 |
-
aihr_notice_error( $error );
|
345 |
-
|
346 |
-
return;
|
347 |
-
}
|
348 |
-
}
|
349 |
-
|
350 |
-
|
351 |
-
public static function get_image_src( $image, $strip_protocol = true ) {
|
352 |
-
$doc = new DOMDocument();
|
353 |
-
$doc->loadHTML( $image );
|
354 |
-
$xpath = new DOMXPath( $doc );
|
355 |
-
$src = $xpath->evaluate( 'string(//img/@src)' );
|
356 |
-
|
357 |
-
if ( $strip_protocol ) {
|
358 |
-
$src = self::strip_protocol( $src );
|
359 |
-
}
|
360 |
-
|
361 |
-
return $src;
|
362 |
-
}
|
363 |
-
|
364 |
-
|
365 |
-
public static function clean_string( $string ) {
|
366 |
-
if ( ! is_string( $string ) ) {
|
367 |
-
return $string;
|
368 |
-
}
|
369 |
-
|
370 |
-
return trim( strip_shortcodes( strip_tags( $string ) ) );
|
371 |
-
}
|
372 |
-
|
373 |
-
|
374 |
-
/**
|
375 |
-
* Truncate HTML, close opened tags. UTF-8 aware, and aware of unpaired tags
|
376 |
-
* (which don't need a matching closing tag)
|
377 |
-
*
|
378 |
-
* @param string $html
|
379 |
-
* @param int $max_length Maximum length of the characters of the string
|
380 |
-
* @param string $indicator Suffix to use if string was truncated.
|
381 |
-
* @param boolean $force_indicator Suffix to use if string was truncated.
|
382 |
-
* @return string
|
383 |
-
*
|
384 |
-
* @ref http://pastie.org/3084080
|
385 |
-
*/
|
386 |
-
public static function truncate( $html, $max_length, $indicator = '…', $force_indicator = false ) {
|
387 |
-
$output_length = 0; // number of counted characters stored so far in $output
|
388 |
-
$position = 0; // character offset within input string after last tag/entity
|
389 |
-
$tag_stack = array(); // stack of tags we've encountered but not closed
|
390 |
-
$output = '';
|
391 |
-
$truncated = false;
|
392 |
-
|
393 |
-
/**
|
394 |
-
* these tags don't have matching closing elements, in HTML (in XHTML they
|
395 |
-
* theoretically need a closing /> )
|
396 |
-
*
|
397 |
-
* @see http://www.netstrider.com/tutorials/HTMLRef/a_d.html
|
398 |
-
* @see http://www.w3schools.com/tags/default.asp
|
399 |
-
* @see http://stackoverflow.com/questions/3741896/what-do-you-call-tags-that-need-no-ending-tag
|
400 |
-
*/
|
401 |
-
$unpaired_tags = array(
|
402 |
-
'doctype',
|
403 |
-
'!doctype',
|
404 |
-
'area',
|
405 |
-
'base',
|
406 |
-
'basefont',
|
407 |
-
'bgsound',
|
408 |
-
'br',
|
409 |
-
'col',
|
410 |
-
'embed',
|
411 |
-
'frame',
|
412 |
-
'hr',
|
413 |
-
'img',
|
414 |
-
'input',
|
415 |
-
'link',
|
416 |
-
'meta',
|
417 |
-
'param',
|
418 |
-
'sound',
|
419 |
-
'spacer',
|
420 |
-
'wbr',
|
421 |
-
);
|
422 |
-
|
423 |
-
$func_strcut = function_exists( 'mb_strcut' ) ? 'mb_strcut' : 'substr';
|
424 |
-
$func_strlen = function_exists( 'mb_strlen' ) ? 'mb_strlen' : 'strlen';
|
425 |
-
|
426 |
-
// loop through, splitting at HTML entities or tags
|
427 |
-
while ( $output_length < $max_length && preg_match( '{</?([a-z]+)[^>]*>|&#?[a-zA-Z0-9]+;}', $html, $match, PREG_OFFSET_CAPTURE, $position ) ) {
|
428 |
-
list( $tag, $tag_position ) = $match[0];
|
429 |
-
|
430 |
-
// get text leading up to the tag, and store it – up to max_length
|
431 |
-
$text = $func_strcut( $html, $position, $tag_position - $position );
|
432 |
-
if ( $output_length + $func_strlen( $text ) > $max_length ) {
|
433 |
-
$output .= $func_strcut( $text, 0, $max_length - $output_length );
|
434 |
-
$truncated = true;
|
435 |
-
$output_length = $max_length;
|
436 |
-
break;
|
437 |
-
}
|
438 |
-
|
439 |
-
// store everything, it wasn't too long
|
440 |
-
$output .= $text;
|
441 |
-
$output_length += $func_strlen( $text );
|
442 |
-
|
443 |
-
if ( '&' == $tag[0] ) {
|
444 |
-
// Handle HTML entity by copying straight through
|
445 |
-
$output .= $tag;
|
446 |
-
$output_length++; // only counted as one character
|
447 |
-
} else {
|
448 |
-
// Handle HTML tag
|
449 |
-
$tag_inner = $match[1][0];
|
450 |
-
if ( '/' == $tag[1] ) {
|
451 |
-
// This is a closing tag.
|
452 |
-
$output .= $tag;
|
453 |
-
// If input tags aren't balanced, we leave the popped tag
|
454 |
-
// on the stack so hopefully we're not introducing more
|
455 |
-
// problems.
|
456 |
-
|
457 |
-
if ( end( $tag_stack ) == $tag_inner ) {
|
458 |
-
array_pop( $tag_stack );
|
459 |
-
}
|
460 |
-
} elseif ( $tag[ $func_strlen( $tag ) - 2 ] == '/' || in_array( strtolower( $tag_inner ), $unpaired_tags ) ) {
|
461 |
-
// Self-closing or unpaired tag
|
462 |
-
$output .= $tag;
|
463 |
-
} else {
|
464 |
-
// Opening tag.
|
465 |
-
$output .= $tag;
|
466 |
-
$tag_stack[] = $tag_inner; // push tag onto the stack
|
467 |
-
}
|
468 |
-
}
|
469 |
-
|
470 |
-
// Continue after the tag we just found
|
471 |
-
$position = $tag_position + $func_strlen( $tag );
|
472 |
-
}
|
473 |
-
|
474 |
-
// Print any remaining text after the last tag, if there's room
|
475 |
-
|
476 |
-
if ( $output_length < $max_length && $position < $func_strlen( $html ) ) {
|
477 |
-
$output .= $func_strcut( $html, $position, $max_length - $output_length );
|
478 |
-
}
|
479 |
-
|
480 |
-
$truncated = $func_strlen( $html ) - $position > $max_length - $output_length;
|
481 |
-
|
482 |
-
// add terminator if it was truncated in loop or just above here
|
483 |
-
if ( $truncated || $force_indicator ) {
|
484 |
-
$output .= $indicator;
|
485 |
-
}
|
486 |
-
|
487 |
-
// Close any open tags
|
488 |
-
while ( ! empty( $tag_stack ) ) {
|
489 |
-
$output .= '</'.array_pop( $tag_stack ).'>';
|
490 |
-
}
|
491 |
-
|
492 |
-
return $output;
|
493 |
-
}
|
494 |
-
|
495 |
-
|
496 |
-
public static function strip_protocol( $link ) {
|
497 |
-
if ( ! empty( $link ) ) {
|
498 |
-
$link = preg_replace( '#https?:#', '', $link );
|
499 |
-
}
|
500 |
-
|
501 |
-
return $link;
|
502 |
-
}
|
503 |
-
|
504 |
-
|
505 |
-
/**
|
506 |
-
*
|
507 |
-
*
|
508 |
-
* @ref http://wpbandit.com/code/check-a-users-role-in-wordpress/
|
509 |
-
*/
|
510 |
-
public static function check_user_role( $roles = array(), $user_id = null ) {
|
511 |
-
// Get user by ID, else get current user
|
512 |
-
if ( $user_id ) {
|
513 |
-
$user = get_userdata( $user_id );
|
514 |
-
} else {
|
515 |
-
$user = wp_get_current_user();
|
516 |
-
}
|
517 |
-
|
518 |
-
// No user found, return
|
519 |
-
if ( empty( $user ) ) {
|
520 |
-
return false;
|
521 |
-
}
|
522 |
-
|
523 |
-
// Append administrator to roles, if necessary
|
524 |
-
if ( ! in_array( 'administrator', $roles ) ) {
|
525 |
-
$roles[] = 'administrator';
|
526 |
-
}
|
527 |
-
|
528 |
-
// Loop through user roles
|
529 |
-
foreach ( $user->roles as $role ) {
|
530 |
-
// Does user have role
|
531 |
-
if ( in_array( $role, $roles ) ) {
|
532 |
-
return true;
|
533 |
-
}
|
534 |
-
}
|
535 |
-
|
536 |
-
// User not in roles
|
537 |
-
return false;
|
538 |
-
}
|
539 |
-
|
540 |
-
|
541 |
-
public static function activation() {
|
542 |
-
if ( ! current_user_can( 'activate_plugins' ) ) {
|
543 |
-
return;
|
544 |
-
}
|
545 |
-
}
|
546 |
-
|
547 |
-
|
548 |
-
public static function deactivation() {
|
549 |
-
if ( ! current_user_can( 'activate_plugins' ) ) {
|
550 |
-
return;
|
551 |
-
}
|
552 |
-
}
|
553 |
-
|
554 |
-
|
555 |
-
public static function uninstall() {
|
556 |
-
if ( ! current_user_can( 'activate_plugins' ) ) {
|
557 |
-
return;
|
558 |
-
}
|
559 |
-
}
|
560 |
-
|
561 |
-
|
562 |
-
public static function version_check() {
|
563 |
-
$good_version = true;
|
564 |
-
|
565 |
-
return $good_version;
|
566 |
-
}
|
567 |
-
|
568 |
-
|
569 |
-
public static function get_archive_slug( $cpt ) {
|
570 |
-
$post_type = get_post_type_object( $cpt );
|
571 |
-
$archive_slug = $post_type->has_archive;
|
572 |
-
if ( true === $archive_slug ) {
|
573 |
-
$archive_slug = $post_type->name;
|
574 |
-
}
|
575 |
-
|
576 |
-
return $archive_slug;
|
577 |
-
}
|
578 |
-
|
579 |
-
|
580 |
-
/**
|
581 |
-
* Generate date archive rewrite rules for a given custom post type
|
582 |
-
*
|
583 |
-
* @param string $cpt slug of the custom post type
|
584 |
-
* @return rules returns a set of rewrite rules for Wordpress to handle
|
585 |
-
*/
|
586 |
-
public static function rewrite_rules_date_archives( $cpt, $wp_rewrite ) {
|
587 |
-
$rules = array();
|
588 |
-
$slug_archive = self::get_archive_slug( $cpt );
|
589 |
-
if ( false === $slug_archive ) {
|
590 |
-
return $rules;
|
591 |
-
}
|
592 |
-
|
593 |
-
$dates = array(
|
594 |
-
array(
|
595 |
-
'rule' => '([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})',
|
596 |
-
'vars' => array( 'year', 'monthnum', 'day' ),
|
597 |
-
),
|
598 |
-
array(
|
599 |
-
'rule' => '([0-9]{4})/([0-9]{1,2})',
|
600 |
-
'vars' => array( 'year', 'monthnum' ),
|
601 |
-
),
|
602 |
-
array(
|
603 |
-
'rule' => '([0-9]{4})',
|
604 |
-
'vars' => array( 'year' ),
|
605 |
-
),
|
606 |
-
);
|
607 |
-
|
608 |
-
foreach ( $dates as $data ) {
|
609 |
-
$query = 'index.php?post_type=' . $cpt;
|
610 |
-
$rule = $slug_archive . '/' . $data['rule'];
|
611 |
-
|
612 |
-
$i = 1;
|
613 |
-
foreach ( $data['vars'] as $var ) {
|
614 |
-
$query .= '&' . $var . '=' . $wp_rewrite->preg_index( $i );
|
615 |
-
$i++;
|
616 |
-
}
|
617 |
-
|
618 |
-
$rules[ $rule . '/?$' ] = $query;
|
619 |
-
$rules[ $rule . '/feed/(feed|rdf|rss|rss2|atom)/?$' ] = $query . '&feed=' . $wp_rewrite->preg_index( $i );
|
620 |
-
$rules[ $rule . '/(feed|rdf|rss|rss2|atom)/?$' ] = $query . '&feed=' . $wp_rewrite->preg_index( $i );
|
621 |
-
$rules[ $rule . '/page/([0-9]{1,})/?$' ] = $query . '&paged=' . $wp_rewrite->preg_index( $i );
|
622 |
-
}
|
623 |
-
|
624 |
-
return $rules;
|
625 |
-
}
|
626 |
-
|
627 |
-
|
628 |
-
public static function markdown2html( $markdown ) {
|
629 |
-
require_once AIHR_DIR_LIB . 'parsedown/Parsedown.php';
|
630 |
-
|
631 |
-
if ( is_null( self::$markdown_helper ) ) {
|
632 |
-
self::$markdown_helper = new Parsedown();
|
633 |
-
}
|
634 |
-
|
635 |
-
if ( is_readable( $markdown ) ) {
|
636 |
-
$markdown = self::file_get_contents( $markdown );
|
637 |
-
} else {
|
638 |
-
return;
|
639 |
-
}
|
640 |
-
|
641 |
-
$html = self::$markdown_helper->text( $markdown );
|
642 |
-
|
643 |
-
return $html;
|
644 |
-
}
|
645 |
-
|
646 |
-
|
647 |
-
public static function rewrite_rules_feed( $wp_rewrite, $slug ) {
|
648 |
-
$rules = array(
|
649 |
-
"feed/({$slug})" => 'index.php?feed=' . $wp_rewrite->preg_index( 1 ),
|
650 |
-
"({$slug}).xml" => 'index.php?feed=' . $wp_rewrite->preg_index( 1 ),
|
651 |
-
);
|
652 |
-
|
653 |
-
return $rules;
|
654 |
-
}
|
655 |
-
|
656 |
-
|
657 |
-
public static function define_options_validate( $parts ) {
|
658 |
-
$validate = '';
|
659 |
-
if ( empty( $parts['validate'] ) ) {
|
660 |
-
return $validate;
|
661 |
-
}
|
662 |
-
|
663 |
-
$validation_info = array(
|
664 |
-
'absint' => __( '<a href="http://codex.wordpress.org/Function_Reference/absint">absint</a>.' ),
|
665 |
-
'ids' => __( 'Digit-only characters to make a multiple or single entries. Regex <code>#^\d+(,\s?\d+)*$#</code>.' ),
|
666 |
-
'intval' => __( '<a href="php.net/manual/en/function.intval.php">intval</a>.' ),
|
667 |
-
'is_true' => __( 'Values like true, \'true\', 1, \'on\', and \'yes\' are <strong>true</strong>; otherwise <strong>false</strong>.' ),
|
668 |
-
'min1' => __( 'An <a href="php.net/manual/en/function.intval.php">intval</a> greater than zero.' ),
|
669 |
-
'nozero' => __( 'A non-zero <a href="php.net/manual/en/function.intval.php">intval</a>.' ),
|
670 |
-
'order' => __( 'SQL ordering "ASC" or "DESC". Regex <code>#^desc|asc$#i</code>.' ),
|
671 |
-
'slash_sanitize_title' => __( '<a href="http://codex.wordpress.org/Function_Reference/sanitize_title">sanitize_title</a>.' ),
|
672 |
-
'slug' => __( 'Word-only characters including a hyphen to make a single term. Regex <code>#^[\w-]+$#</code>.' ),
|
673 |
-
'term' => __( 'Word-only characters to make a single term. Regex <code>#^\w+$#</code>.' ),
|
674 |
-
'terms' => __( 'Word-only characters including hyphens and spaces to make a multiple or single terms. Regex <code>#^(([\w- ]+)(,\s?)?)+$#</code>.' ),
|
675 |
-
'twp_update_license' => esc_html__( 'Current license.' ),
|
676 |
-
'url' => __( '<a href="http://php.net/manual/en/filter.filters.validate.php">filter_var( $url, FILTER_VALIDATE_URL )</a>.' ),
|
677 |
-
'wp_kses_data' => __( '<a href="http://codex.wordpress.org/Function_Reference/wp_kses_data">wp_kses_data</a>.' ),
|
678 |
-
'wp_kses_post' => __( '<a href="http://codex.wordpress.org/Function_Reference/wp_kses_post">wp_kses_post</a>.' ),
|
679 |
-
);
|
680 |
-
|
681 |
-
$validations = ! empty( $parts['validate'] ) ? $parts['validate'] : array();
|
682 |
-
if ( ! empty( $validations ) ) {
|
683 |
-
$validate = esc_html__( 'Validatation: ' );
|
684 |
-
|
685 |
-
$validates = array();
|
686 |
-
$validations = explode( ',', $validations );
|
687 |
-
foreach ( $validations as $validation ) {
|
688 |
-
if ( ! empty( $validation_info[ $validation ] ) ) {
|
689 |
-
$validates[] = $validation_info[ $validation ];
|
690 |
-
} else {
|
691 |
-
$validates[] = 'TBD ' . $validation;
|
692 |
-
}
|
693 |
-
|
694 |
-
self::$value_check = $validation;
|
695 |
-
}
|
696 |
-
|
697 |
-
$validate .= implode( ', ', $validates );
|
698 |
-
}
|
699 |
-
|
700 |
-
return $validate;
|
701 |
-
}
|
702 |
-
|
703 |
-
|
704 |
-
public static function define_options_choices( $parts ) {
|
705 |
-
$choices = '';
|
706 |
-
if ( empty( $parts['choices'] ) ) {
|
707 |
-
return $choices;
|
708 |
-
}
|
709 |
-
|
710 |
-
$choices = $parts['choices'];
|
711 |
-
$choices = array_keys( $parts['choices'] );
|
712 |
-
if ( '' == $choices[0] ) {
|
713 |
-
$choices[0] = 'false';
|
714 |
-
}
|
715 |
-
|
716 |
-
$choices = implode( ', ', $choices );
|
717 |
-
|
718 |
-
return $choices;
|
719 |
-
}
|
720 |
-
|
721 |
-
|
722 |
-
public static function define_options_value( $setting, $parts ) {
|
723 |
-
$value = $parts['std'];
|
724 |
-
|
725 |
-
switch ( $parts['type'] ) {
|
726 |
-
case 'checkbox':
|
727 |
-
if ( Aihrus_Settings::is_false( $value ) ) {
|
728 |
-
$value = 'false';
|
729 |
-
} elseif ( Aihrus_Settings::is_true( $value ) ) {
|
730 |
-
$value = 'true';
|
731 |
-
} elseif ( empty( $value ) ) {
|
732 |
-
$value = esc_html__( 'TBD empty ' ) . $parts['type'];
|
733 |
-
}
|
734 |
-
break;
|
735 |
-
|
736 |
-
case 'select':
|
737 |
-
if ( empty( $value ) ) {
|
738 |
-
$value = esc_html__( 'Pick an option' );
|
739 |
-
}
|
740 |
-
break;
|
741 |
-
|
742 |
-
case 'text':
|
743 |
-
case 'textarea':
|
744 |
-
if ( empty( $value ) ) {
|
745 |
-
if ( 'absint' == self::$value_check ) {
|
746 |
-
$value = 10;
|
747 |
-
} elseif ( 'ids' == self::$value_check ) {
|
748 |
-
$value = '3,1,2';
|
749 |
-
} elseif ( 'intval' == self::$value_check ) {
|
750 |
-
$value = 10;
|
751 |
-
} elseif ( 'min1' == self::$value_check ) {
|
752 |
-
$value = 5;
|
753 |
-
} elseif ( 'nozero' == self::$value_check ) {
|
754 |
-
$value = 10;
|
755 |
-
} elseif ( 'slug' == self::$value_check ) {
|
756 |
-
$value = 'slug-name';
|
757 |
-
} elseif ( 'term' == self::$value_check ) {
|
758 |
-
$value = 'termname';
|
759 |
-
} elseif ( 'terms' == self::$value_check ) {
|
760 |
-
if ( preg_match( '#category|categories#i', $setting ) ) {
|
761 |
-
$value = esc_html__( 'Category A, Another category, 123' );
|
762 |
-
} else {
|
763 |
-
$value = esc_html__( 'Tag A, Another tag, 123' );
|
764 |
-
}
|
765 |
-
} else {
|
766 |
-
$value = esc_html__( 'You decide…' );
|
767 |
-
}
|
768 |
-
}
|
769 |
-
break;
|
770 |
-
|
771 |
-
default:
|
772 |
-
break;
|
773 |
-
}
|
774 |
-
|
775 |
-
self::$value_check = null;
|
776 |
-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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/class-aihrus-licensing.php
DELETED
@@ -1,216 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
Aihrus Framework
|
4 |
-
Copyright (C) 2015 Axelerant
|
5 |
-
|
6 |
-
This program is free software; you can redistribute it and/or modify
|
7 |
-
it under the terms of the GNU General Public License as published by
|
8 |
-
the Free Software Foundation; either version 2 of the License, or
|
9 |
-
(at your option) any later version.
|
10 |
-
|
11 |
-
This program is distributed in the hope that it will be useful,
|
12 |
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 |
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14 |
-
GNU General Public License for more details.
|
15 |
-
|
16 |
-
You should have received a copy of the GNU General Public License along
|
17 |
-
with this program; if not, write to the Free Software Foundation, Inc.,
|
18 |
-
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
19 |
-
*/
|
20 |
-
|
21 |
-
if ( class_exists( 'Aihrus_Licensing' ) ) {
|
22 |
-
return;
|
23 |
-
}
|
24 |
-
|
25 |
-
|
26 |
-
abstract class Aihrus_Licensing {
|
27 |
-
public $author;
|
28 |
-
public $item_name;
|
29 |
-
public $item_name_encoded;
|
30 |
-
public $slug;
|
31 |
-
public $store_url;
|
32 |
-
|
33 |
-
public static $settings_saved = false;
|
34 |
-
|
35 |
-
|
36 |
-
public function __construct( $slug, $item_name, $author = 'Axelerant', $store_url = 'https://store.axelerant.com' ) {
|
37 |
-
$this->author = $author;
|
38 |
-
$this->item_name_encoded = urlencode( $item_name );
|
39 |
-
$this->item_name = $item_name;
|
40 |
-
$this->slug = $slug;
|
41 |
-
$this->store_url = $store_url;
|
42 |
-
}
|
43 |
-
|
44 |
-
|
45 |
-
public function license_key() {
|
46 |
-
$key = $this->slug . 'license_key';
|
47 |
-
|
48 |
-
return $key;
|
49 |
-
}
|
50 |
-
|
51 |
-
|
52 |
-
public function get_license() {
|
53 |
-
$key = $this->license_key();
|
54 |
-
$license = get_transient( $key );
|
55 |
-
|
56 |
-
return $license;
|
57 |
-
}
|
58 |
-
|
59 |
-
|
60 |
-
public function update_license( $value = null ) {
|
61 |
-
$license = $this->get_license();
|
62 |
-
if ( $license === $value ) {
|
63 |
-
return $value;
|
64 |
-
}
|
65 |
-
|
66 |
-
$deactivate_license = false;
|
67 |
-
if ( $this->valid_hash( $value ) ) {
|
68 |
-
$this->set_license( $value );
|
69 |
-
$value = $this->activate_license();
|
70 |
-
$this->set_license( $value );
|
71 |
-
} else {
|
72 |
-
$this->deactivate_license();
|
73 |
-
$this->delete_license();
|
74 |
-
|
75 |
-
$deactivate_license = true;
|
76 |
-
$value = '';
|
77 |
-
}
|
78 |
-
|
79 |
-
if ( $this->valid_license() ) {
|
80 |
-
$text = esc_html__( '%s license saved.' );
|
81 |
-
$text = sprintf( $text, $this->item_name );
|
82 |
-
add_settings_error( static::$settings_id, 'license_saved', $text, 'updated' );
|
83 |
-
} elseif ( empty( $deactivate_license ) ) {
|
84 |
-
$text = esc_html__( '%s license not saved.' );
|
85 |
-
$text = sprintf( $text, $this->item_name );
|
86 |
-
add_settings_error( static::$settings_id, 'license_not_saved', $text, 'error' );
|
87 |
-
}
|
88 |
-
|
89 |
-
if ( empty( self::$settings_saved ) ) {
|
90 |
-
self::$settings_saved = true;
|
91 |
-
set_transient( 'settings_errors', get_settings_errors(), 30 );
|
92 |
-
}
|
93 |
-
|
94 |
-
return $value;
|
95 |
-
}
|
96 |
-
|
97 |
-
|
98 |
-
public function set_license( $value = null ) {
|
99 |
-
$key = $this->license_key();
|
100 |
-
delete_transient( $key );
|
101 |
-
|
102 |
-
if ( ! is_null( $value ) ) {
|
103 |
-
set_transient( $key, $value, YEAR_IN_SECONDS );
|
104 |
-
}
|
105 |
-
}
|
106 |
-
|
107 |
-
|
108 |
-
public function valid_license() {
|
109 |
-
$license = $this->get_license();
|
110 |
-
if ( $this->valid_hash( $license ) ) {
|
111 |
-
return true;
|
112 |
-
} else {
|
113 |
-
return false;
|
114 |
-
}
|
115 |
-
}
|
116 |
-
|
117 |
-
|
118 |
-
public function get_api_call( $action ) {
|
119 |
-
$license = $this->get_license();
|
120 |
-
$api_params = array(
|
121 |
-
'edd_action' => $action,
|
122 |
-
'item_name' => $this->item_name_encoded,
|
123 |
-
'license' => $license,
|
124 |
-
);
|
125 |
-
|
126 |
-
$api_call = add_query_arg(
|
127 |
-
$api_params,
|
128 |
-
$this->store_url
|
129 |
-
);
|
130 |
-
|
131 |
-
return $api_call;
|
132 |
-
}
|
133 |
-
|
134 |
-
|
135 |
-
public function get_remote_get( $api_call ) {
|
136 |
-
$response = wp_remote_get( $api_call, array( 'sslverify' => false ) );
|
137 |
-
|
138 |
-
return $response;
|
139 |
-
}
|
140 |
-
|
141 |
-
|
142 |
-
public function activate_license() {
|
143 |
-
$license_data = $this->get_license_data( 'activate_license' );
|
144 |
-
if ( false !== $license_data ) {
|
145 |
-
if ( 'valid' == $license_data->license ) {
|
146 |
-
$license = $this->get_license();
|
147 |
-
|
148 |
-
return $license;
|
149 |
-
}
|
150 |
-
|
151 |
-
return $license_data->license;
|
152 |
-
}
|
153 |
-
|
154 |
-
return false;
|
155 |
-
}
|
156 |
-
|
157 |
-
|
158 |
-
public function get_license_data( $action = 'check_license' ) {
|
159 |
-
$api_call = $this->get_api_call( $action );
|
160 |
-
$response = $this->get_remote_get( $api_call );
|
161 |
-
if ( empty( $response ) || is_wp_error( $response ) ) {
|
162 |
-
return false;
|
163 |
-
}
|
164 |
-
|
165 |
-
$license_data = json_decode( wp_remote_retrieve_body( $response ) );
|
166 |
-
|
167 |
-
return $license_data;
|
168 |
-
}
|
169 |
-
|
170 |
-
|
171 |
-
public function deactivate_license() {
|
172 |
-
$license_data = $this->get_license_data( 'deactivate_license' );
|
173 |
-
if ( false !== $license_data ) {
|
174 |
-
if ( 'deactivated' == $license_data->license ) {
|
175 |
-
$text = esc_html__( '%s license deactivated.' );
|
176 |
-
$text = sprintf( $text, $this->item_name );
|
177 |
-
add_settings_error( static::$settings_id, 'license_deactivated', $text, 'updated' );
|
178 |
-
|
179 |
-
return true;
|
180 |
-
}
|
181 |
-
|
182 |
-
return $license_data->license;
|
183 |
-
}
|
184 |
-
|
185 |
-
return false;
|
186 |
-
}
|
187 |
-
|
188 |
-
|
189 |
-
public function delete_license() {
|
190 |
-
$this->set_license();
|
191 |
-
}
|
192 |
-
|
193 |
-
|
194 |
-
public function license_notice() {
|
195 |
-
$result = '<p><em>' . esc_html( 'Premium features require licensing to function.' ) . '</em></p>';
|
196 |
-
|
197 |
-
return $result;
|
198 |
-
}
|
199 |
-
|
200 |
-
|
201 |
-
public function valid_hash( $value = null ) {
|
202 |
-
if ( is_string( $value ) && preg_match( '#^[0-9a-f]{32}$#i', $value ) ) {
|
203 |
-
return true;
|
204 |
-
}
|
205 |
-
|
206 |
-
return false;
|
207 |
-
}
|
208 |
-
|
209 |
-
|
210 |
-
public static function settings( $settings ) {
|
211 |
-
return $settings;
|
212 |
-
}
|
213 |
-
}
|
214 |
-
|
215 |
-
|
216 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/class-aihrus-settings.php
DELETED
@@ -1,895 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Aihrus Framework
|
4 |
-
* Copyright (C) 2015 Axelerant
|
5 |
-
* This program is free software; you can redistribute it and/or modify
|
6 |
-
* it under the terms of the GNU General Public License as published by
|
7 |
-
* the Free Software Foundation; either version 2 of the License, or
|
8 |
-
* (at your option) any later version.
|
9 |
-
* This program is distributed in the hope that it will be useful,
|
10 |
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11 |
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12 |
-
* GNU General Public License for more details.
|
13 |
-
* You should have received a copy of the GNU General Public License along
|
14 |
-
* with this program; if not, write to the Free Software Foundation, Inc.,
|
15 |
-
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
16 |
-
*/
|
17 |
-
|
18 |
-
|
19 |
-
/**
|
20 |
-
* Aihrus Framework settings helper class
|
21 |
-
*
|
22 |
-
* Based upon http://alisothegeek.com/2011/01/wordpress-settings-api-tutorial-1/
|
23 |
-
*/
|
24 |
-
require_once ABSPATH . 'wp-admin/includes/template.php';
|
25 |
-
|
26 |
-
if ( class_exists( 'Aihrus_Settings' ) ) {
|
27 |
-
return;
|
28 |
-
}
|
29 |
-
|
30 |
-
|
31 |
-
abstract class Aihrus_Settings {
|
32 |
-
public static $default = array(
|
33 |
-
'backwards' => array(
|
34 |
-
'version' => null, // below this version number, use std
|
35 |
-
'std' => null,
|
36 |
-
),
|
37 |
-
'choices' => array(), // key => value
|
38 |
-
'class' => null, // warning, etc.
|
39 |
-
'desc' => null,
|
40 |
-
'id' => null,
|
41 |
-
'section' => 'general',
|
42 |
-
'show_code' => false,
|
43 |
-
'std' => null, // default key or value
|
44 |
-
'suggest' => false, // attempt for auto-suggest on inputs
|
45 |
-
'title' => null,
|
46 |
-
'type' => 'text', // textarea, checkbox, radio, select, hidden, heading, password, expand_begin, expand_end
|
47 |
-
'validate' => null, // required, term, slug, slugs, ids, order, single paramater PHP functions
|
48 |
-
'widget' => 1, // show in widget options, 0 off
|
49 |
-
);
|
50 |
-
|
51 |
-
private static $settings_saved = false;
|
52 |
-
|
53 |
-
public static $suggest_id = 0;
|
54 |
-
|
55 |
-
public function __construct() {}
|
56 |
-
|
57 |
-
|
58 |
-
public static function load_options() {
|
59 |
-
static::sections();
|
60 |
-
static::settings();
|
61 |
-
}
|
62 |
-
|
63 |
-
|
64 |
-
public static function sections() {
|
65 |
-
static::$sections['reset'] = esc_html__( 'Reset' );
|
66 |
-
static::$sections['about'] = esc_html__( 'About' );
|
67 |
-
}
|
68 |
-
|
69 |
-
|
70 |
-
/**
|
71 |
-
*
|
72 |
-
*
|
73 |
-
* @SuppressWarnings(PHPMD.Superglobals)
|
74 |
-
*/
|
75 |
-
public static function settings() {
|
76 |
-
// Reset section defaults
|
77 |
-
$options = get_option( static::ID );
|
78 |
-
if ( ! empty( $options ) ) {
|
79 |
-
$serialized_options = serialize( $options );
|
80 |
-
$_SESSION['export'] = $serialized_options;
|
81 |
-
|
82 |
-
static::$settings['export'] = array(
|
83 |
-
'section' => 'reset',
|
84 |
-
'title' => esc_html__( 'Export Settings' ),
|
85 |
-
'type' => 'readonly',
|
86 |
-
'desc' => esc_html__( 'These are your current settings in a serialized format. Copy the contents to make a backup of your settings.' ),
|
87 |
-
'std' => $serialized_options,
|
88 |
-
'widget' => 0,
|
89 |
-
'show_code' => false,
|
90 |
-
);
|
91 |
-
}
|
92 |
-
|
93 |
-
static::$settings['import'] = array(
|
94 |
-
'section' => 'reset',
|
95 |
-
'title' => esc_html__( 'Import Settings' ),
|
96 |
-
'type' => 'textarea',
|
97 |
-
'desc' => esc_html__( 'Paste new serialized settings here to overwrite your current configuration.' ),
|
98 |
-
'widget' => 0,
|
99 |
-
'show_code' => false,
|
100 |
-
);
|
101 |
-
|
102 |
-
$desc = esc_html__( 'Delete all %s data and options from database on plugin deletion. Even if this option isn\'t checked, WordPress will still give a data deletion warning.' );
|
103 |
-
|
104 |
-
static::$settings['delete_data'] = array(
|
105 |
-
'section' => 'reset',
|
106 |
-
'title' => esc_html__( 'Remove Plugin Data on Deletion?' ),
|
107 |
-
'type' => 'checkbox',
|
108 |
-
'class' => 'warning',
|
109 |
-
'desc' => sprintf( $desc, static::NAME ),
|
110 |
-
'widget' => 0,
|
111 |
-
'show_code' => false,
|
112 |
-
);
|
113 |
-
|
114 |
-
static::$settings['reset_defaults'] = array(
|
115 |
-
'section' => 'reset',
|
116 |
-
'title' => esc_html__( 'Reset to Defaults?' ),
|
117 |
-
'type' => 'checkbox',
|
118 |
-
'class' => 'warning',
|
119 |
-
'desc' => esc_html__( 'Check this box to reset options to their defaults.' ),
|
120 |
-
'show_code' => false,
|
121 |
-
);
|
122 |
-
}
|
123 |
-
|
124 |
-
|
125 |
-
public static function get_defaults( $mode = null, $old_version = null ) {
|
126 |
-
if ( empty( static::$defaults ) ) {
|
127 |
-
static::settings();
|
128 |
-
}
|
129 |
-
|
130 |
-
$do_backwards = false;
|
131 |
-
if ( 'backwards' == $mode ) {
|
132 |
-
if ( ! empty( $old_version ) ) {
|
133 |
-
$do_backwards = true;
|
134 |
-
}
|
135 |
-
}
|
136 |
-
|
137 |
-
foreach ( static::$settings as $id => $parts ) {
|
138 |
-
$std = isset( $parts['std'] ) ? $parts['std'] : '';
|
139 |
-
if ( $do_backwards ) {
|
140 |
-
$version = ! empty( $parts['backwards']['version'] ) ? $parts['backwards']['version'] : false;
|
141 |
-
if ( ! empty( $version ) ) {
|
142 |
-
if ( $old_version < $version ) {
|
143 |
-
$std = $parts['backwards']['std'];
|
144 |
-
}
|
145 |
-
}
|
146 |
-
}
|
147 |
-
|
148 |
-
static::$defaults[ $id ] = $std;
|
149 |
-
}
|
150 |
-
|
151 |
-
return static::$defaults;
|
152 |
-
}
|
153 |
-
|
154 |
-
|
155 |
-
public static function get_settings() {
|
156 |
-
if ( empty( static::$settings ) ) {
|
157 |
-
static::settings();
|
158 |
-
}
|
159 |
-
|
160 |
-
return static::$settings;
|
161 |
-
}
|
162 |
-
|
163 |
-
|
164 |
-
public static function initialize_settings( $version = null ) {
|
165 |
-
$defaults = static::get_defaults( 'backwards' );
|
166 |
-
$current = get_option( static::ID );
|
167 |
-
$current = wp_parse_args( $current, $defaults );
|
168 |
-
|
169 |
-
$current['admin_notices'] = $version;
|
170 |
-
$current['version'] = static::$version;
|
171 |
-
|
172 |
-
update_option( static::ID, $current );
|
173 |
-
}
|
174 |
-
|
175 |
-
|
176 |
-
/**
|
177 |
-
*
|
178 |
-
*
|
179 |
-
* @SuppressWarnings(PHPMD.UnusedLocalVariable)
|
180 |
-
*/
|
181 |
-
public static function create_setting( $args = array() ) {
|
182 |
-
extract( $args );
|
183 |
-
|
184 |
-
if ( preg_match( '#(_expand_begin|_expand_end)#', $id ) ) {
|
185 |
-
return;
|
186 |
-
}
|
187 |
-
|
188 |
-
$field_args = array(
|
189 |
-
'choices' => $choices,
|
190 |
-
'class' => $class,
|
191 |
-
'desc' => $desc,
|
192 |
-
'id' => $id,
|
193 |
-
'label_for' => $id,
|
194 |
-
'show_code' => $show_code,
|
195 |
-
'std' => $std,
|
196 |
-
'suggest' => $suggest,
|
197 |
-
'type' => $type,
|
198 |
-
);
|
199 |
-
|
200 |
-
static::$defaults[ $id ] = $std;
|
201 |
-
|
202 |
-
add_settings_field( $id, $title, array( static::$class, 'display_setting' ), static::ID, $section, $field_args );
|
203 |
-
}
|
204 |
-
|
205 |
-
|
206 |
-
public static function section_scripts() {
|
207 |
-
echo '
|
208 |
-
<script type="text/javascript">
|
209 |
-
jQuery(document).ready(function($) {
|
210 |
-
$( "#' . static::ID . '" ).tabs();
|
211 |
-
// This will make the "warning" checkbox class really stand out when checked.
|
212 |
-
$(".warning").change(function() {
|
213 |
-
if ($(this).is(":checked"))
|
214 |
-
$(this).parent().css("background", "#c00").css("color", "#fff").css("fontWeight", "bold");
|
215 |
-
else
|
216 |
-
$(this).parent().css("background", "inherit").css("color", "inherit").css("fontWeight", "inherit");
|
217 |
-
});
|
218 |
-
});
|
219 |
-
</script>
|
220 |
-
';
|
221 |
-
}
|
222 |
-
|
223 |
-
|
224 |
-
public static function do_settings_sections( $page ) {
|
225 |
-
global $wp_settings_sections, $wp_settings_fields;
|
226 |
-
|
227 |
-
if ( ! isset( $wp_settings_sections ) || ! isset( $wp_settings_sections[ $page ] ) ) {
|
228 |
-
return;
|
229 |
-
}
|
230 |
-
|
231 |
-
foreach ( (array) $wp_settings_sections[ $page ] as $section ) {
|
232 |
-
if ( $section['callback'] ) {
|
233 |
-
call_user_func( $section['callback'], $section );
|
234 |
-
}
|
235 |
-
|
236 |
-
if ( ! isset( $wp_settings_fields ) || ! isset( $wp_settings_fields[ $page ] ) || ! isset( $wp_settings_fields[ $page ][ $section['id'] ] ) ) {
|
237 |
-
continue;
|
238 |
-
}
|
239 |
-
|
240 |
-
echo '<table id=' . $section['id'] . ' class="form-table">';
|
241 |
-
do_settings_fields( $page, $section['id'] );
|
242 |
-
echo '</table>';
|
243 |
-
}
|
244 |
-
}
|
245 |
-
|
246 |
-
|
247 |
-
public static function display_section() {}
|
248 |
-
|
249 |
-
|
250 |
-
public static function display_about() {
|
251 |
-
$text = __( '<img class="size-medium" src="%5$s" alt="Axelerant 2015 Retreat in Goa" width="640" height="327" /><p>Axelerant is a full-service software development company that focuses on open-source technologies. Top technical talent who are passionate, giving, and communicative demonstrates our backbone. We provide high-end Strategy, Implementation, and Support services for our clients and agencies with whom we partner.</p><p>Our team members span the world, and we follow agile delivery and working processes. Further, we’re actively giving back to many open-source communities and have fostered an innovative, incubator culture to give ideas a chance to succeed.</p><h2>Foundations of Axelerant</h2><ul><li><b>Passion</b> – Our passion is so strong, we’re selfdirected to make the difficult easy.</li><li><b>Openness</b> – We’re so honest and painstaking in our discussions that there are no questions left, and standards are created.</li><li><b>Giving</b> – We’re excited to share our results to inspire all to surpass them.</li></ul><h3>Learn More About Axelerant</h3><ul><li><a href="%1$s">Axelerant Team</a></li><li><a href="%2$s">Giving Back</a></li><li><a href="%7$s">Inside Axelerant</a></li><li><a href="%3$s">Our Services</a></li><li><a href="%4$s">Testimonials</a></li><li><a href="%6$s">Careers</a></li></ul>' );
|
252 |
-
|
253 |
-
echo '<div id="about" style="width: 70%; min-height: 225px;"><p>';
|
254 |
-
echo sprintf(
|
255 |
-
$text,
|
256 |
-
esc_url( 'https://axelerant.com/about-axelerant/' ),
|
257 |
-
esc_url( 'https://axelerant.com/drupalgive/' ),
|
258 |
-
esc_url( 'https://axelerant.com/services/' ),
|
259 |
-
esc_url( 'https://axelerant.com/about-axelerant/testimonials/' ),
|
260 |
-
esc_url( 'https://axelerant.com/wp-content/uploads/2015/02/IGP7228-2015-01-22-at-05-18-02.jpg' ),
|
261 |
-
esc_url( 'https://axelerant.com/careers/' ),
|
262 |
-
esc_url( 'https://axelerant.com/open-policies-open-discussion/' )
|
263 |
-
);
|
264 |
-
echo '</p></div>';
|
265 |
-
}
|
266 |
-
|
267 |
-
|
268 |
-
public static function display_page( $disable_donate = false ) {
|
269 |
-
echo '<div class="wrap">
|
270 |
-
<div class="icon32" id="icon-options-general"></div>
|
271 |
-
<h2>' . static::NAME . '</h2>';
|
272 |
-
|
273 |
-
echo '<form action="options.php" method="post">';
|
274 |
-
|
275 |
-
settings_errors( static::ID );
|
276 |
-
settings_fields( static::ID );
|
277 |
-
|
278 |
-
echo '<div id="' . static::ID . '">
|
279 |
-
<ul>';
|
280 |
-
|
281 |
-
foreach ( static::$sections as $section_slug => $section ) {
|
282 |
-
echo '<li><a href="#' . $section_slug . '">' . $section . '</a></li>';
|
283 |
-
}
|
284 |
-
|
285 |
-
echo '</ul>';
|
286 |
-
|
287 |
-
self::do_settings_sections( static::ID );
|
288 |
-
|
289 |
-
echo '
|
290 |
-
<p class="submit"><input name="Submit" type="submit" class="button-primary" value="' . esc_html__( 'Save Changes' ) . '" /></p>
|
291 |
-
</form>
|
292 |
-
</div>
|
293 |
-
';
|
294 |
-
|
295 |
-
if ( ! $disable_donate ) {
|
296 |
-
echo '<p>' .
|
297 |
-
sprintf(
|
298 |
-
__( 'If you like this plugin, please <a href="%1$s" title="Donate for Good Karma"><img src="%2$s" border="0" alt="Donate for Good Karma" /></a> or <a href="%3$s" title="purchase premium WordPress plugins from Axelerant ">purchase the Premium version</a> to help fund further development and <a href="%4$s" title="Support forums">support</a>.' ),
|
299 |
-
esc_url( 'https://axelerant.com/about-axelerant/donate/' ),
|
300 |
-
esc_url( 'https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif' ),
|
301 |
-
esc_url( 'https://store.axelerant.com/' ),
|
302 |
-
esc_url( 'https://nodedesk.zendesk.com' )
|
303 |
-
) .
|
304 |
-
'</p>';
|
305 |
-
}
|
306 |
-
|
307 |
-
echo '<p class="copyright">' .
|
308 |
-
sprintf(
|
309 |
-
__( 'Copyright ©%1$s <a href="%2$s">Axlerant</a>.' ),
|
310 |
-
date( 'Y' ),
|
311 |
-
esc_url( 'https://axelerant.com' )
|
312 |
-
) .
|
313 |
-
'</p>';
|
314 |
-
|
315 |
-
echo '</div>';
|
316 |
-
|
317 |
-
add_action( 'admin_footer', array( static::$class, 'section_scripts' ) );
|
318 |
-
}
|
319 |
-
|
320 |
-
|
321 |
-
/**
|
322 |
-
*
|
323 |
-
*
|
324 |
-
* @SuppressWarnings(PHPMD.UnusedLocalVariable)
|
325 |
-
*/
|
326 |
-
public static function display_setting( $args = array(), $do_echo = true, $input = null ) {
|
327 |
-
$content = '';
|
328 |
-
|
329 |
-
extract( $args );
|
330 |
-
|
331 |
-
$maxlength = ! empty( $maxlength ) ? 'maxlength="' . $maxlength . '"' : null;
|
332 |
-
$placeholder = ! empty( $placeholder ) ? $placeholder : $std;
|
333 |
-
|
334 |
-
if ( is_null( $input ) ) {
|
335 |
-
$options = get_option( static::ID );
|
336 |
-
} else {
|
337 |
-
$options = array();
|
338 |
-
$options[ $id ] = $input;
|
339 |
-
}
|
340 |
-
|
341 |
-
if ( ! isset( $options[ $id ] ) && 'checkbox' != $type ) {
|
342 |
-
$options[ $id ] = $std;
|
343 |
-
} elseif ( ! isset( $options[ $id ] ) ) {
|
344 |
-
$options[ $id ] = 0;
|
345 |
-
}
|
346 |
-
|
347 |
-
$field_class = '';
|
348 |
-
if ( ! empty( $class ) ) {
|
349 |
-
$field_class = ' ' . $class;
|
350 |
-
}
|
351 |
-
|
352 |
-
// desc isn't escaped because it's might contain allowed html
|
353 |
-
$choices = array_map( 'esc_attr', $choices );
|
354 |
-
$field_class = esc_attr( $field_class );
|
355 |
-
$id = esc_attr( $id );
|
356 |
-
$field_value = esc_attr( $options[ $id ] );
|
357 |
-
$std = esc_attr( $std );
|
358 |
-
|
359 |
-
switch ( $type ) {
|
360 |
-
case 'checkbox':
|
361 |
-
$content .= '<input class="checkbox' . $field_class . '" type="checkbox" id="' . $id . '" name="' . static::ID . '[' . $id . ']" value="1" ' . checked( $field_value, 1, false ) . ' /> ';
|
362 |
-
|
363 |
-
if ( ! empty( $desc ) ) {
|
364 |
-
$content .= '<label for="' . $id . '"><span class="description">' . $desc . '</span></label>';
|
365 |
-
}
|
366 |
-
break;
|
367 |
-
|
368 |
-
case 'file':
|
369 |
-
$content .= '<input class="regular-text' . $field_class . '" type="file" id="' . $id . '" name="' . static::ID . '[' . $id . ']" />';
|
370 |
-
|
371 |
-
if ( ! empty( $desc ) ) {
|
372 |
-
$content .= '<br /><span class="description">' . $desc . '</span>';
|
373 |
-
}
|
374 |
-
|
375 |
-
break;
|
376 |
-
|
377 |
-
case 'heading':
|
378 |
-
$content .= '</td></tr><tr valign="top"><td colspan="2"><h3>' . $desc . '</h3>';
|
379 |
-
break;
|
380 |
-
|
381 |
-
case 'hidden':
|
382 |
-
$content .= '<input type="hidden" id="' . $id . '" name="' . static::ID . '[' . $id . ']" value="' . $field_value . '" />';
|
383 |
-
|
384 |
-
break;
|
385 |
-
|
386 |
-
case 'password':
|
387 |
-
$content .= '<input class="regular-text' . $field_class . '" type="password" id="' . $id . '" name="' . static::ID . '[' . $id . ']" value="' . $field_value . '" />';
|
388 |
-
|
389 |
-
if ( ! empty( $desc ) ) {
|
390 |
-
$content .= '<br /><span class="description">' . $desc . '</span>';
|
391 |
-
}
|
392 |
-
|
393 |
-
break;
|
394 |
-
|
395 |
-
case 'radio':
|
396 |
-
$i = 1;
|
397 |
-
$count_choices = count( $choices );
|
398 |
-
foreach ( $choices as $value => $label ) {
|
399 |
-
$content .= '<input class="radio' . $field_class . '" type="radio" name="' . static::ID . '[' . $id . ']" id="' . $id . $i . '" value="' . $value . '" ' . checked( $field_value, $value, false ) . '> <label for="' . $id . $i . '">' . $label . '</label>';
|
400 |
-
|
401 |
-
if ( $i < $count_choices ) {
|
402 |
-
$content .= '<br />';
|
403 |
-
}
|
404 |
-
|
405 |
-
$i++;
|
406 |
-
}
|
407 |
-
|
408 |
-
if ( ! empty( $desc ) ) {
|
409 |
-
$content .= '<br /><span class="description">' . $desc . '</span>';
|
410 |
-
}
|
411 |
-
break;
|
412 |
-
|
413 |
-
case 'readonly':
|
414 |
-
$content .= '<input class="regular-text' . $field_class . '" type="text" id="' . $id . '" name="' . static::ID . '[' . $id . ']" value="' . $field_value . '" readonly="readonly" />';
|
415 |
-
|
416 |
-
if ( ! empty( $desc ) ) {
|
417 |
-
$content .= '<br /><span class="description">' . $desc . '</span>';
|
418 |
-
}
|
419 |
-
break;
|
420 |
-
|
421 |
-
case 'rich_editor':
|
422 |
-
$field_value = $options[ $id ];
|
423 |
-
|
424 |
-
ob_start();
|
425 |
-
wp_editor( $field_value, static::ID . '[' . $id . ']', array( 'textarea_name' => static::ID . '[' . $id . ']' ) );
|
426 |
-
$content = ob_get_clean();
|
427 |
-
|
428 |
-
if ( ! empty( $desc ) ) {
|
429 |
-
$content .= '<br /><span class="description">' . $desc . '</span>';
|
430 |
-
}
|
431 |
-
break;
|
432 |
-
|
433 |
-
case 'select':
|
434 |
-
$content .= '<select class="select' . $field_class . '" id="' . $id . '" name="' . static::ID . '[' . $id . ']">';
|
435 |
-
|
436 |
-
foreach ( $choices as $value => $label ) {
|
437 |
-
$content .= '<option value="' . $value . '"' . selected( $field_value, $value, false ) . '>' . $label . '</option>';
|
438 |
-
}
|
439 |
-
|
440 |
-
$content .= '</select>';
|
441 |
-
|
442 |
-
if ( ! empty( $desc ) ) {
|
443 |
-
$content .= '<br /><span class="description">' . $desc . '</span>';
|
444 |
-
}
|
445 |
-
break;
|
446 |
-
|
447 |
-
case 'text':
|
448 |
-
$suggest_id = 'suggest_' . self::$suggest_id++;
|
449 |
-
$content .= '<input class="regular-text' . $field_class . ' ' . $suggest_id . '" type="text" id="' . $id . '" name="' . static::ID . '[' . $id . ']" placeholder="' . $placeholder . '" value="' . $field_value . '" ' . $maxlength . ' />';
|
450 |
-
|
451 |
-
if ( ! empty( $suggest ) ) {
|
452 |
-
$content .= static::get_suggest( $id, $suggest_id );
|
453 |
-
}
|
454 |
-
|
455 |
-
if ( ! empty( $desc ) ) {
|
456 |
-
$content .= '<br /><span class="description">' . $desc . '</span>';
|
457 |
-
}
|
458 |
-
break;
|
459 |
-
|
460 |
-
case 'textarea':
|
461 |
-
$content .= '<textarea class="' . $field_class . '" id="' . $id . '" name="' . static::ID . '[' . $id . ']" placeholder="' . $placeholder . '" ' . $maxlength . ' rows="5" cols="30">' . $field_value . '</textarea>';
|
462 |
-
|
463 |
-
if ( ! empty( $desc ) ) {
|
464 |
-
$content .= '<br /><span class="description">' . $desc . '</span>';
|
465 |
-
}
|
466 |
-
break;
|
467 |
-
|
468 |
-
case 'content':
|
469 |
-
$content .= $desc . '</td></tr>';
|
470 |
-
break;
|
471 |
-
|
472 |
-
default:
|
473 |
-
break;
|
474 |
-
}
|
475 |
-
|
476 |
-
if ( ! $do_echo ) {
|
477 |
-
return $content;
|
478 |
-
}
|
479 |
-
|
480 |
-
echo $content;
|
481 |
-
}
|
482 |
-
|
483 |
-
|
484 |
-
public static function register_settings() {
|
485 |
-
register_setting( static::ID, static::ID, array( static::$class, 'validate_settings' ) );
|
486 |
-
|
487 |
-
foreach ( static::$sections as $slug => $title ) {
|
488 |
-
if ( 'about' == $slug ) {
|
489 |
-
add_settings_section( $slug, $title, array( static::$class, 'display_about' ), static::ID );
|
490 |
-
} else {
|
491 |
-
add_settings_section( $slug, $title, array( static::$class, 'display_section' ), static::ID );
|
492 |
-
}
|
493 |
-
}
|
494 |
-
|
495 |
-
foreach ( static::$settings as $id => $setting ) {
|
496 |
-
$setting['id'] = $id;
|
497 |
-
static::create_setting( $setting );
|
498 |
-
}
|
499 |
-
}
|
500 |
-
|
501 |
-
|
502 |
-
public static function scripts() {
|
503 |
-
wp_enqueue_script( 'jquery-ui-tabs' );
|
504 |
-
}
|
505 |
-
|
506 |
-
|
507 |
-
public static function styles() {
|
508 |
-
wp_register_style( 'jquery-style', '//ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/themes/smoothness/jquery-ui.css' );
|
509 |
-
wp_enqueue_style( 'jquery-style' );
|
510 |
-
}
|
511 |
-
|
512 |
-
|
513 |
-
/**
|
514 |
-
*
|
515 |
-
*
|
516 |
-
* @SuppressWarnings(PHPMD.Superglobals)
|
517 |
-
*/
|
518 |
-
public static function validate_settings( $input, $options = null, $do_errors = false ) {
|
519 |
-
$null_options = false;
|
520 |
-
if ( is_null( $options ) ) {
|
521 |
-
$null_options = true;
|
522 |
-
|
523 |
-
$defaults = static::get_defaults();
|
524 |
-
$options = self::get_settings();
|
525 |
-
|
526 |
-
if ( is_admin() ) {
|
527 |
-
if ( ! empty( $input['reset_defaults'] ) ) {
|
528 |
-
foreach ( $defaults as $id => $std ) {
|
529 |
-
$input[ $id ] = $std;
|
530 |
-
}
|
531 |
-
|
532 |
-
unset( $input['reset_defaults'] );
|
533 |
-
|
534 |
-
$input['resetted'] = true;
|
535 |
-
}
|
536 |
-
|
537 |
-
if ( ! empty( $input['import'] ) && $_SESSION['export'] != $input['import'] ) {
|
538 |
-
$import = $input['import'];
|
539 |
-
$unserialized = unserialize( $import );
|
540 |
-
if ( is_array( $unserialized ) ) {
|
541 |
-
foreach ( $unserialized as $id => $std ) {
|
542 |
-
$input[ $id ] = $std;
|
543 |
-
}
|
544 |
-
}
|
545 |
-
}
|
546 |
-
}
|
547 |
-
}
|
548 |
-
|
549 |
-
return self::do_validate_settings( $input, $options, $do_errors, $null_options );
|
550 |
-
}
|
551 |
-
|
552 |
-
|
553 |
-
/**
|
554 |
-
*
|
555 |
-
*
|
556 |
-
* @SuppressWarnings(PHPMD.Superglobals)
|
557 |
-
*/
|
558 |
-
public static function do_validate_settings( $input, $options = null, $do_errors = false, $null_options = true ) {
|
559 |
-
$errors = array();
|
560 |
-
|
561 |
-
foreach ( $options as $id => $parts ) {
|
562 |
-
$default = isset( $parts['std'] ) ? $parts['std'] : '';
|
563 |
-
$type = isset( $parts['type'] ) ? $parts['type'] : '';
|
564 |
-
$validations = ! empty( $parts['validate'] ) ? $parts['validate'] : array();
|
565 |
-
if ( ! empty( $validations ) ) {
|
566 |
-
$validations = explode( ',', $validations );
|
567 |
-
}
|
568 |
-
|
569 |
-
if ( ! isset( $input[ $id ] ) ) {
|
570 |
-
if ( 'checkbox' != $type ) {
|
571 |
-
$input[ $id ] = $default;
|
572 |
-
} else {
|
573 |
-
$input[ $id ] = 0;
|
574 |
-
}
|
575 |
-
}
|
576 |
-
|
577 |
-
if ( $default == $input[ $id ] && ! in_array( 'required', $validations ) ) {
|
578 |
-
continue;
|
579 |
-
}
|
580 |
-
|
581 |
-
if ( 'checkbox' == $type ) {
|
582 |
-
if ( self::is_true( $input[ $id ] ) ) {
|
583 |
-
$input[ $id ] = 1;
|
584 |
-
} else {
|
585 |
-
$input[ $id ] = 0;
|
586 |
-
}
|
587 |
-
} elseif ( in_array( $type, array( 'radio', 'select' ) ) ) {
|
588 |
-
// single choices only
|
589 |
-
$keys = array_keys( $parts['choices'] );
|
590 |
-
|
591 |
-
if ( ! in_array( $input[ $id ], $keys ) ) {
|
592 |
-
if ( self::is_true( $input[ $id ] ) ) {
|
593 |
-
$input[ $id ] = 1;
|
594 |
-
} else {
|
595 |
-
$input[ $id ] = 0;
|
596 |
-
}
|
597 |
-
}
|
598 |
-
}
|
599 |
-
|
600 |
-
if ( ! empty( $validations ) ) {
|
601 |
-
foreach ( $validations as $validate ) {
|
602 |
-
self::validators( $validate, $id, $input, $default, $errors );
|
603 |
-
}
|
604 |
-
}
|
605 |
-
}
|
606 |
-
|
607 |
-
unset( $input['export'] );
|
608 |
-
unset( $input['import'] );
|
609 |
-
|
610 |
-
$hide_update_notice = false;
|
611 |
-
if ( isset( static::$hide_update_notice ) && ! empty( static::$hide_update_notice ) ) {
|
612 |
-
$hide_update_notice = true;
|
613 |
-
}
|
614 |
-
|
615 |
-
if ( $null_options && empty( $errors ) && ! $hide_update_notice && ! empty( $_REQUEST['option_page'] ) ) {
|
616 |
-
add_settings_error( static::ID, 'settings_updated', esc_html__( 'Settings saved.' ), 'updated' );
|
617 |
-
|
618 |
-
if ( empty( self::$settings_saved ) ) {
|
619 |
-
self::$settings_saved = true;
|
620 |
-
set_transient( 'settings_errors', get_settings_errors(), 30 );
|
621 |
-
}
|
622 |
-
}
|
623 |
-
|
624 |
-
if ( empty( $do_errors ) ) {
|
625 |
-
$validated = $input;
|
626 |
-
} else {
|
627 |
-
$validated = array(
|
628 |
-
'input' => $input,
|
629 |
-
'errors' => $errors,
|
630 |
-
);
|
631 |
-
}
|
632 |
-
|
633 |
-
return $validated;
|
634 |
-
}
|
635 |
-
|
636 |
-
|
637 |
-
public static function validators( $validate, $id, &$input, $default, &$errors ) {
|
638 |
-
switch ( $validate ) {
|
639 |
-
case 'absint':
|
640 |
-
case 'intval':
|
641 |
-
if ( '' !== $input[ $id ] ) {
|
642 |
-
$input[ $id ] = $validate( $input[ $id ] );
|
643 |
-
} else {
|
644 |
-
$input[ $id ] = $default;
|
645 |
-
}
|
646 |
-
break;
|
647 |
-
|
648 |
-
case 'email':
|
649 |
-
$input[ $id ] = self::validate_email( $input[ $id ], $default );
|
650 |
-
break;
|
651 |
-
|
652 |
-
case 'ids':
|
653 |
-
$input[ $id ] = self::validate_ids( $input[ $id ], $default );
|
654 |
-
break;
|
655 |
-
|
656 |
-
case 'is_true':
|
657 |
-
$input[ $id ] = self::is_true( $input[ $id ] );
|
658 |
-
break;
|
659 |
-
|
660 |
-
case 'min1':
|
661 |
-
$input[ $id ] = intval( $input[ $id ] );
|
662 |
-
if ( 0 >= $input[ $id ] ) {
|
663 |
-
$input[ $id ] = $default;
|
664 |
-
}
|
665 |
-
break;
|
666 |
-
|
667 |
-
case 'nozero':
|
668 |
-
$input[ $id ] = intval( $input[ $id ] );
|
669 |
-
if ( 0 === $input[ $id ] ) {
|
670 |
-
$input[ $id ] = $default;
|
671 |
-
}
|
672 |
-
break;
|
673 |
-
|
674 |
-
case 'order':
|
675 |
-
$input[ $id ] = self::validate_order( $input[ $id ], $default );
|
676 |
-
break;
|
677 |
-
|
678 |
-
case 'required':
|
679 |
-
if ( empty( $input[ $id ] ) ) {
|
680 |
-
$errors[ $id ] = esc_html__( 'Required' );
|
681 |
-
}
|
682 |
-
break;
|
683 |
-
|
684 |
-
case 'slash_sanitize_title':
|
685 |
-
$temp = explode( '/', $input[ $id ] );
|
686 |
-
$temp = array_map( 'sanitize_title', $temp );
|
687 |
-
$temp = implode( '/', $temp );
|
688 |
-
|
689 |
-
$input[ $id ] = $temp;
|
690 |
-
break;
|
691 |
-
|
692 |
-
case 'slug':
|
693 |
-
$input[ $id ] = self::validate_slug( $input[ $id ], $default );
|
694 |
-
$input[ $id ] = strtolower( $input[ $id ] );
|
695 |
-
break;
|
696 |
-
|
697 |
-
case 'slugs':
|
698 |
-
$input[ $id ] = self::validate_slugs( $input[ $id ], $default );
|
699 |
-
$input[ $id ] = strtolower( $input[ $id ] );
|
700 |
-
break;
|
701 |
-
|
702 |
-
case 'term':
|
703 |
-
$input[ $id ] = self::validate_term( $input[ $id ], $default );
|
704 |
-
$input[ $id ] = strtolower( $input[ $id ] );
|
705 |
-
break;
|
706 |
-
|
707 |
-
case 'terms':
|
708 |
-
$input[ $id ] = self::validate_terms( $input[ $id ], $default );
|
709 |
-
break;
|
710 |
-
|
711 |
-
case 'trim':
|
712 |
-
$options = explode( "\n", $input[ $id ] );
|
713 |
-
foreach ( $options as $key => $value ) {
|
714 |
-
$options[ $key ] = trim( $value );
|
715 |
-
}
|
716 |
-
|
717 |
-
$input[ $id ] = implode( "\n", $options );
|
718 |
-
break;
|
719 |
-
|
720 |
-
case 'url':
|
721 |
-
$input[ $id ] = self::validate_url( $input[ $id ], $default );
|
722 |
-
break;
|
723 |
-
|
724 |
-
default:
|
725 |
-
$input[ $id ] = $validate( $input[ $id ] );
|
726 |
-
break;
|
727 |
-
}
|
728 |
-
}
|
729 |
-
|
730 |
-
|
731 |
-
public static function validate_ids( $input, $default = false ) {
|
732 |
-
if ( preg_match( '#^\d+(,\s?\d+)*$#', $input ) ) {
|
733 |
-
return preg_replace( '#\s#', '', $input );
|
734 |
-
}
|
735 |
-
|
736 |
-
return $default;
|
737 |
-
}
|
738 |
-
|
739 |
-
|
740 |
-
public static function validate_order( $input, $default = false ) {
|
741 |
-
if ( preg_match( '#^desc|asc$#i', $input ) ) {
|
742 |
-
return $input;
|
743 |
-
}
|
744 |
-
|
745 |
-
return $default;
|
746 |
-
}
|
747 |
-
|
748 |
-
|
749 |
-
public static function validate_slugs( $input, $default = false ) {
|
750 |
-
if ( preg_match( '#^[\w-]+(,\s?[\w-]+)*$#', $input ) ) {
|
751 |
-
return preg_replace( '#\s#', '', $input );
|
752 |
-
}
|
753 |
-
|
754 |
-
return $default;
|
755 |
-
}
|
756 |
-
|
757 |
-
|
758 |
-
public static function validate_slug( $input, $default = false ) {
|
759 |
-
if ( preg_match( '#^[\w-]+$#', $input ) ) {
|
760 |
-
return $input;
|
761 |
-
}
|
762 |
-
|
763 |
-
return $default;
|
764 |
-
}
|
765 |
-
|
766 |
-
|
767 |
-
public static function validate_term( $input, $default = false ) {
|
768 |
-
if ( preg_match( '#^\w+$#', $input ) ) {
|
769 |
-
return $input;
|
770 |
-
}
|
771 |
-
|
772 |
-
return $default;
|
773 |
-
}
|
774 |
-
|
775 |
-
|
776 |
-
/**
|
777 |
-
* Let values like true, 'true', 1, 'on', and 'yes' to be true. Else, false
|
778 |
-
*/
|
779 |
-
public static function is_true( $value = null, $return_boolean = true ) {
|
780 |
-
if ( true === $value || 'true' == strtolower( $value ) || 1 == $value || 'on' == strtolower( $value ) || 'yes' == strtolower( $value ) ) {
|
781 |
-
if ( $return_boolean ) {
|
782 |
-
return true;
|
783 |
-
} else {
|
784 |
-
return 1;
|
785 |
-
}
|
786 |
-
} else {
|
787 |
-
if ( $return_boolean ) {
|
788 |
-
return false;
|
789 |
-
} else {
|
790 |
-
return 0;
|
791 |
-
}
|
792 |
-
}
|
793 |
-
}
|
794 |
-
|
795 |
-
|
796 |
-
public static function validate_email( $input, $default = false ) {
|
797 |
-
if ( filter_var( $input, FILTER_VALIDATE_EMAIL ) ) {
|
798 |
-
return $input;
|
799 |
-
}
|
800 |
-
|
801 |
-
return $default;
|
802 |
-
}
|
803 |
-
|
804 |
-
|
805 |
-
public static function validate_terms( $input, $default = false ) {
|
806 |
-
if ( preg_match( '#^(([\w- ]+)(,\s?)?)+$#', $input ) ) {
|
807 |
-
return preg_replace( '#,\s*$#', '', $input );
|
808 |
-
}
|
809 |
-
|
810 |
-
return $default;
|
811 |
-
}
|
812 |
-
|
813 |
-
|
814 |
-
public static function validate_url( $input, $default = false ) {
|
815 |
-
if ( filter_var( $input, FILTER_VALIDATE_URL ) ) {
|
816 |
-
return $input;
|
817 |
-
}
|
818 |
-
|
819 |
-
return $default;
|
820 |
-
}
|
821 |
-
|
822 |
-
|
823 |
-
public static function get_scripts() {
|
824 |
-
foreach ( static::$scripts as $script ) {
|
825 |
-
echo $script;
|
826 |
-
}
|
827 |
-
}
|
828 |
-
|
829 |
-
|
830 |
-
public static function get_styles() {
|
831 |
-
foreach ( static::$styles as $style ) {
|
832 |
-
echo $style;
|
833 |
-
}
|
834 |
-
}
|
835 |
-
|
836 |
-
|
837 |
-
/**
|
838 |
-
* Let values like false, 'false', 0, 'off', and 'no' to be true. Else, false
|
839 |
-
*/
|
840 |
-
public static function is_false( $value = null, $return_boolean = false ) {
|
841 |
-
if ( false === $value || 'false' == strtolower( $value ) || 0 == $value || 'off' == strtolower( $value ) || 'no' == strtolower( $value ) ) {
|
842 |
-
if ( $return_boolean ) {
|
843 |
-
return true;
|
844 |
-
} else {
|
845 |
-
return 1;
|
846 |
-
}
|
847 |
-
} else {
|
848 |
-
if ( $return_boolean ) {
|
849 |
-
return false;
|
850 |
-
} else {
|
851 |
-
return 0;
|
852 |
-
}
|
853 |
-
}
|
854 |
-
}
|
855 |
-
|
856 |
-
|
857 |
-
public static function get_suggest( $id, $suggest_id ) {
|
858 |
-
wp_enqueue_script( 'suggest' );
|
859 |
-
|
860 |
-
switch ( $id ) {
|
861 |
-
case 'category':
|
862 |
-
$taxonomy = 'category';
|
863 |
-
break;
|
864 |
-
|
865 |
-
case 'tags':
|
866 |
-
$taxonomy = 'post_tag';
|
867 |
-
break;
|
868 |
-
}
|
869 |
-
|
870 |
-
$ajax_url = site_url() . '/wp-admin/admin-ajax.php';
|
871 |
-
$suggest_js = "suggest( '{$ajax_url}?action=ajax-tag-search&tax={$taxonomy}', { delay: 500, minchars: 2, multiple: true, multipleSep: ', ' } )";
|
872 |
-
|
873 |
-
$scripts = <<<EOD
|
874 |
-
<script type="text/javascript">
|
875 |
-
jQuery(document).ready( function() {
|
876 |
-
jQuery( '.{$suggest_id}' ).{$suggest_js};
|
877 |
-
});
|
878 |
-
</script>
|
879 |
-
EOD;
|
880 |
-
|
881 |
-
return $scripts;
|
882 |
-
}
|
883 |
-
|
884 |
-
|
885 |
-
public static function get_sections() {
|
886 |
-
if ( empty( static::$sections ) ) {
|
887 |
-
static::sections();
|
888 |
-
}
|
889 |
-
|
890 |
-
return static::$sections;
|
891 |
-
}
|
892 |
-
}
|
893 |
-
|
894 |
-
|
895 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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framework/includes/class-aihrus-widget.php
DELETED
@@ -1,365 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Aihrus Framework
|
4 |
-
* Copyright (C) 2015 Axelerant
|
5 |
-
* This program is free software; you can redistribute it and/or modify
|
6 |
-
* it under the terms of the GNU General Public License as published by
|
7 |
-
* the Free Software Foundation; either version 2 of the License, or
|
8 |
-
* (at your option) any later version.
|
9 |
-
* This program is distributed in the hope that it will be useful,
|
10 |
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11 |
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12 |
-
* GNU General Public License for more details.
|
13 |
-
* You should have received a copy of the GNU General Public License along
|
14 |
-
* with this program; if not, write to the Free Software Foundation, Inc.,
|
15 |
-
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
16 |
-
*/
|
17 |
-
|
18 |
-
|
19 |
-
if ( class_exists( 'Aihrus_Widget' ) ) {
|
20 |
-
return;
|
21 |
-
}
|
22 |
-
|
23 |
-
|
24 |
-
abstract class Aihrus_Widget extends WP_Widget {
|
25 |
-
public static $default = array(
|
26 |
-
'choices' => array(), // key => value
|
27 |
-
'class' => null, // warning, etc.
|
28 |
-
'desc' => null,
|
29 |
-
'id' => null,
|
30 |
-
'std' => null, // default key or value
|
31 |
-
'suggest' => false, // attempt for auto-suggest on inputs
|
32 |
-
'title' => null,
|
33 |
-
'type' => 'text', // textarea, checkbox, radio, select, hidden, heading, password, expand_begin, expand_end
|
34 |
-
'validate' => null, // required, term, slug, slugs, ids, order, single paramater PHP functions
|
35 |
-
'widget' => 1,
|
36 |
-
);
|
37 |
-
|
38 |
-
public static $settings_saved = false;
|
39 |
-
public static $suggest_id = 0;
|
40 |
-
|
41 |
-
|
42 |
-
public function __construct( $classname, $description, $id_base, $title ) {
|
43 |
-
// Widget settings
|
44 |
-
$widget_ops = array(
|
45 |
-
'classname' => $classname,
|
46 |
-
'description' => $description,
|
47 |
-
);
|
48 |
-
|
49 |
-
// Widget control settings
|
50 |
-
$control_ops = array(
|
51 |
-
'id_base' => $id_base,
|
52 |
-
);
|
53 |
-
|
54 |
-
// Create the widget
|
55 |
-
parent::__construct(
|
56 |
-
static::ID,
|
57 |
-
$title,
|
58 |
-
$widget_ops,
|
59 |
-
$control_ops
|
60 |
-
);
|
61 |
-
}
|
62 |
-
|
63 |
-
|
64 |
-
public function widget( $args, $instance ) {
|
65 |
-
$args = wp_parse_args( $args, static::get_defaults() );
|
66 |
-
extract( $args );
|
67 |
-
|
68 |
-
// Before widget (defined by themes)
|
69 |
-
echo $args['before_widget'];
|
70 |
-
|
71 |
-
$title = apply_filters( 'widget_title', $instance['title'], null );
|
72 |
-
if ( ! empty( $instance['title_link'] ) ) {
|
73 |
-
$target = ! empty( $instance['target'] ) ? $instance['target'] : null;
|
74 |
-
$title = Aihrus_Common::create_link( $instance['title_link'], $title, $target );
|
75 |
-
}
|
76 |
-
|
77 |
-
if ( ! empty( $title ) ) {
|
78 |
-
echo $args['before_title'] . $title . $args['after_title'];
|
79 |
-
}
|
80 |
-
|
81 |
-
$content = static::get_content( $instance, $this->number );
|
82 |
-
echo $content;
|
83 |
-
|
84 |
-
// After widget (defined by themes)
|
85 |
-
echo $args['after_widget'];
|
86 |
-
}
|
87 |
-
|
88 |
-
|
89 |
-
/**
|
90 |
-
*
|
91 |
-
*
|
92 |
-
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
93 |
-
*/
|
94 |
-
public function update( $new_instance, $old_instance ) {
|
95 |
-
$instance = static::validate_settings( $new_instance );
|
96 |
-
|
97 |
-
return $instance;
|
98 |
-
}
|
99 |
-
|
100 |
-
|
101 |
-
public static function validate_settings( $input, $options = null, $do_errors = false ) {
|
102 |
-
$null_options = false;
|
103 |
-
if ( is_null( $options ) ) {
|
104 |
-
$null_options = true;
|
105 |
-
|
106 |
-
$defaults = static::get_defaults();
|
107 |
-
$options = static::form_parts();
|
108 |
-
|
109 |
-
if ( is_admin() ) {
|
110 |
-
if ( ! empty( $input['reset_defaults'] ) ) {
|
111 |
-
foreach ( $defaults as $id => $std ) {
|
112 |
-
$input[ $id ] = $std;
|
113 |
-
}
|
114 |
-
|
115 |
-
unset( $input['reset_defaults'] );
|
116 |
-
|
117 |
-
$input['resetted'] = true;
|
118 |
-
}
|
119 |
-
}
|
120 |
-
}
|
121 |
-
|
122 |
-
return Aihrus_Settings::do_validate_settings( $input, $options, $do_errors );
|
123 |
-
}
|
124 |
-
|
125 |
-
|
126 |
-
public function form( $instance ) {
|
127 |
-
$instance = static::form_instance( $instance );
|
128 |
-
$defaults = static::get_defaults();
|
129 |
-
$instance = wp_parse_args( $instance, $defaults );
|
130 |
-
|
131 |
-
$form_parts = static::form_parts( $instance, $this->number );
|
132 |
-
foreach ( $form_parts as $key => $part ) {
|
133 |
-
$part['id'] = $key;
|
134 |
-
$this->display_setting( $part, $instance );
|
135 |
-
}
|
136 |
-
}
|
137 |
-
|
138 |
-
|
139 |
-
/**
|
140 |
-
*
|
141 |
-
*
|
142 |
-
* @SuppressWarnings(PHPMD.UnusedLocalVariable)
|
143 |
-
*/
|
144 |
-
public function display_setting( $args = array(), $options ) {
|
145 |
-
extract( $args );
|
146 |
-
|
147 |
-
if ( empty( $widget ) ) {
|
148 |
-
echo '<div style="display:none;">';
|
149 |
-
}
|
150 |
-
|
151 |
-
$do_return = false;
|
152 |
-
switch ( $type ) {
|
153 |
-
case 'heading':
|
154 |
-
if ( ! empty( $desc ) ) {
|
155 |
-
echo '<h3>' . $desc . '</h3>';
|
156 |
-
}
|
157 |
-
|
158 |
-
$do_return = true;
|
159 |
-
break;
|
160 |
-
|
161 |
-
case 'expand_all':
|
162 |
-
if ( ! empty( $desc ) ) {
|
163 |
-
echo '<h3>' . $desc . '</h3>';
|
164 |
-
}
|
165 |
-
|
166 |
-
echo '<a id="' . $this->get_field_id( $id ) . '-expand" style="cursor:pointer;" onclick="jQuery( \'.af-collapsible-control\' ).slideToggle(); jQuery( \'.af-collapsible\' ).slideToggle(); jQuery( this ).hide(); jQuery( \'#' . $this->get_field_id( $id ) . '-collapse\' ).show();">» ' . esc_html__( 'Expand All Options' ) . '</a>';
|
167 |
-
echo '<a id="' . $this->get_field_id( $id ) . '-collapse" style="cursor:pointer; display: none;" onclick="jQuery( \'.af-collapsible-control\' ).slideToggle(); jQuery( \'.af-collapsible\' ).slideToggle(); jQuery( this ).hide(); jQuery( \'#' . $this->get_field_id( $id ) . '-expand\' ).show();">« ' . esc_html__( 'Collapse All Options' ) . '</a>';
|
168 |
-
|
169 |
-
$do_return = true;
|
170 |
-
break;
|
171 |
-
|
172 |
-
case 'expand_begin':
|
173 |
-
if ( ! empty( $desc ) ) {
|
174 |
-
echo '<h3>' . $desc . '</h3>';
|
175 |
-
}
|
176 |
-
|
177 |
-
echo '<span class="af-collapsible-control">';
|
178 |
-
echo '<a id="' . $this->get_field_id( $id ) . '-expand" style="cursor:pointer;" onclick="jQuery( \'div#' . $this->get_field_id( $id ) . '\' ).slideToggle(); jQuery( this ).hide(); jQuery( \'#' . $this->get_field_id( $id ) . '-collapse\' ).show();">» ' . esc_html__( 'Expand' ) . '</a>';
|
179 |
-
echo '<a id="' . $this->get_field_id( $id ) . '-collapse" style="cursor:pointer; display: none;" onclick="jQuery( \'div#' . $this->get_field_id( $id ) . '\' ).slideToggle(); jQuery( this ).hide(); jQuery( \'#' . $this->get_field_id( $id ) . '-expand\' ).show();">« ' . esc_html__( 'Collapse' ) . '</a>';
|
180 |
-
echo '</span>';
|
181 |
-
echo '<div id="' . $this->get_field_id( $id ) . '" style="display:none" class="af-collapsible">';
|
182 |
-
|
183 |
-
$do_return = true;
|
184 |
-
break;
|
185 |
-
|
186 |
-
case 'expand_end':
|
187 |
-
echo '</div>';
|
188 |
-
|
189 |
-
$do_return = true;
|
190 |
-
break;
|
191 |
-
|
192 |
-
default:
|
193 |
-
break;
|
194 |
-
}
|
195 |
-
|
196 |
-
if ( $do_return ) {
|
197 |
-
if ( empty( $widget ) ) {
|
198 |
-
echo '</div>';
|
199 |
-
}
|
200 |
-
|
201 |
-
return;
|
202 |
-
}
|
203 |
-
|
204 |
-
if ( ! isset( $options[ $id ] ) && 'checkbox' != $type ) {
|
205 |
-
$options[ $id ] = $std;
|
206 |
-
} elseif ( ! isset( $options[ $id ] ) ) {
|
207 |
-
$options[ $id ] = 0;
|
208 |
-
}
|
209 |
-
|
210 |
-
$field_class = '';
|
211 |
-
if ( ! empty( $class ) ) {
|
212 |
-
$field_class = ' ' . $class;
|
213 |
-
}
|
214 |
-
|
215 |
-
echo '<p>';
|
216 |
-
|
217 |
-
switch ( $type ) {
|
218 |
-
case 'checkbox':
|
219 |
-
echo '<input class="checkbox' . $field_class . '" type="checkbox" id="' . $this->get_field_id( $id ) . '" name="' . $this->get_field_name( $id ) . '" value="1" ' . checked( $options[ $id ], 1, false ) . ' /> ';
|
220 |
-
|
221 |
-
echo '<label for="' . $this->get_field_id( $id ) . '">' . $title . '</label>';
|
222 |
-
break;
|
223 |
-
|
224 |
-
case 'select':
|
225 |
-
echo '<label for="' . $this->get_field_id( $id ) . '">' . $title . '</label>';
|
226 |
-
echo '<select id="' . $this->get_field_id( $id ) . '"class="select' . $field_class . '" name="' . $this->get_field_name( $id ) . '">';
|
227 |
-
|
228 |
-
foreach ( $choices as $value => $label ) {
|
229 |
-
echo '<option value="' . esc_attr( $value ) . '"' . selected( $options[ $id ], $value, false ) . '>' . $label . '</option>';
|
230 |
-
}
|
231 |
-
|
232 |
-
echo '</select>';
|
233 |
-
break;
|
234 |
-
|
235 |
-
case 'radio':
|
236 |
-
$i = 0;
|
237 |
-
$count_options = count( $options ) - 1;
|
238 |
-
|
239 |
-
foreach ( $choices as $value => $label ) {
|
240 |
-
echo '<input class="radio' . $field_class . '" type="radio" name="' . $this->get_field_name( $id ) . '" id="' . $this->get_field_name( $id . $i ) . '" value="' . esc_attr( $value ) . '" ' . checked( $options[ $id ], $value, false ) . '> <label for="' . $this->get_field_name( $id . $i ) . '">' . $label . '</label>';
|
241 |
-
if ( $i < $count_options ) {
|
242 |
-
echo '<br />';
|
243 |
-
}
|
244 |
-
|
245 |
-
$i++;
|
246 |
-
}
|
247 |
-
|
248 |
-
echo '<label for="' . $this->get_field_id( $id ) . '">' . $title . '</label>';
|
249 |
-
break;
|
250 |
-
|
251 |
-
case 'textarea':
|
252 |
-
echo '<label for="' . $this->get_field_id( $id ) . '">' . $title . '</label>';
|
253 |
-
|
254 |
-
if ( function_exists( 'format_for_editor' ) ) {
|
255 |
-
echo '<textarea class="widefat' . $field_class . '" id="' . $this->get_field_id( $id ) . '" name="' . $this->get_field_name( $id ) . '" placeholder="' . $std . '" rows="5" cols="30">' . format_for_editor( $options[ $id ] ) . '</textarea>';
|
256 |
-
} else {
|
257 |
-
echo '<textarea class="widefat' . $field_class . '" id="' . $this->get_field_id( $id ) . '" name="' . $this->get_field_name( $id ) . '" placeholder="' . $std . '" rows="5" cols="30">' . wp_htmledit_pre( $options[ $id ] ) . '</textarea>';
|
258 |
-
}
|
259 |
-
break;
|
260 |
-
|
261 |
-
case 'password':
|
262 |
-
echo '<label for="' . $this->get_field_id( $id ) . '">' . $title . '</label>';
|
263 |
-
|
264 |
-
echo '<input class="widefat' . $field_class . '" type="password" id="' . $this->get_field_id( $id ) . '" name="' . $this->get_field_name( $id ) . '" value="' . esc_attr( $options[ $id ] ) . '" />';
|
265 |
-
break;
|
266 |
-
|
267 |
-
case 'readonly':
|
268 |
-
echo '<label for="' . $this->get_field_id( $id ) . '">' . $title . '</label>';
|
269 |
-
|
270 |
-
echo '<input class="widefat' . $field_class . '" type="text" id="' . $this->get_field_id( $id ) . '" name="' . $this->get_field_name( $id ) . '" value="' . esc_attr( $options[ $id ] ) . '" readonly="readonly" />';
|
271 |
-
break;
|
272 |
-
|
273 |
-
case 'text':
|
274 |
-
echo '<label for="' . $this->get_field_id( $id ) . '">' . $title . '</label>';
|
275 |
-
|
276 |
-
$suggest_id = 'suggest_' . self::$suggest_id++;
|
277 |
-
echo '<input class="widefat' . $field_class . ' ' . $suggest_id . '" type="text" id="' . $this->get_field_id( $id ) . '" name="' . $this->get_field_name( $id ) . '" placeholder="' . $std . '" value="' . esc_attr( $options[ $id ] ) . '" />';
|
278 |
-
|
279 |
-
if ( $suggest ) {
|
280 |
-
echo static::get_suggest( $id, $suggest_id );
|
281 |
-
}
|
282 |
-
break;
|
283 |
-
|
284 |
-
default:
|
285 |
-
break;
|
286 |
-
}
|
287 |
-
|
288 |
-
if ( ! empty( $desc ) ) {
|
289 |
-
echo '<br /><span class="setting-description"><small>' . $desc . '</small></span>';
|
290 |
-
}
|
291 |
-
|
292 |
-
echo '</p>';
|
293 |
-
|
294 |
-
if ( empty( $widget ) ) {
|
295 |
-
echo '</div>';
|
296 |
-
}
|
297 |
-
}
|
298 |
-
|
299 |
-
|
300 |
-
/**
|
301 |
-
*
|
302 |
-
*
|
303 |
-
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
304 |
-
*/
|
305 |
-
public static function get_suggest( $id, $suggest_id ) {
|
306 |
-
return;
|
307 |
-
}
|
308 |
-
|
309 |
-
|
310 |
-
public static function form_instance( $instance ) {
|
311 |
-
if ( empty( $instance ) ) {
|
312 |
-
$instance = static::get_defaults();
|
313 |
-
} elseif ( ! empty( $instance['resetted'] ) ) {
|
314 |
-
$instance = static::get_defaults();
|
315 |
-
}
|
316 |
-
|
317 |
-
return $instance;
|
318 |
-
}
|
319 |
-
|
320 |
-
|
321 |
-
public static function get_defaults() {
|
322 |
-
$defaults = array();
|
323 |
-
$options = static::form_parts();
|
324 |
-
foreach ( $options as $option => $value ) {
|
325 |
-
$defaults[ $option ] = isset( $value['std'] ) ? $value['std'] : '';
|
326 |
-
}
|
327 |
-
|
328 |
-
return $defaults;
|
329 |
-
}
|
330 |
-
|
331 |
-
|
332 |
-
/**
|
333 |
-
*
|
334 |
-
*
|
335 |
-
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
336 |
-
*/
|
337 |
-
public static function form_parts( $instance = null, $number = null ) {
|
338 |
-
$form_parts = array(
|
339 |
-
'title' => array(
|
340 |
-
'title' => esc_html__( 'Title' ),
|
341 |
-
'validate' => 'wp_kses_post',
|
342 |
-
),
|
343 |
-
'title_link' => array(
|
344 |
-
'title' => esc_html__( 'Title Link' ),
|
345 |
-
'desc' => esc_html__( 'URL, path, or post ID to link widget title to. Ex: http://example.com/stuff, /testimonials, or 123' ),
|
346 |
-
'validate' => 'wp_kses_data',
|
347 |
-
),
|
348 |
-
);
|
349 |
-
|
350 |
-
return $form_parts;
|
351 |
-
}
|
352 |
-
|
353 |
-
|
354 |
-
/**
|
355 |
-
*
|
356 |
-
*
|
357 |
-
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
358 |
-
*/
|
359 |
-
public static function get_content( $instance = null, $widget_number = null ) {
|
360 |
-
return;
|
361 |
-
}
|
362 |
-
}
|
363 |
-
|
364 |
-
|
365 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
-
|
5 |
-
This program is free software; you can redistribute it and/or modify
|
6 |
-
it under the terms of the GNU General Public License, version 2, as
|
7 |
-
published by the Free Software Foundation.
|
8 |
-
|
9 |
-
This program is distributed in the hope that it will be useful,
|
10 |
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11 |
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12 |
-
GNU General Public License for more details.
|
13 |
-
|
14 |
-
You should have received a copy of the GNU General Public License
|
15 |
-
along with this program; if not, write to the Free Software
|
16 |
-
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
17 |
-
*/
|
18 |
-
|
19 |
-
if ( class_exists( 'Aihrus_Common_Interface' ) )
|
20 |
-
return;
|
21 |
-
|
22 |
-
|
23 |
-
interface Aihrus_Common_Interface {
|
24 |
-
}
|
25 |
-
|
26 |
-
|
27 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/interface-aihrus-licensing.php
DELETED
@@ -1,28 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/*
|
3 |
-
Copyright 2014 Michael Cannon (email: mc@aihr.us)
|
4 |
-
|
5 |
-
This program is free software; you can redistribute it and/or modify
|
6 |
-
it under the terms of the GNU General Public License, version 2, as
|
7 |
-
published by the Free Software Foundation.
|
8 |
-
|
9 |
-
This program is distributed in the hope that it will be useful,
|
10 |
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11 |
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12 |
-
GNU General Public License for more details.
|
13 |
-
|
14 |
-
You should have received a copy of the GNU General Public License
|
15 |
-
along with this program; if not, write to the Free Software
|
16 |
-
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
17 |
-
*/
|
18 |
-
|
19 |
-
if ( class_exists( 'Aihrus_Licensing_Interface' ) )
|
20 |
-
return;
|
21 |
-
|
22 |
-
|
23 |
-
interface Aihrus_Licensing_Interface {
|
24 |
-
public function settings( $settings );
|
25 |
-
}
|
26 |
-
|
27 |
-
|
28 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/interface-aihrus-widget.php
DELETED
@@ -1,33 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/*
|
3 |
-
Copyright 2014 Michael Cannon (email: mc@aihr.us)
|
4 |
-
|
5 |
-
This program is free software; you can redistribute it and/or modify
|
6 |
-
it under the terms of the GNU General Public License, version 2, as
|
7 |
-
published by the Free Software Foundation.
|
8 |
-
|
9 |
-
This program is distributed in the hope that it will be useful,
|
10 |
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11 |
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12 |
-
GNU General Public License for more details.
|
13 |
-
|
14 |
-
You should have received a copy of the GNU General Public License
|
15 |
-
along with this program; if not, write to the Free Software
|
16 |
-
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
17 |
-
*/
|
18 |
-
|
19 |
-
if ( class_exists( 'Aihrus_Widget_Interface' ) )
|
20 |
-
return;
|
21 |
-
|
22 |
-
|
23 |
-
interface Aihrus_Widget_Interface {
|
24 |
-
public static function form_instance( $instance );
|
25 |
-
public static function form_parts( $instance, $number );
|
26 |
-
public static function get_content( $instance, $widget_number );
|
27 |
-
public static function get_defaults();
|
28 |
-
public static function get_suggest( $id, $suggest_id );
|
29 |
-
public static function validate_settings( $instance );
|
30 |
-
}
|
31 |
-
|
32 |
-
|
33 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/class-redrokk-metabox-class.php
DELETED
@@ -1,1471 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
*
|
4 |
-
*
|
5 |
-
* @Author Anonymous
|
6 |
-
* @link http://www.redrokk.com
|
7 |
-
* @Package Wordpress
|
8 |
-
* @SubPackage RedRokk Library
|
9 |
-
*
|
10 |
-
* @version 2.0
|
11 |
-
*/
|
12 |
-
|
13 |
-
|
14 |
-
//security
|
15 |
-
defined( 'ABSPATH' ) or die( 'You\'re not supposed to be here.' );
|
16 |
-
|
17 |
-
/**
|
18 |
-
*
|
19 |
-
*
|
20 |
-
* @author Anonymous
|
21 |
-
* @example
|
22 |
-
* $gallery = redrokk_metabox_class::getInstance('gallery');
|
23 |
-
*/
|
24 |
-
if ( !class_exists( 'redrokk_metabox_class' ) ):
|
25 |
-
class redrokk_metabox_class {
|
26 |
-
|
27 |
-
/**
|
28 |
-
* HTML 'id' attribute of the edit screen section
|
29 |
-
*
|
30 |
-
* @var string
|
31 |
-
*/
|
32 |
-
var $_id;
|
33 |
-
|
34 |
-
/**
|
35 |
-
* Save the form fields here that will be displayed to the user
|
36 |
-
*
|
37 |
-
* @var array
|
38 |
-
*/
|
39 |
-
var $_fields;
|
40 |
-
|
41 |
-
/**
|
42 |
-
* Title of the edit screen section, visible to user
|
43 |
-
* Default: None
|
44 |
-
*
|
45 |
-
* @var string
|
46 |
-
*/
|
47 |
-
var $title;
|
48 |
-
|
49 |
-
/**
|
50 |
-
* Function that prints out the HTML for the edit screen section. Pass
|
51 |
-
* function name as a string. Within a class, you can instead pass an
|
52 |
-
* array to call one of the class's methods. See the second example under
|
53 |
-
* Example below.
|
54 |
-
* Default: None
|
55 |
-
*
|
56 |
-
* @var callback
|
57 |
-
*/
|
58 |
-
var $callback = null;
|
59 |
-
|
60 |
-
/**
|
61 |
-
* The part of the page where the edit screen section should be shown
|
62 |
-
* ('normal', 'advanced', or 'side'). (Note that 'side' doesn't exist before 2.7)
|
63 |
-
* Default: 'advanced'
|
64 |
-
*
|
65 |
-
* @var string
|
66 |
-
*/
|
67 |
-
var $context = 'normal';
|
68 |
-
|
69 |
-
/**
|
70 |
-
* The priority within the context where the boxes should show
|
71 |
-
* ('high', 'core', 'default' or 'low')
|
72 |
-
* Default: 'default'
|
73 |
-
*
|
74 |
-
* @var string
|
75 |
-
*/
|
76 |
-
var $priority = 'default';
|
77 |
-
|
78 |
-
/**
|
79 |
-
* Arguments to pass into your callback function. The callback will receive the
|
80 |
-
* $post object and whatever parameters are passed through this variable.
|
81 |
-
* Default: null
|
82 |
-
*
|
83 |
-
* @var array
|
84 |
-
*/
|
85 |
-
var $callback_args;
|
86 |
-
|
87 |
-
/**
|
88 |
-
* Prebuilt metaboxes can be activated by using this type
|
89 |
-
* Default: default
|
90 |
-
*
|
91 |
-
* (options:)
|
92 |
-
* default
|
93 |
-
* images
|
94 |
-
*
|
95 |
-
* @var string
|
96 |
-
*/
|
97 |
-
var $_type;
|
98 |
-
|
99 |
-
/**
|
100 |
-
*
|
101 |
-
*
|
102 |
-
* @var unknown_type
|
103 |
-
*/
|
104 |
-
var $_category_name;
|
105 |
-
|
106 |
-
/**
|
107 |
-
* The type of Write screen on which to show the edit screen section
|
108 |
-
* ('post', 'page', 'link', or 'custom_post_type' where custom_post_type
|
109 |
-
* is the custom post type slug)
|
110 |
-
* Default: None
|
111 |
-
*
|
112 |
-
* @var array
|
113 |
-
*/
|
114 |
-
var $_object_types = array();
|
115 |
-
|
116 |
-
/**
|
117 |
-
* Whether or not to make the fields available as wp-options
|
118 |
-
*
|
119 |
-
* @var bool
|
120 |
-
*/
|
121 |
-
var $_isAdminPage = false;
|
122 |
-
|
123 |
-
|
124 |
-
/**
|
125 |
-
* Constructor.
|
126 |
-
*
|
127 |
-
*/
|
128 |
-
function __construct( $options = array() ) {
|
129 |
-
//initializing
|
130 |
-
$this->setProperties( $options );
|
131 |
-
$this->setOptionHooks();
|
132 |
-
|
133 |
-
if ( !$this->callback ) {
|
134 |
-
$this->callback = array( $this, 'show' );
|
135 |
-
}
|
136 |
-
if ( !$this->title ) {
|
137 |
-
$this->title = ucfirst( $this->_id );
|
138 |
-
}
|
139 |
-
|
140 |
-
//registering this metabox
|
141 |
-
add_action( 'add_meta_boxes', array( $this, '_register' ) );
|
142 |
-
|
143 |
-
// backwards compatible (before WP 3.0)
|
144 |
-
// add_action( 'admin_init', array($this, '_register'), 1 );
|
145 |
-
|
146 |
-
add_action( 'save_post', array( $this, '_save' ) );
|
147 |
-
add_filter( 'wp_redirect', array( $this, '_redirectIntervention' ), 40, 1 );
|
148 |
-
}
|
149 |
-
|
150 |
-
|
151 |
-
/**
|
152 |
-
* Method properly inturprets the given parameter and sets it accordingly
|
153 |
-
*
|
154 |
-
* @param string|object $value
|
155 |
-
*/
|
156 |
-
function setObjectTypes( $value ) {
|
157 |
-
if ( is_a( $value, 'redrokk_post_class' ) ) {
|
158 |
-
$value = $value->_post_type;
|
159 |
-
}
|
160 |
-
if ( is_a( $value, 'redrokk_admin_class' ) ) {
|
161 |
-
$value = $value->id;
|
162 |
-
$this->_isAdminPage = $value;
|
163 |
-
}
|
164 |
-
if ( is_array( $value ) ) {
|
165 |
-
foreach ( $value as $v )
|
166 |
-
$this->_object_types[] = $v;
|
167 |
-
return $this;
|
168 |
-
}
|
169 |
-
|
170 |
-
$this->_object_types[] = $value;
|
171 |
-
return $this;
|
172 |
-
}
|
173 |
-
|
174 |
-
|
175 |
-
/**
|
176 |
-
* Method is designed to return the currently visible post type
|
177 |
-
*/
|
178 |
-
function getCurrentPostType() {
|
179 |
-
$post_type = false;
|
180 |
-
if ( isset( $_REQUEST['post_type'] ) ) {
|
181 |
-
$post_type = $_REQUEST['post_type'];
|
182 |
-
}
|
183 |
-
elseif ( isset( $_REQUEST['post'] ) ) {
|
184 |
-
$post = get_post( $_REQUEST['post'] );
|
185 |
-
$post_type = $post->post_type;
|
186 |
-
}
|
187 |
-
elseif ( isset( $_REQUEST['page'] ) ) {
|
188 |
-
$post_type = $_REQUEST['page'];
|
189 |
-
}
|
190 |
-
|
191 |
-
return $post_type;
|
192 |
-
}
|
193 |
-
|
194 |
-
|
195 |
-
/**
|
196 |
-
* Method properly prepares the metabox type by binding the necessary hooks
|
197 |
-
*
|
198 |
-
* @param mixed $value
|
199 |
-
*/
|
200 |
-
function settype( $value = 'default' ) {
|
201 |
-
$this->_type = $value;
|
202 |
-
|
203 |
-
switch ( $this->_type ) {
|
204 |
-
default:
|
205 |
-
case 'default':
|
206 |
-
add_action( 'metabox-show-'.$this->_id, array( $this, '_renderForm' ), 20, 1 );
|
207 |
-
add_action( 'metabox-save-'.$this->_id, array( $this, 'saveAsPostMeta' ), 10, 2 );
|
208 |
-
break;
|
209 |
-
case 'image':
|
210 |
-
case 'images':
|
211 |
-
$this->_fields = array(
|
212 |
-
array(
|
213 |
-
'name' => 'New Image',
|
214 |
-
'type' => 'title',
|
215 |
-
),
|
216 |
-
array(
|
217 |
-
'name' => 'Image Title',
|
218 |
-
'id' => $this->_id.'_post_title',
|
219 |
-
'type' => 'text',
|
220 |
-
),
|
221 |
-
array(
|
222 |
-
'name' => 'Description',
|
223 |
-
'id' => $this->_id.'_post_content',
|
224 |
-
'type' => 'textarea',
|
225 |
-
),
|
226 |
-
array(
|
227 |
-
'name' => 'Image File',
|
228 |
-
'id' => $this->_id.'_image',
|
229 |
-
'type' => 'image',
|
230 |
-
),
|
231 |
-
array(
|
232 |
-
'name' => 'Save Image',
|
233 |
-
'type' => 'submit',
|
234 |
-
),
|
235 |
-
);
|
236 |
-
add_action( 'metabox-show-'.$this->_id, array( $this, '_renderListImageAttachments' ), 20, 1 );
|
237 |
-
add_action( 'metabox-show-'.$this->_id, array( $this, '_renderForm' ), 20, 1 );
|
238 |
-
add_action( 'metabox-save-'.$this->_id, array( $this, 'saveAsAttachment' ), 1, 2 );
|
239 |
-
break;
|
240 |
-
case 'video':
|
241 |
-
case 'videos':
|
242 |
-
$this->_fields = array(
|
243 |
-
array(
|
244 |
-
'name' => 'New Video',
|
245 |
-
'type' => 'title',
|
246 |
-
),
|
247 |
-
array(
|
248 |
-
'name' => 'Video Title',
|
249 |
-
'id' => $this->_id.'_post_title',
|
250 |
-
'type' => 'text',
|
251 |
-
),
|
252 |
-
array(
|
253 |
-
'name' => 'Description',
|
254 |
-
'id' => $this->_id.'_post_content',
|
255 |
-
'type' => 'textarea',
|
256 |
-
),
|
257 |
-
array(
|
258 |
-
'name' => 'Video File',
|
259 |
-
'id' => $this->_id.'_image',
|
260 |
-
'type' => 'image',
|
261 |
-
),
|
262 |
-
array(
|
263 |
-
'name' => 'Video Link',
|
264 |
-
'id' => $this->_id.'_link',
|
265 |
-
'type' => 'text',
|
266 |
-
),
|
267 |
-
array(
|
268 |
-
'name' => '_videocat',
|
269 |
-
'id' => $this->_id.'_videocat',
|
270 |
-
'std'=> $this->getCategory(),
|
271 |
-
'type' => 'hidden',
|
272 |
-
),
|
273 |
-
array(
|
274 |
-
'name' => '_metaid',
|
275 |
-
'id' => $this->_id.'_metaid',
|
276 |
-
'type' => 'hidden',
|
277 |
-
),
|
278 |
-
array(
|
279 |
-
'name' => 'Save Video',
|
280 |
-
'type' => 'submit',
|
281 |
-
),
|
282 |
-
);
|
283 |
-
add_action( 'metabox-show-'.$this->_id, array( $this, '_renderListAttachments' ), 20, 1 );
|
284 |
-
add_action( 'metabox-show-'.$this->_id, array( $this, '_renderListVideoAttachments' ), 20, 1 );
|
285 |
-
add_action( 'metabox-show-'.$this->_id, array( $this, '_renderForm' ), 20, 1 );
|
286 |
-
add_action( 'metabox-save-'.$this->_id, array( $this, 'saveAsPostMeta' ), 1, 2 );
|
287 |
-
break;
|
288 |
-
}
|
289 |
-
}
|
290 |
-
|
291 |
-
|
292 |
-
/**
|
293 |
-
* Returns the category to use
|
294 |
-
*/
|
295 |
-
function getCategory() {
|
296 |
-
return isset( $this->_category_name )
|
297 |
-
? $this->_category_name
|
298 |
-
: '_videocat';
|
299 |
-
}
|
300 |
-
|
301 |
-
|
302 |
-
/**
|
303 |
-
* Method will save the posted content as an image attachment
|
304 |
-
*
|
305 |
-
*/
|
306 |
-
function saveAsAttachment( $source, $post_id ) {
|
307 |
-
if ( empty( $_FILES ) || !isset( $_REQUEST[$this->_id.'files'] ) ) return $source;
|
308 |
-
|
309 |
-
// initializing
|
310 |
-
$property = $_REQUEST[$this->_id.'files'];
|
311 |
-
$post_data = array();
|
312 |
-
|
313 |
-
if ( isset( $source[$this->_id.'_post_title'] ) && $source[$this->_id.'_post_title'] ) {
|
314 |
-
$post_data['post_title'] = $source[$this->_id.'_post_title'];
|
315 |
-
}
|
316 |
-
|
317 |
-
if ( isset( $source[$this->_id.'_post_content'] ) && $source[$this->_id.'_post_content'] ) {
|
318 |
-
$post_data['post_content'] = $source[$this->_id.'_post_content'];
|
319 |
-
}
|
320 |
-
|
321 |
-
$id = media_handle_upload( $property, $post_id, $post_data );
|
322 |
-
$source[$property] = $id;
|
323 |
-
|
324 |
-
$type = 'post';
|
325 |
-
if ( $this->getCurrentPostType() ) {
|
326 |
-
$type = $this->getCurrentPostType();
|
327 |
-
}
|
328 |
-
|
329 |
-
//saving the attachment ID to the taxonomy
|
330 |
-
if ( !in_array( $type, get_post_types( array( 'public' => false ) ) ) ) {
|
331 |
-
$old = get_metadata( $type, $post_id, $property, true );
|
332 |
-
if ( $id && $id != $old ) {
|
333 |
-
wp_delete_attachment( $old, true );
|
334 |
-
update_metadata( $type, $post_id, $property, $id );
|
335 |
-
}
|
336 |
-
}
|
337 |
-
|
338 |
-
foreach ( (array)$source as $property => $new ) {
|
339 |
-
//skip everything but the specially prefixed
|
340 |
-
if ( strpos( $property, $this->_id ) !== 0 ) continue;
|
341 |
-
if ( in_array( $property, array(
|
342 |
-
$this->_id.'_post_title',
|
343 |
-
$this->_id.'_post_content',
|
344 |
-
) ) ) continue;
|
345 |
-
|
346 |
-
$old = get_metadata( $type, $id, $property, true );
|
347 |
-
if ( $new && $new != $old ) {
|
348 |
-
update_metadata( $type, $id, $property, $new );
|
349 |
-
}
|
350 |
-
elseif ( !$new ) {
|
351 |
-
delete_metadata( $type, $id, $property, $old );
|
352 |
-
}
|
353 |
-
}
|
354 |
-
|
355 |
-
return $source;
|
356 |
-
}
|
357 |
-
|
358 |
-
|
359 |
-
/**
|
360 |
-
* Method saves the data provided as post meta values
|
361 |
-
*
|
362 |
-
* @param array $source
|
363 |
-
* @param integer $post_id
|
364 |
-
*/
|
365 |
-
function saveAsPostMeta( $source, $post_id ) {
|
366 |
-
$type = 'post';
|
367 |
-
if ( !$this->getCurrentPostType() ) {
|
368 |
-
$type = $this->_table;
|
369 |
-
}
|
370 |
-
|
371 |
-
//save as a file
|
372 |
-
//if there's no FILES then we save as a meta
|
373 |
-
$source = $this->saveAsAttachment( $source, $post_id );
|
374 |
-
|
375 |
-
//get the ID of this meta set
|
376 |
-
$id = false;
|
377 |
-
if ( isset( $source[$this->_id.'_metaid'] ) && $source[$this->_id.'_metaid'] ) {
|
378 |
-
$id = $source[$this->_id.'_metaid'];
|
379 |
-
}
|
380 |
-
|
381 |
-
// if this is a built in metabox
|
382 |
-
if ( $this->_type != 'default'
|
383 |
-
&& ( !isset( $source[$this->_id.'_image'] ) || !$source[$this->_id.'_image'] ) )
|
384 |
-
return false;
|
385 |
-
|
386 |
-
// Saving only the specially prefixed items
|
387 |
-
foreach ( (array)$source as $property => $new ) {
|
388 |
-
//skip everything but the specially prefixed
|
389 |
-
if ( strpos( $property, $this->_id ) !== 0 ) continue;
|
390 |
-
|
391 |
-
//each meta set has it's own ID
|
392 |
-
$property = str_replace( $this->_id, $this->_category_name.'_'.$id, $property );
|
393 |
-
|
394 |
-
$old = get_metadata( $type, $post_id, $property, true );
|
395 |
-
if ( $new && $new != $old ) {
|
396 |
-
update_metadata( $type, $post_id, $property, $new );
|
397 |
-
}
|
398 |
-
elseif ( !$new ) {
|
399 |
-
delete_metadata( $type, $post_id, $property, $old );
|
400 |
-
}
|
401 |
-
}
|
402 |
-
|
403 |
-
// maybe there's a last id
|
404 |
-
if ( !$id ) {
|
405 |
-
if ( !$id = get_metadata( $type, $post_id, '_metaidlast', true ) ) {
|
406 |
-
$id = 0;
|
407 |
-
}
|
408 |
-
$id++;
|
409 |
-
update_metadata( $type, $post_id, '_metaidlast', $id );
|
410 |
-
}
|
411 |
-
|
412 |
-
// saving all of the standard items
|
413 |
-
foreach ( (array)$source as $property => $new ) {
|
414 |
-
//skip special properties that are prefixed with the id
|
415 |
-
if ( strpos( $property, $this->_id ) === 0 ) continue;
|
416 |
-
|
417 |
-
$old = get_metadata( $type, $post_id, $property, true );
|
418 |
-
update_metadata( $type, $post_id, $property, $new );
|
419 |
-
|
420 |
-
// if ($new && $new != $old) {
|
421 |
-
// update_metadata($type, $post_id, $property, $new);
|
422 |
-
// }
|
423 |
-
// elseif (!$new) {
|
424 |
-
// delete_metadata($type, $post_id, $property, $old);
|
425 |
-
// }
|
426 |
-
|
427 |
-
}
|
428 |
-
|
429 |
-
return true;
|
430 |
-
}
|
431 |
-
|
432 |
-
|
433 |
-
/**
|
434 |
-
* Do something with the data entered
|
435 |
-
*
|
436 |
-
* @param integer $post_id
|
437 |
-
*/
|
438 |
-
function _save( $post_id ) {
|
439 |
-
//initializing
|
440 |
-
$post = get_post( $post_id );
|
441 |
-
|
442 |
-
// verify if this is an auto save routine.
|
443 |
-
// If it is our form has not been submitted, so we dont want to do anything
|
444 |
-
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )
|
445 |
-
return;
|
446 |
-
|
447 |
-
// verify this came from the our screen and with proper authorization,
|
448 |
-
// because save_post can be triggered at other times
|
449 |
-
if ( !isset( $_REQUEST[ get_class().$this->_id ] ) )
|
450 |
-
return;
|
451 |
-
|
452 |
-
if ( !wp_verify_nonce( $_REQUEST[ get_class().$this->_id ], plugin_basename( __FILE__ ) ) )
|
453 |
-
return;
|
454 |
-
|
455 |
-
// this metabox is to be displayed for a certain object type only
|
456 |
-
if ( !in_array( $post->post_type, $this->_object_types ) )
|
457 |
-
return;
|
458 |
-
|
459 |
-
// Check permissions
|
460 |
-
if ( 'page' == $post->post_type ) {
|
461 |
-
if ( !current_user_can( 'edit_page', $post->ID ) )
|
462 |
-
return;
|
463 |
-
}
|
464 |
-
else {
|
465 |
-
if ( !current_user_can( 'edit_post', $post->ID ) )
|
466 |
-
return;
|
467 |
-
}
|
468 |
-
|
469 |
-
//saving the request data
|
470 |
-
if ( !$this->_type ) $this->setType();
|
471 |
-
do_action( 'metabox-save-'.$this->_id, $this->getRequestPostMetas(), $post->ID, $this );
|
472 |
-
return true;
|
473 |
-
}
|
474 |
-
|
475 |
-
|
476 |
-
/**
|
477 |
-
* Method returns the post meta
|
478 |
-
*
|
479 |
-
*/
|
480 |
-
function getRequestPostMetas() {
|
481 |
-
$ignores = array( 'post_title', 'post_name', 'post_content', 'post_excerpt', 'post',
|
482 |
-
'post_status', 'post_type', 'post_author', 'ping_status', 'post_parent', 'message',
|
483 |
-
'post_category', 'comment_status', 'menu_order', 'to_ping', 'pinged', 'post_password',
|
484 |
-
'guid', 'post_content_filtered', 'import_id', 'post_date', 'post_date_gmt', 'tags_input',
|
485 |
-
'action' );
|
486 |
-
|
487 |
-
$fields = array();
|
488 |
-
foreach ( (array)$this->_fields as $field ) {
|
489 |
-
if ( !array_key_exists( 'id', $field ) ) continue;
|
490 |
-
$fields[] = $field['id'];
|
491 |
-
}
|
492 |
-
|
493 |
-
$requests = $_REQUEST;
|
494 |
-
foreach ( (array)$requests as $k => $request ) {
|
495 |
-
if ( ( !empty( $fields ) && !in_array( $k, $fields ) )
|
496 |
-
|| ( in_array( $k, $ignores ) || strpos( $k, 'nounce' ) !== false ) ) {
|
497 |
-
unset( $requests[$k] );
|
498 |
-
}
|
499 |
-
}
|
500 |
-
|
501 |
-
return apply_filters( 'metabox-requests-'.$this->_id, $requests );
|
502 |
-
}
|
503 |
-
|
504 |
-
|
505 |
-
/**
|
506 |
-
* Display the inner contents of the metabox
|
507 |
-
*
|
508 |
-
* @param object $post
|
509 |
-
*/
|
510 |
-
function show( $post ) {
|
511 |
-
// Use nonce for verification
|
512 |
-
wp_nonce_field( plugin_basename( __FILE__ ), get_class().$this->_id );
|
513 |
-
do_action( 'metabox-show-'.$this->_id, $this->_fields, $this );
|
514 |
-
}
|
515 |
-
|
516 |
-
|
517 |
-
/**
|
518 |
-
* Method displays a list of attached images
|
519 |
-
*
|
520 |
-
*/
|
521 |
-
function _renderListImageAttachments() {
|
522 |
-
global $post, $current_screen;
|
523 |
-
$images = get_children( "post_parent=$post->ID&post_type=attachment&post_mime_type=image" );
|
524 |
-
|
525 |
-
// no images to render
|
526 |
-
if ( empty( $images ) ) {
|
527 |
-
?><p>No images have been saved.</p><?php
|
528 |
-
|
529 |
-
// rendering the images
|
530 |
-
} else {
|
531 |
-
|
532 |
-
?>
|
533 |
-
<table class="wp-list-table form-table widefat" style="border:none;">
|
534 |
-
<?php foreach ( (array)$images as $post_id => $image ): ?>
|
535 |
-
<?php $image_attributes = wp_get_attachment_image_src( $image->ID, 'thumbnail' ); ?>
|
536 |
-
<tbody id="the-list">
|
537 |
-
<tr>
|
538 |
-
<th scope="row" style="width: 140px">
|
539 |
-
<div style="padding:10px;background:whiteSmoke;">
|
540 |
-
<img src="<?php echo wp_get_attachment_thumb_url( $image->ID ); ?>" /></div>
|
541 |
-
</th>
|
542 |
-
<td>
|
543 |
-
<b><?php echo $image->post_title; ?></b>
|
544 |
-
<p><?php echo get_the_content( $image->ID ); ?></p>
|
545 |
-
|
546 |
-
<div class="row-actions">
|
547 |
-
<span class="inline">
|
548 |
-
<a href="<?php echo wp_nonce_url(
|
549 |
-
"media.php?attachment_id=$image->ID"
|
550 |
-
."&action=edit&_redirect="
|
551 |
-
.urlencode( $this->_currentPageURL() )
|
552 |
-
); ?>">
|
553 |
-
Edit</a> |
|
554 |
-
</span>
|
555 |
-
<span class="trash">
|
556 |
-
<a class="submitdelete"
|
557 |
-
onclick="return showNotice.warn();"
|
558 |
-
href="<?php echo wp_nonce_url(
|
559 |
-
"post.php?action=delete&_redirect="
|
560 |
-
.urlencode( $this->_currentPageURL() )
|
561 |
-
."&post=$image->ID",
|
562 |
-
'delete-attachment_' . $image->ID ); ?>">
|
563 |
-
Delete Permanently</a> |
|
564 |
-
</span>
|
565 |
-
<span class="inline">
|
566 |
-
<a target="_blank"
|
567 |
-
href="<?php echo get_attachment_link( $image->ID ); ?>">
|
568 |
-
View</a>
|
569 |
-
</span>
|
570 |
-
</div>
|
571 |
-
</td>
|
572 |
-
</tr>
|
573 |
-
</tbody>
|
574 |
-
<?php endforeach; ?>
|
575 |
-
</table>
|
576 |
-
<?php
|
577 |
-
}
|
578 |
-
return;
|
579 |
-
}
|
580 |
-
|
581 |
-
|
582 |
-
/**
|
583 |
-
* Return a clean list of meta listings created by this system
|
584 |
-
*
|
585 |
-
* @param string $category
|
586 |
-
* $param object $post
|
587 |
-
*/
|
588 |
-
public static function getMetaListings( $category, $post = null ) {
|
589 |
-
// initializing
|
590 |
-
if ( $post === NULL ) {
|
591 |
-
global $post;
|
592 |
-
}
|
593 |
-
$custom = get_post_custom( $post->ID );
|
594 |
-
$return = array();
|
595 |
-
|
596 |
-
//looping all values to build our return array
|
597 |
-
foreach ( (array)$custom as $property => $value ) {
|
598 |
-
$parts = explode( '_', $property );
|
599 |
-
if ( !isset( $parts[0] ) || !isset( $parts[1] ) || !isset( $parts[2] ) ) continue;
|
600 |
-
if ( $parts[0] != $category ) continue;
|
601 |
-
|
602 |
-
$pro = str_replace( $parts[0].'_'.$parts[1].'_', '', $property );
|
603 |
-
$return[$parts[1]][$pro] = $value;
|
604 |
-
}
|
605 |
-
|
606 |
-
return $return;
|
607 |
-
}
|
608 |
-
|
609 |
-
|
610 |
-
/**
|
611 |
-
* Function removes a specific category meta
|
612 |
-
*
|
613 |
-
* @param string $category
|
614 |
-
* $param string $meta_id
|
615 |
-
* $param object $post
|
616 |
-
*/
|
617 |
-
public static function deleteMetaListing( $category, $meta_id, $post = null ) {
|
618 |
-
// initializing
|
619 |
-
if ( $post === NULL ) {
|
620 |
-
global $post;
|
621 |
-
}
|
622 |
-
$listings = redrokk_metabox_class::getMetaListings( $category, $post );
|
623 |
-
if ( !isset( $listings[$meta_id] ) ) return false;
|
624 |
-
|
625 |
-
$type = 'post';
|
626 |
-
|
627 |
-
foreach ( (array)$listings[$meta_id] as $property => $value ) {
|
628 |
-
$pro = $category.'_'.$meta_id.'_'.$property;
|
629 |
-
delete_metadata( $type, $post->ID, $pro, $value[0] );
|
630 |
-
}
|
631 |
-
return true;
|
632 |
-
}
|
633 |
-
|
634 |
-
|
635 |
-
/**
|
636 |
-
* Method displays a list of meta attachments
|
637 |
-
*
|
638 |
-
*/
|
639 |
-
function _renderListAttachments() {
|
640 |
-
global $post;
|
641 |
-
|
642 |
-
//delete action prior to pulling new listings
|
643 |
-
if ( isset( $_REQUEST['redrokkdelete'] ) && $_REQUEST['redrokkdelete'] ) {
|
644 |
-
redrokk_metabox_class::deleteMetaListing( $this->_category_name, $_REQUEST['redrokkdelete'], $post );
|
645 |
-
}
|
646 |
-
|
647 |
-
//pull new listings
|
648 |
-
$metaListings = redrokk_metabox_class::getMetaListings( $this->_category_name, $post );
|
649 |
-
|
650 |
-
if ( !empty( $metaListings ) ) {
|
651 |
-
?>
|
652 |
-
<table class="wp-list-table form-table widefat" style="border:none;">
|
653 |
-
<tbody id="the-list">
|
654 |
-
<?php foreach ( (array)$metaListings as $meta_id => $video ): ?>
|
655 |
-
<?php $video = apply_filters( 'redrokk_metabox_class::_renderListAttachments', $video, $meta_id );?>
|
656 |
-
|
657 |
-
<tr id="<?php echo $this->_category_name; ?>_<?php echo $meta_id; ?>">
|
658 |
-
<th scope="row" style="width: 140px">
|
659 |
-
<div style="padding:10px;background:whiteSmoke;">
|
660 |
-
<?php if ( isset( $video['link'] ) ) echo apply_filters( 'the_content', $video['link'][0] ); ?>
|
661 |
-
</div>
|
662 |
-
</th>
|
663 |
-
<td>
|
664 |
-
<b><?php if ( isset( $video['post_title'] ) ) echo $video['post_title'][0]; ?></b>
|
665 |
-
<p><?php if ( isset( $video['post_content'] ) ) echo $video['post_content'][0]; ?></p>
|
666 |
-
|
667 |
-
<div class="row-actions">
|
668 |
-
<span class="inline">
|
669 |
-
<a href="#" id="edit_<?php echo $this->_category_name; ?>_<?php echo $meta_id; ?>">
|
670 |
-
Edit</a> |
|
671 |
-
</span>
|
672 |
-
<span class="trash">
|
673 |
-
<a class="submitdelete"
|
674 |
-
onclick="return showNotice.warn();"
|
675 |
-
href="<?php echo site_url( "wp-admin/post.php?post={$post->ID}"
|
676 |
-
."&action=edit"
|
677 |
-
."&redrokkdelete=$meta_id"
|
678 |
-
); ?>">
|
679 |
-
Delete Permanently</a>
|
680 |
-
</span>
|
681 |
-
</div>
|
682 |
-
<script>
|
683 |
-
jQuery('#edit_<?php echo $this->_category_name; ?>_<?php echo $meta_id; ?>').click(function(){
|
684 |
-
var data = {
|
685 |
-
<?php
|
686 |
-
$data = array();
|
687 |
-
|
688 |
-
//making sure all fields will be cleared
|
689 |
-
foreach ( (array)$this->_fields as $field ) {
|
690 |
-
if ( !isset( $field['id'] ) || !isset( $field['type'] ) ) continue;
|
691 |
-
if ( !in_array( $field['type'], array( 'text', 'file', 'image', 'textarea', 'hidden' ) ) )
|
692 |
-
continue;
|
693 |
-
|
694 |
-
$id = str_replace( $this->_id.'_', '', $field['id'] );
|
695 |
-
$data[$id] = "'$id':''";
|
696 |
-
}
|
697 |
-
|
698 |
-
//adding our values to the array
|
699 |
-
foreach ( (array)$video as $vp => $vv ) {
|
700 |
-
if ( isset( $vv[0] ) ) $vv = $vv[0];
|
701 |
-
$data[$vp] = "'$vp':'$vv'";
|
702 |
-
}
|
703 |
-
|
704 |
-
//adding the meta ID to the array
|
705 |
-
$data[$id] = "'metaid':'$meta_id'";
|
706 |
-
|
707 |
-
echo implode( ',', $data );
|
708 |
-
?>
|
709 |
-
};
|
710 |
-
|
711 |
-
jQuery.each(data, function(key, value){
|
712 |
-
jQuery('#<?php echo $this->_id; ?>_'+key).val( value );
|
713 |
-
});
|
714 |
-
return false;
|
715 |
-
});
|
716 |
-
</script>
|
717 |
-
</td>
|
718 |
-
<?php do_action( 'redrokk_metabox_class::_renderListAttachments::rows', $video, $meta_id, $this ); ?>
|
719 |
-
</tr>
|
720 |
-
<?php endforeach; ?>
|
721 |
-
</tbody>
|
722 |
-
</table>
|
723 |
-
<?php
|
724 |
-
}
|
725 |
-
|
726 |
-
}
|
727 |
-
|
728 |
-
|
729 |
-
/**
|
730 |
-
* Method displays a list of attached videos
|
731 |
-
*
|
732 |
-
*/
|
733 |
-
function _renderListVideoAttachments() {
|
734 |
-
global $post;
|
735 |
-
|
736 |
-
//pull new listings
|
737 |
-
$videos = get_children( "post_parent=$post->ID&post_type=attachment&post_mime_type=video/mp4" );
|
738 |
-
|
739 |
-
// no images to render
|
740 |
-
if ( !empty( $videos ) ) {
|
741 |
-
?>
|
742 |
-
<table class="wp-list-table form-table widefat" style="border:none;">
|
743 |
-
<tbody id="the-list">
|
744 |
-
<?php foreach ( (array)$videos as $post_id => $video ): ?>
|
745 |
-
<?php $image_attributes = wp_get_attachment_link( $video->ID ); ?>
|
746 |
-
<tr>
|
747 |
-
<th scope="row" style="width: 140px">
|
748 |
-
<div style="padding:10px;background:whiteSmoke;">
|
749 |
-
<?php echo $image_attributes; ?>
|
750 |
-
</div>
|
751 |
-
</th>
|
752 |
-
<td>
|
753 |
-
<b><?php echo $video->post_title; ?></b>
|
754 |
-
<p><?php echo get_the_content( $video->ID ); ?></p>
|
755 |
-
|
756 |
-
<div class="row-actions">
|
757 |
-
<span class="inline">
|
758 |
-
<a href="<?php echo wp_nonce_url(
|
759 |
-
"media.php?attachment_id=$meta_id"
|
760 |
-
."&action=edit&_redirect="
|
761 |
-
.urlencode( $this->_currentPageURL() )
|
762 |
-
); ?>">
|
763 |
-
Edit</a> |
|
764 |
-
</span>
|
765 |
-
<span class="trash">
|
766 |
-
<a class="submitdelete"
|
767 |
-
onclick="return showNotice.warn();"
|
768 |
-
href="<?php echo wp_nonce_url(
|
769 |
-
"post.php?action=delete&_redirect="
|
770 |
-
.urlencode( $this->_currentPageURL() )
|
771 |
-
."&post=$video->ID",
|
772 |
-
'delete-attachment_' . $video->ID ); ?>">
|
773 |
-
Delete Permanently</a>
|
774 |
-
</span>
|
775 |
-
</div>
|
776 |
-
</td>
|
777 |
-
</tr>
|
778 |
-
<?php endforeach; ?>
|
779 |
-
</tbody>
|
780 |
-
</table>
|
781 |
-
<?php
|
782 |
-
}
|
783 |
-
}
|
784 |
-
|
785 |
-
|
786 |
-
/**
|
787 |
-
* Method renders the form from any source
|
788 |
-
*
|
789 |
-
* @param array $fields
|
790 |
-
*/
|
791 |
-
function _renderForm( $fields = array() ) {
|
792 |
-
//initializing
|
793 |
-
global $post;
|
794 |
-
$defaults = array(
|
795 |
-
'name' => '',
|
796 |
-
'desc' => '',
|
797 |
-
'id' => '',
|
798 |
-
'type' => 'text',
|
799 |
-
'options' => array(),
|
800 |
-
'std' => '',
|
801 |
-
'value' => '',
|
802 |
-
'class' => '',
|
803 |
-
'multiple' => '',
|
804 |
-
'args' => array(
|
805 |
-
'hide_empty' => 0,
|
806 |
-
'name' => 'element_name',
|
807 |
-
'hierarchical' => true
|
808 |
-
),
|
809 |
-
'attributes' => ''
|
810 |
-
);
|
811 |
-
|
812 |
-
// no fields to render
|
813 |
-
if ( empty( $fields ) ) {
|
814 |
-
?>
|
815 |
-
<p>No form fields have been defined. Use <pre>
|
816 |
-
$metabox->set('_fields', array(
|
817 |
-
array(
|
818 |
-
'name' => 'Title',
|
819 |
-
'type' => 'title',
|
820 |
-
),
|
821 |
-
array(
|
822 |
-
'name' => 'Title',
|
823 |
-
'desc' => '',
|
824 |
-
'id' => 'title',
|
825 |
-
'type' => 'text',
|
826 |
-
'std' => ''
|
827 |
-
),
|
828 |
-
array(
|
829 |
-
'name' => 'image',
|
830 |
-
'desc' => '',
|
831 |
-
'id' => 'imagefile',
|
832 |
-
'type' => 'image',
|
833 |
-
'std' => ''
|
834 |
-
),
|
835 |
-
array(
|
836 |
-
'name' => 'Textarea',
|
837 |
-
'desc' => 'Enter big text here',
|
838 |
-
'id' => 'textarea_id',
|
839 |
-
'type' => 'textarea',
|
840 |
-
'std' => 'Default value 2'
|
841 |
-
),
|
842 |
-
array(
|
843 |
-
'name' => 'Select box',
|
844 |
-
'id' => 'select_id',
|
845 |
-
'type' => 'select',
|
846 |
-
'options'=> array(
|
847 |
-
'value1' => 'Value 1',
|
848 |
-
'value2' => 'Value 2',
|
849 |
-
'value3' => 'Value 3',
|
850 |
-
'value4' => 'Value 4',
|
851 |
-
)
|
852 |
-
),
|
853 |
-
array(
|
854 |
-
'name' => 'Radio',
|
855 |
-
'id' => 'radio_id',
|
856 |
-
'type' => 'radio',
|
857 |
-
'value' => 'test',
|
858 |
-
'desc' => 'Check this box if you want its value saved',
|
859 |
-
),
|
860 |
-
array(
|
861 |
-
'name' => '',
|
862 |
-
'id' => 'radio_id',
|
863 |
-
'type' => 'radio',
|
864 |
-
'value' => 'test2',
|
865 |
-
'desc' => 'Check this box if you want its value saved',
|
866 |
-
),
|
867 |
-
array(
|
868 |
-
'name' => 'Checkbox',
|
869 |
-
'id' => 'checkbox_id',
|
870 |
-
'type' => 'checkbox',
|
871 |
-
'desc' => 'Check this box if you want its value saved',
|
872 |
-
),
|
873 |
-
));</pre>
|
874 |
-
</p>
|
875 |
-
<?php
|
876 |
-
|
877 |
-
// rendering the fields
|
878 |
-
} else {
|
879 |
-
?>
|
880 |
-
<table class="form-table">
|
881 |
-
<?php
|
882 |
-
// do_action("{$this->_class}_before");
|
883 |
-
$custom = get_post_custom( $this->_id );
|
884 |
-
|
885 |
-
foreach ( (array)$fields as $field ):
|
886 |
-
$field = wp_parse_args( $field, $defaults );
|
887 |
-
$field['args'] = wp_parse_args( $field['args'], $defaults['args'] );
|
888 |
-
|
889 |
-
extract( $field );
|
890 |
-
$field['args']['name'] = $element_name = $id;
|
891 |
-
|
892 |
-
// grabbing the meta value
|
893 |
-
if ( array_key_exists( $id, $custom ) ) {
|
894 |
-
if ( isset( $custom[$id][0] ) )
|
895 |
-
$meta = esc_attr( $custom[$id][0] );
|
896 |
-
else
|
897 |
-
$meta = esc_attr( $custom[$id] );
|
898 |
-
} else {
|
899 |
-
$meta = $std;
|
900 |
-
}
|
901 |
-
|
902 |
-
$id = sanitize_title( $id );
|
903 |
-
|
904 |
-
if ( array_key_exists( 'deleteattachment', $_GET )
|
905 |
-
&& $id == $_GET['fileproperty']
|
906 |
-
&& $meta == $_GET['deleteattachment'] ) {
|
907 |
-
wp_delete_attachment( $_GET['deleteattachment'], $force_delete = true );
|
908 |
-
update_post_meta( $post->ID, $id, '' );
|
909 |
-
}
|
910 |
-
?>
|
911 |
-
<?php switch ( $type ) { default: ?>
|
912 |
-
<?php if ( is_callable( $type ) && function_exists( $type ) ) : ?>
|
913 |
-
<?php if ( ! isset( $custom[ $id ] ) ) $custom[ $id ] = null; ?>
|
914 |
-
<tr>
|
915 |
-
<th scope="row" style="width: 140px">
|
916 |
-
<label for="<?php echo $id; ?>"><?php echo $name; ?></label>
|
917 |
-
</th>
|
918 |
-
<td>
|
919 |
-
<?php call_user_func( $type, $args, $field, $custom[ $id ] ); ?>
|
920 |
-
<span class="description"><?php echo $desc; ?></span>
|
921 |
-
</td>
|
922 |
-
</tr>
|
923 |
-
<?php break; endif; ?>
|
924 |
-
<?php case 'text': ?>
|
925 |
-
<tr>
|
926 |
-
<th scope="row" style="width: 140px">
|
927 |
-
<label for="<?php echo $id; ?>"><?php echo $name; ?></label>
|
928 |
-
</th>
|
929 |
-
<td>
|
930 |
-
<input <?php echo $attributes ?>
|
931 |
-
id="<?php echo $id; ?>"
|
932 |
-
value="<?php echo $meta; ?>"
|
933 |
-
type="<?php echo $type; ?>"
|
934 |
-
name="<?php echo $id; ?>"
|
935 |
-
class="text large-text <?php echo $class; ?>" />
|
936 |
-
<span class="description"><?php echo $desc; ?></span>
|
937 |
-
</td>
|
938 |
-
</tr>
|
939 |
-
<?php break; ?>
|
940 |
-
<?php case 'submit': ?>
|
941 |
-
<?php case 'button': ?>
|
942 |
-
<tr>
|
943 |
-
<td colspan="2">
|
944 |
-
<input <?php echo $attributes ?>
|
945 |
-
id="<?php echo $id; ?>"
|
946 |
-
value="<?php echo $name; ?>"
|
947 |
-
type="submit"
|
948 |
-
name="submit"
|
949 |
-
class="button-primary <?php echo $class; ?>" />
|
950 |
-
<span class="description"><?php echo $desc; ?></span>
|
951 |
-
</td>
|
952 |
-
</tr>
|
953 |
-
<?php break; ?>
|
954 |
-
<?php case 'file': ?>
|
955 |
-
<?php case 'image': ?>
|
956 |
-
<tr>
|
957 |
-
<th scope="row" style="width: 140px">
|
958 |
-
<label for="<?php echo $id; ?>"><?php echo $name; ?></label>
|
959 |
-
</th>
|
960 |
-
<td>
|
961 |
-
<?php if ( $meta && wp_get_attachment_url( $meta ) ): ?>
|
962 |
-
<?php echo wp_get_attachment_image( $meta ); ?>
|
963 |
-
<span><a href="<?php echo add_query_arg( 'fileproperty', $id, add_query_arg( 'deleteattachment', $meta, $this->_currentPageURL() ) ); ?>">Delete Image</a></span>
|
964 |
-
<?php else: ?>
|
965 |
-
<input type="hidden" name="<?php echo $this->_id; ?>files" value="<?php echo $id; ?>" />
|
966 |
-
<!-- first hidden input forces this item to be submitted when it is not checked -->
|
967 |
-
<input <?php echo $attributes ?>
|
968 |
-
id="<?php echo $id; ?>"
|
969 |
-
type="file"
|
970 |
-
name="<?php echo $id; ?>"
|
971 |
-
onChange="jQuery(this).closest('form').attr('enctype', 'multipart/form-data');"
|
972 |
-
class="<?php echo $class; ?>" />
|
973 |
-
<?php endif; ?>
|
974 |
-
<span class="description"><?php echo $desc; ?></span>
|
975 |
-
</td>
|
976 |
-
</tr>
|
977 |
-
<?php break; ?>
|
978 |
-
<?php case 'title': ?>
|
979 |
-
<tr>
|
980 |
-
<th colspan="2" scope="row">
|
981 |
-
<h3 <?php echo $attributes ?> style="border: 1px solid #ddd;
|
982 |
-
padding: 10px;
|
983 |
-
background: #eee;
|
984 |
-
border-radius: 2px;
|
985 |
-
color: #666;
|
986 |
-
margin: 0;"><?php echo $name; ?>
|
987 |
-
</h3>
|
988 |
-
</th>
|
989 |
-
</tr>
|
990 |
-
<?php break; ?>
|
991 |
-
<?php case 'checkbox': ?>
|
992 |
-
<tr>
|
993 |
-
<th scope="row" style="width: 140px">
|
994 |
-
<label for="<?php echo $id; ?>"><?php echo $name; ?></label>
|
995 |
-
</th>
|
996 |
-
<td>
|
997 |
-
<input type="hidden" name="<?php echo $id; ?>" value="" />
|
998 |
-
<!-- first hidden input forces this item to be submitted when it is not checked -->
|
999 |
-
|
1000 |
-
<?php foreach ( (array)$options as $_value => $_name ): ?>
|
1001 |
-
<input value="<?php echo $_value; ?>" type="checkbox" <?php echo $attributes ?>
|
1002 |
-
name="<?php echo $element_name; ?>" id="<?php echo $id; ?>"
|
1003 |
-
<?php echo $meta == $_value? 'checked="checked"' :''; ?>
|
1004 |
-
class="<?php echo $class; ?>" />
|
1005 |
-
<?php echo $_name; ?>
|
1006 |
-
<?php endforeach; ?>
|
1007 |
-
<span class="description"><?php echo $desc; ?></span>
|
1008 |
-
</td>
|
1009 |
-
</tr>
|
1010 |
-
<?php break; ?>
|
1011 |
-
<?php case 'radio': ?>
|
1012 |
-
<tr>
|
1013 |
-
<th scope="row" style="width: 140px">
|
1014 |
-
<label for="<?php echo $id; ?>"><?php echo $name; ?></label>
|
1015 |
-
</th>
|
1016 |
-
<td>
|
1017 |
-
<?php foreach ( (array)$options as $_value => $_name ): ?>
|
1018 |
-
<input name="<?php echo $element_name; ?>" id="<?php echo $id; ?>"
|
1019 |
-
value="<?php echo $_value; ?>" type="<?php echo $type; ?>"
|
1020 |
-
<?php echo $meta == $_value?'checked="checked"' :''; ?>
|
1021 |
-
<?php echo $attributes ?> class="<?php echo $class; ?>" />
|
1022 |
-
<?php echo $_name; ?>
|
1023 |
-
<?php endforeach; ?>
|
1024 |
-
<span class="description"><?php echo $desc; ?></span>
|
1025 |
-
</td>
|
1026 |
-
</tr>
|
1027 |
-
<?php break; ?>
|
1028 |
-
<?php case 'textarea': ?>
|
1029 |
-
<tr>
|
1030 |
-
<th scope="row" style="width: 140px">
|
1031 |
-
<label for="<?php echo $id; ?>"><?php echo $name; ?></label>
|
1032 |
-
</th>
|
1033 |
-
<td>
|
1034 |
-
<textarea <?php echo $attributes ?>
|
1035 |
-
id="<?php echo $id; ?>"
|
1036 |
-
name="<?php echo $id; ?>"
|
1037 |
-
class="large-text <?php echo $class; ?>"
|
1038 |
-
><?php echo $meta; ?></textarea>
|
1039 |
-
<span class="description"><?php echo $desc; ?></span>
|
1040 |
-
</td>
|
1041 |
-
</tr>
|
1042 |
-
<?php break; ?>
|
1043 |
-
<?php case 'wpeditor': ?>
|
1044 |
-
<tr>
|
1045 |
-
<th scope="row" style="width: 140px">
|
1046 |
-
<label for="<?php echo $id; ?>"><?php echo $name; ?></label>
|
1047 |
-
</th>
|
1048 |
-
<td>
|
1049 |
-
<?php wp_editor( $meta, $id, $settings = array() ); ?>
|
1050 |
-
<span class="description"><?php echo $desc; ?></span>
|
1051 |
-
</td>
|
1052 |
-
</tr>
|
1053 |
-
<?php break; ?>
|
1054 |
-
<?php case 'select_capabilities': ?>
|
1055 |
-
<?php $options = $type=='select_capabilities' ?$this->get_options_capabilities()+$options :$options; ?>
|
1056 |
-
|
1057 |
-
<?php case 'select_roles': ?>
|
1058 |
-
<?php $options = $type=='select_roles' ?$this->get_options_roles()+$options :$options; ?>
|
1059 |
-
|
1060 |
-
<?php case 'select_menu': ?>
|
1061 |
-
<?php $options = $type=='select_menu' ?$this->get_options_menus()+$options :$options; ?>
|
1062 |
-
|
1063 |
-
<?php case 'select_pages': ?>
|
1064 |
-
<?php $options = $type=='select_pages' ?$this->get_options_pages()+$options :$options; ?>
|
1065 |
-
|
1066 |
-
<?php case 'select_users': ?>
|
1067 |
-
<?php $options = $type=='select_users' ?$this->get_options_users()+$options :$options; ?>
|
1068 |
-
|
1069 |
-
<?php case 'select_categories': ?>
|
1070 |
-
<?php case 'select': ?>
|
1071 |
-
<tr>
|
1072 |
-
<th scope="row" style="width: 140px">
|
1073 |
-
<label for="<?php echo $id; ?>"><?php echo $name; ?></label>
|
1074 |
-
</th>
|
1075 |
-
<td>
|
1076 |
-
<?php if ( $type == 'select_categories' ): ?>
|
1077 |
-
<?php wp_dropdown_categories( $args ); ?>
|
1078 |
-
|
1079 |
-
<?php else: ?>
|
1080 |
-
|
1081 |
-
<select <?php echo $attributes ?>
|
1082 |
-
id="<?php echo $id; ?>"
|
1083 |
-
name="<?php echo $id; ?>"
|
1084 |
-
class="<?php echo $class; ?>"
|
1085 |
-
<?php echo $multiple ?"MULTIPLE SIZE='$multiple'" :''; ?>
|
1086 |
-
><?php foreach ( (array)$options as $_value => $_name ): ?>
|
1087 |
-
|
1088 |
-
<option
|
1089 |
-
value="<?php echo $_value; ?>"
|
1090 |
-
<?php echo $meta == $_value ?' selected="selected"' :''; ?>
|
1091 |
-
><?php echo $_name; ?></option>
|
1092 |
-
|
1093 |
-
<?php endforeach; ?></select>
|
1094 |
-
<?php endif; ?>
|
1095 |
-
<span class="description"><?php echo $desc; ?></span>
|
1096 |
-
</td>
|
1097 |
-
</tr>
|
1098 |
-
<?php break; ?>
|
1099 |
-
<?php case 'hidden': ?>
|
1100 |
-
<tr>
|
1101 |
-
<td colspan="2">
|
1102 |
-
<input <?php echo $attributes ?>
|
1103 |
-
id="<?php echo $id; ?>"
|
1104 |
-
value="<?php echo $meta ?$meta :$std; ?>"
|
1105 |
-
type="<?php echo $type; ?>"
|
1106 |
-
name="<?php echo $id; ?>"
|
1107 |
-
style="visibility:hidden;" />
|
1108 |
-
</td>
|
1109 |
-
</tr>
|
1110 |
-
<?php break; ?>
|
1111 |
-
<?php case 'custom': ?>
|
1112 |
-
<tr>
|
1113 |
-
<td colspan="2">
|
1114 |
-
<?php echo $desc.$std; ?>
|
1115 |
-
</td>
|
1116 |
-
</tr>
|
1117 |
-
<?php case 'date': ?>
|
1118 |
-
<tr>
|
1119 |
-
<th scope="row" style="width: 140px">
|
1120 |
-
<label for="<?php echo $id; ?>"><?php echo $name; ?></label>
|
1121 |
-
</th>
|
1122 |
-
<td>
|
1123 |
-
<?php echo mysql2date( get_option( 'date_format' ), $meta ); ?>
|
1124 |
-
<span class="description"><?php echo $desc; ?></span>
|
1125 |
-
</td>
|
1126 |
-
</tr>
|
1127 |
-
<?php break; ?>
|
1128 |
-
<?php case 'time': ?>
|
1129 |
-
<tr>
|
1130 |
-
<th scope="row" style="width: 140px">
|
1131 |
-
<label for="<?php echo $id; ?>"><?php echo $name; ?></label>
|
1132 |
-
</th>
|
1133 |
-
<td>
|
1134 |
-
<?php echo mysql2date( get_option( 'time_format' ), $meta ); ?>
|
1135 |
-
<span class="description"><?php echo $desc; ?></span>
|
1136 |
-
</td>
|
1137 |
-
</tr>
|
1138 |
-
<?php break; ?>
|
1139 |
-
<?php case 'datetime': ?>
|
1140 |
-
<tr>
|
1141 |
-
<th scope="row" style="width: 140px">
|
1142 |
-
<label for="<?php echo $id; ?>"><?php echo $name; ?></label>
|
1143 |
-
</th>
|
1144 |
-
<td>
|
1145 |
-
<?php echo mysql2date( get_option( 'date_format' ), $meta ); ?>
|
1146 |
-
<?php echo mysql2date( get_option( 'time_format' ), $meta ); ?>
|
1147 |
-
<span class="description"><?php echo $desc; ?></span>
|
1148 |
-
</td>
|
1149 |
-
</tr>
|
1150 |
-
<?php break; ?>
|
1151 |
-
<?php } ?>
|
1152 |
-
<?php endforeach; ?>
|
1153 |
-
</table>
|
1154 |
-
<?php
|
1155 |
-
}
|
1156 |
-
return $this;
|
1157 |
-
}
|
1158 |
-
|
1159 |
-
|
1160 |
-
/**
|
1161 |
-
* Returns an options list of menus
|
1162 |
-
*/
|
1163 |
-
function get_options_pages() {
|
1164 |
-
// initializing
|
1165 |
-
$options = array( '0'=>' -- ' );
|
1166 |
-
$pages = get_pages( array( 'post_type' => 'page', 'post_status' => 'publish' ) );
|
1167 |
-
|
1168 |
-
foreach ( $pages as $page ) {
|
1169 |
-
$options[$page->ID] = $page->post_title;
|
1170 |
-
}
|
1171 |
-
|
1172 |
-
return $options;
|
1173 |
-
}
|
1174 |
-
|
1175 |
-
|
1176 |
-
/**
|
1177 |
-
* Returns an options list of menus
|
1178 |
-
*/
|
1179 |
-
function get_options_menus() {
|
1180 |
-
// initializing
|
1181 |
-
$options = array( '0'=>' -- ' );
|
1182 |
-
$menus = get_terms( 'nav_menu', array(
|
1183 |
-
'hide_empty' => 0
|
1184 |
-
) );
|
1185 |
-
|
1186 |
-
foreach ( $menus as $menu ) {
|
1187 |
-
$options[$menu->slug] = $menu->name;
|
1188 |
-
}
|
1189 |
-
|
1190 |
-
return $options;
|
1191 |
-
}
|
1192 |
-
|
1193 |
-
|
1194 |
-
/**
|
1195 |
-
* Returns an options list of users
|
1196 |
-
*/
|
1197 |
-
function get_options_users() {
|
1198 |
-
// initializing
|
1199 |
-
global $wpdb;
|
1200 |
-
|
1201 |
-
$options = array( '0'=>' -- ' );
|
1202 |
-
$query = $wpdb->prepare( "SELECT $wpdb->users.ID, $wpdb->users.display_name FROM $wpdb->users", null );
|
1203 |
-
$results = $wpdb->get_results( $query );
|
1204 |
-
|
1205 |
-
foreach ( (array)$results as $result ) {
|
1206 |
-
$options[$result->ID] = $result->display_name;
|
1207 |
-
}
|
1208 |
-
|
1209 |
-
return $options;
|
1210 |
-
}
|
1211 |
-
|
1212 |
-
|
1213 |
-
/**
|
1214 |
-
* Returns an options list of capabilities
|
1215 |
-
*/
|
1216 |
-
function get_options_capabilities() {
|
1217 |
-
// initializing
|
1218 |
-
global $wpdb;
|
1219 |
-
|
1220 |
-
$options = array();
|
1221 |
-
$roles = get_option( $wpdb->prefix . 'user_roles' );
|
1222 |
-
|
1223 |
-
foreach ( (array)$roles as $role ) {
|
1224 |
-
if ( !isset( $role['capabilities'] ) ) continue;
|
1225 |
-
foreach ( (array)$role['capabilities'] as $cap => $v ) {
|
1226 |
-
$options[$role['name']."::$cap"] = $role['name']."::$cap";
|
1227 |
-
}
|
1228 |
-
}
|
1229 |
-
|
1230 |
-
return $options;
|
1231 |
-
}
|
1232 |
-
|
1233 |
-
|
1234 |
-
/**
|
1235 |
-
* Returns an options list of roles
|
1236 |
-
*/
|
1237 |
-
function get_options_roles() {
|
1238 |
-
// initializing
|
1239 |
-
global $wpdb;
|
1240 |
-
|
1241 |
-
$options = array(
|
1242 |
-
'read' => 'Public'
|
1243 |
-
);
|
1244 |
-
$roles = get_option( $wpdb->prefix . 'user_roles' );
|
1245 |
-
|
1246 |
-
foreach ( (array)$roles as $role ) {
|
1247 |
-
$options[strtolower( $role['name'] )] = $role['name'];
|
1248 |
-
}
|
1249 |
-
|
1250 |
-
return $options;
|
1251 |
-
}
|
1252 |
-
|
1253 |
-
|
1254 |
-
/**
|
1255 |
-
* Adds a box to the main column on the Post and Page edit screens
|
1256 |
-
*
|
1257 |
-
*/
|
1258 |
-
function _register() {
|
1259 |
-
// this metabox is to be displayed for a certain object type only
|
1260 |
-
if ( !empty( $this->_object_types ) && !in_array( $this->getCurrentPostType(), $this->_object_types ) )
|
1261 |
-
return;
|
1262 |
-
|
1263 |
-
if ( !$this->callback_args ) {
|
1264 |
-
$this->callback_args = $this;
|
1265 |
-
}
|
1266 |
-
|
1267 |
-
// if the user has not already set the type of this metabox,
|
1268 |
-
// then we need to do that now
|
1269 |
-
if ( !$this->_type ) {
|
1270 |
-
$this->setType();
|
1271 |
-
}
|
1272 |
-
|
1273 |
-
add_meta_box(
|
1274 |
-
$this->_id,
|
1275 |
-
$this->title,
|
1276 |
-
$this->callback,
|
1277 |
-
$this->getCurrentPostType(),
|
1278 |
-
$this->context,
|
1279 |
-
$this->priority,
|
1280 |
-
$this->callback_args
|
1281 |
-
);
|
1282 |
-
}
|
1283 |
-
|
1284 |
-
|
1285 |
-
/**
|
1286 |
-
* Method set's the hooks for the options creted by this metabox
|
1287 |
-
*
|
1288 |
-
*/
|
1289 |
-
function setOptionHooks() {
|
1290 |
-
foreach ( (array)$this->_fields as $field ) {
|
1291 |
-
if ( !isset( $field['id'] ) ) continue;
|
1292 |
-
|
1293 |
-
//creating the callback for the admin page
|
1294 |
-
$function = create_function( '$default', '
|
1295 |
-
return redrokk_admin_class::getInstance("'.$this->_isAdminPage.'")
|
1296 |
-
->getOption("'.$field['id'].'", $default, true);
|
1297 |
-
' );
|
1298 |
-
add_filter( "pre_option_{$field['id']}", $function, 20, 2 );
|
1299 |
-
}
|
1300 |
-
}
|
1301 |
-
|
1302 |
-
|
1303 |
-
/**
|
1304 |
-
* Method redirects the user if we have added a request redirect
|
1305 |
-
* in the url
|
1306 |
-
*
|
1307 |
-
* @param string $location
|
1308 |
-
*/
|
1309 |
-
function _redirectIntervention( $location ) {
|
1310 |
-
if ( isset( $_GET['_redirect'] ) ) {
|
1311 |
-
$location = urldecode( $_GET['_redirect'] );
|
1312 |
-
}
|
1313 |
-
return $location;
|
1314 |
-
}
|
1315 |
-
|
1316 |
-
|
1317 |
-
/**
|
1318 |
-
* Get the current page url
|
1319 |
-
*/
|
1320 |
-
function _currentPageURL() {
|
1321 |
-
$pageURL = 'http';
|
1322 |
-
if ( isset( $_SERVER["HTTPS"] ) && $_SERVER["HTTPS"] == "on" ) {$pageURL .= "s";}
|
1323 |
-
$pageURL .= "://";
|
1324 |
-
if ( $_SERVER["SERVER_PORT"] != "80" ) {
|
1325 |
-
$pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
|
1326 |
-
} else {
|
1327 |
-
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
|
1328 |
-
}
|
1329 |
-
return $pageURL;
|
1330 |
-
}
|
1331 |
-
|
1332 |
-
|
1333 |
-
/**
|
1334 |
-
* Method to bind an associative array or object to the JTable instance.This
|
1335 |
-
* method only binds properties that are publicly accessible and optionally
|
1336 |
-
* takes an array of properties to ignore when binding.
|
1337 |
-
*
|
1338 |
-
* @param mixed $src An associative array or object to bind to the JTable instance.
|
1339 |
-
* @param mixed $ignore An optional array or space separated list of properties to ignore while binding.
|
1340 |
-
*
|
1341 |
-
* @return boolean True on success.
|
1342 |
-
*
|
1343 |
-
* @link http://docs.joomla.org/JTable/bind
|
1344 |
-
* @since 11.1
|
1345 |
-
*/
|
1346 |
-
public function bind( $src, $ignore = array() ) {
|
1347 |
-
// If the source value is not an array or object return false.
|
1348 |
-
if ( !is_object( $src ) && !is_array( $src ) ) {
|
1349 |
-
trigger_error( 'Bind failed as the provided source is not an array.' );
|
1350 |
-
return false;
|
1351 |
-
}
|
1352 |
-
|
1353 |
-
// If the source value is an object, get its accessible properties.
|
1354 |
-
if ( is_object( $src ) ) {
|
1355 |
-
$src = get_object_vars( $src );
|
1356 |
-
}
|
1357 |
-
|
1358 |
-
// If the ignore value is a string, explode it over spaces.
|
1359 |
-
if ( !is_array( $ignore ) ) {
|
1360 |
-
$ignore = explode( ' ', $ignore );
|
1361 |
-
}
|
1362 |
-
|
1363 |
-
// Bind the source value, excluding the ignored fields.
|
1364 |
-
foreach ( $this->getProperties() as $k => $v ) {
|
1365 |
-
// Only process fields not in the ignore array.
|
1366 |
-
if ( !in_array( $k, $ignore ) ) {
|
1367 |
-
if ( isset( $src[$k] ) ) {
|
1368 |
-
$this->$k = $src[$k];
|
1369 |
-
}
|
1370 |
-
}
|
1371 |
-
}
|
1372 |
-
|
1373 |
-
return true;
|
1374 |
-
}
|
1375 |
-
|
1376 |
-
|
1377 |
-
/**
|
1378 |
-
* Set the object properties based on a named array/hash.
|
1379 |
-
*
|
1380 |
-
* @param mixed $properties Either an associative array or another object.
|
1381 |
-
*
|
1382 |
-
* @return boolean
|
1383 |
-
*
|
1384 |
-
* @since 11.1
|
1385 |
-
*
|
1386 |
-
* @see set()
|
1387 |
-
*/
|
1388 |
-
public function setProperties( $properties ) {
|
1389 |
-
if ( is_array( $properties ) || is_object( $properties ) ) {
|
1390 |
-
foreach ( (array) $properties as $k => $v ) {
|
1391 |
-
// Use the set function which might be overridden.
|
1392 |
-
$this->set( $k, $v );
|
1393 |
-
}
|
1394 |
-
return true;
|
1395 |
-
}
|
1396 |
-
|
1397 |
-
return false;
|
1398 |
-
}
|
1399 |
-
|
1400 |
-
|
1401 |
-
/**
|
1402 |
-
* Modifies a property of the object, creating it if it does not already exist.
|
1403 |
-
*
|
1404 |
-
* @param string $property The name of the property.
|
1405 |
-
* @param mixed $value The value of the property to set.
|
1406 |
-
*
|
1407 |
-
* @return mixed Previous value of the property.
|
1408 |
-
*
|
1409 |
-
* @since 11.1
|
1410 |
-
*/
|
1411 |
-
public function set( $property, $value = null ) {
|
1412 |
-
$_property = 'set'.str_replace( ' ', '', ucwords( str_replace( '_', ' ', $property ) ) );
|
1413 |
-
if ( method_exists( $this, $_property ) ) {
|
1414 |
-
return $this->$_property( $value );
|
1415 |
-
}
|
1416 |
-
|
1417 |
-
$previous = isset( $this->$property ) ? $this->$property : null;
|
1418 |
-
$this->$property = $value;
|
1419 |
-
return $previous;
|
1420 |
-
}
|
1421 |
-
|
1422 |
-
|
1423 |
-
/**
|
1424 |
-
* Returns an associative array of object properties.
|
1425 |
-
*
|
1426 |
-
* @param boolean $public If true, returns only the public properties.
|
1427 |
-
*
|
1428 |
-
* @return array
|
1429 |
-
*
|
1430 |
-
* @see get()
|
1431 |
-
*/
|
1432 |
-
public function getProperties( $public = true ) {
|
1433 |
-
$vars = get_object_vars( $this );
|
1434 |
-
if ( $public ) {
|
1435 |
-
foreach ( $vars as $key => $value ) {
|
1436 |
-
if ( '_' == substr( $key, 0, 1 ) ) {
|
1437 |
-
unset( $vars[$key] );
|
1438 |
-
}
|
1439 |
-
}
|
1440 |
-
}
|
1441 |
-
|
1442 |
-
return $vars;
|
1443 |
-
}
|
1444 |
-
|
1445 |
-
|
1446 |
-
/**
|
1447 |
-
* contains the current instance of this class
|
1448 |
-
*
|
1449 |
-
* @var object
|
1450 |
-
*/
|
1451 |
-
static $_instances = null;
|
1452 |
-
|
1453 |
-
/**
|
1454 |
-
* Method is called when we need to instantiate this class
|
1455 |
-
*
|
1456 |
-
* @param array $options
|
1457 |
-
*/
|
1458 |
-
public static function getInstance( $_id, $options = array() ) {
|
1459 |
-
if ( !isset( self::$_instances[$_id] ) ) {
|
1460 |
-
$options['_id'] = $_id;
|
1461 |
-
$class = get_class();
|
1462 |
-
self::$_instances[$_id] = new $class( $options );
|
1463 |
-
}
|
1464 |
-
return self::$_instances[$_id];
|
1465 |
-
}
|
1466 |
-
|
1467 |
-
|
1468 |
-
}
|
1469 |
-
|
1470 |
-
|
1471 |
-
endif;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/LICENSE.txt
DELETED
@@ -1,20 +0,0 @@
|
|
1 |
-
The MIT License (MIT)
|
2 |
-
|
3 |
-
Copyright (c) 2013 Emanuil Rusev, erusev.com
|
4 |
-
|
5 |
-
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
6 |
-
this software and associated documentation files (the "Software"), to deal in
|
7 |
-
the Software without restriction, including without limitation the rights to
|
8 |
-
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
9 |
-
the Software, and to permit persons to whom the Software is furnished to do so,
|
10 |
-
subject to the following conditions:
|
11 |
-
|
12 |
-
The above copyright notice and this permission notice shall be included in all
|
13 |
-
copies or substantial portions of the Software.
|
14 |
-
|
15 |
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16 |
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
17 |
-
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
18 |
-
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
19 |
-
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
20 |
-
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/Parsedown.php
DELETED
@@ -1,1528 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
#
|
4 |
-
#
|
5 |
-
# Parsedown
|
6 |
-
# http://parsedown.org
|
7 |
-
#
|
8 |
-
# (c) Emanuil Rusev
|
9 |
-
# http://erusev.com
|
10 |
-
#
|
11 |
-
# For the full license information, view the LICENSE file that was distributed
|
12 |
-
# with this source code.
|
13 |
-
#
|
14 |
-
#
|
15 |
-
|
16 |
-
class Parsedown
|
17 |
-
{
|
18 |
-
# ~
|
19 |
-
|
20 |
-
const version = '1.5.4';
|
21 |
-
|
22 |
-
# ~
|
23 |
-
|
24 |
-
function text($text)
|
25 |
-
{
|
26 |
-
# make sure no definitions are set
|
27 |
-
$this->DefinitionData = array();
|
28 |
-
|
29 |
-
# standardize line breaks
|
30 |
-
$text = str_replace(array("\r\n", "\r"), "\n", $text);
|
31 |
-
|
32 |
-
# remove surrounding line breaks
|
33 |
-
$text = trim($text, "\n");
|
34 |
-
|
35 |
-
# split text into lines
|
36 |
-
$lines = explode("\n", $text);
|
37 |
-
|
38 |
-
# iterate through lines to identify blocks
|
39 |
-
$markup = $this->lines($lines);
|
40 |
-
|
41 |
-
# trim line breaks
|
42 |
-
$markup = trim($markup, "\n");
|
43 |
-
|
44 |
-
return $markup;
|
45 |
-
}
|
46 |
-
|
47 |
-
#
|
48 |
-
# Setters
|
49 |
-
#
|
50 |
-
|
51 |
-
function setBreaksEnabled($breaksEnabled)
|
52 |
-
{
|
53 |
-
$this->breaksEnabled = $breaksEnabled;
|
54 |
-
|
55 |
-
return $this;
|
56 |
-
}
|
57 |
-
|
58 |
-
protected $breaksEnabled;
|
59 |
-
|
60 |
-
function setMarkupEscaped($markupEscaped)
|
61 |
-
{
|
62 |
-
$this->markupEscaped = $markupEscaped;
|
63 |
-
|
64 |
-
return $this;
|
65 |
-
}
|
66 |
-
|
67 |
-
protected $markupEscaped;
|
68 |
-
|
69 |
-
function setUrlsLinked($urlsLinked)
|
70 |
-
{
|
71 |
-
$this->urlsLinked = $urlsLinked;
|
72 |
-
|
73 |
-
return $this;
|
74 |
-
}
|
75 |
-
|
76 |
-
protected $urlsLinked = true;
|
77 |
-
|
78 |
-
#
|
79 |
-
# Lines
|
80 |
-
#
|
81 |
-
|
82 |
-
protected $BlockTypes = array(
|
83 |
-
'#' => array('Header'),
|
84 |
-
'*' => array('Rule', 'List'),
|
85 |
-
'+' => array('List'),
|
86 |
-
'-' => array('SetextHeader', 'Table', 'Rule', 'List'),
|
87 |
-
'0' => array('List'),
|
88 |
-
'1' => array('List'),
|
89 |
-
'2' => array('List'),
|
90 |
-
'3' => array('List'),
|
91 |
-
'4' => array('List'),
|
92 |
-
'5' => array('List'),
|
93 |
-
'6' => array('List'),
|
94 |
-
'7' => array('List'),
|
95 |
-
'8' => array('List'),
|
96 |
-
'9' => array('List'),
|
97 |
-
':' => array('Table'),
|
98 |
-
'<' => array('Comment', 'Markup'),
|
99 |
-
'=' => array('SetextHeader'),
|
100 |
-
'>' => array('Quote'),
|
101 |
-
'[' => array('Reference'),
|
102 |
-
'_' => array('Rule'),
|
103 |
-
'`' => array('FencedCode'),
|
104 |
-
'|' => array('Table'),
|
105 |
-
'~' => array('FencedCode'),
|
106 |
-
);
|
107 |
-
|
108 |
-
# ~
|
109 |
-
|
110 |
-
protected $unmarkedBlockTypes = array(
|
111 |
-
'Code',
|
112 |
-
);
|
113 |
-
|
114 |
-
#
|
115 |
-
# Blocks
|
116 |
-
#
|
117 |
-
|
118 |
-
private function lines(array $lines)
|
119 |
-
{
|
120 |
-
$CurrentBlock = null;
|
121 |
-
|
122 |
-
foreach ($lines as $line)
|
123 |
-
{
|
124 |
-
if (chop($line) === '')
|
125 |
-
{
|
126 |
-
if (isset($CurrentBlock))
|
127 |
-
{
|
128 |
-
$CurrentBlock['interrupted'] = true;
|
129 |
-
}
|
130 |
-
|
131 |
-
continue;
|
132 |
-
}
|
133 |
-
|
134 |
-
if (strpos($line, "\t") !== false)
|
135 |
-
{
|
136 |
-
$parts = explode("\t", $line);
|
137 |
-
|
138 |
-
$line = $parts[0];
|
139 |
-
|
140 |
-
unset($parts[0]);
|
141 |
-
|
142 |
-
foreach ($parts as $part)
|
143 |
-
{
|
144 |
-
$shortage = 4 - mb_strlen($line, 'utf-8') % 4;
|
145 |
-
|
146 |
-
$line .= str_repeat(' ', $shortage);
|
147 |
-
$line .= $part;
|
148 |
-
}
|
149 |
-
}
|
150 |
-
|
151 |
-
$indent = 0;
|
152 |
-
|
153 |
-
while (isset($line[$indent]) and $line[$indent] === ' ')
|
154 |
-
{
|
155 |
-
$indent ++;
|
156 |
-
}
|
157 |
-
|
158 |
-
$text = $indent > 0 ? substr($line, $indent) : $line;
|
159 |
-
|
160 |
-
# ~
|
161 |
-
|
162 |
-
$Line = array('body' => $line, 'indent' => $indent, 'text' => $text);
|
163 |
-
|
164 |
-
# ~
|
165 |
-
|
166 |
-
if (isset($CurrentBlock['continuable']))
|
167 |
-
{
|
168 |
-
$Block = $this->{'block'.$CurrentBlock['type'].'Continue'}($Line, $CurrentBlock);
|
169 |
-
|
170 |
-
if (isset($Block))
|
171 |
-
{
|
172 |
-
$CurrentBlock = $Block;
|
173 |
-
|
174 |
-
continue;
|
175 |
-
}
|
176 |
-
else
|
177 |
-
{
|
178 |
-
if (method_exists($this, 'block'.$CurrentBlock['type'].'Complete'))
|
179 |
-
{
|
180 |
-
$CurrentBlock = $this->{'block'.$CurrentBlock['type'].'Complete'}($CurrentBlock);
|
181 |
-
}
|
182 |
-
}
|
183 |
-
}
|
184 |
-
|
185 |
-
# ~
|
186 |
-
|
187 |
-
$marker = $text[0];
|
188 |
-
|
189 |
-
# ~
|
190 |
-
|
191 |
-
$blockTypes = $this->unmarkedBlockTypes;
|
192 |
-
|
193 |
-
if (isset($this->BlockTypes[$marker]))
|
194 |
-
{
|
195 |
-
foreach ($this->BlockTypes[$marker] as $blockType)
|
196 |
-
{
|
197 |
-
$blockTypes []= $blockType;
|
198 |
-
}
|
199 |
-
}
|
200 |
-
|
201 |
-
#
|
202 |
-
# ~
|
203 |
-
|
204 |
-
foreach ($blockTypes as $blockType)
|
205 |
-
{
|
206 |
-
$Block = $this->{'block'.$blockType}($Line, $CurrentBlock);
|
207 |
-
|
208 |
-
if (isset($Block))
|
209 |
-
{
|
210 |
-
$Block['type'] = $blockType;
|
211 |
-
|
212 |
-
if ( ! isset($Block['identified']))
|
213 |
-
{
|
214 |
-
$Blocks []= $CurrentBlock;
|
215 |
-
|
216 |
-
$Block['identified'] = true;
|
217 |
-
}
|
218 |
-
|
219 |
-
if (method_exists($this, 'block'.$blockType.'Continue'))
|
220 |
-
{
|
221 |
-
$Block['continuable'] = true;
|
222 |
-
}
|
223 |
-
|
224 |
-
$CurrentBlock = $Block;
|
225 |
-
|
226 |
-
continue 2;
|
227 |
-
}
|
228 |
-
}
|
229 |
-
|
230 |
-
# ~
|
231 |
-
|
232 |
-
if (isset($CurrentBlock) and ! isset($CurrentBlock['type']) and ! isset($CurrentBlock['interrupted']))
|
233 |
-
{
|
234 |
-
$CurrentBlock['element']['text'] .= "\n".$text;
|
235 |
-
}
|
236 |
-
else
|
237 |
-
{
|
238 |
-
$Blocks []= $CurrentBlock;
|
239 |
-
|
240 |
-
$CurrentBlock = $this->paragraph($Line);
|
241 |
-
|
242 |
-
$CurrentBlock['identified'] = true;
|
243 |
-
}
|
244 |
-
}
|
245 |
-
|
246 |
-
# ~
|
247 |
-
|
248 |
-
if (isset($CurrentBlock['continuable']) and method_exists($this, 'block'.$CurrentBlock['type'].'Complete'))
|
249 |
-
{
|
250 |
-
$CurrentBlock = $this->{'block'.$CurrentBlock['type'].'Complete'}($CurrentBlock);
|
251 |
-
}
|
252 |
-
|
253 |
-
# ~
|
254 |
-
|
255 |
-
$Blocks []= $CurrentBlock;
|
256 |
-
|
257 |
-
unset($Blocks[0]);
|
258 |
-
|
259 |
-
# ~
|
260 |
-
|
261 |
-
$markup = '';
|
262 |
-
|
263 |
-
foreach ($Blocks as $Block)
|
264 |
-
{
|
265 |
-
if (isset($Block['hidden']))
|
266 |
-
{
|
267 |
-
continue;
|
268 |
-
}
|
269 |
-
|
270 |
-
$markup .= "\n";
|
271 |
-
$markup .= isset($Block['markup']) ? $Block['markup'] : $this->element($Block['element']);
|
272 |
-
}
|
273 |
-
|
274 |
-
$markup .= "\n";
|
275 |
-
|
276 |
-
# ~
|
277 |
-
|
278 |
-
return $markup;
|
279 |
-
}
|
280 |
-
|
281 |
-
#
|
282 |
-
# Code
|
283 |
-
|
284 |
-
protected function blockCode($Line, $Block = null)
|
285 |
-
{
|
286 |
-
if (isset($Block) and ! isset($Block['type']) and ! isset($Block['interrupted']))
|
287 |
-
{
|
288 |
-
return;
|
289 |
-
}
|
290 |
-
|
291 |
-
if ($Line['indent'] >= 4)
|
292 |
-
{
|
293 |
-
$text = substr($Line['body'], 4);
|
294 |
-
|
295 |
-
$Block = array(
|
296 |
-
'element' => array(
|
297 |
-
'name' => 'pre',
|
298 |
-
'handler' => 'element',
|
299 |
-
'text' => array(
|
300 |
-
'name' => 'code',
|
301 |
-
'text' => $text,
|
302 |
-
),
|
303 |
-
),
|
304 |
-
);
|
305 |
-
|
306 |
-
return $Block;
|
307 |
-
}
|
308 |
-
}
|
309 |
-
|
310 |
-
protected function blockCodeContinue($Line, $Block)
|
311 |
-
{
|
312 |
-
if ($Line['indent'] >= 4)
|
313 |
-
{
|
314 |
-
if (isset($Block['interrupted']))
|
315 |
-
{
|
316 |
-
$Block['element']['text']['text'] .= "\n";
|
317 |
-
|
318 |
-
unset($Block['interrupted']);
|
319 |
-
}
|
320 |
-
|
321 |
-
$Block['element']['text']['text'] .= "\n";
|
322 |
-
|
323 |
-
$text = substr($Line['body'], 4);
|
324 |
-
|
325 |
-
$Block['element']['text']['text'] .= $text;
|
326 |
-
|
327 |
-
return $Block;
|
328 |
-
}
|
329 |
-
}
|
330 |
-
|
331 |
-
protected function blockCodeComplete($Block)
|
332 |
-
{
|
333 |
-
$text = $Block['element']['text']['text'];
|
334 |
-
|
335 |
-
$text = htmlspecialchars($text, ENT_NOQUOTES, 'UTF-8');
|
336 |
-
|
337 |
-
$Block['element']['text']['text'] = $text;
|
338 |
-
|
339 |
-
return $Block;
|
340 |
-
}
|
341 |
-
|
342 |
-
#
|
343 |
-
# Comment
|
344 |
-
|
345 |
-
protected function blockComment($Line)
|
346 |
-
{
|
347 |
-
if ($this->markupEscaped)
|
348 |
-
{
|
349 |
-
return;
|
350 |
-
}
|
351 |
-
|
352 |
-
if (isset($Line['text'][3]) and $Line['text'][3] === '-' and $Line['text'][2] === '-' and $Line['text'][1] === '!')
|
353 |
-
{
|
354 |
-
$Block = array(
|
355 |
-
'markup' => $Line['body'],
|
356 |
-
);
|
357 |
-
|
358 |
-
if (preg_match('/-->$/', $Line['text']))
|
359 |
-
{
|
360 |
-
$Block['closed'] = true;
|
361 |
-
}
|
362 |
-
|
363 |
-
return $Block;
|
364 |
-
}
|
365 |
-
}
|
366 |
-
|
367 |
-
protected function blockCommentContinue($Line, array $Block)
|
368 |
-
{
|
369 |
-
if (isset($Block['closed']))
|
370 |
-
{
|
371 |
-
return;
|
372 |
-
}
|
373 |
-
|
374 |
-
$Block['markup'] .= "\n" . $Line['body'];
|
375 |
-
|
376 |
-
if (preg_match('/-->$/', $Line['text']))
|
377 |
-
{
|
378 |
-
$Block['closed'] = true;
|
379 |
-
}
|
380 |
-
|
381 |
-
return $Block;
|
382 |
-
}
|
383 |
-
|
384 |
-
#
|
385 |
-
# Fenced Code
|
386 |
-
|
387 |
-
protected function blockFencedCode($Line)
|
388 |
-
{
|
389 |
-
if (preg_match('/^['.$Line['text'][0].']{3,}[ ]*([\w-]+)?[ ]*$/', $Line['text'], $matches))
|
390 |
-
{
|
391 |
-
$Element = array(
|
392 |
-
'name' => 'code',
|
393 |
-
'text' => '',
|
394 |
-
);
|
395 |
-
|
396 |
-
if (isset($matches[1]))
|
397 |
-
{
|
398 |
-
$class = 'language-'.$matches[1];
|
399 |
-
|
400 |
-
$Element['attributes'] = array(
|
401 |
-
'class' => $class,
|
402 |
-
);
|
403 |
-
}
|
404 |
-
|
405 |
-
$Block = array(
|
406 |
-
'char' => $Line['text'][0],
|
407 |
-
'element' => array(
|
408 |
-
'name' => 'pre',
|
409 |
-
'handler' => 'element',
|
410 |
-
'text' => $Element,
|
411 |
-
),
|
412 |
-
);
|
413 |
-
|
414 |
-
return $Block;
|
415 |
-
}
|
416 |
-
}
|
417 |
-
|
418 |
-
protected function blockFencedCodeContinue($Line, $Block)
|
419 |
-
{
|
420 |
-
if (isset($Block['complete']))
|
421 |
-
{
|
422 |
-
return;
|
423 |
-
}
|
424 |
-
|
425 |
-
if (isset($Block['interrupted']))
|
426 |
-
{
|
427 |
-
$Block['element']['text']['text'] .= "\n";
|
428 |
-
|
429 |
-
unset($Block['interrupted']);
|
430 |
-
}
|
431 |
-
|
432 |
-
if (preg_match('/^'.$Block['char'].'{3,}[ ]*$/', $Line['text']))
|
433 |
-
{
|
434 |
-
$Block['element']['text']['text'] = substr($Block['element']['text']['text'], 1);
|
435 |
-
|
436 |
-
$Block['complete'] = true;
|
437 |
-
|
438 |
-
return $Block;
|
439 |
-
}
|
440 |
-
|
441 |
-
$Block['element']['text']['text'] .= "\n".$Line['body'];;
|
442 |
-
|
443 |
-
return $Block;
|
444 |
-
}
|
445 |
-
|
446 |
-
protected function blockFencedCodeComplete($Block)
|
447 |
-
{
|
448 |
-
$text = $Block['element']['text']['text'];
|
449 |
-
|
450 |
-
$text = htmlspecialchars($text, ENT_NOQUOTES, 'UTF-8');
|
451 |
-
|
452 |
-
$Block['element']['text']['text'] = $text;
|
453 |
-
|
454 |
-
return $Block;
|
455 |
-
}
|
456 |
-
|
457 |
-
#
|
458 |
-
# Header
|
459 |
-
|
460 |
-
protected function blockHeader($Line)
|
461 |
-
{
|
462 |
-
if (isset($Line['text'][1]))
|
463 |
-
{
|
464 |
-
$level = 1;
|
465 |
-
|
466 |
-
while (isset($Line['text'][$level]) and $Line['text'][$level] === '#')
|
467 |
-
{
|
468 |
-
$level ++;
|
469 |
-
}
|
470 |
-
|
471 |
-
if ($level > 6)
|
472 |
-
{
|
473 |
-
return;
|
474 |
-
}
|
475 |
-
|
476 |
-
$text = trim($Line['text'], '# ');
|
477 |
-
|
478 |
-
$Block = array(
|
479 |
-
'element' => array(
|
480 |
-
'name' => 'h' . min(6, $level),
|
481 |
-
'text' => $text,
|
482 |
-
'handler' => 'line',
|
483 |
-
),
|
484 |
-
);
|
485 |
-
|
486 |
-
return $Block;
|
487 |
-
}
|
488 |
-
}
|
489 |
-
|
490 |
-
#
|
491 |
-
# List
|
492 |
-
|
493 |
-
protected function blockList($Line)
|
494 |
-
{
|
495 |
-
list($name, $pattern) = $Line['text'][0] <= '-' ? array('ul', '[*+-]') : array('ol', '[0-9]+[.]');
|
496 |
-
|
497 |
-
if (preg_match('/^('.$pattern.'[ ]+)(.*)/', $Line['text'], $matches))
|
498 |
-
{
|
499 |
-
$Block = array(
|
500 |
-
'indent' => $Line['indent'],
|
501 |
-
'pattern' => $pattern,
|
502 |
-
'element' => array(
|
503 |
-
'name' => $name,
|
504 |
-
'handler' => 'elements',
|
505 |
-
),
|
506 |
-
);
|
507 |
-
|
508 |
-
$Block['li'] = array(
|
509 |
-
'name' => 'li',
|
510 |
-
'handler' => 'li',
|
511 |
-
'text' => array(
|
512 |
-
$matches[2],
|
513 |
-
),
|
514 |
-
);
|
515 |
-
|
516 |
-
$Block['element']['text'] []= & $Block['li'];
|
517 |
-
|
518 |
-
return $Block;
|
519 |
-
}
|
520 |
-
}
|
521 |
-
|
522 |
-
protected function blockListContinue($Line, array $Block)
|
523 |
-
{
|
524 |
-
if ($Block['indent'] === $Line['indent'] and preg_match('/^'.$Block['pattern'].'(?:[ ]+(.*)|$)/', $Line['text'], $matches))
|
525 |
-
{
|
526 |
-
if (isset($Block['interrupted']))
|
527 |
-
{
|
528 |
-
$Block['li']['text'] []= '';
|
529 |
-
|
530 |
-
unset($Block['interrupted']);
|
531 |
-
}
|
532 |
-
|
533 |
-
unset($Block['li']);
|
534 |
-
|
535 |
-
$text = isset($matches[1]) ? $matches[1] : '';
|
536 |
-
|
537 |
-
$Block['li'] = array(
|
538 |
-
'name' => 'li',
|
539 |
-
'handler' => 'li',
|
540 |
-
'text' => array(
|
541 |
-
$text,
|
542 |
-
),
|
543 |
-
);
|
544 |
-
|
545 |
-
$Block['element']['text'] []= & $Block['li'];
|
546 |
-
|
547 |
-
return $Block;
|
548 |
-
}
|
549 |
-
|
550 |
-
if ($Line['text'][0] === '[' and $this->blockReference($Line))
|
551 |
-
{
|
552 |
-
return $Block;
|
553 |
-
}
|
554 |
-
|
555 |
-
if ( ! isset($Block['interrupted']))
|
556 |
-
{
|
557 |
-
$text = preg_replace('/^[ ]{0,4}/', '', $Line['body']);
|
558 |
-
|
559 |
-
$Block['li']['text'] []= $text;
|
560 |
-
|
561 |
-
return $Block;
|
562 |
-
}
|
563 |
-
|
564 |
-
if ($Line['indent'] > 0)
|
565 |
-
{
|
566 |
-
$Block['li']['text'] []= '';
|
567 |
-
|
568 |
-
$text = preg_replace('/^[ ]{0,4}/', '', $Line['body']);
|
569 |
-
|
570 |
-
$Block['li']['text'] []= $text;
|
571 |
-
|
572 |
-
unset($Block['interrupted']);
|
573 |
-
|
574 |
-
return $Block;
|
575 |
-
}
|
576 |
-
}
|
577 |
-
|
578 |
-
#
|
579 |
-
# Quote
|
580 |
-
|
581 |
-
protected function blockQuote($Line)
|
582 |
-
{
|
583 |
-
if (preg_match('/^>[ ]?(.*)/', $Line['text'], $matches))
|
584 |
-
{
|
585 |
-
$Block = array(
|
586 |
-
'element' => array(
|
587 |
-
'name' => 'blockquote',
|
588 |
-
'handler' => 'lines',
|
589 |
-
'text' => (array) $matches[1],
|
590 |
-
),
|
591 |
-
);
|
592 |
-
|
593 |
-
return $Block;
|
594 |
-
}
|
595 |
-
}
|
596 |
-
|
597 |
-
protected function blockQuoteContinue($Line, array $Block)
|
598 |
-
{
|
599 |
-
if ($Line['text'][0] === '>' and preg_match('/^>[ ]?(.*)/', $Line['text'], $matches))
|
600 |
-
{
|
601 |
-
if (isset($Block['interrupted']))
|
602 |
-
{
|
603 |
-
$Block['element']['text'] []= '';
|
604 |
-
|
605 |
-
unset($Block['interrupted']);
|
606 |
-
}
|
607 |
-
|
608 |
-
$Block['element']['text'] []= $matches[1];
|
609 |
-
|
610 |
-
return $Block;
|
611 |
-
}
|
612 |
-
|
613 |
-
if ( ! isset($Block['interrupted']))
|
614 |
-
{
|
615 |
-
$Block['element']['text'] []= $Line['text'];
|
616 |
-
|
617 |
-
return $Block;
|
618 |
-
}
|
619 |
-
}
|
620 |
-
|
621 |
-
#
|
622 |
-
# Rule
|
623 |
-
|
624 |
-
protected function blockRule($Line)
|
625 |
-
{
|
626 |
-
if (preg_match('/^(['.$Line['text'][0].'])([ ]*\1){2,}[ ]*$/', $Line['text']))
|
627 |
-
{
|
628 |
-
$Block = array(
|
629 |
-
'element' => array(
|
630 |
-
'name' => 'hr'
|
631 |
-
),
|
632 |
-
);
|
633 |
-
|
634 |
-
return $Block;
|
635 |
-
}
|
636 |
-
}
|
637 |
-
|
638 |
-
#
|
639 |
-
# Setext
|
640 |
-
|
641 |
-
protected function blockSetextHeader($Line, array $Block = null)
|
642 |
-
{
|
643 |
-
if ( ! isset($Block) or isset($Block['type']) or isset($Block['interrupted']))
|
644 |
-
{
|
645 |
-
return;
|
646 |
-
}
|
647 |
-
|
648 |
-
if (chop($Line['text'], $Line['text'][0]) === '')
|
649 |
-
{
|
650 |
-
$Block['element']['name'] = $Line['text'][0] === '=' ? 'h1' : 'h2';
|
651 |
-
|
652 |
-
return $Block;
|
653 |
-
}
|
654 |
-
}
|
655 |
-
|
656 |
-
#
|
657 |
-
# Markup
|
658 |
-
|
659 |
-
protected function blockMarkup($Line)
|
660 |
-
{
|
661 |
-
if ($this->markupEscaped)
|
662 |
-
{
|
663 |
-
return;
|
664 |
-
}
|
665 |
-
|
666 |
-
if (preg_match('/^<(\w*)(?:[ ]*'.$this->regexHtmlAttribute.')*[ ]*(\/)?>/', $Line['text'], $matches))
|
667 |
-
{
|
668 |
-
$element = strtolower($matches[1]);
|
669 |
-
|
670 |
-
if (in_array($element, $this->textLevelElements))
|
671 |
-
{
|
672 |
-
return;
|
673 |
-
}
|
674 |
-
|
675 |
-
$Block = array(
|
676 |
-
'name' => $matches[1],
|
677 |
-
'depth' => 0,
|
678 |
-
'markup' => $Line['text'],
|
679 |
-
);
|
680 |
-
|
681 |
-
$length = strlen($matches[0]);
|
682 |
-
|
683 |
-
$remainder = substr($Line['text'], $length);
|
684 |
-
|
685 |
-
if (trim($remainder) === '')
|
686 |
-
{
|
687 |
-
if (isset($matches[2]) or in_array($matches[1], $this->voidElements))
|
688 |
-
{
|
689 |
-
$Block['closed'] = true;
|
690 |
-
|
691 |
-
$Block['void'] = true;
|
692 |
-
}
|
693 |
-
}
|
694 |
-
else
|
695 |
-
{
|
696 |
-
if (isset($matches[2]) or in_array($matches[1], $this->voidElements))
|
697 |
-
{
|
698 |
-
return;
|
699 |
-
}
|
700 |
-
|
701 |
-
if (preg_match('/<\/'.$matches[1].'>[ ]*$/i', $remainder))
|
702 |
-
{
|
703 |
-
$Block['closed'] = true;
|
704 |
-
}
|
705 |
-
}
|
706 |
-
|
707 |
-
return $Block;
|
708 |
-
}
|
709 |
-
}
|
710 |
-
|
711 |
-
protected function blockMarkupContinue($Line, array $Block)
|
712 |
-
{
|
713 |
-
if (isset($Block['closed']))
|
714 |
-
{
|
715 |
-
return;
|
716 |
-
}
|
717 |
-
|
718 |
-
if (preg_match('/^<'.$Block['name'].'(?:[ ]*'.$this->regexHtmlAttribute.')*[ ]*>/i', $Line['text'])) # open
|
719 |
-
{
|
720 |
-
$Block['depth'] ++;
|
721 |
-
}
|
722 |
-
|
723 |
-
if (preg_match('/(.*?)<\/'.$Block['name'].'>[ ]*$/i', $Line['text'], $matches)) # close
|
724 |
-
{
|
725 |
-
if ($Block['depth'] > 0)
|
726 |
-
{
|
727 |
-
$Block['depth'] --;
|
728 |
-
}
|
729 |
-
else
|
730 |
-
{
|
731 |
-
$Block['closed'] = true;
|
732 |
-
}
|
733 |
-
}
|
734 |
-
|
735 |
-
if (isset($Block['interrupted']))
|
736 |
-
{
|
737 |
-
$Block['markup'] .= "\n";
|
738 |
-
|
739 |
-
unset($Block['interrupted']);
|
740 |
-
}
|
741 |
-
|
742 |
-
$Block['markup'] .= "\n".$Line['body'];
|
743 |
-
|
744 |
-
return $Block;
|
745 |
-
}
|
746 |
-
|
747 |
-
#
|
748 |
-
# Reference
|
749 |
-
|
750 |
-
protected function blockReference($Line)
|
751 |
-
{
|
752 |
-
if (preg_match('/^\[(.+?)\]:[ ]*<?(\S+?)>?(?:[ ]+["\'(](.+)["\')])?[ ]*$/', $Line['text'], $matches))
|
753 |
-
{
|
754 |
-
$id = strtolower($matches[1]);
|
755 |
-
|
756 |
-
$Data = array(
|
757 |
-
'url' => $matches[2],
|
758 |
-
'title' => null,
|
759 |
-
);
|
760 |
-
|
761 |
-
if (isset($matches[3]))
|
762 |
-
{
|
763 |
-
$Data['title'] = $matches[3];
|
764 |
-
}
|
765 |
-
|
766 |
-
$this->DefinitionData['Reference'][$id] = $Data;
|
767 |
-
|
768 |
-
$Block = array(
|
769 |
-
'hidden' => true,
|
770 |
-
);
|
771 |
-
|
772 |
-
return $Block;
|
773 |
-
}
|
774 |
-
}
|
775 |
-
|
776 |
-
#
|
777 |
-
# Table
|
778 |
-
|
779 |
-
protected function blockTable($Line, array $Block = null)
|
780 |
-
{
|
781 |
-
if ( ! isset($Block) or isset($Block['type']) or isset($Block['interrupted']))
|
782 |
-
{
|
783 |
-
return;
|
784 |
-
}
|
785 |
-
|
786 |
-
if (strpos($Block['element']['text'], '|') !== false and chop($Line['text'], ' -:|') === '')
|
787 |
-
{
|
788 |
-
$alignments = array();
|
789 |
-
|
790 |
-
$divider = $Line['text'];
|
791 |
-
|
792 |
-
$divider = trim($divider);
|
793 |
-
$divider = trim($divider, '|');
|
794 |
-
|
795 |
-
$dividerCells = explode('|', $divider);
|
796 |
-
|
797 |
-
foreach ($dividerCells as $dividerCell)
|
798 |
-
{
|
799 |
-
$dividerCell = trim($dividerCell);
|
800 |
-
|
801 |
-
if ($dividerCell === '')
|
802 |
-
{
|
803 |
-
continue;
|
804 |
-
}
|
805 |
-
|
806 |
-
$alignment = null;
|
807 |
-
|
808 |
-
if ($dividerCell[0] === ':')
|
809 |
-
{
|
810 |
-
$alignment = 'left';
|
811 |
-
}
|
812 |
-
|
813 |
-
if (substr($dividerCell, - 1) === ':')
|
814 |
-
{
|
815 |
-
$alignment = $alignment === 'left' ? 'center' : 'right';
|
816 |
-
}
|
817 |
-
|
818 |
-
$alignments []= $alignment;
|
819 |
-
}
|
820 |
-
|
821 |
-
# ~
|
822 |
-
|
823 |
-
$HeaderElements = array();
|
824 |
-
|
825 |
-
$header = $Block['element']['text'];
|
826 |
-
|
827 |
-
$header = trim($header);
|
828 |
-
$header = trim($header, '|');
|
829 |
-
|
830 |
-
$headerCells = explode('|', $header);
|
831 |
-
|
832 |
-
foreach ($headerCells as $index => $headerCell)
|
833 |
-
{
|
834 |
-
$headerCell = trim($headerCell);
|
835 |
-
|
836 |
-
$HeaderElement = array(
|
837 |
-
'name' => 'th',
|
838 |
-
'text' => $headerCell,
|
839 |
-
'handler' => 'line',
|
840 |
-
);
|
841 |
-
|
842 |
-
if (isset($alignments[$index]))
|
843 |
-
{
|
844 |
-
$alignment = $alignments[$index];
|
845 |
-
|
846 |
-
$HeaderElement['attributes'] = array(
|
847 |
-
'style' => 'text-align: '.$alignment.';',
|
848 |
-
);
|
849 |
-
}
|
850 |
-
|
851 |
-
$HeaderElements []= $HeaderElement;
|
852 |
-
}
|
853 |
-
|
854 |
-
# ~
|
855 |
-
|
856 |
-
$Block = array(
|
857 |
-
'alignments' => $alignments,
|
858 |
-
'identified' => true,
|
859 |
-
'element' => array(
|
860 |
-
'name' => 'table',
|
861 |
-
'handler' => 'elements',
|
862 |
-
),
|
863 |
-
);
|
864 |
-
|
865 |
-
$Block['element']['text'] []= array(
|
866 |
-
'name' => 'thead',
|
867 |
-
'handler' => 'elements',
|
868 |
-
);
|
869 |
-
|
870 |
-
$Block['element']['text'] []= array(
|
871 |
-
'name' => 'tbody',
|
872 |
-
'handler' => 'elements',
|
873 |
-
'text' => array(),
|
874 |
-
);
|
875 |
-
|
876 |
-
$Block['element']['text'][0]['text'] []= array(
|
877 |
-
'name' => 'tr',
|
878 |
-
'handler' => 'elements',
|
879 |
-
'text' => $HeaderElements,
|
880 |
-
);
|
881 |
-
|
882 |
-
return $Block;
|
883 |
-
}
|
884 |
-
}
|
885 |
-
|
886 |
-
protected function blockTableContinue($Line, array $Block)
|
887 |
-
{
|
888 |
-
if (isset($Block['interrupted']))
|
889 |
-
{
|
890 |
-
return;
|
891 |
-
}
|
892 |
-
|
893 |
-
if ($Line['text'][0] === '|' or strpos($Line['text'], '|'))
|
894 |
-
{
|
895 |
-
$Elements = array();
|
896 |
-
|
897 |
-
$row = $Line['text'];
|
898 |
-
|
899 |
-
$row = trim($row);
|
900 |
-
$row = trim($row, '|');
|
901 |
-
|
902 |
-
preg_match_all('/(?:(\\\\[|])|[^|`]|`[^`]+`|`)+/', $row, $matches);
|
903 |
-
|
904 |
-
foreach ($matches[0] as $index => $cell)
|
905 |
-
{
|
906 |
-
$cell = trim($cell);
|
907 |
-
|
908 |
-
$Element = array(
|
909 |
-
'name' => 'td',
|
910 |
-
'handler' => 'line',
|
911 |
-
'text' => $cell,
|
912 |
-
);
|
913 |
-
|
914 |
-
if (isset($Block['alignments'][$index]))
|
915 |
-
{
|
916 |
-
$Element['attributes'] = array(
|
917 |
-
'style' => 'text-align: '.$Block['alignments'][$index].';',
|
918 |
-
);
|
919 |
-
}
|
920 |
-
|
921 |
-
$Elements []= $Element;
|
922 |
-
}
|
923 |
-
|
924 |
-
$Element = array(
|
925 |
-
'name' => 'tr',
|
926 |
-
'handler' => 'elements',
|
927 |
-
'text' => $Elements,
|
928 |
-
);
|
929 |
-
|
930 |
-
$Block['element']['text'][1]['text'] []= $Element;
|
931 |
-
|
932 |
-
return $Block;
|
933 |
-
}
|
934 |
-
}
|
935 |
-
|
936 |
-
#
|
937 |
-
# ~
|
938 |
-
#
|
939 |
-
|
940 |
-
protected function paragraph($Line)
|
941 |
-
{
|
942 |
-
$Block = array(
|
943 |
-
'element' => array(
|
944 |
-
'name' => 'p',
|
945 |
-
'text' => $Line['text'],
|
946 |
-
'handler' => 'line',
|
947 |
-
),
|
948 |
-
);
|
949 |
-
|
950 |
-
return $Block;
|
951 |
-
}
|
952 |
-
|
953 |
-
#
|
954 |
-
# Inline Elements
|
955 |
-
#
|
956 |
-
|
957 |
-
protected $InlineTypes = array(
|
958 |
-
'"' => array('SpecialCharacter'),
|
959 |
-
'!' => array('Image'),
|
960 |
-
'&' => array('SpecialCharacter'),
|
961 |
-
'*' => array('Emphasis'),
|
962 |
-
':' => array('Url'),
|
963 |
-
'<' => array('UrlTag', 'EmailTag', 'Markup', 'SpecialCharacter'),
|
964 |
-
'>' => array('SpecialCharacter'),
|
965 |
-
'[' => array('Link'),
|
966 |
-
'_' => array('Emphasis'),
|
967 |
-
'`' => array('Code'),
|
968 |
-
'~' => array('Strikethrough'),
|
969 |
-
'\\' => array('EscapeSequence'),
|
970 |
-
);
|
971 |
-
|
972 |
-
# ~
|
973 |
-
|
974 |
-
protected $inlineMarkerList = '!"*_&[:<>`~\\';
|
975 |
-
|
976 |
-
#
|
977 |
-
# ~
|
978 |
-
#
|
979 |
-
|
980 |
-
public function line($text)
|
981 |
-
{
|
982 |
-
$markup = '';
|
983 |
-
|
984 |
-
# $excerpt is based on the first occurrence of a marker
|
985 |
-
|
986 |
-
while ($excerpt = strpbrk($text, $this->inlineMarkerList))
|
987 |
-
{
|
988 |
-
$marker = $excerpt[0];
|
989 |
-
|
990 |
-
$markerPosition = strpos($text, $marker);
|
991 |
-
|
992 |
-
$Excerpt = array('text' => $excerpt, 'context' => $text);
|
993 |
-
|
994 |
-
foreach ($this->InlineTypes[$marker] as $inlineType)
|
995 |
-
{
|
996 |
-
$Inline = $this->{'inline'.$inlineType}($Excerpt);
|
997 |
-
|
998 |
-
if ( ! isset($Inline))
|
999 |
-
{
|
1000 |
-
continue;
|
1001 |
-
}
|
1002 |
-
|
1003 |
-
# makes sure that the inline belongs to "our" marker
|
1004 |
-
|
1005 |
-
if (isset($Inline['position']) and $Inline['position'] > $markerPosition)
|
1006 |
-
{
|
1007 |
-
continue;
|
1008 |
-
}
|
1009 |
-
|
1010 |
-
# sets a default inline position
|
1011 |
-
|
1012 |
-
if ( ! isset($Inline['position']))
|
1013 |
-
{
|
1014 |
-
$Inline['position'] = $markerPosition;
|
1015 |
-
}
|
1016 |
-
|
1017 |
-
# the text that comes before the inline
|
1018 |
-
$unmarkedText = substr($text, 0, $Inline['position']);
|
1019 |
-
|
1020 |
-
# compile the unmarked text
|
1021 |
-
$markup .= $this->unmarkedText($unmarkedText);
|
1022 |
-
|
1023 |
-
# compile the inline
|
1024 |
-
$markup .= isset($Inline['markup']) ? $Inline['markup'] : $this->element($Inline['element']);
|
1025 |
-
|
1026 |
-
# remove the examined text
|
1027 |
-
$text = substr($text, $Inline['position'] + $Inline['extent']);
|
1028 |
-
|
1029 |
-
continue 2;
|
1030 |
-
}
|
1031 |
-
|
1032 |
-
# the marker does not belong to an inline
|
1033 |
-
|
1034 |
-
$unmarkedText = substr($text, 0, $markerPosition + 1);
|
1035 |
-
|
1036 |
-
$markup .= $this->unmarkedText($unmarkedText);
|
1037 |
-
|
1038 |
-
$text = substr($text, $markerPosition + 1);
|
1039 |
-
}
|
1040 |
-
|
1041 |
-
$markup .= $this->unmarkedText($text);
|
1042 |
-
|
1043 |
-
return $markup;
|
1044 |
-
}
|
1045 |
-
|
1046 |
-
#
|
1047 |
-
# ~
|
1048 |
-
#
|
1049 |
-
|
1050 |
-
protected function inlineCode($Excerpt)
|
1051 |
-
{
|
1052 |
-
$marker = $Excerpt['text'][0];
|
1053 |
-
|
1054 |
-
if (preg_match('/^('.$marker.'+)[ ]*(.+?)[ ]*(?<!'.$marker.')\1(?!'.$marker.')/s', $Excerpt['text'], $matches))
|
1055 |
-
{
|
1056 |
-
$text = $matches[2];
|
1057 |
-
$text = htmlspecialchars($text, ENT_NOQUOTES, 'UTF-8');
|
1058 |
-
$text = preg_replace("/[ ]*\n/", ' ', $text);
|
1059 |
-
|
1060 |
-
return array(
|
1061 |
-
'extent' => strlen($matches[0]),
|
1062 |
-
'element' => array(
|
1063 |
-
'name' => 'code',
|
1064 |
-
'text' => $text,
|
1065 |
-
),
|
1066 |
-
);
|
1067 |
-
}
|
1068 |
-
}
|
1069 |
-
|
1070 |
-
protected function inlineEmailTag($Excerpt)
|
1071 |
-
{
|
1072 |
-
if (strpos($Excerpt['text'], '>') !== false and preg_match('/^<((mailto:)?\S+?@\S+?)>/i', $Excerpt['text'], $matches))
|
1073 |
-
{
|
1074 |
-
$url = $matches[1];
|
1075 |
-
|
1076 |
-
if ( ! isset($matches[2]))
|
1077 |
-
{
|
1078 |
-
$url = 'mailto:' . $url;
|
1079 |
-
}
|
1080 |
-
|
1081 |
-
return array(
|
1082 |
-
'extent' => strlen($matches[0]),
|
1083 |
-
'element' => array(
|
1084 |
-
'name' => 'a',
|
1085 |
-
'text' => $matches[1],
|
1086 |
-
'attributes' => array(
|
1087 |
-
'href' => $url,
|
1088 |
-
),
|
1089 |
-
),
|
1090 |
-
);
|
1091 |
-
}
|
1092 |
-
}
|
1093 |
-
|
1094 |
-
protected function inlineEmphasis($Excerpt)
|
1095 |
-
{
|
1096 |
-
if ( ! isset($Excerpt['text'][1]))
|
1097 |
-
{
|
1098 |
-
return;
|
1099 |
-
}
|
1100 |
-
|
1101 |
-
$marker = $Excerpt['text'][0];
|
1102 |
-
|
1103 |
-
if ($Excerpt['text'][1] === $marker and preg_match($this->StrongRegex[$marker], $Excerpt['text'], $matches))
|
1104 |
-
{
|
1105 |
-
$emphasis = 'strong';
|
1106 |
-
}
|
1107 |
-
elseif (preg_match($this->EmRegex[$marker], $Excerpt['text'], $matches))
|
1108 |
-
{
|
1109 |
-
$emphasis = 'em';
|
1110 |
-
}
|
1111 |
-
else
|
1112 |
-
{
|
1113 |
-
return;
|
1114 |
-
}
|
1115 |
-
|
1116 |
-
return array(
|
1117 |
-
'extent' => strlen($matches[0]),
|
1118 |
-
'element' => array(
|
1119 |
-
'name' => $emphasis,
|
1120 |
-
'handler' => 'line',
|
1121 |
-
'text' => $matches[1],
|
1122 |
-
),
|
1123 |
-
);
|
1124 |
-
}
|
1125 |
-
|
1126 |
-
protected function inlineEscapeSequence($Excerpt)
|
1127 |
-
{
|
1128 |
-
if (isset($Excerpt['text'][1]) and in_array($Excerpt['text'][1], $this->specialCharacters))
|
1129 |
-
{
|
1130 |
-
return array(
|
1131 |
-
'markup' => $Excerpt['text'][1],
|
1132 |
-
'extent' => 2,
|
1133 |
-
);
|
1134 |
-
}
|
1135 |
-
}
|
1136 |
-
|
1137 |
-
protected function inlineImage($Excerpt)
|
1138 |
-
{
|
1139 |
-
if ( ! isset($Excerpt['text'][1]) or $Excerpt['text'][1] !== '[')
|
1140 |
-
{
|
1141 |
-
return;
|
1142 |
-
}
|
1143 |
-
|
1144 |
-
$Excerpt['text']= substr($Excerpt['text'], 1);
|
1145 |
-
|
1146 |
-
$Link = $this->inlineLink($Excerpt);
|
1147 |
-
|
1148 |
-
if ($Link === null)
|
1149 |
-
{
|
1150 |
-
return;
|
1151 |
-
}
|
1152 |
-
|
1153 |
-
$Inline = array(
|
1154 |
-
'extent' => $Link['extent'] + 1,
|
1155 |
-
'element' => array(
|
1156 |
-
'name' => 'img',
|
1157 |
-
'attributes' => array(
|
1158 |
-
'src' => $Link['element']['attributes']['href'],
|
1159 |
-
'alt' => $Link['element']['text'],
|
1160 |
-
),
|
1161 |
-
),
|
1162 |
-
);
|
1163 |
-
|
1164 |
-
$Inline['element']['attributes'] += $Link['element']['attributes'];
|
1165 |
-
|
1166 |
-
unset($Inline['element']['attributes']['href']);
|
1167 |
-
|
1168 |
-
return $Inline;
|
1169 |
-
}
|
1170 |
-
|
1171 |
-
protected function inlineLink($Excerpt)
|
1172 |
-
{
|
1173 |
-
$Element = array(
|
1174 |
-
'name' => 'a',
|
1175 |
-
'handler' => 'line',
|
1176 |
-
'text' => null,
|
1177 |
-
'attributes' => array(
|
1178 |
-
'href' => null,
|
1179 |
-
'title' => null,
|
1180 |
-
),
|
1181 |
-
);
|
1182 |
-
|
1183 |
-
$extent = 0;
|
1184 |
-
|
1185 |
-
$remainder = $Excerpt['text'];
|
1186 |
-
|
1187 |
-
if (preg_match('/\[((?:[^][]|(?R))*)\]/', $remainder, $matches))
|
1188 |
-
{
|
1189 |
-
$Element['text'] = $matches[1];
|
1190 |
-
|
1191 |
-
$extent += strlen($matches[0]);
|
1192 |
-
|
1193 |
-
$remainder = substr($remainder, $extent);
|
1194 |
-
}
|
1195 |
-
else
|
1196 |
-
{
|
1197 |
-
return;
|
1198 |
-
}
|
1199 |
-
|
1200 |
-
if (preg_match('/^[(]((?:[^ ()]|[(][^ )]+[)])+)(?:[ ]+("[^"]*"|\'[^\']*\'))?[)]/', $remainder, $matches))
|
1201 |
-
{
|
1202 |
-
$Element['attributes']['href'] = $matches[1];
|
1203 |
-
|
1204 |
-
if (isset($matches[2]))
|
1205 |
-
{
|
1206 |
-
$Element['attributes']['title'] = substr($matches[2], 1, - 1);
|
1207 |
-
}
|
1208 |
-
|
1209 |
-
$extent += strlen($matches[0]);
|
1210 |
-
}
|
1211 |
-
else
|
1212 |
-
{
|
1213 |
-
if (preg_match('/^\s*\[(.*?)\]/', $remainder, $matches))
|
1214 |
-
{
|
1215 |
-
$definition = strlen($matches[1]) ? $matches[1] : $Element['text'];
|
1216 |
-
$definition = strtolower($definition);
|
1217 |
-
|
1218 |
-
$extent += strlen($matches[0]);
|
1219 |
-
}
|
1220 |
-
else
|
1221 |
-
{
|
1222 |
-
$definition = strtolower($Element['text']);
|
1223 |
-
}
|
1224 |
-
|
1225 |
-
if ( ! isset($this->DefinitionData['Reference'][$definition]))
|
1226 |
-
{
|
1227 |
-
return;
|
1228 |
-
}
|
1229 |
-
|
1230 |
-
$Definition = $this->DefinitionData['Reference'][$definition];
|
1231 |
-
|
1232 |
-
$Element['attributes']['href'] = $Definition['url'];
|
1233 |
-
$Element['attributes']['title'] = $Definition['title'];
|
1234 |
-
}
|
1235 |
-
|
1236 |
-
$Element['attributes']['href'] = str_replace(array('&', '<'), array('&', '<'), $Element['attributes']['href']);
|
1237 |
-
|
1238 |
-
return array(
|
1239 |
-
'extent' => $extent,
|
1240 |
-
'element' => $Element,
|
1241 |
-
);
|
1242 |
-
}
|
1243 |
-
|
1244 |
-
protected function inlineMarkup($Excerpt)
|
1245 |
-
{
|
1246 |
-
if ($this->markupEscaped or strpos($Excerpt['text'], '>') === false)
|
1247 |
-
{
|
1248 |
-
return;
|
1249 |
-
}
|
1250 |
-
|
1251 |
-
if ($Excerpt['text'][1] === '/' and preg_match('/^<\/\w*[ ]*>/s', $Excerpt['text'], $matches))
|
1252 |
-
{
|
1253 |
-
return array(
|
1254 |
-
'markup' => $matches[0],
|
1255 |
-
'extent' => strlen($matches[0]),
|
1256 |
-
);
|
1257 |
-
}
|
1258 |
-
|
1259 |
-
if ($Excerpt['text'][1] === '!' and preg_match('/^<!---?[^>-](?:-?[^-])*-->/s', $Excerpt['text'], $matches))
|
1260 |
-
{
|
1261 |
-
return array(
|
1262 |
-
'markup' => $matches[0],
|
1263 |
-
'extent' => strlen($matches[0]),
|
1264 |
-
);
|
1265 |
-
}
|
1266 |
-
|
1267 |
-
if ($Excerpt['text'][1] !== ' ' and preg_match('/^<\w*(?:[ ]*'.$this->regexHtmlAttribute.')*[ ]*\/?>/s', $Excerpt['text'], $matches))
|
1268 |
-
{
|
1269 |
-
return array(
|
1270 |
-
'markup' => $matches[0],
|
1271 |
-
'extent' => strlen($matches[0]),
|
1272 |
-
);
|
1273 |
-
}
|
1274 |
-
}
|
1275 |
-
|
1276 |
-
protected function inlineSpecialCharacter($Excerpt)
|
1277 |
-
{
|
1278 |
-
if ($Excerpt['text'][0] === '&' and ! preg_match('/^&#?\w+;/', $Excerpt['text']))
|
1279 |
-
{
|
1280 |
-
return array(
|
1281 |
-
'markup' => '&',
|
1282 |
-
'extent' => 1,
|
1283 |
-
);
|
1284 |
-
}
|
1285 |
-
|
1286 |
-
$SpecialCharacter = array('>' => 'gt', '<' => 'lt', '"' => 'quot');
|
1287 |
-
|
1288 |
-
if (isset($SpecialCharacter[$Excerpt['text'][0]]))
|
1289 |
-
{
|
1290 |
-
return array(
|
1291 |
-
'markup' => '&'.$SpecialCharacter[$Excerpt['text'][0]].';',
|
1292 |
-
'extent' => 1,
|
1293 |
-
);
|
1294 |
-
}
|
1295 |
-
}
|
1296 |
-
|
1297 |
-
protected function inlineStrikethrough($Excerpt)
|
1298 |
-
{
|
1299 |
-
if ( ! isset($Excerpt['text'][1]))
|
1300 |
-
{
|
1301 |
-
return;
|
1302 |
-
}
|
1303 |
-
|
1304 |
-
if ($Excerpt['text'][1] === '~' and preg_match('/^~~(?=\S)(.+?)(?<=\S)~~/', $Excerpt['text'], $matches))
|
1305 |
-
{
|
1306 |
-
return array(
|
1307 |
-
'extent' => strlen($matches[0]),
|
1308 |
-
'element' => array(
|
1309 |
-
'name' => 'del',
|
1310 |
-
'text' => $matches[1],
|
1311 |
-
'handler' => 'line',
|
1312 |
-
),
|
1313 |
-
);
|
1314 |
-
}
|
1315 |
-
}
|
1316 |
-
|
1317 |
-
protected function inlineUrl($Excerpt)
|
1318 |
-
{
|
1319 |
-
if ($this->urlsLinked !== true or ! isset($Excerpt['text'][2]) or $Excerpt['text'][2] !== '/')
|
1320 |
-
{
|
1321 |
-
return;
|
1322 |
-
}
|
1323 |
-
|
1324 |
-
if (preg_match('/\bhttps?:[\/]{2}[^\s<]+\b\/*/ui', $Excerpt['context'], $matches, PREG_OFFSET_CAPTURE))
|
1325 |
-
{
|
1326 |
-
$Inline = array(
|
1327 |
-
'extent' => strlen($matches[0][0]),
|
1328 |
-
'position' => $matches[0][1],
|
1329 |
-
'element' => array(
|
1330 |
-
'name' => 'a',
|
1331 |
-
'text' => $matches[0][0],
|
1332 |
-
'attributes' => array(
|
1333 |
-
'href' => $matches[0][0],
|
1334 |
-
),
|
1335 |
-
),
|
1336 |
-
);
|
1337 |
-
|
1338 |
-
return $Inline;
|
1339 |
-
}
|
1340 |
-
}
|
1341 |
-
|
1342 |
-
protected function inlineUrlTag($Excerpt)
|
1343 |
-
{
|
1344 |
-
if (strpos($Excerpt['text'], '>') !== false and preg_match('/^<(\w+:\/{2}[^ >]+)>/i', $Excerpt['text'], $matches))
|
1345 |
-
{
|
1346 |
-
$url = str_replace(array('&', '<'), array('&', '<'), $matches[1]);
|
1347 |
-
|
1348 |
-
return array(
|
1349 |
-
'extent' => strlen($matches[0]),
|
1350 |
-
'element' => array(
|
1351 |
-
'name' => 'a',
|
1352 |
-
'text' => $url,
|
1353 |
-
'attributes' => array(
|
1354 |
-
'href' => $url,
|
1355 |
-
),
|
1356 |
-
),
|
1357 |
-
);
|
1358 |
-
}
|
1359 |
-
}
|
1360 |
-
|
1361 |
-
# ~
|
1362 |
-
|
1363 |
-
protected function unmarkedText($text)
|
1364 |
-
{
|
1365 |
-
if ($this->breaksEnabled)
|
1366 |
-
{
|
1367 |
-
$text = preg_replace('/[ ]*\n/', "<br />\n", $text);
|
1368 |
-
}
|
1369 |
-
else
|
1370 |
-
{
|
1371 |
-
$text = preg_replace('/(?:[ ][ ]+|[ ]*\\\\)\n/', "<br />\n", $text);
|
1372 |
-
$text = str_replace(" \n", "\n", $text);
|
1373 |
-
}
|
1374 |
-
|
1375 |
-
return $text;
|
1376 |
-
}
|
1377 |
-
|
1378 |
-
#
|
1379 |
-
# Handlers
|
1380 |
-
#
|
1381 |
-
|
1382 |
-
protected function element(array $Element)
|
1383 |
-
{
|
1384 |
-
$markup = '<'.$Element['name'];
|
1385 |
-
|
1386 |
-
if (isset($Element['attributes']))
|
1387 |
-
{
|
1388 |
-
foreach ($Element['attributes'] as $name => $value)
|
1389 |
-
{
|
1390 |
-
if ($value === null)
|
1391 |
-
{
|
1392 |
-
continue;
|
1393 |
-
}
|
1394 |
-
|
1395 |
-
$markup .= ' '.$name.'="'.$value.'"';
|
1396 |
-
}
|
1397 |
-
}
|
1398 |
-
|
1399 |
-
if (isset($Element['text']))
|
1400 |
-
{
|
1401 |
-
$markup .= '>';
|
1402 |
-
|
1403 |
-
if (isset($Element['handler']))
|
1404 |
-
{
|
1405 |
-
$markup .= $this->{$Element['handler']}($Element['text']);
|
1406 |
-
}
|
1407 |
-
else
|
1408 |
-
{
|
1409 |
-
$markup .= $Element['text'];
|
1410 |
-
}
|
1411 |
-
|
1412 |
-
$markup .= '</'.$Element['name'].'>';
|
1413 |
-
}
|
1414 |
-
else
|
1415 |
-
{
|
1416 |
-
$markup .= ' />';
|
1417 |
-
}
|
1418 |
-
|
1419 |
-
return $markup;
|
1420 |
-
}
|
1421 |
-
|
1422 |
-
protected function elements(array $Elements)
|
1423 |
-
{
|
1424 |
-
$markup = '';
|
1425 |
-
|
1426 |
-
foreach ($Elements as $Element)
|
1427 |
-
{
|
1428 |
-
$markup .= "\n" . $this->element($Element);
|
1429 |
-
}
|
1430 |
-
|
1431 |
-
$markup .= "\n";
|
1432 |
-
|
1433 |
-
return $markup;
|
1434 |
-
}
|
1435 |
-
|
1436 |
-
# ~
|
1437 |
-
|
1438 |
-
protected function li($lines)
|
1439 |
-
{
|
1440 |
-
$markup = $this->lines($lines);
|
1441 |
-
|
1442 |
-
$trimmedMarkup = trim($markup);
|
1443 |
-
|
1444 |
-
if ( ! in_array('', $lines) and substr($trimmedMarkup, 0, 3) === '<p>')
|
1445 |
-
{
|
1446 |
-
$markup = $trimmedMarkup;
|
1447 |
-
$markup = substr($markup, 3);
|
1448 |
-
|
1449 |
-
$position = strpos($markup, "</p>");
|
1450 |
-
|
1451 |
-
$markup = substr_replace($markup, '', $position, 4);
|
1452 |
-
}
|
1453 |
-
|
1454 |
-
return $markup;
|
1455 |
-
}
|
1456 |
-
|
1457 |
-
#
|
1458 |
-
# Deprecated Methods
|
1459 |
-
#
|
1460 |
-
|
1461 |
-
function parse($text)
|
1462 |
-
{
|
1463 |
-
$markup = $this->text($text);
|
1464 |
-
|
1465 |
-
return $markup;
|
1466 |
-
}
|
1467 |
-
|
1468 |
-
#
|
1469 |
-
# Static Methods
|
1470 |
-
#
|
1471 |
-
|
1472 |
-
static function instance($name = 'default')
|
1473 |
-
{
|
1474 |
-
if (isset(self::$instances[$name]))
|
1475 |
-
{
|
1476 |
-
return self::$instances[$name];
|
1477 |
-
}
|
1478 |
-
|
1479 |
-
$instance = new static();
|
1480 |
-
|
1481 |
-
self::$instances[$name] = $instance;
|
1482 |
-
|
1483 |
-
return $instance;
|
1484 |
-
}
|
1485 |
-
|
1486 |
-
private static $instances = array();
|
1487 |
-
|
1488 |
-
#
|
1489 |
-
# Fields
|
1490 |
-
#
|
1491 |
-
|
1492 |
-
protected $DefinitionData;
|
1493 |
-
|
1494 |
-
#
|
1495 |
-
# Read-Only
|
1496 |
-
|
1497 |
-
protected $specialCharacters = array(
|
1498 |
-
'\\', '`', '*', '_', '{', '}', '[', ']', '(', ')', '>', '#', '+', '-', '.', '!', '|',
|
1499 |
-
);
|
1500 |
-
|
1501 |
-
protected $StrongRegex = array(
|
1502 |
-
'*' => '/^[*]{2}((?:\\\\\*|[^*]|[*][^*]*[*])+?)[*]{2}(?![*])/s',
|
1503 |
-
'_' => '/^__((?:\\\\_|[^_]|_[^_]*_)+?)__(?!_)/us',
|
1504 |
-
);
|
1505 |
-
|
1506 |
-
protected $EmRegex = array(
|
1507 |
-
'*' => '/^[*]((?:\\\\\*|[^*]|[*][*][^*]+?[*][*])+?)[*](?![*])/s',
|
1508 |
-
'_' => '/^_((?:\\\\_|[^_]|__[^_]*__)+?)_(?!_)\b/us',
|
1509 |
-
);
|
1510 |
-
|
1511 |
-
protected $regexHtmlAttribute = '[a-zA-Z_:][\w:.-]*(?:\s*=\s*(?:[^"\'=<>`\s]+|"[^"]*"|\'[^\']*\'))?';
|
1512 |
-
|
1513 |
-
protected $voidElements = array(
|
1514 |
-
'area', 'base', 'br', 'col', 'command', 'embed', 'hr', 'img', 'input', 'link', 'meta', 'param', 'source',
|
1515 |
-
);
|
1516 |
-
|
1517 |
-
protected $textLevelElements = array(
|
1518 |
-
'a', 'br', 'bdo', 'abbr', 'blink', 'nextid', 'acronym', 'basefont',
|
1519 |
-
'b', 'em', 'big', 'cite', 'small', 'spacer', 'listing',
|
1520 |
-
'i', 'rp', 'del', 'code', 'strike', 'marquee',
|
1521 |
-
'q', 'rt', 'ins', 'font', 'strong',
|
1522 |
-
's', 'tt', 'sub', 'mark',
|
1523 |
-
'u', 'xm', 'sup', 'nobr',
|
1524 |
-
'var', 'ruby',
|
1525 |
-
'wbr', 'span',
|
1526 |
-
'time',
|
1527 |
-
);
|
1528 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/README.md
DELETED
@@ -1,53 +0,0 @@
|
|
1 |
-
## Parsedown
|
2 |
-
|
3 |
-
[![Build Status](https://img.shields.io/travis/erusev/parsedown/master.svg?style=flat-square)](https://travis-ci.org/erusev/parsedown)
|
4 |
-
<!--[![Total Downloads](http://img.shields.io/packagist/dt/erusev/parsedown.svg?style=flat-square)](https://packagist.org/packages/erusev/parsedown)-->
|
5 |
-
|
6 |
-
Better Markdown Parser in PHP
|
7 |
-
|
8 |
-
[Demo](http://parsedown.org/demo) |
|
9 |
-
[Benchmarks](http://parsedown.org/speed) |
|
10 |
-
[Tests](http://parsedown.org/tests/) |
|
11 |
-
[Documentation](https://github.com/erusev/parsedown/wiki/)
|
12 |
-
|
13 |
-
### Features
|
14 |
-
|
15 |
-
* Super Fast
|
16 |
-
* [GitHub flavored](https://help.github.com/articles/github-flavored-markdown)
|
17 |
-
* Extensible
|
18 |
-
* Tested in 5.3 to 5.6
|
19 |
-
* [Markdown Extra extension](https://github.com/erusev/parsedown-extra)
|
20 |
-
|
21 |
-
### Installation
|
22 |
-
|
23 |
-
Include `Parsedown.php` or install [the composer package](https://packagist.org/packages/erusev/parsedown).
|
24 |
-
|
25 |
-
### Example
|
26 |
-
|
27 |
-
``` php
|
28 |
-
$Parsedown = new Parsedown();
|
29 |
-
|
30 |
-
echo $Parsedown->text('Hello _Parsedown_!'); # prints: <p>Hello <em>Parsedown</em>!</p>
|
31 |
-
```
|
32 |
-
|
33 |
-
More examples in [the wiki](https://github.com/erusev/parsedown/wiki/) and in [this video tutorial](http://youtu.be/wYZBY8DEikI).
|
34 |
-
|
35 |
-
### Questions
|
36 |
-
|
37 |
-
**How does Parsedown work?**
|
38 |
-
|
39 |
-
It tries to read Markdown like a human. First, it looks at the lines. It’s interested in how the lines start. This helps it recognise blocks. It knows, for example, that if a line start with a `-` then it perhaps belong to a list. Once it recognises the blocks, it continues to the content. As it reads, it watches out for special characters. This helps it recognise inline elements (or inlines).
|
40 |
-
|
41 |
-
We call this approach "line based". We believe that Parsedown is the first Markdown parser to use it. Since the release of Parsedown, other developers have used the same approach to develop other Markdown parsers in PHP and in other languages.
|
42 |
-
|
43 |
-
**Is it compliant with CommonMark?**
|
44 |
-
|
45 |
-
It passes most of the CommonMark tests. Most of the tests that don't pass deal with cases that are quite uncommon. Still, as CommonMark matures, compliance should improve.
|
46 |
-
|
47 |
-
**Who uses it?**
|
48 |
-
|
49 |
-
[phpDocumentor](http://www.phpdoc.org/), [October CMS](http://octobercms.com/), [Bolt CMS](http://bolt.cm/), [Kirby CMS](http://getkirby.com/), [Grav CMS](http://getgrav.org/), [Statamic CMS](http://www.statamic.com/), [RaspberryPi.org](http://www.raspberrypi.org/) and [more](https://www.versioneye.com/php/erusev:parsedown/references).
|
50 |
-
|
51 |
-
**How can I help?**
|
52 |
-
|
53 |
-
Use it, star it, share it and if you feel generous, [donate](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=528P3NZQMP8N2).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/composer.json
DELETED
@@ -1,18 +0,0 @@
|
|
1 |
-
{
|
2 |
-
"name": "erusev/parsedown",
|
3 |
-
"description": "Parser for Markdown.",
|
4 |
-
"keywords": ["markdown", "parser"],
|
5 |
-
"homepage": "http://parsedown.org",
|
6 |
-
"type": "library",
|
7 |
-
"license": "MIT",
|
8 |
-
"authors": [
|
9 |
-
{
|
10 |
-
"name": "Emanuil Rusev",
|
11 |
-
"email": "hello@erusev.com",
|
12 |
-
"homepage": "http://erusev.com"
|
13 |
-
}
|
14 |
-
],
|
15 |
-
"autoload": {
|
16 |
-
"psr-0": {"Parsedown": ""}
|
17 |
-
}
|
18 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/phpunit.xml.dist
DELETED
@@ -1,8 +0,0 @@
|
|
1 |
-
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
-
<phpunit bootstrap="test/bootstrap.php" colors="true">
|
3 |
-
<testsuites>
|
4 |
-
<testsuite>
|
5 |
-
<file>test/ParsedownTest.php</file>
|
6 |
-
</testsuite>
|
7 |
-
</testsuites>
|
8 |
-
</phpunit>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/CommonMarkTest.php
DELETED
@@ -1,74 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Test Parsedown against the CommonMark spec.
|
5 |
-
*
|
6 |
-
* Some code based on the original JavaScript test runner by jgm.
|
7 |
-
*
|
8 |
-
* @link http://commonmark.org/ CommonMark
|
9 |
-
* @link http://git.io/8WtRvQ JavaScript test runner
|
10 |
-
*/
|
11 |
-
class CommonMarkTest extends PHPUnit_Framework_TestCase
|
12 |
-
{
|
13 |
-
const SPEC_URL = 'https://raw.githubusercontent.com/jgm/stmd/master/spec.txt';
|
14 |
-
|
15 |
-
/**
|
16 |
-
* @dataProvider data
|
17 |
-
* @param $section
|
18 |
-
* @param $markdown
|
19 |
-
* @param $expectedHtml
|
20 |
-
*/
|
21 |
-
function test_($section, $markdown, $expectedHtml)
|
22 |
-
{
|
23 |
-
$Parsedown = new Parsedown();
|
24 |
-
$Parsedown->setUrlsLinked(false);
|
25 |
-
|
26 |
-
$actualHtml = $Parsedown->text($markdown);
|
27 |
-
$actualHtml = $this->normalizeMarkup($actualHtml);
|
28 |
-
|
29 |
-
$this->assertEquals($expectedHtml, $actualHtml);
|
30 |
-
}
|
31 |
-
|
32 |
-
function data()
|
33 |
-
{
|
34 |
-
$spec = file_get_contents(self::SPEC_URL);
|
35 |
-
$spec = strstr($spec, '<!-- END TESTS -->', true);
|
36 |
-
|
37 |
-
$tests = array();
|
38 |
-
$currentSection = '';
|
39 |
-
|
40 |
-
preg_replace_callback(
|
41 |
-
'/^\.\n([\s\S]*?)^\.\n([\s\S]*?)^\.$|^#{1,6} *(.*)$/m',
|
42 |
-
function($matches) use ( & $tests, & $currentSection, & $testCount) {
|
43 |
-
if (isset($matches[3]) and $matches[3]) {
|
44 |
-
$currentSection = $matches[3];
|
45 |
-
} else {
|
46 |
-
$testCount++;
|
47 |
-
$markdown = $matches[1];
|
48 |
-
$markdown = preg_replace('/→/', "\t", $markdown);
|
49 |
-
$expectedHtml = $matches[2];
|
50 |
-
$expectedHtml = $this->normalizeMarkup($expectedHtml);
|
51 |
-
$tests []= array(
|
52 |
-
$currentSection, # section
|
53 |
-
$markdown, # markdown
|
54 |
-
$expectedHtml, # html
|
55 |
-
);
|
56 |
-
}
|
57 |
-
},
|
58 |
-
$spec
|
59 |
-
);
|
60 |
-
|
61 |
-
return $tests;
|
62 |
-
}
|
63 |
-
|
64 |
-
private function normalizeMarkup($markup)
|
65 |
-
{
|
66 |
-
$markup = preg_replace("/\n+/", "\n", $markup);
|
67 |
-
$markup = preg_replace('/^\s+/m', '', $markup);
|
68 |
-
$markup = preg_replace('/^((?:<[\w]+>)+)\n/m', '$1', $markup);
|
69 |
-
$markup = preg_replace('/\n((?:<\/[\w]+>)+)$/m', '$1', $markup);
|
70 |
-
$markup = trim($markup);
|
71 |
-
|
72 |
-
return $markup;
|
73 |
-
}
|
74 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/ParsedownTest.php
DELETED
@@ -1,159 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class ParsedownTest extends PHPUnit_Framework_TestCase
|
4 |
-
{
|
5 |
-
final function __construct($name = null, array $data = array(), $dataName = '')
|
6 |
-
{
|
7 |
-
$this->dirs = $this->initDirs();
|
8 |
-
$this->Parsedown = $this->initParsedown();
|
9 |
-
|
10 |
-
parent::__construct($name, $data, $dataName);
|
11 |
-
}
|
12 |
-
|
13 |
-
private $dirs, $Parsedown;
|
14 |
-
|
15 |
-
/**
|
16 |
-
* @return array
|
17 |
-
*/
|
18 |
-
protected function initDirs()
|
19 |
-
{
|
20 |
-
$dirs []= dirname(__FILE__).'/data/';
|
21 |
-
|
22 |
-
return $dirs;
|
23 |
-
}
|
24 |
-
|
25 |
-
/**
|
26 |
-
* @return Parsedown
|
27 |
-
*/
|
28 |
-
protected function initParsedown()
|
29 |
-
{
|
30 |
-
$Parsedown = new Parsedown();
|
31 |
-
|
32 |
-
return $Parsedown;
|
33 |
-
}
|
34 |
-
|
35 |
-
/**
|
36 |
-
* @dataProvider data
|
37 |
-
* @param $test
|
38 |
-
* @param $dir
|
39 |
-
*/
|
40 |
-
function test_($test, $dir)
|
41 |
-
{
|
42 |
-
$markdown = file_get_contents($dir . $test . '.md');
|
43 |
-
|
44 |
-
$expectedMarkup = file_get_contents($dir . $test . '.html');
|
45 |
-
|
46 |
-
$expectedMarkup = str_replace("\r\n", "\n", $expectedMarkup);
|
47 |
-
$expectedMarkup = str_replace("\r", "\n", $expectedMarkup);
|
48 |
-
|
49 |
-
$actualMarkup = $this->Parsedown->text($markdown);
|
50 |
-
|
51 |
-
$this->assertEquals($expectedMarkup, $actualMarkup);
|
52 |
-
}
|
53 |
-
|
54 |
-
function data()
|
55 |
-
{
|
56 |
-
$data = array();
|
57 |
-
|
58 |
-
foreach ($this->dirs as $dir)
|
59 |
-
{
|
60 |
-
$Folder = new DirectoryIterator($dir);
|
61 |
-
|
62 |
-
foreach ($Folder as $File)
|
63 |
-
{
|
64 |
-
/** @var $File DirectoryIterator */
|
65 |
-
|
66 |
-
if ( ! $File->isFile())
|
67 |
-
{
|
68 |
-
continue;
|
69 |
-
}
|
70 |
-
|
71 |
-
$filename = $File->getFilename();
|
72 |
-
|
73 |
-
$extension = pathinfo($filename, PATHINFO_EXTENSION);
|
74 |
-
|
75 |
-
if ($extension !== 'md')
|
76 |
-
{
|
77 |
-
continue;
|
78 |
-
}
|
79 |
-
|
80 |
-
$basename = $File->getBasename('.md');
|
81 |
-
|
82 |
-
if (file_exists($dir . $basename . '.html'))
|
83 |
-
{
|
84 |
-
$data []= array($basename, $dir);
|
85 |
-
}
|
86 |
-
}
|
87 |
-
}
|
88 |
-
|
89 |
-
return $data;
|
90 |
-
}
|
91 |
-
|
92 |
-
public function test_no_markup()
|
93 |
-
{
|
94 |
-
$markdownWithHtml = <<<MARKDOWN_WITH_MARKUP
|
95 |
-
<div>_content_</div>
|
96 |
-
|
97 |
-
sparse:
|
98 |
-
|
99 |
-
<div>
|
100 |
-
<div class="inner">
|
101 |
-
_content_
|
102 |
-
</div>
|
103 |
-
</div>
|
104 |
-
|
105 |
-
paragraph
|
106 |
-
|
107 |
-
<style type="text/css">
|
108 |
-
p {
|
109 |
-
color: red;
|
110 |
-
}
|
111 |
-
</style>
|
112 |
-
|
113 |
-
comment
|
114 |
-
|
115 |
-
<!-- html comment -->
|
116 |
-
MARKDOWN_WITH_MARKUP;
|
117 |
-
|
118 |
-
$expectedHtml = <<<EXPECTED_HTML
|
119 |
-
<p><div><em>content</em></div></p>
|
120 |
-
<p>sparse:</p>
|
121 |
-
<p><div>
|
122 |
-
<div class="inner">
|
123 |
-
<em>content</em>
|
124 |
-
</div>
|
125 |
-
</div></p>
|
126 |
-
<p>paragraph</p>
|
127 |
-
<p><style type="text/css">
|
128 |
-
p {
|
129 |
-
color: red;
|
130 |
-
}
|
131 |
-
</style></p>
|
132 |
-
<p>comment</p>
|
133 |
-
<p><!-- html comment --></p>
|
134 |
-
EXPECTED_HTML;
|
135 |
-
$parsedownWithNoMarkup = new Parsedown();
|
136 |
-
$parsedownWithNoMarkup->setMarkupEscaped(true);
|
137 |
-
$this->assertEquals($expectedHtml, $parsedownWithNoMarkup->text($markdownWithHtml));
|
138 |
-
}
|
139 |
-
|
140 |
-
public function testLateStaticBinding()
|
141 |
-
{
|
142 |
-
include 'test/TestParsedown.php';
|
143 |
-
|
144 |
-
$parsedown = Parsedown::instance();
|
145 |
-
$this->assertInstanceOf('Parsedown', $parsedown);
|
146 |
-
|
147 |
-
// After instance is already called on Parsedown
|
148 |
-
// subsequent calls with the same arguments return the same instance
|
149 |
-
$sameParsedown = TestParsedown::instance();
|
150 |
-
$this->assertInstanceOf('Parsedown', $sameParsedown);
|
151 |
-
$this->assertSame($parsedown, $sameParsedown);
|
152 |
-
|
153 |
-
$testParsedown = TestParsedown::instance('test late static binding');
|
154 |
-
$this->assertInstanceOf('TestParsedown', $testParsedown);
|
155 |
-
|
156 |
-
$sameInstanceAgain = TestParsedown::instance('test late static binding');
|
157 |
-
$this->assertSame($testParsedown, $sameInstanceAgain);
|
158 |
-
}
|
159 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/Test.php
DELETED
@@ -1,65 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Test extends PHPUnit_Framework_TestCase
|
4 |
-
{
|
5 |
-
public function __construct($name = null, array $data = array(), $dataName = '')
|
6 |
-
{
|
7 |
-
$this->dataDir = dirname(__FILE__).'/data/';
|
8 |
-
|
9 |
-
parent::__construct($name, $data, $dataName);
|
10 |
-
}
|
11 |
-
|
12 |
-
private $dataDir;
|
13 |
-
|
14 |
-
/**
|
15 |
-
* @dataProvider data
|
16 |
-
*/
|
17 |
-
function test_($filename)
|
18 |
-
{
|
19 |
-
$markdown = file_get_contents($this->dataDir . $filename . '.md');
|
20 |
-
|
21 |
-
$expectedMarkup = file_get_contents($this->dataDir . $filename . '.html');
|
22 |
-
|
23 |
-
$expectedMarkup = str_replace("\r\n", "\n", $expectedMarkup);
|
24 |
-
$expectedMarkup = str_replace("\r", "\n", $expectedMarkup);
|
25 |
-
|
26 |
-
$actualMarkup = Parsedown::instance()->text($markdown);
|
27 |
-
|
28 |
-
$this->assertEquals($expectedMarkup, $actualMarkup);
|
29 |
-
}
|
30 |
-
|
31 |
-
function data()
|
32 |
-
{
|
33 |
-
$data = array();
|
34 |
-
|
35 |
-
$Folder = new DirectoryIterator($this->dataDir);
|
36 |
-
|
37 |
-
foreach ($Folder as $File)
|
38 |
-
{
|
39 |
-
/** @var $File DirectoryIterator */
|
40 |
-
|
41 |
-
if ( ! $File->isFile())
|
42 |
-
{
|
43 |
-
continue;
|
44 |
-
}
|
45 |
-
|
46 |
-
$filename = $File->getFilename();
|
47 |
-
|
48 |
-
$extension = pathinfo($filename, PATHINFO_EXTENSION);
|
49 |
-
|
50 |
-
if ($extension !== 'md')
|
51 |
-
{
|
52 |
-
continue;
|
53 |
-
}
|
54 |
-
|
55 |
-
$basename = $File->getBasename('.md');
|
56 |
-
|
57 |
-
if (file_exists($this->dataDir . $basename . '.html'))
|
58 |
-
{
|
59 |
-
$data []= array($basename);
|
60 |
-
}
|
61 |
-
}
|
62 |
-
|
63 |
-
return $data;
|
64 |
-
}
|
65 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/TestParsedown.php
DELETED
@@ -1,5 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class TestParsedown extends Parsedown
|
4 |
-
{
|
5 |
-
}
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/bootstrap.php
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
include 'Parsedown.php';
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/HTML_Comment.html
DELETED
@@ -1,5 +0,0 @@
|
|
1 |
-
<!-- single line -->
|
2 |
-
<p>paragraph</p>
|
3 |
-
<!--
|
4 |
-
multiline -->
|
5 |
-
<p>paragraph</p>
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/HTML_Comment.md
DELETED
@@ -1,8 +0,0 @@
|
|
1 |
-
<!-- single line -->
|
2 |
-
|
3 |
-
paragraph
|
4 |
-
|
5 |
-
<!--
|
6 |
-
multiline -->
|
7 |
-
|
8 |
-
paragraph
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/aesthetic_table.html
DELETED
@@ -1,18 +0,0 @@
|
|
1 |
-
<table>
|
2 |
-
<thead>
|
3 |
-
<tr>
|
4 |
-
<th>header 1</th>
|
5 |
-
<th>header 2</th>
|
6 |
-
</tr>
|
7 |
-
</thead>
|
8 |
-
<tbody>
|
9 |
-
<tr>
|
10 |
-
<td>cell 1.1</td>
|
11 |
-
<td>cell 1.2</td>
|
12 |
-
</tr>
|
13 |
-
<tr>
|
14 |
-
<td>cell 2.1</td>
|
15 |
-
<td>cell 2.2</td>
|
16 |
-
</tr>
|
17 |
-
</tbody>
|
18 |
-
</table>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/aesthetic_table.md
DELETED
@@ -1,4 +0,0 @@
|
|
1 |
-
| header 1 | header 2 |
|
2 |
-
| -------- | -------- |
|
3 |
-
| cell 1.1 | cell 1.2 |
|
4 |
-
| cell 2.1 | cell 2.2 |
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/aligned_table.html
DELETED
@@ -1,21 +0,0 @@
|
|
1 |
-
<table>
|
2 |
-
<thead>
|
3 |
-
<tr>
|
4 |
-
<th style="text-align: left;">header 1</th>
|
5 |
-
<th style="text-align: center;">header 2</th>
|
6 |
-
<th style="text-align: right;">header 2</th>
|
7 |
-
</tr>
|
8 |
-
</thead>
|
9 |
-
<tbody>
|
10 |
-
<tr>
|
11 |
-
<td style="text-align: left;">cell 1.1</td>
|
12 |
-
<td style="text-align: center;">cell 1.2</td>
|
13 |
-
<td style="text-align: right;">cell 1.3</td>
|
14 |
-
</tr>
|
15 |
-
<tr>
|
16 |
-
<td style="text-align: left;">cell 2.1</td>
|
17 |
-
<td style="text-align: center;">cell 2.2</td>
|
18 |
-
<td style="text-align: right;">cell 2.3</td>
|
19 |
-
</tr>
|
20 |
-
</tbody>
|
21 |
-
</table>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/aligned_table.md
DELETED
@@ -1,4 +0,0 @@
|
|
1 |
-
| header 1 | header 2 | header 2 |
|
2 |
-
| :------- | :------: | -------: |
|
3 |
-
| cell 1.1 | cell 1.2 | cell 1.3 |
|
4 |
-
| cell 2.1 | cell 2.2 | cell 2.3 |
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/atx_heading.html
DELETED
@@ -1,9 +0,0 @@
|
|
1 |
-
<h1>h1</h1>
|
2 |
-
<h2>h2</h2>
|
3 |
-
<h3>h3</h3>
|
4 |
-
<h4>h4</h4>
|
5 |
-
<h5>h5</h5>
|
6 |
-
<h6>h6</h6>
|
7 |
-
<p>####### not a heading</p>
|
8 |
-
<h1>closed h1</h1>
|
9 |
-
<p>#</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/atx_heading.md
DELETED
@@ -1,17 +0,0 @@
|
|
1 |
-
# h1
|
2 |
-
|
3 |
-
## h2
|
4 |
-
|
5 |
-
### h3
|
6 |
-
|
7 |
-
#### h4
|
8 |
-
|
9 |
-
##### h5
|
10 |
-
|
11 |
-
###### h6
|
12 |
-
|
13 |
-
####### not a heading
|
14 |
-
|
15 |
-
# closed h1 #
|
16 |
-
|
17 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/automatic_link.html
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
<p><a href="http://example.com">http://example.com</a></p>
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/automatic_link.md
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
<http://example.com>
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/block-level_html.html
DELETED
@@ -1,12 +0,0 @@
|
|
1 |
-
<div>_content_</div>
|
2 |
-
<p>paragraph</p>
|
3 |
-
<div>
|
4 |
-
<div class="inner">
|
5 |
-
_content_
|
6 |
-
</div>
|
7 |
-
</div>
|
8 |
-
<style type="text/css">
|
9 |
-
p {color: #789;}
|
10 |
-
</style>
|
11 |
-
<div>
|
12 |
-
<a href="/">home</a></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/block-level_html.md
DELETED
@@ -1,16 +0,0 @@
|
|
1 |
-
<div>_content_</div>
|
2 |
-
|
3 |
-
paragraph
|
4 |
-
|
5 |
-
<div>
|
6 |
-
<div class="inner">
|
7 |
-
_content_
|
8 |
-
</div>
|
9 |
-
</div>
|
10 |
-
|
11 |
-
<style type="text/css">
|
12 |
-
p {color: #789;}
|
13 |
-
</style>
|
14 |
-
|
15 |
-
<div>
|
16 |
-
<a href="/">home</a></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/code_block.html
DELETED
@@ -1,8 +0,0 @@
|
|
1 |
-
<pre><code><?php
|
2 |
-
|
3 |
-
$message = 'Hello World!';
|
4 |
-
echo $message;</code></pre>
|
5 |
-
<hr />
|
6 |
-
<pre><code>> not a quote
|
7 |
-
- not a list item
|
8 |
-
[not a reference]: http://foo.com</code></pre>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/code_block.md
DELETED
@@ -1,10 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
$message = 'Hello World!';
|
4 |
-
echo $message;
|
5 |
-
|
6 |
-
---
|
7 |
-
|
8 |
-
> not a quote
|
9 |
-
- not a list item
|
10 |
-
[not a reference]: http://foo.com
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/code_span.html
DELETED
@@ -1,6 +0,0 @@
|
|
1 |
-
<p>a <code>code span</code></p>
|
2 |
-
<p><code>this is also a codespan</code> trailing text</p>
|
3 |
-
<p><code>and look at this one!</code></p>
|
4 |
-
<p>single backtick in a code span: <code>`</code></p>
|
5 |
-
<p>backtick-delimited string in a code span: <code>`foo`</code></p>
|
6 |
-
<p><code>sth `` sth</code></p>
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/code_span.md
DELETED
@@ -1,11 +0,0 @@
|
|
1 |
-
a `code span`
|
2 |
-
|
3 |
-
`this is also a codespan` trailing text
|
4 |
-
|
5 |
-
`and look at this one!`
|
6 |
-
|
7 |
-
single backtick in a code span: `` ` ``
|
8 |
-
|
9 |
-
backtick-delimited string in a code span: `` `foo` ``
|
10 |
-
|
11 |
-
`sth `` sth`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/compound_blockquote.html
DELETED
@@ -1,9 +0,0 @@
|
|
1 |
-
<blockquote>
|
2 |
-
<h2>header</h2>
|
3 |
-
<p>paragraph</p>
|
4 |
-
<ul>
|
5 |
-
<li>li</li>
|
6 |
-
</ul>
|
7 |
-
<hr />
|
8 |
-
<p>paragraph</p>
|
9 |
-
</blockquote>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/compound_blockquote.md
DELETED
@@ -1,10 +0,0 @@
|
|
1 |
-
> header
|
2 |
-
> ------
|
3 |
-
>
|
4 |
-
> paragraph
|
5 |
-
>
|
6 |
-
> - li
|
7 |
-
>
|
8 |
-
> ---
|
9 |
-
>
|
10 |
-
> paragraph
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/compound_emphasis.html
DELETED
@@ -1,2 +0,0 @@
|
|
1 |
-
<p><em><code>code</code></em> <strong><code>code</code></strong></p>
|
2 |
-
<p><em><code>code</code><strong><code>code</code></strong><code>code</code></em></p>
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/compound_emphasis.md
DELETED
@@ -1,4 +0,0 @@
|
|
1 |
-
_`code`_ __`code`__
|
2 |
-
|
3 |
-
*`code`**`code`**`code`*
|
4 |
-
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/compound_list.html
DELETED
@@ -1,12 +0,0 @@
|
|
1 |
-
<ul>
|
2 |
-
<li>
|
3 |
-
<p>paragraph</p>
|
4 |
-
<p>paragraph</p>
|
5 |
-
</li>
|
6 |
-
<li>
|
7 |
-
<p>paragraph</p>
|
8 |
-
<blockquote>
|
9 |
-
<p>quote</p>
|
10 |
-
</blockquote>
|
11 |
-
</li>
|
12 |
-
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/compound_list.md
DELETED
@@ -1,7 +0,0 @@
|
|
1 |
-
- paragraph
|
2 |
-
|
3 |
-
paragraph
|
4 |
-
|
5 |
-
- paragraph
|
6 |
-
|
7 |
-
> quote
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/deeply_nested_list.html
DELETED
@@ -1,12 +0,0 @@
|
|
1 |
-
<ul>
|
2 |
-
<li>li
|
3 |
-
<ul>
|
4 |
-
<li>li
|
5 |
-
<ul>
|
6 |
-
<li>li</li>
|
7 |
-
<li>li</li>
|
8 |
-
</ul></li>
|
9 |
-
<li>li</li>
|
10 |
-
</ul></li>
|
11 |
-
<li>li</li>
|
12 |
-
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/deeply_nested_list.md
DELETED
@@ -1,6 +0,0 @@
|
|
1 |
-
- li
|
2 |
-
- li
|
3 |
-
- li
|
4 |
-
- li
|
5 |
-
- li
|
6 |
-
- li
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/em_strong.html
DELETED
@@ -1,8 +0,0 @@
|
|
1 |
-
<p><strong><em>em strong</em></strong></p>
|
2 |
-
<p><strong><em>em strong</em> strong</strong></p>
|
3 |
-
<p><strong>strong <em>em strong</em></strong></p>
|
4 |
-
<p><strong>strong <em>em strong</em> strong</strong></p>
|
5 |
-
<p><strong><em>em strong</em></strong></p>
|
6 |
-
<p><strong><em>em strong</em> strong</strong></p>
|
7 |
-
<p><strong>strong <em>em strong</em></strong></p>
|
8 |
-
<p><strong>strong <em>em strong</em> strong</strong></p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/em_strong.md
DELETED
@@ -1,15 +0,0 @@
|
|
1 |
-
___em strong___
|
2 |
-
|
3 |
-
___em strong_ strong__
|
4 |
-
|
5 |
-
__strong _em strong___
|
6 |
-
|
7 |
-
__strong _em strong_ strong__
|
8 |
-
|
9 |
-
***em strong***
|
10 |
-
|
11 |
-
***em strong* strong**
|
12 |
-
|
13 |
-
**strong *em strong***
|
14 |
-
|
15 |
-
**strong *em strong* strong**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/email.html
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
<p>my email is <a href="mailto:me@example.com">me@example.com</a></p>
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/email.md
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
my email is <me@example.com>
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/emphasis.html
DELETED
@@ -1,8 +0,0 @@
|
|
1 |
-
<p><em>underscore</em>, <em>asterisk</em>, <em>one two</em>, <em>three four</em>, <em>a</em>, <em>b</em></p>
|
2 |
-
<p><strong>strong</strong> and <em>em</em> and <strong>strong</strong> and <em>em</em></p>
|
3 |
-
<p><em>line
|
4 |
-
line
|
5 |
-
line</em></p>
|
6 |
-
<p>this_is_not_an_emphasis</p>
|
7 |
-
<p>an empty emphasis __ ** is not an emphasis</p>
|
8 |
-
<p>*mixed *<em>double and</em> single asterisk** spans</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/emphasis.md
DELETED
@@ -1,13 +0,0 @@
|
|
1 |
-
_underscore_, *asterisk*, _one two_, *three four*, _a_, *b*
|
2 |
-
|
3 |
-
**strong** and *em* and **strong** and *em*
|
4 |
-
|
5 |
-
_line
|
6 |
-
line
|
7 |
-
line_
|
8 |
-
|
9 |
-
this_is_not_an_emphasis
|
10 |
-
|
11 |
-
an empty emphasis __ ** is not an emphasis
|
12 |
-
|
13 |
-
*mixed **double and* single asterisk** spans
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/escaping.html
DELETED
@@ -1,6 +0,0 @@
|
|
1 |
-
<p>escaped *emphasis*.</p>
|
2 |
-
<p><code>escaped \*emphasis\* in a code span</code></p>
|
3 |
-
<pre><code>escaped \*emphasis\* in a code block</code></pre>
|
4 |
-
<p>\ ` * _ { } [ ] ( ) > # + - . !</p>
|
5 |
-
<p><em>one_two</em> <strong>one_two</strong></p>
|
6 |
-
<p><em>one*two</em> <strong>one*two</strong></p>
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/escaping.md
DELETED
@@ -1,11 +0,0 @@
|
|
1 |
-
escaped \*emphasis\*.
|
2 |
-
|
3 |
-
`escaped \*emphasis\* in a code span`
|
4 |
-
|
5 |
-
escaped \*emphasis\* in a code block
|
6 |
-
|
7 |
-
\\ \` \* \_ \{ \} \[ \] \( \) \> \# \+ \- \. \!
|
8 |
-
|
9 |
-
_one\_two_ __one\_two__
|
10 |
-
|
11 |
-
*one\*two* **one\*two**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/fenced_code_block.html
DELETED
@@ -1,6 +0,0 @@
|
|
1 |
-
<pre><code><?php
|
2 |
-
|
3 |
-
$message = 'fenced code block';
|
4 |
-
echo $message;</code></pre>
|
5 |
-
<pre><code>tilde</code></pre>
|
6 |
-
<pre><code class="language-php">echo 'language identifier';</code></pre>
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/fenced_code_block.md
DELETED
@@ -1,14 +0,0 @@
|
|
1 |
-
```
|
2 |
-
<?php
|
3 |
-
|
4 |
-
$message = 'fenced code block';
|
5 |
-
echo $message;
|
6 |
-
```
|
7 |
-
|
8 |
-
~~~
|
9 |
-
tilde
|
10 |
-
~~~
|
11 |
-
|
12 |
-
```php
|
13 |
-
echo 'language identifier';
|
14 |
-
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/horizontal_rule.html
DELETED
@@ -1,5 +0,0 @@
|
|
1 |
-
<hr />
|
2 |
-
<hr />
|
3 |
-
<hr />
|
4 |
-
<hr />
|
5 |
-
<hr />
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/horizontal_rule.md
DELETED
@@ -1,9 +0,0 @@
|
|
1 |
-
---
|
2 |
-
|
3 |
-
- - -
|
4 |
-
|
5 |
-
- - -
|
6 |
-
|
7 |
-
***
|
8 |
-
|
9 |
-
___
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/html_entity.html
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
<p>& © {</p>
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/html_entity.md
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
& © {
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/image_reference.html
DELETED
@@ -1,2 +0,0 @@
|
|
1 |
-
<p><img src="/md.png" alt="Markdown Logo" /></p>
|
2 |
-
<p>![missing reference]</p>
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/image_reference.md
DELETED
@@ -1,5 +0,0 @@
|
|
1 |
-
![Markdown Logo][image]
|
2 |
-
|
3 |
-
[image]: /md.png
|
4 |
-
|
5 |
-
![missing reference]
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/image_title.html
DELETED
@@ -1,2 +0,0 @@
|
|
1 |
-
<p><img src="/md.png" alt="alt" title="title" /></p>
|
2 |
-
<p><img src="/md.png" alt="blank title" title="" /></p>
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/image_title.md
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
![alt](/md.png "title")
|
2 |
-
|
3 |
-
![blank title](/md.png "")
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/implicit_reference.html
DELETED
@@ -1,4 +0,0 @@
|
|
1 |
-
<p>an <a href="http://example.com">implicit</a> reference link</p>
|
2 |
-
<p>an <a href="http://example.com">implicit</a> reference link with an empty link definition</p>
|
3 |
-
<p>an <a href="http://example.com">implicit</a> reference link followed by <a href="http://cnn.com">another</a></p>
|
4 |
-
<p>an <a href="http://example.com" title="Example">explicit</a> reference link with a title</p>
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/implicit_reference.md
DELETED
@@ -1,13 +0,0 @@
|
|
1 |
-
an [implicit] reference link
|
2 |
-
|
3 |
-
[implicit]: http://example.com
|
4 |
-
|
5 |
-
an [implicit][] reference link with an empty link definition
|
6 |
-
|
7 |
-
an [implicit][] reference link followed by [another][]
|
8 |
-
|
9 |
-
[another]: http://cnn.com
|
10 |
-
|
11 |
-
an [explicit][example] reference link with a title
|
12 |
-
|
13 |
-
[example]: http://example.com "Example"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/inline_link.html
DELETED
@@ -1,6 +0,0 @@
|
|
1 |
-
<p><a href="http://example.com">link</a></p>
|
2 |
-
<p><a href="/url-(parentheses)">link</a> with parentheses in URL </p>
|
3 |
-
<p>(<a href="/index.php">link</a>) in parentheses</p>
|
4 |
-
<p><a href="http://example.com"><code>link</code></a></p>
|
5 |
-
<p><a href="http://example.com"><img src="http://parsedown.org/md.png" alt="MD Logo" /></a></p>
|
6 |
-
<p><a href="http://example.com"><img src="http://parsedown.org/md.png" alt="MD Logo" /> and text</a></p>
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/inline_link.md
DELETED
@@ -1,11 +0,0 @@
|
|
1 |
-
[link](http://example.com)
|
2 |
-
|
3 |
-
[link](/url-(parentheses)) with parentheses in URL
|
4 |
-
|
5 |
-
([link](/index.php)) in parentheses
|
6 |
-
|
7 |
-
[`link`](http://example.com)
|
8 |
-
|
9 |
-
[![MD Logo](http://parsedown.org/md.png)](http://example.com)
|
10 |
-
|
11 |
-
[![MD Logo](http://parsedown.org/md.png) and text](http://example.com)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/inline_link_title.html
DELETED
@@ -1,6 +0,0 @@
|
|
1 |
-
<p><a href="http://example.com" title="Title">single quotes</a></p>
|
2 |
-
<p><a href="http://example.com" title="Title">double quotes</a></p>
|
3 |
-
<p><a href="http://example.com" title="">single quotes blank</a></p>
|
4 |
-
<p><a href="http://example.com" title="">double quotes blank</a></p>
|
5 |
-
<p><a href="http://example.com" title="2 Words">space</a></p>
|
6 |
-
<p><a href="http://example.com/url-(parentheses)" title="Title">parentheses</a></p>
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/inline_link_title.md
DELETED
@@ -1,11 +0,0 @@
|
|
1 |
-
[single quotes](http://example.com 'Title')
|
2 |
-
|
3 |
-
[double quotes](http://example.com "Title")
|
4 |
-
|
5 |
-
[single quotes blank](http://example.com '')
|
6 |
-
|
7 |
-
[double quotes blank](http://example.com "")
|
8 |
-
|
9 |
-
[space](http://example.com "2 Words")
|
10 |
-
|
11 |
-
[parentheses](http://example.com/url-(parentheses) "Title")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/inline_title.html
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
<p><a href="http://example.com" title="Example">single quotes</a> and <a href="http://example.com" title="Example">double quotes</a></p>
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/inline_title.md
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
[single quotes](http://example.com 'Example') and [double quotes](http://example.com "Example")
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/lazy_blockquote.html
DELETED
@@ -1,6 +0,0 @@
|
|
1 |
-
<blockquote>
|
2 |
-
<p>quote
|
3 |
-
the rest of it</p>
|
4 |
-
<p>another paragraph
|
5 |
-
the rest of it</p>
|
6 |
-
</blockquote>
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/lazy_blockquote.md
DELETED
@@ -1,5 +0,0 @@
|
|
1 |
-
> quote
|
2 |
-
the rest of it
|
3 |
-
|
4 |
-
> another paragraph
|
5 |
-
the rest of it
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/lazy_list.html
DELETED
@@ -1,4 +0,0 @@
|
|
1 |
-
<ul>
|
2 |
-
<li>li
|
3 |
-
the rest of it</li>
|
4 |
-
</ul>
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/lazy_list.md
DELETED
@@ -1,2 +0,0 @@
|
|
1 |
-
- li
|
2 |
-
the rest of it
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/line_break.html
DELETED
@@ -1,2 +0,0 @@
|
|
1 |
-
<p>line<br />
|
2 |
-
line</p>
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/line_break.md
DELETED
@@ -1,2 +0,0 @@
|
|
1 |
-
line
|
2 |
-
line
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/multiline_list_paragraph.html
DELETED
@@ -1,7 +0,0 @@
|
|
1 |
-
<ul>
|
2 |
-
<li>
|
3 |
-
<p>li</p>
|
4 |
-
<p>line
|
5 |
-
line</p>
|
6 |
-
</li>
|
7 |
-
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/multiline_list_paragraph.md
DELETED
@@ -1,4 +0,0 @@
|
|
1 |
-
- li
|
2 |
-
|
3 |
-
line
|
4 |
-
line
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/nested_block-level_html.html
DELETED
@@ -1,10 +0,0 @@
|
|
1 |
-
<div>
|
2 |
-
_parent_
|
3 |
-
<div>
|
4 |
-
_child_
|
5 |
-
</div>
|
6 |
-
<pre>
|
7 |
-
_adopted child_
|
8 |
-
</pre>
|
9 |
-
</div>
|
10 |
-
<p><em>outside</em></p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/nested_block-level_html.md
DELETED
@@ -1,11 +0,0 @@
|
|
1 |
-
<div>
|
2 |
-
_parent_
|
3 |
-
<div>
|
4 |
-
_child_
|
5 |
-
</div>
|
6 |
-
<pre>
|
7 |
-
_adopted child_
|
8 |
-
</pre>
|
9 |
-
</div>
|
10 |
-
|
11 |
-
_outside_
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/ordered_list.html
DELETED
@@ -1,13 +0,0 @@
|
|
1 |
-
<ol>
|
2 |
-
<li>one</li>
|
3 |
-
<li>two</li>
|
4 |
-
</ol>
|
5 |
-
<p>repeating numbers:</p>
|
6 |
-
<ol>
|
7 |
-
<li>one</li>
|
8 |
-
<li>two</li>
|
9 |
-
</ol>
|
10 |
-
<p>large numbers:</p>
|
11 |
-
<ol>
|
12 |
-
<li>one</li>
|
13 |
-
</ol>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/ordered_list.md
DELETED
@@ -1,11 +0,0 @@
|
|
1 |
-
1. one
|
2 |
-
2. two
|
3 |
-
|
4 |
-
repeating numbers:
|
5 |
-
|
6 |
-
1. one
|
7 |
-
1. two
|
8 |
-
|
9 |
-
large numbers:
|
10 |
-
|
11 |
-
123. one
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/paragraph_list.html
DELETED
@@ -1,12 +0,0 @@
|
|
1 |
-
<p>paragraph</p>
|
2 |
-
<ul>
|
3 |
-
<li>li</li>
|
4 |
-
<li>li</li>
|
5 |
-
</ul>
|
6 |
-
<p>paragraph</p>
|
7 |
-
<ul>
|
8 |
-
<li>
|
9 |
-
<p>li</p>
|
10 |
-
</li>
|
11 |
-
<li>li</li>
|
12 |
-
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/paragraph_list.md
DELETED
@@ -1,9 +0,0 @@
|
|
1 |
-
paragraph
|
2 |
-
- li
|
3 |
-
- li
|
4 |
-
|
5 |
-
paragraph
|
6 |
-
|
7 |
-
* li
|
8 |
-
|
9 |
-
* li
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/reference_title.html
DELETED
@@ -1,2 +0,0 @@
|
|
1 |
-
<p><a href="http://example.com" title="example title">double quotes</a> and <a href="http://example.com" title="example title">single quotes</a> and <a href="http://example.com" title="example title">parentheses</a></p>
|
2 |
-
<p>[invalid title]: <a href="http://example.com">http://example.com</a> example title</p>
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/reference_title.md
DELETED
@@ -1,6 +0,0 @@
|
|
1 |
-
[double quotes] and [single quotes] and [parentheses]
|
2 |
-
|
3 |
-
[double quotes]: http://example.com "example title"
|
4 |
-
[single quotes]: http://example.com 'example title'
|
5 |
-
[parentheses]: http://example.com (example title)
|
6 |
-
[invalid title]: http://example.com example title
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/self-closing_html.html
DELETED
@@ -1,12 +0,0 @@
|
|
1 |
-
<hr>
|
2 |
-
<p>paragraph</p>
|
3 |
-
<hr/>
|
4 |
-
<p>paragraph</p>
|
5 |
-
<hr />
|
6 |
-
<p>paragraph</p>
|
7 |
-
<hr class="foo" id="bar" />
|
8 |
-
<p>paragraph</p>
|
9 |
-
<hr class="foo" id="bar"/>
|
10 |
-
<p>paragraph</p>
|
11 |
-
<hr class="foo" id="bar" >
|
12 |
-
<p>paragraph</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/self-closing_html.md
DELETED
@@ -1,12 +0,0 @@
|
|
1 |
-
<hr>
|
2 |
-
paragraph
|
3 |
-
<hr/>
|
4 |
-
paragraph
|
5 |
-
<hr />
|
6 |
-
paragraph
|
7 |
-
<hr class="foo" id="bar" />
|
8 |
-
paragraph
|
9 |
-
<hr class="foo" id="bar"/>
|
10 |
-
paragraph
|
11 |
-
<hr class="foo" id="bar" >
|
12 |
-
paragraph
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/separated_nested_list.html
DELETED
@@ -1,9 +0,0 @@
|
|
1 |
-
<ul>
|
2 |
-
<li>
|
3 |
-
<p>li</p>
|
4 |
-
<ul>
|
5 |
-
<li>li</li>
|
6 |
-
<li>li</li>
|
7 |
-
</ul>
|
8 |
-
</li>
|
9 |
-
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/separated_nested_list.md
DELETED
@@ -1,4 +0,0 @@
|
|
1 |
-
- li
|
2 |
-
|
3 |
-
- li
|
4 |
-
- li
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/setext_header.html
DELETED
@@ -1,5 +0,0 @@
|
|
1 |
-
<h1>h1</h1>
|
2 |
-
<h2>h2</h2>
|
3 |
-
<h2>single character</h2>
|
4 |
-
<p>not a header</p>
|
5 |
-
<hr />
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/setext_header.md
DELETED
@@ -1,12 +0,0 @@
|
|
1 |
-
h1
|
2 |
-
==
|
3 |
-
|
4 |
-
h2
|
5 |
-
--
|
6 |
-
|
7 |
-
single character
|
8 |
-
-
|
9 |
-
|
10 |
-
not a header
|
11 |
-
|
12 |
-
------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/simple_blockquote.html
DELETED
@@ -1,11 +0,0 @@
|
|
1 |
-
<blockquote>
|
2 |
-
<p>quote</p>
|
3 |
-
</blockquote>
|
4 |
-
<p>indented:</p>
|
5 |
-
<blockquote>
|
6 |
-
<p>quote</p>
|
7 |
-
</blockquote>
|
8 |
-
<p>no space after <code>></code>:</p>
|
9 |
-
<blockquote>
|
10 |
-
<p>quote</p>
|
11 |
-
</blockquote>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/simple_blockquote.md
DELETED
@@ -1,7 +0,0 @@
|
|
1 |
-
> quote
|
2 |
-
|
3 |
-
indented:
|
4 |
-
> quote
|
5 |
-
|
6 |
-
no space after `>`:
|
7 |
-
>quote
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/simple_table.html
DELETED
@@ -1,37 +0,0 @@
|
|
1 |
-
<table>
|
2 |
-
<thead>
|
3 |
-
<tr>
|
4 |
-
<th>header 1</th>
|
5 |
-
<th>header 2</th>
|
6 |
-
</tr>
|
7 |
-
</thead>
|
8 |
-
<tbody>
|
9 |
-
<tr>
|
10 |
-
<td>cell 1.1</td>
|
11 |
-
<td>cell 1.2</td>
|
12 |
-
</tr>
|
13 |
-
<tr>
|
14 |
-
<td>cell 2.1</td>
|
15 |
-
<td>cell 2.2</td>
|
16 |
-
</tr>
|
17 |
-
</tbody>
|
18 |
-
</table>
|
19 |
-
<hr />
|
20 |
-
<table>
|
21 |
-
<thead>
|
22 |
-
<tr>
|
23 |
-
<th style="text-align: left;">header 1</th>
|
24 |
-
<th>header 2</th>
|
25 |
-
</tr>
|
26 |
-
</thead>
|
27 |
-
<tbody>
|
28 |
-
<tr>
|
29 |
-
<td style="text-align: left;">cell 1.1</td>
|
30 |
-
<td>cell 1.2</td>
|
31 |
-
</tr>
|
32 |
-
<tr>
|
33 |
-
<td style="text-align: left;">cell 2.1</td>
|
34 |
-
<td>cell 2.2</td>
|
35 |
-
</tr>
|
36 |
-
</tbody>
|
37 |
-
</table>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/simple_table.md
DELETED
@@ -1,11 +0,0 @@
|
|
1 |
-
header 1 | header 2
|
2 |
-
-------- | --------
|
3 |
-
cell 1.1 | cell 1.2
|
4 |
-
cell 2.1 | cell 2.2
|
5 |
-
|
6 |
-
---
|
7 |
-
|
8 |
-
header 1 | header 2
|
9 |
-
:------- | --------
|
10 |
-
cell 1.1 | cell 1.2
|
11 |
-
cell 2.1 | cell 2.2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/span-level_html.html
DELETED
@@ -1,5 +0,0 @@
|
|
1 |
-
<p>an <b>important</b> <a href=''>link</a></p>
|
2 |
-
<p>broken<br/>
|
3 |
-
line</p>
|
4 |
-
<p><b>inline tag</b> at the beginning</p>
|
5 |
-
<p><span><a href="http://example.com">http://example.com</a></span></p>
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/span-level_html.md
DELETED
@@ -1,8 +0,0 @@
|
|
1 |
-
an <b>important</b> <a href=''>link</a>
|
2 |
-
|
3 |
-
broken<br/>
|
4 |
-
line
|
5 |
-
|
6 |
-
<b>inline tag</b> at the beginning
|
7 |
-
|
8 |
-
<span>http://example.com</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/sparse_dense_list.html
DELETED
@@ -1,7 +0,0 @@
|
|
1 |
-
<ul>
|
2 |
-
<li>
|
3 |
-
<p>li</p>
|
4 |
-
</li>
|
5 |
-
<li>li</li>
|
6 |
-
<li>li</li>
|
7 |
-
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/sparse_dense_list.md
DELETED
@@ -1,4 +0,0 @@
|
|
1 |
-
- li
|
2 |
-
|
3 |
-
- li
|
4 |
-
- li
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/sparse_html.html
DELETED
@@ -1,8 +0,0 @@
|
|
1 |
-
<div>
|
2 |
-
line 1
|
3 |
-
|
4 |
-
line 2
|
5 |
-
line 3
|
6 |
-
|
7 |
-
line 4
|
8 |
-
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/sparse_html.md
DELETED
@@ -1,8 +0,0 @@
|
|
1 |
-
<div>
|
2 |
-
line 1
|
3 |
-
|
4 |
-
line 2
|
5 |
-
line 3
|
6 |
-
|
7 |
-
line 4
|
8 |
-
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/sparse_list.html
DELETED
@@ -1,15 +0,0 @@
|
|
1 |
-
<ul>
|
2 |
-
<li>
|
3 |
-
<p>li</p>
|
4 |
-
</li>
|
5 |
-
<li>li</li>
|
6 |
-
</ul>
|
7 |
-
<hr />
|
8 |
-
<ul>
|
9 |
-
<li>
|
10 |
-
<p>li</p>
|
11 |
-
<ul>
|
12 |
-
<li>indented li</li>
|
13 |
-
</ul>
|
14 |
-
</li>
|
15 |
-
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/sparse_list.md
DELETED
@@ -1,9 +0,0 @@
|
|
1 |
-
- li
|
2 |
-
|
3 |
-
- li
|
4 |
-
|
5 |
-
---
|
6 |
-
|
7 |
-
- li
|
8 |
-
|
9 |
-
- indented li
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/special_characters.html
DELETED
@@ -1,6 +0,0 @@
|
|
1 |
-
<p>AT&T has an ampersand in their name</p>
|
2 |
-
<p>this & that</p>
|
3 |
-
<p>4 < 5 and 6 > 5</p>
|
4 |
-
<p><a href="http://example.com/autolink?a=1&b=2">http://example.com/autolink?a=1&b=2</a></p>
|
5 |
-
<p><a href="/script?a=1&b=2">inline link</a></p>
|
6 |
-
<p><a href="http://example.com/?a=1&b=2">reference link</a></p>
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/special_characters.md
DELETED
@@ -1,13 +0,0 @@
|
|
1 |
-
AT&T has an ampersand in their name
|
2 |
-
|
3 |
-
this & that
|
4 |
-
|
5 |
-
4 < 5 and 6 > 5
|
6 |
-
|
7 |
-
<http://example.com/autolink?a=1&b=2>
|
8 |
-
|
9 |
-
[inline link](/script?a=1&b=2)
|
10 |
-
|
11 |
-
[reference link][1]
|
12 |
-
|
13 |
-
[1]: http://example.com/?a=1&b=2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/strikethrough.html
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
<p><del>strikethrough</del></p>
|
2 |
-
<p>here's <del>one</del> followed by <del>another one</del></p>
|
3 |
-
<p>~~ this ~~ is not one neither is ~this~</p>
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/strikethrough.md
DELETED
@@ -1,5 +0,0 @@
|
|
1 |
-
~~strikethrough~~
|
2 |
-
|
3 |
-
here's ~~one~~ followed by ~~another one~~
|
4 |
-
|
5 |
-
~~ this ~~ is not one neither is ~this~
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/strong_em.html
DELETED
@@ -1,6 +0,0 @@
|
|
1 |
-
<p><em>em <strong>strong em</strong></em></p>
|
2 |
-
<p><em><strong>strong em</strong> em</em></p>
|
3 |
-
<p><em>em <strong>strong em</strong> em</em></p>
|
4 |
-
<p><em>em <strong>strong em</strong></em></p>
|
5 |
-
<p><em><strong>strong em</strong> em</em></p>
|
6 |
-
<p><em>em <strong>strong em</strong> em</em></p>
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/strong_em.md
DELETED
@@ -1,11 +0,0 @@
|
|
1 |
-
*em **strong em***
|
2 |
-
|
3 |
-
***strong em** em*
|
4 |
-
|
5 |
-
*em **strong em** em*
|
6 |
-
|
7 |
-
_em __strong em___
|
8 |
-
|
9 |
-
___strong em__ em_
|
10 |
-
|
11 |
-
_em __strong em__ em_
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/tab-indented_code_block.html
DELETED
@@ -1,6 +0,0 @@
|
|
1 |
-
<pre><code><?php
|
2 |
-
|
3 |
-
$message = 'Hello World!';
|
4 |
-
echo $message;
|
5 |
-
|
6 |
-
echo "following a blank line";</code></pre>
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/tab-indented_code_block.md
DELETED
@@ -1,6 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
$message = 'Hello World!';
|
4 |
-
echo $message;
|
5 |
-
|
6 |
-
echo "following a blank line";
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/table_inline_markdown.html
DELETED
@@ -1,22 +0,0 @@
|
|
1 |
-
<table>
|
2 |
-
<thead>
|
3 |
-
<tr>
|
4 |
-
<th><em>header</em> 1</th>
|
5 |
-
<th>header 2</th>
|
6 |
-
</tr>
|
7 |
-
</thead>
|
8 |
-
<tbody>
|
9 |
-
<tr>
|
10 |
-
<td><em>cell</em> 1.1</td>
|
11 |
-
<td><del>cell</del> 1.2</td>
|
12 |
-
</tr>
|
13 |
-
<tr>
|
14 |
-
<td><code>|</code> 2.1</td>
|
15 |
-
<td>| 2.2</td>
|
16 |
-
</tr>
|
17 |
-
<tr>
|
18 |
-
<td><code>\|</code> 2.1</td>
|
19 |
-
<td><a href="/">link</a></td>
|
20 |
-
</tr>
|
21 |
-
</tbody>
|
22 |
-
</table>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/table_inline_markdown.md
DELETED
@@ -1,5 +0,0 @@
|
|
1 |
-
| _header_ 1 | header 2 |
|
2 |
-
| ------------ | ------------ |
|
3 |
-
| _cell_ 1.1 | ~~cell~~ 1.2 |
|
4 |
-
| `|` 2.1 | \| 2.2 |
|
5 |
-
| `\|` 2.1 | [link](/) |
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/text_reference.html
DELETED
@@ -1,8 +0,0 @@
|
|
1 |
-
<p><a href="http://example.com">reference link</a></p>
|
2 |
-
<p><a href="http://example.com">one</a> with a semantic name</p>
|
3 |
-
<p>[one][404] with no definition</p>
|
4 |
-
<p><a href="http://example.com">multiline
|
5 |
-
one</a> defined on 2 lines</p>
|
6 |
-
<p><a href="http://example.com">one</a> with a mixed case label and an upper case definition</p>
|
7 |
-
<p><a href="http://example.com">one</a> with the a label on the next line</p>
|
8 |
-
<p><a href="http://example.com"><code>link</code></a></p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/text_reference.md
DELETED
@@ -1,21 +0,0 @@
|
|
1 |
-
[reference link][1]
|
2 |
-
|
3 |
-
[1]: http://example.com
|
4 |
-
|
5 |
-
[one][website] with a semantic name
|
6 |
-
|
7 |
-
[website]: http://example.com
|
8 |
-
|
9 |
-
[one][404] with no definition
|
10 |
-
|
11 |
-
[multiline
|
12 |
-
one][website] defined on 2 lines
|
13 |
-
|
14 |
-
[one][Label] with a mixed case label and an upper case definition
|
15 |
-
|
16 |
-
[LABEL]: http://example.com
|
17 |
-
|
18 |
-
[one]
|
19 |
-
[1] with the a label on the next line
|
20 |
-
|
21 |
-
[`link`][website]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/unordered_list.html
DELETED
@@ -1,10 +0,0 @@
|
|
1 |
-
<ul>
|
2 |
-
<li>li</li>
|
3 |
-
<li>li</li>
|
4 |
-
</ul>
|
5 |
-
<p>mixed markers:</p>
|
6 |
-
<ul>
|
7 |
-
<li>li</li>
|
8 |
-
<li>li</li>
|
9 |
-
<li>li</li>
|
10 |
-
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/unordered_list.md
DELETED
@@ -1,8 +0,0 @@
|
|
1 |
-
- li
|
2 |
-
- li
|
3 |
-
|
4 |
-
mixed markers:
|
5 |
-
|
6 |
-
* li
|
7 |
-
+ li
|
8 |
-
- li
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/untidy_table.html
DELETED
@@ -1,18 +0,0 @@
|
|
1 |
-
<table>
|
2 |
-
<thead>
|
3 |
-
<tr>
|
4 |
-
<th>header 1</th>
|
5 |
-
<th>header 2</th>
|
6 |
-
</tr>
|
7 |
-
</thead>
|
8 |
-
<tbody>
|
9 |
-
<tr>
|
10 |
-
<td>cell 1.1</td>
|
11 |
-
<td>cell 1.2</td>
|
12 |
-
</tr>
|
13 |
-
<tr>
|
14 |
-
<td>cell 2.1</td>
|
15 |
-
<td>cell 2.2</td>
|
16 |
-
</tr>
|
17 |
-
</tbody>
|
18 |
-
</table>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/untidy_table.md
DELETED
@@ -1,4 +0,0 @@
|
|
1 |
-
| header 1 | header 2 |
|
2 |
-
| ------------- | ----------- |
|
3 |
-
| cell 1.1 | cell 1.2 |
|
4 |
-
| cell 2.1 | cell 2.2 |
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/url_autolinking.html
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
<p>an autolink <a href="http://example.com">http://example.com</a></p>
|
2 |
-
<p>inside of brackets [<a href="http://example.com">http://example.com</a>], inside of braces {<a href="http://example.com">http://example.com</a>}, inside of parentheses (<a href="http://example.com">http://example.com</a>)</p>
|
3 |
-
<p>trailing slash <a href="http://example.com/">http://example.com/</a> and <a href="http://example.com/path/">http://example.com/path/</a></p>
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/url_autolinking.md
DELETED
@@ -1,5 +0,0 @@
|
|
1 |
-
an autolink http://example.com
|
2 |
-
|
3 |
-
inside of brackets [http://example.com], inside of braces {http://example.com}, inside of parentheses (http://example.com)
|
4 |
-
|
5 |
-
trailing slash http://example.com/ and http://example.com/path/
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/whitespace.html
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
<pre><code>code</code></pre>
|
|
includes/libraries/aihrus-framework/includes/libraries/parsedown/test/data/whitespace.md
DELETED
@@ -1,5 +0,0 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
code
|
4 |
-
|
5 |
-
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/includes/libraries/wp_custom_post_status.php
DELETED
@@ -1,234 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
if ( class_exists ( 'wp_custom_post_status' ) ) {
|
3 |
-
return;
|
4 |
-
}
|
5 |
-
|
6 |
-
// No, Thanks. Direct file access forbidden.
|
7 |
-
! defined( 'ABSPATH' ) AND exit;
|
8 |
-
/*
|
9 |
-
Plugin Name: Custom Post Status
|
10 |
-
Plugin URI: http://
|
11 |
-
Description: Adds a custom post status for posts, pages or custom post types
|
12 |
-
Author: Franz Josef Kaiser
|
13 |
-
Version: 2012-06-14.1426
|
14 |
-
Author URI: http://unserkaiser.com/
|
15 |
-
License: MIT
|
16 |
-
*/
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
class wp_custom_post_status
|
21 |
-
{
|
22 |
-
/**
|
23 |
-
* Name of the post status
|
24 |
-
* Must be lower case
|
25 |
-
*
|
26 |
-
* @access protected
|
27 |
-
* @var string
|
28 |
-
*/
|
29 |
-
public $post_status;
|
30 |
-
|
31 |
-
|
32 |
-
/**
|
33 |
-
* Post type (slug) where the post status should appear
|
34 |
-
*
|
35 |
-
* @access protected
|
36 |
-
* @var string/array
|
37 |
-
*/
|
38 |
-
public $post_type = array( 'post', 'page' );
|
39 |
-
|
40 |
-
|
41 |
-
/**
|
42 |
-
* Custom Args for the post status
|
43 |
-
*
|
44 |
-
* @access protected
|
45 |
-
* @var string
|
46 |
-
*/
|
47 |
-
public $args;
|
48 |
-
|
49 |
-
|
50 |
-
/**
|
51 |
-
* Track jQuery firing
|
52 |
-
*
|
53 |
-
* @access protected
|
54 |
-
* @var boolean
|
55 |
-
*/
|
56 |
-
private static $jquery_ran = false;
|
57 |
-
|
58 |
-
|
59 |
-
/**
|
60 |
-
* Construct
|
61 |
-
* @return void
|
62 |
-
*/
|
63 |
-
public function __construct()
|
64 |
-
{
|
65 |
-
#echo '<pre>'; print_r( $this ); echo '</pre>';
|
66 |
-
// We need to have at least a post status name
|
67 |
-
if ( ! isset( $this->post_status ) )
|
68 |
-
return;
|
69 |
-
|
70 |
-
add_action( 'init', array( $this, 'add_post_status' ), 0 );
|
71 |
-
|
72 |
-
foreach ( array( 'post', 'post-new' ) as $hook )
|
73 |
-
add_action( "admin_footer-{$hook}.php", array( $this,'extend_submitdiv_post_status' ) );
|
74 |
-
}
|
75 |
-
|
76 |
-
|
77 |
-
/**
|
78 |
-
* Add a new post status of "Unavailable"
|
79 |
-
*
|
80 |
-
* @return void
|
81 |
-
*/
|
82 |
-
public function add_post_status()
|
83 |
-
{
|
84 |
-
$defaults = array(
|
85 |
-
'label_count' => false
|
86 |
-
// defaults to FALSE
|
87 |
-
,'hierarchical' => false
|
88 |
-
// defaults to FALSE
|
89 |
-
,'public' => true
|
90 |
-
// If NULL, then inherits "public"
|
91 |
-
,'publicly_queryable' => null
|
92 |
-
|
93 |
-
// most important switch
|
94 |
-
,'internal' => false
|
95 |
-
// If NULL, inherits from "internal"
|
96 |
-
,'exclude_from_search' => null
|
97 |
-
// If NULL, inherits from "internal"
|
98 |
-
,'show_in_admin_all_list' => null
|
99 |
-
// If NULL, inherits from "internal"
|
100 |
-
,'show_in_admin_status_list' => null
|
101 |
-
|
102 |
-
// If NULL, will be set to FALSE
|
103 |
-
,'protected' => null
|
104 |
-
// If NULL, will be set to FALSE
|
105 |
-
,'private' => null
|
106 |
-
// not set by the core function - defaults to NULL
|
107 |
-
,'show_in_admin_all' => null
|
108 |
-
// defaults to "post"
|
109 |
-
,'capability_type' => 'post'
|
110 |
-
,'single_view_cap' => null
|
111 |
-
// @internal use only - don't touch
|
112 |
-
,'_builtin' => false
|
113 |
-
,'_edit_link' => 'post.php?post=%d'
|
114 |
-
);
|
115 |
-
|
116 |
-
// if FALSE, will take the 1st fn arg
|
117 |
-
$defaults['label'] = __(
|
118 |
-
ucwords( str_replace(
|
119 |
-
array( '_', '-' )
|
120 |
-
,array( ' ', ' ' )
|
121 |
-
,$this->post_status
|
122 |
-
) )
|
123 |
-
,'cps_textdomain'
|
124 |
-
);
|
125 |
-
|
126 |
-
// Care about counters:
|
127 |
-
// If FALSE, will be set to array( $args->label, $args->label ), which is not desired
|
128 |
-
$defaults['label_count'] = _n_noop(
|
129 |
-
"{$defaults['label']} <span class='count'>(%s)</span>"
|
130 |
-
,"{$defaults['label']} <span class='count'>(%s)</span>"
|
131 |
-
,'cps_textdomain'
|
132 |
-
);
|
133 |
-
|
134 |
-
// Register the status: Merge Args with defaults
|
135 |
-
register_post_status(
|
136 |
-
$this->post_status
|
137 |
-
,wp_parse_args(
|
138 |
-
$this->args
|
139 |
-
,$defaults
|
140 |
-
)
|
141 |
-
);
|
142 |
-
}
|
143 |
-
|
144 |
-
|
145 |
-
/**
|
146 |
-
* Adds post status to the "submitdiv" Meta Box and post type WP List Table screens
|
147 |
-
*
|
148 |
-
* @return void
|
149 |
-
*/
|
150 |
-
public function extend_submitdiv_post_status()
|
151 |
-
{
|
152 |
-
if ( self::$jquery_ran )
|
153 |
-
return;
|
154 |
-
else
|
155 |
-
self::$jquery_ran = true;
|
156 |
-
|
157 |
-
// Abort if we're on the wrong post type, but only if we got a restriction
|
158 |
-
if ( empty( $this->post_type ) )
|
159 |
-
return;
|
160 |
-
|
161 |
-
global $post_type;
|
162 |
-
if ( is_array( $this->post_type ) )
|
163 |
-
{
|
164 |
-
if ( in_array( $post_type, $this->post_type ) )
|
165 |
-
return;
|
166 |
-
}
|
167 |
-
elseif ( $this->post_type !== $post_type )
|
168 |
-
{
|
169 |
-
return;
|
170 |
-
}
|
171 |
-
|
172 |
-
// Our post status and post type objects
|
173 |
-
global $wp_post_statuses, $post;
|
174 |
-
|
175 |
-
// Get all non-builtin post status and add them as <option>
|
176 |
-
$options = $display = '';
|
177 |
-
foreach ( $wp_post_statuses as $status )
|
178 |
-
{
|
179 |
-
if ( ! empty( $status->internal ) )
|
180 |
-
continue;
|
181 |
-
|
182 |
-
if ( ! empty( $status->private ) )
|
183 |
-
continue;
|
184 |
-
|
185 |
-
if ( ! empty( $status->protected ) )
|
186 |
-
continue;
|
187 |
-
|
188 |
-
if ( empty( $status->_builtin ) )
|
189 |
-
{
|
190 |
-
if ( ! empty( $status->label_count['domain'] ) && 'cps_textdomain' != $status->label_count['domain'] )
|
191 |
-
continue;
|
192 |
-
|
193 |
-
}
|
194 |
-
|
195 |
-
// Match against the current posts status
|
196 |
-
$selected = selected( $post->post_status, $status->name, false );
|
197 |
-
|
198 |
-
// If we one of our custom post status is selected, remember it
|
199 |
-
$selected AND $display = $status->label;
|
200 |
-
|
201 |
-
// Build the options
|
202 |
-
$options .= "<option{$selected} value='{$status->name}'>{$status->label}</option>";
|
203 |
-
|
204 |
-
}
|
205 |
-
?>
|
206 |
-
<script type="text/javascript">
|
207 |
-
jQuery( document ).ready( function($)
|
208 |
-
{
|
209 |
-
var appended = false;
|
210 |
-
|
211 |
-
<?php
|
212 |
-
// Add the selected post status label to the "Status: [Name] (Edit)"
|
213 |
-
if ( ! empty( $display ) ) :
|
214 |
-
?>
|
215 |
-
$( '#post-status-display' ).html( '<?php echo $display; ?>' )
|
216 |
-
<?php
|
217 |
-
endif;
|
218 |
-
|
219 |
-
// Add the options to the <select> element
|
220 |
-
?>
|
221 |
-
$( '.edit-post-status' ).on( 'click', function()
|
222 |
-
{
|
223 |
-
if ( !appended )
|
224 |
-
{
|
225 |
-
var select = $( '#post-status-select' ).find( 'select' );
|
226 |
-
$( select ).append( "<?php echo $options; ?>" );
|
227 |
-
appended = true;
|
228 |
-
}
|
229 |
-
} );
|
230 |
-
} );
|
231 |
-
</script>
|
232 |
-
<?php
|
233 |
-
}
|
234 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/interface-aihrus-common.php
DELETED
@@ -1,27 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/*
|
3 |
-
Copyright 2014 Michael Cannon (email: mc@aihr.us)
|
4 |
-
|
5 |
-
This program is free software; you can redistribute it and/or modify
|
6 |
-
it under the terms of the GNU General Public License, version 2, as
|
7 |
-
published by the Free Software Foundation.
|
8 |
-
|
9 |
-
This program is distributed in the hope that it will be useful,
|
10 |
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11 |
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12 |
-
GNU General Public License for more details.
|
13 |
-
|
14 |
-
You should have received a copy of the GNU General Public License
|
15 |
-
along with this program; if not, write to the Free Software
|
16 |
-
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
17 |
-
*/
|
18 |
-
|
19 |
-
if ( class_exists( 'Aihrus_Common_Interface' ) )
|
20 |
-
return;
|
21 |
-
|
22 |
-
|
23 |
-
interface Aihrus_Common_Interface {
|
24 |
-
}
|
25 |
-
|
26 |
-
|
27 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/interface-aihrus-licensing.php
DELETED
@@ -1,28 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/*
|
3 |
-
Copyright 2014 Michael Cannon (email: mc@aihr.us)
|
4 |
-
|
5 |
-
This program is free software; you can redistribute it and/or modify
|
6 |
-
it under the terms of the GNU General Public License, version 2, as
|
7 |
-
published by the Free Software Foundation.
|
8 |
-
|
9 |
-
This program is distributed in the hope that it will be useful,
|
10 |
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11 |
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12 |
-
GNU General Public License for more details.
|
13 |
-
|
14 |
-
You should have received a copy of the GNU General Public License
|
15 |
-
along with this program; if not, write to the Free Software
|
16 |
-
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
17 |
-
*/
|
18 |
-
|
19 |
-
if ( class_exists( 'Aihrus_Licensing_Interface' ) )
|
20 |
-
return;
|
21 |
-
|
22 |
-
|
23 |
-
interface Aihrus_Licensing_Interface {
|
24 |
-
public function settings( $settings );
|
25 |
-
}
|
26 |
-
|
27 |
-
|
28 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/interface-aihrus-widget.php
DELETED
@@ -1,33 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/*
|
3 |
-
Copyright 2014 Michael Cannon (email: mc@aihr.us)
|
4 |
-
|
5 |
-
This program is free software; you can redistribute it and/or modify
|
6 |
-
it under the terms of the GNU General Public License, version 2, as
|
7 |
-
published by the Free Software Foundation.
|
8 |
-
|
9 |
-
This program is distributed in the hope that it will be useful,
|
10 |
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11 |
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12 |
-
GNU General Public License for more details.
|
13 |
-
|
14 |
-
You should have received a copy of the GNU General Public License
|
15 |
-
along with this program; if not, write to the Free Software
|
16 |
-
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
17 |
-
*/
|
18 |
-
|
19 |
-
if ( class_exists( 'Aihrus_Widget_Interface' ) )
|
20 |
-
return;
|
21 |
-
|
22 |
-
|
23 |
-
interface Aihrus_Widget_Interface {
|
24 |
-
public static function form_instance( $instance );
|
25 |
-
public static function form_parts( $instance, $number );
|
26 |
-
public static function get_content( $instance, $widget_number );
|
27 |
-
public static function get_defaults();
|
28 |
-
public static function get_suggest( $id, $suggest_id );
|
29 |
-
public static function validate_settings( $instance );
|
30 |
-
}
|
31 |
-
|
32 |
-
|
33 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/aihrus-framework/requirements.php
DELETED
@@ -1,270 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/*
|
3 |
-
Copyright 2014 Michael Cannon (email: mc@aihr.us)
|
4 |
-
|
5 |
-
This program is free software; you can redistribute it and/or modify
|
6 |
-
it under the terms of the GNU General Public License, version 2, as
|
7 |
-
published by the Free Software Foundation.
|
8 |
-
|
9 |
-
This program is distributed in the hope that it will be useful,
|
10 |
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11 |
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12 |
-
GNU General Public License for more details.
|
13 |
-
|
14 |
-
You should have received a copy of the GNU General Public License
|
15 |
-
along with this program; if not, write to the Free Software
|
16 |
-
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
17 |
-
*/
|
18 |
-
|
19 |
-
if ( ! defined( 'AIHR_BASE' ) )
|
20 |
-
define( 'AIHR_BASE', __FILE__ );
|
21 |
-
|
22 |
-
if ( ! defined( 'AIHR_VERSION' ) )
|
23 |
-
define( 'AIHR_VERSION', '1.0.4RC2' );
|
24 |
-
|
25 |
-
require_once ABSPATH . 'wp-admin/includes/plugin.php';
|
26 |
-
|
27 |
-
if ( ! function_exists( 'aihr_check_aihrus_framework' ) ) {
|
28 |
-
function aihr_check_aihrus_framework( $file = null, $name = null, $aihr_min = '1.0.0' ) {
|
29 |
-
if ( is_null( $file ) ) {
|
30 |
-
aihr_notice_error( __( '`aihr_check_aihrus_framework` requires $file argument' ) );
|
31 |
-
|
32 |
-
return false;
|
33 |
-
}
|
34 |
-
|
35 |
-
if ( ! defined( 'AIHR_VERSION' ) ) {
|
36 |
-
$check_okay = false;
|
37 |
-
} else {
|
38 |
-
$check_okay = version_compare( AIHR_VERSION, $aihr_min, '>=' );
|
39 |
-
}
|
40 |
-
|
41 |
-
$file = plugin_basename( $file );
|
42 |
-
if ( ! $check_okay && __FILE__ != $file ) {
|
43 |
-
deactivate_plugins( $file );
|
44 |
-
|
45 |
-
if ( ! defined( 'AIHR_VERSION_FILE' ) ) {
|
46 |
-
define( 'AIHR_VERSION_FILE', $file );
|
47 |
-
}
|
48 |
-
|
49 |
-
if ( ! is_null( $name ) && ! defined( 'AIHR_VERSION_NAME' ) ) {
|
50 |
-
define( 'AIHR_VERSION_NAME', $name );
|
51 |
-
}
|
52 |
-
|
53 |
-
if ( ! defined( 'AIHR_VERSION_MIN' ) ) {
|
54 |
-
define( 'AIHR_VERSION_MIN', $aihr_min );
|
55 |
-
}
|
56 |
-
|
57 |
-
add_action( 'admin_notices', 'aihr_notice_aihrus_framework' );
|
58 |
-
}
|
59 |
-
|
60 |
-
return $check_okay;
|
61 |
-
}
|
62 |
-
}
|
63 |
-
|
64 |
-
if ( ! function_exists( 'aihr_notice_aihrus_framework' ) ) {
|
65 |
-
function aihr_notice_aihrus_framework() {
|
66 |
-
if ( defined( 'AIHR_VERSION_NAME' ) ) {
|
67 |
-
$name = AIHR_VERSION_NAME;
|
68 |
-
} else {
|
69 |
-
$name = basename( dirname( AIHR_VERSION_FILE ) );
|
70 |
-
$name = str_replace( '-', ' ', $name );
|
71 |
-
$name = ucwords( $name );
|
72 |
-
}
|
73 |
-
|
74 |
-
$help_url = esc_url( 'https://aihrus.zendesk.com/entries/35689458' );
|
75 |
-
$help_link = sprintf( __( '<a href="%1$s">Update plugins</a>. <a href="%2$s">More information</a>.' ), self_admin_url( 'update-core.php' ), $help_url );
|
76 |
-
|
77 |
-
$note = '';
|
78 |
-
if ( defined( 'AIHR_BASE' ) ) {
|
79 |
-
$plugin = plugin_basename( AIHR_BASE );
|
80 |
-
$plugin = explode( '/', $plugin );
|
81 |
-
|
82 |
-
$plugin_name = $plugin[0];
|
83 |
-
$plugin_name = str_replace( '-', ' ', $plugin_name );
|
84 |
-
$plugin_name = ucwords( $plugin_name );
|
85 |
-
|
86 |
-
$note = sprintf( esc_html__( 'Plugin "%1$s" is causing the out of date issue.' ), $plugin_name );
|
87 |
-
}
|
88 |
-
|
89 |
-
$aihr_version = defined( 'AIHR_VERSION' ) ? AIHR_VERSION : '0.0.0';
|
90 |
-
|
91 |
-
$text = sprintf( esc_html__( 'Plugin "%1$s" has been deactivated as it requires Aihrus Framework %2$s or newer. You\'re running Aihrus Framework %4$s. Once corrected, "%1$s" can be activated. %5$s %3$s' ), $name, AIHR_VERSION_MIN, $help_link, $aihr_version, $note );
|
92 |
-
|
93 |
-
aihr_notice_error( $text );
|
94 |
-
}
|
95 |
-
}
|
96 |
-
|
97 |
-
if ( ! function_exists( 'aihr_check_php' ) ) {
|
98 |
-
function aihr_check_php( $file = null, $name = null, $php_min = '5.3.0' ) {
|
99 |
-
if ( is_null( $file ) ) {
|
100 |
-
aihr_notice_error( __( '`aihr_check_php` requires $file argument' ) );
|
101 |
-
|
102 |
-
return false;
|
103 |
-
}
|
104 |
-
|
105 |
-
$check_okay = version_compare( PHP_VERSION, $php_min, '>=' );
|
106 |
-
$file = plugin_basename( $file );
|
107 |
-
if ( ! $check_okay && __FILE__ != $file ) {
|
108 |
-
deactivate_plugins( $file );
|
109 |
-
|
110 |
-
if ( ! defined( 'AIHR_PHP_VERSION_FILE' ) ) {
|
111 |
-
define( 'AIHR_PHP_VERSION_FILE', $file );
|
112 |
-
}
|
113 |
-
|
114 |
-
if ( ! is_null( $name ) && ! defined( 'AIHR_PHP_VERSION_NAME' ) ) {
|
115 |
-
define( 'AIHR_PHP_VERSION_NAME', $name );
|
116 |
-
}
|
117 |
-
|
118 |
-
if ( ! defined( 'AIHR_PHP_VERSION_MIN' ) ) {
|
119 |
-
define( 'AIHR_PHP_VERSION_MIN', $php_min );
|
120 |
-
}
|
121 |
-
|
122 |
-
add_action( 'admin_notices', 'aihr_notice_php' );
|
123 |
-
}
|
124 |
-
|
125 |
-
return $check_okay;
|
126 |
-
}
|
127 |
-
}
|
128 |
-
|
129 |
-
if ( ! function_exists( 'aihr_notice_php' ) ) {
|
130 |
-
function aihr_notice_php() {
|
131 |
-
if ( defined( 'AIHR_PHP_VERSION_NAME' ) ) {
|
132 |
-
$name = AIHR_PHP_VERSION_NAME;
|
133 |
-
} else {
|
134 |
-
$name = basename( dirname( AIHR_PHP_VERSION_FILE ) );
|
135 |
-
$name = str_replace( '-', ' ', $name );
|
136 |
-
$name = ucwords( $name );
|
137 |
-
}
|
138 |
-
|
139 |
-
$help_url = esc_url( 'https://aihrus.zendesk.com/entries/30678006' );
|
140 |
-
|
141 |
-
$text = sprintf( __( 'Plugin "%1$s" has been deactivated as it requires PHP %2$s or newer. You\'re running PHP %4$s. Once corrected, "%1$s" can be activated. <a href="%3$s">More information</a>.' ), $name, AIHR_PHP_VERSION_MIN, $help_url, PHP_VERSION );
|
142 |
-
|
143 |
-
aihr_notice_error( $text );
|
144 |
-
}
|
145 |
-
}
|
146 |
-
|
147 |
-
if ( ! function_exists( 'aihr_check_wp' ) ) {
|
148 |
-
function aihr_check_wp( $file = null, $name = null, $wp_min = '3.6' ) {
|
149 |
-
if ( is_null( $file ) ) {
|
150 |
-
aihr_notice_error( __( '`aihr_check_wp` requires $file argument' ) );
|
151 |
-
|
152 |
-
return false;
|
153 |
-
}
|
154 |
-
|
155 |
-
global $wp_version;
|
156 |
-
|
157 |
-
$check_okay = version_compare( $wp_version, $wp_min, '>=' );
|
158 |
-
$file = plugin_basename( $file );
|
159 |
-
if ( ! $check_okay && __FILE__ != $file ) {
|
160 |
-
deactivate_plugins( $file );
|
161 |
-
|
162 |
-
if ( ! defined( 'AIHR_WP_VERSION_FILE' ) ) {
|
163 |
-
define( 'AIHR_WP_VERSION_FILE', $file );
|
164 |
-
}
|
165 |
-
|
166 |
-
if ( ! is_null( $name ) && ! defined( 'AIHR_WP_VERSION_NAME' ) ) {
|
167 |
-
define( 'AIHR_WP_VERSION_NAME', $name );
|
168 |
-
}
|
169 |
-
|
170 |
-
if ( ! defined( 'AIHR_WP_VERSION_MIN' ) ) {
|
171 |
-
define( 'AIHR_WP_VERSION_MIN', $wp_min );
|
172 |
-
}
|
173 |
-
|
174 |
-
add_action( 'admin_notices', 'aihr_notice_wp' );
|
175 |
-
}
|
176 |
-
|
177 |
-
return $check_okay;
|
178 |
-
}
|
179 |
-
}
|
180 |
-
|
181 |
-
if ( ! function_exists( 'aihr_notice_wp' ) ) {
|
182 |
-
function aihr_notice_wp() {
|
183 |
-
global $wp_version;
|
184 |
-
|
185 |
-
if ( defined( 'AIHR_WP_VERSION_NAME' ) ) {
|
186 |
-
$name = AIHR_WP_VERSION_NAME;
|
187 |
-
} else {
|
188 |
-
$name = basename( dirname( AIHR_WP_VERSION_FILE ) );
|
189 |
-
$name = str_replace( '-', ' ', $name );
|
190 |
-
$name = ucwords( $name );
|
191 |
-
}
|
192 |
-
|
193 |
-
$help_url = network_admin_url( 'update-core.php' );
|
194 |
-
|
195 |
-
$text = sprintf( __( 'Plugin "%1$s" has been deactivated as it requires WordPress %2$s or newer. You\'re running WordPress %4$s. Once corrected, "%1$s" can be activated. <a href="%3$s">Update WordPress</a>.' ), $name, AIHR_WP_VERSION_MIN, $help_url, $wp_version );
|
196 |
-
|
197 |
-
aihr_notice_error( $text );
|
198 |
-
}
|
199 |
-
}
|
200 |
-
|
201 |
-
if ( ! function_exists( 'aihr_notice_error' ) ) {
|
202 |
-
function aihr_notice_error( $text ) {
|
203 |
-
aihr_notice_updated( $text, 'error' );
|
204 |
-
}
|
205 |
-
}
|
206 |
-
|
207 |
-
if ( ! function_exists( 'aihr_notice_updated' ) ) {
|
208 |
-
function aihr_notice_updated( $text, $class = 'updated' ) {
|
209 |
-
if ( 'updated' == $class )
|
210 |
-
$class .= ' fade';
|
211 |
-
|
212 |
-
$content = '';
|
213 |
-
$content .= '<div class="' . $class . '"><p>';
|
214 |
-
$content .= $text;
|
215 |
-
$content .= '</p></div>';
|
216 |
-
|
217 |
-
echo $content;
|
218 |
-
}
|
219 |
-
}
|
220 |
-
|
221 |
-
if ( ! function_exists( 'aihr_notice_version' ) ) {
|
222 |
-
function aihr_notice_version( $required_base, $required_name, $required_slug, $required_version, $item_name ) {
|
223 |
-
$is_active = is_plugin_active( $required_base );
|
224 |
-
if ( $is_active )
|
225 |
-
$link = sprintf( __( '<a href="%1$s">update to</a>' ), self_admin_url( 'update-core.php' ) );
|
226 |
-
else {
|
227 |
-
$plugins = get_plugins();
|
228 |
-
if ( empty( $plugins[ $required_base ] ) ) {
|
229 |
-
$install = esc_url( wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=' . $required_slug ), 'install-plugin_' . $required_slug ) );
|
230 |
-
$link = sprintf( __( '<a href="%1$s">install</a>' ), $install );
|
231 |
-
} else {
|
232 |
-
$activate = esc_url( wp_nonce_url( admin_url( 'plugins.php?action=activate&plugin=' . $required_base ), 'activate-plugin_' . $required_base ) );
|
233 |
-
$link = sprintf( __( '<a href="%1$s">activate</a>' ), $activate );
|
234 |
-
}
|
235 |
-
}
|
236 |
-
|
237 |
-
$text = sprintf( __( 'Plugin "%3$s" has been deactivated. Please %1$s "%4$s" version %2$s or newer before activating "%3$s".' ), $link, $required_version, $item_name, $required_name );
|
238 |
-
|
239 |
-
aihr_notice_error( $text );
|
240 |
-
}
|
241 |
-
}
|
242 |
-
|
243 |
-
if ( ! function_exists( 'aihr_notice_license' ) ) {
|
244 |
-
function aihr_notice_license( $post_type, $settings_id, $free_name, $purchase_url, $item_name ) {
|
245 |
-
if ( empty( $post_type ) )
|
246 |
-
$link = get_admin_url() . 'options-general.php?page=' . $settings_id;
|
247 |
-
else
|
248 |
-
$link = get_admin_url() . 'edit.php?post_type=' . $post_type . '&page=' . $settings_id;
|
249 |
-
|
250 |
-
$text = __( '<a href="%1$s">%2$s > Settings</a>, <em>Premium</em> tab, <em>License Key</em> entry' );
|
251 |
-
|
252 |
-
$settings_link = sprintf( $text, $link, $free_name );
|
253 |
-
|
254 |
-
$link = esc_url( 'https://aihrus.zendesk.com/entries/28745227' );
|
255 |
-
$text = __( '<a href="%s">Where\'s my license key?</a>' );
|
256 |
-
|
257 |
-
$faq_link = sprintf( $text, $link );
|
258 |
-
|
259 |
-
$link = esc_url( $purchase_url );
|
260 |
-
$text = __( '<a href="%1$s">%2$s</a>' );
|
261 |
-
|
262 |
-
$buy_link = sprintf( $text, $link, $item_name );
|
263 |
-
|
264 |
-
$text = sprintf( __( 'Plugin "%1$s" requires license activation before updating will work. Please activate the license key through %2$s. No license key? See "%3$s" or purchase "%4$s".' ), $item_name, $settings_link, $faq_link, $buy_link );
|
265 |
-
|
266 |
-
aihr_notice_error( $text );
|
267 |
-
}
|
268 |
-
}
|
269 |
-
|
270 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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"curly": true,
|
5 |
-
"eqeqeq": true,
|
6 |
-
"eqnull": true,
|
7 |
-
"esnext": true,
|
8 |
-
"immed": true,
|
9 |
-
"jquery": true,
|
10 |
-
"latedef": true,
|
11 |
-
"newcap": true,
|
12 |
-
"noarg": true,
|
13 |
-
"node": true,
|
14 |
-
"strict": false,
|
15 |
-
"trailing": true
|
16 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/bxslider-4/CONTRIBUTING.md
DELETED
@@ -1,118 +0,0 @@
|
|
1 |
-
# Contributing to this project
|
2 |
-
|
3 |
-
Please take a moment to review this document in order to make the contribution
|
4 |
-
process easy and effective for everyone involved.
|
5 |
-
|
6 |
-
Following these guidelines helps to communicate that you respect the time of
|
7 |
-
the developers managing and developing this open source project. In return,
|
8 |
-
they should reciprocate that respect in addressing your issue or assessing
|
9 |
-
patches and features.
|
10 |
-
|
11 |
-
|
12 |
-
## Using the issue tracker
|
13 |
-
|
14 |
-
The issue tracker is the preferred channel for [bug reports](#bugs),
|
15 |
-
[features requests](#features) and [submitting pull
|
16 |
-
requests](#pull-requests), but please respect the following restrictions:
|
17 |
-
|
18 |
-
* Please **do not** use the issue tracker for personal support requests.
|
19 |
-
|
20 |
-
* Please **do not** derail or troll issues. Keep the discussion on topic and
|
21 |
-
respect the opinions of others.
|
22 |
-
|
23 |
-
|
24 |
-
<a name="bugs"></a>
|
25 |
-
## Bug reports
|
26 |
-
|
27 |
-
A bug is a _demonstrable problem_ that is caused by the code in the repository.
|
28 |
-
Good bug reports are extremely helpful - thank you!
|
29 |
-
|
30 |
-
Guidelines for bug reports:
|
31 |
-
|
32 |
-
1. **Use the GitHub issue search** — check if the issue has already been
|
33 |
-
reported.
|
34 |
-
|
35 |
-
2. **Check if the issue has been fixed** — try to reproduce it using the
|
36 |
-
latest `master` or development branch in the repository.
|
37 |
-
|
38 |
-
3. **Isolate the problem** — make sure that the code in the repository is
|
39 |
-
_definitely_ responsible for the issue.
|
40 |
-
|
41 |
-
A good bug report shouldn't leave others needing to chase you up for more
|
42 |
-
information. Please try to be as detailed as possible in your report. Examples are
|
43 |
-
important, please try to provide them.
|
44 |
-
|
45 |
-
|
46 |
-
<a name="features"></a>
|
47 |
-
## Feature requests
|
48 |
-
|
49 |
-
Feature requests are welcome. But take a moment to find out whether your idea
|
50 |
-
fits with the scope and aims of the project. It's up to *you* to make a strong
|
51 |
-
case to convince the developers of the merits of this feature. Please
|
52 |
-
provide as much detail and context as possible.
|
53 |
-
|
54 |
-
|
55 |
-
<a name="pull-requests"></a>
|
56 |
-
## Pull requests
|
57 |
-
|
58 |
-
Good pull requests - patches, improvements, new features - are a fantastic
|
59 |
-
help. They should remain focused in scope and avoid containing unrelated
|
60 |
-
commits.
|
61 |
-
|
62 |
-
**Please ask first** before embarking on any significant pull request (e.g.
|
63 |
-
implementing features, refactoring code), otherwise you risk spending a lot of
|
64 |
-
time working on something that the developers might not want to merge into the
|
65 |
-
project.
|
66 |
-
|
67 |
-
Please adhere to the coding conventions used throughout the project (indentation,
|
68 |
-
comments, etc.).
|
69 |
-
|
70 |
-
Adhering to the following this process is the best way to get your work
|
71 |
-
merged:
|
72 |
-
|
73 |
-
1. [Fork](http://help.github.com/fork-a-repo/) the repo, clone your fork,
|
74 |
-
and configure the remotes:
|
75 |
-
|
76 |
-
```bash
|
77 |
-
# Clone your fork of the repo into the current directory
|
78 |
-
git clone https://github.com/<your-username>/<repo-name>
|
79 |
-
# Navigate to the newly cloned directory
|
80 |
-
cd <repo-name>
|
81 |
-
# Assign the original repo to a remote called "upstream"
|
82 |
-
git remote add upstream https://github.com/<upsteam-owner>/<repo-name>
|
83 |
-
```
|
84 |
-
|
85 |
-
2. If you cloned a while ago, get the latest changes from upstream:
|
86 |
-
|
87 |
-
```bash
|
88 |
-
git checkout <dev-branch>
|
89 |
-
git pull upstream <dev-branch>
|
90 |
-
```
|
91 |
-
|
92 |
-
3. Create a new topic branch (off the main project development branch) to
|
93 |
-
contain your feature, change, or fix:
|
94 |
-
|
95 |
-
```bash
|
96 |
-
git checkout -b <topic-branch-name>
|
97 |
-
```
|
98 |
-
|
99 |
-
4. Commit your changes in logical chunks. Please adhere to these [git commit
|
100 |
-
message guidelines](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)
|
101 |
-
or your code is unlikely be merged into the main project. Use Git's
|
102 |
-
[interactive rebase](https://help.github.com/articles/interactive-rebase)
|
103 |
-
feature to tidy up your commits before making them public.
|
104 |
-
|
105 |
-
5. Locally merge (or rebase) the upstream development branch into your topic branch:
|
106 |
-
|
107 |
-
```bash
|
108 |
-
git pull [--rebase] upstream <dev-branch>
|
109 |
-
```
|
110 |
-
|
111 |
-
6. Push your topic branch up to your fork:
|
112 |
-
|
113 |
-
```bash
|
114 |
-
git push origin <topic-branch-name>
|
115 |
-
```
|
116 |
-
|
117 |
-
10. [Open a Pull Request](https://help.github.com/articles/using-pull-requests/)
|
118 |
-
with a clear title and description.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/bxslider-4/Gruntfile.js
DELETED
@@ -1,326 +0,0 @@
|
|
1 |
-
/**
|
2 |
-
* bxSlider
|
3 |
-
*
|
4 |
-
* Steven Wanderski
|
5 |
-
*
|
6 |
-
* Copyright (c) 2014
|
7 |
-
* Licensed under the MIT license.
|
8 |
-
*/
|
9 |
-
module.exports = function(grunt) {
|
10 |
-
|
11 |
-
var path = require('path');
|
12 |
-
|
13 |
-
if (!grunt.file.isDir('bower_components')) {
|
14 |
-
grunt.fail.fatal('>> Please run "bower install" before continuing.');
|
15 |
-
}
|
16 |
-
require('load-grunt-tasks')(grunt);
|
17 |
-
|
18 |
-
grunt
|
19 |
-
.initConfig({
|
20 |
-
pkg: grunt.file.readJSON('package.json'),
|
21 |
-
app: grunt.file.readJSON('_config.json'),
|
22 |
-
vendor: 'bower_components',
|
23 |
-
|
24 |
-
// assemble
|
25 |
-
assemble: {
|
26 |
-
options: {
|
27 |
-
flatten: false,
|
28 |
-
expand: true,
|
29 |
-
production: false,
|
30 |
-
assets: '<%= app.docs.dest %>/assets',
|
31 |
-
postprocess: require('pretty'),
|
32 |
-
mybaseDir: path.resolve('<%= app.docs.dest %>'),
|
33 |
-
|
34 |
-
// metadata
|
35 |
-
pkg: '<%= pkg %>',
|
36 |
-
app: '<%= app %>',
|
37 |
-
data: ['<%= app.docs.src %>/data/*.{json,yml}'],
|
38 |
-
helpers: ['handlebars-helpers'],
|
39 |
-
|
40 |
-
// templates
|
41 |
-
partials: '<%= app.docs.templates %>/partials/*.hbs',
|
42 |
-
layoutdir: '<%= app.docs.layouts %>/'
|
43 |
-
},
|
44 |
-
index: {
|
45 |
-
options: {
|
46 |
-
layout: 'home.hbs'
|
47 |
-
},
|
48 |
-
files: [{
|
49 |
-
expand: true,
|
50 |
-
cwd: '<%= app.docs.pages %>/',
|
51 |
-
src: '*.hbs',
|
52 |
-
dest: '<%= app.docs.dest %>/'
|
53 |
-
}]
|
54 |
-
},
|
55 |
-
demos: {
|
56 |
-
options: {
|
57 |
-
layout: 'demos.hbs'
|
58 |
-
},
|
59 |
-
files: [{
|
60 |
-
expand: true,
|
61 |
-
cwd: '<%= app.docs.pages %>/demos/',
|
62 |
-
src: '*.hbs',
|
63 |
-
dest: '<%= app.docs.dest %>/demos'
|
64 |
-
}]
|
65 |
-
},
|
66 |
-
docs: {
|
67 |
-
options: {
|
68 |
-
layout: 'docs.hbs'
|
69 |
-
},
|
70 |
-
files: [{
|
71 |
-
expand: true,
|
72 |
-
cwd: '<%= app.docs.pages %>/docs/',
|
73 |
-
src: '*.hbs',
|
74 |
-
dest: '<%= app.docs.dest %>/docs'
|
75 |
-
}]
|
76 |
-
}
|
77 |
-
},
|
78 |
-
|
79 |
-
// clean
|
80 |
-
clean: {
|
81 |
-
docs: ['<%= app.docs.dest %>/**/*.*'],
|
82 |
-
dist: ['dist/**/*.*']
|
83 |
-
},
|
84 |
-
|
85 |
-
// less
|
86 |
-
less: {
|
87 |
-
docs: {
|
88 |
-
options: {
|
89 |
-
compress: true,
|
90 |
-
paths: ['<%= app.docs.src %>/assets/less/', 'bower_components/bootstrap/less/']
|
91 |
-
},
|
92 |
-
files: {
|
93 |
-
'<%= app.docs.dest %>/assets/css/docs.min.css': '<%= app.docs.src %>/assets/less/docs.less'
|
94 |
-
}
|
95 |
-
},
|
96 |
-
dist: {
|
97 |
-
options: {
|
98 |
-
compress: false
|
99 |
-
},
|
100 |
-
files: [{
|
101 |
-
expand: true,
|
102 |
-
flatten: true,
|
103 |
-
cwd: 'src/less/',
|
104 |
-
src: '*less',
|
105 |
-
dest: 'src/css/',
|
106 |
-
ext: '.css',
|
107 |
-
extDot: 'last'
|
108 |
-
}]
|
109 |
-
}
|
110 |
-
},
|
111 |
-
|
112 |
-
// concat
|
113 |
-
concat: {
|
114 |
-
docs: {
|
115 |
-
src: [
|
116 |
-
'bower_components/bootstrap/js/transition.js',
|
117 |
-
'bower_components/bootstrap/js/alert.js',
|
118 |
-
'bower_components/bootstrap/js/button.js',
|
119 |
-
'bower_components/bootstrap/js/carousel.js',
|
120 |
-
'bower_components/bootstrap/js/collapse.js',
|
121 |
-
'bower_components/bootstrap/js/dropdown.js',
|
122 |
-
'bower_components/bootstrap/js/modal.js',
|
123 |
-
'bower_components/bootstrap/js/tooltip.js',
|
124 |
-
'bower_components/bootstrap/js/popover.js',
|
125 |
-
'bower_components/bootstrap/js/scrollspy.js',
|
126 |
-
'bower_components/bootstrap/js/tab.js',
|
127 |
-
'bower_components/bootstrap/js/affix.js',
|
128 |
-
'bower_components/highlightjs/highlight.pack.js'
|
129 |
-
],
|
130 |
-
dest: '<%= app.docs.dest %>/assets/js/vendor.js'
|
131 |
-
},
|
132 |
-
dist: {
|
133 |
-
options: {
|
134 |
-
banner: '/**\n' + ' * bxSlider v<%= pkg.version %>\n' +
|
135 |
-
' * Copyright 2013-<%= grunt.template.today("yyyy") %> <%= pkg.author.name %>\n' +
|
136 |
-
' * Written while drinking Belgian ales and listening to jazz\n\n' +
|
137 |
-
' * Licensed under <%= pkg.license.type %> (<%= pkg.license.url %>)\n' + ' */\n\n'
|
138 |
-
},
|
139 |
-
files: {
|
140 |
-
'dist/jquery.<%= pkg.name %>.css': ['src/css/*.css'],
|
141 |
-
'dist/jquery.<%= pkg.name %>.js': '<%= app.src.scripts %>'
|
142 |
-
}
|
143 |
-
}
|
144 |
-
},
|
145 |
-
|
146 |
-
cssmin: {
|
147 |
-
options: {
|
148 |
-
banner: '/**\n' + ' * bxSlider v<%= pkg.version %>\n' +
|
149 |
-
' * Copyright 2013-<%= grunt.template.today("yyyy") %> <%= pkg.author.name %>\n' +
|
150 |
-
' * Written while drinking Belgian ales and listening to jazz\n\n' +
|
151 |
-
' * Licensed under <%= pkg.license.type %> (<%= pkg.license.url %>)\n' + ' */\n\n'
|
152 |
-
},
|
153 |
-
dist: {
|
154 |
-
files: {
|
155 |
-
'dist/jquery.<%= pkg.name %>.min.css': ['src/css/*.css']
|
156 |
-
}
|
157 |
-
}
|
158 |
-
},
|
159 |
-
|
160 |
-
// jshint
|
161 |
-
jshint: {
|
162 |
-
options: {
|
163 |
-
jshintrc: 'src/js/.jshintrc'
|
164 |
-
},
|
165 |
-
dist: {
|
166 |
-
src: ['<%= app.src.scripts %>', 'Gruntfile.js']
|
167 |
-
}
|
168 |
-
},
|
169 |
-
|
170 |
-
//jscs
|
171 |
-
jscs: {
|
172 |
-
options: {
|
173 |
-
config: 'src/js/.jscsrc',
|
174 |
-
reporter: 'text.js',
|
175 |
-
reporterOutput: 'jscs.report.txt'
|
176 |
-
},
|
177 |
-
dist: {
|
178 |
-
src: ['<%= app.src.scripts %>', 'Gruntfile.js']
|
179 |
-
}
|
180 |
-
},
|
181 |
-
|
182 |
-
// uglify
|
183 |
-
uglify: {
|
184 |
-
options: {
|
185 |
-
banner: '/**\n' + ' * bxSlider v<%= pkg.version %>\n' +
|
186 |
-
' * Copyright 2013-<%= grunt.template.today("yyyy") %> <%= pkg.author.name %>\n' +
|
187 |
-
' * Written while drinking Belgian ales and listening to jazz\n\n' +
|
188 |
-
' * Licensed under <%= pkg.license.type %> (<%= pkg.license.url %>)\n' + ' */\n\n'
|
189 |
-
},
|
190 |
-
dist: {
|
191 |
-
files: {
|
192 |
-
'dist/jquery.<%= pkg.name %>.min.js': '<%= app.src.scripts %>'
|
193 |
-
}
|
194 |
-
}
|
195 |
-
},
|
196 |
-
|
197 |
-
// copy
|
198 |
-
copy: {
|
199 |
-
distImages: {
|
200 |
-
expand: true,
|
201 |
-
flatten: true,
|
202 |
-
cwd: 'src/',
|
203 |
-
src: ['images/*.*'],
|
204 |
-
dest: 'dist/images'
|
205 |
-
},
|
206 |
-
|
207 |
-
distVendor: {
|
208 |
-
expand: true,
|
209 |
-
flatten: true,
|
210 |
-
cwd: 'src/',
|
211 |
-
src: ['vendor/*.*'],
|
212 |
-
dest: 'dist/vendor'
|
213 |
-
},
|
214 |
-
|
215 |
-
distToDocs: {
|
216 |
-
expand: true,
|
217 |
-
cwd: 'dist/',
|
218 |
-
src: ['**/*.*'],
|
219 |
-
dest: '<%= app.docs.dest %>/assets/bxslider'
|
220 |
-
},
|
221 |
-
|
222 |
-
srcToDocs: {
|
223 |
-
expand: true,
|
224 |
-
cwd: 'src/js',
|
225 |
-
src: ['**/*.js'],
|
226 |
-
dest: '<%= app.docs.dest %>/assets/bxslider/src'
|
227 |
-
},
|
228 |
-
|
229 |
-
docsAssets: {
|
230 |
-
expand: true,
|
231 |
-
cwd: '<%= app.docs.src %>/assets/',
|
232 |
-
src: ['css/*.css', 'vendors/*.js', 'vendors/*.map', 'img/*.*', 'js/*.*'],
|
233 |
-
dest: '<%= app.docs.dest %>/assets/'
|
234 |
-
},
|
235 |
-
|
236 |
-
docsHighlightAssets: {
|
237 |
-
expand: true,
|
238 |
-
cwd: 'bower_components/highlightjs/',
|
239 |
-
src: 'styles/*.css',
|
240 |
-
dest: '<%= app.docs.dest %>/assets/css/'
|
241 |
-
},
|
242 |
-
|
243 |
-
readme: {
|
244 |
-
files: [{
|
245 |
-
'dist/LICENSE.md': 'LICENSE.md',
|
246 |
-
'dist/README.md': 'README.md'
|
247 |
-
}]
|
248 |
-
}
|
249 |
-
},
|
250 |
-
|
251 |
-
// connect
|
252 |
-
connect: {
|
253 |
-
options: {
|
254 |
-
port: 9000,
|
255 |
-
open: true,
|
256 |
-
livereload: true,
|
257 |
-
hostname: 'localhost'
|
258 |
-
},
|
259 |
-
docs: {
|
260 |
-
options: {
|
261 |
-
base: '<%= app.docs.dest %>'
|
262 |
-
}
|
263 |
-
}
|
264 |
-
},
|
265 |
-
|
266 |
-
// watch
|
267 |
-
watch: {
|
268 |
-
options: {
|
269 |
-
livereload: true
|
270 |
-
},
|
271 |
-
templates: {
|
272 |
-
files: ['<%= app.docs.templates %>/**/*.hbs'],
|
273 |
-
tasks: ['assemble']
|
274 |
-
},
|
275 |
-
less: {
|
276 |
-
files: ['<%= app.docs.src %>/assets/**/*.less'],
|
277 |
-
tasks: ['less:docs']
|
278 |
-
},
|
279 |
-
lessDist: {
|
280 |
-
files: ['src/**/*.less'],
|
281 |
-
tasks: ['less:dist', 'concat:dist', 'cssmin:dist', 'copy:distToDocs']
|
282 |
-
},
|
283 |
-
jsDocs: {
|
284 |
-
files: ['<%= app.docs.src %>/assets/**/*.js'],
|
285 |
-
tasks: ['copy:docsAssets']
|
286 |
-
},
|
287 |
-
js: {
|
288 |
-
files: ['src/**/*.js'],
|
289 |
-
tasks: ['jscs:dist', 'jshint:dist', 'uglify:dist', 'concat:dist', 'copy:distToDocs', 'copy:srcToDocs']
|
290 |
-
},
|
291 |
-
helpers: {
|
292 |
-
files: ['<%= app.src %>/helpers/*.js'],
|
293 |
-
tasks: ['assemble']
|
294 |
-
}
|
295 |
-
},
|
296 |
-
|
297 |
-
// compress zip
|
298 |
-
compress: {
|
299 |
-
zip: {
|
300 |
-
options: {
|
301 |
-
archive: 'download/<%= pkg.version %>/bxslider.zip'
|
302 |
-
},
|
303 |
-
files: [{
|
304 |
-
expand: true,
|
305 |
-
cwd: 'dist/',
|
306 |
-
src: ['**'],
|
307 |
-
dest: 'bxslider.<%= pkg.version %>'
|
308 |
-
}]
|
309 |
-
}
|
310 |
-
}
|
311 |
-
});
|
312 |
-
|
313 |
-
grunt.loadNpmTasks('assemble');
|
314 |
-
|
315 |
-
// tasks
|
316 |
-
grunt.registerTask('dist', ['clean:dist', 'less:dist', 'jshint:dist', 'concat:dist', 'cssmin:dist', 'copy:distImages', 'copy:distVendor', 'jscs:dist', 'uglify:dist', 'copy:readme']);
|
317 |
-
|
318 |
-
grunt.registerTask('docs', ['clean:docs', 'assemble', 'less:docs', 'concat:docs', 'copy:docsAssets', 'copy:docsHighlightAssets', 'copy:distToDocs']);
|
319 |
-
|
320 |
-
grunt.registerTask('default', ['dist', 'docs']);
|
321 |
-
|
322 |
-
grunt.registerTask('watch', ['connect:docs', 'watch']);
|
323 |
-
|
324 |
-
grunt.registerTask('zip', ['compress']);
|
325 |
-
|
326 |
-
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/bxslider-4/Gulpfile.js
DELETED
@@ -1,82 +0,0 @@
|
|
1 |
-
// ## Globals
|
2 |
-
/*global $:true*/
|
3 |
-
var $ = require('gulp-load-plugins')();
|
4 |
-
var gulp = require('gulp');
|
5 |
-
|
6 |
-
// ### Styles
|
7 |
-
// `gulp styles` - compiles and optimizes css.
|
8 |
-
gulp.task('styles', function() {
|
9 |
-
return gulp.src('./src/less/*.less')
|
10 |
-
.pipe($.less())
|
11 |
-
.pipe($.pleeease({
|
12 |
-
autoprefixer: {
|
13 |
-
browsers: [
|
14 |
-
'last 2 versions', 'ie 8', 'ie 9', 'android 2.3', 'android 4',
|
15 |
-
'opera 12'
|
16 |
-
]
|
17 |
-
},
|
18 |
-
minifier: false
|
19 |
-
}))
|
20 |
-
.pipe(gulp.dest('./dist/'));
|
21 |
-
});
|
22 |
-
|
23 |
-
// ### Scripts
|
24 |
-
// `gulp scripts` - runs jshint and uglify
|
25 |
-
gulp.task('scripts', ['jshint'], function() {
|
26 |
-
return gulp.src('./src/js/*.js')
|
27 |
-
.pipe(gulp.dest('./dist/'))
|
28 |
-
.pipe($.uglify({
|
29 |
-
preserveComments: function (node, comment) {
|
30 |
-
if (/^\*\*/.test(comment.value) && /\*\*$/.test(comment.value)) {
|
31 |
-
|
32 |
-
console.log('Found tri-star comment. Preserving.');
|
33 |
-
return true;
|
34 |
-
}
|
35 |
-
}
|
36 |
-
}))
|
37 |
-
.pipe($.rename({extname: '.min.js'}))
|
38 |
-
.pipe(gulp.dest('./dist/'));
|
39 |
-
});
|
40 |
-
|
41 |
-
// ### Vendor Scripts
|
42 |
-
// `gulp vendor` - runs uglify on 3rd party plugins
|
43 |
-
gulp.task('vendor', function() {
|
44 |
-
return gulp.src('./src/vendor/*.js')
|
45 |
-
.pipe(gulp.dest('./dist/vendor'));
|
46 |
-
});
|
47 |
-
|
48 |
-
// ### Images
|
49 |
-
// `gulp images` - run lossless compression on all the images.
|
50 |
-
gulp.task('images', function() {
|
51 |
-
return gulp.src('./src/images/*')
|
52 |
-
.pipe($.imagemin({
|
53 |
-
progressive: true,
|
54 |
-
interlaced: true
|
55 |
-
}))
|
56 |
-
.pipe(gulp.dest('./dist/images'));
|
57 |
-
});
|
58 |
-
|
59 |
-
// ### JsHint
|
60 |
-
// `gulp jshint` - lints configuration JSON and project javascript
|
61 |
-
gulp.task('jshint', function() {
|
62 |
-
return gulp.src([ 'bower.json', 'gulpfile.js', './src/*.js' ])
|
63 |
-
.pipe($.jshint())
|
64 |
-
.pipe($.jshint.reporter('jshint-stylish'))
|
65 |
-
.pipe($.jshint.reporter('fail'));
|
66 |
-
});
|
67 |
-
|
68 |
-
// ### Clean
|
69 |
-
// `gulp clean` - deletes the build folder entirely
|
70 |
-
gulp.task('clean', require('del').bind(null, ['dist/']));
|
71 |
-
|
72 |
-
// ### Build
|
73 |
-
// `gulp build` - Run all the build tasks but don't clean up beforehand.
|
74 |
-
// Generally you should be running `gulp` instead of `gulp build`.
|
75 |
-
gulp.task('build', ['styles', 'scripts', 'images', 'vendor']);
|
76 |
-
|
77 |
-
|
78 |
-
// ### Gulp
|
79 |
-
// `gulp` - Run a complete build. To compile for production run `gulp --production`.
|
80 |
-
gulp.task('default', ['clean'], function() {
|
81 |
-
gulp.start('build');
|
82 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/bxslider-4/LICENSE.md
DELETED
@@ -1,12 +0,0 @@
|
|
1 |
-
License
|
2 |
-
-------
|
3 |
-
|
4 |
-
The MIT License (MIT)
|
5 |
-
|
6 |
-
Copyright © 2014 [Steven Wanderski](https://twitter.com/stevenwanderski)
|
7 |
-
|
8 |
-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
9 |
-
|
10 |
-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
11 |
-
|
12 |
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/bxslider-4/_config.json
DELETED
@@ -1,21 +0,0 @@
|
|
1 |
-
{
|
2 |
-
"docs":{
|
3 |
-
"src": "docs_src",
|
4 |
-
"dest": "docs",
|
5 |
-
"templates":"<%= app.docs.src %>/templates",
|
6 |
-
"pages": "<%= app.docs.templates %>/pages",
|
7 |
-
"layouts": "<%= app.docs.templates %>/layouts"
|
8 |
-
},
|
9 |
-
|
10 |
-
"src":{
|
11 |
-
"dist": "dist",
|
12 |
-
|
13 |
-
"scripts": [
|
14 |
-
"src/js/jquery.bxslider.js"
|
15 |
-
]
|
16 |
-
},
|
17 |
-
|
18 |
-
"title": "bxSlider",
|
19 |
-
"download": "https://github.com/stevenwanderski/bxslider-4/archive/master.zip",
|
20 |
-
"donate": "http://www.bxslider.com"
|
21 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/bxslider-4/bower.json
DELETED
@@ -1,29 +0,0 @@
|
|
1 |
-
{
|
2 |
-
"name": "bxslider-4",
|
3 |
-
"version": "4.2.5",
|
4 |
-
"homepage": "http://bxslider.com",
|
5 |
-
"license": "MIT",
|
6 |
-
"main": [
|
7 |
-
"dist/jquery.bxslider.js",
|
8 |
-
"dist/jquery.bxslider.css",
|
9 |
-
"dist/images/bx_loader.gif",
|
10 |
-
"dist/images/controls.png"
|
11 |
-
],
|
12 |
-
"ignore": [
|
13 |
-
"docs_src/*",
|
14 |
-
"docs/*"
|
15 |
-
],
|
16 |
-
"keywords": [
|
17 |
-
"bxslider",
|
18 |
-
"javascript",
|
19 |
-
"jquery",
|
20 |
-
"library"
|
21 |
-
],
|
22 |
-
"dependencies": {
|
23 |
-
"jquery": ">= 1.8.3"
|
24 |
-
},
|
25 |
-
"devDependencies": {
|
26 |
-
"bootstrap": ">= 3.3.2",
|
27 |
-
"highlightjs": "~8.4.0"
|
28 |
-
}
|
29 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/bxslider-4/dist/LICENSE.md
DELETED
@@ -1,12 +0,0 @@
|
|
1 |
-
License
|
2 |
-
-------
|
3 |
-
|
4 |
-
The MIT License (MIT)
|
5 |
-
|
6 |
-
Copyright © 2014 [Steven Wanderski](https://twitter.com/stevenwanderski)
|
7 |
-
|
8 |
-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
9 |
-
|
10 |
-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
11 |
-
|
12 |
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/bxslider-4/dist/README.md
DELETED
@@ -1,748 +0,0 @@
|
|
1 |
-
#bxSlider 4.2.5
|
2 |
-
##The fully-loaded, responsive jQuery content slider
|
3 |
-
|
4 |
-
###Why should I use this slider?
|
5 |
-
* Fully responsive - will adapt to any device
|
6 |
-
* Horizontal, vertical, and fade modes
|
7 |
-
* Slides can contain images, video, or HTML content
|
8 |
-
* Full callback API and public methods
|
9 |
-
* Small file size, fully themed, simple to implement
|
10 |
-
* Browser support: Firefox, Chrome, Safari, iOS, Android, IE7+
|
11 |
-
* Tons of configuration options
|
12 |
-
|
13 |
-
For complete documentation, tons of examples, and a good time, visit:
|
14 |
-
|
15 |
-
[http://bxslider.com](http://bxslider.com)
|
16 |
-
|
17 |
-
Written by: Steven Wanderski - [http://stevenwanderski.com](http://stevenwanderski.com)
|
18 |
-
|
19 |
-
###License
|
20 |
-
Released under the MIT license - http://opensource.org/licenses/MIT
|
21 |
-
|
22 |
-
Let's get on with it!
|
23 |
-
|
24 |
-
##Installation
|
25 |
-
|
26 |
-
###Step 1: Link required files
|
27 |
-
|
28 |
-
First and most important, the jQuery library needs to be included (no need to download - link directly from Google). Next, download the package from this site and link the bxSlider CSS file (for the theme) and the bxSlider Javascript file.
|
29 |
-
|
30 |
-
```html
|
31 |
-
<!-- jQuery library (served from Google) -->
|
32 |
-
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
|
33 |
-
<!-- bxSlider Javascript file -->
|
34 |
-
<script src="/js/jquery.bxslider.min.js"></script>
|
35 |
-
<!-- bxSlider CSS file -->
|
36 |
-
<link href="/lib/jquery.bxslider.css" rel="stylesheet" />
|
37 |
-
```
|
38 |
-
|
39 |
-
###Step 2: Create HTML markup
|
40 |
-
|
41 |
-
Create a `<ul class="bxslider">` element, with a `<li>` for each slide. Slides can contain images, video, or any other HTML content!
|
42 |
-
|
43 |
-
```html
|
44 |
-
<ul class="bxslider">
|
45 |
-
<li><img src="/images/pic1.jpg" /></li>
|
46 |
-
<li><img src="/images/pic2.jpg" /></li>
|
47 |
-
<li><img src="/images/pic3.jpg" /></li>
|
48 |
-
<li><img src="/images/pic4.jpg" /></li>
|
49 |
-
</ul>
|
50 |
-
```
|
51 |
-
|
52 |
-
###Step 3: Call the bxSlider
|
53 |
-
|
54 |
-
Call .bxSlider() on `<ul class="bxslider">`. Note that the call must be made inside of a $(document).ready() call, or the plugin will not work!
|
55 |
-
|
56 |
-
```javascript
|
57 |
-
$(document).ready(function(){
|
58 |
-
$('.bxslider').bxSlider();
|
59 |
-
});
|
60 |
-
```
|
61 |
-
|
62 |
-
##Configuration options
|
63 |
-
|
64 |
-
###General
|
65 |
-
|
66 |
-
**mode**
|
67 |
-
Type of transition between slides
|
68 |
-
```
|
69 |
-
default: 'horizontal'
|
70 |
-
options: 'horizontal', 'vertical', 'fade'
|
71 |
-
```
|
72 |
-
|
73 |
-
**speed**
|
74 |
-
Slide transition duration (in ms)
|
75 |
-
```
|
76 |
-
default: 500
|
77 |
-
options: integer
|
78 |
-
```
|
79 |
-
|
80 |
-
**slideMargin**
|
81 |
-
Margin between each slide
|
82 |
-
```
|
83 |
-
default: 0
|
84 |
-
options: integer
|
85 |
-
```
|
86 |
-
|
87 |
-
**startSlide**
|
88 |
-
Starting slide index (zero-based)
|
89 |
-
```
|
90 |
-
default: 0
|
91 |
-
options: integer
|
92 |
-
```
|
93 |
-
|
94 |
-
**randomStart**
|
95 |
-
Start slider on a random slide
|
96 |
-
```
|
97 |
-
default: false
|
98 |
-
options: boolean (true / false)
|
99 |
-
```
|
100 |
-
|
101 |
-
**slideSelector**
|
102 |
-
Element to use as slides (ex. <code>'div.slide'</code>).<br />Note: by default, bxSlider will use all immediate children of the slider element
|
103 |
-
```
|
104 |
-
default: ''
|
105 |
-
options: jQuery selector
|
106 |
-
```
|
107 |
-
|
108 |
-
**infiniteLoop**
|
109 |
-
If <code>true</code>, clicking "Next" while on the last slide will transition to the first slide and vice-versa
|
110 |
-
```
|
111 |
-
default: true
|
112 |
-
options: boolean (true / false)
|
113 |
-
```
|
114 |
-
|
115 |
-
**hideControlOnEnd**
|
116 |
-
If <code>true</code>, "Prev" and "Next" controls will receive a class <code>disabled</code> when slide is the first or the last<br/>Note: Only used when <code>infiniteLoop: false</code>
|
117 |
-
```
|
118 |
-
default: false
|
119 |
-
options: boolean (true / false)
|
120 |
-
```
|
121 |
-
|
122 |
-
**easing**
|
123 |
-
The type of "easing" to use during transitions. If using CSS transitions, include a value for the <code>transition-timing-function</code> property. If not using CSS transitions, you may include <code>plugins/jquery.easing.1.3.js</code> for many options.<br />See <a href="http://gsgd.co.uk/sandbox/jquery/easing/" target="_blank">http://gsgd.co.uk/sandbox/jquery/easing/</a> for more info.
|
124 |
-
```
|
125 |
-
default: null
|
126 |
-
options: if using CSS: 'linear', 'ease', 'ease-in', 'ease-out', 'ease-in-out', 'cubic-bezier(n,n,n,n)'. If not using CSS: 'swing', 'linear' (see the above file for more options)
|
127 |
-
```
|
128 |
-
|
129 |
-
**captions**
|
130 |
-
Include image captions. Captions are derived from the image's <code>title</code> attribute
|
131 |
-
```
|
132 |
-
default: false
|
133 |
-
options: boolean (true / false)
|
134 |
-
```
|
135 |
-
|
136 |
-
**ticker**
|
137 |
-
Use slider in ticker mode (similar to a news ticker)
|
138 |
-
```
|
139 |
-
default: false
|
140 |
-
options: boolean (true / false)
|
141 |
-
```
|
142 |
-
|
143 |
-
**tickerHover**
|
144 |
-
Ticker will pause when mouse hovers over slider. Note: this functionality does NOT work if using CSS transitions!
|
145 |
-
```
|
146 |
-
default: false
|
147 |
-
options: boolean (true / false)
|
148 |
-
```
|
149 |
-
|
150 |
-
**adaptiveHeight**
|
151 |
-
Dynamically adjust slider height based on each slide's height
|
152 |
-
```
|
153 |
-
default: false
|
154 |
-
options: boolean (true / false)
|
155 |
-
```
|
156 |
-
|
157 |
-
**adaptiveHeightSpeed**
|
158 |
-
Slide height transition duration (in ms). Note: only used if <code>adaptiveHeight: true</code>
|
159 |
-
```
|
160 |
-
default: 500
|
161 |
-
options: integer
|
162 |
-
```
|
163 |
-
|
164 |
-
**video**
|
165 |
-
If any slides contain video, set this to <code>true</code>. Also, include <code>plugins/jquery.fitvids.js</code><br />See <a href="http://fitvidsjs.com/" target="_blank">http://fitvidsjs.com/</a> for more info
|
166 |
-
```
|
167 |
-
default: false
|
168 |
-
options: boolean (true / false)
|
169 |
-
```
|
170 |
-
|
171 |
-
**responsive**
|
172 |
-
Enable or disable auto resize of the slider. Useful if you need to use fixed width sliders.
|
173 |
-
```
|
174 |
-
default: true
|
175 |
-
options: boolean (true /false)
|
176 |
-
```
|
177 |
-
|
178 |
-
**useCSS**
|
179 |
-
If true, CSS transitions will be used for horizontal and vertical slide animations (this uses native hardware acceleration). If false, jQuery animate() will be used.
|
180 |
-
```
|
181 |
-
default: true
|
182 |
-
options: boolean (true / false)
|
183 |
-
```
|
184 |
-
|
185 |
-
**preloadImages**
|
186 |
-
If 'all', preloads all images before starting the slider. If 'visible', preloads only images in the initially visible slides before starting the slider (tip: use 'visible' if all slides are identical dimensions)
|
187 |
-
```
|
188 |
-
default: 'visible'
|
189 |
-
options: 'all', 'visible'
|
190 |
-
```
|
191 |
-
|
192 |
-
**touchEnabled**
|
193 |
-
If <code>true</code>, slider will allow touch swipe transitions
|
194 |
-
```
|
195 |
-
default: true
|
196 |
-
options: boolean (true / false)
|
197 |
-
```
|
198 |
-
|
199 |
-
**swipeThreshold**
|
200 |
-
Amount of pixels a touch swipe needs to exceed in order to execute a slide transition. Note: only used if <code>touchEnabled: true</code>
|
201 |
-
```
|
202 |
-
default: 50
|
203 |
-
options: integer
|
204 |
-
```
|
205 |
-
|
206 |
-
**oneToOneTouch**
|
207 |
-
If <code>true</code>, non-fade slides follow the finger as it swipes
|
208 |
-
```
|
209 |
-
default: true
|
210 |
-
options: boolean (true / false)
|
211 |
-
```
|
212 |
-
|
213 |
-
**preventDefaultSwipeX**
|
214 |
-
If <code>true</code>, touch screen will not move along the x-axis as the finger swipes
|
215 |
-
```
|
216 |
-
default: true
|
217 |
-
options: boolean (true / false)
|
218 |
-
```
|
219 |
-
|
220 |
-
**preventDefaultSwipeY**
|
221 |
-
If <code>true</code>, touch screen will not move along the y-axis as the finger swipes
|
222 |
-
```
|
223 |
-
default: false
|
224 |
-
options: boolean (true / false)
|
225 |
-
```
|
226 |
-
|
227 |
-
**wrapperClass**
|
228 |
-
Class to wrap the slider in. Change to prevent from using default bxSlider styles.
|
229 |
-
```
|
230 |
-
default: 'bx-wrapper'
|
231 |
-
options: string
|
232 |
-
```
|
233 |
-
|
234 |
-
###Pager
|
235 |
-
|
236 |
-
**pager**
|
237 |
-
If <code>true</code>, a pager will be added
|
238 |
-
```
|
239 |
-
default: true
|
240 |
-
options: boolean (true / false)
|
241 |
-
```
|
242 |
-
|
243 |
-
**pagerType**
|
244 |
-
If <code>'full'</code>, a pager link will be generated for each slide. If <code>'short'</code>, a x / y pager will be used (ex. 1 / 5)
|
245 |
-
```
|
246 |
-
default: 'full'
|
247 |
-
options: 'full', 'short'
|
248 |
-
```
|
249 |
-
|
250 |
-
**pagerShortSeparator**
|
251 |
-
If <code>pagerType: 'short'</code>, pager will use this value as the separating character
|
252 |
-
```
|
253 |
-
default: ' / '
|
254 |
-
options: string
|
255 |
-
```
|
256 |
-
|
257 |
-
**pagerSelector**
|
258 |
-
Element used to populate the populate the pager. By default, the pager is appended to the bx-viewport
|
259 |
-
```
|
260 |
-
default: ''
|
261 |
-
options: jQuery selector
|
262 |
-
```
|
263 |
-
|
264 |
-
**pagerCustom**
|
265 |
-
Parent element to be used as the pager. Parent element must contain a <code><a data-slide-index="x"></code> element for each slide. See example <a href="/examples/thumbnail-method-1">here</a>. Not for use with dynamic carousels.
|
266 |
-
```
|
267 |
-
default: null
|
268 |
-
options: jQuery selector
|
269 |
-
```
|
270 |
-
|
271 |
-
**buildPager**
|
272 |
-
If supplied, function is called on every slide element, and the returned value is used as the pager item markup.<br />See <a href="http://bxslider.com/examples">examples</a> for detailed implementation
|
273 |
-
```
|
274 |
-
default: null
|
275 |
-
options: function(slideIndex)
|
276 |
-
```
|
277 |
-
|
278 |
-
###Controls
|
279 |
-
|
280 |
-
**controls**
|
281 |
-
If <code>true</code>, "Next" / "Prev" controls will be added
|
282 |
-
```
|
283 |
-
default: true
|
284 |
-
options: boolean (true / false)
|
285 |
-
```
|
286 |
-
|
287 |
-
**nextText**
|
288 |
-
Text to be used for the "Next" control
|
289 |
-
```
|
290 |
-
default: 'Next'
|
291 |
-
options: string
|
292 |
-
```
|
293 |
-
|
294 |
-
**prevText**
|
295 |
-
Text to be used for the "Prev" control
|
296 |
-
```
|
297 |
-
default: 'Prev'
|
298 |
-
options: string
|
299 |
-
```
|
300 |
-
|
301 |
-
**nextSelector**
|
302 |
-
Element used to populate the "Next" control
|
303 |
-
```
|
304 |
-
default: null
|
305 |
-
options: jQuery selector
|
306 |
-
```
|
307 |
-
|
308 |
-
**prevSelector**
|
309 |
-
Element used to populate the "Prev" control
|
310 |
-
```
|
311 |
-
default: null
|
312 |
-
options: jQuery selector
|
313 |
-
```
|
314 |
-
|
315 |
-
**autoControls**
|
316 |
-
If <code>true</code>, "Start" / "Stop" controls will be added
|
317 |
-
```
|
318 |
-
default: false
|
319 |
-
options: boolean (true / false)
|
320 |
-
```
|
321 |
-
|
322 |
-
**startText**
|
323 |
-
Text to be used for the "Start" control
|
324 |
-
```
|
325 |
-
default: 'Start'
|
326 |
-
options: string
|
327 |
-
```
|
328 |
-
|
329 |
-
**stopText**
|
330 |
-
Text to be used for the "Stop" control
|
331 |
-
```
|
332 |
-
default: 'Stop'
|
333 |
-
options: string
|
334 |
-
```
|
335 |
-
|
336 |
-
**autoControlsCombine**
|
337 |
-
When slideshow is playing only "Stop" control is displayed and vice-versa
|
338 |
-
```
|
339 |
-
default: false
|
340 |
-
options: boolean (true / false)
|
341 |
-
```
|
342 |
-
|
343 |
-
**autoControlsSelector**
|
344 |
-
Element used to populate the auto controls
|
345 |
-
```
|
346 |
-
default: null
|
347 |
-
options: jQuery selector
|
348 |
-
```
|
349 |
-
|
350 |
-
**keyboardEnabled**
|
351 |
-
Enable keyboard navigation for visible sliders
|
352 |
-
```
|
353 |
-
default: false
|
354 |
-
options: boolean (true / false)
|
355 |
-
```
|
356 |
-
|
357 |
-
###Auto
|
358 |
-
|
359 |
-
**auto**
|
360 |
-
Slides will automatically transition
|
361 |
-
```
|
362 |
-
default: false
|
363 |
-
options: boolean (true / false)
|
364 |
-
```
|
365 |
-
**stopAutoOnClick**
|
366 |
-
Auto will stop on interaction with controls
|
367 |
-
```
|
368 |
-
default: false
|
369 |
-
options: boolean (true / false)
|
370 |
-
```
|
371 |
-
|
372 |
-
**pause**
|
373 |
-
The amount of time (in ms) between each auto transition
|
374 |
-
```
|
375 |
-
default: 4000
|
376 |
-
options: integer
|
377 |
-
```
|
378 |
-
|
379 |
-
**autoStart**
|
380 |
-
Auto show starts playing on load. If <code>false</code>, slideshow will start when the "Start" control is clicked
|
381 |
-
```
|
382 |
-
default: true
|
383 |
-
options: boolean (true / false)
|
384 |
-
```
|
385 |
-
|
386 |
-
**autoDirection**
|
387 |
-
The direction of auto show slide transitions
|
388 |
-
```
|
389 |
-
default: 'next'
|
390 |
-
options: 'next', 'prev'
|
391 |
-
```
|
392 |
-
|
393 |
-
**autoHover**
|
394 |
-
Auto show will pause when mouse hovers over slider
|
395 |
-
```
|
396 |
-
default: false
|
397 |
-
options: boolean (true / false)
|
398 |
-
```
|
399 |
-
|
400 |
-
**autoDelay**
|
401 |
-
Time (in ms) auto show should wait before starting
|
402 |
-
```
|
403 |
-
default: 0
|
404 |
-
options: integer
|
405 |
-
```
|
406 |
-
|
407 |
-
###Carousel
|
408 |
-
|
409 |
-
**minSlides**
|
410 |
-
The minimum number of slides to be shown. Slides will be sized down if carousel becomes smaller than the original size.
|
411 |
-
```
|
412 |
-
default: 1
|
413 |
-
options: integer
|
414 |
-
```
|
415 |
-
|
416 |
-
**maxSlides**
|
417 |
-
The maximum number of slides to be shown. Slides will be sized up if carousel becomes larger than the original size.
|
418 |
-
```
|
419 |
-
default: 1
|
420 |
-
options: integer
|
421 |
-
```
|
422 |
-
|
423 |
-
**moveSlides**
|
424 |
-
The number of slides to move on transition. This value must be <code>>= minSlides</code>, and <code><= maxSlides</code>. If zero (default), the number of fully-visible slides will be used.
|
425 |
-
```
|
426 |
-
default: 0
|
427 |
-
options: integer
|
428 |
-
```
|
429 |
-
|
430 |
-
**slideWidth**
|
431 |
-
The width of each slide. This setting is required for all horizontal carousels!
|
432 |
-
```
|
433 |
-
default: 0
|
434 |
-
options: integer
|
435 |
-
```
|
436 |
-
|
437 |
-
**shrinkItems**
|
438 |
-
The Carousel will only show whole items and shrink the images to fit the viewport based on maxSlides/MinSlides.
|
439 |
-
```
|
440 |
-
default: false
|
441 |
-
options: boolean (true / false)
|
442 |
-
```
|
443 |
-
|
444 |
-
###Keyboard
|
445 |
-
|
446 |
-
**keyboardEnabled**
|
447 |
-
Allows for keyboard control of visible slider. Keypress ignored if slider not visible.
|
448 |
-
```
|
449 |
-
default: false
|
450 |
-
options: boolean (true / false)
|
451 |
-
```
|
452 |
-
|
453 |
-
###Accessibility
|
454 |
-
**ariaLive**
|
455 |
-
Adds Aria Live attribute to slider.
|
456 |
-
```
|
457 |
-
default: true
|
458 |
-
options: boolean (true / false)
|
459 |
-
```
|
460 |
-
|
461 |
-
**ariaHidden**
|
462 |
-
Adds Aria Hidden attribute to any nonvisible slides.
|
463 |
-
```
|
464 |
-
default: true
|
465 |
-
options: boolean (true / false)
|
466 |
-
```
|
467 |
-
|
468 |
-
###Callbacks
|
469 |
-
|
470 |
-
**onSliderLoad**
|
471 |
-
Executes immediately after the slider is fully loaded
|
472 |
-
```
|
473 |
-
default: function(){}
|
474 |
-
options: function(currentIndex){ // your code here }
|
475 |
-
arguments:
|
476 |
-
currentIndex: element index of the current slide
|
477 |
-
```
|
478 |
-
|
479 |
-
**onSliderResize**
|
480 |
-
Executes immediately after the slider is resized
|
481 |
-
```
|
482 |
-
default: function(){}
|
483 |
-
options: function(currentIndex){ // your code here }
|
484 |
-
arguments:
|
485 |
-
currentIndex: element index of the current slide
|
486 |
-
```
|
487 |
-
|
488 |
-
**onSlideBefore**
|
489 |
-
Executes immediately before each slide transition.
|
490 |
-
```
|
491 |
-
default: function(){}
|
492 |
-
options: function($slideElement, oldIndex, newIndex){ // your code here }
|
493 |
-
arguments:
|
494 |
-
$slideElement: jQuery element of the destination element
|
495 |
-
oldIndex: element index of the previous slide (before the transition)
|
496 |
-
newIndex: element index of the destination slide (after the transition)
|
497 |
-
```
|
498 |
-
|
499 |
-
**onSlideAfter**
|
500 |
-
Executes immediately after each slide transition. Function argument is the current slide element (when transition completes).
|
501 |
-
```
|
502 |
-
default: function(){}
|
503 |
-
options: function($slideElement, oldIndex, newIndex){ // your code here }
|
504 |
-
arguments:
|
505 |
-
$slideElement: jQuery element of the destination element
|
506 |
-
oldIndex: element index of the previous slide (before the transition)
|
507 |
-
newIndex: element index of the destination slide (after the transition)
|
508 |
-
```
|
509 |
-
|
510 |
-
**onSlideNext**
|
511 |
-
Executes immediately before each "Next" slide transition. Function argument is the target (next) slide element.
|
512 |
-
```
|
513 |
-
default: function(){}
|
514 |
-
options: function($slideElement, oldIndex, newIndex){ // your code here }
|
515 |
-
arguments:
|
516 |
-
$slideElement: jQuery element of the destination element
|
517 |
-
oldIndex: element index of the previous slide (before the transition)
|
518 |
-
newIndex: element index of the destination slide (after the transition)
|
519 |
-
```
|
520 |
-
|
521 |
-
**onSlidePrev**
|
522 |
-
Executes immediately before each "Prev" slide transition. Function argument is the target (prev) slide element.
|
523 |
-
```
|
524 |
-
default: function(){}
|
525 |
-
options: function($slideElement, oldIndex, newIndex){ // your code here }
|
526 |
-
arguments:
|
527 |
-
$slideElement: jQuery element of the destination element
|
528 |
-
oldIndex: element index of the previous slide (before the transition)
|
529 |
-
newIndex: element index of the destination slide (after the transition)
|
530 |
-
```
|
531 |
-
|
532 |
-
###Public methods
|
533 |
-
|
534 |
-
**goToSlide**
|
535 |
-
Performs a slide transition to the supplied slide index (zero-based)
|
536 |
-
```
|
537 |
-
example:
|
538 |
-
slider = $('.bxslider').bxSlider();
|
539 |
-
slider.goToSlide(3);
|
540 |
-
```
|
541 |
-
|
542 |
-
**goToNextSlide**
|
543 |
-
Performs a "Next" slide transition
|
544 |
-
```
|
545 |
-
example:
|
546 |
-
slider = $('.bxslider').bxSlider();
|
547 |
-
slider.goToNextSlide();
|
548 |
-
```
|
549 |
-
|
550 |
-
**goToPrevSlide**
|
551 |
-
Performs a "Prev" slide transition
|
552 |
-
```
|
553 |
-
example:
|
554 |
-
slider = $('.bxslider').bxSlider();
|
555 |
-
slider.goToPrevSlide();
|
556 |
-
```
|
557 |
-
|
558 |
-
**startAuto**
|
559 |
-
Starts the auto show. Provide an argument <code>false</code> to prevent the auto controls from being updated.
|
560 |
-
```
|
561 |
-
example:
|
562 |
-
slider = $('.bxslider').bxSlider();
|
563 |
-
slider.startAuto();
|
564 |
-
```
|
565 |
-
|
566 |
-
**stopAuto**
|
567 |
-
Stops the auto show. Provide an argument <code>false</code> to prevent the auto controls from being updated.
|
568 |
-
```
|
569 |
-
example:
|
570 |
-
slider = $('.bxslider').bxSlider();
|
571 |
-
slider.stopAuto();
|
572 |
-
```
|
573 |
-
|
574 |
-
**getCurrentSlide**
|
575 |
-
Returns the current active slide
|
576 |
-
```
|
577 |
-
example:
|
578 |
-
slider = $('.bxslider').bxSlider();
|
579 |
-
var current = slider.getCurrentSlide();
|
580 |
-
```
|
581 |
-
|
582 |
-
**getSlideCount**
|
583 |
-
Returns the total number of slides in the slider
|
584 |
-
```
|
585 |
-
example:
|
586 |
-
slider = $('.bxslider').bxSlider();
|
587 |
-
var slideQty = slider.getSlideCount();
|
588 |
-
```
|
589 |
-
|
590 |
-
**redrawSlider**
|
591 |
-
Redraw the slider. Useful when needing to redraw a hidden slider after it is unhidden.
|
592 |
-
```
|
593 |
-
example:
|
594 |
-
slider = $('.bxslider').bxSlider();
|
595 |
-
slider.redrawSlider();
|
596 |
-
```
|
597 |
-
|
598 |
-
**reloadSlider**
|
599 |
-
Reload the slider. Useful when adding slides on the fly. Accepts an optional settings object. <a href="/examples/reload-slider-settings">See here for an example.</a>
|
600 |
-
```
|
601 |
-
example:
|
602 |
-
slider = $('.bxslider').bxSlider();
|
603 |
-
slider.reloadSlider();
|
604 |
-
```
|
605 |
-
|
606 |
-
**destroySlider**
|
607 |
-
Destroy the slider. This reverts all slider elements back to their original state (before calling the slider).
|
608 |
-
```
|
609 |
-
example:
|
610 |
-
slider = $('.bxslider').bxSlider();
|
611 |
-
slider.destroySlider();
|
612 |
-
```
|
613 |
-
|
614 |
-
### Install Grunt and Bower
|
615 |
-
|
616 |
-
**Unfamiliar with npm? Don't have node installed?** [Download and install node.js](http://nodejs.org/download/) before proceeding.
|
617 |
-
|
618 |
-
From the command line:
|
619 |
-
|
620 |
-
1. Install `grunt-cli` and `bower` globally with `npm install -g grunt-cli bower`.
|
621 |
-
2. Run `npm install`. npm will look at `package.json` and automatically install the necessary dependencies.
|
622 |
-
3. Run `bower install`, which installs front-end packages defined in `bower.json`.
|
623 |
-
|
624 |
-
When completed, you'll be able to run the various Grunt commands provided from the command line.
|
625 |
-
|
626 |
-
### Available Grunt commands
|
627 |
-
|
628 |
-
* `grunt` — Clean, Compile LESS to CSS, concatenate and validate JS, build documentation.
|
629 |
-
* `grunt dist` — Clean, Compile LESS to CSS, concatenate and validate JS for plugin only.
|
630 |
-
* `grunt docs` — Clean, build documentation only.
|
631 |
-
* `grunt watch` — loads LiveReload, connects, and watches all assets.
|
632 |
-
* `grunt zip` — Creates a zip of `/dist` and places it in `/download`.
|
633 |
-
|
634 |
-
## Contributing
|
635 |
-
|
636 |
-
Everyone is welcome to help [contribute](CONTRIBUTING.md) and improve this project. There are several ways you can contribute:
|
637 |
-
|
638 |
-
* Reporting issues (please read [issue guidelines](https://github.com/necolas/issue-guidelines))
|
639 |
-
* Suggesting new features
|
640 |
-
* Writing or refactoring code
|
641 |
-
* Fixing [issues](https://github.com/roots/roots/issues)
|
642 |
-
|
643 |
-
## Changelog
|
644 |
-
|
645 |
-
### Version 4.2.5
|
646 |
-
* Fix: Vertical carousel minSlides not working #840
|
647 |
-
* Fix: slider breaks with css animations if settings.speed set to 0 #838
|
648 |
-
* Fix: Slider runs into undefined state when reloadSlider is called before initialization was finished #833
|
649 |
-
|
650 |
-
### Version 4.2.4
|
651 |
-
NOTICE: We have switched to a Grunt based build process in order to leverage [Assemble](http://assemble.io) for local documentation building. Please review the above notes about Grunt for the commands available.
|
652 |
-
|
653 |
-
* Fix: Fixed transition from first to last slide during infinite loop #778
|
654 |
-
* Fix: Reload on multiple sliders doesn't work? #755
|
655 |
-
* Fix: bxSlider with text only #746
|
656 |
-
* Fix: bower missing main and ignore entries #738
|
657 |
-
* Fix: Tickermode transitionend event bubbling #737
|
658 |
-
* Fix: Initializing before destroyed breaks slider #748
|
659 |
-
* Enhancement: Added shrinkItems carousel setting #772
|
660 |
-
* Enhancement: Maintain auto display of slides after a manual selection #594
|
661 |
-
* Enhancement: Slider getter through jquery object #739
|
662 |
-
* Enhancement: Add aria attributes #751
|
663 |
-
* Enhancement: Slider element in every callback and a new method getSliderElement (#780)
|
664 |
-
* Enhancement: Local Documentiation and examples. I have added buildable documentation to the repo. This will expand over time and allow for community corrections as needed. Please see above Grunt notes on how to build.
|
665 |
-
|
666 |
-
|
667 |
-
### Version 4.2.3
|
668 |
-
* Minor bug fix
|
669 |
-
|
670 |
-
### Version 4.2.2
|
671 |
-
* Fix: Remove unused plugin variable (#733)
|
672 |
-
* Fix: `updateAfterSlideTransition` not being called (#704)
|
673 |
-
* Fix: Slider stops auto advancing (#702)
|
674 |
-
* Fix: Refresh page, slider show the last item at the first in mode: 'horizontal' (#694)
|
675 |
-
* Fix: horizintal ticker stutters on loop (#669)
|
676 |
-
* Fix: Wrong bx-wrapper bottom margin with controls=true and pager=false (#647)
|
677 |
-
* Fix: add css tickerHover. (#629)
|
678 |
-
* Fix: Slider refusing to scale down, only up (#611)
|
679 |
-
* Fix: bxSlider freezes on touch devices (#540)
|
680 |
-
* Fix: Multiple fixes and improvements for Windows Mobile Devices (#596)
|
681 |
-
* Fix: Accessing bxslider's slider object inside its “onSliderLoad” callback returns undefined (#475)
|
682 |
-
* Fix: infiniteLoop glitch when scrolling from first to last slide (#429)
|
683 |
-
* Enhancement: Cancel transitions on callbacks by returning false. (#411)
|
684 |
-
* Enhancement: Added Keyboard arrow left and right support (#239)
|
685 |
-
|
686 |
-
### Version 4.2.1
|
687 |
-
* Fix: Merge Conflict in dist
|
688 |
-
* Fix: modified bower.json
|
689 |
-
|
690 |
-
### Version 4.2.0
|
691 |
-
* Fix: Reverse #714, fixes #722.
|
692 |
-
* Fix: Repo Tag #729
|
693 |
-
* Fix: #720 pagerCustom issues
|
694 |
-
|
695 |
-
4.2.0 Introduces a streamlined build process using [gulp](www.gulpjs.com). Along with this new build process the projects folder structure has been changed. You will find a `dist` folder with all assets ready to use, including both minified and unminified versions of the javascript. These assets should be ready to go. In `src` you will find the uncompiled assets, including a new less version of the css for bxslider. This is an important step for bxslider. It will help speed development up and keep work clean. It also paves the way for a big revamp we have planned in the future.
|
696 |
-
|
697 |
-
**Unfamiliar with npm? Don't have node installed?** [Download and install node.js](http://nodejs.org/download/) before proceeding.
|
698 |
-
|
699 |
-
From the command line:
|
700 |
-
|
701 |
-
1. Install [gulp](http://gulpjs.com) globally with `npm install -g gulp`
|
702 |
-
2. Navigate to the project directory, then run `npm install`
|
703 |
-
|
704 |
-
You now have all the necessary dependencies to run the build process.
|
705 |
-
|
706 |
-
### Available gulp commands
|
707 |
-
|
708 |
-
* `gulp` — Compile and optimize all files to `dist`
|
709 |
-
* `gulp styles` — Compile css assets only to `dist`
|
710 |
-
* `gulp scripts` — Compile js assets only to `dist`
|
711 |
-
* `gulp images` - Run lossless compression on all the images and copy to `dist`
|
712 |
-
* `gulp jshint` — Checks JS and JSON code for errors based on our .jshintrc settings
|
713 |
-
|
714 |
-
|
715 |
-
### Version 4.1.3
|
716 |
-
* Fix: responsive issue for horizontal mode for issue #611, #714
|
717 |
-
* Fix: extra space on the left when using fade mode. #715
|
718 |
-
* Fix: wrongly removing custom pager in destroySlider #610
|
719 |
-
* Fix: bug with reloading slider with custom pager #545
|
720 |
-
* Fix: Issue with infinite scroll sometimes returning to 0 #481
|
721 |
-
* Fix: When "infiniteLoop" is used, true is not passed to a clone method. #346
|
722 |
-
* Fix: "pagerCustom" won't work when using reloadSlider #171
|
723 |
-
* Fix: Remove vendor prefix for translateZ(0) #565
|
724 |
-
* Fix: give styles on focus for accessibility #228
|
725 |
-
* Fix: Minified Version out of sync.
|
726 |
-
* Fix: Remove -5px left #517
|
727 |
-
* Enhancement: Invert order call of appendControls() and appendPager() #226
|
728 |
-
* Enhancement: Various Indentation and typos in docs fixed. #551, #578
|
729 |
-
* Enhancement: Update jsDelivr with update.json for autoupdate of CDN
|
730 |
-
* Enhancement: Tag Repo so it can be included in CDNJS
|
731 |
-
* Created development branch to work from. Eventually will restructure entire repo to follow best practice setup.
|
732 |
-
|
733 |
-
|
734 |
-
### Version 4.1.2
|
735 |
-
* Added `bower.json` configuration file. Manage bxSlider as a dependency using [bower](http://bower.io/).
|
736 |
-
|
737 |
-
### Version 4.1.1
|
738 |
-
* Removed imagesLoaded library and added iframe preloading support
|
739 |
-
* Added responsive option - setting to false will prevent $(window).resize binding
|
740 |
-
|
741 |
-
### Version 4.1
|
742 |
-
* Carousel mode (minSlides / maxSlides) was re-written to be more intuitive.
|
743 |
-
* SlideWidth now acts as it should (slides respect the width value).
|
744 |
-
* SlideWidth now properly parsed: accepts string ("600px") or integer (600).
|
745 |
-
* Slider now only needs to load visible slides (by default) in order to initialize which results in much faster loading. A "preloadImages" setting allows for configuration.
|
746 |
-
|
747 |
-
|
748 |
-
Long live Zep.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/bxslider-4/dist/images/bx_loader.gif
DELETED
Binary file
|
includes/libraries/bxslider-4/dist/images/controls.png
DELETED
Binary file
|
includes/libraries/bxslider-4/dist/jquery.bxslider.css
DELETED
@@ -1,184 +0,0 @@
|
|
1 |
-
/**
|
2 |
-
* bxSlider v4.2.5
|
3 |
-
* Copyright 2013-2015 Steven Wanderski
|
4 |
-
* Written while drinking Belgian ales and listening to jazz
|
5 |
-
|
6 |
-
* Licensed under MIT (http://opensource.org/licenses/MIT)
|
7 |
-
*/
|
8 |
-
|
9 |
-
/** VARIABLES
|
10 |
-
===================================*/
|
11 |
-
/** RESET AND LAYOUT
|
12 |
-
===================================*/
|
13 |
-
.bx-wrapper {
|
14 |
-
position: relative;
|
15 |
-
margin: 0 auto 60px;
|
16 |
-
padding: 0;
|
17 |
-
*zoom: 1;
|
18 |
-
-ms-touch-action: pan-y;
|
19 |
-
touch-action: pan-y;
|
20 |
-
}
|
21 |
-
.bx-wrapper img {
|
22 |
-
max-width: 100%;
|
23 |
-
display: block;
|
24 |
-
}
|
25 |
-
.bxslider {
|
26 |
-
margin: 0;
|
27 |
-
padding: 0;
|
28 |
-
}
|
29 |
-
ul.bxslider {
|
30 |
-
list-style: none;
|
31 |
-
}
|
32 |
-
.bx-viewport {
|
33 |
-
/*fix other elements on the page moving (on Chrome)*/
|
34 |
-
-webkit-transform: translatez(0);
|
35 |
-
}
|
36 |
-
/** THEME
|
37 |
-
===================================*/
|
38 |
-
.bx-wrapper {
|
39 |
-
-moz-box-shadow: 0 0 5px #ccc;
|
40 |
-
-webkit-box-shadow: 0 0 5px #ccc;
|
41 |
-
box-shadow: 0 0 5px #ccc;
|
42 |
-
border: 5px solid #fff;
|
43 |
-
background: #fff;
|
44 |
-
}
|
45 |
-
.bx-wrapper .bx-pager,
|
46 |
-
.bx-wrapper .bx-controls-auto {
|
47 |
-
position: absolute;
|
48 |
-
bottom: -30px;
|
49 |
-
width: 100%;
|
50 |
-
}
|
51 |
-
/* LOADER */
|
52 |
-
.bx-wrapper .bx-loading {
|
53 |
-
min-height: 50px;
|
54 |
-
background: url('images/bx_loader.gif') center center no-repeat #ffffff;
|
55 |
-
height: 100%;
|
56 |
-
width: 100%;
|
57 |
-
position: absolute;
|
58 |
-
top: 0;
|
59 |
-
left: 0;
|
60 |
-
z-index: 2000;
|
61 |
-
}
|
62 |
-
/* PAGER */
|
63 |
-
.bx-wrapper .bx-pager {
|
64 |
-
text-align: center;
|
65 |
-
font-size: .85em;
|
66 |
-
font-family: Arial;
|
67 |
-
font-weight: bold;
|
68 |
-
color: #666;
|
69 |
-
padding-top: 20px;
|
70 |
-
}
|
71 |
-
.bx-wrapper .bx-pager.bx-default-pager a {
|
72 |
-
background: #666;
|
73 |
-
text-indent: -9999px;
|
74 |
-
display: block;
|
75 |
-
width: 10px;
|
76 |
-
height: 10px;
|
77 |
-
margin: 0 5px;
|
78 |
-
outline: 0;
|
79 |
-
-moz-border-radius: 5px;
|
80 |
-
-webkit-border-radius: 5px;
|
81 |
-
border-radius: 5px;
|
82 |
-
}
|
83 |
-
.bx-wrapper .bx-pager.bx-default-pager a:hover,
|
84 |
-
.bx-wrapper .bx-pager.bx-default-pager a.active,
|
85 |
-
.bx-wrapper .bx-pager.bx-default-pager a:focus {
|
86 |
-
background: #000;
|
87 |
-
}
|
88 |
-
.bx-wrapper .bx-pager-item,
|
89 |
-
.bx-wrapper .bx-controls-auto .bx-controls-auto-item {
|
90 |
-
display: inline-block;
|
91 |
-
*zoom: 1;
|
92 |
-
*display: inline;
|
93 |
-
}
|
94 |
-
.bx-wrapper .bx-pager-item {
|
95 |
-
font-size: 0;
|
96 |
-
line-height: 0;
|
97 |
-
}
|
98 |
-
/* DIRECTION CONTROLS (NEXT / PREV) */
|
99 |
-
.bx-wrapper .bx-prev {
|
100 |
-
left: 10px;
|
101 |
-
background: url('images/controls.png') no-repeat 0 -32px;
|
102 |
-
}
|
103 |
-
.bx-wrapper .bx-prev:hover,
|
104 |
-
.bx-wrapper .bx-prev:focus {
|
105 |
-
background-position: 0 0;
|
106 |
-
}
|
107 |
-
.bx-wrapper .bx-next {
|
108 |
-
right: 10px;
|
109 |
-
background: url('images/controls.png') no-repeat -43px -32px;
|
110 |
-
}
|
111 |
-
.bx-wrapper .bx-next:hover,
|
112 |
-
.bx-wrapper .bx-next:focus {
|
113 |
-
background-position: -43px 0;
|
114 |
-
}
|
115 |
-
.bx-wrapper .bx-controls-direction a {
|
116 |
-
position: absolute;
|
117 |
-
top: 50%;
|
118 |
-
margin-top: -16px;
|
119 |
-
outline: 0;
|
120 |
-
width: 32px;
|
121 |
-
height: 32px;
|
122 |
-
text-indent: -9999px;
|
123 |
-
z-index: 9999;
|
124 |
-
}
|
125 |
-
.bx-wrapper .bx-controls-direction a.disabled {
|
126 |
-
display: none;
|
127 |
-
}
|
128 |
-
/* AUTO CONTROLS (START / STOP) */
|
129 |
-
.bx-wrapper .bx-controls-auto {
|
130 |
-
text-align: center;
|
131 |
-
}
|
132 |
-
.bx-wrapper .bx-controls-auto .bx-start {
|
133 |
-
display: block;
|
134 |
-
text-indent: -9999px;
|
135 |
-
width: 10px;
|
136 |
-
height: 11px;
|
137 |
-
outline: 0;
|
138 |
-
background: url('images/controls.png') -86px -11px no-repeat;
|
139 |
-
margin: 0 3px;
|
140 |
-
}
|
141 |
-
.bx-wrapper .bx-controls-auto .bx-start:hover,
|
142 |
-
.bx-wrapper .bx-controls-auto .bx-start.active,
|
143 |
-
.bx-wrapper .bx-controls-auto .bx-start:focus {
|
144 |
-
background-position: -86px 0;
|
145 |
-
}
|
146 |
-
.bx-wrapper .bx-controls-auto .bx-stop {
|
147 |
-
display: block;
|
148 |
-
text-indent: -9999px;
|
149 |
-
width: 9px;
|
150 |
-
height: 11px;
|
151 |
-
outline: 0;
|
152 |
-
background: url('images/controls.png') -86px -44px no-repeat;
|
153 |
-
margin: 0 3px;
|
154 |
-
}
|
155 |
-
.bx-wrapper .bx-controls-auto .bx-stop:hover,
|
156 |
-
.bx-wrapper .bx-controls-auto .bx-stop.active,
|
157 |
-
.bx-wrapper .bx-controls-auto .bx-stop:focus {
|
158 |
-
background-position: -86px -33px;
|
159 |
-
}
|
160 |
-
/* PAGER WITH AUTO-CONTROLS HYBRID LAYOUT */
|
161 |
-
.bx-wrapper .bx-controls.bx-has-controls-auto.bx-has-pager .bx-pager {
|
162 |
-
text-align: left;
|
163 |
-
width: 80%;
|
164 |
-
}
|
165 |
-
.bx-wrapper .bx-controls.bx-has-controls-auto.bx-has-pager .bx-controls-auto {
|
166 |
-
right: 0;
|
167 |
-
width: 35px;
|
168 |
-
}
|
169 |
-
/* IMAGE CAPTIONS */
|
170 |
-
.bx-wrapper .bx-caption {
|
171 |
-
position: absolute;
|
172 |
-
bottom: 0;
|
173 |
-
left: 0;
|
174 |
-
background: #666;
|
175 |
-
background: rgba(80, 80, 80, 0.75);
|
176 |
-
width: 100%;
|
177 |
-
}
|
178 |
-
.bx-wrapper .bx-caption span {
|
179 |
-
color: #fff;
|
180 |
-
font-family: Arial;
|
181 |
-
display: block;
|
182 |
-
font-size: .85em;
|
183 |
-
padding: 10px;
|
184 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/bxslider-4/dist/jquery.bxslider.js
DELETED
@@ -1,1614 +0,0 @@
|
|
1 |
-
/**
|
2 |
-
* bxSlider v4.2.5
|
3 |
-
* Copyright 2013-2015 Steven Wanderski
|
4 |
-
* Written while drinking Belgian ales and listening to jazz
|
5 |
-
|
6 |
-
* Licensed under MIT (http://opensource.org/licenses/MIT)
|
7 |
-
*/
|
8 |
-
|
9 |
-
;(function($) {
|
10 |
-
|
11 |
-
var defaults = {
|
12 |
-
|
13 |
-
// GENERAL
|
14 |
-
mode: 'horizontal',
|
15 |
-
slideSelector: '',
|
16 |
-
infiniteLoop: true,
|
17 |
-
hideControlOnEnd: false,
|
18 |
-
speed: 500,
|
19 |
-
easing: null,
|
20 |
-
slideMargin: 0,
|
21 |
-
startSlide: 0,
|
22 |
-
randomStart: false,
|
23 |
-
captions: false,
|
24 |
-
ticker: false,
|
25 |
-
tickerHover: false,
|
26 |
-
adaptiveHeight: false,
|
27 |
-
adaptiveHeightSpeed: 500,
|
28 |
-
video: false,
|
29 |
-
useCSS: true,
|
30 |
-
preloadImages: 'visible',
|
31 |
-
responsive: true,
|
32 |
-
slideZIndex: 50,
|
33 |
-
wrapperClass: 'bx-wrapper',
|
34 |
-
|
35 |
-
// TOUCH
|
36 |
-
touchEnabled: true,
|
37 |
-
swipeThreshold: 50,
|
38 |
-
oneToOneTouch: true,
|
39 |
-
preventDefaultSwipeX: true,
|
40 |
-
preventDefaultSwipeY: false,
|
41 |
-
|
42 |
-
// ACCESSIBILITY
|
43 |
-
ariaLive: true,
|
44 |
-
ariaHidden: true,
|
45 |
-
|
46 |
-
// KEYBOARD
|
47 |
-
keyboardEnabled: false,
|
48 |
-
|
49 |
-
// PAGER
|
50 |
-
pager: true,
|
51 |
-
pagerType: 'full',
|
52 |
-
pagerShortSeparator: ' / ',
|
53 |
-
pagerSelector: null,
|
54 |
-
buildPager: null,
|
55 |
-
pagerCustom: null,
|
56 |
-
|
57 |
-
// CONTROLS
|
58 |
-
controls: true,
|
59 |
-
nextText: 'Next',
|
60 |
-
prevText: 'Prev',
|
61 |
-
nextSelector: null,
|
62 |
-
prevSelector: null,
|
63 |
-
autoControls: false,
|
64 |
-
startText: 'Start',
|
65 |
-
stopText: 'Stop',
|
66 |
-
autoControlsCombine: false,
|
67 |
-
autoControlsSelector: null,
|
68 |
-
|
69 |
-
// AUTO
|
70 |
-
auto: false,
|
71 |
-
pause: 4000,
|
72 |
-
autoStart: true,
|
73 |
-
autoDirection: 'next',
|
74 |
-
stopAutoOnClick: false,
|
75 |
-
autoHover: false,
|
76 |
-
autoDelay: 0,
|
77 |
-
autoSlideForOnePage: false,
|
78 |
-
|
79 |
-
// CAROUSEL
|
80 |
-
minSlides: 1,
|
81 |
-
maxSlides: 1,
|
82 |
-
moveSlides: 0,
|
83 |
-
slideWidth: 0,
|
84 |
-
shrinkItems: false,
|
85 |
-
|
86 |
-
// CALLBACKS
|
87 |
-
onSliderLoad: function() { return true; },
|
88 |
-
onSlideBefore: function() { return true; },
|
89 |
-
onSlideAfter: function() { return true; },
|
90 |
-
onSlideNext: function() { return true; },
|
91 |
-
onSlidePrev: function() { return true; },
|
92 |
-
onSliderResize: function() { return true; }
|
93 |
-
};
|
94 |
-
|
95 |
-
$.fn.bxSlider = function(options) {
|
96 |
-
|
97 |
-
if (this.length === 0) {
|
98 |
-
return this;
|
99 |
-
}
|
100 |
-
|
101 |
-
// support multiple elements
|
102 |
-
if (this.length > 1) {
|
103 |
-
this.each(function() {
|
104 |
-
$(this).bxSlider(options);
|
105 |
-
});
|
106 |
-
return this;
|
107 |
-
}
|
108 |
-
|
109 |
-
// create a namespace to be used throughout the plugin
|
110 |
-
var slider = {},
|
111 |
-
// set a reference to our slider element
|
112 |
-
el = this,
|
113 |
-
// get the original window dimens (thanks a lot IE)
|
114 |
-
windowWidth = $(window).width(),
|
115 |
-
windowHeight = $(window).height();
|
116 |
-
|
117 |
-
// Return if slider is already initialized
|
118 |
-
if ($(el).data('bxSlider')) { return; }
|
119 |
-
|
120 |
-
/**
|
121 |
-
* ===================================================================================
|
122 |
-
* = PRIVATE FUNCTIONS
|
123 |
-
* ===================================================================================
|
124 |
-
*/
|
125 |
-
|
126 |
-
/**
|
127 |
-
* Initializes namespace settings to be used throughout plugin
|
128 |
-
*/
|
129 |
-
var init = function() {
|
130 |
-
// Return if slider is already initialized
|
131 |
-
if ($(el).data('bxSlider')) { return; }
|
132 |
-
// merge user-supplied options with the defaults
|
133 |
-
slider.settings = $.extend({}, defaults, options);
|
134 |
-
// parse slideWidth setting
|
135 |
-
slider.settings.slideWidth = parseInt(slider.settings.slideWidth);
|
136 |
-
// store the original children
|
137 |
-
slider.children = el.children(slider.settings.slideSelector);
|
138 |
-
// check if actual number of slides is less than minSlides / maxSlides
|
139 |
-
if (slider.children.length < slider.settings.minSlides) { slider.settings.minSlides = slider.children.length; }
|
140 |
-
if (slider.children.length < slider.settings.maxSlides) { slider.settings.maxSlides = slider.children.length; }
|
141 |
-
// if random start, set the startSlide setting to random number
|
142 |
-
if (slider.settings.randomStart) { slider.settings.startSlide = Math.floor(Math.random() * slider.children.length); }
|
143 |
-
// store active slide information
|
144 |
-
slider.active = { index: slider.settings.startSlide };
|
145 |
-
// store if the slider is in carousel mode (displaying / moving multiple slides)
|
146 |
-
slider.carousel = slider.settings.minSlides > 1 || slider.settings.maxSlides > 1 ? true : false;
|
147 |
-
// if carousel, force preloadImages = 'all'
|
148 |
-
if (slider.carousel) { slider.settings.preloadImages = 'all'; }
|
149 |
-
// calculate the min / max width thresholds based on min / max number of slides
|
150 |
-
// used to setup and update carousel slides dimensions
|
151 |
-
slider.minThreshold = (slider.settings.minSlides * slider.settings.slideWidth) + ((slider.settings.minSlides - 1) * slider.settings.slideMargin);
|
152 |
-
slider.maxThreshold = (slider.settings.maxSlides * slider.settings.slideWidth) + ((slider.settings.maxSlides - 1) * slider.settings.slideMargin);
|
153 |
-
// store the current state of the slider (if currently animating, working is true)
|
154 |
-
slider.working = false;
|
155 |
-
// initialize the controls object
|
156 |
-
slider.controls = {};
|
157 |
-
// initialize an auto interval
|
158 |
-
slider.interval = null;
|
159 |
-
// determine which property to use for transitions
|
160 |
-
slider.animProp = slider.settings.mode === 'vertical' ? 'top' : 'left';
|
161 |
-
// determine if hardware acceleration can be used
|
162 |
-
slider.usingCSS = slider.settings.useCSS && slider.settings.mode !== 'fade' && (function() {
|
163 |
-
// create our test div element
|
164 |
-
var div = document.createElement('div'),
|
165 |
-
// css transition properties
|
166 |
-
props = ['WebkitPerspective', 'MozPerspective', 'OPerspective', 'msPerspective'];
|
167 |
-
// test for each property
|
168 |
-
for (var i = 0; i < props.length; i++) {
|
169 |
-
if (div.style[props[i]] !== undefined) {
|
170 |
-
slider.cssPrefix = props[i].replace('Perspective', '').toLowerCase();
|
171 |
-
slider.animProp = '-' + slider.cssPrefix + '-transform';
|
172 |
-
return true;
|
173 |
-
}
|
174 |
-
}
|
175 |
-
return false;
|
176 |
-
}());
|
177 |
-
// if vertical mode always make maxSlides and minSlides equal
|
178 |
-
if (slider.settings.mode === 'vertical') { slider.settings.maxSlides = slider.settings.minSlides; }
|
179 |
-
// save original style data
|
180 |
-
el.data('origStyle', el.attr('style'));
|
181 |
-
el.children(slider.settings.slideSelector).each(function() {
|
182 |
-
$(this).data('origStyle', $(this).attr('style'));
|
183 |
-
});
|
184 |
-
|
185 |
-
// perform all DOM / CSS modifications
|
186 |
-
setup();
|
187 |
-
};
|
188 |
-
|
189 |
-
/**
|
190 |
-
* Performs all DOM and CSS modifications
|
191 |
-
*/
|
192 |
-
var setup = function() {
|
193 |
-
var preloadSelector = slider.children.eq(slider.settings.startSlide); // set the default preload selector (visible)
|
194 |
-
|
195 |
-
// wrap el in a wrapper
|
196 |
-
el.wrap('<div class="' + slider.settings.wrapperClass + '"><div class="bx-viewport"></div></div>');
|
197 |
-
// store a namespace reference to .bx-viewport
|
198 |
-
slider.viewport = el.parent();
|
199 |
-
|
200 |
-
// add aria-live if the setting is enabled and ticker mode is disabled
|
201 |
-
if (slider.settings.ariaLive && !slider.settings.ticker) {
|
202 |
-
slider.viewport.attr('aria-live', 'polite');
|
203 |
-
}
|
204 |
-
// add a loading div to display while images are loading
|
205 |
-
slider.loader = $('<div class="bx-loading" />');
|
206 |
-
slider.viewport.prepend(slider.loader);
|
207 |
-
// set el to a massive width, to hold any needed slides
|
208 |
-
// also strip any margin and padding from el
|
209 |
-
el.css({
|
210 |
-
width: slider.settings.mode === 'horizontal' ? (slider.children.length * 1000 + 215) + '%' : 'auto',
|
211 |
-
position: 'relative'
|
212 |
-
});
|
213 |
-
// if using CSS, add the easing property
|
214 |
-
if (slider.usingCSS && slider.settings.easing) {
|
215 |
-
el.css('-' + slider.cssPrefix + '-transition-timing-function', slider.settings.easing);
|
216 |
-
// if not using CSS and no easing value was supplied, use the default JS animation easing (swing)
|
217 |
-
} else if (!slider.settings.easing) {
|
218 |
-
slider.settings.easing = 'swing';
|
219 |
-
}
|
220 |
-
// make modifications to the viewport (.bx-viewport)
|
221 |
-
slider.viewport.css({
|
222 |
-
width: '100%',
|
223 |
-
overflow: 'hidden',
|
224 |
-
position: 'relative'
|
225 |
-
});
|
226 |
-
slider.viewport.parent().css({
|
227 |
-
maxWidth: getViewportMaxWidth()
|
228 |
-
});
|
229 |
-
// make modification to the wrapper (.bx-wrapper)
|
230 |
-
if (!slider.settings.pager && !slider.settings.controls) {
|
231 |
-
slider.viewport.parent().css({
|
232 |
-
margin: '0 auto 0px'
|
233 |
-
});
|
234 |
-
}
|
235 |
-
// apply css to all slider children
|
236 |
-
slider.children.css({
|
237 |
-
float: slider.settings.mode === 'horizontal' ? 'left' : 'none',
|
238 |
-
listStyle: 'none',
|
239 |
-
position: 'relative'
|
240 |
-
});
|
241 |
-
// apply the calculated width after the float is applied to prevent scrollbar interference
|
242 |
-
slider.children.css('width', getSlideWidth());
|
243 |
-
// if slideMargin is supplied, add the css
|
244 |
-
if (slider.settings.mode === 'horizontal' && slider.settings.slideMargin > 0) { slider.children.css('marginRight', slider.settings.slideMargin); }
|
245 |
-
if (slider.settings.mode === 'vertical' && slider.settings.slideMargin > 0) { slider.children.css('marginBottom', slider.settings.slideMargin); }
|
246 |
-
// if "fade" mode, add positioning and z-index CSS
|
247 |
-
if (slider.settings.mode === 'fade') {
|
248 |
-
slider.children.css({
|
249 |
-
position: 'absolute',
|
250 |
-
zIndex: 0,
|
251 |
-
display: 'none'
|
252 |
-
});
|
253 |
-
// prepare the z-index on the showing element
|
254 |
-
slider.children.eq(slider.settings.startSlide).css({zIndex: slider.settings.slideZIndex, display: 'block'});
|
255 |
-
}
|
256 |
-
// create an element to contain all slider controls (pager, start / stop, etc)
|
257 |
-
slider.controls.el = $('<div class="bx-controls" />');
|
258 |
-
// if captions are requested, add them
|
259 |
-
if (slider.settings.captions) { appendCaptions(); }
|
260 |
-
// check if startSlide is last slide
|
261 |
-
slider.active.last = slider.settings.startSlide === getPagerQty() - 1;
|
262 |
-
// if video is true, set up the fitVids plugin
|
263 |
-
if (slider.settings.video) { el.fitVids(); }
|
264 |
-
if (slider.settings.preloadImages === 'all' || slider.settings.ticker) { preloadSelector = slider.children; }
|
265 |
-
// only check for control addition if not in "ticker" mode
|
266 |
-
if (!slider.settings.ticker) {
|
267 |
-
// if controls are requested, add them
|
268 |
-
if (slider.settings.controls) { appendControls(); }
|
269 |
-
// if auto is true, and auto controls are requested, add them
|
270 |
-
if (slider.settings.auto && slider.settings.autoControls) { appendControlsAuto(); }
|
271 |
-
// if pager is requested, add it
|
272 |
-
if (slider.settings.pager) { appendPager(); }
|
273 |
-
// if any control option is requested, add the controls wrapper
|
274 |
-
if (slider.settings.controls || slider.settings.autoControls || slider.settings.pager) { slider.viewport.after(slider.controls.el); }
|
275 |
-
// if ticker mode, do not allow a pager
|
276 |
-
} else {
|
277 |
-
slider.settings.pager = false;
|
278 |
-
}
|
279 |
-
loadElements(preloadSelector, start);
|
280 |
-
};
|
281 |
-
|
282 |
-
var loadElements = function(selector, callback) {
|
283 |
-
var total = selector.find('img:not([src=""]), iframe').length,
|
284 |
-
count = 0;
|
285 |
-
if (total === 0) {
|
286 |
-
callback();
|
287 |
-
return;
|
288 |
-
}
|
289 |
-
selector.find('img:not([src=""]), iframe').each(function() {
|
290 |
-
$(this).one('load error', function() {
|
291 |
-
if (++count === total) { callback(); }
|
292 |
-
}).each(function() {
|
293 |
-
if (this.complete) { $(this).load(); }
|
294 |
-
});
|
295 |
-
});
|
296 |
-
};
|
297 |
-
|
298 |
-
/**
|
299 |
-
* Start the slider
|
300 |
-
*/
|
301 |
-
var start = function() {
|
302 |
-
// if infinite loop, prepare additional slides
|
303 |
-
if (slider.settings.infiniteLoop && slider.settings.mode !== 'fade' && !slider.settings.ticker) {
|
304 |
-
var slice = slider.settings.mode === 'vertical' ? slider.settings.minSlides : slider.settings.maxSlides,
|
305 |
-
sliceAppend = slider.children.slice(0, slice).clone(true).addClass('bx-clone'),
|
306 |
-
slicePrepend = slider.children.slice(-slice).clone(true).addClass('bx-clone');
|
307 |
-
if (slider.settings.ariaHidden) {
|
308 |
-
sliceAppend.attr('aria-hidden', true);
|
309 |
-
slicePrepend.attr('aria-hidden', true);
|
310 |
-
}
|
311 |
-
el.append(sliceAppend).prepend(slicePrepend);
|
312 |
-
}
|
313 |
-
// remove the loading DOM element
|
314 |
-
slider.loader.remove();
|
315 |
-
// set the left / top position of "el"
|
316 |
-
setSlidePosition();
|
317 |
-
// if "vertical" mode, always use adaptiveHeight to prevent odd behavior
|
318 |
-
if (slider.settings.mode === 'vertical') { slider.settings.adaptiveHeight = true; }
|
319 |
-
// set the viewport height
|
320 |
-
slider.viewport.height(getViewportHeight());
|
321 |
-
// make sure everything is positioned just right (same as a window resize)
|
322 |
-
el.redrawSlider();
|
323 |
-
// onSliderLoad callback
|
324 |
-
slider.settings.onSliderLoad.call(el, slider.active.index);
|
325 |
-
// slider has been fully initialized
|
326 |
-
slider.initialized = true;
|
327 |
-
// bind the resize call to the window
|
328 |
-
if (slider.settings.responsive) { $(window).bind('resize', resizeWindow); }
|
329 |
-
// if auto is true and has more than 1 page, start the show
|
330 |
-
if (slider.settings.auto && slider.settings.autoStart && (getPagerQty() > 1 || slider.settings.autoSlideForOnePage)) { initAuto(); }
|
331 |
-
// if ticker is true, start the ticker
|
332 |
-
if (slider.settings.ticker) { initTicker(); }
|
333 |
-
// if pager is requested, make the appropriate pager link active
|
334 |
-
if (slider.settings.pager) { updatePagerActive(slider.settings.startSlide); }
|
335 |
-
// check for any updates to the controls (like hideControlOnEnd updates)
|
336 |
-
if (slider.settings.controls) { updateDirectionControls(); }
|
337 |
-
// if touchEnabled is true, setup the touch events
|
338 |
-
if (slider.settings.touchEnabled && !slider.settings.ticker) { initTouch(); }
|
339 |
-
// if keyboardEnabled is true, setup the keyboard events
|
340 |
-
if (slider.settings.keyboardEnabled && !slider.settings.ticker) {
|
341 |
-
$(document).keydown(keyPress);
|
342 |
-
}
|
343 |
-
};
|
344 |
-
|
345 |
-
/**
|
346 |
-
* Returns the calculated height of the viewport, used to determine either adaptiveHeight or the maxHeight value
|
347 |
-
*/
|
348 |
-
var getViewportHeight = function() {
|
349 |
-
var height = 0;
|
350 |
-
// first determine which children (slides) should be used in our height calculation
|
351 |
-
var children = $();
|
352 |
-
// if mode is not "vertical" and adaptiveHeight is false, include all children
|
353 |
-
if (slider.settings.mode !== 'vertical' && !slider.settings.adaptiveHeight) {
|
354 |
-
children = slider.children;
|
355 |
-
} else {
|
356 |
-
// if not carousel, return the single active child
|
357 |
-
if (!slider.carousel) {
|
358 |
-
children = slider.children.eq(slider.active.index);
|
359 |
-
// if carousel, return a slice of children
|
360 |
-
} else {
|
361 |
-
// get the individual slide index
|
362 |
-
var currentIndex = slider.settings.moveSlides === 1 ? slider.active.index : slider.active.index * getMoveBy();
|
363 |
-
// add the current slide to the children
|
364 |
-
children = slider.children.eq(currentIndex);
|
365 |
-
// cycle through the remaining "showing" slides
|
366 |
-
for (i = 1; i <= slider.settings.maxSlides - 1; i++) {
|
367 |
-
// if looped back to the start
|
368 |
-
if (currentIndex + i >= slider.children.length) {
|
369 |
-
children = children.add(slider.children.eq(i - 1));
|
370 |
-
} else {
|
371 |
-
children = children.add(slider.children.eq(currentIndex + i));
|
372 |
-
}
|
373 |
-
}
|
374 |
-
}
|
375 |
-
}
|
376 |
-
// if "vertical" mode, calculate the sum of the heights of the children
|
377 |
-
if (slider.settings.mode === 'vertical') {
|
378 |
-
children.each(function(index) {
|
379 |
-
height += $(this).outerHeight();
|
380 |
-
});
|
381 |
-
// add user-supplied margins
|
382 |
-
if (slider.settings.slideMargin > 0) {
|
383 |
-
height += slider.settings.slideMargin * (slider.settings.minSlides - 1);
|
384 |
-
}
|
385 |
-
// if not "vertical" mode, calculate the max height of the children
|
386 |
-
} else {
|
387 |
-
height = Math.max.apply(Math, children.map(function() {
|
388 |
-
return $(this).outerHeight(false);
|
389 |
-
}).get());
|
390 |
-
}
|
391 |
-
|
392 |
-
if (slider.viewport.css('box-sizing') === 'border-box') {
|
393 |
-
height += parseFloat(slider.viewport.css('padding-top')) + parseFloat(slider.viewport.css('padding-bottom')) +
|
394 |
-
parseFloat(slider.viewport.css('border-top-width')) + parseFloat(slider.viewport.css('border-bottom-width'));
|
395 |
-
} else if (slider.viewport.css('box-sizing') === 'padding-box') {
|
396 |
-
height += parseFloat(slider.viewport.css('padding-top')) + parseFloat(slider.viewport.css('padding-bottom'));
|
397 |
-
}
|
398 |
-
|
399 |
-
return height;
|
400 |
-
};
|
401 |
-
|
402 |
-
/**
|
403 |
-
* Returns the calculated width to be used for the outer wrapper / viewport
|
404 |
-
*/
|
405 |
-
var getViewportMaxWidth = function() {
|
406 |
-
var width = '100%';
|
407 |
-
if (slider.settings.slideWidth > 0) {
|
408 |
-
if (slider.settings.mode === 'horizontal') {
|
409 |
-
width = (slider.settings.maxSlides * slider.settings.slideWidth) + ((slider.settings.maxSlides - 1) * slider.settings.slideMargin);
|
410 |
-
} else {
|
411 |
-
width = slider.settings.slideWidth;
|
412 |
-
}
|
413 |
-
}
|
414 |
-
return width;
|
415 |
-
};
|
416 |
-
|
417 |
-
/**
|
418 |
-
* Returns the calculated width to be applied to each slide
|
419 |
-
*/
|
420 |
-
var getSlideWidth = function() {
|
421 |
-
var newElWidth = slider.settings.slideWidth, // start with any user-supplied slide width
|
422 |
-
wrapWidth = slider.viewport.width(); // get the current viewport width
|
423 |
-
// if slide width was not supplied, or is larger than the viewport use the viewport width
|
424 |
-
if (slider.settings.slideWidth === 0 ||
|
425 |
-
(slider.settings.slideWidth > wrapWidth && !slider.carousel) ||
|
426 |
-
slider.settings.mode === 'vertical') {
|
427 |
-
newElWidth = wrapWidth;
|
428 |
-
// if carousel, use the thresholds to determine the width
|
429 |
-
} else if (slider.settings.maxSlides > 1 && slider.settings.mode === 'horizontal') {
|
430 |
-
if (wrapWidth > slider.maxThreshold) {
|
431 |
-
return newElWidth;
|
432 |
-
} else if (wrapWidth < slider.minThreshold) {
|
433 |
-
newElWidth = (wrapWidth - (slider.settings.slideMargin * (slider.settings.minSlides - 1))) / slider.settings.minSlides;
|
434 |
-
} else if (slider.settings.shrinkItems) {
|
435 |
-
newElWidth = Math.floor((wrapWidth + slider.settings.slideMargin) / (Math.ceil((wrapWidth + slider.settings.slideMargin) / (newElWidth + slider.settings.slideMargin))) - slider.settings.slideMargin);
|
436 |
-
}
|
437 |
-
}
|
438 |
-
return newElWidth;
|
439 |
-
};
|
440 |
-
|
441 |
-
/**
|
442 |
-
* Returns the number of slides currently visible in the viewport (includes partially visible slides)
|
443 |
-
*/
|
444 |
-
var getNumberSlidesShowing = function() {
|
445 |
-
var slidesShowing = 1,
|
446 |
-
childWidth = null;
|
447 |
-
if (slider.settings.mode === 'horizontal' && slider.settings.slideWidth > 0) {
|
448 |
-
// if viewport is smaller than minThreshold, return minSlides
|
449 |
-
if (slider.viewport.width() < slider.minThreshold) {
|
450 |
-
slidesShowing = slider.settings.minSlides;
|
451 |
-
// if viewport is larger than maxThreshold, return maxSlides
|
452 |
-
} else if (slider.viewport.width() > slider.maxThreshold) {
|
453 |
-
slidesShowing = slider.settings.maxSlides;
|
454 |
-
// if viewport is between min / max thresholds, divide viewport width by first child width
|
455 |
-
} else {
|
456 |
-
childWidth = slider.children.first().width() + slider.settings.slideMargin;
|
457 |
-
slidesShowing = Math.floor((slider.viewport.width() +
|
458 |
-
slider.settings.slideMargin) / childWidth);
|
459 |
-
}
|
460 |
-
// if "vertical" mode, slides showing will always be minSlides
|
461 |
-
} else if (slider.settings.mode === 'vertical') {
|
462 |
-
slidesShowing = slider.settings.minSlides;
|
463 |
-
}
|
464 |
-
return slidesShowing;
|
465 |
-
};
|
466 |
-
|
467 |
-
/**
|
468 |
-
* Returns the number of pages (one full viewport of slides is one "page")
|
469 |
-
*/
|
470 |
-
var getPagerQty = function() {
|
471 |
-
var pagerQty = 0,
|
472 |
-
breakPoint = 0,
|
473 |
-
counter = 0;
|
474 |
-
// if moveSlides is specified by the user
|
475 |
-
if (slider.settings.moveSlides > 0) {
|
476 |
-
if (slider.settings.infiniteLoop) {
|
477 |
-
pagerQty = Math.ceil(slider.children.length / getMoveBy());
|
478 |
-
} else {
|
479 |
-
// when breakpoint goes above children length, counter is the number of pages
|
480 |
-
while (breakPoint < slider.children.length) {
|
481 |
-
++pagerQty;
|
482 |
-
breakPoint = counter + getNumberSlidesShowing();
|
483 |
-
counter += slider.settings.moveSlides <= getNumberSlidesShowing() ? slider.settings.moveSlides : getNumberSlidesShowing();
|
484 |
-
}
|
485 |
-
}
|
486 |
-
// if moveSlides is 0 (auto) divide children length by sides showing, then round up
|
487 |
-
} else {
|
488 |
-
pagerQty = Math.ceil(slider.children.length / getNumberSlidesShowing());
|
489 |
-
}
|
490 |
-
return pagerQty;
|
491 |
-
};
|
492 |
-
|
493 |
-
/**
|
494 |
-
* Returns the number of individual slides by which to shift the slider
|
495 |
-
*/
|
496 |
-
var getMoveBy = function() {
|
497 |
-
// if moveSlides was set by the user and moveSlides is less than number of slides showing
|
498 |
-
if (slider.settings.moveSlides > 0 && slider.settings.moveSlides <= getNumberSlidesShowing()) {
|
499 |
-
return slider.settings.moveSlides;
|
500 |
-
}
|
501 |
-
// if moveSlides is 0 (auto)
|
502 |
-
return getNumberSlidesShowing();
|
503 |
-
};
|
504 |
-
|
505 |
-
/**
|
506 |
-
* Sets the slider's (el) left or top position
|
507 |
-
*/
|
508 |
-
var setSlidePosition = function() {
|
509 |
-
var position, lastChild, lastShowingIndex;
|
510 |
-
// if last slide, not infinite loop, and number of children is larger than specified maxSlides
|
511 |
-
if (slider.children.length > slider.settings.maxSlides && slider.active.last && !slider.settings.infiniteLoop) {
|
512 |
-
if (slider.settings.mode === 'horizontal') {
|
513 |
-
// get the last child's position
|
514 |
-
lastChild = slider.children.last();
|
515 |
-
position = lastChild.position();
|
516 |
-
// set the left position
|
517 |
-
setPositionProperty(-(position.left - (slider.viewport.width() - lastChild.outerWidth())), 'reset', 0);
|
518 |
-
} else if (slider.settings.mode === 'vertical') {
|
519 |
-
// get the last showing index's position
|
520 |
-
lastShowingIndex = slider.children.length - slider.settings.minSlides;
|
521 |
-
position = slider.children.eq(lastShowingIndex).position();
|
522 |
-
// set the top position
|
523 |
-
setPositionProperty(-position.top, 'reset', 0);
|
524 |
-
}
|
525 |
-
// if not last slide
|
526 |
-
} else {
|
527 |
-
// get the position of the first showing slide
|
528 |
-
position = slider.children.eq(slider.active.index * getMoveBy()).position();
|
529 |
-
// check for last slide
|
530 |
-
if (slider.active.index === getPagerQty() - 1) { slider.active.last = true; }
|
531 |
-
// set the respective position
|
532 |
-
if (position !== undefined) {
|
533 |
-
if (slider.settings.mode === 'horizontal') { setPositionProperty(-position.left, 'reset', 0); }
|
534 |
-
else if (slider.settings.mode === 'vertical') { setPositionProperty(-position.top, 'reset', 0); }
|
535 |
-
}
|
536 |
-
}
|
537 |
-
};
|
538 |
-
|
539 |
-
/**
|
540 |
-
* Sets the el's animating property position (which in turn will sometimes animate el).
|
541 |
-
* If using CSS, sets the transform property. If not using CSS, sets the top / left property.
|
542 |
-
*
|
543 |
-
* @param value (int)
|
544 |
-
* - the animating property's value
|
545 |
-
*
|
546 |
-
* @param type (string) 'slide', 'reset', 'ticker'
|
547 |
-
* - the type of instance for which the function is being
|
548 |
-
*
|
549 |
-
* @param duration (int)
|
550 |
-
* - the amount of time (in ms) the transition should occupy
|
551 |
-
*
|
552 |
-
* @param params (array) optional
|
553 |
-
* - an optional parameter containing any variables that need to be passed in
|
554 |
-
*/
|
555 |
-
var setPositionProperty = function(value, type, duration, params) {
|
556 |
-
var animateObj, propValue;
|
557 |
-
// use CSS transform
|
558 |
-
if (slider.usingCSS) {
|
559 |
-
// determine the translate3d value
|
560 |
-
propValue = slider.settings.mode === 'vertical' ? 'translate3d(0, ' + value + 'px, 0)' : 'translate3d(' + value + 'px, 0, 0)';
|
561 |
-
// add the CSS transition-duration
|
562 |
-
el.css('-' + slider.cssPrefix + '-transition-duration', duration / 1000 + 's');
|
563 |
-
if (type === 'slide') {
|
564 |
-
// set the property value
|
565 |
-
el.css(slider.animProp, propValue);
|
566 |
-
if (duration !== 0) {
|
567 |
-
// bind a callback method - executes when CSS transition completes
|
568 |
-
el.bind('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd', function(e) {
|
569 |
-
//make sure it's the correct one
|
570 |
-
if (!$(e.target).is(el)) { return; }
|
571 |
-
// unbind the callback
|
572 |
-
el.unbind('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd');
|
573 |
-
updateAfterSlideTransition();
|
574 |
-
});
|
575 |
-
} else { //duration = 0
|
576 |
-
updateAfterSlideTransition();
|
577 |
-
}
|
578 |
-
} else if (type === 'reset') {
|
579 |
-
el.css(slider.animProp, propValue);
|
580 |
-
} else if (type === 'ticker') {
|
581 |
-
// make the transition use 'linear'
|
582 |
-
el.css('-' + slider.cssPrefix + '-transition-timing-function', 'linear');
|
583 |
-
el.css(slider.animProp, propValue);
|
584 |
-
if (duration !== 0) {
|
585 |
-
el.bind('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd', function(e) {
|
586 |
-
//make sure it's the correct one
|
587 |
-
if (!$(e.target).is(el)) { return; }
|
588 |
-
// unbind the callback
|
589 |
-
el.unbind('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd');
|
590 |
-
// reset the position
|
591 |
-
setPositionProperty(params.resetValue, 'reset', 0);
|
592 |
-
// start the loop again
|
593 |
-
tickerLoop();
|
594 |
-
});
|
595 |
-
} else { //duration = 0
|
596 |
-
setPositionProperty(params.resetValue, 'reset', 0);
|
597 |
-
tickerLoop();
|
598 |
-
}
|
599 |
-
}
|
600 |
-
// use JS animate
|
601 |
-
} else {
|
602 |
-
animateObj = {};
|
603 |
-
animateObj[slider.animProp] = value;
|
604 |
-
if (type === 'slide') {
|
605 |
-
el.animate(animateObj, duration, slider.settings.easing, function() {
|
606 |
-
updateAfterSlideTransition();
|
607 |
-
});
|
608 |
-
} else if (type === 'reset') {
|
609 |
-
el.css(slider.animProp, value);
|
610 |
-
} else if (type === 'ticker') {
|
611 |
-
el.animate(animateObj, duration, 'linear', function() {
|
612 |
-
setPositionProperty(params.resetValue, 'reset', 0);
|
613 |
-
// run the recursive loop after animation
|
614 |
-
tickerLoop();
|
615 |
-
});
|
616 |
-
}
|
617 |
-
}
|
618 |
-
};
|
619 |
-
|
620 |
-
/**
|
621 |
-
* Populates the pager with proper amount of pages
|
622 |
-
*/
|
623 |
-
var populatePager = function() {
|
624 |
-
var pagerHtml = '',
|
625 |
-
linkContent = '',
|
626 |
-
pagerQty = getPagerQty();
|
627 |
-
// loop through each pager item
|
628 |
-
for (var i = 0; i < pagerQty; i++) {
|
629 |
-
linkContent = '';
|
630 |
-
// if a buildPager function is supplied, use it to get pager link value, else use index + 1
|
631 |
-
if (slider.settings.buildPager && $.isFunction(slider.settings.buildPager) || slider.settings.pagerCustom) {
|
632 |
-
linkContent = slider.settings.buildPager(i);
|
633 |
-
slider.pagerEl.addClass('bx-custom-pager');
|
634 |
-
} else {
|
635 |
-
linkContent = i + 1;
|
636 |
-
slider.pagerEl.addClass('bx-default-pager');
|
637 |
-
}
|
638 |
-
// var linkContent = slider.settings.buildPager && $.isFunction(slider.settings.buildPager) ? slider.settings.buildPager(i) : i + 1;
|
639 |
-
// add the markup to the string
|
640 |
-
pagerHtml += '<div class="bx-pager-item"><a href="" data-slide-index="' + i + '" class="bx-pager-link">' + linkContent + '</a></div>';
|
641 |
-
}
|
642 |
-
// populate the pager element with pager links
|
643 |
-
slider.pagerEl.html(pagerHtml);
|
644 |
-
};
|
645 |
-
|
646 |
-
/**
|
647 |
-
* Appends the pager to the controls element
|
648 |
-
*/
|
649 |
-
var appendPager = function() {
|
650 |
-
if (!slider.settings.pagerCustom) {
|
651 |
-
// create the pager DOM element
|
652 |
-
slider.pagerEl = $('<div class="bx-pager" />');
|
653 |
-
// if a pager selector was supplied, populate it with the pager
|
654 |
-
if (slider.settings.pagerSelector) {
|
655 |
-
$(slider.settings.pagerSelector).html(slider.pagerEl);
|
656 |
-
// if no pager selector was supplied, add it after the wrapper
|
657 |
-
} else {
|
658 |
-
slider.controls.el.addClass('bx-has-pager').append(slider.pagerEl);
|
659 |
-
}
|
660 |
-
// populate the pager
|
661 |
-
populatePager();
|
662 |
-
} else {
|
663 |
-
slider.pagerEl = $(slider.settings.pagerCustom);
|
664 |
-
}
|
665 |
-
// assign the pager click binding
|
666 |
-
slider.pagerEl.on('click touchend', 'a', clickPagerBind);
|
667 |
-
};
|
668 |
-
|
669 |
-
/**
|
670 |
-
* Appends prev / next controls to the controls element
|
671 |
-
*/
|
672 |
-
var appendControls = function() {
|
673 |
-
slider.controls.next = $('<a class="bx-next" href="">' + slider.settings.nextText + '</a>');
|
674 |
-
slider.controls.prev = $('<a class="bx-prev" href="">' + slider.settings.prevText + '</a>');
|
675 |
-
// bind click actions to the controls
|
676 |
-
slider.controls.next.bind('click touchend', clickNextBind);
|
677 |
-
slider.controls.prev.bind('click touchend', clickPrevBind);
|
678 |
-
// if nextSelector was supplied, populate it
|
679 |
-
if (slider.settings.nextSelector) {
|
680 |
-
$(slider.settings.nextSelector).append(slider.controls.next);
|
681 |
-
}
|
682 |
-
// if prevSelector was supplied, populate it
|
683 |
-
if (slider.settings.prevSelector) {
|
684 |
-
$(slider.settings.prevSelector).append(slider.controls.prev);
|
685 |
-
}
|
686 |
-
// if no custom selectors were supplied
|
687 |
-
if (!slider.settings.nextSelector && !slider.settings.prevSelector) {
|
688 |
-
// add the controls to the DOM
|
689 |
-
slider.controls.directionEl = $('<div class="bx-controls-direction" />');
|
690 |
-
// add the control elements to the directionEl
|
691 |
-
slider.controls.directionEl.append(slider.controls.prev).append(slider.controls.next);
|
692 |
-
// slider.viewport.append(slider.controls.directionEl);
|
693 |
-
slider.controls.el.addClass('bx-has-controls-direction').append(slider.controls.directionEl);
|
694 |
-
}
|
695 |
-
};
|
696 |
-
|
697 |
-
/**
|
698 |
-
* Appends start / stop auto controls to the controls element
|
699 |
-
*/
|
700 |
-
var appendControlsAuto = function() {
|
701 |
-
slider.controls.start = $('<div class="bx-controls-auto-item"><a class="bx-start" href="">' + slider.settings.startText + '</a></div>');
|
702 |
-
slider.controls.stop = $('<div class="bx-controls-auto-item"><a class="bx-stop" href="">' + slider.settings.stopText + '</a></div>');
|
703 |
-
// add the controls to the DOM
|
704 |
-
slider.controls.autoEl = $('<div class="bx-controls-auto" />');
|
705 |
-
// bind click actions to the controls
|
706 |
-
slider.controls.autoEl.on('click', '.bx-start', clickStartBind);
|
707 |
-
slider.controls.autoEl.on('click', '.bx-stop', clickStopBind);
|
708 |
-
// if autoControlsCombine, insert only the "start" control
|
709 |
-
if (slider.settings.autoControlsCombine) {
|
710 |
-
slider.controls.autoEl.append(slider.controls.start);
|
711 |
-
// if autoControlsCombine is false, insert both controls
|
712 |
-
} else {
|
713 |
-
slider.controls.autoEl.append(slider.controls.start).append(slider.controls.stop);
|
714 |
-
}
|
715 |
-
// if auto controls selector was supplied, populate it with the controls
|
716 |
-
if (slider.settings.autoControlsSelector) {
|
717 |
-
$(slider.settings.autoControlsSelector).html(slider.controls.autoEl);
|
718 |
-
// if auto controls selector was not supplied, add it after the wrapper
|
719 |
-
} else {
|
720 |
-
slider.controls.el.addClass('bx-has-controls-auto').append(slider.controls.autoEl);
|
721 |
-
}
|
722 |
-
// update the auto controls
|
723 |
-
updateAutoControls(slider.settings.autoStart ? 'stop' : 'start');
|
724 |
-
};
|
725 |
-
|
726 |
-
/**
|
727 |
-
* Appends image captions to the DOM
|
728 |
-
*/
|
729 |
-
var appendCaptions = function() {
|
730 |
-
// cycle through each child
|
731 |
-
slider.children.each(function(index) {
|
732 |
-
// get the image title attribute
|
733 |
-
var title = $(this).find('img:first').attr('title');
|
734 |
-
// append the caption
|
735 |
-
if (title !== undefined && ('' + title).length) {
|
736 |
-
$(this).append('<div class="bx-caption"><span>' + title + '</span></div>');
|
737 |
-
}
|
738 |
-
});
|
739 |
-
};
|
740 |
-
|
741 |
-
/**
|
742 |
-
* Click next binding
|
743 |
-
*
|
744 |
-
* @param e (event)
|
745 |
-
* - DOM event object
|
746 |
-
*/
|
747 |
-
var clickNextBind = function(e) {
|
748 |
-
e.preventDefault();
|
749 |
-
if (slider.controls.el.hasClass('disabled')) { return; }
|
750 |
-
// if auto show is running, stop it
|
751 |
-
if (slider.settings.auto && slider.settings.stopAutoOnClick) { el.stopAuto(); }
|
752 |
-
el.goToNextSlide();
|
753 |
-
};
|
754 |
-
|
755 |
-
/**
|
756 |
-
* Click prev binding
|
757 |
-
*
|
758 |
-
* @param e (event)
|
759 |
-
* - DOM event object
|
760 |
-
*/
|
761 |
-
var clickPrevBind = function(e) {
|
762 |
-
e.preventDefault();
|
763 |
-
if (slider.controls.el.hasClass('disabled')) { return; }
|
764 |
-
// if auto show is running, stop it
|
765 |
-
if (slider.settings.auto && slider.settings.stopAutoOnClick) { el.stopAuto(); }
|
766 |
-
el.goToPrevSlide();
|
767 |
-
};
|
768 |
-
|
769 |
-
/**
|
770 |
-
* Click start binding
|
771 |
-
*
|
772 |
-
* @param e (event)
|
773 |
-
* - DOM event object
|
774 |
-
*/
|
775 |
-
var clickStartBind = function(e) {
|
776 |
-
el.startAuto();
|
777 |
-
e.preventDefault();
|
778 |
-
};
|
779 |
-
|
780 |
-
/**
|
781 |
-
* Click stop binding
|
782 |
-
*
|
783 |
-
* @param e (event)
|
784 |
-
* - DOM event object
|
785 |
-
*/
|
786 |
-
var clickStopBind = function(e) {
|
787 |
-
el.stopAuto();
|
788 |
-
e.preventDefault();
|
789 |
-
};
|
790 |
-
|
791 |
-
/**
|
792 |
-
* Click pager binding
|
793 |
-
*
|
794 |
-
* @param e (event)
|
795 |
-
* - DOM event object
|
796 |
-
*/
|
797 |
-
var clickPagerBind = function(e) {
|
798 |
-
var pagerLink, pagerIndex;
|
799 |
-
e.preventDefault();
|
800 |
-
if (slider.controls.el.hasClass('disabled')) {
|
801 |
-
return;
|
802 |
-
}
|
803 |
-
// if auto show is running, stop it
|
804 |
-
if (slider.settings.auto && slider.settings.stopAutoOnClick) { el.stopAuto(); }
|
805 |
-
pagerLink = $(e.currentTarget);
|
806 |
-
if (pagerLink.attr('data-slide-index') !== undefined) {
|
807 |
-
pagerIndex = parseInt(pagerLink.attr('data-slide-index'));
|
808 |
-
// if clicked pager link is not active, continue with the goToSlide call
|
809 |
-
if (pagerIndex !== slider.active.index) { el.goToSlide(pagerIndex); }
|
810 |
-
}
|
811 |
-
};
|
812 |
-
|
813 |
-
/**
|
814 |
-
* Updates the pager links with an active class
|
815 |
-
*
|
816 |
-
* @param slideIndex (int)
|
817 |
-
* - index of slide to make active
|
818 |
-
*/
|
819 |
-
var updatePagerActive = function(slideIndex) {
|
820 |
-
// if "short" pager type
|
821 |
-
var len = slider.children.length; // nb of children
|
822 |
-
if (slider.settings.pagerType === 'short') {
|
823 |
-
if (slider.settings.maxSlides > 1) {
|
824 |
-
len = Math.ceil(slider.children.length / slider.settings.maxSlides);
|
825 |
-
}
|
826 |
-
slider.pagerEl.html((slideIndex + 1) + slider.settings.pagerShortSeparator + len);
|
827 |
-
return;
|
828 |
-
}
|
829 |
-
// remove all pager active classes
|
830 |
-
slider.pagerEl.find('a').removeClass('active');
|
831 |
-
// apply the active class for all pagers
|
832 |
-
slider.pagerEl.each(function(i, el) { $(el).find('a').eq(slideIndex).addClass('active'); });
|
833 |
-
};
|
834 |
-
|
835 |
-
/**
|
836 |
-
* Performs needed actions after a slide transition
|
837 |
-
*/
|
838 |
-
var updateAfterSlideTransition = function() {
|
839 |
-
// if infinite loop is true
|
840 |
-
if (slider.settings.infiniteLoop) {
|
841 |
-
var position = '';
|
842 |
-
// first slide
|
843 |
-
if (slider.active.index === 0) {
|
844 |
-
// set the new position
|
845 |
-
position = slider.children.eq(0).position();
|
846 |
-
// carousel, last slide
|
847 |
-
} else if (slider.active.index === getPagerQty() - 1 && slider.carousel) {
|
848 |
-
position = slider.children.eq((getPagerQty() - 1) * getMoveBy()).position();
|
849 |
-
// last slide
|
850 |
-
} else if (slider.active.index === slider.children.length - 1) {
|
851 |
-
position = slider.children.eq(slider.children.length - 1).position();
|
852 |
-
}
|
853 |
-
if (position) {
|
854 |
-
if (slider.settings.mode === 'horizontal') { setPositionProperty(-position.left, 'reset', 0); }
|
855 |
-
else if (slider.settings.mode === 'vertical') { setPositionProperty(-position.top, 'reset', 0); }
|
856 |
-
}
|
857 |
-
}
|
858 |
-
// declare that the transition is complete
|
859 |
-
slider.working = false;
|
860 |
-
// onSlideAfter callback
|
861 |
-
slider.settings.onSlideAfter.call(el, slider.children.eq(slider.active.index), slider.oldIndex, slider.active.index);
|
862 |
-
};
|
863 |
-
|
864 |
-
/**
|
865 |
-
* Updates the auto controls state (either active, or combined switch)
|
866 |
-
*
|
867 |
-
* @param state (string) "start", "stop"
|
868 |
-
* - the new state of the auto show
|
869 |
-
*/
|
870 |
-
var updateAutoControls = function(state) {
|
871 |
-
// if autoControlsCombine is true, replace the current control with the new state
|
872 |
-
if (slider.settings.autoControlsCombine) {
|
873 |
-
slider.controls.autoEl.html(slider.controls[state]);
|
874 |
-
// if autoControlsCombine is false, apply the "active" class to the appropriate control
|
875 |
-
} else {
|
876 |
-
slider.controls.autoEl.find('a').removeClass('active');
|
877 |
-
slider.controls.autoEl.find('a:not(.bx-' + state + ')').addClass('active');
|
878 |
-
}
|
879 |
-
};
|
880 |
-
|
881 |
-
/**
|
882 |
-
* Updates the direction controls (checks if either should be hidden)
|
883 |
-
*/
|
884 |
-
var updateDirectionControls = function() {
|
885 |
-
if (getPagerQty() === 1) {
|
886 |
-
slider.controls.prev.addClass('disabled');
|
887 |
-
slider.controls.next.addClass('disabled');
|
888 |
-
} else if (!slider.settings.infiniteLoop && slider.settings.hideControlOnEnd) {
|
889 |
-
// if first slide
|
890 |
-
if (slider.active.index === 0) {
|
891 |
-
slider.controls.prev.addClass('disabled');
|
892 |
-
slider.controls.next.removeClass('disabled');
|
893 |
-
// if last slide
|
894 |
-
} else if (slider.active.index === getPagerQty() - 1) {
|
895 |
-
slider.controls.next.addClass('disabled');
|
896 |
-
slider.controls.prev.removeClass('disabled');
|
897 |
-
// if any slide in the middle
|
898 |
-
} else {
|
899 |
-
slider.controls.prev.removeClass('disabled');
|
900 |
-
slider.controls.next.removeClass('disabled');
|
901 |
-
}
|
902 |
-
}
|
903 |
-
};
|
904 |
-
|
905 |
-
/**
|
906 |
-
* Initializes the auto process
|
907 |
-
*/
|
908 |
-
var initAuto = function() {
|
909 |
-
// if autoDelay was supplied, launch the auto show using a setTimeout() call
|
910 |
-
if (slider.settings.autoDelay > 0) {
|
911 |
-
var timeout = setTimeout(el.startAuto, slider.settings.autoDelay);
|
912 |
-
// if autoDelay was not supplied, start the auto show normally
|
913 |
-
} else {
|
914 |
-
el.startAuto();
|
915 |
-
|
916 |
-
//add focus and blur events to ensure its running if timeout gets paused
|
917 |
-
$(window).focus(function() {
|
918 |
-
el.startAuto();
|
919 |
-
}).blur(function() {
|
920 |
-
el.stopAuto();
|
921 |
-
});
|
922 |
-
}
|
923 |
-
// if autoHover is requested
|
924 |
-
if (slider.settings.autoHover) {
|
925 |
-
// on el hover
|
926 |
-
el.hover(function() {
|
927 |
-
// if the auto show is currently playing (has an active interval)
|
928 |
-
if (slider.interval) {
|
929 |
-
// stop the auto show and pass true argument which will prevent control update
|
930 |
-
el.stopAuto(true);
|
931 |
-
// create a new autoPaused value which will be used by the relative "mouseout" event
|
932 |
-
slider.autoPaused = true;
|
933 |
-
}
|
934 |
-
}, function() {
|
935 |
-
// if the autoPaused value was created be the prior "mouseover" event
|
936 |
-
if (slider.autoPaused) {
|
937 |
-
// start the auto show and pass true argument which will prevent control update
|
938 |
-
el.startAuto(true);
|
939 |
-
// reset the autoPaused value
|
940 |
-
slider.autoPaused = null;
|
941 |
-
}
|
942 |
-
});
|
943 |
-
}
|
944 |
-
};
|
945 |
-
|
946 |
-
/**
|
947 |
-
* Initializes the ticker process
|
948 |
-
*/
|
949 |
-
var initTicker = function() {
|
950 |
-
var startPosition = 0,
|
951 |
-
position, transform, value, idx, ratio, property, newSpeed, totalDimens;
|
952 |
-
// if autoDirection is "next", append a clone of the entire slider
|
953 |
-
if (slider.settings.autoDirection === 'next') {
|
954 |
-
el.append(slider.children.clone().addClass('bx-clone'));
|
955 |
-
// if autoDirection is "prev", prepend a clone of the entire slider, and set the left position
|
956 |
-
} else {
|
957 |
-
el.prepend(slider.children.clone().addClass('bx-clone'));
|
958 |
-
position = slider.children.first().position();
|
959 |
-
startPosition = slider.settings.mode === 'horizontal' ? -position.left : -position.top;
|
960 |
-
}
|
961 |
-
setPositionProperty(startPosition, 'reset', 0);
|
962 |
-
// do not allow controls in ticker mode
|
963 |
-
slider.settings.pager = false;
|
964 |
-
slider.settings.controls = false;
|
965 |
-
slider.settings.autoControls = false;
|
966 |
-
// if autoHover is requested
|
967 |
-
if (slider.settings.tickerHover) {
|
968 |
-
if (slider.usingCSS) {
|
969 |
-
idx = slider.settings.mode === 'horizontal' ? 4 : 5;
|
970 |
-
slider.viewport.hover(function() {
|
971 |
-
transform = el.css('-' + slider.cssPrefix + '-transform');
|
972 |
-
value = parseFloat(transform.split(',')[idx]);
|
973 |
-
setPositionProperty(value, 'reset', 0);
|
974 |
-
}, function() {
|
975 |
-
totalDimens = 0;
|
976 |
-
slider.children.each(function(index) {
|
977 |
-
totalDimens += slider.settings.mode === 'horizontal' ? $(this).outerWidth(true) : $(this).outerHeight(true);
|
978 |
-
});
|
979 |
-
// calculate the speed ratio (used to determine the new speed to finish the paused animation)
|
980 |
-
ratio = slider.settings.speed / totalDimens;
|
981 |
-
// determine which property to use
|
982 |
-
property = slider.settings.mode === 'horizontal' ? 'left' : 'top';
|
983 |
-
// calculate the new speed
|
984 |
-
newSpeed = ratio * (totalDimens - (Math.abs(parseInt(value))));
|
985 |
-
tickerLoop(newSpeed);
|
986 |
-
});
|
987 |
-
} else {
|
988 |
-
// on el hover
|
989 |
-
slider.viewport.hover(function() {
|
990 |
-
el.stop();
|
991 |
-
}, function() {
|
992 |
-
// calculate the total width of children (used to calculate the speed ratio)
|
993 |
-
totalDimens = 0;
|
994 |
-
slider.children.each(function(index) {
|
995 |
-
totalDimens += slider.settings.mode === 'horizontal' ? $(this).outerWidth(true) : $(this).outerHeight(true);
|
996 |
-
});
|
997 |
-
// calculate the speed ratio (used to determine the new speed to finish the paused animation)
|
998 |
-
ratio = slider.settings.speed / totalDimens;
|
999 |
-
// determine which property to use
|
1000 |
-
property = slider.settings.mode === 'horizontal' ? 'left' : 'top';
|
1001 |
-
// calculate the new speed
|
1002 |
-
newSpeed = ratio * (totalDimens - (Math.abs(parseInt(el.css(property)))));
|
1003 |
-
tickerLoop(newSpeed);
|
1004 |
-
});
|
1005 |
-
}
|
1006 |
-
}
|
1007 |
-
// start the ticker loop
|
1008 |
-
tickerLoop();
|
1009 |
-
};
|
1010 |
-
|
1011 |
-
/**
|
1012 |
-
* Runs a continuous loop, news ticker-style
|
1013 |
-
*/
|
1014 |
-
var tickerLoop = function(resumeSpeed) {
|
1015 |
-
var speed = resumeSpeed ? resumeSpeed : slider.settings.speed,
|
1016 |
-
position = {left: 0, top: 0},
|
1017 |
-
reset = {left: 0, top: 0},
|
1018 |
-
animateProperty, resetValue, params;
|
1019 |
-
|
1020 |
-
// if "next" animate left position to last child, then reset left to 0
|
1021 |
-
if (slider.settings.autoDirection === 'next') {
|
1022 |
-
position = el.find('.bx-clone').first().position();
|
1023 |
-
// if "prev" animate left position to 0, then reset left to first non-clone child
|
1024 |
-
} else {
|
1025 |
-
reset = slider.children.first().position();
|
1026 |
-
}
|
1027 |
-
animateProperty = slider.settings.mode === 'horizontal' ? -position.left : -position.top;
|
1028 |
-
resetValue = slider.settings.mode === 'horizontal' ? -reset.left : -reset.top;
|
1029 |
-
params = {resetValue: resetValue};
|
1030 |
-
setPositionProperty(animateProperty, 'ticker', speed, params);
|
1031 |
-
};
|
1032 |
-
|
1033 |
-
/**
|
1034 |
-
* Check if el is on screen
|
1035 |
-
*/
|
1036 |
-
var isOnScreen = function(el) {
|
1037 |
-
var win = $(window),
|
1038 |
-
viewport = {
|
1039 |
-
top: win.scrollTop(),
|
1040 |
-
left: win.scrollLeft()
|
1041 |
-
},
|
1042 |
-
bounds = el.offset();
|
1043 |
-
|
1044 |
-
viewport.right = viewport.left + win.width();
|
1045 |
-
viewport.bottom = viewport.top + win.height();
|
1046 |
-
bounds.right = bounds.left + el.outerWidth();
|
1047 |
-
bounds.bottom = bounds.top + el.outerHeight();
|
1048 |
-
|
1049 |
-
return (!(viewport.right < bounds.left || viewport.left > bounds.right || viewport.bottom < bounds.top || viewport.top > bounds.bottom));
|
1050 |
-
};
|
1051 |
-
|
1052 |
-
/**
|
1053 |
-
* Initializes keyboard events
|
1054 |
-
*/
|
1055 |
-
var keyPress = function(e) {
|
1056 |
-
var activeElementTag = document.activeElement.tagName.toLowerCase(),
|
1057 |
-
tagFilters = 'input|textarea',
|
1058 |
-
p = new RegExp(activeElementTag,['i']),
|
1059 |
-
result = p.exec(tagFilters);
|
1060 |
-
|
1061 |
-
if (result == null && isOnScreen(el)) {
|
1062 |
-
if (e.keyCode === 39) {
|
1063 |
-
clickNextBind(e);
|
1064 |
-
return false;
|
1065 |
-
} else if (e.keyCode === 37) {
|
1066 |
-
clickPrevBind(e);
|
1067 |
-
return false;
|
1068 |
-
}
|
1069 |
-
}
|
1070 |
-
};
|
1071 |
-
|
1072 |
-
/**
|
1073 |
-
* Initializes touch events
|
1074 |
-
*/
|
1075 |
-
var initTouch = function() {
|
1076 |
-
// initialize object to contain all touch values
|
1077 |
-
slider.touch = {
|
1078 |
-
start: {x: 0, y: 0},
|
1079 |
-
end: {x: 0, y: 0}
|
1080 |
-
};
|
1081 |
-
slider.viewport.bind('touchstart MSPointerDown pointerdown', onTouchStart);
|
1082 |
-
|
1083 |
-
//for browsers that have implemented pointer events and fire a click after
|
1084 |
-
//every pointerup regardless of whether pointerup is on same screen location as pointerdown or not
|
1085 |
-
slider.viewport.on('click', '.bxslider a', function(e) {
|
1086 |
-
if (slider.viewport.hasClass('click-disabled')) {
|
1087 |
-
e.preventDefault();
|
1088 |
-
slider.viewport.removeClass('click-disabled');
|
1089 |
-
}
|
1090 |
-
});
|
1091 |
-
};
|
1092 |
-
|
1093 |
-
/**
|
1094 |
-
* Event handler for "touchstart"
|
1095 |
-
*
|
1096 |
-
* @param e (event)
|
1097 |
-
* - DOM event object
|
1098 |
-
*/
|
1099 |
-
var onTouchStart = function(e) {
|
1100 |
-
//disable slider controls while user is interacting with slides to avoid slider freeze that happens on touch devices when a slide swipe happens immediately after interacting with slider controls
|
1101 |
-
slider.controls.el.addClass('disabled');
|
1102 |
-
|
1103 |
-
if (slider.working) {
|
1104 |
-
e.preventDefault();
|
1105 |
-
slider.controls.el.removeClass('disabled');
|
1106 |
-
} else {
|
1107 |
-
// record the original position when touch starts
|
1108 |
-
slider.touch.originalPos = el.position();
|
1109 |
-
var orig = e.originalEvent,
|
1110 |
-
touchPoints = (typeof orig.changedTouches !== 'undefined') ? orig.changedTouches : [orig];
|
1111 |
-
// record the starting touch x, y coordinates
|
1112 |
-
slider.touch.start.x = touchPoints[0].pageX;
|
1113 |
-
slider.touch.start.y = touchPoints[0].pageY;
|
1114 |
-
|
1115 |
-
if (slider.viewport.get(0).setPointerCapture) {
|
1116 |
-
slider.pointerId = orig.pointerId;
|
1117 |
-
slider.viewport.get(0).setPointerCapture(slider.pointerId);
|
1118 |
-
}
|
1119 |
-
// bind a "touchmove" event to the viewport
|
1120 |
-
slider.viewport.bind('touchmove MSPointerMove pointermove', onTouchMove);
|
1121 |
-
// bind a "touchend" event to the viewport
|
1122 |
-
slider.viewport.bind('touchend MSPointerUp pointerup', onTouchEnd);
|
1123 |
-
slider.viewport.bind('MSPointerCancel pointercancel', onPointerCancel);
|
1124 |
-
}
|
1125 |
-
};
|
1126 |
-
|
1127 |
-
/**
|
1128 |
-
* Cancel Pointer for Windows Phone
|
1129 |
-
*
|
1130 |
-
* @param e (event)
|
1131 |
-
* - DOM event object
|
1132 |
-
*/
|
1133 |
-
var onPointerCancel = function(e) {
|
1134 |
-
/* onPointerCancel handler is needed to deal with situations when a touchend
|
1135 |
-
doesn't fire after a touchstart (this happens on windows phones only) */
|
1136 |
-
setPositionProperty(slider.touch.originalPos.left, 'reset', 0);
|
1137 |
-
|
1138 |
-
//remove handlers
|
1139 |
-
slider.controls.el.removeClass('disabled');
|
1140 |
-
slider.viewport.unbind('MSPointerCancel pointercancel', onPointerCancel);
|
1141 |
-
slider.viewport.unbind('touchmove MSPointerMove pointermove', onTouchMove);
|
1142 |
-
slider.viewport.unbind('touchend MSPointerUp pointerup', onTouchEnd);
|
1143 |
-
if (slider.viewport.get(0).releasePointerCapture) {
|
1144 |
-
slider.viewport.get(0).releasePointerCapture(slider.pointerId);
|
1145 |
-
}
|
1146 |
-
};
|
1147 |
-
|
1148 |
-
/**
|
1149 |
-
* Event handler for "touchmove"
|
1150 |
-
*
|
1151 |
-
* @param e (event)
|
1152 |
-
* - DOM event object
|
1153 |
-
*/
|
1154 |
-
var onTouchMove = function(e) {
|
1155 |
-
var orig = e.originalEvent,
|
1156 |
-
touchPoints = (typeof orig.changedTouches !== 'undefined') ? orig.changedTouches : [orig],
|
1157 |
-
// if scrolling on y axis, do not prevent default
|
1158 |
-
xMovement = Math.abs(touchPoints[0].pageX - slider.touch.start.x),
|
1159 |
-
yMovement = Math.abs(touchPoints[0].pageY - slider.touch.start.y),
|
1160 |
-
value = 0,
|
1161 |
-
change = 0;
|
1162 |
-
|
1163 |
-
// x axis swipe
|
1164 |
-
if ((xMovement * 3) > yMovement && slider.settings.preventDefaultSwipeX) {
|
1165 |
-
e.preventDefault();
|
1166 |
-
// y axis swipe
|
1167 |
-
} else if ((yMovement * 3) > xMovement && slider.settings.preventDefaultSwipeY) {
|
1168 |
-
e.preventDefault();
|
1169 |
-
}
|
1170 |
-
if (slider.settings.mode !== 'fade' && slider.settings.oneToOneTouch) {
|
1171 |
-
// if horizontal, drag along x axis
|
1172 |
-
if (slider.settings.mode === 'horizontal') {
|
1173 |
-
change = touchPoints[0].pageX - slider.touch.start.x;
|
1174 |
-
value = slider.touch.originalPos.left + change;
|
1175 |
-
// if vertical, drag along y axis
|
1176 |
-
} else {
|
1177 |
-
change = touchPoints[0].pageY - slider.touch.start.y;
|
1178 |
-
value = slider.touch.originalPos.top + change;
|
1179 |
-
}
|
1180 |
-
setPositionProperty(value, 'reset', 0);
|
1181 |
-
}
|
1182 |
-
};
|
1183 |
-
|
1184 |
-
/**
|
1185 |
-
* Event handler for "touchend"
|
1186 |
-
*
|
1187 |
-
* @param e (event)
|
1188 |
-
* - DOM event object
|
1189 |
-
*/
|
1190 |
-
var onTouchEnd = function(e) {
|
1191 |
-
slider.viewport.unbind('touchmove MSPointerMove pointermove', onTouchMove);
|
1192 |
-
//enable slider controls as soon as user stops interacing with slides
|
1193 |
-
slider.controls.el.removeClass('disabled');
|
1194 |
-
var orig = e.originalEvent,
|
1195 |
-
touchPoints = (typeof orig.changedTouches !== 'undefined') ? orig.changedTouches : [orig],
|
1196 |
-
value = 0,
|
1197 |
-
distance = 0;
|
1198 |
-
// record end x, y positions
|
1199 |
-
slider.touch.end.x = touchPoints[0].pageX;
|
1200 |
-
slider.touch.end.y = touchPoints[0].pageY;
|
1201 |
-
// if fade mode, check if absolute x distance clears the threshold
|
1202 |
-
if (slider.settings.mode === 'fade') {
|
1203 |
-
distance = Math.abs(slider.touch.start.x - slider.touch.end.x);
|
1204 |
-
if (distance >= slider.settings.swipeThreshold) {
|
1205 |
-
if (slider.touch.start.x > slider.touch.end.x) {
|
1206 |
-
el.goToNextSlide();
|
1207 |
-
} else {
|
1208 |
-
el.goToPrevSlide();
|
1209 |
-
}
|
1210 |
-
el.stopAuto();
|
1211 |
-
}
|
1212 |
-
// not fade mode
|
1213 |
-
} else {
|
1214 |
-
// calculate distance and el's animate property
|
1215 |
-
if (slider.settings.mode === 'horizontal') {
|
1216 |
-
distance = slider.touch.end.x - slider.touch.start.x;
|
1217 |
-
value = slider.touch.originalPos.left;
|
1218 |
-
} else {
|
1219 |
-
distance = slider.touch.end.y - slider.touch.start.y;
|
1220 |
-
value = slider.touch.originalPos.top;
|
1221 |
-
}
|
1222 |
-
// if not infinite loop and first / last slide, do not attempt a slide transition
|
1223 |
-
if (!slider.settings.infiniteLoop && ((slider.active.index === 0 && distance > 0) || (slider.active.last && distance < 0))) {
|
1224 |
-
setPositionProperty(value, 'reset', 200);
|
1225 |
-
} else {
|
1226 |
-
// check if distance clears threshold
|
1227 |
-
if (Math.abs(distance) >= slider.settings.swipeThreshold) {
|
1228 |
-
if (distance < 0) {
|
1229 |
-
el.goToNextSlide();
|
1230 |
-
} else {
|
1231 |
-
el.goToPrevSlide();
|
1232 |
-
}
|
1233 |
-
el.stopAuto();
|
1234 |
-
} else {
|
1235 |
-
// el.animate(property, 200);
|
1236 |
-
setPositionProperty(value, 'reset', 200);
|
1237 |
-
}
|
1238 |
-
}
|
1239 |
-
}
|
1240 |
-
slider.viewport.unbind('touchend MSPointerUp pointerup', onTouchEnd);
|
1241 |
-
if (slider.viewport.get(0).releasePointerCapture) {
|
1242 |
-
slider.viewport.get(0).releasePointerCapture(slider.pointerId);
|
1243 |
-
}
|
1244 |
-
};
|
1245 |
-
|
1246 |
-
/**
|
1247 |
-
* Window resize event callback
|
1248 |
-
*/
|
1249 |
-
var resizeWindow = function(e) {
|
1250 |
-
// don't do anything if slider isn't initialized.
|
1251 |
-
if (!slider.initialized) { return; }
|
1252 |
-
// Delay if slider working.
|
1253 |
-
if (slider.working) {
|
1254 |
-
window.setTimeout(resizeWindow, 10);
|
1255 |
-
} else {
|
1256 |
-
// get the new window dimens (again, thank you IE)
|
1257 |
-
var windowWidthNew = $(window).width(),
|
1258 |
-
windowHeightNew = $(window).height();
|
1259 |
-
// make sure that it is a true window resize
|
1260 |
-
// *we must check this because our dinosaur friend IE fires a window resize event when certain DOM elements
|
1261 |
-
// are resized. Can you just die already?*
|
1262 |
-
if (windowWidth !== windowWidthNew || windowHeight !== windowHeightNew) {
|
1263 |
-
// set the new window dimens
|
1264 |
-
windowWidth = windowWidthNew;
|
1265 |
-
windowHeight = windowHeightNew;
|
1266 |
-
// update all dynamic elements
|
1267 |
-
el.redrawSlider();
|
1268 |
-
// Call user resize handler
|
1269 |
-
slider.settings.onSliderResize.call(el, slider.active.index);
|
1270 |
-
}
|
1271 |
-
}
|
1272 |
-
};
|
1273 |
-
|
1274 |
-
/**
|
1275 |
-
* Adds an aria-hidden=true attribute to each element
|
1276 |
-
*
|
1277 |
-
* @param startVisibleIndex (int)
|
1278 |
-
* - the first visible element's index
|
1279 |
-
*/
|
1280 |
-
var applyAriaHiddenAttributes = function(startVisibleIndex) {
|
1281 |
-
var numberOfSlidesShowing = getNumberSlidesShowing();
|
1282 |
-
// only apply attributes if the setting is enabled and not in ticker mode
|
1283 |
-
if (slider.settings.ariaHidden && !slider.settings.ticker) {
|
1284 |
-
// add aria-hidden=true to all elements
|
1285 |
-
slider.children.attr('aria-hidden', 'true');
|
1286 |
-
// get the visible elements and change to aria-hidden=false
|
1287 |
-
slider.children.slice(startVisibleIndex, startVisibleIndex + numberOfSlidesShowing).attr('aria-hidden', 'false');
|
1288 |
-
}
|
1289 |
-
};
|
1290 |
-
|
1291 |
-
/**
|
1292 |
-
* Returns index according to present page range
|
1293 |
-
*
|
1294 |
-
* @param slideOndex (int)
|
1295 |
-
* - the desired slide index
|
1296 |
-
*/
|
1297 |
-
var setSlideIndex = function(slideIndex) {
|
1298 |
-
if (slideIndex < 0) {
|
1299 |
-
if (slider.settings.infiniteLoop) {
|
1300 |
-
return getPagerQty() - 1;
|
1301 |
-
}else {
|
1302 |
-
//we don't go to undefined slides
|
1303 |
-
return slider.active.index;
|
1304 |
-
}
|
1305 |
-
// if slideIndex is greater than children length, set active index to 0 (this happens during infinite loop)
|
1306 |
-
} else if (slideIndex >= getPagerQty()) {
|
1307 |
-
if (slider.settings.infiniteLoop) {
|
1308 |
-
return 0;
|
1309 |
-
} else {
|
1310 |
-
//we don't move to undefined pages
|
1311 |
-
return slider.active.index;
|
1312 |
-
}
|
1313 |
-
// set active index to requested slide
|
1314 |
-
} else {
|
1315 |
-
return slideIndex;
|
1316 |
-
}
|
1317 |
-
};
|
1318 |
-
|
1319 |
-
/**
|
1320 |
-
* ===================================================================================
|
1321 |
-
* = PUBLIC FUNCTIONS
|
1322 |
-
* ===================================================================================
|
1323 |
-
*/
|
1324 |
-
|
1325 |
-
/**
|
1326 |
-
* Performs slide transition to the specified slide
|
1327 |
-
*
|
1328 |
-
* @param slideIndex (int)
|
1329 |
-
* - the destination slide's index (zero-based)
|
1330 |
-
*
|
1331 |
-
* @param direction (string)
|
1332 |
-
* - INTERNAL USE ONLY - the direction of travel ("prev" / "next")
|
1333 |
-
*/
|
1334 |
-
el.goToSlide = function(slideIndex, direction) {
|
1335 |
-
// onSlideBefore, onSlideNext, onSlidePrev callbacks
|
1336 |
-
// Allow transition canceling based on returned value
|
1337 |
-
var performTransition = true,
|
1338 |
-
moveBy = 0,
|
1339 |
-
position = {left: 0, top: 0},
|
1340 |
-
lastChild = null,
|
1341 |
-
lastShowingIndex, eq, value, requestEl;
|
1342 |
-
// store the old index
|
1343 |
-
slider.oldIndex = slider.active.index;
|
1344 |
-
//set new index
|
1345 |
-
slider.active.index = setSlideIndex(slideIndex);
|
1346 |
-
|
1347 |
-
// if plugin is currently in motion, ignore request
|
1348 |
-
if (slider.working || slider.active.index === slider.oldIndex) { return; }
|
1349 |
-
// declare that plugin is in motion
|
1350 |
-
slider.working = true;
|
1351 |
-
|
1352 |
-
performTransition = slider.settings.onSlideBefore.call(el, slider.children.eq(slider.active.index), slider.oldIndex, slider.active.index);
|
1353 |
-
|
1354 |
-
// If transitions canceled, reset and return
|
1355 |
-
if (typeof (performTransition) !== 'undefined' && !performTransition) {
|
1356 |
-
slider.active.index = slider.oldIndex; // restore old index
|
1357 |
-
slider.working = false; // is not in motion
|
1358 |
-
return;
|
1359 |
-
}
|
1360 |
-
|
1361 |
-
if (direction === 'next') {
|
1362 |
-
// Prevent canceling in future functions or lack there-of from negating previous commands to cancel
|
1363 |
-
if (!slider.settings.onSlideNext.call(el, slider.children.eq(slider.active.index), slider.oldIndex, slider.active.index)) {
|
1364 |
-
performTransition = false;
|
1365 |
-
}
|
1366 |
-
} else if (direction === 'prev') {
|
1367 |
-
// Prevent canceling in future functions or lack there-of from negating previous commands to cancel
|
1368 |
-
if (!slider.settings.onSlidePrev.call(el, slider.children.eq(slider.active.index), slider.oldIndex, slider.active.index)) {
|
1369 |
-
performTransition = false;
|
1370 |
-
}
|
1371 |
-
}
|
1372 |
-
|
1373 |
-
// check if last slide
|
1374 |
-
slider.active.last = slider.active.index >= getPagerQty() - 1;
|
1375 |
-
// update the pager with active class
|
1376 |
-
if (slider.settings.pager || slider.settings.pagerCustom) { updatePagerActive(slider.active.index); }
|
1377 |
-
// // check for direction control update
|
1378 |
-
if (slider.settings.controls) { updateDirectionControls(); }
|
1379 |
-
// if slider is set to mode: "fade"
|
1380 |
-
if (slider.settings.mode === 'fade') {
|
1381 |
-
// if adaptiveHeight is true and next height is different from current height, animate to the new height
|
1382 |
-
if (slider.settings.adaptiveHeight && slider.viewport.height() !== getViewportHeight()) {
|
1383 |
-
slider.viewport.animate({height: getViewportHeight()}, slider.settings.adaptiveHeightSpeed);
|
1384 |
-
}
|
1385 |
-
// fade out the visible child and reset its z-index value
|
1386 |
-
slider.children.filter(':visible').fadeOut(slider.settings.speed).css({zIndex: 0});
|
1387 |
-
// fade in the newly requested slide
|
1388 |
-
slider.children.eq(slider.active.index).css('zIndex', slider.settings.slideZIndex + 1).fadeIn(slider.settings.speed, function() {
|
1389 |
-
$(this).css('zIndex', slider.settings.slideZIndex);
|
1390 |
-
updateAfterSlideTransition();
|
1391 |
-
});
|
1392 |
-
// slider mode is not "fade"
|
1393 |
-
} else {
|
1394 |
-
// if adaptiveHeight is true and next height is different from current height, animate to the new height
|
1395 |
-
if (slider.settings.adaptiveHeight && slider.viewport.height() !== getViewportHeight()) {
|
1396 |
-
slider.viewport.animate({height: getViewportHeight()}, slider.settings.adaptiveHeightSpeed);
|
1397 |
-
}
|
1398 |
-
// if carousel and not infinite loop
|
1399 |
-
if (!slider.settings.infiniteLoop && slider.carousel && slider.active.last) {
|
1400 |
-
if (slider.settings.mode === 'horizontal') {
|
1401 |
-
// get the last child position
|
1402 |
-
lastChild = slider.children.eq(slider.children.length - 1);
|
1403 |
-
position = lastChild.position();
|
1404 |
-
// calculate the position of the last slide
|
1405 |
-
moveBy = slider.viewport.width() - lastChild.outerWidth();
|
1406 |
-
} else {
|
1407 |
-
// get last showing index position
|
1408 |
-
lastShowingIndex = slider.children.length - slider.settings.minSlides;
|
1409 |
-
position = slider.children.eq(lastShowingIndex).position();
|
1410 |
-
}
|
1411 |
-
// horizontal carousel, going previous while on first slide (infiniteLoop mode)
|
1412 |
-
} else if (slider.carousel && slider.active.last && direction === 'prev') {
|
1413 |
-
// get the last child position
|
1414 |
-
eq = slider.settings.moveSlides === 1 ? slider.settings.maxSlides - getMoveBy() : ((getPagerQty() - 1) * getMoveBy()) - (slider.children.length - slider.settings.maxSlides);
|
1415 |
-
lastChild = el.children('.bx-clone').eq(eq);
|
1416 |
-
position = lastChild.position();
|
1417 |
-
// if infinite loop and "Next" is clicked on the last slide
|
1418 |
-
} else if (direction === 'next' && slider.active.index === 0) {
|
1419 |
-
// get the last clone position
|
1420 |
-
position = el.find('> .bx-clone').eq(slider.settings.maxSlides).position();
|
1421 |
-
slider.active.last = false;
|
1422 |
-
// normal non-zero requests
|
1423 |
-
} else if (slideIndex >= 0) {
|
1424 |
-
//parseInt is applied to allow floats for slides/page
|
1425 |
-
requestEl = slideIndex * parseInt(getMoveBy());
|
1426 |
-
position = slider.children.eq(requestEl).position();
|
1427 |
-
}
|
1428 |
-
|
1429 |
-
/* If the position doesn't exist
|
1430 |
-
* (e.g. if you destroy the slider on a next click),
|
1431 |
-
* it doesn't throw an error.
|
1432 |
-
*/
|
1433 |
-
if (typeof (position) !== 'undefined') {
|
1434 |
-
value = slider.settings.mode === 'horizontal' ? -(position.left - moveBy) : -position.top;
|
1435 |
-
// plugin values to be animated
|
1436 |
-
setPositionProperty(value, 'slide', slider.settings.speed);
|
1437 |
-
} else {
|
1438 |
-
slider.working = false;
|
1439 |
-
}
|
1440 |
-
}
|
1441 |
-
if (slider.settings.ariaHidden) { applyAriaHiddenAttributes(slider.active.index * getMoveBy()); }
|
1442 |
-
};
|
1443 |
-
|
1444 |
-
/**
|
1445 |
-
* Transitions to the next slide in the show
|
1446 |
-
*/
|
1447 |
-
el.goToNextSlide = function() {
|
1448 |
-
// if infiniteLoop is false and last page is showing, disregard call
|
1449 |
-
if (!slider.settings.infiniteLoop && slider.active.last) { return; }
|
1450 |
-
var pagerIndex = parseInt(slider.active.index) + 1;
|
1451 |
-
el.goToSlide(pagerIndex, 'next');
|
1452 |
-
};
|
1453 |
-
|
1454 |
-
/**
|
1455 |
-
* Transitions to the prev slide in the show
|
1456 |
-
*/
|
1457 |
-
el.goToPrevSlide = function() {
|
1458 |
-
// if infiniteLoop is false and last page is showing, disregard call
|
1459 |
-
if (!slider.settings.infiniteLoop && slider.active.index === 0) { return; }
|
1460 |
-
var pagerIndex = parseInt(slider.active.index) - 1;
|
1461 |
-
el.goToSlide(pagerIndex, 'prev');
|
1462 |
-
};
|
1463 |
-
|
1464 |
-
/**
|
1465 |
-
* Starts the auto show
|
1466 |
-
*
|
1467 |
-
* @param preventControlUpdate (boolean)
|
1468 |
-
* - if true, auto controls state will not be updated
|
1469 |
-
*/
|
1470 |
-
el.startAuto = function(preventControlUpdate) {
|
1471 |
-
// if an interval already exists, disregard call
|
1472 |
-
if (slider.interval) { return; }
|
1473 |
-
// create an interval
|
1474 |
-
slider.interval = setInterval(function() {
|
1475 |
-
if (slider.settings.autoDirection === 'next') {
|
1476 |
-
el.goToNextSlide();
|
1477 |
-
} else {
|
1478 |
-
el.goToPrevSlide();
|
1479 |
-
}
|
1480 |
-
}, slider.settings.pause);
|
1481 |
-
// if auto controls are displayed and preventControlUpdate is not true
|
1482 |
-
if (slider.settings.autoControls && preventControlUpdate !== true) { updateAutoControls('stop'); }
|
1483 |
-
};
|
1484 |
-
|
1485 |
-
/**
|
1486 |
-
* Stops the auto show
|
1487 |
-
*
|
1488 |
-
* @param preventControlUpdate (boolean)
|
1489 |
-
* - if true, auto controls state will not be updated
|
1490 |
-
*/
|
1491 |
-
el.stopAuto = function(preventControlUpdate) {
|
1492 |
-
// if no interval exists, disregard call
|
1493 |
-
if (!slider.interval) { return; }
|
1494 |
-
// clear the interval
|
1495 |
-
clearInterval(slider.interval);
|
1496 |
-
slider.interval = null;
|
1497 |
-
// if auto controls are displayed and preventControlUpdate is not true
|
1498 |
-
if (slider.settings.autoControls && preventControlUpdate !== true) { updateAutoControls('start'); }
|
1499 |
-
};
|
1500 |
-
|
1501 |
-
/**
|
1502 |
-
* Returns current slide index (zero-based)
|
1503 |
-
*/
|
1504 |
-
el.getCurrentSlide = function() {
|
1505 |
-
return slider.active.index;
|
1506 |
-
};
|
1507 |
-
|
1508 |
-
/**
|
1509 |
-
* Returns current slide element
|
1510 |
-
*/
|
1511 |
-
el.getCurrentSlideElement = function() {
|
1512 |
-
return slider.children.eq(slider.active.index);
|
1513 |
-
};
|
1514 |
-
|
1515 |
-
/**
|
1516 |
-
* Returns a slide element
|
1517 |
-
* @param index (int)
|
1518 |
-
* - The index (zero-based) of the element you want returned.
|
1519 |
-
*/
|
1520 |
-
el.getSlideElement = function(index) {
|
1521 |
-
return slider.children.eq(index);
|
1522 |
-
};
|
1523 |
-
|
1524 |
-
/**
|
1525 |
-
* Returns number of slides in show
|
1526 |
-
*/
|
1527 |
-
el.getSlideCount = function() {
|
1528 |
-
return slider.children.length;
|
1529 |
-
};
|
1530 |
-
|
1531 |
-
/**
|
1532 |
-
* Return slider.working variable
|
1533 |
-
*/
|
1534 |
-
el.isWorking = function() {
|
1535 |
-
return slider.working;
|
1536 |
-
};
|
1537 |
-
|
1538 |
-
/**
|
1539 |
-
* Update all dynamic slider elements
|
1540 |
-
*/
|
1541 |
-
el.redrawSlider = function() {
|
1542 |
-
// resize all children in ratio to new screen size
|
1543 |
-
slider.children.add(el.find('.bx-clone')).outerWidth(getSlideWidth());
|
1544 |
-
// adjust the height
|
1545 |
-
slider.viewport.css('height', getViewportHeight());
|
1546 |
-
// update the slide position
|
1547 |
-
if (!slider.settings.ticker) { setSlidePosition(); }
|
1548 |
-
// if active.last was true before the screen resize, we want
|
1549 |
-
// to keep it last no matter what screen size we end on
|
1550 |
-
if (slider.active.last) { slider.active.index = getPagerQty() - 1; }
|
1551 |
-
// if the active index (page) no longer exists due to the resize, simply set the index as last
|
1552 |
-
if (slider.active.index >= getPagerQty()) { slider.active.last = true; }
|
1553 |
-
// if a pager is being displayed and a custom pager is not being used, update it
|
1554 |
-
if (slider.settings.pager && !slider.settings.pagerCustom) {
|
1555 |
-
populatePager();
|
1556 |
-
updatePagerActive(slider.active.index);
|
1557 |
-
}
|
1558 |
-
if (slider.settings.ariaHidden) { applyAriaHiddenAttributes(slider.active.index * getMoveBy()); }
|
1559 |
-
};
|
1560 |
-
|
1561 |
-
/**
|
1562 |
-
* Destroy the current instance of the slider (revert everything back to original state)
|
1563 |
-
*/
|
1564 |
-
el.destroySlider = function() {
|
1565 |
-
// don't do anything if slider has already been destroyed
|
1566 |
-
if (!slider.initialized) { return; }
|
1567 |
-
slider.initialized = false;
|
1568 |
-
$('.bx-clone', this).remove();
|
1569 |
-
slider.children.each(function() {
|
1570 |
-
if ($(this).data('origStyle') !== undefined) {
|
1571 |
-
$(this).attr('style', $(this).data('origStyle'));
|
1572 |
-
} else {
|
1573 |
-
$(this).removeAttr('style');
|
1574 |
-
}
|
1575 |
-
});
|
1576 |
-
if ($(this).data('origStyle') !== undefined) {
|
1577 |
-
this.attr('style', $(this).data('origStyle'));
|
1578 |
-
} else {
|
1579 |
-
$(this).removeAttr('style');
|
1580 |
-
}
|
1581 |
-
$(this).unwrap().unwrap();
|
1582 |
-
if (slider.controls.el) { slider.controls.el.remove(); }
|
1583 |
-
if (slider.controls.next) { slider.controls.next.remove(); }
|
1584 |
-
if (slider.controls.prev) { slider.controls.prev.remove(); }
|
1585 |
-
if (slider.pagerEl && slider.settings.controls && !slider.settings.pagerCustom) { slider.pagerEl.remove(); }
|
1586 |
-
$('.bx-caption', this).remove();
|
1587 |
-
if (slider.controls.autoEl) { slider.controls.autoEl.remove(); }
|
1588 |
-
clearInterval(slider.interval);
|
1589 |
-
if (slider.settings.responsive) { $(window).unbind('resize', resizeWindow); }
|
1590 |
-
if (slider.settings.keyboardEnabled) { $(document).unbind('keydown', keyPress); }
|
1591 |
-
//remove self reference in data
|
1592 |
-
$(this).removeData('bxSlider');
|
1593 |
-
};
|
1594 |
-
|
1595 |
-
/**
|
1596 |
-
* Reload the slider (revert all DOM changes, and re-initialize)
|
1597 |
-
*/
|
1598 |
-
el.reloadSlider = function(settings) {
|
1599 |
-
if (settings !== undefined) { options = settings; }
|
1600 |
-
el.destroySlider();
|
1601 |
-
init();
|
1602 |
-
//store reference to self in order to access public functions later
|
1603 |
-
$(el).data('bxSlider', this);
|
1604 |
-
};
|
1605 |
-
|
1606 |
-
init();
|
1607 |
-
|
1608 |
-
$(el).data('bxSlider', this);
|
1609 |
-
|
1610 |
-
// returns the current jQuery object
|
1611 |
-
return this;
|
1612 |
-
};
|
1613 |
-
|
1614 |
-
})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/bxslider-4/dist/jquery.bxslider.min.css
DELETED
@@ -1,10 +0,0 @@
|
|
1 |
-
/**
|
2 |
-
* bxSlider v4.2.5
|
3 |
-
* Copyright 2013-2015 Steven Wanderski
|
4 |
-
* Written while drinking Belgian ales and listening to jazz
|
5 |
-
|
6 |
-
* Licensed under MIT (http://opensource.org/licenses/MIT)
|
7 |
-
*/
|
8 |
-
|
9 |
-
|
10 |
-
.bx-wrapper{position:relative;margin:0 auto 60px;padding:0;*zoom:1;-ms-touch-action:pan-y;touch-action:pan-y}.bx-wrapper img{max-width:100%;display:block}.bxslider{margin:0;padding:0}ul.bxslider{list-style:none}.bx-viewport{-webkit-transform:translatez(0)}.bx-wrapper{-moz-box-shadow:0 0 5px #ccc;-webkit-box-shadow:0 0 5px #ccc;box-shadow:0 0 5px #ccc;border:5px solid #fff;background:#fff}.bx-wrapper .bx-controls-auto,.bx-wrapper .bx-pager{position:absolute;bottom:-30px;width:100%}.bx-wrapper .bx-loading{min-height:50px;background:url(images/bx_loader.gif) center center no-repeat #fff;height:100%;width:100%;position:absolute;top:0;left:0;z-index:2000}.bx-wrapper .bx-pager{text-align:center;font-size:.85em;font-family:Arial;font-weight:700;color:#666;padding-top:20px}.bx-wrapper .bx-pager.bx-default-pager a{background:#666;text-indent:-9999px;display:block;width:10px;height:10px;margin:0 5px;outline:0;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px}.bx-wrapper .bx-pager.bx-default-pager a.active,.bx-wrapper .bx-pager.bx-default-pager a:focus,.bx-wrapper .bx-pager.bx-default-pager a:hover{background:#000}.bx-wrapper .bx-controls-auto .bx-controls-auto-item,.bx-wrapper .bx-pager-item{display:inline-block;*zoom:1;*display:inline}.bx-wrapper .bx-pager-item{font-size:0;line-height:0}.bx-wrapper .bx-prev{left:10px;background:url(images/controls.png) no-repeat 0 -32px}.bx-wrapper .bx-prev:focus,.bx-wrapper .bx-prev:hover{background-position:0 0}.bx-wrapper .bx-next{right:10px;background:url(images/controls.png) no-repeat -43px -32px}.bx-wrapper .bx-next:focus,.bx-wrapper .bx-next:hover{background-position:-43px 0}.bx-wrapper .bx-controls-direction a{position:absolute;top:50%;margin-top:-16px;outline:0;width:32px;height:32px;text-indent:-9999px;z-index:9999}.bx-wrapper .bx-controls-direction a.disabled{display:none}.bx-wrapper .bx-controls-auto{text-align:center}.bx-wrapper .bx-controls-auto .bx-start{display:block;text-indent:-9999px;width:10px;height:11px;outline:0;background:url(images/controls.png) -86px -11px no-repeat;margin:0 3px}.bx-wrapper .bx-controls-auto .bx-start.active,.bx-wrapper .bx-controls-auto .bx-start:focus,.bx-wrapper .bx-controls-auto .bx-start:hover{background-position:-86px 0}.bx-wrapper .bx-controls-auto .bx-stop{display:block;text-indent:-9999px;width:9px;height:11px;outline:0;background:url(images/controls.png) -86px -44px no-repeat;margin:0 3px}.bx-wrapper .bx-controls-auto .bx-stop.active,.bx-wrapper .bx-controls-auto .bx-stop:focus,.bx-wrapper .bx-controls-auto .bx-stop:hover{background-position:-86px -33px}.bx-wrapper .bx-controls.bx-has-controls-auto.bx-has-pager .bx-pager{text-align:left;width:80%}.bx-wrapper .bx-controls.bx-has-controls-auto.bx-has-pager .bx-controls-auto{right:0;width:35px}.bx-wrapper .bx-caption{position:absolute;bottom:0;left:0;background:#666;background:rgba(80,80,80,.75);width:100%}.bx-wrapper .bx-caption span{color:#fff;font-family:Arial;display:block;font-size:.85em;padding:10px}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/bxslider-4/dist/jquery.bxslider.min.js
DELETED
@@ -1,9 +0,0 @@
|
|
1 |
-
/**
|
2 |
-
* bxSlider v4.2.5
|
3 |
-
* Copyright 2013-2015 Steven Wanderski
|
4 |
-
* Written while drinking Belgian ales and listening to jazz
|
5 |
-
|
6 |
-
* Licensed under MIT (http://opensource.org/licenses/MIT)
|
7 |
-
*/
|
8 |
-
|
9 |
-
!function(a){var b={mode:"horizontal",slideSelector:"",infiniteLoop:!0,hideControlOnEnd:!1,speed:500,easing:null,slideMargin:0,startSlide:0,randomStart:!1,captions:!1,ticker:!1,tickerHover:!1,adaptiveHeight:!1,adaptiveHeightSpeed:500,video:!1,useCSS:!0,preloadImages:"visible",responsive:!0,slideZIndex:50,wrapperClass:"bx-wrapper",touchEnabled:!0,swipeThreshold:50,oneToOneTouch:!0,preventDefaultSwipeX:!0,preventDefaultSwipeY:!1,ariaLive:!0,ariaHidden:!0,keyboardEnabled:!1,pager:!0,pagerType:"full",pagerShortSeparator:" / ",pagerSelector:null,buildPager:null,pagerCustom:null,controls:!0,nextText:"Next",prevText:"Prev",nextSelector:null,prevSelector:null,autoControls:!1,startText:"Start",stopText:"Stop",autoControlsCombine:!1,autoControlsSelector:null,auto:!1,pause:4e3,autoStart:!0,autoDirection:"next",stopAutoOnClick:!1,autoHover:!1,autoDelay:0,autoSlideForOnePage:!1,minSlides:1,maxSlides:1,moveSlides:0,slideWidth:0,shrinkItems:!1,onSliderLoad:function(){return!0},onSlideBefore:function(){return!0},onSlideAfter:function(){return!0},onSlideNext:function(){return!0},onSlidePrev:function(){return!0},onSliderResize:function(){return!0}};a.fn.bxSlider=function(c){if(0===this.length)return this;if(this.length>1)return this.each(function(){a(this).bxSlider(c)}),this;var d={},e=this,f=a(window).width(),g=a(window).height();if(!a(e).data("bxSlider")){var h=function(){a(e).data("bxSlider")||(d.settings=a.extend({},b,c),d.settings.slideWidth=parseInt(d.settings.slideWidth),d.children=e.children(d.settings.slideSelector),d.children.length<d.settings.minSlides&&(d.settings.minSlides=d.children.length),d.children.length<d.settings.maxSlides&&(d.settings.maxSlides=d.children.length),d.settings.randomStart&&(d.settings.startSlide=Math.floor(Math.random()*d.children.length)),d.active={index:d.settings.startSlide},d.carousel=d.settings.minSlides>1||d.settings.maxSlides>1?!0:!1,d.carousel&&(d.settings.preloadImages="all"),d.minThreshold=d.settings.minSlides*d.settings.slideWidth+(d.settings.minSlides-1)*d.settings.slideMargin,d.maxThreshold=d.settings.maxSlides*d.settings.slideWidth+(d.settings.maxSlides-1)*d.settings.slideMargin,d.working=!1,d.controls={},d.interval=null,d.animProp="vertical"===d.settings.mode?"top":"left",d.usingCSS=d.settings.useCSS&&"fade"!==d.settings.mode&&function(){for(var a=document.createElement("div"),b=["WebkitPerspective","MozPerspective","OPerspective","msPerspective"],c=0;c<b.length;c++)if(void 0!==a.style[b[c]])return d.cssPrefix=b[c].replace("Perspective","").toLowerCase(),d.animProp="-"+d.cssPrefix+"-transform",!0;return!1}(),"vertical"===d.settings.mode&&(d.settings.maxSlides=d.settings.minSlides),e.data("origStyle",e.attr("style")),e.children(d.settings.slideSelector).each(function(){a(this).data("origStyle",a(this).attr("style"))}),j())},j=function(){var b=d.children.eq(d.settings.startSlide);e.wrap('<div class="'+d.settings.wrapperClass+'"><div class="bx-viewport"></div></div>'),d.viewport=e.parent(),d.settings.ariaLive&&!d.settings.ticker&&d.viewport.attr("aria-live","polite"),d.loader=a('<div class="bx-loading" />'),d.viewport.prepend(d.loader),e.css({width:"horizontal"===d.settings.mode?1e3*d.children.length+215+"%":"auto",position:"relative"}),d.usingCSS&&d.settings.easing?e.css("-"+d.cssPrefix+"-transition-timing-function",d.settings.easing):d.settings.easing||(d.settings.easing="swing"),d.viewport.css({width:"100%",overflow:"hidden",position:"relative"}),d.viewport.parent().css({maxWidth:n()}),d.settings.pager||d.settings.controls||d.viewport.parent().css({margin:"0 auto 0px"}),d.children.css({"float":"horizontal"===d.settings.mode?"left":"none",listStyle:"none",position:"relative"}),d.children.css("width",o()),"horizontal"===d.settings.mode&&d.settings.slideMargin>0&&d.children.css("marginRight",d.settings.slideMargin),"vertical"===d.settings.mode&&d.settings.slideMargin>0&&d.children.css("marginBottom",d.settings.slideMargin),"fade"===d.settings.mode&&(d.children.css({position:"absolute",zIndex:0,display:"none"}),d.children.eq(d.settings.startSlide).css({zIndex:d.settings.slideZIndex,display:"block"})),d.controls.el=a('<div class="bx-controls" />'),d.settings.captions&&y(),d.active.last=d.settings.startSlide===q()-1,d.settings.video&&e.fitVids(),("all"===d.settings.preloadImages||d.settings.ticker)&&(b=d.children),d.settings.ticker?d.settings.pager=!1:(d.settings.controls&&w(),d.settings.auto&&d.settings.autoControls&&x(),d.settings.pager&&v(),(d.settings.controls||d.settings.autoControls||d.settings.pager)&&d.viewport.after(d.controls.el)),k(b,l)},k=function(b,c){var d=b.find('img:not([src=""]), iframe').length,e=0;return 0===d?void c():void b.find('img:not([src=""]), iframe').each(function(){a(this).one("load error",function(){++e===d&&c()}).each(function(){this.complete&&a(this).load()})})},l=function(){if(d.settings.infiniteLoop&&"fade"!==d.settings.mode&&!d.settings.ticker){var b="vertical"===d.settings.mode?d.settings.minSlides:d.settings.maxSlides,c=d.children.slice(0,b).clone(!0).addClass("bx-clone"),f=d.children.slice(-b).clone(!0).addClass("bx-clone");d.settings.ariaHidden&&(c.attr("aria-hidden",!0),f.attr("aria-hidden",!0)),e.append(c).prepend(f)}d.loader.remove(),s(),"vertical"===d.settings.mode&&(d.settings.adaptiveHeight=!0),d.viewport.height(m()),e.redrawSlider(),d.settings.onSliderLoad.call(e,d.active.index),d.initialized=!0,d.settings.responsive&&a(window).bind("resize",S),d.settings.auto&&d.settings.autoStart&&(q()>1||d.settings.autoSlideForOnePage)&&I(),d.settings.ticker&&J(),d.settings.pager&&E(d.settings.startSlide),d.settings.controls&&H(),d.settings.touchEnabled&&!d.settings.ticker&&N(),d.settings.keyboardEnabled&&!d.settings.ticker&&a(document).keydown(M)},m=function(){var b=0,c=a();if("vertical"===d.settings.mode||d.settings.adaptiveHeight)if(d.carousel){var e=1===d.settings.moveSlides?d.active.index:d.active.index*r();for(c=d.children.eq(e),i=1;i<=d.settings.maxSlides-1;i++)c=e+i>=d.children.length?c.add(d.children.eq(i-1)):c.add(d.children.eq(e+i))}else c=d.children.eq(d.active.index);else c=d.children;return"vertical"===d.settings.mode?(c.each(function(c){b+=a(this).outerHeight()}),d.settings.slideMargin>0&&(b+=d.settings.slideMargin*(d.settings.minSlides-1))):b=Math.max.apply(Math,c.map(function(){return a(this).outerHeight(!1)}).get()),"border-box"===d.viewport.css("box-sizing")?b+=parseFloat(d.viewport.css("padding-top"))+parseFloat(d.viewport.css("padding-bottom"))+parseFloat(d.viewport.css("border-top-width"))+parseFloat(d.viewport.css("border-bottom-width")):"padding-box"===d.viewport.css("box-sizing")&&(b+=parseFloat(d.viewport.css("padding-top"))+parseFloat(d.viewport.css("padding-bottom"))),b},n=function(){var a="100%";return d.settings.slideWidth>0&&(a="horizontal"===d.settings.mode?d.settings.maxSlides*d.settings.slideWidth+(d.settings.maxSlides-1)*d.settings.slideMargin:d.settings.slideWidth),a},o=function(){var a=d.settings.slideWidth,b=d.viewport.width();if(0===d.settings.slideWidth||d.settings.slideWidth>b&&!d.carousel||"vertical"===d.settings.mode)a=b;else if(d.settings.maxSlides>1&&"horizontal"===d.settings.mode){if(b>d.maxThreshold)return a;b<d.minThreshold?a=(b-d.settings.slideMargin*(d.settings.minSlides-1))/d.settings.minSlides:d.settings.shrinkItems&&(a=Math.floor((b+d.settings.slideMargin)/Math.ceil((b+d.settings.slideMargin)/(a+d.settings.slideMargin))-d.settings.slideMargin))}return a},p=function(){var a=1,b=null;return"horizontal"===d.settings.mode&&d.settings.slideWidth>0?d.viewport.width()<d.minThreshold?a=d.settings.minSlides:d.viewport.width()>d.maxThreshold?a=d.settings.maxSlides:(b=d.children.first().width()+d.settings.slideMargin,a=Math.floor((d.viewport.width()+d.settings.slideMargin)/b)):"vertical"===d.settings.mode&&(a=d.settings.minSlides),a},q=function(){var a=0,b=0,c=0;if(d.settings.moveSlides>0)if(d.settings.infiniteLoop)a=Math.ceil(d.children.length/r());else for(;b<d.children.length;)++a,b=c+p(),c+=d.settings.moveSlides<=p()?d.settings.moveSlides:p();else a=Math.ceil(d.children.length/p());return a},r=function(){return d.settings.moveSlides>0&&d.settings.moveSlides<=p()?d.settings.moveSlides:p()},s=function(){var a,b,c;d.children.length>d.settings.maxSlides&&d.active.last&&!d.settings.infiniteLoop?"horizontal"===d.settings.mode?(b=d.children.last(),a=b.position(),t(-(a.left-(d.viewport.width()-b.outerWidth())),"reset",0)):"vertical"===d.settings.mode&&(c=d.children.length-d.settings.minSlides,a=d.children.eq(c).position(),t(-a.top,"reset",0)):(a=d.children.eq(d.active.index*r()).position(),d.active.index===q()-1&&(d.active.last=!0),void 0!==a&&("horizontal"===d.settings.mode?t(-a.left,"reset",0):"vertical"===d.settings.mode&&t(-a.top,"reset",0)))},t=function(b,c,f,g){var h,i;d.usingCSS?(i="vertical"===d.settings.mode?"translate3d(0, "+b+"px, 0)":"translate3d("+b+"px, 0, 0)",e.css("-"+d.cssPrefix+"-transition-duration",f/1e3+"s"),"slide"===c?(e.css(d.animProp,i),0!==f?e.bind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd",function(b){a(b.target).is(e)&&(e.unbind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd"),F())}):F()):"reset"===c?e.css(d.animProp,i):"ticker"===c&&(e.css("-"+d.cssPrefix+"-transition-timing-function","linear"),e.css(d.animProp,i),0!==f?e.bind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd",function(b){a(b.target).is(e)&&(e.unbind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd"),t(g.resetValue,"reset",0),K())}):(t(g.resetValue,"reset",0),K()))):(h={},h[d.animProp]=b,"slide"===c?e.animate(h,f,d.settings.easing,function(){F()}):"reset"===c?e.css(d.animProp,b):"ticker"===c&&e.animate(h,f,"linear",function(){t(g.resetValue,"reset",0),K()}))},u=function(){for(var b="",c="",e=q(),f=0;e>f;f++)c="",d.settings.buildPager&&a.isFunction(d.settings.buildPager)||d.settings.pagerCustom?(c=d.settings.buildPager(f),d.pagerEl.addClass("bx-custom-pager")):(c=f+1,d.pagerEl.addClass("bx-default-pager")),b+='<div class="bx-pager-item"><a href="" data-slide-index="'+f+'" class="bx-pager-link">'+c+"</a></div>";d.pagerEl.html(b)},v=function(){d.settings.pagerCustom?d.pagerEl=a(d.settings.pagerCustom):(d.pagerEl=a('<div class="bx-pager" />'),d.settings.pagerSelector?a(d.settings.pagerSelector).html(d.pagerEl):d.controls.el.addClass("bx-has-pager").append(d.pagerEl),u()),d.pagerEl.on("click touchend","a",D)},w=function(){d.controls.next=a('<a class="bx-next" href="">'+d.settings.nextText+"</a>"),d.controls.prev=a('<a class="bx-prev" href="">'+d.settings.prevText+"</a>"),d.controls.next.bind("click touchend",z),d.controls.prev.bind("click touchend",A),d.settings.nextSelector&&a(d.settings.nextSelector).append(d.controls.next),d.settings.prevSelector&&a(d.settings.prevSelector).append(d.controls.prev),d.settings.nextSelector||d.settings.prevSelector||(d.controls.directionEl=a('<div class="bx-controls-direction" />'),d.controls.directionEl.append(d.controls.prev).append(d.controls.next),d.controls.el.addClass("bx-has-controls-direction").append(d.controls.directionEl))},x=function(){d.controls.start=a('<div class="bx-controls-auto-item"><a class="bx-start" href="">'+d.settings.startText+"</a></div>"),d.controls.stop=a('<div class="bx-controls-auto-item"><a class="bx-stop" href="">'+d.settings.stopText+"</a></div>"),d.controls.autoEl=a('<div class="bx-controls-auto" />'),d.controls.autoEl.on("click",".bx-start",B),d.controls.autoEl.on("click",".bx-stop",C),d.settings.autoControlsCombine?d.controls.autoEl.append(d.controls.start):d.controls.autoEl.append(d.controls.start).append(d.controls.stop),d.settings.autoControlsSelector?a(d.settings.autoControlsSelector).html(d.controls.autoEl):d.controls.el.addClass("bx-has-controls-auto").append(d.controls.autoEl),G(d.settings.autoStart?"stop":"start")},y=function(){d.children.each(function(b){var c=a(this).find("img:first").attr("title");void 0!==c&&(""+c).length&&a(this).append('<div class="bx-caption"><span>'+c+"</span></div>")})},z=function(a){a.preventDefault(),d.controls.el.hasClass("disabled")||(d.settings.auto&&d.settings.stopAutoOnClick&&e.stopAuto(),e.goToNextSlide())},A=function(a){a.preventDefault(),d.controls.el.hasClass("disabled")||(d.settings.auto&&d.settings.stopAutoOnClick&&e.stopAuto(),e.goToPrevSlide())},B=function(a){e.startAuto(),a.preventDefault()},C=function(a){e.stopAuto(),a.preventDefault()},D=function(b){var c,f;b.preventDefault(),d.controls.el.hasClass("disabled")||(d.settings.auto&&d.settings.stopAutoOnClick&&e.stopAuto(),c=a(b.currentTarget),void 0!==c.attr("data-slide-index")&&(f=parseInt(c.attr("data-slide-index")),f!==d.active.index&&e.goToSlide(f)))},E=function(b){var c=d.children.length;return"short"===d.settings.pagerType?(d.settings.maxSlides>1&&(c=Math.ceil(d.children.length/d.settings.maxSlides)),void d.pagerEl.html(b+1+d.settings.pagerShortSeparator+c)):(d.pagerEl.find("a").removeClass("active"),void d.pagerEl.each(function(c,d){a(d).find("a").eq(b).addClass("active")}))},F=function(){if(d.settings.infiniteLoop){var a="";0===d.active.index?a=d.children.eq(0).position():d.active.index===q()-1&&d.carousel?a=d.children.eq((q()-1)*r()).position():d.active.index===d.children.length-1&&(a=d.children.eq(d.children.length-1).position()),a&&("horizontal"===d.settings.mode?t(-a.left,"reset",0):"vertical"===d.settings.mode&&t(-a.top,"reset",0))}d.working=!1,d.settings.onSlideAfter.call(e,d.children.eq(d.active.index),d.oldIndex,d.active.index)},G=function(a){d.settings.autoControlsCombine?d.controls.autoEl.html(d.controls[a]):(d.controls.autoEl.find("a").removeClass("active"),d.controls.autoEl.find("a:not(.bx-"+a+")").addClass("active"))},H=function(){1===q()?(d.controls.prev.addClass("disabled"),d.controls.next.addClass("disabled")):!d.settings.infiniteLoop&&d.settings.hideControlOnEnd&&(0===d.active.index?(d.controls.prev.addClass("disabled"),d.controls.next.removeClass("disabled")):d.active.index===q()-1?(d.controls.next.addClass("disabled"),d.controls.prev.removeClass("disabled")):(d.controls.prev.removeClass("disabled"),d.controls.next.removeClass("disabled")))},I=function(){if(d.settings.autoDelay>0){setTimeout(e.startAuto,d.settings.autoDelay)}else e.startAuto(),a(window).focus(function(){e.startAuto()}).blur(function(){e.stopAuto()});d.settings.autoHover&&e.hover(function(){d.interval&&(e.stopAuto(!0),d.autoPaused=!0)},function(){d.autoPaused&&(e.startAuto(!0),d.autoPaused=null)})},J=function(){var b,c,f,g,h,i,j,k,l=0;"next"===d.settings.autoDirection?e.append(d.children.clone().addClass("bx-clone")):(e.prepend(d.children.clone().addClass("bx-clone")),b=d.children.first().position(),l="horizontal"===d.settings.mode?-b.left:-b.top),t(l,"reset",0),d.settings.pager=!1,d.settings.controls=!1,d.settings.autoControls=!1,d.settings.tickerHover&&(d.usingCSS?(g="horizontal"===d.settings.mode?4:5,d.viewport.hover(function(){c=e.css("-"+d.cssPrefix+"-transform"),f=parseFloat(c.split(",")[g]),t(f,"reset",0)},function(){k=0,d.children.each(function(b){k+="horizontal"===d.settings.mode?a(this).outerWidth(!0):a(this).outerHeight(!0)}),h=d.settings.speed/k,i="horizontal"===d.settings.mode?"left":"top",j=h*(k-Math.abs(parseInt(f))),K(j)})):d.viewport.hover(function(){e.stop()},function(){k=0,d.children.each(function(b){k+="horizontal"===d.settings.mode?a(this).outerWidth(!0):a(this).outerHeight(!0)}),h=d.settings.speed/k,i="horizontal"===d.settings.mode?"left":"top",j=h*(k-Math.abs(parseInt(e.css(i)))),K(j)})),K()},K=function(a){var b,c,f,g=a?a:d.settings.speed,h={left:0,top:0},i={left:0,top:0};"next"===d.settings.autoDirection?h=e.find(".bx-clone").first().position():i=d.children.first().position(),b="horizontal"===d.settings.mode?-h.left:-h.top,c="horizontal"===d.settings.mode?-i.left:-i.top,f={resetValue:c},t(b,"ticker",g,f)},L=function(b){var c=a(window),d={top:c.scrollTop(),left:c.scrollLeft()},e=b.offset();return d.right=d.left+c.width(),d.bottom=d.top+c.height(),e.right=e.left+b.outerWidth(),e.bottom=e.top+b.outerHeight(),!(d.right<e.left||d.left>e.right||d.bottom<e.top||d.top>e.bottom)},M=function(a){var b=document.activeElement.tagName.toLowerCase(),c="input|textarea",d=new RegExp(b,["i"]),f=d.exec(c);if(null==f&&L(e)){if(39===a.keyCode)return z(a),!1;if(37===a.keyCode)return A(a),!1}},N=function(){d.touch={start:{x:0,y:0},end:{x:0,y:0}},d.viewport.bind("touchstart MSPointerDown pointerdown",O),d.viewport.on("click",".bxslider a",function(a){d.viewport.hasClass("click-disabled")&&(a.preventDefault(),d.viewport.removeClass("click-disabled"))})},O=function(a){if(d.controls.el.addClass("disabled"),d.working)a.preventDefault(),d.controls.el.removeClass("disabled");else{d.touch.originalPos=e.position();var b=a.originalEvent,c="undefined"!=typeof b.changedTouches?b.changedTouches:[b];d.touch.start.x=c[0].pageX,d.touch.start.y=c[0].pageY,d.viewport.get(0).setPointerCapture&&(d.pointerId=b.pointerId,d.viewport.get(0).setPointerCapture(d.pointerId)),d.viewport.bind("touchmove MSPointerMove pointermove",Q),d.viewport.bind("touchend MSPointerUp pointerup",R),d.viewport.bind("MSPointerCancel pointercancel",P)}},P=function(a){t(d.touch.originalPos.left,"reset",0),d.controls.el.removeClass("disabled"),d.viewport.unbind("MSPointerCancel pointercancel",P),d.viewport.unbind("touchmove MSPointerMove pointermove",Q),d.viewport.unbind("touchend MSPointerUp pointerup",R),d.viewport.get(0).releasePointerCapture&&d.viewport.get(0).releasePointerCapture(d.pointerId)},Q=function(a){var b=a.originalEvent,c="undefined"!=typeof b.changedTouches?b.changedTouches:[b],e=Math.abs(c[0].pageX-d.touch.start.x),f=Math.abs(c[0].pageY-d.touch.start.y),g=0,h=0;3*e>f&&d.settings.preventDefaultSwipeX?a.preventDefault():3*f>e&&d.settings.preventDefaultSwipeY&&a.preventDefault(),"fade"!==d.settings.mode&&d.settings.oneToOneTouch&&("horizontal"===d.settings.mode?(h=c[0].pageX-d.touch.start.x,g=d.touch.originalPos.left+h):(h=c[0].pageY-d.touch.start.y,g=d.touch.originalPos.top+h),t(g,"reset",0))},R=function(a){d.viewport.unbind("touchmove MSPointerMove pointermove",Q),d.controls.el.removeClass("disabled");var b=a.originalEvent,c="undefined"!=typeof b.changedTouches?b.changedTouches:[b],f=0,g=0;d.touch.end.x=c[0].pageX,d.touch.end.y=c[0].pageY,"fade"===d.settings.mode?(g=Math.abs(d.touch.start.x-d.touch.end.x),g>=d.settings.swipeThreshold&&(d.touch.start.x>d.touch.end.x?e.goToNextSlide():e.goToPrevSlide(),e.stopAuto())):("horizontal"===d.settings.mode?(g=d.touch.end.x-d.touch.start.x,f=d.touch.originalPos.left):(g=d.touch.end.y-d.touch.start.y,f=d.touch.originalPos.top),!d.settings.infiniteLoop&&(0===d.active.index&&g>0||d.active.last&&0>g)?t(f,"reset",200):Math.abs(g)>=d.settings.swipeThreshold?(0>g?e.goToNextSlide():e.goToPrevSlide(),e.stopAuto()):t(f,"reset",200)),d.viewport.unbind("touchend MSPointerUp pointerup",R),d.viewport.get(0).releasePointerCapture&&d.viewport.get(0).releasePointerCapture(d.pointerId)},S=function(b){if(d.initialized)if(d.working)window.setTimeout(S,10);else{var c=a(window).width(),h=a(window).height();(f!==c||g!==h)&&(f=c,g=h,e.redrawSlider(),d.settings.onSliderResize.call(e,d.active.index))}},T=function(a){var b=p();d.settings.ariaHidden&&!d.settings.ticker&&(d.children.attr("aria-hidden","true"),d.children.slice(a,a+b).attr("aria-hidden","false"))},U=function(a){return 0>a?d.settings.infiniteLoop?q()-1:d.active.index:a>=q()?d.settings.infiniteLoop?0:d.active.index:a};return e.goToSlide=function(b,c){var f,g,h,i,j=!0,k=0,l={left:0,top:0},n=null;if(d.oldIndex=d.active.index,d.active.index=U(b),!d.working&&d.active.index!==d.oldIndex){if(d.working=!0,j=d.settings.onSlideBefore.call(e,d.children.eq(d.active.index),d.oldIndex,d.active.index),"undefined"!=typeof j&&!j)return d.active.index=d.oldIndex,void(d.working=!1);"next"===c?d.settings.onSlideNext.call(e,d.children.eq(d.active.index),d.oldIndex,d.active.index)||(j=!1):"prev"===c&&(d.settings.onSlidePrev.call(e,d.children.eq(d.active.index),d.oldIndex,d.active.index)||(j=!1)),d.active.last=d.active.index>=q()-1,(d.settings.pager||d.settings.pagerCustom)&&E(d.active.index),d.settings.controls&&H(),"fade"===d.settings.mode?(d.settings.adaptiveHeight&&d.viewport.height()!==m()&&d.viewport.animate({height:m()},d.settings.adaptiveHeightSpeed),d.children.filter(":visible").fadeOut(d.settings.speed).css({zIndex:0}),d.children.eq(d.active.index).css("zIndex",d.settings.slideZIndex+1).fadeIn(d.settings.speed,function(){a(this).css("zIndex",d.settings.slideZIndex),F()})):(d.settings.adaptiveHeight&&d.viewport.height()!==m()&&d.viewport.animate({height:m()},d.settings.adaptiveHeightSpeed),!d.settings.infiniteLoop&&d.carousel&&d.active.last?"horizontal"===d.settings.mode?(n=d.children.eq(d.children.length-1),l=n.position(),k=d.viewport.width()-n.outerWidth()):(f=d.children.length-d.settings.minSlides,l=d.children.eq(f).position()):d.carousel&&d.active.last&&"prev"===c?(g=1===d.settings.moveSlides?d.settings.maxSlides-r():(q()-1)*r()-(d.children.length-d.settings.maxSlides),n=e.children(".bx-clone").eq(g),l=n.position()):"next"===c&&0===d.active.index?(l=e.find("> .bx-clone").eq(d.settings.maxSlides).position(),d.active.last=!1):b>=0&&(i=b*parseInt(r()),l=d.children.eq(i).position()),"undefined"!=typeof l?(h="horizontal"===d.settings.mode?-(l.left-k):-l.top,t(h,"slide",d.settings.speed)):d.working=!1),d.settings.ariaHidden&&T(d.active.index*r())}},e.goToNextSlide=function(){if(d.settings.infiniteLoop||!d.active.last){var a=parseInt(d.active.index)+1;e.goToSlide(a,"next")}},e.goToPrevSlide=function(){if(d.settings.infiniteLoop||0!==d.active.index){var a=parseInt(d.active.index)-1;e.goToSlide(a,"prev")}},e.startAuto=function(a){d.interval||(d.interval=setInterval(function(){"next"===d.settings.autoDirection?e.goToNextSlide():e.goToPrevSlide()},d.settings.pause),d.settings.autoControls&&a!==!0&&G("stop"))},e.stopAuto=function(a){d.interval&&(clearInterval(d.interval),d.interval=null,d.settings.autoControls&&a!==!0&&G("start"))},e.getCurrentSlide=function(){return d.active.index},e.getCurrentSlideElement=function(){return d.children.eq(d.active.index)},e.getSlideElement=function(a){return d.children.eq(a)},e.getSlideCount=function(){return d.children.length},e.isWorking=function(){return d.working},e.redrawSlider=function(){d.children.add(e.find(".bx-clone")).outerWidth(o()),d.viewport.css("height",m()),d.settings.ticker||s(),d.active.last&&(d.active.index=q()-1),d.active.index>=q()&&(d.active.last=!0),d.settings.pager&&!d.settings.pagerCustom&&(u(),E(d.active.index)),d.settings.ariaHidden&&T(d.active.index*r())},e.destroySlider=function(){d.initialized&&(d.initialized=!1,a(".bx-clone",this).remove(),d.children.each(function(){void 0!==a(this).data("origStyle")?a(this).attr("style",a(this).data("origStyle")):a(this).removeAttr("style")}),void 0!==a(this).data("origStyle")?this.attr("style",a(this).data("origStyle")):a(this).removeAttr("style"),a(this).unwrap().unwrap(),d.controls.el&&d.controls.el.remove(),d.controls.next&&d.controls.next.remove(),d.controls.prev&&d.controls.prev.remove(),d.pagerEl&&d.settings.controls&&!d.settings.pagerCustom&&d.pagerEl.remove(),a(".bx-caption",this).remove(),d.controls.autoEl&&d.controls.autoEl.remove(),clearInterval(d.interval),d.settings.responsive&&a(window).unbind("resize",S),d.settings.keyboardEnabled&&a(document).unbind("keydown",M),a(this).removeData("bxSlider"))},e.reloadSlider=function(b){void 0!==b&&(c=b),e.destroySlider(),h(),a(e).data("bxSlider",this)},h(),a(e).data("bxSlider",this),this}}}(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/bxslider-4/dist/vendor/jquery.easing.1.3.js
DELETED
@@ -1,205 +0,0 @@
|
|
1 |
-
/*
|
2 |
-
* jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
|
3 |
-
*
|
4 |
-
* Uses the built in easing capabilities added In jQuery 1.1
|
5 |
-
* to offer multiple easing options
|
6 |
-
*
|
7 |
-
* TERMS OF USE - jQuery Easing
|
8 |
-
*
|
9 |
-
* Open source under the BSD License.
|
10 |
-
*
|
11 |
-
* Copyright © 2008 George McGinley Smith
|
12 |
-
* All rights reserved.
|
13 |
-
*
|
14 |
-
* Redistribution and use in source and binary forms, with or without modification,
|
15 |
-
* are permitted provided that the following conditions are met:
|
16 |
-
*
|
17 |
-
* Redistributions of source code must retain the above copyright notice, this list of
|
18 |
-
* conditions and the following disclaimer.
|
19 |
-
* Redistributions in binary form must reproduce the above copyright notice, this list
|
20 |
-
* of conditions and the following disclaimer in the documentation and/or other materials
|
21 |
-
* provided with the distribution.
|
22 |
-
*
|
23 |
-
* Neither the name of the author nor the names of contributors may be used to endorse
|
24 |
-
* or promote products derived from this software without specific prior written permission.
|
25 |
-
*
|
26 |
-
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
27 |
-
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
28 |
-
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
29 |
-
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
30 |
-
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
31 |
-
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
32 |
-
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
33 |
-
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
34 |
-
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
35 |
-
*
|
36 |
-
*/
|
37 |
-
|
38 |
-
// t: current time, b: begInnIng value, c: change In value, d: duration
|
39 |
-
jQuery.easing['jswing'] = jQuery.easing['swing'];
|
40 |
-
|
41 |
-
jQuery.extend( jQuery.easing,
|
42 |
-
{
|
43 |
-
def: 'easeOutQuad',
|
44 |
-
swing: function (x, t, b, c, d) {
|
45 |
-
//alert(jQuery.easing.default);
|
46 |
-
return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
|
47 |
-
},
|
48 |
-
easeInQuad: function (x, t, b, c, d) {
|
49 |
-
return c*(t/=d)*t + b;
|
50 |
-
},
|
51 |
-
easeOutQuad: function (x, t, b, c, d) {
|
52 |
-
return -c *(t/=d)*(t-2) + b;
|
53 |
-
},
|
54 |
-
easeInOutQuad: function (x, t, b, c, d) {
|
55 |
-
if ((t/=d/2) < 1) return c/2*t*t + b;
|
56 |
-
return -c/2 * ((--t)*(t-2) - 1) + b;
|
57 |
-
},
|
58 |
-
easeInCubic: function (x, t, b, c, d) {
|
59 |
-
return c*(t/=d)*t*t + b;
|
60 |
-
},
|
61 |
-
easeOutCubic: function (x, t, b, c, d) {
|
62 |
-
return c*((t=t/d-1)*t*t + 1) + b;
|
63 |
-
},
|
64 |
-
easeInOutCubic: function (x, t, b, c, d) {
|
65 |
-
if ((t/=d/2) < 1) return c/2*t*t*t + b;
|
66 |
-
return c/2*((t-=2)*t*t + 2) + b;
|
67 |
-
},
|
68 |
-
easeInQuart: function (x, t, b, c, d) {
|
69 |
-
return c*(t/=d)*t*t*t + b;
|
70 |
-
},
|
71 |
-
easeOutQuart: function (x, t, b, c, d) {
|
72 |
-
return -c * ((t=t/d-1)*t*t*t - 1) + b;
|
73 |
-
},
|
74 |
-
easeInOutQuart: function (x, t, b, c, d) {
|
75 |
-
if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
|
76 |
-
return -c/2 * ((t-=2)*t*t*t - 2) + b;
|
77 |
-
},
|
78 |
-
easeInQuint: function (x, t, b, c, d) {
|
79 |
-
return c*(t/=d)*t*t*t*t + b;
|
80 |
-
},
|
81 |
-
easeOutQuint: function (x, t, b, c, d) {
|
82 |
-
return c*((t=t/d-1)*t*t*t*t + 1) + b;
|
83 |
-
},
|
84 |
-
easeInOutQuint: function (x, t, b, c, d) {
|
85 |
-
if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
|
86 |
-
return c/2*((t-=2)*t*t*t*t + 2) + b;
|
87 |
-
},
|
88 |
-
easeInSine: function (x, t, b, c, d) {
|
89 |
-
return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
|
90 |
-
},
|
91 |
-
easeOutSine: function (x, t, b, c, d) {
|
92 |
-
return c * Math.sin(t/d * (Math.PI/2)) + b;
|
93 |
-
},
|
94 |
-
easeInOutSine: function (x, t, b, c, d) {
|
95 |
-
return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
|
96 |
-
},
|
97 |
-
easeInExpo: function (x, t, b, c, d) {
|
98 |
-
return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
|
99 |
-
},
|
100 |
-
easeOutExpo: function (x, t, b, c, d) {
|
101 |
-
return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
|
102 |
-
},
|
103 |
-
easeInOutExpo: function (x, t, b, c, d) {
|
104 |
-
if (t==0) return b;
|
105 |
-
if (t==d) return b+c;
|
106 |
-
if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
|
107 |
-
return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
|
108 |
-
},
|
109 |
-
easeInCirc: function (x, t, b, c, d) {
|
110 |
-
return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
|
111 |
-
},
|
112 |
-
easeOutCirc: function (x, t, b, c, d) {
|
113 |
-
return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
|
114 |
-
},
|
115 |
-
easeInOutCirc: function (x, t, b, c, d) {
|
116 |
-
if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
|
117 |
-
return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
|
118 |
-
},
|
119 |
-
easeInElastic: function (x, t, b, c, d) {
|
120 |
-
var s=1.70158;var p=0;var a=c;
|
121 |
-
if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
|
122 |
-
if (a < Math.abs(c)) { a=c; var s=p/4; }
|
123 |
-
else var s = p/(2*Math.PI) * Math.asin (c/a);
|
124 |
-
return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
|
125 |
-
},
|
126 |
-
easeOutElastic: function (x, t, b, c, d) {
|
127 |
-
var s=1.70158;var p=0;var a=c;
|
128 |
-
if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
|
129 |
-
if (a < Math.abs(c)) { a=c; var s=p/4; }
|
130 |
-
else var s = p/(2*Math.PI) * Math.asin (c/a);
|
131 |
-
return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
|
132 |
-
},
|
133 |
-
easeInOutElastic: function (x, t, b, c, d) {
|
134 |
-
var s=1.70158;var p=0;var a=c;
|
135 |
-
if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5);
|
136 |
-
if (a < Math.abs(c)) { a=c; var s=p/4; }
|
137 |
-
else var s = p/(2*Math.PI) * Math.asin (c/a);
|
138 |
-
if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
|
139 |
-
return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
|
140 |
-
},
|
141 |
-
easeInBack: function (x, t, b, c, d, s) {
|
142 |
-
if (s == undefined) s = 1.70158;
|
143 |
-
return c*(t/=d)*t*((s+1)*t - s) + b;
|
144 |
-
},
|
145 |
-
easeOutBack: function (x, t, b, c, d, s) {
|
146 |
-
if (s == undefined) s = 1.70158;
|
147 |
-
return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
|
148 |
-
},
|
149 |
-
easeInOutBack: function (x, t, b, c, d, s) {
|
150 |
-
if (s == undefined) s = 1.70158;
|
151 |
-
if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
|
152 |
-
return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
|
153 |
-
},
|
154 |
-
easeInBounce: function (x, t, b, c, d) {
|
155 |
-
return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
|
156 |
-
},
|
157 |
-
easeOutBounce: function (x, t, b, c, d) {
|
158 |
-
if ((t/=d) < (1/2.75)) {
|
159 |
-
return c*(7.5625*t*t) + b;
|
160 |
-
} else if (t < (2/2.75)) {
|
161 |
-
return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
|
162 |
-
} else if (t < (2.5/2.75)) {
|
163 |
-
return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
|
164 |
-
} else {
|
165 |
-
return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
|
166 |
-
}
|
167 |
-
},
|
168 |
-
easeInOutBounce: function (x, t, b, c, d) {
|
169 |
-
if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
|
170 |
-
return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
|
171 |
-
}
|
172 |
-
});
|
173 |
-
|
174 |
-
/*
|
175 |
-
*
|
176 |
-
* TERMS OF USE - EASING EQUATIONS
|
177 |
-
*
|
178 |
-
* Open source under the BSD License.
|
179 |
-
*
|
180 |
-
* Copyright © 2001 Robert Penner
|
181 |
-
* All rights reserved.
|
182 |
-
*
|
183 |
-
* Redistribution and use in source and binary forms, with or without modification,
|
184 |
-
* are permitted provided that the following conditions are met:
|
185 |
-
*
|
186 |
-
* Redistributions of source code must retain the above copyright notice, this list of
|
187 |
-
* conditions and the following disclaimer.
|
188 |
-
* Redistributions in binary form must reproduce the above copyright notice, this list
|
189 |
-
* of conditions and the following disclaimer in the documentation and/or other materials
|
190 |
-
* provided with the distribution.
|
191 |
-
*
|
192 |
-
* Neither the name of the author nor the names of contributors may be used to endorse
|
193 |
-
* or promote products derived from this software without specific prior written permission.
|
194 |
-
*
|
195 |
-
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
196 |
-
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
197 |
-
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
198 |
-
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
199 |
-
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
200 |
-
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
201 |
-
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
202 |
-
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
203 |
-
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
204 |
-
*
|
205 |
-
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/bxslider-4/dist/vendor/jquery.fitvids.js
DELETED
@@ -1,80 +0,0 @@
|
|
1 |
-
/*global jQuery */
|
2 |
-
/*jshint multistr:true browser:true */
|
3 |
-
/*!
|
4 |
-
* FitVids 1.0
|
5 |
-
*
|
6 |
-
* Copyright 2011, Chris Coyier - http://css-tricks.com + Dave Rupert - http://daverupert.com
|
7 |
-
* Credit to Thierry Koblentz - http://www.alistapart.com/articles/creating-intrinsic-ratios-for-video/
|
8 |
-
* Released under the WTFPL license - http://sam.zoy.org/wtfpl/
|
9 |
-
*
|
10 |
-
* Date: Thu Sept 01 18:00:00 2011 -0500
|
11 |
-
*/
|
12 |
-
|
13 |
-
(function( $ ){
|
14 |
-
|
15 |
-
"use strict";
|
16 |
-
|
17 |
-
$.fn.fitVids = function( options ) {
|
18 |
-
var settings = {
|
19 |
-
customSelector: null
|
20 |
-
};
|
21 |
-
|
22 |
-
var div = document.createElement('div'),
|
23 |
-
ref = document.getElementsByTagName('base')[0] || document.getElementsByTagName('script')[0];
|
24 |
-
|
25 |
-
div.className = 'fit-vids-style';
|
26 |
-
div.innerHTML = '­<style> \
|
27 |
-
.fluid-width-video-wrapper { \
|
28 |
-
width: 100%; \
|
29 |
-
position: relative; \
|
30 |
-
padding: 0; \
|
31 |
-
} \
|
32 |
-
\
|
33 |
-
.fluid-width-video-wrapper iframe, \
|
34 |
-
.fluid-width-video-wrapper object, \
|
35 |
-
.fluid-width-video-wrapper embed { \
|
36 |
-
position: absolute; \
|
37 |
-
top: 0; \
|
38 |
-
left: 0; \
|
39 |
-
width: 100%; \
|
40 |
-
height: 100%; \
|
41 |
-
} \
|
42 |
-
</style>';
|
43 |
-
|
44 |
-
ref.parentNode.insertBefore(div,ref);
|
45 |
-
|
46 |
-
if ( options ) {
|
47 |
-
$.extend( settings, options );
|
48 |
-
}
|
49 |
-
|
50 |
-
return this.each(function(){
|
51 |
-
var selectors = [
|
52 |
-
"iframe[src*='player.vimeo.com']",
|
53 |
-
"iframe[src*='www.youtube.com']",
|
54 |
-
"iframe[src*='www.kickstarter.com']",
|
55 |
-
"object",
|
56 |
-
"embed"
|
57 |
-
];
|
58 |
-
|
59 |
-
if (settings.customSelector) {
|
60 |
-
selectors.push(settings.customSelector);
|
61 |
-
}
|
62 |
-
|
63 |
-
var $allVideos = $(this).find(selectors.join(','));
|
64 |
-
|
65 |
-
$allVideos.each(function(){
|
66 |
-
var $this = $(this);
|
67 |
-
if (this.tagName.toLowerCase() === 'embed' && $this.parent('object').length || $this.parent('.fluid-width-video-wrapper').length) { return; }
|
68 |
-
var height = ( this.tagName.toLowerCase() === 'object' || ($this.attr('height') && !isNaN(parseInt($this.attr('height'), 10))) ) ? parseInt($this.attr('height'), 10) : $this.height(),
|
69 |
-
width = !isNaN(parseInt($this.attr('width'), 10)) ? parseInt($this.attr('width'), 10) : $this.width(),
|
70 |
-
aspectRatio = height / width;
|
71 |
-
if(!$this.attr('id')){
|
72 |
-
var videoID = 'fitvid' + Math.floor(Math.random()*999999);
|
73 |
-
$this.attr('id', videoID);
|
74 |
-
}
|
75 |
-
$this.wrap('<div class="fluid-width-video-wrapper"></div>').parent('.fluid-width-video-wrapper').css('padding-top', (aspectRatio * 100)+"%");
|
76 |
-
$this.removeAttr('height').removeAttr('width');
|
77 |
-
});
|
78 |
-
});
|
79 |
-
};
|
80 |
-
})( jQuery );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/bxslider-4/docs_src/assets/img/bx-logo.png
DELETED
Binary file
|
includes/libraries/bxslider-4/docs_src/assets/img/photo1-cropped.jpeg
DELETED
Binary file
|
includes/libraries/bxslider-4/docs_src/assets/img/photo1.jpeg
DELETED
Binary file
|
includes/libraries/bxslider-4/docs_src/assets/img/photo2-cropped.jpeg
DELETED
Binary file
|
includes/libraries/bxslider-4/docs_src/assets/img/photo2.jpeg
DELETED
Binary file
|
includes/libraries/bxslider-4/docs_src/assets/img/photo3-cropped.jpeg
DELETED
Binary file
|
includes/libraries/bxslider-4/docs_src/assets/img/photo3.jpeg
DELETED
Binary file
|
includes/libraries/bxslider-4/docs_src/assets/img/photo4.jpeg
DELETED
Binary file
|
includes/libraries/bxslider-4/docs_src/assets/img/photo5.jpeg
DELETED
Binary file
|
includes/libraries/bxslider-4/docs_src/assets/img/photo6.jpeg
DELETED
Binary file
|
includes/libraries/bxslider-4/docs_src/assets/js/app.js
DELETED
@@ -1,234 +0,0 @@
|
|
1 |
-
(function($) {
|
2 |
-
|
3 |
-
var Docs = {
|
4 |
-
// All pages
|
5 |
-
common: {
|
6 |
-
init: function() {
|
7 |
-
}
|
8 |
-
},
|
9 |
-
// Home page
|
10 |
-
home: {
|
11 |
-
init: function() {
|
12 |
-
// JavaScript to be fired on the Home page
|
13 |
-
var slider = $('#demoSlider').bxSlider();
|
14 |
-
}
|
15 |
-
},
|
16 |
-
// Docs page
|
17 |
-
docs: {
|
18 |
-
init: function() {
|
19 |
-
// JavaScript to be fired on the Docs page
|
20 |
-
}
|
21 |
-
},
|
22 |
-
// Demos page
|
23 |
-
Basic: {
|
24 |
-
init: function() {
|
25 |
-
var slider = $('#demoSlider').bxSlider();
|
26 |
-
}
|
27 |
-
},
|
28 |
-
Destroy: {
|
29 |
-
init: function() {
|
30 |
-
var slider = $('#demoSlider').bxSlider();
|
31 |
-
|
32 |
-
$('#slider-init').click(function(){
|
33 |
-
slider.bxSlider();
|
34 |
-
return false;
|
35 |
-
});
|
36 |
-
|
37 |
-
$('#slider-destroy').click(function(){
|
38 |
-
slider.destroySlider();
|
39 |
-
return false;
|
40 |
-
});
|
41 |
-
}
|
42 |
-
},
|
43 |
-
Vertical: {
|
44 |
-
init: function() {
|
45 |
-
var slider = $('#demoSlider').bxSlider({
|
46 |
-
mode: 'vertical',
|
47 |
-
slideWidth: 400,
|
48 |
-
minSlides: 3,
|
49 |
-
moveSlides: 1
|
50 |
-
});
|
51 |
-
}
|
52 |
-
},
|
53 |
-
Fade: {
|
54 |
-
init: function() {
|
55 |
-
var slider = $('#demoSlider').bxSlider({mode:'fade'});
|
56 |
-
}
|
57 |
-
},
|
58 |
-
Ticker: {
|
59 |
-
init: function() {
|
60 |
-
$('#demoSlider1').bxSlider({minSlides: 4,
|
61 |
-
maxSlides: 4,
|
62 |
-
slideWidth: 170,
|
63 |
-
slideMargin: 10,
|
64 |
-
ticker: true,
|
65 |
-
tickerHover: true,
|
66 |
-
useCSS: false,
|
67 |
-
speed: 6000
|
68 |
-
});
|
69 |
-
$('#demoSlider2').bxSlider({minSlides: 4,
|
70 |
-
mode: 'vertical',
|
71 |
-
maxSlides: 4,
|
72 |
-
slideWidth: 170,
|
73 |
-
slideMargin: 10,
|
74 |
-
ticker: true,
|
75 |
-
tickerHover: true,
|
76 |
-
speed: 6000
|
77 |
-
});
|
78 |
-
}
|
79 |
-
},
|
80 |
-
Captions: {
|
81 |
-
init: function() {
|
82 |
-
var slider = $('#demoSlider').bxSlider({captions:true});
|
83 |
-
}
|
84 |
-
},
|
85 |
-
Callbacks: {
|
86 |
-
init: function() {
|
87 |
-
var slider = $('#demoSlider').bxSlider({
|
88 |
-
onSliderLoad: function(){
|
89 |
-
// do funky JS stuff here
|
90 |
-
alert('Slider has finished loading. Click OK to continue!');
|
91 |
-
},
|
92 |
-
onSlideAfter: function(){
|
93 |
-
// do mind-blowing JS stuff here
|
94 |
-
alert('A slide has finished transitioning. Bravo. Click OK to continue!');
|
95 |
-
}
|
96 |
-
});
|
97 |
-
}
|
98 |
-
},
|
99 |
-
Manual: {
|
100 |
-
init: function() {
|
101 |
-
var slider = $('#demoSlider').bxSlider({
|
102 |
-
infiniteLoop: false,
|
103 |
-
hideControlOnEnd: true
|
104 |
-
});
|
105 |
-
}
|
106 |
-
},
|
107 |
-
Auto: {
|
108 |
-
init: function() {
|
109 |
-
var slider = $('#demoSlider').bxSlider({
|
110 |
-
auto: true,
|
111 |
-
autoControls: true
|
112 |
-
});
|
113 |
-
}
|
114 |
-
},
|
115 |
-
AdaptiveHeight: {
|
116 |
-
init: function() {
|
117 |
-
var slider = $('#demoSlider').bxSlider({
|
118 |
-
adaptiveHeight: true,
|
119 |
-
mode: 'fade'
|
120 |
-
});
|
121 |
-
}
|
122 |
-
},
|
123 |
-
Carousel: {
|
124 |
-
init: function() {
|
125 |
-
$('.slider1').bxSlider({
|
126 |
-
slideWidth: 200,
|
127 |
-
minSlides: 2,
|
128 |
-
maxSlides: 3,
|
129 |
-
slideMargin: 10
|
130 |
-
});
|
131 |
-
$('.slider2').bxSlider({
|
132 |
-
slideWidth: 300,
|
133 |
-
minSlides: 2,
|
134 |
-
maxSlides: 2,
|
135 |
-
slideMargin: 10
|
136 |
-
});
|
137 |
-
$('.slider3').bxSlider({
|
138 |
-
slideWidth: 2000,
|
139 |
-
minSlides: 2,
|
140 |
-
maxSlides: 4,
|
141 |
-
slideMargin: 10
|
142 |
-
});
|
143 |
-
$('.slider4').bxSlider({
|
144 |
-
slideWidth: 300,
|
145 |
-
minSlides: 2,
|
146 |
-
maxSlides: 3,
|
147 |
-
moveSlides: 1,
|
148 |
-
slideMargin: 10
|
149 |
-
});
|
150 |
-
$('.slider5').bxSlider({
|
151 |
-
slideWidth: 300,
|
152 |
-
minSlides: 3,
|
153 |
-
maxSlides: 3,
|
154 |
-
moveSlides: 3,
|
155 |
-
slideMargin: 10
|
156 |
-
});
|
157 |
-
$('.slider6').bxSlider({
|
158 |
-
slideWidth: 300,
|
159 |
-
minSlides: 2,
|
160 |
-
maxSlides: 3,
|
161 |
-
startSlide: 2,
|
162 |
-
slideMargin: 10
|
163 |
-
});
|
164 |
-
$('.slider7').bxSlider({
|
165 |
-
slideWidth: 200,
|
166 |
-
minSlides: 4,
|
167 |
-
maxSlides: 5,
|
168 |
-
slideMargin: 10
|
169 |
-
});
|
170 |
-
$('.slider8').bxSlider({
|
171 |
-
mode: 'vertical',
|
172 |
-
slideWidth: 300,
|
173 |
-
minSlides: 2,
|
174 |
-
slideMargin: 10
|
175 |
-
});
|
176 |
-
}
|
177 |
-
},
|
178 |
-
Shrink: {
|
179 |
-
init: function() {
|
180 |
-
$('#demoSlider1').bxSlider({
|
181 |
-
slideWidth: 350,
|
182 |
-
minSlides: 1,
|
183 |
-
maxSlides: 4,
|
184 |
-
slideMargin: 10,
|
185 |
-
shrinkItems: true
|
186 |
-
});
|
187 |
-
$('#demoSlider2').bxSlider({
|
188 |
-
slideWidth: 350,
|
189 |
-
minSlides: 1,
|
190 |
-
maxSlides: 4,
|
191 |
-
slideMargin: 10,
|
192 |
-
shrinkItems: false
|
193 |
-
});
|
194 |
-
}
|
195 |
-
},
|
196 |
-
Touch: {
|
197 |
-
init: function() {
|
198 |
-
$('#demoSlider').bxSlider({
|
199 |
-
oneToOneTouch: false,
|
200 |
-
swipeThreshold: 100
|
201 |
-
});
|
202 |
-
}
|
203 |
-
},
|
204 |
-
Pager: {
|
205 |
-
init: function() {
|
206 |
-
$('#demoSlider1').bxSlider({
|
207 |
-
pagerCustom: '#bx-pager'
|
208 |
-
});
|
209 |
-
}
|
210 |
-
},
|
211 |
-
};
|
212 |
-
|
213 |
-
// The routing fires all common scripts, followed by the page specific scripts.
|
214 |
-
// Add additional events for more control over timing e.g. a finalize event
|
215 |
-
var UTIL = {
|
216 |
-
fire: function(func, funcname, args) {
|
217 |
-
var namespace = Docs;
|
218 |
-
funcname = (funcname === undefined) ? 'init' : funcname;
|
219 |
-
if (func !== '' && namespace[func] && typeof namespace[func][funcname] === 'function') {
|
220 |
-
namespace[func][funcname](args);
|
221 |
-
}
|
222 |
-
},
|
223 |
-
loadEvents: function() {
|
224 |
-
UTIL.fire('common');
|
225 |
-
|
226 |
-
$.each(document.body.className.replace(/-/g, '_').split(/\s+/),function(i,classnm) {
|
227 |
-
UTIL.fire(classnm);
|
228 |
-
});
|
229 |
-
}
|
230 |
-
};
|
231 |
-
|
232 |
-
$(document).ready(UTIL.loadEvents);
|
233 |
-
|
234 |
-
})(jQuery); // Fully reference jQuery after this point.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/bxslider-4/docs_src/assets/less/docs.less
DELETED
@@ -1,112 +0,0 @@
|
|
1 |
-
@import "bootstrap";
|
2 |
-
|
3 |
-
@font-family-sans-serif: "Lato", Helvetica, Arial, sans-serif;
|
4 |
-
@navbar-height: 80px;
|
5 |
-
@navbar-default-bg: #e0e0e0;
|
6 |
-
|
7 |
-
|
8 |
-
// Sticky Footer
|
9 |
-
// --------------------
|
10 |
-
|
11 |
-
html, body {
|
12 |
-
height: 100%;
|
13 |
-
}
|
14 |
-
.wrapper {
|
15 |
-
min-height: 100%;
|
16 |
-
height: auto !important; /* This line and the next line are not necessary unless you need IE6 support */
|
17 |
-
height: 100%;
|
18 |
-
margin: 0 auto -211px; /* the bottom margin is the negative value of the footer's height */
|
19 |
-
}
|
20 |
-
|
21 |
-
footer, .push {
|
22 |
-
height: 211px; /* .push must be the same height as .footer */
|
23 |
-
}
|
24 |
-
|
25 |
-
// Nav
|
26 |
-
// --------------------
|
27 |
-
|
28 |
-
.navbar-brand {
|
29 |
-
padding: 10px 15px;
|
30 |
-
}
|
31 |
-
|
32 |
-
// UI
|
33 |
-
// --------------------
|
34 |
-
|
35 |
-
.btn-outline {
|
36 |
-
.button-variant(#5280dd, transparent, #5280dd);
|
37 |
-
border-width: 3px;
|
38 |
-
}
|
39 |
-
|
40 |
-
.sub-lead {
|
41 |
-
margin-top: 5px;
|
42 |
-
}
|
43 |
-
|
44 |
-
// Home
|
45 |
-
// --------------------
|
46 |
-
|
47 |
-
.version {
|
48 |
-
font-family: monospace;
|
49 |
-
}
|
50 |
-
|
51 |
-
// Demos
|
52 |
-
// --------------------
|
53 |
-
|
54 |
-
.demo-list {
|
55 |
-
margin-bottom: 30px;
|
56 |
-
}
|
57 |
-
|
58 |
-
// Options
|
59 |
-
// --------------------
|
60 |
-
|
61 |
-
.options {
|
62 |
-
h1 {
|
63 |
-
margin-bottom: 10px;
|
64 |
-
}
|
65 |
-
h2 {
|
66 |
-
font-size: 1.5em;
|
67 |
-
margin-bottom: 15px;
|
68 |
-
}
|
69 |
-
}
|
70 |
-
|
71 |
-
.option-name {
|
72 |
-
font-weight: bold;
|
73 |
-
font-size: 1em;
|
74 |
-
margin-bottom: 2px;
|
75 |
-
}
|
76 |
-
|
77 |
-
.option-desc {
|
78 |
-
font-size: .8em;
|
79 |
-
line-height: 1.4em;
|
80 |
-
color: #666;
|
81 |
-
}
|
82 |
-
|
83 |
-
// Footer
|
84 |
-
// --------------------
|
85 |
-
|
86 |
-
footer {
|
87 |
-
background: #e0e0e0;
|
88 |
-
border-top: solid 3px #c3c3c3;
|
89 |
-
padding: 40px 0 40px;
|
90 |
-
font-family: "Arial", sans-serif;
|
91 |
-
p {
|
92 |
-
font-size: 1em;
|
93 |
-
margin-bottom: 5px;
|
94 |
-
.pix {
|
95 |
-
margin-top: 25px;
|
96 |
-
}
|
97 |
-
}
|
98 |
-
h4 {
|
99 |
-
font-size: 1.25em;
|
100 |
-
font-weight: bold;
|
101 |
-
}
|
102 |
-
.left {
|
103 |
-
float: left;
|
104 |
-
width: 500px;
|
105 |
-
}
|
106 |
-
.first h4 {
|
107 |
-
padding-top: 3px;
|
108 |
-
}
|
109 |
-
.twitter {
|
110 |
-
margin-top: 16px;
|
111 |
-
}
|
112 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/bxslider-4/docs_src/assets/vendors/jquery.min.js
DELETED
@@ -1,5 +0,0 @@
|
|
1 |
-
/*! jQuery v2.1.1 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */
|
2 |
-
!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l=a.document,m="2.1.1",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return n.each(this,a,b)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(n.isPlainObject(d)||(e=n.isArray(d)))?(e?(e=!1,f=c&&n.isArray(c)?c:[]):f=c&&n.isPlainObject(c)?c:{},g[b]=n.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){return!n.isArray(a)&&a-parseFloat(a)>=0},isPlainObject:function(a){return"object"!==n.type(a)||a.nodeType||n.isWindow(a)?!1:a.constructor&&!j.call(a.constructor.prototype,"isPrototypeOf")?!1:!0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(a){var b,c=eval;a=n.trim(a),a&&(1===a.indexOf("use strict")?(b=l.createElement("script"),b.text=a,l.head.appendChild(b).parentNode.removeChild(b)):c(a))},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=s(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:g.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;c>d;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=s(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(c=a[b],b=a,a=c),n.isFunction(a)?(e=d.call(arguments,2),f=function(){return a.apply(b||this,e.concat(d.call(arguments)))},f.guid=a.guid=a.guid||n.guid++,f):void 0},now:Date.now,support:k}),n.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+-new Date,v=a.document,w=0,x=0,y=gb(),z=gb(),A=gb(),B=function(a,b){return a===b&&(l=!0),0},C="undefined",D=1<<31,E={}.hasOwnProperty,F=[],G=F.pop,H=F.push,I=F.push,J=F.slice,K=F.indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},L="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",N="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",O=N.replace("w","w#"),P="\\["+M+"*("+N+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+O+"))|)"+M+"*\\]",Q=":("+N+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+P+")*)|.*)\\)|)",R=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),S=new RegExp("^"+M+"*,"+M+"*"),T=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=new RegExp("="+M+"*([^\\]'\"]*?)"+M+"*\\]","g"),V=new RegExp(Q),W=new RegExp("^"+O+"$"),X={ID:new RegExp("^#("+N+")"),CLASS:new RegExp("^\\.("+N+")"),TAG:new RegExp("^("+N.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+Q),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+L+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ab=/[+~]/,bb=/'|\\/g,cb=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),db=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)};try{I.apply(F=J.call(v.childNodes),v.childNodes),F[v.childNodes.length].nodeType}catch(eb){I={apply:F.length?function(a,b){H.apply(a,J.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fb(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],!a||"string"!=typeof a)return d;if(1!==(k=b.nodeType)&&9!==k)return[];if(p&&!e){if(f=_.exec(a))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return I.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName&&b.getElementsByClassName)return I.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=9===k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(bb,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+qb(o[l]);w=ab.test(a)&&ob(b.parentNode)||b,x=o.join(",")}if(x)try{return I.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function gb(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function hb(a){return a[u]=!0,a}function ib(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function jb(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function kb(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||D)-(~a.sourceIndex||D);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function lb(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function mb(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function nb(a){return hb(function(b){return b=+b,hb(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function ob(a){return a&&typeof a.getElementsByTagName!==C&&a}c=fb.support={},f=fb.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fb.setDocument=function(a){var b,e=a?a.ownerDocument||a:v,g=e.defaultView;return e!==n&&9===e.nodeType&&e.documentElement?(n=e,o=e.documentElement,p=!f(e),g&&g!==g.top&&(g.addEventListener?g.addEventListener("unload",function(){m()},!1):g.attachEvent&&g.attachEvent("onunload",function(){m()})),c.attributes=ib(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ib(function(a){return a.appendChild(e.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(e.getElementsByClassName)&&ib(function(a){return a.innerHTML="<div class='a'></div><div class='a i'></div>",a.firstChild.className="i",2===a.getElementsByClassName("i").length}),c.getById=ib(function(a){return o.appendChild(a).id=u,!e.getElementsByName||!e.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if(typeof b.getElementById!==C&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){var c=typeof a.getAttributeNode!==C&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return typeof b.getElementsByTagName!==C?b.getElementsByTagName(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return typeof b.getElementsByClassName!==C&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(e.querySelectorAll))&&(ib(function(a){a.innerHTML="<select msallowclip=''><option selected=''></option></select>",a.querySelectorAll("[msallowclip^='']").length&&q.push("[*^$]="+M+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+M+"*(?:value|"+L+")"),a.querySelectorAll(":checked").length||q.push(":checked")}),ib(function(a){var b=e.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+M+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ib(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",Q)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===e||a.ownerDocument===v&&t(v,a)?-1:b===e||b.ownerDocument===v&&t(v,b)?1:k?K.call(k,a)-K.call(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,f=a.parentNode,g=b.parentNode,h=[a],i=[b];if(!f||!g)return a===e?-1:b===e?1:f?-1:g?1:k?K.call(k,a)-K.call(k,b):0;if(f===g)return kb(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?kb(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},e):n},fb.matches=function(a,b){return fb(a,null,null,b)},fb.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fb(b,n,null,[a]).length>0},fb.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fb.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&E.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fb.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fb.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fb.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=fb.selectors={cacheLength:50,createPseudo:hb,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(cb,db),a[3]=(a[3]||a[4]||a[5]||"").replace(cb,db),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fb.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fb.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(cb,db).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+M+")"+a+"("+M+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||typeof a.getAttribute!==C&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fb.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fb.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?hb(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=K.call(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:hb(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?hb(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:hb(function(a){return function(b){return fb(a,b).length>0}}),contains:hb(function(a){return function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:hb(function(a){return W.test(a||"")||fb.error("unsupported lang: "+a),a=a.replace(cb,db).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:nb(function(){return[0]}),last:nb(function(a,b){return[b-1]}),eq:nb(function(a,b,c){return[0>c?c+b:c]}),even:nb(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:nb(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:nb(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:nb(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=lb(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=mb(b);function pb(){}pb.prototype=d.filters=d.pseudos,d.setFilters=new pb,g=fb.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){(!c||(e=S.exec(h)))&&(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=T.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(R," ")}),h=h.slice(c.length));for(g in d.filter)!(e=X[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?fb.error(a):z(a,i).slice(0)};function qb(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function rb(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function sb(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function tb(a,b,c){for(var d=0,e=b.length;e>d;d++)fb(a,b[d],c);return c}function ub(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function vb(a,b,c,d,e,f){return d&&!d[u]&&(d=vb(d)),e&&!e[u]&&(e=vb(e,f)),hb(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||tb(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ub(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ub(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?K.call(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ub(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):I.apply(g,r)})}function wb(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=rb(function(a){return a===b},h,!0),l=rb(function(a){return K.call(b,a)>-1},h,!0),m=[function(a,c,d){return!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d))}];f>i;i++)if(c=d.relative[a[i].type])m=[rb(sb(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return vb(i>1&&sb(m),i>1&&qb(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&wb(a.slice(i,e)),f>e&&wb(a=a.slice(e)),f>e&&qb(a))}m.push(c)}return sb(m)}function xb(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=G.call(i));s=ub(s)}I.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&fb.uniqueSort(i)}return k&&(w=v,j=t),r};return c?hb(f):f}return h=fb.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wb(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xb(e,d)),f.selector=a}return f},i=fb.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(cb,db),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(cb,db),ab.test(j[0].type)&&ob(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qb(j),!a)return I.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,ab.test(a)&&ob(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ib(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ib(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||jb("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ib(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||jb("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ib(function(a){return null==a.getAttribute("disabled")})||jb(L,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fb}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=n.expr.match.needsContext,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^.[^:#\[\.,]*$/;function x(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(w.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return g.call(b,a)>=0!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=this.length,d=[],e=this;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;c>b;b++)if(n.contains(e[b],this))return!0}));for(b=0;c>b;b++)n.find(a,e[b],d);return d=this.pushStack(c>1?n.unique(d):d),d.selector=this.selector?this.selector+" "+a:a,d},filter:function(a){return this.pushStack(x(this,a||[],!1))},not:function(a){return this.pushStack(x(this,a||[],!0))},is:function(a){return!!x(this,"string"==typeof a&&u.test(a)?n(a):a||[],!1).length}});var y,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=n.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||y).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:l,!0)),v.test(c[1])&&n.isPlainObject(b))for(c in b)n.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}return d=l.getElementById(c[2]),d&&d.parentNode&&(this.length=1,this[0]=d),this.context=l,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?"undefined"!=typeof y.ready?y.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};A.prototype=n.fn,y=n(l);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};n.extend({dir:function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),n.fn.extend({has:function(a){var b=n(a,this),c=b.length;return this.filter(function(){for(var a=0;c>a;a++)if(n.contains(this,b[a]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=u.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.unique(f):f)},index:function(a){return a?"string"==typeof a?g.call(n(a),this[0]):g.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.unique(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){while((a=a[b])&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return n.dir(a,"parentNode")},parentsUntil:function(a,b,c){return n.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return n.dir(a,"nextSibling")},prevAll:function(a){return n.dir(a,"previousSibling")},nextUntil:function(a,b,c){return n.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return n.dir(a,"previousSibling",c)},siblings:function(a){return n.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return n.sibling(a.firstChild)},contents:function(a){return a.contentDocument||n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(C[a]||n.unique(e),B.test(a)&&e.reverse()),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return n.each(a.match(E)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):n.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(b=a.memory&&l,c=!0,g=e||0,e=0,f=h.length,d=!0;h&&f>g;g++)if(h[g].apply(l[0],l[1])===!1&&a.stopOnFalse){b=!1;break}d=!1,h&&(i?i.length&&j(i.shift()):b?h=[]:k.disable())},k={add:function(){if(h){var c=h.length;!function g(b){n.each(b,function(b,c){var d=n.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&g(c)})}(arguments),d?f=h.length:b&&(e=c,j(b))}return this},remove:function(){return h&&n.each(arguments,function(a,b){var c;while((c=n.inArray(b,h,c))>-1)h.splice(c,1),d&&(f>=c&&f--,g>=c&&g--)}),this},has:function(a){return a?n.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],f=0,this},disable:function(){return h=i=b=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,b||k.disable(),this},locked:function(){return!i},fireWith:function(a,b){return!h||c&&!i||(b=b||[],b=[a,b.slice?b.slice():b],d?i.push(b):j(b)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!c}};return k},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&n.isFunction(a.promise)?e:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(H.resolveWith(l,[n]),n.fn.triggerHandler&&(n(l).triggerHandler("ready"),n(l).off("ready"))))}});function I(){l.removeEventListener("DOMContentLoaded",I,!1),a.removeEventListener("load",I,!1),n.ready()}n.ready.promise=function(b){return H||(H=n.Deferred(),"complete"===l.readyState?setTimeout(n.ready):(l.addEventListener("DOMContentLoaded",I,!1),a.addEventListener("load",I,!1))),H.promise(b)},n.ready.promise();var J=n.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)n.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f};n.acceptData=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function K(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=n.expando+Math.random()}K.uid=1,K.accepts=n.acceptData,K.prototype={key:function(a){if(!K.accepts(a))return 0;var b={},c=a[this.expando];if(!c){c=K.uid++;try{b[this.expando]={value:c},Object.defineProperties(a,b)}catch(d){b[this.expando]=c,n.extend(a,b)}}return this.cache[c]||(this.cache[c]={}),c},set:function(a,b,c){var d,e=this.key(a),f=this.cache[e];if("string"==typeof b)f[b]=c;else if(n.isEmptyObject(f))n.extend(this.cache[e],b);else for(d in b)f[d]=b[d];return f},get:function(a,b){var c=this.cache[this.key(a)];return void 0===b?c:c[b]},access:function(a,b,c){var d;return void 0===b||b&&"string"==typeof b&&void 0===c?(d=this.get(a,b),void 0!==d?d:this.get(a,n.camelCase(b))):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d,e,f=this.key(a),g=this.cache[f];if(void 0===b)this.cache[f]={};else{n.isArray(b)?d=b.concat(b.map(n.camelCase)):(e=n.camelCase(b),b in g?d=[b,e]:(d=e,d=d in g?[d]:d.match(E)||[])),c=d.length;while(c--)delete g[d[c]]}},hasData:function(a){return!n.isEmptyObject(this.cache[a[this.expando]]||{})},discard:function(a){a[this.expando]&&delete this.cache[a[this.expando]]}};var L=new K,M=new K,N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(O,"-$1").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}M.set(a,b,c)}else c=void 0;return c}n.extend({hasData:function(a){return M.hasData(a)||L.hasData(a)},data:function(a,b,c){return M.access(a,b,c)},removeData:function(a,b){M.remove(a,b)
|
3 |
-
},_data:function(a,b,c){return L.access(a,b,c)},_removeData:function(a,b){L.remove(a,b)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=M.get(f),1===f.nodeType&&!L.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d])));L.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){M.set(this,a)}):J(this,function(b){var c,d=n.camelCase(a);if(f&&void 0===b){if(c=M.get(f,a),void 0!==c)return c;if(c=M.get(f,d),void 0!==c)return c;if(c=P(f,d,void 0),void 0!==c)return c}else this.each(function(){var c=M.get(this,d);M.set(this,d,b),-1!==a.indexOf("-")&&void 0!==c&&M.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){M.remove(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=L.get(a,b),c&&(!d||n.isArray(c)?d=L.access(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return L.get(a,c)||L.access(a,c,{empty:n.Callbacks("once memory").add(function(){L.remove(a,[b+"queue",c])})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?n.queue(this[0],a):void 0===b?this:this.each(function(){var c=n.queue(this,a,b);n._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&n.dequeue(this,a)})},dequeue:function(a){return this.each(function(){n.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=n.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=L.get(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var Q=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,R=["Top","Right","Bottom","Left"],S=function(a,b){return a=b||a,"none"===n.css(a,"display")||!n.contains(a.ownerDocument,a)},T=/^(?:checkbox|radio)$/i;!function(){var a=l.createDocumentFragment(),b=a.appendChild(l.createElement("div")),c=l.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),k.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="<textarea>x</textarea>",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var U="undefined";k.focusinBubbles="onfocusin"in a;var V=/^key/,W=/^(?:mouse|pointer|contextmenu)|click/,X=/^(?:focusinfocus|focusoutblur)$/,Y=/^([^.]*)(?:\.(.+)|)$/;function Z(){return!0}function $(){return!1}function _(){try{return l.activeElement}catch(a){}}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.get(a);if(r){c.handler&&(f=c,c=f.handler,e=f.selector),c.guid||(c.guid=n.guid++),(i=r.events)||(i=r.events={}),(g=r.handle)||(g=r.handle=function(b){return typeof n!==U&&n.event.triggered!==b.type?n.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(E)||[""],j=b.length;while(j--)h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o&&(l=n.event.special[o]||{},o=(e?l.delegateType:l.bindType)||o,l=n.event.special[o]||{},k=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},f),(m=i[o])||(m=i[o]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,p,g)!==!1||a.addEventListener&&a.addEventListener(o,g,!1)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),n.event.global[o]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.hasData(a)&&L.get(a);if(r&&(i=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=i[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&q!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete i[o])}else for(o in i)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(i)&&(delete r.handle,L.remove(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,m,o,p=[d||l],q=j.call(b,"type")?b.type:b,r=j.call(b,"namespace")?b.namespace.split("."):[];if(g=h=d=d||l,3!==d.nodeType&&8!==d.nodeType&&!X.test(q+n.event.triggered)&&(q.indexOf(".")>=0&&(r=q.split("."),q=r.shift(),r.sort()),k=q.indexOf(":")<0&&"on"+q,b=b[n.expando]?b:new n.Event(q,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=r.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:n.makeArray(c,[b]),o=n.event.special[q]||{},e||!o.trigger||o.trigger.apply(d,c)!==!1)){if(!e&&!o.noBubble&&!n.isWindow(d)){for(i=o.delegateType||q,X.test(i+q)||(g=g.parentNode);g;g=g.parentNode)p.push(g),h=g;h===(d.ownerDocument||l)&&p.push(h.defaultView||h.parentWindow||a)}f=0;while((g=p[f++])&&!b.isPropagationStopped())b.type=f>1?i:o.bindType||q,m=(L.get(g,"events")||{})[b.type]&&L.get(g,"handle"),m&&m.apply(g,c),m=k&&g[k],m&&m.apply&&n.acceptData(g)&&(b.result=m.apply(g,c),b.result===!1&&b.preventDefault());return b.type=q,e||b.isDefaultPrevented()||o._default&&o._default.apply(p.pop(),c)!==!1||!n.acceptData(d)||k&&n.isFunction(d[q])&&!n.isWindow(d)&&(h=d[k],h&&(d[k]=null),n.event.triggered=q,d[q](),n.event.triggered=void 0,h&&(d[k]=h)),b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(L.get(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(g.namespace))&&(a.handleObj=g,a.data=g.data,e=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==e&&(a.result=e)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!==this;i=i.parentNode||this)if(i.disabled!==!0||"click"!==a.type){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>=0:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,d,e,f=b.button;return null==a.pageX&&null!=b.clientX&&(c=a.target.ownerDocument||l,d=c.documentElement,e=c.body,a.pageX=b.clientX+(d&&d.scrollLeft||e&&e.scrollLeft||0)-(d&&d.clientLeft||e&&e.clientLeft||0),a.pageY=b.clientY+(d&&d.scrollTop||e&&e.scrollTop||0)-(d&&d.clientTop||e&&e.clientTop||0)),a.which||void 0===f||(a.which=1&f?1:2&f?3:4&f?2:0),a}},fix:function(a){if(a[n.expando])return a;var b,c,d,e=a.type,f=a,g=this.fixHooks[e];g||(this.fixHooks[e]=g=W.test(e)?this.mouseHooks:V.test(e)?this.keyHooks:{}),d=g.props?this.props.concat(g.props):this.props,a=new n.Event(f),b=d.length;while(b--)c=d[b],a[c]=f[c];return a.target||(a.target=l),3===a.target.nodeType&&(a.target=a.target.parentNode),g.filter?g.filter(a,f):a},special:{load:{noBubble:!0},focus:{trigger:function(){return this!==_()&&this.focus?(this.focus(),!1):void 0},delegateType:"focusin"},blur:{trigger:function(){return this===_()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return"checkbox"===this.type&&this.click&&n.nodeName(this,"input")?(this.click(),!1):void 0},_default:function(a){return n.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c,d){var e=n.extend(new n.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?n.event.trigger(e,null,b):n.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},n.removeEvent=function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)},n.Event=function(a,b){return this instanceof n.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?Z:$):this.type=a,b&&n.extend(this,b),this.timeStamp=a&&a.timeStamp||n.now(),void(this[n.expando]=!0)):new n.Event(a,b)},n.Event.prototype={isDefaultPrevented:$,isPropagationStopped:$,isImmediatePropagationStopped:$,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=Z,a&&a.preventDefault&&a.preventDefault()},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=Z,a&&a.stopPropagation&&a.stopPropagation()},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=Z,a&&a.stopImmediatePropagation&&a.stopImmediatePropagation(),this.stopPropagation()}},n.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){n.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return(!e||e!==d&&!n.contains(d,e))&&(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),k.focusinBubbles||n.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){n.event.simulate(b,a.target,n.event.fix(a),!0)};n.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=L.access(d,b);e||d.addEventListener(a,c,!0),L.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=L.access(d,b)-1;e?L.access(d,b,e):(d.removeEventListener(a,c,!0),L.remove(d,b))}}}),n.fn.extend({on:function(a,b,c,d,e){var f,g;if("object"==typeof a){"string"!=typeof b&&(c=c||b,b=void 0);for(g in a)this.on(g,b,c,a[g],e);return this}if(null==c&&null==d?(d=b,c=b=void 0):null==d&&("string"==typeof b?(d=c,c=void 0):(d=c,c=b,b=void 0)),d===!1)d=$;else if(!d)return this;return 1===e&&(f=d,d=function(a){return n().off(a),f.apply(this,arguments)},d.guid=f.guid||(f.guid=n.guid++)),this.each(function(){n.event.add(this,a,d,c,b)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,n(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return(b===!1||"function"==typeof b)&&(c=b,b=void 0),c===!1&&(c=$),this.each(function(){n.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){n.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?n.event.trigger(a,b,c,!0):void 0}});var ab=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bb=/<([\w:]+)/,cb=/<|&#?\w+;/,db=/<(?:script|style|link)/i,eb=/checked\s*(?:[^=]|=\s*.checked.)/i,fb=/^$|\/(?:java|ecma)script/i,gb=/^true\/(.*)/,hb=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,ib={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};ib.optgroup=ib.option,ib.tbody=ib.tfoot=ib.colgroup=ib.caption=ib.thead,ib.th=ib.td;function jb(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function kb(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function lb(a){var b=gb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function mb(a,b){for(var c=0,d=a.length;d>c;c++)L.set(a[c],"globalEval",!b||L.get(b[c],"globalEval"))}function nb(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(L.hasData(a)&&(f=L.access(a),g=L.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)n.event.add(b,e,j[e][c])}M.hasData(a)&&(h=M.access(a),i=n.extend({},h),M.set(b,i))}}function ob(a,b){var c=a.getElementsByTagName?a.getElementsByTagName(b||"*"):a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&n.nodeName(a,b)?n.merge([a],c):c}function pb(a,b){var c=b.nodeName.toLowerCase();"input"===c&&T.test(a.type)?b.checked=a.checked:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}n.extend({clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=n.contains(a.ownerDocument,a);if(!(k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(g=ob(h),f=ob(a),d=0,e=f.length;e>d;d++)pb(f[d],g[d]);if(b)if(c)for(f=f||ob(a),g=g||ob(h),d=0,e=f.length;e>d;d++)nb(f[d],g[d]);else nb(a,h);return g=ob(h,"script"),g.length>0&&mb(g,!i&&ob(a,"script")),h},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,k=b.createDocumentFragment(),l=[],m=0,o=a.length;o>m;m++)if(e=a[m],e||0===e)if("object"===n.type(e))n.merge(l,e.nodeType?[e]:e);else if(cb.test(e)){f=f||k.appendChild(b.createElement("div")),g=(bb.exec(e)||["",""])[1].toLowerCase(),h=ib[g]||ib._default,f.innerHTML=h[1]+e.replace(ab,"<$1></$2>")+h[2],j=h[0];while(j--)f=f.lastChild;n.merge(l,f.childNodes),f=k.firstChild,f.textContent=""}else l.push(b.createTextNode(e));k.textContent="",m=0;while(e=l[m++])if((!d||-1===n.inArray(e,d))&&(i=n.contains(e.ownerDocument,e),f=ob(k.appendChild(e),"script"),i&&mb(f),c)){j=0;while(e=f[j++])fb.test(e.type||"")&&c.push(e)}return k},cleanData:function(a){for(var b,c,d,e,f=n.event.special,g=0;void 0!==(c=a[g]);g++){if(n.acceptData(c)&&(e=c[L.expando],e&&(b=L.cache[e]))){if(b.events)for(d in b.events)f[d]?n.event.remove(c,d):n.removeEvent(c,d,b.handle);L.cache[e]&&delete L.cache[e]}delete M.cache[c[M.expando]]}}}),n.fn.extend({text:function(a){return J(this,function(a){return void 0===a?n.text(this):this.empty().each(function(){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&(this.textContent=a)})},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=jb(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=jb(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?n.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||n.cleanData(ob(c)),c.parentNode&&(b&&n.contains(c.ownerDocument,c)&&mb(ob(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(n.cleanData(ob(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return J(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!db.test(a)&&!ib[(bb.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(ab,"<$1></$2>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(ob(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,n.cleanData(ob(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,m=this,o=l-1,p=a[0],q=n.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&eb.test(p))return this.each(function(c){var d=m.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(c=n.buildFragment(a,this[0].ownerDocument,!1,this),d=c.firstChild,1===c.childNodes.length&&(c=d),d)){for(f=n.map(ob(c,"script"),kb),g=f.length;l>j;j++)h=c,j!==o&&(h=n.clone(h,!0,!0),g&&n.merge(f,ob(h,"script"))),b.call(this[j],h,j);if(g)for(i=f[f.length-1].ownerDocument,n.map(f,lb),j=0;g>j;j++)h=f[j],fb.test(h.type||"")&&!L.access(h,"globalEval")&&n.contains(i,h)&&(h.src?n._evalUrl&&n._evalUrl(h.src):n.globalEval(h.textContent.replace(hb,"")))}return this}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=[],e=n(a),g=e.length-1,h=0;g>=h;h++)c=h===g?this:this.clone(!0),n(e[h])[b](c),f.apply(d,c.get());return this.pushStack(d)}});var qb,rb={};function sb(b,c){var d,e=n(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:n.css(e[0],"display");return e.detach(),f}function tb(a){var b=l,c=rb[a];return c||(c=sb(a,b),"none"!==c&&c||(qb=(qb||n("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=qb[0].contentDocument,b.write(),b.close(),c=sb(a,b),qb.detach()),rb[a]=c),c}var ub=/^margin/,vb=new RegExp("^("+Q+")(?!px)[a-z%]+$","i"),wb=function(a){return a.ownerDocument.defaultView.getComputedStyle(a,null)};function xb(a,b,c){var d,e,f,g,h=a.style;return c=c||wb(a),c&&(g=c.getPropertyValue(b)||c[b]),c&&(""!==g||n.contains(a.ownerDocument,a)||(g=n.style(a,b)),vb.test(g)&&ub.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0!==g?g+"":g}function yb(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}!function(){var b,c,d=l.documentElement,e=l.createElement("div"),f=l.createElement("div");if(f.style){f.style.backgroundClip="content-box",f.cloneNode(!0).style.backgroundClip="",k.clearCloneStyle="content-box"===f.style.backgroundClip,e.style.cssText="border:0;width:0;height:0;top:0;left:-9999px;margin-top:1px;position:absolute",e.appendChild(f);function g(){f.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",f.innerHTML="",d.appendChild(e);var g=a.getComputedStyle(f,null);b="1%"!==g.top,c="4px"===g.width,d.removeChild(e)}a.getComputedStyle&&n.extend(k,{pixelPosition:function(){return g(),b},boxSizingReliable:function(){return null==c&&g(),c},reliableMarginRight:function(){var b,c=f.appendChild(l.createElement("div"));return c.style.cssText=f.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",c.style.marginRight=c.style.width="0",f.style.width="1px",d.appendChild(e),b=!parseFloat(a.getComputedStyle(c,null).marginRight),d.removeChild(e),b}})}}(),n.swap=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};var zb=/^(none|table(?!-c[ea]).+)/,Ab=new RegExp("^("+Q+")(.*)$","i"),Bb=new RegExp("^([+-])=("+Q+")","i"),Cb={position:"absolute",visibility:"hidden",display:"block"},Db={letterSpacing:"0",fontWeight:"400"},Eb=["Webkit","O","Moz","ms"];function Fb(a,b){if(b in a)return b;var c=b[0].toUpperCase()+b.slice(1),d=b,e=Eb.length;while(e--)if(b=Eb[e]+c,b in a)return b;return d}function Gb(a,b,c){var d=Ab.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function Hb(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=n.css(a,c+R[f],!0,e)),d?("content"===c&&(g-=n.css(a,"padding"+R[f],!0,e)),"margin"!==c&&(g-=n.css(a,"border"+R[f]+"Width",!0,e))):(g+=n.css(a,"padding"+R[f],!0,e),"padding"!==c&&(g+=n.css(a,"border"+R[f]+"Width",!0,e)));return g}function Ib(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=wb(a),g="border-box"===n.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=xb(a,b,f),(0>e||null==e)&&(e=a.style[b]),vb.test(e))return e;d=g&&(k.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+Hb(a,b,c||(g?"border":"content"),d,f)+"px"}function Jb(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=L.get(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&S(d)&&(f[g]=L.access(d,"olddisplay",tb(d.nodeName)))):(e=S(d),"none"===c&&e||L.set(d,"olddisplay",e?c:n.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}n.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=xb(a,"opacity");return""===c?"1":c}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=n.camelCase(b),i=a.style;return b=n.cssProps[h]||(n.cssProps[h]=Fb(i,h)),g=n.cssHooks[b]||n.cssHooks[h],void 0===c?g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b]:(f=typeof c,"string"===f&&(e=Bb.exec(c))&&(c=(e[1]+1)*e[2]+parseFloat(n.css(a,b)),f="number"),null!=c&&c===c&&("number"!==f||n.cssNumber[h]||(c+="px"),k.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),g&&"set"in g&&void 0===(c=g.set(a,c,d))||(i[b]=c)),void 0)}},css:function(a,b,c,d){var e,f,g,h=n.camelCase(b);return b=n.cssProps[h]||(n.cssProps[h]=Fb(a.style,h)),g=n.cssHooks[b]||n.cssHooks[h],g&&"get"in g&&(e=g.get(a,!0,c)),void 0===e&&(e=xb(a,b,d)),"normal"===e&&b in Db&&(e=Db[b]),""===c||c?(f=parseFloat(e),c===!0||n.isNumeric(f)?f||0:e):e}}),n.each(["height","width"],function(a,b){n.cssHooks[b]={get:function(a,c,d){return c?zb.test(n.css(a,"display"))&&0===a.offsetWidth?n.swap(a,Cb,function(){return Ib(a,b,d)}):Ib(a,b,d):void 0},set:function(a,c,d){var e=d&&wb(a);return Gb(a,c,d?Hb(a,b,d,"border-box"===n.css(a,"boxSizing",!1,e),e):0)}}}),n.cssHooks.marginRight=yb(k.reliableMarginRight,function(a,b){return b?n.swap(a,{display:"inline-block"},xb,[a,"marginRight"]):void 0}),n.each({margin:"",padding:"",border:"Width"},function(a,b){n.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+R[d]+b]=f[d]||f[d-2]||f[0];return e}},ub.test(a)||(n.cssHooks[a+b].set=Gb)}),n.fn.extend({css:function(a,b){return J(this,function(a,b,c){var d,e,f={},g=0;if(n.isArray(b)){for(d=wb(a),e=b.length;e>g;g++)f[b[g]]=n.css(a,b[g],!1,d);return f}return void 0!==c?n.style(a,b,c):n.css(a,b)},a,b,arguments.length>1)},show:function(){return Jb(this,!0)},hide:function(){return Jb(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){S(this)?n(this).show():n(this).hide()})}});function Kb(a,b,c,d,e){return new Kb.prototype.init(a,b,c,d,e)}n.Tween=Kb,Kb.prototype={constructor:Kb,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(n.cssNumber[c]?"":"px")},cur:function(){var a=Kb.propHooks[this.prop];return a&&a.get?a.get(this):Kb.propHooks._default.get(this)},run:function(a){var b,c=Kb.propHooks[this.prop];return this.pos=b=this.options.duration?n.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Kb.propHooks._default.set(this),this}},Kb.prototype.init.prototype=Kb.prototype,Kb.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=n.css(a.elem,a.prop,""),b&&"auto"!==b?b:0):a.elem[a.prop]},set:function(a){n.fx.step[a.prop]?n.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[n.cssProps[a.prop]]||n.cssHooks[a.prop])?n.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},Kb.propHooks.scrollTop=Kb.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},n.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},n.fx=Kb.prototype.init,n.fx.step={};var Lb,Mb,Nb=/^(?:toggle|show|hide)$/,Ob=new RegExp("^(?:([+-])=|)("+Q+")([a-z%]*)$","i"),Pb=/queueHooks$/,Qb=[Vb],Rb={"*":[function(a,b){var c=this.createTween(a,b),d=c.cur(),e=Ob.exec(b),f=e&&e[3]||(n.cssNumber[a]?"":"px"),g=(n.cssNumber[a]||"px"!==f&&+d)&&Ob.exec(n.css(c.elem,a)),h=1,i=20;if(g&&g[3]!==f){f=f||g[3],e=e||[],g=+d||1;do h=h||".5",g/=h,n.style(c.elem,a,g+f);while(h!==(h=c.cur()/d)&&1!==h&&--i)}return e&&(g=c.start=+g||+d||0,c.unit=f,c.end=e[1]?g+(e[1]+1)*e[2]:+e[2]),c}]};function Sb(){return setTimeout(function(){Lb=void 0}),Lb=n.now()}function Tb(a,b){var c,d=0,e={height:a};for(b=b?1:0;4>d;d+=2-b)c=R[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function Ub(a,b,c){for(var d,e=(Rb[b]||[]).concat(Rb["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function Vb(a,b,c){var d,e,f,g,h,i,j,k,l=this,m={},o=a.style,p=a.nodeType&&S(a),q=L.get(a,"fxshow");c.queue||(h=n._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,l.always(function(){l.always(function(){h.unqueued--,n.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[o.overflow,o.overflowX,o.overflowY],j=n.css(a,"display"),k="none"===j?L.get(a,"olddisplay")||tb(a.nodeName):j,"inline"===k&&"none"===n.css(a,"float")&&(o.display="inline-block")),c.overflow&&(o.overflow="hidden",l.always(function(){o.overflow=c.overflow[0],o.overflowX=c.overflow[1],o.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],Nb.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(p?"hide":"show")){if("show"!==e||!q||void 0===q[d])continue;p=!0}m[d]=q&&q[d]||n.style(a,d)}else j=void 0;if(n.isEmptyObject(m))"inline"===("none"===j?tb(a.nodeName):j)&&(o.display=j);else{q?"hidden"in q&&(p=q.hidden):q=L.access(a,"fxshow",{}),f&&(q.hidden=!p),p?n(a).show():l.done(function(){n(a).hide()}),l.done(function(){var b;L.remove(a,"fxshow");for(b in m)n.style(a,b,m[b])});for(d in m)g=Ub(p?q[d]:0,d,l),d in q||(q[d]=g.start,p&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function Wb(a,b){var c,d,e,f,g;for(c in a)if(d=n.camelCase(c),e=b[d],f=a[c],n.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=n.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function Xb(a,b,c){var d,e,f=0,g=Qb.length,h=n.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=Lb||Sb(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:n.extend({},b),opts:n.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:Lb||Sb(),duration:c.duration,tweens:[],createTween:function(b,c){var d=n.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;for(Wb(k,j.opts.specialEasing);g>f;f++)if(d=Qb[f].call(j,a,k,j.opts))return d;return n.map(k,Ub,j),n.isFunction(j.opts.start)&&j.opts.start.call(a,j),n.fx.timer(n.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}n.Animation=n.extend(Xb,{tweener:function(a,b){n.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");for(var c,d=0,e=a.length;e>d;d++)c=a[d],Rb[c]=Rb[c]||[],Rb[c].unshift(b)},prefilter:function(a,b){b?Qb.unshift(a):Qb.push(a)}}),n.speed=function(a,b,c){var d=a&&"object"==typeof a?n.extend({},a):{complete:c||!c&&b||n.isFunction(a)&&a,duration:a,easing:c&&b||b&&!n.isFunction(b)&&b};return d.duration=n.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in n.fx.speeds?n.fx.speeds[d.duration]:n.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){n.isFunction(d.old)&&d.old.call(this),d.queue&&n.dequeue(this,d.queue)},d},n.fn.extend({fadeTo:function(a,b,c,d){return this.filter(S).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=n.isEmptyObject(a),f=n.speed(b,c,d),g=function(){var b=Xb(this,n.extend({},a),f);(e||L.get(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=n.timers,g=L.get(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&Pb.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));(b||!c)&&n.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=L.get(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=n.timers,g=d?d.length:0;for(c.finish=!0,n.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),n.each(["toggle","show","hide"],function(a,b){var c=n.fn[b];n.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(Tb(b,!0),a,d,e)}}),n.each({slideDown:Tb("show"),slideUp:Tb("hide"),slideToggle:Tb("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){n.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),n.timers=[],n.fx.tick=function(){var a,b=0,c=n.timers;for(Lb=n.now();b<c.length;b++)a=c[b],a()||c[b]!==a||c.splice(b--,1);c.length||n.fx.stop(),Lb=void 0},n.fx.timer=function(a){n.timers.push(a),a()?n.fx.start():n.timers.pop()},n.fx.interval=13,n.fx.start=function(){Mb||(Mb=setInterval(n.fx.tick,n.fx.interval))},n.fx.stop=function(){clearInterval(Mb),Mb=null},n.fx.speeds={slow:600,fast:200,_default:400},n.fn.delay=function(a,b){return a=n.fx?n.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},function(){var a=l.createElement("input"),b=l.createElement("select"),c=b.appendChild(l.createElement("option"));a.type="checkbox",k.checkOn=""!==a.value,k.optSelected=c.selected,b.disabled=!0,k.optDisabled=!c.disabled,a=l.createElement("input"),a.value="t",a.type="radio",k.radioValue="t"===a.value}();var Yb,Zb,$b=n.expr.attrHandle;n.fn.extend({attr:function(a,b){return J(this,n.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){n.removeAttr(this,a)})}}),n.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(a&&3!==f&&8!==f&&2!==f)return typeof a.getAttribute===U?n.prop(a,b,c):(1===f&&n.isXMLDoc(a)||(b=b.toLowerCase(),d=n.attrHooks[b]||(n.expr.match.bool.test(b)?Zb:Yb)),void 0===c?d&&"get"in d&&null!==(e=d.get(a,b))?e:(e=n.find.attr(a,b),null==e?void 0:e):null!==c?d&&"set"in d&&void 0!==(e=d.set(a,c,b))?e:(a.setAttribute(b,c+""),c):void n.removeAttr(a,b))
|
4 |
-
},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(E);if(f&&1===a.nodeType)while(c=f[e++])d=n.propFix[c]||c,n.expr.match.bool.test(c)&&(a[d]=!1),a.removeAttribute(c)},attrHooks:{type:{set:function(a,b){if(!k.radioValue&&"radio"===b&&n.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}}}),Zb={set:function(a,b,c){return b===!1?n.removeAttr(a,c):a.setAttribute(c,c),c}},n.each(n.expr.match.bool.source.match(/\w+/g),function(a,b){var c=$b[b]||n.find.attr;$b[b]=function(a,b,d){var e,f;return d||(f=$b[b],$b[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,$b[b]=f),e}});var _b=/^(?:input|select|textarea|button)$/i;n.fn.extend({prop:function(a,b){return J(this,n.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[n.propFix[a]||a]})}}),n.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(a,b,c){var d,e,f,g=a.nodeType;if(a&&3!==g&&8!==g&&2!==g)return f=1!==g||!n.isXMLDoc(a),f&&(b=n.propFix[b]||b,e=n.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){return a.hasAttribute("tabindex")||_b.test(a.nodeName)||a.href?a.tabIndex:-1}}}}),k.optSelected||(n.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null}}),n.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){n.propFix[this.toLowerCase()]=this});var ac=/[\t\r\n\f]/g;n.fn.extend({addClass:function(a){var b,c,d,e,f,g,h="string"==typeof a&&a,i=0,j=this.length;if(n.isFunction(a))return this.each(function(b){n(this).addClass(a.call(this,b,this.className))});if(h)for(b=(a||"").match(E)||[];j>i;i++)if(c=this[i],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(ac," "):" ")){f=0;while(e=b[f++])d.indexOf(" "+e+" ")<0&&(d+=e+" ");g=n.trim(d),c.className!==g&&(c.className=g)}return this},removeClass:function(a){var b,c,d,e,f,g,h=0===arguments.length||"string"==typeof a&&a,i=0,j=this.length;if(n.isFunction(a))return this.each(function(b){n(this).removeClass(a.call(this,b,this.className))});if(h)for(b=(a||"").match(E)||[];j>i;i++)if(c=this[i],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(ac," "):"")){f=0;while(e=b[f++])while(d.indexOf(" "+e+" ")>=0)d=d.replace(" "+e+" "," ");g=a?n.trim(d):"",c.className!==g&&(c.className=g)}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):this.each(n.isFunction(a)?function(c){n(this).toggleClass(a.call(this,c,this.className,b),b)}:function(){if("string"===c){var b,d=0,e=n(this),f=a.match(E)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else(c===U||"boolean"===c)&&(this.className&&L.set(this,"__className__",this.className),this.className=this.className||a===!1?"":L.get(this,"__className__")||"")})},hasClass:function(a){for(var b=" "+a+" ",c=0,d=this.length;d>c;c++)if(1===this[c].nodeType&&(" "+this[c].className+" ").replace(ac," ").indexOf(b)>=0)return!0;return!1}});var bc=/\r/g;n.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=n.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,n(this).val()):a,null==e?e="":"number"==typeof e?e+="":n.isArray(e)&&(e=n.map(e,function(a){return null==a?"":a+""})),b=n.valHooks[this.type]||n.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=n.valHooks[e.type]||n.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(bc,""):null==c?"":c)}}}),n.extend({valHooks:{option:{get:function(a){var b=n.find.attr(a,"value");return null!=b?b:n.trim(n.text(a))}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],!(!c.selected&&i!==e||(k.optDisabled?c.disabled:null!==c.getAttribute("disabled"))||c.parentNode.disabled&&n.nodeName(c.parentNode,"optgroup"))){if(b=n(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=n.makeArray(b),g=e.length;while(g--)d=e[g],(d.selected=n.inArray(d.value,f)>=0)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),n.each(["radio","checkbox"],function(){n.valHooks[this]={set:function(a,b){return n.isArray(b)?a.checked=n.inArray(n(a).val(),b)>=0:void 0}},k.checkOn||(n.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})}),n.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){n.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),n.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}});var cc=n.now(),dc=/\?/;n.parseJSON=function(a){return JSON.parse(a+"")},n.parseXML=function(a){var b,c;if(!a||"string"!=typeof a)return null;try{c=new DOMParser,b=c.parseFromString(a,"text/xml")}catch(d){b=void 0}return(!b||b.getElementsByTagName("parsererror").length)&&n.error("Invalid XML: "+a),b};var ec,fc,gc=/#.*$/,hc=/([?&])_=[^&]*/,ic=/^(.*?):[ \t]*([^\r\n]*)$/gm,jc=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,kc=/^(?:GET|HEAD)$/,lc=/^\/\//,mc=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,nc={},oc={},pc="*/".concat("*");try{fc=location.href}catch(qc){fc=l.createElement("a"),fc.href="",fc=fc.href}ec=mc.exec(fc.toLowerCase())||[];function rc(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(E)||[];if(n.isFunction(c))while(d=f[e++])"+"===d[0]?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function sc(a,b,c,d){var e={},f=a===oc;function g(h){var i;return e[h]=!0,n.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function tc(a,b){var c,d,e=n.ajaxSettings.flatOptions||{};for(c in b)void 0!==b[c]&&((e[c]?a:d||(d={}))[c]=b[c]);return d&&n.extend(!0,a,d),a}function uc(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===d&&(d=a.mimeType||b.getResponseHeader("Content-Type"));if(d)for(e in h)if(h[e]&&h[e].test(d)){i.unshift(e);break}if(i[0]in c)f=i[0];else{for(e in c){if(!i[0]||a.converters[e+" "+i[0]]){f=e;break}g||(g=e)}f=f||g}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function vc(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}n.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:fc,type:"GET",isLocal:jc.test(ec[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":pc,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":n.parseJSON,"text xml":n.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?tc(tc(a,n.ajaxSettings),b):tc(n.ajaxSettings,a)},ajaxPrefilter:rc(nc),ajaxTransport:rc(oc),ajax:function(a,b){"object"==typeof a&&(b=a,a=void 0),b=b||{};var c,d,e,f,g,h,i,j,k=n.ajaxSetup({},b),l=k.context||k,m=k.context&&(l.nodeType||l.jquery)?n(l):n.event,o=n.Deferred(),p=n.Callbacks("once memory"),q=k.statusCode||{},r={},s={},t=0,u="canceled",v={readyState:0,getResponseHeader:function(a){var b;if(2===t){if(!f){f={};while(b=ic.exec(e))f[b[1].toLowerCase()]=b[2]}b=f[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===t?e:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return t||(a=s[c]=s[c]||a,r[a]=b),this},overrideMimeType:function(a){return t||(k.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>t)for(b in a)q[b]=[q[b],a[b]];else v.always(a[v.status]);return this},abort:function(a){var b=a||u;return c&&c.abort(b),x(0,b),this}};if(o.promise(v).complete=p.add,v.success=v.done,v.error=v.fail,k.url=((a||k.url||fc)+"").replace(gc,"").replace(lc,ec[1]+"//"),k.type=b.method||b.type||k.method||k.type,k.dataTypes=n.trim(k.dataType||"*").toLowerCase().match(E)||[""],null==k.crossDomain&&(h=mc.exec(k.url.toLowerCase()),k.crossDomain=!(!h||h[1]===ec[1]&&h[2]===ec[2]&&(h[3]||("http:"===h[1]?"80":"443"))===(ec[3]||("http:"===ec[1]?"80":"443")))),k.data&&k.processData&&"string"!=typeof k.data&&(k.data=n.param(k.data,k.traditional)),sc(nc,k,b,v),2===t)return v;i=k.global,i&&0===n.active++&&n.event.trigger("ajaxStart"),k.type=k.type.toUpperCase(),k.hasContent=!kc.test(k.type),d=k.url,k.hasContent||(k.data&&(d=k.url+=(dc.test(d)?"&":"?")+k.data,delete k.data),k.cache===!1&&(k.url=hc.test(d)?d.replace(hc,"$1_="+cc++):d+(dc.test(d)?"&":"?")+"_="+cc++)),k.ifModified&&(n.lastModified[d]&&v.setRequestHeader("If-Modified-Since",n.lastModified[d]),n.etag[d]&&v.setRequestHeader("If-None-Match",n.etag[d])),(k.data&&k.hasContent&&k.contentType!==!1||b.contentType)&&v.setRequestHeader("Content-Type",k.contentType),v.setRequestHeader("Accept",k.dataTypes[0]&&k.accepts[k.dataTypes[0]]?k.accepts[k.dataTypes[0]]+("*"!==k.dataTypes[0]?", "+pc+"; q=0.01":""):k.accepts["*"]);for(j in k.headers)v.setRequestHeader(j,k.headers[j]);if(k.beforeSend&&(k.beforeSend.call(l,v,k)===!1||2===t))return v.abort();u="abort";for(j in{success:1,error:1,complete:1})v[j](k[j]);if(c=sc(oc,k,b,v)){v.readyState=1,i&&m.trigger("ajaxSend",[v,k]),k.async&&k.timeout>0&&(g=setTimeout(function(){v.abort("timeout")},k.timeout));try{t=1,c.send(r,x)}catch(w){if(!(2>t))throw w;x(-1,w)}}else x(-1,"No Transport");function x(a,b,f,h){var j,r,s,u,w,x=b;2!==t&&(t=2,g&&clearTimeout(g),c=void 0,e=h||"",v.readyState=a>0?4:0,j=a>=200&&300>a||304===a,f&&(u=uc(k,v,f)),u=vc(k,u,v,j),j?(k.ifModified&&(w=v.getResponseHeader("Last-Modified"),w&&(n.lastModified[d]=w),w=v.getResponseHeader("etag"),w&&(n.etag[d]=w)),204===a||"HEAD"===k.type?x="nocontent":304===a?x="notmodified":(x=u.state,r=u.data,s=u.error,j=!s)):(s=x,(a||!x)&&(x="error",0>a&&(a=0))),v.status=a,v.statusText=(b||x)+"",j?o.resolveWith(l,[r,x,v]):o.rejectWith(l,[v,x,s]),v.statusCode(q),q=void 0,i&&m.trigger(j?"ajaxSuccess":"ajaxError",[v,k,j?r:s]),p.fireWith(l,[v,x]),i&&(m.trigger("ajaxComplete",[v,k]),--n.active||n.event.trigger("ajaxStop")))}return v},getJSON:function(a,b,c){return n.get(a,b,c,"json")},getScript:function(a,b){return n.get(a,void 0,b,"script")}}),n.each(["get","post"],function(a,b){n[b]=function(a,c,d,e){return n.isFunction(c)&&(e=e||d,d=c,c=void 0),n.ajax({url:a,type:b,dataType:e,data:c,success:d})}}),n.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){n.fn[b]=function(a){return this.on(b,a)}}),n._evalUrl=function(a){return n.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},n.fn.extend({wrapAll:function(a){var b;return n.isFunction(a)?this.each(function(b){n(this).wrapAll(a.call(this,b))}):(this[0]&&(b=n(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstElementChild)a=a.firstElementChild;return a}).append(this)),this)},wrapInner:function(a){return this.each(n.isFunction(a)?function(b){n(this).wrapInner(a.call(this,b))}:function(){var b=n(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=n.isFunction(a);return this.each(function(c){n(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){n.nodeName(this,"body")||n(this).replaceWith(this.childNodes)}).end()}}),n.expr.filters.hidden=function(a){return a.offsetWidth<=0&&a.offsetHeight<=0},n.expr.filters.visible=function(a){return!n.expr.filters.hidden(a)};var wc=/%20/g,xc=/\[\]$/,yc=/\r?\n/g,zc=/^(?:submit|button|image|reset|file)$/i,Ac=/^(?:input|select|textarea|keygen)/i;function Bc(a,b,c,d){var e;if(n.isArray(b))n.each(b,function(b,e){c||xc.test(a)?d(a,e):Bc(a+"["+("object"==typeof e?b:"")+"]",e,c,d)});else if(c||"object"!==n.type(b))d(a,b);else for(e in b)Bc(a+"["+e+"]",b[e],c,d)}n.param=function(a,b){var c,d=[],e=function(a,b){b=n.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=n.ajaxSettings&&n.ajaxSettings.traditional),n.isArray(a)||a.jquery&&!n.isPlainObject(a))n.each(a,function(){e(this.name,this.value)});else for(c in a)Bc(c,a[c],b,e);return d.join("&").replace(wc,"+")},n.fn.extend({serialize:function(){return n.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=n.prop(this,"elements");return a?n.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!n(this).is(":disabled")&&Ac.test(this.nodeName)&&!zc.test(a)&&(this.checked||!T.test(a))}).map(function(a,b){var c=n(this).val();return null==c?null:n.isArray(c)?n.map(c,function(a){return{name:b.name,value:a.replace(yc,"\r\n")}}):{name:b.name,value:c.replace(yc,"\r\n")}}).get()}}),n.ajaxSettings.xhr=function(){try{return new XMLHttpRequest}catch(a){}};var Cc=0,Dc={},Ec={0:200,1223:204},Fc=n.ajaxSettings.xhr();a.ActiveXObject&&n(a).on("unload",function(){for(var a in Dc)Dc[a]()}),k.cors=!!Fc&&"withCredentials"in Fc,k.ajax=Fc=!!Fc,n.ajaxTransport(function(a){var b;return k.cors||Fc&&!a.crossDomain?{send:function(c,d){var e,f=a.xhr(),g=++Cc;if(f.open(a.type,a.url,a.async,a.username,a.password),a.xhrFields)for(e in a.xhrFields)f[e]=a.xhrFields[e];a.mimeType&&f.overrideMimeType&&f.overrideMimeType(a.mimeType),a.crossDomain||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest");for(e in c)f.setRequestHeader(e,c[e]);b=function(a){return function(){b&&(delete Dc[g],b=f.onload=f.onerror=null,"abort"===a?f.abort():"error"===a?d(f.status,f.statusText):d(Ec[f.status]||f.status,f.statusText,"string"==typeof f.responseText?{text:f.responseText}:void 0,f.getAllResponseHeaders()))}},f.onload=b(),f.onerror=b("error"),b=Dc[g]=b("abort");try{f.send(a.hasContent&&a.data||null)}catch(h){if(b)throw h}},abort:function(){b&&b()}}:void 0}),n.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(a){return n.globalEval(a),a}}}),n.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET")}),n.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(d,e){b=n("<script>").prop({async:!0,charset:a.scriptCharset,src:a.url}).on("load error",c=function(a){b.remove(),c=null,a&&e("error"===a.type?404:200,a.type)}),l.head.appendChild(b[0])},abort:function(){c&&c()}}}});var Gc=[],Hc=/(=)\?(?=&|$)|\?\?/;n.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=Gc.pop()||n.expando+"_"+cc++;return this[a]=!0,a}}),n.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(Hc.test(b.url)?"url":"string"==typeof b.data&&!(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&Hc.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=n.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(Hc,"$1"+e):b.jsonp!==!1&&(b.url+=(dc.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||n.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,Gc.push(e)),g&&n.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),n.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||l;var d=v.exec(a),e=!c&&[];return d?[b.createElement(d[1])]:(d=n.buildFragment([a],b,e),e&&e.length&&n(e).remove(),n.merge([],d.childNodes))};var Ic=n.fn.load;n.fn.load=function(a,b,c){if("string"!=typeof a&&Ic)return Ic.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>=0&&(d=n.trim(a.slice(h)),a=a.slice(0,h)),n.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(e="POST"),g.length>0&&n.ajax({url:a,type:e,dataType:"html",data:b}).done(function(a){f=arguments,g.html(d?n("<div>").append(n.parseHTML(a)).find(d):a)}).complete(c&&function(a,b){g.each(c,f||[a.responseText,b,a])}),this},n.expr.filters.animated=function(a){return n.grep(n.timers,function(b){return a===b.elem}).length};var Jc=a.document.documentElement;function Kc(a){return n.isWindow(a)?a:9===a.nodeType&&a.defaultView}n.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=n.css(a,"position"),l=n(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=n.css(a,"top"),i=n.css(a,"left"),j=("absolute"===k||"fixed"===k)&&(f+i).indexOf("auto")>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),n.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},n.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){n.offset.setOffset(this,a,b)});var b,c,d=this[0],e={top:0,left:0},f=d&&d.ownerDocument;if(f)return b=f.documentElement,n.contains(b,d)?(typeof d.getBoundingClientRect!==U&&(e=d.getBoundingClientRect()),c=Kc(f),{top:e.top+c.pageYOffset-b.clientTop,left:e.left+c.pageXOffset-b.clientLeft}):e},position:function(){if(this[0]){var a,b,c=this[0],d={top:0,left:0};return"fixed"===n.css(c,"position")?b=c.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),n.nodeName(a[0],"html")||(d=a.offset()),d.top+=n.css(a[0],"borderTopWidth",!0),d.left+=n.css(a[0],"borderLeftWidth",!0)),{top:b.top-d.top-n.css(c,"marginTop",!0),left:b.left-d.left-n.css(c,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||Jc;while(a&&!n.nodeName(a,"html")&&"static"===n.css(a,"position"))a=a.offsetParent;return a||Jc})}}),n.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(b,c){var d="pageYOffset"===c;n.fn[b]=function(e){return J(this,function(b,e,f){var g=Kc(b);return void 0===f?g?g[c]:b[e]:void(g?g.scrollTo(d?a.pageXOffset:f,d?f:a.pageYOffset):b[e]=f)},b,e,arguments.length,null)}}),n.each(["top","left"],function(a,b){n.cssHooks[b]=yb(k.pixelPosition,function(a,c){return c?(c=xb(a,b),vb.test(c)?n(a).position()[b]+"px":c):void 0})}),n.each({Height:"height",Width:"width"},function(a,b){n.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){n.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return J(this,function(b,c,d){var e;return n.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?n.css(b,c,g):n.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),n.fn.size=function(){return this.length},n.fn.andSelf=n.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return n});var Lc=a.jQuery,Mc=a.$;return n.noConflict=function(b){return a.$===n&&(a.$=Mc),b&&a.jQuery===n&&(a.jQuery=Lc),n},typeof b===U&&(a.jQuery=a.$=n),n});
|
5 |
-
//# sourceMappingURL=jquery.min.map
|
|
|
|
|
|
|
|
|
|
includes/libraries/bxslider-4/docs_src/assets/vendors/jquery.min.map
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
{"version":3,"file":"jquery.min.js","sources":["jquery.js"],"names":["global","factory","module","exports","document","w","Error","window","this","noGlobal","arr","slice","concat","push","indexOf","class2type","toString","hasOwn","hasOwnProperty","support","version","jQuery","selector","context","fn","init","rtrim","rmsPrefix","rdashAlpha","fcamelCase","all","letter","toUpperCase","prototype","jquery","constructor","length","toArray","call","get","num","pushStack","elems","ret","merge","prevObject","each","callback","args","map","elem","i","apply","arguments","first","eq","last","len","j","end","sort","splice","extend","options","name","src","copy","copyIsArray","clone","target","deep","isFunction","isPlainObject","isArray","undefined","expando","Math","random","replace","isReady","error","msg","noop","obj","type","Array","isWindow","isNumeric","parseFloat","nodeType","isEmptyObject","globalEval","code","script","indirect","eval","trim","createElement","text","head","appendChild","parentNode","removeChild","camelCase","string","nodeName","toLowerCase","value","isArraylike","makeArray","results","Object","inArray","second","grep","invert","callbackInverse","matches","callbackExpect","arg","guid","proxy","tmp","now","Date","split","Sizzle","Expr","getText","isXML","tokenize","compile","select","outermostContext","sortInput","hasDuplicate","setDocument","docElem","documentIsHTML","rbuggyQSA","rbuggyMatches","contains","preferredDoc","dirruns","done","classCache","createCache","tokenCache","compilerCache","sortOrder","a","b","strundefined","MAX_NEGATIVE","pop","push_native","booleans","whitespace","characterEncoding","identifier","attributes","pseudos","RegExp","rcomma","rcombinators","rattributeQuotes","rpseudo","ridentifier","matchExpr","ID","CLASS","TAG","ATTR","PSEUDO","CHILD","bool","needsContext","rinputs","rheader","rnative","rquickExpr","rsibling","rescape","runescape","funescape","_","escaped","escapedWhitespace","high","String","fromCharCode","childNodes","e","els","seed","match","m","groups","old","nid","newContext","newSelector","ownerDocument","exec","getElementById","id","getElementsByTagName","getElementsByClassName","qsa","test","getAttribute","setAttribute","toSelector","testContext","join","querySelectorAll","qsaError","removeAttribute","keys","cache","key","cacheLength","shift","markFunction","assert","div","addHandle","attrs","handler","attrHandle","siblingCheck","cur","diff","sourceIndex","nextSibling","createInputPseudo","createButtonPseudo","createPositionalPseudo","argument","matchIndexes","documentElement","node","hasCompare","doc","parent","defaultView","top","addEventListener","attachEvent","className","createComment","innerHTML","firstChild","getById","getElementsByName","find","filter","attrId","getAttributeNode","tag","input","matchesSelector","webkitMatchesSelector","mozMatchesSelector","oMatchesSelector","msMatchesSelector","disconnectedMatch","compareDocumentPosition","adown","bup","compare","sortDetached","aup","ap","bp","unshift","expr","elements","attr","val","specified","uniqueSort","duplicates","detectDuplicates","sortStable","textContent","nodeValue","selectors","createPseudo","relative",">","dir"," ","+","~","preFilter","excess","unquoted","nodeNameSelector","pattern","operator","check","result","what","simple","forward","ofType","xml","outerCache","nodeIndex","start","useCache","lastChild","pseudo","setFilters","idx","matched","not","matcher","unmatched","has","innerText","lang","elemLang","hash","location","root","focus","activeElement","hasFocus","href","tabIndex","enabled","disabled","checked","selected","selectedIndex","empty","header","button","even","odd","lt","gt","radio","checkbox","file","password","image","submit","reset","filters","parseOnly","tokens","soFar","preFilters","cached","addCombinator","combinator","base","checkNonElements","doneName","oldCache","newCache","elementMatcher","matchers","multipleContexts","contexts","condense","newUnmatched","mapped","setMatcher","postFilter","postFinder","postSelector","temp","preMap","postMap","preexisting","matcherIn","matcherOut","matcherFromTokens","checkContext","leadingRelative","implicitRelative","matchContext","matchAnyContext","matcherFromGroupMatchers","elementMatchers","setMatchers","bySet","byElement","superMatcher","outermost","matchedCount","setMatched","contextBackup","dirrunsUnique","token","compiled","div1","defaultValue","unique","isXMLDoc","rneedsContext","rsingleTag","risSimple","winnow","qualifier","self","is","rootjQuery","parseHTML","ready","rparentsprev","guaranteedUnique","children","contents","next","prev","until","truncate","sibling","n","targets","l","closest","pos","index","prevAll","add","addBack","parents","parentsUntil","nextAll","nextUntil","prevUntil","siblings","contentDocument","reverse","rnotwhite","optionsCache","createOptions","object","flag","Callbacks","memory","fired","firing","firingStart","firingLength","firingIndex","list","stack","once","fire","data","stopOnFalse","disable","remove","lock","locked","fireWith","Deferred","func","tuples","state","promise","always","deferred","fail","then","fns","newDefer","tuple","returned","resolve","reject","progress","notify","pipe","stateString","when","subordinate","resolveValues","remaining","updateFunc","values","progressValues","notifyWith","resolveWith","progressContexts","resolveContexts","readyList","readyWait","holdReady","hold","wait","triggerHandler","off","completed","removeEventListener","readyState","setTimeout","access","chainable","emptyGet","raw","bulk","acceptData","owner","Data","defineProperty","uid","accepts","descriptor","unlock","defineProperties","set","prop","stored","camel","hasData","discard","data_priv","data_user","rbrace","rmultiDash","dataAttr","parseJSON","removeData","_data","_removeData","camelKey","queue","dequeue","startLength","hooks","_queueHooks","stop","setter","clearQueue","count","defer","pnum","source","cssExpand","isHidden","el","css","rcheckableType","fragment","createDocumentFragment","checkClone","cloneNode","noCloneChecked","focusinBubbles","rkeyEvent","rmouseEvent","rfocusMorph","rtypenamespace","returnTrue","returnFalse","safeActiveElement","err","event","types","handleObjIn","eventHandle","events","t","handleObj","special","handlers","namespaces","origType","elemData","handle","triggered","dispatch","delegateType","bindType","namespace","delegateCount","setup","mappedTypes","origCount","teardown","removeEvent","trigger","onlyHandlers","bubbleType","ontype","eventPath","Event","isTrigger","namespace_re","noBubble","parentWindow","isPropagationStopped","preventDefault","isDefaultPrevented","_default","fix","handlerQueue","delegateTarget","preDispatch","currentTarget","isImmediatePropagationStopped","stopPropagation","postDispatch","sel","props","fixHooks","keyHooks","original","which","charCode","keyCode","mouseHooks","eventDoc","body","pageX","clientX","scrollLeft","clientLeft","pageY","clientY","scrollTop","clientTop","originalEvent","fixHook","load","blur","click","beforeunload","returnValue","simulate","bubble","isSimulated","defaultPrevented","timeStamp","stopImmediatePropagation","mouseenter","mouseleave","pointerenter","pointerleave","orig","related","relatedTarget","attaches","on","one","origFn","rxhtmlTag","rtagName","rhtml","rnoInnerhtml","rchecked","rscriptType","rscriptTypeMasked","rcleanScript","wrapMap","option","thead","col","tr","td","optgroup","tbody","tfoot","colgroup","caption","th","manipulationTarget","content","disableScript","restoreScript","setGlobalEval","refElements","cloneCopyEvent","dest","pdataOld","pdataCur","udataOld","udataCur","getAll","fixInput","dataAndEvents","deepDataAndEvents","srcElements","destElements","inPage","buildFragment","scripts","selection","wrap","nodes","createTextNode","cleanData","append","domManip","prepend","insertBefore","before","after","keepData","html","replaceWith","replaceChild","detach","hasScripts","iNoClone","_evalUrl","appendTo","prependTo","insertAfter","replaceAll","insert","iframe","elemdisplay","actualDisplay","style","display","getDefaultComputedStyle","defaultDisplay","write","close","rmargin","rnumnonpx","getStyles","getComputedStyle","curCSS","computed","width","minWidth","maxWidth","getPropertyValue","addGetHookIf","conditionFn","hookFn","pixelPositionVal","boxSizingReliableVal","container","backgroundClip","clearCloneStyle","cssText","computePixelPositionAndBoxSizingReliable","divStyle","pixelPosition","boxSizingReliable","reliableMarginRight","marginDiv","marginRight","swap","rdisplayswap","rnumsplit","rrelNum","cssShow","position","visibility","cssNormalTransform","letterSpacing","fontWeight","cssPrefixes","vendorPropName","capName","origName","setPositiveNumber","subtract","max","augmentWidthOrHeight","extra","isBorderBox","styles","getWidthOrHeight","valueIsBorderBox","offsetWidth","offsetHeight","showHide","show","hidden","cssHooks","opacity","cssNumber","columnCount","fillOpacity","flexGrow","flexShrink","lineHeight","order","orphans","widows","zIndex","zoom","cssProps","float","margin","padding","border","prefix","suffix","expand","expanded","parts","hide","toggle","Tween","easing","unit","propHooks","run","percent","eased","duration","step","tween","fx","linear","p","swing","cos","PI","fxNow","timerId","rfxtypes","rfxnum","rrun","animationPrefilters","defaultPrefilter","tweeners","*","createTween","scale","maxIterations","createFxNow","genFx","includeWidth","height","animation","collection","opts","oldfire","checkDisplay","anim","dataShow","unqueued","overflow","overflowX","overflowY","propFilter","specialEasing","Animation","properties","stopped","tick","currentTime","startTime","tweens","originalProperties","originalOptions","gotoEnd","rejectWith","timer","complete","tweener","prefilter","speed","opt","speeds","fadeTo","to","animate","optall","doAnimation","finish","stopQueue","timers","cssFn","slideDown","slideUp","slideToggle","fadeIn","fadeOut","fadeToggle","interval","setInterval","clearInterval","slow","fast","delay","time","timeout","clearTimeout","checkOn","optSelected","optDisabled","radioValue","nodeHook","boolHook","removeAttr","nType","attrHooks","propName","attrNames","propFix","getter","rfocusable","removeProp","for","class","notxml","hasAttribute","rclass","addClass","classes","clazz","finalValue","proceed","removeClass","toggleClass","stateVal","classNames","hasClass","rreturn","valHooks","optionSet","hover","fnOver","fnOut","bind","unbind","delegate","undelegate","nonce","rquery","JSON","parse","parseXML","DOMParser","parseFromString","ajaxLocParts","ajaxLocation","rhash","rts","rheaders","rlocalProtocol","rnoContent","rprotocol","rurl","prefilters","transports","allTypes","addToPrefiltersOrTransports","structure","dataTypeExpression","dataType","dataTypes","inspectPrefiltersOrTransports","jqXHR","inspected","seekingTransport","inspect","prefilterOrFactory","dataTypeOrTransport","ajaxExtend","flatOptions","ajaxSettings","ajaxHandleResponses","s","responses","ct","finalDataType","firstDataType","mimeType","getResponseHeader","converters","ajaxConvert","response","isSuccess","conv2","current","conv","responseFields","dataFilter","active","lastModified","etag","url","isLocal","processData","async","contentType","json","* text","text html","text json","text xml","ajaxSetup","settings","ajaxPrefilter","ajaxTransport","ajax","transport","cacheURL","responseHeadersString","responseHeaders","timeoutTimer","fireGlobals","callbackContext","globalEventContext","completeDeferred","statusCode","requestHeaders","requestHeadersNames","strAbort","getAllResponseHeaders","setRequestHeader","lname","overrideMimeType","status","abort","statusText","finalText","success","method","crossDomain","param","traditional","hasContent","ifModified","headers","beforeSend","send","nativeStatusText","modified","getJSON","getScript","throws","wrapAll","firstElementChild","wrapInner","unwrap","visible","r20","rbracket","rCRLF","rsubmitterTypes","rsubmittable","buildParams","v","encodeURIComponent","serialize","serializeArray","xhr","XMLHttpRequest","xhrId","xhrCallbacks","xhrSuccessStatus",1223,"xhrSupported","ActiveXObject","cors","open","username","xhrFields","onload","onerror","responseText","text script","charset","scriptCharset","evt","oldCallbacks","rjsonp","jsonp","jsonpCallback","originalSettings","callbackName","overwritten","responseContainer","jsonProp","keepScripts","parsed","_load","params","animated","getWindow","offset","setOffset","curPosition","curLeft","curCSSTop","curTop","curOffset","curCSSLeft","calculatePosition","curElem","left","using","win","box","getBoundingClientRect","pageYOffset","pageXOffset","offsetParent","parentOffset","scrollTo","Height","Width","defaultExtra","funcName","size","andSelf","define","amd","_jQuery","_$","$","noConflict"],"mappings":";CAcC,SAAUA,EAAQC,GAEK,gBAAXC,SAAiD,gBAAnBA,QAAOC,QAQhDD,OAAOC,QAAUH,EAAOI,SACvBH,EAASD,GAAQ,GACjB,SAAUK,GACT,IAAMA,EAAED,SACP,KAAM,IAAIE,OAAO,2CAElB,OAAOL,GAASI,IAGlBJ,EAASD,IAIS,mBAAXO,QAAyBA,OAASC,KAAM,SAAUD,EAAQE,GAQnE,GAAIC,MAEAC,EAAQD,EAAIC,MAEZC,EAASF,EAAIE,OAEbC,EAAOH,EAAIG,KAEXC,EAAUJ,EAAII,QAEdC,KAEAC,EAAWD,EAAWC,SAEtBC,EAASF,EAAWG,eAEpBC,KAMHf,EAAWG,EAAOH,SAElBgB,EAAU,QAGVC,EAAS,SAAUC,EAAUC,GAG5B,MAAO,IAAIF,GAAOG,GAAGC,KAAMH,EAAUC,IAKtCG,EAAQ,qCAGRC,EAAY,QACZC,EAAa,eAGbC,EAAa,SAAUC,EAAKC,GAC3B,MAAOA,GAAOC,cAGhBX,GAAOG,GAAKH,EAAOY,WAElBC,OAAQd,EAERe,YAAad,EAGbC,SAAU,GAGVc,OAAQ,EAERC,QAAS,WACR,MAAO1B,GAAM2B,KAAM9B,OAKpB+B,IAAK,SAAUC,GACd,MAAc,OAAPA,EAGE,EAANA,EAAUhC,KAAMgC,EAAMhC,KAAK4B,QAAW5B,KAAMgC,GAG9C7B,EAAM2B,KAAM9B,OAKdiC,UAAW,SAAUC,GAGpB,GAAIC,GAAMtB,EAAOuB,MAAOpC,KAAK2B,cAAeO,EAO5C,OAJAC,GAAIE,WAAarC,KACjBmC,EAAIpB,QAAUf,KAAKe,QAGZoB,GA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