Version Description
- Release 2016-10-02
- Complete code rewrite
- Added support for featured image
- Plugin settings clean up
Download this release
Release Info
Developer | mrsztuczkens |
Plugin | jQuery Pin It Button for Images |
Version | 2.00 |
Comparing to | |
See all releases |
Code changes from version 1.60 to 2.00
- css/admin-ad.css +26 -0
- css/admin.css +2 -43
- css/colorbox.css +0 -70
- css/images/border.png +0 -0
- css/images/controls.png +0 -0
- css/images/loading.gif +0 -0
- css/images/loading_background.png +0 -0
- css/images/overlay.png +0 -0
- includes/admin/class-jpibfi-admin-utilities.php +0 -50
- includes/admin/class-jpibfi-admin.php +110 -129
- includes/admin/class-jpibfi-advanced-options.php +0 -110
- includes/admin/class-jpibfi-import-export.php +0 -179
- includes/admin/class-jpibfi-lightbox-options.php +0 -121
- includes/admin/class-jpibfi-options.php +0 -26
- includes/admin/class-jpibfi-selection-options.php +0 -326
- includes/admin/class-jpibfi-visual-options.php +0 -429
- includes/admin/includes/class-jpibfi-ajax-result-builder.php +50 -0
- includes/admin/settings/class-jpibfi-import-export-settings.php +126 -0
- includes/admin/settings/class-jpibfi-selection-settings.php +133 -0
- includes/admin/settings/class-jpibfi-settings-base.php +121 -0
- includes/admin/settings/class-jpibfi-settings-validator.php +69 -0
- includes/admin/settings/class-jpibfi-visual-settings.php +167 -0
- includes/admin/settings/index.php +1 -0
- includes/admin/views/admin.php +0 -38
- includes/class-jpibfi-globals.php +0 -41
- includes/class-jpibfi.php +51 -0
- includes/consts/jpibfi-description-option.php +0 -11
- includes/includes/class-jpibfi-includes.php +21 -0
- includes/includes/class-jpibfi-option-converter.php +169 -0
- includes/{admin/views → includes}/index.php +0 -0
- includes/includes/options/class-jpibfi-options.php +24 -0
- includes/includes/options/class-jpibfi-selection-options.php +23 -0
- includes/includes/options/class-jpibfi-visual-options.php +48 -0
- includes/public/class-jpibfi-client-utilities.php +0 -110
- includes/public/class-jpibfi-client.php +191 -169
- jquery-pin-it-button-for-images.php +6 -67
- js/admin.js +0 -155
- js/jpibfi-ad.admin.js +10 -0
- js/jpibfi.admin.js +9 -0
- js/jpibfi.client.js +1 -0
- js/jpibfi.js +0 -1
- js/jquery.colorbox-min.js +0 -6
- js/upload-button-new.js +0 -38
- js/upload-button-old.js +0 -25
- languages/jquery-pin-it-button-for-images.pot +152 -257
- readme.txt +12 -3
- uninstall.php +2 -5
css/admin-ad.css
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
div.jpibfi-pro-notice {
|
2 |
+
overflow: hidden;
|
3 |
+
margin: 5px 0;
|
4 |
+
}
|
5 |
+
|
6 |
+
div.jpibfi-pro-notice p {
|
7 |
+
display:block;
|
8 |
+
float:left;
|
9 |
+
font-size: 1.3em;
|
10 |
+
font-weight: 600;
|
11 |
+
color: #23282d;
|
12 |
+
margin: 5px 0;
|
13 |
+
}
|
14 |
+
|
15 |
+
div.jpibfi-pro-notice a {
|
16 |
+
color: orange;
|
17 |
+
}
|
18 |
+
|
19 |
+
div.jpibfi-pro-notice span {
|
20 |
+
display:block;
|
21 |
+
float: right;
|
22 |
+
font-size: 1.6em;
|
23 |
+
padding: 2px 10px;
|
24 |
+
margin: 0.6em 0;
|
25 |
+
cursor: pointer;
|
26 |
+
}
|
css/admin.css
CHANGED
@@ -1,46 +1,5 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
display:block;
|
4 |
-
}
|
5 |
-
|
6 |
-
#show_button_error {
|
7 |
-
background-color: white;
|
8 |
-
border-left: 5px solid #dc3232;
|
9 |
-
margin: 7px 0;
|
10 |
-
padding: 5px 0 5px 12px;
|
11 |
-
box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.1);
|
12 |
-
display: none;
|
13 |
-
}
|
14 |
-
|
15 |
-
.jpibfi-error-message {
|
16 |
-
font-weight: bold;
|
17 |
-
color: red;
|
18 |
-
}
|
19 |
-
|
20 |
-
.jpibfi-pro-notice {
|
21 |
-
overflow: hidden;
|
22 |
-
}
|
23 |
-
|
24 |
-
.jpibfi-pro-notice p {
|
25 |
-
display:block;
|
26 |
-
float:left;
|
27 |
-
font-size: 1.3em;
|
28 |
-
font-weight: 600;
|
29 |
-
color: #23282d;
|
30 |
-
margin: 0.8em 0;
|
31 |
-
}
|
32 |
-
|
33 |
-
.jpibfi-pro-notice a {
|
34 |
-
color: orange;
|
35 |
-
}
|
36 |
-
|
37 |
-
.jpibfi-pro-notice span {
|
38 |
-
display:block;
|
39 |
-
float: right;
|
40 |
-
font-size: 1.6em;
|
41 |
-
padding: 2px 10px;
|
42 |
-
margin: 0.6em 0;
|
43 |
-
cursor: pointer;
|
44 |
}
|
45 |
|
46 |
input[type="checkbox"] ~ label {
|
1 |
+
.frizzly-sortable li {
|
2 |
+
cursor: move;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
}
|
4 |
|
5 |
input[type="checkbox"] ~ label {
|
css/colorbox.css
DELETED
@@ -1,70 +0,0 @@
|
|
1 |
-
/*
|
2 |
-
Colorbox Core Style:
|
3 |
-
The following CSS is consistent between example themes and should not be altered.
|
4 |
-
*/
|
5 |
-
#colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden; -webkit-transform: translate3d(0,0,0);}
|
6 |
-
#cboxWrapper {max-width:none;}
|
7 |
-
#cboxOverlay{position:fixed; width:100%; height:100%;}
|
8 |
-
#cboxMiddleLeft, #cboxBottomLeft{clear:left;}
|
9 |
-
#cboxContent{position:relative;}
|
10 |
-
#cboxLoadedContent{overflow:auto; -webkit-overflow-scrolling: touch;}
|
11 |
-
#cboxTitle{margin:0;}
|
12 |
-
#cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%; height:100%;}
|
13 |
-
#cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;}
|
14 |
-
.cboxPhoto{float:left; margin:auto; border:0; display:block; max-width:none; -ms-interpolation-mode:bicubic;}
|
15 |
-
.cboxIframe{width:100%; height:100%; display:block; border:0; padding:0; margin:0;}
|
16 |
-
#colorbox, #cboxContent, #cboxLoadedContent{box-sizing:content-box; -moz-box-sizing:content-box; -webkit-box-sizing:content-box;}
|
17 |
-
|
18 |
-
/*
|
19 |
-
User Style:
|
20 |
-
Change the following styles to modify the appearance of Colorbox. They are
|
21 |
-
ordered & tabbed in a way that represents the nesting of the generated HTML.
|
22 |
-
*/
|
23 |
-
#cboxOverlay{background:url(images/overlay.png) repeat 0 0;}
|
24 |
-
#colorbox{outline:0;}
|
25 |
-
#cboxTopLeft{width:21px; height:21px; background:url(images/controls.png) no-repeat -101px 0;}
|
26 |
-
#cboxTopRight{width:21px; height:21px; background:url(images/controls.png) no-repeat -130px 0;}
|
27 |
-
#cboxBottomLeft{width:21px; height:21px; background:url(images/controls.png) no-repeat -101px -29px;}
|
28 |
-
#cboxBottomRight{width:21px; height:21px; background:url(images/controls.png) no-repeat -130px -29px;}
|
29 |
-
#cboxMiddleLeft{width:21px; background:url(images/controls.png) left top repeat-y;}
|
30 |
-
#cboxMiddleRight{width:21px; background:url(images/controls.png) right top repeat-y;}
|
31 |
-
#cboxTopCenter{height:21px; background:url(images/border.png) 0 0 repeat-x;}
|
32 |
-
#cboxBottomCenter{height:21px; background:url(images/border.png) 0 -29px repeat-x;}
|
33 |
-
#cboxContent{background:#fff; overflow:hidden;}
|
34 |
-
.cboxIframe{background:#fff;}
|
35 |
-
#cboxError{padding:50px; border:1px solid #ccc;}
|
36 |
-
#cboxLoadedContent{margin-bottom:28px;}
|
37 |
-
#cboxTitle{position:absolute; bottom:4px; left:0; text-align:center; width:100%; color:#949494;}
|
38 |
-
#cboxCurrent{position:absolute; bottom:4px; left:58px; color:#949494;}
|
39 |
-
#cboxLoadingOverlay{background:url(images/loading_background.png) no-repeat center center;}
|
40 |
-
#cboxLoadingGraphic{background:url(images/loading.gif) no-repeat center center;}
|
41 |
-
|
42 |
-
/* these elements are buttons, and may need to have additional styles reset to avoid unwanted base styles */
|
43 |
-
#cboxPrevious, #cboxNext, #cboxSlideshow, #cboxClose {border:0; padding:0; margin:0; overflow:visible; width:auto; background:none; }
|
44 |
-
|
45 |
-
/* avoid outlines on :active (mouseclick), but preserve outlines on :focus (tabbed navigating) */
|
46 |
-
#cboxPrevious:active, #cboxNext:active, #cboxSlideshow:active, #cboxClose:active {outline:0;}
|
47 |
-
|
48 |
-
#cboxSlideshow{position:absolute; bottom:4px; right:30px; color:#0092ef;}
|
49 |
-
#cboxPrevious{position:absolute; bottom:0; left:0; background:url(images/controls.png) no-repeat -75px 0; width:25px; height:25px; text-indent:-9999px;}
|
50 |
-
#cboxPrevious:hover{background-position:-75px -25px;}
|
51 |
-
#cboxNext{position:absolute; bottom:0; left:27px; background:url(images/controls.png) no-repeat -50px 0; width:25px; height:25px; text-indent:-9999px;}
|
52 |
-
#cboxNext:hover{background-position:-50px -25px;}
|
53 |
-
#cboxClose{position:absolute; bottom:0; right:0; background:url(images/controls.png) no-repeat -25px 0; width:25px; height:25px; text-indent:-9999px;}
|
54 |
-
#cboxClose:hover{background-position:-25px -25px;}
|
55 |
-
|
56 |
-
/*
|
57 |
-
The following fixes a problem where IE7 and IE8 replace a PNG's alpha transparency with a black fill
|
58 |
-
when an alpha filter (opacity change) is set on the element or ancestor element. This style is not applied to or needed in IE9.
|
59 |
-
See: http://jacklmoore.com/notes/ie-transparency-problems/
|
60 |
-
*/
|
61 |
-
.cboxIE #cboxTopLeft,
|
62 |
-
.cboxIE #cboxTopCenter,
|
63 |
-
.cboxIE #cboxTopRight,
|
64 |
-
.cboxIE #cboxBottomLeft,
|
65 |
-
.cboxIE #cboxBottomCenter,
|
66 |
-
.cboxIE #cboxBottomRight,
|
67 |
-
.cboxIE #cboxMiddleLeft,
|
68 |
-
.cboxIE #cboxMiddleRight {
|
69 |
-
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#00FFFFFF,endColorstr=#00FFFFFF);
|
70 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
css/images/border.png
DELETED
Binary file
|
css/images/controls.png
DELETED
Binary file
|
css/images/loading.gif
DELETED
Binary file
|
css/images/loading_background.png
DELETED
Binary file
|
css/images/overlay.png
DELETED
Binary file
|
includes/admin/class-jpibfi-admin-utilities.php
DELETED
@@ -1,50 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class JPIBFI_Admin_Utilities {
|
4 |
-
|
5 |
-
/* Returns properly formatted description of a setting */
|
6 |
-
public static function create_description( $desc ) {
|
7 |
-
return '<p class="description">' . $desc . '</p>';
|
8 |
-
}
|
9 |
-
|
10 |
-
/* Returns error div if there are errors */
|
11 |
-
public static function create_errors( $setting_name ) {
|
12 |
-
$error = "";
|
13 |
-
|
14 |
-
$errors_array = get_settings_errors( $setting_name );
|
15 |
-
|
16 |
-
if ( count ( $errors_array ) > 0 ) {
|
17 |
-
$error .= '<div class="jpibfi-error-message">';
|
18 |
-
for( $i = 0; $i < count( $errors_array ); $i++ ){
|
19 |
-
$error .= $errors_array[ $i ]['message'] . '</br>';
|
20 |
-
}
|
21 |
-
$error .= '</div>';
|
22 |
-
}
|
23 |
-
|
24 |
-
return $error;
|
25 |
-
}
|
26 |
-
|
27 |
-
/* Checks if value exists in array and if it is of certain value */
|
28 |
-
public static function exists_and_equal_to( $array , $name, $expected_value = "1" ) {
|
29 |
-
return isset( $array[ $name ] ) && $array[ $name ] == $expected_value;
|
30 |
-
}
|
31 |
-
|
32 |
-
/* Checks if given string contains class names separated by semicolons or is empty */
|
33 |
-
public static function contains_css_class_names_or_empty( $str ) {
|
34 |
-
if ( 0 == strlen( $str ) )
|
35 |
-
return true;
|
36 |
-
|
37 |
-
$names = explode( ';', $str );
|
38 |
-
$only_class_names = true;
|
39 |
-
|
40 |
-
for( $i = 0; $i < count( $names ) && $only_class_names; $i++ )
|
41 |
-
$only_class_names = self::is_string_css_class_name( $names [ $i ] );
|
42 |
-
|
43 |
-
return $only_class_names;
|
44 |
-
}
|
45 |
-
|
46 |
-
public static function is_string_css_class_name( $class_name ) {
|
47 |
-
return 1 == preg_match( "/^-?[_a-zA-Z]+[_a-zA-Z0-9-]*$/", $class_name );
|
48 |
-
}
|
49 |
-
|
50 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/admin/class-jpibfi-admin.php
CHANGED
@@ -2,28 +2,56 @@
|
|
2 |
|
3 |
class JPIBFI_Admin {
|
4 |
|
5 |
-
|
|
|
6 |
|
7 |
private $admin_screen_hook = '';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
|
9 |
-
private function __construct() {
|
10 |
add_action( 'admin_menu', array( $this, 'print_admin_page_action') );
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
|
|
|
|
15 |
add_filter( 'plugin_row_meta', array($this, 'plugin_meta_links'), 10, 2 );
|
16 |
add_action( 'wp_ajax_jpibfi_remove_pro_ad', array($this, 'remove_pro_ad') );
|
17 |
}
|
18 |
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
|
25 |
-
|
26 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
|
28 |
public function print_admin_page_action() {
|
29 |
|
@@ -38,125 +66,88 @@ class JPIBFI_Admin {
|
|
38 |
);
|
39 |
}
|
40 |
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
$hooks[] = $this->admin_screen_hook;
|
46 |
-
$hooks[] = 'plugins.php';
|
47 |
-
|
48 |
-
if (!in_array($hook, $hooks))
|
49 |
-
return;
|
50 |
-
|
51 |
-
$is_plugins_php = $hook == 'plugins.php';
|
52 |
|
53 |
-
|
54 |
-
|
|
|
|
|
55 |
|
56 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
$settings['version'] = 'lite';
|
58 |
-
wp_enqueue_script( '
|
59 |
-
wp_localize_script('
|
60 |
-
|
61 |
-
if ($is_plugins_php)
|
62 |
-
return;
|
63 |
|
64 |
if ( function_exists( "wp_enqueue_media") ) {
|
65 |
wp_enqueue_media();
|
66 |
-
wp_enqueue_script( 'jpibfi-upload-new', JPIBFI_Globals::get_plugin_url() . 'js/upload-button-new.js', array(), JPIBFI_Globals::get_file_version(), false );
|
67 |
-
} else {
|
68 |
-
wp_enqueue_script( 'jpibfi-upload-old', JPIBFI_Globals::get_plugin_url() . 'js/upload-button-old.js', array('thickbox', 'media-upload' ), JPIBFI_Globals::get_file_version(), false );
|
69 |
}
|
70 |
-
|
71 |
|
72 |
-
|
73 |
-
|
74 |
|
75 |
-
|
76 |
-
|
|
|
|
|
77 |
}
|
|
|
|
|
|
|
78 |
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
'tab_label' => __( 'Visual', 'jquery-pin-it-button-for-images' ),
|
88 |
-
),
|
89 |
-
'advanced_options' => array(
|
90 |
-
'settings_name' => 'jpibfi_advanced_options',
|
91 |
-
'tab_label' => __('Advanced', 'jquery-pin-it-button-for-images' ),
|
92 |
-
),
|
93 |
-
'import_export' => array(
|
94 |
-
'settings_name' => 'jpibfi_import_export_options',
|
95 |
-
'tab_label' => __('Import/Export', 'jquery-pin-it-button-for-images')
|
96 |
-
),
|
97 |
-
'lightbox' => array(
|
98 |
-
'settings_name' => 'jpibfi_lightbox_options',
|
99 |
-
'tab_label' => __('Lightbox', 'jquery-pin-it-button-for-images')
|
100 |
-
)
|
101 |
-
);
|
102 |
-
|
103 |
-
$settings_tabs = apply_filters( 'jpibfi_settings_tabs', $settings_tabs);
|
104 |
-
|
105 |
-
include_once( 'views/admin.php' );
|
106 |
-
//cumbersome, but needed for error management to work properly in WP 3.3
|
107 |
-
delete_option( JPIBFI_Selection_Options::get_instance()->get_option_name() . '_errors' );
|
108 |
-
delete_option( JPIBFI_Visual_Options::get_instance()->get_option_name() . '_errors' );
|
109 |
}
|
110 |
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
array( $this, 'print_meta_box' ),
|
120 |
-
$pt,
|
121 |
-
'side',
|
122 |
-
'default'
|
123 |
-
);
|
124 |
}
|
125 |
-
|
126 |
-
|
127 |
-
/* Displays the meta box */
|
128 |
-
public function print_meta_box( $post, $metabox ) {
|
129 |
-
|
130 |
-
wp_nonce_field( plugin_basename( __FILE__ ), 'jpibfi_nonce' );
|
131 |
-
|
132 |
-
$post_meta = get_post_meta( $post->ID, 'jpibfi_meta', true );
|
133 |
-
$checked = isset( $post_meta ) && isset( $post_meta['jpibfi_disable_for_post'] ) && $post_meta['jpibfi_disable_for_post'] == '1';
|
134 |
-
|
135 |
-
echo '<input type="checkbox" id="jpibfi_disable_for_post" name="jpibfi_disable_for_post" value="1"' . checked( $checked, true, false ) . '>';
|
136 |
-
echo '<label for="jpibfi_disable_for_post">' . __( 'Disable "Pin it" button for this post (works only on single pages/posts)', 'jquery-pin-it-button-for-images' ) . '</label><br />';
|
137 |
-
}
|
138 |
-
|
139 |
-
public function save_meta_data( $post_id ) {
|
140 |
-
|
141 |
-
//check user's permissions and autosave
|
142 |
-
if ( ! current_user_can( 'edit_post', $post_id ) || (defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE) )
|
143 |
-
return;
|
144 |
-
|
145 |
-
// security check = updating possible only using post edit form
|
146 |
-
if ( !isset( $_POST['jpibfi_nonce'] ) || ! wp_verify_nonce( $_POST['jpibfi_nonce'], plugin_basename( __FILE__ ) ) )
|
147 |
-
return;
|
148 |
-
|
149 |
-
$post_meta = array( 'jpibfi_disable_for_post' => '0' );
|
150 |
-
// now store data in custom fields based on checkboxes selected
|
151 |
-
$post_meta['jpibfi_disable_for_post'] = isset( $_POST['jpibfi_disable_for_post'] ) && $_POST['jpibfi_disable_for_post'] == '1' ? '1' : '0';
|
152 |
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
|
159 |
-
function
|
160 |
global $hook_suffix;
|
161 |
$hooks = array();
|
162 |
$hooks[] = $this->admin_screen_hook;
|
@@ -176,14 +167,9 @@ class JPIBFI_Admin {
|
|
176 |
}
|
177 |
|
178 |
function plugin_meta_links( $links, $file ) {
|
179 |
-
$
|
180 |
-
$plugin = plugin_basename($basefile);
|
181 |
-
// create link
|
182 |
if ( $file == $plugin ) {
|
183 |
-
return array_merge(
|
184 |
-
$links,
|
185 |
-
array( '<a href="http://mrsztuczkens.me/jpibfi-pro/">jQuery Pin It Button for Images Pro</a>' )
|
186 |
-
);
|
187 |
}
|
188 |
return $links;
|
189 |
}
|
@@ -192,9 +178,4 @@ class JPIBFI_Admin {
|
|
192 |
delete_option('jpibfi_pro_ad');
|
193 |
wp_die();
|
194 |
}
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
}
|
199 |
-
|
200 |
-
add_action( 'plugins_loaded', array( 'JPIBFI_Admin', 'get_instance' ) );
|
2 |
|
3 |
class JPIBFI_Admin {
|
4 |
|
5 |
+
private $file;
|
6 |
+
private $version;
|
7 |
|
8 |
private $admin_screen_hook = '';
|
9 |
+
private $import_export_settings;
|
10 |
+
private $selection_settings;
|
11 |
+
private $visual_settings;
|
12 |
+
|
13 |
+
function __construct($file, $version) {
|
14 |
+
$this->file = $file;
|
15 |
+
$this->version = $version;
|
16 |
+
|
17 |
+
$this->load_dependencies();
|
18 |
+
$this->init_settings();
|
19 |
|
|
|
20 |
add_action( 'admin_menu', array( $this, 'print_admin_page_action') );
|
21 |
+
add_action( 'admin_enqueue_scripts', array($this, 'add_admin_scripts') );
|
22 |
+
|
23 |
+
$jpibfi_plugin = plugin_basename( $this->file );
|
24 |
+
add_filter( "plugin_action_links_$jpibfi_plugin", array( $this, 'add_settings_link' ) );
|
25 |
+
add_action( 'admin_notices', array( $this, 'show_lightbox_ad' ), 11 );
|
26 |
+
add_action( 'admin_notices', array( $this, 'show_pro_ad') );
|
27 |
add_filter( 'plugin_row_meta', array($this, 'plugin_meta_links'), 10, 2 );
|
28 |
add_action( 'wp_ajax_jpibfi_remove_pro_ad', array($this, 'remove_pro_ad') );
|
29 |
}
|
30 |
|
31 |
+
function add_settings_link( $links ) {
|
32 |
+
$settings_link = '<a href="options-general.php?page=jpibfi_settings">' . __( 'Settings', 'jquery-pin-it-button-for-images' ) . '</a>';
|
33 |
+
array_unshift( $links, $settings_link );
|
34 |
+
return $links;
|
35 |
+
}
|
36 |
|
37 |
+
private function load_dependencies(){
|
38 |
+
$deps = array(
|
39 |
+
'includes/class-jpibfi-ajax-result-builder.php',
|
40 |
+
'settings/class-jpibfi-settings-base.php',
|
41 |
+
'settings/class-jpibfi-settings-validator.php',
|
42 |
+
'settings/class-jpibfi-import-export-settings.php',
|
43 |
+
'settings/class-jpibfi-selection-settings.php',
|
44 |
+
'settings/class-jpibfi-visual-settings.php'
|
45 |
+
);
|
46 |
+
foreach ($deps as $dep)
|
47 |
+
require_once $dep;
|
48 |
+
}
|
49 |
+
|
50 |
+
private function init_settings(){
|
51 |
+
$this->import_export_settings = new JPIBFI_Import_Export_Settings();
|
52 |
+
$this->selection_settings = new JPIBFI_Selection_Settings();
|
53 |
+
$this->visual_settings = new JPIBFI_Visual_Settings();
|
54 |
+
}
|
55 |
|
56 |
public function print_admin_page_action() {
|
57 |
|
66 |
);
|
67 |
}
|
68 |
|
69 |
+
public function add_admin_scripts($hook) {
|
70 |
+
if ($this->admin_screen_hook === $hook) {
|
71 |
+
$this->add_settings_scripts();
|
72 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
73 |
|
74 |
+
if ('plugins.php' === $hook) {
|
75 |
+
$this->add_remove_ad_scripts();
|
76 |
+
}
|
77 |
+
}
|
78 |
|
79 |
+
private function add_settings_scripts() {
|
80 |
+
$plugin_dir_url = plugin_dir_url($this->file);
|
81 |
+
|
82 |
+
wp_enqueue_style( 'jquery-pin-it-button-admin-style', $plugin_dir_url . 'css/admin.css', array(), $this->version, 'all' );
|
83 |
+
wp_enqueue_style( 'jpibfi-ad', $plugin_dir_url . 'css/admin-ad.css', array(), $this->version, 'all' );
|
84 |
+
|
85 |
+
$slug = isset( $_GET[ 'tab' ] ) ? $_GET[ 'tab' ] : 'select';
|
86 |
+
$settings = array (
|
87 |
+
'ajax' => apply_filters('jpibfi_settings_ajax', array (
|
88 |
+
'url' => admin_url( 'admin-ajax.php' ),
|
89 |
+
'tab' => $slug,
|
90 |
+
)),
|
91 |
+
'tabs' => $this->get_sorted_tabs(),
|
92 |
+
'currentTab' => $slug,
|
93 |
+
'page' => 'jpibfi_settings',
|
94 |
+
'settings' => apply_filters( 'jpibfi_settings_configuration_' . $slug, array()),
|
95 |
+
'i18n' => array (
|
96 |
+
'editor' => apply_filters( 'jpibfi_settings_i18n_' . $slug, array('submit' => __('Save Changes', 'jquery-pin-it-button-for-images'))),
|
97 |
+
'status' => array (
|
98 |
+
'pending' => __('Saving changes ...', 'jquery-pin-it-button-for-images'),
|
99 |
+
),
|
100 |
+
),
|
101 |
+
);
|
102 |
$settings['version'] = 'lite';
|
103 |
+
wp_enqueue_script( 'jpibfi', $plugin_dir_url . 'js/jpibfi.admin.js', array( 'jquery' ), $this->version, false );
|
104 |
+
wp_localize_script('jpibfi', 'jpibfi_settings', $settings);
|
|
|
|
|
|
|
105 |
|
106 |
if ( function_exists( "wp_enqueue_media") ) {
|
107 |
wp_enqueue_media();
|
|
|
|
|
|
|
108 |
}
|
109 |
+
}
|
110 |
|
111 |
+
private function get_sorted_tabs(){
|
112 |
+
$settings_tabs = apply_filters('jpibfi_settings_tabs', array());
|
113 |
|
114 |
+
/* order tabs by priority */
|
115 |
+
$priority = array();
|
116 |
+
foreach ($settings_tabs as $key => $tab){
|
117 |
+
$priority[$key] = $tab['priority'];
|
118 |
}
|
119 |
+
array_multisort($priority, SORT_ASC, $settings_tabs);
|
120 |
+
return $settings_tabs;
|
121 |
+
}
|
122 |
|
123 |
+
public function print_admin_page() {
|
124 |
+
?>
|
125 |
+
<div ng-app="app" class="wrap">
|
126 |
+
<h2><?php _e( 'jQuery Pin It Button For Images Options', 'jquery-pin-it-button-for-images' ); ?></h2>
|
127 |
+
<div id="icon-plugins" class="icon32"></div>
|
128 |
+
<app settings-name="jpibfi_settings"></app>
|
129 |
+
</div>
|
130 |
+
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
131 |
}
|
132 |
|
133 |
+
public function show_lightbox_ad() {
|
134 |
+
global $hook_suffix;
|
135 |
+
if ( $hook_suffix === $this->admin_screen_hook ) {
|
136 |
+
?>
|
137 |
+
<div class="updated jpibfi-pro-notice">
|
138 |
+
<p><?php echo sprintf(__('Lightbox feature has been transferred to another plugin. Click <a target="_blank" href="%s">here</a> to learn more.', 'jquery-pin-it-button-for-images'), 'http://bit.ly/2cXnS2D'); ?></p>
|
139 |
+
</div>
|
140 |
+
<?php
|
|
|
|
|
|
|
|
|
|
|
141 |
}
|
142 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
143 |
|
144 |
+
private function add_remove_ad_scripts() {
|
145 |
+
$plugin_dir_url = plugin_dir_url($this->file);
|
146 |
+
wp_enqueue_style( 'jpibfi-ad', $plugin_dir_url . 'css/admin-ad.css', array(), $this->version, 'all' );
|
147 |
+
wp_enqueue_script( 'jpibfi-ad', $plugin_dir_url . 'js/jpibfi-ad.admin.js', array( 'jquery' ), $this->version, false );
|
148 |
+
}
|
149 |
|
150 |
+
function show_pro_ad() {
|
151 |
global $hook_suffix;
|
152 |
$hooks = array();
|
153 |
$hooks[] = $this->admin_screen_hook;
|
167 |
}
|
168 |
|
169 |
function plugin_meta_links( $links, $file ) {
|
170 |
+
$plugin = plugin_basename($this->file);
|
|
|
|
|
171 |
if ( $file == $plugin ) {
|
172 |
+
return array_merge($links, array( '<a href="http://mrsztuczkens.me/jpibfi-pro/">jQuery Pin It Button for Images Pro</a>' ));
|
|
|
|
|
|
|
173 |
}
|
174 |
return $links;
|
175 |
}
|
178 |
delete_option('jpibfi_pro_ad');
|
179 |
wp_die();
|
180 |
}
|
181 |
+
}
|
|
|
|
|
|
|
|
|
|
includes/admin/class-jpibfi-advanced-options.php
DELETED
@@ -1,110 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class JPIBFI_Advanced_Options extends JPIBFI_Options {
|
4 |
-
|
5 |
-
protected static $instance = null;
|
6 |
-
|
7 |
-
protected $admin_advanced_options = null;
|
8 |
-
|
9 |
-
private function __construct() {
|
10 |
-
add_action( 'admin_init', array( $this, 'initialize_advanced_options' ) );
|
11 |
-
}
|
12 |
-
|
13 |
-
public static function get_instance() {
|
14 |
-
// If the single instance hasn't been set, set it now.
|
15 |
-
if ( null == self::$instance ) {
|
16 |
-
self::$instance = new self;
|
17 |
-
}
|
18 |
-
|
19 |
-
return self::$instance;
|
20 |
-
}
|
21 |
-
|
22 |
-
function get_default_options(){
|
23 |
-
$defaults = array(
|
24 |
-
'debug' => '0',
|
25 |
-
'container_selector' => 'div'
|
26 |
-
);
|
27 |
-
|
28 |
-
return apply_filters( 'jpibfi_default_advanced_options', $defaults );
|
29 |
-
}
|
30 |
-
|
31 |
-
static function get_option_name(){
|
32 |
-
return 'jpibfi_advanced_options';
|
33 |
-
}
|
34 |
-
|
35 |
-
/* Defines selection options section and adds all required fields */
|
36 |
-
public function initialize_advanced_options() {
|
37 |
-
|
38 |
-
// First, we register a section.
|
39 |
-
add_settings_section(
|
40 |
-
'advanced_options_section',
|
41 |
-
__( 'Advanced Settings', 'jquery-pin-it-button-for-images' ),
|
42 |
-
array( $this, 'advanced_options_callback' ),
|
43 |
-
'jpibfi_advanced_options'
|
44 |
-
);
|
45 |
-
|
46 |
-
//lThen add all necessary fields to the section
|
47 |
-
add_settings_field(
|
48 |
-
'debug',
|
49 |
-
__( 'Debug', 'jquery-pin-it-button-for-images' ),
|
50 |
-
array( $this, 'debug_callback' ),
|
51 |
-
'jpibfi_advanced_options',
|
52 |
-
'advanced_options_section',
|
53 |
-
array(
|
54 |
-
__( 'Use debug mode only if you are experiencing some issues with the plugin and you are reporting them to the developer of the plugin', 'jquery-pin-it-button-for-images' ),
|
55 |
-
)
|
56 |
-
);
|
57 |
-
|
58 |
-
add_settings_field(
|
59 |
-
'container_selector',
|
60 |
-
__( 'Container selector', 'jquery-pin-it-button-for-images' ),
|
61 |
-
array( $this, 'container_selector_callback' ),
|
62 |
-
'jpibfi_advanced_options',
|
63 |
-
'advanced_options_section',
|
64 |
-
array(
|
65 |
-
__( 'This is the selector used to find the container that holds the entire single post. It looks for an element that is a parent of the content of the post. Usually it\'s a div or article element. This setting is important to making "Use post url" visual setting work properly.', 'jquery-pin-it-button-for-images' ),
|
66 |
-
)
|
67 |
-
);
|
68 |
-
|
69 |
-
register_setting(
|
70 |
-
'jpibfi_advanced_options',
|
71 |
-
'jpibfi_advanced_options' //no sanitization needed for now
|
72 |
-
);
|
73 |
-
}
|
74 |
-
|
75 |
-
public function advanced_options_callback() {
|
76 |
-
echo '<p>' . __('Advanced settings', 'jquery-pin-it-button-for-images') . '</p>';
|
77 |
-
}
|
78 |
-
|
79 |
-
public function debug_callback( $args ){
|
80 |
-
$options = $this->get_advanced_options();
|
81 |
-
$debug = JPIBFI_Admin_Utilities::exists_and_equal_to( $options, 'debug', '1' );
|
82 |
-
|
83 |
-
echo '<input type="checkbox" id="debug" name="jpibfi_advanced_options[debug]" value="1" ' . checked( "1", $debug, false ) . '>';
|
84 |
-
echo '<label for="debug">' . __( 'Enable debug mode', 'jquery-pin-it-button-for-images' ) . '</label>';
|
85 |
-
|
86 |
-
echo JPIBFI_Admin_Utilities::create_description( $args[0] );
|
87 |
-
}
|
88 |
-
|
89 |
-
public function container_selector_callback( $args ) {
|
90 |
-
$options = $this->get_advanced_options();
|
91 |
-
$container_selector = esc_attr( $options[ 'container_selector' ] );
|
92 |
-
|
93 |
-
echo '<input type="text" id="image_selector" name="jpibfi_advanced_options[container_selector]" value="' . $container_selector . '"/>';
|
94 |
-
echo JPIBFI_Admin_Utilities::create_description( $args[0] );
|
95 |
-
}
|
96 |
-
|
97 |
-
private function get_advanced_options() {
|
98 |
-
$jpibfi_adanced_options = JPIBFI_Advanced_Options::get_instance()->get_options();
|
99 |
-
|
100 |
-
if ( null == $this->admin_advanced_options ) {
|
101 |
-
//cumbersome, but works in WP 3.3
|
102 |
-
$options = get_option( $this->get_option_name() . '_errors' );
|
103 |
-
$this->admin_advanced_options = false == $options ? $jpibfi_adanced_options : $options;
|
104 |
-
}
|
105 |
-
|
106 |
-
return $this->admin_advanced_options;
|
107 |
-
}
|
108 |
-
}
|
109 |
-
|
110 |
-
add_action( 'plugins_loaded', array( 'JPIBFI_Advanced_Options', 'get_instance' ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/admin/class-jpibfi-import-export.php
DELETED
@@ -1,179 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class JPIBFI_Import_Export {
|
4 |
-
|
5 |
-
protected static $instance = null;
|
6 |
-
|
7 |
-
public static function get_instance() {
|
8 |
-
// If the single instance hasn't been set, set it now.
|
9 |
-
if ( null == self::$instance ) {
|
10 |
-
self::$instance = new self;
|
11 |
-
}
|
12 |
-
return self::$instance;
|
13 |
-
}
|
14 |
-
|
15 |
-
private function __construct(){
|
16 |
-
add_filter( 'export_args', array( $this, 'export_args' ) );
|
17 |
-
add_action( 'export_wp', array( $this, 'export_wp' ) );
|
18 |
-
add_action( 'admin_init', array( $this, 'initialize' ) );
|
19 |
-
}
|
20 |
-
|
21 |
-
private function error_message( $message, $details = '' ) {
|
22 |
-
echo '<div class="error notice is-dismissible"><p><strong>' . $message . '</strong>';
|
23 |
-
if ( ! empty( $details ) ) {
|
24 |
-
echo '<br />' . $details;
|
25 |
-
}
|
26 |
-
echo '</p></div>';
|
27 |
-
return false;
|
28 |
-
}
|
29 |
-
|
30 |
-
private function success_message(){
|
31 |
-
echo '<div class="updated notice is-dismissible"><p><strong>';
|
32 |
-
_e('Import successful', 'jquery_pin_it_button_for_images');
|
33 |
-
echo '</strong></p></div>';
|
34 |
-
}
|
35 |
-
|
36 |
-
/**
|
37 |
-
* @param array $args The export args being filtered.
|
38 |
-
* @return array The (possibly modified) export args.
|
39 |
-
*/
|
40 |
-
public function export_args( $args ) {
|
41 |
-
if ( ! empty( $_GET['content'] ) && 'jpibfi' == $_GET['content'] ) {
|
42 |
-
return array( 'jpibfi' => true );
|
43 |
-
}
|
44 |
-
return $args;
|
45 |
-
}
|
46 |
-
|
47 |
-
|
48 |
-
/**
|
49 |
-
* Export options as a JSON file if that's what the user wants to do.
|
50 |
-
*
|
51 |
-
* @param array $args The export arguments.
|
52 |
-
* @return void
|
53 |
-
*/
|
54 |
-
public function export_wp( $args ) {
|
55 |
-
if (empty($args['jpibfi']))
|
56 |
-
return;
|
57 |
-
|
58 |
-
$filename = 'jpibfi_settings_' . date( 'Y-m-d' ) . '.json';
|
59 |
-
|
60 |
-
header( 'Content-Description: File Transfer' );
|
61 |
-
header( 'Content-Disposition: attachment; filename=' . $filename );
|
62 |
-
header( 'Content-Type: application/json; charset=' . get_option( 'blog_charset' ), true );
|
63 |
-
|
64 |
-
$option_names = array();
|
65 |
-
$option_names[] = JPIBFI_Selection_Options::get_option_name();
|
66 |
-
$option_names[] = JPIBFI_Visual_Options::get_option_name();
|
67 |
-
$option_names[] = JPIBFI_Advanced_Options::get_option_name();
|
68 |
-
|
69 |
-
$export_options = array();
|
70 |
-
|
71 |
-
foreach ( $option_names as $option_name ) {
|
72 |
-
|
73 |
-
$option_value = get_option( $option_name );
|
74 |
-
if ( $option_value !== false ) {
|
75 |
-
$export_options[ $option_name ] = maybe_serialize( $option_value );
|
76 |
-
}
|
77 |
-
}
|
78 |
-
$JSON_PRETTY_PRINT = defined( 'JSON_PRETTY_PRINT' ) ? JSON_PRETTY_PRINT : null;
|
79 |
-
echo json_encode( array( 'options' => $export_options ), $JSON_PRETTY_PRINT );
|
80 |
-
exit;
|
81 |
-
}
|
82 |
-
|
83 |
-
public function handle_import(){
|
84 |
-
check_admin_referer( 'import-upload' );
|
85 |
-
$file = wp_import_handle_upload();
|
86 |
-
|
87 |
-
if ( isset( $file['error'] ) ) {
|
88 |
-
return $this->error_message(
|
89 |
-
__( 'Sorry, there has been an error.', 'jquery_pin_it_button_for_images' ),
|
90 |
-
esc_html( $file['error'] )
|
91 |
-
);
|
92 |
-
}
|
93 |
-
|
94 |
-
if ( ! isset( $file['file'], $file['id'] ) ) {
|
95 |
-
return $this->error_message(
|
96 |
-
__( 'Sorry, there has been an error.', 'jquery-pin-it-button-for-images' ),
|
97 |
-
__( 'The file did not upload properly. Please try again.', 'jquery-pin-it-button-for-images' )
|
98 |
-
);
|
99 |
-
}
|
100 |
-
|
101 |
-
if ( ! file_exists( $file['file'] ) ) {
|
102 |
-
wp_import_cleanup( $file['id'] );
|
103 |
-
return $this->error_message(
|
104 |
-
__( 'Sorry, there has been an error.', 'jquery-pin-it-button-for-images' ),
|
105 |
-
sprintf( __( 'The export file could not be found at <code>%s</code>. It is likely that this was caused by a permissions problem.', 'jquery-pin-it-button-for-images' ), esc_html( $file['file'] ) )
|
106 |
-
);
|
107 |
-
}
|
108 |
-
|
109 |
-
if ( ! is_file( $file['file'] ) ) {
|
110 |
-
wp_import_cleanup( $file['id'] );
|
111 |
-
return $this->error_message(
|
112 |
-
__( 'Sorry, there has been an error.', 'jquery-pin-it-button-for-images' ),
|
113 |
-
__( 'The path is not a file, please try again.', 'jquery-pin-it-button-for-images' )
|
114 |
-
);
|
115 |
-
}
|
116 |
-
|
117 |
-
$file_contents = file_get_contents( $file['file'] );
|
118 |
-
$data = json_decode( $file_contents, true );
|
119 |
-
wp_import_cleanup( $file['id']);
|
120 |
-
|
121 |
-
$options_to_import = $data['options'];
|
122 |
-
foreach ( (array)$options_to_import as $option_name => $option_value ) {
|
123 |
-
|
124 |
-
$val= maybe_unserialize( $option_value );
|
125 |
-
update_option( $option_name, $val );
|
126 |
-
//var_dump($option_name, get_option($option_name), $val);
|
127 |
-
}
|
128 |
-
$this->success_message();
|
129 |
-
}
|
130 |
-
|
131 |
-
public function initialize(){
|
132 |
-
|
133 |
-
add_settings_section(
|
134 |
-
'import_export_section',
|
135 |
-
__( 'Import/Export Settings', 'jquery-pin-it-button-for-images' ),
|
136 |
-
'__return_false',
|
137 |
-
'jpibfi_import_export_options'
|
138 |
-
);
|
139 |
-
|
140 |
-
add_settings_field(
|
141 |
-
'Export',
|
142 |
-
__( 'Export', 'jquery-pin-it-button-for-images' ),
|
143 |
-
array( $this, 'export_callback' ),
|
144 |
-
'jpibfi_import_export_options',
|
145 |
-
'import_export_section',
|
146 |
-
array()
|
147 |
-
);
|
148 |
-
|
149 |
-
add_settings_field(
|
150 |
-
'Import',
|
151 |
-
__( 'Import', 'jquery-pin-it-button-for-images' ),
|
152 |
-
array( $this, 'import_callback' ),
|
153 |
-
'jpibfi_import_export_options',
|
154 |
-
'import_export_section',
|
155 |
-
array()
|
156 |
-
);
|
157 |
-
|
158 |
-
register_setting(
|
159 |
-
'jpibfi_import_export_options',
|
160 |
-
'jpibfi_import_export_options'
|
161 |
-
);
|
162 |
-
}
|
163 |
-
|
164 |
-
public function export_callback( $args ){
|
165 |
-
|
166 |
-
echo '<a class="button button-primary" href="' . admin_url('export.php?download=true&content=jpibfi'). '">'
|
167 |
-
.__('Download Export File', 'jquery-pin-it-button-for-images')
|
168 |
-
.'</a>';
|
169 |
-
|
170 |
-
}
|
171 |
-
|
172 |
-
public function import_callback(){
|
173 |
-
_e( 'Choose a JSON (.json) file to upload, then click Upload file and import.', 'jquery-pin-it-button-for-images' );
|
174 |
-
wp_import_upload_form( 'options-general.php?page=jpibfi_settings&tab=import_export');
|
175 |
-
}
|
176 |
-
}
|
177 |
-
|
178 |
-
|
179 |
-
add_action( 'plugins_loaded', array( 'JPIBFI_Import_Export', 'get_instance' ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/admin/class-jpibfi-lightbox-options.php
DELETED
@@ -1,121 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class JPIBFI_Lightbox_Options extends JPIBFI_Options {
|
4 |
-
|
5 |
-
protected static $instance = null;
|
6 |
-
|
7 |
-
protected $admin_advanced_options = null;
|
8 |
-
|
9 |
-
private function __construct() {
|
10 |
-
add_action( 'admin_init', array( $this, 'init' ) );
|
11 |
-
}
|
12 |
-
|
13 |
-
public static function get_instance() {
|
14 |
-
// If the single instance hasn't been set, set it now.
|
15 |
-
if ( null == self::$instance ) {
|
16 |
-
self::$instance = new self;
|
17 |
-
}
|
18 |
-
|
19 |
-
return self::$instance;
|
20 |
-
}
|
21 |
-
|
22 |
-
function get_default_options(){
|
23 |
-
$defaults = array(
|
24 |
-
'enabled' => '0',
|
25 |
-
'description_option' => '1'
|
26 |
-
);
|
27 |
-
|
28 |
-
return apply_filters( 'jpibfi_default_lightbox_options', $defaults );
|
29 |
-
}
|
30 |
-
|
31 |
-
static function get_option_name(){
|
32 |
-
return 'jpibfi_lightbox_options';
|
33 |
-
}
|
34 |
-
|
35 |
-
/* Defines selection options section and adds all required fields */
|
36 |
-
public function init() {
|
37 |
-
|
38 |
-
// First, we register a section.
|
39 |
-
add_settings_section(
|
40 |
-
'lightbox_options_section',
|
41 |
-
__( 'Lightbox Settings', 'jquery-pin-it-button-for-images' ),
|
42 |
-
array( $this, 'section_name_callback' ),
|
43 |
-
'jpibfi_lightbox_options'
|
44 |
-
);
|
45 |
-
|
46 |
-
add_settings_field(
|
47 |
-
'enabled',
|
48 |
-
__( 'Enabled', 'jquery-pin-it-button-for-images' ),
|
49 |
-
array( $this, 'enabled_callback' ),
|
50 |
-
'jpibfi_lightbox_options',
|
51 |
-
'lightbox_options_section',
|
52 |
-
array(
|
53 |
-
__( 'Activate lightbox in posts', 'jquery-pin-it-button-for-images' )
|
54 |
-
)
|
55 |
-
);
|
56 |
-
|
57 |
-
add_settings_field(
|
58 |
-
'description_option',
|
59 |
-
__( 'Description source', 'jquery-pin-it-button-for-images' ),
|
60 |
-
array( $this, 'description_option_callback' ),
|
61 |
-
'jpibfi_lightbox_options',
|
62 |
-
'lightbox_options_section',
|
63 |
-
array(
|
64 |
-
__( 'From where the lightbox description should be taken. Please note that "Image description" works properly only for images that were added to your Media Library.', 'jquery-pin-it-button-for-images' ),
|
65 |
-
)
|
66 |
-
);
|
67 |
-
|
68 |
-
add_settings_field(
|
69 |
-
'footer',
|
70 |
-
'',
|
71 |
-
array( $this, 'footer_callback' ),
|
72 |
-
'jpibfi_lightbox_options',
|
73 |
-
'lightbox_options_section',
|
74 |
-
array(
|
75 |
-
__( 'Lightbox module uses Colorbox. Visit <a href="http://www.jacklmoore.com/colorbox/" target="_blank">this page</a> to learn more about Colorbox.', 'jquery-pin-it-button-for-images' ),
|
76 |
-
)
|
77 |
-
);
|
78 |
-
|
79 |
-
register_setting(
|
80 |
-
'jpibfi_lightbox_options',
|
81 |
-
'jpibfi_lightbox_options'
|
82 |
-
);
|
83 |
-
}
|
84 |
-
|
85 |
-
public function section_name_callback() {
|
86 |
-
echo '<p>' . __('Lightbox settings', 'jquery-pin-it-button-for-images') . '</p>';
|
87 |
-
}
|
88 |
-
|
89 |
-
public function enabled_callback( $args ){
|
90 |
-
$options = $this->get_options();
|
91 |
-
$enabled = JPIBFI_Admin_Utilities::exists_and_equal_to( $options, 'enabled', '1' );
|
92 |
-
|
93 |
-
echo '<input type="checkbox" id="debug" name="jpibfi_lightbox_options[enabled]" value="1" ' . checked( "1", $enabled, false ) . '>';
|
94 |
-
echo JPIBFI_Admin_Utilities::create_description( $args[0] );
|
95 |
-
}
|
96 |
-
|
97 |
-
public function description_option_callback( $args ) {
|
98 |
-
$options = $this->get_options();
|
99 |
-
|
100 |
-
$description_option = $options[ 'description_option' ];
|
101 |
-
?>
|
102 |
-
|
103 |
-
<select id="description_option" name="jpibfi_lightbox_options[description_option]">
|
104 |
-
<option value="1" <?php selected ( "1", $description_option ); ?>><?php _e( 'Page title', 'jquery-pin-it-button-for-images' ); ?></option>
|
105 |
-
<option value="2" <?php selected ( "2", $description_option ); ?>><?php _e( 'Page description (excerpt)', 'jquery-pin-it-button-for-images' ); ?></option>
|
106 |
-
<option value="3" <?php selected ( "3", $description_option ); ?>><?php _e( 'Image title or (if title not available) alt attribute', 'jquery-pin-it-button-for-images' ); ?></option>
|
107 |
-
<option value="4" <?php selected ( "4", $description_option ); ?>><?php _e( 'Site title (Settings->General)', 'jquery-pin-it-button-for-images' ); ?></option>
|
108 |
-
<option value="5" <?php selected ( "5", $description_option ); ?>><?php _e( 'Image description', 'jquery-pin-it-button-for-images' ); ?></option>
|
109 |
-
<option value="6" <?php selected ( "6", $description_option ); ?>><?php _e( 'Image alt attribute', 'jquery-pin-it-button-for-images' ); ?></option>
|
110 |
-
</select>
|
111 |
-
|
112 |
-
<?php
|
113 |
-
echo JPIBFI_Admin_Utilities::create_description( $args[0] );
|
114 |
-
}
|
115 |
-
|
116 |
-
public function footer_callback($args){
|
117 |
-
echo '<span style="font-size: 18px">' . $args[0] . '</span>';
|
118 |
-
}
|
119 |
-
}
|
120 |
-
|
121 |
-
add_action( 'plugins_loaded', array( 'JPIBFI_Lightbox_Options', 'get_instance' ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/admin/class-jpibfi-options.php
DELETED
@@ -1,26 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
if (!class_exists('JPIBFI_Options')){
|
4 |
-
|
5 |
-
abstract class JPIBFI_Options {
|
6 |
-
|
7 |
-
protected static function get_option_name(){
|
8 |
-
return '';
|
9 |
-
}
|
10 |
-
|
11 |
-
protected abstract function get_default_options();
|
12 |
-
|
13 |
-
private function get_db_options(){
|
14 |
-
$db_options = get_option($this->get_option_name());
|
15 |
-
return $db_options;
|
16 |
-
}
|
17 |
-
|
18 |
-
public function get_options(){
|
19 |
-
$db_options = $this->get_db_options();
|
20 |
-
$db_options = $db_options != false ? $db_options : array();
|
21 |
-
$defaults = $this->get_default_options();
|
22 |
-
$merged = array_merge($defaults, $db_options);
|
23 |
-
return $merged;
|
24 |
-
}
|
25 |
-
}
|
26 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/admin/class-jpibfi-selection-options.php
DELETED
@@ -1,326 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class JPIBFI_Selection_Options extends JPIBFI_Options {
|
4 |
-
|
5 |
-
protected static $instance = null;
|
6 |
-
|
7 |
-
protected $admin_selection_options = null;
|
8 |
-
|
9 |
-
private function __construct() {
|
10 |
-
add_action( 'admin_init', array( $this, 'initialize_selection_options' ) );
|
11 |
-
}
|
12 |
-
|
13 |
-
public static function get_instance() {
|
14 |
-
// If the single instance hasn't been set, set it now.
|
15 |
-
if ( null == self::$instance ) {
|
16 |
-
self::$instance = new self;
|
17 |
-
}
|
18 |
-
|
19 |
-
return self::$instance;
|
20 |
-
}
|
21 |
-
|
22 |
-
function get_default_options(){
|
23 |
-
$defaults = array(
|
24 |
-
'image_selector' => '.jpibfi_container img',
|
25 |
-
'disabled_classes' => 'nopin;wp-smiley',
|
26 |
-
'enabled_classes' => '',
|
27 |
-
'min_image_height' => '0',
|
28 |
-
'min_image_width' => '0',
|
29 |
-
'show_on_home' => '1',
|
30 |
-
'show_on_single' => '1',
|
31 |
-
'show_on_page' => '1',
|
32 |
-
'show_on_category' => '1',
|
33 |
-
'show_on_blog' => '1'
|
34 |
-
);
|
35 |
-
|
36 |
-
return apply_filters('jpibfi_default_selection_options', $defaults);
|
37 |
-
}
|
38 |
-
|
39 |
-
static function get_option_name(){
|
40 |
-
return 'jpibfi_selection_options';
|
41 |
-
}
|
42 |
-
|
43 |
-
private function get_checkbox_settings(){
|
44 |
-
return array(
|
45 |
-
'show_on_home',
|
46 |
-
'show_on_single',
|
47 |
-
'show_on_page',
|
48 |
-
'show_on_category',
|
49 |
-
'show_on_blog'
|
50 |
-
);
|
51 |
-
}
|
52 |
-
|
53 |
-
/*
|
54 |
-
* Defines selection options section and adds all required fields
|
55 |
-
*/
|
56 |
-
public function initialize_selection_options() {
|
57 |
-
|
58 |
-
// First, we register a section.
|
59 |
-
add_settings_section(
|
60 |
-
'selection_options_section', // ID used to identify this section and with which to register options
|
61 |
-
__( 'Selection', 'jquery-pin-it-button-for-images' ), // Title to be displayed on the administration page
|
62 |
-
array( $this, 'selection_options_callback' ), // Callback used to render the description of the section
|
63 |
-
'jpibfi_selection_options' // Page on which to add this section of options
|
64 |
-
);
|
65 |
-
|
66 |
-
//lThen add all necessary fields to the section
|
67 |
-
add_settings_field(
|
68 |
-
'image_selector', // ID used to identify the field throughout the plugin
|
69 |
-
__( 'Image selector', 'jquery-pin-it-button-for-images' ), // The label to the left of the option interface element
|
70 |
-
array( $this, 'image_selector_callback'), // The name of the function responsible for rendering the option interface
|
71 |
-
'jpibfi_selection_options', // The page on which this option will be displayed
|
72 |
-
'selection_options_section', // The name of the section to which this field belongs
|
73 |
-
array( // The array of arguments to pass to the callback. In this case, just a description.
|
74 |
-
sprintf ( __( 'jQuery selector for all the images that should have the "Pin it" button. Set the value to %s if you want the "Pin it" button to appear only on images in content or %s to appear on all images on site (including sidebar, header and footer). If you know a thing or two about jQuery, you might use your own selector. %sClick here%s to read about jQuery selectors.', 'jquery-pin-it-button-for-images' ),
|
75 |
-
'<a href="#" class="jpibfi_selector_option">.jpibfi_container img</a>',
|
76 |
-
'<a href="#" class="jpibfi_selector_option">img</a>',
|
77 |
-
'<a href="http://api.jquery.com/category/selectors/" target="_blank">',
|
78 |
-
'</a>'
|
79 |
-
)
|
80 |
-
)
|
81 |
-
);
|
82 |
-
|
83 |
-
add_settings_field(
|
84 |
-
'disabled_classes',
|
85 |
-
__( 'Disabled classes', 'jquery-pin-it-button-for-images' ),
|
86 |
-
array( $this, 'disabled_classes_callback' ),
|
87 |
-
'jpibfi_selection_options',
|
88 |
-
'selection_options_section',
|
89 |
-
array(
|
90 |
-
__( 'Pictures with these CSS classes won\'t show the "Pin it" button. Please separate multiple classes with semicolons. Spaces are not accepted.', 'jquery-pin-it-button-for-images' ),
|
91 |
-
)
|
92 |
-
);
|
93 |
-
|
94 |
-
add_settings_field(
|
95 |
-
'enabled_classes',
|
96 |
-
__( 'Enabled classes', 'jquery-pin-it-button-for-images' ),
|
97 |
-
array( $this, 'enabled_classes_callback' ),
|
98 |
-
'jpibfi_selection_options',
|
99 |
-
'selection_options_section',
|
100 |
-
array(
|
101 |
-
__( 'Only pictures with these CSS classes will show the "Pin it" button. Please separate multiple classes with semicolons. If this field is empty, images with any (besides disabled ones) classes will show the Pin It button.', 'jquery-pin-it-button-for-images' ),
|
102 |
-
)
|
103 |
-
);
|
104 |
-
|
105 |
-
add_settings_field(
|
106 |
-
'show_on_field',
|
107 |
-
__( 'On which pages the "Pin it" button should be shown', 'jquery-pin-it-button-for-images' ),
|
108 |
-
array( $this, 'show_on_field_callback' ),
|
109 |
-
'jpibfi_selection_options',
|
110 |
-
'selection_options_section',
|
111 |
-
array(
|
112 |
-
__( 'Check on which pages you want the Pinterest button to show up.', 'jquery-pin-it-button-for-images' ),
|
113 |
-
)
|
114 |
-
);
|
115 |
-
|
116 |
-
add_settings_field(
|
117 |
-
'min_image',
|
118 |
-
__( 'Minimum resolution that should trigger the "Pin it" button to show up', 'jquery-pin-it-button-for-images' ),
|
119 |
-
array( $this, 'min_image_callback' ),
|
120 |
-
'jpibfi_selection_options',
|
121 |
-
'selection_options_section',
|
122 |
-
array(
|
123 |
-
__( 'If you\'d like the "Pin it" button to not show up on small images (e.g. social media icons), just set the appropriate values above. The default values cause the "Pin it" button to show on every eligible image.', 'jquery-pin-it-button-for-images' ),
|
124 |
-
)
|
125 |
-
);
|
126 |
-
|
127 |
-
register_setting(
|
128 |
-
'jpibfi_selection_options',
|
129 |
-
'jpibfi_selection_options',
|
130 |
-
array( $this, 'sanitize_selection_options' )
|
131 |
-
);
|
132 |
-
}
|
133 |
-
|
134 |
-
public function selection_options_callback() {
|
135 |
-
echo '<p>' . __('Which images can be pinned', 'jquery-pin-it-button-for-images') . '</p>';
|
136 |
-
}
|
137 |
-
|
138 |
-
public function image_selector_callback( $args ) {
|
139 |
-
|
140 |
-
$options = $this->get_selection_options();
|
141 |
-
|
142 |
-
$selector = esc_attr( $options['image_selector'] );
|
143 |
-
|
144 |
-
echo '<input type="text" id="image_selector" name="jpibfi_selection_options[image_selector]" value="' . $selector . '"/>';
|
145 |
-
echo JPIBFI_Admin_Utilities::create_description( $args[0] );
|
146 |
-
}
|
147 |
-
|
148 |
-
public function disabled_classes_callback( $args ){
|
149 |
-
|
150 |
-
$options = $this->get_selection_options();
|
151 |
-
$value = esc_attr( $options[ 'disabled_classes' ] );
|
152 |
-
?>
|
153 |
-
<div id="jpibfi-disabled-classes">
|
154 |
-
<input type="hidden" class="jpibfi-value" name="jpibfi_selection_options[disabled_classes]" value="<?php echo $value; ?>">
|
155 |
-
<span class="jpibfi-empty"><?php echo JPIBFI_Admin_Utilities::create_description( __( 'No classes added.', 'jquery-pin-it-button-for-images' ) ); ?></span>
|
156 |
-
<div class="jpibfi-classes-list tagchecklist"></div>
|
157 |
-
<div>
|
158 |
-
<label>
|
159 |
-
<?php _e( 'Class name', 'jquery-pin-it-button-for-images' ); ?>
|
160 |
-
<input class="jpibfi-class-name" type="text">
|
161 |
-
</label>
|
162 |
-
<button type="button" class="jpibfi-class-button button"><?php _e( 'Add', 'jquery-pin-it-button-for-images' ); ?></button>
|
163 |
-
</div>
|
164 |
-
</div>
|
165 |
-
|
166 |
-
<?php
|
167 |
-
echo JPIBFI_Admin_Utilities::create_description( $args[0] );
|
168 |
-
echo JPIBFI_Admin_Utilities::create_errors( 'disabled_classes' );
|
169 |
-
}
|
170 |
-
|
171 |
-
public function enabled_classes_callback( $args ){
|
172 |
-
|
173 |
-
$options = $this->get_selection_options();
|
174 |
-
$value = esc_attr( $options[ 'enabled_classes' ] );
|
175 |
-
|
176 |
-
?>
|
177 |
-
<div id="jpibfi-enabled-classes">
|
178 |
-
<input type="hidden" class="jpibfi-value" name="jpibfi_selection_options[enabled_classes]" value="<?php echo $value; ?>">
|
179 |
-
<span class="jpibfi-empty"><?php echo JPIBFI_Admin_Utilities::create_description( __( 'No classes added.', 'jquery-pin-it-button-for-images' ) ); ?></span>
|
180 |
-
<div class="jpibfi-classes-list tagchecklist"></div>
|
181 |
-
<div>
|
182 |
-
<label>
|
183 |
-
<?php _e( 'Class name', 'jquery-pin-it-button-for-images' ); ?>
|
184 |
-
<input class="jpibfi-class-name" type="text">
|
185 |
-
</label>
|
186 |
-
<button type="button" class="jpibfi-class-button button"><?php _e( 'Add', 'jquery-pin-it-button-for-images' ); ?></button>
|
187 |
-
</div>
|
188 |
-
</div>
|
189 |
-
|
190 |
-
<?php
|
191 |
-
echo JPIBFI_Admin_Utilities::create_description( $args[0] );
|
192 |
-
echo JPIBFI_Admin_Utilities::create_errors( 'enabled_classes' );
|
193 |
-
}
|
194 |
-
|
195 |
-
public function show_on_field_callback( $args ) {
|
196 |
-
$options = $this->get_selection_options();
|
197 |
-
|
198 |
-
$show_on_home = JPIBFI_Admin_Utilities::exists_and_equal_to( $options, 'show_on_home', '1' );
|
199 |
-
$show_on_page = JPIBFI_Admin_Utilities::exists_and_equal_to( $options, 'show_on_page', '1' );
|
200 |
-
$show_on_single = JPIBFI_Admin_Utilities::exists_and_equal_to( $options, 'show_on_single', '1' );
|
201 |
-
$show_on_category = JPIBFI_Admin_Utilities::exists_and_equal_to( $options, 'show_on_category', '1' );
|
202 |
-
$show_on_blog = JPIBFI_Admin_Utilities::exists_and_equal_to( $options, 'show_on_blog', '1' );
|
203 |
-
?>
|
204 |
-
|
205 |
-
<input type="checkbox" id="show_on_home" name="jpibfi_selection_options[show_on_home]" <?php checked( true, $show_on_home ); ?> value="1" />
|
206 |
-
<label for="show_on_home"><?php _e( 'Home page', 'jquery-pin-it-button-for-images' ); ?></label><br/>
|
207 |
-
<input type="checkbox" id="show_on_page" name="jpibfi_selection_options[show_on_page]" <?php checked( true, $show_on_page ); ?> value="1" />
|
208 |
-
<label for="show_on_page"><?php _e( 'Pages', 'jquery-pin-it-button-for-images' ); ?></label><br />
|
209 |
-
<input type="checkbox" id="show_on_single" name="jpibfi_selection_options[show_on_single]" <?php checked( true, $show_on_single ); ?> value="1" />
|
210 |
-
<label for="show_on_single"><?php _e( 'Single posts', 'jquery-pin-it-button-for-images' ); ?></label><br />
|
211 |
-
<input type="checkbox" id="show_on_category" name="jpibfi_selection_options[show_on_category]" <?php checked( true, $show_on_category ); ?> value="1" />
|
212 |
-
<label for="show_on_category"><?php _e( 'Category and archive pages', 'jquery-pin-it-button-for-images' ); ?></label><br />
|
213 |
-
<input type="checkbox" id="show_on_blog" name="jpibfi_selection_options[show_on_blog]" <?php checked( true, $show_on_blog ); ?> value="1" />
|
214 |
-
<label for="show_on_blog"><?php _e( 'Blog pages', 'jquery-pin-it-button-for-images' ); ?></label>
|
215 |
-
|
216 |
-
<?php
|
217 |
-
echo JPIBFI_Admin_Utilities::create_description( $args[0] );
|
218 |
-
}
|
219 |
-
|
220 |
-
public function min_image_callback( $args ) {
|
221 |
-
$options = $this->get_selection_options();
|
222 |
-
|
223 |
-
$min_image_height = $options[ 'min_image_height' ];
|
224 |
-
$min_image_width = $options[ 'min_image_width' ];
|
225 |
-
?>
|
226 |
-
|
227 |
-
<p>
|
228 |
-
<label for="min_image_height"><?php _e('Height', 'jquery-pin-it-button-for-images'); ?></label>
|
229 |
-
<input type="number" min="0" step="1" id="min_image_height" name="jpibfi_selection_options[min_image_height]" value="<?php echo $min_image_height; ?>"
|
230 |
-
class="small-text" /> px
|
231 |
-
<?php echo JPIBFI_Admin_Utilities::create_errors( 'min_image_height' ); ?>
|
232 |
-
</p>
|
233 |
-
|
234 |
-
<p>
|
235 |
-
<label for="min_image_width"><?php _e('Width', 'jquery-pin-it-button-for-images'); ?></label>
|
236 |
-
<input type="number" min="0" step="1" id="min_image_width" name="jpibfi_selection_options[min_image_width]" value="<?php echo $min_image_width; ?>"
|
237 |
-
class="small-text" /> px
|
238 |
-
<?php echo JPIBFI_Admin_Utilities::create_errors( 'min_image_width' ); ?>
|
239 |
-
</p>
|
240 |
-
|
241 |
-
<?php
|
242 |
-
|
243 |
-
echo JPIBFI_Admin_Utilities::create_description( $args[0] );
|
244 |
-
}
|
245 |
-
|
246 |
-
public function sanitize_selection_options( $input ) {
|
247 |
-
$errors = false;
|
248 |
-
$jpibfi_selection_options = $this->get_options();
|
249 |
-
|
250 |
-
foreach( $input as $key => $value ) {
|
251 |
-
switch($key) {
|
252 |
-
case 'disabled_classes':
|
253 |
-
case 'enabled_classes':
|
254 |
-
if ( false == JPIBFI_Admin_Utilities::contains_css_class_names_or_empty( $input [ $key ] ) ) {
|
255 |
-
|
256 |
-
$field = '';
|
257 |
-
if ( 'disabled_classes' == $key )
|
258 |
-
$field = __( 'Disabled classes', 'jquery-pin-it-button-for-images' );
|
259 |
-
else if ( 'enabled_classes' == $key )
|
260 |
-
$field = __( 'Enabled classes', 'jquery-pin-it-button-for-images' );
|
261 |
-
|
262 |
-
$errors = true;
|
263 |
-
add_settings_error(
|
264 |
-
$key,
|
265 |
-
esc_attr( 'settings_updated' ),
|
266 |
-
$field . ' - ' . __('the given value doesn\'t meet the requirements. Please correct it and try again.', 'jquery-pin-it-button-for-images')
|
267 |
-
);
|
268 |
-
}
|
269 |
-
break;
|
270 |
-
case 'min_image_height':
|
271 |
-
case 'min_image_width':
|
272 |
-
if ( !is_numeric( $value ) || $value < 0 ) {
|
273 |
-
|
274 |
-
$field = '';
|
275 |
-
if ( 'min_image_height' == $key )
|
276 |
-
$field = __( 'Minimum image height', 'jquery-pin-it-button-for-images' );
|
277 |
-
else if ( 'min_image_width' == $key )
|
278 |
-
$field = __( 'Minimum image width', 'jquery-pin-it-button-for-images' );
|
279 |
-
|
280 |
-
$errors = true;
|
281 |
-
add_settings_error(
|
282 |
-
$key,
|
283 |
-
esc_attr( 'settings_updated' ),
|
284 |
-
$field . ' - ' . sprintf ( __('value must be a number greater or equal to %d.', 'jquery-pin-it-button-for-images'), '0' )
|
285 |
-
);
|
286 |
-
}
|
287 |
-
break;
|
288 |
-
}
|
289 |
-
|
290 |
-
}
|
291 |
-
|
292 |
-
$checkbox_settings = $this->get_checkbox_settings();
|
293 |
-
foreach($checkbox_settings as $setting_name){
|
294 |
-
if (false == array_key_exists( $setting_name, $input) ){
|
295 |
-
$input[ $setting_name ] = '0';
|
296 |
-
}
|
297 |
-
}
|
298 |
-
|
299 |
-
|
300 |
-
if ( $errors ) {
|
301 |
-
|
302 |
-
update_option( $this->get_option_name() . '_errors', $input );
|
303 |
-
return $jpibfi_selection_options;
|
304 |
-
|
305 |
-
} else {
|
306 |
-
|
307 |
-
delete_option( $this->get_option_name() . '_errors' );
|
308 |
-
return $input;
|
309 |
-
|
310 |
-
}
|
311 |
-
}
|
312 |
-
|
313 |
-
private function get_selection_options() {
|
314 |
-
$jpibfi_selection_options = $this->get_options();
|
315 |
-
|
316 |
-
if ( null == $this->admin_selection_options ) {
|
317 |
-
//cumbersome, but works in WP 3.3
|
318 |
-
$options = get_option( $this->get_option_name() . '_errors' );
|
319 |
-
$this->admin_selection_options = false == $options ? $jpibfi_selection_options : $options;
|
320 |
-
}
|
321 |
-
|
322 |
-
return $this->admin_selection_options;
|
323 |
-
}
|
324 |
-
}
|
325 |
-
|
326 |
-
add_action( 'plugins_loaded', array( 'JPIBFI_Selection_Options', 'get_instance' ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/admin/class-jpibfi-visual-options.php
DELETED
@@ -1,429 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class JPIBFI_Visual_Options extends JPIBFI_Options {
|
4 |
-
protected static $instance = null;
|
5 |
-
|
6 |
-
protected $admin_visual_options = null;
|
7 |
-
|
8 |
-
private function __construct() {
|
9 |
-
add_action( 'admin_init', array( $this, 'initialize_visual_options' ) );
|
10 |
-
|
11 |
-
}
|
12 |
-
|
13 |
-
public static function get_instance() {
|
14 |
-
// If the single instance hasn't been set, set it now.
|
15 |
-
if ( null == self::$instance ) {
|
16 |
-
self::$instance = new self;
|
17 |
-
}
|
18 |
-
return self::$instance;
|
19 |
-
}
|
20 |
-
|
21 |
-
private function get_visual_options() {
|
22 |
-
$db_options = $this->get_options();
|
23 |
-
|
24 |
-
if ( null == $this->admin_visual_options ) {
|
25 |
-
//cumbersome, but works in WP 3.3
|
26 |
-
$options = get_option( $this->get_option_name() . '_errors' );
|
27 |
-
$this->admin_visual_options = false == $options ? $db_options : $options;
|
28 |
-
}
|
29 |
-
|
30 |
-
return $this->admin_visual_options;
|
31 |
-
}
|
32 |
-
|
33 |
-
function get_default_options(){
|
34 |
-
$defaults = array(
|
35 |
-
'button_margin_bottom' => '20',
|
36 |
-
'button_margin_top' => '20',
|
37 |
-
'button_margin_right' => '20',
|
38 |
-
'button_margin_left' => '20',
|
39 |
-
'button_position' => '0',
|
40 |
-
'custom_image_url' => '',
|
41 |
-
'custom_image_height' => '0',
|
42 |
-
'custom_image_width' => '0',
|
43 |
-
'description_option' => '1',
|
44 |
-
'pinLinkedImages' => '0',
|
45 |
-
'pinLinkedImagesExtensions' => '',
|
46 |
-
'retina_friendly' => '0',
|
47 |
-
'show_button' => 'hover',
|
48 |
-
'transparency_value' => '0.5',
|
49 |
-
'use_custom_image' => '0',
|
50 |
-
'use_post_url' => '0'
|
51 |
-
);
|
52 |
-
|
53 |
-
return apply_filters( 'jpibfi_default_visual_options', $defaults );
|
54 |
-
}
|
55 |
-
|
56 |
-
static function get_option_name(){
|
57 |
-
return 'jpibfi_visual_options';
|
58 |
-
}
|
59 |
-
|
60 |
-
function get_checkbox_settings() {
|
61 |
-
return array(
|
62 |
-
'pinLinkedImages',
|
63 |
-
'use_post_url',
|
64 |
-
'retina_friendly',
|
65 |
-
'use_custom_image'
|
66 |
-
);
|
67 |
-
}
|
68 |
-
|
69 |
-
/* Defines visual options section and defines all required fields */
|
70 |
-
public function initialize_visual_options() {
|
71 |
-
|
72 |
-
add_settings_section(
|
73 |
-
'visual_options_section', // ID used to identify this section and with which to register options
|
74 |
-
__( 'Visual', 'jquery-pin-it-button-for-images' ), // Title to be displayed on the administration page
|
75 |
-
array( $this, 'visual_options_callback' ), // Callback used to render the description of the section
|
76 |
-
'jpibfi_visual_options' // Page on which to add this section of options
|
77 |
-
);
|
78 |
-
|
79 |
-
add_settings_field(
|
80 |
-
'show_button',
|
81 |
-
__( 'Show button', 'jquery-pin-it-button-for-images' ),
|
82 |
-
array( $this, 'show_button_callback' ),
|
83 |
-
'jpibfi_visual_options',
|
84 |
-
'visual_options_section',
|
85 |
-
array(
|
86 |
-
__( 'When the "Pin it" button should be visible.', 'jquery-pin-it-button-for-images' ),
|
87 |
-
)
|
88 |
-
);
|
89 |
-
|
90 |
-
add_settings_field(
|
91 |
-
'description_option',
|
92 |
-
__( 'Description source', 'jquery-pin-it-button-for-images' ),
|
93 |
-
array( $this, 'description_option_callback' ),
|
94 |
-
'jpibfi_visual_options',
|
95 |
-
'visual_options_section',
|
96 |
-
array(
|
97 |
-
__( 'From where the Pinterest message should be taken. Please note that "Image description" works properly only for images that were added to your Media Library.', 'jquery-pin-it-button-for-images' ),
|
98 |
-
)
|
99 |
-
);
|
100 |
-
|
101 |
-
add_settings_field(
|
102 |
-
'use_post_url',
|
103 |
-
__( 'Linked page', 'jquery-pin-it-button-for-images' ),
|
104 |
-
array( $this, 'use_post_url_callback' ),
|
105 |
-
'jpibfi_visual_options',
|
106 |
-
'visual_options_section',
|
107 |
-
array(
|
108 |
-
__( 'When checked, the link on Pinterest will always point to the individual page with the image and title of this individual page will be used if you\'ve selected Title as the description source, even when the image was pinned on an archive page, category page or homepage. If false, the link will point to the URL the user is currently on.', 'jquery-pin-it-button-for-images' ),
|
109 |
-
)
|
110 |
-
);
|
111 |
-
|
112 |
-
add_settings_field(
|
113 |
-
'pin_linked_images',
|
114 |
-
__( 'Pin linked images', 'jquery-pin-it-button-for-images' ),
|
115 |
-
array( $this, 'pin_linked_images_callback' ),
|
116 |
-
'jpibfi_visual_options',
|
117 |
-
'visual_options_section',
|
118 |
-
array(
|
119 |
-
)
|
120 |
-
);
|
121 |
-
|
122 |
-
add_settings_field(
|
123 |
-
'transparency_value',
|
124 |
-
__( 'Transparency value', 'jquery-pin-it-button-for-images' ),
|
125 |
-
array( $this, 'transparency_value_callback' ),
|
126 |
-
'jpibfi_visual_options',
|
127 |
-
'visual_options_section',
|
128 |
-
array(
|
129 |
-
__( 'This setting sets the transparency of the image.', 'jquery-pin-it-button-for-images' ),
|
130 |
-
)
|
131 |
-
);
|
132 |
-
|
133 |
-
add_settings_field(
|
134 |
-
'custom_pin_it_button',
|
135 |
-
__( 'Custom "Pin It" button', 'jquery-pin-it-button-for-images' ),
|
136 |
-
array( $this, 'custom_pin_it_button_callback' ),
|
137 |
-
'jpibfi_visual_options',
|
138 |
-
'visual_options_section',
|
139 |
-
array(
|
140 |
-
__( 'Check the <b>Use custom image</b> checkbox, specify image\'s URL, height and width to use your own Pinterest button design. You can just upload an image using Wordpress media library if you wish.', 'jquery-pin-it-button-for-images' ),
|
141 |
-
)
|
142 |
-
);
|
143 |
-
|
144 |
-
add_settings_field(
|
145 |
-
'pin_it_button_position',
|
146 |
-
__( '"Pin it" button position', 'jquery-pin-it-button-for-images' ),
|
147 |
-
array( $this, 'pin_it_button_position_callback' ),
|
148 |
-
'jpibfi_visual_options',
|
149 |
-
'visual_options_section',
|
150 |
-
array(
|
151 |
-
__( 'Where the "Pin it" button should appear on the image.', 'jquery-pin-it-button-for-images' ),
|
152 |
-
)
|
153 |
-
);
|
154 |
-
|
155 |
-
add_settings_field(
|
156 |
-
'pin_it_button_margins',
|
157 |
-
__( '"Pin it" button margins', 'jquery-pin-it-button-for-images' ),
|
158 |
-
array( $this, 'pin_it_button_margins_callback' ),
|
159 |
-
'jpibfi_visual_options',
|
160 |
-
'visual_options_section',
|
161 |
-
array(
|
162 |
-
sprintf( __( 'Margins are used to adjust the position of the "Pin it" button, but not all margins are used on all button positions. Here is an example. If you\'re using the "%s" position, the button\'s position will be affected only by top and left margins. Bottom and right margins affect "%s" position, etc. The "%s" position does not use any margins at all.', 'jquery-pin-it-button-for-images' ),
|
163 |
-
__( 'Top left', 'jquery-pin-it-button-for-images' ),
|
164 |
-
__( 'Bottom right', 'jquery-pin-it-button-for-images' ),
|
165 |
-
__( 'Middle', 'jquery-pin-it-button-for-images' )
|
166 |
-
),
|
167 |
-
)
|
168 |
-
);
|
169 |
-
|
170 |
-
add_settings_field(
|
171 |
-
'retina_friendly',
|
172 |
-
__( 'Retina friendly', 'jquery-pin-it-button-for-images' ),
|
173 |
-
array( $this, 'retina_friendly_callback' ),
|
174 |
-
'jpibfi_visual_options',
|
175 |
-
'visual_options_section',
|
176 |
-
array(
|
177 |
-
__( 'Please note that checking this option will result in rendering the "Pin it" button half of its normal size (if you use a 80x60 image, the button will be 40x30). When uploading a custom "Pin it" button (the default one is too small), please make sure both width and height are even numbers (i.e. divisible by two) when using this option.', 'jquery-pin-it-button-for-images' ),
|
178 |
-
)
|
179 |
-
);
|
180 |
-
|
181 |
-
register_setting(
|
182 |
-
'jpibfi_visual_options',
|
183 |
-
'jpibfi_visual_options',
|
184 |
-
array( $this, 'sanitize_visual_options' )
|
185 |
-
);
|
186 |
-
}
|
187 |
-
|
188 |
-
public function visual_options_callback() {
|
189 |
-
echo '<p>' . __('How it should look like', 'jquery-pin-it-button-for-images') . '</p>';
|
190 |
-
}
|
191 |
-
|
192 |
-
public function show_button_callback($args){
|
193 |
-
$options = $this->get_visual_options();
|
194 |
-
$show_button = 'hover';
|
195 |
-
?>
|
196 |
-
<select id="show_button" name="jpibfi_visual_options[show_button]">
|
197 |
-
<option value="hover" <?php selected ( "hover", $show_button ); ?>><?php _e( 'On hover', 'jquery-pin-it-button-for-images' ); ?></option>
|
198 |
-
<option value="always_touch" <?php selected ( "always_touch", $show_button ); ?>><?php _e( 'Always on touch devices', 'jquery-pin-it-button-for-images' ); ?></option>
|
199 |
-
<option value="always" <?php selected ( "always", $show_button ); ?>><?php _e( 'Always', 'jquery-pin-it-button-for-images' ); ?></option>
|
200 |
-
</select>
|
201 |
-
<?php
|
202 |
-
?>
|
203 |
-
<div id="show_button_error">
|
204 |
-
<p><strong><?php echo sprintf(__('This feature is disabled in this version of the plugin. Consider buying <a target="_blank" href="%s">the PRO version</a>.', 'jquery-pin-it-button-for-images'), 'http://mrsztuczkens.me/jpibfi-pro/'); ?></strong></p>
|
205 |
-
</div>
|
206 |
-
<?php
|
207 |
-
echo JPIBFI_Admin_Utilities::create_description( $args[0] );
|
208 |
-
}
|
209 |
-
|
210 |
-
public function description_option_callback( $args ) {
|
211 |
-
$options = $this->get_visual_options();
|
212 |
-
|
213 |
-
$description_option = $options[ 'description_option' ];
|
214 |
-
?>
|
215 |
-
|
216 |
-
<select id="description_option" name="jpibfi_visual_options[description_option]">
|
217 |
-
<option value="1" <?php selected ( "1", $description_option ); ?>><?php _e( 'Page title', 'jquery-pin-it-button-for-images' ); ?></option>
|
218 |
-
<option value="2" <?php selected ( "2", $description_option ); ?>><?php _e( 'Page description (excerpt)', 'jquery-pin-it-button-for-images' ); ?></option>
|
219 |
-
<option value="3" <?php selected ( "3", $description_option ); ?>><?php _e( 'Image title or (if title not available) alt attribute', 'jquery-pin-it-button-for-images' ); ?></option>
|
220 |
-
<option value="4" <?php selected ( "4", $description_option ); ?>><?php _e( 'Site title (Settings->General)', 'jquery-pin-it-button-for-images' ); ?></option>
|
221 |
-
<option value="5" <?php selected ( "5", $description_option ); ?>><?php _e( 'Image description', 'jquery-pin-it-button-for-images' ); ?></option>
|
222 |
-
<option value="6" <?php selected ( "6", $description_option ); ?>><?php _e( 'Image alt attribute', 'jquery-pin-it-button-for-images' ); ?></option>
|
223 |
-
</select>
|
224 |
-
|
225 |
-
<?php
|
226 |
-
echo JPIBFI_Admin_Utilities::create_description( $args[0] );
|
227 |
-
}
|
228 |
-
|
229 |
-
public function use_post_url_callback( $args ) {
|
230 |
-
|
231 |
-
$options = $this->get_visual_options();
|
232 |
-
$use_post_url = JPIBFI_Admin_Utilities::exists_and_equal_to( $options, 'use_post_url', '1' );
|
233 |
-
|
234 |
-
echo '<input type="checkbox" id="use_post_url" name="jpibfi_visual_options[use_post_url]" value="1" ' . checked( true, $use_post_url, false ) . '>';
|
235 |
-
echo '<label for="use_post_url">' . __( 'Always link to individual post page', 'jquery-pin-it-button-for-images' ) . '</label>';
|
236 |
-
|
237 |
-
echo JPIBFI_Admin_Utilities::create_description( $args[0] );
|
238 |
-
}
|
239 |
-
|
240 |
-
public function pin_linked_images_callback( $args){
|
241 |
-
$options = $this->get_visual_options();
|
242 |
-
|
243 |
-
$pin_linked_images = $options['pinLinkedImages']== '1';
|
244 |
-
$pin_linked_images_extensions = $options['pinLinkedImagesExtensions'];
|
245 |
-
|
246 |
-
echo '<input type="checkbox" id="pinLinkedImages" name="jpibfi_visual_options[pinLinkedImages]" value="1" ' . checked( true, $pin_linked_images, false ) . '>';
|
247 |
-
echo '<label for="pinLinkedImages">' . __( 'Active', 'jquery-pin-it-button-for-images' ) . '</label>';
|
248 |
-
echo JPIBFI_Admin_Utilities::create_description(__( 'When checked, pins full-sized images instead of thumbnails (works only if you link thumbnails to their full versions).', 'jquery-pin-it-button-for-images' ));
|
249 |
-
echo '<p><label for="pinLinkedImagesExtensions">' . __( 'File extensions to use', 'jquery-pin-it-button-for-images' ) . '</label> ';
|
250 |
-
echo '<input type="text" id="pinLinkedImagesExtensions" name="jpibfi_visual_options[pinLinkedImagesExtensions]" value="' . $pin_linked_images_extensions . '"></p>';
|
251 |
-
echo JPIBFI_Admin_Utilities::create_description( __('Leaving this empty means files of any extension will be used (also those without any extension). If you want to use only files of specific extension(s), type those file extensions here (separated by commas).', 'jquery-pin-it-button-for-images') );
|
252 |
-
}
|
253 |
-
|
254 |
-
public function transparency_value_callback( $args ) {
|
255 |
-
$options = $this->get_visual_options();
|
256 |
-
|
257 |
-
$transparency_value = $options[ 'transparency_value' ];
|
258 |
-
|
259 |
-
echo '<label for="transparency_value">' . sprintf ( __('Choose transparency (between %.02f and %.02f)', 'jquery-pin-it-button-for-images'), '0.00', '1.00' ) . '</label><br/>';
|
260 |
-
echo '<input type="number" min="0" max="1" step="0.01" id="transparency_value" name="jpibfi_visual_options[transparency_value]"' .
|
261 |
-
'value="' . $transparency_value . '" class="small-text" >';
|
262 |
-
echo JPIBFI_Admin_Utilities::create_description( $args[0] );
|
263 |
-
echo JPIBFI_Admin_Utilities::create_errors( 'transparency_value' );
|
264 |
-
}
|
265 |
-
|
266 |
-
public function custom_pin_it_button_callback( $args ) {
|
267 |
-
$options = $this->get_visual_options();
|
268 |
-
|
269 |
-
$use_custom_image = JPIBFI_Admin_Utilities::exists_and_equal_to( $options, 'use_custom_image', '1' );
|
270 |
-
$custom_image_url = $options[ 'custom_image_url' ];
|
271 |
-
$custom_image_height = $options[ 'custom_image_height' ];
|
272 |
-
$custom_image_width = $options[ 'custom_image_width' ];
|
273 |
-
|
274 |
-
?>
|
275 |
-
<p>
|
276 |
-
<input type="checkbox" id="use_custom_image" name="jpibfi_visual_options[use_custom_image]" value="1" <?php checked( true, $use_custom_image ); ?> >
|
277 |
-
<label class="chbox-label" for="use_custom_image"><?php _e( 'Use custom image', 'jquery-pin-it-button-for-images' ); ?></label>
|
278 |
-
</p>
|
279 |
-
|
280 |
-
<button id=upload-image><?php _e( 'Upload an image using media library','jquery-pin-it-button-for-images' ); ?></button><br />
|
281 |
-
|
282 |
-
<p>
|
283 |
-
<label for="custom_image_url"><?php _e( 'URL address of the image', 'jquery-pin-it-button-for-images' ); ?></label>
|
284 |
-
<input type="url" id="custom_image_url" name="jpibfi_visual_options[custom_image_url]" value="<?php echo $custom_image_url; ?>">
|
285 |
-
</p>
|
286 |
-
|
287 |
-
<p>
|
288 |
-
<label for="custom_image_height"><?php _e( 'Height', 'jquery-pin-it-button-for-images' ); ?></label>
|
289 |
-
<input type="number" min="0" step="1" id="custom_image_height" name="jpibfi_visual_options[custom_image_height]" value="<?php echo $custom_image_height; ?>"
|
290 |
-
class="small-text" /> px
|
291 |
-
<?php echo JPIBFI_Admin_Utilities::create_errors( 'custom_image_height' ); ?>
|
292 |
-
</p>
|
293 |
-
|
294 |
-
<p>
|
295 |
-
<label for="custom_image_width"><?php _e( 'Width', 'jquery-pin-it-button-for-images' ); ?></label>
|
296 |
-
<input type="number" min="0" step="1" id="custom_image_width" name="jpibfi_visual_options[custom_image_width]" value="<?php echo $custom_image_width; ?>"
|
297 |
-
class="small-text" /> px
|
298 |
-
<?php echo JPIBFI_Admin_Utilities::create_errors( 'custom_image_width' ); ?>
|
299 |
-
</p>
|
300 |
-
|
301 |
-
<p>
|
302 |
-
<b><?php _e( 'Custom Pin It button preview', 'jquery-pin-it-button-for-images' ); ?></b><br/>
|
303 |
-
<span id="custom_button_preview" style="width: <?php echo $custom_image_width; ?>px; height: <?php echo $custom_image_height; ?>px; background-image: url('<?php echo $custom_image_url; ?>');">
|
304 |
-
Preview
|
305 |
-
</span><br/>
|
306 |
-
<button id="refresh_custom_button_preview"><?php _e( 'Refresh preview', 'jquery-pin-it-button-for-images' ); ?></button>
|
307 |
-
</p>
|
308 |
-
|
309 |
-
<?php
|
310 |
-
|
311 |
-
echo JPIBFI_Admin_Utilities::create_description( $args[0] );
|
312 |
-
}
|
313 |
-
|
314 |
-
public function pin_it_button_position_callback( $args ) {
|
315 |
-
$options = $this->get_visual_options();
|
316 |
-
|
317 |
-
$jpibfi_button_dropdown = array(
|
318 |
-
__( 'Top left', 'jquery-pin-it-button-for-images' ),
|
319 |
-
__( 'Top right', 'jquery-pin-it-button-for-images' ),
|
320 |
-
__( 'Bottom left', 'jquery-pin-it-button-for-images' ),
|
321 |
-
__( 'Bottom right', 'jquery-pin-it-button-for-images' ),
|
322 |
-
__( 'Middle', 'jquery-pin-it-button-for-images' )
|
323 |
-
);
|
324 |
-
|
325 |
-
$button_position = $options[ 'button_position' ];
|
326 |
-
|
327 |
-
?>
|
328 |
-
|
329 |
-
<select name="jpibfi_visual_options[button_position]" id="button_position">
|
330 |
-
<?php for( $i = 0; $i < count( $jpibfi_button_dropdown ); $i++) { ?>
|
331 |
-
<option value="<?php echo $i; ?>" <?php selected( $i, $button_position ); ?>><?php echo $jpibfi_button_dropdown[ $i ]; ?></option>
|
332 |
-
<?php } ?>
|
333 |
-
</select><br/>
|
334 |
-
|
335 |
-
<?php
|
336 |
-
echo JPIBFI_Admin_Utilities::create_description( $args[0] );
|
337 |
-
}
|
338 |
-
|
339 |
-
public function pin_it_button_margins_callback( $args ) {
|
340 |
-
$options = $this->get_visual_options();
|
341 |
-
?>
|
342 |
-
<label for="button_margin_top"><?php _e('Top', 'jquery-pin-it-button-for-images'); ?></label>
|
343 |
-
<input type="number" min="-1000" max="1000" step="1" id="button_margin_top" name="jpibfi_visual_options[button_margin_top]" value="<?php echo $options[ 'button_margin_top' ]; ?>" class="small-text" >px<br/>
|
344 |
-
<label for="button_margin_bottom"><?php _e('Bottom', 'jquery-pin-it-button-for-images'); ?></label>
|
345 |
-
<input type="number" min="-1000" max="1000" step="1" id="button_margin_bottom" name="jpibfi_visual_options[button_margin_bottom]" value="<?php echo $options[ 'button_margin_bottom' ]; ?>" class="small-text" >px<br/>
|
346 |
-
<label for="button_margin_left"><?php _e('Left', 'jquery-pin-it-button-for-images'); ?></label>
|
347 |
-
<input type="number" min="-1000" max="1000" step="1" id="button_margin_left" name="jpibfi_visual_options[button_margin_left]" value="<?php echo $options[ 'button_margin_left' ]; ?>" class="small-text" >px<br/>
|
348 |
-
<label for="button_margin_right"><?php _e('Right', 'jquery-pin-it-button-for-images'); ?></label>
|
349 |
-
<input type="number" min="-1000" max="1000" step="1" id="button_margin_right" name="jpibfi_visual_options[button_margin_right]" value="<?php echo $options[ 'button_margin_right' ]; ?>" class="small-text" >px<br/>
|
350 |
-
|
351 |
-
<?php
|
352 |
-
echo JPIBFI_Admin_Utilities::create_description( $args[0] );
|
353 |
-
}
|
354 |
-
|
355 |
-
public function retina_friendly_callback( $args ) {
|
356 |
-
|
357 |
-
$options = $this->get_visual_options();
|
358 |
-
$retina_friendly = JPIBFI_Admin_Utilities::exists_and_equal_to( $options, 'retina_friendly', '1' );
|
359 |
-
|
360 |
-
echo '<input type="checkbox" id="retina_friendly" name="jpibfi_visual_options[retina_friendly]" value="1" ' . checked( true, $retina_friendly, false ) . '>';
|
361 |
-
echo '<label for="retina_friendly">' . __( 'Optimize for high pixel density displays', 'jquery-pin-it-button-for-images' ) . '</label>';
|
362 |
-
|
363 |
-
echo JPIBFI_Admin_Utilities::create_description( $args[0] );
|
364 |
-
}
|
365 |
-
|
366 |
-
public function sanitize_visual_options( $input ) {
|
367 |
-
$errors = false;
|
368 |
-
$jpibfi_visual_options = $this->get_options();
|
369 |
-
|
370 |
-
foreach( $input as $key => $value ) {
|
371 |
-
|
372 |
-
switch($key) {
|
373 |
-
case 'custom_image_height':
|
374 |
-
case 'custom_image_width':
|
375 |
-
$name = "";
|
376 |
-
if ( 'custom_image_height' == $key )
|
377 |
-
$name = __('Custom image height', 'jquery-pin-it-button-for-images' );
|
378 |
-
else if ( 'custom_image_width' == $key )
|
379 |
-
$name = __('Custom image width', 'jquery-pin-it-button-for-images' );
|
380 |
-
|
381 |
-
if ( '' != $value && ( !is_numeric( $value ) || $value < 0 ) ) {
|
382 |
-
$errors = true;
|
383 |
-
add_settings_error(
|
384 |
-
$key,
|
385 |
-
esc_attr( 'settings_updated' ),
|
386 |
-
$name . ' - ' . sprintf ( __('value must be a number greater or equal to %d.', 'jquery-pin-it-button-for-images'), '0' )
|
387 |
-
);
|
388 |
-
}
|
389 |
-
break;
|
390 |
-
case 'transparency_value':
|
391 |
-
if ( !is_numeric( $input[ $key ] ) || ( $input[ $key ] < 0.0 ) || ( $input[ $key ] > 1.0 ) ) {
|
392 |
-
$errors = true;
|
393 |
-
add_settings_error(
|
394 |
-
$key,
|
395 |
-
esc_attr( 'settings_updated' ),
|
396 |
-
sprintf( __('Transparency value must be a number between %.02d and %.02f.', 'jquery-pin-it-button-for-images'), '0.00', '1.00' )
|
397 |
-
);
|
398 |
-
}
|
399 |
-
break;
|
400 |
-
case 'pinLinkedImagesExtensions':
|
401 |
-
$options[ $key ] = esc_attr( $value );
|
402 |
-
break;
|
403 |
-
}
|
404 |
-
}
|
405 |
-
|
406 |
-
$defaults = $this->get_default_options();
|
407 |
-
$input['show_button'] = $defaults['show_button'];
|
408 |
-
|
409 |
-
$checkbox_settings = $this->get_checkbox_settings();
|
410 |
-
foreach($checkbox_settings as $setting_name){
|
411 |
-
if (false == array_key_exists( $setting_name, $input) )
|
412 |
-
$input[ $setting_name ] = '0';
|
413 |
-
}
|
414 |
-
|
415 |
-
if ( $errors ) {
|
416 |
-
|
417 |
-
update_option( $this->get_option_name() . '_errors', $input );
|
418 |
-
return $jpibfi_visual_options;
|
419 |
-
|
420 |
-
} else {
|
421 |
-
|
422 |
-
delete_option( $this->get_option_name() . '_errors' );
|
423 |
-
return $input;
|
424 |
-
|
425 |
-
}
|
426 |
-
}
|
427 |
-
}
|
428 |
-
|
429 |
-
add_action( 'plugins_loaded', array( 'JPIBFI_Visual_Options', 'get_instance' ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/admin/includes/class-jpibfi-ajax-result-builder.php
ADDED
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class JPIBFI_Ajax_Result_Builder {
|
4 |
+
|
5 |
+
private $model;
|
6 |
+
private $status;
|
7 |
+
private $messages;
|
8 |
+
|
9 |
+
function __construct() {
|
10 |
+
$this->model = null;
|
11 |
+
$this->messages = array();
|
12 |
+
$this->status = 'OK';
|
13 |
+
}
|
14 |
+
|
15 |
+
function set_model($model) {
|
16 |
+
$this->model = $model;
|
17 |
+
return $this;
|
18 |
+
}
|
19 |
+
|
20 |
+
function set_error($error_msg, $error_msg_id = 'error') {
|
21 |
+
$arr = array();
|
22 |
+
$arr[$error_msg_id] = $error_msg;
|
23 |
+
return $this->set_errors($arr);
|
24 |
+
}
|
25 |
+
|
26 |
+
function set_errors($errors) {
|
27 |
+
$this->status = 'ERROR';
|
28 |
+
$this->messages = $errors;
|
29 |
+
return $this;
|
30 |
+
}
|
31 |
+
|
32 |
+
function set_message($msg, $msg_id = 'ok'){
|
33 |
+
$this->messages = array($msg_id => $msg);
|
34 |
+
return $this;
|
35 |
+
}
|
36 |
+
|
37 |
+
function build() {
|
38 |
+
$res = array(
|
39 |
+
'status' => array(
|
40 |
+
'status' => $this->status,
|
41 |
+
'messages' => $this->messages
|
42 |
+
)
|
43 |
+
);
|
44 |
+
|
45 |
+
if ($this->model != null)
|
46 |
+
$res['model'] = $this->model;
|
47 |
+
|
48 |
+
return $res;
|
49 |
+
}
|
50 |
+
}
|
includes/admin/settings/class-jpibfi-import-export-settings.php
ADDED
@@ -0,0 +1,126 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class JPIBFI_Import_Export_Settings extends JPIBFI_Settings_Tab {
|
4 |
+
|
5 |
+
private $ajax_import_action;
|
6 |
+
|
7 |
+
function __construct() {
|
8 |
+
parent::__construct();
|
9 |
+
$this->ajax_import_action = '_import';
|
10 |
+
add_filter( 'export_args', array( $this, 'export_args' ) );
|
11 |
+
add_action( 'export_wp', array( $this, 'export_wp' ) );
|
12 |
+
add_filter($this->ajax_custom_action . $this->ajax_import_action, array($this, 'ajax_import'));
|
13 |
+
}
|
14 |
+
|
15 |
+
function ajax_import() {
|
16 |
+
$result = new JPIBFI_Ajax_Result_Builder();
|
17 |
+
$file = wp_import_handle_upload();
|
18 |
+
|
19 |
+
if ( isset( $file['error'] ) ) {
|
20 |
+
return $result
|
21 |
+
->set_error(esc_html( $file['error'] ))
|
22 |
+
->build();
|
23 |
+
}
|
24 |
+
|
25 |
+
if ( ! isset( $file['file'], $file['id'] ) ) {
|
26 |
+
return $result
|
27 |
+
->set_error(__( 'The file did not upload properly. Please try again.', 'jquery-pin-it-button-for-images' ))
|
28 |
+
->build();
|
29 |
+
}
|
30 |
+
|
31 |
+
if ( ! file_exists( $file['file'] ) ) {
|
32 |
+
wp_import_cleanup( $file['id'] );
|
33 |
+
return $result
|
34 |
+
->set_error(sprintf( __( 'The export file could not be found at <code>%s</code>. It is likely that this was caused by a permissions problem.', 'jquery-pin-it-button-for-images' ), esc_html( $file['file'] ) ))
|
35 |
+
->build();
|
36 |
+
}
|
37 |
+
|
38 |
+
if ( ! is_file( $file['file'] ) ) {
|
39 |
+
wp_import_cleanup( $file['id'] );
|
40 |
+
return $result
|
41 |
+
->set_error(__( 'The path is not a file, please try again.', 'jquery-pin-it-button-for-images' ))
|
42 |
+
->build();
|
43 |
+
}
|
44 |
+
|
45 |
+
$file_contents = file_get_contents( $file['file'] );
|
46 |
+
$data = json_decode( $file_contents, true );
|
47 |
+
wp_import_cleanup( $file['id']);
|
48 |
+
|
49 |
+
$options_to_import = $data['options'];
|
50 |
+
foreach ( (array)$options_to_import as $option_name => $option_value ) {
|
51 |
+
$options_to_import[$option_name] = maybe_unserialize( $option_value );
|
52 |
+
}
|
53 |
+
|
54 |
+
$converter = new JPIBFI_Option_Converter();
|
55 |
+
$converter->save_and_convert_if_needed($options_to_import);
|
56 |
+
|
57 |
+
return $result
|
58 |
+
->set_model($input)
|
59 |
+
->set_message(__('Import Successful', 'jquery_pin_it_button_for_images'))
|
60 |
+
->build();
|
61 |
+
}
|
62 |
+
|
63 |
+
function filter_settings_i18n($i18n) {
|
64 |
+
$i18n['export_title'] = __( 'Export', 'jquery-pin-it-button-for-images' );
|
65 |
+
$i18n['export_url'] = admin_url('export.php?download=true&content=jpibfi');
|
66 |
+
$i18n['export_button_text'] = __('Download Export File', 'jquery-pin-it-button-for-images');
|
67 |
+
|
68 |
+
$i18n['import_title'] = __( 'Import', 'jquery-pin-it-button-for-images' );
|
69 |
+
$i18n['import_button_text'] = __('Import Settings', 'jquery-pin-it-button-for-images');
|
70 |
+
$i18n['import_action_name'] = $this->ajax_import_action;
|
71 |
+
return $i18n;
|
72 |
+
}
|
73 |
+
|
74 |
+
function get_module_settings() {
|
75 |
+
return array (
|
76 |
+
'slug' => 'import',
|
77 |
+
'name' => __( 'Import/Export Settings', 'jquery-pin-it-button-for-images' ),
|
78 |
+
'priority' => 10,
|
79 |
+
'setting_name' => ''
|
80 |
+
);
|
81 |
+
}
|
82 |
+
|
83 |
+
/**
|
84 |
+
* @param array $args The export args being filtered.
|
85 |
+
* @return array The (possibly modified) export args.
|
86 |
+
*/
|
87 |
+
public function export_args( $args ) {
|
88 |
+
if ( ! empty( $_GET['content'] ) && 'jpibfi' == $_GET['content'] ) {
|
89 |
+
return array( 'jpibfi' => true );
|
90 |
+
}
|
91 |
+
return $args;
|
92 |
+
}
|
93 |
+
|
94 |
+
|
95 |
+
/**
|
96 |
+
* Export options as a JSON file if that's what the user wants to do.
|
97 |
+
*
|
98 |
+
* @param array $args The export arguments.
|
99 |
+
* @return void
|
100 |
+
*/
|
101 |
+
public function export_wp( $args ) {
|
102 |
+
if (empty($args['jpibfi']))
|
103 |
+
return;
|
104 |
+
|
105 |
+
$filename = 'jpibfi_settings_' . date( 'Y-m-d' ) . '.json';
|
106 |
+
|
107 |
+
header( 'Content-Description: File Transfer' );
|
108 |
+
header( 'Content-Disposition: attachment; filename=' . $filename );
|
109 |
+
header( 'Content-Type: application/json; charset=' . get_option( 'blog_charset' ), true );
|
110 |
+
|
111 |
+
$option_names = apply_filters('jpibfi_option_names', array ('jpibfi_options_version'));
|
112 |
+
|
113 |
+
$export_options = array();
|
114 |
+
|
115 |
+
foreach ( $option_names as $option_name ) {
|
116 |
+
|
117 |
+
$option_value = get_option( $option_name );
|
118 |
+
if ( $option_value !== false ) {
|
119 |
+
$export_options[ $option_name ] = maybe_serialize( $option_value );
|
120 |
+
}
|
121 |
+
}
|
122 |
+
$JSON_PRETTY_PRINT = defined( 'JSON_PRETTY_PRINT' ) ? JSON_PRETTY_PRINT : null;
|
123 |
+
echo json_encode( array( 'options' => $export_options ), $JSON_PRETTY_PRINT );
|
124 |
+
exit;
|
125 |
+
}
|
126 |
+
}
|
includes/admin/settings/class-jpibfi-selection-settings.php
ADDED
@@ -0,0 +1,133 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class JPIBFI_Selection_Settings extends JPIBFI_Settings_Base {
|
4 |
+
|
5 |
+
function filter_settings_i18n($i18n) {
|
6 |
+
$i18n['title'] = __('Selection settings', 'jquery-pin-it-button-for-images');
|
7 |
+
$i18n['image_resolution_label'] = __( 'Minimum image resolution', 'jquery-pin-it-button-for-images' );
|
8 |
+
$i18n['image_resolution_desc'] = __( 'Use this settings to hide the "Pin it" button on small images (e.g. social media icons).', 'jquery-pin-it-button-for-images' );
|
9 |
+
$i18n['image_resolution_desc_2'] = __( '* - screen that is less than 768 pixels wide', 'jquery-pin-it-button-for-images' );
|
10 |
+
// $i18n['min_image_resolution1'] = __('For small screens* the "Pin it" button will show up if the image is at least %% pixels high and %% pixels wide.', 'jquery-pin-it-button-for-images');
|
11 |
+
// $i18n['min_image_resolution2'] = __('Otherwise, the "Pin it" button will show up if the image is at least %% pixels high and %% pixels wide.', 'jquery-pin-it-button-for-images');
|
12 |
+
|
13 |
+
$i18n['show_on_field_label'] = __( 'On which pages the "Pin it" button should be shown', 'jquery-pin-it-button-for-images' );
|
14 |
+
$i18n['show_on_field_desc'] = __('Separate settings using commas. For the button to show up on a certain page, the page must be included in the "Show on" section and not included in the "Disable on" section. You can use the following settings:')
|
15 |
+
. '<p>'
|
16 |
+
. __( 'number (e.g. 588) - the ID of a certain page or post') . '<br/>'
|
17 |
+
. __( '[front] - front page') . '<br/>'
|
18 |
+
. __( '[single] - single posts') . '<br/>'
|
19 |
+
. __( '[page] - single pages') . '<br/>'
|
20 |
+
. __( '[archive] - archive pages') . '<br/>'
|
21 |
+
. __( '[search] - search pages') . '<br/>'
|
22 |
+
. __( '[category] - category pages') . '<br/>'
|
23 |
+
. __( '[home] - blog page') . '</p>';
|
24 |
+
return $i18n;
|
25 |
+
}
|
26 |
+
|
27 |
+
function get_module_settings() {
|
28 |
+
return array (
|
29 |
+
'slug' => 'select',
|
30 |
+
'name' => __('Selection', 'jquery-pin-it-button-for-images'),
|
31 |
+
'priority' => 0,
|
32 |
+
'setting_name' => $this->setting_name
|
33 |
+
);
|
34 |
+
}
|
35 |
+
|
36 |
+
function get_settings_configuration($params) {
|
37 |
+
|
38 |
+
$option_value = $this->options->get();
|
39 |
+
$res = array();
|
40 |
+
|
41 |
+
$res['image_selector'] = array (
|
42 |
+
'key' => 'image_selector',
|
43 |
+
'label' => __( 'Image selector', 'jquery-pin-it-button-for-images' ),
|
44 |
+
'desc' => sprintf ( __( 'jQuery selector for all the images that should have the "Pin it" button. Set the value to %s if you want the "Pin it" button to appear only on images in content or %s to appear on all images on site (including sidebar, header and footer). If you know a thing or two about jQuery, you might use your own selector. %sClick here%s to read about jQuery selectors.', 'jquery-pin-it-button-for-images' ),
|
45 |
+
'<strong>.jpibfi_container img</strong>',
|
46 |
+
'<strong>img</strong>',
|
47 |
+
'<a href="http://api.jquery.com/category/selectors/" target="_blank">',
|
48 |
+
'</a>'
|
49 |
+
)
|
50 |
+
);
|
51 |
+
|
52 |
+
$res['disabled_classes'] = array (
|
53 |
+
'key' => 'disabled_classes',
|
54 |
+
'label' => __( 'Disabled classes', 'jquery-pin-it-button-for-images' ),
|
55 |
+
'desc' => __( 'Pictures with these CSS classes won\'t show the "Pin it" button. Please separate multiple classes with semicolons. Spaces are not accepted.', 'jquery-pin-it-button-for-images' )
|
56 |
+
);
|
57 |
+
|
58 |
+
$res['enabled_classes'] = array (
|
59 |
+
'key' => 'enabled_classes',
|
60 |
+
'label' => __( 'Enabled classes', 'jquery-pin-it-button-for-images' ),
|
61 |
+
'desc' => __( 'Only pictures with these CSS classes will show the "Pin it" button. Please separate multiple classes with semicolons. If this field is empty, images with any (besides disabled ones) classes will show the Pin It button.', 'jquery-pin-it-button-for-images' ),
|
62 |
+
);
|
63 |
+
|
64 |
+
$local_args = array('min' => '0', 'step' => '1');
|
65 |
+
$res['min_image_height'] = array_merge($local_args, array('key' => 'min_image_height', 'label' => __('Height', 'jquery-pin-it-button-for-images')));
|
66 |
+
$res['min_image_width'] = array_merge($local_args, array('key' => 'min_image_width', 'label' => __('Width', 'jquery-pin-it-button-for-images')));
|
67 |
+
|
68 |
+
$res['min_image_height_small'] = array_merge($local_args, array('key' => 'min_image_height_small', 'label' => __('Height', 'jquery-pin-it-button-for-images')));
|
69 |
+
$res['min_image_width_small'] = array_merge($local_args, array('key' => 'min_image_width_small', 'label' => __('Width', 'jquery-pin-it-button-for-images')));
|
70 |
+
|
71 |
+
$res['show_on'] = array (
|
72 |
+
'key' => 'show_on',
|
73 |
+
'label' => __( 'Show on', 'jquery-pin-it-button-for-images' ),
|
74 |
+
);
|
75 |
+
|
76 |
+
$res['disable_on'] = array (
|
77 |
+
'key' => 'disable_on',
|
78 |
+
'label' => __( 'Disable on', 'jquery-pin-it-button-for-images' ),
|
79 |
+
);
|
80 |
+
|
81 |
+
foreach($res as $key => $setting) {
|
82 |
+
$res[$key]['value'] = $option_value[$key];
|
83 |
+
}
|
84 |
+
|
85 |
+
return $res;
|
86 |
+
}
|
87 |
+
|
88 |
+
function get_options() {
|
89 |
+
return new JPIBFI_Selection_Options();
|
90 |
+
}
|
91 |
+
|
92 |
+
public function sanitize_selection_options( $input ) {
|
93 |
+
|
94 |
+
$this->sanitize_input($input);
|
95 |
+
$output = $this->options->get();
|
96 |
+
|
97 |
+
$validator = new JPIBFI_Settings_Validator($input, $output);
|
98 |
+
|
99 |
+
foreach( $input as $key => $value ) {
|
100 |
+
switch($key) {
|
101 |
+
case 'disabled_classes':
|
102 |
+
case 'enabled_classes':
|
103 |
+
$field = 'disabled_classes' == $key
|
104 |
+
? __( 'Disabled classes', 'jquery-pin-it-button-for-images' )
|
105 |
+
: __( 'Enabled classes', 'jquery-pin-it-button-for-images' );
|
106 |
+
$error_message = $field . ' - ' . __('the given value doesn\'t meet the requirements. Please correct it and try again.', 'jquery-pin-it-button-for-images');
|
107 |
+
$validator->validate_css_class_list($key, $error_message, array());
|
108 |
+
break;
|
109 |
+
case 'min_image_height':
|
110 |
+
case 'min_image_width':
|
111 |
+
$field = 'min_image_height' == $key
|
112 |
+
? __( 'Minimum image height', 'jquery-pin-it-button-for-images' )
|
113 |
+
: __( 'Minimum image width', 'jquery-pin-it-button-for-images' );
|
114 |
+
$error_message = $field . ' - ' . sprintf ( __('value must be a number greater or equal to %d.', 'jquery-pin-it-button-for-images'), '0' );
|
115 |
+
$validator->validate_number($key, $error_message, array( 'min' => 0));
|
116 |
+
break;
|
117 |
+
default:
|
118 |
+
$output[$key] = $value;
|
119 |
+
break;
|
120 |
+
}
|
121 |
+
}
|
122 |
+
return $output;
|
123 |
+
}
|
124 |
+
|
125 |
+
function save_settings($input){
|
126 |
+
$result = new JPIBFI_Ajax_Result_Builder();
|
127 |
+
$this->options->update($input);
|
128 |
+
return $result
|
129 |
+
->set_model($input)
|
130 |
+
->set_message(__('Settings saved.', 'jquery-pin-it-button-for-images'))
|
131 |
+
->build();
|
132 |
+
}
|
133 |
+
}
|
includes/admin/settings/class-jpibfi-settings-base.php
ADDED
@@ -0,0 +1,121 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
abstract class JPIBFI_Settings_Tab {
|
4 |
+
|
5 |
+
protected abstract function get_module_settings();
|
6 |
+
|
7 |
+
protected $ajax_custom_action;
|
8 |
+
|
9 |
+
function __construct() {
|
10 |
+
$this->ajax_custom_action = 'jpibfi_settings_custom';
|
11 |
+
add_action( 'wp_ajax_' . $this->ajax_custom_action, array($this, 'ajax_custom') );
|
12 |
+
add_filter( 'jpibfi_settings_ajax', array($this, 'filter_settings_ajax_custom'));
|
13 |
+
add_filter( 'jpibfi_settings_tabs', array($this, 'filter_settings_tab'));
|
14 |
+
|
15 |
+
$module_settings = $this->get_module_settings();
|
16 |
+
$slug = $module_settings['slug'];
|
17 |
+
add_filter('jpibfi_settings_i18n_' . $slug, array($this, 'filter_settings_i18n'));
|
18 |
+
}
|
19 |
+
|
20 |
+
function ajax_custom() {
|
21 |
+
check_ajax_referer( $this->ajax_custom_action, 'nonce' );
|
22 |
+
if (!current_user_can( 'manage_options' ))
|
23 |
+
wp_die();
|
24 |
+
|
25 |
+
$action = $_REQUEST['name'];
|
26 |
+
$result = apply_filters($this->ajax_custom_action . $action, array());
|
27 |
+
wp_send_json( $result );
|
28 |
+
}
|
29 |
+
|
30 |
+
function filter_settings_ajax_custom($ajax) {
|
31 |
+
$ajax['customAction'] = $this->ajax_custom_action;
|
32 |
+
$ajax['customActionNonce'] = wp_create_nonce( $this->ajax_custom_action );
|
33 |
+
return $ajax;
|
34 |
+
}
|
35 |
+
|
36 |
+
function filter_settings_i18n($i18n){
|
37 |
+
return $i18n;
|
38 |
+
}
|
39 |
+
|
40 |
+
function filter_settings_tab($tabs) {
|
41 |
+
$module_settings = $this->get_module_settings();
|
42 |
+
$tabs[] = $module_settings;
|
43 |
+
return $tabs;
|
44 |
+
}
|
45 |
+
}
|
46 |
+
|
47 |
+
abstract class JPIBFI_Settings_Base extends JPIBFI_Settings_Tab {
|
48 |
+
|
49 |
+
protected $ajax_save_action;
|
50 |
+
protected $options;
|
51 |
+
protected $settings_name;
|
52 |
+
|
53 |
+
function __construct() {
|
54 |
+
parent::__construct();
|
55 |
+
$this->ajax_save_action = 'jpibfi_settings_save';
|
56 |
+
$this->options = $this->get_options();
|
57 |
+
$this->settings_name = $this->options->get_option_name();
|
58 |
+
|
59 |
+
$module_settings = $this->get_module_settings();
|
60 |
+
$slug = $module_settings['slug'];
|
61 |
+
|
62 |
+
add_action( 'wp_ajax_' . $this->ajax_save_action, array($this, 'ajax_save_settings') );
|
63 |
+
add_filter( 'jpibfi_settings_ajax', array($this, 'filter_settings_ajax_settings'));
|
64 |
+
add_filter('jpibfi_option_names', array($this, 'add_option_name') );
|
65 |
+
add_filter('jpibfi_settings_configuration_' . $slug, array($this, 'filter_settings_configuration'));
|
66 |
+
add_filter('jpibfi_settings_save_' . $slug, array($this, 'filter_settings_save'));
|
67 |
+
add_filter('jpibfi_settings_i18n_' . $slug, array($this, 'filter_settings_i18n'));
|
68 |
+
|
69 |
+
}
|
70 |
+
|
71 |
+
public function add_option_name($arr) {
|
72 |
+
$arr[] = $this->settings_name;
|
73 |
+
return $arr;
|
74 |
+
}
|
75 |
+
|
76 |
+
function ajax_save_settings() {
|
77 |
+
check_ajax_referer( $this->ajax_save_action, 'nonce' );
|
78 |
+
if (!current_user_can( 'manage_options' ))
|
79 |
+
wp_die();
|
80 |
+
|
81 |
+
$slug = $_REQUEST['tab'];
|
82 |
+
$settings = json_decode(stripslashes($_REQUEST['settings']), true);
|
83 |
+
$update_result = apply_filters('jpibfi_settings_save_' . $slug, $settings);
|
84 |
+
wp_send_json( $update_result );
|
85 |
+
}
|
86 |
+
|
87 |
+
protected function get_checkbox_settings() {
|
88 |
+
return array();
|
89 |
+
}
|
90 |
+
|
91 |
+
protected abstract function get_options();
|
92 |
+
|
93 |
+
function filter_settings_ajax_settings($ajax) {
|
94 |
+
$ajax['saveSettingsAction'] = $this->ajax_save_action;
|
95 |
+
$ajax['saveSettingsNonce'] = wp_create_nonce( $this->ajax_save_action );
|
96 |
+
return $ajax;
|
97 |
+
}
|
98 |
+
|
99 |
+
function filter_settings_tab($tabs) {
|
100 |
+
$module_settings = $this->get_module_settings();
|
101 |
+
$tabs[] = $module_settings;
|
102 |
+
return $tabs;
|
103 |
+
}
|
104 |
+
|
105 |
+
function filter_settings_configuration($result){
|
106 |
+
return $this->get_settings_configuration($params);
|
107 |
+
}
|
108 |
+
|
109 |
+
function filter_settings_save($settings){
|
110 |
+
return $this->save_settings($settings);
|
111 |
+
}
|
112 |
+
|
113 |
+
function save_settings($input){
|
114 |
+
$result = new JPIBFI_Ajax_Result_Builder();
|
115 |
+
$this->options->update($input);
|
116 |
+
return $result
|
117 |
+
->set_model($input)
|
118 |
+
->set_message(__('Settings saved.', 'jquery-pin-it-button-for-images'))
|
119 |
+
->build();
|
120 |
+
}
|
121 |
+
}
|
includes/admin/settings/class-jpibfi-settings-validator.php
ADDED
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class JPIBFI_Settings_Validator {
|
4 |
+
|
5 |
+
private $input = null;
|
6 |
+
private $output = null;
|
7 |
+
|
8 |
+
function __construct($input_arr, &$output_arr){
|
9 |
+
$this->input = $input_arr;
|
10 |
+
$this->output = &$output_arr;
|
11 |
+
}
|
12 |
+
|
13 |
+
public function add_error($key, $error_text){
|
14 |
+
add_settings_error(
|
15 |
+
$key,
|
16 |
+
esc_attr( 'settings_updated' ),
|
17 |
+
$error_text
|
18 |
+
);
|
19 |
+
}
|
20 |
+
|
21 |
+
public function validate_number($key, $error_message, $validator_settings){
|
22 |
+
$this->validate($key, $error_message, 'v_number', $validator_settings);
|
23 |
+
}
|
24 |
+
|
25 |
+
public function validate_css_class_list($key, $error_message, $validation_settings){
|
26 |
+
$this->validate($key, $error_message, 'v_css_class_names', $validator_settings);
|
27 |
+
}
|
28 |
+
|
29 |
+
private function validate($key, $error_message, $validator_name, $validator_settings){
|
30 |
+
$value = $this->input[ $key ];
|
31 |
+
$valid = call_user_func( array($this, $validator_name), $value, $validator_settings);
|
32 |
+
$this->handle_validation_result($valid, $key, $error_message);
|
33 |
+
}
|
34 |
+
|
35 |
+
private function handle_validation_result($validation_result, $key, $error_message){
|
36 |
+
if ( $validation_result ){
|
37 |
+
$this->output[ $key ] = $this->input[ $key ];
|
38 |
+
} else {
|
39 |
+
$this->add_error($key, $error_message);
|
40 |
+
}
|
41 |
+
}
|
42 |
+
|
43 |
+
/* V FUNCTIONS */
|
44 |
+
|
45 |
+
/* Checks if given string contains class names separated by semicolons or is empty */
|
46 |
+
private function v_css_class_names( $str, $settings ) {
|
47 |
+
if ( 0 == strlen( $str ) )
|
48 |
+
return true;
|
49 |
+
|
50 |
+
$names = explode( ';', $str );
|
51 |
+
$only_class_names = true;
|
52 |
+
|
53 |
+
for( $i = 0; $i < count( $names ) && $only_class_names; $i++ )
|
54 |
+
$only_class_names = 1 == preg_match( "/^-?[_a-zA-Z]+[_a-zA-Z0-9-]*$/", $names [ $i ] );
|
55 |
+
|
56 |
+
return $only_class_names;
|
57 |
+
}
|
58 |
+
|
59 |
+
private function v_number($value, $settings){
|
60 |
+
if (isset($settings['required']) && false == $settings['required'] && '' == $value)
|
61 |
+
return true;
|
62 |
+
|
63 |
+
return is_numeric($value)
|
64 |
+
&& (!isset($settings[ 'min' ]) || $value >= $settings['min'])
|
65 |
+
&& (!isset($settings[ 'max' ]) || $value <= $settings['max']);
|
66 |
+
}
|
67 |
+
|
68 |
+
/* END V FUNCTIONS */
|
69 |
+
}
|
includes/admin/settings/class-jpibfi-visual-settings.php
ADDED
@@ -0,0 +1,167 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class JPIBFI_Visual_Settings extends JPIBFI_Settings_Base {
|
4 |
+
|
5 |
+
function filter_settings_i18n($i18n) {
|
6 |
+
$i18n['margins_label'] = __( '"Pin it" button margins', 'jquery-pin-it-button-for-images' );
|
7 |
+
$i18n['margins_desc'] = sprintf( __( 'Margins are used to adjust the position of the "Pin it" button, but not all margins are used on all button positions. Here is an example. If you\'re using the "%s" position, the button\'s position will be affected only by top and left margins. Bottom and right margins affect "%s" position, etc. The "%s" position does not use any margins at all.', 'jquery-pin-it-button-for-images' ),
|
8 |
+
__( 'Top left', 'jquery-pin-it-button-for-images' ),
|
9 |
+
__( 'Bottom right', 'jquery-pin-it-button-for-images' ),
|
10 |
+
__( 'Middle', 'jquery-pin-it-button-for-images' )
|
11 |
+
);
|
12 |
+
$i18n['custom_button_label'] = __( 'Custom "Pin It" button', 'jquery-pin-it-button-for-images' );
|
13 |
+
$i18n['custom_button_desc'] = __( 'Check the <b>Use custom image</b> checkbox, specify image\'s URL, height and width to use your own Pinterest button design. You can just upload an image using Wordpress media library if you wish.', 'jquery-pin-it-button-for-images' );
|
14 |
+
$i18n['custom_button_preview'] = __( 'Custom Pin It button preview', 'jquery-pin-it-button-for-images' );
|
15 |
+
$i18n['custom_button_upload'] = __( 'Upload an image using media library','jquery-pin-it-button-for-images');
|
16 |
+
$i18n['custom_button_frame_title'] = __('Select your custom "Pin It" button', 'jquery-pin-it-button-for-images');
|
17 |
+
$i18n['custom_button_frame_button_text'] = __('Use as "Pin It" button', 'jquery-pin-it-button-for-images');
|
18 |
+
$i18n['pro_feature_error'] = sprintf(__('This feature is disabled in this version of the plugin. Consider buying <a target="_blank" href="%s">the PRO version</a>.', 'jquery-pin-it-button-for-images'), 'http://mrsztuczkens.me/jpibfi-pro/');
|
19 |
+
|
20 |
+
return $i18n;
|
21 |
+
}
|
22 |
+
|
23 |
+
function get_module_settings() {
|
24 |
+
return array (
|
25 |
+
'slug' => 'visual',
|
26 |
+
'name' => __( 'Visual', 'jquery-pin-it-button-for-images' ),
|
27 |
+
'priority' => 1,
|
28 |
+
'setting_name' => $this->setting_name
|
29 |
+
);
|
30 |
+
}
|
31 |
+
|
32 |
+
function get_options() {
|
33 |
+
return new JPIBFI_Visual_Options();
|
34 |
+
}
|
35 |
+
|
36 |
+
function get_settings_configuration($params) {
|
37 |
+
|
38 |
+
$option_value = $this->options->get();
|
39 |
+
$res = array();
|
40 |
+
|
41 |
+
$res['show_button'] = array (
|
42 |
+
'key' => 'show_button',
|
43 |
+
'label' => __( 'Show button', 'jquery-pin-it-button-for-images' ),
|
44 |
+
'options' => array (
|
45 |
+
'hover' => __( 'On hover', 'jquery-pin-it-button-for-images' ),
|
46 |
+
'always_touch' => __( 'Always on touch devices', 'jquery-pin-it-button-for-images' ),
|
47 |
+
'always' => __( 'Always', 'jquery-pin-it-button-for-images' )
|
48 |
+
),
|
49 |
+
'desc' => __( 'When the "Pin it" button should be visible.', 'jquery-pin-it-button-for-images' )
|
50 |
+
);
|
51 |
+
|
52 |
+
$margin_args = array ('min' => '0', 'step' => '1', 'unit' => 'px');
|
53 |
+
$res['button_margin_bottom'] = array_merge($margin_args, array('key' => 'button_margin_bottom', 'label' => __('Bottom', 'jquery-pin-it-button-for-images')));
|
54 |
+
$res['button_margin_top'] = array_merge($margin_args, array('key' => 'button_margin_top', 'label' => __('Top', 'jquery-pin-it-button-for-images')));
|
55 |
+
$res['button_margin_left'] = array_merge($margin_args, array('key' => 'button_margin_left', 'label' => __('Left', 'jquery-pin-it-button-for-images')));
|
56 |
+
$res['button_margin_right'] = array_merge($margin_args, array('key' => 'button_margin_right', 'label' => __('Right', 'jquery-pin-it-button-for-images')));
|
57 |
+
|
58 |
+
$res['button_position'] = array (
|
59 |
+
'key' => 'button_position',
|
60 |
+
'label' => __( '"Pin it" button position', 'jquery-pin-it-button-for-images' ),
|
61 |
+
'options' => array (
|
62 |
+
'top-left' => __( 'Top left', 'jquery-pin-it-button-for-images' ),
|
63 |
+
'top-right' => __( 'Top right', 'jquery-pin-it-button-for-images' ),
|
64 |
+
'bottom-left' => __( 'Bottom left', 'jquery-pin-it-button-for-images' ),
|
65 |
+
'bottom-right' => __( 'Bottom right', 'jquery-pin-it-button-for-images' ),
|
66 |
+
'middle' => __( 'Middle', 'jquery-pin-it-button-for-images' )
|
67 |
+
),
|
68 |
+
'desc' => __( 'Where the "Pin it" button should appear on the image.', 'jquery-pin-it-button-for-images' )
|
69 |
+
);
|
70 |
+
|
71 |
+
$res['description_option'] = array (
|
72 |
+
'key' => 'description_option',
|
73 |
+
'label' => __( 'Description source', 'jquery-pin-it-button-for-images' ),
|
74 |
+
'options' => array (
|
75 |
+
"post_title" => __( 'Post title', 'jquery-pin-it-button-for-images' ),
|
76 |
+
"post_excerpt" => __( 'Post description (excerpt)', 'jquery-pin-it-button-for-images' ),
|
77 |
+
"img_title" => __( 'Image title attribute', 'jquery-pin-it-button-for-images' ),
|
78 |
+
"site_title" => __( 'Site title (Settings->General)', 'jquery-pin-it-button-for-images' ),
|
79 |
+
"img_description" => __( 'Image description', 'jquery-pin-it-button-for-images' ),
|
80 |
+
"img_caption" => __('Image caption', 'jquery-pin-it-button-for-images' ),
|
81 |
+
"img_alt" => __( 'Image alt attribute', 'jquery-pin-it-button-for-images' )
|
82 |
+
),
|
83 |
+
'desc' => __( 'From where the Pinterest message should be taken. Check which sources should be considered and prioritize them by dragging and dropping. The description will come from the top source that has data. Please note that "Image description" and "Image caption" work properly only for images that were added to your Media Library.', 'jquery-pin-it-button-for-images' )
|
84 |
+
);
|
85 |
+
|
86 |
+
$res['pinLinkedImages'] = array (
|
87 |
+
'key' => 'pinLinkedImages',
|
88 |
+
'label' => __('Pin linked images', 'jquery-pin-it-button-for-images'),
|
89 |
+
'text' => __('Active', 'jquery-pin-it-button-for-images'),
|
90 |
+
'desc' => __('When checked, pins full-sized images instead of thumbnails (works only if you link thumbnails to their full versions).', 'jquery-pin-it-button-for-images')
|
91 |
+
);
|
92 |
+
|
93 |
+
$res['transparency_value'] = array (
|
94 |
+
'key' => 'transparency_value',
|
95 |
+
'label' => __('Transparency value', 'jquery-pin-it-button-for-images'),
|
96 |
+
'desc' => sprintf ( __('Choose transparency (between %.02f and %.02f)', 'jquery-pin-it-button-for-images'), '0.00', '1.00' ),
|
97 |
+
'min' => '0',
|
98 |
+
'max' => '1',
|
99 |
+
'step' => '0.01'
|
100 |
+
);
|
101 |
+
|
102 |
+
$res['use_custom_image'] = array (
|
103 |
+
'key' => 'use_custom_image',
|
104 |
+
'text' => __( 'Use custom image', 'jquery-pin-it-button-for-images' )
|
105 |
+
);
|
106 |
+
|
107 |
+
$res['custom_image_url'] = array (
|
108 |
+
'key' => 'custom_image_url',
|
109 |
+
'label' => __( 'URL address of the image', 'jquery-pin-it-button-for-images' )
|
110 |
+
);
|
111 |
+
|
112 |
+
$image_size = array ('min' => '0', 'step' => '1', 'unit' => 'px');
|
113 |
+
$res['custom_image_height'] = array_merge($margin_args, array('key' => 'custom_image_height', 'label' => __( 'Height', 'jquery-pin-it-button-for-images' )));
|
114 |
+
$res['custom_image_width'] = array_merge($margin_args, array('key' => 'custom_image_width', 'label' => __('Width', 'jquery-pin-it-button-for-images')));
|
115 |
+
|
116 |
+
foreach($res as $key => $setting) {
|
117 |
+
$res[$key]['value'] = $option_value[$key];
|
118 |
+
}
|
119 |
+
|
120 |
+
return $res;
|
121 |
+
}
|
122 |
+
|
123 |
+
public function visual_options_callback() {
|
124 |
+
echo '<p>' . __('How it should look like', 'jquery-pin-it-button-for-images') . '</p>';
|
125 |
+
}
|
126 |
+
|
127 |
+
public function sanitize_visual_options( $input ) {
|
128 |
+
|
129 |
+
$this->sanitize_input( $input );
|
130 |
+
$output = $this->options->get();
|
131 |
+
|
132 |
+
$validator = new JPIBFI_Settings_Validator($input, $output);
|
133 |
+
|
134 |
+
foreach( $input as $key => $value ) {
|
135 |
+
|
136 |
+
switch($key) {
|
137 |
+
case 'custom_image_height':
|
138 |
+
case 'custom_image_width':
|
139 |
+
$name = "";
|
140 |
+
if ( 'custom_image_height' == $key )
|
141 |
+
$name = __('Custom image height', 'jquery-pin-it-button-for-images' );
|
142 |
+
else if ( 'custom_image_width' == $key )
|
143 |
+
$name = __('Custom image width', 'jquery-pin-it-button-for-images' );
|
144 |
+
$error_message = $name . ' - ' . sprintf ( __('value must be empty or a number greater or equal to %d.', 'jquery-pin-it-button-for-images'), '0' );
|
145 |
+
$validator->validate_number($key, $error_message, array( 'min' => 0, 'required' => false));
|
146 |
+
break;
|
147 |
+
case 'transparency_value':
|
148 |
+
$error_message = sprintf( __('Transparency value must be a number between %.02d and %.02f.', 'jquery-pin-it-button-for-images'), '0.00', '1.00' );
|
149 |
+
$validator->validate_number($key, $error_message, array( 'min' => 0.0, 'max' => 1.0));
|
150 |
+
break;
|
151 |
+
default:
|
152 |
+
$output[ $key ] = $value;
|
153 |
+
break;
|
154 |
+
}
|
155 |
+
}
|
156 |
+
return $this->options->sanitize($output);
|
157 |
+
}
|
158 |
+
|
159 |
+
function save_settings($input){
|
160 |
+
$result = new JPIBFI_Ajax_Result_Builder();
|
161 |
+
$this->options->update($input);
|
162 |
+
return $result
|
163 |
+
->set_model($input)
|
164 |
+
->set_message(__('Settings saved.', 'jquery-pin-it-button-for-images'))
|
165 |
+
->build();
|
166 |
+
}
|
167 |
+
}
|
includes/admin/settings/index.php
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<?php //May the force be with you
|
includes/admin/views/admin.php
DELETED
@@ -1,38 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
?>
|
4 |
-
<div class="wrap">
|
5 |
-
|
6 |
-
<h2><?php _e( 'jQuery Pin It Button For Images Options', 'jquery-pin-it-button-for-images' ); ?></h2>
|
7 |
-
<?php
|
8 |
-
$tab = isset( $_GET[ 'tab' ] ) ? $_GET[ 'tab' ] : 'selection_options';
|
9 |
-
$tab_found = false;
|
10 |
-
foreach( $settings_tabs as $tab_name => $tab_settings)
|
11 |
-
$tab_found = $tab_found || ( $tab_name == $tab );
|
12 |
-
|
13 |
-
$tab = false == $tab_found ? 'selection_options' : $tab;
|
14 |
-
$current_settings = $settings_tabs[ $tab ];
|
15 |
-
?>
|
16 |
-
<div id="icon-plugins" class="icon32"></div>
|
17 |
-
<h2 class="nav-tab-wrapper">
|
18 |
-
<?php foreach( $settings_tabs as $tab_name => $settings) { ?>
|
19 |
-
<a href="?page=jpibfi_settings&tab=<?php echo $tab_name; ?>" class="nav-tab <?php echo $tab_name == $tab ? 'nav-tab-active' : ''; ?>"><?php echo $settings['tab_label']; ?></a>
|
20 |
-
<?php } ?>
|
21 |
-
</h2>
|
22 |
-
<p>
|
23 |
-
<a href="http://mrsztuczkens.me/how-to-get-the-most-out-of-jpibfi/" class="button" target="_blank" rel="nofollow"><b><?php _e( 'How to Get The Most Out of JPIBFI', 'jquery-pin-it-button-for-images' ); ?></b></a>
|
24 |
-
<a href="http://wordpress.org/support/plugin/jquery-pin-it-button-for-images" class="button" target="_blank" rel="nofollow"><b><?php _e( 'Support forum', 'jquery-pin-it-button-for-images' ); ?></b></a>
|
25 |
-
</p>
|
26 |
-
<?php if ($tab != 'import_export'): ?>
|
27 |
-
<form method="post" action="options.php">
|
28 |
-
<?php endif; ?>
|
29 |
-
<?php
|
30 |
-
settings_fields( $current_settings[ 'settings_name'] );
|
31 |
-
do_settings_sections( $current_settings[ 'settings_name'] );
|
32 |
-
if ($tab != 'import_export')
|
33 |
-
submit_button();
|
34 |
-
?>
|
35 |
-
<?php if ($tab != 'import_export'): ?>
|
36 |
-
</form>
|
37 |
-
<?php endif; ?>
|
38 |
-
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/class-jpibfi-globals.php
DELETED
@@ -1,41 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* Stores basic plugin info like all the urls and directories needed
|
5 |
-
*/
|
6 |
-
class JPIBFI_Globals {
|
7 |
-
|
8 |
-
private static $plugin_dir;
|
9 |
-
private static $plugin_file;
|
10 |
-
private static $plugin_url;
|
11 |
-
private static $version;
|
12 |
-
private static $version_minor;
|
13 |
-
|
14 |
-
public static function init( $plugin_file, $version, $version_minor ){
|
15 |
-
self::$plugin_file = $plugin_file;
|
16 |
-
self::$plugin_dir = plugin_dir_path( self::$plugin_file );
|
17 |
-
self::$plugin_url = plugin_dir_url( self::$plugin_file );
|
18 |
-
self::$version = $version;
|
19 |
-
self::$version_minor = $version_minor;
|
20 |
-
}
|
21 |
-
|
22 |
-
public static function get_plugin_dir() {
|
23 |
-
return self::$plugin_dir;
|
24 |
-
}
|
25 |
-
|
26 |
-
public static function get_plugin_file() {
|
27 |
-
return self::$plugin_file;
|
28 |
-
}
|
29 |
-
|
30 |
-
public static function get_plugin_url() {
|
31 |
-
return self::$plugin_url;
|
32 |
-
}
|
33 |
-
|
34 |
-
public static function get_version() {
|
35 |
-
return self::$version;
|
36 |
-
}
|
37 |
-
|
38 |
-
public static function get_file_version(){
|
39 |
-
return self::$version . self::$version_minor;
|
40 |
-
}
|
41 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/class-jpibfi.php
ADDED
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class JPIBFI {
|
4 |
+
|
5 |
+
private $version;
|
6 |
+
private $file;
|
7 |
+
|
8 |
+
function __construct($file, $version){
|
9 |
+
|
10 |
+
$this->file = $file;
|
11 |
+
$this->version = $version;
|
12 |
+
|
13 |
+
$this->load_dependencies();
|
14 |
+
$this->load_textdomain();
|
15 |
+
|
16 |
+
register_activation_hook( $file, array( $this, 'update_plugin' ) );
|
17 |
+
add_action( 'plugins_loaded', array( $this, 'update_plugin' ) );
|
18 |
+
}
|
19 |
+
|
20 |
+
function load_dependencies(){
|
21 |
+
|
22 |
+
require_once 'includes/class-jpibfi-includes.php';
|
23 |
+
new JPIBFI_Includes();
|
24 |
+
|
25 |
+
if (is_admin()){
|
26 |
+
require_once 'admin/class-jpibfi-admin.php';
|
27 |
+
new JPIBFI_Admin($this->file, $this->version);
|
28 |
+
} else {
|
29 |
+
require_once 'public/class-jpibfi-client.php';
|
30 |
+
new JPIBFI_Client($this->file, $this->version);
|
31 |
+
}
|
32 |
+
}
|
33 |
+
|
34 |
+
function load_textdomain() {
|
35 |
+
load_plugin_textdomain( 'jquery-pin-it-button-for-images', FALSE, dirname( plugin_basename( $this->file ) ) . '/languages/' );
|
36 |
+
}
|
37 |
+
|
38 |
+
public function update_plugin() {
|
39 |
+
$version_option = 'jpibfi_version';
|
40 |
+
|
41 |
+
$version = get_option( $version_option );
|
42 |
+
if ( $this->version == $version )
|
43 |
+
return;
|
44 |
+
|
45 |
+
update_option( $version_option, $this->version );
|
46 |
+
update_option( 'jpibfi_pro_ad', 1 );
|
47 |
+
|
48 |
+
$converter = new JPIBFI_Option_Converter();
|
49 |
+
$converter->convert_if_needed();
|
50 |
+
}
|
51 |
+
}
|
includes/consts/jpibfi-description-option.php
DELETED
@@ -1,11 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
abstract class JPIBFIDescriptionOption
|
4 |
-
{
|
5 |
-
const PageTitle = 1;
|
6 |
-
const PageDescription = 2;
|
7 |
-
const ImageTitleOrAlt = 3;
|
8 |
-
const SiteTitle = 4;
|
9 |
-
const ImageDescription = 5;
|
10 |
-
const ImageAlt = 6;
|
11 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/includes/class-jpibfi-includes.php
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class JPIBFI_Includes {
|
4 |
+
|
5 |
+
function __construct(){
|
6 |
+
$this->load_dependencies();
|
7 |
+
}
|
8 |
+
|
9 |
+
function load_dependencies(){
|
10 |
+
|
11 |
+
$deps = array(
|
12 |
+
'options/class-jpibfi-options.php',
|
13 |
+
'options/class-jpibfi-selection-options.php',
|
14 |
+
'options/class-jpibfi-visual-options.php',
|
15 |
+
'class-jpibfi-option-converter.php'
|
16 |
+
);
|
17 |
+
|
18 |
+
foreach ($deps as $dep)
|
19 |
+
require_once $dep;
|
20 |
+
}
|
21 |
+
}
|
includes/includes/class-jpibfi-option-converter.php
ADDED
@@ -0,0 +1,169 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class JPIBFI_Option_Converter {
|
4 |
+
|
5 |
+
private $selection_options;
|
6 |
+
private $visual_options;
|
7 |
+
|
8 |
+
private $converted_option_name;
|
9 |
+
private $converted_option_value;
|
10 |
+
|
11 |
+
public function __construct() {
|
12 |
+
$this->selection_options = new JPIBFI_Selection_Options();
|
13 |
+
$this->visual_options = new JPIBFI_Visual_Options();
|
14 |
+
|
15 |
+
$this->converted_option_name = 'jpibfi_options_version';
|
16 |
+
$this->converted_option_value = '2.0';
|
17 |
+
}
|
18 |
+
|
19 |
+
public function convert_if_needed() {
|
20 |
+
$converted_val = get_option( $this->converted_option_name );
|
21 |
+
if ( $this->converted_option_value === $converted_val )
|
22 |
+
return;
|
23 |
+
|
24 |
+
$selection_options = get_option( 'jpibfi_selection_options' );
|
25 |
+
if ( $selection_options ) {
|
26 |
+
$selection_options = $this->convert_selection_options( $selection_options );
|
27 |
+
$this->selection_options->update( $selection_options );
|
28 |
+
}
|
29 |
+
|
30 |
+
$visual_options = get_option( 'jpibfi_visual_options' );
|
31 |
+
if ( $visual_options ) {
|
32 |
+
$visual_options = $this->convert_visual_options( $visual_options );
|
33 |
+
$this->visual_options->update( $visual_options );
|
34 |
+
}
|
35 |
+
$this->finish();
|
36 |
+
}
|
37 |
+
|
38 |
+
public function save_and_convert_if_needed($imported_options) {
|
39 |
+
if ( !is_array( $imported_options ) )
|
40 |
+
return;
|
41 |
+
if ( $imported_options[ $this->converted_option_name ] == $this->converted_option_value )
|
42 |
+
return;
|
43 |
+
|
44 |
+
$selection_options = $imported_options[ 'jpibfi_selection_options' ];
|
45 |
+
if ( $selection_options ) {
|
46 |
+
$selection_options = $this->convert_selection_options( $selection_options );
|
47 |
+
$this->selection_options->update( $selection_options );
|
48 |
+
}
|
49 |
+
|
50 |
+
$visual_options = $imported_options[ 'jpibfi_visual_options' ];
|
51 |
+
if ( $visual_options ) {
|
52 |
+
$visual_options = $this->convert_visual_options( $visual_options );
|
53 |
+
$this->visual_options->update( $visual_options );
|
54 |
+
}
|
55 |
+
|
56 |
+
$this->finish();
|
57 |
+
}
|
58 |
+
|
59 |
+
private function convert_selection_options($options) {
|
60 |
+
$new_options = array (
|
61 |
+
'image_selector' => $options['image_selector'],
|
62 |
+
'disabled_classes' => $options['disabled_classes'],
|
63 |
+
'enabled_classes' => $options['enabled_classes'],
|
64 |
+
'min_image_height' => is_numeric( $options['min_image_height'] ) ? intval( $options['min_image_height'] ) : 0,
|
65 |
+
'min_image_height_small' => is_numeric( $options['min_image_height'] ) ? intval( $options['min_image_height'] ) : 0,
|
66 |
+
'min_image_width' => is_numeric( $options['min_image_width'] ) ? intval( $options['min_image_width'] ) : 0,
|
67 |
+
'min_image_width_small' => is_numeric( $options['min_image_width'] ) ? intval( $options['min_image_width'] ) : 0,
|
68 |
+
'show_on' => $this->create_show_on( $options ),
|
69 |
+
'disable_on' => $this->create_disable_on()
|
70 |
+
);
|
71 |
+
$defaults = $this->selection_options->get_default_options();
|
72 |
+
return array_merge($defaults, $new_options);
|
73 |
+
}
|
74 |
+
|
75 |
+
private function create_show_on($selection_settings) {
|
76 |
+
$show_on = array ();
|
77 |
+
if ($selection_settings['show_on_home'] == "1")
|
78 |
+
$show_on[] = '[front]';
|
79 |
+
|
80 |
+
if ($selection_settings['show_on_single'] == "1")
|
81 |
+
$show_on[] = '[single]';
|
82 |
+
|
83 |
+
if ($selection_settings['show_on_page'] == "1")
|
84 |
+
$show_on[] = '[page]';
|
85 |
+
|
86 |
+
if ($selection_settings['show_on_category'] == "1") {
|
87 |
+
$show_on[] = '[category]';
|
88 |
+
$show_on[] = '[archive]';
|
89 |
+
$show_on[] = '[search]';
|
90 |
+
}
|
91 |
+
|
92 |
+
if ($selection_settings['show_on_blog'] == "1")
|
93 |
+
$show_on[] = '[home]';
|
94 |
+
|
95 |
+
return implode(',', $show_on);
|
96 |
+
}
|
97 |
+
|
98 |
+
private function create_disable_on() {
|
99 |
+
$result = array ();
|
100 |
+
$args = array(
|
101 |
+
'post_type' => array ( 'page', 'post' ),
|
102 |
+
'meta_query' => array (
|
103 |
+
array ( 'key' => 'jpibfi_meta' )
|
104 |
+
)
|
105 |
+
);
|
106 |
+
$my_query = new WP_Query( $args );
|
107 |
+
if( $my_query->have_posts() ) {
|
108 |
+
while( $my_query->have_posts() ) {
|
109 |
+
$my_query->the_post();
|
110 |
+
$post_meta = get_post_meta( get_the_ID(), 'jpibfi_meta', true );
|
111 |
+
if ( array_key_exists( 'jpibfi_disable_for_post', $post_meta ) && '1' == $post_meta['jpibfi_disable_for_post'] ) {
|
112 |
+
$result[] = get_the_ID();
|
113 |
+
}
|
114 |
+
}
|
115 |
+
}
|
116 |
+
wp_reset_postdata();
|
117 |
+
return implode(',', $result);
|
118 |
+
}
|
119 |
+
|
120 |
+
private function convert_visual_options($options) {
|
121 |
+
$new_options = array (
|
122 |
+
'show_button' => $options['show_button'],
|
123 |
+
'button_margin_bottom' => is_numeric( $options['button_margin_bottom'] ) ? intval( $options['button_margin_bottom'] ) : 0,
|
124 |
+
'button_margin_top' => is_numeric( $options['button_margin_top'] ) ? intval( $options['button_margin_top'] ) : 0,
|
125 |
+
'button_margin_left' => is_numeric( $options['button_margin_left'] ) ? intval( $options['button_margin_left'] ) : 0,
|
126 |
+
'button_margin_right' => is_numeric( $options['button_margin_right'] ) ? intval( $options['button_margin_right'] ) : 0,
|
127 |
+
'button_position' => $this->convert_button_position( $options['button_position'] ),
|
128 |
+
'description_option' => $this->convert_description_option( $options['description_option'] ),
|
129 |
+
'pinLinkedImages' => $options['pinLinkedImages'] == '1',
|
130 |
+
'transparency_value' => is_numeric( $options['transparency_value'] ) ? floatval( $options['transparency_value'] ) : 0.5,
|
131 |
+
'use_custom_image' => $options['use_custom_image'] == '1',
|
132 |
+
'custom_image_url' => $options['custom_image_url'],
|
133 |
+
'custom_image_height' => is_numeric( $options['custom_image_height'] ) ? intval( $options['custom_image_height'] ) : 0,
|
134 |
+
'custom_image_width' => is_numeric( $options['custom_image_width'] ) ? intval( $options['custom_image_width'] ) : 0
|
135 |
+
);
|
136 |
+
$defaults = $this->visual_options->get_default_options();
|
137 |
+
return array_merge($defaults, $new_options);
|
138 |
+
}
|
139 |
+
|
140 |
+
private function convert_button_position( $button_position ) {
|
141 |
+
switch ( $button_position ){
|
142 |
+
case '0': return 'top-left';
|
143 |
+
case '1': return 'top-right';
|
144 |
+
case '2': return 'bottom-left';
|
145 |
+
case '3': return 'bottom-right';
|
146 |
+
case '4': return 'middle';
|
147 |
+
default: return 'top-left';
|
148 |
+
}
|
149 |
+
}
|
150 |
+
|
151 |
+
private function convert_description_option( $description_option ) {
|
152 |
+
switch( $description_option ) {
|
153 |
+
case '1': return array ( 'post_title' );
|
154 |
+
case '2': return array ( 'post_excerpt' );
|
155 |
+
case '3': return array ( 'img_title' );
|
156 |
+
case '4': return array ( 'site_title' );
|
157 |
+
case '5': return array ( 'img_description' );
|
158 |
+
case '6': return array ( 'img_alt' );
|
159 |
+
default: return array ( 'img_title', 'img_alt', 'post_title' );
|
160 |
+
}
|
161 |
+
}
|
162 |
+
|
163 |
+
private function finish() {
|
164 |
+
update_option( $this->converted_option_name, $this->converted_option_value );
|
165 |
+
delete_option( 'jpibfi_advanced_options' );
|
166 |
+
delete_option( 'jpibfi_lightbox_options' );
|
167 |
+
delete_post_meta_by_key( 'jpibfi_meta' );
|
168 |
+
}
|
169 |
+
}
|
includes/{admin/views → includes}/index.php
RENAMED
File without changes
|
includes/includes/options/class-jpibfi-options.php
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
abstract class JPIBFI_Options {
|
4 |
+
|
5 |
+
abstract protected function get_option_name();
|
6 |
+
|
7 |
+
abstract protected function get_default_options();
|
8 |
+
|
9 |
+
protected function sanitize($input){
|
10 |
+
return $input;
|
11 |
+
}
|
12 |
+
|
13 |
+
public function get() {
|
14 |
+
$db_options = get_option( $this->get_option_name() );
|
15 |
+
$db_options = $db_options != false ? $db_options : array();
|
16 |
+
$defaults = $this->get_default_options();
|
17 |
+
$merged = array_merge($defaults, $db_options);
|
18 |
+
return $this->sanitize($merged);
|
19 |
+
}
|
20 |
+
|
21 |
+
public function update( $val ) {
|
22 |
+
update_option( $this->get_option_name(), $val );
|
23 |
+
}
|
24 |
+
}
|
includes/includes/options/class-jpibfi-selection-options.php
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class JPIBFI_Selection_Options extends JPIBFI_Options {
|
4 |
+
|
5 |
+
function get_default_options() {
|
6 |
+
$defaults = array(
|
7 |
+
'image_selector' => '.jpibfi_container img',
|
8 |
+
'disabled_classes' => 'wp-smiley;nopin',
|
9 |
+
'enabled_classes' => '',
|
10 |
+
'min_image_height' => 0,
|
11 |
+
'min_image_height_small' => 0,
|
12 |
+
'min_image_width' => 0,
|
13 |
+
'min_image_width_small' => 0,
|
14 |
+
'show_on' => '[front],[home],[single],[page],[archive],[search],[category]',
|
15 |
+
'disable_on' => ''
|
16 |
+
);
|
17 |
+
return $defaults;
|
18 |
+
}
|
19 |
+
|
20 |
+
function get_option_name() {
|
21 |
+
return 'jpibfi_selection_options';
|
22 |
+
}
|
23 |
+
}
|
includes/includes/options/class-jpibfi-visual-options.php
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class JPIBFI_Visual_Options extends JPIBFI_Options {
|
4 |
+
|
5 |
+
private $image_height = 41;
|
6 |
+
private $image_width = 65;
|
7 |
+
|
8 |
+
function get_default_options() {
|
9 |
+
$defaults = array(
|
10 |
+
'show_button' => 'hover',
|
11 |
+
'button_margin_bottom' => 20,
|
12 |
+
'button_margin_top' => 20,
|
13 |
+
'button_margin_left' => 20,
|
14 |
+
'button_margin_right' => 20,
|
15 |
+
'button_position' => 'top-left',
|
16 |
+
'description_option' => array ( 'img_title', 'img_alt', 'post_title' ),
|
17 |
+
'pinLinkedImages' => true,
|
18 |
+
'transparency_value' => 0.5,
|
19 |
+
'use_custom_image' => false,
|
20 |
+
'custom_image_url' => '',
|
21 |
+
'custom_image_height' => 0,
|
22 |
+
'custom_image_width' => 0
|
23 |
+
);
|
24 |
+
return $defaults;
|
25 |
+
}
|
26 |
+
|
27 |
+
protected function sanitize($input){
|
28 |
+
$input['show_button'] = 'hover';
|
29 |
+
return $input;
|
30 |
+
}
|
31 |
+
|
32 |
+
public function get_options_for_view() {
|
33 |
+
$options = $this->get();
|
34 |
+
if ($options['use_custom_image']) {
|
35 |
+
$options['pinImageWidth'] = $options['custom_image_width'];
|
36 |
+
$options['pinImageHeight'] = $options['custom_image_height'];
|
37 |
+
} else {
|
38 |
+
$options['pinImageWidth'] = $this->image_width;
|
39 |
+
$options['pinImageHeight'] = $this->image_height;
|
40 |
+
}
|
41 |
+
unset( $options['custom_image_width'], $options['custom_image_height'] );
|
42 |
+
return $options;
|
43 |
+
}
|
44 |
+
|
45 |
+
public function get_option_name() {
|
46 |
+
return 'jpibfi_visual_options';
|
47 |
+
}
|
48 |
+
}
|
includes/public/class-jpibfi-client-utilities.php
DELETED
@@ -1,110 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class JPIBFI_Client_Utilities {
|
4 |
-
|
5 |
-
//function gets the id of the image by searching for class with wp-image- prefix, otherwise returns empty string
|
6 |
-
public static function get_post_id_from_image_classes( $class_attribute ) {
|
7 |
-
$classes = preg_split( '/\s+/', $class_attribute, -1, PREG_SPLIT_NO_EMPTY );
|
8 |
-
$prefix = 'wp-image-';
|
9 |
-
|
10 |
-
for ($i = 0; $i < count( $classes ); $i++) {
|
11 |
-
|
12 |
-
if ( $prefix === substr( $classes[ $i ], 0, strlen( $prefix ) ))
|
13 |
-
return str_replace( $prefix, '', $classes[ $i ] );
|
14 |
-
}
|
15 |
-
|
16 |
-
return '';
|
17 |
-
}
|
18 |
-
|
19 |
-
/* Get description for a given image */
|
20 |
-
public static function get_image_description( $id, $src ) {
|
21 |
-
|
22 |
-
$result = is_numeric( $id ) ? self::get_image_description_by_id( $id ) : '';
|
23 |
-
|
24 |
-
//if description based on id wasn't found
|
25 |
-
if ( '' === $result ) {
|
26 |
-
$id = self::fjarrett_get_attachment_id_by_url( $src );
|
27 |
-
$result = is_numeric ( $id ) ? self::get_image_description_by_id( $id ) : '';
|
28 |
-
}
|
29 |
-
|
30 |
-
return $result;
|
31 |
-
}
|
32 |
-
|
33 |
-
/* Function searches for image based on $id and returns its description */
|
34 |
-
static function get_image_description_by_id( $id ){
|
35 |
-
|
36 |
-
$attachment = get_post( $id );
|
37 |
-
return null == $attachment ? '' : $attachment->post_content;
|
38 |
-
}
|
39 |
-
|
40 |
-
/**
|
41 |
-
* Function copied from http://frankiejarrett.com/get-an-attachment-id-by-url-in-wordpress/
|
42 |
-
* Return an ID of an attachment by searching the database with the file URL.
|
43 |
-
*
|
44 |
-
* First checks to see if the $url is pointing to a file that exists in
|
45 |
-
* the wp-content directory. If so, then we search the database for a
|
46 |
-
* partial match consisting of the remaining path AFTER the wp-content
|
47 |
-
* directory. Finally, if a match is found the attachment ID will be
|
48 |
-
* returned.
|
49 |
-
*
|
50 |
-
* @return {int} $attachment
|
51 |
-
*/
|
52 |
-
static function fjarrett_get_attachment_id_by_url( $url ) {
|
53 |
-
|
54 |
-
// Split the $url into two parts with the wp-content directory as the separator.
|
55 |
-
$parse_url = explode( parse_url( WP_CONTENT_URL, PHP_URL_PATH ), $url );
|
56 |
-
|
57 |
-
// Get the host of the current site and the host of the $url, ignoring www.
|
58 |
-
$this_host = str_ireplace( 'www.', '', parse_url( home_url(), PHP_URL_HOST ) );
|
59 |
-
$file_host = str_ireplace( 'www.', '', parse_url( $url, PHP_URL_HOST ) );
|
60 |
-
|
61 |
-
// Return nothing if there aren't any $url parts or if the current host and $url host do not match.
|
62 |
-
if ( ! isset( $parse_url[1] ) || empty( $parse_url[1] ) || ( $this_host != $file_host ) )
|
63 |
-
return;
|
64 |
-
|
65 |
-
// Now we're going to quickly search the DB for any attachment GUID with a partial path match.
|
66 |
-
// Example: /uploads/2013/05/test-image.jpg
|
67 |
-
global $wpdb;
|
68 |
-
|
69 |
-
$prefix = $wpdb->prefix;
|
70 |
-
$attachment = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM " . $prefix . "posts WHERE guid RLIKE %s;", $parse_url[1] ) );
|
71 |
-
|
72 |
-
// Returns null if no attachment is found.
|
73 |
-
return $attachment ? $attachment[0] : null;
|
74 |
-
}
|
75 |
-
|
76 |
-
/* True if plugin should be added to the current post/page */
|
77 |
-
public static function add_jpibfi() {
|
78 |
-
global $post;
|
79 |
-
$jpibfi_selection_options = JPIBFI_Selection_Options::get_instance()->get_options();
|
80 |
-
|
81 |
-
if ( is_front_page() )
|
82 |
-
return $jpibfi_selection_options['show_on_home'] == "1";
|
83 |
-
else if ( is_single() )
|
84 |
-
return $jpibfi_selection_options['show_on_single'] == "1" ? self::add_plugin_to_post( $post->ID ) : false;
|
85 |
-
else if ( is_page() )
|
86 |
-
return $jpibfi_selection_options['show_on_page'] == "1" ? self::add_plugin_to_post( $post->ID ) : false;
|
87 |
-
else if ( is_category() || is_archive() || is_search() )
|
88 |
-
return $jpibfi_selection_options['show_on_category'] == "1";
|
89 |
-
else if ( self::is_blog_page() )
|
90 |
-
return $jpibfi_selection_options['show_on_blog'] == "1";
|
91 |
-
return true;
|
92 |
-
}
|
93 |
-
|
94 |
-
/* Checks if the plugin wasn't deactivated in the given post/page */
|
95 |
-
private static function add_plugin_to_post( $post_id ) {
|
96 |
-
$post_meta = get_post_meta( $post_id, 'jpibfi_meta', true );
|
97 |
-
return empty( $post_meta )
|
98 |
-
|| false == array_key_exists( 'jpibfi_disable_for_post', $post_meta )
|
99 |
-
|| '1' != $post_meta['jpibfi_disable_for_post'];
|
100 |
-
}
|
101 |
-
|
102 |
-
/* function copied from https://gist.github.com/wesbos/1189639 */
|
103 |
-
private static function is_blog_page() {
|
104 |
-
global $post;
|
105 |
-
|
106 |
-
$post_type = get_post_type( $post );
|
107 |
-
|
108 |
-
return ( ( is_home() || is_archive() || is_single() ) && ( $post_type == 'post' ) );
|
109 |
-
}
|
110 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/public/class-jpibfi-client.php
CHANGED
@@ -2,201 +2,95 @@
|
|
2 |
|
3 |
class JPIBFI_Client {
|
4 |
|
5 |
-
|
6 |
-
|
7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
|
9 |
-
private function __construct() {
|
10 |
add_action( 'wp_enqueue_scripts', array( $this, 'add_plugin_scripts' ) );
|
11 |
add_action( 'wp_head', array( $this, 'print_header_style' ) );
|
12 |
-
|
13 |
-
add_filter( "
|
14 |
-
|
15 |
-
$lightbox_options = JPIBFI_Lightbox_Options::get_instance()->get_options();
|
16 |
-
if ($lightbox_options['enabled'] == '1') {
|
17 |
-
add_filter("the_content", array($this, 'add_lightbox'), 9998);
|
18 |
-
}
|
19 |
-
}
|
20 |
-
|
21 |
-
public static function get_instance() {
|
22 |
-
// If the single instance hasn't been set, set it now.
|
23 |
-
if ( null == self::$instance ) {
|
24 |
-
self::$instance = new self;
|
25 |
-
}
|
26 |
-
|
27 |
-
return self::$instance;
|
28 |
}
|
29 |
|
30 |
-
//Adds all necessary scripts
|
31 |
public function add_plugin_scripts() {
|
32 |
-
|
33 |
-
$jpibfi_selection_options = JPIBFI_Selection_Options::get_instance()->get_options();
|
34 |
-
$jpibfi_visual_options = JPIBFI_Visual_Options::get_instance()->get_options();
|
35 |
-
$lightbox_options = JPIBFI_Lightbox_Options::get_instance()->get_options();
|
36 |
-
|
37 |
-
if ( ! ( JPIBFI_Client_Utilities::add_jpibfi() ) )
|
38 |
return;
|
39 |
|
40 |
$deps = array('jquery');
|
41 |
|
42 |
-
|
43 |
-
wp_enqueue_script('jquery-colorbox', JPIBFI_Globals::get_plugin_url() . 'js/jquery.colorbox-min.js', array('jquery'), JPIBFI_Globals::get_file_version(), false);
|
44 |
-
wp_enqueue_style('jquery-colorbox', JPIBFI_Globals::get_plugin_url() . 'css/colorbox.css', array(), JPIBFI_Globals::get_file_version());
|
45 |
-
$deps[] = 'jquery-colorbox';
|
46 |
-
}
|
47 |
-
|
48 |
-
wp_enqueue_script( 'jquery-pin-it-button-script', JPIBFI_Globals::get_plugin_url() . 'js/jpibfi.js', $deps, JPIBFI_Globals::get_file_version(), false );
|
49 |
-
|
50 |
-
$use_custom_image = $jpibfi_visual_options[ 'use_custom_image' ] == "1";
|
51 |
-
|
52 |
-
$parameters_array = array(
|
53 |
-
'imageSelector' => $jpibfi_selection_options['image_selector'],
|
54 |
-
'disabledClasses' => $jpibfi_selection_options['disabled_classes'],
|
55 |
-
'enabledClasses' => $jpibfi_selection_options['enabled_classes'],
|
56 |
-
'descriptionOption' => $jpibfi_visual_options['description_option'],
|
57 |
-
'usePostUrl' => $jpibfi_visual_options['use_post_url'],
|
58 |
-
'minImageHeight' => $jpibfi_selection_options['min_image_height'],
|
59 |
-
'minImageWidth' => $jpibfi_selection_options['min_image_width'],
|
60 |
-
'siteTitle' => get_bloginfo( 'name', 'display' ),
|
61 |
-
'buttonPosition' => $jpibfi_visual_options[ 'button_position' ],
|
62 |
-
'debug' => $jpibfi_adanced_options[ 'debug'],
|
63 |
-
'containerSelector' => $jpibfi_adanced_options[ 'container_selector'],
|
64 |
-
'pinImageHeight' => $use_custom_image ? $jpibfi_visual_options['custom_image_height'] : $this->image_height,
|
65 |
-
'pinImageWidth' => $use_custom_image ? $jpibfi_visual_options['custom_image_width'] : $this->image_width,
|
66 |
-
'buttonMarginTop' => $jpibfi_visual_options[ 'button_margin_top' ],
|
67 |
-
'buttonMarginBottom'=> $jpibfi_visual_options[ 'button_margin_bottom' ],
|
68 |
-
'buttonMarginLeft' => $jpibfi_visual_options[ 'button_margin_left' ],
|
69 |
-
'buttonMarginRight' => $jpibfi_visual_options[ 'button_margin_right' ],
|
70 |
-
'retinaFriendly' => $jpibfi_visual_options[ 'retina_friendly' ] == '1' ? '1' : '0',
|
71 |
-
'showButton' => $jpibfi_visual_options['show_button'],
|
72 |
-
'pinLinkedImages' => $jpibfi_visual_options['pinLinkedImages'] == '1',
|
73 |
-
'pinLinkedImagesExtensions' => $jpibfi_visual_options['pinLinkedImagesExtensions'],
|
74 |
-
'lightbox' => array(
|
75 |
-
'enabled' => $lightbox_options['enabled'] == '1',
|
76 |
-
'descriptionOption' => $lightbox_options['description_option']
|
77 |
-
)
|
78 |
-
);
|
79 |
-
wp_localize_script( 'jquery-pin-it-button-script', 'jpibfi_options', apply_filters( 'jpibfi_javascript_parameters', $parameters_array ) );
|
80 |
|
|
|
|
|
81 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
82 |
}
|
83 |
|
84 |
public function print_header_style() {
|
85 |
-
|
86 |
-
|
87 |
-
if ( ! ( JPIBFI_Client_Utilities::add_jpibfi() ) )
|
88 |
return;
|
89 |
|
90 |
-
$
|
91 |
-
|
92 |
-
$width = $use_custom_image ? $jpibfi_visual_options['custom_image_width'] : $this->image_width;
|
93 |
-
$height = $use_custom_image ? $jpibfi_visual_options['custom_image_height'] : $this->image_height;
|
94 |
|
95 |
-
|
96 |
-
|
97 |
-
$
|
98 |
-
}
|
99 |
-
|
100 |
-
$url = $use_custom_image ? $jpibfi_visual_options['custom_image_url'] : JPIBFI_Globals::get_plugin_url() . 'images/pinit-button.png';
|
101 |
ob_start();
|
102 |
?>
|
103 |
<style type="text/css">
|
104 |
a.pinit-button {
|
105 |
position:absolute;
|
106 |
text-indent:-9999em !important;
|
107 |
-
width: <?php echo $
|
108 |
-
height: <?php echo $
|
109 |
background: transparent url('<?php echo $url; ?>') no-repeat 0 0 !important;
|
110 |
-
background-size: <?php
|
111 |
}
|
112 |
|
113 |
img.pinit-hover {
|
114 |
-
opacity: <?php echo (1 - $
|
115 |
-
filter:alpha(opacity=<?php echo (1 - $
|
116 |
}
|
117 |
</style>
|
118 |
|
119 |
<?php
|
120 |
-
|
121 |
-
echo trim( preg_replace( "/[".$what."]+/" , ' ' , ob_get_clean() ) , $what );
|
122 |
}
|
123 |
|
|
|
|
|
|
|
|
|
|
|
|
|
124 |
/*
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
if (
|
130 |
return $content;
|
|
|
|
|
131 |
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
global $post;
|
136 |
-
|
137 |
-
$attributes_html = '';
|
138 |
-
|
139 |
-
//if we need to add additional attributes to handle use_post_url setting
|
140 |
-
if ( !is_singular() && '1' == $jpibfi_visual_options[ 'use_post_url' ] ){
|
141 |
-
//if page description should be used as pin description and an excerpt for the post exists
|
142 |
-
if ( has_excerpt( $post->ID ) && (JPIBFIDescriptionOption::PageDescription == $jpibfi_visual_options[ 'description_option' ] || JPIBFIDescriptionOption::PageDescription == $lightbox_options[ 'description_option' ]))
|
143 |
-
$description = wp_kses( $post->post_excerpt, array() );
|
144 |
-
else
|
145 |
-
$description = get_the_title($post->ID);
|
146 |
-
|
147 |
-
$attributes_html .= 'data-jpibfi-url="' . get_permalink( $post->ID ) . '" ' ;
|
148 |
-
$attributes_html .= 'data-jpibfi-description ="' . esc_attr( $description ) . '" ';
|
149 |
-
}
|
150 |
-
|
151 |
-
$input_html = '<input class="jpibfi" type="hidden" ' . $attributes_html . '>';
|
152 |
-
$content = $input_html . $content;
|
153 |
-
|
154 |
-
$add_image_descriptions = JPIBFIDescriptionOption::ImageDescription == $jpibfi_visual_options[ 'description_option' ] || JPIBFIDescriptionOption::ImageDescription == $lightbox_options[ 'description_option' ];
|
155 |
-
|
156 |
-
//if we need to add data-jpibfi-description to each image
|
157 |
-
if ( $add_image_descriptions ){
|
158 |
-
$content = $this->add_description_attribute_to_images( $content );
|
159 |
-
}
|
160 |
-
|
161 |
-
return $content;
|
162 |
-
}
|
163 |
-
|
164 |
-
public function add_lightbox( $content ){
|
165 |
-
if ( ! JPIBFI_Client_Utilities::add_jpibfi() )
|
166 |
-
return $content;
|
167 |
-
|
168 |
-
global $post;
|
169 |
-
// universal IMG-Tag pattern matches everything between "<img" and the closing "(/)>"
|
170 |
-
// will be used to match all IMG-Tags in Content.
|
171 |
-
$imgPattern = "/<img([^\>]*?)>/i";
|
172 |
-
if (preg_match_all($imgPattern, $content, $imgTags)) {
|
173 |
-
foreach ($imgTags[0] as $imgTag) {
|
174 |
-
// only work on imgTags that do not already contain the string "colorbox-"
|
175 |
-
if (!preg_match('/jpibfi-group-/i', $imgTag)) {
|
176 |
-
if (!preg_match('/class=/i', $imgTag)) {
|
177 |
-
// imgTag does not contain class-attribute
|
178 |
-
$pattern = $imgPattern;
|
179 |
-
$replacement = '<img class="jpibfi-group-' . $post->ID . '" $1>';
|
180 |
-
} else {
|
181 |
-
// imgTag already contains class-attribute
|
182 |
-
$pattern = "/<img(.*?)class=('|\")([A-Za-z0-9 \/_\.\~\:-]*?)('|\")([^\>]*?)>/i";
|
183 |
-
$replacement = '<img$1class=$2$3 jpibfi-group-' . $post->ID . '$4$5>';
|
184 |
-
}
|
185 |
-
$replacedImgTag = preg_replace($pattern, $replacement, $imgTag);
|
186 |
-
$content = str_replace($imgTag, $replacedImgTag, $content);
|
187 |
-
}
|
188 |
-
}
|
189 |
-
}
|
190 |
-
return $content;
|
191 |
-
}
|
192 |
-
|
193 |
-
/* PRIVATE METHODS */
|
194 |
-
|
195 |
-
/*
|
196 |
-
* Adds data-jpibfi-description attribute to each image that is added through media library. The value is the "Description" of the image from media library.
|
197 |
-
* This piece of code uses a lot of code from the Photo Protect http://wordpress.org/plugins/photo-protect/ plugin
|
198 |
-
*/
|
199 |
-
private function add_description_attribute_to_images( $content ) {
|
200 |
|
201 |
$imgPattern = '/<img[^>]*>/i';
|
202 |
$attrPattern = '/ ([\w]+)[ ]*=[ ]*([\"\'])(.*?)\2/i';
|
@@ -207,7 +101,7 @@ class JPIBFI_Client {
|
|
207 |
|
208 |
preg_match_all($attrPattern, $img[0], $attributes, PREG_SET_ORDER);
|
209 |
|
210 |
-
$
|
211 |
$src = '';
|
212 |
$id = '';
|
213 |
|
@@ -216,22 +110,150 @@ class JPIBFI_Client {
|
|
216 |
$name = $att[1];
|
217 |
$value = $att[3];
|
218 |
|
219 |
-
$
|
220 |
|
221 |
-
if ('class' == $name )
|
222 |
-
$id =
|
223 |
-
|
|
|
224 |
$src = $value;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
225 |
}
|
226 |
}
|
227 |
|
228 |
-
$
|
229 |
-
$
|
230 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
231 |
}
|
232 |
|
233 |
-
return $content;
|
234 |
}
|
235 |
-
}
|
236 |
|
237 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
class JPIBFI_Client {
|
4 |
|
5 |
+
private $selection_options;
|
6 |
+
private $visual_options;
|
7 |
+
private $version;
|
8 |
+
private $plugin_dir_url;
|
9 |
+
|
10 |
+
public function __construct($file, $version) {
|
11 |
+
$this->version = $version;
|
12 |
+
$this->plugin_dir_url = plugin_dir_url($file);
|
13 |
+
$this->selection_options = new JPIBFI_Selection_Options();
|
14 |
+
$this->visual_options = new JPIBFI_Visual_Options();
|
15 |
|
|
|
16 |
add_action( 'wp_enqueue_scripts', array( $this, 'add_plugin_scripts' ) );
|
17 |
add_action( 'wp_head', array( $this, 'print_header_style' ) );
|
18 |
+
add_action( 'begin_fetch_post_thumbnail_html', array ( $this, 'print_thumbnail_js' ) );
|
19 |
+
add_filter( "the_excerpt", array( $this, 'the_content' ), 9999 );
|
20 |
+
add_filter( "the_content", array( $this, 'the_content' ), 9999 );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
}
|
22 |
|
|
|
23 |
public function add_plugin_scripts() {
|
24 |
+
if ( !$this->add_jpibfi() )
|
|
|
|
|
|
|
|
|
|
|
25 |
return;
|
26 |
|
27 |
$deps = array('jquery');
|
28 |
|
29 |
+
wp_enqueue_script( 'jquery-pin-it-button-script', $this->plugin_dir_url . 'js/jpibfi.client.js', $deps, $this->version, false );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
|
31 |
+
$selection_options = $this->selection_options->get();
|
32 |
+
$selection_options['image_selector'] = apply_filters( 'jpibfi_image_selector', $selection_options['image_selector'] );
|
33 |
|
34 |
+
$parameters_array = array (
|
35 |
+
'hover' => array_merge(
|
36 |
+
array ('siteTitle' => esc_attr(get_bloginfo( 'name', 'display'))),
|
37 |
+
$selection_options,
|
38 |
+
$this->visual_options->get_options_for_view()
|
39 |
+
),
|
40 |
+
);
|
41 |
+
|
42 |
+
wp_localize_script( 'jquery-pin-it-button-script', 'jpibfi_options', $parameters_array );
|
43 |
}
|
44 |
|
45 |
public function print_header_style() {
|
46 |
+
if (!$this->add_jpibfi())
|
|
|
|
|
47 |
return;
|
48 |
|
49 |
+
$visual_options_js = $this->visual_options->get_options_for_view();
|
|
|
|
|
|
|
50 |
|
51 |
+
$url = $visual_options_js[ 'use_custom_image' ]
|
52 |
+
? $visual_options_js['custom_image_url']
|
53 |
+
: $this->plugin_dir_url . 'images/pinit-button.png';
|
|
|
|
|
|
|
54 |
ob_start();
|
55 |
?>
|
56 |
<style type="text/css">
|
57 |
a.pinit-button {
|
58 |
position:absolute;
|
59 |
text-indent:-9999em !important;
|
60 |
+
width: <?php echo $visual_options_js['pinImageWidth']; ?>px !important;
|
61 |
+
height: <?php echo $visual_options_js['pinImageHeight']; ?>px !important;
|
62 |
background: transparent url('<?php echo $url; ?>') no-repeat 0 0 !important;
|
63 |
+
background-size: <?php printf('%dpx %dpx', $visual_options_js['pinImageWidth'], $visual_options_js['pinImageHeight']); ?> !important;
|
64 |
}
|
65 |
|
66 |
img.pinit-hover {
|
67 |
+
opacity: <?php echo (1 - $visual_options_js['transparency_value']); ?> !important;
|
68 |
+
filter:alpha(opacity=<?php echo (1 - $visual_options_js['transparency_value']) * 100; ?>) !important;
|
69 |
}
|
70 |
</style>
|
71 |
|
72 |
<?php
|
73 |
+
echo ob_get_clean();
|
|
|
74 |
}
|
75 |
|
76 |
+
public function print_thumbnail_js() {
|
77 |
+
if (!$this->add_jpibfi())
|
78 |
+
return;
|
79 |
+
echo '<input class="jpibfi" type="hidden">';
|
80 |
+
}
|
81 |
+
|
82 |
/*
|
83 |
+
* Adds data-jpibfi-description attribute to each image that is added through media library. The value is the "Description" of the image from media library.
|
84 |
+
* This piece of code uses a lot of code from the Photo Protect http://wordpress.org/plugins/photo-protect/ plugin
|
85 |
+
*/
|
86 |
+
function the_content( $content ) {
|
87 |
+
if ( !$this->add_jpibfi() )
|
88 |
return $content;
|
89 |
+
|
90 |
+
$visual_options = $this->visual_options->get();
|
91 |
|
92 |
+
$get_description = in_array('img_description', $visual_options['description_option']);
|
93 |
+
$get_caption = in_array('img_caption', $visual_options['description_option']);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
94 |
|
95 |
$imgPattern = '/<img[^>]*>/i';
|
96 |
$attrPattern = '/ ([\w]+)[ ]*=[ ]*([\"\'])(.*?)\2/i';
|
101 |
|
102 |
preg_match_all($attrPattern, $img[0], $attributes, PREG_SET_ORDER);
|
103 |
|
104 |
+
$new_img = '<img';
|
105 |
$src = '';
|
106 |
$id = '';
|
107 |
|
110 |
$name = $att[1];
|
111 |
$value = $att[3];
|
112 |
|
113 |
+
$new_img .= $full;
|
114 |
|
115 |
+
if ('class' == $name )
|
116 |
+
$id = $this->get_post_id_from_image_classes( $value );
|
117 |
+
|
118 |
+
if ( 'src' == $name )
|
119 |
$src = $value;
|
120 |
+
}
|
121 |
+
|
122 |
+
if ($get_description || $get_caption){
|
123 |
+
$att = $this->get_attachment($id, $src);
|
124 |
+
if ($att != null) {
|
125 |
+
if ($get_description)
|
126 |
+
$new_img .= sprintf('data-jpibfi-description="%s"', esc_attr( $att->post_content ));
|
127 |
+
|
128 |
+
if ($get_caption)
|
129 |
+
$new_img .= sprintf(' data-jpibfi-caption="%s"', esc_attr( $att->post_excerpt ));
|
130 |
}
|
131 |
}
|
132 |
|
133 |
+
$new_img .= sprintf(' data-jpibfi-post-url="%s"', esc_attr(get_permalink()));
|
134 |
+
$new_img .= sprintf(' data-jpibfi-post-title="%s"', esc_attr(get_the_title()));
|
135 |
+
$new_img .= ' >';
|
136 |
+
$content = str_replace($img[0], $new_img, $content);
|
137 |
+
}
|
138 |
+
$jscript = '';
|
139 |
+
if (defined( 'DOING_AJAX' ) && DOING_AJAX ) {
|
140 |
+
ob_start();
|
141 |
+
?>
|
142 |
+
<script type="text/javascript">
|
143 |
+
(function(){
|
144 |
+
if (!jQuery) return;
|
145 |
+
jQuery(document).ready(function(){
|
146 |
+
jQuery('.jpibfi').closest('div').addClass('jpibfi_container');
|
147 |
+
});
|
148 |
+
})();
|
149 |
+
</script>
|
150 |
+
<?php
|
151 |
+
$jscript = ob_get_clean();
|
152 |
}
|
153 |
|
154 |
+
return '<input class="jpibfi" type="hidden">' . $content . $jscript;
|
155 |
}
|
|
|
156 |
|
157 |
+
//function gets the id of the image by searching for class with wp-image- prefix, otherwise returns empty string
|
158 |
+
function get_post_id_from_image_classes( $class_attribute ) {
|
159 |
+
$classes = preg_split( '/\s+/', $class_attribute, -1, PREG_SPLIT_NO_EMPTY );
|
160 |
+
$prefix = 'wp-image-';
|
161 |
+
|
162 |
+
foreach($classes as $class) {
|
163 |
+
if ( $prefix === substr( $class, 0, strlen( $prefix ) ))
|
164 |
+
return str_replace( $prefix, '', $class );
|
165 |
+
}
|
166 |
+
return '';
|
167 |
+
}
|
168 |
+
|
169 |
+
function get_attachment($id, $src) {
|
170 |
+
$result = is_numeric($id) ? get_post($id) : null;
|
171 |
+
|
172 |
+
if ( null === $result ) {
|
173 |
+
$id = $this->fjarrett_get_attachment_id_by_url($src);
|
174 |
+
$result = is_numeric($id) ? get_post($id) : null;
|
175 |
+
}
|
176 |
+
return $result;
|
177 |
+
}
|
178 |
+
|
179 |
+
/**
|
180 |
+
* Function copied from http://frankiejarrett.com/get-an-attachment-id-by-url-in-wordpress/
|
181 |
+
* Return an ID of an attachment by searching the database with the file URL.
|
182 |
+
*
|
183 |
+
* First checks to see if the $url is pointing to a file that exists in
|
184 |
+
* the wp-content directory. If so, then we search the database for a
|
185 |
+
* partial match consisting of the remaining path AFTER the wp-content
|
186 |
+
* directory. Finally, if a match is found the attachment ID will be
|
187 |
+
* returned.
|
188 |
+
*
|
189 |
+
* @return {int} $attachment
|
190 |
+
*/
|
191 |
+
function fjarrett_get_attachment_id_by_url( $url ) {
|
192 |
+
|
193 |
+
// Split the $url into two parts with the wp-content directory as the separator.
|
194 |
+
$parse_url = explode( parse_url( WP_CONTENT_URL, PHP_URL_PATH ), $url );
|
195 |
+
|
196 |
+
// Get the host of the current site and the host of the $url, ignoring www.
|
197 |
+
$this_host = str_ireplace( 'www.', '', parse_url( home_url(), PHP_URL_HOST ) );
|
198 |
+
$file_host = str_ireplace( 'www.', '', parse_url( $url, PHP_URL_HOST ) );
|
199 |
+
|
200 |
+
// Return nothing if there aren't any $url parts or if the current host and $url host do not match.
|
201 |
+
if ( ! isset( $parse_url[1] ) || empty( $parse_url[1] ) || ( $this_host != $file_host ) )
|
202 |
+
return;
|
203 |
+
|
204 |
+
// Now we're going to quickly search the DB for any attachment GUID with a partial path match.
|
205 |
+
// Example: /uploads/2013/05/test-image.jpg
|
206 |
+
global $wpdb;
|
207 |
+
|
208 |
+
$prefix = $wpdb->prefix;
|
209 |
+
$attachment = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM " . $prefix . "posts WHERE guid RLIKE %s;", $parse_url[1] ) );
|
210 |
+
|
211 |
+
// Returns null if no attachment is found.
|
212 |
+
return $attachment ? $attachment[0] : null;
|
213 |
+
}
|
214 |
+
|
215 |
+
function add_jpibfi() {
|
216 |
+
if ( is_feed() )
|
217 |
+
return false;
|
218 |
+
$add_jpibfi = false;
|
219 |
+
$jpibfi_selection_options = $this->selection_options->get();
|
220 |
+
$show_on = $jpibfi_selection_options['show_on'];
|
221 |
+
$show_array = explode( ',', $show_on );
|
222 |
+
|
223 |
+
foreach ( $show_array as $show_tag ) {
|
224 |
+
if ($this->is_tag( $show_tag )) {
|
225 |
+
$add_jpibfi = true;
|
226 |
+
break;
|
227 |
+
}
|
228 |
+
}
|
229 |
+
if (!$add_jpibfi)
|
230 |
+
return false;
|
231 |
+
|
232 |
+
$disable_on = $jpibfi_selection_options['disable_on'];
|
233 |
+
$disable_array = explode( ',', $disable_on );
|
234 |
+
|
235 |
+
foreach ( $disable_array as $disable_tag ) {
|
236 |
+
if ($this->is_tag( $disable_tag ))
|
237 |
+
return false;
|
238 |
+
}
|
239 |
+
return true;
|
240 |
+
}
|
241 |
+
|
242 |
+
function is_tag( $tag ) {
|
243 |
+
if ( is_numeric($tag) ) {
|
244 |
+
$int = intval( $tag );
|
245 |
+
return get_the_ID() === $int;
|
246 |
+
}
|
247 |
+
switch( strtolower( $tag ) ) {
|
248 |
+
case '[front]': return is_front_page();
|
249 |
+
case '[single]': return is_single();
|
250 |
+
case '[page]': return is_page();
|
251 |
+
case '[archive]': return is_archive();
|
252 |
+
case '[search]': return is_search();
|
253 |
+
case '[category]': return is_category();
|
254 |
+
case '[home]': return is_home();
|
255 |
+
default:
|
256 |
+
return false;
|
257 |
+
}
|
258 |
+
}
|
259 |
+
}
|
jquery-pin-it-button-for-images.php
CHANGED
@@ -6,11 +6,10 @@ Description: Highlights images on hover and adds a "Pin It" button over them for
|
|
6 |
Text Domain: jquery-pin-it-button-for-images
|
7 |
Domain Path: /languages
|
8 |
Author: Marcin Skrzypiec
|
9 |
-
Version:
|
10 |
Author URI: http://mrsztuczkens.me/
|
11 |
*/
|
12 |
|
13 |
-
// If this file is called directly, abort.
|
14 |
if ( ! defined( 'WPINC' ) ) {
|
15 |
die;
|
16 |
}
|
@@ -19,74 +18,14 @@ if ( ! class_exists( 'jQuery_Pin_It_Button_For_Images' ) ) :
|
|
19 |
|
20 |
final class jQuery_Pin_It_Button_For_Images {
|
21 |
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
$
|
26 |
-
$this->load_textdomain();
|
27 |
-
|
28 |
-
$jpibfi_plugin = plugin_basename( __FILE__ );
|
29 |
-
add_filter( "plugin_action_links_$jpibfi_plugin", array( $this, 'plugin_settings_filter' ) );
|
30 |
-
|
31 |
-
register_activation_hook( __FILE__, array( $this, 'update_plugin' ) );
|
32 |
-
add_action( 'plugins_loaded', array( $this, 'update_plugin' ) );
|
33 |
-
}
|
34 |
-
|
35 |
-
public static function instance() {
|
36 |
-
if ( null == self::$instance ) {
|
37 |
-
self::$instance = new self;
|
38 |
-
}
|
39 |
-
return self::$instance;
|
40 |
-
}
|
41 |
-
|
42 |
-
private function includes() {
|
43 |
-
|
44 |
-
require_once(plugin_dir_path(__FILE__) . 'includes/class-jpibfi-globals.php');
|
45 |
-
JPIBFI_Globals::init(__FILE__, '1.60', 'a');
|
46 |
-
|
47 |
-
$files = array(
|
48 |
-
'includes/consts/jpibfi-description-option.php',
|
49 |
-
'includes/admin/class-jpibfi-admin-utilities.php',
|
50 |
-
'includes/admin/class-jpibfi-options.php',
|
51 |
-
'includes/admin/class-jpibfi-selection-options.php',
|
52 |
-
'includes/admin/class-jpibfi-advanced-options.php',
|
53 |
-
'includes/admin/class-jpibfi-visual-options.php',
|
54 |
-
'includes/admin/class-jpibfi-lightbox-options.php',
|
55 |
-
'includes/admin/class-jpibfi-admin.php',
|
56 |
-
'includes/admin/class-jpibfi-import-export.php',
|
57 |
-
'includes/public/class-jpibfi-client-utilities.php',
|
58 |
-
'includes/public/class-jpibfi-client.php'
|
59 |
-
);
|
60 |
-
foreach($files as $file)
|
61 |
-
require_once JPIBFI_Globals::get_plugin_dir() .$file;
|
62 |
-
}
|
63 |
-
|
64 |
-
public function load_textdomain() {
|
65 |
-
load_plugin_textdomain( 'jquery-pin-it-button-for-images', FALSE, dirname( plugin_basename( JPIBFI_Globals::get_plugin_file() ) ) . '/languages/' );
|
66 |
-
}
|
67 |
-
|
68 |
-
public function plugin_settings_filter( $links ) {
|
69 |
-
$settings_link = '<a href="options-general.php?page=jpibfi_settings">' . __( 'Settings', 'jquery-pin-it-button-for-images' ) . '</a>';
|
70 |
-
array_unshift( $links, $settings_link );
|
71 |
-
return $links;
|
72 |
-
}
|
73 |
-
|
74 |
-
/* Function updates DB if it detects new version of the plugin */
|
75 |
-
public function update_plugin() {
|
76 |
-
$version_option = 'jpibfi_version';
|
77 |
-
$update_option = 'jpibfi_update_options';
|
78 |
-
|
79 |
-
$jpibfi_v = JPIBFI_Globals::get_version();
|
80 |
-
$version = get_option( $version_option );
|
81 |
-
if ( false == $version || (float)$version < (float)$jpibfi_v || get_option( $update_option ) ) {
|
82 |
-
update_option( $version_option, $jpibfi_v);
|
83 |
-
update_option( $update_option, false);
|
84 |
-
update_option('jpibfi_pro_ad', 1);
|
85 |
-
}
|
86 |
}
|
87 |
}
|
88 |
|
89 |
endif; // End if class_exists check
|
90 |
|
91 |
|
92 |
-
$JPIBFI = jQuery_Pin_It_Button_For_Images
|
6 |
Text Domain: jquery-pin-it-button-for-images
|
7 |
Domain Path: /languages
|
8 |
Author: Marcin Skrzypiec
|
9 |
+
Version:2.0.0
|
10 |
Author URI: http://mrsztuczkens.me/
|
11 |
*/
|
12 |
|
|
|
13 |
if ( ! defined( 'WPINC' ) ) {
|
14 |
die;
|
15 |
}
|
18 |
|
19 |
final class jQuery_Pin_It_Button_For_Images {
|
20 |
|
21 |
+
function __construct() {
|
22 |
+
$version = '2.0.0';
|
23 |
+
require_once plugin_dir_path(__FILE__) . 'includes/class-jpibfi.php';
|
24 |
+
new JPIBFI(__FILE__, $version);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
}
|
26 |
}
|
27 |
|
28 |
endif; // End if class_exists check
|
29 |
|
30 |
|
31 |
+
$JPIBFI = new jQuery_Pin_It_Button_For_Images();
|
js/admin.js
DELETED
@@ -1,155 +0,0 @@
|
|
1 |
-
(function ($) {
|
2 |
-
|
3 |
-
var modelModule = function () {
|
4 |
-
|
5 |
-
var _classes = [];
|
6 |
-
|
7 |
-
function addClasses(classes) {
|
8 |
-
var classNames = classes.indexOf(';') >= 0 ? classes.split(';') : [classes];
|
9 |
-
|
10 |
-
for (var i = 0; i < classNames.length; i++) {
|
11 |
-
if (_classes.indexOf(classNames[i]) < 0 && classNames[i].length > 0)
|
12 |
-
_classes.push(classNames[i]);
|
13 |
-
}
|
14 |
-
}
|
15 |
-
|
16 |
-
function deleteClass(className) {
|
17 |
-
var index = _classes.indexOf(className);
|
18 |
-
if (index >= 0)
|
19 |
-
_classes.splice(index, 1);
|
20 |
-
}
|
21 |
-
|
22 |
-
function getFormatted() { return _classes.join(';'); }
|
23 |
-
|
24 |
-
function init(formatted) {
|
25 |
-
formatted = formatted || '';
|
26 |
-
var toAdd = formatted.split(';')
|
27 |
-
|
28 |
-
for (var i = 0; i < toAdd.length; i++) {
|
29 |
-
if (toAdd[i].length != 0) {
|
30 |
-
_classes.push(toAdd[i]);
|
31 |
-
}
|
32 |
-
}
|
33 |
-
}
|
34 |
-
|
35 |
-
return {
|
36 |
-
addClasses: addClasses,
|
37 |
-
deleteClass: deleteClass,
|
38 |
-
getClasses: function(){ return _classes; },
|
39 |
-
getFormatted: getFormatted,
|
40 |
-
init: init
|
41 |
-
};
|
42 |
-
};
|
43 |
-
|
44 |
-
var guiModule = function(){
|
45 |
-
|
46 |
-
var _model = modelModule();
|
47 |
-
var _valueInput,
|
48 |
-
_classNameInput,
|
49 |
-
_classButton,
|
50 |
-
_noClassesSpan,
|
51 |
-
_classesUl;
|
52 |
-
|
53 |
-
function updateNoClassesSpan(){
|
54 |
-
var classes = _model.getClasses();
|
55 |
-
_noClassesSpan.toggle(classes.length == 0);
|
56 |
-
}
|
57 |
-
|
58 |
-
function updateUl(){
|
59 |
-
var classes = _model.getClasses();
|
60 |
-
var html = '';
|
61 |
-
for(var i = 0; i < classes.length; i++){
|
62 |
-
html += '<span><a class="jpibfi-delete">X</a>' + classes[i] + '</span>';
|
63 |
-
}
|
64 |
-
_classesUl.html(html);
|
65 |
-
}
|
66 |
-
|
67 |
-
function updateValueInput(){
|
68 |
-
_valueInput.val(_model.getFormatted());
|
69 |
-
}
|
70 |
-
|
71 |
-
function init($container){
|
72 |
-
_valueInput = $container.find('.jpibfi-value');
|
73 |
-
_classNameInput = $container.find('.jpibfi-class-name');
|
74 |
-
_classButton = $container.find('.jpibfi-class-button');
|
75 |
-
_noClassesSpan = $container.find('.jpibfi-empty');
|
76 |
-
_classesUl = $container.find('.jpibfi-classes-list');
|
77 |
-
|
78 |
-
_model.init(_valueInput.val());
|
79 |
-
|
80 |
-
_classButton.click(function(){
|
81 |
-
var className = _classNameInput.val();
|
82 |
-
_model.addClasses(className);
|
83 |
-
_classNameInput.val('');
|
84 |
-
updateUI();
|
85 |
-
});
|
86 |
-
|
87 |
-
_classesUl.delegate('.jpibfi-delete', 'click', function(){
|
88 |
-
var className = $(this).parent().text().substr(1);
|
89 |
-
_model.deleteClass(className);
|
90 |
-
updateUI();
|
91 |
-
});
|
92 |
-
|
93 |
-
updateUI();
|
94 |
-
}
|
95 |
-
|
96 |
-
function updateUI(){
|
97 |
-
updateValueInput();
|
98 |
-
updateUl();
|
99 |
-
updateNoClassesSpan();
|
100 |
-
}
|
101 |
-
|
102 |
-
return {
|
103 |
-
init: init,
|
104 |
-
};
|
105 |
-
};
|
106 |
-
|
107 |
-
var disabledClassesModule = guiModule(),
|
108 |
-
enabledClassesModule = guiModule();
|
109 |
-
|
110 |
-
var settings = (function(){
|
111 |
-
var settings = {
|
112 |
-
version: 'lite'
|
113 |
-
};
|
114 |
-
|
115 |
-
if (window.jpibfiAdminSettings){
|
116 |
-
$.extend(settings, window.jpibfiAdminSettings);
|
117 |
-
}
|
118 |
-
return settings;
|
119 |
-
})();
|
120 |
-
|
121 |
-
$(document).ready(function ($) {
|
122 |
-
|
123 |
-
disabledClassesModule.init($('#jpibfi-disabled-classes'));
|
124 |
-
enabledClassesModule.init($('#jpibfi-enabled-classes'));
|
125 |
-
|
126 |
-
$('a.jpibfi_selector_option').click(function (e) {
|
127 |
-
$('#image_selector').val($(this).text());
|
128 |
-
e.preventDefault();
|
129 |
-
});
|
130 |
-
|
131 |
-
$("#refresh_custom_button_preview").click(function (e) {
|
132 |
-
var customWidth = $('#custom_image_width').val();
|
133 |
-
var customHeight = $('#custom_image_height').val();
|
134 |
-
var customUrl = $('#custom_image_url').val();
|
135 |
-
|
136 |
-
$('#custom_button_preview').css({
|
137 |
-
width: customWidth,
|
138 |
-
height: customHeight,
|
139 |
-
"background-image": "url('" + customUrl + "')"
|
140 |
-
});
|
141 |
-
return false;
|
142 |
-
});
|
143 |
-
|
144 |
-
$('#jpibfi_remove_ad').click(function(){
|
145 |
-
$('.jpibfi-pro-notice').remove();
|
146 |
-
jQuery.post(ajaxurl, { 'action': 'jpibfi_remove_pro_ad' }, function(response) {});
|
147 |
-
});
|
148 |
-
|
149 |
-
if ($('#show_button_error').length > 0){
|
150 |
-
$('#show_button').change(function(e){
|
151 |
-
$('#show_button_error').toggle($(this).val() != 'hover');
|
152 |
-
});
|
153 |
-
}
|
154 |
-
});
|
155 |
-
})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/jpibfi-ad.admin.js
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* eslint-disable */
|
2 |
+
(function ($) {
|
3 |
+
|
4 |
+
$(document).ready(function ($) {
|
5 |
+
$('#jpibfi_remove_ad').click(function () {
|
6 |
+
$('.jpibfi-pro-notice').remove();
|
7 |
+
jQuery.post(ajaxurl, { 'action': 'jpibfi_remove_pro_ad' }, function (response) {});
|
8 |
+
});
|
9 |
+
});
|
10 |
+
})(jQuery);
|
js/jpibfi.admin.js
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
!function e(t,n,r){function i(a,s){if(!n[a]){if(!t[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(o)return o(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var c=n[a]={exports:{}};t[a][0].call(c.exports,function(e){var n=t[a][1][e];return i(n?n:e)},c,c.exports,e,t,n,r)}return n[a].exports}for(var o="function"==typeof require&&require,a=0;a<r.length;a++)i(r[a]);return i}({1:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(n,"__esModule",{value:!0});var i=e("./app.controller"),o=r(i),a={bindings:{settingsName:"@"},controller:o["default"],template:'<navbar id="settings-navbar"\n tabs="$ctrl.config.tabs"\n page="$ctrl.config.page"\n current-tab="$ctrl.config.currentTab">\n </navbar>\n <status i18n="$ctrl.config.i18n.status"></status>\n <select-editor\n ng-if="$ctrl.config.currentTab == \'select\'"\n settings="$ctrl.config.settings"\n i18n="$ctrl.config.i18n.editor">\n </select-editor>\n <visual-editor\n ng-if="$ctrl.config.currentTab == \'visual\'"\n settings="$ctrl.config.settings"\n i18n="$ctrl.config.i18n.editor">\n </visual-editor>\n <import-editor\n ng-if="$ctrl.config.currentTab == \'import\'"\n settings="$ctrl.config.settings"\n i18n="$ctrl.config.i18n.editor">\n </import-editor>\n '};n["default"]=a},{"./app.controller":2}],2:[function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=function(){function e(t,n){r(this,e),this.httpService=t,this.linkService=n,this.config={},this.settingsValue={}}return i(e,[{key:"$onInit",value:function(){this.config=window[this.settingsName],this.httpService.init(this.config.ajax),this.linkService.init(this.config.page)}}]),e}();o.$inject=["httpService","linkService"],n["default"]=o},{}],3:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(n,"__esModule",{value:!0});var i=e("angular"),o=r(i),a=e("angular-sanitize"),s=r(a),u=e("ng-file-upload"),l=r(u),c=e("angular-drag-and-drop-lists"),f=(r(c),e("./app.component")),d=r(f),p=e("./components/components"),h=r(p),g=e("./common/components"),v=r(g),$=e("./services"),m=r($),b=o["default"].module("app",[s["default"],l["default"],h["default"],v["default"],m["default"]]).component("app",d["default"]).name;n["default"]=b},{"./app.component":1,"./common/components":5,"./components/components":14,"./services":34,angular:41,"angular-drag-and-drop-lists":37,"angular-sanitize":39,"ng-file-upload":43}],4:[function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=function(){function e(t){r(this,e),this.httpService=t}return i(e,[{key:"$onChanges",value:function(e){var t=this;e.settings&&(this.settings=Object.assign({},this.settings),this.values=Object.keys(this.settings).reduce(function(e,n){return e[n]=t.settings[n].value,e},{}))}},{key:"update",value:function(e){var t=e.key,n=e.value;this.values[t]=n}},{key:"updateValue",value:function(e,t){this.settings[e]=Object.assign({},this.settings[e],{value:t}),this.values[e]=t}},{key:"save",value:function(){var e=this;this.httpService.saveSettings(this.values).then(function(t){var n=t.status,r=t.model;"OK"===n.status&&(e.values=r)})}}]),e}();o.$inject=["httpService"],n["default"]=o},{}],5:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(n,"__esModule",{value:!0});var i=e("angular"),o=r(i),a=e("./select"),s=r(a),u=e("./visual"),l=r(u),c=e("./import"),f=r(c),d=o["default"].module("app.common",[s["default"],l["default"],f["default"]]).name;n["default"]=d},{"./import":8,"./select":9,"./visual":11,angular:41}],6:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(n,"__esModule",{value:!0});var i=e("./import.controller"),o=r(i),a={bindings:{i18n:"<"},controller:o["default"],template:'\n <h2>{{ ::$ctrl.i18n.title }}</h2>\n <table class="form-table">\n <tbody>\n <tr>\n <th><label>{{ ::$ctrl.i18n.export_title }}</label></th>\n <td>\n <a href="{{ ::$ctrl.i18n.export_url }}" class="button button-default">\n {{ ::$ctrl.i18n.export_button_text }}\n </a>\n </td>\n </tr>\n <tr>\n <th><label>{{ ::$ctrl.i18n.import_title }}</label></th>\n <td>\n <button class="button button-primary" type="file"\n ngf-accept="\'.json\'"\n ngf-select="$ctrl.uploadFiles($file, $invalidFiles)" ngf-max-size="1MB">\n {{ ::$ctrl.i18n.import_button_text }}\n </button>\n <div ng-if="$ctrl.upload_status === \'OK\' || $ctrl.upload_status === \'ERROR\'" class="notice"\n ng-class="{ \'error\': $ctrl.upload_status === \'ERROR\', \'updated\': $ctrl.upload_status === \'OK\' }">\n <p><strong ng-bind-html="$ctrl.upload_message"></strong></p>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n '};n["default"]=a},{"./import.controller":7}],7:[function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=function(){function e(t,n,i){r(this,e),this.$timeout=t,this.httpService=i,this.Upload=n,this.upload_status="",this.upload_message=""}return i(e,[{key:"uploadFiles",value:function(e,t){this.f=e,this.errFile=t&&t[0],e&&this.httpService.uploadFile(this.i18n.import_action_name,e)}}]),e}();o.$inject=["$timeout","Upload","httpService"],n["default"]=o},{}],8:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(n,"__esModule",{value:!0});var i=e("angular"),o=r(i),a=e("./import.component"),s=r(a),u=o["default"].module("app.common.import",[]).component("importEditor",s["default"]).name;n["default"]=u},{"./import.component":6,angular:41}],9:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(n,"__esModule",{value:!0});var i=e("angular"),o=r(i),a=e("./select.component"),s=r(a),u=e("./../../components/components"),l=r(u),c=o["default"].module("app.common.select",[l["default"]]).component("selectEditor",s["default"]).name;n["default"]=c},{"./../../components/components":14,"./select.component":10,angular:41}],10:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(n,"__esModule",{value:!0});var i=e("./../base.controller"),o=r(i),a={bindings:{settings:"<",i18n:"<"},controller:o["default"],template:'\n <h2>{{ $ctrl.i18n.title }}</h2>\n <table class="form-table">\n <tbody>\n <tr>\n <th><label for="image_selector">{{ ::$ctrl.settings.image_selector.label }}</label></th>\n <td>\n <editor-text args="$ctrl.settings.image_selector" on-update="$ctrl.update($event)"></editor-text>\n <p class="description" ng-bind-html="$ctrl.settings.image_selector.desc"></p>\n </td>\n </tr>\n <tr>\n <th><label for="disabled_classes">{{ ::$ctrl.settings.disabled_classes.label }}</label></th>\n <td>\n <editor-text args="$ctrl.settings.disabled_classes" on-update="$ctrl.update($event)"></editor-text>\n <p class="description" ng-bind-html="$ctrl.settings.disabled_classes.desc"></p>\n </td>\n </tr>\n <tr>\n <th><label for="enabled_classes">{{ ::$ctrl.settings.enabled_classes.label }}</label></th>\n <td>\n <editor-text args="$ctrl.settings.enabled_classes" on-update="$ctrl.update($event)"></editor-text>\n <p class="description" ng-bind-html="$ctrl.settings.enabled_classes.desc"></p>\n </td>\n </tr>\n <tr>\n <th>{{ ::$ctrl.i18n.image_resolution_label }}</th>\n <td>\n <p>{{ $ctrl.i18n.min_image_resolution }}</p>\n <p>For small screens* the "Pin it" button will show up if the image is at least <editor-number args="$ctrl.settings.min_image_height_small" on-update="$ctrl.update($event)"></editor-number> pixels high and <editor-number args="$ctrl.settings.min_image_width_small" on-update="$ctrl.update($event)"></editor-number> pixels wide.</p>\n <p>Otherwise, the "Pin it" button will show up if the image is at least <editor-number args="$ctrl.settings.min_image_height" on-update="$ctrl.update($event)"></editor-number> pixels high and <editor-number args="$ctrl.settings.min_image_width" on-update="$ctrl.update($event)"></editor-number> pixels wide.</p>\n <p class="description" ng-bind-html="$ctrl.i18n.image_resolution_desc"></p>\n <p class="description" ng-bind-html="$ctrl.i18n.image_resolution_desc_2"></p>\n </td>\n </tr>\n <tr>\n <th>{{ ::$ctrl.i18n.show_on_field_label }}</th>\n <td>\n <p>\n <label for="show_on">{{ ::$ctrl.settings.show_on.label }}:</label><br/>\n <editor-textarea args="$ctrl.settings.show_on" on-update="$ctrl.update($event)"></editor-text>\n </p>\n <p>\n <label for="disable_on">{{ ::$ctrl.settings.disable_on.label }}:</label><br/>\n <editor-textarea args="$ctrl.settings.disable_on" on-update="$ctrl.update($event)"></editor-text>\n </p>\n <p class="description" ng-bind-html="$ctrl.i18n.show_on_field_desc"></p>\n </td>\n </tr>\n </tbody>\n </table>\n <button class="button button-primary" ng-click="$ctrl.save()">\n {{ ::$ctrl.i18n.submit }}\n </buton>\n '};n["default"]=a},{"./../base.controller":4}],11:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(n,"__esModule",{value:!0});var i=e("angular"),o=r(i),a=e("./visual.component"),s=r(a),u=e("./../../components/components"),l=r(u),c=o["default"].module("app.common.visual",[l["default"]]).component("visualEditor",s["default"]).name;n["default"]=c},{"./../../components/components":14,"./visual.component":12,angular:41}],12:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(n,"__esModule",{value:!0});var i=e("./visual.controller"),o=r(i),a={bindings:{settings:"<",i18n:"<"},controller:o["default"],template:'\n <h2>{{ $ctrl.i18n.title }}</h2>\n <table class="form-table">\n <tbody>\n <tr>\n <th><label for="show_button">{{ ::$ctrl.settings.show_button.label }}</label></th>\n <td>\n <editor-select args="$ctrl.settings.show_button" on-update="$ctrl.update($event)"></editor-select>\n <p class="description" ng-bind-html="$ctrl.settings.show_button.desc"></p>\n <!-- @ifdef JPIBFI_LITE -->\n <p ng-if="$ctrl.showButtonError">\n <b ng-bind-html="$ctrl.i18n.pro_feature_error"></b>\n </p>\n <!-- @endif -->\n </td>\n </tr>\n <tr>\n <th><label>{{ ::$ctrl.settings.description_option.label }}</label></th>\n <td>\n <editor-sortable-select args="$ctrl.settings.description_option" on-update="$ctrl.update($event)"></editor-sortable-select>\n <p class="description" ng-bind-html="$ctrl.settings.description_option.desc"></p>\n </td>\n </tr>\n <tr>\n <th><label for="pinLinkedImages">{{ ::$ctrl.settings.pinLinkedImages.label }}</label></th>\n <td>\n <editor-checkbox args="$ctrl.settings.pinLinkedImages" on-update="$ctrl.update($event)"></editor-checkbox>\n <p class="description" ng-bind-html="$ctrl.settings.pinLinkedImages.desc"></p>\n </td>\n </tr>\n <tr>\n <th><label for="transparency_value">{{ ::$ctrl.settings.transparency_value.label }}</label></th>\n <td>\n <editor-number args="$ctrl.settings.transparency_value" on-update="$ctrl.update($event)"></editor-number>\n <p class="description" ng-bind-html="$ctrl.settings.transparency_value.desc"></p>\n </td>\n </tr>\n <tr>\n <th><label>{{ ::$ctrl.i18n.custom_button_label }}</label></th>\n <td>\n <p><editor-checkbox args="$ctrl.settings.use_custom_image" on-update="$ctrl.update($event)"></editor-checkbox></p>\n <p><button class="button button-default" ng-click="$ctrl.upload()">{{ ::$ctrl.i18n.custom_button_upload }}</button></p>\n <p>\n <label for="custom_image_url">{{ ::$ctrl.settings.custom_image_url.label }}</label>\n <editor-text args="$ctrl.settings.custom_image_url" on-update="$ctrl.update($event)"></editor-text>\n </p>\n <p>\n <label for="custom_image_height">{{ ::$ctrl.settings.custom_image_height.label }}</label>\n <editor-number args="$ctrl.settings.custom_image_height" on-update="$ctrl.update($event)"></editor-number>\n </p>\n <p>\n <label for="custom_image_width">{{ ::$ctrl.settings.custom_image_width.label }}</label>\n <editor-number args="$ctrl.settings.custom_image_width" on-update="$ctrl.update($event)"></editor-number>\n </p>\n <p class="description" ng-bind-html="$ctrl.i18n.custom_button_desc"></p>\n <div ng-if="$ctrl.values.custom_image_url">\n <div style="width: {{ $ctrl.values.custom_image_width }}px;\n height: {{ $ctrl.values.custom_image_height }}px;\n background-image: url(\'{{ $ctrl.values.custom_image_url }}\');">\n </div>\n </div>\n </td>\n </tr>\n <tr>\n <th><label for="button_position">{{ ::$ctrl.settings.button_position.label }}</label></th>\n <td>\n <editor-select args="$ctrl.settings.button_position" on-update="$ctrl.update($event)"></editor-select>\n <p class="description" ng-bind-html="$ctrl.settings.button_position.desc"></p>\n </td>\n </tr>\n <tr>\n <th><label>{{ ::$ctrl.i18n.margins_label }}</label></th>\n <td>\n <p>\n <label for="button_margin_top">{{ ::$ctrl.settings.button_margin_top.label }}</label>\n <editor-number ng-disabled="!$ctrl.marginAvailability.top" args="$ctrl.settings.button_margin_top" on-update="$ctrl.update($event)">\n </editor-number>\n </p>\n <p>\n <label for="button_margin_bottom">{{ ::$ctrl.settings.button_margin_bottom.label }}</label>\n <editor-number ng-disabled="!$ctrl.marginAvailability.bottom" args="$ctrl.settings.button_margin_bottom" on-update="$ctrl.update($event)">\n </editor-number>\n </p>\n <p>\n <label for="button_margin_left">{{ ::$ctrl.settings.button_margin_left.label }}</label>\n <editor-number ng-disabled="!$ctrl.marginAvailability.left" args="$ctrl.settings.button_margin_left" on-update="$ctrl.update($event)">\n </editor-number>\n </p>\n <p>\n <label for="button_margin_right">{{ ::$ctrl.settings.button_margin_right.label }}</label>\n <editor-number ng-disabled="!$ctrl.marginAvailability.right" args="$ctrl.settings.button_margin_right" on-update="$ctrl.update($event)">\n </editor-number>\n </p>\n <p class="description" ng-bind-html="$ctrl.i18n.margins_desc"></p>\n </td>\n </tr>\n </tbody>\n </table>\n <button class="button button-primary" ng-click="$ctrl.save()">\n {{ ::$ctrl.i18n.submit }}\n </buton>\n '};n["default"]=a},{"./visual.controller":13}],13:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=function d(e,t,n){null===e&&(e=Function.prototype);var r=Object.getOwnPropertyDescriptor(e,t);if(void 0===r){var i=Object.getPrototypeOf(e);return null===i?void 0:d(i,t,n)}if("value"in r)return r.value;var o=r.get;if(void 0!==o)return o.call(n)},l=e("./../base.controller"),c=r(l),f=function(e){function t(e,n){i(this,t);var r=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,n));return r.$scope=e,r.fileFrame=null,r}return a(t,e),s(t,[{key:"$onChanges",value:function(e){u(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"$onChanges",this).call(this,e),this.updateMarginAvailability()}},{key:"update",value:function(e){var t=e.key,n=e.value;return"show_button"===t?(this.showButtonError=!0,void this.updateValue("show_button","hover")):(this.values[t]=n,void("button_position"===t&&this.updateMarginAvailability()))}},{key:"updateMarginAvailability",value:function(){var e=this.values.button_position;this.marginAvailability={top:"top-left"===e||"top-right"===e,bottom:"bottom-left"===e||"bottom-right"===e,left:"top-left"===e||"bottom-left"===e,right:"top-right"===e||"bottom-right"===e}}},{key:"upload",value:function(){var e=this;return this.fileFrame?void this.fileFrame.open():(this.fileFrame=wp.media.frames.file_frame=wp.media({title:this.i18n.custom_button_frame_title,button:{text:this.i18n.custom_button_frame_button_text},multiple:!1}).on("select",function(){var t=e.fileFrame.state().get("selection").first().toJSON();e.updateValue("custom_image_url",t.url),e.updateValue("custom_image_width",t.width),e.updateValue("custom_image_height",t.height),e.$scope.$digest()}),void this.fileFrame.open())}}]),t}(c["default"]);f.$inject=["$scope","httpService"],n["default"]=f},{"./../base.controller":4}],14:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(n,"__esModule",{value:!0});var i=e("angular"),o=r(i),a=e("./navbar"),s=r(a),u=e("./editors"),l=r(u),c=e("./status"),f=r(c),d=o["default"].module("app.components",[s["default"],l["default"],f["default"]]).name;n["default"]=d},{"./editors":27,"./navbar":28,"./status":30,angular:41}],15:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(n,"__esModule",{value:!0});var i=e("./editor.controller"),o=r(i),a={bindings:{args:"<",onUpdate:"&"},controller:o["default"],template:'<input type="checkbox" ng-change="$ctrl.change()" id="{{ $ctrl.key }}" ng-model="$ctrl.value">\n <label for=" {{ $ctrl.key }}">{{ ::$ctrl.args.text }}</label><br/>'};n["default"]=a},{"./editor.controller":18}],16:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(n,"__esModule",{value:!0});var i=e("./editor.checkboxes.controller"),o=r(i),a={bindings:{args:"<",onUpdate:"&"},controller:o["default"],template:'<p ng-repeat="(key, label) in $ctrl.args.options">\n <input type="checkbox" id="{{:: $ctrl.key + \'_\' + key }}" ng-change="$ctrl.change()" ng-model="$ctrl.values[key]" />\n <label for="{{ $ctrl.key + \'_\' + key }}">{{ ::label }}</label>\n </p>'};n["default"]=a},{"./editor.checkboxes.controller":17}],17:[function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=function(){function e(){r(this,e),this.key=this.args.key;var t=this.args.value||[];this.values=Object.keys(this.args.options).reduce(function(e,n){return e[n]=t.indexOf(n)!==-1,e},{})}return i(e,[{key:"$onChanges",value:function(e){e.args&&(this.args=Object.assign({},this.args))}},{key:"change",value:function(e){var t=this;return this.onUpdate({$event:{key:this.key,value:Object.keys(this.args.options).reduce(function(e,n){return t.values[n]?e.concat([n]):e},[])}}),e}}]),e}();o.$inject=[],n["default"]=o},{}],18:[function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=function(){function e(){r(this,e)}return i(e,[{key:"$onChanges",value:function(e){e.args&&(this.args=Object.assign({},this.args),this.key=this.args.key,this.value=this.args.value)}},{key:"change",value:function(){this.onUpdate({$event:{key:this.key,value:this.value}})}}]),e}();o.$inject=[],n["default"]=o},{}],19:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(n,"__esModule",{value:!0});var i=e("./editor.controller"),o=r(i),a={bindings:{args:"<",ngDisabled:"<",onUpdate:"&"},controller:o["default"],template:'\n <input id="{{ $ctrl.key }}" ng-disabled="$ctrl.ngDisabled" number-attributes="$ctrl.args" class="small-text" type="number" ng-model="$ctrl.value" ng-change="$ctrl.change()" /> \n <span>{{ ::$ctrl.args.unit }}</span>'};n["default"]=a},{"./editor.controller":18}],20:[function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=function(){function e(t){r(this,e),this.$parse=t,this.restrict="A"}return i(e,[{key:"link",value:function(e,t,n){var r=this.$parse(n.numberAttributes)(e),i=["step","min","max"];i.forEach(function(e){void 0!==r[e]&&t.attr(e,r[e])})}}]),e}();n["default"]=o},{}],21:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(n,"__esModule",{value:!0});var i=e("./editor.select.controller"),o=r(i),a={bindings:{args:"<",onUpdate:"&"},controller:o["default"],template:'\n <select ng-model="$ctrl.value" ng-change="$ctrl.change()">\n <option ng-repeat="(value, name) in $ctrl.args.options" value="{{ value }}">{{ name }}</option>\n </select>'};n["default"]=a},{"./editor.select.controller":22}],22:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=function d(e,t,n){null===e&&(e=Function.prototype);var r=Object.getOwnPropertyDescriptor(e,t);if(void 0===r){var i=Object.getPrototypeOf(e);return null===i?void 0:d(i,t,n)}if("value"in r)return r.value;var o=r.get;if(void 0!==o)return o.call(n)},l=e("./editor.controller"),c=r(l),f=function(e){function t(){return i(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return a(t,e),s(t,[{key:"$onChanges",value:function(e){u(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"$onChanges",this).call(this,e),e.args&&(void 0!==this.args.value&&null!==this.args.value||(this.value=Object.keys(this.args.options)[0],this.change()),this.args.truthy&&(this.value=this.value?"1":"0"))}},{key:"change",value:function(){this.onUpdate({$event:{key:this.key,value:this.args.truthy?"1"===this.value:this.value}})}}]),t}(c["default"]);f.$inject=[],n["default"]=f},{"./editor.controller":18}],23:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(n,"__esModule",{value:!0});var i=e("./editor.sortableSelect.controller"),o=r(i),a={bindings:{args:"<",onUpdate:"&"},controller:o["default"],template:'\n <ul class="frizzly-sortable" dnd-list="$ctrl.options">\n <li ng-repeat="item in $ctrl.options"\n dnd-draggable="item"\n dnd-moved="$ctrl.options.splice($index, 1); $ctrl.change()"\n dnd-effect-allowed="move">\n <input type="checkbox" id="{{ item.key }}" ng-model="item.selected" ng-change="$ctrl.change()" />\n <label for="{{ item.key }}">{{ item.label }}\n </li>\n </ul>\n '};n["default"]=a},{"./editor.sortableSelect.controller":24}],24:[function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=function(){function e(){r(this,e)}return i(e,[{key:"$onChanges",value:function(e){var t=this;if(e.args){this.args=Object.assign({},this.args),this.key=this.args.key,this.value=this.args.value||[];var n=this.value.slice().concat(Object.keys(this.args.options).filter(function(e){return t.value.indexOf(e)===-1}));this.options=n.map(function(e){return{key:e,label:t.args.options[e],selected:t.value.indexOf(e)!==-1}})}}},{key:"change",value:function(){var e=this.options.reduce(function(e,t){return t.selected?e.concat([t.key]):e},[]);this.onUpdate({$event:{key:this.key,value:e}})}}]),e}();o.$inject=[],n["default"]=o},{}],25:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(n,"__esModule",{value:!0});var i=e("./editor.controller"),o=r(i),a={bindings:{args:"<",onUpdate:"&"},controller:o["default"],template:'<input type="text" id="{{ $ctrl.key }}" ng-model="$ctrl.value" ng-change="$ctrl.change()" class="regular-text" />'};n["default"]=a},{"./editor.controller":18}],26:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(n,"__esModule",{value:!0});var i=e("./editor.controller"),o=r(i),a={bindings:{args:"<",onUpdate:"&"},controller:o["default"],template:'<textarea rows="3" cols="50" id="{{ $ctrl.key }}" class="large-text code" ng-model="$ctrl.value" ng-change="$ctrl.change()"></textarea>'};n["default"]=a},{"./editor.controller":18}],27:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(n,"__esModule",{value:!0});var i=e("angular"),o=r(i),a=e("./editor.text.component"),s=r(a),u=e("./editor.textarea.component"),l=r(u),c=e("./editor.number.component"),f=r(c),d=e("./editor.number.directive"),p=r(d),h=e("./editor.checkbox.component"),g=r(h),v=e("./editor.checkboxes.component"),$=r(v),m=e("./editor.select.component"),b=r(m),y=e("./editor.sortableSelect.component"),w=r(y),x=o["default"].module("editors",["dndLists"]).component("editorText",s["default"]).component("editorTextarea",l["default"]).component("editorNumber",f["default"]).component("editorCheckbox",g["default"]).component("editorCheckboxes",$["default"]).component("editorSelect",b["default"]).component("editorSortableSelect",w["default"]).directive("numberAttributes",["$parse",function(e){return new p["default"](e)}]).name;n["default"]=x},{"./editor.checkbox.component":15,"./editor.checkboxes.component":16,"./editor.number.component":19,"./editor.number.directive":20,"./editor.select.component":21,"./editor.sortableSelect.component":23,"./editor.text.component":25,"./editor.textarea.component":26,angular:41}],28:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(n,"__esModule",{value:!0});var i=e("angular"),o=r(i),a=e("./navbar.component"),s=r(a),u=o["default"].module("navbar",[]).component("navbar",s["default"]).name;n["default"]=u},{"./navbar.component":29,angular:41}],29:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r={bindings:{currentTab:"<",tabs:"<",page:"<"},controller:function(){},template:'\n <h2 class="nav-tab-wrapper">\n <a ng-repeat="tab in $ctrl.tabs" \n href="?page={{ $ctrl.page }}&tab={{ tab.slug }}" class="nav-tab {{ $ctrl.currentTab == tab.slug ? \'nav-tab-active\' : \'\' }}">\n {{ tab.name }}\n </a>\n </h2>\n '};n["default"]=r;
|
2 |
+
},{}],30:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(n,"__esModule",{value:!0});var i=e("angular"),o=r(i),a=e("./status.component"),s=r(a),u=o["default"].module("status",[]).component("status",s["default"]).name;n["default"]=u},{"./status.component":31,angular:41}],31:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(n,"__esModule",{value:!0});var i=e("./status.controller"),o=r(i),a={bindings:{i18n:"<"},controller:o["default"],template:"\n <div class=\"notice notice-success\" ng-if=\"$ctrl.status.status != ''\" ng-class=\"{ \n 'notice-success': $ctrl.status.status === 'OK',\n 'notice-info' : $ctrl.status.status === 'PENDING',\n 'notice-error': $ctrl.status.status === 'ERROR'\n }\">\n <p ng-repeat=\"(key, text) in $ctrl.status.messages\"><strong>{{ text }}</strong></p>\n </div>\n "};n["default"]=a},{"./status.controller":32}],32:[function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=function(){function e(t,n){var i=this;r(this,e),this.$anchorScroll=t,this.status={status:""},n.onRequest(function(){return i.onRequestHandler()}),n.onResponse(function(e){var t=e.status;return i.onResponseHandler(t)})}return i(e,[{key:"onResponseHandler",value:function(e){this.status=e}},{key:"onRequestHandler",value:function(){this.$anchorScroll(),this.status.status="PENDING",this.status.messages={pending:this.i18n.pending}}}]),e}();o.$inject=["$anchorScroll","httpService"],n["default"]=o},{}],33:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=e("angular"),s=r(a),u=function(){function e(t,n,r){i(this,e),this.$http=t,this.$timeout=n,this.Upload=r,this.responseObservers=[],this.requestObservers=[]}return o(e,[{key:"init",value:function(e){this.url=e.url,this.saveSettingsParams={action:e.saveSettingsAction,nonce:e.saveSettingsNonce,tab:e.tab},this.customActionParams={action:e.customAction,nonce:e.customActionNonce}}},{key:"onRequest",value:function(e){this.requestObservers.push(e)}},{key:"onResponse",value:function(e){this.responseObservers.push(e)}},{key:"saveSettings",value:function(e){var t=s["default"].extend({},this.saveSettingsParams,{settings:e});return this.processRequest(t)}},{key:"customAction",value:function(e,t){var n=s["default"].extend({},this.customActionParams,{name:e,settings:t});return this.processRequest(n)}},{key:"uploadFile",value:function(e,t){var n=this,r=s["default"].extend({},this.customActionParams,{name:e,"import":t}),i=this.Upload.upload({url:this.url,data:r});this.requestObservers.forEach(function(e){e()}),i.then(function(e){var t=e.data;n.$timeout(function(){n.responseObservers.forEach(function(e){e(t)})})},function(e){e.status>0&&(n.errorMsg=e.status+": "+e.data)})}},{key:"processRequest",value:function(e){var t=this,n={method:"POST",url:this.url,params:e};return this.requestObservers.forEach(function(e){e()}),this.$http(n).then(function(e){var n=e.data;return t.responseObservers.forEach(function(e){e(n)}),n})}}]),e}();u.$inject=["$http","$timeout","Upload"],n["default"]=u},{angular:41}],34:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(n,"__esModule",{value:!0});var i=e("angular"),o=r(i),a=e("./http.service"),s=r(a),u=e("./link.service"),l=r(u),c=o["default"].module("services",[]).service("httpService",s["default"]).service("linkService",l["default"]).name;n["default"]=c},{"./http.service":33,"./link.service":35,angular:41}],35:[function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function e(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(u){i=!0,o=u}finally{try{!r&&s["return"]&&s["return"]()}finally{if(i)throw o}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=function(){function e(){r(this,e),this.baseLink=""}return o(e,[{key:"init",value:function(e){this.baseLink="?page="+e}},{key:"generateQuery",value:function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.reduce(function(e,t){var n=i(t,2),r=n[0],o=n[1];return e+"&"+r+"="+o},this.baseLink)}}]),e}();a.$inject=[],n["default"]=a},{}],36:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}var i=e("./app/app");r(i);!function(e){e(document).ready(function(){})}(jQuery)},{"./app/app":3}],37:[function(e,t,n){angular.module("dndLists",[]).directive("dndDraggable",["$parse","$timeout","dndDropEffectWorkaround","dndDragTypeWorkaround",function(e,t,n,r){return function(i,o,a){o.attr("draggable","true"),a.dndDisableIf&&i.$watch(a.dndDisableIf,function(e){o.attr("draggable",!e)}),o.on("dragstart",function(s){return s=s.originalEvent||s,"false"==o.attr("draggable")||(s.dataTransfer.setData("Text",angular.toJson(i.$eval(a.dndDraggable))),s.dataTransfer.effectAllowed=a.dndEffectAllowed||"move",o.addClass("dndDragging"),t(function(){o.addClass("dndDraggingSource")},0),n.dropEffect="none",r.isDragging=!0,r.dragType=a.dndType?i.$eval(a.dndType):void 0,s._dndHandle&&s.dataTransfer.setDragImage&&s.dataTransfer.setDragImage(o[0],0,0),e(a.dndDragstart)(i,{event:s}),void s.stopPropagation())}),o.on("dragend",function(s){s=s.originalEvent||s;var u=n.dropEffect;i.$apply(function(){switch(u){case"move":e(a.dndMoved)(i,{event:s});break;case"copy":e(a.dndCopied)(i,{event:s});break;case"none":e(a.dndCanceled)(i,{event:s})}e(a.dndDragend)(i,{event:s,dropEffect:u})}),o.removeClass("dndDragging"),t(function(){o.removeClass("dndDraggingSource")},0),r.isDragging=!1,s.stopPropagation()}),o.on("click",function(t){a.dndSelected&&(t=t.originalEvent||t,i.$apply(function(){e(a.dndSelected)(i,{event:t})}),t.stopPropagation())}),o.on("selectstart",function(){this.dragDrop&&this.dragDrop()})}}]).directive("dndList",["$parse","$timeout","dndDropEffectWorkaround","dndDragTypeWorkaround",function(e,t,n,r){return function(i,o,a){function s(e,t,n){var r=$?e.offsetX||e.layerX:e.offsetY||e.layerY,i=$?t.offsetWidth:t.offsetHeight,o=$?t.offsetLeft:t.offsetTop;return o=n?o:0,r<o+i/2}function u(){var e;return angular.forEach(o.children(),function(t){var n=angular.element(t);n.hasClass("dndPlaceholder")&&(e=n)}),e||angular.element("<li class='dndPlaceholder'></li>")}function l(){return Array.prototype.indexOf.call(v.children,g)}function c(e){if(!r.isDragging&&!m)return!1;if(!p(e.dataTransfer.types))return!1;if(a.dndAllowedTypes&&r.isDragging){var t=i.$eval(a.dndAllowedTypes);if(angular.isArray(t)&&t.indexOf(r.dragType)===-1)return!1}return!a.dndDisableIf||!i.$eval(a.dndDisableIf)}function f(){return h.remove(),o.removeClass("dndDragover"),!0}function d(t,n,o,a){return e(t)(i,{event:n,index:o,item:a||void 0,external:!r.isDragging,type:r.isDragging?r.dragType:void 0})}function p(e){if(!e)return!0;for(var t=0;t<e.length;t++)if("Text"===e[t]||"text/plain"===e[t])return!0;return!1}var h=u(),g=h[0],v=o[0];h.remove();var $=a.dndHorizontalList&&i.$eval(a.dndHorizontalList),m=a.dndExternalSources&&i.$eval(a.dndExternalSources);o.on("dragenter",function(e){return e=e.originalEvent||e,!c(e)||void e.preventDefault()}),o.on("dragover",function(e){if(e=e.originalEvent||e,!c(e))return!0;if(g.parentNode!=v&&o.append(h),e.target!==v){for(var t=e.target;t.parentNode!==v&&t.parentNode;)t=t.parentNode;t.parentNode===v&&t!==g&&(s(e,t)?v.insertBefore(g,t):v.insertBefore(g,t.nextSibling))}else if(s(e,g,!0))for(;g.previousElementSibling&&(s(e,g.previousElementSibling,!0)||0===g.previousElementSibling.offsetHeight);)v.insertBefore(g,g.previousElementSibling);else for(;g.nextElementSibling&&!s(e,g.nextElementSibling,!0);)v.insertBefore(g,g.nextElementSibling.nextElementSibling);return a.dndDragover&&!d(a.dndDragover,e,l())?f():(o.addClass("dndDragover"),e.preventDefault(),e.stopPropagation(),!1)}),o.on("drop",function(e){if(e=e.originalEvent||e,!c(e))return!0;e.preventDefault();var t,r=e.dataTransfer.getData("Text")||e.dataTransfer.getData("text/plain");try{t=JSON.parse(r)}catch(o){return f()}var s=l();return a.dndDrop&&(t=d(a.dndDrop,e,s,t),!t)?f():(t!==!0&&i.$apply(function(){i.$eval(a.dndList).splice(s,0,t)}),d(a.dndInserted,e,s,t),"none"===e.dataTransfer.dropEffect?"copy"===e.dataTransfer.effectAllowed||"move"===e.dataTransfer.effectAllowed?n.dropEffect=e.dataTransfer.effectAllowed:n.dropEffect=e.ctrlKey?"copy":"move":n.dropEffect=e.dataTransfer.dropEffect,f(),e.stopPropagation(),!1)}),o.on("dragleave",function(e){e=e.originalEvent||e,o.removeClass("dndDragover"),t(function(){o.hasClass("dndDragover")||h.remove()},100)})}}]).directive("dndNodrag",function(){return function(e,t,n){t.attr("draggable","true"),t.on("dragstart",function(e){e=e.originalEvent||e,e._dndHandle||(e.dataTransfer.types&&e.dataTransfer.types.length||e.preventDefault(),e.stopPropagation())}),t.on("dragend",function(e){e=e.originalEvent||e,e._dndHandle||e.stopPropagation()})}}).directive("dndHandle",function(){return function(e,t,n){t.attr("draggable","true"),t.on("dragstart dragend",function(e){e=e.originalEvent||e,e._dndHandle=!0})}}).factory("dndDragTypeWorkaround",function(){return{}}).factory("dndDropEffectWorkaround",function(){return{}})},{}],38:[function(e,t,n){!function(e,t){"use strict";function n(){function n(e,t){var n,r={},i=e.split(",");for(n=0;n<i.length;n++)r[t?u(i[n]):i[n]]=!0;return r}function r(t,n){null===t||void 0===t?t="":"string"!=typeof t&&(t=""+t),m.innerHTML=t;var r=5;do{if(0===r)throw d("uinput","Failed to sanitize html because the input is unstable");r--,e.document.documentMode&&v(m),t=m.innerHTML,m.innerHTML=t}while(t!==m.innerHTML);for(var i=m.firstChild;i;){switch(i.nodeType){case 1:n.start(i.nodeName.toLowerCase(),p(i.attributes));break;case 3:n.chars(i.textContent)}var o;if(!(o=i.firstChild)&&(1==i.nodeType&&n.end(i.nodeName.toLowerCase()),o=i.nextSibling,!o))for(;null==o&&(i=i.parentNode,i!==m);)o=i.nextSibling,1==i.nodeType&&n.end(i.nodeName.toLowerCase());i=o}for(;i=m.firstChild;)m.removeChild(i)}function p(e){for(var t={},n=0,r=e.length;n<r;n++){var i=e[n];t[i.name]=i.value}return t}function h(e){return e.replace(/&/g,"&").replace(b,function(e){var t=e.charCodeAt(0),n=e.charCodeAt(1);return"&#"+(1024*(t-55296)+(n-56320)+65536)+";"}).replace(y,function(e){return"&#"+e.charCodeAt(0)+";"}).replace(/</g,"<").replace(/>/g,">")}function g(e,t){var n=!1,r=i(e,e.push);return{start:function(e,i){e=u(e),!n&&A[e]&&(n=e),n||O[e]!==!0||(r("<"),r(e),a(i,function(n,i){var o=u(i),a="img"===e&&"src"===o||"background"===o;T[o]!==!0||M[o]===!0&&!t(n,a)||(r(" "),r(i),r('="'),r(h(n)),r('"'))}),r(">"))},end:function(e){e=u(e),n||O[e]!==!0||w[e]===!0||(r("</"),r(e),r(">")),e==n&&(n=!1)},chars:function(e){n||r(h(e))}}}function v(t){if(t.nodeType===e.Node.ELEMENT_NODE)for(var n=t.attributes,r=0,i=n.length;r<i;r++){var o=n[r],a=o.name.toLowerCase();"xmlns:ns1"!==a&&0!==a.lastIndexOf("ns1:",0)||(t.removeAttributeNode(o),r--,i--)}var s=t.firstChild;s&&v(s),s=t.nextSibling,s&&v(s)}var $=!1;this.$get=["$$sanitizeUri",function(e){return $&&o(O,C),function(t){var n=[];return c(t,f(n,function(t,n){return!/^unsafe:/.test(e(t,n))})),n.join("")}}],this.enableSvg=function(e){return s(e)?($=e,this):$},i=t.bind,o=t.extend,a=t.forEach,s=t.isDefined,u=t.lowercase,l=t.noop,c=r,f=g;var m,b=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,y=/([^\#-~ |!])/g,w=n("area,br,col,hr,img,wbr"),x=n("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),_=n("rp,rt"),S=o({},_,x),k=o({},x,n("address,article,aside,blockquote,caption,center,del,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,map,menu,nav,ol,pre,section,table,ul")),E=o({},_,n("a,abbr,acronym,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,q,ruby,rp,rt,s,samp,small,span,strike,strong,sub,sup,time,tt,u,var")),C=n("circle,defs,desc,ellipse,font-face,font-face-name,font-face-src,g,glyph,hkern,image,linearGradient,line,marker,metadata,missing-glyph,mpath,path,polygon,polyline,radialGradient,rect,stop,svg,switch,text,title,tspan"),A=n("script,style"),O=o({},w,k,E,S),M=n("background,cite,href,longdesc,src,xlink:href"),j=n("abbr,align,alt,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,coords,dir,face,headers,height,hreflang,hspace,ismap,lang,language,nohref,nowrap,rel,rev,rows,rowspan,rules,scope,scrolling,shape,size,span,start,summary,tabindex,target,title,type,valign,value,vspace,width"),P=n("accent-height,accumulate,additive,alphabetic,arabic-form,ascent,baseProfile,bbox,begin,by,calcMode,cap-height,class,color,color-rendering,content,cx,cy,d,dx,dy,descent,display,dur,end,fill,fill-rule,font-family,font-size,font-stretch,font-style,font-variant,font-weight,from,fx,fy,g1,g2,glyph-name,gradientUnits,hanging,height,horiz-adv-x,horiz-origin-x,ideographic,k,keyPoints,keySplines,keyTimes,lang,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mathematical,max,min,offset,opacity,orient,origin,overline-position,overline-thickness,panose-1,path,pathLength,points,preserveAspectRatio,r,refX,refY,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,rotate,rx,ry,slope,stemh,stemv,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,systemLanguage,target,text-anchor,to,transform,type,u1,u2,underline-position,underline-thickness,unicode,unicode-range,units-per-em,values,version,viewBox,visibility,width,widths,x,x-height,x1,x2,xlink:actuate,xlink:arcrole,xlink:role,xlink:show,xlink:title,xlink:type,xml:base,xml:lang,xml:space,xmlns,xmlns:xlink,y,y1,y2,zoomAndPan",!0),T=o({},M,P,j);!function(e){var t;if(!e.document||!e.document.implementation)throw d("noinert","Can't create an inert html document");t=e.document.implementation.createHTMLDocument("inert");var n=t.documentElement||t.getDocumentElement(),r=n.getElementsByTagName("body");if(1===r.length)m=r[0];else{var i=t.createElement("html");m=t.createElement("body"),i.appendChild(m),t.appendChild(i)}}(e)}function r(e){var t=[],n=f(t,l);return n.chars(e),t.join("")}var i,o,a,s,u,l,c,f,d=t.$$minErr("$sanitize");t.module("ngSanitize",[]).provider("$sanitize",n),t.module("ngSanitize").filter("linky",["$sanitize",function(e){var n=/((ftp|https?):\/\/|(www\.)|(mailto:)?[A-Za-z0-9._%+-]+@)\S*[^\s.;,(){}<>"\u201d\u2019]/i,i=/^mailto:/i,o=t.$$minErr("linky"),a=t.isDefined,s=t.isFunction,u=t.isObject,l=t.isString;return function(t,c,f){function d(e){e&&b.push(r(e))}function p(e,t){var n,r=$(e);b.push("<a ");for(n in r)b.push(n+'="'+r[n]+'" ');!a(c)||"target"in r||b.push('target="',c,'" '),b.push('href="',e.replace(/"/g,"""),'">'),d(t),b.push("</a>")}if(null==t||""===t)return t;if(!l(t))throw o("notstring","Expected string but received: {0}",t);for(var h,g,v,$=s(f)?f:u(f)?function(){return f}:function(){return{}},m=t,b=[];h=m.match(n);)g=h[0],h[2]||h[4]||(g=(h[3]?"http://":"mailto:")+g),v=h.index,d(m.substr(0,v)),p(g,h[0].replace(i,"")),m=m.substring(v+h[0].length);return d(m),e(b.join(""))}}])}(window,window.angular)},{}],39:[function(e,t,n){e("./angular-sanitize"),t.exports="ngSanitize"},{"./angular-sanitize":38}],40:[function(e,t,n){!function(e){"use strict";function t(e,t){return t=t||Error,function(){var n,r,i=2,o=arguments,a=o[0],s="["+(e?e+":":"")+a+"] ",u=o[1];for(s+=u.replace(/\{\d+\}/g,function(e){var t=+e.slice(1,-1),n=t+i;return n<o.length?me(o[n]):e}),s+="\nhttp://errors.angularjs.org/1.5.8/"+(e?e+"/":"")+a,r=i,n="?";r<o.length;r++,n="&")s+=n+"p"+(r-i)+"="+encodeURIComponent(me(o[r]));return new t(s)}}function n(e){if(null==e||E(e))return!1;if(Kr(e)||w(e)||Rr&&e instanceof Rr)return!0;var t="length"in Object(e)&&e.length;return x(t)&&(t>=0&&(t-1 in e||e instanceof Array)||"function"==typeof e.item)}function r(e,t,i){var o,a;if(e)if(S(e))for(o in e)"prototype"==o||"length"==o||"name"==o||e.hasOwnProperty&&!e.hasOwnProperty(o)||t.call(i,e[o],o,e);else if(Kr(e)||n(e)){var s="object"!=typeof e;for(o=0,a=e.length;o<a;o++)(s||o in e)&&t.call(i,e[o],o,e)}else if(e.forEach&&e.forEach!==r)e.forEach(t,i,e);else if(y(e))for(o in e)t.call(i,e[o],o,e);else if("function"==typeof e.hasOwnProperty)for(o in e)e.hasOwnProperty(o)&&t.call(i,e[o],o,e);else for(o in e)Pr.call(e,o)&&t.call(i,e[o],o,e);return e}function i(e,t,n){for(var r=Object.keys(e).sort(),i=0;i<r.length;i++)t.call(n,e[r[i]],r[i]);return r}function o(e){return function(t,n){e(n,t)}}function a(){return++Xr}function s(e,t){t?e.$$hashKey=t:delete e.$$hashKey}function u(e,t,n){for(var r=e.$$hashKey,i=0,o=t.length;i<o;++i){var a=t[i];if(b(a)||S(a))for(var l=Object.keys(a),c=0,f=l.length;c<f;c++){var d=l[c],p=a[d];n&&b(p)?_(p)?e[d]=new Date(p.valueOf()):k(p)?e[d]=new RegExp(p):p.nodeName?e[d]=p.cloneNode(!0):F(p)?e[d]=p.clone():(b(e[d])||(e[d]=Kr(p)?[]:{}),u(e[d],[p],!0)):e[d]=p}}return s(e,r),e}function l(e){return u(e,zr.call(arguments,1),!1)}function c(e){return u(e,zr.call(arguments,1),!0)}function f(e){return parseInt(e,10)}function d(e,t){return l(Object.create(e),t)}function p(){}function h(e){return e}function g(e){return function(){return e}}function v(e){return S(e.toString)&&e.toString!==Hr}function $(e){return"undefined"==typeof e}function m(e){return"undefined"!=typeof e}function b(e){return null!==e&&"object"==typeof e}function y(e){return null!==e&&"object"==typeof e&&!Br(e)}function w(e){return"string"==typeof e}function x(e){return"number"==typeof e}function _(e){return"[object Date]"===Hr.call(e)}function S(e){return"function"==typeof e}function k(e){return"[object RegExp]"===Hr.call(e)}function E(e){return e&&e.window===e}function C(e){return e&&e.$evalAsync&&e.$watch}function A(e){return"[object File]"===Hr.call(e)}function O(e){return"[object FormData]"===Hr.call(e)}function M(e){return"[object Blob]"===Hr.call(e)}function j(e){return"boolean"==typeof e}function P(e){return e&&S(e.then)}function T(e){return e&&x(e.length)&&Yr.test(Hr.call(e))}function D(e){return"[object ArrayBuffer]"===Hr.call(e)}function F(e){return!(!e||!(e.nodeName||e.prop&&e.attr&&e.find))}function N(e){var t,n={},r=e.split(",");for(t=0;t<r.length;t++)n[r[t]]=!0;return n}function I(e){return Tr(e.nodeName||e[0]&&e[0].nodeName)}function R(e,t){var n=e.indexOf(t);return n>=0&&e.splice(n,1),n}function U(e,t){function n(e,t){var n,r=t.$$hashKey;if(Kr(e))for(var o=0,a=e.length;o<a;o++)t.push(i(e[o]));else if(y(e))for(n in e)t[n]=i(e[n]);else if(e&&"function"==typeof e.hasOwnProperty)for(n in e)e.hasOwnProperty(n)&&(t[n]=i(e[n]));else for(n in e)Pr.call(e,n)&&(t[n]=i(e[n]));return s(t,r),t}function i(e){if(!b(e))return e;var t=a.indexOf(e);if(t!==-1)return u[t];if(E(e)||C(e))throw Wr("cpws","Can't copy! Making copies of Window or Scope instances is not supported.");var r=!1,i=o(e);return void 0===i&&(i=Kr(e)?[]:Object.create(Br(e)),r=!0),a.push(e),u.push(i),r?n(e,i):i}function o(e){switch(Hr.call(e)){case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Float32Array]":case"[object Float64Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return new e.constructor(i(e.buffer),e.byteOffset,e.length);case"[object ArrayBuffer]":if(!e.slice){var t=new ArrayBuffer(e.byteLength);return new Uint8Array(t).set(new Uint8Array(e)),t}return e.slice(0);case"[object Boolean]":case"[object Number]":case"[object String]":case"[object Date]":return new e.constructor(e.valueOf());case"[object RegExp]":var n=new RegExp(e.source,e.toString().match(/[^\/]*$/)[0]);return n.lastIndex=e.lastIndex,n;case"[object Blob]":return new e.constructor([e],{type:e.type})}if(S(e.cloneNode))return e.cloneNode(!0)}var a=[],u=[];if(t){if(T(t)||D(t))throw Wr("cpta","Can't copy! TypedArray destination cannot be mutated.");if(e===t)throw Wr("cpi","Can't copy! Source and destination are identical.");return Kr(t)?t.length=0:r(t,function(e,n){"$$hashKey"!==n&&delete t[n]}),a.push(e),u.push(t),n(e,t)}return i(e)}function V(e,t){if(e===t)return!0;if(null===e||null===t)return!1;if(e!==e&&t!==t)return!0;var n,r,i,o=typeof e,a=typeof t;if(o==a&&"object"==o){if(!Kr(e)){if(_(e))return!!_(t)&&V(e.getTime(),t.getTime());if(k(e))return!!k(t)&&e.toString()==t.toString();if(C(e)||C(t)||E(e)||E(t)||Kr(t)||_(t)||k(t))return!1;i=he();for(r in e)if("$"!==r.charAt(0)&&!S(e[r])){if(!V(e[r],t[r]))return!1;i[r]=!0}for(r in t)if(!(r in i)&&"$"!==r.charAt(0)&&m(t[r])&&!S(t[r]))return!1;return!0}if(!Kr(t))return!1;if((n=e.length)==t.length){for(r=0;r<n;r++)if(!V(e[r],t[r]))return!1;return!0}}return!1}function z(e,t,n){return e.concat(zr.call(t,n))}function L(e,t){return zr.call(e,t||0)}function q(e,t){var n=arguments.length>2?L(arguments,2):[];return!S(t)||t instanceof RegExp?t:n.length?function(){return arguments.length?t.apply(e,z(n,arguments,0)):t.apply(e,n)}:function(){return arguments.length?t.apply(e,arguments):t.call(e)}}function H(t,n){var r=n;return"string"==typeof t&&"$"===t.charAt(0)&&"$"===t.charAt(1)?r=void 0:E(n)?r="$WINDOW":n&&e.document===n?r="$DOCUMENT":C(n)&&(r="$SCOPE"),r}function B(e,t){if(!$(e))return x(t)||(t=t?2:null),JSON.stringify(e,H,t)}function W(e){return w(e)?JSON.parse(e):e}function G(e,t){e=e.replace(ti,"");var n=Date.parse("Jan 01, 1970 00:00:00 "+e)/6e4;return isNaN(n)?t:n}function X(e,t){return e=new Date(e.getTime()),e.setMinutes(e.getMinutes()+t),e}function K(e,t,n){n=n?-1:1;var r=e.getTimezoneOffset(),i=G(t,r);return X(e,n*(i-r))}function Y(e){e=Rr(e).clone();try{e.empty()}catch(t){}var n=Rr("<div>").append(e).html();try{return e[0].nodeType===si?Tr(n):n.match(/^(<[^>]+>)/)[1].replace(/^<([\w\-]+)/,function(e,t){return"<"+Tr(t)})}catch(t){return Tr(n)}}function Z(e){try{return decodeURIComponent(e)}catch(t){}}function J(e){var t={};return r((e||"").split("&"),function(e){var n,r,i;e&&(r=e=e.replace(/\+/g,"%20"),n=e.indexOf("="),n!==-1&&(r=e.substring(0,n),i=e.substring(n+1)),r=Z(r),m(r)&&(i=!m(i)||Z(i),Pr.call(t,r)?Kr(t[r])?t[r].push(i):t[r]=[t[r],i]:t[r]=i))}),t}function Q(e){var t=[];return r(e,function(e,n){Kr(e)?r(e,function(e){t.push(te(n,!0)+(e===!0?"":"="+te(e,!0)))}):t.push(te(n,!0)+(e===!0?"":"="+te(e,!0)))}),t.length?t.join("&"):""}function ee(e){return te(e,!0).replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+")}function te(e,t){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%3B/gi,";").replace(/%20/g,t?"%20":"+")}function ne(e,t){var n,r,i=ni.length;for(r=0;r<i;++r)if(n=ni[r]+t,w(n=e.getAttribute(n)))return n;return null}function re(e,t){var n,i,o={};r(ni,function(t){var r=t+"app";!n&&e.hasAttribute&&e.hasAttribute(r)&&(n=e,i=e.getAttribute(r))}),r(ni,function(t){var r,o=t+"app";!n&&(r=e.querySelector("["+o.replace(":","\\:")+"]"))&&(n=r,i=r.getAttribute(o))}),n&&(o.strictDi=null!==ne(n,"strict-di"),t(n,i?[i]:[],o))}function ie(t,n,i){b(i)||(i={});var o={strictDi:!1};i=l(o,i);var a=function(){if(t=Rr(t),t.injector()){var r=t[0]===e.document?"document":Y(t);throw Wr("btstrpd","App already bootstrapped with this element '{0}'",r.replace(/</,"<").replace(/>/,">"))}n=n||[],n.unshift(["$provide",function(e){e.value("$rootElement",t)}]),i.debugInfoEnabled&&n.push(["$compileProvider",function(e){e.debugInfoEnabled(!0)}]),n.unshift("ng");var o=rt(n,i.strictDi);return o.invoke(["$rootScope","$rootElement","$compile","$injector",function(e,t,n,r){e.$apply(function(){t.data("$injector",r),n(t)(e)})}]),o},s=/^NG_ENABLE_DEBUG_INFO!/,u=/^NG_DEFER_BOOTSTRAP!/;return e&&s.test(e.name)&&(i.debugInfoEnabled=!0,e.name=e.name.replace(s,"")),e&&!u.test(e.name)?a():(e.name=e.name.replace(u,""),Gr.resumeBootstrap=function(e){return r(e,function(e){n.push(e)}),a()},void(S(Gr.resumeDeferredBootstrap)&&Gr.resumeDeferredBootstrap()))}function oe(){e.name="NG_ENABLE_DEBUG_INFO!"+e.name,e.location.reload()}function ae(e){var t=Gr.element(e).injector();if(!t)throw Wr("test","no injector found for element argument to getTestability");return t.get("$$testability")}function se(e,t){return t=t||"_",e.replace(ri,function(e,n){return(n?t:"")+e.toLowerCase()})}function ue(){var t;if(!ii){var n=ei();Ur=$(n)?e.jQuery:n?e[n]:void 0,Ur&&Ur.fn.on?(Rr=Ur,l(Ur.fn,{scope:Ei.scope,isolateScope:Ei.isolateScope,controller:Ei.controller,injector:Ei.injector,inheritedData:Ei.inheritedData}),t=Ur.cleanData,Ur.cleanData=function(e){for(var n,r,i=0;null!=(r=e[i]);i++)n=Ur._data(r,"events"),n&&n.$destroy&&Ur(r).triggerHandler("$destroy");t(e)}):Rr=Oe,Gr.element=Rr,ii=!0}}function le(e,t,n){if(!e)throw Wr("areq","Argument '{0}' is {1}",t||"?",n||"required");return e}function ce(e,t,n){return n&&Kr(e)&&(e=e[e.length-1]),le(S(e),t,"not a function, got "+(e&&"object"==typeof e?e.constructor.name||"Object":typeof e)),e}function fe(e,t){if("hasOwnProperty"===e)throw Wr("badname","hasOwnProperty is not a valid {0} name",t)}function de(e,t,n){if(!t)return e;for(var r,i=t.split("."),o=e,a=i.length,s=0;s<a;s++)r=i[s],e&&(e=(o=e)[r]);return!n&&S(e)?q(o,e):e}function pe(e){for(var t,n=e[0],r=e[e.length-1],i=1;n!==r&&(n=n.nextSibling);i++)(t||e[i]!==n)&&(t||(t=Rr(zr.call(e,0,i))),t.push(n));return t||e}function he(){return Object.create(null)}function ge(e){function n(e,t,n){return e[t]||(e[t]=n())}var r=t("$injector"),i=t("ng"),o=n(e,"angular",Object);return o.$$minErr=o.$$minErr||t,n(o,"module",function(){var e={};return function(t,o,a){var s=function(e,t){if("hasOwnProperty"===e)throw i("badname","hasOwnProperty is not a valid {0} name",t)};return s(t,"module"),o&&e.hasOwnProperty(t)&&(e[t]=null),n(e,t,function(){function e(e,t,n,r){return r||(r=i),function(){return r[n||"push"]([e,t,arguments]),c}}function n(e,n){return function(r,o){return o&&S(o)&&(o.$$moduleName=t),i.push([e,n,arguments]),c}}if(!o)throw r("nomod","Module '{0}' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.",t);var i=[],s=[],u=[],l=e("$injector","invoke","push",s),c={_invokeQueue:i,_configBlocks:s,_runBlocks:u,requires:o,name:t,provider:n("$provide","provider"),factory:n("$provide","factory"),service:n("$provide","service"),value:e("$provide","value"),constant:e("$provide","constant","unshift"),decorator:n("$provide","decorator"),animation:n("$animateProvider","register"),filter:n("$filterProvider","register"),controller:n("$controllerProvider","register"),directive:n("$compileProvider","directive"),component:n("$compileProvider","component"),config:l,run:function(e){return u.push(e),this}};return a&&l(a),c})}})}function ve(e,t){if(Kr(e)){t=t||[];for(var n=0,r=e.length;n<r;n++)t[n]=e[n]}else if(b(e)){t=t||{};for(var i in e)"$"===i.charAt(0)&&"$"===i.charAt(1)||(t[i]=e[i])}return t||e}function $e(e){var t=[];return JSON.stringify(e,function(e,n){if(n=H(e,n),b(n)){if(t.indexOf(n)>=0)return"...";t.push(n)}return n})}function me(e){return"function"==typeof e?e.toString().replace(/ \{[\s\S]*$/,""):$(e)?"undefined":"string"!=typeof e?$e(e):e}function be(n){l(n,{bootstrap:ie,copy:U,extend:l,merge:c,equals:V,element:Rr,forEach:r,injector:rt,noop:p,bind:q,toJson:B,fromJson:W,identity:h,isUndefined:$,isDefined:m,isString:w,isFunction:S,isObject:b,isNumber:x,isElement:F,isArray:Kr,version:fi,isDate:_,lowercase:Tr,uppercase:Dr,callbacks:{$$counter:0},getTestability:ae,$$minErr:t,$$csp:Qr,reloadWithDebugInfo:oe}),(Vr=ge(e))("ng",["ngLocale"],["$provide",function(e){e.provider({$$sanitizeUri:kn}),e.provider("$compile",ht).directive({a:Fo,input:ea,textarea:ea,form:Vo,script:Ka,select:Ja,style:es,option:Qa,ngBind:ra,ngBindHtml:oa,ngBindTemplate:ia,ngClass:sa,ngClassEven:la,ngClassOdd:ua,ngCloak:ca,ngController:fa,ngForm:zo,ngHide:La,ngIf:ha,ngInclude:ga,ngInit:$a,ngNonBindable:Ta,ngPluralize:Ia,ngRepeat:Ra,ngShow:za,ngStyle:qa,ngSwitch:Ha,ngSwitchWhen:Ba,ngSwitchDefault:Wa,ngOptions:Na,ngTransclude:Xa,ngModel:Ma,ngList:ma,ngChange:aa,pattern:ns,ngPattern:ns,required:ts,ngRequired:ts,minlength:is,ngMinlength:is,maxlength:rs,ngMaxlength:rs,ngValue:na,ngModelOptions:Pa}).directive({ngInclude:va}).directive(No).directive(da),e.provider({$anchorScroll:it,$animate:Li,$animateCss:Bi,$$animateJs:Vi,$$animateQueue:zi,$$AnimateRunner:Hi,$$animateAsyncRun:qi,$browser:ct,$cacheFactory:ft,$controller:yt,$document:wt,$exceptionHandler:xt,$filter:Un,$$forceReflow:Zi,$interpolate:Nt,$interval:It,$http:Pt,$httpParamSerializer:St,$httpParamSerializerJQLike:kt,$httpBackend:Dt,$xhrFactory:Tt,$jsonpCallbacks:ao,$location:Jt,$log:Qt,$parse:bn,$rootScope:Sn,$q:yn,$$q:wn,$sce:On,$sceDelegate:An,$sniffer:Mn,$templateCache:dt,$templateRequest:jn,$$testability:Pn,$timeout:Tn,$window:Nn,$$rAF:_n,$$jqLite:Ye,$$HashMap:Mi,$$cookieReader:Rn})}])}function ye(){return++pi}function we(e){return e.replace(vi,function(e,t,n,r){return r?n.toUpperCase():n}).replace($i,"Moz$1")}function xe(e){return!wi.test(e)}function _e(e){var t=e.nodeType;return t===oi||!t||t===li}function Se(e){for(var t in di[e.ng339])return!0;return!1}function ke(e){for(var t=0,n=e.length;t<n;t++)Te(e[t])}function Ee(e,t){var n,i,o,a,s=t.createDocumentFragment(),u=[];if(xe(e))u.push(t.createTextNode(e));else{for(n=s.appendChild(t.createElement("div")),i=(xi.exec(e)||["",""])[1].toLowerCase(),o=Si[i]||Si._default,n.innerHTML=o[1]+e.replace(_i,"<$1></$2>")+o[2],a=o[0];a--;)n=n.lastChild;u=z(u,n.childNodes),n=s.firstChild,n.textContent=""}return s.textContent="",s.innerHTML="",r(u,function(e){s.appendChild(e)}),s}function Ce(t,n){n=n||e.document;var r;return(r=yi.exec(t))?[n.createElement(r[1])]:(r=Ee(t,n))?r.childNodes:[]}function Ae(e,t){var n=e.parentNode;n&&n.replaceChild(t,e),t.appendChild(e)}function Oe(e){if(e instanceof Oe)return e;var t;if(w(e)&&(e=Zr(e),t=!0),!(this instanceof Oe)){if(t&&"<"!=e.charAt(0))throw bi("nosel","Looking up elements via selectors is not supported by jqLite! See: http://docs.angularjs.org/api/angular.element");return new Oe(e)}t?Ue(this,Ce(e)):Ue(this,e)}function Me(e){return e.cloneNode(!0)}function je(e,t){if(t||Te(e),e.querySelectorAll)for(var n=e.querySelectorAll("*"),r=0,i=n.length;r<i;r++)Te(n[r])}function Pe(e,t,n,i){if(m(i))throw bi("offargs","jqLite#off() does not support the `selector` argument");var o=De(e),a=o&&o.events,s=o&&o.handle;if(s)if(t){var u=function(t){var r=a[t];m(n)&&R(r||[],n),m(n)&&r&&r.length>0||(gi(e,t,s),delete a[t])};r(t.split(" "),function(e){u(e),mi[e]&&u(mi[e])})}else for(t in a)"$destroy"!==t&&gi(e,t,s),delete a[t]}function Te(e,t){var n=e.ng339,r=n&&di[n];if(r){if(t)return void delete r.data[t];r.handle&&(r.events.$destroy&&r.handle({},"$destroy"),Pe(e)),delete di[n],e.ng339=void 0}}function De(e,t){var n=e.ng339,r=n&&di[n];return t&&!r&&(e.ng339=n=ye(),r=di[n]={events:{},data:{},handle:void 0}),r}function Fe(e,t,n){if(_e(e)){var r=m(n),i=!r&&t&&!b(t),o=!t,a=De(e,!i),s=a&&a.data;
|
3 |
+
if(r)s[t]=n;else{if(o)return s;if(i)return s&&s[t];l(s,t)}}}function Ne(e,t){return!!e.getAttribute&&(" "+(e.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ").indexOf(" "+t+" ")>-1}function Ie(e,t){t&&e.setAttribute&&r(t.split(" "),function(t){e.setAttribute("class",Zr((" "+(e.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ").replace(" "+Zr(t)+" "," ")))})}function Re(e,t){if(t&&e.setAttribute){var n=(" "+(e.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ");r(t.split(" "),function(e){e=Zr(e),n.indexOf(" "+e+" ")===-1&&(n+=e+" ")}),e.setAttribute("class",Zr(n))}}function Ue(e,t){if(t)if(t.nodeType)e[e.length++]=t;else{var n=t.length;if("number"==typeof n&&t.window!==t){if(n)for(var r=0;r<n;r++)e[e.length++]=t[r]}else e[e.length++]=t}}function Ve(e,t){return ze(e,"$"+(t||"ngController")+"Controller")}function ze(e,t,n){e.nodeType==li&&(e=e.documentElement);for(var r=Kr(t)?t:[t];e;){for(var i=0,o=r.length;i<o;i++)if(m(n=Rr.data(e,r[i])))return n;e=e.parentNode||e.nodeType===ci&&e.host}}function Le(e){for(je(e,!0);e.firstChild;)e.removeChild(e.firstChild)}function qe(e,t){t||je(e);var n=e.parentNode;n&&n.removeChild(e)}function He(t,n){n=n||e,"complete"===n.document.readyState?n.setTimeout(t):Rr(n).on("load",t)}function Be(e,t){var n=Ci[t.toLowerCase()];return n&&Ai[I(e)]&&n}function We(e){return Oi[e]}function Ge(e,t){var n=function(n,r){n.isDefaultPrevented=function(){return n.defaultPrevented};var i=t[r||n.type],o=i?i.length:0;if(o){if($(n.immediatePropagationStopped)){var a=n.stopImmediatePropagation;n.stopImmediatePropagation=function(){n.immediatePropagationStopped=!0,n.stopPropagation&&n.stopPropagation(),a&&a.call(n)}}n.isImmediatePropagationStopped=function(){return n.immediatePropagationStopped===!0};var s=i.specialHandlerWrapper||Xe;o>1&&(i=ve(i));for(var u=0;u<o;u++)n.isImmediatePropagationStopped()||s(e,n,i[u])}};return n.elem=e,n}function Xe(e,t,n){n.call(e,t)}function Ke(e,t,n){var r=t.relatedTarget;r&&(r===e||ki.call(e,r))||n.call(e,t)}function Ye(){this.$get=function(){return l(Oe,{hasClass:function(e,t){return e.attr&&(e=e[0]),Ne(e,t)},addClass:function(e,t){return e.attr&&(e=e[0]),Re(e,t)},removeClass:function(e,t){return e.attr&&(e=e[0]),Ie(e,t)}})}}function Ze(e,t){var n=e&&e.$$hashKey;if(n)return"function"==typeof n&&(n=e.$$hashKey()),n;var r=typeof e;return n="function"==r||"object"==r&&null!==e?e.$$hashKey=r+":"+(t||a)():r+":"+e}function Je(e,t){if(t){var n=0;this.nextUid=function(){return++n}}r(e,this.put,this)}function Qe(e){return Function.prototype.toString.call(e)+" "}function et(e){var t=Qe(e).replace(Fi,""),n=t.match(ji)||t.match(Pi);return n}function tt(e){var t=et(e);return t?"function("+(t[1]||"").replace(/[\s\r\n]+/," ")+")":"fn"}function nt(e,t,n){var i,o,a;if("function"==typeof e){if(!(i=e.$inject)){if(i=[],e.length){if(t)throw w(n)&&n||(n=e.name||tt(e)),Ni("strictdi","{0} is not using explicit annotation and cannot be invoked in strict mode",n);o=et(e),r(o[1].split(Ti),function(e){e.replace(Di,function(e,t,n){i.push(n)})})}e.$inject=i}}else Kr(e)?(a=e.length-1,ce(e[a],"fn"),i=e.slice(0,a)):ce(e,"fn",!0);return i}function rt(e,t){function n(e){return function(t,n){return b(t)?void r(t,o(e)):e(t,n)}}function i(e,t){if(fe(e,"service"),(S(t)||Kr(t))&&(t=_.instantiate(t)),!t.$get)throw Ni("pget","Provider '{0}' must define $get factory method.",e);return x[e+v]=t}function a(e,t){return function(){var n=C.invoke(t,this);if($(n))throw Ni("undef","Provider '{0}' must return a value from $get factory method.",e);return n}}function s(e,t,n){return i(e,{$get:n!==!1?a(e,t):t})}function u(e,t){return s(e,["$injector",function(e){return e.instantiate(t)}])}function l(e,t){return s(e,g(t),!1)}function c(e,t){fe(e,"constant"),x[e]=t,k[e]=t}function f(e,t){var n=_.get(e+v),r=n.$get;n.$get=function(){var e=C.invoke(r,n);return C.invoke(t,null,{$delegate:e})}}function d(e){le($(e)||Kr(e),"modulesToLoad","not an array");var t,n=[];return r(e,function(e){function r(e){var t,n;for(t=0,n=e.length;t<n;t++){var r=e[t],i=_.get(r[0]);i[r[1]].apply(i,r[2])}}if(!y.get(e)){y.put(e,!0);try{w(e)?(t=Vr(e),n=n.concat(d(t.requires)).concat(t._runBlocks),r(t._invokeQueue),r(t._configBlocks)):S(e)?n.push(_.invoke(e)):Kr(e)?n.push(_.invoke(e)):ce(e,"module")}catch(i){throw Kr(e)&&(e=e[e.length-1]),i.message&&i.stack&&i.stack.indexOf(i.message)==-1&&(i=i.message+"\n"+i.stack),Ni("modulerr","Failed to instantiate module {0} due to:\n{1}",e,i.stack||i.message||i)}}}),n}function p(e,n){function r(t,r){if(e.hasOwnProperty(t)){if(e[t]===h)throw Ni("cdep","Circular dependency found: {0}",t+" <- "+m.join(" <- "));return e[t]}try{return m.unshift(t),e[t]=h,e[t]=n(t,r)}catch(i){throw e[t]===h&&delete e[t],i}finally{m.shift()}}function i(e,n,i){for(var o=[],a=rt.$$annotate(e,t,i),s=0,u=a.length;s<u;s++){var l=a[s];if("string"!=typeof l)throw Ni("itkn","Incorrect injection token! Expected service name as string, got {0}",l);o.push(n&&n.hasOwnProperty(l)?n[l]:r(l,i))}return o}function o(e){return!(Ir<=11)&&("function"==typeof e&&/^(?:class\b|constructor\()/.test(Qe(e)))}function a(e,t,n,r){"string"==typeof n&&(r=n,n=null);var a=i(e,n,r);return Kr(e)&&(e=e[e.length-1]),o(e)?(a.unshift(null),new(Function.prototype.bind.apply(e,a))):e.apply(t,a)}function s(e,t,n){var r=Kr(e)?e[e.length-1]:e,o=i(e,t,n);return o.unshift(null),new(Function.prototype.bind.apply(r,o))}return{invoke:a,instantiate:s,get:r,annotate:rt.$$annotate,has:function(t){return x.hasOwnProperty(t+v)||e.hasOwnProperty(t)}}}t=t===!0;var h={},v="Provider",m=[],y=new Je([],(!0)),x={$provide:{provider:n(i),factory:n(s),service:n(u),value:n(l),constant:n(c),decorator:f}},_=x.$injector=p(x,function(e,t){throw Gr.isString(t)&&m.push(t),Ni("unpr","Unknown provider: {0}",m.join(" <- "))}),k={},E=p(k,function(e,t){var n=_.get(e+v,t);return C.invoke(n.$get,n,void 0,e)}),C=E;x["$injector"+v]={$get:g(E)};var A=d(e);return C=E.get("$injector"),C.strictDi=t,r(A,function(e){e&&C.invoke(e)}),C}function it(){var e=!0;this.disableAutoScrolling=function(){e=!1},this.$get=["$window","$location","$rootScope",function(t,n,r){function i(e){var t=null;return Array.prototype.some.call(e,function(e){if("a"===I(e))return t=e,!0}),t}function o(){var e=s.yOffset;if(S(e))e=e();else if(F(e)){var n=e[0],r=t.getComputedStyle(n);e="fixed"!==r.position?0:n.getBoundingClientRect().bottom}else x(e)||(e=0);return e}function a(e){if(e){e.scrollIntoView();var n=o();if(n){var r=e.getBoundingClientRect().top;t.scrollBy(0,r-n)}}else t.scrollTo(0,0)}function s(e){e=w(e)?e:n.hash();var t;e?(t=u.getElementById(e))?a(t):(t=i(u.getElementsByName(e)))?a(t):"top"===e&&a(null):a(null)}var u=t.document;return e&&r.$watch(function(){return n.hash()},function(e,t){e===t&&""===e||He(function(){r.$evalAsync(s)})}),s}]}function ot(e,t){return e||t?e?t?(Kr(e)&&(e=e.join(" ")),Kr(t)&&(t=t.join(" ")),e+" "+t):e:t:""}function at(e){for(var t=0;t<e.length;t++){var n=e[t];if(n.nodeType===Ri)return n}}function st(e){w(e)&&(e=e.split(" "));var t=he();return r(e,function(e){e.length&&(t[e]=!0)}),t}function ut(e){return b(e)?e:{}}function lt(e,t,n,i){function o(e){try{e.apply(null,L(arguments,1))}finally{if(m--,0===m)for(;b.length;)try{b.pop()()}catch(t){n.error(t)}}}function a(e){var t=e.indexOf("#");return t===-1?"":e.substr(t)}function s(){S=null,u(),l()}function u(){y=k(),y=$(y)?null:y,V(y,A)&&(y=A),A=y}function l(){x===c.url()&&w===y||(x=c.url(),w=y,r(E,function(e){e(c.url(),y)}))}var c=this,f=e.location,d=e.history,h=e.setTimeout,g=e.clearTimeout,v={};c.isMock=!1;var m=0,b=[];c.$$completeOutstandingRequest=o,c.$$incOutstandingRequestCount=function(){m++},c.notifyWhenNoOutstandingRequests=function(e){0===m?e():b.push(e)};var y,w,x=f.href,_=t.find("base"),S=null,k=i.history?function(){try{return d.state}catch(e){}}:p;u(),w=y,c.url=function(t,n,r){if($(r)&&(r=null),f!==e.location&&(f=e.location),d!==e.history&&(d=e.history),t){var o=w===r;if(x===t&&(!i.history||o))return c;var s=x&&qt(x)===qt(t);return x=t,w=r,!i.history||s&&o?(s||(S=t),n?f.replace(t):s?f.hash=a(t):f.href=t,f.href!==t&&(S=t)):(d[n?"replaceState":"pushState"](r,"",t),u(),w=y),S&&(S=t),c}return S||f.href.replace(/%27/g,"'")},c.state=function(){return y};var E=[],C=!1,A=null;c.onUrlChange=function(t){return C||(i.history&&Rr(e).on("popstate",s),Rr(e).on("hashchange",s),C=!0),E.push(t),t},c.$$applicationDestroyed=function(){Rr(e).off("hashchange popstate",s)},c.$$checkUrlChange=l,c.baseHref=function(){var e=_.attr("href");return e?e.replace(/^(https?\:)?\/\/[^\/]*/,""):""},c.defer=function(e,t){var n;return m++,n=h(function(){delete v[n],o(e)},t||0),v[n]=!0,n},c.defer.cancel=function(e){return!!v[e]&&(delete v[e],g(e),o(p),!0)}}function ct(){this.$get=["$window","$log","$sniffer","$document",function(e,t,n,r){return new lt(e,r,t,n)}]}function ft(){this.$get=function(){function e(e,r){function i(e){e!=d&&(p?p==e&&(p=e.n):p=e,o(e.n,e.p),o(e,d),d=e,d.n=null)}function o(e,t){e!=t&&(e&&(e.p=t),t&&(t.n=e))}if(e in n)throw t("$cacheFactory")("iid","CacheId '{0}' is already taken!",e);var a=0,s=l({},r,{id:e}),u=he(),c=r&&r.capacity||Number.MAX_VALUE,f=he(),d=null,p=null;return n[e]={put:function(e,t){if(!$(t)){if(c<Number.MAX_VALUE){var n=f[e]||(f[e]={key:e});i(n)}return e in u||a++,u[e]=t,a>c&&this.remove(p.key),t}},get:function(e){if(c<Number.MAX_VALUE){var t=f[e];if(!t)return;i(t)}return u[e]},remove:function(e){if(c<Number.MAX_VALUE){var t=f[e];if(!t)return;t==d&&(d=t.p),t==p&&(p=t.n),o(t.n,t.p),delete f[e]}e in u&&(delete u[e],a--)},removeAll:function(){u=he(),a=0,f=he(),d=p=null},destroy:function(){u=null,s=null,f=null,delete n[e]},info:function(){return l({},s,{size:a})}}}var n={};return e.info=function(){var e={};return r(n,function(t,n){e[n]=t.info()}),e},e.get=function(e){return n[e]},e}}function dt(){this.$get=["$cacheFactory",function(e){return e("templates")}]}function pt(){}function ht(t,n){function i(e,t,n){var i=/^\s*([@&<]|=(\*?))(\??)\s*(\w*)\s*$/,o=he();return r(e,function(e,r){if(e in E)return void(o[r]=E[e]);var a=e.match(i);if(!a)throw Wi("iscp","Invalid {3} for directive '{0}'. Definition: {... {1}: '{2}' ...}",t,r,e,n?"controller bindings definition":"isolate scope definition");o[r]={mode:a[1][0],collection:"*"===a[2],optional:"?"===a[3],attrName:a[4]||r},a[4]&&(E[e]=o[r])}),o}function a(e,t){var n={isolateScope:null,bindToController:null};if(b(e.scope)&&(e.bindToController===!0?(n.bindToController=i(e.scope,t,!0),n.isolateScope={}):n.isolateScope=i(e.scope,t,!1)),b(e.bindToController)&&(n.bindToController=i(e.bindToController,t,!0)),b(n.bindToController)){var r=e.controller,o=e.controllerAs;if(!r)throw Wi("noctrl","Cannot bind to controller without directive '{0}'s controller.",t);if(!bt(r,o))throw Wi("noident","Cannot bind to controller without identifier for directive '{0}'.",t)}return n}function s(e){var t=e.charAt(0);if(!t||t!==Tr(t))throw Wi("baddir","Directive/Component name '{0}' is invalid. The first character must be a lowercase letter",e);if(e!==e.trim())throw Wi("baddir","Directive/Component name '{0}' is invalid. The name should not contain leading or trailing whitespaces",e)}function u(e){var t=e.require||e.controller&&e.name;return!Kr(t)&&b(t)&&r(t,function(e,n){var r=e.match(_),i=e.substring(r[0].length);i||(t[n]=r[0]+n)}),t}var c={},f="Directive",v=/^\s*directive\:\s*([\w\-]+)\s+(.*)$/,y=/(([\w\-]+)(?:\:([^;]+))?;?)/,x=N("ngSrc,ngSrcset,src,srcset"),_=/^(?:(\^\^?)?(\?)?(\^\^?)?)?/,k=/^(on[a-z]+|formaction)$/,E=he();this.directive=function M(e,n){return fe(e,"directive"),w(e)?(s(e),le(n,"directiveFactory"),c.hasOwnProperty(e)||(c[e]=[],t.factory(e+f,["$injector","$exceptionHandler",function(t,n){var i=[];return r(c[e],function(r,o){try{var a=t.invoke(r);S(a)?a={compile:g(a)}:!a.compile&&a.link&&(a.compile=g(a.link)),a.priority=a.priority||0,a.index=o,a.name=a.name||e,a.require=u(a),a.restrict=a.restrict||"EA",a.$$moduleName=r.$$moduleName,i.push(a)}catch(s){n(s)}}),i}])),c[e].push(n)):r(e,o(M)),this},this.component=function(e,t){function n(e){function n(t){return S(t)||Kr(t)?function(n,r){return e.invoke(t,this,{$element:n,$attrs:r})}:t}var o=t.template||t.templateUrl?t.template:"",a={controller:i,controllerAs:bt(t.controller)||t.controllerAs||"$ctrl",template:n(o),templateUrl:n(t.templateUrl),transclude:t.transclude,scope:{},bindToController:t.bindings||{},restrict:"E",require:t.require};return r(t,function(e,t){"$"===t.charAt(0)&&(a[t]=e)}),a}var i=t.controller||function(){};return r(t,function(e,t){"$"===t.charAt(0)&&(n[t]=e,S(i)&&(i[t]=e))}),n.$inject=["$injector"],this.directive(e,n)},this.aHrefSanitizationWhitelist=function(e){return m(e)?(n.aHrefSanitizationWhitelist(e),this):n.aHrefSanitizationWhitelist()},this.imgSrcSanitizationWhitelist=function(e){return m(e)?(n.imgSrcSanitizationWhitelist(e),this):n.imgSrcSanitizationWhitelist()};var A=!0;this.debugInfoEnabled=function(e){return m(e)?(A=e,this):A};var O=10;this.onChangesTtl=function(e){return arguments.length?(O=e,this):O},this.$get=["$injector","$interpolate","$exceptionHandler","$templateRequest","$parse","$controller","$rootScope","$sce","$animate","$$sanitizeUri",function(t,n,i,o,s,u,g,E,M,P){function T(){try{if(!--_e)throw be=void 0,Wi("infchng","{0} $onChanges() iterations reached. Aborting!\n",O);g.$apply(function(){for(var e=[],t=0,n=be.length;t<n;++t)try{be[t]()}catch(r){e.push(r)}if(be=void 0,e.length)throw e})}finally{_e++}}function D(e,t){if(t){var n,r,i,o=Object.keys(t);for(n=0,r=o.length;n<r;n++)i=o[n],this[i]=t[i]}else this.$attr={};this.$$element=e}function F(e,t,n){we.innerHTML="<span "+t+">";var r=we.firstChild.attributes,i=r[0];r.removeNamedItem(i.name),i.value=n,e.attributes.setNamedItem(i)}function N(e,t){try{e.addClass(t)}catch(n){}}function U(t,n,r,i,o){t instanceof Rr||(t=Rr(t));for(var a=/\S+/,s=0,u=t.length;s<u;s++){var l=t[s];l.nodeType===si&&l.nodeValue.match(a)&&Ae(l,t[s]=e.document.createElement("span"))}var c=H(t,n,t,r,i,o);U.$$addScopeClass(t);var f=null;return function(e,n,r){le(e,"scope"),o&&o.needsNewScope&&(e=e.$parent.$new()),r=r||{};var i=r.parentBoundTranscludeFn,a=r.transcludeControllers,s=r.futureParentElement;i&&i.$$boundTransclude&&(i=i.$$boundTransclude),f||(f=z(s));var u;if(u="html"!==f?Rr(fe(f,Rr("<div>").append(t).html())):n?Ei.clone.call(t):t,a)for(var l in a)u.data("$"+l+"Controller",a[l].instance);return U.$$addScopeInfo(u,e),n&&n(u,e),c&&c(e,u,u,i),u}}function z(e){var t=e&&e[0];return t&&"foreignobject"!==I(t)&&Hr.call(t).match(/SVG/)?"svg":"html"}function H(e,t,n,r,i,o){function a(e,n,r,i){var o,a,s,u,l,c,f,d,g;if(p){var v=n.length;for(g=new Array(v),l=0;l<h.length;l+=3)f=h[l],g[f]=n[f]}else g=n;for(l=0,c=h.length;l<c;)s=g[h[l++]],o=h[l++],a=h[l++],o?(o.scope?(u=e.$new(),U.$$addScopeInfo(Rr(s),u)):u=e,d=o.transcludeOnThisElement?B(e,o.transclude,i):!o.templateOnThisElement&&i?i:!i&&t?B(e,t):null,o(a,u,s,r,d)):a&&a(e,s.childNodes,void 0,i)}for(var s,u,l,c,f,d,p,h=[],g=0;g<e.length;g++)s=new D,u=W(e[g],[],s,0===g?r:void 0,i),l=u.length?J(u,e[g],s,t,n,null,[],[],o):null,l&&l.scope&&U.$$addScopeClass(s.$$element),f=l&&l.terminal||!(c=e[g].childNodes)||!c.length?null:H(c,l?(l.transcludeOnThisElement||!l.templateOnThisElement)&&l.transclude:t),(l||f)&&(h.push(g,l,f),d=!0,p=p||l),o=null;return d?a:null}function B(e,t,n){function r(r,i,o,a,s){return r||(r=e.$new(!1,s),r.$$transcluded=!0),t(r,i,{parentBoundTranscludeFn:n,transcludeControllers:o,futureParentElement:a})}var i=r.$$slots=he();for(var o in t.$$slots)t.$$slots[o]?i[o]=B(e,t.$$slots[o],n):i[o]=null;return r}function W(e,t,n,r,i){var o,a,s=e.nodeType,u=n.$attr;switch(s){case oi:ne(t,vt(I(e)),"E",r,i);for(var l,c,f,d,p,h,g=e.attributes,v=0,$=g&&g.length;v<$;v++){var m=!1,x=!1;l=g[v],c=l.name,p=Zr(l.value),d=vt(c),(h=Ce.test(d))&&(c=c.replace(Xi,"").substr(8).replace(/_(.)/g,function(e,t){return t.toUpperCase()}));var _=d.match(Oe);_&&re(_[1])&&(m=c,x=c.substr(0,c.length-5)+"end",c=c.substr(0,c.length-6)),f=vt(c.toLowerCase()),u[f]=c,!h&&n.hasOwnProperty(f)||(n[f]=p,Be(e,f)&&(n[f]=!0)),pe(e,t,p,f,h),ne(t,f,"A",r,i,m,x)}if(a=e.className,b(a)&&(a=a.animVal),w(a)&&""!==a)for(;o=y.exec(a);)f=vt(o[2]),ne(t,f,"C",r,i)&&(n[f]=Zr(o[3])),a=a.substr(o.index+o[0].length);break;case si:if(11===Ir)for(;e.parentNode&&e.nextSibling&&e.nextSibling.nodeType===si;)e.nodeValue=e.nodeValue+e.nextSibling.nodeValue,e.parentNode.removeChild(e.nextSibling);ce(t,e.nodeValue);break;case ui:G(e,t,n,r,i)}return t.sort(ae),t}function G(e,t,n,r,i){try{var o=v.exec(e.nodeValue);if(o){var a=vt(o[1]);ne(t,a,"M",r,i)&&(n[a]=Zr(o[2]))}}catch(s){}}function X(e,t,n){var r=[],i=0;if(t&&e.hasAttribute&&e.hasAttribute(t)){do{if(!e)throw Wi("uterdir","Unterminated attribute, found '{0}' but no matching '{1}' found.",t,n);e.nodeType==oi&&(e.hasAttribute(t)&&i++,e.hasAttribute(n)&&i--),r.push(e),e=e.nextSibling}while(i>0)}else r.push(e);return Rr(r)}function K(e,t,n){return function(r,i,o,a,s){return i=X(i[0],t,n),e(r,i,o,a,s)}}function Z(e,t,n,r,i,o){var a;return e?U(t,n,r,i,o):function(){return a||(a=U(t,n,r,i,o),t=n=o=null),a.apply(this,arguments)}}function J(e,t,n,o,a,s,u,c,f){function d(e,t,n,r){e&&(n&&(e=K(e,n,r)),e.require=h.require,e.directiveName=g,(k===h||h.$$isolateScope)&&(e=ve(e,{isolateScope:!0})),u.push(e)),t&&(n&&(t=K(t,n,r)),t.require=h.require,t.directiveName=g,(k===h||h.$$isolateScope)&&(t=ve(t,{isolateScope:!0})),c.push(t))}function p(e,o,a,s,f){function d(e,t,n,r){var i;if(C(e)||(r=n,n=t,t=e,e=void 0),j&&(i=y),n||(n=j?A.parent():A),!r)return f(e,t,i,n,R);var o=f.$$slots[r];if(o)return o(e,t,i,n,R);if($(o))throw Wi("noslot",'No parent directive that requires a transclusion with slot name "{0}". Element: {1}',r,Y(A))}var p,h,g,v,m,y,w,A,O,M;t===a?(O=n,A=n.$$element):(A=Rr(a),O=new D(A,n)),m=o,k?v=o.$new(!0):x&&(m=o.$parent),f&&(w=d,w.$$boundTransclude=f,w.isSlotFilled=function(e){return!!f.$$slots[e]}),_&&(y=ee(A,O,w,_,v,o,k)),k&&(U.$$addScopeInfo(A,v,!0,!(E&&(E===k||E===k.$$originalDirective))),U.$$addScopeClass(A,!0),v.$$isolateBindings=k.$$isolateBindings,M=me(o,O,v,v.$$isolateBindings,k),M.removeWatches&&v.$on("$destroy",M.removeWatches));for(var P in y){var T=_[P],F=y[P],N=T.$$bindings.bindToController;F.identifier&&N?F.bindingInfo=me(m,O,F.instance,N,T):F.bindingInfo={};var I=F();I!==F.instance&&(F.instance=I,A.data("$"+T.name+"Controller",I),F.bindingInfo.removeWatches&&F.bindingInfo.removeWatches(),F.bindingInfo=me(m,O,F.instance,N,T))}for(r(_,function(e,t){var n=e.require;e.bindToController&&!Kr(n)&&b(n)&&l(y[t].instance,Q(t,n,A,y))}),r(y,function(e){var t=e.instance;if(S(t.$onChanges))try{t.$onChanges(e.bindingInfo.initialChanges)}catch(n){i(n)}if(S(t.$onInit))try{t.$onInit()}catch(n){i(n)}S(t.$doCheck)&&(m.$watch(function(){t.$doCheck()}),t.$doCheck()),S(t.$onDestroy)&&m.$on("$destroy",function(){t.$onDestroy()})}),p=0,h=u.length;p<h;p++)g=u[p],$e(g,g.isolateScope?v:o,A,O,g.require&&Q(g.directiveName,g.require,A,y),w);var R=o;for(k&&(k.template||null===k.templateUrl)&&(R=v),e&&e(R,a.childNodes,void 0,f),p=c.length-1;p>=0;p--)g=c[p],$e(g,g.isolateScope?v:o,A,O,g.require&&Q(g.directiveName,g.require,A,y),w);r(y,function(e){var t=e.instance;S(t.$postLink)&&t.$postLink()})}f=f||{};for(var h,g,v,m,y,w=-Number.MAX_VALUE,x=f.newScopeDirective,_=f.controllerDirectives,k=f.newIsolateScopeDirective,E=f.templateDirective,A=f.nonTlbTranscludeDirective,O=!1,M=!1,j=f.hasElementTranscludeDirective,P=n.$$element=Rr(t),T=s,F=o,N=!1,R=!1,V=0,z=e.length;V<z;V++){h=e[V];var H=h.$$start,B=h.$$end;if(H&&(P=X(t,H,B)),v=void 0,w>h.priority)break;if((y=h.scope)&&(h.templateUrl||(b(y)?(ue("new/isolated scope",k||x,h,P),k=h):ue("new/isolated scope",k,h,P)),x=x||h),g=h.name,!N&&(h.replace&&(h.templateUrl||h.template)||h.transclude&&!h.$$tlb)){for(var G,J=V+1;G=e[J++];)if(G.transclude&&!G.$$tlb||G.replace&&(G.templateUrl||G.template)){R=!0;break}N=!0}if(!h.templateUrl&&h.controller&&(y=h.controller,_=_||he(),ue("'"+g+"' controller",_[g],h,P),_[g]=h),y=h.transclude)if(O=!0,h.$$tlb||(ue("transclusion",A,h,P),A=h),"element"==y)j=!0,w=h.priority,v=P,P=n.$$element=Rr(U.$$createComment(g,n[g])),t=P[0],ge(a,L(v),t),v[0].$$parentNode=v[0].parentNode,F=Z(R,v,o,w,T&&T.name,{nonTlbTranscludeDirective:A});else{var ne=he();if(v=Rr(Me(t)).contents(),b(y)){v=[];var re=he(),ae=he();r(y,function(e,t){var n="?"===e.charAt(0);e=n?e.substring(1):e,re[e]=t,ne[t]=null,ae[t]=n}),r(P.contents(),function(e){var t=re[vt(I(e))];t?(ae[t]=!0,ne[t]=ne[t]||[],ne[t].push(e)):v.push(e)}),r(ae,function(e,t){if(!e)throw Wi("reqslot","Required transclusion slot `{0}` was not filled.",t)});for(var se in ne)ne[se]&&(ne[se]=Z(R,ne[se],o))}P.empty(),F=Z(R,v,o,void 0,void 0,{needsNewScope:h.$$isolateScope||h.$$newScope}),F.$$slots=ne}if(h.template)if(M=!0,ue("template",E,h,P),E=h,y=S(h.template)?h.template(P,n):h.template,y=Ee(y),h.replace){if(T=h,v=xe(y)?[]:mt(fe(h.templateNamespace,Zr(y))),t=v[0],1!=v.length||t.nodeType!==oi)throw Wi("tplrt","Template for directive '{0}' must have exactly one root element. {1}",g,"");ge(a,P,t);var le={$attr:{}},ce=W(t,[],le),de=e.splice(V+1,e.length-(V+1));(k||x)&&te(ce,k,x),e=e.concat(ce).concat(de),ie(n,le),z=e.length}else P.html(y);if(h.templateUrl)M=!0,ue("template",E,h,P),E=h,h.replace&&(T=h),p=oe(e.splice(V,e.length-V),P,n,a,O&&F,u,c,{controllerDirectives:_,newScopeDirective:x!==h&&x,newIsolateScopeDirective:k,templateDirective:E,nonTlbTranscludeDirective:A}),z=e.length;else if(h.compile)try{m=h.compile(P,n,F);var pe=h.$$originalDirective||h;S(m)?d(null,q(pe,m),H,B):m&&d(q(pe,m.pre),q(pe,m.post),H,B)}catch(be){i(be,Y(P))}h.terminal&&(p.terminal=!0,w=Math.max(w,h.priority))}return p.scope=x&&x.scope===!0,p.transcludeOnThisElement=O,p.templateOnThisElement=M,p.transclude=F,f.hasElementTranscludeDirective=j,p}function Q(e,t,n,i){var o;if(w(t)){var a=t.match(_),s=t.substring(a[0].length),u=a[1]||a[3],l="?"===a[2];if("^^"===u?n=n.parent():(o=i&&i[s],o=o&&o.instance),!o){var c="$"+s+"Controller";o=u?n.inheritedData(c):n.data(c)}if(!o&&!l)throw Wi("ctreq","Controller '{0}', required by directive '{1}', can't be found!",s,e)}else if(Kr(t)){o=[];for(var f=0,d=t.length;f<d;f++)o[f]=Q(e,t[f],n,i)}else b(t)&&(o={},r(t,function(t,r){o[r]=Q(e,t,n,i)}));return o||null}function ee(e,t,n,r,i,o,a){var s=he();for(var l in r){var c=r[l],f={$scope:c===a||c.$$isolateScope?i:o,$element:e,$attrs:t,$transclude:n},d=c.controller;"@"==d&&(d=t[c.name]);var p=u(d,f,!0,c.controllerAs);s[c.name]=p,e.data("$"+c.name+"Controller",p.instance)}return s}function te(e,t,n){for(var r=0,i=e.length;r<i;r++)e[r]=d(e[r],{$$isolateScope:t,$$newScope:n})}function ne(e,n,r,o,s,u,l){if(n===s)return null;var p=null;if(c.hasOwnProperty(n))for(var h,g=t.get(n+f),v=0,m=g.length;v<m;v++)try{if(h=g[v],($(o)||o>h.priority)&&h.restrict.indexOf(r)!=-1){if(u&&(h=d(h,{$$start:u,$$end:l})),!h.$$bindings){var y=h.$$bindings=a(h,h.name);b(y.isolateScope)&&(h.$$isolateBindings=y.isolateScope)}e.push(h),p=h}}catch(w){i(w)}return p}function re(e){if(c.hasOwnProperty(e))for(var n,r=t.get(e+f),i=0,o=r.length;i<o;i++)if(n=r[i],n.multiElement)return!0;return!1}function ie(e,t){var n=t.$attr,i=e.$attr;e.$$element;r(e,function(r,i){"$"!=i.charAt(0)&&(t[i]&&t[i]!==r&&(r+=("style"===i?";":" ")+t[i]),e.$set(i,r,!0,n[i]))}),r(t,function(t,r){e.hasOwnProperty(r)||"$"===r.charAt(0)||(e[r]=t,"class"!==r&&"style"!==r&&(i[r]=n[r]))})}function oe(e,t,n,i,a,s,u,l){var c,f,p=[],h=t[0],g=e.shift(),v=d(g,{templateUrl:null,transclude:null,replace:null,$$originalDirective:g}),$=S(g.templateUrl)?g.templateUrl(t,n):g.templateUrl,m=g.templateNamespace;return t.empty(),o($).then(function(o){var d,y,w,x;if(o=Ee(o),g.replace){if(w=xe(o)?[]:mt(fe(m,Zr(o))),d=w[0],1!=w.length||d.nodeType!==oi)throw Wi("tplrt","Template for directive '{0}' must have exactly one root element. {1}",g.name,$);y={$attr:{}},ge(i,t,d);var _=W(d,[],y);b(g.scope)&&te(_,!0),e=_.concat(e),ie(n,y)}else d=h,t.html(o);for(e.unshift(v),c=J(e,d,n,a,t,g,s,u,l),r(i,function(e,n){e==d&&(i[n]=t[0])}),f=H(t[0].childNodes,a);p.length;){var S=p.shift(),k=p.shift(),E=p.shift(),C=p.shift(),A=t[0];if(!S.$$destroyed){if(k!==h){var O=k.className;l.hasElementTranscludeDirective&&g.replace||(A=Me(d)),ge(E,Rr(k),A),N(Rr(A),O)}x=c.transcludeOnThisElement?B(S,c.transclude,C):C,c(f,S,A,i,x)}}p=null}),function(e,t,n,r,i){var o=i;t.$$destroyed||(p?p.push(t,n,r,o):(c.transcludeOnThisElement&&(o=B(t,c.transclude,i)),c(f,t,n,r,o)))}}function ae(e,t){var n=t.priority-e.priority;return 0!==n?n:e.name!==t.name?e.name<t.name?-1:1:e.index-t.index}function ue(e,t,n,r){function i(e){return e?" (module: "+e+")":""}if(t)throw Wi("multidir","Multiple directives [{0}{1}, {2}{3}] asking for {4} on: {5}",t.name,i(t.$$moduleName),n.name,i(n.$$moduleName),e,Y(r))}function ce(e,t){var r=n(t,!0);r&&e.push({priority:0,compile:function(e){var t=e.parent(),n=!!t.length;return n&&U.$$addBindingClass(t),function(e,t){var i=t.parent();n||U.$$addBindingClass(i),U.$$addBindingInfo(i,r.expressions),e.$watch(r,function(e){t[0].nodeValue=e})}}})}function fe(t,n){switch(t=Tr(t||"html")){case"svg":case"math":var r=e.document.createElement("div");return r.innerHTML="<"+t+">"+n+"</"+t+">",r.childNodes[0].childNodes;default:return n}}function de(e,t){if("srcdoc"==t)return E.HTML;var n=I(e);return"xlinkHref"==t||"form"==n&&"action"==t||"img"!=n&&("src"==t||"ngSrc"==t)?E.RESOURCE_URL:void 0}function pe(e,t,r,i,o){var a=de(e,i);o=x[i]||o;var s=n(r,!0,a,o);if(s){if("multiple"===i&&"select"===I(e))throw Wi("selmulti","Binding to the 'multiple' attribute is not supported. Element: {0}",Y(e));t.push({priority:100,compile:function(){return{pre:function(e,t,u){var l=u.$$observers||(u.$$observers=he());if(k.test(i))throw Wi("nodomevents","Interpolations for HTML DOM event attributes are disallowed. Please use the ng- versions (such as ng-click instead of onclick) instead.");var c=u[i];c!==r&&(s=c&&n(c,!0,a,o),r=c),s&&(u[i]=s(e),(l[i]||(l[i]=[])).$$inter=!0,(u.$$observers&&u.$$observers[i].$$scope||e).$watch(s,function(e,t){"class"===i&&e!=t?u.$updateClass(e,t):u.$set(i,e)}))}}}})}}function ge(t,n,r){var i,o,a=n[0],s=n.length,u=a.parentNode;if(t)for(i=0,o=t.length;i<o;i++)if(t[i]==a){t[i++]=r;for(var l=i,c=l+s-1,f=t.length;l<f;l++,c++)c<f?t[l]=t[c]:delete t[l];t.length-=s-1,t.context===a&&(t.context=r);break}u&&u.replaceChild(r,a);var d=e.document.createDocumentFragment();for(i=0;i<s;i++)d.appendChild(n[i]);for(Rr.hasData(a)&&(Rr.data(r,Rr.data(a)),Rr(a).off("$destroy")),Rr.cleanData(d.querySelectorAll("*")),i=1;i<s;i++)delete n[i];n[0]=r,n.length=1}function ve(e,t){return l(function(){return e.apply(null,arguments)},e,t)}function $e(e,t,n,r,o,a){try{e(t,n,r,o,a)}catch(s){i(s,Y(n))}}function me(e,t,i,o,a){function u(t,n,r){S(i.$onChanges)&&n!==r&&(be||(e.$$postDigest(T),be=[]),c||(c={},be.push(l)),c[t]&&(r=c[t].previousValue),c[t]=new gt(r,n))}function l(){i.$onChanges(c),c=void 0}var c,f=[],d={};return r(o,function(r,o){var l,c,h,g,v,$=r.attrName,m=r.optional,b=r.mode;switch(b){case"@":m||Pr.call(t,$)||(i[o]=t[$]=void 0),t.$observe($,function(e){if(w(e)||j(e)){var t=i[o];u(o,e,t),i[o]=e}}),t.$$observers[$].$$scope=e,l=t[$],w(l)?i[o]=n(l)(e):j(l)&&(i[o]=l),d[o]=new gt(Gi,i[o]);break;case"=":if(!Pr.call(t,$)){if(m)break;t[$]=void 0}if(m&&!t[$])break;c=s(t[$]),g=c.literal?V:function(e,t){return e===t||e!==e&&t!==t},h=c.assign||function(){throw l=i[o]=c(e),Wi("nonassign","Expression '{0}' in attribute '{1}' used with directive '{2}' is non-assignable!",t[$],$,a.name)},l=i[o]=c(e);var y=function(t){return g(t,i[o])||(g(t,l)?h(e,t=i[o]):i[o]=t),l=t};y.$stateful=!0,v=r.collection?e.$watchCollection(t[$],y):e.$watch(s(t[$],y),null,c.literal),f.push(v);break;case"<":if(!Pr.call(t,$)){if(m)break;t[$]=void 0}if(m&&!t[$])break;c=s(t[$]);var x=i[o]=c(e);d[o]=new gt(Gi,i[o]),v=e.$watch(c,function(e,t){if(t===e){if(t===x)return;t=x}u(o,e,t),i[o]=e},c.literal),f.push(v);break;case"&":if(c=t.hasOwnProperty($)?s(t[$]):p,c===p&&m)break;i[o]=function(t){return c(e,t)}}}),{initialChanges:d,removeWatches:f.length&&function(){for(var e=0,t=f.length;e<t;++e)f[e]()}}}var be,ye=/^\w/,we=e.document.createElement("div"),_e=O;D.prototype={$normalize:vt,$addClass:function(e){e&&e.length>0&&M.addClass(this.$$element,e)},$removeClass:function(e){e&&e.length>0&&M.removeClass(this.$$element,e)},$updateClass:function(e,t){var n=$t(e,t);n&&n.length&&M.addClass(this.$$element,n);var r=$t(t,e);r&&r.length&&M.removeClass(this.$$element,r)},$set:function(e,t,n,o){var a,s=this.$$element[0],u=Be(s,e),l=We(e),c=e;if(u?(this.$$element.prop(e,t),o=u):l&&(this[l]=t,c=l),this[e]=t,o?this.$attr[e]=o:(o=this.$attr[e],o||(this.$attr[e]=o=se(e,"-"))),a=I(this.$$element),"a"===a&&("href"===e||"xlinkHref"===e)||"img"===a&&"src"===e)this[e]=t=P(t,"src"===e);else if("img"===a&&"srcset"===e&&m(t)){for(var f="",d=Zr(t),p=/(\s+\d+x\s*,|\s+\d+w\s*,|\s+,|,\s+)/,h=/\s/.test(d)?p:/(,)/,g=d.split(h),v=Math.floor(g.length/2),b=0;b<v;b++){var y=2*b;f+=P(Zr(g[y]),!0),f+=" "+Zr(g[y+1])}var w=Zr(g[2*b]).split(/\s/);f+=P(Zr(w[0]),!0),2===w.length&&(f+=" "+Zr(w[1])),this[e]=t=f}n!==!1&&(null===t||$(t)?this.$$element.removeAttr(o):ye.test(o)?this.$$element.attr(o,t):F(this.$$element[0],o,t));var x=this.$$observers;x&&r(x[c],function(e){try{e(t)}catch(n){i(n)}})},$observe:function(e,t){var n=this,r=n.$$observers||(n.$$observers=he()),i=r[e]||(r[e]=[]);return i.push(t),g.$evalAsync(function(){i.$$inter||!n.hasOwnProperty(e)||$(n[e])||t(n[e])}),function(){R(i,t)}}};var Se=n.startSymbol(),ke=n.endSymbol(),Ee="{{"==Se&&"}}"==ke?h:function(e){return e.replace(/\{\{/g,Se).replace(/}}/g,ke)},Ce=/^ngAttr[A-Z]/,Oe=/^(.+)Start$/;return U.$$addBindingInfo=A?function(e,t){var n=e.data("$binding")||[];Kr(t)?n=n.concat(t):n.push(t),e.data("$binding",n)}:p,U.$$addBindingClass=A?function(e){N(e,"ng-binding")}:p,U.$$addScopeInfo=A?function(e,t,n,r){var i=n?r?"$isolateScopeNoTemplate":"$isolateScope":"$scope";e.data(i,t)}:p,U.$$addScopeClass=A?function(e,t){N(e,t?"ng-isolate-scope":"ng-scope")}:p,U.$$createComment=function(t,n){var r="";return A&&(r=" "+(t||"")+": ",n&&(r+=n+" ")),e.document.createComment(r)},U}]}function gt(e,t){this.previousValue=e,this.currentValue=t}function vt(e){return we(e.replace(Xi,""))}function $t(e,t){var n="",r=e.split(/\s+/),i=t.split(/\s+/);e:for(var o=0;o<r.length;o++){for(var a=r[o],s=0;s<i.length;s++)if(a==i[s])continue e;n+=(n.length>0?" ":"")+a}return n}function mt(e){e=Rr(e);var t=e.length;if(t<=1)return e;for(;t--;){var n=e[t];n.nodeType===ui&&Lr.call(e,t,1)}return e}function bt(e,t){if(t&&w(t))return t;if(w(e)){var n=Yi.exec(e);if(n)return n[3]}}function yt(){var e={},n=!1;this.has=function(t){return e.hasOwnProperty(t)},this.register=function(t,n){fe(t,"controller"),b(t)?l(e,t):e[t]=n},this.allowGlobals=function(){n=!0},this.$get=["$injector","$window",function(r,i){function o(e,n,r,i){if(!e||!b(e.$scope))throw t("$controller")("noscp","Cannot export controller '{0}' as '{1}'! No $scope object provided via `locals`.",i,n);e.$scope[n]=r}return function(t,a,s,u){var c,f,d,p;if(s=s===!0,u&&w(u)&&(p=u),w(t)){if(f=t.match(Yi),!f)throw Ki("ctrlfmt","Badly formed controller string '{0}'. Must match `__name__ as __id__` or `__name__`.",t);d=f[1],p=p||f[3],t=e.hasOwnProperty(d)?e[d]:de(a.$scope,d,!0)||(n?de(i,d,!0):void 0),ce(t,d,!0)}if(s){var h=(Kr(t)?t[t.length-1]:t).prototype;c=Object.create(h||null),p&&o(a,p,c,d||t.name);var g;return g=l(function(){var e=r.invoke(t,c,a,d);return e!==c&&(b(e)||S(e))&&(c=e,p&&o(a,p,c,d||t.name)),c},{instance:c,identifier:p})}return c=r.instantiate(t,a,d),p&&o(a,p,c,d||t.name),c}}]}function wt(){this.$get=["$window",function(e){return Rr(e.document)}]}function xt(){this.$get=["$log",function(e){return function(t,n){e.error.apply(e,arguments)}}]}function _t(e){return b(e)?_(e)?e.toISOString():B(e):e}function St(){this.$get=function(){return function(e){if(!e)return"";var t=[];return i(e,function(e,n){null===e||$(e)||(Kr(e)?r(e,function(e){t.push(te(n)+"="+te(_t(e)))}):t.push(te(n)+"="+te(_t(e))))}),t.join("&")}}}function kt(){this.$get=function(){return function(e){function t(e,o,a){null===e||$(e)||(Kr(e)?r(e,function(e,n){t(e,o+"["+(b(e)?n:"")+"]")}):b(e)&&!_(e)?i(e,function(e,n){
|
4 |
+
t(e,o+(a?"":"[")+n+(a?"":"]"))}):n.push(te(o)+"="+te(_t(e))))}if(!e)return"";var n=[];return t(e,"",!0),n.join("&")}}}function Et(e,t){if(w(e)){var n=e.replace(no,"").trim();if(n){var r=t("Content-Type");(r&&0===r.indexOf(Ji)||Ct(n))&&(e=W(n))}}return e}function Ct(e){var t=e.match(eo);return t&&to[t[0]].test(e)}function At(e){function t(e,t){e&&(i[e]=i[e]?i[e]+", "+t:t)}var n,i=he();return w(e)?r(e.split("\n"),function(e){n=e.indexOf(":"),t(Tr(Zr(e.substr(0,n))),Zr(e.substr(n+1)))}):b(e)&&r(e,function(e,n){t(Tr(n),Zr(e))}),i}function Ot(e){var t;return function(n){if(t||(t=At(e)),n){var r=t[Tr(n)];return void 0===r&&(r=null),r}return t}}function Mt(e,t,n,i){return S(i)?i(e,t,n):(r(i,function(r){e=r(e,t,n)}),e)}function jt(e){return 200<=e&&e<300}function Pt(){var e=this.defaults={transformResponse:[Et],transformRequest:[function(e){return!b(e)||A(e)||M(e)||O(e)?e:B(e)}],headers:{common:{Accept:"application/json, text/plain, */*"},post:ve(Qi),put:ve(Qi),patch:ve(Qi)},xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",paramSerializer:"$httpParamSerializer"},n=!1;this.useApplyAsync=function(e){return m(e)?(n=!!e,this):n};var i=!0;this.useLegacyPromiseExtensions=function(e){return m(e)?(i=!!e,this):i};var o=this.interceptors=[];this.$get=["$httpBackend","$$cookieReader","$cacheFactory","$rootScope","$q","$injector",function(a,s,u,c,f,d){function p(n){function o(e,t){for(var n=0,r=t.length;n<r;){var i=t[n++],o=t[n++];e=e.then(i,o)}return t.length=0,e}function a(e,t){var n,i={};return r(e,function(e,r){S(e)?(n=e(t),null!=n&&(i[r]=n)):i[r]=e}),i}function s(t){var n,r,i,o=e.headers,s=l({},t.headers);o=l({},o.common,o[Tr(t.method)]);e:for(n in o){r=Tr(n);for(i in s)if(Tr(i)===r)continue e;s[n]=o[n]}return a(s,ve(t))}function u(t){var n=t.headers,i=Mt(t.data,Ot(n),void 0,t.transformRequest);return $(i)&&r(n,function(e,t){"content-type"===Tr(t)&&delete n[t]}),$(t.withCredentials)&&!$(e.withCredentials)&&(t.withCredentials=e.withCredentials),v(t,i).then(c,c)}function c(e){var t=l({},e);return t.data=Mt(e.data,e.headers,e.status,p.transformResponse),jt(e.status)?t:f.reject(t)}if(!b(n))throw t("$http")("badreq","Http request configuration must be an object. Received: {0}",n);if(!w(n.url))throw t("$http")("badreq","Http request configuration url must be a string. Received: {0}",n.url);var p=l({method:"get",transformRequest:e.transformRequest,transformResponse:e.transformResponse,paramSerializer:e.paramSerializer},n);p.headers=s(n),p.method=Dr(p.method),p.paramSerializer=w(p.paramSerializer)?d.get(p.paramSerializer):p.paramSerializer;var h=[],g=[],m=f.when(p);return r(_,function(e){(e.request||e.requestError)&&h.unshift(e.request,e.requestError),(e.response||e.responseError)&&g.push(e.response,e.responseError)}),m=o(m,h),m=m.then(u),m=o(m,g),i?(m.success=function(e){return ce(e,"fn"),m.then(function(t){e(t.data,t.status,t.headers,p)}),m},m.error=function(e){return ce(e,"fn"),m.then(null,function(t){e(t.data,t.status,t.headers,p)}),m}):(m.success=io("success"),m.error=io("error")),m}function h(e){r(arguments,function(e){p[e]=function(t,n){return p(l({},n||{},{method:e,url:t}))}})}function g(e){r(arguments,function(e){p[e]=function(t,n,r){return p(l({},r||{},{method:e,url:t,data:n}))}})}function v(t,i){function o(e){if(e){var t={};return r(e,function(e,r){t[r]=function(t){function r(){e(t)}n?c.$applyAsync(r):c.$$phase?r():c.$apply(r)}}),t}}function u(e,t,r,i){function o(){l(t,e,r,i)}g&&(jt(e)?g.put(k,[e,t,At(r),i]):g.remove(k)),n?c.$applyAsync(o):(o(),c.$$phase||c.$apply())}function l(e,n,r,i){n=n>=-1?n:0,(jt(n)?w.resolve:w.reject)({data:e,status:n,headers:Ot(r),config:t,statusText:i})}function d(e){l(e.data,e.status,ve(e.headers()),e.statusText)}function h(){var e=p.pendingRequests.indexOf(t);e!==-1&&p.pendingRequests.splice(e,1)}var g,v,w=f.defer(),_=w.promise,S=t.headers,k=y(t.url,t.paramSerializer(t.params));if(p.pendingRequests.push(t),_.then(h,h),!t.cache&&!e.cache||t.cache===!1||"GET"!==t.method&&"JSONP"!==t.method||(g=b(t.cache)?t.cache:b(e.cache)?e.cache:x),g&&(v=g.get(k),m(v)?P(v)?v.then(d,d):Kr(v)?l(v[1],v[0],ve(v[2]),v[3]):l(v,200,{},"OK"):g.put(k,_)),$(v)){var E=Fn(t.url)?s()[t.xsrfCookieName||e.xsrfCookieName]:void 0;E&&(S[t.xsrfHeaderName||e.xsrfHeaderName]=E),a(t.method,k,i,u,S,t.timeout,t.withCredentials,t.responseType,o(t.eventHandlers),o(t.uploadEventHandlers))}return _}function y(e,t){return t.length>0&&(e+=(e.indexOf("?")==-1?"?":"&")+t),e}var x=u("$http");e.paramSerializer=w(e.paramSerializer)?d.get(e.paramSerializer):e.paramSerializer;var _=[];return r(o,function(e){_.unshift(w(e)?d.get(e):d.invoke(e))}),p.pendingRequests=[],h("get","delete","head","jsonp"),g("post","put","patch"),p.defaults=e,p}]}function Tt(){this.$get=function(){return function(){return new e.XMLHttpRequest}}}function Dt(){this.$get=["$browser","$jsonpCallbacks","$document","$xhrFactory",function(e,t,n,r){return Ft(e,r,e.defer,t,n[0])}]}function Ft(e,t,n,i,o){function a(e,t,n){e=e.replace("JSON_CALLBACK",t);var r=o.createElement("script"),a=null;return r.type="text/javascript",r.src=e,r.async=!0,a=function(e){gi(r,"load",a),gi(r,"error",a),o.body.removeChild(r),r=null;var s=-1,u="unknown";e&&("load"!==e.type||i.wasCalled(t)||(e={type:"error"}),u=e.type,s="error"===e.type?404:200),n&&n(s,u)},hi(r,"load",a),hi(r,"error",a),o.body.appendChild(r),a}return function(o,s,u,l,c,f,d,h,g,v){function b(){x&&x(),_&&_.abort()}function y(t,r,i,o,a){m(E)&&n.cancel(E),x=_=null,t(r,i,o,a),e.$$completeOutstandingRequest(p)}if(e.$$incOutstandingRequestCount(),s=s||e.url(),"jsonp"===Tr(o))var w=i.createCallback(s),x=a(s,w,function(e,t){var n=200===e&&i.getResponse(w);y(l,e,n,"",t),i.removeCallback(w)});else{var _=t(o,s);_.open(o,s,!0),r(c,function(e,t){m(e)&&_.setRequestHeader(t,e)}),_.onload=function(){var e=_.statusText||"",t="response"in _?_.response:_.responseText,n=1223===_.status?204:_.status;0===n&&(n=t?200:"file"==Dn(s).protocol?404:0),y(l,n,t,_.getAllResponseHeaders(),e)};var S=function(){y(l,-1,null,null,"")};if(_.onerror=S,_.onabort=S,r(g,function(e,t){_.addEventListener(t,e)}),r(v,function(e,t){_.upload.addEventListener(t,e)}),d&&(_.withCredentials=!0),h)try{_.responseType=h}catch(k){if("json"!==h)throw k}_.send($(u)?null:u)}if(f>0)var E=n(b,f);else P(f)&&f.then(b)}}function Nt(){var e="{{",t="}}";this.startSymbol=function(t){return t?(e=t,this):e},this.endSymbol=function(e){return e?(t=e,this):t},this.$get=["$parse","$exceptionHandler","$sce",function(n,r,i){function o(e){return"\\\\\\"+e}function a(n){return n.replace(p,e).replace(h,t)}function s(e){if(null==e)return"";switch(typeof e){case"string":break;case"number":e=""+e;break;default:e=B(e)}return e}function u(e,t,n,r){var i;return i=e.$watch(function(e){return i(),r(e)},t,n)}function c(o,c,p,h){function v(e){try{return e=P(e),h&&!m(e)?e:s(e)}catch(t){r(oo.interr(o,t))}}if(!o.length||o.indexOf(e)===-1){var b;if(!c){var y=a(o);b=g(y),b.exp=o,b.expressions=[],b.$$watchDelegate=u}return b}h=!!h;for(var w,x,_,k=0,E=[],C=[],A=o.length,O=[],M=[];k<A;){if((w=o.indexOf(e,k))==-1||(x=o.indexOf(t,w+f))==-1){k!==A&&O.push(a(o.substring(k)));break}k!==w&&O.push(a(o.substring(k,w))),_=o.substring(w+f,x),E.push(_),C.push(n(_,v)),k=x+d,M.push(O.length),O.push("")}if(p&&O.length>1&&oo.throwNoconcat(o),!c||E.length){var j=function(e){for(var t=0,n=E.length;t<n;t++){if(h&&$(e[t]))return;O[M[t]]=e[t]}return O.join("")},P=function(e){return p?i.getTrusted(p,e):i.valueOf(e)};return l(function(e){var t=0,n=E.length,i=new Array(n);try{for(;t<n;t++)i[t]=C[t](e);return j(i)}catch(a){r(oo.interr(o,a))}},{exp:o,expressions:E,$$watchDelegate:function(e,t){var n;return e.$watchGroup(C,function(r,i){var o=j(r);S(t)&&t.call(this,o,r!==i?n:o,e),n=o})}})}}var f=e.length,d=t.length,p=new RegExp(e.replace(/./g,o),"g"),h=new RegExp(t.replace(/./g,o),"g");return c.startSymbol=function(){return e},c.endSymbol=function(){return t},c}]}function It(){this.$get=["$rootScope","$window","$q","$$q","$browser",function(e,t,n,r,i){function o(o,s,u,l){function c(){f?o.apply(null,d):o(g)}var f=arguments.length>4,d=f?L(arguments,4):[],p=t.setInterval,h=t.clearInterval,g=0,v=m(l)&&!l,$=(v?r:n).defer(),b=$.promise;return u=m(u)?u:0,b.$$intervalId=p(function(){v?i.defer(c):e.$evalAsync(c),$.notify(g++),u>0&&g>=u&&($.resolve(g),h(b.$$intervalId),delete a[b.$$intervalId]),v||e.$apply()},s),a[b.$$intervalId]=$,b}var a={};return o.cancel=function(e){return!!(e&&e.$$intervalId in a)&&(a[e.$$intervalId].reject("canceled"),t.clearInterval(e.$$intervalId),delete a[e.$$intervalId],!0)},o}]}function Rt(e){for(var t=e.split("/"),n=t.length;n--;)t[n]=ee(t[n]);return t.join("/")}function Ut(e,t){var n=Dn(e);t.$$protocol=n.protocol,t.$$host=n.hostname,t.$$port=f(n.port)||uo[n.protocol]||null}function Vt(e,t){var n="/"!==e.charAt(0);n&&(e="/"+e);var r=Dn(e);t.$$path=decodeURIComponent(n&&"/"===r.pathname.charAt(0)?r.pathname.substring(1):r.pathname),t.$$search=J(r.search),t.$$hash=decodeURIComponent(r.hash),t.$$path&&"/"!=t.$$path.charAt(0)&&(t.$$path="/"+t.$$path)}function zt(e,t){return 0===e.lastIndexOf(t,0)}function Lt(e,t){if(zt(t,e))return t.substr(e.length)}function qt(e){var t=e.indexOf("#");return t==-1?e:e.substr(0,t)}function Ht(e){return e.replace(/(#.+)|#$/,"$1")}function Bt(e){return e.substr(0,qt(e).lastIndexOf("/")+1)}function Wt(e){return e.substring(0,e.indexOf("/",e.indexOf("//")+2))}function Gt(e,t,n){this.$$html5=!0,n=n||"",Ut(e,this),this.$$parse=function(e){var n=Lt(t,e);if(!w(n))throw lo("ipthprfx",'Invalid url "{0}", missing path prefix "{1}".',e,t);Vt(n,this),this.$$path||(this.$$path="/"),this.$$compose()},this.$$compose=function(){var e=Q(this.$$search),n=this.$$hash?"#"+ee(this.$$hash):"";this.$$url=Rt(this.$$path)+(e?"?"+e:"")+n,this.$$absUrl=t+this.$$url.substr(1)},this.$$parseLinkUrl=function(r,i){if(i&&"#"===i[0])return this.hash(i.slice(1)),!0;var o,a,s;return m(o=Lt(e,r))?(a=o,s=m(o=Lt(n,o))?t+(Lt("/",o)||o):e+a):m(o=Lt(t,r))?s=t+o:t==r+"/"&&(s=t),s&&this.$$parse(s),!!s}}function Xt(e,t,n){Ut(e,this),this.$$parse=function(r){function i(e,t,n){var r,i=/^\/[A-Z]:(\/.*)/;return zt(t,n)&&(t=t.replace(n,"")),i.exec(t)?e:(r=i.exec(e),r?r[1]:e)}var o,a=Lt(e,r)||Lt(t,r);$(a)||"#"!==a.charAt(0)?this.$$html5?o=a:(o="",$(a)&&(e=r,this.replace())):(o=Lt(n,a),$(o)&&(o=a)),Vt(o,this),this.$$path=i(this.$$path,o,e),this.$$compose()},this.$$compose=function(){var t=Q(this.$$search),r=this.$$hash?"#"+ee(this.$$hash):"";this.$$url=Rt(this.$$path)+(t?"?"+t:"")+r,this.$$absUrl=e+(this.$$url?n+this.$$url:"")},this.$$parseLinkUrl=function(t,n){return qt(e)==qt(t)&&(this.$$parse(t),!0)}}function Kt(e,t,n){this.$$html5=!0,Xt.apply(this,arguments),this.$$parseLinkUrl=function(r,i){if(i&&"#"===i[0])return this.hash(i.slice(1)),!0;var o,a;return e==qt(r)?o=r:(a=Lt(t,r))?o=e+n+a:t===r+"/"&&(o=t),o&&this.$$parse(o),!!o},this.$$compose=function(){var t=Q(this.$$search),r=this.$$hash?"#"+ee(this.$$hash):"";this.$$url=Rt(this.$$path)+(t?"?"+t:"")+r,this.$$absUrl=e+n+this.$$url}}function Yt(e){return function(){return this[e]}}function Zt(e,t){return function(n){return $(n)?this[e]:(this[e]=t(n),this.$$compose(),this)}}function Jt(){var e="",t={enabled:!1,requireBase:!0,rewriteLinks:!0};this.hashPrefix=function(t){return m(t)?(e=t,this):e},this.html5Mode=function(e){return j(e)?(t.enabled=e,this):b(e)?(j(e.enabled)&&(t.enabled=e.enabled),j(e.requireBase)&&(t.requireBase=e.requireBase),j(e.rewriteLinks)&&(t.rewriteLinks=e.rewriteLinks),this):t},this.$get=["$rootScope","$browser","$sniffer","$rootElement","$window",function(n,r,i,o,a){function s(e,t,n){var i=l.url(),o=l.$$state;try{r.url(e,t,n),l.$$state=r.state()}catch(a){throw l.url(i),l.$$state=o,a}}function u(e,t){n.$broadcast("$locationChangeSuccess",l.absUrl(),e,l.$$state,t)}var l,c,f,d=r.baseHref(),p=r.url();if(t.enabled){if(!d&&t.requireBase)throw lo("nobase","$location in HTML5 mode requires a <base> tag to be present!");f=Wt(p)+(d||"/"),c=i.history?Gt:Kt}else f=qt(p),c=Xt;var h=Bt(f);l=new c(f,h,"#"+e),l.$$parseLinkUrl(p,p),l.$$state=r.state();var g=/^\s*(javascript|mailto):/i;o.on("click",function(e){if(t.rewriteLinks&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey&&2!=e.which&&2!=e.button){for(var i=Rr(e.target);"a"!==I(i[0]);)if(i[0]===o[0]||!(i=i.parent())[0])return;var s=i.prop("href"),u=i.attr("href")||i.attr("xlink:href");b(s)&&"[object SVGAnimatedString]"===s.toString()&&(s=Dn(s.animVal).href),g.test(s)||!s||i.attr("target")||e.isDefaultPrevented()||l.$$parseLinkUrl(s,u)&&(e.preventDefault(),l.absUrl()!=r.url()&&(n.$apply(),a.angular["ff-684208-preventDefault"]=!0))}}),Ht(l.absUrl())!=Ht(p)&&r.url(l.absUrl(),!0);var v=!0;return r.onUrlChange(function(e,t){return $(Lt(h,e))?void(a.location.href=e):(n.$evalAsync(function(){var r,i=l.absUrl(),o=l.$$state;e=Ht(e),l.$$parse(e),l.$$state=t,r=n.$broadcast("$locationChangeStart",e,i,t,o).defaultPrevented,l.absUrl()===e&&(r?(l.$$parse(i),l.$$state=o,s(i,!1,o)):(v=!1,u(i,o)))}),void(n.$$phase||n.$digest()))}),n.$watch(function(){var e=Ht(r.url()),t=Ht(l.absUrl()),o=r.state(),a=l.$$replace,c=e!==t||l.$$html5&&i.history&&o!==l.$$state;(v||c)&&(v=!1,n.$evalAsync(function(){var t=l.absUrl(),r=n.$broadcast("$locationChangeStart",t,e,l.$$state,o).defaultPrevented;l.absUrl()===t&&(r?(l.$$parse(e),l.$$state=o):(c&&s(t,a,o===l.$$state?null:l.$$state),u(e,o)))})),l.$$replace=!1}),l}]}function Qt(){var e=!0,t=this;this.debugEnabled=function(t){return m(t)?(e=t,this):e},this.$get=["$window",function(n){function i(e){return e instanceof Error&&(e.stack?e=e.message&&e.stack.indexOf(e.message)===-1?"Error: "+e.message+"\n"+e.stack:e.stack:e.sourceURL&&(e=e.message+"\n"+e.sourceURL+":"+e.line)),e}function o(e){var t=n.console||{},o=t[e]||t.log||p,a=!1;try{a=!!o.apply}catch(s){}return a?function(){var e=[];return r(arguments,function(t){e.push(i(t))}),o.apply(t,e)}:function(e,t){o(e,null==t?"":t)}}return{log:o("log"),info:o("info"),warn:o("warn"),error:o("error"),debug:function(){var n=o("debug");return function(){e&&n.apply(t,arguments)}}()}}]}function en(e,t){if("__defineGetter__"===e||"__defineSetter__"===e||"__lookupGetter__"===e||"__lookupSetter__"===e||"__proto__"===e)throw fo("isecfld","Attempting to access a disallowed field in Angular expressions! Expression: {0}",t);return e}function tn(e){return e+""}function nn(e,t){if(e){if(e.constructor===e)throw fo("isecfn","Referencing Function in Angular expressions is disallowed! Expression: {0}",t);if(e.window===e)throw fo("isecwindow","Referencing the Window in Angular expressions is disallowed! Expression: {0}",t);if(e.children&&(e.nodeName||e.prop&&e.attr&&e.find))throw fo("isecdom","Referencing DOM nodes in Angular expressions is disallowed! Expression: {0}",t);if(e===Object)throw fo("isecobj","Referencing Object in Angular expressions is disallowed! Expression: {0}",t)}return e}function rn(e,t){if(e){if(e.constructor===e)throw fo("isecfn","Referencing Function in Angular expressions is disallowed! Expression: {0}",t);if(e===po||e===ho||e===go)throw fo("isecff","Referencing call, apply or bind in Angular expressions is disallowed! Expression: {0}",t)}}function on(e,t){if(e&&(e===(0).constructor||e===(!1).constructor||e==="".constructor||e==={}.constructor||e===[].constructor||e===Function.constructor))throw fo("isecaf","Assigning to a constructor is disallowed! Expression: {0}",t)}function an(e,t){return"undefined"!=typeof e?e:t}function sn(e,t){return"undefined"==typeof e?t:"undefined"==typeof t?e:e+t}function un(e,t){var n=e(t);return!n.$stateful}function ln(e,t){var n,i;switch(e.type){case bo.Program:n=!0,r(e.body,function(e){ln(e.expression,t),n=n&&e.expression.constant}),e.constant=n;break;case bo.Literal:e.constant=!0,e.toWatch=[];break;case bo.UnaryExpression:ln(e.argument,t),e.constant=e.argument.constant,e.toWatch=e.argument.toWatch;break;case bo.BinaryExpression:ln(e.left,t),ln(e.right,t),e.constant=e.left.constant&&e.right.constant,e.toWatch=e.left.toWatch.concat(e.right.toWatch);break;case bo.LogicalExpression:ln(e.left,t),ln(e.right,t),e.constant=e.left.constant&&e.right.constant,e.toWatch=e.constant?[]:[e];break;case bo.ConditionalExpression:ln(e.test,t),ln(e.alternate,t),ln(e.consequent,t),e.constant=e.test.constant&&e.alternate.constant&&e.consequent.constant,e.toWatch=e.constant?[]:[e];break;case bo.Identifier:e.constant=!1,e.toWatch=[e];break;case bo.MemberExpression:ln(e.object,t),e.computed&&ln(e.property,t),e.constant=e.object.constant&&(!e.computed||e.property.constant),e.toWatch=[e];break;case bo.CallExpression:n=!!e.filter&&un(t,e.callee.name),i=[],r(e.arguments,function(e){ln(e,t),n=n&&e.constant,e.constant||i.push.apply(i,e.toWatch)}),e.constant=n,e.toWatch=e.filter&&un(t,e.callee.name)?i:[e];break;case bo.AssignmentExpression:ln(e.left,t),ln(e.right,t),e.constant=e.left.constant&&e.right.constant,e.toWatch=[e];break;case bo.ArrayExpression:n=!0,i=[],r(e.elements,function(e){ln(e,t),n=n&&e.constant,e.constant||i.push.apply(i,e.toWatch)}),e.constant=n,e.toWatch=i;break;case bo.ObjectExpression:n=!0,i=[],r(e.properties,function(e){ln(e.value,t),n=n&&e.value.constant&&!e.computed,e.value.constant||i.push.apply(i,e.value.toWatch)}),e.constant=n,e.toWatch=i;break;case bo.ThisExpression:e.constant=!1,e.toWatch=[];break;case bo.LocalsExpression:e.constant=!1,e.toWatch=[]}}function cn(e){if(1==e.length){var t=e[0].expression,n=t.toWatch;return 1!==n.length?n:n[0]!==t?n:void 0}}function fn(e){return e.type===bo.Identifier||e.type===bo.MemberExpression}function dn(e){if(1===e.body.length&&fn(e.body[0].expression))return{type:bo.AssignmentExpression,left:e.body[0].expression,right:{type:bo.NGValueParameter},operator:"="}}function pn(e){return 0===e.body.length||1===e.body.length&&(e.body[0].expression.type===bo.Literal||e.body[0].expression.type===bo.ArrayExpression||e.body[0].expression.type===bo.ObjectExpression)}function hn(e){return e.constant}function gn(e,t){this.astBuilder=e,this.$filter=t}function vn(e,t){this.astBuilder=e,this.$filter=t}function $n(e){return"constructor"==e}function mn(e){return S(e.valueOf)?e.valueOf():wo.call(e)}function bn(){var e,t,n=he(),i=he(),o={"true":!0,"false":!1,"null":null,undefined:void 0};this.addLiteral=function(e,t){o[e]=t},this.setIdentifierFns=function(n,r){return e=n,t=r,this},this.$get=["$filter",function(a){function s(e,t,r){var o,s,l;switch(r=r||y,typeof e){case"string":e=e.trim(),l=e;var v=r?i:n;if(o=v[l],!o){":"===e.charAt(0)&&":"===e.charAt(1)&&(s=!0,e=e.substring(2));var m=r?b:$,w=new mo(m),x=new yo(w,a,m);o=x.parse(e),o.constant?o.$$watchDelegate=h:s?o.$$watchDelegate=o.literal?d:f:o.inputs&&(o.$$watchDelegate=c),r&&(o=u(o)),v[l]=o}return g(o,t);case"function":return g(e,t);default:return g(p,t)}}function u(e){function t(t,n,r,i){var o=y;y=!0;try{return e(t,n,r,i)}finally{y=o}}if(!e)return e;t.$$watchDelegate=e.$$watchDelegate,t.assign=u(e.assign),t.constant=e.constant,t.literal=e.literal;for(var n=0;e.inputs&&n<e.inputs.length;++n)e.inputs[n]=u(e.inputs[n]);return t.inputs=e.inputs,t}function l(e,t){return null==e||null==t?e===t:("object"!=typeof e||(e=mn(e),"object"!=typeof e))&&(e===t||e!==e&&t!==t)}function c(e,t,n,r,i){var o,a=r.inputs;if(1===a.length){var s=l;return a=a[0],e.$watch(function(e){var t=a(e);return l(t,s)||(o=r(e,void 0,void 0,[t]),s=t&&mn(t)),o},t,n,i)}for(var u=[],c=[],f=0,d=a.length;f<d;f++)u[f]=l,c[f]=null;return e.$watch(function(e){for(var t=!1,n=0,i=a.length;n<i;n++){var s=a[n](e);(t||(t=!l(s,u[n])))&&(c[n]=s,u[n]=s&&mn(s))}return t&&(o=r(e,void 0,void 0,c)),o},t,n,i)}function f(e,t,n,r){var i,o;return i=e.$watch(function(e){return r(e)},function(e,n,r){o=e,S(t)&&t.apply(this,arguments),m(e)&&r.$$postDigest(function(){m(o)&&i()})},n)}function d(e,t,n,i){function o(e){var t=!0;return r(e,function(e){m(e)||(t=!1)}),t}var a,s;return a=e.$watch(function(e){return i(e)},function(e,n,r){s=e,S(t)&&t.call(this,e,n,r),o(e)&&r.$$postDigest(function(){o(s)&&a()})},n)}function h(e,t,n,r){var i;return i=e.$watch(function(e){return i(),r(e)},t,n)}function g(e,t){if(!t)return e;var n=e.$$watchDelegate,r=!1,i=n!==d&&n!==f,o=i?function(n,i,o,a){var s=r&&a?a[0]:e(n,i,o,a);return t(s,n,i)}:function(n,r,i,o){var a=e(n,r,i,o),s=t(a,n,r);return m(a)?s:a};return e.$$watchDelegate&&e.$$watchDelegate!==c?o.$$watchDelegate=e.$$watchDelegate:t.$stateful||(o.$$watchDelegate=c,r=!e.inputs,o.inputs=e.inputs?e.inputs:[e]),o}var v=Qr().noUnsafeEval,$={csp:v,expensiveChecks:!1,literals:U(o),isIdentifierStart:S(e)&&e,isIdentifierContinue:S(t)&&t},b={csp:v,expensiveChecks:!0,literals:U(o),isIdentifierStart:S(e)&&e,isIdentifierContinue:S(t)&&t},y=!1;return s.$$runningExpensiveChecks=function(){return y},s}]}function yn(){this.$get=["$rootScope","$exceptionHandler",function(e,t){return xn(function(t){e.$evalAsync(t)},t)}]}function wn(){this.$get=["$browser","$exceptionHandler",function(e,t){return xn(function(t){e.defer(t)},t)}]}function xn(e,n){function i(){this.$$state={status:0}}function o(e,t){return function(n){t.call(e,n)}}function a(e){var t,r,i;i=e.pending,e.processScheduled=!1,e.pending=void 0;for(var o=0,a=i.length;o<a;++o){r=i[o][0],t=i[o][e.status];try{S(t)?r.resolve(t(e.value)):1===e.status?r.resolve(e.value):r.reject(e.value)}catch(s){r.reject(s),n(s)}}}function s(t){!t.processScheduled&&t.pending&&(t.processScheduled=!0,e(function(){a(t)}))}function u(){this.promise=new i}function c(e){var t=new u,n=0,i=Kr(e)?[]:{};return r(e,function(e,r){n++,m(e).then(function(e){i.hasOwnProperty(r)||(i[r]=e,--n||t.resolve(i))},function(e){i.hasOwnProperty(r)||t.reject(e)})}),0===n&&t.resolve(i),t.promise}function f(e){var t=p();return r(e,function(e){m(e).then(t.resolve,t.reject)}),t.promise}var d=t("$q",TypeError),p=function(){var e=new u;return e.resolve=o(e,e.resolve),e.reject=o(e,e.reject),e.notify=o(e,e.notify),e};l(i.prototype,{then:function(e,t,n){if($(e)&&$(t)&&$(n))return this;var r=new u;return this.$$state.pending=this.$$state.pending||[],this.$$state.pending.push([r,e,t,n]),this.$$state.status>0&&s(this.$$state),r.promise},"catch":function(e){return this.then(null,e)},"finally":function(e,t){return this.then(function(t){return v(t,!0,e)},function(t){return v(t,!1,e)},t)}}),l(u.prototype,{resolve:function(e){this.promise.$$state.status||(e===this.promise?this.$$reject(d("qcycle","Expected promise to be resolved with value other than itself '{0}'",e)):this.$$resolve(e))},$$resolve:function(e){function t(e){u||(u=!0,a.$$resolve(e))}function r(e){u||(u=!0,a.$$reject(e))}var i,a=this,u=!1;try{(b(e)||S(e))&&(i=e&&e.then),S(i)?(this.promise.$$state.status=-1,i.call(e,t,r,o(this,this.notify))):(this.promise.$$state.value=e,this.promise.$$state.status=1,s(this.promise.$$state))}catch(l){r(l),n(l)}},reject:function(e){this.promise.$$state.status||this.$$reject(e)},$$reject:function(e){this.promise.$$state.value=e,this.promise.$$state.status=2,s(this.promise.$$state)},notify:function(t){var r=this.promise.$$state.pending;this.promise.$$state.status<=0&&r&&r.length&&e(function(){for(var e,i,o=0,a=r.length;o<a;o++){i=r[o][0],e=r[o][3];try{i.notify(S(e)?e(t):t)}catch(s){n(s)}}})}});var h=function(e){var t=new u;return t.reject(e),t.promise},g=function(e,t){var n=new u;return t?n.resolve(e):n.reject(e),n.promise},v=function(e,t,n){var r=null;try{S(n)&&(r=n())}catch(i){return g(i,!1)}return P(r)?r.then(function(){return g(e,t)},function(e){return g(e,!1)}):g(e,t)},m=function(e,t,n,r){var i=new u;return i.resolve(e),i.promise.then(t,n,r)},y=m,w=function(e){function t(e){r.resolve(e)}function n(e){r.reject(e)}if(!S(e))throw d("norslvr","Expected resolverFn, got '{0}'",e);var r=new u;return e(t,n),r.promise};return w.prototype=i.prototype,w.defer=p,w.reject=h,w.when=m,w.resolve=y,w.all=c,w.race=f,w}function _n(){this.$get=["$window","$timeout",function(e,t){var n=e.requestAnimationFrame||e.webkitRequestAnimationFrame,r=e.cancelAnimationFrame||e.webkitCancelAnimationFrame||e.webkitCancelRequestAnimationFrame,i=!!n,o=i?function(e){var t=n(e);return function(){r(t)}}:function(e){var n=t(e,16.66,!1);return function(){t.cancel(n)}};return o.supported=i,o}]}function Sn(){function e(e){function t(){this.$$watchers=this.$$nextSibling=this.$$childHead=this.$$childTail=null,this.$$listeners={},this.$$listenerCount={},this.$$watchersCount=0,this.$id=a(),this.$$ChildScope=null}return t.prototype=e,t}var i=10,o=t("$rootScope"),s=null,u=null;this.digestTtl=function(e){return arguments.length&&(i=e),i},this.$get=["$exceptionHandler","$parse","$browser",function(t,l,c){function f(e){e.currentScope.$$destroyed=!0}function d(e){9===Ir&&(e.$$childHead&&d(e.$$childHead),e.$$nextSibling&&d(e.$$nextSibling)),e.$parent=e.$$nextSibling=e.$$prevSibling=e.$$childHead=e.$$childTail=e.$root=e.$$watchers=null}function h(){this.$id=a(),this.$$phase=this.$parent=this.$$watchers=this.$$nextSibling=this.$$prevSibling=this.$$childHead=this.$$childTail=null,this.$root=this,this.$$destroyed=!1,this.$$listeners={},this.$$listenerCount={},this.$$watchersCount=0,this.$$isolateBindings=null}function g(e){if(k.$$phase)throw o("inprog","{0} already in progress",k.$$phase);k.$$phase=e}function v(){k.$$phase=null}function m(e,t){do e.$$watchersCount+=t;while(e=e.$parent)}function y(e,t,n){do e.$$listenerCount[n]-=t,0===e.$$listenerCount[n]&&delete e.$$listenerCount[n];while(e=e.$parent)}function w(){}function x(){for(;A.length;)try{A.shift()()}catch(e){t(e)}u=null}function _(){null===u&&(u=c.defer(function(){k.$apply(x)}))}h.prototype={constructor:h,$new:function(t,n){var r;return n=n||this,t?(r=new h,r.$root=this.$root):(this.$$ChildScope||(this.$$ChildScope=e(this)),r=new this.$$ChildScope),r.$parent=n,r.$$prevSibling=n.$$childTail,n.$$childHead?(n.$$childTail.$$nextSibling=r,n.$$childTail=r):n.$$childHead=n.$$childTail=r,(t||n!=this)&&r.$on("$destroy",f),r},$watch:function(e,t,n,r){var i=l(e);if(i.$$watchDelegate)return i.$$watchDelegate(this,t,n,i,e);var o=this,a=o.$$watchers,u={fn:t,last:w,get:i,exp:r||e,eq:!!n};return s=null,S(t)||(u.fn=p),a||(a=o.$$watchers=[]),a.unshift(u),m(this,1),function(){R(a,u)>=0&&m(o,-1),s=null}},$watchGroup:function(e,t){function n(){u=!1,l?(l=!1,t(o,o,s)):t(o,i,s)}var i=new Array(e.length),o=new Array(e.length),a=[],s=this,u=!1,l=!0;if(!e.length){var c=!0;return s.$evalAsync(function(){c&&t(o,o,s)}),function(){c=!1}}return 1===e.length?this.$watch(e[0],function(e,n,r){o[0]=e,i[0]=n,t(o,e===n?o:i,r)}):(r(e,function(e,t){var r=s.$watch(e,function(e,r){o[t]=e,i[t]=r,u||(u=!0,s.$evalAsync(n))});a.push(r)}),function(){for(;a.length;)a.shift()()})},$watchCollection:function(e,t){function r(e){o=e;var t,r,i,s,u;if(!$(o)){if(b(o))if(n(o)){a!==p&&(a=p,v=a.length=0,f++),t=o.length,v!==t&&(f++,a.length=v=t);for(var l=0;l<t;l++)u=a[l],s=o[l],i=u!==u&&s!==s,i||u===s||(f++,a[l]=s)}else{a!==h&&(a=h={},v=0,f++),t=0;for(r in o)Pr.call(o,r)&&(t++,s=o[r],u=a[r],r in a?(i=u!==u&&s!==s,i||u===s||(f++,a[r]=s)):(v++,a[r]=s,f++));if(v>t){f++;for(r in a)Pr.call(o,r)||(v--,delete a[r])}}else a!==o&&(a=o,f++);return f}}function i(){if(g?(g=!1,t(o,o,u)):t(o,s,u),c)if(b(o))if(n(o)){s=new Array(o.length);for(var e=0;e<o.length;e++)s[e]=o[e]}else{s={};for(var r in o)Pr.call(o,r)&&(s[r]=o[r])}else s=o}r.$stateful=!0;var o,a,s,u=this,c=t.length>1,f=0,d=l(e,r),p=[],h={},g=!0,v=0;return this.$watch(d,i)},$digest:function(){var e,n,r,a,l,f,d,p,h,$,m,b,y=i,_=this,A=[];g("$digest"),c.$$checkUrlChange(),this===k&&null!==u&&(c.defer.cancel(u),x()),s=null;do{p=!1,$=_;for(var M=0;M<E.length;M++){try{b=E[M],b.scope.$eval(b.expression,b.locals)}catch(j){t(j)}s=null}E.length=0;e:do{if(f=$.$$watchers)for(d=f.length;d--;)try{if(e=f[d])if(l=e.get,(n=l($))===(r=e.last)||(e.eq?V(n,r):"number"==typeof n&&"number"==typeof r&&isNaN(n)&&isNaN(r))){if(e===s){p=!1;break e}}else p=!0,s=e,e.last=e.eq?U(n,null):n,a=e.fn,a(n,r===w?n:r,$),y<5&&(m=4-y,A[m]||(A[m]=[]),A[m].push({msg:S(e.exp)?"fn: "+(e.exp.name||e.exp.toString()):e.exp,newVal:n,oldVal:r}))}catch(j){t(j)}if(!(h=$.$$watchersCount&&$.$$childHead||$!==_&&$.$$nextSibling))for(;$!==_&&!(h=$.$$nextSibling);)$=$.$parent}while($=h);if((p||E.length)&&!y--)throw v(),o("infdig","{0} $digest() iterations reached. Aborting!\nWatchers fired in the last 5 iterations: {1}",i,A)}while(p||E.length);for(v();O<C.length;)try{C[O++]()}catch(j){t(j)}C.length=O=0},$destroy:function(){if(!this.$$destroyed){var e=this.$parent;this.$broadcast("$destroy"),this.$$destroyed=!0,this===k&&c.$$applicationDestroyed(),m(this,-this.$$watchersCount);for(var t in this.$$listenerCount)y(this,this.$$listenerCount[t],t);e&&e.$$childHead==this&&(e.$$childHead=this.$$nextSibling),e&&e.$$childTail==this&&(e.$$childTail=this.$$prevSibling),this.$$prevSibling&&(this.$$prevSibling.$$nextSibling=this.$$nextSibling),this.$$nextSibling&&(this.$$nextSibling.$$prevSibling=this.$$prevSibling),this.$destroy=this.$digest=this.$apply=this.$evalAsync=this.$applyAsync=p,this.$on=this.$watch=this.$watchGroup=function(){return p},this.$$listeners={},this.$$nextSibling=null,d(this)}},$eval:function(e,t){return l(e)(this,t)},$evalAsync:function(e,t){k.$$phase||E.length||c.defer(function(){E.length&&k.$digest()}),E.push({scope:this,expression:l(e),locals:t})},$$postDigest:function(e){C.push(e)},$apply:function(e){try{g("$apply");try{return this.$eval(e)}finally{v()}}catch(n){t(n)}finally{try{k.$digest()}catch(n){throw t(n),n}}},$applyAsync:function(e){function t(){n.$eval(e)}var n=this;e&&A.push(t),e=l(e),_()},$on:function(e,t){var n=this.$$listeners[e];n||(this.$$listeners[e]=n=[]),n.push(t);var r=this;do r.$$listenerCount[e]||(r.$$listenerCount[e]=0),r.$$listenerCount[e]++;while(r=r.$parent);var i=this;return function(){var r=n.indexOf(t);r!==-1&&(n[r]=null,y(i,1,e))}},$emit:function(e,n){var r,i,o,a=[],s=this,u=!1,l={name:e,targetScope:s,stopPropagation:function(){u=!0},preventDefault:function(){l.defaultPrevented=!0},defaultPrevented:!1},c=z([l],arguments,1);do{for(r=s.$$listeners[e]||a,l.currentScope=s,i=0,o=r.length;i<o;i++)if(r[i])try{r[i].apply(null,c)}catch(f){t(f)}else r.splice(i,1),i--,o--;if(u)return l.currentScope=null,l;s=s.$parent}while(s);return l.currentScope=null,l},$broadcast:function(e,n){var r=this,i=r,o=r,a={name:e,targetScope:r,preventDefault:function(){a.defaultPrevented=!0},defaultPrevented:!1};if(!r.$$listenerCount[e])return a;for(var s,u,l,c=z([a],arguments,1);i=o;){for(a.currentScope=i,s=i.$$listeners[e]||[],u=0,l=s.length;u<l;u++)if(s[u])try{s[u].apply(null,c)}catch(f){t(f)}else s.splice(u,1),u--,l--;if(!(o=i.$$listenerCount[e]&&i.$$childHead||i!==r&&i.$$nextSibling))for(;i!==r&&!(o=i.$$nextSibling);)i=i.$parent}return a.currentScope=null,a}};var k=new h,E=k.$$asyncQueue=[],C=k.$$postDigestQueue=[],A=k.$$applyAsyncQueue=[],O=0;return k}]}function kn(){var e=/^\s*(https?|ftp|mailto|tel|file):/,t=/^\s*((https?|ftp|file|blob):|data:image\/)/;this.aHrefSanitizationWhitelist=function(t){return m(t)?(e=t,this):e},this.imgSrcSanitizationWhitelist=function(e){return m(e)?(t=e,this):t},this.$get=function(){return function(n,r){var i,o=r?t:e;return i=Dn(n).href,""===i||i.match(o)?n:"unsafe:"+i}}}function En(e){if("self"===e)return e;if(w(e)){if(e.indexOf("***")>-1)throw xo("iwcard","Illegal sequence *** in string matcher. String: {0}",e);return e=Jr(e).replace("\\*\\*",".*").replace("\\*","[^:/.?&;]*"),new RegExp("^"+e+"$")}if(k(e))return new RegExp("^"+e.source+"$");throw xo("imatcher",'Matchers may only be "self", string patterns or RegExp objects')}function Cn(e){var t=[];return m(e)&&r(e,function(e){t.push(En(e))}),t}function An(){this.SCE_CONTEXTS=_o;var e=["self"],t=[];this.resourceUrlWhitelist=function(t){return arguments.length&&(e=Cn(t)),e},this.resourceUrlBlacklist=function(e){return arguments.length&&(t=Cn(e)),t},this.$get=["$injector",function(n){function r(e,t){return"self"===e?Fn(t):!!e.exec(t.href)}function i(n){var i,o,a=Dn(n.toString()),s=!1;for(i=0,o=e.length;i<o;i++)if(r(e[i],a)){s=!0;break}if(s)for(i=0,o=t.length;i<o;i++)if(r(t[i],a)){s=!1;break}return s}function o(e){var t=function(e){this.$$unwrapTrustedValue=function(){return e}};return e&&(t.prototype=new e),t.prototype.valueOf=function(){return this.$$unwrapTrustedValue()},t.prototype.toString=function(){
|
5 |
+
return this.$$unwrapTrustedValue().toString()},t}function a(e,t){var n=f.hasOwnProperty(e)?f[e]:null;if(!n)throw xo("icontext","Attempted to trust a value in invalid context. Context: {0}; Value: {1}",e,t);if(null===t||$(t)||""===t)return t;if("string"!=typeof t)throw xo("itype","Attempted to trust a non-string value in a content requiring a string: Context: {0}",e);return new n(t)}function s(e){return e instanceof c?e.$$unwrapTrustedValue():e}function u(e,t){if(null===t||$(t)||""===t)return t;var n=f.hasOwnProperty(e)?f[e]:null;if(n&&t instanceof n)return t.$$unwrapTrustedValue();if(e===_o.RESOURCE_URL){if(i(t))return t;throw xo("insecurl","Blocked loading resource from url not allowed by $sceDelegate policy. URL: {0}",t.toString())}if(e===_o.HTML)return l(t);throw xo("unsafe","Attempting to use an unsafe value in a safe context.")}var l=function(e){throw xo("unsafe","Attempting to use an unsafe value in a safe context.")};n.has("$sanitize")&&(l=n.get("$sanitize"));var c=o(),f={};return f[_o.HTML]=o(c),f[_o.CSS]=o(c),f[_o.URL]=o(c),f[_o.JS]=o(c),f[_o.RESOURCE_URL]=o(f[_o.URL]),{trustAs:a,getTrusted:u,valueOf:s}}]}function On(){var e=!0;this.enabled=function(t){return arguments.length&&(e=!!t),e},this.$get=["$parse","$sceDelegate",function(t,n){if(e&&Ir<8)throw xo("iequirks","Strict Contextual Escaping does not support Internet Explorer version < 11 in quirks mode. You can fix this by adding the text <!doctype html> to the top of your HTML document. See http://docs.angularjs.org/api/ng.$sce for more information.");var i=ve(_o);i.isEnabled=function(){return e},i.trustAs=n.trustAs,i.getTrusted=n.getTrusted,i.valueOf=n.valueOf,e||(i.trustAs=i.getTrusted=function(e,t){return t},i.valueOf=h),i.parseAs=function(e,n){var r=t(n);return r.literal&&r.constant?r:t(n,function(t){return i.getTrusted(e,t)})};var o=i.parseAs,a=i.getTrusted,s=i.trustAs;return r(_o,function(e,t){var n=Tr(t);i[we("parse_as_"+n)]=function(t){return o(e,t)},i[we("get_trusted_"+n)]=function(t){return a(e,t)},i[we("trust_as_"+n)]=function(t){return s(e,t)}}),i}]}function Mn(){this.$get=["$window","$document",function(e,t){var n,r,i={},o=e.chrome&&e.chrome.app&&e.chrome.app.runtime,a=!o&&e.history&&e.history.pushState,s=f((/android (\d+)/.exec(Tr((e.navigator||{}).userAgent))||[])[1]),u=/Boxee/i.test((e.navigator||{}).userAgent),l=t[0]||{},c=/^(Moz|webkit|ms)(?=[A-Z])/,d=l.body&&l.body.style,p=!1,h=!1;if(d){for(var g in d)if(r=c.exec(g)){n=r[0],n=n[0].toUpperCase()+n.substr(1);break}n||(n="WebkitOpacity"in d&&"webkit"),p=!!("transition"in d||n+"Transition"in d),h=!!("animation"in d||n+"Animation"in d),!s||p&&h||(p=w(d.webkitTransition),h=w(d.webkitAnimation))}return{history:!(!a||s<4||u),hasEvent:function(e){if("input"===e&&Ir<=11)return!1;if($(i[e])){var t=l.createElement("div");i[e]="on"+e in t}return i[e]},csp:Qr(),vendorPrefix:n,transitions:p,animations:h,android:s}}]}function jn(){var e;this.httpOptions=function(t){return t?(e=t,this):e},this.$get=["$templateCache","$http","$q","$sce",function(t,n,r,i){function o(a,s){function u(e){if(!s)throw So("tpload","Failed to load template: {0} (HTTP status: {1} {2})",a,e.status,e.statusText);return r.reject(e)}o.totalPendingRequests++,w(a)&&!$(t.get(a))||(a=i.getTrustedResourceUrl(a));var c=n.defaults&&n.defaults.transformResponse;return Kr(c)?c=c.filter(function(e){return e!==Et}):c===Et&&(c=null),n.get(a,l({cache:t,transformResponse:c},e))["finally"](function(){o.totalPendingRequests--}).then(function(e){return t.put(a,e.data),e.data},u)}return o.totalPendingRequests=0,o}]}function Pn(){this.$get=["$rootScope","$browser","$location",function(e,t,n){var i={};return i.findBindings=function(e,t,n){var i=e.getElementsByClassName("ng-binding"),o=[];return r(i,function(e){var i=Gr.element(e).data("$binding");i&&r(i,function(r){if(n){var i=new RegExp("(^|\\s)"+Jr(t)+"(\\s|\\||$)");i.test(r)&&o.push(e)}else r.indexOf(t)!=-1&&o.push(e)})}),o},i.findModels=function(e,t,n){for(var r=["ng-","data-ng-","ng\\:"],i=0;i<r.length;++i){var o=n?"=":"*=",a="["+r[i]+"model"+o+'"'+t+'"]',s=e.querySelectorAll(a);if(s.length)return s}},i.getLocation=function(){return n.url()},i.setLocation=function(t){t!==n.url()&&(n.url(t),e.$digest())},i.whenStable=function(e){t.notifyWhenNoOutstandingRequests(e)},i}]}function Tn(){this.$get=["$rootScope","$browser","$q","$$q","$exceptionHandler",function(e,t,n,r,i){function o(o,s,u){S(o)||(u=s,s=o,o=p);var l,c=L(arguments,3),f=m(u)&&!u,d=(f?r:n).defer(),h=d.promise;return l=t.defer(function(){try{d.resolve(o.apply(null,c))}catch(t){d.reject(t),i(t)}finally{delete a[h.$$timeoutId]}f||e.$apply()},s),h.$$timeoutId=l,a[l]=d,h}var a={};return o.cancel=function(e){return!!(e&&e.$$timeoutId in a)&&(a[e.$$timeoutId].reject("canceled"),delete a[e.$$timeoutId],t.defer.cancel(e.$$timeoutId))},o}]}function Dn(e){var t=e;return Ir&&(ko.setAttribute("href",t),t=ko.href),ko.setAttribute("href",t),{href:ko.href,protocol:ko.protocol?ko.protocol.replace(/:$/,""):"",host:ko.host,search:ko.search?ko.search.replace(/^\?/,""):"",hash:ko.hash?ko.hash.replace(/^#/,""):"",hostname:ko.hostname,port:ko.port,pathname:"/"===ko.pathname.charAt(0)?ko.pathname:"/"+ko.pathname}}function Fn(e){var t=w(e)?Dn(e):e;return t.protocol===Eo.protocol&&t.host===Eo.host}function Nn(){this.$get=g(e)}function In(e){function t(e){try{return decodeURIComponent(e)}catch(t){return e}}var n=e[0]||{},r={},i="";return function(){var e,o,a,s,u,l=n.cookie||"";if(l!==i)for(i=l,e=i.split("; "),r={},a=0;a<e.length;a++)o=e[a],s=o.indexOf("="),s>0&&(u=t(o.substring(0,s)),$(r[u])&&(r[u]=t(o.substring(s+1))));return r}}function Rn(){this.$get=In}function Un(e){function t(i,o){if(b(i)){var a={};return r(i,function(e,n){a[n]=t(n,e)}),a}return e.factory(i+n,o)}var n="Filter";this.register=t,this.$get=["$injector",function(e){return function(t){return e.get(t+n)}}],t("currency",Hn),t("date",or),t("filter",Vn),t("json",ar),t("limitTo",sr),t("lowercase",To),t("number",Bn),t("orderBy",lr),t("uppercase",Do)}function Vn(){return function(e,r,i,o){if(!n(e)){if(null==e)return e;throw t("filter")("notarray","Expected array but received: {0}",e)}o=o||"$";var a,s,u=qn(r);switch(u){case"function":a=r;break;case"boolean":case"null":case"number":case"string":s=!0;case"object":a=zn(r,i,o,s);break;default:return e}return Array.prototype.filter.call(e,a)}}function zn(e,t,n,r){var i,o=b(e)&&n in e;return t===!0?t=V:S(t)||(t=function(e,t){return!$(e)&&(null===e||null===t?e===t:!(b(t)||b(e)&&!v(e))&&(e=Tr(""+e),t=Tr(""+t),e.indexOf(t)!==-1))}),i=function(i){return o&&!b(i)?Ln(i,e[n],t,n,!1):Ln(i,e,t,n,r)}}function Ln(e,t,n,r,i,o){var a=qn(e),s=qn(t);if("string"===s&&"!"===t.charAt(0))return!Ln(e,t.substring(1),n,r,i);if(Kr(e))return e.some(function(e){return Ln(e,t,n,r,i)});switch(a){case"object":var u;if(i){for(u in e)if("$"!==u.charAt(0)&&Ln(e[u],t,n,r,!0))return!0;return!o&&Ln(e,t,n,r,!1)}if("object"===s){for(u in t){var l=t[u];if(!S(l)&&!$(l)){var c=u===r,f=c?e:e[u];if(!Ln(f,l,n,r,c,c))return!1}}return!0}return n(e,t);case"function":return!1;default:return n(e,t)}}function qn(e){return null===e?"null":typeof e}function Hn(e){var t=e.NUMBER_FORMATS;return function(e,n,r){return $(n)&&(n=t.CURRENCY_SYM),$(r)&&(r=t.PATTERNS[1].maxFrac),null==e?e:Xn(e,t.PATTERNS[1],t.GROUP_SEP,t.DECIMAL_SEP,r).replace(/\u00A4/g,n)}}function Bn(e){var t=e.NUMBER_FORMATS;return function(e,n){return null==e?e:Xn(e,t.PATTERNS[0],t.GROUP_SEP,t.DECIMAL_SEP,n)}}function Wn(e){var t,n,r,i,o,a=0;for((n=e.indexOf(Ao))>-1&&(e=e.replace(Ao,"")),(r=e.search(/e/i))>0?(n<0&&(n=r),n+=+e.slice(r+1),e=e.substring(0,r)):n<0&&(n=e.length),r=0;e.charAt(r)==Oo;r++);if(r==(o=e.length))t=[0],n=1;else{for(o--;e.charAt(o)==Oo;)o--;for(n-=r,t=[],i=0;r<=o;r++,i++)t[i]=+e.charAt(r)}return n>Co&&(t=t.splice(0,Co-1),a=n-1,n=1),{d:t,e:a,i:n}}function Gn(e,t,n,r){var i=e.d,o=i.length-e.i;t=$(t)?Math.min(Math.max(n,o),r):+t;var a=t+e.i,s=i[a];if(a>0){i.splice(Math.max(e.i,a));for(var u=a;u<i.length;u++)i[u]=0}else{o=Math.max(0,o),e.i=1,i.length=Math.max(1,a=t+1),i[0]=0;for(var l=1;l<a;l++)i[l]=0}if(s>=5)if(a-1<0){for(var c=0;c>a;c--)i.unshift(0),e.i++;i.unshift(1),e.i++}else i[a-1]++;for(;o<Math.max(0,t);o++)i.push(0);var f=i.reduceRight(function(e,t,n,r){return t+=e,r[n]=t%10,Math.floor(t/10)},0);f&&(i.unshift(f),e.i++)}function Xn(e,t,n,r,i){if(!w(e)&&!x(e)||isNaN(e))return"";var o,a=!isFinite(e),s=!1,u=Math.abs(e)+"",l="";if(a)l="∞";else{o=Wn(u),Gn(o,i,t.minFrac,t.maxFrac);var c=o.d,f=o.i,d=o.e,p=[];for(s=c.reduce(function(e,t){return e&&!t},!0);f<0;)c.unshift(0),f++;f>0?p=c.splice(f,c.length):(p=c,c=[0]);var h=[];for(c.length>=t.lgSize&&h.unshift(c.splice(-t.lgSize,c.length).join(""));c.length>t.gSize;)h.unshift(c.splice(-t.gSize,c.length).join(""));c.length&&h.unshift(c.join("")),l=h.join(n),p.length&&(l+=r+p.join("")),d&&(l+="e+"+d)}return e<0&&!s?t.negPre+l+t.negSuf:t.posPre+l+t.posSuf}function Kn(e,t,n,r){var i="";for((e<0||r&&e<=0)&&(r?e=-e+1:(e=-e,i="-")),e=""+e;e.length<t;)e=Oo+e;return n&&(e=e.substr(e.length-t)),i+e}function Yn(e,t,n,r,i){return n=n||0,function(o){var a=o["get"+e]();return(n>0||a>-n)&&(a+=n),0===a&&n==-12&&(a=12),Kn(a,t,r,i)}}function Zn(e,t,n){return function(r,i){var o=r["get"+e](),a=(n?"STANDALONE":"")+(t?"SHORT":""),s=Dr(a+e);return i[s][o]}}function Jn(e,t,n){var r=-1*n,i=r>=0?"+":"";return i+=Kn(Math[r>0?"floor":"ceil"](r/60),2)+Kn(Math.abs(r%60),2)}function Qn(e){var t=new Date(e,0,1).getDay();return new Date(e,0,(t<=4?5:12)-t)}function er(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate()+(4-e.getDay()))}function tr(e){return function(t){var n=Qn(t.getFullYear()),r=er(t),i=+r-+n,o=1+Math.round(i/6048e5);return Kn(o,e)}}function nr(e,t){return e.getHours()<12?t.AMPMS[0]:t.AMPMS[1]}function rr(e,t){return e.getFullYear()<=0?t.ERAS[0]:t.ERAS[1]}function ir(e,t){return e.getFullYear()<=0?t.ERANAMES[0]:t.ERANAMES[1]}function or(e){function t(e){var t;if(t=e.match(n)){var r=new Date(0),i=0,o=0,a=t[8]?r.setUTCFullYear:r.setFullYear,s=t[8]?r.setUTCHours:r.setHours;t[9]&&(i=f(t[9]+t[10]),o=f(t[9]+t[11])),a.call(r,f(t[1]),f(t[2])-1,f(t[3]));var u=f(t[4]||0)-i,l=f(t[5]||0)-o,c=f(t[6]||0),d=Math.round(1e3*parseFloat("0."+(t[7]||0)));return s.call(r,u,l,c,d),r}return e}var n=/^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/;return function(n,i,o){var a,s,u="",l=[];if(i=i||"mediumDate",i=e.DATETIME_FORMATS[i]||i,w(n)&&(n=Po.test(n)?f(n):t(n)),x(n)&&(n=new Date(n)),!_(n)||!isFinite(n.getTime()))return n;for(;i;)s=jo.exec(i),s?(l=z(l,s,1),i=l.pop()):(l.push(i),i=null);var c=n.getTimezoneOffset();return o&&(c=G(o,c),n=K(n,o,!0)),r(l,function(t){a=Mo[t],u+=a?a(n,e.DATETIME_FORMATS,c):"''"===t?"'":t.replace(/(^'|'$)/g,"").replace(/''/g,"'")}),u}}function ar(){return function(e,t){return $(t)&&(t=2),B(e,t)}}function sr(){return function(e,t,r){return t=Math.abs(Number(t))===1/0?Number(t):f(t),isNaN(t)?e:(x(e)&&(e=e.toString()),n(e)?(r=!r||isNaN(r)?0:f(r),r=r<0?Math.max(0,e.length+r):r,t>=0?ur(e,r,r+t):0===r?ur(e,t,e.length):ur(e,Math.max(0,r+t),r)):e)}}function ur(e,t,n){return w(e)?e.slice(t,n):zr.call(e,t,n)}function lr(e){function r(t){return t.map(function(t){var n=1,r=h;if(S(t))r=t;else if(w(t)&&("+"!=t.charAt(0)&&"-"!=t.charAt(0)||(n="-"==t.charAt(0)?-1:1,t=t.substring(1)),""!==t&&(r=e(t),r.constant))){var i=r();r=function(e){return e[i]}}return{get:r,descending:n}})}function i(e){switch(typeof e){case"number":case"boolean":case"string":return!0;default:return!1}}function o(e){return S(e.valueOf)&&(e=e.valueOf(),i(e))?e:v(e)&&(e=e.toString(),i(e))?e:e}function a(e,t){var n=typeof e;return null===e?(n="string",e="null"):"object"===n&&(e=o(e)),{value:e,type:n,index:t}}function s(e,t){var n=0,r=e.type,i=t.type;if(r===i){var o=e.value,a=t.value;"string"===r?(o=o.toLowerCase(),a=a.toLowerCase()):"object"===r&&(b(o)&&(o=e.index),b(a)&&(a=t.index)),o!==a&&(n=o<a?-1:1)}else n=r<i?-1:1;return n}return function(e,i,o,u){function l(e,t){return{value:e,tieBreaker:{value:t,type:"number",index:t},predicateValues:f.map(function(n){return a(n.get(e),t)})}}function c(e,t){for(var n=0,r=f.length;n<r;n++){var i=p(e.predicateValues[n],t.predicateValues[n]);if(i)return i*f[n].descending*d}return p(e.tieBreaker,t.tieBreaker)*d}if(null==e)return e;if(!n(e))throw t("orderBy")("notarray","Expected array but received: {0}",e);Kr(i)||(i=[i]),0===i.length&&(i=["+"]);var f=r(i),d=o?-1:1,p=S(u)?u:s,h=Array.prototype.map.call(e,l);return h.sort(c),e=h.map(function(e){return e.value})}}function cr(e){return S(e)&&(e={link:e}),e.restrict=e.restrict||"AC",g(e)}function fr(e,t){e.$name=t}function dr(e,t,n,i,o){var a=this,s=[];a.$error={},a.$$success={},a.$pending=void 0,a.$name=o(t.name||t.ngForm||"")(n),a.$dirty=!1,a.$pristine=!0,a.$valid=!0,a.$invalid=!1,a.$submitted=!1,a.$$parentForm=Io,a.$rollbackViewValue=function(){r(s,function(e){e.$rollbackViewValue()})},a.$commitViewValue=function(){r(s,function(e){e.$commitViewValue()})},a.$addControl=function(e){fe(e.$name,"input"),s.push(e),e.$name&&(a[e.$name]=e),e.$$parentForm=a},a.$$renameControl=function(e,t){var n=e.$name;a[n]===e&&delete a[n],a[t]=e,e.$name=t},a.$removeControl=function(e){e.$name&&a[e.$name]===e&&delete a[e.$name],r(a.$pending,function(t,n){a.$setValidity(n,null,e)}),r(a.$error,function(t,n){a.$setValidity(n,null,e)}),r(a.$$success,function(t,n){a.$setValidity(n,null,e)}),R(s,e),e.$$parentForm=Io},Cr({ctrl:this,$element:e,set:function(e,t,n){var r=e[t];if(r){var i=r.indexOf(n);i===-1&&r.push(n)}else e[t]=[n]},unset:function(e,t,n){var r=e[t];r&&(R(r,n),0===r.length&&delete e[t])},$animate:i}),a.$setDirty=function(){i.removeClass(e,wa),i.addClass(e,xa),a.$dirty=!0,a.$pristine=!1,a.$$parentForm.$setDirty()},a.$setPristine=function(){i.setClass(e,wa,xa+" "+Ro),a.$dirty=!1,a.$pristine=!0,a.$submitted=!1,r(s,function(e){e.$setPristine()})},a.$setUntouched=function(){r(s,function(e){e.$setUntouched()})},a.$setSubmitted=function(){i.addClass(e,Ro),a.$submitted=!0,a.$$parentForm.$setSubmitted()}}function pr(e){e.$formatters.push(function(t){return e.$isEmpty(t)?t:t.toString()})}function hr(e,t,n,r,i,o){gr(e,t,n,r,i,o),pr(r)}function gr(e,t,n,r,i,o){var a=Tr(t[0].type);if(!i.android){var s=!1;t.on("compositionstart",function(){s=!0}),t.on("compositionend",function(){s=!1,l()})}var u,l=function(e){if(u&&(o.defer.cancel(u),u=null),!s){var i=t.val(),l=e&&e.type;"password"===a||n.ngTrim&&"false"===n.ngTrim||(i=Zr(i)),(r.$viewValue!==i||""===i&&r.$$hasNativeValidators)&&r.$setViewValue(i,l)}};if(i.hasEvent("input"))t.on("input",l);else{var c=function(e,t,n){u||(u=o.defer(function(){u=null,t&&t.value===n||l(e)}))};t.on("keydown",function(e){var t=e.keyCode;91===t||15<t&&t<19||37<=t&&t<=40||c(e,this,this.value)}),i.hasEvent("paste")&&t.on("paste cut",c)}t.on("change",l),Jo[a]&&r.$$hasNativeValidators&&a===n.type&&t.on(Zo,function(e){if(!u){var t=this[jr],n=t.badInput,r=t.typeMismatch;u=o.defer(function(){u=null,t.badInput===n&&t.typeMismatch===r||l(e)})}}),r.$render=function(){var e=r.$isEmpty(r.$viewValue)?"":r.$viewValue;t.val()!==e&&t.val(e)}}function vr(e,t){if(_(e))return e;if(w(e)){Xo.lastIndex=0;var n=Xo.exec(e);if(n){var r=+n[1],i=+n[2],o=0,a=0,s=0,u=0,l=Qn(r),c=7*(i-1);return t&&(o=t.getHours(),a=t.getMinutes(),s=t.getSeconds(),u=t.getMilliseconds()),new Date(r,0,l.getDate()+c,o,a,s,u)}}return NaN}function $r(e,t){return function(n,i){var o,a;if(_(n))return n;if(w(n)){if('"'==n.charAt(0)&&'"'==n.charAt(n.length-1)&&(n=n.substring(1,n.length-1)),Lo.test(n))return new Date(n);if(e.lastIndex=0,o=e.exec(n))return o.shift(),a=i?{yyyy:i.getFullYear(),MM:i.getMonth()+1,dd:i.getDate(),HH:i.getHours(),mm:i.getMinutes(),ss:i.getSeconds(),sss:i.getMilliseconds()/1e3}:{yyyy:1970,MM:1,dd:1,HH:0,mm:0,ss:0,sss:0},r(o,function(e,n){n<t.length&&(a[t[n]]=+e)}),new Date(a.yyyy,a.MM-1,a.dd,a.HH,a.mm,a.ss||0,1e3*a.sss||0)}return NaN}}function mr(e,t,n,r){return function(i,o,a,s,u,l,c){function f(e){return e&&!(e.getTime&&e.getTime()!==e.getTime())}function d(e){return m(e)&&!_(e)?n(e)||void 0:e}br(i,o,a,s),gr(i,o,a,s,u,l);var p,h=s&&s.$options&&s.$options.timezone;if(s.$$parserName=e,s.$parsers.push(function(e){if(s.$isEmpty(e))return null;if(t.test(e)){var r=n(e,p);return h&&(r=K(r,h)),r}}),s.$formatters.push(function(e){if(e&&!_(e))throw Aa("datefmt","Expected `{0}` to be a date",e);return f(e)?(p=e,p&&h&&(p=K(p,h,!0)),c("date")(e,r,h)):(p=null,"")}),m(a.min)||a.ngMin){var g;s.$validators.min=function(e){return!f(e)||$(g)||n(e)>=g},a.$observe("min",function(e){g=d(e),s.$validate()})}if(m(a.max)||a.ngMax){var v;s.$validators.max=function(e){return!f(e)||$(v)||n(e)<=v},a.$observe("max",function(e){v=d(e),s.$validate()})}}}function br(e,t,n,r){var i=t[0],o=r.$$hasNativeValidators=b(i.validity);o&&r.$parsers.push(function(e){var n=t.prop(jr)||{};return n.badInput||n.typeMismatch?void 0:e})}function yr(e,t,n,r,i,o){if(br(e,t,n,r),gr(e,t,n,r,i,o),r.$$parserName="number",r.$parsers.push(function(e){return r.$isEmpty(e)?null:Bo.test(e)?parseFloat(e):void 0}),r.$formatters.push(function(e){if(!r.$isEmpty(e)){if(!x(e))throw Aa("numfmt","Expected `{0}` to be a number",e);e=e.toString()}return e}),m(n.min)||n.ngMin){var a;r.$validators.min=function(e){return r.$isEmpty(e)||$(a)||e>=a},n.$observe("min",function(e){m(e)&&!x(e)&&(e=parseFloat(e)),a=x(e)&&!isNaN(e)?e:void 0,r.$validate()})}if(m(n.max)||n.ngMax){var s;r.$validators.max=function(e){return r.$isEmpty(e)||$(s)||e<=s},n.$observe("max",function(e){m(e)&&!x(e)&&(e=parseFloat(e)),s=x(e)&&!isNaN(e)?e:void 0,r.$validate()})}}function wr(e,t,n,r,i,o){gr(e,t,n,r,i,o),pr(r),r.$$parserName="url",r.$validators.url=function(e,t){var n=e||t;return r.$isEmpty(n)||qo.test(n)}}function xr(e,t,n,r,i,o){gr(e,t,n,r,i,o),pr(r),r.$$parserName="email",r.$validators.email=function(e,t){var n=e||t;return r.$isEmpty(n)||Ho.test(n)}}function _r(e,t,n,r){$(n.name)&&t.attr("name",a());var i=function(e){t[0].checked&&r.$setViewValue(n.value,e&&e.type)};t.on("click",i),r.$render=function(){var e=n.value;t[0].checked=e==r.$viewValue},n.$observe("value",r.$render)}function Sr(e,t,n,r,i){var o;if(m(r)){if(o=e(r),!o.constant)throw Aa("constexpr","Expected constant expression for `{0}`, but saw `{1}`.",n,r);return o(t)}return i}function kr(e,t,n,r,i,o,a,s){var u=Sr(s,e,"ngTrueValue",n.ngTrueValue,!0),l=Sr(s,e,"ngFalseValue",n.ngFalseValue,!1),c=function(e){r.$setViewValue(t[0].checked,e&&e.type)};t.on("click",c),r.$render=function(){t[0].checked=r.$viewValue},r.$isEmpty=function(e){return e===!1},r.$formatters.push(function(e){return V(e,u)}),r.$parsers.push(function(e){return e?u:l})}function Er(e,t){return e="ngClass"+e,["$animate",function(n){function i(e,t){var n=[];e:for(var r=0;r<e.length;r++){for(var i=e[r],o=0;o<t.length;o++)if(i==t[o])continue e;n.push(i)}return n}function o(e){var t=[];return Kr(e)?(r(e,function(e){t=t.concat(o(e))}),t):w(e)?e.split(" "):b(e)?(r(e,function(e,n){e&&(t=t.concat(n.split(" ")))}),t):e}return{restrict:"AC",link:function(a,s,u){function l(e){var t=f(e,1);u.$addClass(t)}function c(e){var t=f(e,-1);u.$removeClass(t)}function f(e,t){var n=s.data("$classCounts")||he(),i=[];return r(e,function(e){(t>0||n[e])&&(n[e]=(n[e]||0)+t,n[e]===+(t>0)&&i.push(e))}),s.data("$classCounts",n),i.join(" ")}function d(e,t){var r=i(t,e),o=i(e,t);r=f(r,1),o=f(o,-1),r&&r.length&&n.addClass(s,r),o&&o.length&&n.removeClass(s,o)}function p(e){if(t===!0||(1&a.$index)===t){var n=o(e||[]);if(h){if(!V(e,h)){var r=o(h);d(r,n)}}else l(n)}h=Kr(e)?e.map(function(e){return ve(e)}):ve(e)}var h;a.$watch(u[e],p,!0),u.$observe("class",function(t){p(a.$eval(u[e]))}),"ngClass"!==e&&a.$watch("$index",function(n,r){var i=1&n;if(i!==(1&r)){var s=o(a.$eval(u[e]));i===t?l(s):c(s)}})}}}]}function Cr(e){function t(e,t,s){$(t)?n("$pending",e,s):r("$pending",e,s),j(t)?t?(c(a.$error,e,s),l(a.$$success,e,s)):(l(a.$error,e,s),c(a.$$success,e,s)):(c(a.$error,e,s),c(a.$$success,e,s)),a.$pending?(i(ka,!0),a.$valid=a.$invalid=void 0,o("",null)):(i(ka,!1),a.$valid=Ar(a.$error),a.$invalid=!a.$valid,o("",a.$valid));var u;u=a.$pending&&a.$pending[e]?void 0:!a.$error[e]&&(!!a.$$success[e]||null),o(e,u),a.$$parentForm.$setValidity(e,u,a)}function n(e,t,n){a[e]||(a[e]={}),l(a[e],t,n)}function r(e,t,n){a[e]&&c(a[e],t,n),Ar(a[e])&&(a[e]=void 0)}function i(e,t){t&&!u[e]?(f.addClass(s,e),u[e]=!0):!t&&u[e]&&(f.removeClass(s,e),u[e]=!1)}function o(e,t){e=e?"-"+se(e,"-"):"",i(ba+e,t===!0),i(ya+e,t===!1)}var a=e.ctrl,s=e.$element,u={},l=e.set,c=e.unset,f=e.$animate;u[ya]=!(u[ba]=s.hasClass(ba)),a.$setValidity=t}function Ar(e){if(e)for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}function Or(e){e[0].hasAttribute("selected")&&(e[0].selected=!0)}var Mr=/^\/(.+)\/([a-z]*)$/,jr="validity",Pr=Object.prototype.hasOwnProperty,Tr=function(e){return w(e)?e.toLowerCase():e},Dr=function(e){return w(e)?e.toUpperCase():e},Fr=function(e){return w(e)?e.replace(/[A-Z]/g,function(e){return String.fromCharCode(32|e.charCodeAt(0))}):e},Nr=function(e){return w(e)?e.replace(/[a-z]/g,function(e){return String.fromCharCode(e.charCodeAt(0)&-33)}):e};"i"!=="I".toLowerCase()&&(Tr=Fr,Dr=Nr);var Ir,Rr,Ur,Vr,zr=[].slice,Lr=[].splice,qr=[].push,Hr=Object.prototype.toString,Br=Object.getPrototypeOf,Wr=t("ng"),Gr=e.angular||(e.angular={}),Xr=0;Ir=e.document.documentMode,p.$inject=[],h.$inject=[];var Kr=Array.isArray,Yr=/^\[object (?:Uint8|Uint8Clamped|Uint16|Uint32|Int8|Int16|Int32|Float32|Float64)Array\]$/,Zr=function(e){return w(e)?e.trim():e},Jr=function(e){return e.replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g,"\\$1").replace(/\x08/g,"\\x08")},Qr=function(){function t(){try{return new Function(""),!1}catch(e){return!0}}if(!m(Qr.rules)){var n=e.document.querySelector("[ng-csp]")||e.document.querySelector("[data-ng-csp]");if(n){var r=n.getAttribute("ng-csp")||n.getAttribute("data-ng-csp");Qr.rules={noUnsafeEval:!r||r.indexOf("no-unsafe-eval")!==-1,noInlineStyle:!r||r.indexOf("no-inline-style")!==-1}}else Qr.rules={noUnsafeEval:t(),noInlineStyle:!1}}return Qr.rules},ei=function(){if(m(ei.name_))return ei.name_;var t,n,r,i,o=ni.length;for(n=0;n<o;++n)if(r=ni[n],t=e.document.querySelector("["+r.replace(":","\\:")+"jq]")){i=t.getAttribute(r+"jq");break}return ei.name_=i},ti=/:/g,ni=["ng-","data-ng-","ng:","x-ng-"],ri=/[A-Z]/g,ii=!1,oi=1,ai=2,si=3,ui=8,li=9,ci=11,fi={full:"1.5.8",major:1,minor:5,dot:8,codeName:"arbitrary-fallbacks"};Oe.expando="ng339";var di=Oe.cache={},pi=1,hi=function(e,t,n){e.addEventListener(t,n,!1)},gi=function(e,t,n){e.removeEventListener(t,n,!1)};Oe._data=function(e){return this.cache[e[this.expando]]||{}};var vi=/([\:\-\_]+(.))/g,$i=/^moz([A-Z])/,mi={mouseleave:"mouseout",mouseenter:"mouseover"},bi=t("jqLite"),yi=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,wi=/<|&#?\w+;/,xi=/<([\w:-]+)/,_i=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,Si={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,"",""]};Si.optgroup=Si.option,Si.tbody=Si.tfoot=Si.colgroup=Si.caption=Si.thead,Si.th=Si.td;var ki=e.Node.prototype.contains||function(e){return!!(16&this.compareDocumentPosition(e))},Ei=Oe.prototype={ready:function(t){function n(){r||(r=!0,t())}var r=!1;"complete"===e.document.readyState?e.setTimeout(n):(this.on("DOMContentLoaded",n),Oe(e).on("load",n))},toString:function(){var e=[];return r(this,function(t){e.push(""+t)}),"["+e.join(", ")+"]"},eq:function(e){return Rr(e>=0?this[e]:this[this.length+e])},length:0,push:qr,sort:[].sort,splice:[].splice},Ci={};r("multiple,selected,checked,disabled,readOnly,required,open".split(","),function(e){Ci[Tr(e)]=e});var Ai={};r("input,select,option,textarea,button,form,details".split(","),function(e){Ai[e]=!0});var Oi={ngMinlength:"minlength",ngMaxlength:"maxlength",ngMin:"min",ngMax:"max",ngPattern:"pattern"};r({data:Fe,removeData:Te,hasData:Se,cleanData:ke},function(e,t){Oe[t]=e}),r({data:Fe,inheritedData:ze,scope:function(e){return Rr.data(e,"$scope")||ze(e.parentNode||e,["$isolateScope","$scope"])},isolateScope:function(e){return Rr.data(e,"$isolateScope")||Rr.data(e,"$isolateScopeNoTemplate")},controller:Ve,injector:function(e){return ze(e,"$injector")},removeAttr:function(e,t){e.removeAttribute(t)},hasClass:Ne,css:function(e,t,n){return t=we(t),m(n)?void(e.style[t]=n):e.style[t]},attr:function(e,t,n){var r=e.nodeType;if(r!==si&&r!==ai&&r!==ui){var i=Tr(t);if(Ci[i]){if(!m(n))return e[t]||(e.attributes.getNamedItem(t)||p).specified?i:void 0;n?(e[t]=!0,e.setAttribute(t,i)):(e[t]=!1,e.removeAttribute(i))}else if(m(n))e.setAttribute(t,n);else if(e.getAttribute){var o=e.getAttribute(t,2);return null===o?void 0:o}}},prop:function(e,t,n){return m(n)?void(e[t]=n):e[t]},text:function(){function e(e,t){if($(t)){var n=e.nodeType;return n===oi||n===si?e.textContent:""}e.textContent=t}return e.$dv="",e}(),val:function(e,t){if($(t)){if(e.multiple&&"select"===I(e)){var n=[];return r(e.options,function(e){e.selected&&n.push(e.value||e.text)}),0===n.length?null:n}return e.value}e.value=t},html:function(e,t){return $(t)?e.innerHTML:(je(e,!0),void(e.innerHTML=t))},empty:Le},function(e,t){Oe.prototype[t]=function(t,n){var r,i,o=this.length;if(e!==Le&&$(2==e.length&&e!==Ne&&e!==Ve?t:n)){if(b(t)){for(r=0;r<o;r++)if(e===Fe)e(this[r],t);else for(i in t)e(this[r],i,t[i]);return this}for(var a=e.$dv,s=$(a)?Math.min(o,1):o,u=0;u<s;u++){var l=e(this[u],t,n);a=a?a+l:l}return a}for(r=0;r<o;r++)e(this[r],t,n);return this}}),r({removeData:Te,on:function(e,t,n,r){if(m(r))throw bi("onargs","jqLite#on() does not support the `selector` or `eventData` parameters");if(_e(e)){var i=De(e,!0),o=i.events,a=i.handle;a||(a=i.handle=Ge(e,o));for(var s=t.indexOf(" ")>=0?t.split(" "):[t],u=s.length,l=function(t,r,i){var s=o[t];s||(s=o[t]=[],s.specialHandlerWrapper=r,"$destroy"===t||i||hi(e,t,a)),s.push(n)};u--;)t=s[u],mi[t]?(l(mi[t],Ke),l(t,void 0,!0)):l(t)}},off:Pe,one:function(e,t,n){e=Rr(e),e.on(t,function r(){e.off(t,n),e.off(t,r)}),e.on(t,n)},replaceWith:function(e,t){var n,i=e.parentNode;je(e),r(new Oe(t),function(t){n?i.insertBefore(t,n.nextSibling):i.replaceChild(t,e),n=t})},children:function(e){var t=[];return r(e.childNodes,function(e){e.nodeType===oi&&t.push(e)}),t},contents:function(e){return e.contentDocument||e.childNodes||[]},append:function(e,t){var n=e.nodeType;if(n===oi||n===ci){t=new Oe(t);for(var r=0,i=t.length;r<i;r++){var o=t[r];e.appendChild(o)}}},prepend:function(e,t){if(e.nodeType===oi){var n=e.firstChild;r(new Oe(t),function(t){e.insertBefore(t,n)})}},wrap:function(e,t){Ae(e,Rr(t).eq(0).clone()[0])},remove:qe,detach:function(e){qe(e,!0)},after:function(e,t){var n=e,r=e.parentNode;t=new Oe(t);for(var i=0,o=t.length;i<o;i++){var a=t[i];r.insertBefore(a,n.nextSibling),n=a}},addClass:Re,removeClass:Ie,toggleClass:function(e,t,n){t&&r(t.split(" "),function(t){var r=n;$(r)&&(r=!Ne(e,t)),(r?Re:Ie)(e,t)})},parent:function(e){var t=e.parentNode;return t&&t.nodeType!==ci?t:null},next:function(e){return e.nextElementSibling},find:function(e,t){return e.getElementsByTagName?e.getElementsByTagName(t):[]},clone:Me,triggerHandler:function(e,t,n){var i,o,a,s=t.type||t,u=De(e),c=u&&u.events,f=c&&c[s];f&&(i={preventDefault:function(){this.defaultPrevented=!0},isDefaultPrevented:function(){return this.defaultPrevented===!0},stopImmediatePropagation:function(){this.immediatePropagationStopped=!0},isImmediatePropagationStopped:function(){return this.immediatePropagationStopped===!0},stopPropagation:p,type:s,target:e},t.type&&(i=l(i,t)),o=ve(f),a=n?[i].concat(n):[i],r(o,function(t){i.isImmediatePropagationStopped()||t.apply(e,a)}))}},function(e,t){Oe.prototype[t]=function(t,n,r){for(var i,o=0,a=this.length;o<a;o++)$(i)?(i=e(this[o],t,n,r),m(i)&&(i=Rr(i))):Ue(i,e(this[o],t,n,r));return m(i)?i:this},Oe.prototype.bind=Oe.prototype.on,Oe.prototype.unbind=Oe.prototype.off}),Je.prototype={put:function(e,t){this[Ze(e,this.nextUid)]=t},get:function(e){return this[Ze(e,this.nextUid)]},remove:function(e){var t=this[e=Ze(e,this.nextUid)];return delete this[e],t}};var Mi=[function(){this.$get=[function(){return Je}]}],ji=/^([^\(]+?)=>/,Pi=/^[^\(]*\(\s*([^\)]*)\)/m,Ti=/,/,Di=/^\s*(_?)(\S+?)\1\s*$/,Fi=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm,Ni=t("$injector");rt.$$annotate=nt;var Ii=t("$animate"),Ri=1,Ui="ng-animate",Vi=function(){this.$get=p},zi=function(){var e=new Je,t=[];this.$get=["$$AnimateRunner","$rootScope",function(n,i){function o(e,t,n){var i=!1;return t&&(t=w(t)?t.split(" "):Kr(t)?t:[],r(t,function(t){t&&(i=!0,e[t]=n)})),i}function a(){r(t,function(t){var n=e.get(t);if(n){var i=st(t.attr("class")),o="",a="";r(n,function(e,t){var n=!!i[t];e!==n&&(e?o+=(o.length?" ":"")+t:a+=(a.length?" ":"")+t)}),r(t,function(e){o&&Re(e,o),a&&Ie(e,a)}),e.remove(t)}}),t.length=0}function s(n,r,s){var u=e.get(n)||{},l=o(u,r,!0),c=o(u,s,!1);(l||c)&&(e.put(n,u),t.push(n),1===t.length&&i.$$postDigest(a))}return{enabled:p,on:p,off:p,pin:p,push:function(e,t,r,i){i&&i(),r=r||{},r.from&&e.css(r.from),r.to&&e.css(r.to),(r.addClass||r.removeClass)&&s(e,r.addClass,r.removeClass);var o=new n;return o.complete(),o}}}]},Li=["$provide",function(e){var t=this;this.$$registeredAnimations=Object.create(null),this.register=function(n,r){if(n&&"."!==n.charAt(0))throw Ii("notcsel","Expecting class selector starting with '.' got '{0}'.",n);var i=n+"-animation";t.$$registeredAnimations[n.substr(1)]=i,e.factory(i,r)},this.classNameFilter=function(e){if(1===arguments.length&&(this.$$classNameFilter=e instanceof RegExp?e:null,this.$$classNameFilter)){var t=new RegExp("(\\s+|\\/)"+Ui+"(\\s+|\\/)");if(t.test(this.$$classNameFilter.toString()))throw Ii("nongcls",'$animateProvider.classNameFilter(regex) prohibits accepting a regex value which matches/contains the "{0}" CSS class.',Ui)}return this.$$classNameFilter},this.$get=["$$animateQueue",function(e){function t(e,t,n){if(n){var r=at(n);!r||r.parentNode||r.previousElementSibling||(n=null)}n?n.after(e):t.prepend(e)}return{on:e.on,off:e.off,pin:e.pin,enabled:e.enabled,cancel:function(e){e.end&&e.end()},enter:function(n,r,i,o){return r=r&&Rr(r),i=i&&Rr(i),r=r||i.parent(),t(n,r,i),e.push(n,"enter",ut(o))},move:function(n,r,i,o){return r=r&&Rr(r),i=i&&Rr(i),r=r||i.parent(),t(n,r,i),e.push(n,"move",ut(o))},leave:function(t,n){return e.push(t,"leave",ut(n),function(){t.remove()})},addClass:function(t,n,r){return r=ut(r),r.addClass=ot(r.addclass,n),e.push(t,"addClass",r)},removeClass:function(t,n,r){return r=ut(r),r.removeClass=ot(r.removeClass,n),e.push(t,"removeClass",r)},setClass:function(t,n,r,i){return i=ut(i),i.addClass=ot(i.addClass,n),i.removeClass=ot(i.removeClass,r),e.push(t,"setClass",i)},animate:function(t,n,r,i,o){return o=ut(o),o.from=o.from?l(o.from,n):n,o.to=o.to?l(o.to,r):r,i=i||"ng-inline-animate",o.tempClasses=ot(o.tempClasses,i),e.push(t,"animate",o)}}}]}],qi=function(){this.$get=["$$rAF",function(e){function t(t){n.push(t),n.length>1||e(function(){for(var e=0;e<n.length;e++)n[e]();n=[]})}var n=[];return function(){var e=!1;return t(function(){e=!0}),function(n){e?n():t(n)}}}]},Hi=function(){this.$get=["$q","$sniffer","$$animateAsyncRun","$document","$timeout",function(e,t,n,i,o){function a(e){this.setHost(e);var t=n(),r=function(e){o(e,0,!1)};this._doneCallbacks=[],this._tick=function(e){var n=i[0];n&&n.hidden?r(e):t(e)},this._state=0}var s=0,u=1,l=2;return a.chain=function(e,t){function n(){return r===e.length?void t(!0):void e[r](function(e){return e===!1?void t(!1):(r++,void n())})}var r=0;n()},a.all=function(e,t){function n(n){o=o&&n,++i===e.length&&t(o)}var i=0,o=!0;r(e,function(e){e.done(n)})},a.prototype={setHost:function(e){this.host=e||{}},done:function(e){this._state===l?e():this._doneCallbacks.push(e)},progress:p,getPromise:function(){if(!this.promise){var t=this;this.promise=e(function(e,n){t.done(function(t){t===!1?n():e()})})}return this.promise},then:function(e,t){return this.getPromise().then(e,t)},"catch":function(e){return this.getPromise()["catch"](e)},"finally":function(e){return this.getPromise()["finally"](e);
|
6 |
+
},pause:function(){this.host.pause&&this.host.pause()},resume:function(){this.host.resume&&this.host.resume()},end:function(){this.host.end&&this.host.end(),this._resolve(!0)},cancel:function(){this.host.cancel&&this.host.cancel(),this._resolve(!1)},complete:function(e){var t=this;t._state===s&&(t._state=u,t._tick(function(){t._resolve(e)}))},_resolve:function(e){this._state!==l&&(r(this._doneCallbacks,function(t){t(e)}),this._doneCallbacks.length=0,this._state=l)}},a}]},Bi=function(){this.$get=["$$rAF","$q","$$AnimateRunner",function(e,t,n){return function(t,r){function i(){return e(function(){o(),s||u.complete(),s=!0}),u}function o(){a.addClass&&(t.addClass(a.addClass),a.addClass=null),a.removeClass&&(t.removeClass(a.removeClass),a.removeClass=null),a.to&&(t.css(a.to),a.to=null)}var a=r||{};a.$$prepared||(a=U(a)),a.cleanupStyles&&(a.from=a.to=null),a.from&&(t.css(a.from),a.from=null);var s,u=new n;return{start:i,end:i}}}]},Wi=t("$compile"),Gi=new pt;ht.$inject=["$provide","$$sanitizeUriProvider"],gt.prototype.isFirstChange=function(){return this.previousValue===Gi};var Xi=/^((?:x|data)[\:\-_])/i,Ki=t("$controller"),Yi=/^(\S+)(\s+as\s+([\w$]+))?$/,Zi=function(){this.$get=["$document",function(e){return function(t){return t?!t.nodeType&&t instanceof Rr&&(t=t[0]):t=e[0].body,t.offsetWidth+1}}]},Ji="application/json",Qi={"Content-Type":Ji+";charset=utf-8"},eo=/^\[|^\{(?!\{)/,to={"[":/]$/,"{":/}$/},no=/^\)\]\}',?\n/,ro=t("$http"),io=function(e){return function(){throw ro("legacy","The method `{0}` on the promise returned from `$http` has been disabled.",e)}},oo=Gr.$interpolateMinErr=t("$interpolate");oo.throwNoconcat=function(e){throw oo("noconcat","Error while interpolating: {0}\nStrict Contextual Escaping disallows interpolations that concatenate multiple expressions when a trusted value is required. See http://docs.angularjs.org/api/ng.$sce",e)},oo.interr=function(e,t){return oo("interr","Can't interpolate: {0}\n{1}",e,t.toString())};var ao=function(){this.$get=["$window",function(e){function t(e){var t=function(e){t.data=e,t.called=!0};return t.id=e,t}var n=e.angular.callbacks,r={};return{createCallback:function(e){var i="_"+(n.$$counter++).toString(36),o="angular.callbacks."+i,a=t(i);return r[o]=n[i]=a,o},wasCalled:function(e){return r[e].called},getResponse:function(e){return r[e].data},removeCallback:function(e){var t=r[e];delete n[t.id],delete r[e]}}}]},so=/^([^\?#]*)(\?([^#]*))?(#(.*))?$/,uo={http:80,https:443,ftp:21},lo=t("$location"),co={$$absUrl:"",$$html5:!1,$$replace:!1,absUrl:Yt("$$absUrl"),url:function(e){if($(e))return this.$$url;var t=so.exec(e);return(t[1]||""===e)&&this.path(decodeURIComponent(t[1])),(t[2]||t[1]||""===e)&&this.search(t[3]||""),this.hash(t[5]||""),this},protocol:Yt("$$protocol"),host:Yt("$$host"),port:Yt("$$port"),path:Zt("$$path",function(e){return e=null!==e?e.toString():"","/"==e.charAt(0)?e:"/"+e}),search:function(e,t){switch(arguments.length){case 0:return this.$$search;case 1:if(w(e)||x(e))e=e.toString(),this.$$search=J(e);else{if(!b(e))throw lo("isrcharg","The first argument of the `$location#search()` call must be a string or an object.");e=U(e,{}),r(e,function(t,n){null==t&&delete e[n]}),this.$$search=e}break;default:$(t)||null===t?delete this.$$search[e]:this.$$search[e]=t}return this.$$compose(),this},hash:Zt("$$hash",function(e){return null!==e?e.toString():""}),replace:function(){return this.$$replace=!0,this}};r([Kt,Xt,Gt],function(e){e.prototype=Object.create(co),e.prototype.state=function(t){if(!arguments.length)return this.$$state;if(e!==Gt||!this.$$html5)throw lo("nostate","History API state support is available only in HTML5 mode and only in browsers supporting HTML5 History API");return this.$$state=$(t)?null:t,this}});var fo=t("$parse"),po=Function.prototype.call,ho=Function.prototype.apply,go=Function.prototype.bind,vo=he();r("+ - * / % === !== == != < > <= >= && || ! = |".split(" "),function(e){vo[e]=!0});var $o={n:"\n",f:"\f",r:"\r",t:"\t",v:"\x0B","'":"'",'"':'"'},mo=function(e){this.options=e};mo.prototype={constructor:mo,lex:function(e){for(this.text=e,this.index=0,this.tokens=[];this.index<this.text.length;){var t=this.text.charAt(this.index);if('"'===t||"'"===t)this.readString(t);else if(this.isNumber(t)||"."===t&&this.isNumber(this.peek()))this.readNumber();else if(this.isIdentifierStart(this.peekMultichar()))this.readIdent();else if(this.is(t,"(){}[].,;:?"))this.tokens.push({index:this.index,text:t}),this.index++;else if(this.isWhitespace(t))this.index++;else{var n=t+this.peek(),r=n+this.peek(2),i=vo[t],o=vo[n],a=vo[r];if(i||o||a){var s=a?r:o?n:t;this.tokens.push({index:this.index,text:s,operator:!0}),this.index+=s.length}else this.throwError("Unexpected next character ",this.index,this.index+1)}}return this.tokens},is:function(e,t){return t.indexOf(e)!==-1},peek:function(e){var t=e||1;return this.index+t<this.text.length&&this.text.charAt(this.index+t)},isNumber:function(e){return"0"<=e&&e<="9"&&"string"==typeof e},isWhitespace:function(e){return" "===e||"\r"===e||"\t"===e||"\n"===e||"\x0B"===e||" "===e},isIdentifierStart:function(e){return this.options.isIdentifierStart?this.options.isIdentifierStart(e,this.codePointAt(e)):this.isValidIdentifierStart(e)},isValidIdentifierStart:function(e){return"a"<=e&&e<="z"||"A"<=e&&e<="Z"||"_"===e||"$"===e},isIdentifierContinue:function(e){return this.options.isIdentifierContinue?this.options.isIdentifierContinue(e,this.codePointAt(e)):this.isValidIdentifierContinue(e)},isValidIdentifierContinue:function(e,t){return this.isValidIdentifierStart(e,t)||this.isNumber(e)},codePointAt:function(e){return 1===e.length?e.charCodeAt(0):(e.charCodeAt(0)<<10)+e.charCodeAt(1)-56613888},peekMultichar:function(){var e=this.text.charAt(this.index),t=this.peek();if(!t)return e;var n=e.charCodeAt(0),r=t.charCodeAt(0);return n>=55296&&n<=56319&&r>=56320&&r<=57343?e+t:e},isExpOperator:function(e){return"-"===e||"+"===e||this.isNumber(e)},throwError:function(e,t,n){n=n||this.index;var r=m(t)?"s "+t+"-"+this.index+" ["+this.text.substring(t,n)+"]":" "+n;throw fo("lexerr","Lexer Error: {0} at column{1} in expression [{2}].",e,r,this.text)},readNumber:function(){for(var e="",t=this.index;this.index<this.text.length;){var n=Tr(this.text.charAt(this.index));if("."==n||this.isNumber(n))e+=n;else{var r=this.peek();if("e"==n&&this.isExpOperator(r))e+=n;else if(this.isExpOperator(n)&&r&&this.isNumber(r)&&"e"==e.charAt(e.length-1))e+=n;else{if(!this.isExpOperator(n)||r&&this.isNumber(r)||"e"!=e.charAt(e.length-1))break;this.throwError("Invalid exponent")}}this.index++}this.tokens.push({index:t,text:e,constant:!0,value:Number(e)})},readIdent:function(){var e=this.index;for(this.index+=this.peekMultichar().length;this.index<this.text.length;){var t=this.peekMultichar();if(!this.isIdentifierContinue(t))break;this.index+=t.length}this.tokens.push({index:e,text:this.text.slice(e,this.index),identifier:!0})},readString:function(e){var t=this.index;this.index++;for(var n="",r=e,i=!1;this.index<this.text.length;){var o=this.text.charAt(this.index);if(r+=o,i){if("u"===o){var a=this.text.substring(this.index+1,this.index+5);a.match(/[\da-f]{4}/i)||this.throwError("Invalid unicode escape [\\u"+a+"]"),this.index+=4,n+=String.fromCharCode(parseInt(a,16))}else{var s=$o[o];n+=s||o}i=!1}else if("\\"===o)i=!0;else{if(o===e)return this.index++,void this.tokens.push({index:t,text:r,constant:!0,value:n});n+=o}this.index++}this.throwError("Unterminated quote",t)}};var bo=function(e,t){this.lexer=e,this.options=t};bo.Program="Program",bo.ExpressionStatement="ExpressionStatement",bo.AssignmentExpression="AssignmentExpression",bo.ConditionalExpression="ConditionalExpression",bo.LogicalExpression="LogicalExpression",bo.BinaryExpression="BinaryExpression",bo.UnaryExpression="UnaryExpression",bo.CallExpression="CallExpression",bo.MemberExpression="MemberExpression",bo.Identifier="Identifier",bo.Literal="Literal",bo.ArrayExpression="ArrayExpression",bo.Property="Property",bo.ObjectExpression="ObjectExpression",bo.ThisExpression="ThisExpression",bo.LocalsExpression="LocalsExpression",bo.NGValueParameter="NGValueParameter",bo.prototype={ast:function(e){this.text=e,this.tokens=this.lexer.lex(e);var t=this.program();return 0!==this.tokens.length&&this.throwError("is an unexpected token",this.tokens[0]),t},program:function(){for(var e=[];;)if(this.tokens.length>0&&!this.peek("}",")",";","]")&&e.push(this.expressionStatement()),!this.expect(";"))return{type:bo.Program,body:e}},expressionStatement:function(){return{type:bo.ExpressionStatement,expression:this.filterChain()}},filterChain:function(){for(var e,t=this.expression();e=this.expect("|");)t=this.filter(t);return t},expression:function(){return this.assignment()},assignment:function(){var e=this.ternary();return this.expect("=")&&(e={type:bo.AssignmentExpression,left:e,right:this.assignment(),operator:"="}),e},ternary:function(){var e,t,n=this.logicalOR();return this.expect("?")&&(e=this.expression(),this.consume(":"))?(t=this.expression(),{type:bo.ConditionalExpression,test:n,alternate:e,consequent:t}):n},logicalOR:function(){for(var e=this.logicalAND();this.expect("||");)e={type:bo.LogicalExpression,operator:"||",left:e,right:this.logicalAND()};return e},logicalAND:function(){for(var e=this.equality();this.expect("&&");)e={type:bo.LogicalExpression,operator:"&&",left:e,right:this.equality()};return e},equality:function(){for(var e,t=this.relational();e=this.expect("==","!=","===","!==");)t={type:bo.BinaryExpression,operator:e.text,left:t,right:this.relational()};return t},relational:function(){for(var e,t=this.additive();e=this.expect("<",">","<=",">=");)t={type:bo.BinaryExpression,operator:e.text,left:t,right:this.additive()};return t},additive:function(){for(var e,t=this.multiplicative();e=this.expect("+","-");)t={type:bo.BinaryExpression,operator:e.text,left:t,right:this.multiplicative()};return t},multiplicative:function(){for(var e,t=this.unary();e=this.expect("*","/","%");)t={type:bo.BinaryExpression,operator:e.text,left:t,right:this.unary()};return t},unary:function(){var e;return(e=this.expect("+","-","!"))?{type:bo.UnaryExpression,operator:e.text,prefix:!0,argument:this.unary()}:this.primary()},primary:function(){var e;this.expect("(")?(e=this.filterChain(),this.consume(")")):this.expect("[")?e=this.arrayDeclaration():this.expect("{")?e=this.object():this.selfReferential.hasOwnProperty(this.peek().text)?e=U(this.selfReferential[this.consume().text]):this.options.literals.hasOwnProperty(this.peek().text)?e={type:bo.Literal,value:this.options.literals[this.consume().text]}:this.peek().identifier?e=this.identifier():this.peek().constant?e=this.constant():this.throwError("not a primary expression",this.peek());for(var t;t=this.expect("(","[",".");)"("===t.text?(e={type:bo.CallExpression,callee:e,arguments:this.parseArguments()},this.consume(")")):"["===t.text?(e={type:bo.MemberExpression,object:e,property:this.expression(),computed:!0},this.consume("]")):"."===t.text?e={type:bo.MemberExpression,object:e,property:this.identifier(),computed:!1}:this.throwError("IMPOSSIBLE");return e},filter:function(e){for(var t=[e],n={type:bo.CallExpression,callee:this.identifier(),arguments:t,filter:!0};this.expect(":");)t.push(this.expression());return n},parseArguments:function(){var e=[];if(")"!==this.peekToken().text)do e.push(this.filterChain());while(this.expect(","));return e},identifier:function(){var e=this.consume();return e.identifier||this.throwError("is not a valid identifier",e),{type:bo.Identifier,name:e.text}},constant:function(){return{type:bo.Literal,value:this.consume().value}},arrayDeclaration:function(){var e=[];if("]"!==this.peekToken().text)do{if(this.peek("]"))break;e.push(this.expression())}while(this.expect(","));return this.consume("]"),{type:bo.ArrayExpression,elements:e}},object:function(){var e,t=[];if("}"!==this.peekToken().text)do{if(this.peek("}"))break;e={type:bo.Property,kind:"init"},this.peek().constant?(e.key=this.constant(),e.computed=!1,this.consume(":"),e.value=this.expression()):this.peek().identifier?(e.key=this.identifier(),e.computed=!1,this.peek(":")?(this.consume(":"),e.value=this.expression()):e.value=e.key):this.peek("[")?(this.consume("["),e.key=this.expression(),this.consume("]"),e.computed=!0,this.consume(":"),e.value=this.expression()):this.throwError("invalid key",this.peek()),t.push(e)}while(this.expect(","));return this.consume("}"),{type:bo.ObjectExpression,properties:t}},throwError:function(e,t){throw fo("syntax","Syntax Error: Token '{0}' {1} at column {2} of the expression [{3}] starting at [{4}].",t.text,e,t.index+1,this.text,this.text.substring(t.index))},consume:function(e){if(0===this.tokens.length)throw fo("ueoe","Unexpected end of expression: {0}",this.text);var t=this.expect(e);return t||this.throwError("is unexpected, expecting ["+e+"]",this.peek()),t},peekToken:function(){if(0===this.tokens.length)throw fo("ueoe","Unexpected end of expression: {0}",this.text);return this.tokens[0]},peek:function(e,t,n,r){return this.peekAhead(0,e,t,n,r)},peekAhead:function(e,t,n,r,i){if(this.tokens.length>e){var o=this.tokens[e],a=o.text;if(a===t||a===n||a===r||a===i||!t&&!n&&!r&&!i)return o}return!1},expect:function(e,t,n,r){var i=this.peek(e,t,n,r);return!!i&&(this.tokens.shift(),i)},selfReferential:{"this":{type:bo.ThisExpression},$locals:{type:bo.LocalsExpression}}},gn.prototype={compile:function(e,t){var n=this,i=this.astBuilder.ast(e);this.state={nextId:0,filters:{},expensiveChecks:t,fn:{vars:[],body:[],own:{}},assign:{vars:[],body:[],own:{}},inputs:[]},ln(i,n.$filter);var o,a="";if(this.stage="assign",o=dn(i)){this.state.computing="assign";var s=this.nextId();this.recurse(o,s),this.return_(s),a="fn.assign="+this.generateFunction("assign","s,v,l")}var u=cn(i.body);n.stage="inputs",r(u,function(e,t){var r="fn"+t;n.state[r]={vars:[],body:[],own:{}},n.state.computing=r;var i=n.nextId();n.recurse(e,i),n.return_(i),n.state.inputs.push(r),e.watchId=t}),this.state.computing="fn",this.stage="main",this.recurse(i);var l='"'+this.USE+" "+this.STRICT+'";\n'+this.filterPrefix()+"var fn="+this.generateFunction("fn","s,l,a,i")+a+this.watchFns()+"return fn;",c=new Function("$filter","ensureSafeMemberName","ensureSafeObject","ensureSafeFunction","getStringValue","ensureSafeAssignContext","ifDefined","plus","text",l)(this.$filter,en,nn,rn,tn,on,an,sn,e);return this.state=this.stage=void 0,c.literal=pn(i),c.constant=hn(i),c},USE:"use",STRICT:"strict",watchFns:function(){var e=[],t=this.state.inputs,n=this;return r(t,function(t){e.push("var "+t+"="+n.generateFunction(t,"s"))}),t.length&&e.push("fn.inputs=["+t.join(",")+"];"),e.join("")},generateFunction:function(e,t){return"function("+t+"){"+this.varsPrefix(e)+this.body(e)+"};"},filterPrefix:function(){var e=[],t=this;return r(this.state.filters,function(n,r){e.push(n+"=$filter("+t.escape(r)+")")}),e.length?"var "+e.join(",")+";":""},varsPrefix:function(e){return this.state[e].vars.length?"var "+this.state[e].vars.join(",")+";":""},body:function(e){return this.state[e].body.join("")},recurse:function(e,t,n,i,o,a){var s,u,l,c,f,d=this;if(i=i||p,!a&&m(e.watchId))return t=t||this.nextId(),void this.if_("i",this.lazyAssign(t,this.computedMember("i",e.watchId)),this.lazyRecurse(e,t,n,i,o,!0));switch(e.type){case bo.Program:r(e.body,function(t,n){d.recurse(t.expression,void 0,void 0,function(e){u=e}),n!==e.body.length-1?d.current().body.push(u,";"):d.return_(u)});break;case bo.Literal:c=this.escape(e.value),this.assign(t,c),i(c);break;case bo.UnaryExpression:this.recurse(e.argument,void 0,void 0,function(e){u=e}),c=e.operator+"("+this.ifDefined(u,0)+")",this.assign(t,c),i(c);break;case bo.BinaryExpression:this.recurse(e.left,void 0,void 0,function(e){s=e}),this.recurse(e.right,void 0,void 0,function(e){u=e}),c="+"===e.operator?this.plus(s,u):"-"===e.operator?this.ifDefined(s,0)+e.operator+this.ifDefined(u,0):"("+s+")"+e.operator+"("+u+")",this.assign(t,c),i(c);break;case bo.LogicalExpression:t=t||this.nextId(),d.recurse(e.left,t),d.if_("&&"===e.operator?t:d.not(t),d.lazyRecurse(e.right,t)),i(t);break;case bo.ConditionalExpression:t=t||this.nextId(),d.recurse(e.test,t),d.if_(t,d.lazyRecurse(e.alternate,t),d.lazyRecurse(e.consequent,t)),i(t);break;case bo.Identifier:t=t||this.nextId(),n&&(n.context="inputs"===d.stage?"s":this.assign(this.nextId(),this.getHasOwnProperty("l",e.name)+"?l:s"),n.computed=!1,n.name=e.name),en(e.name),d.if_("inputs"===d.stage||d.not(d.getHasOwnProperty("l",e.name)),function(){d.if_("inputs"===d.stage||"s",function(){o&&1!==o&&d.if_(d.not(d.nonComputedMember("s",e.name)),d.lazyAssign(d.nonComputedMember("s",e.name),"{}")),d.assign(t,d.nonComputedMember("s",e.name))})},t&&d.lazyAssign(t,d.nonComputedMember("l",e.name))),(d.state.expensiveChecks||$n(e.name))&&d.addEnsureSafeObject(t),i(t);break;case bo.MemberExpression:s=n&&(n.context=this.nextId())||this.nextId(),t=t||this.nextId(),d.recurse(e.object,s,void 0,function(){d.if_(d.notNull(s),function(){o&&1!==o&&d.addEnsureSafeAssignContext(s),e.computed?(u=d.nextId(),d.recurse(e.property,u),d.getStringValue(u),d.addEnsureSafeMemberName(u),o&&1!==o&&d.if_(d.not(d.computedMember(s,u)),d.lazyAssign(d.computedMember(s,u),"{}")),c=d.ensureSafeObject(d.computedMember(s,u)),d.assign(t,c),n&&(n.computed=!0,n.name=u)):(en(e.property.name),o&&1!==o&&d.if_(d.not(d.nonComputedMember(s,e.property.name)),d.lazyAssign(d.nonComputedMember(s,e.property.name),"{}")),c=d.nonComputedMember(s,e.property.name),(d.state.expensiveChecks||$n(e.property.name))&&(c=d.ensureSafeObject(c)),d.assign(t,c),n&&(n.computed=!1,n.name=e.property.name))},function(){d.assign(t,"undefined")}),i(t)},!!o);break;case bo.CallExpression:t=t||this.nextId(),e.filter?(u=d.filter(e.callee.name),l=[],r(e.arguments,function(e){var t=d.nextId();d.recurse(e,t),l.push(t)}),c=u+"("+l.join(",")+")",d.assign(t,c),i(t)):(u=d.nextId(),s={},l=[],d.recurse(e.callee,u,s,function(){d.if_(d.notNull(u),function(){d.addEnsureSafeFunction(u),r(e.arguments,function(e){d.recurse(e,d.nextId(),void 0,function(e){l.push(d.ensureSafeObject(e))})}),s.name?(d.state.expensiveChecks||d.addEnsureSafeObject(s.context),c=d.member(s.context,s.name,s.computed)+"("+l.join(",")+")"):c=u+"("+l.join(",")+")",c=d.ensureSafeObject(c),d.assign(t,c)},function(){d.assign(t,"undefined")}),i(t)}));break;case bo.AssignmentExpression:if(u=this.nextId(),s={},!fn(e.left))throw fo("lval","Trying to assign a value to a non l-value");this.recurse(e.left,void 0,s,function(){d.if_(d.notNull(s.context),function(){d.recurse(e.right,u),d.addEnsureSafeObject(d.member(s.context,s.name,s.computed)),d.addEnsureSafeAssignContext(s.context),c=d.member(s.context,s.name,s.computed)+e.operator+u,d.assign(t,c),i(t||c)})},1);break;case bo.ArrayExpression:l=[],r(e.elements,function(e){d.recurse(e,d.nextId(),void 0,function(e){l.push(e)})}),c="["+l.join(",")+"]",this.assign(t,c),i(c);break;case bo.ObjectExpression:l=[],f=!1,r(e.properties,function(e){e.computed&&(f=!0)}),f?(t=t||this.nextId(),this.assign(t,"{}"),r(e.properties,function(e){e.computed?(s=d.nextId(),d.recurse(e.key,s)):s=e.key.type===bo.Identifier?e.key.name:""+e.key.value,u=d.nextId(),d.recurse(e.value,u),d.assign(d.member(t,s,e.computed),u)})):(r(e.properties,function(t){d.recurse(t.value,e.constant?void 0:d.nextId(),void 0,function(e){l.push(d.escape(t.key.type===bo.Identifier?t.key.name:""+t.key.value)+":"+e)})}),c="{"+l.join(",")+"}",this.assign(t,c)),i(t||c);break;case bo.ThisExpression:this.assign(t,"s"),i("s");break;case bo.LocalsExpression:this.assign(t,"l"),i("l");break;case bo.NGValueParameter:this.assign(t,"v"),i("v")}},getHasOwnProperty:function(e,t){var n=e+"."+t,r=this.current().own;return r.hasOwnProperty(n)||(r[n]=this.nextId(!1,e+"&&("+this.escape(t)+" in "+e+")")),r[n]},assign:function(e,t){if(e)return this.current().body.push(e,"=",t,";"),e},filter:function(e){return this.state.filters.hasOwnProperty(e)||(this.state.filters[e]=this.nextId(!0)),this.state.filters[e]},ifDefined:function(e,t){return"ifDefined("+e+","+this.escape(t)+")"},plus:function(e,t){return"plus("+e+","+t+")"},return_:function(e){this.current().body.push("return ",e,";")},if_:function(e,t,n){if(e===!0)t();else{var r=this.current().body;r.push("if(",e,"){"),t(),r.push("}"),n&&(r.push("else{"),n(),r.push("}"))}},not:function(e){return"!("+e+")"},notNull:function(e){return e+"!=null"},nonComputedMember:function(e,t){var n=/[$_a-zA-Z][$_a-zA-Z0-9]*/,r=/[^$_a-zA-Z0-9]/g;return n.test(t)?e+"."+t:e+'["'+t.replace(r,this.stringEscapeFn)+'"]'},computedMember:function(e,t){return e+"["+t+"]"},member:function(e,t,n){return n?this.computedMember(e,t):this.nonComputedMember(e,t)},addEnsureSafeObject:function(e){this.current().body.push(this.ensureSafeObject(e),";")},addEnsureSafeMemberName:function(e){this.current().body.push(this.ensureSafeMemberName(e),";")},addEnsureSafeFunction:function(e){this.current().body.push(this.ensureSafeFunction(e),";")},addEnsureSafeAssignContext:function(e){this.current().body.push(this.ensureSafeAssignContext(e),";")},ensureSafeObject:function(e){return"ensureSafeObject("+e+",text)"},ensureSafeMemberName:function(e){return"ensureSafeMemberName("+e+",text)"},ensureSafeFunction:function(e){return"ensureSafeFunction("+e+",text)"},getStringValue:function(e){this.assign(e,"getStringValue("+e+")")},ensureSafeAssignContext:function(e){return"ensureSafeAssignContext("+e+",text)"},lazyRecurse:function(e,t,n,r,i,o){var a=this;return function(){a.recurse(e,t,n,r,i,o)}},lazyAssign:function(e,t){var n=this;return function(){n.assign(e,t)}},stringEscapeRegex:/[^ a-zA-Z0-9]/g,stringEscapeFn:function(e){return"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)},escape:function(e){if(w(e))return"'"+e.replace(this.stringEscapeRegex,this.stringEscapeFn)+"'";if(x(e))return e.toString();if(e===!0)return"true";if(e===!1)return"false";if(null===e)return"null";if("undefined"==typeof e)return"undefined";throw fo("esc","IMPOSSIBLE")},nextId:function(e,t){var n="v"+this.state.nextId++;return e||this.current().vars.push(n+(t?"="+t:"")),n},current:function(){return this.state[this.state.computing]}},vn.prototype={compile:function(e,t){var n=this,i=this.astBuilder.ast(e);this.expression=e,this.expensiveChecks=t,ln(i,n.$filter);var o,a;(o=dn(i))&&(a=this.recurse(o));var s,u=cn(i.body);u&&(s=[],r(u,function(e,t){var r=n.recurse(e);e.input=r,s.push(r),e.watchId=t}));var l=[];r(i.body,function(e){l.push(n.recurse(e.expression))});var c=0===i.body.length?p:1===i.body.length?l[0]:function(e,t){var n;return r(l,function(r){n=r(e,t)}),n};return a&&(c.assign=function(e,t,n){return a(e,n,t)}),s&&(c.inputs=s),c.literal=pn(i),c.constant=hn(i),c},recurse:function(e,t,n){var i,o,a,s=this;if(e.input)return this.inputs(e.input,e.watchId);switch(e.type){case bo.Literal:return this.value(e.value,t);case bo.UnaryExpression:return o=this.recurse(e.argument),this["unary"+e.operator](o,t);case bo.BinaryExpression:return i=this.recurse(e.left),o=this.recurse(e.right),this["binary"+e.operator](i,o,t);case bo.LogicalExpression:return i=this.recurse(e.left),o=this.recurse(e.right),this["binary"+e.operator](i,o,t);case bo.ConditionalExpression:return this["ternary?:"](this.recurse(e.test),this.recurse(e.alternate),this.recurse(e.consequent),t);case bo.Identifier:return en(e.name,s.expression),s.identifier(e.name,s.expensiveChecks||$n(e.name),t,n,s.expression);case bo.MemberExpression:return i=this.recurse(e.object,!1,!!n),e.computed||(en(e.property.name,s.expression),o=e.property.name),e.computed&&(o=this.recurse(e.property)),e.computed?this.computedMember(i,o,t,n,s.expression):this.nonComputedMember(i,o,s.expensiveChecks,t,n,s.expression);case bo.CallExpression:return a=[],r(e.arguments,function(e){a.push(s.recurse(e))}),e.filter&&(o=this.$filter(e.callee.name)),e.filter||(o=this.recurse(e.callee,!0)),e.filter?function(e,n,r,i){for(var s=[],u=0;u<a.length;++u)s.push(a[u](e,n,r,i));var l=o.apply(void 0,s,i);return t?{context:void 0,name:void 0,value:l}:l}:function(e,n,r,i){var u,l=o(e,n,r,i);if(null!=l.value){nn(l.context,s.expression),rn(l.value,s.expression);for(var c=[],f=0;f<a.length;++f)c.push(nn(a[f](e,n,r,i),s.expression));u=nn(l.value.apply(l.context,c),s.expression)}return t?{value:u}:u};case bo.AssignmentExpression:return i=this.recurse(e.left,!0,1),o=this.recurse(e.right),function(e,n,r,a){var u=i(e,n,r,a),l=o(e,n,r,a);return nn(u.value,s.expression),on(u.context),u.context[u.name]=l,t?{value:l}:l};case bo.ArrayExpression:return a=[],r(e.elements,function(e){a.push(s.recurse(e))}),function(e,n,r,i){for(var o=[],s=0;s<a.length;++s)o.push(a[s](e,n,r,i));return t?{value:o}:o};case bo.ObjectExpression:return a=[],r(e.properties,function(e){e.computed?a.push({key:s.recurse(e.key),computed:!0,value:s.recurse(e.value)}):a.push({key:e.key.type===bo.Identifier?e.key.name:""+e.key.value,computed:!1,value:s.recurse(e.value)})}),function(e,n,r,i){for(var o={},s=0;s<a.length;++s)a[s].computed?o[a[s].key(e,n,r,i)]=a[s].value(e,n,r,i):o[a[s].key]=a[s].value(e,n,r,i);return t?{value:o}:o};case bo.ThisExpression:return function(e){return t?{value:e}:e};case bo.LocalsExpression:return function(e,n){return t?{value:n}:n};case bo.NGValueParameter:return function(e,n,r){return t?{value:r}:r}}},"unary+":function(e,t){return function(n,r,i,o){var a=e(n,r,i,o);return a=m(a)?+a:0,t?{value:a}:a}},"unary-":function(e,t){return function(n,r,i,o){var a=e(n,r,i,o);return a=m(a)?-a:0,t?{value:a}:a}},"unary!":function(e,t){return function(n,r,i,o){var a=!e(n,r,i,o);return t?{value:a}:a}},"binary+":function(e,t,n){return function(r,i,o,a){var s=e(r,i,o,a),u=t(r,i,o,a),l=sn(s,u);return n?{value:l}:l}},"binary-":function(e,t,n){return function(r,i,o,a){var s=e(r,i,o,a),u=t(r,i,o,a),l=(m(s)?s:0)-(m(u)?u:0);return n?{value:l}:l}},"binary*":function(e,t,n){return function(r,i,o,a){var s=e(r,i,o,a)*t(r,i,o,a);return n?{value:s}:s}},"binary/":function(e,t,n){return function(r,i,o,a){var s=e(r,i,o,a)/t(r,i,o,a);return n?{value:s}:s}},"binary%":function(e,t,n){return function(r,i,o,a){var s=e(r,i,o,a)%t(r,i,o,a);return n?{value:s}:s}},"binary===":function(e,t,n){return function(r,i,o,a){var s=e(r,i,o,a)===t(r,i,o,a);return n?{value:s}:s}},"binary!==":function(e,t,n){return function(r,i,o,a){var s=e(r,i,o,a)!==t(r,i,o,a);return n?{value:s}:s}},"binary==":function(e,t,n){return function(r,i,o,a){var s=e(r,i,o,a)==t(r,i,o,a);return n?{value:s}:s}},"binary!=":function(e,t,n){return function(r,i,o,a){var s=e(r,i,o,a)!=t(r,i,o,a);return n?{value:s}:s}},"binary<":function(e,t,n){return function(r,i,o,a){var s=e(r,i,o,a)<t(r,i,o,a);return n?{value:s}:s}},"binary>":function(e,t,n){return function(r,i,o,a){var s=e(r,i,o,a)>t(r,i,o,a);return n?{value:s}:s}},"binary<=":function(e,t,n){return function(r,i,o,a){var s=e(r,i,o,a)<=t(r,i,o,a);return n?{value:s}:s}},"binary>=":function(e,t,n){return function(r,i,o,a){var s=e(r,i,o,a)>=t(r,i,o,a);return n?{value:s}:s}},"binary&&":function(e,t,n){return function(r,i,o,a){var s=e(r,i,o,a)&&t(r,i,o,a);return n?{value:s}:s}},"binary||":function(e,t,n){return function(r,i,o,a){var s=e(r,i,o,a)||t(r,i,o,a);return n?{value:s}:s}},"ternary?:":function(e,t,n,r){return function(i,o,a,s){var u=e(i,o,a,s)?t(i,o,a,s):n(i,o,a,s);return r?{value:u}:u}},value:function(e,t){return function(){return t?{context:void 0,name:void 0,value:e}:e}},identifier:function(e,t,n,r,i){return function(o,a,s,u){var l=a&&e in a?a:o;r&&1!==r&&l&&!l[e]&&(l[e]={});var c=l?l[e]:void 0;return t&&nn(c,i),n?{context:l,name:e,value:c}:c}},computedMember:function(e,t,n,r,i){return function(o,a,s,u){var l,c,f=e(o,a,s,u);return null!=f&&(l=t(o,a,s,u),l=tn(l),en(l,i),r&&1!==r&&(on(f),f&&!f[l]&&(f[l]={})),c=f[l],nn(c,i)),n?{context:f,name:l,value:c}:c}},nonComputedMember:function(e,t,n,r,i,o){return function(a,s,u,l){var c=e(a,s,u,l);i&&1!==i&&(on(c),c&&!c[t]&&(c[t]={}));var f=null!=c?c[t]:void 0;return(n||$n(t))&&nn(f,o),r?{context:c,name:t,value:f}:f}},inputs:function(e,t){return function(n,r,i,o){return o?o[t]:e(n,r,i)}}};var yo=function(e,t,n){this.lexer=e,this.$filter=t,this.options=n,this.ast=new bo(e,n),this.astCompiler=n.csp?new vn(this.ast,t):new gn(this.ast,t)};yo.prototype={constructor:yo,parse:function(e){return this.astCompiler.compile(e,this.options.expensiveChecks)}};var wo=Object.prototype.valueOf,xo=t("$sce"),_o={HTML:"html",CSS:"css",URL:"url",RESOURCE_URL:"resourceUrl",JS:"js"},So=t("$compile"),ko=e.document.createElement("a"),Eo=Dn(e.location.href);In.$inject=["$document"],Un.$inject=["$provide"];var Co=22,Ao=".",Oo="0";Hn.$inject=["$locale"],Bn.$inject=["$locale"];var Mo={yyyy:Yn("FullYear",4,0,!1,!0),yy:Yn("FullYear",2,0,!0,!0),y:Yn("FullYear",1,0,!1,!0),MMMM:Zn("Month"),MMM:Zn("Month",!0),MM:Yn("Month",2,1),M:Yn("Month",1,1),LLLL:Zn("Month",!1,!0),dd:Yn("Date",2),d:Yn("Date",1),HH:Yn("Hours",2),H:Yn("Hours",1),hh:Yn("Hours",2,-12),h:Yn("Hours",1,-12),mm:Yn("Minutes",2),m:Yn("Minutes",1),ss:Yn("Seconds",2),s:Yn("Seconds",1),sss:Yn("Milliseconds",3),EEEE:Zn("Day"),EEE:Zn("Day",!0),a:nr,Z:Jn,ww:tr(2),w:tr(1),G:rr,GG:rr,GGG:rr,GGGG:ir},jo=/((?:[^yMLdHhmsaZEwG']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|L+|d+|H+|h+|m+|s+|a|Z|G+|w+))(.*)/,Po=/^\-?\d+$/;or.$inject=["$locale"];var To=g(Tr),Do=g(Dr);lr.$inject=["$parse"];var Fo=g({restrict:"E",compile:function(e,t){if(!t.href&&!t.xlinkHref)return function(e,t){if("a"===t[0].nodeName.toLowerCase()){var n="[object SVGAnimatedString]"===Hr.call(t.prop("href"))?"xlink:href":"href";t.on("click",function(e){t.attr(n)||e.preventDefault()})}}}}),No={};r(Ci,function(e,t){function n(e,n,i){e.$watch(i[r],function(e){i.$set(t,!!e)})}if("multiple"!=e){var r=vt("ng-"+t),i=n;"checked"===e&&(i=function(e,t,i){i.ngModel!==i[r]&&n(e,t,i)}),No[r]=function(){return{restrict:"A",priority:100,link:i}}}}),r(Oi,function(e,t){No[t]=function(){return{priority:100,link:function(e,n,r){if("ngPattern"===t&&"/"==r.ngPattern.charAt(0)){var i=r.ngPattern.match(Mr);if(i)return void r.$set("ngPattern",new RegExp(i[1],i[2]))}e.$watch(r[t],function(e){r.$set(t,e)})}}}}),r(["src","srcset","href"],function(e){var t=vt("ng-"+e);No[t]=function(){return{priority:99,link:function(n,r,i){var o=e,a=e;"href"===e&&"[object SVGAnimatedString]"===Hr.call(r.prop("href"))&&(a="xlinkHref",i.$attr[a]="xlink:href",o=null),i.$observe(t,function(t){return t?(i.$set(a,t),void(Ir&&o&&r.prop(o,i[a]))):void("href"===e&&i.$set(a,null))})}}}});var Io={$addControl:p,$$renameControl:fr,$removeControl:p,$setValidity:p,$setDirty:p,$setPristine:p,$setSubmitted:p},Ro="ng-submitted";dr.$inject=["$element","$attrs","$scope","$animate","$interpolate"];var Uo=function(e){return["$timeout","$parse",function(t,n){function r(e){return""===e?n('this[""]').assign:n(e).assign||p}var i={name:"form",restrict:e?"EAC":"E",require:["form","^^?form"],controller:dr,compile:function(n,i){n.addClass(wa).addClass(ba);var o=i.name?"name":!(!e||!i.ngForm)&&"ngForm";return{pre:function(e,n,i,a){var s=a[0];if(!("action"in i)){var u=function(t){e.$apply(function(){s.$commitViewValue(),s.$setSubmitted()}),t.preventDefault()};hi(n[0],"submit",u),n.on("$destroy",function(){t(function(){gi(n[0],"submit",u)},0,!1)})}var c=a[1]||s.$$parentForm;c.$addControl(s);var f=o?r(s.$name):p;o&&(f(e,s),i.$observe(o,function(t){s.$name!==t&&(f(e,void 0),s.$$parentForm.$$renameControl(s,t),(f=r(s.$name))(e,s))})),n.on("$destroy",function(){s.$$parentForm.$removeControl(s),f(e,void 0),l(s,Io)})}}}};return i}]},Vo=Uo(),zo=Uo(!0),Lo=/^\d{4,}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+(?:[+-][0-2]\d:[0-5]\d|Z)$/,qo=/^[a-z][a-z\d.+-]*:\/*(?:[^:@]+(?::[^@]+)?@)?(?:[^\s:\/?#]+|\[[a-f\d:]+\])(?::\d+)?(?:\/[^?#]*)?(?:\?[^#]*)?(?:#.*)?$/i,Ho=/^(?=.{1,254}$)(?=.{1,64}@)[-!#$%&'*+\/0-9=?A-Z^_`a-z{|}~]+(\.[-!#$%&'*+\/0-9=?A-Z^_`a-z{|}~]+)*@[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?(\.[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?)*$/,Bo=/^\s*(\-|\+)?(\d+|(\d*(\.\d*)))([eE][+-]?\d+)?\s*$/,Wo=/^(\d{4,})-(\d{2})-(\d{2})$/,Go=/^(\d{4,})-(\d\d)-(\d\d)T(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/,Xo=/^(\d{4,})-W(\d\d)$/,Ko=/^(\d{4,})-(\d\d)$/,Yo=/^(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/,Zo="keydown wheel mousedown",Jo=he();
|
7 |
+
r("date,datetime-local,month,time,week".split(","),function(e){Jo[e]=!0});var Qo={text:hr,date:mr("date",Wo,$r(Wo,["yyyy","MM","dd"]),"yyyy-MM-dd"),"datetime-local":mr("datetimelocal",Go,$r(Go,["yyyy","MM","dd","HH","mm","ss","sss"]),"yyyy-MM-ddTHH:mm:ss.sss"),time:mr("time",Yo,$r(Yo,["HH","mm","ss","sss"]),"HH:mm:ss.sss"),week:mr("week",Xo,vr,"yyyy-Www"),month:mr("month",Ko,$r(Ko,["yyyy","MM"]),"yyyy-MM"),number:yr,url:wr,email:xr,radio:_r,checkbox:kr,hidden:p,button:p,submit:p,reset:p,file:p},ea=["$browser","$sniffer","$filter","$parse",function(e,t,n,r){return{restrict:"E",require:["?ngModel"],link:{pre:function(i,o,a,s){s[0]&&(Qo[Tr(a.type)]||Qo.text)(i,o,a,s[0],t,e,n,r)}}}}],ta=/^(true|false|\d+)$/,na=function(){return{restrict:"A",priority:100,compile:function(e,t){return ta.test(t.ngValue)?function(e,t,n){n.$set("value",e.$eval(n.ngValue))}:function(e,t,n){e.$watch(n.ngValue,function(e){n.$set("value",e)})}}}},ra=["$compile",function(e){return{restrict:"AC",compile:function(t){return e.$$addBindingClass(t),function(t,n,r){e.$$addBindingInfo(n,r.ngBind),n=n[0],t.$watch(r.ngBind,function(e){n.textContent=$(e)?"":e})}}}}],ia=["$interpolate","$compile",function(e,t){return{compile:function(n){return t.$$addBindingClass(n),function(n,r,i){var o=e(r.attr(i.$attr.ngBindTemplate));t.$$addBindingInfo(r,o.expressions),r=r[0],i.$observe("ngBindTemplate",function(e){r.textContent=$(e)?"":e})}}}}],oa=["$sce","$parse","$compile",function(e,t,n){return{restrict:"A",compile:function(r,i){var o=t(i.ngBindHtml),a=t(i.ngBindHtml,function(t){return e.valueOf(t)});return n.$$addBindingClass(r),function(t,r,i){n.$$addBindingInfo(r,i.ngBindHtml),t.$watch(a,function(){var n=o(t);r.html(e.getTrustedHtml(n)||"")})}}}}],aa=g({restrict:"A",require:"ngModel",link:function(e,t,n,r){r.$viewChangeListeners.push(function(){e.$eval(n.ngChange)})}}),sa=Er("",!0),ua=Er("Odd",0),la=Er("Even",1),ca=cr({compile:function(e,t){t.$set("ngCloak",void 0),e.removeClass("ng-cloak")}}),fa=[function(){return{restrict:"A",scope:!0,controller:"@",priority:500}}],da={},pa={blur:!0,focus:!0};r("click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress submit focus blur copy cut paste".split(" "),function(e){var t=vt("ng-"+e);da[t]=["$parse","$rootScope",function(n,r){return{restrict:"A",compile:function(i,o){var a=n(o[t],null,!0);return function(t,n){n.on(e,function(n){var i=function(){a(t,{$event:n})};pa[e]&&r.$$phase?t.$evalAsync(i):t.$apply(i)})}}}}]});var ha=["$animate","$compile",function(e,t){return{multiElement:!0,transclude:"element",priority:600,terminal:!0,restrict:"A",$$tlb:!0,link:function(n,r,i,o,a){var s,u,l;n.$watch(i.ngIf,function(n){n?u||a(function(n,o){u=o,n[n.length++]=t.$$createComment("end ngIf",i.ngIf),s={clone:n},e.enter(n,r.parent(),r)}):(l&&(l.remove(),l=null),u&&(u.$destroy(),u=null),s&&(l=pe(s.clone),e.leave(l).then(function(){l=null}),s=null))})}}}],ga=["$templateRequest","$anchorScroll","$animate",function(e,t,n){return{restrict:"ECA",priority:400,terminal:!0,transclude:"element",controller:Gr.noop,compile:function(r,i){var o=i.ngInclude||i.src,a=i.onload||"",s=i.autoscroll;return function(r,i,u,l,c){var f,d,p,h=0,g=function(){d&&(d.remove(),d=null),f&&(f.$destroy(),f=null),p&&(n.leave(p).then(function(){d=null}),d=p,p=null)};r.$watch(o,function(o){var u=function(){!m(s)||s&&!r.$eval(s)||t()},d=++h;o?(e(o,!0).then(function(e){if(!r.$$destroyed&&d===h){var t=r.$new();l.template=e;var s=c(t,function(e){g(),n.enter(e,null,i).then(u)});f=t,p=s,f.$emit("$includeContentLoaded",o),r.$eval(a)}},function(){r.$$destroyed||d===h&&(g(),r.$emit("$includeContentError",o))}),r.$emit("$includeContentRequested",o)):(g(),l.template=null)})}}}}],va=["$compile",function(t){return{restrict:"ECA",priority:-400,require:"ngInclude",link:function(n,r,i,o){return Hr.call(r[0]).match(/SVG/)?(r.empty(),void t(Ee(o.template,e.document).childNodes)(n,function(e){r.append(e)},{futureParentElement:r})):(r.html(o.template),void t(r.contents())(n))}}}],$a=cr({priority:450,compile:function(){return{pre:function(e,t,n){e.$eval(n.ngInit)}}}}),ma=function(){return{restrict:"A",priority:100,require:"ngModel",link:function(e,t,n,i){var o=t.attr(n.$attr.ngList)||", ",a="false"!==n.ngTrim,s=a?Zr(o):o,u=function(e){if(!$(e)){var t=[];return e&&r(e.split(s),function(e){e&&t.push(a?Zr(e):e)}),t}};i.$parsers.push(u),i.$formatters.push(function(e){if(Kr(e))return e.join(o)}),i.$isEmpty=function(e){return!e||!e.length}}}},ba="ng-valid",ya="ng-invalid",wa="ng-pristine",xa="ng-dirty",_a="ng-untouched",Sa="ng-touched",ka="ng-pending",Ea="ng-empty",Ca="ng-not-empty",Aa=t("ngModel"),Oa=["$scope","$exceptionHandler","$attrs","$element","$parse","$animate","$timeout","$rootScope","$q","$interpolate",function(e,t,n,i,o,a,s,u,l,c){this.$viewValue=Number.NaN,this.$modelValue=Number.NaN,this.$$rawModelValue=void 0,this.$validators={},this.$asyncValidators={},this.$parsers=[],this.$formatters=[],this.$viewChangeListeners=[],this.$untouched=!0,this.$touched=!1,this.$pristine=!0,this.$dirty=!1,this.$valid=!0,this.$invalid=!1,this.$error={},this.$$success={},this.$pending=void 0,this.$name=c(n.name||"",!1)(e),this.$$parentForm=Io;var f,d=o(n.ngModel),h=d.assign,g=d,v=h,b=null,y=this;this.$$setOptions=function(e){if(y.$options=e,e&&e.getterSetter){var t=o(n.ngModel+"()"),r=o(n.ngModel+"($$$p)");g=function(e){var n=d(e);return S(n)&&(n=t(e)),n},v=function(e,t){S(d(e))?r(e,{$$$p:t}):h(e,t)}}else if(!d.assign)throw Aa("nonassign","Expression '{0}' is non-assignable. Element: {1}",n.ngModel,Y(i))},this.$render=p,this.$isEmpty=function(e){return $(e)||""===e||null===e||e!==e},this.$$updateEmptyClasses=function(e){y.$isEmpty(e)?(a.removeClass(i,Ca),a.addClass(i,Ea)):(a.removeClass(i,Ea),a.addClass(i,Ca))};var w=0;Cr({ctrl:this,$element:i,set:function(e,t){e[t]=!0},unset:function(e,t){delete e[t]},$animate:a}),this.$setPristine=function(){y.$dirty=!1,y.$pristine=!0,a.removeClass(i,xa),a.addClass(i,wa)},this.$setDirty=function(){y.$dirty=!0,y.$pristine=!1,a.removeClass(i,wa),a.addClass(i,xa),y.$$parentForm.$setDirty()},this.$setUntouched=function(){y.$touched=!1,y.$untouched=!0,a.setClass(i,_a,Sa)},this.$setTouched=function(){y.$touched=!0,y.$untouched=!1,a.setClass(i,Sa,_a)},this.$rollbackViewValue=function(){s.cancel(b),y.$viewValue=y.$$lastCommittedViewValue,y.$render()},this.$validate=function(){if(!x(y.$modelValue)||!isNaN(y.$modelValue)){var e=y.$$lastCommittedViewValue,t=y.$$rawModelValue,n=y.$valid,r=y.$modelValue,i=y.$options&&y.$options.allowInvalid;y.$$runValidators(t,e,function(e){i||n===e||(y.$modelValue=e?t:void 0,y.$modelValue!==r&&y.$$writeModelToScope())})}},this.$$runValidators=function(e,t,n){function i(){var e=y.$$parserName||"parse";return $(f)?(s(e,null),!0):(f||(r(y.$validators,function(e,t){s(t,null)}),r(y.$asyncValidators,function(e,t){s(t,null)})),s(e,f),f)}function o(){var n=!0;return r(y.$validators,function(r,i){var o=r(e,t);n=n&&o,s(i,o)}),!!n||(r(y.$asyncValidators,function(e,t){s(t,null)}),!1)}function a(){var n=[],i=!0;r(y.$asyncValidators,function(r,o){var a=r(e,t);if(!P(a))throw Aa("nopromise","Expected asynchronous validator to return a promise but got '{0}' instead.",a);s(o,void 0),n.push(a.then(function(){s(o,!0)},function(){i=!1,s(o,!1)}))}),n.length?l.all(n).then(function(){u(i)},p):u(!0)}function s(e,t){c===w&&y.$setValidity(e,t)}function u(e){c===w&&n(e)}w++;var c=w;return i()&&o()?void a():void u(!1)},this.$commitViewValue=function(){var e=y.$viewValue;s.cancel(b),(y.$$lastCommittedViewValue!==e||""===e&&y.$$hasNativeValidators)&&(y.$$updateEmptyClasses(e),y.$$lastCommittedViewValue=e,y.$pristine&&this.$setDirty(),this.$$parseAndValidate())},this.$$parseAndValidate=function(){function t(){y.$modelValue!==o&&y.$$writeModelToScope()}var n=y.$$lastCommittedViewValue,r=n;if(f=!$(r)||void 0)for(var i=0;i<y.$parsers.length;i++)if(r=y.$parsers[i](r),$(r)){f=!1;break}x(y.$modelValue)&&isNaN(y.$modelValue)&&(y.$modelValue=g(e));var o=y.$modelValue,a=y.$options&&y.$options.allowInvalid;y.$$rawModelValue=r,a&&(y.$modelValue=r,t()),y.$$runValidators(r,y.$$lastCommittedViewValue,function(e){a||(y.$modelValue=e?r:void 0,t())})},this.$$writeModelToScope=function(){v(e,y.$modelValue),r(y.$viewChangeListeners,function(e){try{e()}catch(n){t(n)}})},this.$setViewValue=function(e,t){y.$viewValue=e,y.$options&&!y.$options.updateOnDefault||y.$$debounceViewValueCommit(t)},this.$$debounceViewValueCommit=function(t){var n,r=0,i=y.$options;i&&m(i.debounce)&&(n=i.debounce,x(n)?r=n:x(n[t])?r=n[t]:x(n["default"])&&(r=n["default"])),s.cancel(b),r?b=s(function(){y.$commitViewValue()},r):u.$$phase?y.$commitViewValue():e.$apply(function(){y.$commitViewValue()})},e.$watch(function(){var t=g(e);if(t!==y.$modelValue&&(y.$modelValue===y.$modelValue||t===t)){y.$modelValue=y.$$rawModelValue=t,f=void 0;for(var n=y.$formatters,r=n.length,i=t;r--;)i=n[r](i);y.$viewValue!==i&&(y.$$updateEmptyClasses(i),y.$viewValue=y.$$lastCommittedViewValue=i,y.$render(),y.$$runValidators(t,i,p))}return t})}],Ma=["$rootScope",function(e){return{restrict:"A",require:["ngModel","^?form","^?ngModelOptions"],controller:Oa,priority:1,compile:function(t){return t.addClass(wa).addClass(_a).addClass(ba),{pre:function(e,t,n,r){var i=r[0],o=r[1]||i.$$parentForm;i.$$setOptions(r[2]&&r[2].$options),o.$addControl(i),n.$observe("name",function(e){i.$name!==e&&i.$$parentForm.$$renameControl(i,e)}),e.$on("$destroy",function(){i.$$parentForm.$removeControl(i)})},post:function(t,n,r,i){var o=i[0];o.$options&&o.$options.updateOn&&n.on(o.$options.updateOn,function(e){o.$$debounceViewValueCommit(e&&e.type)}),n.on("blur",function(){o.$touched||(e.$$phase?t.$evalAsync(o.$setTouched):t.$apply(o.$setTouched))})}}}}}],ja=/(\s+|^)default(\s+|$)/,Pa=function(){return{restrict:"A",controller:["$scope","$attrs",function(e,t){var n=this;this.$options=U(e.$eval(t.ngModelOptions)),m(this.$options.updateOn)?(this.$options.updateOnDefault=!1,this.$options.updateOn=Zr(this.$options.updateOn.replace(ja,function(){return n.$options.updateOnDefault=!0," "}))):this.$options.updateOnDefault=!0}]}},Ta=cr({terminal:!0,priority:1e3}),Da=t("ngOptions"),Fa=/^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+group\s+by\s+([\s\S]+?))?(?:\s+disable\s+when\s+([\s\S]+?))?\s+for\s+(?:([\$\w][\$\w]*)|(?:\(\s*([\$\w][\$\w]*)\s*,\s*([\$\w][\$\w]*)\s*\)))\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?$/,Na=["$compile","$document","$parse",function(t,i,o){function a(e,t,r){function i(e,t,n,r,i){this.selectValue=e,this.viewValue=t,this.label=n,this.group=r,this.disabled=i}function a(e){var t;if(!l&&n(e))t=e;else{t=[];for(var r in e)e.hasOwnProperty(r)&&"$"!==r.charAt(0)&&t.push(r)}return t}var s=e.match(Fa);if(!s)throw Da("iexp","Expected expression in form of '_select_ (as _label_)? for (_key_,)?_value_ in _collection_' but got '{0}'. Element: {1}",e,Y(t));var u=s[5]||s[7],l=s[6],c=/ as /.test(s[0])&&s[1],f=s[9],d=o(s[2]?s[1]:u),p=c&&o(c),h=p||d,g=f&&o(f),v=f?function(e,t){return g(r,t)}:function(e){return Ze(e)},$=function(e,t){return v(e,_(e,t))},m=o(s[2]||s[1]),b=o(s[3]||""),y=o(s[4]||""),w=o(s[8]),x={},_=l?function(e,t){return x[l]=t,x[u]=e,x}:function(e){return x[u]=e,x};return{trackBy:f,getTrackByValue:$,getWatchables:o(w,function(e){var t=[];e=e||[];for(var n=a(e),i=n.length,o=0;o<i;o++){var u=e===n?o:n[o],l=e[u],c=_(l,u),f=v(l,c);if(t.push(f),s[2]||s[1]){var d=m(r,c);t.push(d)}if(s[4]){var p=y(r,c);t.push(p)}}return t}),getOptions:function(){for(var e=[],t={},n=w(r)||[],o=a(n),s=o.length,u=0;u<s;u++){var l=n===o?u:o[u],c=n[l],d=_(c,l),p=h(r,d),g=v(p,d),x=m(r,d),S=b(r,d),k=y(r,d),E=new i(g,p,x,S,k);e.push(E),t[g]=E}return{items:e,selectValueMap:t,getOptionFromViewValue:function(e){return t[$(e)]},getViewValueFromOption:function(e){return f?Gr.copy(e.viewValue):e.viewValue}}}}}function s(e,n,o,s){function c(e,t){var n=u.cloneNode(!1);t.appendChild(n),f(e,n)}function f(e,t){e.element=t,t.disabled=e.disabled,e.label!==t.label&&(t.label=e.label,t.textContent=e.label),e.value!==t.value&&(t.value=e.selectValue)}function d(){var e=_&&h.readValue();if(_)for(var t=_.items.length-1;t>=0;t--){var r=_.items[t];qe(m(r.group)?r.element.parentNode:r.element)}_=S.getOptions();var i={};if(w&&n.prepend(p),_.items.forEach(function(e){var t;m(e.group)?(t=i[e.group],t||(t=l.cloneNode(!1),k.appendChild(t),t.label=null===e.group?"null":e.group,i[e.group]=t),c(e,t)):c(e,k)}),n[0].appendChild(k),g.$render(),!g.$isEmpty(e)){var o=h.readValue(),a=S.trackBy||v;(a?V(e,o):e===o)||(g.$setViewValue(o),g.$render())}}for(var p,h=s[0],g=s[1],v=o.multiple,$=0,b=n.children(),y=b.length;$<y;$++)if(""===b[$].value){p=b.eq($);break}var w=!!p,x=Rr(u.cloneNode(!1));x.val("?");var _,S=a(o.ngOptions,n,e),k=i[0].createDocumentFragment(),E=function(){w||n.prepend(p),n.val(""),p.prop("selected",!0),p.attr("selected",!0)},C=function(){w||p.remove()},A=function(){n.prepend(x),n.val("?"),x.prop("selected",!0),x.attr("selected",!0)},O=function(){x.remove()};v?(g.$isEmpty=function(e){return!e||0===e.length},h.writeValue=function(e){_.items.forEach(function(e){e.element.selected=!1}),e&&e.forEach(function(e){var t=_.getOptionFromViewValue(e);t&&(t.element.selected=!0)})},h.readValue=function(){var e=n.val()||[],t=[];return r(e,function(e){var n=_.selectValueMap[e];n&&!n.disabled&&t.push(_.getViewValueFromOption(n))}),t},S.trackBy&&e.$watchCollection(function(){if(Kr(g.$viewValue))return g.$viewValue.map(function(e){return S.getTrackByValue(e)})},function(){g.$render()})):(h.writeValue=function(e){var t=_.getOptionFromViewValue(e);t?(n[0].value!==t.selectValue&&(O(),C(),n[0].value=t.selectValue,t.element.selected=!0),t.element.setAttribute("selected","selected")):null===e||w?(O(),E()):(C(),A())},h.readValue=function(){var e=_.selectValueMap[n.val()];return e&&!e.disabled?(C(),O(),_.getViewValueFromOption(e)):null},S.trackBy&&e.$watch(function(){return S.getTrackByValue(g.$viewValue)},function(){g.$render()})),w?(p.remove(),t(p)(e),p.removeClass("ng-scope")):p=Rr(u.cloneNode(!1)),n.empty(),d(),e.$watchCollection(S.getWatchables,d)}var u=e.document.createElement("option"),l=e.document.createElement("optgroup");return{restrict:"A",terminal:!0,require:["select","ngModel"],link:{pre:function(e,t,n,r){r[0].registerOption=p},post:s}}}],Ia=["$locale","$interpolate","$log",function(e,t,n){var i=/{}/g,o=/^when(Minus)?(.+)$/;return{link:function(a,s,u){function l(e){s.text(e||"")}var c,f=u.count,d=u.$attr.when&&s.attr(u.$attr.when),h=u.offset||0,g=a.$eval(d)||{},v={},m=t.startSymbol(),b=t.endSymbol(),y=m+f+"-"+h+b,w=Gr.noop;r(u,function(e,t){var n=o.exec(t);if(n){var r=(n[1]?"-":"")+Tr(n[2]);g[r]=s.attr(u.$attr[t])}}),r(g,function(e,n){v[n]=t(e.replace(i,y))}),a.$watch(f,function(t){var r=parseFloat(t),i=isNaN(r);if(i||r in g||(r=e.pluralCat(r-h)),r!==c&&!(i&&x(c)&&isNaN(c))){w();var o=v[r];$(o)?(null!=t&&n.debug("ngPluralize: no rule defined for '"+r+"' in "+d),w=p,l()):w=a.$watch(o,l),c=r}})}}}],Ra=["$parse","$animate","$compile",function(e,i,o){var a="$$NG_REMOVED",s=t("ngRepeat"),u=function(e,t,n,r,i,o,a){e[n]=r,i&&(e[i]=o),e.$index=t,e.$first=0===t,e.$last=t===a-1,e.$middle=!(e.$first||e.$last),e.$odd=!(e.$even=0===(1&t))},l=function(e){return e.clone[0]},c=function(e){return e.clone[e.clone.length-1]};return{restrict:"A",multiElement:!0,transclude:"element",priority:1e3,terminal:!0,$$tlb:!0,compile:function(t,f){var d=f.ngRepeat,p=o.$$createComment("end ngRepeat",d),h=d.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+track\s+by\s+([\s\S]+?))?\s*$/);if(!h)throw s("iexp","Expected expression in form of '_item_ in _collection_[ track by _id_]' but got '{0}'.",d);var g=h[1],v=h[2],$=h[3],m=h[4];if(h=g.match(/^(?:(\s*[\$\w]+)|\(\s*([\$\w]+)\s*,\s*([\$\w]+)\s*\))$/),!h)throw s("iidexp","'_item_' in '_item_ in _collection_' should be an identifier or '(_key_, _value_)' expression, but got '{0}'.",g);var b=h[3]||h[1],y=h[2];if($&&(!/^[$a-zA-Z_][$a-zA-Z0-9_]*$/.test($)||/^(null|undefined|this|\$index|\$first|\$middle|\$last|\$even|\$odd|\$parent|\$root|\$id)$/.test($)))throw s("badident","alias '{0}' is invalid --- must be a valid JS identifier which is not a reserved name.",$);var w,x,_,S,k={$id:Ze};return m?w=e(m):(_=function(e,t){return Ze(t)},S=function(e){return e}),function(e,t,o,f,h){w&&(x=function(t,n,r){return y&&(k[y]=t),k[b]=n,k.$index=r,w(e,k)});var g=he();e.$watchCollection(v,function(o){var f,v,m,w,k,E,C,A,O,M,j,P,T=t[0],D=he();if($&&(e[$]=o),n(o))O=o,A=x||_;else{A=x||S,O=[];for(var F in o)Pr.call(o,F)&&"$"!==F.charAt(0)&&O.push(F)}for(w=O.length,j=new Array(w),f=0;f<w;f++)if(k=o===O?f:O[f],E=o[k],C=A(k,E,f),g[C])M=g[C],delete g[C],D[C]=M,j[f]=M;else{if(D[C])throw r(j,function(e){e&&e.scope&&(g[e.id]=e)}),s("dupes","Duplicates in a repeater are not allowed. Use 'track by' expression to specify unique keys. Repeater: {0}, Duplicate key: {1}, Duplicate value: {2}",d,C,E);j[f]={id:C,scope:void 0,clone:void 0},D[C]=!0}for(var N in g){if(M=g[N],P=pe(M.clone),i.leave(P),P[0].parentNode)for(f=0,v=P.length;f<v;f++)P[f][a]=!0;M.scope.$destroy()}for(f=0;f<w;f++)if(k=o===O?f:O[f],E=o[k],M=j[f],M.scope){m=T;do m=m.nextSibling;while(m&&m[a]);l(M)!=m&&i.move(pe(M.clone),null,T),T=c(M),u(M.scope,f,b,E,y,k,w)}else h(function(e,t){M.scope=t;var n=p.cloneNode(!1);e[e.length++]=n,i.enter(e,null,T),T=n,M.clone=e,D[M.id]=M,u(M.scope,f,b,E,y,k,w)});g=D})}}}}],Ua="ng-hide",Va="ng-hide-animate",za=["$animate",function(e){return{restrict:"A",multiElement:!0,link:function(t,n,r){t.$watch(r.ngShow,function(t){e[t?"removeClass":"addClass"](n,Ua,{tempClasses:Va})})}}}],La=["$animate",function(e){return{restrict:"A",multiElement:!0,link:function(t,n,r){t.$watch(r.ngHide,function(t){e[t?"addClass":"removeClass"](n,Ua,{tempClasses:Va})})}}}],qa=cr(function(e,t,n){e.$watch(n.ngStyle,function(e,n){n&&e!==n&&r(n,function(e,n){t.css(n,"")}),e&&t.css(e)},!0)}),Ha=["$animate","$compile",function(e,t){return{require:"ngSwitch",controller:["$scope",function(){this.cases={}}],link:function(n,i,o,a){var s=o.ngSwitch||o.on,u=[],l=[],c=[],f=[],d=function(e,t){return function(){e.splice(t,1)}};n.$watch(s,function(n){var i,o;for(i=0,o=c.length;i<o;++i)e.cancel(c[i]);for(c.length=0,i=0,o=f.length;i<o;++i){var s=pe(l[i].clone);f[i].$destroy();var p=c[i]=e.leave(s);p.then(d(c,i))}l.length=0,f.length=0,(u=a.cases["!"+n]||a.cases["?"])&&r(u,function(n){n.transclude(function(r,i){f.push(i);var o=n.element;r[r.length++]=t.$$createComment("end ngSwitchWhen");var a={clone:r};l.push(a),e.enter(r,o.parent(),o)})})})}}}],Ba=cr({transclude:"element",priority:1200,require:"^ngSwitch",multiElement:!0,link:function(e,t,n,r,i){r.cases["!"+n.ngSwitchWhen]=r.cases["!"+n.ngSwitchWhen]||[],r.cases["!"+n.ngSwitchWhen].push({transclude:i,element:t})}}),Wa=cr({transclude:"element",priority:1200,require:"^ngSwitch",multiElement:!0,link:function(e,t,n,r,i){r.cases["?"]=r.cases["?"]||[],r.cases["?"].push({transclude:i,element:t})}}),Ga=t("ngTransclude"),Xa=["$compile",function(e){return{restrict:"EAC",terminal:!0,compile:function(t){var n=e(t.contents());return t.empty(),function(e,t,r,i,o){function a(e,n){e.length?t.append(e):(s(),n.$destroy())}function s(){n(e,function(e){t.append(e)})}if(!o)throw Ga("orphan","Illegal use of ngTransclude directive in the template! No parent directive that requires a transclusion found. Element: {0}",Y(t));r.ngTransclude===r.$attr.ngTransclude&&(r.ngTransclude="");var u=r.ngTransclude||r.ngTranscludeSlot;o(a,null,u),u&&!o.isSlotFilled(u)&&s()}}}}],Ka=["$templateCache",function(e){return{restrict:"E",terminal:!0,compile:function(t,n){if("text/ng-template"==n.type){var r=n.id,i=t[0].text;e.put(r,i)}}}}],Ya={$setViewValue:p,$render:p},Za=["$element","$scope",function(t,n){var r=this,i=new Je;r.ngModelCtrl=Ya,r.unknownOption=Rr(e.document.createElement("option")),r.renderUnknownOption=function(e){var n="? "+Ze(e)+" ?";r.unknownOption.val(n),t.prepend(r.unknownOption),t.val(n)},n.$on("$destroy",function(){r.renderUnknownOption=p}),r.removeUnknownOption=function(){r.unknownOption.parent()&&r.unknownOption.remove()},r.readValue=function(){return r.removeUnknownOption(),t.val()},r.writeValue=function(e){r.hasOption(e)?(r.removeUnknownOption(),t.val(e),""===e&&r.emptyOption.prop("selected",!0)):null==e&&r.emptyOption?(r.removeUnknownOption(),t.val("")):r.renderUnknownOption(e)},r.addOption=function(e,t){if(t[0].nodeType!==ui){fe(e,'"option value"'),""===e&&(r.emptyOption=t);var n=i.get(e)||0;i.put(e,n+1),r.ngModelCtrl.$render(),Or(t)}},r.removeOption=function(e){var t=i.get(e);t&&(1===t?(i.remove(e),""===e&&(r.emptyOption=void 0)):i.put(e,t-1))},r.hasOption=function(e){return!!i.get(e)},r.registerOption=function(e,t,n,i,o){if(i){var a;n.$observe("value",function(e){m(a)&&r.removeOption(a),a=e,r.addOption(e,t)})}else o?e.$watch(o,function(e,i){n.$set("value",e),i!==e&&r.removeOption(i),r.addOption(e,t)}):r.addOption(n.value,t);t.on("$destroy",function(){r.removeOption(n.value),r.ngModelCtrl.$render()})}}],Ja=function(){function e(e,t,n,i){var o=i[1];if(o){var a=i[0];if(a.ngModelCtrl=o,t.on("change",function(){e.$apply(function(){o.$setViewValue(a.readValue())})}),n.multiple){a.readValue=function(){var e=[];return r(t.find("option"),function(t){t.selected&&e.push(t.value)}),e},a.writeValue=function(e){var n=new Je(e);r(t.find("option"),function(e){e.selected=m(n.get(e.value))})};var s,u=NaN;e.$watch(function(){u!==o.$viewValue||V(s,o.$viewValue)||(s=ve(o.$viewValue),o.$render()),u=o.$viewValue}),o.$isEmpty=function(e){return!e||0===e.length}}}}function t(e,t,n,r){var i=r[1];if(i){var o=r[0];i.$render=function(){o.writeValue(i.$viewValue)}}}return{restrict:"E",require:["select","?ngModel"],controller:Za,priority:1,link:{pre:e,post:t}}},Qa=["$interpolate",function(e){return{restrict:"E",priority:100,compile:function(t,n){if(m(n.value))var r=e(n.value,!0);else{var i=e(t.text(),!0);i||n.$set("value",t.text())}return function(e,t,n){var o="$selectController",a=t.parent(),s=a.data(o)||a.parent().data(o);s&&s.registerOption(e,t,n,r,i)}}}}],es=g({restrict:"E",terminal:!1}),ts=function(){return{restrict:"A",require:"?ngModel",link:function(e,t,n,r){r&&(n.required=!0,r.$validators.required=function(e,t){return!n.required||!r.$isEmpty(t)},n.$observe("required",function(){r.$validate()}))}}},ns=function(){return{restrict:"A",require:"?ngModel",link:function(e,n,r,i){if(i){var o,a=r.ngPattern||r.pattern;r.$observe("pattern",function(e){if(w(e)&&e.length>0&&(e=new RegExp("^"+e+"$")),e&&!e.test)throw t("ngPattern")("noregexp","Expected {0} to be a RegExp but was {1}. Element: {2}",a,e,Y(n));o=e||void 0,i.$validate()}),i.$validators.pattern=function(e,t){return i.$isEmpty(t)||$(o)||o.test(t)}}}}},rs=function(){return{restrict:"A",require:"?ngModel",link:function(e,t,n,r){if(r){var i=-1;n.$observe("maxlength",function(e){var t=f(e);i=isNaN(t)?-1:t,r.$validate()}),r.$validators.maxlength=function(e,t){return i<0||r.$isEmpty(t)||t.length<=i}}}}},is=function(){return{restrict:"A",require:"?ngModel",link:function(e,t,n,r){if(r){var i=0;n.$observe("minlength",function(e){i=f(e)||0,r.$validate()}),r.$validators.minlength=function(e,t){return r.$isEmpty(t)||t.length>=i}}}}};return e.angular.bootstrap?void(e.console&&console.log("WARNING: Tried to load angular more than once.")):(ue(),be(Gr),Gr.module("ngLocale",[],["$provide",function(e){function t(e){e+="";var t=e.indexOf(".");return t==-1?0:e.length-t-1}function n(e,n){var r=n;void 0===r&&(r=Math.min(t(e),3));var i=Math.pow(10,r),o=(e*i|0)%i;return{v:r,f:o}}var r={ZERO:"zero",ONE:"one",TWO:"two",FEW:"few",MANY:"many",OTHER:"other"};e.value("$locale",{DATETIME_FORMATS:{AMPMS:["AM","PM"],DAY:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],ERANAMES:["Before Christ","Anno Domini"],ERAS:["BC","AD"],FIRSTDAYOFWEEK:6,MONTH:["January","February","March","April","May","June","July","August","September","October","November","December"],SHORTDAY:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],SHORTMONTH:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],STANDALONEMONTH:["January","February","March","April","May","June","July","August","September","October","November","December"],WEEKENDRANGE:[5,6],fullDate:"EEEE, MMMM d, y",longDate:"MMMM d, y",medium:"MMM d, y h:mm:ss a",mediumDate:"MMM d, y",mediumTime:"h:mm:ss a","short":"M/d/yy h:mm a",shortDate:"M/d/yy",shortTime:"h:mm a"},NUMBER_FORMATS:{CURRENCY_SYM:"$",DECIMAL_SEP:".",GROUP_SEP:",",PATTERNS:[{gSize:3,lgSize:3,maxFrac:3,minFrac:0,minInt:1,negPre:"-",negSuf:"",posPre:"",posSuf:""},{gSize:3,lgSize:3,maxFrac:2,minFrac:2,minInt:1,negPre:"-¤",negSuf:"",posPre:"¤",posSuf:""}]},id:"en-us",localeID:"en_US",pluralCat:function(e,t){var i=0|e,o=n(e,t);return 1==i&&0==o.v?r.ONE:r.OTHER}})}]),void Rr(e.document).ready(function(){re(e.document,ie)}))}(window),!window.angular.$$csp().noInlineStyle&&window.angular.element(document.head).prepend('<style type="text/css">@charset "UTF-8";[ng\\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak,.ng-hide:not(.ng-hide-animate){display:none !important;}ng\\:form{display:block;}.ng-animate-shim{visibility:hidden;}.ng-anchor{position:absolute;}</style>')},{}],41:[function(e,t,n){e("./angular"),t.exports=angular},{"./angular":40}],42:[function(e,t,n){!function(){function e(e,t){window.XMLHttpRequest.prototype[e]=t(window.XMLHttpRequest.prototype[e])}function t(e,t,n){try{Object.defineProperty(e,t,{get:n})}catch(r){}}if(window.FileAPI||(window.FileAPI={}),!window.XMLHttpRequest)throw"AJAX is not supported. XMLHttpRequest is not defined.";if(FileAPI.shouldLoad=!window.FormData||FileAPI.forceLoad,FileAPI.shouldLoad){var n=function(e){if(!e.__listeners){e.upload||(e.upload={}),e.__listeners=[];var t=e.upload.addEventListener;e.upload.addEventListener=function(n,r){e.__listeners[n]=r,t&&t.apply(this,arguments)}}};e("open",function(e){return function(t,r,i){n(this),this.__url=r;try{e.apply(this,[t,r,i])}catch(o){o.message.indexOf("Access is denied")>-1&&(this.__origError=o,e.apply(this,[t,"_fix_for_ie_crossdomain__",i]))}}}),e("getResponseHeader",function(e){return function(t){return this.__fileApiXHR&&this.__fileApiXHR.getResponseHeader?this.__fileApiXHR.getResponseHeader(t):null==e?null:e.apply(this,[t])}}),e("getAllResponseHeaders",function(e){return function(){return this.__fileApiXHR&&this.__fileApiXHR.getAllResponseHeaders?this.__fileApiXHR.getAllResponseHeaders():null==e?null:e.apply(this)}}),e("abort",function(e){return function(){return this.__fileApiXHR&&this.__fileApiXHR.abort?this.__fileApiXHR.abort():null==e?null:e.apply(this)}}),e("setRequestHeader",function(e){return function(t,r){if("__setXHR_"===t){n(this);var i=r(this);i instanceof Function&&i(this)}else this.__requestHeaders=this.__requestHeaders||{},this.__requestHeaders[t]=r,e.apply(this,arguments)}}),e("send",function(e){return function(){var n=this;if(arguments[0]&&arguments[0].__isFileAPIShim){var r=arguments[0],i={url:n.__url,jsonp:!1,cache:!0,complete:function(e,r){e&&angular.isString(e)&&e.indexOf("#2174")!==-1&&(e=null),n.__completed=!0,!e&&n.__listeners.load&&n.__listeners.load({type:"load",loaded:n.__loaded,total:n.__total,target:n,lengthComputable:!0}),!e&&n.__listeners.loadend&&n.__listeners.loadend({type:"loadend",loaded:n.__loaded,total:n.__total,target:n,lengthComputable:!0}),"abort"===e&&n.__listeners.abort&&n.__listeners.abort({type:"abort",loaded:n.__loaded,total:n.__total,target:n,lengthComputable:!0}),void 0!==r.status&&t(n,"status",function(){return 0===r.status&&e&&"abort"!==e?500:r.status}),void 0!==r.statusText&&t(n,"statusText",function(){return r.statusText}),t(n,"readyState",function(){return 4}),void 0!==r.response&&t(n,"response",function(){return r.response});var i=r.responseText||(e&&0===r.status&&"abort"!==e?e:void 0);t(n,"responseText",function(){return i}),t(n,"response",function(){return i}),e&&t(n,"err",function(){return e}),n.__fileApiXHR=r,n.onreadystatechange&&n.onreadystatechange(),n.onload&&n.onload()},progress:function(e){if(e.target=n,n.__listeners.progress&&n.__listeners.progress(e),n.__total=e.total,n.__loaded=e.loaded,e.total===e.loaded){var t=this;setTimeout(function(){n.__completed||(n.getAllResponseHeaders=function(){},t.complete(null,{status:204,statusText:"No Content"}))},FileAPI.noContentTimeout||1e4)}},headers:n.__requestHeaders};i.data={},i.files={};for(var o=0;o<r.data.length;o++){var a=r.data[o];null!=a.val&&null!=a.val.name&&null!=a.val.size&&null!=a.val.type?i.files[a.key]=a.val:i.data[a.key]=a.val}setTimeout(function(){if(!FileAPI.hasFlash)throw'Adode Flash Player need to be installed. To check ahead use "FileAPI.hasFlash"';n.__fileApiXHR=FileAPI.upload(i)},1)}else{if(this.__origError)throw this.__origError;e.apply(n,arguments)}}}),window.XMLHttpRequest.__isFileAPIShim=!0,window.FormData=FormData=function(){return{append:function(e,t,n){t.__isFileAPIBlobShim&&(t=t.data[0]),this.data.push({key:e,val:t,name:n})},data:[],__isFileAPIShim:!0}},window.Blob=Blob=function(e){return{data:e,__isFileAPIBlobShim:!0}}}}(),function(){function e(e){return"input"===e[0].tagName.toLowerCase()&&e.attr("type")&&"file"===e.attr("type").toLowerCase()}function t(){try{var e=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");if(e)return!0}catch(t){if(void 0!==navigator.mimeTypes["application/x-shockwave-flash"])return!0}return!1}function n(e){var t=0,n=0;if(window.jQuery)return jQuery(e).offset();if(e.offsetParent)do t+=e.offsetLeft-e.scrollLeft,n+=e.offsetTop-e.scrollTop,e=e.offsetParent;while(e);return{left:t,top:n}}if(FileAPI.shouldLoad){if(FileAPI.hasFlash=t(),FileAPI.forceLoad&&(FileAPI.html5=!1),!FileAPI.upload){var r,i,o,a,s,u=document.createElement("script"),l=document.getElementsByTagName("script");if(window.FileAPI.jsUrl)r=window.FileAPI.jsUrl;else if(window.FileAPI.jsPath)i=window.FileAPI.jsPath;else for(o=0;o<l.length;o++)if(s=l[o].src,a=s.search(/\/ng\-file\-upload[\-a-zA-z0-9\.]*\.js/),a>-1){i=s.substring(0,a+1);break}null==FileAPI.staticPath&&(FileAPI.staticPath=i),u.setAttribute("src",r||i+"FileAPI.min.js"),document.getElementsByTagName("head")[0].appendChild(u)}FileAPI.ngfFixIE=function(r,i,o){if(!t())throw'Adode Flash Player need to be installed. To check ahead use "FileAPI.hasFlash"';var a=function(){var t=i.parent();r.attr("disabled")?t&&t.removeClass("js-fileapi-wrapper"):(i.attr("__ngf_flash_")||(i.unbind("change"),i.unbind("click"),i.bind("change",function(e){s.apply(this,[e]),o.apply(this,[e])}),i.attr("__ngf_flash_","true")),t.addClass("js-fileapi-wrapper"),e(r)||(t.css("position","absolute").css("top",n(r[0]).top+"px").css("left",n(r[0]).left+"px").css("width",r[0].offsetWidth+"px").css("height",r[0].offsetHeight+"px").css("filter","alpha(opacity=0)").css("display",r.css("display")).css("overflow","hidden").css("z-index","900000").css("visibility","visible"),i.css("width",r[0].offsetWidth+"px").css("height",r[0].offsetHeight+"px").css("position","absolute").css("top","0px").css("left","0px")))};r.bind("mouseenter",a);var s=function(e){for(var t=FileAPI.getFiles(e),n=0;n<t.length;n++)void 0===t[n].size&&(t[n].size=0),void 0===t[n].name&&(t[n].name="file"),void 0===t[n].type&&(t[n].type="undefined");e.target||(e.target={}),e.target.files=t,e.target.files!==t&&(e.__files_=t),(e.__files_||e.target.files).item=function(t){return(e.__files_||e.target.files)[t]||null}}},FileAPI.disableFileInput=function(e,t){t?e.removeClass("js-fileapi-wrapper"):e.addClass("js-fileapi-wrapper")}}}(),window.FileReader||(window.FileReader=function(){var e=this,t=!1;this.listeners={},this.addEventListener=function(t,n){e.listeners[t]=e.listeners[t]||[],e.listeners[t].push(n)},this.removeEventListener=function(t,n){e.listeners[t]&&e.listeners[t].splice(e.listeners[t].indexOf(n),1)},this.dispatchEvent=function(t){var n=e.listeners[t.type];if(n)for(var r=0;r<n.length;r++)n[r].call(e,t)},this.onabort=this.onerror=this.onload=this.onloadstart=this.onloadend=this.onprogress=null;var n=function(t,n){var r={type:t,target:e,loaded:n.loaded,total:n.total,error:n.error};return null!=n.result&&(r.target.result=n.result),r},r=function(r){
|
8 |
+
t||(t=!0,e.onloadstart&&e.onloadstart(n("loadstart",r)));var i;"load"===r.type?(e.onloadend&&e.onloadend(n("loadend",r)),i=n("load",r),e.onload&&e.onload(i),e.dispatchEvent(i)):"progress"===r.type?(i=n("progress",r),e.onprogress&&e.onprogress(i),e.dispatchEvent(i)):(i=n("error",r),e.onerror&&e.onerror(i),e.dispatchEvent(i))};this.readAsDataURL=function(e){FileAPI.readAsDataURL(e,r)},this.readAsText=function(e){FileAPI.readAsText(e,r)}}),!window.XMLHttpRequest||window.FileAPI&&FileAPI.shouldLoad||(window.XMLHttpRequest.prototype.setRequestHeader=function(e){return function(t,n){if("__setXHR_"===t){var r=n(this);r instanceof Function&&r(this)}else e.apply(this,arguments)}}(window.XMLHttpRequest.prototype.setRequestHeader));var r=angular.module("ngFileUpload",[]);r.version="12.2.12",r.service("UploadBase",["$http","$q","$timeout",function(e,t,n){function i(r){function i(e){l.notify&&l.notify(e),c.progressFunc&&n(function(){c.progressFunc(e)})}function o(e){return null!=r._start&&s?{loaded:e.loaded+r._start,total:r._file&&r._file.size||e.total,type:e.type,config:r,lengthComputable:!0,target:e.target}:e}function u(){e(r).then(function(e){if(s&&r._chunkSize&&!r._finished&&r._file){var t=r._file&&r._file.size||0;i({loaded:Math.min(r._end,t),total:t,config:r,type:"progress"}),a.upload(r,!0)}else r._finished&&delete r._finished,l.resolve(e)},function(e){l.reject(e)},function(e){l.notify(e)})}r.method=r.method||"POST",r.headers=r.headers||{};var l=r._deferred=r._deferred||t.defer(),c=l.promise;return r.disableProgress||(r.headers.__setXHR_=function(){return function(e){e&&e.upload&&e.upload.addEventListener&&(r.__XHR=e,r.xhrFn&&r.xhrFn(e),e.upload.addEventListener("progress",function(e){e.config=r,i(o(e))},!1),e.upload.addEventListener("load",function(e){e.lengthComputable&&(e.config=r,i(o(e)))},!1))}}),s?r._chunkSize&&r._end&&!r._finished?(r._start=r._end,r._end+=r._chunkSize,u()):r.resumeSizeUrl?e.get(r.resumeSizeUrl).then(function(e){r.resumeSizeResponseReader?r._start=r.resumeSizeResponseReader(e.data):r._start=parseInt((null==e.data.size?e.data:e.data.size).toString()),r._chunkSize&&(r._end=r._start+r._chunkSize),u()},function(e){throw e}):r.resumeSize?r.resumeSize().then(function(e){r._start=e,r._chunkSize&&(r._end=r._start+r._chunkSize),u()},function(e){throw e}):(r._chunkSize&&(r._start=0,r._end=r._start+r._chunkSize),u()):u(),c.success=function(e){return c.then(function(t){e(t.data,t.status,t.headers,r)}),c},c.error=function(e){return c.then(null,function(t){e(t.data,t.status,t.headers,r)}),c},c.progress=function(e){return c.progressFunc=e,c.then(null,null,function(t){e(t)}),c},c.abort=c.pause=function(){return r.__XHR&&n(function(){r.__XHR.abort()}),c},c.xhr=function(e){return r.xhrFn=function(t){return function(){t&&t.apply(c,arguments),e.apply(c,arguments)}}(r.xhrFn),c},a.promisesCount++,c["finally"]&&c["finally"]instanceof Function&&c["finally"](function(){a.promisesCount--}),c}function o(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}var a=this;a.promisesCount=0,this.isResumeSupported=function(){return window.Blob&&window.Blob.prototype.slice};var s=this.isResumeSupported();this.isUploadInProgress=function(){return a.promisesCount>0},this.rename=function(e,t){return e.ngfName=t,e},this.jsonBlob=function(e){null==e||angular.isString(e)||(e=JSON.stringify(e));var t=new window.Blob([e],{type:"application/json"});return t._ngfBlob=!0,t},this.json=function(e){return angular.toJson(e)},this.isFile=function(e){return null!=e&&(e instanceof window.Blob||e.flashId&&e.name&&e.size)},this.upload=function(e,t){function n(t,n){if(t._ngfBlob)return t;if(e._file=e._file||t,null!=e._start&&s){e._end&&e._end>=t.size&&(e._finished=!0,e._end=t.size);var r=t.slice(e._start,e._end||t.size);return r.name=t.name,r.ngfName=t.ngfName,e._chunkSize&&(n.append("_chunkSize",e._chunkSize),n.append("_currentChunkSize",e._end-e._start),n.append("_chunkNumber",Math.floor(e._start/e._chunkSize)),n.append("_totalSize",e._file.size)),r}return t}function r(t,i,o){if(void 0!==i)if(angular.isDate(i)&&(i=i.toISOString()),angular.isString(i))t.append(o,i);else if(a.isFile(i)){var s=n(i,t),u=o.split(",");u[1]&&(s.ngfName=u[1].replace(/^\s+|\s+$/g,""),o=u[0]),e._fileKey=e._fileKey||o,t.append(o,s,s.ngfName||s.name)}else if(angular.isObject(i)){if(i.$$ngfCircularDetection)throw"ngFileUpload: Circular reference in config.data. Make sure specified data for Upload.upload() has no circular reference: "+o;i.$$ngfCircularDetection=!0;try{for(var l in i)if(i.hasOwnProperty(l)&&"$$ngfCircularDetection"!==l){var c=null==e.objectKey?"[i]":e.objectKey;i.length&&parseInt(l)>-1&&(c=null==e.arrayKey?c:e.arrayKey),r(t,i[l],o+c.replace(/[ik]/g,l))}}finally{delete i.$$ngfCircularDetection}}else t.append(o,i)}function u(){e._chunkSize=a.translateScalars(e.resumeChunkSize),e._chunkSize=e._chunkSize?parseInt(e._chunkSize.toString()):null,e.headers=e.headers||{},e.headers["Content-Type"]=void 0,e.transformRequest=e.transformRequest?angular.isArray(e.transformRequest)?e.transformRequest:[e.transformRequest]:[],e.transformRequest.push(function(t){var n,i=new window.FormData;t=t||e.fields||{},e.file&&(t.file=e.file);for(n in t)if(t.hasOwnProperty(n)){var o=t[n];e.formDataAppender?e.formDataAppender(i,n,o):r(i,o,n)}return i})}return t||(e=o(e)),e._isDigested||(e._isDigested=!0,u()),i(e)},this.http=function(t){return t=o(t),t.transformRequest=t.transformRequest||function(t){return window.ArrayBuffer&&t instanceof window.ArrayBuffer||t instanceof window.Blob?t:e.defaults.transformRequest[0].apply(this,arguments)},t._chunkSize=a.translateScalars(t.resumeChunkSize),t._chunkSize=t._chunkSize?parseInt(t._chunkSize.toString()):null,i(t)},this.translateScalars=function(e){if(angular.isString(e)){if(e.search(/kb/i)===e.length-2)return parseFloat(1024*e.substring(0,e.length-2));if(e.search(/mb/i)===e.length-2)return parseFloat(1048576*e.substring(0,e.length-2));if(e.search(/gb/i)===e.length-2)return parseFloat(1073741824*e.substring(0,e.length-2));if(e.search(/b/i)===e.length-1)return parseFloat(e.substring(0,e.length-1));if(e.search(/s/i)===e.length-1)return parseFloat(e.substring(0,e.length-1));if(e.search(/m/i)===e.length-1)return parseFloat(60*e.substring(0,e.length-1));if(e.search(/h/i)===e.length-1)return parseFloat(3600*e.substring(0,e.length-1))}return e},this.urlToBlob=function(n){var r=t.defer();return e({url:n,method:"get",responseType:"arraybuffer"}).then(function(e){var t=new Uint8Array(e.data),i=e.headers("content-type")||"image/WebP",o=new window.Blob([t],{type:i}),a=n.match(/.*\/(.+?)(\?.*)?$/);a.length>1&&(o.name=a[1]),r.resolve(o)},function(e){r.reject(e)}),r.promise},this.setDefaults=function(e){this.defaults=e||{}},this.defaults={},this.version=r.version}]),r.service("Upload",["$parse","$timeout","$compile","$q","UploadExif",function(e,t,n,r,i){function o(e,t,n){var i=[u.emptyPromise()];return angular.forEach(e,function(r,o){0===r.type.indexOf("image/jpeg")&&u.attrGetter("ngfFixOrientation",t,n,{$file:r})&&i.push(u.happyPromise(u.applyExifRotation(r),r).then(function(t){e.splice(o,1,t)}))}),r.all(i)}function a(e,t,n,i){var o=u.attrGetter("ngfResize",t,n);if(!o||!u.isResizeSupported()||!e.length)return u.emptyPromise();if(o instanceof Function){var a=r.defer();return o(e).then(function(r){s(r,e,t,n,i).then(function(e){a.resolve(e)},function(e){a.reject(e)})},function(e){a.reject(e)})}return s(o,e,t,n,i)}function s(e,t,n,i,o){function a(r,a){if(0===r.type.indexOf("image")){if(e.pattern&&!u.validatePattern(r,e.pattern))return;e.resizeIf=function(e,t){return u.attrGetter("ngfResizeIf",n,i,{$width:e,$height:t,$file:r})};var l=u.resize(r,e);s.push(l),l.then(function(e){t.splice(a,1,e)},function(e){r.$error="resize",(r.$errorMessages=r.$errorMessages||{}).resize=!0,r.$errorParam=(e?(e.message?e.message:e)+": ":"")+(r&&r.name),o.$ngfValidations.push({name:"resize",valid:!1}),u.applyModelValidation(o,t)})}}for(var s=[u.emptyPromise()],l=0;l<t.length;l++)a(t[l],l);return r.all(s)}var u=i;return u.getAttrWithDefaults=function(e,t){if(null!=e[t])return e[t];var n=u.defaults[t];return null==n?n:angular.isString(n)?n:JSON.stringify(n)},u.attrGetter=function(t,n,r,i){var o=this.getAttrWithDefaults(n,t);if(!r)return o;try{return i?e(o)(r,i):e(o)(r)}catch(a){if(t.search(/min|max|pattern/i))return o;throw a}},u.shouldUpdateOn=function(e,t,n){var r=u.attrGetter("ngfModelOptions",t,n);return!r||!r.updateOn||r.updateOn.split(" ").indexOf(e)>-1},u.emptyPromise=function(){var e=r.defer(),n=arguments;return t(function(){e.resolve.apply(e,n)}),e.promise},u.rejectPromise=function(){var e=r.defer(),n=arguments;return t(function(){e.reject.apply(e,n)}),e.promise},u.happyPromise=function(e,n){var i=r.defer();return e.then(function(e){i.resolve(e)},function(e){t(function(){throw e}),i.resolve(n)}),i.promise},u.updateModel=function(n,r,i,s,l,c,f){function d(o,a,l,f,d){r.$$ngfPrevValidFiles=o,r.$$ngfPrevInvalidFiles=a;var p=o&&o.length?o[0]:null,h=a&&a.length?a[0]:null;n&&(u.applyModelValidation(n,o),n.$setViewValue(d?p:o)),s&&e(s)(i,{$files:o,$file:p,$newFiles:l,$duplicateFiles:f,$invalidFiles:a,$invalidFile:h,$event:c});var g=u.attrGetter("ngfModelInvalid",r);g&&t(function(){e(g).assign(i,d?h:a)}),t(function(){})}function p(){function e(e,t){return e.name===t.name&&(e.$ngfOrigSize||e.size)===(t.$ngfOrigSize||t.size)&&e.type===t.type}function t(t){var n;for(n=0;n<$.length;n++)if(e(t,$[n]))return!0;for(n=0;n<m.length;n++)if(e(t,m[n]))return!0;return!1}if(l){v=[],b=[];for(var n=0;n<l.length;n++)t(l[n])?b.push(l[n]):v.push(l[n])}}function h(e){return angular.isArray(e)?e:[e]}function g(){function e(){t(function(){d(x?$.concat(w):w,x?m.concat(y):y,l,b,_)},k&&k.debounce?k.debounce.change||k.debounce:0)}var o=S?v:w;a(o,r,i,n).then(function(){S?u.validate(v,x?$.length:0,n,r,i).then(function(t){w=t.validsFiles,y=t.invalidsFiles,e()}):e()},function(){for(var t=0;t<o.length;t++){var n=o[t];if("resize"===n.$error){var r=w.indexOf(n);r>-1&&(w.splice(r,1),y.push(n)),e()}}})}var v,$,m,b=[],y=[],w=[];$=r.$$ngfPrevValidFiles||[],m=r.$$ngfPrevInvalidFiles||[],n&&n.$modelValue&&($=h(n.$modelValue));var x=u.attrGetter("ngfKeep",r,i);v=(l||[]).slice(0),"distinct"!==x&&u.attrGetter("ngfKeepDistinct",r,i)!==!0||p(r,i);var _=!x&&!u.attrGetter("ngfMultiple",r,i)&&!u.attrGetter("multiple",r);if(!x||v.length){u.attrGetter("ngfBeforeModelChange",r,i,{$files:l,$file:l&&l.length?l[0]:null,$newFiles:v,$duplicateFiles:b,$event:c});var S=u.attrGetter("ngfValidateAfterResize",r,i),k=u.attrGetter("ngfModelOptions",r,i);u.validate(v,x?$.length:0,n,r,i).then(function(e){f?d(v,[],l,b,_):(k&&k.allowInvalid||S?w=v:(w=e.validFiles,y=e.invalidFiles),u.attrGetter("ngfFixOrientation",r,i)&&u.isExifSupported()?o(w,r,i).then(function(){g()}):g())})}},u}]),r.directive("ngfSelect",["$parse","$timeout","$compile","Upload",function(e,t,n,r){function i(e){var t=e.match(/Android[^\d]*(\d+)\.(\d+)/);if(t&&t.length>2){var n=r.defaults.androidFixMinorVersion||4;return parseInt(t[1])<4||parseInt(t[1])===n&&parseInt(t[2])<n}return e.indexOf("Chrome")===-1&&/.*Windows.*Safari.*/.test(e)}function o(e,t,n,r,o,s,u,l){function c(){return"input"===t[0].tagName.toLowerCase()&&n.type&&"file"===n.type.toLowerCase()}function f(){return b("ngfChange")||b("ngfSelect")}function d(t){if(l.shouldUpdateOn("change",n,e)){var i=t.__files_||t.target&&t.target.files,o=[];if(!i)return;for(var a=0;a<i.length;a++)o.push(i[a]);l.updateModel(r,n,e,f(),o.length?o:null,t)}}function p(e,r){function i(t){e.attr("id","ngf-"+t),r.attr("id","ngf-label-"+t)}for(var o=0;o<t[0].attributes.length;o++){var a=t[0].attributes[o];"type"!==a.name&&"class"!==a.name&&"style"!==a.name&&("id"===a.name?(i(a.value),y.push(n.$observe("id",i))):e.attr(a.name,a.value||"required"!==a.name&&"multiple"!==a.name?a.value:a.name))}}function h(){if(c())return t;var e=angular.element('<input type="file">'),n=angular.element("<label>upload</label>");return n.css("visibility","hidden").css("position","absolute").css("overflow","hidden").css("width","0px").css("height","0px").css("border","none").css("margin","0px").css("padding","0px").attr("tabindex","-1"),p(e,n),a.push({el:t,ref:n}),document.body.appendChild(n.append(e)[0]),e}function g(n){if(t.attr("disabled"))return!1;if(!b("ngfSelectDisabled",e)){var r=v(n);if(null!=r)return r;$(n);try{c()||document.body.contains(_[0])||(a.push({el:t,ref:_.parent()}),document.body.appendChild(_.parent()[0]),_.bind("change",d))}catch(o){}return i(navigator.userAgent)?setTimeout(function(){_[0].click()},0):_[0].click(),!1}}function v(e){var t=e.changedTouches||e.originalEvent&&e.originalEvent.changedTouches;if(t){if("touchstart"===e.type)return x=t[0].clientX,w=t[0].clientY,!0;if("touchend"===e.type){var n=t[0].clientX,r=t[0].clientY;if(Math.abs(n-x)>20||Math.abs(r-w)>20)return e.stopPropagation(),e.preventDefault(),!1}return!0}}function $(t){l.shouldUpdateOn("click",n,e)&&_.val()&&(_.val(null),l.updateModel(r,n,e,f(),null,t,!0))}function m(e){if(_&&!_.attr("__ngf_ie10_Fix_")){if(!_[0].parentNode)return void(_=null);e.preventDefault(),e.stopPropagation(),_.unbind("click");var t=_.clone();return _.replaceWith(t),_=t,_.attr("__ngf_ie10_Fix_","true"),_.bind("change",d),_.bind("click",m),_[0].click(),!1}_.removeAttr("__ngf_ie10_Fix_")}var b=function(e,t){return l.attrGetter(e,n,t)};l.registerModelChangeValidator(r,n,e);var y=[];b("ngfMultiple")&&y.push(e.$watch(b("ngfMultiple"),function(){_.attr("multiple",b("ngfMultiple",e))})),b("ngfCapture")&&y.push(e.$watch(b("ngfCapture"),function(){_.attr("capture",b("ngfCapture",e))})),b("ngfAccept")&&y.push(e.$watch(b("ngfAccept"),function(){_.attr("accept",b("ngfAccept",e))})),y.push(n.$observe("accept",function(){_.attr("accept",b("accept"))}));var w=0,x=0,_=t;c()||(_=h()),_.bind("change",d),c()?t.bind("click",$):t.bind("click touchstart touchend",g),navigator.appVersion.indexOf("MSIE 10")!==-1&&_.bind("click",m),r&&r.$formatters.push(function(e){return null!=e&&0!==e.length||_.val()&&_.val(null),e}),e.$on("$destroy",function(){c()||_.parent().remove(),angular.forEach(y,function(e){e()})}),s(function(){for(var e=0;e<a.length;e++){var t=a[e];document.body.contains(t.el[0])||(a.splice(e,1),t.ref.remove())}}),window.FileAPI&&window.FileAPI.ngfFixIE&&window.FileAPI.ngfFixIE(t,_,d)}var a=[];return{restrict:"AEC",require:"?ngModel",link:function(i,a,s,u){o(i,a,s,u,e,t,n,r)}}}]),function(){function e(e){return"img"===e.tagName.toLowerCase()?"image":"audio"===e.tagName.toLowerCase()?"audio":"video"===e.tagName.toLowerCase()?"video":/./}function t(t,n,r,i,o,a,s,u){function l(e){var a=t.attrGetter("ngfNoObjectUrl",o,r);t.dataUrl(e,a)["finally"](function(){n(function(){var t=(a?e.$ngfDataUrl:e.$ngfBlobUrl)||e.$ngfDataUrl;u?i.css("background-image","url('"+(t||"")+"')"):i.attr("src",t),t?i.removeClass("ng-hide"):i.addClass("ng-hide")})})}n(function(){var n=r.$watch(o[a],function(n){var c=s;if("ngfThumbnail"===a&&(c||(c={width:i[0].naturalWidth||i[0].clientWidth,height:i[0].naturalHeight||i[0].clientHeight}),0===c.width&&window.getComputedStyle)){var f=getComputedStyle(i[0]);c={width:parseInt(f.width.slice(0,-2)),height:parseInt(f.height.slice(0,-2))}}return angular.isString(n)?(i.removeClass("ng-hide"),u?i.css("background-image","url('"+n+"')"):i.attr("src",n)):void(!n||!n.type||0!==n.type.search(e(i[0]))||u&&0!==n.type.indexOf("image")?i.addClass("ng-hide"):c&&t.isResizeSupported()?(c.resizeIf=function(e,i){return t.attrGetter("ngfResizeIf",o,r,{$width:e,$height:i,$file:n})},t.resize(n,c).then(function(e){l(e)},function(e){throw e})):l(n))});r.$on("$destroy",function(){n()})})}r.service("UploadDataUrl",["UploadBase","$timeout","$q",function(e,t,n){var r=e;return r.base64DataUrl=function(e){if(angular.isArray(e)){var t=n.defer(),i=0;return angular.forEach(e,function(n){r.dataUrl(n,!0)["finally"](function(){if(i++,i===e.length){var n=[];angular.forEach(e,function(e){n.push(e.$ngfDataUrl)}),t.resolve(n,e)}})}),t.promise}return r.dataUrl(e,!0)},r.dataUrl=function(e,i){if(!e)return r.emptyPromise(e,e);if(i&&null!=e.$ngfDataUrl||!i&&null!=e.$ngfBlobUrl)return r.emptyPromise(i?e.$ngfDataUrl:e.$ngfBlobUrl,e);var o=i?e.$$ngfDataUrlPromise:e.$$ngfBlobUrlPromise;if(o)return o;var a=n.defer();return t(function(){if(window.FileReader&&e&&(!window.FileAPI||navigator.userAgent.indexOf("MSIE 8")===-1||e.size<2e4)&&(!window.FileAPI||navigator.userAgent.indexOf("MSIE 9")===-1||e.size<4e6)){var n=window.URL||window.webkitURL;if(n&&n.createObjectURL&&!i){var o;try{o=n.createObjectURL(e)}catch(s){return void t(function(){e.$ngfBlobUrl="",a.reject()})}t(function(){if(e.$ngfBlobUrl=o,o){a.resolve(o,e),r.blobUrls=r.blobUrls||[],r.blobUrlsTotalSize=r.blobUrlsTotalSize||0,r.blobUrls.push({url:o,size:e.size}),r.blobUrlsTotalSize+=e.size||0;for(var t=r.defaults.blobUrlsMaxMemory||268435456,i=r.defaults.blobUrlsMaxQueueSize||200;(r.blobUrlsTotalSize>t||r.blobUrls.length>i)&&r.blobUrls.length>1;){var s=r.blobUrls.splice(0,1)[0];n.revokeObjectURL(s.url),r.blobUrlsTotalSize-=s.size}}})}else{var u=new FileReader;u.onload=function(n){t(function(){e.$ngfDataUrl=n.target.result,a.resolve(n.target.result,e),t(function(){delete e.$ngfDataUrl},1e3)})},u.onerror=function(){t(function(){e.$ngfDataUrl="",a.reject()})},u.readAsDataURL(e)}}else t(function(){e[i?"$ngfDataUrl":"$ngfBlobUrl"]="",a.reject()})}),o=i?e.$$ngfDataUrlPromise=a.promise:e.$$ngfBlobUrlPromise=a.promise,o["finally"](function(){delete e[i?"$$ngfDataUrlPromise":"$$ngfBlobUrlPromise"]}),o},r}]),r.directive("ngfSrc",["Upload","$timeout",function(e,n){return{restrict:"AE",link:function(r,i,o){t(e,n,r,i,o,"ngfSrc",e.attrGetter("ngfResize",o,r),!1)}}}]),r.directive("ngfBackground",["Upload","$timeout",function(e,n){return{restrict:"AE",link:function(r,i,o){t(e,n,r,i,o,"ngfBackground",e.attrGetter("ngfResize",o,r),!0)}}}]),r.directive("ngfThumbnail",["Upload","$timeout",function(e,n){return{restrict:"AE",link:function(r,i,o){var a=e.attrGetter("ngfSize",o,r);t(e,n,r,i,o,"ngfThumbnail",a,e.attrGetter("ngfAsBackground",o,r))}}}]),r.config(["$compileProvider",function(e){e.imgSrcSanitizationWhitelist&&e.imgSrcSanitizationWhitelist(/^\s*(https?|ftp|mailto|tel|webcal|local|file|data|blob):/),e.aHrefSanitizationWhitelist&&e.aHrefSanitizationWhitelist(/^\s*(https?|ftp|mailto|tel|webcal|local|file|data|blob):/)}]),r.filter("ngfDataUrl",["UploadDataUrl","$sce",function(e,t){return function(n,r,i){if(angular.isString(n))return t.trustAsResourceUrl(n);var o=n&&((r?n.$ngfDataUrl:n.$ngfBlobUrl)||n.$ngfDataUrl);return n&&!o?(!n.$ngfDataUrlFilterInProgress&&angular.isObject(n)&&(n.$ngfDataUrlFilterInProgress=!0,e.dataUrl(n,r)),""):(n&&delete n.$ngfDataUrlFilterInProgress,(n&&o?i?t.trustAsResourceUrl(o):o:n)||"")}}])}(),r.service("UploadValidate",["UploadDataUrl","$q","$timeout",function(e,t,n){function r(e){var t="",n=[];if(e.length>2&&"/"===e[0]&&"/"===e[e.length-1])t=e.substring(1,e.length-1);else{var i=e.split(",");if(i.length>1)for(var o=0;o<i.length;o++){var a=r(i[o]);a.regexp?(t+="("+a.regexp+")",o<i.length-1&&(t+="|")):n=n.concat(a.excludes)}else 0===e.indexOf("!")?n.push("^((?!"+r(e.substring(1)).regexp+").)*$"):(0===e.indexOf(".")&&(e="*"+e),t="^"+e.replace(new RegExp("[.\\\\+*?\\[\\^\\]$(){}=!<>|:\\-]","g"),"\\$&")+"$",t=t.replace(/\\\*/g,".*").replace(/\\\?/g,"."))}return{regexp:t,excludes:n}}function i(e,t){null==t||e.$dirty||(e.$setDirty?e.$setDirty():e.$dirty=!0)}var o=e;return o.validatePattern=function(e,t){if(!t)return!0;var n=r(t),i=!0;if(n.regexp&&n.regexp.length){var o=new RegExp(n.regexp,"i");i=null!=e.type&&o.test(e.type)||null!=e.name&&o.test(e.name)}for(var a=n.excludes.length;a--;){var s=new RegExp(n.excludes[a],"i");i=i&&(null==e.type||s.test(e.type))&&(null==e.name||s.test(e.name))}return i},o.ratioToFloat=function(e){var t=e.toString(),n=t.search(/[x:]/i);return t=n>-1?parseFloat(t.substring(0,n))/parseFloat(t.substring(n+1)):parseFloat(t)},o.registerModelChangeValidator=function(e,t,n){e&&e.$formatters.push(function(r){if(e.$dirty){var i=r;r&&!angular.isArray(r)&&(i=[r]),o.validate(i,0,e,t,n).then(function(){o.applyModelValidation(e,i)})}return r})},o.applyModelValidation=function(e,t){i(e,t),angular.forEach(e.$ngfValidations,function(t){e.$setValidity(t.name,t.valid)})},o.getValidationAttr=function(e,t,n,r,i){var a="ngf"+n[0].toUpperCase()+n.substr(1),s=o.attrGetter(a,e,t,{$file:i});if(null==s&&(s=o.attrGetter("ngfValidate",e,t,{$file:i}))){var u=(r||n).split(".");s=s[u[0]],u.length>1&&(s=s&&s[u[1]])}return s},o.validate=function(e,n,r,i,a){function s(t,n,s){if(e){for(var u=e.length,l=null;u--;){var p=e[u];if(p){var h=o.getValidationAttr(i,a,t,n,p);null!=h&&(s(p,h,u)||(c.indexOf(t)===-1?(p.$error=t,(p.$errorMessages=p.$errorMessages||{})[t]=!0,p.$errorParam=h,d.indexOf(p)===-1&&d.push(p),f||e.splice(u,1),l=!1):e.splice(u,1)))}}null!==l&&r.$ngfValidations.push({name:t,valid:l})}}function u(n,s,u,p,h){function g(t,r,i){function o(o){if(o())if(c.indexOf(n)===-1){if(r.$error=n,(r.$errorMessages=r.$errorMessages||{})[n]=!0,r.$errorParam=i,d.indexOf(r)===-1&&d.push(r),!f){var a=e.indexOf(r);a>-1&&e.splice(a,1)}t.resolve(!1)}else{var s=e.indexOf(r);s>-1&&e.splice(s,1),t.resolve(!0)}else t.resolve(!0)}null!=i?p(r,i).then(function(e){o(function(){return!h(e,i)})},function(){o(function(){return l("ngfValidateForce",{$file:r})})}):t.resolve(!0)}var v=[o.emptyPromise(!0)];e&&(e=void 0===e.length?[e]:e,angular.forEach(e,function(e){var r=t.defer();return v.push(r.promise),!u||null!=e.type&&0===e.type.search(u)?void("dimensions"===n&&null!=o.attrGetter("ngfDimensions",i)?o.imageDimensions(e).then(function(t){g(r,e,l("ngfDimensions",{$file:e,$width:t.width,$height:t.height}))},function(){r.resolve(!1)}):"duration"===n&&null!=o.attrGetter("ngfDuration",i)?o.mediaDuration(e).then(function(t){g(r,e,l("ngfDuration",{$file:e,$duration:t}))},function(){r.resolve(!1)}):g(r,e,o.getValidationAttr(i,a,n,s,e))):void r.resolve(!0)}));var $=t.defer();return t.all(v).then(function(e){for(var t=!0,i=0;i<e.length;i++)if(!e[i]){t=!1;break}r.$ngfValidations.push({name:n,valid:t}),$.resolve(t)}),$.promise}r=r||{},r.$ngfValidations=r.$ngfValidations||[],angular.forEach(r.$ngfValidations,function(e){e.valid=!0});var l=function(e,t){return o.attrGetter(e,i,a,t)},c=(o.attrGetter("ngfIgnoreInvalid",i,a)||"").split(" "),f=o.attrGetter("ngfRunAllValidations",i,a);if(null==e||0===e.length)return o.emptyPromise({validFiles:e,invalidFiles:[]});e=void 0===e.length?[e]:e.slice(0);var d=[];s("pattern",null,o.validatePattern),s("minSize","size.min",function(e,t){return e.size+.1>=o.translateScalars(t)}),s("maxSize","size.max",function(e,t){return e.size-.1<=o.translateScalars(t)});var p=0;if(s("maxTotalSize",null,function(t,n){return p+=t.size,!(p>o.translateScalars(n))||(e.splice(0,e.length),!1)}),s("validateFn",null,function(e,t){return t===!0||null===t||""===t}),!e.length)return o.emptyPromise({validFiles:[],invalidFiles:d});var h=t.defer(),g=[];return g.push(u("maxHeight","height.max",/image/,this.imageDimensions,function(e,t){return e.height<=t})),g.push(u("minHeight","height.min",/image/,this.imageDimensions,function(e,t){return e.height>=t})),g.push(u("maxWidth","width.max",/image/,this.imageDimensions,function(e,t){return e.width<=t})),g.push(u("minWidth","width.min",/image/,this.imageDimensions,function(e,t){return e.width>=t})),g.push(u("dimensions",null,/image/,function(e,t){return o.emptyPromise(t)},function(e){return e})),g.push(u("ratio",null,/image/,this.imageDimensions,function(e,t){for(var n=t.toString().split(","),r=!1,i=0;i<n.length;i++)Math.abs(e.width/e.height-o.ratioToFloat(n[i]))<.01&&(r=!0);return r})),g.push(u("maxRatio","ratio.max",/image/,this.imageDimensions,function(e,t){return e.width/e.height-o.ratioToFloat(t)<1e-4})),g.push(u("minRatio","ratio.min",/image/,this.imageDimensions,function(e,t){return e.width/e.height-o.ratioToFloat(t)>-1e-4})),g.push(u("maxDuration","duration.max",/audio|video/,this.mediaDuration,function(e,t){return e<=o.translateScalars(t)})),g.push(u("minDuration","duration.min",/audio|video/,this.mediaDuration,function(e,t){return e>=o.translateScalars(t)})),g.push(u("duration",null,/audio|video/,function(e,t){return o.emptyPromise(t)},function(e){return e})),g.push(u("validateAsyncFn",null,null,function(e,t){return t},function(e){return e===!0||null===e||""===e})),t.all(g).then(function(){if(f)for(var t=0;t<e.length;t++){var r=e[t];r.$error&&e.splice(t--,1)}f=!1,s("maxFiles",null,function(e,t,r){return n+r<t}),h.resolve({validFiles:e,invalidFiles:d})}),h.promise},o.imageDimensions=function(e){if(e.$ngfWidth&&e.$ngfHeight){var r=t.defer();return n(function(){r.resolve({width:e.$ngfWidth,height:e.$ngfHeight})}),r.promise}if(e.$ngfDimensionPromise)return e.$ngfDimensionPromise;var i=t.defer();return n(function(){return 0!==e.type.indexOf("image")?void i.reject("not image"):void o.dataUrl(e).then(function(t){function r(){var t=s[0].naturalWidth||s[0].clientWidth,n=s[0].naturalHeight||s[0].clientHeight;s.remove(),e.$ngfWidth=t,e.$ngfHeight=n,i.resolve({width:t,height:n})}function o(){s.remove(),i.reject("load error")}function a(){n(function(){s[0].parentNode&&(s[0].clientWidth?r():u++>10?o():a())},1e3)}var s=angular.element("<img>").attr("src",t).css("visibility","hidden").css("position","fixed").css("max-width","none !important").css("max-height","none !important");s.on("load",r),s.on("error",o);var u=0;a(),angular.element(document.getElementsByTagName("body")[0]).append(s)},function(){i.reject("load error")})}),e.$ngfDimensionPromise=i.promise,e.$ngfDimensionPromise["finally"](function(){delete e.$ngfDimensionPromise}),e.$ngfDimensionPromise},o.mediaDuration=function(e){if(e.$ngfDuration){var r=t.defer();return n(function(){r.resolve(e.$ngfDuration)}),r.promise}if(e.$ngfDurationPromise)return e.$ngfDurationPromise;var i=t.defer();return n(function(){return 0!==e.type.indexOf("audio")&&0!==e.type.indexOf("video")?void i.reject("not media"):void o.dataUrl(e).then(function(t){function r(){var t=s[0].duration;e.$ngfDuration=t,s.remove(),i.resolve(t)}function o(){s.remove(),i.reject("load error")}function a(){n(function(){s[0].parentNode&&(s[0].duration?r():u>10?o():a())},1e3)}var s=angular.element(0===e.type.indexOf("audio")?"<audio>":"<video>").attr("src",t).css("visibility","none").css("position","fixed");s.on("loadedmetadata",r),s.on("error",o);var u=0;a(),angular.element(document.body).append(s)},function(){i.reject("load error")})}),e.$ngfDurationPromise=i.promise,e.$ngfDurationPromise["finally"](function(){delete e.$ngfDurationPromise}),e.$ngfDurationPromise},o}]),r.service("UploadResize",["UploadValidate","$q",function(e,t){var n=e,r=function(e,t,n,r,i){var o=i?Math.max(n/e,r/t):Math.min(n/e,r/t);return{width:e*o,height:t*o,marginX:e*o-n,marginY:t*o-r}},i=function(e,i,o,a,s,u,l,c){var f=t.defer(),d=document.createElement("canvas"),p=document.createElement("img");return p.setAttribute("style","visibility:hidden;position:fixed;z-index:-100000"),document.body.appendChild(p),p.onload=function(){var e=p.width,t=p.height;if(p.parentNode.removeChild(p),null!=c&&c(e,t)===!1)return void f.reject("resizeIf");try{if(u){var h=n.ratioToFloat(u),g=e/t;g<h?(i=e,o=i/h):(o=t,i=o*h)}i||(i=e),o||(o=t);var v=r(e,t,i,o,l);d.width=Math.min(v.width,i),d.height=Math.min(v.height,o);var $=d.getContext("2d");$.drawImage(p,Math.min(0,-v.marginX/2),Math.min(0,-v.marginY/2),v.width,v.height),f.resolve(d.toDataURL(s||"image/WebP",a||.934))}catch(m){f.reject(m)}},p.onerror=function(){p.parentNode.removeChild(p),f.reject()},p.src=e,f.promise};return n.dataUrltoBlob=function(e,t,n){for(var r=e.split(","),i=r[0].match(/:(.*?);/)[1],o=atob(r[1]),a=o.length,s=new Uint8Array(a);a--;)s[a]=o.charCodeAt(a);var u=new window.Blob([s],{type:i});return u.name=t,u.$ngfOrigSize=n,u},n.isResizeSupported=function(){var e=document.createElement("canvas");return window.atob&&e.getContext&&e.getContext("2d")&&window.Blob},n.isResizeSupported()&&Object.defineProperty(window.Blob.prototype,"name",{get:function(){return this.$ngfName},set:function(e){this.$ngfName=e},configurable:!0}),n.resize=function(e,r){if(0!==e.type.indexOf("image"))return n.emptyPromise(e);var o=t.defer();return n.dataUrl(e,!0).then(function(t){i(t,r.width,r.height,r.quality,r.type||e.type,r.ratio,r.centerCrop,r.resizeIf).then(function(i){if("image/jpeg"===e.type&&r.restoreExif!==!1)try{i=n.restoreExif(t,i)}catch(a){setTimeout(function(){throw a},1)}try{var s=n.dataUrltoBlob(i,e.name,e.size);o.resolve(s)}catch(a){o.reject(a)}},function(t){"resizeIf"===t&&o.resolve(e),o.reject(t)})},function(e){o.reject(e)}),o.promise},n}]),function(){function e(e,n,r,i,o,a,s,u,l,c){function f(){return n.attr("disabled")||$("ngfDropDisabled",e)}function d(t,n){u.updateModel(i,r,e,$("ngfChange")||$("ngfDrop"),t,n)}function p(t,n){if(!u.shouldUpdateOn(t,r,e)||"string"!=typeof n)return u.rejectPromise([]);var i=[];n.replace(/<(img src|img [^>]* src) *=\"([^\"]*)\"/gi,function(e,t,n){i.push(n)});var o=[],a=[];if(i.length){angular.forEach(i,function(e){o.push(u.urlToBlob(e).then(function(e){a.push(e)}))});var s=c.defer();return c.all(o).then(function(){s.resolve(a)},function(e){s.reject(e)}),s.promise}return u.emptyPromise()}function h(e,t,n,r){var i=$("ngfDragOverClass",e,{$event:n}),o="dragover";if(angular.isString(i))o=i;else if(i&&(i.delay&&(w=i.delay),i.accept||i.reject)){var a=n.dataTransfer.items;if(null!=a&&a.length)for(var s=i.pattern||$("ngfPattern",e,{$event:n}),l=a.length;l--;){if(!u.validatePattern(a[l],s)){o=i.reject;break}o=i.accept}else o=i.accept}r(o)}function g(t,n,i,o){function a(e,t){var n=c.defer();if(null!=e)if(e.isDirectory){var r=[u.emptyPromise()];if(d){var i={type:"directory"};i.name=i.path=(t||"")+e.name,p.push(i)}var o=e.createReader(),s=[],g=function(){o.readEntries(function(i){try{i.length?(s=s.concat(Array.prototype.slice.call(i||[],0)),g()):(angular.forEach(s.slice(0),function(n){p.length<=l&&h<=f&&r.push(a(n,(t?t:"")+e.name+"/"))}),c.all(r).then(function(){n.resolve()},function(e){n.reject(e)}))}catch(o){n.reject(o)}},function(e){n.reject(e)})};g()}else e.file(function(e){try{e.path=(t?t:"")+e.name,d&&(e=u.rename(e,e.path)),p.push(e),h+=e.size,n.resolve()}catch(r){n.reject(r)}},function(e){n.reject(e)});return n.promise}var l=u.getValidationAttr(r,e,"maxFiles");null==l&&(l=Number.MAX_VALUE);var f=u.getValidationAttr(r,e,"maxTotalSize");null==f&&(f=Number.MAX_VALUE);var d=$("ngfIncludeDir",e),p=[],h=0,g=[u.emptyPromise()];if(t&&t.length>0&&"file:"!==s.location.protocol)for(var v=0;v<t.length;v++){if(t[v].webkitGetAsEntry&&t[v].webkitGetAsEntry()&&t[v].webkitGetAsEntry().isDirectory){var m=t[v].webkitGetAsEntry();if(m.isDirectory&&!i)continue;null!=m&&g.push(a(m))}else{var b=t[v].getAsFile();null!=b&&(p.push(b),h+=b.size)}if(p.length>l||h>f||!o&&p.length>0)break}else if(null!=n)for(var y=0;y<n.length;y++){var w=n.item(y);if((w.type||w.size>0)&&(p.push(w),h+=w.size),p.length>l||h>f||!o&&p.length>0)break}var x=c.defer();return c.all(g).then(function(){if(o||d||!p.length)x.resolve(p);else{for(var e=0;p[e]&&"directory"===p[e].type;)e++;x.resolve([p[e]])}},function(e){x.reject(e)}),x.promise}var v=t(),$=function(e,t,n){return u.attrGetter(e,r,t,n)};if($("dropAvailable")&&a(function(){e[$("dropAvailable")]?e[$("dropAvailable")].value=v:e[$("dropAvailable")]=v}),!v)return void($("ngfHideOnDropNotAvailable",e)===!0&&n.css("display","none"));null==$("ngfSelect")&&u.registerModelChangeValidator(i,r,e);var m,b=null,y=o($("ngfStopPropagation")),w=1;n[0].addEventListener("dragover",function(t){if(!f()&&u.shouldUpdateOn("drop",r,e)){if(t.preventDefault(),y(e)&&t.stopPropagation(),navigator.userAgent.indexOf("Chrome")>-1){var i=t.dataTransfer.effectAllowed;t.dataTransfer.dropEffect="move"===i||"linkMove"===i?"move":"copy"}a.cancel(b),m||(m="C",h(e,r,t,function(r){m=r,n.addClass(m),$("ngfDrag",e,{$isDragging:!0,$class:m,$event:t})}))}},!1),n[0].addEventListener("dragenter",function(t){!f()&&u.shouldUpdateOn("drop",r,e)&&(t.preventDefault(),y(e)&&t.stopPropagation())},!1),n[0].addEventListener("dragleave",function(t){!f()&&u.shouldUpdateOn("drop",r,e)&&(t.preventDefault(),
|
9 |
+
y(e)&&t.stopPropagation(),b=a(function(){m&&n.removeClass(m),m=null,$("ngfDrag",e,{$isDragging:!1,$event:t})},w||100))},!1),n[0].addEventListener("drop",function(t){if(!f()&&u.shouldUpdateOn("drop",r,e)){t.preventDefault(),y(e)&&t.stopPropagation(),m&&n.removeClass(m),m=null;var i,o=t.dataTransfer.items;try{i=t.dataTransfer&&t.dataTransfer.getData&&t.dataTransfer.getData("text/html")}catch(a){}g(o,t.dataTransfer.files,$("ngfAllowDir",e)!==!1,$("multiple")||$("ngfMultiple",e)).then(function(e){e.length?d(e,t):p("dropUrl",i).then(function(e){d(e,t)})})}},!1),n[0].addEventListener("paste",function(t){if(navigator.userAgent.toLowerCase().indexOf("firefox")>-1&&$("ngfEnableFirefoxPaste",e)&&t.preventDefault(),!f()&&u.shouldUpdateOn("paste",r,e)){var n=[],i=t.clipboardData||t.originalEvent.clipboardData;if(i&&i.items)for(var o=0;o<i.items.length;o++)i.items[o].type.indexOf("image")!==-1&&n.push(i.items[o].getAsFile());n.length?d(n,t):p("pasteUrl",i).then(function(e){d(e,t)})}},!1),navigator.userAgent.toLowerCase().indexOf("firefox")>-1&&$("ngfEnableFirefoxPaste",e)&&(n.attr("contenteditable",!0),n.on("keypress",function(e){e.metaKey||e.ctrlKey||e.preventDefault()}))}function t(){var e=document.createElement("div");return"draggable"in e&&"ondrop"in e&&!/Edge\/12./i.test(navigator.userAgent)}r.directive("ngfDrop",["$parse","$timeout","$window","Upload","$http","$q",function(t,n,r,i,o,a){return{restrict:"AEC",require:"?ngModel",link:function(s,u,l,c){e(s,u,l,c,t,n,r,i,o,a)}}}]),r.directive("ngfNoFileDrop",function(){return function(e,n){t()&&n.css("display","none")}}),r.directive("ngfDropAvailable",["$parse","$timeout","Upload",function(e,n,r){return function(i,o,a){if(t()){var s=e(r.attrGetter("ngfDropAvailable",a));n(function(){s(i),s.assign&&s.assign(i,!0)})}}}])}(),r.service("UploadExif",["UploadResize","$q",function(e,t){function n(e,t,n,r){switch(t){case 2:return e.transform(-1,0,0,1,n,0);case 3:return e.transform(-1,0,0,-1,n,r);case 4:return e.transform(1,0,0,-1,0,r);case 5:return e.transform(0,1,1,0,0,0);case 6:return e.transform(0,1,-1,0,r,0);case 7:return e.transform(0,-1,-1,0,r,n);case 8:return e.transform(0,-1,1,0,0,n)}}function r(e){for(var t="",n=new Uint8Array(e),r=n.byteLength,i=0;i<r;i++)t+=String.fromCharCode(n[i]);return window.btoa(t)}var i=e;return i.isExifSupported=function(){return window.FileReader&&(new FileReader).readAsArrayBuffer&&i.isResizeSupported()},i.readOrientation=function(e){var n=t.defer(),r=new FileReader,i=e.slice?e.slice(0,65536):e;return r.readAsArrayBuffer(i),r.onerror=function(e){return n.reject(e)},r.onload=function(e){var t={orientation:1},r=new DataView(this.result);if(65496!==r.getUint16(0,!1))return n.resolve(t);for(var i=r.byteLength,o=2;o<i;){var a=r.getUint16(o,!1);if(o+=2,65505===a){if(1165519206!==r.getUint32(o+=2,!1))return n.resolve(t);var s=18761===r.getUint16(o+=6,!1);o+=r.getUint32(o+4,s);var u=r.getUint16(o,s);o+=2;for(var l=0;l<u;l++)if(274===r.getUint16(o+12*l,s)){var c=r.getUint16(o+12*l+8,s);return c>=2&&c<=8&&(r.setUint16(o+12*l+8,1,s),t.fixedArrayBuffer=e.target.result),t.orientation=c,n.resolve(t)}}else{if(65280!==(65280&a))break;o+=r.getUint16(o,!1)}}return n.resolve(t)},n.promise},i.applyExifRotation=function(e){if(0!==e.type.indexOf("image/jpeg"))return i.emptyPromise(e);var o=t.defer();return i.readOrientation(e).then(function(t){return t.orientation<2||t.orientation>8?o.resolve(e):void i.dataUrl(e,!0).then(function(a){var s=document.createElement("canvas"),u=document.createElement("img");u.onload=function(){try{s.width=t.orientation>4?u.height:u.width,s.height=t.orientation>4?u.width:u.height;var a=s.getContext("2d");n(a,t.orientation,u.width,u.height),a.drawImage(u,0,0);var l=s.toDataURL(e.type||"image/WebP",.934);l=i.restoreExif(r(t.fixedArrayBuffer),l);var c=i.dataUrltoBlob(l,e.name);o.resolve(c)}catch(f){return o.reject(f)}},u.onerror=function(){o.reject()},u.src=a},function(e){o.reject(e)})},function(e){o.reject(e)}),o.promise},i.restoreExif=function(e,t){var n={};return n.KEY_STR="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n.encode64=function(e){var t,n,r,i,o,a="",s="",u="",l=0;do t=e[l++],n=e[l++],s=e[l++],r=t>>2,i=(3&t)<<4|n>>4,o=(15&n)<<2|s>>6,u=63&s,isNaN(n)?o=u=64:isNaN(s)&&(u=64),a=a+this.KEY_STR.charAt(r)+this.KEY_STR.charAt(i)+this.KEY_STR.charAt(o)+this.KEY_STR.charAt(u),t=n=s="",r=i=o=u="";while(l<e.length);return a},n.restore=function(e,t){e.match("data:image/jpeg;base64,")&&(e=e.replace("data:image/jpeg;base64,",""));var n=this.decode64(e),r=this.slice2Segments(n),i=this.exifManipulation(t,r);return"data:image/jpeg;base64,"+this.encode64(i)},n.exifManipulation=function(e,t){var n=this.getExifArray(t),r=this.insertExif(e,n);return new Uint8Array(r)},n.getExifArray=function(e){for(var t,n=0;n<e.length;n++)if(t=e[n],255===t[0]&225===t[1])return t;return[]},n.insertExif=function(e,t){var n=e.replace("data:image/jpeg;base64,",""),r=this.decode64(n),i=r.indexOf(255,3),o=r.slice(0,i),a=r.slice(i),s=o;return s=s.concat(t),s=s.concat(a)},n.slice2Segments=function(e){for(var t=0,n=[];;){if(255===e[t]&218===e[t+1])break;if(255===e[t]&216===e[t+1])t+=2;else{var r=256*e[t+2]+e[t+3],i=t+r+2,o=e.slice(t,i);n.push(o),t=i}if(t>e.length)break}return n},n.decode64=function(e){var t,n,r,i,o,a="",s="",u=0,l=[],c=/[^A-Za-z0-9\+\/\=]/g;c.exec(e)&&console.log("There were invalid base64 characters in the input text.\nValid base64 characters are A-Z, a-z, 0-9, NaNExpect errors in decoding."),e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");do r=this.KEY_STR.indexOf(e.charAt(u++)),i=this.KEY_STR.indexOf(e.charAt(u++)),o=this.KEY_STR.indexOf(e.charAt(u++)),s=this.KEY_STR.indexOf(e.charAt(u++)),t=r<<2|i>>4,n=(15&i)<<4|o>>2,a=(3&o)<<6|s,l.push(t),64!==o&&l.push(n),64!==s&&l.push(a),t=n=a="",r=i=o=s="";while(u<e.length);return l},n.restore(e,t)},i}])},{}],43:[function(e,t,n){e("./dist/ng-file-upload-all"),t.exports="ngFileUpload"},{"./dist/ng-file-upload-all":42}]},{},[36]);
|
js/jpibfi.client.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
!function t(e,n,i){function r(a,u){if(!n[a]){if(!e[a]){var s="function"==typeof require&&require;if(!u&&s)return s(a,!0);if(o)return o(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var l=n[a]={exports:{}};e[a][0].call(l.exports,function(t){var n=e[a][1][t];return r(n?n:t)},l,l.exports,t,e,n,i)}return n[a].exports}for(var o="function"==typeof require&&require,a=0;a<i.length;a++)r(i[a]);return r}({1:[function(t,e,n){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),o=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.siteTitle,r=void 0===n?"":n;i(this,t),this.desc_funcs={img_title:function(t){return t.attr("title")},img_alt:function(t){return t.attr("alt")},post_title:function(t){return t.attr("data-jpibfi-post-title")},img_description:function(t){return t.attr("data-jpibfi-description")},img_caption:function(t){return t.attr("data-jpibfi-caption")},site_title:function(){return r}}}return r(t,[{key:"getDescription",value:function(t,e){for(var n="",i=0;i<e.length&&!n;i++)n=this.desc_funcs[e[i]](t);return n}}]),t}();n["default"]=o},{}],2:[function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var o=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),a=t("./link-generator"),u=i(a),s=function(){function t(e,n){r(this,t),this.$=e,this.settings=n,this.linkGenerator=new u["default"](n),this.$element=this.$("<a />",{target:"_blank","class":"pinit-button"}),this.size={height:n.pinImageHeight,width:n.pinImageWidth}}return o(t,[{key:"createButton",value:function(t){var e=this.$element.clone(!1);return e.attr("href",this.linkGenerator.generate(t)).click(function(t){t.preventDefault(),t.stopPropagation(),"#"!==t.currentTarget.href.slice(-1)&&window.open(t.currentTarget.href,"mw"+t.timeStamp,"left=20,top=20,width=500,height=500,toolbar=1,resizable=0")}),{$element:e,size:this.size}}}]),t}();n["default"]=s},{"./link-generator":5}],3:[function(t,e,n){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),o=function(){function t(e){var n=this;i(this,t),this.settings=e,this.disabledClasses=this.createClassList(e.disabled_classes),this.enabledClasses=this.createClassList(e.enabled_classes),this.updateSizeConstraints(),window.addEventListener("resize",function(){return n.updateSizeConstraints()},!1)}return r(t,[{key:"createClassList",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return t.split(",").filter(function(t){return!!t})}},{key:"imageEligible",value:function(t){return this.enabledClasses.every(function(e){return t.hasClass(e)})&&!this.disabledClasses.some(function(e){return t.hasClass(e)})&&this.imageSizeIsOk(t)}},{key:"imageSizeIsOk",value:function(t){var e=t[0].clientWidth,n=t[0].clientHeight;return e>=this.minWidth&&n>=this.minHeight}},{key:"updateSizeConstraints",value:function(){this.minWidth=window.outerWidth<768?this.settings.min_image_width_small:this.settings.min_image_width,this.minHeight=window.outerWidth<768?this.settings.min_image_height_small:this.settings.min_image_height}}]),t}();n["default"]=o},{}],4:[function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var o=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),a=t("./show-on-hover-strategy"),u=i(a),s=function(){function t(e,n,i){r(this,t),this.settings=n,this.$=e,this.logger=i}return o(t,[{key:"init",value:function(){this.showStrategy=this.getStrategy(),this.showStrategy.start()}},{key:"getStrategy",value:function(){var t=null;return new(t=u["default"])(this.$,this.settings,this.logger)}}]),t}();n["default"]=s},{"./show-on-hover-strategy":7}],5:[function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var o=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),a=t("./../common/description-helper"),u=i(a),s=function(){function t(e){r(this,t),this.descriptionHelper=new u["default"]({siteTitle:e.siteTitle}),this.pinLinkedImages=e.pinLinkedImages,this.description_option=e.description_option,this.desc_funcs={img_title:function(t){return t.attr("title")},img_alt:function(t){return t.attr("alt")},post_title:function(t){return t.attr("data-jpibfi-post-title")},img_description:function(t){return t.attr("data-jpibfi-description")},img_caption:function(t){return t.attr("data-jpibfi-caption")},site_title:function(){return e.siteTitle}}}return o(t,[{key:"getDescription",value:function(t){return this.descriptionHelper.getDescription(t,this.description_option)}},{key:"getImage",value:function(t){var e=t.attr("src");if(!this.pinLinkedImages)return e;var n=t.closest("a");if(0===n.length)return e;var i=e.split(".").pop(),r=n.attr("href"),o=r.split(".").pop();return o.toLowerCase()===i.toLowerCase()?r:e}},{key:"getUrl",value:function(t){return t.attr("data-jpibfi-post-url")||window.location.href}},{key:"generate",value:function(t){var e=encodeURIComponent(this.getDescription(t)),n=encodeURIComponent(this.getUrl(t)),i=encodeURIComponent(this.getImage(t));return"http://pinterest.com/pin/create/bookmarklet/?is_video=false&url="+n+"&media="+i+"&description="+e}}]),t}();n["default"]=s},{"./../common/description-helper":1}],6:[function(t,e,n){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),o=function(t,e,n,i){return t.top+i.top},a=function(t,e,n,i){return t.left+i.left},u=function(t,e,n,i){return e.top-n.height-i.bottom},s=function(t,e,n,i){return e.left-i.right-n.width},c=function(t,e,n){return t.top+((e.top-t.top)/2-n.height/2)},l=function(t,e,n){return t.left+((e.left-t.left)/2-n.width/2)},f=function(){function t(e,n){i(this,t),this.topF=e,this.leftF=n}return r(t,[{key:"calculate",value:function(t,e,n,i){return{top:this.topF(t,e,n,i),left:this.leftF(t,e,n,i)}}}]),t}(),h=function(){function t(e,n){i(this,t),this.margins=n,this.positionCalculator=this.getPositionCalculator(e)}return r(t,[{key:"getPositionCalculator",value:function(t){switch(t){case"top-left":return new f(o,a);case"top-right":return new f(o,s);case"bottom-left":return new f(u,a);case"bottom-right":return new f(u,s);case"center":default:return new f(c,l)}}},{key:"calculatePosition",value:function(t,e,n){return this.positionCalculator.calculate(t,e,n,this.margins)}}]),t}();n["default"]=h},{}],7:[function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(n,"__esModule",{value:!0});var u=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),s=t("./show-strategy"),c=i(s),l=function(t){function e(){return r(this,e),o(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return a(e,t),u(e,[{key:"init",value:function(){var t=this,e=function(){return t.$(".jpibfi").closest("div").addClass("jpibfi_container")};e()}},{key:"start",value:function(){var t=this;this.init();var e="data-jpibfi-timeout",n=0,i=function(e){return t.$("a.pinit-button["+t.indexerAttr+'="'+e+'"]')},r=this;r.$(document).delegate(this.settings.image_selector,"mouseenter",function(){var t=r.$(this);if(r.imageFilter.imageEligible(t)){var o=t.attr(r.indexerAttr);o||(o=n++,t.attr(r.indexerAttr,o));var a=i(o);0===a.length?!function(){var n=r.buttonGenerator.createButton(t),i=n.$element,a=n.size,u=t.offset(),s={top:u.top+t[0].clientHeight,left:u.left+t[0].clientWidth},c=r.positioner.calculatePosition(u,s,a);t.after(i),i.attr(r.indexerAttr,o).css("visibility","hidden").show().offset(c).css("visibility","visible").hover(function(){return clearTimeout(i.attr(e))},function(){return i.attr(e,setTimeout(function(){i.remove()},100))})}():clearTimeout(a.attr(e))}}),r.$(document).delegate(this.settings.image_selector,"mouseleave",function(){var t=r.$(this),n=t.attr(r.indexerAttr);if(n){var o=i(n);o.attr(e,setTimeout(function(){o.remove()},100))}})}}]),e}(c["default"]);n["default"]=l},{"./show-strategy":8}],8:[function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var o=t("./image-filter"),a=i(o),u=t("./button-generator"),s=i(u),c=t("./positioner"),l=i(c),f=function h(t,e,n){r(this,h),this.$=t,this.settings=e,this.logger=n,this.imageFilter=new a["default"](e),this.buttonGenerator=new s["default"](t,e);var i={left:e.button_margin_left,top:e.button_margin_top,right:e.button_margin_right,bottom:e.button_margin_bottom};this.positioner=new l["default"](e.button_position,i),this.indexerAttr="data-jpibfi-indexer"};n["default"]=f},{"./button-generator":2,"./image-filter":3,"./positioner":6}],9:[function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}var r=t("./settings"),o=i(r),a=t("./logger"),u=i(a),s=t("./hover"),c=i(s);!function(t){var e=window.jpibfi_options,n=new o["default"](t.extend({pageUrl:document.URL,pageTitle:document.title,pageDescription:t('meta[name="description"]').attr("content")||""},e.hover)),i=new u["default"](/[?&]jpibfi_debug=/.test(location.search));i.logObject(n);var r=function(){var e=new c["default"](t,n,i);e.init()};t(document).ready(r)}(jQuery)},{"./hover":4,"./logger":10,"./settings":11}],10:[function(t,e,n){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),o=function(){function t(e){var n=this;i(this,t);var r=e&&"undefined"!=typeof console&&"undefined"!=typeof console.log,o="undefined"!=typeof JSON&&"function"==typeof JSON.stringify;r?(this.logString=function(t){n.log(t)},this.logObject=o?function(t){n.log(JSON.stringify(t,null,4))}:function(t){return n.simplelogObject(t)}):(this.logString=function(){},this.logObject=function(){})}return r(t,[{key:"log",value:function(t){console.log("jpibfi debug: "+t)}},{key:"simplelogObject",value:function(t){var e=Object.keys(t).filter(function(e){return t.hasOwnPrototype(e)}).map(function(e){return e+": "+t[e]+"\n"}).join();this.log(e)}}]),t}();n["default"]=o},{}],11:[function(t,e,n){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var r=function o(t){i(this,o),Object.assign(this,t),this.isTouchDevice="ontouchstart"in window||{}.hasOwnProperty.call(navigator,"maxTouchPoints")};n["default"]=r},{}]},{},[9]);
|
js/jpibfi.js
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
var jpibfi;!function(jpibfi){!function(ButtonPosition){ButtonPosition[ButtonPosition.TopLeft=0]="TopLeft",ButtonPosition[ButtonPosition.TopRight=1]="TopRight",ButtonPosition[ButtonPosition.BottomLeft=2]="BottomLeft",ButtonPosition[ButtonPosition.BottomRight=3]="BottomRight",ButtonPosition[ButtonPosition.Middle=4]="Middle"}(jpibfi.ButtonPosition||(jpibfi.ButtonPosition={}));jpibfi.ButtonPosition;!function(ShowButton){ShowButton[ShowButton.Hover=0]="Hover",ShowButton[ShowButton.AlwaysTouch=1]="AlwaysTouch",ShowButton[ShowButton.Always=2]="Always"}(jpibfi.ShowButton||(jpibfi.ShowButton={}));jpibfi.ShowButton}(jpibfi||(jpibfi={}));var jpibfi;!function(jpibfi){var PinButtonGenerator=function(){function PinButtonGenerator($,settings,logger){this.$=$,this.settings=settings,this.logger=logger}return PinButtonGenerator.prototype.cancelHide=function($button){clearTimeout($button.data("jpibfi-timeoutId"))},PinButtonGenerator.prototype.hide=function($button,callback){void 0===callback&&(callback=function(){});var timeoutId=($button.data("jpibfi-indexer"),setTimeout(function(){$button.remove(),callback.call(null,null)},100));$button.data("jpibfi-timeoutId",timeoutId)},PinButtonGenerator.prototype.generateForImage=function($image){var indexer=$image.data("jpibfi-indexer"),$anchor=this.$("<a/>",{href:"#","class":"pinit-button","data-jpibfi-indexer":indexer,text:""}),that=this;$anchor.click(function(){var $this=that.$(this);that.logger.logString("Pin In button clicked");var index=that.$(this).data("jpibfi-indexer"),$image=that.$('img[data-jpibfi-indexer="'+index+'"]'),descriptionForUrl="",bookmarkUrl="";if(that.settings.usePostUrl){var $inputWithData=$image.closest(".jpibfi_container").find("input.jpibfi").first();$inputWithData.length&&(descriptionForUrl=$inputWithData.data("jpibfi-description"),bookmarkUrl=$inputWithData.data("jpibfi-url"))}bookmarkUrl=bookmarkUrl||that.settings.pageUrl;var bookmarkDescription=jpibfi.Utils.getDescription($image,that.settings.descriptionOption,that.settings.pageTitle,that.settings.pageDescription,that.settings.siteTitle),imageUrl="http://pinterest.com/pin/create/bookmarklet/?is_video="+encodeURIComponent("false")+"&url="+encodeURIComponent(bookmarkUrl)+"&media="+encodeURIComponent(that.getImageUrl($image))+"&description="+encodeURIComponent(bookmarkDescription);return that.settings.isTouchDevice?($this.attr("href",imageUrl).attr("target","_blank"),!0):(window.open(imageUrl,"_blank","width=632,height=253,status=0,toolbar=0,menubar=0,location=1,scrollbars=1"),!1)});var position=that.calculateButtonPosition($image);return $image.after($anchor),$anchor.css("visibility","hidden").show().offset({left:position.left,top:position.top}).css("visibility","visible"),$anchor},PinButtonGenerator.prototype.getImageUrl=function($elem){var defaultUrl=this.$.fn.prop&&$elem.prop("src")||$elem.attr("src");return this.settings.pinLinkedImages?this.getLinkedImageUrl($elem)||defaultUrl:defaultUrl},PinButtonGenerator.prototype.getLinkedImageUrl=function($element){var $parent=$element.parents("a").first();if($parent.length){var href=$parent.attr("href"),useUrl=!!href&&this.fileExtensionAllowed(this.getFileExtension(href),this.settings.pinLinkedImagesExtensions);if(useUrl)return href}return null},PinButtonGenerator.prototype.getFileExtension=function(url){var parts=url.split(".");return 1==parts.length?"":parts.pop().split(/\#|\?/)[0]},PinButtonGenerator.prototype.fileExtensionAllowed=function(extension,listOfExtensions){if(!listOfExtensions.length)return!0;for(var extensions=listOfExtensions.split(","),i=0;i<extensions.length;i++)if(extensions[i]==extension)return!0;return!1},PinButtonGenerator.prototype.urlInCurrentDomain=function(url){var currentDomain=document.domain.replace(/^www./,"");return-1!=url.indexOf(currentDomain)},PinButtonGenerator.prototype.calculateButtonPosition=function($image){var position=$image.offset(),imageDimensions={width:$image.get(0).clientWidth,height:$image.get(0).clientHeight};switch(this.settings.buttonPosition){case jpibfi.ButtonPosition.TopLeft:position.left+=this.settings.buttonMarginLeft,position.top+=this.settings.buttonMarginTop;break;case jpibfi.ButtonPosition.TopRight:position.top+=this.settings.buttonMarginTop,position.left=position.left+imageDimensions.width-this.settings.buttonMarginRight-this.settings.pinImageWidth;break;case jpibfi.ButtonPosition.BottomLeft:position.left+=this.settings.buttonMarginLeft,position.top=position.top+imageDimensions.height-this.settings.buttonMarginBottom-this.settings.pinImageHeight;break;case jpibfi.ButtonPosition.BottomRight:position.left=position.left+imageDimensions.width-this.settings.buttonMarginRight-this.settings.pinImageWidth,position.top=position.top+imageDimensions.height-this.settings.buttonMarginBottom-this.settings.pinImageHeight;break;case jpibfi.ButtonPosition.Middle:position.left=Math.round(position.left+imageDimensions.width/2-this.settings.pinImageWidth/2),position.top=Math.round(position.top+imageDimensions.height/2-this.settings.pinImageHeight/2)}return position},PinButtonGenerator}();jpibfi.PinButtonGenerator=PinButtonGenerator}(jpibfi||(jpibfi={}));var jpibfi;!function(jpibfi){var Logger=function(){function Logger(printLog){this._printLog=printLog&&"undefined"!=typeof console&&"undefined"!=typeof console.log,this._jsonStringifyExists="undefined"!=typeof JSON&&"function"==typeof JSON.stringify}return Logger.prototype._logObject=function(obj){var out="";for(var p in obj)out+=p+": "+obj[p]+"\n";console.log("jpibfi debug: "+out)},Logger.prototype.logString=function(message){this._printLog&&console.log("jpibfi debug: "+message)},Logger.prototype.logObject=function(obj){this._printLog&&(this._jsonStringifyExists?console.log("jpibfi debugz: "+JSON.stringify(obj,null,4)):this._logObject(obj))},Logger}();jpibfi.Logger=Logger}(jpibfi||(jpibfi={}));var jpibfi;!function(jpibfi){var Settings=function(){function Settings(settings){this.filterSelector="*",this.notSelector="",this.buttonMarginTop=parseInt(settings.buttonMarginTop),this.buttonMarginRight=parseInt(settings.buttonMarginRight),this.buttonMarginBottom=parseInt(settings.buttonMarginBottom),this.buttonMarginLeft=parseInt(settings.buttonMarginLeft),this.buttonPosition=settings.hasOwnProperty("buttonPosition")?parseInt(settings.buttonPosition):4,this.debug=settings.hasOwnProperty("debug")?"1"==settings.debug:!1,this.descriptionOption=settings.hasOwnProperty("descriptionOption")?parseInt(settings.descriptionOption):1,this.imageSelector=this.createImageSelector(settings.imageSelector),this.isTouchDevice="ontouchstart"in window||navigator.hasOwnProperty("maxTouchPoints"),this.minImageWidth=settings.hasOwnProperty("minImageWidth")?parseInt(settings.minImageWidth):0,this.minImageHeight=settings.hasOwnProperty("minImageHeight")?parseInt(settings.minImageHeight):0,this.showButton=settings.hasOwnProperty("showButton")?this.parseShowButtonSettings(settings.showButton):jpibfi.ShowButton.Hover,this.pageDescription=settings.pageDescription,this.pageTitle=settings.pageTitle,this.pageUrl=settings.pageUrl,this.pinImageHeight=parseInt(settings.pinImageHeight),this.pinImageWidth=parseInt(settings.pinImageWidth),this.pinLinkedImages=1==settings.pinLinkedImages,this.pinLinkedImagesExtensions=settings.pinLinkedImagesExtensions,this.retinaFriendly=settings.hasOwnProperty("retinaFriendly")?1==settings.retinaFriendly:!1,this.siteTitle=settings.siteTitle,this.usePostUrl=settings.hasOwnProperty("usePostUrl")?settings.usePostUrl:!0,this.containerSelector=settings.containerSelector,this.notSelector=settings.hasOwnProperty("disabledClasses")?this.createSelectorFromList(settings.disabledClasses):"",this.filterSelector=settings.hasOwnProperty("enabledClasses")?this.createSelectorFromList(settings.enabledClasses)||"*":"*",this.lightbox=new LightboxSettings(settings.lightbox),this.adjustPinImageSize()}return Settings.prototype.adjustPinImageSize=function(){this.retinaFriendly&&(this.pinImageHeight=Math.ceil(this.pinImageHeight/2),this.pinImageWidth=Math.ceil(this.pinImageWidth/2))},Settings.prototype.createImageSelector=function(selector){return selector+",.jpibfi-lightbox img"},Settings.prototype.createSelectorFromList=function(classes){for(var arrayOfClasses=classes.split(";"),selector="",i=0;i<arrayOfClasses.length;i++)arrayOfClasses[i]&&(selector+="."+arrayOfClasses[i]+",");return selector?selector.substr(0,selector.length-1):selector},Settings.prototype.parseShowButtonSettings=function(showButton){switch(showButton){case"always":return jpibfi.ShowButton.Always;case"always_touch":return jpibfi.ShowButton.AlwaysTouch;case"hover":default:return jpibfi.ShowButton.Hover}},Settings}();jpibfi.Settings=Settings;var LightboxSettings=function(){function LightboxSettings(settings){this.descriptionOption=parseInt(settings.descriptionOption),this.enabled=settings.enabled}return LightboxSettings}();jpibfi.LightboxSettings=LightboxSettings}(jpibfi||(jpibfi={}));var jpibfi;!function(jpibfi){var Utils=function(){function Utils(){}return Utils.getDescription=function($image,descriptionOption,pageTitle,pageDescription,siteTitle){return this.getDescriptionValue($image,descriptionOption,pageTitle,pageDescription,siteTitle)||pageTitle},Utils.getDescriptionValue=function($image,descriptionOption,pageTitle,pageDescription,siteTitle){switch(descriptionOption){case 1:return pageTitle;case 2:var $inputWithData=$image.closest(".jpibfi_container").find("input.jpibfi").first(),descriptionForUrl=$inputWithData.data("jpibfi-description");return descriptionForUrl||pageDescription;case 3:return $image.attr("title")||$image.attr("alt");case 4:return siteTitle;case 5:return $image.data("jpibfi-description");case 6:return $image.attr("alt")}},Utils}();jpibfi.Utils=Utils}(jpibfi||(jpibfi={}));var jpibfi;!function(jpibfi){"use strict";var Hover=function(){function Hover($,settings,logger,buttonGenerator){this.$=$,this.settings=settings,this.logger=logger,this.buttonGenerator=buttonGenerator,this._indexer=0,this.ignoreAttributeName="data-jpibfi-ignore",this.ignoreAttributeSelector="["+this.ignoreAttributeName+"]",this.indexerAttributeName="data-jpibfi-indexer",this.indexerAttributeSelector="["+this.indexerAttributeName+"]"}return Hover.prototype.init=function(){var that=this;this.$(document).delegate(that.settings.imageSelector,"mouseenter",function(){var $image=that.$(this);if(!$image.is(that.ignoreAttributeSelector)){var ignoreImage=$image.is(that.settings.notSelector)||$image.is(that.settings.filterSelector)===!1||$image[0].clientWidth<that.settings.minImageWidth||$image[0].clientHeight<that.settings.minImageHeight;if(ignoreImage)return $image.attr(that.ignoreAttributeName,1..toString());var indexer=$image.attr(that.indexerAttributeName);indexer||(indexer=(that._indexer++).toString(),$image.attr(that.indexerAttributeName,indexer));var $button=that.$('a.pinit-button[data-jpibfi-indexer="'+indexer+'"]');if(1==$button.length)that.buttonGenerator.cancelHide($button);else{var $anchor=that.buttonGenerator.generateForImage($image);null!=$anchor&&($anchor.mouseenter(function(){that.buttonGenerator.cancelHide(that.$(this))}),$anchor.mouseleave(function(){that.buttonGenerator.hide(that.$(this),function(){$image.removeClass("pinit-hover")})}),$image.addClass("pinit-hover"))}}}),that.$(document).delegate(that.settings.imageSelector,"mouseleave",function(){var $image=that.$(this),indexer=$image.attr(that.indexerAttributeName);if(indexer){var $button=that.$('a.pinit-button[data-jpibfi-indexer="'+indexer+'"]');that.buttonGenerator.hide($button,function(){$image.removeClass("pinit-hover")})}})},Hover}();jpibfi.Hover=Hover}(jpibfi||(jpibfi={}));var jpibfi;!function(jpibfi){"use strict";var Lightbox=function(){function Lightbox($,settings){this.$=$,this.settings=settings,this.groupClass="jpibfi-group-"}return Lightbox.prototype.init=function(){var that=this;this.$("a:has(img[class*=jpibfi-group-])").each(function(){var $img=that.$(this).find("img"),rel=$img.attr("class").match("jpibfi-group-[0-9]+"),title=jpibfi.Utils.getDescription($img,that.settings.lightbox.descriptionOption,that.settings.pageTitle,that.settings.pageDescription,that.settings.siteTitle);that.$(this).colorbox({className:"jpibfi-lightbox",rel:rel[0],title:title,maxWidth:"95%",maxHeight:"95%",onComplete:function(){that.$(window).trigger("jpibfi-refresh-scroll"),that.$("#cboxTitle").hide(),that.$("#cboxLoadedContent").append(that.$("#cboxTitle").html()).css({color:that.$("#cboxTitle").css("color")}),that.$.fn.colorbox.resize()}})})},Lightbox}();jpibfi.Lightbox=Lightbox}(jpibfi||(jpibfi={}));var jpibfi;!function(jpibfi){"use strict";var Plugin=function(){function Plugin($,options){this.$=$,this.settings=new jpibfi.Settings(this.$.extend({pageUrl:document.URL,pageTitle:document.title,pageDescription:$('meta[name="description"]').attr("content")||""},options)),this.logger=new jpibfi.Logger(this.settings.debug),this.logger.logObject(this.settings),this.buttonGenerator=new jpibfi.PinButtonGenerator(this.$,this.settings,this.logger)}return Plugin.prototype.init=function(){var _this=this;this.addContainers(),this.$(document).scroll(function(){return _this.addContainers()}),this.$(document).ajaxSuccess(function(){return _this.addContainers()});var hover=new jpibfi.Hover(this.$,this.settings,this.logger,this.buttonGenerator);if(hover.init(),this.settings.lightbox.enabled){var lightbox=new jpibfi.Lightbox(this.$,this.settings);lightbox.init()}},Plugin.prototype.addContainers=function(){var $containers=this.$(".jpibfi").not(".jpibfi-ignore");0!=$containers.length&&($containers.closest(this.settings.containerSelector).addClass("jpibfi_container"),$containers.addClass("jpibfi-ignore"))},Plugin}();!function($){$(document).ready(function(){var plugin=new Plugin($,jpibfi_options);plugin.init()})}(jQuery)}(jpibfi||(jpibfi={}));
|
|
js/jquery.colorbox-min.js
DELETED
@@ -1,6 +0,0 @@
|
|
1 |
-
/*!
|
2 |
-
Colorbox 1.6.4
|
3 |
-
license: MIT
|
4 |
-
http://www.jacklmoore.com/colorbox
|
5 |
-
*/
|
6 |
-
(function(t,e,i){function n(i,n,o){var r=e.createElement(i);return n&&(r.id=Z+n),o&&(r.style.cssText=o),t(r)}function o(){return i.innerHeight?i.innerHeight:t(i).height()}function r(e,i){i!==Object(i)&&(i={}),this.cache={},this.el=e,this.value=function(e){var n;return void 0===this.cache[e]&&(n=t(this.el).attr("data-cbox-"+e),void 0!==n?this.cache[e]=n:void 0!==i[e]?this.cache[e]=i[e]:void 0!==X[e]&&(this.cache[e]=X[e])),this.cache[e]},this.get=function(e){var i=this.value(e);return t.isFunction(i)?i.call(this.el,this):i}}function h(t){var e=W.length,i=(A+t)%e;return 0>i?e+i:i}function a(t,e){return Math.round((/%/.test(t)?("x"===e?E.width():o())/100:1)*parseInt(t,10))}function s(t,e){return t.get("photo")||t.get("photoRegex").test(e)}function l(t,e){return t.get("retinaUrl")&&i.devicePixelRatio>1?e.replace(t.get("photoRegex"),t.get("retinaSuffix")):e}function d(t){"contains"in x[0]&&!x[0].contains(t.target)&&t.target!==v[0]&&(t.stopPropagation(),x.focus())}function c(t){c.str!==t&&(x.add(v).removeClass(c.str).addClass(t),c.str=t)}function g(e){A=0,e&&e!==!1&&"nofollow"!==e?(W=t("."+te).filter(function(){var i=t.data(this,Y),n=new r(this,i);return n.get("rel")===e}),A=W.index(_.el),-1===A&&(W=W.add(_.el),A=W.length-1)):W=t(_.el)}function u(i){t(e).trigger(i),ae.triggerHandler(i)}function f(i){var o;if(!G){if(o=t(i).data(Y),_=new r(i,o),g(_.get("rel")),!U){U=$=!0,c(_.get("className")),x.css({visibility:"hidden",display:"block",opacity:""}),I=n(se,"LoadedContent","width:0; height:0; overflow:hidden; visibility:hidden"),b.css({width:"",height:""}).append(I),j=T.height()+k.height()+b.outerHeight(!0)-b.height(),D=C.width()+H.width()+b.outerWidth(!0)-b.width(),N=I.outerHeight(!0),z=I.outerWidth(!0);var h=a(_.get("initialWidth"),"x"),s=a(_.get("initialHeight"),"y"),l=_.get("maxWidth"),f=_.get("maxHeight");_.w=Math.max((l!==!1?Math.min(h,a(l,"x")):h)-z-D,0),_.h=Math.max((f!==!1?Math.min(s,a(f,"y")):s)-N-j,0),I.css({width:"",height:_.h}),J.position(),u(ee),_.get("onOpen"),O.add(F).hide(),x.focus(),_.get("trapFocus")&&e.addEventListener&&(e.addEventListener("focus",d,!0),ae.one(re,function(){e.removeEventListener("focus",d,!0)})),_.get("returnFocus")&&ae.one(re,function(){t(_.el).focus()})}var p=parseFloat(_.get("opacity"));v.css({opacity:p===p?p:"",cursor:_.get("overlayClose")?"pointer":"",visibility:"visible"}).show(),_.get("closeButton")?B.html(_.get("close")).appendTo(b):B.appendTo("<div/>"),w()}}function p(){x||(V=!1,E=t(i),x=n(se).attr({id:Y,"class":t.support.opacity===!1?Z+"IE":"",role:"dialog",tabindex:"-1"}).hide(),v=n(se,"Overlay").hide(),L=t([n(se,"LoadingOverlay")[0],n(se,"LoadingGraphic")[0]]),y=n(se,"Wrapper"),b=n(se,"Content").append(F=n(se,"Title"),R=n(se,"Current"),P=t('<button type="button"/>').attr({id:Z+"Previous"}),K=t('<button type="button"/>').attr({id:Z+"Next"}),S=t('<button type="button"/>').attr({id:Z+"Slideshow"}),L),B=t('<button type="button"/>').attr({id:Z+"Close"}),y.append(n(se).append(n(se,"TopLeft"),T=n(se,"TopCenter"),n(se,"TopRight")),n(se,!1,"clear:left").append(C=n(se,"MiddleLeft"),b,H=n(se,"MiddleRight")),n(se,!1,"clear:left").append(n(se,"BottomLeft"),k=n(se,"BottomCenter"),n(se,"BottomRight"))).find("div div").css({"float":"left"}),M=n(se,!1,"position:absolute; width:9999px; visibility:hidden; display:none; max-width:none;"),O=K.add(P).add(R).add(S)),e.body&&!x.parent().length&&t(e.body).append(v,x.append(y,M))}function m(){function i(t){t.which>1||t.shiftKey||t.altKey||t.metaKey||t.ctrlKey||(t.preventDefault(),f(this))}return x?(V||(V=!0,K.click(function(){J.next()}),P.click(function(){J.prev()}),B.click(function(){J.close()}),v.click(function(){_.get("overlayClose")&&J.close()}),t(e).bind("keydown."+Z,function(t){var e=t.keyCode;U&&_.get("escKey")&&27===e&&(t.preventDefault(),J.close()),U&&_.get("arrowKey")&&W[1]&&!t.altKey&&(37===e?(t.preventDefault(),P.click()):39===e&&(t.preventDefault(),K.click()))}),t.isFunction(t.fn.on)?t(e).on("click."+Z,"."+te,i):t("."+te).live("click."+Z,i)),!0):!1}function w(){var e,o,r,h=J.prep,d=++le;if($=!0,q=!1,u(he),u(ie),_.get("onLoad"),_.h=_.get("height")?a(_.get("height"),"y")-N-j:_.get("innerHeight")&&a(_.get("innerHeight"),"y"),_.w=_.get("width")?a(_.get("width"),"x")-z-D:_.get("innerWidth")&&a(_.get("innerWidth"),"x"),_.mw=_.w,_.mh=_.h,_.get("maxWidth")&&(_.mw=a(_.get("maxWidth"),"x")-z-D,_.mw=_.w&&_.w<_.mw?_.w:_.mw),_.get("maxHeight")&&(_.mh=a(_.get("maxHeight"),"y")-N-j,_.mh=_.h&&_.h<_.mh?_.h:_.mh),e=_.get("href"),Q=setTimeout(function(){L.show()},100),_.get("inline")){var c=t(e).eq(0);r=t("<div>").hide().insertBefore(c),ae.one(he,function(){r.replaceWith(c)}),h(c)}else _.get("iframe")?h(" "):_.get("html")?h(_.get("html")):s(_,e)?(e=l(_,e),q=_.get("createImg"),t(q).addClass(Z+"Photo").bind("error."+Z,function(){h(n(se,"Error").html(_.get("imgError")))}).one("load",function(){d===le&&setTimeout(function(){var e;_.get("retinaImage")&&i.devicePixelRatio>1&&(q.height=q.height/i.devicePixelRatio,q.width=q.width/i.devicePixelRatio),_.get("scalePhotos")&&(o=function(){q.height-=q.height*e,q.width-=q.width*e},_.mw&&q.width>_.mw&&(e=(q.width-_.mw)/q.width,o()),_.mh&&q.height>_.mh&&(e=(q.height-_.mh)/q.height,o())),_.h&&(q.style.marginTop=Math.max(_.mh-q.height,0)/2+"px"),W[1]&&(_.get("loop")||W[A+1])&&(q.style.cursor="pointer",t(q).bind("click."+Z,function(){J.next()})),q.style.width=q.width+"px",q.style.height=q.height+"px",h(q)},1)}),q.src=e):e&&M.load(e,_.get("data"),function(e,i){d===le&&h("error"===i?n(se,"Error").html(_.get("xhrError")):t(this).contents())})}var v,x,y,b,T,C,H,k,W,E,I,M,L,F,R,S,K,P,B,O,_,j,D,N,z,A,q,U,$,G,Q,J,V,X={html:!1,photo:!1,iframe:!1,inline:!1,transition:"elastic",speed:300,fadeOut:300,width:!1,initialWidth:"600",innerWidth:!1,maxWidth:!1,height:!1,initialHeight:"450",innerHeight:!1,maxHeight:!1,scalePhotos:!0,scrolling:!0,opacity:.9,preloading:!0,className:!1,overlayClose:!0,escKey:!0,arrowKey:!0,top:!1,bottom:!1,left:!1,right:!1,fixed:!1,data:void 0,closeButton:!0,fastIframe:!0,open:!1,reposition:!0,loop:!0,slideshow:!1,slideshowAuto:!0,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",photoRegex:/\.(gif|png|jp(e|g|eg)|bmp|ico|webp|jxr|svg)((#|\?).*)?$/i,retinaImage:!1,retinaUrl:!1,retinaSuffix:"@2x.$1",current:"image {current} of {total}",previous:"previous",next:"next",close:"close",xhrError:"This content failed to load.",imgError:"This image failed to load.",returnFocus:!0,trapFocus:!0,onOpen:!1,onLoad:!1,onComplete:!1,onCleanup:!1,onClosed:!1,rel:function(){return this.rel},href:function(){return t(this).attr("href")},title:function(){return this.title},createImg:function(){var e=new Image,i=t(this).data("cbox-img-attrs");return"object"==typeof i&&t.each(i,function(t,i){e[t]=i}),e},createIframe:function(){var i=e.createElement("iframe"),n=t(this).data("cbox-iframe-attrs");return"object"==typeof n&&t.each(n,function(t,e){i[t]=e}),"frameBorder"in i&&(i.frameBorder=0),"allowTransparency"in i&&(i.allowTransparency="true"),i.name=(new Date).getTime(),i.allowFullscreen=!0,i}},Y="colorbox",Z="cbox",te=Z+"Element",ee=Z+"_open",ie=Z+"_load",ne=Z+"_complete",oe=Z+"_cleanup",re=Z+"_closed",he=Z+"_purge",ae=t("<a/>"),se="div",le=0,de={},ce=function(){function t(){clearTimeout(h)}function e(){(_.get("loop")||W[A+1])&&(t(),h=setTimeout(J.next,_.get("slideshowSpeed")))}function i(){S.html(_.get("slideshowStop")).unbind(s).one(s,n),ae.bind(ne,e).bind(ie,t),x.removeClass(a+"off").addClass(a+"on")}function n(){t(),ae.unbind(ne,e).unbind(ie,t),S.html(_.get("slideshowStart")).unbind(s).one(s,function(){J.next(),i()}),x.removeClass(a+"on").addClass(a+"off")}function o(){r=!1,S.hide(),t(),ae.unbind(ne,e).unbind(ie,t),x.removeClass(a+"off "+a+"on")}var r,h,a=Z+"Slideshow_",s="click."+Z;return function(){r?_.get("slideshow")||(ae.unbind(oe,o),o()):_.get("slideshow")&&W[1]&&(r=!0,ae.one(oe,o),_.get("slideshowAuto")?i():n(),S.show())}}();t[Y]||(t(p),J=t.fn[Y]=t[Y]=function(e,i){var n,o=this;return e=e||{},t.isFunction(o)&&(o=t("<a/>"),e.open=!0),o[0]?(p(),m()&&(i&&(e.onComplete=i),o.each(function(){var i=t.data(this,Y)||{};t.data(this,Y,t.extend(i,e))}).addClass(te),n=new r(o[0],e),n.get("open")&&f(o[0])),o):o},J.position=function(e,i){function n(){T[0].style.width=k[0].style.width=b[0].style.width=parseInt(x[0].style.width,10)-D+"px",b[0].style.height=C[0].style.height=H[0].style.height=parseInt(x[0].style.height,10)-j+"px"}var r,h,s,l=0,d=0,c=x.offset();if(E.unbind("resize."+Z),x.css({top:-9e4,left:-9e4}),h=E.scrollTop(),s=E.scrollLeft(),_.get("fixed")?(c.top-=h,c.left-=s,x.css({position:"fixed"})):(l=h,d=s,x.css({position:"absolute"})),d+=_.get("right")!==!1?Math.max(E.width()-_.w-z-D-a(_.get("right"),"x"),0):_.get("left")!==!1?a(_.get("left"),"x"):Math.round(Math.max(E.width()-_.w-z-D,0)/2),l+=_.get("bottom")!==!1?Math.max(o()-_.h-N-j-a(_.get("bottom"),"y"),0):_.get("top")!==!1?a(_.get("top"),"y"):Math.round(Math.max(o()-_.h-N-j,0)/2),x.css({top:c.top,left:c.left,visibility:"visible"}),y[0].style.width=y[0].style.height="9999px",r={width:_.w+z+D,height:_.h+N+j,top:l,left:d},e){var g=0;t.each(r,function(t){return r[t]!==de[t]?(g=e,void 0):void 0}),e=g}de=r,e||x.css(r),x.dequeue().animate(r,{duration:e||0,complete:function(){n(),$=!1,y[0].style.width=_.w+z+D+"px",y[0].style.height=_.h+N+j+"px",_.get("reposition")&&setTimeout(function(){E.bind("resize."+Z,J.position)},1),t.isFunction(i)&&i()},step:n})},J.resize=function(t){var e;U&&(t=t||{},t.width&&(_.w=a(t.width,"x")-z-D),t.innerWidth&&(_.w=a(t.innerWidth,"x")),I.css({width:_.w}),t.height&&(_.h=a(t.height,"y")-N-j),t.innerHeight&&(_.h=a(t.innerHeight,"y")),t.innerHeight||t.height||(e=I.scrollTop(),I.css({height:"auto"}),_.h=I.height()),I.css({height:_.h}),e&&I.scrollTop(e),J.position("none"===_.get("transition")?0:_.get("speed")))},J.prep=function(i){function o(){return _.w=_.w||I.width(),_.w=_.mw&&_.mw<_.w?_.mw:_.w,_.w}function a(){return _.h=_.h||I.height(),_.h=_.mh&&_.mh<_.h?_.mh:_.h,_.h}if(U){var d,g="none"===_.get("transition")?0:_.get("speed");I.remove(),I=n(se,"LoadedContent").append(i),I.hide().appendTo(M.show()).css({width:o(),overflow:_.get("scrolling")?"auto":"hidden"}).css({height:a()}).prependTo(b),M.hide(),t(q).css({"float":"none"}),c(_.get("className")),d=function(){function i(){t.support.opacity===!1&&x[0].style.removeAttribute("filter")}var n,o,a=W.length;U&&(o=function(){clearTimeout(Q),L.hide(),u(ne),_.get("onComplete")},F.html(_.get("title")).show(),I.show(),a>1?("string"==typeof _.get("current")&&R.html(_.get("current").replace("{current}",A+1).replace("{total}",a)).show(),K[_.get("loop")||a-1>A?"show":"hide"]().html(_.get("next")),P[_.get("loop")||A?"show":"hide"]().html(_.get("previous")),ce(),_.get("preloading")&&t.each([h(-1),h(1)],function(){var i,n=W[this],o=new r(n,t.data(n,Y)),h=o.get("href");h&&s(o,h)&&(h=l(o,h),i=e.createElement("img"),i.src=h)})):O.hide(),_.get("iframe")?(n=_.get("createIframe"),_.get("scrolling")||(n.scrolling="no"),t(n).attr({src:_.get("href"),"class":Z+"Iframe"}).one("load",o).appendTo(I),ae.one(he,function(){n.src="//about:blank"}),_.get("fastIframe")&&t(n).trigger("load")):o(),"fade"===_.get("transition")?x.fadeTo(g,1,i):i())},"fade"===_.get("transition")?x.fadeTo(g,0,function(){J.position(0,d)}):J.position(g,d)}},J.next=function(){!$&&W[1]&&(_.get("loop")||W[A+1])&&(A=h(1),f(W[A]))},J.prev=function(){!$&&W[1]&&(_.get("loop")||A)&&(A=h(-1),f(W[A]))},J.close=function(){U&&!G&&(G=!0,U=!1,u(oe),_.get("onCleanup"),E.unbind("."+Z),v.fadeTo(_.get("fadeOut")||0,0),x.stop().fadeTo(_.get("fadeOut")||0,0,function(){x.hide(),v.hide(),u(he),I.remove(),setTimeout(function(){G=!1,u(re),_.get("onClosed")},1)}))},J.remove=function(){x&&(x.stop(),t[Y].close(),x.stop(!1,!0).remove(),v.remove(),G=!1,x=null,t("."+te).removeData(Y).removeClass(te),t(e).unbind("click."+Z).unbind("keydown."+Z))},J.element=function(){return t(_.el)},J.settings=X)})(jQuery,document,window);
|
|
|
|
|
|
|
|
|
|
|
|
js/upload-button-new.js
DELETED
@@ -1,38 +0,0 @@
|
|
1 |
-
jQuery(document).ready(function($) {
|
2 |
-
|
3 |
-
//Uploading media using new media uploader (Wordpress 3.5+)
|
4 |
-
|
5 |
-
var file_frame;
|
6 |
-
|
7 |
-
$('#upload-image').click(function(e) {
|
8 |
-
e.preventDefault();
|
9 |
-
|
10 |
-
// If the media frame already exists, reopen it.
|
11 |
-
if ( file_frame ) {
|
12 |
-
file_frame.open();
|
13 |
-
return;
|
14 |
-
}
|
15 |
-
|
16 |
-
// Create the media frame.
|
17 |
-
file_frame = wp.media.frames.file_frame = wp.media({
|
18 |
-
title: 'Select your custom "Pin It" button',
|
19 |
-
button: {
|
20 |
-
text: 'Use as "Pin It" button'
|
21 |
-
},
|
22 |
-
multiple: false // Set to true to allow multiple files to be selected
|
23 |
-
});
|
24 |
-
|
25 |
-
// When an image is selected, run a callback.
|
26 |
-
file_frame.on( 'select', function() {
|
27 |
-
// We set multiple to false so only get one image from the uploader
|
28 |
-
var image = file_frame.state().get('selection').first().toJSON();
|
29 |
-
|
30 |
-
$("#custom_image_url").val(image.url);
|
31 |
-
$("#custom_image_width").val(image.width);
|
32 |
-
$("#custom_image_height").val(image.height);
|
33 |
-
});
|
34 |
-
|
35 |
-
file_frame.open();
|
36 |
-
});
|
37 |
-
|
38 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/upload-button-old.js
DELETED
@@ -1,25 +0,0 @@
|
|
1 |
-
jQuery(document).ready(function($) {
|
2 |
-
|
3 |
-
//Uploading media using old media uploader
|
4 |
-
|
5 |
-
$('#upload-image').click(function() {
|
6 |
-
|
7 |
-
tb_show('Choose an image and click "Insert into post"', 'media-upload.php?referer=jpibfi&type=image&TB_iframe=true&post_id=0', false);
|
8 |
-
|
9 |
-
// Re-define the global function 'send_to_editor'
|
10 |
-
// Define where the new value will be sent to
|
11 |
-
window.send_to_editor = function(html) {
|
12 |
-
|
13 |
-
// Get the URL of new image
|
14 |
-
var domElement = new DOMParser().parseFromString("<p>" + html + "</p>", "text/xml");
|
15 |
-
var image = $('img', domElement);
|
16 |
-
$("#custom_image_url").val(image.attr('src'));
|
17 |
-
$("#custom_image_width").val(image.attr('width'));
|
18 |
-
$("#custom_image_height").val(image.attr('height'));
|
19 |
-
|
20 |
-
tb_remove(); // Then close the popup window
|
21 |
-
}
|
22 |
-
return false;
|
23 |
-
});
|
24 |
-
|
25 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
languages/jquery-pin-it-button-for-images.pot
CHANGED
@@ -13,444 +13,339 @@ msgstr ""
|
|
13 |
"X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
|
14 |
"X-Poedit-SearchPath-0: .\n"
|
15 |
"X-Poedit-SearchPathExcluded-0: *.js\n"
|
16 |
-
"Plural-Forms: nplurals=2; plural=(n != 1);\n
|
17 |
-
|
18 |
-
#: includes/admin/class-jpibfi-admin.php:165, includes/admin/class-jpibfi-selection-options.php:121
|
19 |
-
msgid "Selection"
|
20 |
-
msgstr ""
|
21 |
-
|
22 |
-
#: includes/admin/class-jpibfi-admin.php:173, includes/admin/class-jpibfi-visual-options.php:147
|
23 |
-
msgid "Visual"
|
24 |
-
msgstr ""
|
25 |
-
|
26 |
-
#: includes/admin/class-jpibfi-admin.php:181
|
27 |
-
msgid "Advanced"
|
28 |
-
msgstr ""
|
29 |
-
|
30 |
-
#: includes/admin/class-jpibfi-admin.php:189
|
31 |
-
msgid "Import/Export"
|
32 |
-
msgstr ""
|
33 |
-
|
34 |
-
#: includes/admin/class-jpibfi-admin.php:197
|
35 |
-
msgid "Lightbox"
|
36 |
-
msgstr ""
|
37 |
-
|
38 |
-
#: includes/admin/class-jpibfi-admin.php:235, jquery-pin-it-button-for-images.php:137
|
39 |
msgid "Settings"
|
40 |
msgstr ""
|
41 |
|
42 |
-
#: includes/admin/class-jpibfi-admin.php:
|
43 |
-
msgid "
|
44 |
msgstr ""
|
45 |
|
46 |
-
#: includes/admin/class-jpibfi-admin.php:
|
47 |
-
msgid "
|
48 |
msgstr ""
|
49 |
|
50 |
-
#: includes/admin/class-jpibfi-
|
51 |
-
msgid "
|
52 |
-
msgstr ""
|
53 |
-
|
54 |
-
#: includes/admin/class-jpibfi-advanced-options.php:97
|
55 |
-
msgid "Debug"
|
56 |
-
msgstr ""
|
57 |
-
|
58 |
-
#: includes/admin/class-jpibfi-advanced-options.php:107
|
59 |
-
msgid "Use debug mode only if you are experiencing some issues with the plugin and you are reporting them to the developer of the plugin"
|
60 |
-
msgstr ""
|
61 |
-
|
62 |
-
#: includes/admin/class-jpibfi-advanced-options.php:119
|
63 |
-
msgid "Container selector"
|
64 |
-
msgstr ""
|
65 |
-
|
66 |
-
#: includes/admin/class-jpibfi-advanced-options.php:129
|
67 |
-
msgid "This is the selector used to find the container that holds the entire single post. It looks for an element that is a parent of the content of the post. Usually it's a div or article element. This setting is important to making \"Use post url\" visual setting work properly."
|
68 |
-
msgstr ""
|
69 |
-
|
70 |
-
#: includes/admin/class-jpibfi-advanced-options.php:151
|
71 |
-
msgid "Advanced settings"
|
72 |
msgstr ""
|
73 |
|
74 |
-
#: includes/admin/class-jpibfi-
|
75 |
-
msgid "
|
76 |
msgstr ""
|
77 |
|
78 |
-
#: includes/admin/class-jpibfi-
|
79 |
-
msgid "
|
80 |
msgstr ""
|
81 |
|
82 |
-
#: includes/admin/class-jpibfi-import-export.php:
|
83 |
msgid "The file did not upload properly. Please try again."
|
84 |
msgstr ""
|
85 |
|
86 |
-
#: includes/admin/class-jpibfi-import-export.php:
|
87 |
msgid "The export file could not be found at <code>%s</code>. It is likely that this was caused by a permissions problem."
|
88 |
msgstr ""
|
89 |
|
90 |
-
#: includes/admin/class-jpibfi-import-export.php:
|
91 |
msgid "The path is not a file, please try again."
|
92 |
msgstr ""
|
93 |
|
94 |
-
#: includes/admin/class-jpibfi-import-export.php:
|
95 |
-
msgid "Import/Export Settings"
|
96 |
-
msgstr ""
|
97 |
-
|
98 |
-
#: includes/admin/class-jpibfi-import-export.php:283
|
99 |
msgid "Export"
|
100 |
msgstr ""
|
101 |
|
102 |
-
#: includes/admin/class-jpibfi-import-export.php:
|
103 |
-
msgid "Import"
|
104 |
-
msgstr ""
|
105 |
-
|
106 |
-
#: includes/admin/class-jpibfi-import-export.php:333
|
107 |
msgid "Download Export File"
|
108 |
msgstr ""
|
109 |
|
110 |
-
#: includes/admin/class-jpibfi-import-export.php:
|
111 |
-
msgid "
|
112 |
-
msgstr ""
|
113 |
-
|
114 |
-
#: includes/admin/class-jpibfi-lightbox-options.php:81
|
115 |
-
msgid "Lightbox Settings"
|
116 |
-
msgstr ""
|
117 |
-
|
118 |
-
#: includes/admin/class-jpibfi-lightbox-options.php:95
|
119 |
-
msgid "Enabled"
|
120 |
-
msgstr ""
|
121 |
-
|
122 |
-
#: includes/admin/class-jpibfi-lightbox-options.php:105
|
123 |
-
msgid "Activate lightbox in posts"
|
124 |
msgstr ""
|
125 |
|
126 |
-
#: includes/admin/class-jpibfi-
|
127 |
-
msgid "
|
128 |
msgstr ""
|
129 |
|
130 |
-
#: includes/admin/class-jpibfi-
|
131 |
-
msgid "
|
132 |
msgstr ""
|
133 |
|
134 |
-
#: includes/admin/class-jpibfi-
|
135 |
-
msgid "
|
136 |
msgstr ""
|
137 |
|
138 |
-
#: includes/admin/class-jpibfi-
|
139 |
-
msgid "
|
140 |
msgstr ""
|
141 |
|
142 |
-
#: includes/admin/
|
143 |
-
msgid "
|
144 |
msgstr ""
|
145 |
|
146 |
-
#: includes/admin/
|
147 |
-
msgid "
|
148 |
msgstr ""
|
149 |
|
150 |
-
#: includes/admin/
|
151 |
-
msgid "
|
152 |
msgstr ""
|
153 |
|
154 |
-
#: includes/admin/
|
155 |
-
msgid "
|
156 |
msgstr ""
|
157 |
|
158 |
-
#: includes/admin/
|
159 |
-
msgid "
|
160 |
msgstr ""
|
161 |
|
162 |
-
#: includes/admin/
|
163 |
-
msgid "
|
164 |
msgstr ""
|
165 |
|
166 |
-
#: includes/admin/class-jpibfi-selection-
|
167 |
msgid "Image selector"
|
168 |
msgstr ""
|
169 |
|
170 |
-
#: includes/admin/class-jpibfi-selection-
|
171 |
msgid "jQuery selector for all the images that should have the \"Pin it\" button. Set the value to %s if you want the \"Pin it\" button to appear only on images in content or %s to appear on all images on site (including sidebar, header and footer). If you know a thing or two about jQuery, you might use your own selector. %sClick here%s to read about jQuery selectors."
|
172 |
msgstr ""
|
173 |
|
174 |
-
#: includes/admin/class-jpibfi-selection-
|
175 |
msgid "Disabled classes"
|
176 |
msgstr ""
|
177 |
|
178 |
-
#: includes/admin/class-jpibfi-selection-
|
179 |
msgid "Pictures with these CSS classes won't show the \"Pin it\" button. Please separate multiple classes with semicolons. Spaces are not accepted."
|
180 |
msgstr ""
|
181 |
|
182 |
-
#: includes/admin/class-jpibfi-selection-
|
183 |
msgid "Enabled classes"
|
184 |
msgstr ""
|
185 |
|
186 |
-
#: includes/admin/class-jpibfi-selection-
|
187 |
msgid "Only pictures with these CSS classes will show the \"Pin it\" button. Please separate multiple classes with semicolons. If this field is empty, images with any (besides disabled ones) classes will show the Pin It button."
|
188 |
msgstr ""
|
189 |
|
190 |
-
#: includes/admin/class-jpibfi-selection-
|
191 |
-
msgid "
|
192 |
msgstr ""
|
193 |
|
194 |
-
#: includes/admin/class-jpibfi-selection-
|
195 |
-
msgid "
|
196 |
msgstr ""
|
197 |
|
198 |
-
#: includes/admin/class-jpibfi-selection-
|
199 |
-
msgid "
|
200 |
msgstr ""
|
201 |
|
202 |
-
#: includes/admin/class-jpibfi-selection-
|
203 |
-
msgid "
|
204 |
msgstr ""
|
205 |
|
206 |
-
#: includes/admin/class-jpibfi-selection-
|
207 |
-
msgid "
|
208 |
msgstr ""
|
209 |
|
210 |
-
#: includes/admin/
|
211 |
-
msgid "
|
212 |
msgstr ""
|
213 |
|
214 |
-
#: includes/admin/
|
215 |
-
msgid "
|
216 |
msgstr ""
|
217 |
|
218 |
-
#: includes/admin/
|
219 |
-
msgid "
|
220 |
msgstr ""
|
221 |
|
222 |
-
#: includes/admin/class-jpibfi-selection-
|
223 |
-
msgid "
|
224 |
msgstr ""
|
225 |
|
226 |
-
#: includes/admin/class-jpibfi-
|
227 |
-
msgid "
|
228 |
msgstr ""
|
229 |
|
230 |
-
#: includes/admin/class-jpibfi-
|
231 |
-
msgid "
|
232 |
msgstr ""
|
233 |
|
234 |
-
#: includes/admin/class-jpibfi-
|
235 |
-
msgid "
|
236 |
msgstr ""
|
237 |
|
238 |
-
#: includes/admin/class-jpibfi-
|
239 |
-
msgid "
|
240 |
msgstr ""
|
241 |
|
242 |
-
#: includes/admin/class-jpibfi-
|
243 |
-
msgid "
|
244 |
msgstr ""
|
245 |
|
246 |
-
#: includes/admin/
|
247 |
-
msgid "
|
248 |
msgstr ""
|
249 |
|
250 |
-
#: includes/admin/class-jpibfi-
|
251 |
-
msgid "the
|
252 |
msgstr ""
|
253 |
|
254 |
-
#: includes/admin/class-jpibfi-
|
255 |
-
msgid "
|
256 |
msgstr ""
|
257 |
|
258 |
-
#: includes/admin/class-jpibfi-
|
259 |
-
msgid "
|
260 |
msgstr ""
|
261 |
|
262 |
-
#: includes/admin/
|
263 |
-
msgid "
|
264 |
msgstr ""
|
265 |
|
266 |
-
#: includes/admin/class-jpibfi-visual-
|
267 |
-
msgid "
|
268 |
msgstr ""
|
269 |
|
270 |
-
#: includes/admin/class-jpibfi-visual-
|
271 |
-
msgid "
|
272 |
msgstr ""
|
273 |
|
274 |
-
#: includes/admin/class-jpibfi-visual-
|
275 |
-
msgid "
|
276 |
msgstr ""
|
277 |
|
278 |
-
#: includes/admin/class-jpibfi-visual-
|
279 |
-
msgid "
|
280 |
msgstr ""
|
281 |
|
282 |
-
#: includes/admin/class-jpibfi-visual-
|
283 |
-
msgid "
|
284 |
msgstr ""
|
285 |
|
286 |
-
#: includes/admin/class-jpibfi-visual-
|
287 |
-
msgid "
|
288 |
msgstr ""
|
289 |
|
290 |
-
#: includes/admin/class-jpibfi-visual-
|
291 |
-
msgid "
|
292 |
msgstr ""
|
293 |
|
294 |
-
#: includes/admin/class-jpibfi-visual-
|
295 |
-
msgid "
|
296 |
msgstr ""
|
297 |
|
298 |
-
#: includes/admin/class-jpibfi-visual-
|
299 |
-
msgid "
|
300 |
msgstr ""
|
301 |
|
302 |
-
#: includes/admin/class-jpibfi-visual-
|
303 |
-
msgid "
|
304 |
msgstr ""
|
305 |
|
306 |
-
#: includes/admin/class-jpibfi-visual-
|
307 |
-
msgid "
|
308 |
msgstr ""
|
309 |
|
310 |
-
#: includes/admin/class-jpibfi-visual-
|
311 |
-
msgid "
|
312 |
msgstr ""
|
313 |
|
314 |
-
#: includes/admin/class-jpibfi-visual-
|
315 |
-
msgid "\"Pin it\" button
|
316 |
msgstr ""
|
317 |
|
318 |
-
#: includes/admin/class-jpibfi-visual-
|
319 |
-
msgid "
|
320 |
msgstr ""
|
321 |
|
322 |
-
#: includes/admin/
|
323 |
-
msgid "
|
324 |
msgstr ""
|
325 |
|
326 |
-
#: includes/admin/
|
327 |
-
msgid "
|
328 |
msgstr ""
|
329 |
|
330 |
-
#: includes/admin/
|
331 |
-
msgid "
|
332 |
msgstr ""
|
333 |
|
334 |
-
#: includes/admin/class-jpibfi-visual-
|
335 |
-
msgid "
|
336 |
msgstr ""
|
337 |
|
338 |
-
#: includes/admin/class-jpibfi-visual-
|
339 |
-
msgid "
|
340 |
msgstr ""
|
341 |
|
342 |
-
#: includes/admin/class-jpibfi-visual-
|
343 |
-
msgid "
|
344 |
msgstr ""
|
345 |
|
346 |
-
#: includes/admin/class-jpibfi-visual-
|
347 |
-
msgid "
|
348 |
msgstr ""
|
349 |
|
350 |
-
#: includes/admin/class-jpibfi-visual-
|
351 |
-
msgid "
|
352 |
msgstr ""
|
353 |
|
354 |
-
#: includes/admin/class-jpibfi-visual-
|
355 |
-
msgid "
|
356 |
msgstr ""
|
357 |
|
358 |
-
#: includes/admin/class-jpibfi-visual-
|
359 |
-
msgid "
|
360 |
msgstr ""
|
361 |
|
362 |
-
#: includes/admin/class-jpibfi-visual-
|
363 |
-
msgid "
|
364 |
msgstr ""
|
365 |
|
366 |
-
#: includes/admin/class-jpibfi-visual-
|
367 |
-
msgid "
|
368 |
msgstr ""
|
369 |
|
370 |
-
#: includes/admin/class-jpibfi-visual-
|
371 |
-
msgid "
|
372 |
msgstr ""
|
373 |
|
374 |
-
#: includes/admin/class-jpibfi-visual-
|
375 |
-
msgid "
|
376 |
msgstr ""
|
377 |
|
378 |
-
#: includes/admin/class-jpibfi-visual-
|
379 |
-
msgid "
|
380 |
msgstr ""
|
381 |
|
382 |
-
#: includes/admin/class-jpibfi-visual-
|
383 |
msgid "Choose transparency (between %.02f and %.02f)"
|
384 |
msgstr ""
|
385 |
|
386 |
-
#: includes/admin/class-jpibfi-visual-
|
387 |
msgid "Use custom image"
|
388 |
msgstr ""
|
389 |
|
390 |
-
#: includes/admin/class-jpibfi-visual-
|
391 |
-
msgid "Upload an image using media library"
|
392 |
-
msgstr ""
|
393 |
-
|
394 |
-
#: includes/admin/class-jpibfi-visual-options.php:565
|
395 |
msgid "URL address of the image"
|
396 |
msgstr ""
|
397 |
|
398 |
-
#: includes/admin/class-jpibfi-visual-
|
399 |
-
msgid "
|
400 |
-
msgstr ""
|
401 |
-
|
402 |
-
#: includes/admin/class-jpibfi-visual-options.php:611
|
403 |
-
msgid "Refresh preview"
|
404 |
-
msgstr ""
|
405 |
-
|
406 |
-
#: includes/admin/class-jpibfi-visual-options.php:637
|
407 |
-
msgid "Top right"
|
408 |
-
msgstr ""
|
409 |
-
|
410 |
-
#: includes/admin/class-jpibfi-visual-options.php:639
|
411 |
-
msgid "Bottom left"
|
412 |
-
msgstr ""
|
413 |
-
|
414 |
-
#: includes/admin/class-jpibfi-visual-options.php:683
|
415 |
-
msgid "Top"
|
416 |
-
msgstr ""
|
417 |
-
|
418 |
-
#: includes/admin/class-jpibfi-visual-options.php:687
|
419 |
-
msgid "Bottom"
|
420 |
-
msgstr ""
|
421 |
-
|
422 |
-
#: includes/admin/class-jpibfi-visual-options.php:691
|
423 |
-
msgid "Left"
|
424 |
-
msgstr ""
|
425 |
-
|
426 |
-
#: includes/admin/class-jpibfi-visual-options.php:695
|
427 |
-
msgid "Right"
|
428 |
-
msgstr ""
|
429 |
-
|
430 |
-
#: includes/admin/class-jpibfi-visual-options.php:721
|
431 |
-
msgid "Optimize for high pixel density displays"
|
432 |
msgstr ""
|
433 |
|
434 |
-
#: includes/admin/class-jpibfi-visual-
|
435 |
msgid "Custom image height"
|
436 |
msgstr ""
|
437 |
|
438 |
-
#: includes/admin/class-jpibfi-visual-
|
439 |
msgid "Custom image width"
|
440 |
msgstr ""
|
441 |
|
442 |
-
#: includes/admin/class-jpibfi-visual-
|
443 |
-
msgid "
|
444 |
msgstr ""
|
445 |
|
446 |
-
#: includes/admin/
|
447 |
-
msgid "
|
448 |
-
msgstr ""
|
449 |
-
|
450 |
-
#: includes/admin/views/admin.php:45
|
451 |
-
msgid "How to Get The Most Out of JPIBFI"
|
452 |
-
msgstr ""
|
453 |
-
|
454 |
-
#: includes/admin/views/admin.php:47
|
455 |
-
msgid "Support forum"
|
456 |
msgstr ""
|
13 |
"X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
|
14 |
"X-Poedit-SearchPath-0: .\n"
|
15 |
"X-Poedit-SearchPathExcluded-0: *.js\n"
|
16 |
+
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
17 |
+
#: includes/admin/class-jpibfi-admin.php:63
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
msgid "Settings"
|
19 |
msgstr ""
|
20 |
|
21 |
+
#: includes/admin/class-jpibfi-admin.php:191
|
22 |
+
msgid "Save Changes"
|
23 |
msgstr ""
|
24 |
|
25 |
+
#: includes/admin/class-jpibfi-admin.php:195
|
26 |
+
msgid "Saving changes ..."
|
27 |
msgstr ""
|
28 |
|
29 |
+
#: includes/admin/class-jpibfi-admin.php:251
|
30 |
+
msgid "jQuery Pin It Button For Images Options"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
msgstr ""
|
32 |
|
33 |
+
#: includes/admin/class-jpibfi-admin.php:275
|
34 |
+
msgid "Lightbox feature has been transferred to another plugin. Click <a target=\"_blank\" href=\"%s\">here</a> to learn more."
|
35 |
msgstr ""
|
36 |
|
37 |
+
#: includes/admin/class-jpibfi-admin.php:323
|
38 |
+
msgid "jQuery Pin It Button for Images Pro is available. Click <a target=\"_blank\" href=\"%s\">here</a> to learn more."
|
39 |
msgstr ""
|
40 |
|
41 |
+
#: includes/admin/settings/class-jpibfi-import-export-settings.php:53
|
42 |
msgid "The file did not upload properly. Please try again."
|
43 |
msgstr ""
|
44 |
|
45 |
+
#: includes/admin/settings/class-jpibfi-import-export-settings.php:67
|
46 |
msgid "The export file could not be found at <code>%s</code>. It is likely that this was caused by a permissions problem."
|
47 |
msgstr ""
|
48 |
|
49 |
+
#: includes/admin/settings/class-jpibfi-import-export-settings.php:81
|
50 |
msgid "The path is not a file, please try again."
|
51 |
msgstr ""
|
52 |
|
53 |
+
#: includes/admin/settings/class-jpibfi-import-export-settings.php:127
|
|
|
|
|
|
|
|
|
54 |
msgid "Export"
|
55 |
msgstr ""
|
56 |
|
57 |
+
#: includes/admin/settings/class-jpibfi-import-export-settings.php:131
|
|
|
|
|
|
|
|
|
58 |
msgid "Download Export File"
|
59 |
msgstr ""
|
60 |
|
61 |
+
#: includes/admin/settings/class-jpibfi-import-export-settings.php:135
|
62 |
+
msgid "Import"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
msgstr ""
|
64 |
|
65 |
+
#: includes/admin/settings/class-jpibfi-import-export-settings.php:137
|
66 |
+
msgid "Import Settings"
|
67 |
msgstr ""
|
68 |
|
69 |
+
#: includes/admin/settings/class-jpibfi-import-export-settings.php:153
|
70 |
+
msgid "Import/Export Settings"
|
71 |
msgstr ""
|
72 |
|
73 |
+
#: includes/admin/settings/class-jpibfi-selection-settings.php:11
|
74 |
+
msgid "Selection settings"
|
75 |
msgstr ""
|
76 |
|
77 |
+
#: includes/admin/settings/class-jpibfi-selection-settings.php:13
|
78 |
+
msgid "Minimum image resolution"
|
79 |
msgstr ""
|
80 |
|
81 |
+
#: includes/admin/settings/class-jpibfi-selection-settings.php:15
|
82 |
+
msgid "Use this settings to hide the \"Pin it\" button on small images (e.g. social media icons)."
|
83 |
msgstr ""
|
84 |
|
85 |
+
#: includes/admin/settings/class-jpibfi-selection-settings.php:17
|
86 |
+
msgid "* - screen that is less than 768 pixels wide"
|
87 |
msgstr ""
|
88 |
|
89 |
+
#: includes/admin/settings/class-jpibfi-selection-settings.php:19
|
90 |
+
msgid "For small screens* the \"Pin it\" button will show up if the image is at least %% pixels high and %% pixels wide."
|
91 |
msgstr ""
|
92 |
|
93 |
+
#: includes/admin/settings/class-jpibfi-selection-settings.php:21
|
94 |
+
msgid "Otherwise, the \"Pin it\" button will show up if the image is at least %% pixels high and %% pixels wide."
|
95 |
msgstr ""
|
96 |
|
97 |
+
#: includes/admin/settings/class-jpibfi-selection-settings.php:25
|
98 |
+
msgid "On which pages the \"Pin it\" button should be shown"
|
99 |
msgstr ""
|
100 |
|
101 |
+
#: includes/admin/settings/class-jpibfi-selection-settings.php:59
|
102 |
+
msgid "Selection"
|
103 |
msgstr ""
|
104 |
|
105 |
+
#: includes/admin/settings/class-jpibfi-selection-settings.php:85
|
106 |
msgid "Image selector"
|
107 |
msgstr ""
|
108 |
|
109 |
+
#: includes/admin/settings/class-jpibfi-selection-settings.php:87
|
110 |
msgid "jQuery selector for all the images that should have the \"Pin it\" button. Set the value to %s if you want the \"Pin it\" button to appear only on images in content or %s to appear on all images on site (including sidebar, header and footer). If you know a thing or two about jQuery, you might use your own selector. %sClick here%s to read about jQuery selectors."
|
111 |
msgstr ""
|
112 |
|
113 |
+
#: includes/admin/settings/class-jpibfi-selection-settings.php:107, includes/admin/settings/class-jpibfi-selection-settings.php:207
|
114 |
msgid "Disabled classes"
|
115 |
msgstr ""
|
116 |
|
117 |
+
#: includes/admin/settings/class-jpibfi-selection-settings.php:109
|
118 |
msgid "Pictures with these CSS classes won't show the \"Pin it\" button. Please separate multiple classes with semicolons. Spaces are not accepted."
|
119 |
msgstr ""
|
120 |
|
121 |
+
#: includes/admin/settings/class-jpibfi-selection-settings.php:119, includes/admin/settings/class-jpibfi-selection-settings.php:209
|
122 |
msgid "Enabled classes"
|
123 |
msgstr ""
|
124 |
|
125 |
+
#: includes/admin/settings/class-jpibfi-selection-settings.php:121
|
126 |
msgid "Only pictures with these CSS classes will show the \"Pin it\" button. Please separate multiple classes with semicolons. If this field is empty, images with any (besides disabled ones) classes will show the Pin It button."
|
127 |
msgstr ""
|
128 |
|
129 |
+
#: includes/admin/settings/class-jpibfi-selection-settings.php:129, includes/admin/settings/class-jpibfi-selection-settings.php:135, includes/admin/settings/class-jpibfi-visual-settings.php:225
|
130 |
+
msgid "Height"
|
131 |
msgstr ""
|
132 |
|
133 |
+
#: includes/admin/settings/class-jpibfi-selection-settings.php:131, includes/admin/settings/class-jpibfi-selection-settings.php:137, includes/admin/settings/class-jpibfi-visual-settings.php:227
|
134 |
+
msgid "Width"
|
135 |
msgstr ""
|
136 |
|
137 |
+
#: includes/admin/settings/class-jpibfi-selection-settings.php:145
|
138 |
+
msgid "Show on"
|
139 |
msgstr ""
|
140 |
|
141 |
+
#: includes/admin/settings/class-jpibfi-selection-settings.php:155
|
142 |
+
msgid "Disable on"
|
143 |
msgstr ""
|
144 |
|
145 |
+
#: includes/admin/settings/class-jpibfi-selection-settings.php:211
|
146 |
+
msgid "the given value doesn't meet the requirements. Please correct it and try again."
|
147 |
msgstr ""
|
148 |
|
149 |
+
#: includes/admin/settings/class-jpibfi-selection-settings.php:223
|
150 |
+
msgid "Minimum image height"
|
151 |
msgstr ""
|
152 |
|
153 |
+
#: includes/admin/settings/class-jpibfi-selection-settings.php:225
|
154 |
+
msgid "Minimum image width"
|
155 |
msgstr ""
|
156 |
|
157 |
+
#: includes/admin/settings/class-jpibfi-selection-settings.php:227
|
158 |
+
msgid "value must be a number greater or equal to %d."
|
159 |
msgstr ""
|
160 |
|
161 |
+
#: includes/admin/settings/class-jpibfi-selection-settings.php:259, includes/admin/settings/class-jpibfi-settings-base.php:235, includes/admin/settings/class-jpibfi-visual-settings.php:327
|
162 |
+
msgid "Settings saved."
|
163 |
msgstr ""
|
164 |
|
165 |
+
#: includes/admin/settings/class-jpibfi-visual-settings.php:11
|
166 |
+
msgid "\"Pin it\" button margins"
|
167 |
msgstr ""
|
168 |
|
169 |
+
#: includes/admin/settings/class-jpibfi-visual-settings.php:13
|
170 |
+
msgid "Margins are used to adjust the position of the \"Pin it\" button, but not all margins are used on all button positions. Here is an example. If you're using the \"%s\" position, the button's position will be affected only by top and left margins. Bottom and right margins affect \"%s\" position, etc. The \"%s\" position does not use any margins at all."
|
171 |
msgstr ""
|
172 |
|
173 |
+
#: includes/admin/settings/class-jpibfi-visual-settings.php:15, includes/admin/settings/class-jpibfi-visual-settings.php:123
|
174 |
+
msgid "Top left"
|
175 |
msgstr ""
|
176 |
|
177 |
+
#: includes/admin/settings/class-jpibfi-visual-settings.php:17, includes/admin/settings/class-jpibfi-visual-settings.php:129
|
178 |
+
msgid "Bottom right"
|
179 |
msgstr ""
|
180 |
|
181 |
+
#: includes/admin/settings/class-jpibfi-visual-settings.php:19, includes/admin/settings/class-jpibfi-visual-settings.php:131
|
182 |
+
msgid "Middle"
|
183 |
msgstr ""
|
184 |
|
185 |
+
#: includes/admin/settings/class-jpibfi-visual-settings.php:23
|
186 |
+
msgid "Custom \"Pin It\" button"
|
187 |
msgstr ""
|
188 |
|
189 |
+
#: includes/admin/settings/class-jpibfi-visual-settings.php:25
|
190 |
+
msgid "Check the <b>Use custom image</b> checkbox, specify image's URL, height and width to use your own Pinterest button design. You can just upload an image using Wordpress media library if you wish."
|
191 |
msgstr ""
|
192 |
|
193 |
+
#: includes/admin/settings/class-jpibfi-visual-settings.php:27
|
194 |
+
msgid "Custom Pin It button preview"
|
195 |
msgstr ""
|
196 |
|
197 |
+
#: includes/admin/settings/class-jpibfi-visual-settings.php:29
|
198 |
+
msgid "Upload an image using media library"
|
199 |
msgstr ""
|
200 |
|
201 |
+
#: includes/admin/settings/class-jpibfi-visual-settings.php:31
|
202 |
+
msgid "Select your custom \"Pin It\" button"
|
203 |
msgstr ""
|
204 |
|
205 |
+
#: includes/admin/settings/class-jpibfi-visual-settings.php:33
|
206 |
+
msgid "Use as \"Pin It\" button"
|
207 |
msgstr ""
|
208 |
|
209 |
+
#: includes/admin/settings/class-jpibfi-visual-settings.php:35
|
210 |
+
msgid "This feature is disabled in this version of the plugin. Consider buying <a target=\"_blank\" href=\"%s\">the PRO version</a>."
|
211 |
msgstr ""
|
212 |
|
213 |
+
#: includes/admin/settings/class-jpibfi-visual-settings.php:51
|
214 |
+
msgid "Visual"
|
215 |
msgstr ""
|
216 |
|
217 |
+
#: includes/admin/settings/class-jpibfi-visual-settings.php:85
|
218 |
+
msgid "Show button"
|
219 |
msgstr ""
|
220 |
|
221 |
+
#: includes/admin/settings/class-jpibfi-visual-settings.php:89
|
222 |
+
msgid "On hover"
|
223 |
msgstr ""
|
224 |
|
225 |
+
#: includes/admin/settings/class-jpibfi-visual-settings.php:91
|
226 |
+
msgid "Always on touch devices"
|
227 |
msgstr ""
|
228 |
|
229 |
+
#: includes/admin/settings/class-jpibfi-visual-settings.php:93
|
230 |
+
msgid "Always"
|
231 |
msgstr ""
|
232 |
|
233 |
+
#: includes/admin/settings/class-jpibfi-visual-settings.php:97
|
234 |
+
msgid "When the \"Pin it\" button should be visible."
|
235 |
msgstr ""
|
236 |
|
237 |
+
#: includes/admin/settings/class-jpibfi-visual-settings.php:105
|
238 |
+
msgid "Bottom"
|
239 |
msgstr ""
|
240 |
|
241 |
+
#: includes/admin/settings/class-jpibfi-visual-settings.php:107
|
242 |
+
msgid "Top"
|
243 |
msgstr ""
|
244 |
|
245 |
+
#: includes/admin/settings/class-jpibfi-visual-settings.php:109
|
246 |
+
msgid "Left"
|
247 |
msgstr ""
|
248 |
|
249 |
+
#: includes/admin/settings/class-jpibfi-visual-settings.php:111
|
250 |
+
msgid "Right"
|
251 |
msgstr ""
|
252 |
|
253 |
+
#: includes/admin/settings/class-jpibfi-visual-settings.php:119
|
254 |
+
msgid "\"Pin it\" button position"
|
255 |
msgstr ""
|
256 |
|
257 |
+
#: includes/admin/settings/class-jpibfi-visual-settings.php:125
|
258 |
+
msgid "Top right"
|
259 |
msgstr ""
|
260 |
|
261 |
+
#: includes/admin/settings/class-jpibfi-visual-settings.php:127
|
262 |
+
msgid "Bottom left"
|
263 |
msgstr ""
|
264 |
|
265 |
+
#: includes/admin/settings/class-jpibfi-visual-settings.php:135
|
266 |
+
msgid "Where the \"Pin it\" button should appear on the image."
|
267 |
msgstr ""
|
268 |
|
269 |
+
#: includes/admin/settings/class-jpibfi-visual-settings.php:145
|
270 |
+
msgid "Description source"
|
271 |
msgstr ""
|
272 |
|
273 |
+
#: includes/admin/settings/class-jpibfi-visual-settings.php:149
|
274 |
+
msgid "Post title"
|
275 |
msgstr ""
|
276 |
|
277 |
+
#: includes/admin/settings/class-jpibfi-visual-settings.php:151
|
278 |
+
msgid "Post description (excerpt)"
|
279 |
msgstr ""
|
280 |
|
281 |
+
#: includes/admin/settings/class-jpibfi-visual-settings.php:153
|
282 |
+
msgid "Image title attribute"
|
283 |
msgstr ""
|
284 |
|
285 |
+
#: includes/admin/settings/class-jpibfi-visual-settings.php:155
|
286 |
+
msgid "Site title (Settings->General)"
|
287 |
msgstr ""
|
288 |
|
289 |
+
#: includes/admin/settings/class-jpibfi-visual-settings.php:157
|
290 |
+
msgid "Image description"
|
291 |
msgstr ""
|
292 |
|
293 |
+
#: includes/admin/settings/class-jpibfi-visual-settings.php:159
|
294 |
+
msgid "Image caption"
|
295 |
msgstr ""
|
296 |
|
297 |
+
#: includes/admin/settings/class-jpibfi-visual-settings.php:161
|
298 |
+
msgid "Image alt attribute"
|
299 |
msgstr ""
|
300 |
|
301 |
+
#: includes/admin/settings/class-jpibfi-visual-settings.php:165
|
302 |
+
msgid "From where the Pinterest message should be taken. Check which sources should be considered and prioritize them by dragging and dropping. The description will come from the top source that has data. Please note that \"Image description\" and \"Image caption\" work properly only for images that were added to your Media Library."
|
303 |
msgstr ""
|
304 |
|
305 |
+
#: includes/admin/settings/class-jpibfi-visual-settings.php:175
|
306 |
+
msgid "Pin linked images"
|
307 |
msgstr ""
|
308 |
|
309 |
+
#: includes/admin/settings/class-jpibfi-visual-settings.php:177
|
310 |
+
msgid "Active"
|
311 |
msgstr ""
|
312 |
|
313 |
+
#: includes/admin/settings/class-jpibfi-visual-settings.php:179
|
314 |
+
msgid "When checked, pins full-sized images instead of thumbnails (works only if you link thumbnails to their full versions)."
|
315 |
msgstr ""
|
316 |
|
317 |
+
#: includes/admin/settings/class-jpibfi-visual-settings.php:189
|
318 |
+
msgid "Transparency value"
|
319 |
msgstr ""
|
320 |
|
321 |
+
#: includes/admin/settings/class-jpibfi-visual-settings.php:191
|
322 |
msgid "Choose transparency (between %.02f and %.02f)"
|
323 |
msgstr ""
|
324 |
|
325 |
+
#: includes/admin/settings/class-jpibfi-visual-settings.php:207
|
326 |
msgid "Use custom image"
|
327 |
msgstr ""
|
328 |
|
329 |
+
#: includes/admin/settings/class-jpibfi-visual-settings.php:217
|
|
|
|
|
|
|
|
|
330 |
msgid "URL address of the image"
|
331 |
msgstr ""
|
332 |
|
333 |
+
#: includes/admin/settings/class-jpibfi-visual-settings.php:247
|
334 |
+
msgid "How it should look like"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
335 |
msgstr ""
|
336 |
|
337 |
+
#: includes/admin/settings/class-jpibfi-visual-settings.php:281
|
338 |
msgid "Custom image height"
|
339 |
msgstr ""
|
340 |
|
341 |
+
#: includes/admin/settings/class-jpibfi-visual-settings.php:285
|
342 |
msgid "Custom image width"
|
343 |
msgstr ""
|
344 |
|
345 |
+
#: includes/admin/settings/class-jpibfi-visual-settings.php:287
|
346 |
+
msgid "value must be empty or a number greater or equal to %d."
|
347 |
msgstr ""
|
348 |
|
349 |
+
#: includes/admin/settings/class-jpibfi-visual-settings.php:295
|
350 |
+
msgid "Transparency value must be a number between %.02d and %.02f."
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
351 |
msgstr ""
|
readme.txt
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
Contributors: mrsztuczkens, redearthdesign, brocheafoin, robertark
|
3 |
Tags: pinterest, pin it, button, image, images, pinit, social media, hover, click, photo, photos
|
4 |
Requires at least: 3.3.0
|
5 |
-
Tested up to: 4.
|
6 |
-
Stable tag:
|
7 |
License: GPLv2 or later
|
8 |
|
9 |
Highlights images on hover and adds a Pinterest "Pin It" button over them for easy pinning.
|
@@ -17,7 +17,7 @@ The plugin allows you to:
|
|
17 |
* choose which pictures shouldn't show the "Pin it" button (using classes)
|
18 |
* choose which pictures should show the "Pin it" button (all images, post images, images with certain class(es))
|
19 |
* choose if you want to show the "Pin it" button on home page, single posts, single pages or category pages
|
20 |
-
* disable showing the button on certain posts and pages
|
21 |
* choose transparency level depending on your needs
|
22 |
* use your own Pinterest button design
|
23 |
|
@@ -68,6 +68,12 @@ Please report them in the plugin's support forum on Wordpress.org.
|
|
68 |
|
69 |
== Changelog ==
|
70 |
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
= 1.60 =
|
72 |
* Release 2016-07-04
|
73 |
* Added lightbox feature
|
@@ -244,6 +250,9 @@ Please report them in the plugin's support forum on Wordpress.org.
|
|
244 |
|
245 |
== Upgrade Notice ==
|
246 |
|
|
|
|
|
|
|
247 |
= 1.60 =
|
248 |
* Added lightbox feature
|
249 |
|
2 |
Contributors: mrsztuczkens, redearthdesign, brocheafoin, robertark
|
3 |
Tags: pinterest, pin it, button, image, images, pinit, social media, hover, click, photo, photos
|
4 |
Requires at least: 3.3.0
|
5 |
+
Tested up to: 4.6.1
|
6 |
+
Stable tag: 2.00
|
7 |
License: GPLv2 or later
|
8 |
|
9 |
Highlights images on hover and adds a Pinterest "Pin It" button over them for easy pinning.
|
17 |
* choose which pictures shouldn't show the "Pin it" button (using classes)
|
18 |
* choose which pictures should show the "Pin it" button (all images, post images, images with certain class(es))
|
19 |
* choose if you want to show the "Pin it" button on home page, single posts, single pages or category pages
|
20 |
+
* disable showing the button on certain posts and pages
|
21 |
* choose transparency level depending on your needs
|
22 |
* use your own Pinterest button design
|
23 |
|
68 |
|
69 |
== Changelog ==
|
70 |
|
71 |
+
= 2.00 =
|
72 |
+
* Release 2016-10-02
|
73 |
+
* Complete code rewrite
|
74 |
+
* Added support for featured image
|
75 |
+
* Plugin settings clean up
|
76 |
+
|
77 |
= 1.60 =
|
78 |
* Release 2016-07-04
|
79 |
* Added lightbox feature
|
250 |
|
251 |
== Upgrade Notice ==
|
252 |
|
253 |
+
= 2.00 =
|
254 |
+
* Complete rewrite plus some changes in settings.
|
255 |
+
|
256 |
= 1.60 =
|
257 |
* Added lightbox feature
|
258 |
|
uninstall.php
CHANGED
@@ -8,9 +8,6 @@ if ( !defined( 'WP_UNINSTALL_PLUGIN' ) )
|
|
8 |
//delete all added options
|
9 |
delete_option( 'jpibfi_selection_options' );
|
10 |
delete_option( 'jpibfi_visual_options' );
|
11 |
-
delete_option( 'jpibfi_advanced_options' );
|
12 |
delete_option( 'jpibfi_version' );
|
13 |
-
delete_option( '
|
14 |
-
|
15 |
-
//delete added metadata from all posts
|
16 |
-
delete_post_meta_by_key( 'jpibfi_meta' );
|
8 |
//delete all added options
|
9 |
delete_option( 'jpibfi_selection_options' );
|
10 |
delete_option( 'jpibfi_visual_options' );
|
|
|
11 |
delete_option( 'jpibfi_version' );
|
12 |
+
delete_option( 'jpibfi_options_version' );
|
13 |
+
delete_option( 'jpibfi_pro_ad' );
|
|
|
|