jQuery Pin It Button for Images - Version 1.40

Version Description

  • Release 2016-02-11
  • Backend and frontend JavaScript rewritten
Download this release

Release Info

Developer mrsztuczkens
Plugin Icon wp plugin jQuery Pin It Button for Images
Version 1.40
Comparing to
See all releases

Code changes from version 1.38 to 1.40

css/admin.css CHANGED
@@ -14,36 +14,4 @@ input[type="checkbox"] ~ label {
14
15
input#custom_image_url {
16
width: 100%;
17
- }
18
-
19
- ul.jpibfi-classes-list {
20
- margin: 0 0;
21
- overflow: auto;
22
- list-style-type: none;
23
- }
24
-
25
- ul.jpibfi-classes-list li {
26
- float: left;
27
- margin-right: 0;
28
- padding: 0 20px 0 0;
29
- }
30
-
31
- ul.jpibfi-classes-list a {
32
- display: inline-block;
33
- text-indent: -9999px;
34
- background-color: #ffffff;
35
- background-image: url('../images/delete.png');
36
- background-repeat: no-repeat;
37
- background-position: 0 0;
38
- width: 16px;
39
- height: 16px;
40
- cursor: pointer;
41
- }
42
-
43
- ul.jpibfi-classes-list a:hover {
44
- background-position: -16px 0;
45
- }
46
-
47
- ul.jpibfi-classes-list span {
48
- padding-left: 5px;
49
}
14
15
input#custom_image_url {
16
width: 100%;
17
}
css/style.css CHANGED
@@ -13,32 +13,4 @@ a.pinit-button {
13
position:absolute;
14
display:none;
15
text-indent:-9999em !important;
16
- }
17
-
18
- a.pinit-button.pinit-top-left {
19
- top:0;
20
- left:0;
21
- }
22
-
23
- a.pinit-button.pinit-top-right {
24
- top:0;
25
- right:0;
26
- }
27
-
28
- a.pinit-button.pinit-bottom-left {
29
- bottom:0;
30
- left:0;
31
- }
32
-
33
- a.pinit-button.pinit-bottom-right {
34
- bottom:0;
35
- right:0;
36
- }
37
-
38
- a.pinit-button.pinit-middle {
39
- top:0;
40
- bottom:0;
41
- left:0;
42
- right:0;
43
- margin: auto;
44
}
13
position:absolute;
14
display:none;
15
text-indent:-9999em !important;
16
}
gulpfile.js ADDED
@@ -0,0 +1,58 @@
1
+ var gulp = require('gulp'),
2
+ gutil = require('gulp-util'),
3
+ ts = require('gulp-typescript'),
4
+ wpPot = require('gulp-wp-pot'),
5
+ sort = require('gulp-sort'),
6
+ del = require('del'),
7
+ minify = require('gulp-minify');
8
+
9
+ var tsProjectClient = ts.createProject('tsconfig.json');
10
+
11
+ var gulpConfig = {
12
+ repoDirectory: 'D:/dev/jpibfi/trunk'
13
+ };
14
+
15
+ gulp.task('ts', function () {
16
+ var tsResultClient = tsProjectClient.src()
17
+ .pipe(ts(tsProjectClient)).js
18
+ .pipe(minify())
19
+ .pipe(gulp.dest(''));
20
+ return tsResultClient;
21
+ });
22
+
23
+ gulp.task('pot', function () {
24
+ return gulp.src('**/*.php')
25
+ .pipe(sort())
26
+ .pipe(wpPot({
27
+ domain: 'jquery-pin-it-button-for-images',
28
+ destFile: 'jquery-pin-it-button-for-images.pot',
29
+ package: 'jquery-pin-it-button-for-images',
30
+ team: 'Marcin Skrzypiec'
31
+ }))
32
+ .pipe(gulp.dest('languages'));
33
+ });
34
+
35
+ gulp.task('watch', function (cb) {
36
+ gulp.watch('js/src/**/*.ts', ['ts']);
37
+ });
38
+
39
+ gulp.task('clean-repo', function () {
40
+ return del.sync([
41
+ gulpConfig.repoDirectory,
42
+ ], {
43
+ force: true
44
+ });
45
+ });
46
+
47
+ gulp.task('copy-to-repo', function () {
48
+ gulp
49
+ .src([
50
+ './**/*.*',
51
+ '!./node_modules/**',
52
+ '!./typings/**'
53
+ ],
54
+ { dot: true })
55
+ .pipe(gulp.dest(gulpConfig.repoDirectory));
56
+ });
57
+
58
+ gulp.task('repo', ['clean-repo', 'copy-to-repo']);
images/delete.png DELETED
Binary file
includes/admin/class-jpibfi-admin.php CHANGED
@@ -10,7 +10,6 @@ class JPIBFI_Admin {
10
add_action( 'admin_menu', array( $this, 'print_admin_page_action') );
11
add_action( 'add_meta_boxes', array( $this, 'add_meta_box' ) );
12
add_action( 'save_post', array( $this, 'save_meta_data' ) );
13
- add_action( 'admin_notices', array( $this, 'show_admin_notice') );
14
}
15
16
public static function get_instance() {
@@ -43,9 +42,6 @@ class JPIBFI_Admin {
43
44
wp_enqueue_script( 'jquery-pin-it-button-admin-script', JPIBFI_SCRIPT_URL . 'admin.js', array( 'jquery' ), JPIBFI_VERSION . JPIBFI_VERSION_MINOR, false );
45
46
- wp_register_script( 'angular', JPIBFI_SCRIPT_URL . 'angular.min.js' , '', '1.0.7', false );
47
- wp_enqueue_script( 'jquery-pin-it-button-admin-angular-script', JPIBFI_SCRIPT_URL . 'admin-angular.js', array( 'angular' ), JPIBFI_VERSION . JPIBFI_VERSION_MINOR, false );
48
-
49
if ( function_exists( "wp_enqueue_media") ) {
50
wp_enqueue_media();
51
wp_enqueue_script( 'jpibfi-upload-new', JPIBFI_SCRIPT_URL . 'upload-button-new.js', array(), JPIBFI_VERSION . JPIBFI_VERSION_MINOR, false );
@@ -61,17 +57,17 @@ class JPIBFI_Admin {
61
$settings_tabs = array(
62
'selection_options' => array(
63
'settings_name' => 'jpibfi_selection_options',
64
- 'tab_label' => __( 'Selection', 'jpibfi' ),
65
'support_link' => 'http://wordpress.org/support/plugin/jquery-pin-it-button-for-images',
66
),
67
'visual_options' => array(
68
'settings_name' => 'jpibfi_visual_options',
69
- 'tab_label' => __( 'Visual', 'jpibfi' ),
70
'support_link' => 'http://wordpress.org/support/plugin/jquery-pin-it-button-for-images',
71
),
72
'advanced_options' => array(
73
'settings_name' => 'jpibfi_advanced_options',
74
- 'tab_label' => __('Advanced', 'jpibfi' ),
75
'support_link' => 'http://wordpress.org/support/plugin/jquery-pin-it-button-for-images',
76
)
77
);
@@ -86,25 +82,18 @@ class JPIBFI_Admin {
86
87
/* Meta box for each post and page */
88
public function add_meta_box() {
89
- //for posts
90
- add_meta_box(
91
- 'jpibfi_settings_id', // this is HTML id of the box on edit screen
92
- 'jQuery Pin It Button for Images - ' . __( 'Settings', 'jpibfi' ), // title of the box
93
- array( $this, 'print_meta_box' ), // function to be called to display the checkboxes, see the function below
94
- 'post', // on which edit screen the box should appear
95
- 'side', // part of page where the box should appear
96
- 'default' // priority of the box
97
- );
98
-
99
- //for pages
100
- add_meta_box(
101
- 'jpibfi_settings_id',
102
- 'jQuery Pin It Button for Images - ' . __( 'Settings', 'jpibfi' ),
103
- array( $this, 'print_meta_box' ),
104
- 'page',
105
- 'side',
106
- 'default'
107
- );
108
}
109
110
/* Displays the meta box */
@@ -116,7 +105,7 @@ class JPIBFI_Admin {
116
$checked = isset( $post_meta ) && isset( $post_meta['jpibfi_disable_for_post'] ) && $post_meta['jpibfi_disable_for_post'] == '1';
117
118
echo '<input type="checkbox" id="jpibfi_disable_for_post" name="jpibfi_disable_for_post" value="1"' . checked( $checked, true, false ) . '>';
119
- echo '<label for="jpibfi_disable_for_post">' . __( 'Disable "Pin it" button for this post (works only on single pages/posts)', 'jpibfi' ) . '</label><br />';
120
}
121
122
public function save_meta_data( $post_id ) {
@@ -141,13 +130,6 @@ class JPIBFI_Admin {
141
else
142
delete_post_meta( $post_id, JPIBFI_METADATA );
143
}
144
-
145
- function show_admin_notice() {
146
- global $hook_suffix;
147
- if ( $this->admin_screen_hook == $hook_suffix ) {
148
- include_once( 'views/notice.php');
149
- }
150
- }
151
}
152
153
add_action( 'plugins_loaded', array( 'JPIBFI_Admin', 'get_instance' ) );
10
add_action( 'admin_menu', array( $this, 'print_admin_page_action') );
11
add_action( 'add_meta_boxes', array( $this, 'add_meta_box' ) );
12
add_action( 'save_post', array( $this, 'save_meta_data' ) );
13
}
14
15
public static function get_instance() {
42
43
wp_enqueue_script( 'jquery-pin-it-button-admin-script', JPIBFI_SCRIPT_URL . 'admin.js', array( 'jquery' ), JPIBFI_VERSION . JPIBFI_VERSION_MINOR, false );
44
45
if ( function_exists( "wp_enqueue_media") ) {
46
wp_enqueue_media();
47
wp_enqueue_script( 'jpibfi-upload-new', JPIBFI_SCRIPT_URL . 'upload-button-new.js', array(), JPIBFI_VERSION . JPIBFI_VERSION_MINOR, false );
57
$settings_tabs = array(
58
'selection_options' => array(
59
'settings_name' => 'jpibfi_selection_options',
60
+ 'tab_label' => __( 'Selection', 'jquery-pin-it-button-for-images' ),
61
'support_link' => 'http://wordpress.org/support/plugin/jquery-pin-it-button-for-images',
62
),
63
'visual_options' => array(
64
'settings_name' => 'jpibfi_visual_options',
65
+ 'tab_label' => __( 'Visual', 'jquery-pin-it-button-for-images' ),
66
'support_link' => 'http://wordpress.org/support/plugin/jquery-pin-it-button-for-images',
67
),
68
'advanced_options' => array(
69
'settings_name' => 'jpibfi_advanced_options',
70
+ 'tab_label' => __('Advanced', 'jquery-pin-it-button-for-images' ),
71
'support_link' => 'http://wordpress.org/support/plugin/jquery-pin-it-button-for-images',
72
)
73
);
82
83
/* Meta box for each post and page */
84
public function add_meta_box() {
85
+ /* TODO check if has permissions */
86
+ $post_types = ['post', 'page'];
87
+ foreach($post_types as $pt){
88
+ add_meta_box(
89
+ 'jpibfi_settings_id',
90
+ 'jQuery Pin It Button for Images - ' . __( 'Settings', 'jquery-pin-it-button-for-images' ),
91
+ array( $this, 'print_meta_box' ),
92
+ $pt,
93
+ 'side',
94
+ 'default'
95
+ );
96
+ }
97
}
98
99
/* Displays the meta box */
105
$checked = isset( $post_meta ) && isset( $post_meta['jpibfi_disable_for_post'] ) && $post_meta['jpibfi_disable_for_post'] == '1';
106
107
echo '<input type="checkbox" id="jpibfi_disable_for_post" name="jpibfi_disable_for_post" value="1"' . checked( $checked, true, false ) . '>';
108
+ 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 />';
109
}
110
111
public function save_meta_data( $post_id ) {
130
else
131
delete_post_meta( $post_id, JPIBFI_METADATA );
132
}
133
}
134
135
add_action( 'plugins_loaded', array( 'JPIBFI_Admin', 'get_instance' ) );
includes/admin/class-jpibfi-advanced-options.php CHANGED
@@ -34,7 +34,7 @@ class JPIBFI_Advanced_Options {
34
// First, we register a section.
35
add_settings_section(
36
'advanced_options_section',
37
- __( 'Advanced Settings', 'jpibfi' ),
38
array( $this, 'advanced_options_callback' ),
39
'jpibfi_advanced_options'
40
);
@@ -42,23 +42,23 @@ class JPIBFI_Advanced_Options {
42
//lThen add all necessary fields to the section
43
add_settings_field(
44
'debug',
45
- __( 'Debug', 'jpibfi' ),
46
array( $this, 'debug_callback' ),
47
'jpibfi_advanced_options',
48
'advanced_options_section',
49
array(
50
- __( 'Use debug mode only if you are experiencing some issues with the plugin and you are reporting them to the developer of the plugin', 'jpibfi' ),
51
)
52
);
53
54
add_settings_field(
55
'container_selector',
56
- __( 'Container selector', 'jpibfi' ),
57
array( $this, 'container_selector_callback' ),
58
'jpibfi_advanced_options',
59
'advanced_options_section',
60
array(
61
- __( '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.', 'jpibfi' ),
62
)
63
);
64
@@ -69,7 +69,7 @@ class JPIBFI_Advanced_Options {
69
}
70
71
public function advanced_options_callback() {
72
- echo '<p>' . __('Advanced settings', 'jpibfi') . '</p>';
73
}
74
75
public function debug_callback( $args ){
@@ -77,7 +77,7 @@ class JPIBFI_Advanced_Options {
77
$debug = JPIBFI_Admin_Utilities::exists_and_equal_to( $options, 'debug', '1' );
78
79
echo '<input type="checkbox" id="debug" name="jpibfi_advanced_options[debug]" value="1" ' . checked( "1", $debug, false ) . '>';
80
- echo '<label for="debug">' . __( 'Enable debug mode', 'jpibfi' ) . '</label>';
81
82
echo JPIBFI_Admin_Utilities::create_description( $args[0] );
83
}
34
// First, we register a section.
35
add_settings_section(
36
'advanced_options_section',
37
+ __( 'Advanced Settings', 'jquery-pin-it-button-for-images' ),
38
array( $this, 'advanced_options_callback' ),
39
'jpibfi_advanced_options'
40
);
42
//lThen add all necessary fields to the section
43
add_settings_field(
44
'debug',
45
+ __( 'Debug', 'jquery-pin-it-button-for-images' ),
46
array( $this, 'debug_callback' ),
47
'jpibfi_advanced_options',
48
'advanced_options_section',
49
array(
50
+ __( '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' ),
51
)
52
);
53
54
add_settings_field(
55
'container_selector',
56
+ __( 'Container selector', 'jquery-pin-it-button-for-images' ),
57
array( $this, 'container_selector_callback' ),
58
'jpibfi_advanced_options',
59
'advanced_options_section',
60
array(
61
+ __( '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' ),
62
)
63
);
64
69
}
70
71
public function advanced_options_callback() {
72
+ echo '<p>' . __('Advanced settings', 'jquery-pin-it-button-for-images') . '</p>';
73
}
74
75
public function debug_callback( $args ){
77
$debug = JPIBFI_Admin_Utilities::exists_and_equal_to( $options, 'debug', '1' );
78
79
echo '<input type="checkbox" id="debug" name="jpibfi_advanced_options[debug]" value="1" ' . checked( "1", $debug, false ) . '>';
80
+ echo '<label for="debug">' . __( 'Enable debug mode', 'jquery-pin-it-button-for-images' ) . '</label>';
81
82
echo JPIBFI_Admin_Utilities::create_description( $args[0] );
83
}
includes/admin/class-jpibfi-selection-options.php CHANGED
@@ -22,16 +22,16 @@ class JPIBFI_Selection_Options {
22
/* Default values for selection options section */
23
public static function default_selection_options() {
24
$defaults = array(
25
- 'image_selector' => '.jpibfi_container img',
26
- 'disabled_classes' => 'nopin;wp-smiley',
27
- 'enabled_classes' => '',
28
- 'min_image_height' => '0',
29
- 'min_image_width' => '0',
30
- 'show_on_home' => '1',
31
- 'show_on_single' => '1',
32
- 'show_on_page' => '1',
33
- 'show_on_category' => '1',
34
- 'show_on_blog' => '1'
35
);
36
37
return apply_filters('jpibfi_default_selection_options', $defaults);
@@ -55,7 +55,7 @@ class JPIBFI_Selection_Options {
55
// First, we register a section.
56
add_settings_section(
57
'selection_options_section', // ID used to identify this section and with which to register options
58
- __( 'Selection', 'jpibfi' ), // Title to be displayed on the administration page
59
array( $this, 'selection_options_callback' ), // Callback used to render the description of the section
60
'jpibfi_selection_options' // Page on which to add this section of options
61
);
@@ -63,12 +63,12 @@ class JPIBFI_Selection_Options {
63
//lThen add all necessary fields to the section
64
add_settings_field(
65
'image_selector', // ID used to identify the field throughout the plugin
66
- __( 'Image selector', 'jpibfi' ), // The label to the left of the option interface element
67
array( $this, 'image_selector_callback'), // The name of the function responsible for rendering the option interface
68
'jpibfi_selection_options', // The page on which this option will be displayed
69
'selection_options_section', // The name of the section to which this field belongs
70
array( // The array of arguments to pass to the callback. In this case, just a description.
71
- 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.', 'jpibfi' ),
72
'<a href="#" class="jpibfi_selector_option">div.jpibfi_container img</a>',
73
'<a href="#" class="jpibfi_selector_option">img</a>',
74
'<a href="http://api.jquery.com/category/selectors/" target="_blank">',
@@ -79,45 +79,45 @@ class JPIBFI_Selection_Options {
79
80
add_settings_field(
81
'disabled_classes',
82
- __( 'Disabled classes', 'jpibfi' ),
83
array( $this, 'disabled_classes_callback' ),
84
'jpibfi_selection_options',
85
'selection_options_section',
86
array(
87
- __( 'Pictures with these CSS classes won\'t show the "Pin it" button. Please separate multiple classes with semicolons. Spaces are not accepted.', 'jpibfi' ),
88
)
89
);
90
91
add_settings_field(
92
'enabled_classes',
93
- __( 'Enabled classes', 'jpibfi' ),
94
array( $this, 'enabled_classes_callback' ),
95
'jpibfi_selection_options',
96
'selection_options_section',
97
array(
98
- __( '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.', 'jpibfi' ),
99
)
100
);
101
102
add_settings_field(
103
'show_on_field',
104
- __( 'On which pages the "Pin it" button should be shown', 'jpibfi' ),
105
array( $this, 'show_on_field_callback' ),
106
'jpibfi_selection_options',
107
'selection_options_section',
108
array(
109
- __( 'Check on which pages you want the Pinterest button to show up.', 'jpibfi' ),
110
)
111
);
112
113
add_settings_field(
114
'min_image',
115
- __( 'Minimum resolution that should trigger the "Pin it" button to show up', 'jpibfi' ),
116
array( $this, 'min_image_callback' ),
117
'jpibfi_selection_options',
118
'selection_options_section',
119
array(
120
- __( '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.', 'jpibfi' ),
121
)
122
);
123
@@ -129,7 +129,7 @@ class JPIBFI_Selection_Options {
129
}
130
131
public function selection_options_callback() {
132
- echo '<p>' . __('Which images can be pinned', 'jpibfi') . '</p>';
133
}
134
135
public function image_selector_callback( $args ) {
@@ -146,27 +146,21 @@ class JPIBFI_Selection_Options {
146
147
$options = $this->get_selection_options();
148
$value = esc_attr( $options[ 'disabled_classes' ] );
149
-
150
?>
151
- <input type="hidden" name="jpibfi_selection_options[disabled_classes]" value="{{ disabledClassesFormatted }}" ng-init="initDisabledClasses('<?php echo $value; ?>')">
152
- <span ng-hide="disabledClasses.length > 0">
153
- <?php echo JPIBFI_Admin_Utilities::create_description( __( 'No classes added.', 'jpibfi' ) ); ?>
154
- </span>
155
- <ul class="jpibfi-classes-list" ng-hide="disabledClasses.length == 0">
156
- <li ng-repeat="class in disabledClasses">
157
- <a ng-click="deleteDisabledClass(class)">X</a><span>{{ class }}</span>
158
- </li>
159
- </ul>
160
- <div>
161
- <div>
162
- <label for="disabledClass" ><?php _e( 'Class name', 'jpibfi' ); ?></label>
163
- <input id="disabledClass" type="text" ng-model="disabledClass">
164
- <button type="button" ng-click="addDisabledClass(disabledClass)"><?php _e( 'Add to list', 'jpibfi' ); ?></button>
165
- </div>
166
- </div>
167
168
<?php
169
-
170
echo JPIBFI_Admin_Utilities::create_description( $args[0] );
171
echo JPIBFI_Admin_Utilities::create_errors( 'disabled_classes' );
172
}
@@ -177,25 +171,20 @@ class JPIBFI_Selection_Options {
177
$value = esc_attr( $options[ 'enabled_classes' ] );
178
179
?>
180
- <input type="hidden" name="jpibfi_selection_options[enabled_classes]" value="{{ enabledClassesFormatted }}" ng-init="initEnabledClasses('<?php echo $value; ?>')">
181
- <span ng-hide="enabledClasses.length > 0">
182
- <?php echo JPIBFI_Admin_Utilities::create_description( __( 'No classes added.', 'jpibfi' ) ); ?>
183
- </span>
184
- <ul class="jpibfi-classes-list" ng-hide="enabledClasses.length == 0">
185
- <li ng-repeat="class in enabledClasses">
186
- <a ng-click="deleteEnabledClass(class)">X</a><span>{{ class }}</span>
187
- </li>
188
- </ul>
189
- <div>
190
- <div>
191
- <label for="enabledClass" ><?php _e( 'Class name', 'jpibfi' ); ?></label>
192
- <input id="enabledClass" type="text" ng-model="enabledClass">
193
- <button type="button" ng-click="addEnabledClass(enabledClass)"><?php _e( 'Add to list', 'jpibfi' ); ?></button>
194
- </div>
195
- </div>
196
197
<?php
198
-
199
echo JPIBFI_Admin_Utilities::create_description( $args[0] );
200
echo JPIBFI_Admin_Utilities::create_errors( 'enabled_classes' );
201
}
@@ -211,15 +200,15 @@ class JPIBFI_Selection_Options {
211
?>
212
213
<input type="checkbox" id="show_on_home" name="jpibfi_selection_options[show_on_home]" <?php checked( true, $show_on_home ); ?> value="1" />
214
- <label for="show_on_home"><?php _e( 'Home page', 'jpibfi' ); ?></label><br/>
215
<input type="checkbox" id="show_on_page" name="jpibfi_selection_options[show_on_page]" <?php checked( true, $show_on_page ); ?> value="1" />
216
- <label for="show_on_page"><?php _e( 'Pages', 'jpibfi' ); ?></label><br />
217
<input type="checkbox" id="show_on_single" name="jpibfi_selection_options[show_on_single]" <?php checked( true, $show_on_single ); ?> value="1" />
218
- <label for="show_on_single"><?php _e( 'Single posts', 'jpibfi' ); ?></label><br />
219
<input type="checkbox" id="show_on_category" name="jpibfi_selection_options[show_on_category]" <?php checked( true, $show_on_category ); ?> value="1" />
220
- <label for="show_on_category"><?php _e( 'Category and archive pages', 'jpibfi' ); ?></label><br />
221
<input type="checkbox" id="show_on_blog" name="jpibfi_selection_options[show_on_blog]" <?php checked( true, $show_on_blog ); ?> value="1" />
222
- <label for="show_on_blog"><?php _e( 'Blog pages', 'jpibfi' ); ?></label>
223
224
<?php
225
echo JPIBFI_Admin_Utilities::create_description( $args[0] );
@@ -233,14 +222,14 @@ class JPIBFI_Selection_Options {
233
?>
234
235
<p>
236
- <label for="min_image_height"><?php _e('Height', 'jpibfi'); ?></label>
237
<input type="number" min="0" step="1" id="min_image_height" name="jpibfi_selection_options[min_image_height]" value="<?php echo $min_image_height; ?>"
238
class="small-text" /> px
239
<?php echo JPIBFI_Admin_Utilities::create_errors( 'min_image_height' ); ?>
240
</p>
241
242
<p>
243
- <label for="min_image_width"><?php _e('Width', 'jpibfi'); ?></label>
244
<input type="number" min="0" step="1" id="min_image_width" name="jpibfi_selection_options[min_image_width]" value="<?php echo $min_image_width; ?>"
245
class="small-text" /> px
246
<?php echo JPIBFI_Admin_Utilities::create_errors( 'min_image_width' ); ?>
@@ -262,14 +251,14 @@ class JPIBFI_Selection_Options {
262
263
$field = '';
264
if ( 'disabled_classes' == $key )
265
- $field = __( 'Disabled classes', 'jpibfi' );
266
else if ( 'enabled_classes' == $key )
267
- $field = __( 'Enabled classes', 'jpibfi' );
268
269
add_settings_error(
270
$key,
271
esc_attr( 'settings_updated' ),
272
- $field . ' - ' . __('the given value doesn\'t meet the requirements. Please correct it and try again.', 'jpibfi')
273
);
274
}
275
break;
@@ -279,14 +268,14 @@ class JPIBFI_Selection_Options {
279
280
$field = '';
281
if ( 'min_image_height' == $key )
282
- $field = __( 'Minimum image height', 'jpibfi' );
283
else if ( 'min_image_width' == $key )
284
- $field = __( 'Minimum image width', 'jpibfi' );
285
286
add_settings_error(
287
$key,
288
esc_attr( 'settings_updated' ),
289
- $field . ' - ' . sprintf ( __('value must be a number greater or equal to %d.', 'jpibfi'), '0' )
290
);
291
}
292
break;
22
/* Default values for selection options section */
23
public static function default_selection_options() {
24
$defaults = array(
25
+ 'image_selector' => '.jpibfi_container img',
26
+ 'disabled_classes' => 'nopin;wp-smiley',
27
+ 'enabled_classes' => '',
28
+ 'min_image_height' => '0',
29
+ 'min_image_width' => '0',
30
+ 'show_on_home' => '1',
31
+ 'show_on_single' => '1',
32
+ 'show_on_page' => '1',
33
+ 'show_on_category' => '1',
34
+ 'show_on_blog' => '1'
35
);
36
37
return apply_filters('jpibfi_default_selection_options', $defaults);
55
// First, we register a section.
56
add_settings_section(
57
'selection_options_section', // ID used to identify this section and with which to register options
58
+ __( 'Selection', 'jquery-pin-it-button-for-images' ), // Title to be displayed on the administration page
59
array( $this, 'selection_options_callback' ), // Callback used to render the description of the section
60
'jpibfi_selection_options' // Page on which to add this section of options
61
);
63
//lThen add all necessary fields to the section
64
add_settings_field(
65
'image_selector', // ID used to identify the field throughout the plugin
66
+ __( 'Image selector', 'jquery-pin-it-button-for-images' ), // The label to the left of the option interface element
67
array( $this, 'image_selector_callback'), // The name of the function responsible for rendering the option interface
68
'jpibfi_selection_options', // The page on which this option will be displayed
69
'selection_options_section', // The name of the section to which this field belongs
70
array( // The array of arguments to pass to the callback. In this case, just a description.
71
+ 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' ),
72
'<a href="#" class="jpibfi_selector_option">div.jpibfi_container img</a>',
73
'<a href="#" class="jpibfi_selector_option">img</a>',
74
'<a href="http://api.jquery.com/category/selectors/" target="_blank">',
79
80
add_settings_field(
81
'disabled_classes',
82
+ __( 'Disabled classes', 'jquery-pin-it-button-for-images' ),
83
array( $this, 'disabled_classes_callback' ),
84
'jpibfi_selection_options',
85
'selection_options_section',
86
array(
87
+ __( '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' ),
88
)
89
);
90
91
add_settings_field(
92
'enabled_classes',
93
+ __( 'Enabled classes', 'jquery-pin-it-button-for-images' ),
94
array( $this, 'enabled_classes_callback' ),
95
'jpibfi_selection_options',
96
'selection_options_section',
97
array(
98
+ __( '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' ),
99
)
100
);
101
102
add_settings_field(
103
'show_on_field',
104
+ __( 'On which pages the "Pin it" button should be shown', 'jquery-pin-it-button-for-images' ),
105
array( $this, 'show_on_field_callback' ),
106
'jpibfi_selection_options',
107
'selection_options_section',
108
array(
109
+ __( 'Check on which pages you want the Pinterest button to show up.', 'jquery-pin-it-button-for-images' ),
110
)
111
);
112
113
add_settings_field(
114
'min_image',
115
+ __( 'Minimum resolution that should trigger the "Pin it" button to show up', 'jquery-pin-it-button-for-images' ),
116
array( $this, 'min_image_callback' ),
117
'jpibfi_selection_options',
118
'selection_options_section',
119
array(
120
+ __( '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' ),
121
)
122
);
123
129
}
130
131
public function selection_options_callback() {
132
+ echo '<p>' . __('Which images can be pinned', 'jquery-pin-it-button-for-images') . '</p>';
133
}
134
135
public function image_selector_callback( $args ) {
146
147
$options = $this->get_selection_options();
148
$value = esc_attr( $options[ 'disabled_classes' ] );
149
?>
150
+ <div id="jpibfi-disabled-classes">
151
+ <input type="hidden" class="jpibfi-value" name="jpibfi_selection_options[disabled_classes]" value="<?php echo $value; ?>">
152
+ <span class="jpibfi-empty"><?php echo JPIBFI_Admin_Utilities::create_description( __( 'No classes added.', 'jquery-pin-it-button-for-images' ) ); ?></span>
153
+ <div class="jpibfi-classes-list tagchecklist"></div>
154
+ <div>
155
+ <label>
156
+ <?php _e( 'Class name', 'jquery-pin-it-button-for-images' ); ?>
157
+ <input class="jpibfi-class-name" type="text">
158
+ </label>
159
+ <button type="button" class="jpibfi-class-button button"><?php _e( 'Add', 'jquery-pin-it-button-for-images' ); ?></button>
160
+ </div>
161
+ </div>
162
163
<?php
164
echo JPIBFI_Admin_Utilities::create_description( $args[0] );
165
echo JPIBFI_Admin_Utilities::create_errors( 'disabled_classes' );
166
}
171
$value = esc_attr( $options[ 'enabled_classes' ] );
172
173
?>
174
+ <div id="jpibfi-enabled-classes">
175
+ <input type="hidden" class="jpibfi-value" name="jpibfi_selection_options[enabled_classes]" value="<?php echo $value; ?>">
176
+ <span class="jpibfi-empty"><?php echo JPIBFI_Admin_Utilities::create_description( __( 'No classes added.', 'jquery-pin-it-button-for-images' ) ); ?></span>
177
+ <div class="jpibfi-classes-list tagchecklist"></div>
178
+ <div>
179
+ <label>
180
+ <?php _e( 'Class name', 'jquery-pin-it-button-for-images' ); ?>
181
+ <input class="jpibfi-class-name" type="text">
182
+ </label>
183
+ <button type="button" class="jpibfi-class-button button"><?php _e( 'Add', 'jquery-pin-it-button-for-images' ); ?></button>
184
+ </div>
185
+ </div>
186
187
<?php
188
echo JPIBFI_Admin_Utilities::create_description( $args[0] );
189
echo JPIBFI_Admin_Utilities::create_errors( 'enabled_classes' );
190
}
200
?>
201
202
<input type="checkbox" id="show_on_home" name="jpibfi_selection_options[show_on_home]" <?php checked( true, $show_on_home ); ?> value="1" />
203
+ <label for="show_on_home"><?php _e( 'Home page', 'jquery-pin-it-button-for-images' ); ?></label><br/>
204
<input type="checkbox" id="show_on_page" name="jpibfi_selection_options[show_on_page]" <?php checked( true, $show_on_page ); ?> value="1" />
205
+ <label for="show_on_page"><?php _e( 'Pages', 'jquery-pin-it-button-for-images' ); ?></label><br />
206
<input type="checkbox" id="show_on_single" name="jpibfi_selection_options[show_on_single]" <?php checked( true, $show_on_single ); ?> value="1" />
207
+ <label for="show_on_single"><?php _e( 'Single posts', 'jquery-pin-it-button-for-images' ); ?></label><br />
208
<input type="checkbox" id="show_on_category" name="jpibfi_selection_options[show_on_category]" <?php checked( true, $show_on_category ); ?> value="1" />
209
+ <label for="show_on_category"><?php _e( 'Category and archive pages', 'jquery-pin-it-button-for-images' ); ?></label><br />
210
<input type="checkbox" id="show_on_blog" name="jpibfi_selection_options[show_on_blog]" <?php checked( true, $show_on_blog ); ?> value="1" />
211
+ <label for="show_on_blog"><?php _e( 'Blog pages', 'jquery-pin-it-button-for-images' ); ?></label>
212
213
<?php
214
echo JPIBFI_Admin_Utilities::create_description( $args[0] );
222
?>
223
224
<p>
225
+ <label for="min_image_height"><?php _e('Height', 'jquery-pin-it-button-for-images'); ?></label>
226
<input type="number" min="0" step="1" id="min_image_height" name="jpibfi_selection_options[min_image_height]" value="<?php echo $min_image_height; ?>"
227
class="small-text" /> px
228
<?php echo JPIBFI_Admin_Utilities::create_errors( 'min_image_height' ); ?>
229
</p>
230
231
<p>
232
+ <label for="min_image_width"><?php _e('Width', 'jquery-pin-it-button-for-images'); ?></label>
233
<input type="number" min="0" step="1" id="min_image_width" name="jpibfi_selection_options[min_image_width]" value="<?php echo $min_image_width; ?>"
234
class="small-text" /> px
235
<?php echo JPIBFI_Admin_Utilities::create_errors( 'min_image_width' ); ?>
251
252
$field = '';
253
if ( 'disabled_classes' == $key )
254
+ $field = __( 'Disabled classes', 'jquery-pin-it-button-for-images' );
255
else if ( 'enabled_classes' == $key )
256
+ $field = __( 'Enabled classes', 'jquery-pin-it-button-for-images' );
257
258
add_settings_error(
259
$key,
260
esc_attr( 'settings_updated' ),
261
+ $field . ' - ' . __('the given value doesn\'t meet the requirements. Please correct it and try again.', 'jquery-pin-it-button-for-images')
262
);
263
}
264
break;
268
269
$field = '';
270
if ( 'min_image_height' == $key )
271
+ $field = __( 'Minimum image height', 'jquery-pin-it-button-for-images' );
272
else if ( 'min_image_width' == $key )
273
+ $field = __( 'Minimum image width', 'jquery-pin-it-button-for-images' );
274
275
add_settings_error(
276
$key,
277
esc_attr( 'settings_updated' ),
278
+ $field . ' - ' . sprintf ( __('value must be a number greater or equal to %d.', 'jquery-pin-it-button-for-images'), '0' )
279
);
280
}
281
break;
includes/admin/class-jpibfi-visual-options.php CHANGED
@@ -41,13 +41,13 @@ class JPIBFI_Visual_Options {
41
'custom_image_url' => '',
42
'custom_image_height' => '0',
43
'custom_image_width' => '0',
44
- 'use_post_url' => '0',
45
- 'button_position' => '0',
46
- 'button_margin_top' => '20',
47
- 'button_margin_right' => '20',
48
- 'button_margin_bottom'=> '20',
49
- 'button_margin_left' => '20',
50
- 'retina_friendly' => '0'
51
);
52
53
return apply_filters( 'jpibfi_default_visual_options', $defaults );
@@ -67,7 +67,7 @@ class JPIBFI_Visual_Options {
67
// First, we register a section.
68
add_settings_section(
69
'visual_options_section', // ID used to identify this section and with which to register options
70
- __( 'Visual', 'jpibfi' ), // Title to be displayed on the administration page
71
array( $this, 'visual_options_callback' ), // Callback used to render the description of the section
72
'jpibfi_visual_options' // Page on which to add this section of options
73
);
@@ -75,82 +75,82 @@ class JPIBFI_Visual_Options {
75
//Then add all necessary fields to the section
76
add_settings_field(
77
'description_option',
78
- __( 'Description source', 'jpibfi' ),
79
array( $this, 'description_option_callback' ),
80
'jpibfi_visual_options',
81
'visual_options_section',
82
array(
83
- __( '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.', 'jpibfi' ),
84
)
85
);
86
87
add_settings_field(
88
'use_post_url',
89
- __( 'Linked page', 'jpibfi' ),
90
array( $this, 'use_post_url_callback' ),
91
'jpibfi_visual_options',
92
'visual_options_section',
93
array(
94
- __( '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.', 'jpibfi' ),
95
)
96
);
97
98
add_settings_field(
99
'transparency_value',
100
- __( 'Transparency value', 'jpibfi' ),
101
array( $this, 'transparency_value_callback' ),
102
'jpibfi_visual_options',
103
'visual_options_section',
104
array(
105
- __( 'This setting sets the transparency of the image.', 'jpibfi' ),
106
)
107
);
108
109
add_settings_field(
110
'custom_pin_it_button',
111
- __( 'Custom "Pin It" button', 'jpibfi' ),
112
array( $this, 'custom_pin_it_button_callback' ),
113
'jpibfi_visual_options',
114
'visual_options_section',
115
array(
116
- __( '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.', 'jpibfi' ),
117
)
118
);
119
120
add_settings_field(
121
'pin_it_button_position',
122
- __( '"Pin it" button position', 'jpibfi' ),
123
array( $this, 'pin_it_button_position_callback' ),
124
'jpibfi_visual_options',
125
'visual_options_section',
126
array(
127
- __( 'Where the "Pin it" button should appear on the image.', 'jpibfi' ),
128
)
129
);
130
131
add_settings_field(
132
'pin_it_button_margins',
133
- __( '"Pin it" button margins', 'jpibfi' ),
134
array( $this, 'pin_it_button_margins_callback' ),
135
'jpibfi_visual_options',
136
'visual_options_section',
137
array(
138
- 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.', 'jpibfi' ),
139
- __( 'Top left', 'jpibfi' ),
140
- __( 'Bottom right', 'jpibfi' ),
141
- __( 'Middle', 'jpibfi' )
142
),
143
)
144
);
145
146
add_settings_field(
147
'retina_friendly',
148
- __( 'Retina friendly', 'jpibfi' ),
149
array( $this, 'retina_friendly_callback' ),
150
'jpibfi_visual_options',
151
'visual_options_section',
152
array(
153
- __( '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.', 'jpibfi' ),
154
)
155
);
156
@@ -163,7 +163,7 @@ class JPIBFI_Visual_Options {
163
}
164
165
public function visual_options_callback() {
166
- echo '<p>' . __('How it should look like', 'jpibfi') . '</p>';
167
}
168
169
public function description_option_callback( $args ) {
@@ -174,12 +174,12 @@ class JPIBFI_Visual_Options {
174
?>
175
176
<select id="description_option" name="jpibfi_visual_options[description_option]">
177
- <option value="1" <?php selected ( "1", $description_option ); ?>><?php _e( 'Page title', 'jpibfi' ); ?></option>
178
- <option value="2" <?php selected ( "2", $description_option ); ?>><?php _e( 'Page description', 'jpibfi' ); ?></option>
179
- <option value="3" <?php selected ( "3", $description_option ); ?>><?php _e( 'Picture title or (if title not available) alt attribute', 'jpibfi' ); ?></option>
180
- <option value="4" <?php selected ( "4", $description_option ); ?>><?php _e( 'Site title (Settings->General)', 'jpibfi' ); ?></option>
181
- <option value="5" <?php selected ( "5", $description_option ); ?>><?php _e( 'Image description', 'jpibfi' ); ?></option>
182
- <option value="6" <?php selected ( "6", $description_option ); ?>><?php _e( 'Image alt attribute', 'jpibfi' ); ?></option>
183
</select>
184
185
<?php
@@ -192,7 +192,7 @@ class JPIBFI_Visual_Options {
192
$use_post_url = JPIBFI_Admin_Utilities::exists_and_equal_to( $options, 'use_post_url', '1' );
193
194
echo '<input type="checkbox" id="use_post_url" name="jpibfi_visual_options[use_post_url]" value="1" ' . checked( true, $use_post_url, false ) . '>';
195
- echo '<label for="use_post_url">' . __( 'Always link to individual post page', 'jpibfi' ) . '</label>';
196
197
echo JPIBFI_Admin_Utilities::create_description( $args[0] );
198
}
@@ -202,7 +202,7 @@ class JPIBFI_Visual_Options {
202
203
$transparency_value = $options[ 'transparency_value' ];
204
205
- echo '<label for="transparency_value">' . sprintf ( __('Choose transparency (between %.02f and %.02f)', 'jpibfi'), '0.00', '1.00' ) . '</label><br/>';
206
echo '<input type="number" min="0" max="1" step="0.01" id="transparency_value" name="jpibfi_visual_options[transparency_value]"' .
207
'value="' . $transparency_value . '" class="small-text" >';
208
echo JPIBFI_Admin_Utilities::create_description( $args[0] );
@@ -220,36 +220,36 @@ class JPIBFI_Visual_Options {
220
?>
221
<p>
222
<input type="checkbox" id="use_custom_image" name="jpibfi_visual_options[use_custom_image]" value="1" <?php checked( true, $use_custom_image ); ?> >
223
- <label class="chbox-label" for="use_custom_image"><?php _e( 'Use custom image', 'jpibfi' ); ?></label>
224
</p>
225
226
- <button id=upload-image><?php _e( 'Upload an image using media library','jpibfi' ); ?></button><br />
227
228
<p>
229
- <label for="custom_image_url"><?php _e( 'URL address of the image', 'jpibfi' ); ?></label>
230
<input type="url" id="custom_image_url" name="jpibfi_visual_options[custom_image_url]" value="<?php echo $custom_image_url; ?>">
231
</p>
232
233
<p>
234
- <label for="custom_image_height"><?php _e( 'Height', 'jpibfi' ); ?></label>
235
<input type="number" min="0" step="1" id="custom_image_height" name="jpibfi_visual_options[custom_image_height]" value="<?php echo $custom_image_height; ?>"
236
class="small-text" /> px
237
<?php echo JPIBFI_Admin_Utilities::create_errors( 'custom_image_height' ); ?>
238
</p>
239
240
<p>
241
- <label for="custom_image_width"><?php _e( 'Width', 'jpibfi' ); ?></label>
242
<input type="number" min="0" step="1" id="custom_image_width" name="jpibfi_visual_options[custom_image_width]" value="<?php echo $custom_image_width; ?>"
243
class="small-text" /> px
244
<?php echo JPIBFI_Admin_Utilities::create_errors( 'custom_image_width' ); ?>
245
</p>
246
247
<p>
248
- <b><?php _e( 'Custom Pin It button preview', 'jpibfi' ); ?></b><br/>
249
<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; ?>');">
250
Preview
251
</span><br/>
252
- <button id="refresh_custom_button_preview"><?php _e( 'Refresh preview', 'jpibfi' ); ?></button>
253
</p>
254
255
<?php
@@ -261,11 +261,11 @@ class JPIBFI_Visual_Options {
261
$options = $this->get_visual_options();
262
263
$jpibfi_button_dropdown = array(
264
- __( 'Top left', 'jpibfi' ),
265
- __( 'Top right', 'jpibfi' ),
266
- __( 'Bottom left', 'jpibfi' ),
267
- __( 'Bottom right', 'jpibfi' ),
268
- __( 'Middle', 'jpibfi' )
269
);
270
271
$button_position = $options[ 'button_position' ];
@@ -285,13 +285,13 @@ class JPIBFI_Visual_Options {
285
public function pin_it_button_margins_callback( $args ) {
286
$options = $this->get_visual_options();
287
?>
288
- <label for="button_margin_top"><?php _e('Top', 'jpibfi'); ?></label>
289
<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/>
290
- <label for="button_margin_bottom"><?php _e('Bottom', 'jpibfi'); ?></label>
291
<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/>
292
- <label for="button_margin_left"><?php _e('Left', 'jpibfi'); ?></label>
293
<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/>
294
- <label for="button_margin_right"><?php _e('Right', 'jpibfi'); ?></label>
295
<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/>
296
297
<?php
@@ -304,7 +304,7 @@ class JPIBFI_Visual_Options {
304
$retina_friendly = JPIBFI_Admin_Utilities::exists_and_equal_to( $options, 'retina_friendly', '1' );
305
306
echo '<input type="checkbox" id="retina_friendly" name="jpibfi_visual_options[retina_friendly]" value="1" ' . checked( true, $retina_friendly, false ) . '>';
307
- echo '<label for="retina_friendly">' . __( 'Optimize for high pixel density displays', 'jpibfi' ) . '</label>';
308
309
echo JPIBFI_Admin_Utilities::create_description( $args[0] );
310
}
@@ -321,7 +321,7 @@ class JPIBFI_Visual_Options {
321
add_settings_error(
322
$key,
323
esc_attr( 'settings_updated' ),
324
- sprintf( __('Transparency value must be a number between %.02d and %.02f.', 'jpibfi'), '0.00', '1.00' )
325
);
326
}
327
break;
@@ -329,15 +329,15 @@ class JPIBFI_Visual_Options {
329
case 'custom_image_width':
330
$name = "";
331
if ( 'custom_image_height' == $key )
332
- $name = __('Custom image height', 'jpibfi' );
333
else if ( 'custom_image_width' == $key )
334
- $name = __('Custom image width', 'jpibfi' );
335
336
if ( '' != $value && ( !is_numeric( $value ) || $value < 0 ) ) {
337
add_settings_error(
338
$key,
339
esc_attr( 'settings_updated' ),
340
- $name . ' - ' . sprintf ( __('value must be a number greater or equal to %d.', 'jpibfi'), '0' )
341
);
342
}
343
break;
41
'custom_image_url' => '',
42
'custom_image_height' => '0',
43
'custom_image_width' => '0',
44
+ 'use_post_url' => '0',
45
+ 'button_position' => '0',
46
+ 'button_margin_top' => '20',
47
+ 'button_margin_right' => '20',
48
+ 'button_margin_bottom' => '20',
49
+ 'button_margin_left' => '20',
50
+ 'retina_friendly' => '0'
51
);
52
53
return apply_filters( 'jpibfi_default_visual_options', $defaults );
67
// First, we register a section.
68
add_settings_section(
69
'visual_options_section', // ID used to identify this section and with which to register options
70
+ __( 'Visual', 'jquery-pin-it-button-for-images' ), // Title to be displayed on the administration page
71
array( $this, 'visual_options_callback' ), // Callback used to render the description of the section
72
'jpibfi_visual_options' // Page on which to add this section of options
73
);
75
//Then add all necessary fields to the section
76
add_settings_field(
77
'description_option',
78
+ __( 'Description source', 'jquery-pin-it-button-for-images' ),
79
array( $this, 'description_option_callback' ),
80
'jpibfi_visual_options',
81
'visual_options_section',
82
array(
83
+ __( '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' ),
84
)
85
);
86
87
add_settings_field(
88
'use_post_url',
89
+ __( 'Linked page', 'jquery-pin-it-button-for-images' ),
90
array( $this, 'use_post_url_callback' ),
91
'jpibfi_visual_options',
92
'visual_options_section',
93
array(
94
+ __( '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' ),
95
)
96
);
97
98
add_settings_field(
99
'transparency_value',
100
+ __( 'Transparency value', 'jquery-pin-it-button-for-images' ),
101
array( $this, 'transparency_value_callback' ),
102
'jpibfi_visual_options',
103
'visual_options_section',
104
array(
105
+ __( 'This setting sets the transparency of the image.', 'jquery-pin-it-button-for-images' ),
106
)
107
);
108
109
add_settings_field(
110
'custom_pin_it_button',
111
+ __( 'Custom "Pin It" button', 'jquery-pin-it-button-for-images' ),
112
array( $this, 'custom_pin_it_button_callback' ),
113
'jpibfi_visual_options',
114
'visual_options_section',
115
array(
116
+ __( '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' ),
117
)
118
);
119
120
add_settings_field(
121
'pin_it_button_position',
122
+ __( '"Pin it" button position', 'jquery-pin-it-button-for-images' ),
123
array( $this, 'pin_it_button_position_callback' ),
124
'jpibfi_visual_options',
125
'visual_options_section',
126
array(
127
+ __( 'Where the "Pin it" button should appear on the image.', 'jquery-pin-it-button-for-images' ),
128
)
129
);
130
131
add_settings_field(
132
'pin_it_button_margins',
133
+ __( '"Pin it" button margins', 'jquery-pin-it-button-for-images' ),
134
array( $this, 'pin_it_button_margins_callback' ),
135
'jpibfi_visual_options',
136
'visual_options_section',
137
array(
138
+ 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' ),
139
+ __( 'Top left', 'jquery-pin-it-button-for-images' ),
140
+ __( 'Bottom right', 'jquery-pin-it-button-for-images' ),
141
+ __( 'Middle', 'jquery-pin-it-button-for-images' )
142
),
143
)
144
);
145
146
add_settings_field(
147
'retina_friendly',
148
+ __( 'Retina friendly', 'jquery-pin-it-button-for-images' ),
149
array( $this, 'retina_friendly_callback' ),
150
'jpibfi_visual_options',
151
'visual_options_section',
152
array(
153
+ __( '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' ),
154
)
155
);
156
163
}
164
165
public function visual_options_callback() {
166
+ echo '<p>' . __('How it should look like', 'jquery-pin-it-button-for-images') . '</p>';
167
}
168
169
public function description_option_callback( $args ) {
174
?>
175
176
<select id="description_option" name="jpibfi_visual_options[description_option]">
177
+ <option value="1" <?php selected ( "1", $description_option ); ?>><?php _e( 'Page title', 'jquery-pin-it-button-for-images' ); ?></option>
178
+ <option value="2" <?php selected ( "2", $description_option ); ?>><?php _e( 'Page description', 'jquery-pin-it-button-for-images' ); ?></option>
179
+ <option value="3" <?php selected ( "3", $description_option ); ?>><?php _e( 'Picture title or (if title not available) alt attribute', 'jquery-pin-it-button-for-images' ); ?></option>
180
+ <option value="4" <?php selected ( "4", $description_option ); ?>><?php _e( 'Site title (Settings->General)', 'jquery-pin-it-button-for-images' ); ?></option>
181
+ <option value="5" <?php selected ( "5", $description_option ); ?>><?php _e( 'Image description', 'jquery-pin-it-button-for-images' ); ?></option>
182
+ <option value="6" <?php selected ( "6", $description_option ); ?>><?php _e( 'Image alt attribute', 'jquery-pin-it-button-for-images' ); ?></option>
183
</select>
184
185
<?php
192
$use_post_url = JPIBFI_Admin_Utilities::exists_and_equal_to( $options, 'use_post_url', '1' );
193
194
echo '<input type="checkbox" id="use_post_url" name="jpibfi_visual_options[use_post_url]" value="1" ' . checked( true, $use_post_url, false ) . '>';
195
+ echo '<label for="use_post_url">' . __( 'Always link to individual post page', 'jquery-pin-it-button-for-images' ) . '</label>';
196
197
echo JPIBFI_Admin_Utilities::create_description( $args[0] );
198
}
202
203
$transparency_value = $options[ 'transparency_value' ];
204
205
+ echo '<label for="transparency_value">' . sprintf ( __('Choose transparency (between %.02f and %.02f)', 'jquery-pin-it-button-for-images'), '0.00', '1.00' ) . '</label><br/>';
206
echo '<input type="number" min="0" max="1" step="0.01" id="transparency_value" name="jpibfi_visual_options[transparency_value]"' .
207
'value="' . $transparency_value . '" class="small-text" >';
208
echo JPIBFI_Admin_Utilities::create_description( $args[0] );
220
?>
221
<p>
222
<input type="checkbox" id="use_custom_image" name="jpibfi_visual_options[use_custom_image]" value="1" <?php checked( true, $use_custom_image ); ?> >
223
+ <label class="chbox-label" for="use_custom_image"><?php _e( 'Use custom image', 'jquery-pin-it-button-for-images' ); ?></label>
224
</p>
225
226
+ <button id=upload-image><?php _e( 'Upload an image using media library','jquery-pin-it-button-for-images' ); ?></button><br />
227
228
<p>
229
+ <label for="custom_image_url"><?php _e( 'URL address of the image', 'jquery-pin-it-button-for-images' ); ?></label>
230
<input type="url" id="custom_image_url" name="jpibfi_visual_options[custom_image_url]" value="<?php echo $custom_image_url; ?>">
231
</p>
232
233
<p>
234
+ <label for="custom_image_height"><?php _e( 'Height', 'jquery-pin-it-button-for-images' ); ?></label>
235
<input type="number" min="0" step="1" id="custom_image_height" name="jpibfi_visual_options[custom_image_height]" value="<?php echo $custom_image_height; ?>"
236
class="small-text" /> px
237
<?php echo JPIBFI_Admin_Utilities::create_errors( 'custom_image_height' ); ?>
238
</p>
239
240
<p>
241
+ <label for="custom_image_width"><?php _e( 'Width', 'jquery-pin-it-button-for-images' ); ?></label>
242
<input type="number" min="0" step="1" id="custom_image_width" name="jpibfi_visual_options[custom_image_width]" value="<?php echo $custom_image_width; ?>"
243
class="small-text" /> px
244
<?php echo JPIBFI_Admin_Utilities::create_errors( 'custom_image_width' ); ?>
245
</p>
246
247
<p>
248
+ <b><?php _e( 'Custom Pin It button preview', 'jquery-pin-it-button-for-images' ); ?></b><br/>
249
<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; ?>');">
250
Preview
251
</span><br/>
252
+ <button id="refresh_custom_button_preview"><?php _e( 'Refresh preview', 'jquery-pin-it-button-for-images' ); ?></button>
253
</p>
254
255
<?php
261
$options = $this->get_visual_options();
262
263
$jpibfi_button_dropdown = array(
264
+ __( 'Top left', 'jquery-pin-it-button-for-images' ),
265
+ __( 'Top right', 'jquery-pin-it-button-for-images' ),
266
+ __( 'Bottom left', 'jquery-pin-it-button-for-images' ),
267
+ __( 'Bottom right', 'jquery-pin-it-button-for-images' ),
268
+ __( 'Middle', 'jquery-pin-it-button-for-images' )
269
);
270
271
$button_position = $options[ 'button_position' ];
285
public function pin_it_button_margins_callback( $args ) {
286
$options = $this->get_visual_options();
287
?>
288
+ <label for="button_margin_top"><?php _e('Top', 'jquery-pin-it-button-for-images'); ?></label>
289
<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/>
290
+ <label for="button_margin_bottom"><?php _e('Bottom', 'jquery-pin-it-button-for-images'); ?></label>
291
<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/>
292
+ <label for="button_margin_left"><?php _e('Left', 'jquery-pin-it-button-for-images'); ?></label>
293
<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/>
294
+ <label for="button_margin_right"><?php _e('Right', 'jquery-pin-it-button-for-images'); ?></label>
295
<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/>
296
297
<?php
304
$retina_friendly = JPIBFI_Admin_Utilities::exists_and_equal_to( $options, 'retina_friendly', '1' );
305
306
echo '<input type="checkbox" id="retina_friendly" name="jpibfi_visual_options[retina_friendly]" value="1" ' . checked( true, $retina_friendly, false ) . '>';
307
+ echo '<label for="retina_friendly">' . __( 'Optimize for high pixel density displays', 'jquery-pin-it-button-for-images' ) . '</label>';
308
309
echo JPIBFI_Admin_Utilities::create_description( $args[0] );
310
}
321
add_settings_error(
322
$key,
323
esc_attr( 'settings_updated' ),
324
+ sprintf( __('Transparency value must be a number between %.02d and %.02f.', 'jquery-pin-it-button-for-images'), '0.00', '1.00' )
325
);
326
}
327
break;
329
case 'custom_image_width':
330
$name = "";
331
if ( 'custom_image_height' == $key )
332
+ $name = __('Custom image height', 'jquery-pin-it-button-for-images' );
333
else if ( 'custom_image_width' == $key )
334
+ $name = __('Custom image width', 'jquery-pin-it-button-for-images' );
335
336
if ( '' != $value && ( !is_numeric( $value ) || $value < 0 ) ) {
337
add_settings_error(
338
$key,
339
esc_attr( 'settings_updated' ),
340
+ $name . ' - ' . sprintf ( __('value must be a number greater or equal to %d.', 'jquery-pin-it-button-for-images'), '0' )
341
);
342
}
343
break;
includes/admin/views/admin.php CHANGED
@@ -3,7 +3,7 @@
3
?>
4
<div class="wrap">
5
6
- <h2><?php _e( 'jQuery Pin It Button For Images Options', 'jpibfi' ); ?></h2>
7
<?php
8
$tab = isset( $_GET[ 'tab' ] ) ? $_GET[ 'tab' ] : 'selection_options';
9
$tab_found = false;
@@ -21,21 +21,14 @@ $current_settings = $settings_tabs[ $tab ];
21
</h2>
22
23
<p>
24
- <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', 'jpibfi' ); ?></b></a>
25
- <a href="http://mrsztuczkens.me/jquery-pin-it-button-for-images-customization/" class="button" target="_blank" rel="nofollow"><b><?php _e( 'Plugin Customization', 'jpibfi' ); ?></b></a>
26
- <a href="http://mrsztuczkens.me/jquery-pin-it-button-for-images-extensions/" class="button" target="_blank" rel="nofollow"><b><?php _e( 'Plugin Extensions', 'jpibfi' ); ?></b></a>
27
- <a href="http://bit.ly/Uw2mEP" class="button" target="_blank" rel="nofollow"><b><?php _e( 'Donate', 'jpibfi' ); ?></b></a>
28
- <a href="<?php echo $current_settings['support_link']; ?>" class="button" target="_blank" rel="nofollow"><b><?php _e( 'Support forum', 'jpibfi' ); ?></b></a>
29
</p>
30
- <form method="post" action="options.php" ng-app="jpibfiApp" ng-controller="jpibfiController">
31
<?php
32
-
33
settings_fields( $current_settings[ 'settings_name'] );
34
do_settings_sections( $current_settings[ 'settings_name'] );
35
submit_button();
36
?>
37
</form>
38
- <p>
39
- The Silk Icon Set is provided by Mark James and is availble from <a href="http://famfamfam.com/lab/icons/silk/">FamFamFam</a> under the <a href="http://creativecommons.org/licenses/by/2.5/">Creative Commons Attribution 2.5 License</a>.
40
- </p>
41
</div>
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;
21
</h2>
22
23
<p>
24
+ <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>
25
+ <a href="<?php echo $current_settings['support_link']; ?>" class="button" target="_blank" rel="nofollow"><b><?php _e( 'Support forum', 'jquery-pin-it-button-for-images' ); ?></b></a>
26
</p>
27
+ <form method="post" action="options.php">
28
<?php
29
settings_fields( $current_settings[ 'settings_name'] );
30
do_settings_sections( $current_settings[ 'settings_name'] );
31
submit_button();
32
?>
33
</form>
34
</div>
includes/admin/views/notice.php DELETED
@@ -1,5 +0,0 @@
1
- <div class="updated">
2
- <p><?php _e('<strong>jQuery Pin It Button for Images</strong> is no longer being actively developed. There will be only minor bug fix releases in the future.', 'jpibfi'); ?></p>
3
- <p><?php _e('However, there is a new, much more powerful plugin that allows to Pin your images and much more - <strong>Frizzly</strong>.', 'jpibfi'); ?></p>
4
- <p><a style="font-weight: bold;" class="button button-primary" href="http://wordpress.org/plugins/frizzly/" target="_blank"><?php _e('Check out Frizzly on the official WordPress repository', 'jpibfi'); ?></a></p>
5
- </div>
includes/public/class-jpibfi-client.php CHANGED
@@ -47,7 +47,7 @@ class JPIBFI_Client {
47
48
if ( ! ( JPIBFI_Client_Utilities::add_jpibfi() ) )
49
return;
50
- wp_enqueue_script( 'jquery-pin-it-button-script', JPIBFI_SCRIPT_URL . 'script.min.js', array( 'jquery' ), JPIBFI_VERSION . JPIBFI_VERSION_MINOR, false );
51
52
$use_custom_image = isset( $jpibfi_visual_options[ 'use_custom_image' ] ) && $jpibfi_visual_options[ 'use_custom_image' ] == "1";
53
@@ -110,22 +110,6 @@ class JPIBFI_Client {
110
background-size: <?php echo $width; ?>px <?php echo $height; ?>px !important
111
}
112
113
- a.pinit-button.pinit-top-left {
114
- <?php printf('margin: %dpx 0 0 %dpx', $jpibfi_visual_options['button_margin_top'], $jpibfi_visual_options['button_margin_left']); ?>
115
- }
116
-
117
- a.pinit-button.pinit-top-right {
118
- <?php printf('margin: %dpx %dpx 0 0', $jpibfi_visual_options['button_margin_top'], $jpibfi_visual_options['button_margin_right']); ?>
119
- }
120
-
121
- a.pinit-button.pinit-bottom-left {
122
- <?php printf('margin: 0 0 %dpx %dpx', $jpibfi_visual_options['button_margin_bottom'], $jpibfi_visual_options['button_margin_left']); ?>
123
- }
124
-
125
- a.pinit-button.pinit-bottom-right {
126
- <?php printf('margin: 0 %dpx %dpx 0', $jpibfi_visual_options['button_margin_right'], $jpibfi_visual_options['button_margin_bottom']); ?>
127
- }
128
-
129
img.pinit-hover {
130
opacity: <?php echo (1 - $jpibfi_visual_options['transparency_value']); ?> !important;
131
filter:alpha(opacity=<?php echo (1 - $jpibfi_visual_options['transparency_value']) * 100; ?>) !important; /* For IE8 and earlier */
47
48
if ( ! ( JPIBFI_Client_Utilities::add_jpibfi() ) )
49
return;
50
+ wp_enqueue_script( 'jquery-pin-it-button-script', JPIBFI_SCRIPT_URL . 'jpibfi-min.js', array( 'jquery' ), JPIBFI_VERSION . JPIBFI_VERSION_MINOR, false );
51
52
$use_custom_image = isset( $jpibfi_visual_options[ 'use_custom_image' ] ) && $jpibfi_visual_options[ 'use_custom_image' ] == "1";
53
110
background-size: <?php echo $width; ?>px <?php echo $height; ?>px !important
111
}
112
113
img.pinit-hover {
114
opacity: <?php echo (1 - $jpibfi_visual_options['transparency_value']); ?> !important;
115
filter:alpha(opacity=<?php echo (1 - $jpibfi_visual_options['transparency_value']) * 100; ?>) !important; /* For IE8 and earlier */
jquery-pin-it-button-for-images.php CHANGED
@@ -3,8 +3,10 @@
3
Plugin Name: jQuery Pin It Button For Images
4
Plugin URI: http://mrsztuczkens.me/jpibfi/
5
Description: Highlights images on hover and adds a "Pin It" button over them for easy pinning.
6
Author: Marcin Skrzypiec
7
- Version: 1.38
8
Author URI: http://mrsztuczkens.me/
9
*/
10
@@ -47,7 +49,7 @@ if ( ! class_exists( 'jQuery_Pin_It_Button_For_Images' ) ) :
47
/* VERSIONING */
48
//plugin version
49
if ( ! defined( 'JPIBFI_VERSION' ) )
50
- define( 'JPIBFI_VERSION', '1.38' );
51
52
//used in versioning css and js files
53
if ( ! defined( 'JPIBFI_VERSION_MINOR' ) )
@@ -106,7 +108,6 @@ if ( ! class_exists( 'jQuery_Pin_It_Button_For_Images' ) ) :
106
$jpibfi_visual_options = get_option( JPIBFI_VISUAL_OPTIONS );
107
$jpibfi_adanced_options = get_option( JPIBFI_ADVANCED_OPTIONS );
108
109
-
110
require_once JPIBFI_PLUGIN_DIR . 'includes/admin/class-jpibfi-admin-utilities.php';
111
require_once JPIBFI_PLUGIN_DIR . 'includes/admin/class-jpibfi-selection-options.php';
112
require_once JPIBFI_PLUGIN_DIR . 'includes/admin/class-jpibfi-advanced-options.php';
@@ -114,21 +115,14 @@ if ( ! class_exists( 'jQuery_Pin_It_Button_For_Images' ) ) :
114
require_once JPIBFI_PLUGIN_DIR . 'includes/admin/class-jpibfi-admin.php';
115
require_once JPIBFI_PLUGIN_DIR . 'includes/public/class-jpibfi-client-utilities.php';
116
require_once JPIBFI_PLUGIN_DIR . 'includes/public/class-jpibfi-client.php';
117
-
118
-
119
- if ( is_admin() ) {
120
- //TODO changes
121
- } else {
122
-
123
- }
124
}
125
126
public function load_textdomain() {
127
- load_plugin_textdomain( 'jpibfi', FALSE, dirname( plugin_basename( JPIBFI_PLUGIN_FILE ) ) . '/languages/' );
128
}
129
130
public function plugin_settings_filter( $links ) {
131
- $settings_link = '<a href="options-general.php?page=jpibfi_settings">' . __( 'Settings', 'jpibfi' ) . '</a>';
132
array_unshift( $links, $settings_link );
133
return $links;
134
}
@@ -153,15 +147,9 @@ if ( ! class_exists( 'jQuery_Pin_It_Button_For_Images' ) ) :
153
update_option( JPIBFI_VERSION_OPTION, JPIBFI_VERSION );
154
//update not needed anymore
155
update_option( JPIBFI_UPDATE_OPTIONS, false);
156
-
157
- add_action( 'admin_notices', array( $this, 'show_admin_notice') );
158
}
159
}
160
161
- public function show_admin_notice(){
162
- include_once( 'includes/admin/views/notice.php');
163
- }
164
-
165
/* Function makes sure that option has all needed fields by checking with defaults */
166
public static function update_option_fields( $option, $default_option, $option_name ) {
167
3
Plugin Name: jQuery Pin It Button For Images
4
Plugin URI: http://mrsztuczkens.me/jpibfi/
5
Description: Highlights images on hover and adds a "Pin It" button over them for easy pinning.
6
+ Text Domain: jquery-pin-it-button-for-images
7
+ Domain Path: /languages
8
Author: Marcin Skrzypiec
9
+ Version: 1.40
10
Author URI: http://mrsztuczkens.me/
11
*/
12
49
/* VERSIONING */
50
//plugin version
51
if ( ! defined( 'JPIBFI_VERSION' ) )
52
+ define( 'JPIBFI_VERSION', '1.40' );
53
54
//used in versioning css and js files
55
if ( ! defined( 'JPIBFI_VERSION_MINOR' ) )
108
$jpibfi_visual_options = get_option( JPIBFI_VISUAL_OPTIONS );
109
$jpibfi_adanced_options = get_option( JPIBFI_ADVANCED_OPTIONS );
110
111
require_once JPIBFI_PLUGIN_DIR . 'includes/admin/class-jpibfi-admin-utilities.php';
112
require_once JPIBFI_PLUGIN_DIR . 'includes/admin/class-jpibfi-selection-options.php';
113
require_once JPIBFI_PLUGIN_DIR . 'includes/admin/class-jpibfi-advanced-options.php';
115
require_once JPIBFI_PLUGIN_DIR . 'includes/admin/class-jpibfi-admin.php';
116
require_once JPIBFI_PLUGIN_DIR . 'includes/public/class-jpibfi-client-utilities.php';
117
require_once JPIBFI_PLUGIN_DIR . 'includes/public/class-jpibfi-client.php';
118
}
119
120
public function load_textdomain() {
121
+ load_plugin_textdomain( 'jquery-pin-it-button-for-images', FALSE, dirname( plugin_basename( JPIBFI_PLUGIN_FILE ) ) . '/languages/' );
122
}
123
124
public function plugin_settings_filter( $links ) {
125
+ $settings_link = '<a href="options-general.php?page=jpibfi_settings">' . __( 'Settings', 'jquery-pin-it-button-for-images' ) . '</a>';
126
array_unshift( $links, $settings_link );
127
return $links;
128
}
147
update_option( JPIBFI_VERSION_OPTION, JPIBFI_VERSION );
148
//update not needed anymore
149
update_option( JPIBFI_UPDATE_OPTIONS, false);
150
}
151
}
152
153
/* Function makes sure that option has all needed fields by checking with defaults */
154
public static function update_option_fields( $option, $default_option, $option_name ) {
155
js/admin-angular.js DELETED
@@ -1,122 +0,0 @@
1
- var jpibfiApp = angular.module('jpibfiApp', []);
2
-
3
- jpibfiApp.controller('jpibfiController', function( $scope ) {
4
-
5
- $scope.disabledClasses = [];
6
- $scope.disabledClassesFormatted = '';
7
- $scope.enabledClasses = [];
8
- $scope.enabledClassesFormatted = '';
9
-
10
- /*
11
- * Utility functions
12
- */
13
-
14
- function addClass( listName, classes ) {
15
- var classNames = [];
16
-
17
- if ( classes.indexOf( ';' ) >= 0 ){
18
- classNames = classes.split( ';' );
19
- for(var i = 0; i < classNames.length; i++) {
20
- if ( 0 == classNames[i].length ) {
21
- classNames.splice(i, 1);
22
- i--;
23
- }
24
- }
25
- } else {
26
- classNames.push( classes );
27
- }
28
-
29
- var list = null;
30
-
31
- if ( listName == 'disabledClasses' )
32
- list = $scope.disabledClasses;
33
- else if ( listName == 'enabledClasses' )
34
- list = $scope.enabledClasses;
35
-
36
-
37
- for(var i = 0; i < classNames.length; i++ ) {
38
- if ( list.indexOf( classNames[i] ) < 0 )
39
- list.push( classNames[i]);
40
- }
41
-
42
- refreshFormattedValue( listName );
43
- }
44
-
45
- function deleteClass( listName, className ) {
46
- if ( listName == 'disabledClasses' ) {
47
- var index = $scope.disabledClasses.indexOf(className);
48
- $scope.disabledClasses.splice(index, 1);
49
- }
50
- else if ( listName == 'enabledClasses' ) {
51
- var index = $scope.enabledClasses.indexOf(className);
52
- $scope.enabledClasses.splice(index, 1);
53
- }
54
- refreshFormattedValue( listName );
55
- }
56
-
57
- function initClass( listName, formatted ) {
58
- var listRef = null;
59
-
60
- if ( listName == 'disabledClasses' ) {
61
- $scope.disabledClasses = formatted.split( ';' );
62
- listRef = $scope.disabledClasses;
63
- } else if ( listName == 'enabledClasses' ) {
64
- $scope.enabledClasses = formatted.split( ';' );
65
- listRef = $scope.enabledClasses;
66
- }
67
-
68
- for( var i = 0; i < listRef.length; i++ ){
69
- if ( 0 == listRef[i].length ) {
70
- listRef.splice(i, 1);
71
- i--;
72
- }
73
- }
74
-
75
- if ( listName == 'disabledClasses' )
76
- $scope.disabledClassesFormatted = listRef.join( ';' );
77
- else if ( listName == 'enabledClasses' )
78
- $scope.enabledClassesFormatted = listRef.join( ';' );
79
- }
80
-
81
- function refreshFormattedValue( listName ){
82
- if ( listName == 'disabledClasses' )
83
- $scope.disabledClassesFormatted = $scope.disabledClasses.join( ';' );
84
- else if ( listName == 'enabledClasses' )
85
- $scope.enabledClassesFormatted = $scope.enabledClasses.join( ';' );
86
- }
87
-
88
- /*
89
- * Disabled classes
90
- */
91
-
92
- $scope.initDisabledClasses = function( disClassesFormatted ){
93
- initClass( 'disabledClasses', disClassesFormatted );
94
- }
95
-
96
- $scope.addDisabledClass = function( className ) {
97
- addClass( 'disabledClasses', className );
98
- this.disabledClass = '';
99
- };
100
-
101
- $scope.deleteDisabledClass = function( disabledClass ) {
102
- deleteClass( 'disabledClasses', disabledClass );
103
- };
104
-
105
- /*
106
- * Enabled classes
107
- */
108
-
109
- $scope.initEnabledClasses = function( enClassesFormatted ){
110
- initClass( 'enabledClasses', enClassesFormatted );
111
- }
112
-
113
- $scope.addEnabledClass = function(className) {
114
- addClass( 'enabledClasses', className );
115
- this.enabledClass = '';
116
- };
117
-
118
- $scope.deleteEnabledClass = function( enabledClass ) {
119
- deleteClass( 'enabledClasses', enabledClass );
120
- };
121
-
122
- });
js/admin.js CHANGED
@@ -1,24 +1,133 @@
1
- jQuery(document).ready(function($) {
2
-
3
- $('a.jpibfi_selector_option').click(function(e) {
4
- $('#image_selector').val($(this).text());
5
- e.preventDefault();
6
- });
7
-
8
- $("#refresh_custom_button_preview").click( function(e) {
9
- var customWidth = $('#custom_image_width').val();
10
- var customHeight = $('#custom_image_height').val();
11
- var customUrl = $('#custom_image_url').val();
12
-
13
- $('#custom_button_preview')
14
- .css(
15
- {
16
- width: customWidth,
17
- height: customHeight,
18
- "background-image": "url('" + customUrl + "')"
19
- }
20
- );
21
- return false;
22
- });
23
-
24
- });
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
+ $(document).ready(function ($) {
111
+
112
+ disabledClassesModule.init($('#jpibfi-disabled-classes'));
113
+ enabledClassesModule.init($('#jpibfi-enabled-classes'));
114
+
115
+ $('a.jpibfi_selector_option').click(function (e) {
116
+ $('#image_selector').val($(this).text());
117
+ e.preventDefault();
118
+ });
119
+
120
+ $("#refresh_custom_button_preview").click(function (e) {
121
+ var customWidth = $('#custom_image_width').val();
122
+ var customHeight = $('#custom_image_height').val();
123
+ var customUrl = $('#custom_image_url').val();
124
+
125
+ $('#custom_button_preview').css({
126
+ width: customWidth,
127
+ height: customHeight,
128
+ "background-image": "url('" + customUrl + "')"
129
+ });
130
+ return false;
131
+ });
132
+ });
133
+ })(jQuery);
js/angular.min.js DELETED
@@ -1,163 +0,0 @@
1
- /*
2
- AngularJS v1.0.7
3
- (c) 2010-2012 Google, Inc. http://angularjs.org
4
- License: MIT
5
- */
6
- (function(P,T,q){'use strict';function m(b,a,c){var d;if(b)if(H(b))for(d in b)d!="prototype"&&d!="length"&&d!="name"&&b.hasOwnProperty(d)&&a.call(c,b[d],d);else if(b.forEach&&b.forEach!==m)b.forEach(a,c);else if(!b||typeof b.length!=="number"?0:typeof b.hasOwnProperty!="function"&&typeof b.constructor!="function"||b instanceof K||ca&&b instanceof ca||wa.call(b)!=="[object Object]"||typeof b.callee==="function")for(d=0;d<b.length;d++)a.call(c,b[d],d);else for(d in b)b.hasOwnProperty(d)&&a.call(c,b[d],
7
- d);return b}function mb(b){var a=[],c;for(c in b)b.hasOwnProperty(c)&&a.push(c);return a.sort()}function fc(b,a,c){for(var d=mb(b),e=0;e<d.length;e++)a.call(c,b[d[e]],d[e]);return d}function nb(b){return function(a,c){b(c,a)}}function xa(){for(var b=aa.length,a;b;){b--;a=aa[b].charCodeAt(0);if(a==57)return aa[b]="A",aa.join("");if(a==90)aa[b]="0";else return aa[b]=String.fromCharCode(a+1),aa.join("")}aa.unshift("0");return aa.join("")}function ob(b,a){a?b.$hashKey=a:delete b.$hashKey}function v(b){var a=
8
- b.$hashKey;m(arguments,function(a){a!==b&&m(a,function(a,c){b[c]=a})});ob(b,a);return b}function G(b){return parseInt(b,10)}function ya(b,a){return v(new (v(function(){},{prototype:b})),a)}function C(){}function ma(b){return b}function I(b){return function(){return b}}function w(b){return typeof b=="undefined"}function y(b){return typeof b!="undefined"}function L(b){return b!=null&&typeof b=="object"}function B(b){return typeof b=="string"}function Qa(b){return typeof b=="number"}function na(b){return wa.apply(b)==
9
- "[object Date]"}function E(b){return wa.apply(b)=="[object Array]"}function H(b){return typeof b=="function"}function oa(b){return b&&b.document&&b.location&&b.alert&&b.setInterval}function Q(b){return B(b)?b.replace(/^\s*/,"").replace(/\s*#x2F;,""):b}function gc(b){return b&&(b.nodeName||b.bind&&b.find)}function Ra(b,a,c){var d=[];m(b,function(b,g,h){d.push(a.call(c,b,g,h))});return d}function za(b,a){if(b.indexOf)return b.indexOf(a);for(var c=0;c<b.length;c++)if(a===b[c])return c;return-1}function Sa(b,
10
- a){var c=za(b,a);c>=0&&b.splice(c,1);return a}function U(b,a){if(oa(b)||b&&b.$evalAsync&&b.$watch)throw Error("Can't copy Window or Scope");if(a){if(b===a)throw Error("Can't copy equivalent objects or arrays");if(E(b))for(var c=a.length=0;c<b.length;c++)a.push(U(b[c]));else{c=a.$hashKey;m(a,function(b,c){delete a[c]});for(var d in b)a[d]=U(b[d]);ob(a,c)}}else(a=b)&&(E(b)?a=U(b,[]):na(b)?a=new Date(b.getTime()):L(b)&&(a=U(b,{})));return a}function hc(b,a){var a=a||{},c;for(c in b)b.hasOwnProperty(c)&&
11
- c.substr(0,2)!=="$"&&(a[c]=b[c]);return a}function fa(b,a){if(b===a)return!0;if(b===null||a===null)return!1;if(b!==b&&a!==a)return!0;var c=typeof b,d;if(c==typeof a&&c=="object")if(E(b)){if((c=b.length)==a.length){for(d=0;d<c;d++)if(!fa(b[d],a[d]))return!1;return!0}}else if(na(b))return na(a)&&b.getTime()==a.getTime();else{if(b&&b.$evalAsync&&b.$watch||a&&a.$evalAsync&&a.$watch||oa(b)||oa(a))return!1;c={};for(d in b)if(!(d.charAt(0)==="quot;||H(b[d]))){if(!fa(b[d],a[d]))return!1;c[d]=!0}for(d in a)if(!c[d]&&
12
- d.charAt(0)!=="quot;&&a[d]!==q&&!H(a[d]))return!1;return!0}return!1}function Ta(b,a){var c=arguments.length>2?ha.call(arguments,2):[];return H(a)&&!(a instanceof RegExp)?c.length?function(){return arguments.length?a.apply(b,c.concat(ha.call(arguments,0))):a.apply(b,c)}:function(){return arguments.length?a.apply(b,arguments):a.call(b)}:a}function ic(b,a){var c=a;/^\$+/.test(b)?c=q:oa(a)?c="$WINDOW":a&&T===a?c="$DOCUMENT":a&&a.$evalAsync&&a.$watch&&(c="$SCOPE");return c}function da(b,a){return JSON.stringify(b,
13
- ic,a?" ":null)}function pb(b){return B(b)?JSON.parse(b):b}function Ua(b){b&&b.length!==0?(b=z(""+b),b=!(b=="f"||b=="0"||b=="false"||b=="no"||b=="n"||b=="[]")):b=!1;return b}function pa(b){b=u(b).clone();try{b.html("")}catch(a){}var c=u("<div>").append(b).html();try{return b[0].nodeType===3?z(c):c.match(/^(<[^>]+>)/)[1].replace(/^<([\w\-]+)/,function(a,b){return"<"+z(b)})}catch(d){return z(c)}}function Va(b){var a={},c,d;m((b||"").split("&"),function(b){b&&(c=b.split("="),d=decodeURIComponent(c[0]),
14
- a[d]=y(c[1])?decodeURIComponent(c[1]):!0)});return a}function qb(b){var a=[];m(b,function(b,d){a.push(Wa(d,!0)+(b===!0?"":"="+Wa(b,!0)))});return a.length?a.join("&"):""}function Xa(b){return Wa(b,!0).replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+")}function Wa(b,a){return encodeURIComponent(b).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"quot;).replace(/%2C/gi,",").replace(/%20/g,a?"%20":"+")}function jc(b,a){function c(a){a&&d.push(a)}var d=[b],e,g,h=["ng:app","ng-app","x-ng-app",
15
- "data-ng-app"],f=/\sng[:\-]app(:\s*([\w\d_]+);?)?\s/;m(h,function(a){h[a]=!0;c(T.getElementById(a));a=a.replace(":","\\:");b.querySelectorAll&&(m(b.querySelectorAll("."+a),c),m(b.querySelectorAll("."+a+"\\:"),c),m(b.querySelectorAll("["+a+"]"),c))});m(d,function(a){if(!e){var b=f.exec(" "+a.className+" ");b?(e=a,g=(b[2]||"").replace(/\s+/g,",")):m(a.attributes,function(b){if(!e&&h[b.name])e=a,g=b.value})}});e&&a(e,g?[g]:[])}function rb(b,a){var c=function(){b=u(b);a=a||[];a.unshift(["$provide",function(a){a.value("$rootElement",
16
- b)}]);a.unshift("ng");var c=sb(a);c.invoke(["$rootScope","$rootElement","$compile","$injector",function(a,b,c,d){a.$apply(function(){b.data("$injector",d);c(b)(a)})}]);return c},d=/^NG_DEFER_BOOTSTRAP!/;if(P&&!d.test(P.name))return c();P.name=P.name.replace(d,"");Ya.resumeBootstrap=function(b){m(b,function(b){a.push(b)});c()}}function Za(b,a){a=a||"_";return b.replace(kc,function(b,d){return(d?a:"")+b.toLowerCase()})}function $a(b,a,c){if(!b)throw Error("Argument '"+(a||"?")+"' is "+(c||"required"));
17
- return b}function qa(b,a,c){c&&E(b)&&(b=b[b.length-1]);$a(H(b),a,"not a function, got "+(b&&typeof b=="object"?b.constructor.name||"Object":typeof b));return b}function lc(b){function a(a,b,e){return a[b]||(a[b]=e())}return a(a(b,"angular",Object),"module",function(){var b={};return function(d,e,g){e&&b.hasOwnProperty(d)&&(b[d]=null);return a(b,d,function(){function a(c,d,e){return function(){b[e||"push"]([c,d,arguments]);return k}}if(!e)throw Error("No module: "+d);var b=[],c=[],j=a("$injector",
18
- "invoke"),k={_invokeQueue:b,_runBlocks:c,requires:e,name:d,provider:a("$provide","provider"),factory:a("$provide","factory"),service:a("$provide","service"),value:a("$provide","value"),constant:a("$provide","constant","unshift"),filter:a("$filterProvider","register"),controller:a("$controllerProvider","register"),directive:a("$compileProvider","directive"),config:j,run:function(a){c.push(a);return this}};g&&j(g);return k})}})}function tb(b){return b.replace(mc,function(a,b,d,e){return e?d.toUpperCase():
19
- d}).replace(nc,"Moz$1")}function ab(b,a){function c(){var e;for(var b=[this],c=a,h,f,i,j,k,l;b.length;){h=b.shift();f=0;for(i=h.length;f<i;f++){j=u(h[f]);c?j.triggerHandler("$destroy"):c=!c;k=0;for(e=(l=j.children()).length,j=e;k<j;k++)b.push(ca(l[k]))}}return d.apply(this,arguments)}var d=ca.fn[b],d=d.$original||d;c.$original=d;ca.fn[b]=c}function K(b){if(b instanceof K)return b;if(!(this instanceof K)){if(B(b)&&b.charAt(0)!="<")throw Error("selectors not implemented");return new K(b)}if(B(b)){var a=
20
- T.createElement("div");a.innerHTML="<div>&#160;</div>"+b;a.removeChild(a.firstChild);bb(this,a.childNodes);this.remove()}else bb(this,b)}function cb(b){return b.cloneNode(!0)}function ra(b){ub(b);for(var a=0,b=b.childNodes||[];a<b.length;a++)ra(b[a])}function vb(b,a,c){var d=ba(b,"events");ba(b,"handle")&&(w(a)?m(d,function(a,c){db(b,c,a);delete d[c]}):w(c)?(db(b,a,d[a]),delete d[a]):Sa(d[a],c))}function ub(b){var a=b[Aa],c=Ba[a];c&&(c.handle&&(c.events.$destroy&&c.handle({},"$destroy"),vb(b)),delete Ba[a],
21
- b[Aa]=q)}function ba(b,a,c){var d=b[Aa],d=Ba[d||-1];if(y(c))d||(b[Aa]=d=++oc,d=Ba[d]={}),d[a]=c;else return d&&d[a]}function wb(b,a,c){var d=ba(b,"data"),e=y(c),g=!e&&y(a),h=g&&!L(a);!d&&!h&&ba(b,"data",d={});if(e)d[a]=c;else if(g)if(h)return d&&d[a];else v(d,a);else return d}function Ca(b,a){return(" "+b.className+" ").replace(/[\n\t]/g," ").indexOf(" "+a+" ")>-1}function xb(b,a){a&&m(a.split(" "),function(a){b.className=Q((" "+b.className+" ").replace(/[\n\t]/g," ").replace(" "+Q(a)+" "," "))})}
22
- function yb(b,a){a&&m(a.split(" "),function(a){if(!Ca(b,a))b.className=Q(b.className+" "+Q(a))})}function bb(b,a){if(a)for(var a=!a.nodeName&&y(a.length)&&!oa(a)?a:[a],c=0;c<a.length;c++)b.push(a[c])}function zb(b,a){return Da(b,"quot;+(a||"ngController")+"Controller")}function Da(b,a,c){b=u(b);for(b[0].nodeType==9&&(b=b.find("html"));b.length;){if(c=b.data(a))return c;b=b.parent()}}function Ab(b,a){var c=Ea[a.toLowerCase()];return c&&Bb[b.nodeName]&&c}function pc(b,a){var c=function(c,e){if(!c.preventDefault)c.preventDefault=
23
- function(){c.returnValue=!1};if(!c.stopPropagation)c.stopPropagation=function(){c.cancelBubble=!0};if(!c.target)c.target=c.srcElement||T;if(w(c.defaultPrevented)){var g=c.preventDefault;c.preventDefault=function(){c.defaultPrevented=!0;g.call(c)};c.defaultPrevented=!1}c.isDefaultPrevented=function(){return c.defaultPrevented};m(a[e||c.type],function(a){a.call(b,c)});Z<=8?(c.preventDefault=null,c.stopPropagation=null,c.isDefaultPrevented=null):(delete c.preventDefault,delete c.stopPropagation,delete c.isDefaultPrevented)};
24
- c.elem=b;return c}function ga(b){var a=typeof b,c;if(a=="object"&&b!==null)if(typeof(c=b.$hashKey)=="function")c=b.$hashKey();else{if(c===q)c=b.$hashKey=xa()}else c=b;return a+":"+c}function Fa(b){m(b,this.put,this)}function eb(){}function Cb(b){var a,c;if(typeof b=="function"){if(!(a=b.$inject))a=[],c=b.toString().replace(qc,""),c=c.match(rc),m(c[1].split(sc),function(b){b.replace(tc,function(b,c,d){a.push(d)})}),b.$inject=a}else E(b)?(c=b.length-1,qa(b[c],"fn"),a=b.slice(0,c)):qa(b,"fn",!0);
25
- return a}function sb(b){function a(a){return function(b,c){if(L(b))m(b,nb(a));else return a(b,c)}}function c(a,b){if(H(b)||E(b))b=l.instantiate(b);if(!b.$get)throw Error("Provider "+a+" must define $get factory method.");return k[a+f]=b}function d(a,b){return c(a,{$get:b})}function e(a){var b=[];m(a,function(a){if(!j.get(a))if(j.put(a,!0),B(a)){var c=sa(a);b=b.concat(e(c.requires)).concat(c._runBlocks);try{for(var d=c._invokeQueue,c=0,f=d.length;c<f;c++){var g=d[c],h=g[0]=="$injector"?l:l.get(g[0]);
26
- h[g[1]].apply(h,g[2])}}catch(p){throw p.message&&(p.message+=" from "+a),p;}}else if(H(a))try{b.push(l.invoke(a))}catch(i){throw i.message&&(i.message+=" from "+a),i;}else if(E(a))try{b.push(l.invoke(a))}catch(o){throw o.message&&(o.message+=" from "+String(a[a.length-1])),o;}else qa(a,"module")});return b}function g(a,b){function c(d){if(typeof d!=="string")throw Error("Service name expected");if(a.hasOwnProperty(d)){if(a[d]===h)throw Error("Circular dependency: "+i.join(" <- "));return a[d]}else try{return i.unshift(d),
27
- a[d]=h,a[d]=b(d)}finally{i.shift()}}function d(a,b,e){var f=[],j=Cb(a),g,h,i;h=0;for(g=j.length;h<g;h++)i=j[h],f.push(e&&e.hasOwnProperty(i)?e[i]:c(i));a.$inject||(a=a[g]);switch(b?-1:f.length){case 0:return a();case 1:return a(f[0]);case 2:return a(f[0],f[1]);case 3:return a(f[0],f[1],f[2]);case 4:return a(f[0],f[1],f[2],f[3]);case 5:return a(f[0],f[1],f[2],f[3],f[4]);case 6:return a(f[0],f[1],f[2],f[3],f[4],f[5]);case 7:return a(f[0],f[1],f[2],f[3],f[4],f[5],f[6]);case 8:return a(f[0],f[1],f[2],
28
- f[3],f[4],f[5],f[6],f[7]);case 9:return a(f[0],f[1],f[2],f[3],f[4],f[5],f[6],f[7],f[8]);case 10:return a(f[0],f[1],f[2],f[3],f[4],f[5],f[6],f[7],f[8],f[9]);default:return a.apply(b,f)}}return{invoke:d,instantiate:function(a,b){var c=function(){},e;c.prototype=(E(a)?a[a.length-1]:a).prototype;c=new c;e=d(a,c,b);return L(e)?e:c},get:c,annotate:Cb}}var h={},f="Provider",i=[],j=new Fa,k={$provide:{provider:a(c),factory:a(d),service:a(function(a,b){return d(a,["$injector",function(a){return a.instantiate(b)}])}),
29
- value:a(function(a,b){return d(a,I(b))}),constant:a(function(a,b){k[a]=b;n[a]=b}),decorator:function(a,b){var c=l.get(a+f),d=c.$get;c.$get=function(){var a=o.invoke(d,c);return o.invoke(b,null,{$delegate:a})}}}},l=g(k,function(){throw Error("Unknown provider: "+i.join(" <- "));}),n={},o=n.$injector=g(n,function(a){a=l.get(a+f);return o.invoke(a.$get,a)});m(e(b),function(a){o.invoke(a||C)});return o}function uc(){var b=!0;this.disableAutoScrolling=function(){b=!1};this.$get=["$window","$location",
30
- "$rootScope",function(a,c,d){function e(a){var b=null;m(a,function(a){!b&&z(a.nodeName)==="a"&&(b=a)});return b}function g(){var b=c.hash(),d;b?(d=h.getElementById(b))?d.scrollIntoView():(d=e(h.getElementsByName(b)))?d.scrollIntoView():b==="top"&&a.scrollTo(0,0):a.scrollTo(0,0)}var h=a.document;b&&d.$watch(function(){return c.hash()},function(){d.$evalAsync(g)});return g}]}function vc(b,a,c,d){function e(a){try{a.apply(null,ha.call(arguments,1))}finally{if(p--,p===0)for(;s.length;)try{s.pop()()}catch(b){c.error(b)}}}
31
- function g(a,b){(function V(){m(t,function(a){a()});x=b(V,a)})()}function h(){M!=f.url()&&(M=f.url(),m(N,function(a){a(f.url())}))}var f=this,i=a[0],j=b.location,k=b.history,l=b.setTimeout,n=b.clearTimeout,o={};f.isMock=!1;var p=0,s=[];f.$completeOutstandingRequest=e;f.$incOutstandingRequestCount=function(){p++};f.notifyWhenNoOutstandingRequests=function(a){m(t,function(a){a()});p===0?a():s.push(a)};var t=[],x;f.addPollFn=function(a){w(x)&&g(100,l);t.push(a);return a};var M=j.href,A=a.find("base");
32
- f.url=function(a,b){if(a){if(M!=a)return M=a,d.history?b?k.replaceState(null,"",a):(k.pushState(null,"",a),A.attr("href",A.attr("href"))):b?j.replace(a):j.href=a,f}else return j.href.replace(/%27/g,"'")};var N=[],J=!1;f.onUrlChange=function(a){J||(d.history&&u(b).bind("popstate",h),d.hashchange?u(b).bind("hashchange",h):f.addPollFn(h),J=!0);N.push(a);return a};f.baseHref=function(){var a=A.attr("href");return a?a.replace(/^https?\:\/\/[^\/]*/,""):""};var r={},$="",R=f.baseHref();f.cookies=function(a,
33
- b){var d,e,f,j;if(a)if(b===q)i.cookie=escape(a)+"=;path="+R+";expires=Thu, 01 Jan 1970 00:00:00 GMT";else{if(B(b))d=(i.cookie=escape(a)+"="+escape(b)+";path="+R).length+1,d>4096&&c.warn("Cookie '"+a+"' possibly not set or overflowed because it was too large ("+d+" > 4096 bytes)!")}else{if(i.cookie!==$){$=i.cookie;d=$.split("; ");r={};for(f=0;f<d.length;f++)e=d[f],j=e.indexOf("="),j>0&&(a=unescape(e.substring(0,j)),r[a]===q&&(r[a]=unescape(e.substring(j+1))))}return r}};f.defer=function(a,b){var c;
34
- p++;c=l(function(){delete o[c];e(a)},b||0);o[c]=!0;return c};f.defer.cancel=function(a){return o[a]?(delete o[a],n(a),e(C),!0):!1}}function wc(){this.$get=["$window","$log","$sniffer","$document",function(b,a,c,d){return new vc(b,d,a,c)}]}function xc(){this.$get=function(){function b(b,d){function e(a){if(a!=l){if(n){if(n==a)n=a.n}else n=a;g(a.n,a.p);g(a,l);l=a;l.n=null}}function g(a,b){if(a!=b){if(a)a.p=b;if(b)b.n=a}}if(b in a)throw Error("cacheId "+b+" taken");var h=0,f=v({},d,{id:b}),i={},j=d&&
35
- d.capacity||Number.MAX_VALUE,k={},l=null,n=null;return a[b]={put:function(a,b){var c=k[a]||(k[a]={key:a});e(c);w(b)||(a in i||h++,i[a]=b,h>j&&this.remove(n.key))},get:function(a){var b=k[a];if(b)return e(b),i[a]},remove:function(a){var b=k[a];if(b){if(b==l)l=b.p;if(b==n)n=b.n;g(b.n,b.p);delete k[a];delete i[a];h--}},removeAll:function(){i={};h=0;k={};l=n=null},destroy:function(){k=f=i=null;delete a[b]},info:function(){return v({},f,{size:h})}}}var a={};b.info=function(){var b={};m(a,function(a,e){b[e]=
36
- a.info()});return b};b.get=function(b){return a[b]};return b}}function yc(){this.$get=["$cacheFactory",function(b){return b("templates")}]}function Db(b){var a={},c="Directive",d=/^\s*directive\:\s*([\d\w\-_]+)\s+(.*)#x2F;,e=/(([\d\w\-_]+)(?:\:([^;]+))?;?)/,g="Template must have exactly one root element. was: ",h=/^\s*(https?|ftp|mailto|file):/;this.directive=function i(d,e){B(d)?($a(e,"directive"),a.hasOwnProperty(d)||(a[d]=[],b.factory(d+c,["$injector","$exceptionHandler",function(b,c){var e=[];m(a[d],
37
- function(a){try{var g=b.invoke(a);if(H(g))g={compile:I(g)};else if(!g.compile&&g.link)g.compile=I(g.link);g.priority=g.priority||0;g.name=g.name||d;g.require=g.require||g.controller&&g.name;g.restrict=g.restrict||"A";e.push(g)}catch(h){c(h)}});return e}])),a[d].push(e)):m(d,nb(i));return this};this.urlSanitizationWhitelist=function(a){return y(a)?(h=a,this):h};this.$get=["$injector","$interpolate","$exceptionHandler","$http","$templateCache","$parse","$controller","$rootScope","$document",function(b,
38
- j,k,l,n,o,p,s,t){function x(a,b,c){a instanceof u||(a=u(a));m(a,function(b,c){b.nodeType==3&&b.nodeValue.match(/\S+/)&&(a[c]=u(b).wrap("<span></span>").parent()[0])});var d=A(a,b,a,c);return function(b,c){$a(b,"scope");for(var e=c?ua.clone.call(a):a,j=0,g=e.length;j<g;j++){var h=e[j];(h.nodeType==1||h.nodeType==9)&&e.eq(j).data("$scope",b)}M(e,"ng-scope");c&&c(e,b);d&&d(b,e,e);return e}}function M(a,b){try{a.addClass(b)}catch(c){}}function A(a,b,c,d){function e(a,c,d,g){var h,i,k,p,o,l,n,t=[];o=0;
39
- for(l=c.length;o<l;o++)t.push(c[o]);n=o=0;for(l=j.length;o<l;n++)i=t[n],c=j[o++],h=j[o++],c?(c.scope?(k=a.$new(L(c.scope)),u(i).data("$scope",k)):k=a,(p=c.transclude)||!g&&b?c(h,k,i,d,function(b){return function(c){var d=a.$new();d.$transcluded=!0;return b(d,c).bind("$destroy",Ta(d,d.$destroy))}}(p||b)):c(h,k,i,q,g)):h&&h(a,i.childNodes,q,g)}for(var j=[],g,h,i,k=0;k<a.length;k++)h=new ia,g=N(a[k],[],h,d),h=(g=g.length?J(g,a[k],h,b,c):null)&&g.terminal||!a[k].childNodes||!a[k].childNodes.length?null:
40
- A(a[k].childNodes,g?g.transclude:b),j.push(g),j.push(h),i=i||g||h;return i?e:null}function N(a,b,c,g){var j=c.$attr,h;switch(a.nodeType){case 1:r(b,ea(fb(a).toLowerCase()),"E",g);var i,k,o;h=a.attributes;for(var p=0,l=h&&h.length;p<l;p++)if(i=h[p],i.specified)k=i.name,o=ea(k.toLowerCase()),j[o]=k,c[o]=i=Q(Z&&k=="href"?decodeURIComponent(a.getAttribute(k,2)):i.value),Ab(a,o)&&(c[o]=!0),V(a,b,i,o),r(b,o,"A",g);a=a.className;if(B(a)&&a!=="")for(;h=e.exec(a);)o=ea(h[2]),r(b,o,"C",g)&&(c[o]=Q(h[3])),a=
41
- a.substr(h.index+h[0].length);break;case 3:y(b,a.nodeValue);break;case 8:try{if(h=d.exec(a.nodeValue))o=ea(h[1]),r(b,o,"M",g)&&(c[o]=Q(h[2]))}catch(n){}}b.sort(F);return b}function J(a,b,c,d,e){function j(a,b){if(a)a.require=r.require,n.push(a);if(b)b.require=r.require,t.push(b)}function h(a,b){var c,d="data",e=!1;if(B(a)){for(;(c=a.charAt(0))=="^"||c=="?";)a=a.substr(1),c=="^"&&(d="inheritedData"),e=e||c=="?";c=b[d]("quot;+a+"Controller");if(!c&&!e)throw Error("No controller: "+a);}else E(a)&&(c=[],
42
- m(a,function(a){c.push(h(a,b))}));return c}function i(a,d,e,g,j){var l,s,r,D,M;l=b===e?c:hc(c,new ia(u(e),c.$attr));s=l.$element;if(J){var zc=/^\s*([@=&])\s*(\w*)\s*#x2F;,x=d.$parent||d;m(J.scope,function(a,b){var c=a.match(zc)||[],e=c[2]||b,c=c[1],g,j,h;d.$isolateBindings[b]=c+e;switch(c){case "@":l.$observe(e,function(a){d[b]=a});l.$observers[e].$scope=x;break;case "=":j=o(l[e]);h=j.assign||function(){g=d[b]=j(x);throw Error(Eb+l[e]+" (directive: "+J.name+")");};g=d[b]=j(x);d.$watch(function(){var a=
43
- j(x);a!==d[b]&&(a!==g?g=d[b]=a:h(x,a=g=d[b]));return a});break;case "&":j=o(l[e]);d[b]=function(a){return j(x,a)};break;default:throw Error("Invalid isolate scope definition for directive "+J.name+": "+a);}})}y&&m(y,function(a){var b={$scope:d,$element:s,$attrs:l,$transclude:j};M=a.controller;M=="@"&&(M=l[a.name]);s.data("quot;+a.name+"Controller",p(M,b))});g=0;for(r=n.length;g<r;g++)try{D=n[g],D(d,s,l,D.require&&h(D.require,s))}catch(A){k(A,pa(s))}a&&a(d,e.childNodes,q,j);g=0;for(r=t.length;g<r;g++)try{D=
44
- t[g],D(d,s,l,D.require&&h(D.require,s))}catch(Ac){k(Ac,pa(s))}}for(var l=-Number.MAX_VALUE,n=[],t=[],s=null,J=null,A=null,D=c.$element=u(b),r,F,W,ja,V=d,y,w,Y,v=0,z=a.length;v<z;v++){r=a[v];W=q;if(l>r.priority)break;if(Y=r.scope)ta("isolated scope",J,r,D),L(Y)&&(M(D,"ng-isolate-scope"),J=r),M(D,"ng-scope"),s=s||r;F=r.name;if(Y=r.controller)y=y||{},ta("'"+F+"' controller",y[F],r,D),y[F]=r;if(Y=r.transclude)ta("transclusion",ja,r,D),ja=r,l=r.priority,Y=="element"?(W=u(b),D=c.$element=u(T.createComment(" "+
45
- F+": "+c[F]+" ")),b=D[0],C(e,u(W[0]),b),V=x(W,d,l)):(W=u(cb(b)).contents(),D.html(""),V=x(W,d));if(Y=r.template)if(ta("template",A,r,D),A=r,Y=Fb(Y),r.replace){W=u("<div>"+Q(Y)+"</div>").contents();b=W[0];if(W.length!=1||b.nodeType!==1)throw Error(g+Y);C(e,D,b);F={$attr:{}};a=a.concat(N(b,a.splice(v+1,a.length-(v+1)),F));$(c,F);z=a.length}else D.html(Y);if(r.templateUrl)ta("template",A,r,D),A=r,i=R(a.splice(v,a.length-v),i,D,c,e,r.replace,V),z=a.length;else if(r.compile)try{w=r.compile(D,c,V),H(w)?
46
- j(null,w):w&&j(w.pre,w.post)}catch(G){k(G,pa(D))}if(r.terminal)i.terminal=!0,l=Math.max(l,r.priority)}i.scope=s&&s.scope;i.transclude=ja&&V;return i}function r(d,e,g,j){var h=!1;if(a.hasOwnProperty(e))for(var o,e=b.get(e+c),l=0,p=e.length;l<p;l++)try{if(o=e[l],(j===q||j>o.priority)&&o.restrict.indexOf(g)!=-1)d.push(o),h=!0}catch(n){k(n)}return h}function $(a,b){var c=b.$attr,d=a.$attr,e=a.$element;m(a,function(d,e){e.charAt(0)!="quot;&&(b[e]&&(d+=(e==="style"?";":" ")+b[e]),a.$set(e,d,!0,c[e]))});m(b,
47
- function(b,g){g=="class"?(M(e,b),a["class"]=(a["class"]?a["class"]+" ":"")+b):g=="style"?e.attr("style",e.attr("style")+";"+b):g.charAt(0)!="quot;&&!a.hasOwnProperty(g)&&(a[g]=b,d[g]=c[g])})}function R(a,b,c,d,e,j,h){var i=[],k,o,p=c[0],t=a.shift(),s=v({},t,{controller:null,templateUrl:null,transclude:null,scope:null});c.html("");l.get(t.templateUrl,{cache:n}).success(function(l){var n,t,l=Fb(l);if(j){t=u("<div>"+Q(l)+"</div>").contents();n=t[0];if(t.length!=1||n.nodeType!==1)throw Error(g+l);l={$attr:{}};
48
- C(e,c,n);N(n,a,l);$(d,l)}else n=p,c.html(l);a.unshift(s);k=J(a,n,d,h);for(o=A(c[0].childNodes,h);i.length;){var r=i.pop(),l=i.pop();t=i.pop();var ia=i.pop(),D=n;t!==p&&(D=cb(n),C(l,u(t),D));k(function(){b(o,ia,D,e,r)},ia,D,e,r)}i=null}).error(function(a,b,c,d){throw Error("Failed to load template: "+d.url);});return function(a,c,d,e,g){i?(i.push(c),i.push(d),i.push(e),i.push(g)):k(function(){b(o,c,d,e,g)},c,d,e,g)}}function F(a,b){return b.priority-a.priority}function ta(a,b,c,d){if(b)throw Error("Multiple directives ["+
49
- b.name+", "+c.name+"] asking for "+a+" on: "+pa(d));}function y(a,b){var c=j(b,!0);c&&a.push({priority:0,compile:I(function(a,b){var d=b.parent(),e=d.data("$binding")||[];e.push(c);M(d.data("$binding",e),"ng-binding");a.$watch(c,function(a){b[0].nodeValue=a})})})}function V(a,b,c,d){var e=j(c,!0);e&&b.push({priority:100,compile:I(function(a,b,c){b=c.$observers||(c.$observers={});d==="class"&&(e=j(c[d],!0));c[d]=q;(b[d]||(b[d]=[])).$inter=!0;(c.$observers&&c.$observers[d].$scope||a).$watch(e,
50
- function(a){c.$set(d,a)})})})}function C(a,b,c){var d=b[0],e=d.parentNode,g,j;if(a){g=0;for(j=a.length;g<j;g++)if(a[g]==d){a[g]=c;break}}e&&e.replaceChild(c,d);c[u.expando]=d[u.expando];b[0]=c}var ia=function(a,b){this.$element=a;this.$attr=b||{}};ia.prototype={$normalize:ea,$set:function(a,b,c,d){var e=Ab(this.$element[0],a),g=this.$observers;e&&(this.$element.prop(a,b),d=e);this[a]=b;d?this.$attr[a]=d:(d=this.$attr[a])||(this.$attr[a]=d=Za(a,"-"));if(fb(this.$element[0])==="A"&&a==="href")D.setAttribute("href",
51
- b),e=D.href,e.match(h)||(this[a]=b="unsafe:"+e);c!==!1&&(b===null||b===q?this.$element.removeAttr(d):this.$element.attr(d,b));g&&m(g[a],function(a){try{a(b)}catch(c){k(c)}})},$observe:function(a,b){var c=this,d=c.$observers||(c.$observers={}),e=d[a]||(d[a]=[]);e.push(b);s.$evalAsync(function(){e.$inter||b(c[a])});return b}};var D=t[0].createElement("a"),W=j.startSymbol(),ja=j.endSymbol(),Fb=W=="{{"||ja=="}}"?ma:function(a){return a.replace(/\{\{/g,W).replace(/}}/g,ja)};return x}]}function ea(b){return tb(b.replace(Bc,
52
- ""))}function Cc(){var b={};this.register=function(a,c){L(a)?v(b,a):b[a]=c};this.$get=["$injector","$window",function(a,c){return function(d,e){if(B(d)){var g=d,d=b.hasOwnProperty(g)?b[g]:gb(e.$scope,g,!0)||gb(c,g,!0);qa(d,g,!0)}return a.instantiate(d,e)}}]}function Dc(){this.$get=["$window",function(b){return u(b.document)}]}function Ec(){this.$get=["$log",function(b){return function(a,c){b.error.apply(b,arguments)}}]}function Fc(){var b="{{",a="}}";this.startSymbol=function(a){return a?(b=a,this):
53
- b};this.endSymbol=function(b){return b?(a=b,this):a};this.$get=["$parse",function(c){function d(d,f){for(var i,j,k=0,l=[],n=d.length,o=!1,p=[];k<n;)(i=d.indexOf(b,k))!=-1&&(j=d.indexOf(a,i+e))!=-1?(k!=i&&l.push(d.substring(k,i)),l.push(k=c(o=d.substring(i+e,j))),k.exp=o,k=j+g,o=!0):(k!=n&&l.push(d.substring(k)),k=n);if(!(n=l.length))l.push(""),n=1;if(!f||o)return p.length=n,k=function(a){for(var b=0,c=n,d;b<c;b++){if(typeof(d=l[b])=="function")d=d(a),d==null||d==q?d="":typeof d!="string"&&(d=da(d));
54
- p[b]=d}return p.join("")},k.exp=d,k.parts=l,k}var e=b.length,g=a.length;d.startSymbol=function(){return b};d.endSymbol=function(){return a};return d}]}function Gb(b){for(var b=b.split("/"),a=b.length;a--;)b[a]=Xa(b[a]);return b.join("/")}function va(b,a){var c=Hb.exec(b),c={protocol:c[1],host:c[3],port:G(c[5])||Ib[c[1]]||null,path:c[6]||"/",search:c[8],hash:c[10]};if(a)a.$protocol=c.protocol,a.$host=c.host,a.$port=c.port;return c}function ka(b,a,c){return b+"://"+a+(c==Ib[b]?"":":"+c)}function Gc(b,
55
- a,c){var d=va(b);return decodeURIComponent(d.path)!=a||w(d.hash)||d.hash.indexOf(c)!==0?b:ka(d.protocol,d.host,d.port)+a.substr(0,a.lastIndexOf("/"))+d.hash.substr(c.length)}function Hc(b,a,c){var d=va(b);if(decodeURIComponent(d.path)==a&&!w(d.hash)&&d.hash.indexOf(c)===0)return b;else{var e=d.search&&"?"+d.search||"",g=d.hash&&"#"+d.hash||"",h=a.substr(0,a.lastIndexOf("/")),f=d.path.substr(h.length);if(d.path.indexOf(h)!==0)throw Error('Invalid url "'+b+'", missing path prefix "'+h+'" !');return ka(d.protocol,
56
- d.host,d.port)+a+"#"+c+f+e+g}}function hb(b,a,c){a=a||"";this.$parse=function(b){var c=va(b,this);if(c.path.indexOf(a)!==0)throw Error('Invalid url "'+b+'", missing path prefix "'+a+'" !');this.$path=decodeURIComponent(c.path.substr(a.length));this.$search=Va(c.search);this.$hash=c.hash&&decodeURIComponent(c.hash)||"";this.$compose()};this.$compose=function(){var b=qb(this.$search),c=this.$hash?"#"+Xa(this.$hash):"";this.$url=Gb(this.$path)+(b?"?"+b:"")+c;this.$absUrl=ka(this.$protocol,
57
- this.$host,this.$port)+a+this.$url};this.$rewriteAppUrl=function(a){if(a.indexOf(c)==0)return a};this.$parse(b)}function Ga(b,a,c){var d;this.$parse=function(b){var c=va(b,this);if(c.hash&&c.hash.indexOf(a)!==0)throw Error('Invalid url "'+b+'", missing hash prefix "'+a+'" !');d=c.path+(c.search?"?"+c.search:"");c=Ic.exec((c.hash||"").substr(a.length));this.$path=c[1]?(c[1].charAt(0)=="/"?"":"/")+decodeURIComponent(c[1]):"";this.$search=Va(c[3]);this.$hash=c[5]&&decodeURIComponent(c[5])||
58
- "";this.$compose()};this.$compose=function(){var b=qb(this.$search),c=this.$hash?"#"+Xa(this.$hash):"";this.$url=Gb(this.$path)+(b?"?"+b:"")+c;this.$absUrl=ka(this.$protocol,this.$host,this.$port)+d+(this.$url?"#"+a+this.$url:"")};this.$rewriteAppUrl=function(a){if(a.indexOf(c)==0)return a};this.$parse(b)}function Jb(b,a,c,d){Ga.apply(this,arguments);this.$rewriteAppUrl=function(b){if(b.indexOf(c)==0)return c+d+"#"+a+b.substr(c.length)}}function Ha(b){return function(){return this[b]}}
59
- function Kb(b,a){return function(c){if(w(c))return this[b];this[b]=a(c);this.$compose();return this}}function Jc(){var b="",a=!1;this.hashPrefix=function(a){return y(a)?(b=a,this):b};this.html5Mode=function(b){return y(b)?(a=b,this):a};this.$get=["$rootScope","$browser","$sniffer","$rootElement",function(c,d,e,g){function h(a){c.$broadcast("$locationChangeSuccess",f.absUrl(),a)}var f,i,j,k=d.url(),l=va(k);a?(i=d.baseHref()||"/",j=i.substr(0,i.lastIndexOf("/")),l=ka(l.protocol,l.host,l.port)+j+"/",
60
- f=e.history?new hb(Gc(k,i,b),j,l):new Jb(Hc(k,i,b),b,l,i.substr(j.length+1))):(l=ka(l.protocol,l.host,l.port)+(l.path||"")+(l.search?"?"+l.search:"")+"#"+b+"/",f=new Ga(k,b,l));g.bind("click",function(a){if(!a.ctrlKey&&!(a.metaKey||a.which==2)){for(var b=u(a.target);z(b[0].nodeName)!=="a";)if(b[0]===g[0]||!(b=b.parent())[0])return;var d=b.prop("href"),e=f.$rewriteAppUrl(d);d&&!b.attr("target")&&e&&(f.$parse(e),c.$apply(),a.preventDefault(),P.angular["ff-684208-preventDefault"]=!0)}});f.absUrl()!=
61
- k&&d.url(f.absUrl(),!0);d.onUrlChange(function(a){f.absUrl()!=a&&(c.$broadcast("$locationChangeStart",a,f.absUrl()).defaultPrevented?d.url(f.absUrl()):(c.$evalAsync(function(){var b=f.absUrl();f.$parse(a);h(b)}),c.$phase||c.$digest()))});var n=0;c.$watch(function(){var a=d.url(),b=f.$replace;if(!n||a!=f.absUrl())n++,c.$evalAsync(function(){c.$broadcast("$locationChangeStart",f.absUrl(),a).defaultPrevented?f.$parse(a):(d.url(f.absUrl(),b),h(a))});f.$replace=!1;return n});return f}]}function Kc(){this.$get=
62
- ["$window",function(b){function a(a){a instanceof Error&&(a.stack?a=a.message&&a.stack.indexOf(a.message)===-1?"Error: "+a.message+"\n"+a.stack:a.stack:a.sourceURL&&(a=a.message+"\n"+a.sourceURL+":"+a.line));return a}function c(c){var e=b.console||{},g=e[c]||e.log||C;return g.apply?function(){var b=[];m(arguments,function(c){b.push(a(c))});return g.apply(e,b)}:function(a,b){g(a,b)}}return{log:c("log"),warn:c("warn"),info:c("info"),error:c("error")}}]}function Lc(b,a){function c(a){return a.indexOf(t)!=
63
- -1}function d(){return p+1<b.length?b.charAt(p+1):!1}function e(a){return"0"<=a&&a<="9"}function g(a){return a==" "||a=="\r"||a=="\t"||a=="\n"||a=="\u000b"||a=="\u00a0"}function h(a){return"a"<=a&&a<="z"||"A"<=a&&a<="Z"||"_"==a||a=="quot;}function f(a){return a=="-"||a=="+"||e(a)}function i(a,c,d){d=d||p;throw Error("Lexer Error: "+a+" at column"+(y(c)?"s "+c+"-"+p+" ["+b.substring(c,d)+"]":" "+d)+" in expression ["+b+"].");}function j(){for(var a="",c=p;p<b.length;){var g=z(b.charAt(p));if(g=="."||
64
- e(g))a+=g;else{var j=d();if(g=="e"&&f(j))a+=g;else if(f(g)&&j&&e(j)&&a.charAt(a.length-1)=="e")a+=g;else if(f(g)&&(!j||!e(j))&&a.charAt(a.length-1)=="e")i("Invalid exponent");else break}p++}a*=1;n.push({index:c,text:a,json:!0,fn:function(){return a}})}function k(){for(var c="",d=p,f,j,i,k;p<b.length;){k=b.charAt(p);if(k=="."||h(k)||e(k))k=="."&&(f=p),c+=k;else break;p++}if(f)for(j=p;j<b.length;){k=b.charAt(j);if(k=="("){i=c.substr(f-d+1);c=c.substr(0,f-d);p=j;break}if(g(k))j++;else break}d={index:d,
65
- text:c};if(Ia.hasOwnProperty(c))d.fn=d.json=Ia[c];else{var l=Lb(c,a);d.fn=v(function(a,b){return l(a,b)},{assign:function(a,b){return Mb(a,c,b)}})}n.push(d);i&&(n.push({index:f,text:".",json:!1}),n.push({index:f+1,text:i,json:!1}))}function l(a){var c=p;p++;for(var d="",e=a,f=!1;p<b.length;){var g=b.charAt(p);e+=g;if(f)g=="u"?(g=b.substring(p+1,p+5),g.match(/[\da-f]{4}/i)||i("Invalid unicode escape [\\u"+g+"]"),p+=4,d+=String.fromCharCode(parseInt(g,16))):(f=Mc[g],d+=f?f:g),f=!1;else if(g=="\\")f=
66
- !0;else if(g==a){p++;n.push({index:c,text:e,string:d,json:!0,fn:function(){return d}});return}else d+=g;p++}i("Unterminated quote",c)}for(var n=[],o,p=0,s=[],t,x=":";p<b.length;){t=b.charAt(p);if(c("\"'"))l(t);else if(e(t)||c(".")&&e(d()))j();else if(h(t)){if(k(),"{,".indexOf(x)!=-1&&s[0]=="{"&&(o=n[n.length-1]))o.json=o.text.indexOf(".")==-1}else if(c("(){}[].,;:"))n.push({index:p,text:t,json:":[,".indexOf(x)!=-1&&c("{[")||c("}]:,")}),c("{[")&&s.unshift(t),c("}]")&&s.shift(),p++;else if(g(t)){p++;
67
- continue}else{var m=t+d(),A=Ia[t],N=Ia[m];N?(n.push({index:p,text:m,fn:N}),p+=2):A?(n.push({index:p,text:t,fn:A,json:"[,:".indexOf(x)!=-1&&c("+-")}),p+=1):i("Unexpected next character ",p,p+1)}x=t}return n}function Nc(b,a,c,d){function e(a,c){throw Error("Syntax Error: Token '"+c.text+"' "+a+" at column "+(c.index+1)+" of the expression ["+b+"] starting at ["+b.substring(c.index)+"].");}function g(){if(R.length===0)throw Error("Unexpected end of expression: "+b);return R[0]}function h(a,b,c,d){if(R.length>
68
- 0){var e=R[0],f=e.text;if(f==a||f==b||f==c||f==d||!a&&!b&&!c&&!d)return e}return!1}function f(b,c,d,f){return(b=h(b,c,d,f))?(a&&!b.json&&e("is not valid json",b),R.shift(),b):!1}function i(a){f(a)||e("is unexpected, expecting ["+a+"]",h())}function j(a,b){return function(c,d){return a(c,d,b)}}function k(a,b,c){return function(d,e){return b(d,e,a,c)}}function l(){for(var a=[];;)if(R.length>0&&!h("}",")",";","]")&&a.push(w()),!f(";"))return a.length==1?a[0]:function(b,c){for(var d,e=0;e<a.length;e++){var f=
69
- a[e];f&&(d=f(b,c))}return d}}function n(){for(var a=f(),b=c(a.text),d=[];;)if(a=f(":"))d.push(F());else{var e=function(a,c,e){for(var e=[e],f=0;f<d.length;f++)e.push(d[f](a,c));return b.apply(a,e)};return function(){return e}}}function o(){for(var a=p(),b;;)if(b=f("||"))a=k(a,b.fn,p());else return a}function p(){var a=s(),b;if(b=f("&&"))a=k(a,b.fn,p());return a}function s(){var a=t(),b;if(b=f("==","!="))a=k(a,b.fn,s());return a}function t(){var a;a=x();for(var b;b=f("+","-");)a=k(a,b.fn,x());if(b=
70
- f("<",">","<=",">="))a=k(a,b.fn,t());return a}function x(){for(var a=m(),b;b=f("*","/","%");)a=k(a,b.fn,m());return a}function m(){var a;return f("+")?A():(a=f("-"))?k(r,a.fn,m()):(a=f("!"))?j(a.fn,m()):A()}function A(){var a;if(f("("))a=w(),i(")");else if(f("["))a=N();else if(f("{"))a=J();else{var b=f();(a=b.fn)||e("not a primary expression",b)}for(var c;b=f("(","[",".");)b.text==="("?(a=y(a,c),c=null):b.text==="["?(c=a,a=V(a)):b.text==="."?(c=a,a=u(a)):e("IMPOSSIBLE");return a}function N(){var a=
71
- [];if(g().text!="]"){do a.push(F());while(f(","))}i("]");return function(b,c){for(var d=[],e=0;e<a.length;e++)d.push(a[e](b,c));return d}}function J(){var a=[];if(g().text!="}"){do{var b=f(),b=b.string||b.text;i(":");var c=F();a.push({key:b,value:c})}while(f(","))}i("}");return function(b,c){for(var d={},e=0;e<a.length;e++){var f=a[e];d[f.key]=f.value(b,c)}return d}}var r=I(0),$,R=Lc(b,d),F=function(){var a=o(),c,d;return(d=f("="))?(a.assign||e("implies assignment but ["+b.substring(0,d.index)+"] can not be assigned to",
72
- d),c=o(),function(b,d){return a.assign(b,c(b,d),d)}):a},y=function(a,b){var c=[];if(g().text!=")"){do c.push(F());while(f(","))}i(")");return function(d,e){for(var f=[],g=b?b(d,e):d,j=0;j<c.length;j++)f.push(c[j](d,e));j=a(d,e,g)||C;return j.apply?j.apply(g,f):j(f[0],f[1],f[2],f[3],f[4])}},u=function(a){var b=f().text,c=Lb(b,d);return v(function(b,d,e){return c(e||a(b,d),d)},{assign:function(c,d,e){return Mb(a(c,e),b,d)}})},V=function(a){var b=F();i("]");return v(function(c,d){var e=a(c,d),f=b(c,
73
- d),g;if(!e)return q;if((e=e[f])&&e.then){g=e;if(!("$v"in e))g.$v=q,g.then(function(a){g.$v=a});e=e.$v}return e},{assign:function(c,d,e){return a(c,e)[b(c,e)]=d}})},w=function(){for(var a=F(),b;;)if(b=f("|"))a=k(a,b.fn,n());else return a};a?(F=o,y=u=V=w=function(){e("is not valid json",{text:b,index:0})},$=A()):$=l();R.length!==0&&e("is an unexpected token",R[0]);return $}function Mb(b,a,c){for(var a=a.split("."),d=0;a.length>1;d++){var e=a.shift(),g=b[e];g||(g={},b[e]=g);b=g}return b[a.shift()]=
74
- c}function gb(b,a,c){if(!a)return b;for(var a=a.split("."),d,e=b,g=a.length,h=0;h<g;h++)d=a[h],b&&(b=(e=b)[d]);return!c&&H(b)?Ta(e,b):b}function Nb(b,a,c,d,e){return function(g,h){var f=h&&h.hasOwnProperty(b)?h:g,i;if(f===null||f===q)return f;if((f=f[b])&&f.then){if(!("$v"in f))i=f,i.$v=q,i.then(function(a){i.$v=a});f=f.$v}if(!a||f===null||f===q)return f;if((f=f[a])&&f.then){if(!("$v"in f))i=f,i.$v=q,i.then(function(a){i.$v=a});f=f.$v}if(!c||f===null||f===q)return f;if((f=f[c])&&f.then){if(!("$v"in
75
- f))i=f,i.$v=q,i.then(function(a){i.$v=a});f=f.$v}if(!d||f===null||f===q)return f;if((f=f[d])&&f.then){if(!("$v"in f))i=f,i.$v=q,i.then(function(a){i.$v=a});f=f.$v}if(!e||f===null||f===q)return f;if((f=f[e])&&f.then){if(!("$v"in f))i=f,i.$v=q,i.then(function(a){i.$v=a});f=f.$v}return f}}function Lb(b,a){if(ib.hasOwnProperty(b))return ib[b];var c=b.split("."),d=c.length,e;if(a)e=d<6?Nb(c[0],c[1],c[2],c[3],c[4]):function(a,b){var e=0,g;do g=Nb(c[e++],c[e++],c[e++],c[e++],c[e++])(a,b),b=q,
76
- a=g;while(e<d);return g};else{var g="var l, fn, p;\n";m(c,function(a,b){g+="if(s === null || s === undefined) return s;\nl=s;\ns="+(b?"s":'((k&&k.hasOwnProperty("'+a+'"))?k:s)')+'["'+a+'"];\nif (s && s.then) {\n if (!("$v" in s)) {\n p=s;\n p.$v = undefined;\n p.then(function(v) {p.$v=v;});\n}\n s=s.$v\n}\n'});g+="return s;";e=Function("s","k",g);e.toString=function(){return g}}return ib[b]=e}function Oc(){var b={};this.$get=["$filter","$sniffer",function(a,c){return function(d){switch(typeof d){case "string":return b.hasOwnProperty(d)?
77
- b[d]:b[d]=Nc(d,!1,a,c.csp);case "function":return d;default:return C}}}]}function Pc(){this.$get=["$rootScope","$exceptionHandler",function(b,a){return Qc(function(a){b.$evalAsync(a)},a)}]}function Qc(b,a){function c(a){return a}function d(a){return h(a)}var e=function(){var f=[],i,j;return j={resolve:function(a){if(f){var c=f;f=q;i=g(a);c.length&&b(function(){for(var a,b=0,d=c.length;b<d;b++)a=c[b],i.then(a[0],a[1])})}},reject:function(a){j.resolve(h(a))},promise:{then:function(b,g){var j=e(),h=
78
- function(d){try{j.resolve((b||c)(d))}catch(e){a(e),j.reject(e)}},p=function(b){try{j.resolve((g||d)(b))}catch(c){a(c),j.reject(c)}};f?f.push([h,p]):i.then(h,p);return j.promise}}}},g=function(a){return a&&a.then?a:{then:function(c){var d=e();b(function(){d.resolve(c(a))});return d.promise}}},h=function(a){return{then:function(c,g){var h=e();b(function(){h.resolve((g||d)(a))});return h.promise}}};return{defer:e,reject:h,when:function(f,i,j){var k=e(),l,n=function(b){try{return(i||c)(b)}catch(d){return a(d),
79
- h(d)}},o=function(b){try{return(j||d)(b)}catch(c){return a(c),h(c)}};b(function(){g(f).then(function(a){l||(l=!0,k.resolve(g(a).then(n,o)))},function(a){l||(l=!0,k.resolve(o(a)))})});return k.promise},all:function(a){var b=e(),c=a.length,d=[];c?m(a,function(a,e){g(a).then(function(a){e in d||(d[e]=a,--c||b.resolve(d))},function(a){e in d||b.reject(a)})}):b.resolve(d);return b.promise}}}function Rc(){var b={};this.when=function(a,c){b[a]=v({reloadOnSearch:!0},c);if(a){var d=a[a.length-1]=="/"?a.substr(0,
80
- a.length-1):a+"/";b[d]={redirectTo:a}}return this};this.otherwise=function(a){this.when(null,a);return this};this.$get=["$rootScope","$location","$routeParams","$q","$injector","$http","$templateCache",function(a,c,d,e,g,h,f){function i(a,b){for(var b="^"+b.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\amp;")+"quot;,c="",d=[],e={},f=/:(\w+)/g,g,j=0;(g=f.exec(b))!==null;)c+=b.slice(j,g.index),c+="([^\\/]*)",d.push(g[1]),j=f.lastIndex;c+=b.substr(j);var h=a.match(RegExp(c));h&&m(d,function(a,b){e[a]=h[b+1]});return h?
81
- e:null}function j(){var b=k(),j=o.current;if(b&&j&&b.$route===j.$route&&fa(b.pathParams,j.pathParams)&&!b.reloadOnSearch&&!n)j.params=b.params,U(j.params,d),a.$broadcast("$routeUpdate",j);else if(b||j)n=!1,a.$broadcast("$routeChangeStart",b,j),(o.current=b)&&b.redirectTo&&(B(b.redirectTo)?c.path(l(b.redirectTo,b.params)).search(b.params).replace():c.url(b.redirectTo(b.pathParams,c.path(),c.search())).replace()),e.when(b).then(function(){if(b){var a=[],c=[],d;m(b.resolve||{},function(b,d){a.push(d);
82
- c.push(B(b)?g.get(b):g.invoke(b))});if(!y(d=b.template))if(y(d=b.templateUrl))d=h.get(d,{cache:f}).then(function(a){return a.data});y(d)&&(a.push("$template"),c.push(d));return e.all(c).then(function(b){var c={};m(b,function(b,d){c[a[d]]=b});return c})}}).then(function(c){if(b==o.current){if(b)b.locals=c,U(b.params,d);a.$broadcast("$routeChangeSuccess",b,j)}},function(c){b==o.current&&a.$broadcast("$routeChangeError",b,j,c)})}function k(){var a,d;m(b,function(b,e){if(!d&&(a=i(c.path(),e)))d=ya(b,
83
- {params:v({},c.search(),a),pathParams:a}),d.$route=b});return d||b[null]&&ya(b[null],{params:{},pathParams:{}})}function l(a,b){var c=[];m((a||"").split(":"),function(a,d){if(d==0)c.push(a);else{var e=a.match(/(\w+)(.*)/),f=e[1];c.push(b[f]);c.push(e[2]||"");delete b[f]}});return c.join("")}var n=!1,o={routes:b,reload:function(){n=!0;a.$evalAsync(j)}};a.$on("$locationChangeSuccess",j);return o}]}function Sc(){this.$get=I({})}function Tc(){var b=10;this.digestTtl=function(a){arguments.length&&(b=
84
- a);return b};this.$get=["$injector","$exceptionHandler","$parse",function(a,c,d){function e(){this.$id=xa();this.$phase=this.$parent=this.$watchers=this.$nextSibling=this.$prevSibling=this.$childHead=this.$childTail=null;this["this"]=this.$root=this;this.$destroyed=!1;this.$asyncQueue=[];this.$listeners={};this.$isolateBindings={}}function g(a){if(i.$phase)throw Error(i.$phase+" already in progress");i.$phase=a}function h(a,b){var c=d(a);qa(c,b);return c}function f(){}e.prototype={$new:function(a){if(H(a))throw Error("API-CHANGE: Use $controller to instantiate controllers.");
85
- a?(a=new e,a.$root=this.$root):(a=function(){},a.prototype=this,a=new a,a.$id=xa());a["this"]=a;a.$listeners={};a.$parent=this;a.$asyncQueue=[];a.$watchers=a.$nextSibling=a.$childHead=a.$childTail=null;a.$prevSibling=this.$childTail;this.$childHead?this.$childTail=this.$childTail.$nextSibling=a:this.$childHead=this.$childTail=a;return a},$watch:function(a,b,c){var d=h(a,"watch"),e=this.$watchers,g={fn:b,last:f,get:d,exp:a,eq:!!c};if(!H(b)){var i=h(b||C,"listener");g.fn=function(a,b,
86
- c){i(c)}}if(!e)e=this.$watchers=[];e.unshift(g);return function(){Sa(e,g)}},$digest:function(){var a,d,e,h,o,p,m,t=b,x,q=[],A,N;g("$digest");do{m=!1;x=this;do{for(o=x.$asyncQueue;o.length;)try{x.$eval(o.shift())}catch(J){c(J)}if(h=x.$watchers)for(p=h.length;p--;)try{if(a=h[p],(d=a.get(x))!==(e=a.last)&&!(a.eq?fa(d,e):typeof d=="number"&&typeof e=="number"&&isNaN(d)&&isNaN(e)))m=!0,a.last=a.eq?U(d):d,a.fn(d,e===f?d:e,x),t<5&&(A=4-t,q[A]||(q[A]=[]),N=H(a.exp)?"fn: "+(a.exp.name||a.exp.toString()):
87
- a.exp,N+="; newVal: "+da(d)+"; oldVal: "+da(e),q[A].push(N))}catch(r){c(r)}if(!(h=x.$childHead||x!==this&&x.$nextSibling))for(;x!==this&&!(h=x.$nextSibling);)x=x.$parent}while(x=h);if(m&&!t--)throw i.$phase=null,Error(b+" $digest() iterations reached. Aborting!\nWatchers fired in the last 5 iterations: "+da(q));}while(m||o.length);i.$phase=null},$destroy:function(){if(!(i==this||this.$destroyed)){var a=this.$parent;this.$broadcast("$destroy");this.$destroyed=!0;if(a.$childHead==this)a.$childHead=
88
- this.$nextSibling;if(a.$childTail==this)a.$childTail=this.$prevSibling;if(this.$prevSibling)this.$prevSibling.$nextSibling=this.$nextSibling;if(this.$nextSibling)this.$nextSibling.$prevSibling=this.$prevSibling;this.$parent=this.$nextSibling=this.$prevSibling=this.$childHead=this.$childTail=null}},$eval:function(a,b){return d(a)(this,b)},$evalAsync:function(a){this.$asyncQueue.push(a)},$apply:function(a){try{return g("$apply"),this.$eval(a)}catch(b){c(b)}finally{i.$phase=null;try{i.$digest()}catch(d){throw c(d),
89
- d;}}},$on:function(a,b){var c=this.$listeners[a];c||(this.$listeners[a]=c=[]);c.push(b);return function(){c[za(c,b)]=null}},$emit:function(a,b){var d=[],e,f=this,g=!1,h={name:a,targetScope:f,stopPropagation:function(){g=!0},preventDefault:function(){h.defaultPrevented=!0},defaultPrevented:!1},i=[h].concat(ha.call(arguments,1)),m,q;do{e=f.$listeners[a]||d;h.currentScope=f;m=0;for(q=e.length;m<q;m++)if(e[m])try{if(e[m].apply(null,i),g)return h}catch(A){c(A)}else e.splice(m,1),m--,q--;f=f.$parent}while(f);
90
- return h},$broadcast:function(a,b){var d=this,e=this,f={name:a,targetScope:this,preventDefault:function(){f.defaultPrevented=!0},defaultPrevented:!1},g=[f].concat(ha.call(arguments,1)),h,i;do{d=e;f.currentScope=d;e=d.$listeners[a]||[];h=0;for(i=e.length;h<i;h++)if(e[h])try{e[h].apply(null,g)}catch(m){c(m)}else e.splice(h,1),h--,i--;if(!(e=d.$childHead||d!==this&&d.$nextSibling))for(;d!==this&&!(e=d.$nextSibling);)d=d.$parent}while(d=e);return f}};var i=new e;return i}]}function Uc(){this.$get=
91
- ["$window",function(b){var a={},c=G((/android (\d+)/.exec(z(b.navigator.userAgent))||[])[1]);return{history:!(!b.history||!b.history.pushState||c<4),hashchange:"onhashchange"in b&&(!b.document.documentMode||b.document.documentMode>7),hasEvent:function(c){if(c=="input"&&Z==9)return!1;if(w(a[c])){var e=b.document.createElement("div");a[c]="on"+c in e}return a[c]},csp:!1}}]}function Vc(){this.$get=I(P)}function Ob(b){var a={},c,d,e;if(!b)return a;m(b.split("\n"),function(b){e=b.indexOf(":");c=z(Q(b.substr(0,
92
- e)));d=Q(b.substr(e+1));c&&(a[c]?a[c]+=", "+d:a[c]=d)});return a}function Pb(b){var a=L(b)?b:q;return function(c){a||(a=Ob(b));return c?a[z(c)]||null:a}}function Qb(b,a,c){if(H(c))return c(b,a);m(c,function(c){b=c(b,a)});return b}function Wc(){var b=/^\s*(\[|\{[^\{])/,a=/[\}\]]\s*#x2F;,c=/^\)\]\}',?\n/,d=this.defaults={transformResponse:[function(d){B(d)&&(d=d.replace(c,""),b.test(d)&&a.test(d)&&(d=pb(d,!0)));return d}],transformRequest:[function(a){return L(a)&&wa.apply(a)!=="[object File]"?da(a):a}],
93
- headers:{common:{Accept:"application/json, text/plain, */*","X-Requested-With":"XMLHttpRequest"},post:{"Content-Type":"application/json;charset=utf-8"},put:{"Content-Type":"application/json;charset=utf-8"}}},e=this.responseInterceptors=[];this.$get=["$httpBackend","$browser","$cacheFactory","$rootScope","$q","$injector",function(a,b,c,i,j,k){function l(a){function c(a){var b=v({},a,{data:Qb(a.data,a.headers,f)});return 200<=a.status&&a.status<300?b:j.reject(b)}a.method=la(a.method);var e=a.transformRequest||
94
- d.transformRequest,f=a.transformResponse||d.transformResponse,g=d.headers,g=v({"X-XSRF-TOKEN":b.cookies()["XSRF-TOKEN"]},g.common,g[z(a.method)],a.headers),e=Qb(a.data,Pb(g),e),i;w(a.data)&&delete g["Content-Type"];i=n(a,e,g);i=i.then(c,c);m(s,function(a){i=a(i)});i.success=function(b){i.then(function(c){b(c.data,c.status,c.headers,a)});return i};i.error=function(b){i.then(null,function(c){b(c.data,c.status,c.headers,a)});return i};return i}function n(b,c,d){function e(a,b,c){m&&(200<=a&&a<300?m.put(q,
95
- [a,b,Ob(c)]):m.remove(q));f(b,a,c);i.$apply()}function f(a,c,d){c=Math.max(c,0);(200<=c&&c<300?k.resolve:k.reject)({data:a,status:c,headers:Pb(d),config:b})}function h(){var a=za(l.pendingRequests,b);a!==-1&&l.pendingRequests.splice(a,1)}var k=j.defer(),n=k.promise,m,s,q=o(b.url,b.params);l.pendingRequests.push(b);n.then(h,h);b.cache&&b.method=="GET"&&(m=L(b.cache)?b.cache:p);if(m)if(s=m.get(q))if(s.then)return s.then(h,h),s;else E(s)?f(s[1],s[0],U(s[2])):f(s,200,{});else m.put(q,n);s||a(b.method,
96
- q,c,e,d,b.timeout,b.withCredentials);return n}function o(a,b){if(!b)return a;var c=[];fc(b,function(a,b){a==null||a==q||(L(a)&&(a=da(a)),c.push(encodeURIComponent(b)+"="+encodeURIComponent(a)))});return a+(a.indexOf("?")==-1?"?":"&")+c.join("&")}var p=c("$http"),s=[];m(e,function(a){s.push(B(a)?k.get(a):k.invoke(a))});l.pendingRequests=[];(function(a){m(arguments,function(a){l[a]=function(b,c){return l(v(c||{},{method:a,url:b}))}})})("get","delete","head","jsonp");(function(a){m(arguments,function(a){l[a]=
97
- function(b,c,d){return l(v(d||{},{method:a,url:b,data:c}))}})})("post","put");l.defaults=d;return l}]}function Xc(){this.$get=["$browser","$window","$document",function(b,a,c){return Yc(b,Zc,b.defer,a.angular.callbacks,c[0],a.location.protocol.replace(":",""))}]}function Yc(b,a,c,d,e,g){function h(a,b){var c=e.createElement("script"),d=function(){e.body.removeChild(c);b&&b()};c.type="text/javascript";c.src=a;Z?c.onreadystatechange=function(){/loaded|complete/.test(c.readyState)&&d()}:c.onload=c.onerror=
98
- d;e.body.appendChild(c)}return function(e,i,j,k,l,n,o){function p(a,c,d,e){c=(i.match(Hb)||["",g])[1]=="file"?d?200:404:c;a(c==1223?204:c,d,e);b.$completeOutstandingRequest(C)}b.$incOutstandingRequestCount();i=i||b.url();if(z(e)=="jsonp"){var s="_"+(d.counter++).toString(36);d[s]=function(a){d[s].data=a};h(i.replace("JSON_CALLBACK","angular.callbacks."+s),function(){d[s].data?p(k,200,d[s].data):p(k,-2);delete d[s]})}else{var t=new a;t.open(e,i,!0);m(l,function(a,b){a&&t.setRequestHeader(b,a)});
99
- var q;t.onreadystatechange=function(){if(t.readyState==4){var a=t.getAllResponseHeaders(),b=["Cache-Control","Content-Language","Content-Type","Expires","Last-Modified","Pragma"];a||(a="",m(b,function(b){var c=t.getResponseHeader(b);c&&(a+=b+": "+c+"\n")}));p(k,q||t.status,t.responseText,a)}};if(o)t.withCredentials=!0;t.send(j||"");n>0&&c(function(){q=-1;t.abort()},n)}}}function $c(){this.$get=function(){return{id:"en-us",NUMBER_FORMATS:{DECIMAL_SEP:".",GROUP_SEP:",",PATTERNS:[{minInt:1,minFrac:0,
100
- maxFrac:3,posPre:"",posSuf:"",negPre:"-",negSuf:"",gSize:3,lgSize:3},{minInt:1,minFrac:2,maxFrac:2,posPre:"\u00a4",posSuf:"",negPre:"(\u00a4",negSuf:")",gSize:3,lgSize:3}],CURRENCY_SYM:"quot;},DATETIME_FORMATS:{MONTH:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),SHORTMONTH:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),DAY:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),SHORTDAY:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(","),
101
- AMPMS:["AM","PM"],medium:"MMM d, y h:mm:ss a","short":"M/d/yy h:mm a",fullDate:"EEEE, MMMM d, y",longDate:"MMMM d, y",mediumDate:"MMM d, y",shortDate:"M/d/yy",mediumTime:"h:mm:ss a",shortTime:"h:mm a"},pluralCat:function(b){return b===1?"one":"other"}}}}function ad(){this.$get=["$rootScope","$browser","$q","$exceptionHandler",function(b,a,c,d){function e(e,f,i){var j=c.defer(),k=j.promise,l=y(i)&&!i,f=a.defer(function(){try{j.resolve(e())}catch(a){j.reject(a),d(a)}l||b.$apply()},f),i=function(){delete g[k.$timeoutId]};
102
- k.$timeoutId=f;g[f]=j;k.then(i,i);return k}var g={};e.cancel=function(b){return b&&b.$timeoutId in g?(g[b.$timeoutId].reject("canceled"),a.defer.cancel(b.$timeoutId)):!1};return e}]}function Rb(b){function a(a,e){return b.factory(a+c,e)}var c="Filter";this.register=a;this.$get=["$injector",function(a){return function(b){return a.get(b+c)}}];a("currency",Sb);a("date",Tb);a("filter",bd);a("json",cd);a("limitTo",dd);a("lowercase",ed);a("number",Ub);a("orderBy",Vb);a("uppercase",fd)}function bd(){return function(b,
103
- a){if(!E(b))return b;var c=[];c.check=function(a){for(var b=0;b<c.length;b++)if(!c[b](a))return!1;return!0};var d=function(a,b){if(b.charAt(0)==="!")return!d(a,b.substr(1));switch(typeof a){case "boolean":case "number":case "string":return(""+a).toLowerCase().indexOf(b)>-1;case "object":for(var c in a)if(c.charAt(0)!=="quot;&&d(a[c],b))return!0;return!1;case "array":for(c=0;c<a.length;c++)if(d(a[c],b))return!0;return!1;default:return!1}};switch(typeof a){case "boolean":case "number":case "string":a=
104
- {$:a};case "object":for(var e in a)e=="quot;?function(){var b=(""+a[e]).toLowerCase();b&&c.push(function(a){return d(a,b)})}():function(){var b=e,f=(""+a[e]).toLowerCase();f&&c.push(function(a){return d(gb(a,b),f)})}();break;case "function":c.push(a);break;default:return b}for(var g=[],h=0;h<b.length;h++){var f=b[h];c.check(f)&&g.push(f)}return g}}function Sb(b){var a=b.NUMBER_FORMATS;return function(b,d){if(w(d))d=a.CURRENCY_SYM;return Wb(b,a.PATTERNS[1],a.GROUP_SEP,a.DECIMAL_SEP,2).replace(/\u00A4/g,
105
- d)}}function Ub(b){var a=b.NUMBER_FORMATS;return function(b,d){return Wb(b,a.PATTERNS[0],a.GROUP_SEP,a.DECIMAL_SEP,d)}}function Wb(b,a,c,d,e){if(isNaN(b)||!isFinite(b))return"";var g=b<0,b=Math.abs(b),h=b+"",f="",i=[],j=!1;if(h.indexOf("e")!==-1){var k=h.match(/([\d\.]+)e(-?)(\d+)/);k&&k[2]=="-"&&k[3]>e+1?h="0":(f=h,j=!0)}if(!j){h=(h.split(Xb)[1]||"").length;w(e)&&(e=Math.min(Math.max(a.minFrac,h),a.maxFrac));var h=Math.pow(10,e),b=Math.round(b*h)/h,b=(""+b).split(Xb),h=b[0],b=b[1]||"",j=0,k=a.lgSize,
106
- l=a.gSize;if(h.length>=k+l)for(var j=h.length-k,n=0;n<j;n++)(j-n)%l===0&&n!==0&&(f+=c),f+=h.charAt(n);for(n=j;n<h.length;n++)(h.length-n)%k===0&&n!==0&&(f+=c),f+=h.charAt(n);for(;b.length<e;)b+="0";e&&e!=="0"&&(f+=d+b.substr(0,e))}i.push(g?a.negPre:a.posPre);i.push(f);i.push(g?a.negSuf:a.posSuf);return i.join("")}function jb(b,a,c){var d="";b<0&&(d="-",b=-b);for(b=""+b;b.length<a;)b="0"+b;c&&(b=b.substr(b.length-a));return d+b}function O(b,a,c,d){c=c||0;return function(e){e=e["get"+b]();if(c>0||e>
107
- -c)e+=c;e===0&&c==-12&&(e=12);return jb(e,a,d)}}function Ja(b,a){return function(c,d){var e=c["get"+b](),g=la(a?"SHORT"+b:b);return d[g][e]}}function Tb(b){function a(a){var b;if(b=a.match(c)){var a=new Date(0),g=0,h=0;b[9]&&(g=G(b[9]+b[10]),h=G(b[9]+b[11]));a.setUTCFullYear(G(b[1]),G(b[2])-1,G(b[3]));a.setUTCHours(G(b[4]||0)-g,G(b[5]||0)-h,G(b[6]||0),G(b[7]||0))}return a}var c=/^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?#x2F;;return function(c,
108
- e){var g="",h=[],f,i,e=e||"mediumDate",e=b.DATETIME_FORMATS[e]||e;B(c)&&(c=gd.test(c)?G(c):a(c));Qa(c)&&(c=new Date(c));if(!na(c))return c;for(;e;)(i=hd.exec(e))?(h=h.concat(ha.call(i,1)),e=h.pop()):(h.push(e),e=null);m(h,function(a){f=id[a];g+=f?f(c,b.DATETIME_FORMATS):a.replace(/(^'|'$)/g,"").replace(/''/g,"'")});return g}}function cd(){return function(b){return da(b,!0)}}function dd(){return function(b,a){if(!(b instanceof Array))return b;var a=G(a),c=[],d,e;if(!b||!(b instanceof Array))return c;
109
- a>b.length?a=b.length:a<-b.length&&(a=-b.length);a>0?(d=0,e=a):(d=b.length+a,e=b.length);for(;d<e;d++)c.push(b[d]);return c}}function Vb(b){return function(a,c,d){function e(a,b){return Ua(b)?function(b,c){return a(c,b)}:a}if(!E(a))return a;if(!c)return a;for(var c=E(c)?c:[c],c=Ra(c,function(a){var c=!1,d=a||ma;if(B(a)){if(a.charAt(0)=="+"||a.charAt(0)=="-")c=a.charAt(0)=="-",a=a.substring(1);d=b(a)}return e(function(a,b){var c;c=d(a);var e=d(b),f=typeof c,g=typeof e;f==g?(f=="string"&&(c=c.toLowerCase()),
110
- f=="string"&&(e=e.toLowerCase()),c=c===e?0:c<e?-1:1):c=f<g?-1:1;return c},c)}),g=[],h=0;h<a.length;h++)g.push(a[h]);return g.sort(e(function(a,b){for(var d=0;d<c.length;d++){var e=c[d](a,b);if(e!==0)return e}return 0},d))}}function S(b){H(b)&&(b={link:b});b.restrict=b.restrict||"AC";return I(b)}function Yb(b,a){function c(a,c){c=c?"-"+Za(c,"-"):"";b.removeClass((a?Ka:La)+c).addClass((a?La:Ka)+c)}var d=this,e=b.parent().controller("form")||Ma,g=0,h=d.$error={};d.$name=a.name;d.$dirty=!1;d.$pristine=
111
- !0;d.$valid=!0;d.$invalid=!1;e.$addControl(d);b.addClass(Na);c(!0);d.$addControl=function(a){a.$name&&!d.hasOwnProperty(a.$name)&&(d[a.$name]=a)};d.$removeControl=function(a){a.$name&&d[a.$name]===a&&delete d[a.$name];m(h,function(b,c){d.$setValidity(c,!0,a)})};d.$setValidity=function(a,b,j){var k=h[a];if(b){if(k&&(Sa(k,j),!k.length)){g--;if(!g)c(b),d.$valid=!0,d.$invalid=!1;h[a]=!1;c(!0,a);e.$setValidity(a,!0,d)}}else{g||c(b);if(k){if(za(k,j)!=-1)return}else h[a]=k=[],g++,c(!1,a),e.$setValidity(a,
112
- !1,d);k.push(j);d.$valid=!1;d.$invalid=!0}};d.$setDirty=function(){b.removeClass(Na).addClass(Zb);d.$dirty=!0;d.$pristine=!1;e.$setDirty()}}function X(b){return w(b)||b===""||b===null||b!==b}function Oa(b,a,c,d,e,g){var h=function(){var c=Q(a.val());d.$viewValue!==c&&b.$apply(function(){d.$setViewValue(c)})};if(e.hasEvent("input"))a.bind("input",h);else{var f,i=function(){f||(f=g.defer(function(){h();f=null}))};a.bind("keydown",function(a){a=a.keyCode;a===91||15<a&&a<19||37<=a&&a<=40||i()});a.bind("change",
113
- h);e.hasEvent("paste")&&a.bind("paste cut",i)}d.$render=function(){a.val(X(d.$viewValue)?"":d.$viewValue)};var j=c.ngPattern,k=function(a,b){return X(b)||a.test(b)?(d.$setValidity("pattern",!0),b):(d.$setValidity("pattern",!1),q)};j&&(j.match(/^\/(.*)\/#x2F;)?(j=RegExp(j.substr(1,j.length-2)),e=function(a){return k(j,a)}):e=function(a){var c=b.$eval(j);if(!c||!c.test)throw Error("Expected "+j+" to be a RegExp but was "+c);return k(c,a)},d.$formatters.push(e),d.$parsers.push(e));if(c.ngMinlength){var l=
114
- G(c.ngMinlength),e=function(a){return!X(a)&&a.length<l?(d.$setValidity("minlength",!1),q):(d.$setValidity("minlength",!0),a)};d.$parsers.push(e);d.$formatters.push(e)}if(c.ngMaxlength){var n=G(c.ngMaxlength),c=function(a){return!X(a)&&a.length>n?(d.$setValidity("maxlength",!1),q):(d.$setValidity("maxlength",!0),a)};d.$parsers.push(c);d.$formatters.push(c)}}function kb(b,a){b="ngClass"+b;return S(function(c,d,e){function g(b){if(a===!0||c.$index%2===a)i&&!fa(b,i)&&h(i),f(b);i=U(b)}function h(a){L(a)&&
115
- !E(a)&&(a=Ra(a,function(a,b){if(a)return b}));d.removeClass(E(a)?a.join(" "):a)}function f(a){L(a)&&!E(a)&&(a=Ra(a,function(a,b){if(a)return b}));a&&d.addClass(E(a)?a.join(" "):a)}var i=q;c.$watch(e[b],g,!0);e.$observe("class",function(){var a=c.$eval(e[b]);g(a,a)});b!=="ngClass"&&c.$watch("$index",function(d,g){var i=d&1;i!==g&1&&(i===a?f(c.$eval(e[b])):h(c.$eval(e[b])))})})}var z=function(b){return B(b)?b.toLowerCase():b},la=function(b){return B(b)?b.toUpperCase():b},Z=G((/msie (\d+)/.exec(z(navigator.userAgent))||
116
- [])[1]),u,ca,ha=[].slice,Pa=[].push,wa=Object.prototype.toString,Ya=P.angular||(P.angular={}),sa,fb,aa=["0","0","0"];C.$inject=[];ma.$inject=[];fb=Z<9?function(b){b=b.nodeName?b:b[0];return b.scopeName&&b.scopeName!="HTML"?la(b.scopeName+":"+b.nodeName):b.nodeName}:function(b){return b.nodeName?b.nodeName:b[0].nodeName};var kc=/[A-Z]/g,jd={full:"1.0.7",major:1,minor:0,dot:7,codeName:"monochromatic-rainbow"},Ba=K.cache={},Aa=K.expando="ng-"+(new Date).getTime(),oc=1,$b=P.document.addEventListener?
117
- function(b,a,c){b.addEventListener(a,c,!1)}:function(b,a,c){b.attachEvent("on"+a,c)},db=P.document.removeEventListener?function(b,a,c){b.removeEventListener(a,c,!1)}:function(b,a,c){b.detachEvent("on"+a,c)},mc=/([\:\-\_]+(.))/g,nc=/^moz([A-Z])/,ua=K.prototype={ready:function(b){function a(){c||(c=!0,b())}var c=!1;this.bind("DOMContentLoaded",a);K(P).bind("load",a)},toString:function(){var b=[];m(this,function(a){b.push(""+a)});return"["+b.join(", ")+"]"},eq:function(b){return b>=0?u(this[b]):u(this[this.length+
118
- b])},length:0,push:Pa,sort:[].sort,splice:[].splice},Ea={};m("multiple,selected,checked,disabled,readOnly,required".split(","),function(b){Ea[z(b)]=b});var Bb={};m("input,select,option,textarea,button,form".split(","),function(b){Bb[la(b)]=!0});m({data:wb,inheritedData:Da,scope:function(b){return Da(b,"$scope")},controller:zb,injector:function(b){return Da(b,"$injector")},removeAttr:function(b,a){b.removeAttribute(a)},hasClass:Ca,css:function(b,a,c){a=tb(a);if(y(c))b.style[a]=c;else{var d;Z<=8&&(d=
119
- b.currentStyle&&b.currentStyle[a],d===""&&(d="auto"));d=d||b.style[a];Z<=8&&(d=d===""?q:d);return d}},attr:function(b,a,c){var d=z(a);if(Ea[d])if(y(c))c?(b[a]=!0,b.setAttribute(a,d)):(b[a]=!1,b.removeAttribute(d));else return b[a]||(b.attributes.getNamedItem(a)||C).specified?d:q;else if(y(c))b.setAttribute(a,c);else if(b.getAttribute)return b=b.getAttribute(a,2),b===null?q:b},prop:function(b,a,c){if(y(c))b[a]=c;else return b[a]},text:v(Z<9?function(b,a){if(b.nodeType==1){if(w(a))return b.innerText;
120
- b.innerText=a}else{if(w(a))return b.nodeValue;b.nodeValue=a}}:function(b,a){if(w(a))return b.textContent;b.textContent=a},{$dv:""}),val:function(b,a){if(w(a))return b.value;b.value=a},html:function(b,a){if(w(a))return b.innerHTML;for(var c=0,d=b.childNodes;c<d.length;c++)ra(d[c]);b.innerHTML=a}},function(b,a){K.prototype[a]=function(a,d){var e,g;if((b.length==2&&b!==Ca&&b!==zb?a:d)===q)if(L(a)){for(e=0;e<this.length;e++)if(b===wb)b(this[e],a);else for(g in a)b(this[e],g,a[g]);return this}else{if(this.length)return b(this[0],
121
- a,d)}else{for(e=0;e<this.length;e++)b(this[e],a,d);return this}return b.$dv}});m({removeData:ub,dealoc:ra,bind:function a(c,d,e){var g=ba(c,"events"),h=ba(c,"handle");g||ba(c,"events",g={});h||ba(c,"handle",h=pc(c,g));m(d.split(" "),function(d){var i=g[d];if(!i){if(d=="mouseenter"||d=="mouseleave"){var j=T.body.contains||T.body.compareDocumentPosition?function(a,c){var d=a.nodeType===9?a.documentElement:a,e=c&&c.parentNode;return a===e||!(!e||!(e.nodeType===1&&(d.contains?d.contains(e):a.compareDocumentPosition&&
122
- a.compareDocumentPosition(e)&16)))}:function(a,c){if(c)for(;c=c.parentNode;)if(c===a)return!0;return!1};g[d]=[];a(c,{mouseleave:"mouseout",mouseenter:"mouseover"}[d],function(a){var c=a.relatedTarget;(!c||c!==this&&!j(this,c))&&h(a,d)})}else $b(c,d,h),g[d]=[];i=g[d]}i.push(e)})},unbind:vb,replaceWith:function(a,c){var d,e=a.parentNode;ra(a);m(new K(c),function(c){d?e.insertBefore(c,d.nextSibling):e.replaceChild(c,a);d=c})},children:function(a){var c=[];m(a.childNodes,function(a){a.nodeType===1&&c.push(a)});
123
- return c},contents:function(a){return a.childNodes||[]},append:function(a,c){m(new K(c),function(c){a.nodeType===1&&a.appendChild(c)})},prepend:function(a,c){if(a.nodeType===1){var d=a.firstChild;m(new K(c),function(c){d?a.insertBefore(c,d):(a.appendChild(c),d=c)})}},wrap:function(a,c){var c=u(c)[0],d=a.parentNode;d&&d.replaceChild(c,a);c.appendChild(a)},remove:function(a){ra(a);var c=a.parentNode;c&&c.removeChild(a)},after:function(a,c){var d=a,e=a.parentNode;m(new K(c),function(a){e.insertBefore(a,
124
- d.nextSibling);d=a})},addClass:yb,removeClass:xb,toggleClass:function(a,c,d){w(d)&&(d=!Ca(a,c));(d?yb:xb)(a,c)},parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},next:function(a){if(a.nextElementSibling)return a.nextElementSibling;for(a=a.nextSibling;a!=null&&a.nodeType!==1;)a=a.nextSibling;return a},find:function(a,c){return a.getElementsByTagName(c)},clone:cb,triggerHandler:function(a,c){var d=(ba(a,"events")||{})[c];m(d,function(c){c.call(a,null)})}},function(a,c){K.prototype[c]=
125
- function(c,e){for(var g,h=0;h<this.length;h++)g==q?(g=a(this[h],c,e),g!==q&&(g=u(g))):bb(g,a(this[h],c,e));return g==q?this:g}});Fa.prototype={put:function(a,c){this[ga(a)]=c},get:function(a){return this[ga(a)]},remove:function(a){var c=this[a=ga(a)];delete this[a];return c}};eb.prototype={push:function(a,c){var d=this[a=ga(a)];d?d.push(c):this[a]=[c]},shift:function(a){var c=this[a=ga(a)];if(c)return c.length==1?(delete this[a],c[0]):c.shift()},peek:function(a){if(a=this[ga(a)])return a[0]}};var rc=
126
- /^function\s*[^\(]*\(\s*([^\)]*)\)/m,sc=/,/,tc=/^\s*(_?)(\S+?)\1\s*#x2F;,qc=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg,Eb="Non-assignable model expression: ";Db.$inject=["$provide"];var Bc=/^(x[\:\-_]|data[\:\-_])/i,Hb=/^([^:]+):\/\/(\w+:{0,1}\w*@)?(\{?[\w\.-]*\}?)(:([0-9]+))?(\/[^\?#]*)?(\?([^#]*))?(#(.*))?#x2F;,ac=/^([^\?#]*)?(\?([^#]*))?(#(.*))?#x2F;,Ic=ac,Ib={http:80,https:443,ftp:21};hb.prototype={$replace:!1,absUrl:Ha("$absUrl"),url:function(a,c){if(w(a))return this.$url;var d=ac.exec(a);d[1]&&this.path(decodeURIComponent(d[1]));
127
- if(d[2]||d[1])this.search(d[3]||"");this.hash(d[5]||"",c);return this},protocol:Ha("$protocol"),host:Ha("$host"),port:Ha("$port"),path:Kb("$path",function(a){return a.charAt(0)=="/"?a:"/"+a}),search:function(a,c){if(w(a))return this.$search;y(c)?c===null?delete this.$search[a]:this.$search[a]=c:this.$search=B(a)?Va(a):a;this.$compose();return this},hash:Kb("$hash",ma),replace:function(){this.$replace=!0;return this}};Ga.prototype=ya(hb.prototype);Jb.prototype=ya(Ga.prototype);var Ia={"null":function(){return null},
128
- "true":function(){return!0},"false":function(){return!1},undefined:C,"+":function(a,c,d,e){d=d(a,c);e=e(a,c);return y(d)?y(e)?d+e:d:y(e)?e:q},"-":function(a,c,d,e){d=d(a,c);e=e(a,c);return(y(d)?d:0)-(y(e)?e:0)},"*":function(a,c,d,e){return d(a,c)*e(a,c)},"/":function(a,c,d,e){return d(a,c)/e(a,c)},"%":function(a,c,d,e){return d(a,c)%e(a,c)},"^":function(a,c,d,e){return d(a,c)^e(a,c)},"=":C,"==":function(a,c,d,e){return d(a,c)==e(a,c)},"!=":function(a,c,d,e){return d(a,c)!=e(a,c)},"<":function(a,c,
129
- d,e){return d(a,c)<e(a,c)},">":function(a,c,d,e){return d(a,c)>e(a,c)},"<=":function(a,c,d,e){return d(a,c)<=e(a,c)},">=":function(a,c,d,e){return d(a,c)>=e(a,c)},"&&":function(a,c,d,e){return d(a,c)&&e(a,c)},"||":function(a,c,d,e){return d(a,c)||e(a,c)},"&":function(a,c,d,e){return d(a,c)&e(a,c)},"|":function(a,c,d,e){return e(a,c)(a,c,d(a,c))},"!":function(a,c,d){return!d(a,c)}},Mc={n:"\n",f:"\u000c",r:"\r",t:"\t",v:"\u000b","'":"'",'"':'"'},ib={},Zc=P.XMLHttpRequest||function(){try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(a){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(c){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(d){}throw Error("This browser does not support XMLHttpRequest.");
130
- };Rb.$inject=["$provide"];Sb.$inject=["$locale"];Ub.$inject=["$locale"];var Xb=".",id={yyyy:O("FullYear",4),yy:O("FullYear",2,0,!0),y:O("FullYear",1),MMMM:Ja("Month"),MMM:Ja("Month",!0),MM:O("Month",2,1),M:O("Month",1,1),dd:O("Date",2),d:O("Date",1),HH:O("Hours",2),H:O("Hours",1),hh:O("Hours",2,-12),h:O("Hours",1,-12),mm:O("Minutes",2),m:O("Minutes",1),ss:O("Seconds",2),s:O("Seconds",1),EEEE:Ja("Day"),EEE:Ja("Day",!0),a:function(a,c){return a.getHours()<12?c.AMPMS[0]:c.AMPMS[1]},Z:function(a){var a=
131
- -1*a.getTimezoneOffset(),c=a>=0?"+":"";c+=jb(Math[a>0?"floor":"ceil"](a/60),2)+jb(Math.abs(a%60),2);return c}},hd=/((?:[^yMdHhmsaZE']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z))(.*)/,gd=/^\d+#x2F;;Tb.$inject=["$locale"];var ed=I(z),fd=I(la);Vb.$inject=["$parse"];var kd=I({restrict:"E",compile:function(a,c){Z<=8&&(!c.href&&!c.name&&c.$set("href",""),a.append(T.createComment("IE fix")));return function(a,c){c.bind("click",function(a){c.attr("href")||a.preventDefault()})}}}),lb={};m(Ea,function(a,
132
- c){var d=ea("ng-"+c);lb[d]=function(){return{priority:100,compile:function(){return function(a,g,h){a.$watch(h[d],function(a){h.$set(c,!!a)})}}}}});m(["src","href"],function(a){var c=ea("ng-"+a);lb[c]=function(){return{priority:99,link:function(d,e,g){g.$observe(c,function(c){c&&(g.$set(a,c),Z&&e.prop(a,g[a]))})}}}});var Ma={$addControl:C,$removeControl:C,$setValidity:C,$setDirty:C};Yb.$inject=["$element","$attrs","$scope"];var Pa=function(a){return["$timeout",function(c){var d={name:"form",restrict:"E",
133
- controller:Yb,compile:function(){return{pre:function(a,d,h,f){if(!h.action){var i=function(a){a.preventDefault?a.preventDefault():a.returnValue=!1};$b(d[0],"submit",i);d.bind("$destroy",function(){c(function(){db(d[0],"submit",i)},0,!1)})}var j=d.parent().controller("form"),k=h.name||h.ngForm;k&&(a[k]=f);j&&d.bind("$destroy",function(){j.$removeControl(f);k&&(a[k]=q);v(f,Ma)})}}}};return a?v(U(d),{restrict:"EAC"}):d}]},ld=Pa(),md=Pa(!0),nd=/^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?#x2F;,
134
- od=/^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}#x2F;,pd=/^\s*(\-|\+)?(\d+|(\d*(\.\d*)))\s*#x2F;,bc={text:Oa,number:function(a,c,d,e,g,h){Oa(a,c,d,e,g,h);e.$parsers.push(function(a){var c=X(a);return c||pd.test(a)?(e.$setValidity("number",!0),a===""?null:c?a:parseFloat(a)):(e.$setValidity("number",!1),q)});e.$formatters.push(function(a){return X(a)?"":""+a});if(d.min){var f=parseFloat(d.min),a=function(a){return!X(a)&&a<f?(e.$setValidity("min",!1),q):(e.$setValidity("min",!0),a)};e.$parsers.push(a);
135
- e.$formatters.push(a)}if(d.max){var i=parseFloat(d.max),d=function(a){return!X(a)&&a>i?(e.$setValidity("max",!1),q):(e.$setValidity("max",!0),a)};e.$parsers.push(d);e.$formatters.push(d)}e.$formatters.push(function(a){return X(a)||Qa(a)?(e.$setValidity("number",!0),a):(e.$setValidity("number",!1),q)})},url:function(a,c,d,e,g,h){Oa(a,c,d,e,g,h);a=function(a){return X(a)||nd.test(a)?(e.$setValidity("url",!0),a):(e.$setValidity("url",!1),q)};e.$formatters.push(a);e.$parsers.push(a)},email:function(a,
136
- c,d,e,g,h){Oa(a,c,d,e,g,h);a=function(a){return X(a)||od.test(a)?(e.$setValidity("email",!0),a):(e.$setValidity("email",!1),q)};e.$formatters.push(a);e.$parsers.push(a)},radio:function(a,c,d,e){w(d.name)&&c.attr("name",xa());c.bind("click",function(){c[0].checked&&a.$apply(function(){e.$setViewValue(d.value)})});e.$render=function(){c[0].checked=d.value==e.$viewValue};d.$observe("value",e.$render)},checkbox:function(a,c,d,e){var g=d.ngTrueValue,h=d.ngFalseValue;B(g)||(g=!0);B(h)||(h=!1);c.bind("click",
137
- function(){a.$apply(function(){e.$setViewValue(c[0].checked)})});e.$render=function(){c[0].checked=e.$viewValue};e.$formatters.push(function(a){return a===g});e.$parsers.push(function(a){return a?g:h})},hidden:C,button:C,submit:C,reset:C},cc=["$browser","$sniffer",function(a,c){return{restrict:"E",require:"?ngModel",link:function(d,e,g,h){h&&(bc[z(g.type)]||bc.text)(d,e,g,h,c,a)}}}],La="ng-valid",Ka="ng-invalid",Na="ng-pristine",Zb="ng-dirty",qd=["$scope","$exceptionHandler","$attrs","$element","$parse",
138
- function(a,c,d,e,g){function h(a,c){c=c?"-"+Za(c,"-"):"";e.removeClass((a?Ka:La)+c).addClass((a?La:Ka)+c)}this.$modelValue=this.$viewValue=Number.NaN;this.$parsers=[];this.$formatters=[];this.$viewChangeListeners=[];this.$pristine=!0;this.$dirty=!1;this.$valid=!0;this.$invalid=!1;this.$name=d.name;var f=g(d.ngModel),i=f.assign;if(!i)throw Error(Eb+d.ngModel+" ("+pa(e)+")");this.$render=C;var j=e.inheritedData("$formController")||Ma,k=0,l=this.$error={};e.addClass(Na);h(!0);this.$setValidity=function(a,
139
- c){if(l[a]!==!c){if(c){if(l[a]&&k--,!k)h(!0),this.$valid=!0,this.$invalid=!1}else h(!1),this.$invalid=!0,this.$valid=!1,k++;l[a]=!c;h(c,a);j.$setValidity(a,c,this)}};this.$setViewValue=function(d){this.$viewValue=d;if(this.$pristine)this.$dirty=!0,this.$pristine=!1,e.removeClass(Na).addClass(Zb),j.$setDirty();m(this.$parsers,function(a){d=a(d)});if(this.$modelValue!==d)this.$modelValue=d,i(a,d),m(this.$viewChangeListeners,function(a){try{a()}catch(d){c(d)}})};var n=this;a.$watch(function(){var c=
140
- f(a);if(n.$modelValue!==c){var d=n.$formatters,e=d.length;for(n.$modelValue=c;e--;)c=d[e](c);if(n.$viewValue!==c)n.$viewValue=c,n.$render()}})}],rd=function(){return{require:["ngModel","^?form"],controller:qd,link:function(a,c,d,e){var g=e[0],h=e[1]||Ma;h.$addControl(g);c.bind("$destroy",function(){h.$removeControl(g)})}}},sd=I({require:"ngModel",link:function(a,c,d,e){e.$viewChangeListeners.push(function(){a.$eval(d.ngChange)})}}),dc=function(){return{require:"?ngModel",link:function(a,c,d,e){if(e){d.required=
141
- !0;var g=function(a){if(d.required&&(X(a)||a===!1))e.$setValidity("required",!1);else return e.$setValidity("required",!0),a};e.$formatters.push(g);e.$parsers.unshift(g);d.$observe("required",function(){g(e.$viewValue)})}}}},td=function(){return{require:"ngModel",link:function(a,c,d,e){var g=(a=/\/(.*)\//.exec(d.ngList))&&RegExp(a[1])||d.ngList||",";e.$parsers.push(function(a){var c=[];a&&m(a.split(g),function(a){a&&c.push(Q(a))});return c});e.$formatters.push(function(a){return E(a)?a.join(", "):
142
- q})}}},ud=/^(true|false|\d+)#x2F;,vd=function(){return{priority:100,compile:function(a,c){return ud.test(c.ngValue)?function(a,c,g){g.$set("value",a.$eval(g.ngValue))}:function(a,c,g){a.$watch(g.ngValue,function(a){g.$set("value",a,!1)})}}}},wd=S(function(a,c,d){c.addClass("ng-binding").data("$binding",d.ngBind);a.$watch(d.ngBind,function(a){c.text(a==q?"":a)})}),xd=["$interpolate",function(a){return function(c,d,e){c=a(d.attr(e.$attr.ngBindTemplate));d.addClass("ng-binding").data("$binding",c);e.$observe("ngBindTemplate",
143
- function(a){d.text(a)})}}],yd=[function(){return function(a,c,d){c.addClass("ng-binding").data("$binding",d.ngBindHtmlUnsafe);a.$watch(d.ngBindHtmlUnsafe,function(a){c.html(a||"")})}}],zd=kb("",!0),Ad=kb("Odd",0),Bd=kb("Even",1),Cd=S({compile:function(a,c){c.$set("ngCloak",q);a.removeClass("ng-cloak")}}),Dd=[function(){return{scope:!0,controller:"@"}}],Ed=["$sniffer",function(a){return{priority:1E3,compile:function(){a.csp=!0}}}],ec={};m("click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave".split(" "),
144
- function(a){var c=ea("ng-"+a);ec[c]=["$parse",function(d){return function(e,g,h){var f=d(h[c]);g.bind(z(a),function(a){e.$apply(function(){f(e,{$event:a})})})}}]});var Fd=S(function(a,c,d){c.bind("submit",function(){a.$apply(d.ngSubmit)})}),Gd=["$http","$templateCache","$anchorScroll","$compile",function(a,c,d,e){return{restrict:"ECA",terminal:!0,compile:function(g,h){var f=h.ngInclude||h.src,i=h.onload||"",j=h.autoscroll;return function(g,h){var n=0,o,p=function(){o&&(o.$destroy(),o=null);h.html("")};
145
- g.$watch(f,function(f){var m=++n;f?a.get(f,{cache:c}).success(function(a){m===n&&(o&&o.$destroy(),o=g.$new(),h.html(a),e(h.contents())(o),y(j)&&(!j||g.$eval(j))&&d(),o.$emit("$includeContentLoaded"),g.$eval(i))}).error(function(){m===n&&p()}):p()})}}}}],Hd=S({compile:function(){return{pre:function(a,c,d){a.$eval(d.ngInit)}}}}),Id=S({terminal:!0,priority:1E3}),Jd=["$locale","$interpolate",function(a,c){var d=/{}/g;return{restrict:"EA",link:function(e,g,h){var f=h.count,i=g.attr(h.$attr.when),j=h.offset||
146
- 0,k=e.$eval(i),l={},n=c.startSymbol(),o=c.endSymbol();m(k,function(a,e){l[e]=c(a.replace(d,n+f+"-"+j+o))});e.$watch(function(){var c=parseFloat(e.$eval(f));return isNaN(c)?"":(c in k||(c=a.pluralCat(c-j)),l[c](e,g,!0))},function(a){g.text(a)})}}}],Kd=S({transclude:"element",priority:1E3,terminal:!0,compile:function(a,c,d){return function(a,c,h){var f=h.ngRepeat,h=f.match(/^\s*(.+)\s+in\s+(.*)\s*#x2F;),i,j,k;if(!h)throw Error("Expected ngRepeat in form of '_item_ in _collection_' but got '"+f+"'.");f=
147
- h[1];i=h[2];h=f.match(/^(?:([\$\w]+)|\(([\$\w]+)\s*,\s*([\$\w]+)\))#x2F;);if(!h)throw Error("'item' in 'item in collection' should be identifier or (key, value) but got '"+f+"'.");j=h[3]||h[1];k=h[2];var l=new eb;a.$watch(function(a){var e,f,h=a.$eval(i),m=c,q=new eb,y,A,u,w,r,v;if(E(h))r=h||[];else{r=[];for(u in h)h.hasOwnProperty(u)&&u.charAt(0)!="quot;&&r.push(u);r.sort()}y=r.length-1;e=0;for(f=r.length;e<f;e++){u=h===r?e:r[e];w=h[u];if(v=l.shift(w)){A=v.scope;q.push(w,v);if(e!==v.index)v.index=e,m.after(v.element);
148
- m=v.element}else A=a.$new();A[j]=w;k&&(A[k]=u);A.$index=e;A.$first=e===0;A.$last=e===y;A.$middle=!(A.$first||A.$last);v||d(A,function(a){m.after(a);v={scope:A,element:m=a,index:e};q.push(w,v)})}for(u in l)if(l.hasOwnProperty(u))for(r=l[u];r.length;)w=r.pop(),w.element.remove(),w.scope.$destroy();l=q})}}}),Ld=S(function(a,c,d){a.$watch(d.ngShow,function(a){c.css("display",Ua(a)?"":"none")})}),Md=S(function(a,c,d){a.$watch(d.ngHide,function(a){c.css("display",Ua(a)?"none":"")})}),Nd=S(function(a,c,
149
- d){a.$watch(d.ngStyle,function(a,d){d&&a!==d&&m(d,function(a,d){c.css(d,"")});a&&c.css(a)},!0)}),Od=I({restrict:"EA",require:"ngSwitch",controller:["$scope",function(){this.cases={}}],link:function(a,c,d,e){var g,h,f;a.$watch(d.ngSwitch||d.on,function(i){h&&(f.$destroy(),h.remove(),h=f=null);if(g=e.cases["!"+i]||e.cases["?"])a.$eval(d.change),f=a.$new(),g(f,function(a){h=a;c.append(a)})})}}),Pd=S({transclude:"element",priority:500,require:"^ngSwitch",compile:function(a,c,d){return function(a,g,h,
150
- f){f.cases["!"+c.ngSwitchWhen]=d}}}),Qd=S({transclude:"element",priority:500,require:"^ngSwitch",compile:function(a,c,d){return function(a,c,h,f){f.cases["?"]=d}}}),Rd=S({controller:["$transclude","$element",function(a,c){a(function(a){c.append(a)})}]}),Sd=["$http","$templateCache","$route","$anchorScroll","$compile","$controller",function(a,c,d,e,g,h){return{restrict:"ECA",terminal:!0,link:function(a,c,j){function k(){var j=d.current&&d.current.locals,k=j&&j.$template;if(k){c.html(k);l&&(l.$destroy(),
151
- l=null);var k=g(c.contents()),m=d.current;l=m.scope=a.$new();if(m.controller)j.$scope=l,j=h(m.controller,j),c.children().data("$ngControllerController",j);k(l);l.$emit("$viewContentLoaded");l.$eval(n);e()}else c.html(""),l&&(l.$destroy(),l=null)}var l,n=j.onload||"";a.$on("$routeChangeSuccess",k);k()}}}],Td=["$templateCache",function(a){return{restrict:"E",terminal:!0,compile:function(c,d){d.type=="text/ng-template"&&a.put(d.id,c[0].text)}}}],Ud=I({terminal:!0}),Vd=["$compile","$parse",function(a,
152
- c){var d=/^\s*(.*?)(?:\s+as\s+(.*?))?(?:\s+group\s+by\s+(.*))?\s+for\s+(?:([\$\w][\$\w\d]*)|(?:\(\s*([\$\w][\$\w\d]*)\s*,\s*([\$\w][\$\w\d]*)\s*\)))\s+in\s+(.*)#x2F;,e={$setViewValue:C};return{restrict:"E",require:["select","?ngModel"],controller:["$element","$scope","$attrs",function(a,c,d){var i=this,j={},k=e,l;i.databound=d.ngModel;i.init=function(a,c,d){k=a;l=d};i.addOption=function(c){j[c]=!0;k.$viewValue==c&&(a.val(c),l.parent()&&l.remove())};i.removeOption=function(a){this.hasOption(a)&&(delete j[a],
153
- k.$viewValue==a&&this.renderUnknownOption(a))};i.renderUnknownOption=function(c){c="? "+ga(c)+" ?";l.val(c);a.prepend(l);a.val(c);l.prop("selected",!0)};i.hasOption=function(a){return j.hasOwnProperty(a)};c.$on("$destroy",function(){i.renderUnknownOption=C})}],link:function(e,h,f,i){function j(a,c,d,e){d.$render=function(){var a=d.$viewValue;e.hasOption(a)?(z.parent()&&z.remove(),c.val(a),a===""&&v.prop("selected",!0)):w(a)&&v?c.val(""):e.renderUnknownOption(a)};c.bind("change",function(){a.$apply(function(){z.parent()&&
154
- z.remove();d.$setViewValue(c.val())})})}function k(a,c,d){var e;d.$render=function(){var a=new Fa(d.$viewValue);m(c.find("option"),function(c){c.selected=y(a.get(c.value))})};a.$watch(function(){fa(e,d.$viewValue)||(e=U(d.$viewValue),d.$render())});c.bind("change",function(){a.$apply(function(){var a=[];m(c.find("option"),function(c){c.selected&&a.push(c.value)});d.$setViewValue(a)})})}function l(e,f,g){function h(){var a={"":[]},c=[""],d,i,s,u,v;s=g.$modelValue;u=o(e)||[];var w=l?mb(u):u,y,x,z;x=
155
- {};v=!1;var B,E;p&&(v=new Fa(s));for(z=0;y=w.length,z<y;z++){x[k]=u[l?x[l]=w[z]:z];d=m(e,x)||"";if(!(i=a[d]))i=a[d]=[],c.push(d);p?d=v.remove(n(e,x))!=q:(d=s===n(e,x),v=v||d);B=j(e,x);B=B===q?"":B;i.push({id:l?w[z]:z,label:B,selected:d})}p||(t||s===null?a[""].unshift({id:"",label:"",selected:!v}):v||a[""].unshift({id:"?",label:"",selected:!0}));x=0;for(w=c.length;x<w;x++){d=c[x];i=a[d];if(r.length<=x)s={element:A.clone().attr("label",d),label:i.label},u=[s],r.push(u),f.append(s.element);else if(u=
156
- r[x],s=u[0],s.label!=d)s.element.attr("label",s.label=d);B=null;z=0;for(y=i.length;z<y;z++)if(d=i[z],v=u[z+1]){B=v.element;if(v.label!==d.label)B.text(v.label=d.label);if(v.id!==d.id)B.val(v.id=d.id);if(B[0].selected!==d.selected)B.prop("selected",v.selected=d.selected)}else d.id===""&&t?E=t:(E=C.clone()).val(d.id).attr("selected",d.selected).text(d.label),u.push({element:E,label:d.label,id:d.id,selected:d.selected}),B?B.after(E):s.element.append(E),B=E;for(z++;u.length>z;)u.pop().element.remove()}for(;r.length>
157
- x;)r.pop()[0].element.remove()}var i;if(!(i=s.match(d)))throw Error("Expected ngOptions in form of '_select_ (as _label_)? for (_key_,)?_value_ in _collection_' but got '"+s+"'.");var j=c(i[2]||i[1]),k=i[4]||i[6],l=i[5],m=c(i[3]||""),n=c(i[2]?i[1]:k),o=c(i[7]),r=[[{element:f,label:""}]];t&&(a(t)(e),t.removeClass("ng-scope"),t.remove());f.html("");f.bind("change",function(){e.$apply(function(){var a,c=o(e)||[],d={},h,i,j,m,s,t;if(p){i=[];m=0;for(t=r.length;m<t;m++){a=r[m];j=1;for(s=a.length;j<s;j++)if((h=
158
- a[j].element)[0].selected)h=h.val(),l&&(d[l]=h),d[k]=c[h],i.push(n(e,d))}}else h=f.val(),h=="?"?i=q:h==""?i=null:(d[k]=c[h],l&&(d[l]=h),i=n(e,d));g.$setViewValue(i)})});g.$render=h;e.$watch(h)}if(i[1]){for(var n=i[0],o=i[1],p=f.multiple,s=f.ngOptions,t=!1,v,C=u(T.createElement("option")),A=u(T.createElement("optgroup")),z=C.clone(),i=0,B=h.children(),r=B.length;i<r;i++)if(B[i].value==""){v=t=B.eq(i);break}n.init(o,t,z);if(p&&(f.required||f.ngRequired)){var E=function(a){o.$setValidity("required",
159
- !f.required||a&&a.length);return a};o.$parsers.push(E);o.$formatters.unshift(E);f.$observe("required",function(){E(o.$viewValue)})}s?l(e,h,o):p?k(e,h,o):j(e,h,o,n)}}}}],Wd=["$interpolate",function(a){var c={addOption:C,removeOption:C};return{restrict:"E",priority:100,compile:function(d,e){if(w(e.value)){var g=a(d.text(),!0);g||e.$set("value",d.text())}return function(a,d,e){var j=d.parent(),k=j.data("$selectController")||j.parent().data("$selectController");k&&k.databound?d.prop("selected",!1):k=
160
- c;g?a.$watch(g,function(a,c){e.$set("value",a);a!==c&&k.removeOption(c);k.addOption(a)}):k.addOption(e.value);d.bind("$destroy",function(){k.removeOption(e.value)})}}}}],Xd=I({restrict:"E",terminal:!0});(ca=P.jQuery)?(u=ca,v(ca.fn,{scope:ua.scope,controller:ua.controller,injector:ua.injector,inheritedData:ua.inheritedData}),ab("remove",!0),ab("empty"),ab("html")):u=K;Ya.element=u;(function(a){v(a,{bootstrap:rb,copy:U,extend:v,equals:fa,element:u,forEach:m,injector:sb,noop:C,bind:Ta,toJson:da,fromJson:pb,
161
- identity:ma,isUndefined:w,isDefined:y,isString:B,isFunction:H,isObject:L,isNumber:Qa,isElement:gc,isArray:E,version:jd,isDate:na,lowercase:z,uppercase:la,callbacks:{counter:0}});sa=lc(P);try{sa("ngLocale")}catch(c){sa("ngLocale",[]).provider("$locale",$c)}sa("ng",["ngLocale"],["$provide",function(a){a.provider("$compile",Db).directive({a:kd,input:cc,textarea:cc,form:ld,script:Td,select:Vd,style:Xd,option:Wd,ngBind:wd,ngBindHtmlUnsafe:yd,ngBindTemplate:xd,ngClass:zd,ngClassEven:Bd,ngClassOdd:Ad,ngCsp:Ed,
162
- ngCloak:Cd,ngController:Dd,ngForm:md,ngHide:Md,ngInclude:Gd,ngInit:Hd,ngNonBindable:Id,ngPluralize:Jd,ngRepeat:Kd,ngShow:Ld,ngSubmit:Fd,ngStyle:Nd,ngSwitch:Od,ngSwitchWhen:Pd,ngSwitchDefault:Qd,ngOptions:Ud,ngView:Sd,ngTransclude:Rd,ngModel:rd,ngList:td,ngChange:sd,required:dc,ngRequired:dc,ngValue:vd}).directive(lb).directive(ec);a.provider({$anchorScroll:uc,$browser:wc,$cacheFactory:xc,$controller:Cc,$document:Dc,$exceptionHandler:Ec,$filter:Rb,$interpolate:Fc,$http:Wc,$httpBackend:Xc,$location:Jc,
163
- $log:Kc,$parse:Oc,$route:Rc,$routeParams:Sc,$rootScope:Tc,$q:Pc,$sniffer:Uc,$templateCache:yc,$timeout:ad,$window:Vc})}])})(Ya);u(T).ready(function(){jc(T,rb)})})(window,document);angular.element(document).find("head").append('<style type="text/css">@charset "UTF-8";[ng\\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak{display:none;}ng\\:form{display:block;}</style>');
js/jpibfi-min.js ADDED
@@ -0,0 +1 @@
1
+ var jpibfi;!function(t){!function(t){t[t.TopLeft=0]="TopLeft",t[t.TopRight=1]="TopRight",t[t.BottomLeft=2]="BottomLeft",t[t.BottomRight=3]="BottomRight",t[t.Middle=4]="Middle"}(t.ButtonPosition||(t.ButtonPosition={}));t.ButtonPosition}(jpibfi||(jpibfi={}));var jpibfi;!function(t){var i=jQuery,e=function(){function e(t,i){this._settings=t,this._logger=i}return e.prototype.getImageUrl=function(t){return i.fn.prop&&t.prop("src")||t.attr("src")},e.prototype.generate=function(e){var n=jQuery("<a/>",{href:"#","class":"pinit-button","data-jpibfi-indexer":e,text:""}),o=this;return n.click(function(){o._logger.logString("Pin In button clicked");var t=i(this).data("jpibfi-indexer"),e=i('img[data-jpibfi-indexer="'+t+'"]'),n="",s="",r="";if(o._settings.usePostUrl){var a=e.closest(".jpibfi_container").find("input.jpibfi").first();a.length&&(s=a.data("jpibfi-description"),r=a.data("jpibfi-url"))}r=r||o._settings.pageUrl,3==o._settings.descriptionOption?n=e.attr("title")||e.attr("alt"):2==o._settings.descriptionOption?n=s||o._settings.pageDescription:4==o._settings.descriptionOption?n=o._settings.siteTitle:5==o._settings.descriptionOption?n=e.data("jpibfi-description"):6==o._settings.descriptionOption&&(n=e.attr("alt")),n=n||s||o._settings.pageTitle;var g="http://pinterest.com/pin/create/bookmarklet/?is_video="+encodeURIComponent("false")+"&url="+encodeURIComponent(r)+"&media="+encodeURIComponent(o.getImageUrl(e))+"&description="+encodeURIComponent(n);return window.open(g,"Pinterest","width=632,height=253,status=0,toolbar=0,menubar=0,location=1,scrollbars=1"),!1}),n.mouseenter(function(){var t=i(this);clearTimeout(t.data("jpibfi-timeoutId"))}),n.mouseleave(function(){var e=i(this);t.Utils.startHide(e)}),n},e}();t.PinButtonGenerator=e}(jpibfi||(jpibfi={}));var jpibfi;!function(t){var i=function(){function t(t){this._printLog=t&&"undefined"!=typeof console&&"undefined"!=typeof console.log,this._jsonStringifyExists="undefined"!=typeof JSON&&"function"==typeof JSON.stringify}return t.prototype._logObject=function(t){var i="";for(var e in t)i+=e+": "+t[e]+"\n";console.log("jpibfi debug: "+i)},t.prototype.logString=function(t){this._printLog&&console.log("jpibfi debug: "+t)},t.prototype.logObject=function(t){this._printLog&&(this._jsonStringifyExists?console.log("jpibfi debugz: "+JSON.stringify(t,null,4)):this._logObject(t))},t}();t.Logger=i}(jpibfi||(jpibfi={}));var jpibfi;!function(t){var i=function(){function i(i){this.filterSelector="*",this.notSelector="",this.buttonMarginTop=parseInt(i.buttonMarginTop),this.buttonMarginRight=parseInt(i.buttonMarginRight),this.buttonMarginBottom=parseInt(i.buttonMarginBottom),this.buttonMarginLeft=parseInt(i.buttonMarginLeft),this.buttonPosition=i.hasOwnProperty("buttonPosition")?parseInt(i.buttonPosition):4,this.debug=i.hasOwnProperty("debug")?"1"==i.debug:!1,this.descriptionOption=i.hasOwnProperty("descriptionOption")?parseInt(i.descriptionOption):1,this.imageSelector=i.imageSelector,this.minImageWidth=i.hasOwnProperty("minImageWidth")?parseInt(i.minImageWidth):0,this.minImageHeight=i.hasOwnProperty("minImageHeight")?parseInt(i.minImageHeight):0,this.pageDescription=i.pageDescription,this.pageTitle=i.pageTitle,this.pageUrl=i.pageUrl,this.pinImageHeight=parseInt(i.pinImageHeight),this.pinImageWidth=parseInt(i.pinImageWidth),this.retinaFriendly=i.hasOwnProperty("retinaFriendly")?1==i.retinaFriendly:!1,this.siteTitle=i.siteTitle,this.usePostUrl=i.hasOwnProperty("usePostUrl")?i.usePostUrl:!0,this.containerSelector=i.containerSelector,this.notSelector=i.hasOwnProperty("disabledClasses")?t.Utils.createSelectorFromList(i.disabledClasses):"",this.filterSelector=i.hasOwnProperty("enabledClasses")?t.Utils.createSelectorFromList(i.enabledClasses)||"*":"*",this.adjustPinImageSize()}return i.prototype.adjustPinImageSize=function(){this.retinaFriendly&&(this.pinImageHeight=Math.ceil(this.pinImageHeight/2),this.pinImageWidth=Math.ceil(this.pinImageWidth/2))},i}();t.Settings=i}(jpibfi||(jpibfi={}));var jpibfi;!function(t){var i=jQuery,e=function(){function t(){}return t.createSelectorFromList=function(t){for(var i=t.split(";"),e="",n=0;n<i.length;n++)i[n]&&(e+="."+i[n]+",");return e?e.substr(0,e.length-1):e},t.startHide=function(t){var e=setTimeout(function(){t.remove(),i('img[data-jpibfi-indexer="'+t.data("jpibfi-indexer")+'"]').removeClass("pinit-hover")},100);t.data("jpibfi-timeoutId",e)},t}();t.Utils=e}(jpibfi||(jpibfi={}));var jpibfi;!function(t){"use strict";var i=jQuery,e=function(){function e(e){this._indexer=0,this._settings=new t.Settings(i.extend({pageUrl:document.URL,pageTitle:document.title,pageDescription:i('meta[name="description"]').attr("content")||""},e)),this._logger=new t.Logger(this._settings.debug),this._buttonGenerator=new t.PinButtonGenerator(this._settings,this._logger),this._logger.logObject(this._settings)}return e.prototype.addImages=function(){this._logger.logString(">>addImages");var t=i(this._settings.imageSelector).not(this._settings.notSelector).not("[data-jpibfi-indexer]").filter(this._settings.filterSelector),e=this;t.each(function(){i(this).attr("data-jpibfi-indexer",e._indexer++)}),this._logger.logString("Images caught by selectors: "+this._indexer)},e.prototype.init=function(){var t=i(".jpibfi").closest(this._settings.containerSelector).addClass("jpibfi_container");this._logger.logString("Number of containers added: "+t.length),this.initImageDelegates(),i(document).trigger("jpibfi_beforeAddImages",{}),this.addImages(),i(document).trigger("jpibfi_afterAddImages",{})},e.prototype.initImageDelegates=function(){var e=this;i(document).delegate("img[data-jpibfi-indexer]","mouseenter",function(){var n=i(this);if(n[0].clientWidth<e._settings.minImageWidth||n[0].clientHeight<e._settings.minImageHeight)return void n.removeAttr("data-jpibfi-indexer");var o=n.data("jpibfi-indexer"),s=i('a.pinit-button[data-jpibfi-indexer="'+o+'"]');if(1==s.length)clearTimeout(s.data("jpibfi-timeoutId"));else{s=e._buttonGenerator.generate(o);var r=n.offset(),a={width:n.get(0).clientWidth,height:n.get(0).clientHeight};switch(e._settings.buttonPosition){case t.ButtonPosition.TopLeft:r.left+=e._settings.buttonMarginLeft,r.top+=e._settings.buttonMarginTop;break;case t.ButtonPosition.TopRight:r.top+=e._settings.buttonMarginTop,r.left=r.left+a.width-e._settings.buttonMarginRight-e._settings.pinImageWidth;break;case t.ButtonPosition.BottomLeft:r.left+=e._settings.buttonMarginLeft,r.top=r.top+a.height-e._settings.buttonMarginBottom-e._settings.pinImageHeight;break;case t.ButtonPosition.BottomRight:r.left=r.left+a.width-e._settings.buttonMarginRight-e._settings.pinImageWidth,r.top=r.top+a.height-e._settings.buttonMarginBottom-e._settings.pinImageHeight;break;case t.ButtonPosition.Middle:r.left=Math.round(r.left+a.width/2-e._settings.pinImageWidth/2),r.top=Math.round(r.top+a.height/2-e._settings.pinImageHeight/2)}n.after(s),s.show().offset({left:r.left,top:r.top})}n.addClass("pinit-hover")}),i(document).delegate("img[data-jpibfi-indexer]","mouseleave",function(){var e=i(this).data("jpibfi-indexer"),n=i('a.pinit-button[data-jpibfi-indexer="'+e+'"]');t.Utils.startHide(n)})},e}();!function(){i(document).ready(function(){var t=new e(jpibfi_options);t.init()})}()}(jpibfi||(jpibfi={}));
js/jpibfi.js ADDED
@@ -0,0 +1,274 @@
1
+ var jpibfi;
2
+ (function (jpibfi) {
3
+ (function (ButtonPosition) {
4
+ ButtonPosition[ButtonPosition["TopLeft"] = 0] = "TopLeft";
5
+ ButtonPosition[ButtonPosition["TopRight"] = 1] = "TopRight";
6
+ ButtonPosition[ButtonPosition["BottomLeft"] = 2] = "BottomLeft";
7
+ ButtonPosition[ButtonPosition["BottomRight"] = 3] = "BottomRight";
8
+ ButtonPosition[ButtonPosition["Middle"] = 4] = "Middle";
9
+ })(jpibfi.ButtonPosition || (jpibfi.ButtonPosition = {}));
10
+ var ButtonPosition = jpibfi.ButtonPosition;
11
+ })(jpibfi || (jpibfi = {}));
12
+ var jpibfi;
13
+ (function (jpibfi) {
14
+ var $ = jQuery;
15
+ var PinButtonGenerator = (function () {
16
+ function PinButtonGenerator(settings, logger) {
17
+ this._settings = settings;
18
+ this._logger = logger;
19
+ }
20
+ PinButtonGenerator.prototype.getImageUrl = function ($elem) {
21
+ return ($.fn.prop && $elem.prop('src')) || $elem.attr('src');
22
+ };
23
+ PinButtonGenerator.prototype.generate = function (indexer) {
24
+ var $anchor = jQuery('<a/>', {
25
+ href: '#',
26
+ "class": 'pinit-button',
27
+ "data-jpibfi-indexer": indexer,
28
+ text: ""
29
+ });
30
+ var that = this;
31
+ $anchor.click(function () {
32
+ that._logger.logString('Pin In button clicked');
33
+ var index = $(this).data("jpibfi-indexer");
34
+ var $image = $('img[data-jpibfi-indexer="' + index + '"]');
35
+ //Bookmark description is created on click because sometimes it's lazy loaded
36
+ var bookmarkDescription = "", descriptionForUrl = "", bookmarkUrl = "";
37
+ //if usePostUrl feature is active, we need to get the data
38
+ if (that._settings.usePostUrl) {
39
+ var $inputWithData = $image.closest(".jpibfi_container").find("input.jpibfi").first();
40
+ if ($inputWithData.length) {
41
+ descriptionForUrl = $inputWithData.data("jpibfi-description");
42
+ bookmarkUrl = $inputWithData.data("jpibfi-url");
43
+ }
44
+ }
45
+ bookmarkUrl = bookmarkUrl || that._settings.pageUrl;
46
+ if (that._settings.descriptionOption == 3)
47
+ bookmarkDescription = $image.attr('title') || $image.attr('alt');
48
+ else if (that._settings.descriptionOption == 2)
49
+ bookmarkDescription = descriptionForUrl || that._settings.pageDescription;
50
+ else if (that._settings.descriptionOption == 4)
51
+ bookmarkDescription = that._settings.siteTitle;
52
+ else if (that._settings.descriptionOption == 5)
53
+ bookmarkDescription = $image.data('jpibfi-description');
54
+ else if (that._settings.descriptionOption == 6)
55
+ bookmarkDescription = $image.attr('alt');
56
+ bookmarkDescription = bookmarkDescription || (descriptionForUrl || that._settings.pageTitle);
57
+ var imageUrl = 'http://pinterest.com/pin/create/bookmarklet/?is_video=' + encodeURIComponent('false')
58
+ + "&url=" + encodeURIComponent(bookmarkUrl) + "&media=" + encodeURIComponent(that.getImageUrl($image))
59
+ + '&description=' + encodeURIComponent(bookmarkDescription);
60
+ window.open(imageUrl, 'Pinterest', 'width=632,height=253,status=0,toolbar=0,menubar=0,location=1,scrollbars=1');
61
+ return false;
62
+ });
63
+ $anchor.mouseenter(function () {
64
+ var $button = $(this);
65
+ clearTimeout($button.data('jpibfi-timeoutId'));
66
+ });
67
+ $anchor.mouseleave(function () {
68
+ var $button = $(this);
69
+ jpibfi.Utils.startHide($button);
70
+ });
71
+ return $anchor;
72
+ };
73
+ return PinButtonGenerator;
74
+ })();
75
+ jpibfi.PinButtonGenerator = PinButtonGenerator;
76
+ })(jpibfi || (jpibfi = {}));
77
+ var jpibfi;
78
+ (function (jpibfi) {
79
+ var Logger = (function () {
80
+ function Logger(printLog) {
81
+ this._printLog = printLog && typeof console !== 'undefined' && typeof console.log !== 'undefined';
82
+ this._jsonStringifyExists = typeof JSON !== 'undefined' && typeof JSON.stringify === 'function';
83
+ }
84
+ Logger.prototype._logObject = function (obj) {
85
+ var out = '';
86
+ for (var p in obj)
87
+ out += p + ': ' + obj[p] + '\n';
88
+ console.log('jpibfi debug: ' + out);
89
+ };
90
+ Logger.prototype.logString = function (message) {
91
+ if (!this._printLog)
92
+ return;
93
+ console.log('jpibfi debug: ' + message);
94
+ };
95
+ Logger.prototype.logObject = function (obj) {
96
+ if (!this._printLog)
97
+ return;
98
+ if (this._jsonStringifyExists)
99
+ console.log('jpibfi debugz: ' + JSON.stringify(obj, null, 4));
100
+ else
101
+ this._logObject(obj);
102
+ };
103
+ return Logger;
104
+ })();
105
+ jpibfi.Logger = Logger;
106
+ })(jpibfi || (jpibfi = {}));
107
+ var jpibfi;
108
+ (function (jpibfi) {
109
+ var Settings = (function () {
110
+ function Settings(settings) {
111
+ this.filterSelector = '*';
112
+ this.notSelector = '';
113
+ this.buttonMarginTop = parseInt(settings.buttonMarginTop);
114
+ this.buttonMarginRight = parseInt(settings.buttonMarginRight);
115
+ this.buttonMarginBottom = parseInt(settings.buttonMarginBottom);
116
+ this.buttonMarginLeft = parseInt(settings.buttonMarginLeft);
117
+ this.buttonPosition = settings.hasOwnProperty('buttonPosition') ? parseInt(settings.buttonPosition) : 4;
118
+ this.debug = settings.hasOwnProperty('debug') ? settings.debug == '1' : false;
119
+ this.descriptionOption = settings.hasOwnProperty('descriptionOption') ? parseInt(settings.descriptionOption) : 1;
120
+ this.imageSelector = settings.imageSelector;
121
+ this.minImageWidth = settings.hasOwnProperty('minImageWidth') ? parseInt(settings.minImageWidth) : 0;
122
+ this.minImageHeight = settings.hasOwnProperty('minImageHeight') ? parseInt(settings.minImageHeight) : 0;
123
+ this.pageDescription = settings.pageDescription;
124
+ this.pageTitle = settings.pageTitle;
125
+ this.pageUrl = settings.pageUrl;
126
+ this.pinImageHeight = parseInt(settings.pinImageHeight);
127
+ this.pinImageWidth = parseInt(settings.pinImageWidth);
128
+ this.retinaFriendly = settings.hasOwnProperty('retinaFriendly') ? settings.retinaFriendly == 1 : false;
129
+ this.siteTitle = settings.siteTitle;
130
+ this.usePostUrl = settings.hasOwnProperty('usePostUrl') ? settings.usePostUrl : true;
131
+ /* SELECTORS*/
132
+ this.containerSelector = settings.containerSelector;
133
+ this.notSelector = settings.hasOwnProperty('disabledClasses') ? jpibfi.Utils.createSelectorFromList(settings.disabledClasses) : '';
134
+ this.filterSelector = settings.hasOwnProperty('enabledClasses') ? jpibfi.Utils.createSelectorFromList(settings.enabledClasses) || "*" : '*';
135
+ this.adjustPinImageSize();
136
+ }
137
+ Settings.prototype.adjustPinImageSize = function () {
138
+ if (this.retinaFriendly) {
139
+ this.pinImageHeight = Math.ceil(this.pinImageHeight / 2);
140
+ this.pinImageWidth = Math.ceil(this.pinImageWidth / 2);
141
+ }
142
+ };
143
+ return Settings;
144
+ })();
145
+ jpibfi.Settings = Settings;
146
+ })(jpibfi || (jpibfi = {}));
147
+ var jpibfi;
148
+ (function (jpibfi) {
149
+ var $ = jQuery;
150
+ var Utils = (function () {
151
+ function Utils() {
152
+ }
153
+ Utils.createSelectorFromList = function (classes) {
154
+ var arrayOfClasses = classes.split(';');
155
+ var selector = "";
156
+ for (var i = 0; i < arrayOfClasses.length; i++) {
157
+ if (arrayOfClasses[i])
158
+ selector += '.' + arrayOfClasses[i] + ',';
159
+ }
160
+ return selector ? selector.substr(0, selector.length - 1) : selector;
161
+ };
162
+ Utils.startHide = function ($button) {
163
+ var timeoutId = setTimeout(function () {
164
+ $button.remove();
165
+ $('img[data-jpibfi-indexer="' + $button.data('jpibfi-indexer') + '"]').removeClass('pinit-hover');
166
+ }, 100);
167
+ $button.data('jpibfi-timeoutId', timeoutId);
168
+ };
169
+ return Utils;
170
+ })();
171
+ jpibfi.Utils = Utils;
172
+ })(jpibfi || (jpibfi = {}));
173
+ var jpibfi;
174
+ (function (jpibfi) {
175
+ "use strict";
176
+ var $ = jQuery;
177
+ var Plugin = (function () {
178
+ function Plugin(options) {
179
+ this._indexer = 0;
180
+ this._settings = new jpibfi.Settings($.extend({
181
+ pageUrl: document.URL,
182
+ pageTitle: document.title,
183
+ pageDescription: $('meta[name="description"]').attr('content') || "",
184
+ }, options));
185
+ this._logger = new jpibfi.Logger(this._settings.debug);
186
+ this._buttonGenerator = new jpibfi.PinButtonGenerator(this._settings, this._logger);
187
+ this._logger.logObject(this._settings);
188
+ }
189
+ Plugin.prototype.addImages = function () {
190
+ this._logger.logString('>>addImages');
191
+ var $elements = $(this._settings.imageSelector)
192
+ .not(this._settings.notSelector)
193
+ .not('[data-jpibfi-indexer]')
194
+ .filter(this._settings.filterSelector);
195
+ var that = this;
196
+ $elements.each(function () { $(this).attr('data-jpibfi-indexer', that._indexer++); });
197
+ this._logger.logString('Images caught by selectors: ' + this._indexer);
198
+ };
199
+ ;
200
+ Plugin.prototype.init = function () {
201
+ var $containers = $('.jpibfi').closest(this._settings.containerSelector).addClass('jpibfi_container');
202
+ this._logger.logString('Number of containers added: ' + $containers.length);
203
+ this.initImageDelegates();
204
+ $(document).trigger('jpibfi_beforeAddImages', {});
205
+ this.addImages();
206
+ $(document).trigger('jpibfi_afterAddImages', {});
207
+ };
208
+ Plugin.prototype.initImageDelegates = function () {
209
+ var that = this;
210
+ $(document).delegate('img[data-jpibfi-indexer]', 'mouseenter', function () {
211
+ var $image = $(this);
212
+ if ($image[0].clientWidth < that._settings.minImageWidth || $image[0].clientHeight < that._settings.minImageHeight) {
213
+ $image.removeAttr('data-jpibfi-indexer');
214
+ return;
215
+ }
216
+ var indexer = $image.data('jpibfi-indexer');
217
+ var $button = $('a.pinit-button[data-jpibfi-indexer="' + indexer + '"]');
218
+ //button doesn't exist so we need to create it
219
+ if ($button.length == 1) {
220
+ //button exists, we need to clear the timeout that has to remove it
221
+ clearTimeout($button.data('jpibfi-timeoutId'));
222
+ }
223
+ else {
224
+ $button = that._buttonGenerator.generate(indexer);
225
+ var position = $image.offset();
226
+ var imageDimensions = {
227
+ width: $image.get(0).clientWidth,
228
+ height: $image.get(0).clientHeight
229
+ };
230
+ switch (that._settings.buttonPosition) {
231
+ case jpibfi.ButtonPosition.TopLeft:
232
+ position.left += that._settings.buttonMarginLeft;
233
+ position.top += that._settings.buttonMarginTop;
234
+ break;
235
+ case jpibfi.ButtonPosition.TopRight:
236
+ position.top += that._settings.buttonMarginTop;
237
+ position.left = position.left + imageDimensions.width - that._settings.buttonMarginRight - that._settings.pinImageWidth;
238
+ break;
239
+ case jpibfi.ButtonPosition.BottomLeft:
240
+ position.left += that._settings.buttonMarginLeft;
241
+ position.top = position.top + imageDimensions.height - that._settings.buttonMarginBottom - that._settings.pinImageHeight;
242
+ break;
243
+ case jpibfi.ButtonPosition.BottomRight:
244
+ position.left = position.left + imageDimensions.width - that._settings.buttonMarginRight - that._settings.pinImageWidth;
245
+ position.top = position.top + imageDimensions.height - that._settings.buttonMarginBottom - that._settings.pinImageHeight;
246
+ break;
247
+ case jpibfi.ButtonPosition.Middle:
248
+ position.left = Math.round(position.left + imageDimensions.width / 2 - that._settings.pinImageWidth / 2);
249
+ position.top = Math.round(position.top + imageDimensions.height / 2 - that._settings.pinImageHeight / 2);
250
+ break;
251
+ }
252
+ $image.after($button);
253
+ $button
254
+ .show()
255
+ .offset({ left: position.left, top: position.top });
256
+ }
257
+ $image.addClass('pinit-hover');
258
+ });
259
+ $(document).delegate('img[data-jpibfi-indexer]', 'mouseleave', function () {
260
+ var indexer = $(this).data("jpibfi-indexer");
261
+ var $button = $('a.pinit-button[data-jpibfi-indexer="' + indexer + '"]');
262
+ jpibfi.Utils.startHide($button);
263
+ });
264
+ };
265
+ return Plugin;
266
+ })();
267
+ (function () {
268
+ "use strict";
269
+