Stream - Version 3.7.0

Version Description

  • May 11, 2021 =

  • Fix: Exclude records when all conditions match instead of just one #1242, props @kidunot89 and @esausaravia

  • Fix: Store the correct blog ID on the network admin exclude screen #1259, props @dd32

  • Fix: Ensure all blogs on the network are listed instead of just the top 100 #1258, props @dd32

  • Fix: Add highlight color in list table #1246, props @ocean90

  • Fix: Settings page defaults repatched #1236, props @kidunot89

  • Development: Added unit tests for BuddyPress #1211, WooCommerce #1199, Media #1154, Jetpack #1153, Gravity Forms #1139 abd bbPress connector classes #1120, props @kidunot89

Download this release

Release Info

Developer kasparsd
Plugin Icon 128x128 Stream
Version 3.7.0
Comparing to
See all releases

Code changes from version 3.6.2 to 3.7.0

alerts/class-alert-type-highlight.php CHANGED
@@ -217,8 +217,10 @@ class Alert_Type_Highlight extends Alert_Type {
217
  * @return array New list of classes.
218
  */
219
  public function post_class( $classes, $record ) {
220
- if ( ! empty( $record->meta['wp_stream_alerts_triggered']['highlight']['highlight_color'] ) ) {
221
- $color = $record->meta['wp_stream_alerts_triggered']['highlight']['highlight_color'];
 
 
222
  }
223
 
224
  if ( empty( $color ) || ! is_string( $color ) ) {
217
  * @return array New list of classes.
218
  */
219
  public function post_class( $classes, $record ) {
220
+ $record = new Record( $record );
221
+ $alerts_triggered = $record->get_meta( Alerts::ALERTS_TRIGGERED_META_KEY, true );
222
+ if ( ! empty( $alerts_triggered[ $this->slug ]['highlight_color'] ) ) {
223
+ $color = $alerts_triggered[ $this->slug ]['highlight_color'];
224
  }
225
 
226
  if ( empty( $color ) || ! is_string( $color ) ) {
alerts/js/alert-type-highlight.min.js CHANGED
@@ -1 +1 @@
1
- var streamAlertTypeHighlight=function(n){var a={ajaxUrl:"",removeAction:"",security:""};return"undefined"!=typeof _streamAlertTypeHighlightExports&&n.extend(a,_streamAlertTypeHighlightExports),a.init=function(){n(document).ready(function(){n('.alert-highlight .action-link[href="#"]').each(function(){var i=n(this);i.click(function(t){var e,r;t.preventDefault(),e=(e=i.parents(".alert-highlight").attr("class").match(/record\-id\-[\w-]*\b/))[0].replace("record-id-",""),r={action:a.removeAction,security:a.security,recordId:e},n.post(a.ajaxUrl,r,function(t){!0===t.success&&function(){var t=i.parents(".alert-highlight"),e=n(".striped > tbody > :nth-child( odd )");t.is(e)?t.animate({backgroundColor:"#f9f9f9"},300,function(){t.removeClass("alert-highlight")}):t.animate({backgroundColor:""},300,function(){t.removeClass("alert-highlight")});i.remove()}()})})})})},a}(jQuery);
1
+ var streamAlertTypeHighlight=function(i){var e={ajaxUrl:"",removeAction:"",security:""};return"undefined"!=typeof _streamAlertTypeHighlightExports&&i.extend(e,_streamAlertTypeHighlightExports),e.init=function(){i(document).ready(function(){i('.alert-highlight .action-link[href="#"]').each(function(){var r=i(this);r.click(function(t){t.preventDefault(),t=(t=r.parents(".alert-highlight").attr("class").match(/record\-id\-[\w-]*\b/))[0].replace("record-id-",""),t={action:e.removeAction,security:e.security,recordId:t},i.post(e.ajaxUrl,t,function(t){!0===t.success&&function(){var t=r.parents(".alert-highlight"),e=i(".striped > tbody > :nth-child( odd )");t.is(e)?t.animate({backgroundColor:"#f9f9f9"},300,function(){t.removeClass("alert-highlight")}):t.animate({backgroundColor:""},300,function(){t.removeClass("alert-highlight")});r.remove()}()})})})})},e}(jQuery);
classes/class-alerts-list.php CHANGED
@@ -56,7 +56,7 @@ class Alerts_List {
56
  * @return array
57
  */
58
  public function parse_request( $query_vars ) {
59
- $screen = get_current_screen();
60
  if ( 'edit-wp_stream_alerts' === $screen->id && Alerts::POST_TYPE === $query_vars['post_type'] && empty( $query_vars['post_status'] ) ) {
61
  $query_vars['post_status'] = array( 'wp_stream_enabled', 'wp_stream_disabled' );
62
  }
56
  * @return array
57
  */
58
  public function parse_request( $query_vars ) {
59
+ $screen = \get_current_screen();
60
  if ( 'edit-wp_stream_alerts' === $screen->id && Alerts::POST_TYPE === $query_vars['post_type'] && empty( $query_vars['post_status'] ) ) {
61
  $query_vars['post_status'] = array( 'wp_stream_enabled', 'wp_stream_disabled' );
62
  }
classes/class-log.php CHANGED
@@ -242,8 +242,10 @@ class Log {
242
  * @return boolean
243
  */
244
  public function record_matches_rules( $record, $exclude_rules ) {
 
 
245
  foreach ( $exclude_rules as $exclude_key => $exclude_value ) {
246
- if ( ! isset( $record[ $exclude_key ] ) ) {
247
  continue;
248
  }
249
 
@@ -251,14 +253,14 @@ class Log {
251
  $ip_addresses = explode( ',', $exclude_value );
252
 
253
  if ( in_array( $record['ip_address'], $ip_addresses, true ) ) {
254
- return true;
255
  }
256
  } elseif ( $record[ $exclude_key ] === $exclude_value ) {
257
- return true;
258
  }
259
  }
260
 
261
- return false;
262
  }
263
 
264
  /**
242
  * @return boolean
243
  */
244
  public function record_matches_rules( $record, $exclude_rules ) {
245
+ $matches_needed = count( $exclude_rules );
246
+ $matches_found = 0;
247
  foreach ( $exclude_rules as $exclude_key => $exclude_value ) {
248
+ if ( ! isset( $record[ $exclude_key ] ) || is_null( $exclude_value ) ) {
249
  continue;
250
  }
251
 
253
  $ip_addresses = explode( ',', $exclude_value );
254
 
255
  if ( in_array( $record['ip_address'], $ip_addresses, true ) ) {
256
+ $matches_found++;
257
  }
258
  } elseif ( $record[ $exclude_key ] === $exclude_value ) {
259
+ $matches_found++;
260
  }
261
  }
262
 
263
+ return $matches_found === $matches_needed;
264
  }
265
 
266
  /**
classes/class-plugin.php CHANGED
@@ -18,7 +18,7 @@ class Plugin {
18
  *
19
  * @const string
20
  */
21
- const VERSION = '3.6.2';
22
 
23
  /**
24
  * WP-CLI command
18
  *
19
  * @const string
20
  */
21
+ const VERSION = '3.7.0';
22
 
23
  /**
24
  * WP-CLI command
composer.json CHANGED
@@ -24,6 +24,7 @@
24
  "wp-phpunit/wp-phpunit": "^5.4",
25
  "wpackagist-plugin/advanced-custom-fields": "5.8.12",
26
  "wpackagist-plugin/easy-digital-downloads": "^2.9.23",
 
27
  "wpackagist-plugin/user-switching": "^1.5.5",
28
  "wpsh/local": "^0.2.3"
29
  },
24
  "wp-phpunit/wp-phpunit": "^5.4",
25
  "wpackagist-plugin/advanced-custom-fields": "5.8.12",
26
  "wpackagist-plugin/easy-digital-downloads": "^2.9.23",
27
+ "wpackagist-plugin/jetpack": "^8.7",
28
  "wpackagist-plugin/user-switching": "^1.5.5",
29
  "wpsh/local": "^0.2.3"
30
  },
connectors/class-connector-jetpack.php CHANGED
@@ -318,11 +318,16 @@ class Connector_Jetpack extends Connector {
318
  'label' => esc_html__( 'Tiled Galleries', 'stream' ),
319
  'context' => 'tiled-gallery',
320
  ),
 
 
 
 
 
321
  );
322
  }
323
 
324
  /**
325
- * Track Jetpack log entries
326
  * Includes:
327
  * - Activation/Deactivation of modules
328
  * - Registration/Disconnection of blogs
@@ -374,11 +379,10 @@ class Connector_Jetpack extends Connector {
374
  $action = $method;
375
  $meta = compact( 'user_id', 'user_email', 'user_login' );
376
  $message = sprintf(
377
- /* translators: %1$s: a user display name, %2$s: a status, %3$s: the connection either "from" or "to" (e.g. "Jane Doe", "unlinked", "from") */
378
- __( '%1$s\'s account %2$s %3$s Jetpack', 'stream' ),
379
  $user->display_name,
380
- ( 'unlink' === $action ) ? esc_html__( 'unlinked', 'stream' ) : esc_html__( 'linked', 'stream' ),
381
- ( 'unlink' === $action ) ? esc_html__( 'from', 'stream' ) : esc_html__( 'to', 'stream' )
382
  );
383
  } elseif ( in_array( $method, array( 'register', 'disconnect', 'subsiteregister', 'subsitedisconnect' ), true ) ) {
384
  $context = 'blogs';
318
  'label' => esc_html__( 'Tiled Galleries', 'stream' ),
319
  'context' => 'tiled-gallery',
320
  ),
321
+ // Monitor.
322
+ 'monitor_receive_notification' => array(
323
+ 'label' => esc_html__( 'Monitor notifications', 'stream' ),
324
+ 'context' => 'monitor',
325
+ ),
326
  );
327
  }
328
 
329
  /**
330
+ * Tracks logs add to Jetpack logging.
331
  * Includes:
332
  * - Activation/Deactivation of modules
333
  * - Registration/Disconnection of blogs
379
  $action = $method;
380
  $meta = compact( 'user_id', 'user_email', 'user_login' );
381
  $message = sprintf(
382
+ /* translators: %1$s: a user display name, %2$s: a status and the connection either "from" or "to" (e.g. "Jane Doe", "unlinked from") */
383
+ __( '%1$s\'s account %2$s Jetpack', 'stream' ),
384
  $user->display_name,
385
+ ( 'unlink' === $action ) ? esc_html__( 'unlinked from', 'stream' ) : esc_html__( 'linked to', 'stream' )
 
386
  );
387
  } elseif ( in_array( $method, array( 'register', 'disconnect', 'subsiteregister', 'subsitedisconnect' ), true ) ) {
388
  $context = 'blogs';
connectors/class-connector-media.php CHANGED
@@ -151,7 +151,7 @@ class Connector_Media extends Connector {
151
  $url = $post->guid;
152
  $parent_id = $post->post_parent;
153
  $parent = get_post( $parent_id );
154
- $parent_title = $parent_id ? $parent->post_title : null;
155
  $attachment_type = $this->get_attachment_type( $post->guid );
156
 
157
  $this->log(
@@ -171,18 +171,14 @@ class Connector_Media extends Connector {
171
  * @param int $post_id Post ID.
172
  */
173
  public function callback_edit_attachment( $post_id ) {
174
- $post = get_post( $post_id );
175
- $name = $post->post_title;
176
- $attachment_type = $this->get_attachment_type( $post->guid );
177
-
178
- /* translators: %s: an attachment title (e.g. "PIC001") */
179
- $message = esc_html__( 'Updated "%s"', 'stream' );
180
 
181
  $this->log(
182
- $message,
183
- compact( 'name' ),
 
184
  $post_id,
185
- $attachment_type,
186
  'updated'
187
  );
188
  }
@@ -195,21 +191,17 @@ class Connector_Media extends Connector {
195
  * @param int $post_id Post ID.
196
  */
197
  public function callback_delete_attachment( $post_id ) {
198
- $post = get_post( $post_id );
199
- $parent = $post->post_parent ? get_post( $post->post_parent ) : null;
200
- $parent_id = $parent ? $parent->ID : null;
201
- $name = $post->post_title;
202
- $url = $post->guid;
203
- $attachment_type = $this->get_attachment_type( $post->guid );
204
-
205
- /* translators: %s: an attachment title (e.g. "PIC001") */
206
- $message = esc_html__( 'Deleted "%s"', 'stream' );
207
 
208
  $this->log(
209
- $message,
 
210
  compact( 'name', 'parent_id', 'url' ),
211
  $post_id,
212
- $attachment_type,
213
  'deleted'
214
  );
215
  }
@@ -233,14 +225,12 @@ class Connector_Media extends Connector {
233
  $name = basename( $filename );
234
  $post = get_post( $post_id );
235
 
236
- $attachment_type = $this->get_attachment_type( $post->guid );
237
-
238
  $this->log(
239
  /* translators: Placeholder refers to an attachment title (e.g. "PIC001") */
240
  __( 'Edited image "%s"', 'stream' ),
241
  compact( 'name', 'filename', 'post_id' ),
242
  $post_id,
243
- $attachment_type,
244
  'edited'
245
  );
246
  }
151
  $url = $post->guid;
152
  $parent_id = $post->post_parent;
153
  $parent = get_post( $parent_id );
154
+ $parent_title = $parent instanceof \WP_Post ? $parent->post_title : 'Unidentifiable post';
155
  $attachment_type = $this->get_attachment_type( $post->guid );
156
 
157
  $this->log(
171
  * @param int $post_id Post ID.
172
  */
173
  public function callback_edit_attachment( $post_id ) {
174
+ $post = get_post( $post_id );
 
 
 
 
 
175
 
176
  $this->log(
177
+ /* translators: %s: an attachment title (e.g. "PIC001") */
178
+ esc_html__( 'Updated "%s"', 'stream' ),
179
+ array( 'name' => $post->post_title ),
180
  $post_id,
181
+ $this->get_attachment_type( $post->guid ),
182
  'updated'
183
  );
184
  }
191
  * @param int $post_id Post ID.
192
  */
193
  public function callback_delete_attachment( $post_id ) {
194
+ $post = get_post( $post_id );
195
+ $parent_id = $post->post_parent ? $post->post_parent : null;
196
+ $name = $post->post_title;
197
+ $url = $post->guid;
 
 
 
 
 
198
 
199
  $this->log(
200
+ /* translators: %s: an attachment title (e.g. "PIC001") */
201
+ esc_html__( 'Deleted "%s"', 'stream' ),
202
  compact( 'name', 'parent_id', 'url' ),
203
  $post_id,
204
+ $this->get_attachment_type( $post->guid ),
205
  'deleted'
206
  );
207
  }
225
  $name = basename( $filename );
226
  $post = get_post( $post_id );
227
 
 
 
228
  $this->log(
229
  /* translators: Placeholder refers to an attachment title (e.g. "PIC001") */
230
  __( 'Edited image "%s"', 'stream' ),
231
  compact( 'name', 'filename', 'post_id' ),
232
  $post_id,
233
+ $this->get_attachment_type( $post->guid ),
234
  'edited'
235
  );
236
  }
includes/functions.php CHANGED
@@ -95,7 +95,14 @@ function wp_stream_json_encode( $data, $options = 0, $depth = 512 ) {
95
  * @return array
96
  */
97
  function wp_stream_get_sites( $args = array() ) {
 
 
 
 
98
  if ( function_exists( 'get_sites' ) ) {
 
 
 
99
  $sites = get_sites( $args );
100
  } else {
101
  $sites = array();
95
  * @return array
96
  */
97
  function wp_stream_get_sites( $args = array() ) {
98
+ if ( empty( $args['limit'] ) ) {
99
+ $args['limit'] = 0;
100
+ }
101
+
102
  if ( function_exists( 'get_sites' ) ) {
103
+ // Account for get_sites() which uses 'number' while wp_get_sites() uses 'limit'.
104
+ $args['number'] = $args['limit'];
105
+
106
  $sites = get_sites( $args );
107
  } else {
108
  $sites = array();
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: xwp
3
  Tags: wp stream, stream, activity, logs, track
4
  Requires at least: 4.5
5
- Tested up to: 5.6
6
- Stable tag: 3.6.2
7
  License: GPLv2 or later
8
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -91,6 +91,15 @@ Past Contributors: fjarrett, shadyvb, chacha, westonruter, johnregan3, jacobschw
91
 
92
  == Changelog ==
93
 
 
 
 
 
 
 
 
 
 
94
  = 3.6.2 - January 12, 2020 =
95
 
96
  * Fix: revert [#1159](https://github.com/xwp/stream/pull/1159) which caused a PHP error in the previous release.
2
  Contributors: xwp
3
  Tags: wp stream, stream, activity, logs, track
4
  Requires at least: 4.5
5
+ Tested up to: 5.7
6
+ Stable tag: 3.7.0
7
  License: GPLv2 or later
8
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
9
 
91
 
92
  == Changelog ==
93
 
94
+ = 3.7.0 - May 11, 2021 =
95
+
96
+ - Fix: Exclude records when all conditions match instead of just one [#1242](https://github.com/xwp/stream/pull/1242), props [@kidunot89](https://github.com/kidunot89) and [@esausaravia](https://github.com/esausaravia)
97
+ - Fix: Store the correct blog ID on the network admin exclude screen [#1259](https://github.com/xwp/stream/pull/1259), props [@dd32](https://github.com/dd32)
98
+ - Fix: Ensure all blogs on the network are listed instead of just the top 100 [#1258](https://github.com/xwp/stream/pull/1258), props [@dd32](https://github.com/dd32)
99
+ - Fix: Add highlight color in list table [#1246](https://github.com/xwp/stream/pull/1246), props [@ocean90](https://github.com/ocean90)
100
+ - Fix: Settings page defaults repatched [#1236](https://github.com/xwp/stream/pull/1236), props [@kidunot89](https://github.com/kidunot89)
101
+ - Development: Added unit tests for BuddyPress [#1211](https://github.com/xwp/stream/pull/1211), WooCommerce [#1199](https://github.com/xwp/stream/pull/1199), Media [#1154](https://github.com/xwp/stream/pull/1154), Jetpack [#1153](https://github.com/xwp/stream/pull/1153), Gravity Forms [#1139](https://github.com/xwp/stream/pull/1139) abd bbPress connector classes [#1120](https://github.com/xwp/stream/pull/1120), props [@kidunot89](https://github.com/kidunot89)
102
+
103
  = 3.6.2 - January 12, 2020 =
104
 
105
  * Fix: revert [#1159](https://github.com/xwp/stream/pull/1159) which caused a PHP error in the previous release.
stream.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Stream
4
  * Plugin URI: https://xwp.co/work/stream/
5
  * Description: Stream tracks logged-in user activity so you can monitor every change made on your WordPress site in beautifully organized detail. All activity is organized by context, action and IP address for easy filtering. Developers can extend Stream with custom connectors to log any kind of action.
6
- * Version: 3.6.2
7
  * Author: XWP
8
  * Author URI: https://xwp.co
9
  * License: GPLv2+
3
  * Plugin Name: Stream
4
  * Plugin URI: https://xwp.co/work/stream/
5
  * Description: Stream tracks logged-in user activity so you can monitor every change made on your WordPress site in beautifully organized detail. All activity is organized by context, action and IP address for easy filtering. Developers can extend Stream with custom connectors to log any kind of action.
6
+ * Version: 3.7.0
7
  * Author: XWP
8
  * Author URI: https://xwp.co
9
  * License: GPLv2+
ui/js/admin.min.js CHANGED
@@ -1 +1 @@
1
- jQuery(function(m){"en"===wp_stream.locale&&void 0!==m.timeago&&(m.timeago.settings.strings.seconds="seconds",m.timeago.settings.strings.minute="a minute",m.timeago.settings.strings.hour="an hour",m.timeago.settings.strings.hours="%d hours",m.timeago.settings.strings.month="a month",m.timeago.settings.strings.year="a year"),m("li.toplevel_page_wp_stream ul li.wp-first-item.current").parent().parent().find(".update-plugins").remove(),m(".toplevel_page_wp_stream :input.chosen-select").each(function(e,t){function a(e){var t=m("<span>"),a=m(e.element),i="";return"- "===e.text.substring(0,2)&&(e.text=e.text.substring(2)),void 0!==e.id&&"string"==typeof e.id&&(0===e.id.indexOf("group-")?t.addClass("parent"):a.hasClass("level-2")&&t.addClass("child")),void 0!==e.icon?i=e.icon:void 0!==a&&""!==a.data("icon")&&(i=a.data("icon")),i&&t.html('<img src="'+i+'" class="wp-stream-select2-icon">'),t.append(e.text),t}function i(e){return"- "===e.text.substring(0,2)&&(e.text=e.text.substring(2)),e.text}var n={},n=0<m(t).find("option").not(":selected").not(":empty").length?{minimumResultsForSearch:10,templateResult:a,templateSelection:i,allowClear:!0,width:"165px"}:{minimumInputLength:3,allowClear:!0,width:"165px",ajax:{url:ajaxurl,delay:500,dataType:"json",quietMillis:100,data:function(e){return{action:"wp_stream_filters",nonce:m("#stream_filters_user_search_nonce").val(),filter:m(t).attr("name"),q:e.term}},processResults:function(e){var a=[];return m.each(e,function(e,t){a.push({id:t.id,text:t.label})}),{results:a}}},templateResult:a,templateSelection:i};m(t).select2(n)});var e=m.streamGetQueryVars(),t=m('.toplevel_page_wp_stream select.chosen-select[name="context"]');void 0!==e.context&&""!==e.context||void 0===e.connector||(t.val("group-"+e.connector),t.trigger("change")),m("input[type=submit]","#record-filter-form").click(function(){m("input[type=submit]",m(this).parents("form")).removeAttr("clicked"),m(this).attr("clicked","true")}),m("#record-filter-form").submit(function(){var e=m('.toplevel_page_wp_stream :input.chosen-select[name="context"]'),t=e.find("option:selected"),a=e.parent().find(".record-filter-connector"),i=t.data("group"),n=t.prop("class"),r=m(".recordactions select");"true"!==m("#record-actions-submit").attr("clicked")&&r.val(""),a.val(i),"level-1"===n&&t.val("")}),m(window).on("load",function(){m('.toplevel_page_wp_stream input[type="search"]').off("mousedown")}),m("body").on("click","#wp_stream_advanced_delete_all_records, #wp_stream_network_advanced_delete_all_records",function(e){window.confirm(wp_stream.i18n.confirm_purge)||e.preventDefault()}),m("body").on("click","#wp_stream_advanced_reset_site_settings, #wp_stream_network_advanced_reset_site_settings",function(e){window.confirm(wp_stream.i18n.confirm_defaults)||e.preventDefault()}),m("body").on("click","#wp_stream_uninstall",function(e){window.confirm(wp_stream.i18n.confirm_uninstall)||e.preventDefault()});var r=m(".wp_stream_screen .nav-tab-wrapper"),s=m(".wp_stream_screen .nav-tab-content table.form-table"),a=r.find(".nav-tab-active"),i=0<a.length?r.find("a").index(a):0,n=window.location.hash.match(/^#(\d+)$/),o=null!==n?n[1]:i;r.on("click","a",function(){var e,t,a,i=r.find("a").index(m(this)),n=window.location.hash.match(/^#(\d+)$/);return s.hide().eq(i).show(),r.find("a").removeClass("nav-tab-active").filter(m(this)).addClass("nav-tab-active"),""!==window.location.hash&&null===n||(window.location.hash=i),e=i,0!==(a=m('input[name="option_page"][value^="wp_stream"]').closest("form")).length&&(t=a.attr("action"),a.prop("action",t.replace(/(^[^#]*).*$/,"$1#"+e))),!1}),r.children().eq(o).trigger("click"),m(document).ready(function(){function t(){var e=!0;m('div.metabox-prefs [name="date-hide"]').is(":checked")&&(e=!1),m("div.alignleft.actions div.select2-container").each(function(){if(!m(this).is(":hidden"))return e=!1}),e?(m("input#record-query-submit").hide(),m("span.filter_info").show()):(m("input#record-query-submit").show(),m("span.filter_info").hide())}m("#enable_live_update").click(function(){var e,t=m("#stream_live_update_nonce").val(),a=m("#enable_live_update_user").val(),i="unchecked";m("#enable_live_update").is(":checked")&&(i="checked"),e=m("#enable_live_update").data("heartbeat"),m.ajax({type:"POST",url:ajaxurl,data:{action:"stream_enable_live_update",nonce:t,user:a,checked:i,heartbeat:e},dataType:"json",beforeSend:function(){m(".stream-live-update-checkbox .spinner").show().css({display:"inline-block"})},success:function(e){m(".stream-live-update-checkbox .spinner").hide(),!1===e.success&&(m("#enable_live_update").prop("checked",!1),e.data&&window.alert(e.data))}})}),m('div.metabox-prefs [name="date-hide"]').is(":checked")?m("div.date-interval").show():m("div.date-interval").hide(),m("div.actions select.chosen-select").each(function(){var e=m(this).prop("name");m('div.metabox-prefs [name="'+e+'-hide"]').is(":checked")?m(this).prev(".select2-container").show():m(this).prev(".select2-container").hide()}),t(),m('div.metabox-prefs [type="checkbox"]').click(function(){var e=m(this).prop("id");"date-hide"===e?m(this).is(":checked")?m("div.date-interval").show():m("div.date-interval").hide():(e=e.replace("-hide",""),m(this).is(":checked")?m('[name="'+e+'"]').prev(".select2-container").show():m('[name="'+e+'"]').prev(".select2-container").hide()),t()}),m("#ui-datepicker-div").addClass("stream-datepicker")}),m("table.wp-list-table").on("updated",function(){m(this).find("time.relative-time").each(function(e,t){var a=m(t);a.removeClass("relative-time"),m('<strong><time datetime="'+a.attr("datetime")+'" class="timeago"/></time></strong><br/>').prependTo(a.parent().parent()).find("time.timeago").timeago()})}).trigger("updated");var c={init:function(e){this.wrapper=e,this.save_interval(this.wrapper.find(".button-primary"),this.wrapper),this.$=this.wrapper.each(function(e,t){var a,i,n,r,s=m(t),o=s.find(".date-inputs"),c=s.find(".field-from"),d=s.find(".field-to"),l=d.prev(".date-remove"),p=c.prev(".date-remove"),u=s.children(".field-predefined"),h=m("").add(d).add(c);jQuery.datepicker&&(a=parseFloat(wp_stream.gmt_offset)-(new Date).getTimezoneOffset()/60*-1,i=new Date,n=new Date(i.getTime()+60*a*60*1e3),r=0,i.getDate()===n.getDate()&&i.getMonth()===n.getMonth()||(r=i.getTime()<n.getTime()?"+1d":"-1d"),h.datepicker({dateFormat:"yy/mm/dd",minDate:null,maxDate:r,defaultDate:n,beforeShow:function(){m(this).prop("disabled",!0)},onClose:function(){m(this).prop("disabled",!1)}}),h.datepicker("widget").addClass("stream-datepicker")),u.select2({allowClear:!0}),""!==c.val()&&p.show(),""!==d.val()&&l.show(),u.on({change:function(){var e=m(this).val(),t=u.find('[value="'+e+'"]'),a=t.data("to"),i=t.data("from");if("custom"===e)return o.show(),!1;o.hide(),h.datepicker("hide"),c.val(i).trigger("change",[!0]),d.val(a).trigger("change",[!0]),jQuery.datepicker&&h.datepicker("widget").is(":visible")&&h.datepicker("refresh").datepicker("hide")},"select2-removed":function(){u.val("").trigger("change")},check_options:function(){var e;""!==d.val()&&""!==c.val()?0!==(e=u.find("option").filter('[data-to="'+d.val()+'"]').filter('[data-from="'+c.val()+'"]')).length?u.val(e.attr("value")).trigger("change",[!0]):u.val("custom").trigger("change",[!0]):""===d.val()&&""===c.val()?u.val("").trigger("change",[!0]):u.val("custom").trigger("change",[!0])}}),c.on("change",function(){return""!==c.val()?(p.show(),d.datepicker("option","minDate",c.val())):p.hide(),!0!==arguments[arguments.length-1]&&void u.trigger("check_options")}),d.on("change",function(){return""!==d.val()?(l.show(),c.datepicker("option","maxDate",d.val())):l.hide(),!0!==arguments[arguments.length-1]&&void u.trigger("check_options")}),u.trigger("change"),m("").add(p).add(l).on("click",function(){m(this).next("input").val("").trigger("change")})})},save_interval:function(e){var t=this.wrapper;e.click(function(){var e={key:t.find("select.field-predefined").find(":selected").val(),start:t.find(".date-inputs .field-from").val(),end:t.find(".date-inputs .field-to").val()};m(this).attr("href",m(this).attr("href")+"&"+m.param(e))})}};m(document).ready(function(){c.init(m(".date-interval")),m('select[name="context"] .level-1').each(function(){var e=!0;m(this).nextUntil(".level-1").each(function(){if(m(this).is(":not(:disabled)"))return e=!1}),!0===e&&m(this).prop("disabled",!0)})})}),jQuery.extend({streamGetQueryVars:function(e){return(e||document.location.search).replace(/(^\?)/,"").split("&").map(function(e){return this[(e=e.split("="))[0]]=e[1],this}.bind({}))[0]}});
1
+ jQuery(function(p){"en"===wp_stream.locale&&void 0!==p.timeago&&(p.timeago.settings.strings.seconds="seconds",p.timeago.settings.strings.minute="a minute",p.timeago.settings.strings.hour="an hour",p.timeago.settings.strings.hours="%d hours",p.timeago.settings.strings.month="a month",p.timeago.settings.strings.year="a year"),p("li.toplevel_page_wp_stream ul li.wp-first-item.current").parent().parent().find(".update-plugins").remove(),p(".toplevel_page_wp_stream :input.chosen-select").each(function(e,t){function a(e){var t=p("<span>"),a=p(e.element),i="";return"- "===e.text.substring(0,2)&&(e.text=e.text.substring(2)),void 0!==e.id&&"string"==typeof e.id&&(0===e.id.indexOf("group-")?t.addClass("parent"):a.hasClass("level-2")&&t.addClass("child")),void 0!==e.icon?i=e.icon:void 0!==a&&""!==a.data("icon")&&(i=a.data("icon")),i&&t.html('<img src="'+i+'" class="wp-stream-select2-icon">'),t.append(e.text),t}function i(e){return"- "===e.text.substring(0,2)&&(e.text=e.text.substring(2)),e.text}var n={},n=0<p(t).find("option").not(":selected").not(":empty").length?{minimumResultsForSearch:10,templateResult:a,templateSelection:i,allowClear:!0,width:"165px"}:{minimumInputLength:3,allowClear:!0,width:"165px",ajax:{url:ajaxurl,delay:500,dataType:"json",quietMillis:100,data:function(e){return{action:"wp_stream_filters",nonce:p("#stream_filters_user_search_nonce").val(),filter:p(t).attr("name"),q:e.term}},processResults:function(e){var a=[];return p.each(e,function(e,t){a.push({id:t.id,text:t.label})}),{results:a}}},templateResult:a,templateSelection:i};p(t).select2(n)});var e=p.streamGetQueryVars(),t=p('.toplevel_page_wp_stream select.chosen-select[name="context"]');void 0!==e.context&&""!==e.context||void 0===e.connector||(t.val("group-"+e.connector),t.trigger("change")),p("input[type=submit]","#record-filter-form").click(function(){p("input[type=submit]",p(this).parents("form")).removeAttr("clicked"),p(this).attr("clicked","true")}),p("#record-filter-form").submit(function(){var e=p('.toplevel_page_wp_stream :input.chosen-select[name="context"]'),t=e.find("option:selected"),a=e.parent().find(".record-filter-connector"),i=t.data("group"),n=t.prop("class"),e=p(".recordactions select");"true"!==p("#record-actions-submit").attr("clicked")&&e.val(""),a.val(i),"level-1"===n&&t.val("")}),p(window).on("load",function(){p('.toplevel_page_wp_stream input[type="search"]').off("mousedown")}),p("body").on("click","#wp_stream_advanced_delete_all_records, #wp_stream_network_advanced_delete_all_records",function(e){window.confirm(wp_stream.i18n.confirm_purge)||e.preventDefault()}),p("body").on("click","#wp_stream_advanced_reset_site_settings, #wp_stream_network_advanced_reset_site_settings",function(e){window.confirm(wp_stream.i18n.confirm_defaults)||e.preventDefault()}),p("body").on("click","#wp_stream_uninstall",function(e){window.confirm(wp_stream.i18n.confirm_uninstall)||e.preventDefault()});var i=p(".wp_stream_screen .nav-tab-wrapper"),n=p(".wp_stream_screen .nav-tab-content table.form-table"),e=i.find(".nav-tab-active"),t=0<e.length?i.find("a").index(e):0,e=window.location.hash.match(/^#(\d+)$/),t=null!==e?e[1]:t;i.on("click","a",function(){var e,t=i.find("a").index(p(this)),a=window.location.hash.match(/^#(\d+)$/);return n.hide().eq(t).show(),i.find("a").removeClass("nav-tab-active").filter(p(this)).addClass("nav-tab-active"),""!==window.location.hash&&null===a||(window.location.hash=t),e=t,0!==(a=p('input[name="option_page"][value^="wp_stream"]').closest("form")).length&&(t=a.attr("action"),a.prop("action",t.replace(/(^[^#]*).*$/,"$1#"+e))),!1}),i.children().eq(t).trigger("click"),p(document).ready(function(){function t(){var e=!0;p('div.metabox-prefs [name="date-hide"]').is(":checked")&&(e=!1),p("div.alignleft.actions div.select2-container").each(function(){if(!p(this).is(":hidden"))return e=!1}),e?(p("input#record-query-submit").hide(),p("span.filter_info").show()):(p("input#record-query-submit").show(),p("span.filter_info").hide())}p("#enable_live_update").click(function(){var e,t=p("#stream_live_update_nonce").val(),a=p("#enable_live_update_user").val(),i="unchecked";p("#enable_live_update").is(":checked")&&(i="checked"),e=p("#enable_live_update").data("heartbeat"),p.ajax({type:"POST",url:ajaxurl,data:{action:"stream_enable_live_update",nonce:t,user:a,checked:i,heartbeat:e},dataType:"json",beforeSend:function(){p(".stream-live-update-checkbox .spinner").show().css({display:"inline-block"})},success:function(e){p(".stream-live-update-checkbox .spinner").hide(),!1===e.success&&(p("#enable_live_update").prop("checked",!1),e.data&&window.alert(e.data))}})}),p('div.metabox-prefs [name="date-hide"]').is(":checked")?p("div.date-interval").show():p("div.date-interval").hide(),p("div.actions select.chosen-select").each(function(){var e=p(this).prop("name");p('div.metabox-prefs [name="'+e+'-hide"]').is(":checked")?p(this).prev(".select2-container").show():p(this).prev(".select2-container").hide()}),t(),p('div.metabox-prefs [type="checkbox"]').click(function(){var e=p(this).prop("id");"date-hide"===e?p(this).is(":checked")?p("div.date-interval").show():p("div.date-interval").hide():(e=e.replace("-hide",""),p(this).is(":checked")?p('[name="'+e+'"]').prev(".select2-container").show():p('[name="'+e+'"]').prev(".select2-container").hide()),t()}),p("#ui-datepicker-div").addClass("stream-datepicker")}),p("table.wp-list-table").on("updated",function(){p(this).find("time.relative-time").each(function(e,t){t=p(t);t.removeClass("relative-time"),p('<strong><time datetime="'+t.attr("datetime")+'" class="timeago"/></time></strong><br/>').prependTo(t.parent().parent()).find("time.timeago").timeago()})}).trigger("updated");var a={init:function(e){this.wrapper=e,this.save_interval(this.wrapper.find(".button-primary"),this.wrapper),this.$=this.wrapper.each(function(e,t){var a,i=p(t),n=i.find(".date-inputs"),r=i.find(".field-from"),s=i.find(".field-to"),o=s.prev(".date-remove"),c=r.prev(".date-remove"),d=i.children(".field-predefined"),l=p("").add(s).add(r);jQuery.datepicker&&(a=parseFloat(wp_stream.gmt_offset)-(new Date).getTimezoneOffset()/60*-1,t=new Date,i=new Date(t.getTime()+60*a*60*1e3),a=0,t.getDate()===i.getDate()&&t.getMonth()===i.getMonth()||(a=t.getTime()<i.getTime()?"+1d":"-1d"),l.datepicker({dateFormat:"yy/mm/dd",minDate:null,maxDate:a,defaultDate:i,beforeShow:function(){p(this).prop("disabled",!0)},onClose:function(){p(this).prop("disabled",!1)}}),l.datepicker("widget").addClass("stream-datepicker")),d.select2({allowClear:!0}),""!==r.val()&&c.show(),""!==s.val()&&o.show(),d.on({change:function(){var e=p(this).val(),t=d.find('[value="'+e+'"]'),a=t.data("to"),t=t.data("from");if("custom"===e)return n.show(),!1;n.hide(),l.datepicker("hide"),r.val(t).trigger("change",[!0]),s.val(a).trigger("change",[!0]),jQuery.datepicker&&l.datepicker("widget").is(":visible")&&l.datepicker("refresh").datepicker("hide")},"select2-removed":function(){d.val("").trigger("change")},check_options:function(){var e;(""!==s.val()&&""!==r.val()?0!==(e=d.find("option").filter('[data-to="'+s.val()+'"]').filter('[data-from="'+r.val()+'"]')).length?d.val(e.attr("value")):d.val("custom"):""===s.val()&&""===r.val()?d.val(""):d.val("custom")).trigger("change",[!0])}}),r.on("change",function(){return""!==r.val()?(c.show(),s.datepicker("option","minDate",r.val())):c.hide(),!0!==arguments[arguments.length-1]&&void d.trigger("check_options")}),s.on("change",function(){return""!==s.val()?(o.show(),r.datepicker("option","maxDate",s.val())):o.hide(),!0!==arguments[arguments.length-1]&&void d.trigger("check_options")}),d.trigger("change"),p("").add(c).add(o).on("click",function(){p(this).next("input").val("").trigger("change")})})},save_interval:function(e){var t=this.wrapper;e.click(function(){var e={key:t.find("select.field-predefined").find(":selected").val(),start:t.find(".date-inputs .field-from").val(),end:t.find(".date-inputs .field-to").val()};p(this).attr("href",p(this).attr("href")+"&"+p.param(e))})}};p(document).ready(function(){a.init(p(".date-interval")),p('select[name="context"] .level-1').each(function(){var e=!0;p(this).nextUntil(".level-1").each(function(){if(p(this).is(":not(:disabled)"))return e=!1}),!0===e&&p(this).prop("disabled",!0)})})}),jQuery.extend({streamGetQueryVars:function(e){return(e||document.location.search).replace(/(^\?)/,"").split("&").map(function(e){return this[(e=e.split("="))[0]]=e[1],this}.bind({}))[0]}});
ui/js/alerts.min.js CHANGED
@@ -1 +1 @@
1
- jQuery(function(o){"use strict";function c(t){var e=o(t);e.find(".select2-select.connector_or_context").each(function(t,e){o(e).select2({allowClear:!0,placeholder:streamAlerts.anyContext,templateResult:function(t){return void 0===t.id?t.text:-1===t.id.indexOf("-")?o('<span class="parent">'+t.text+"</span>"):o('<span class="child">'+t.text+"</span>")},matcher:function(t,e){var n=o.extend(!0,{},e);if(null===t.term||""===o.trim(t.term))return n;var a=t.term.toLowerCase();if(n.id=n.id.replace("blogs","sites"),0<=n.id.toLowerCase().indexOf(a))return n;if(n.children){for(var i=n.children.length-1;0<=i;i--){-1===n.children[i].id.toLowerCase().indexOf(a)&&n.children.splice(i,1)}if(0<n.children.length)return n}return null}}).change(function(){var t,e=o(this).val();e&&(t=e.split("-"),o(this).siblings(".connector").val(t[0]),o(this).siblings(".context").val(t[1]))});var n=[o(e).siblings(".connector").val(),o(e).siblings(".context").val()];""===n[1]&&n.splice(1,1),o(e).val(n.join("-")).trigger("change")}),e.find("select.select2-select:not(.connector_or_context)").each(function(){var t=o(this).attr("id").split("_"),e=t[t.length-1].charAt(0).toUpperCase()+t[t.length-1].slice(1);o(this).select2({allowClear:!0,placeholder:streamAlerts.any+" "+e})})}function i(t){var e={action:"load_alerts_settings",alert_type:t},n=o("#wp_stream_alert_type").closest("tr").attr("id");e.post_id=n.split("-")[1],o.post(window.ajaxurl,e,function(t){var e=o("#wp_stream_alert_type_form");"none"!==o("#wp_stream_alert_type").val()?(e.html(t.data.html),e.show()):e.hide()})}var p,_,t=o("#wp_stream_alert_type");o("#the-list").on("change","#wp_stream_trigger_connector_or_context",function(){var t;"wp_stream_trigger_connector_or_context"===o(this).attr("id")&&((t=o(this).val())&&0<t.indexOf("-")&&(t=t.split("-")[0]),e(t))});var e=function(t){var s=o("#wp_stream_trigger_action");s.empty(),s.prop("disabled",!0);var e=o("<option/>",{value:"",text:""});s.append(e);var n={action:"get_actions",connector:t};o.post(window.ajaxurl,n,function(t){var e,n,a=t.success,i=t.data;if(a){for(var r in i){i.hasOwnProperty(r)&&(e=i[r],n=o("<option/>",{value:r,text:e}),s.append(n))}s.prop("disabled",!1),o(document).trigger("alert-actions-updated")}})};t.change(function(){i(o(this).val())}),o("#wpbody-content").on("click","a.page-title-action",function(t){t.preventDefault(),o("#add-new-alert").remove(),0<o(".inline-edit-wp_stream_alerts").length&&o(".inline-edit-wp_stream_alerts .inline-edit-save button.button-secondary.cancel").trigger("click");var a;o.post(window.ajaxurl,{action:"get_new_alert_triggers_notifications"},function(t){var e,n;!0===t.success&&(a=t.data.html,o("tbody#the-list").prepend('<tr id="add-new-alert" class="inline-edit-row inline-edit-row-page inline-edit-page quick-edit-row quick-edit-row-page inline-edit-page inline-editor" style=""><td colspan="4" class="colspanchange">'+a+'<p class="submit inline-edit-save"> <button type="button" class="button-secondary cancel alignleft">Cancel</button> <input type="hidden" id="_inline_edit" name="_inline_edit" value="3550d271fe"> <button type="button" class="button-primary save alignright">Save</button> <span class="spinner"></span><span class="error" style="display:none"></span> <br class="clear"></p></td></tr>'),e=o("#add-new-alert"),n=e.css("background-color"),e.css("background-color","#C1E1B9"),setTimeout(function(){e.css("background-color",n)},250),o("#wp_stream_alert_type").change(function(){i(o(this).val())}),e.on("click",".button-secondary.cancel",function(){o("#add-new-alert").remove()}),e.on("click",".button-primary.save",r),c("#add-new-alert"))})});var n,a,r=function(t){t.preventDefault(),o("#add-new-alert").find("p.submit.inline-edit-save span.spinner").css("visibility","visible");var e={action:"save_new_alert",wp_stream_alerts_nonce:o("#wp_stream_alerts_nonce").val(),wp_stream_trigger_author:o("#wp_stream_trigger_author").val(),wp_stream_trigger_context:o("#wp_stream_trigger_connector_or_context").val(),wp_stream_trigger_action:o("#wp_stream_trigger_action").val(),wp_stream_alert_type:o("#wp_stream_alert_type").val(),wp_stream_alert_status:o("#wp_stream_alert_status").val()};o("#wp_stream_alert_type_form").find(":input").each(function(){var t=o(this).attr("id");o(this).val()&&(e[t]=o(this).val())}),o.post(window.ajaxurl,e,function(t){!0===t.success&&(o("#add-new-alert").find("p.submit.inline-edit-save span.spinner").css("visibility","hidden"),location.reload())})},d=inlineEditPost.edit;inlineEditPost.edit=function(t){d.apply(this,arguments);var e,n,a,i,r,s,l=0;"object"==typeof t&&(l=parseInt(this.getId(t),10)),0<l&&(_=o("#edit-"+l),a=(e=(p=o("#post-"+l)).find('input[name="wp_stream_trigger_connector"]').val())+"-"+(n=p.find('input[name="wp_stream_trigger_context"]').val()),i=p.find('input[name="wp_stream_trigger_action"]').val(),r=p.find('input[name="wp_stream_alert_status"]').val(),_.find('input[name="wp_stream_trigger_connector"]').attr("value",e),_.find('input[name="wp_stream_trigger_context"]').attr("value",n),_.find('select[name="wp_stream_trigger_connector_or_context"] option[value="'+a+'"]').attr("selected","selected"),o(document).one("alert-actions-updated",function(){_.find('input[name="wp_stream_trigger_action"]').attr("value",i),_.find('select[name="wp_stream_trigger_action"] option[value="'+i+'"]').attr("selected","selected").trigger("change")}),_.find('select[name="wp_stream_alert_status"] option[value="'+r+'"]').attr("selected","selected"),c("#edit-"+l),o("#wp_stream_alert_type_form").hide(),s=p.find('input[name="wp_stream_alert_type"]').val(),_.find('select[name="wp_stream_alert_type"] option[value="'+s+'"]').attr("selected","selected").trigger("change"))},!window.location.hash||(n=o(window.location.hash)).length&&(a=n.offset().top-o("#wpadminbar").height(),o("html, body").animate({scrollTop:a},1e3),n.find(".row-actions a.editinline").trigger("click"))});
1
+ jQuery(function(s){"use strict";function l(t){(t=s(t)).find(".select2-select.connector_or_context").each(function(t,e){s(e).select2({allowClear:!0,placeholder:streamAlerts.anyContext,templateResult:function(t){return void 0===t.id?t.text:-1===t.id.indexOf("-")?s('<span class="parent">'+t.text+"</span>"):s('<span class="child">'+t.text+"</span>")},matcher:function(t,e){var n=s.extend(!0,{},e);if(null===t.term||""===s.trim(t.term))return n;var a=t.term.toLowerCase();if(n.id=n.id.replace("blogs","sites"),0<=n.id.toLowerCase().indexOf(a))return n;if(n.children){for(var i=n.children.length-1;0<=i;i--)-1===n.children[i].id.toLowerCase().indexOf(a)&&n.children.splice(i,1);if(0<n.children.length)return n}return null}}).change(function(){var t=s(this).val();t&&(t=t.split("-"),s(this).siblings(".connector").val(t[0]),s(this).siblings(".context").val(t[1]))});var n=[s(e).siblings(".connector").val(),s(e).siblings(".context").val()];""===n[1]&&n.splice(1,1),s(e).val(n.join("-")).trigger("change")}),t.find("select.select2-select:not(.connector_or_context)").each(function(){var t=s(this).attr("id").split("_"),t=t[t.length-1].charAt(0).toUpperCase()+t[t.length-1].slice(1);s(this).select2({allowClear:!0,placeholder:streamAlerts.any+" "+t})})}function i(t){var e={action:"load_alerts_settings",alert_type:t},t=s("#wp_stream_alert_type").closest("tr").attr("id");e.post_id=t.split("-")[1],s.post(window.ajaxurl,e,function(t){var e=s("#wp_stream_alert_type_form");"none"!==s("#wp_stream_alert_type").val()?(e.html(t.data.html),e.show()):e.hide()})}var o,c,t=s("#wp_stream_alert_type");s("#the-list").on("change","#wp_stream_trigger_connector_or_context",function(){var t;"wp_stream_trigger_connector_or_context"===s(this).attr("id")&&((t=s(this).val())&&0<t.indexOf("-")&&(t=t.split("-")[0]),e(t))});var e=function(t){var r=s("#wp_stream_trigger_action");r.empty(),r.prop("disabled",!0);var e=s("<option/>",{value:"",text:""});r.append(e),s.post(window.ajaxurl,{action:"get_actions",connector:t},function(t){var e,n=t.success,a=t.data;if(n){for(var i in a)a.hasOwnProperty(i)&&(e=a[i],e=s("<option/>",{value:i,text:e}),r.append(e));r.prop("disabled",!1),s(document).trigger("alert-actions-updated")}})};t.change(function(){i(s(this).val())}),s("#wpbody-content").on("click","a.page-title-action",function(t){t.preventDefault(),s("#add-new-alert").remove(),0<s(".inline-edit-wp_stream_alerts").length&&s(".inline-edit-wp_stream_alerts .inline-edit-save button.button-secondary.cancel").trigger("click");var a;s.post(window.ajaxurl,{action:"get_new_alert_triggers_notifications"},function(t){var e,n;!0===t.success&&(a=t.data.html,s("tbody#the-list").prepend('<tr id="add-new-alert" class="inline-edit-row inline-edit-row-page inline-edit-page quick-edit-row quick-edit-row-page inline-edit-page inline-editor" style=""><td colspan="4" class="colspanchange">'+a+'<p class="submit inline-edit-save"> <button type="button" class="button-secondary cancel alignleft">Cancel</button> <input type="hidden" id="_inline_edit" name="_inline_edit" value="3550d271fe"> <button type="button" class="button-primary save alignright">Save</button> <span class="spinner"></span><span class="error" style="display:none"></span> <br class="clear"></p></td></tr>'),e=s("#add-new-alert"),n=e.css("background-color"),e.css("background-color","#C1E1B9"),setTimeout(function(){e.css("background-color",n)},250),s("#wp_stream_alert_type").change(function(){i(s(this).val())}),e.on("click",".button-secondary.cancel",function(){s("#add-new-alert").remove()}),e.on("click",".button-primary.save",r),l("#add-new-alert"))})});var n,r=function(t){t.preventDefault(),s("#add-new-alert").find("p.submit.inline-edit-save span.spinner").css("visibility","visible");var e={action:"save_new_alert",wp_stream_alerts_nonce:s("#wp_stream_alerts_nonce").val(),wp_stream_trigger_author:s("#wp_stream_trigger_author").val(),wp_stream_trigger_context:s("#wp_stream_trigger_connector_or_context").val(),wp_stream_trigger_action:s("#wp_stream_trigger_action").val(),wp_stream_alert_type:s("#wp_stream_alert_type").val(),wp_stream_alert_status:s("#wp_stream_alert_status").val()};s("#wp_stream_alert_type_form").find(":input").each(function(){var t=s(this).attr("id");s(this).val()&&(e[t]=s(this).val())}),s.post(window.ajaxurl,e,function(t){!0===t.success&&(s("#add-new-alert").find("p.submit.inline-edit-save span.spinner").css("visibility","hidden"),location.reload())})},p=inlineEditPost.edit;inlineEditPost.edit=function(t){p.apply(this,arguments);var e,n,a,i,r=0;0<(r="object"==typeof t?parseInt(this.getId(t),10):r)&&(c=s("#edit-"+r),a=(e=(o=s("#post-"+r)).find('input[name="wp_stream_trigger_connector"]').val())+"-"+(n=o.find('input[name="wp_stream_trigger_context"]').val()),i=o.find('input[name="wp_stream_trigger_action"]').val(),t=o.find('input[name="wp_stream_alert_status"]').val(),c.find('input[name="wp_stream_trigger_connector"]').attr("value",e),c.find('input[name="wp_stream_trigger_context"]').attr("value",n),c.find('select[name="wp_stream_trigger_connector_or_context"] option[value="'+a+'"]').attr("selected","selected"),s(document).one("alert-actions-updated",function(){c.find('input[name="wp_stream_trigger_action"]').attr("value",i),c.find('select[name="wp_stream_trigger_action"] option[value="'+i+'"]').attr("selected","selected").trigger("change")}),c.find('select[name="wp_stream_alert_status"] option[value="'+t+'"]').attr("selected","selected"),l("#edit-"+r),s("#wp_stream_alert_type_form").hide(),r=o.find('input[name="wp_stream_alert_type"]').val(),c.find('select[name="wp_stream_alert_type"] option[value="'+r+'"]').attr("selected","selected").trigger("change"))},!window.location.hash||(n=s(window.location.hash)).length&&(t=n.offset().top-s("#wpadminbar").height(),s("html, body").animate({scrollTop:t},1e3),n.find(".row-actions a.editinline").trigger("click"))});
ui/js/exclude.js CHANGED
@@ -354,7 +354,7 @@ jQuery(
354
  function() {
355
  var parts = $( this ).val().split( '-' );
356
  $( this ).siblings( '.connector' ).val( parts[0] );
357
- $( this ).siblings( '.context' ).val( parts[1] );
358
  $( this ).removeAttr( 'name' );
359
  }
360
  );
354
  function() {
355
  var parts = $( this ).val().split( '-' );
356
  $( this ).siblings( '.connector' ).val( parts[0] );
357
+ $( this ).siblings( '.context' ).val( parts.slice( 1 ).join( '-' ) );
358
  $( this ).removeAttr( 'name' );
359
  }
360
  );
ui/js/exclude.min.js CHANGED
@@ -1 +1 @@
1
- jQuery(function(a){function t(e){var s;a("select.select2-select.connector_or_context",e).each(function(e,t){a(t).select2({allowClear:!0,templateResult:function(e){return void 0===e.id?e.text:-1===e.id.indexOf("-")?a('<span class="parent">'+e.text+"</span>"):a('<span class="child">'+e.text+"</span>")},matcher:function(e,t){var s=a.extend(!0,{},t);if(null===e.term||""===a.trim(e.term))return s;var n=e.term.toLowerCase();if(s.id=s.id.replace("blogs","sites"),0<=s.id.toLowerCase().indexOf(n))return s;if(s.children){for(var i=s.children.length-1;0<=i;i--){-1===s.children[i].id.toLowerCase().indexOf(n)&&s.children.splice(i,1)}if(0<s.children.length)return s}return null}}).on("change",function(){var e=a(this).closest("tr"),t=a(this).val();t&&0<t.indexOf("-")&&(t=t.split("-")[0]),function(e,t){var c=a(".select2-select.action",e),r=c.val();c.empty(),c.prop("disabled",!0);var s=a("<option/>",{value:"",text:""});c.append(s);var n={action:"get_actions",connector:t};a.post(window.ajaxurl,n,function(e){var t,s,n=e.success,i=e.data;if(n){for(var l in i){i.hasOwnProperty(l)&&(t=i[l],s=a("<option/>",{value:l,text:t}),c.append(s))}c.val(r),c.prop("disabled",!1),a(document).trigger("alert-actions-updated")}})}(e,t)})}),a("select.select2-select.action",e).each(function(e,t){a(t).select2({allowClear:!0})}),a("select.select2-select.author_or_role",e).each(function(e,t){(s=a(t)).select2({ajax:{type:"POST",url:ajaxurl,dataType:"json",quietMillis:500,data:function(e,t){return{find:e,limit:10,pager:t,action:"stream_get_users",nonce:s.data("nonce")}},processResults:function(e){var t={results:[{text:"",id:""},{text:"Roles",children:[]},{text:"Users",children:[]}]};if(!0!==e.success||void 0===e.data||!0!==e.data.status)return t;if(void 0===e.data.users||void 0===e.data.roles)return t;var s=[];return a.each(e.data.roles,function(e,t){s.push({id:e,text:t})}),t.results[1].children=s,t.results[2].children=e.data.users,t}},templateResult:function(e){var t=a("<div>").text(e.text);return void 0!==e.icon&&e.icon&&(t.prepend(a('<img src="'+e.icon+'" class="wp-stream-select2-icon">')),t.attr("title",e.tooltip)),void 0!==e.tooltip?t.attr("title",e.tooltip):void 0!==e.user_count&&t.attr("title",e.user_count),t},templateSelection:function(e){var t=a("<div>").text(e.text);return a.isNumeric(e.id)&&e.text.indexOf("icon-users")<0&&t.append(a('<i class="icon16 icon-users"></i>')),t},allowClear:!0,placeholder:s.data("placeholder")}).on("change",function(){var e=a(this).select2("data");a(this).data("selected-id",e.id),a(this).data("selected-text",e.text)})}),a("select.select2-select.ip_address",e).each(function(e,t){var s=a(t),n="";s.select2({ajax:{type:"POST",url:ajaxurl,dataType:"json",quietMillis:500,data:function(e){return n=e.term,{find:e,limit:10,action:"stream_get_ips",nonce:s.data("nonce")}},processResults:function(e){var s={results:[]},t=[];return!0===e.success&&void 0!==e.data&&a.each(e.data,function(e,t){s.results.push({id:t,text:t})}),void 0===n||null===(t=n.match(/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/))||(t.shift(),4<=(t=a.grep(t,function(e){var t=parseInt(e,10);return t<=255&&t.toString()===e})).length&&s.results.push({id:n,text:n})),s}},allowClear:!1,multiple:!0,maximumSelectionSize:1,placeholder:s.data("placeholder"),tags:!0})}).on("change",function(){a(this).prev(".select2-container").find("input.select2-input").blur()}),a("ul.select2-choices, ul.select2-choices li, input.select2-input",".stream-exclude-list tr:not(.hidden) .ip_address").on("mousedown click focus",function(){var e=a(this).closest(".select2-container"),t=e.find("input.select2-input");if(1<=e.select2("data").length)return t.blur(),!1}),a(".exclude_rules_remove_rule_row",e).on("click",function(e){a(this).closest("tr").remove(),i(),n(),e.preventDefault()})}var e=a(".stream-exclude-list tbody tr:not(.hidden)"),s=a(".stream-exclude-list tr.helper");function n(){var e=a("table.stream-exclude-list tbody tr:not( .hidden ) input.cb-select:checked"),t=a("#exclude_rules_remove_rules");0===e.length?t.prop("disabled",!0):t.prop("disabled",!1)}function i(){var e=a("table.stream-exclude-list tbody tr:not( .hidden )"),t=a("table.stream-exclude-list tbody tr.no-items"),s=a(".check-column.manage-column input.cb-select"),n=a("#exclude_rules_remove_rules");0===e.length?(t.show(),s.prop("disabled",!0),n.prop("disabled",!0)):(t.hide(),s.prop("disabled",!1)),wp_stream_regenerate_alt_rows(e)}t(e),a("select.select2-select.author_or_role",e).each(function(){var e=a("<option selected>"+a(this).data("selected-text")+"</option>").val(a(this).data("selected-id"));a(this).append(e).trigger("change")}),a("select.select2-select.connector_or_context",e).each(function(){var e=[a(this).siblings(".connector").val(),a(this).siblings(".context").val()];""===e[1]&&e.splice(1,1),a(this).val(e.join("-")).trigger("change")}),a("#exclude_rules_new_rule").on("click",function(){var e=s.clone();e.removeAttr("class"),e.insertBefore(s),t(e),i(),n()}),a("#exclude_rules_remove_rules").on("click",function(){var e=a("table.stream-exclude-list"),t=a("tbody input.cb-select:checked",e).closest("tr");2<=a("tbody tr",e).length-t.length?t.remove():(a(":input",t).val(""),a(t).not(":first").remove(),a(".select2-select",t).select2("val","")),e.find("input.cb-select").prop("checked",!1),i(),n()}),a(".stream-exclude-list").closest("form").submit(function(){a(".stream-exclude-list tbody tr.hidden",this).each(function(){a(this).find(":input").removeAttr("name")}),a(".stream-exclude-list tbody tr:not(.hidden) select.select2-select.connector_or_context",this).each(function(){var e=a(this).val().split("-");a(this).siblings(".connector").val(e[0]),a(this).siblings(".context").val(e[1]),a(this).removeAttr("name")}),a(".stream-exclude-list tbody tr:not(.hidden) select.select2-select.ip_address",this).each(function(){var e=a("option:selected",this).first();e.length||a(this).append('<option selected="selected"></option>'),a("option:selected:not(:first)",this).each(function(){e.attr("value",e.attr("value")+","+a(this).attr("value")),a(this).removeAttr("selected")})})}),a(".stream-exclude-list").closest("td").prev("th").hide(),a("table.stream-exclude-list").on("click","input.cb-select",function(){n()}),a(document).ready(function(){i(),n()})});
1
+ jQuery(function(r){function t(e){var s;r("select.select2-select.connector_or_context",e).each(function(e,t){r(t).select2({allowClear:!0,templateResult:function(e){return void 0===e.id?e.text:-1===e.id.indexOf("-")?r('<span class="parent">'+e.text+"</span>"):r('<span class="child">'+e.text+"</span>")},matcher:function(e,t){var s=r.extend(!0,{},t);if(null===e.term||""===r.trim(e.term))return s;var n=e.term.toLowerCase();if(s.id=s.id.replace("blogs","sites"),0<=s.id.toLowerCase().indexOf(n))return s;if(s.children){for(var i=s.children.length-1;0<=i;i--)-1===s.children[i].id.toLowerCase().indexOf(n)&&s.children.splice(i,1);if(0<s.children.length)return s}return null}}).on("change",function(){var e=r(this).closest("tr"),t=r(this).val();!function(e,t){var l=r(".select2-select.action",e),c=l.val();l.empty(),l.prop("disabled",!0);e=r("<option/>",{value:"",text:""});l.append(e);t={action:"get_actions",connector:t};r.post(window.ajaxurl,t,function(e){var t,s=e.success,n=e.data;if(s){for(var i in n)n.hasOwnProperty(i)&&(t=n[i],t=r("<option/>",{value:i,text:t}),l.append(t));l.val(c),l.prop("disabled",!1),r(document).trigger("alert-actions-updated")}})}(e,t=t&&0<t.indexOf("-")?t.split("-")[0]:t)})}),r("select.select2-select.action",e).each(function(e,t){r(t).select2({allowClear:!0})}),r("select.select2-select.author_or_role",e).each(function(e,t){(s=r(t)).select2({ajax:{type:"POST",url:ajaxurl,dataType:"json",quietMillis:500,data:function(e,t){return{find:e,limit:10,pager:t,action:"stream_get_users",nonce:s.data("nonce")}},processResults:function(e){var t={results:[{text:"",id:""},{text:"Roles",children:[]},{text:"Users",children:[]}]};if(!0!==e.success||void 0===e.data||!0!==e.data.status)return t;if(void 0===e.data.users||void 0===e.data.roles)return t;var s=[];return r.each(e.data.roles,function(e,t){s.push({id:e,text:t})}),t.results[1].children=s,t.results[2].children=e.data.users,t}},templateResult:function(e){var t=r("<div>").text(e.text);return void 0!==e.icon&&e.icon&&(t.prepend(r('<img src="'+e.icon+'" class="wp-stream-select2-icon">')),t.attr("title",e.tooltip)),void 0!==e.tooltip?t.attr("title",e.tooltip):void 0!==e.user_count&&t.attr("title",e.user_count),t},templateSelection:function(e){var t=r("<div>").text(e.text);return r.isNumeric(e.id)&&e.text.indexOf("icon-users")<0&&t.append(r('<i class="icon16 icon-users"></i>')),t},allowClear:!0,placeholder:s.data("placeholder")}).on("change",function(){var e=r(this).select2("data");r(this).data("selected-id",e.id),r(this).data("selected-text",e.text)})}),r("select.select2-select.ip_address",e).each(function(e,t){var s=r(t),n="";s.select2({ajax:{type:"POST",url:ajaxurl,dataType:"json",quietMillis:500,data:function(e){return n=e.term,{find:e,limit:10,action:"stream_get_ips",nonce:s.data("nonce")}},processResults:function(e){var s={results:[]},t=[];return!0===e.success&&void 0!==e.data&&r.each(e.data,function(e,t){s.results.push({id:t,text:t})}),void 0===n||null===(t=n.match(/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/))||(t.shift(),4<=(t=r.grep(t,function(e){var t=parseInt(e,10);return t<=255&&t.toString()===e})).length&&s.results.push({id:n,text:n})),s}},allowClear:!1,multiple:!0,maximumSelectionSize:1,placeholder:s.data("placeholder"),tags:!0})}).on("change",function(){r(this).prev(".select2-container").find("input.select2-input").blur()}),r("ul.select2-choices, ul.select2-choices li, input.select2-input",".stream-exclude-list tr:not(.hidden) .ip_address").on("mousedown click focus",function(){var e=r(this).closest(".select2-container"),t=e.find("input.select2-input");if(1<=e.select2("data").length)return t.blur(),!1}),r(".exclude_rules_remove_rule_row",e).on("click",function(e){r(this).closest("tr").remove(),i(),n(),e.preventDefault()})}var e=r(".stream-exclude-list tbody tr:not(.hidden)"),s=r(".stream-exclude-list tr.helper");function n(){var e=r("table.stream-exclude-list tbody tr:not( .hidden ) input.cb-select:checked"),t=r("#exclude_rules_remove_rules");0===e.length?t.prop("disabled",!0):t.prop("disabled",!1)}function i(){var e=r("table.stream-exclude-list tbody tr:not( .hidden )"),t=r("table.stream-exclude-list tbody tr.no-items"),s=r(".check-column.manage-column input.cb-select"),n=r("#exclude_rules_remove_rules");0===e.length?(t.show(),s.prop("disabled",!0),n.prop("disabled",!0)):(t.hide(),s.prop("disabled",!1)),wp_stream_regenerate_alt_rows(e)}t(e),r("select.select2-select.author_or_role",e).each(function(){var e=r("<option selected>"+r(this).data("selected-text")+"</option>").val(r(this).data("selected-id"));r(this).append(e).trigger("change")}),r("select.select2-select.connector_or_context",e).each(function(){var e=[r(this).siblings(".connector").val(),r(this).siblings(".context").val()];""===e[1]&&e.splice(1,1),r(this).val(e.join("-")).trigger("change")}),r("#exclude_rules_new_rule").on("click",function(){var e=s.clone();e.removeAttr("class"),e.insertBefore(s),t(e),i(),n()}),r("#exclude_rules_remove_rules").on("click",function(){var e=r("table.stream-exclude-list"),t=r("tbody input.cb-select:checked",e).closest("tr");2<=r("tbody tr",e).length-t.length?t.remove():(r(":input",t).val(""),r(t).not(":first").remove(),r(".select2-select",t).select2("val","")),e.find("input.cb-select").prop("checked",!1),i(),n()}),r(".stream-exclude-list").closest("form").submit(function(){r(".stream-exclude-list tbody tr.hidden",this).each(function(){r(this).find(":input").removeAttr("name")}),r(".stream-exclude-list tbody tr:not(.hidden) select.select2-select.connector_or_context",this).each(function(){var e=r(this).val().split("-");r(this).siblings(".connector").val(e[0]),r(this).siblings(".context").val(e.slice(1).join("-")),r(this).removeAttr("name")}),r(".stream-exclude-list tbody tr:not(.hidden) select.select2-select.ip_address",this).each(function(){var e=r("option:selected",this).first();e.length||r(this).append('<option selected="selected"></option>'),r("option:selected:not(:first)",this).each(function(){e.attr("value",e.attr("value")+","+r(this).attr("value")),r(this).removeAttr("selected")})})}),r(".stream-exclude-list").closest("td").prev("th").hide(),r("table.stream-exclude-list").on("click","input.cb-select",function(){n()}),r(document).ready(function(){i(),n()})});
ui/js/live-updates.min.js CHANGED
@@ -1 +1 @@
1
- jQuery(function(d){d(document).ready(function(){var _;"toplevel_page_wp_stream"===wp_stream_live_updates.current_screen&&"1"===wp_stream_live_updates.current_page&&"asc"!==wp_stream_live_updates.current_order&&(1<parseInt(wp_stream_live_updates.current_query_count,10)||(_=".toplevel_page_wp_stream #the-list",wp.heartbeat.interval("fast"),d(document).on("heartbeat-send.stream",function(e,t){t["wp-stream-heartbeat"]="live-update";var a=d(_+" tr:first .column-date time"),r=1;0!==a.length&&(r=""===a.attr("datetime")?1:a.attr("datetime")),t["wp-stream-heartbeat-last-time"]=r,t["wp-stream-heartbeat-query"]=wp_stream_live_updates.current_query}),d(document).on("heartbeat-tick.stream",function(e,t){var a,r,s,n,l,p,i;t["wp-stream-heartbeat"]&&0!==t["wp-stream-heartbeat"].length&&(a=d("#edit_stream_per_page").val(),r=d(_+" tr"),(s=d(t["wp-stream-heartbeat"])).addClass("new-row"),n=r.first().hasClass("alternate"),1!==s.length||n?(l=0!=s.length%2||n?"odd":"even",s.filter(":nth-child("+l+")").addClass("alternate")):s.addClass("alternate"),d(_).prepend(s),d(".metabox-prefs input").each(function(){var e;!0!==d(this).prop("checked")&&(e=d(this).val(),d("td.column-"+e).hide())}),(p=a-(s.length+r.length))<0&&d(_+" tr").slice(p).remove(),d(_+" tr.no-items").remove(),(i=t.total_items_i18n||"")&&(d(".displaying-num").text(i),d(".total-pages").text(t.total_pages_i18n),d(".tablenav-pages").find(".next-page, .last-page").toggleClass("disabled",t.total_pages===d(".current-page").val()),d(".tablenav-pages .last-page").attr("href",t.last_page_link)),d(_).parent().trigger("updated"),wp_stream_regenerate_alt_rows(d(_+" tr")),setTimeout(function(){d(".new-row").addClass("fadeout"),setTimeout(function(){d(_+" tr").removeClass("new-row fadeout")},500)},3e3))})))})});
1
+ jQuery(function(p){p(document).ready(function(){var l;"toplevel_page_wp_stream"===wp_stream_live_updates.current_screen&&"1"===wp_stream_live_updates.current_page&&"asc"!==wp_stream_live_updates.current_order&&(1<parseInt(wp_stream_live_updates.current_query_count,10)||(l=".toplevel_page_wp_stream #the-list",wp.heartbeat.interval("fast"),p(document).on("heartbeat-send.stream",function(e,t){t["wp-stream-heartbeat"]="live-update";var a=p(l+" tr:first .column-date time"),r=1;0!==a.length&&(r=""===a.attr("datetime")?1:a.attr("datetime")),t["wp-stream-heartbeat-last-time"]=r,t["wp-stream-heartbeat-query"]=wp_stream_live_updates.current_query}),p(document).on("heartbeat-tick.stream",function(e,t){var a,r,s,n;t["wp-stream-heartbeat"]&&0!==t["wp-stream-heartbeat"].length&&(a=p("#edit_stream_per_page").val(),n=p(l+" tr"),(r=p(t["wp-stream-heartbeat"])).addClass("new-row"),s=n.first().hasClass("alternate"),1!==r.length||s?(s=0!=r.length%2||s?"odd":"even",r.filter(":nth-child("+s+")").addClass("alternate")):r.addClass("alternate"),p(l).prepend(r),p(".metabox-prefs input").each(function(){var e;!0!==p(this).prop("checked")&&(e=p(this).val(),p("td.column-"+e).hide())}),(n=a-(r.length+n.length))<0&&p(l+" tr").slice(n).remove(),p(l+" tr.no-items").remove(),(n=t.total_items_i18n||"")&&(p(".displaying-num").text(n),p(".total-pages").text(t.total_pages_i18n),p(".tablenav-pages").find(".next-page, .last-page").toggleClass("disabled",t.total_pages===p(".current-page").val()),p(".tablenav-pages .last-page").attr("href",t.last_page_link)),p(l).parent().trigger("updated"),wp_stream_regenerate_alt_rows(p(l+" tr")),setTimeout(function(){p(".new-row").addClass("fadeout"),setTimeout(function(){p(l+" tr").removeClass("new-row fadeout")},500)},3e3))})))})});
ui/js/settings.min.js CHANGED
@@ -1 +1 @@
1
- jQuery(function(o){var e="wp_stream_network"===o('input[name="option_page"]').val()?"_network_affix":"",a=o("#wp_stream"+e+"\\[general_keep_records_indefinitely\\]"),n=o("#wp_stream"+e+"_general_records_ttl"),t=n.closest("tr");function i(){a.is(":checked")?(t.addClass("hidden"),n.addClass("hidden")):(t.removeClass("hidden"),n.removeClass("hidden"))}a.on("change",function(){i()}),i(),o("#wp_stream_general_reset_site_settings").click(function(e){confirm(wp_stream.i18n.confirm_defaults)||e.preventDefault()});var r=o(".nav-tab-wrapper"),s=o(".nav-tab-content table.form-table"),l=r.find(".nav-tab-active"),c=0<l.length?r.find("a").index(l):0,d=window.location.hash.match(/^#(\d+)$/),h=null!==d?d[1]:c;r.on("click","a",function(){var e,a,n,t=r.find("a").index(o(this)),i=window.location.hash.match(/^#(\d+)$/);return s.hide().eq(t).show(),r.find("a").removeClass("nav-tab-active").filter(o(this)).addClass("nav-tab-active"),""!==window.location.hash&&null===i||(window.location.hash=t),e=t,0!==(n=o('input[name="option_page"][value^="wp_stream"]').closest("form")).length&&(a=n.attr("action"),n.prop("action",a.replace(/(^[^#]*).*$/,"$1#"+e))),!1}),r.children().eq(h).trigger("click")});
1
+ jQuery(function(t){var e="wp_stream_network"===t('input[name="option_page"]').val()?"_network_affix":"",a=t("#wp_stream"+e+"\\[general_keep_records_indefinitely\\]"),n=t("#wp_stream"+e+"_general_records_ttl"),i=n.closest("tr");function o(){a.is(":checked")?(i.addClass("hidden"),n.addClass("hidden")):(i.removeClass("hidden"),n.removeClass("hidden"))}a.on("change",function(){o()}),o(),t("#wp_stream_general_reset_site_settings").click(function(e){confirm(wp_stream.i18n.confirm_defaults)||e.preventDefault()});var r=t(".nav-tab-wrapper"),s=t(".nav-tab-content table.form-table"),l=r.find(".nav-tab-active"),e=0<l.length?r.find("a").index(l):0,l=window.location.hash.match(/^#(\d+)$/),e=null!==l?l[1]:e;r.on("click","a",function(){var e,a=r.find("a").index(t(this)),n=window.location.hash.match(/^#(\d+)$/);return s.hide().eq(a).show(),r.find("a").removeClass("nav-tab-active").filter(t(this)).addClass("nav-tab-active"),""!==window.location.hash&&null===n||(window.location.hash=a),e=a,0!==(n=t('input[name="option_page"][value^="wp_stream"]').closest("form")).length&&(a=n.attr("action"),n.prop("action",a.replace(/(^[^#]*).*$/,"$1#"+e))),!1}),r.children().eq(e).trigger("click")});
ui/js/wpseo-admin.min.js CHANGED
@@ -1 +1 @@
1
- jQuery(function(o){var t,n,a;window.location.hash.substr("stream-highlight-")&&(t=window.location.hash.replace("stream-highlight-",""),n=o(":input"+t),window.location.hash="",n.length&&(o("#wpseo-tabs").length&&(a=n.parents(".wpseotab").first().attr("id"),window.location.hash="#top#"+a),jQuery(document).ready(function(){setTimeout(function(){o("body,html").animate({scrollTop:n.offset().top-50},"slow",function(){n.animate({backgroundColor:"yellow"},"slow")})},500)})))});
1
+ jQuery(function(o){var t,n;window.location.hash.substr("stream-highlight-")&&(n=window.location.hash.replace("stream-highlight-",""),t=o(":input"+n),window.location.hash="",t.length&&(o("#wpseo-tabs").length&&(n=t.parents(".wpseotab").first().attr("id"),window.location.hash="#top#"+n),jQuery(document).ready(function(){setTimeout(function(){o("body,html").animate({scrollTop:t.offset().top-50},"slow",function(){t.animate({backgroundColor:"yellow"},"slow")})},500)})))});