Admin Menu Editor - Version 1.10.1

Version Description

  • Fixed the [ame-user-info] shortcode not working in login redirects. It would always output "(No user)" instead of the actual user data.
  • Fixed a warning caused by a conflict with plugins and themes that call the "login_redirect" filter with only 1 parameter instead of the expected 3.
  • Probably fixed a bug where menu items that use fully qualified URLs would lose their custom settings when the site URL changed (such as when migrating the site to a different domain).
  • Fixed a minor conflict with the plugin "Google Analytics for WordPress by MonsterInsights" where the "Getting Started" menu item that is usually hidden would become visible when AME was activated.
  • Fixed an edge case where the plugin would incorrectly show an "is this option enabled for everyone" checkbox in an indeterminate state when it was actually enabled for all roles but was not explicitly enabled (or disabled) for individual users.
  • Fixed a bug where AME did not prefer submenu items when detecting the current menu item based on the current URL.
  • Switched from jQuery.toJSON() to JSON.stringify(). The old jQuery JSON plugin appears to be unmaintained, and all modern browsers have supported JSON.stringify() for a long time.
  • Other minor fixes.
  • Tested up to WP 6.0-beta1.
Download this release

Release Info

Developer whiteshadow
Plugin Icon 128x128 Admin Menu Editor
Version 1.10.1
Comparing to
See all releases

Code changes from version 1.10 to 1.10.1

css/_indeterminate-checkbox.scss CHANGED
@@ -1,7 +1,7 @@
1
- @mixin ame-indeterminate-checkbox {
2
  &:indeterminate:before {
3
  content: '\25a0'; //Unicode black square. Another option would be BLACK LARGE SQUARE (U+2B1B).
4
- color: #1e8cbe;
5
 
6
  //Large square.
7
  //margin: -6px 0 0 -1px;
@@ -21,4 +21,18 @@
21
  width: 16px;
22
  -webkit-font-smoothing: antialiased;
23
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  }
1
+ @mixin ame-indeterminate-checkbox($markColor: #1e8cbe) {
2
  &:indeterminate:before {
3
  content: '\25a0'; //Unicode black square. Another option would be BLACK LARGE SQUARE (U+2B1B).
4
+ color: $markColor;
5
 
6
  //Large square.
7
  //margin: -6px 0 0 -1px;
21
  width: 16px;
22
  -webkit-font-smoothing: antialiased;
23
  }
24
+
25
+ @media screen and (max-width: 782px) {
26
+ &:indeterminate:before {
27
+ $boxSize: 1.5625rem;
28
+ height: $boxSize;
29
+ width: $boxSize;
30
+ line-height: $boxSize;
31
+ margin: -1px;
32
+
33
+ font-size: 18px;
34
+ font-family: unset;
35
+ font-weight: normal;
36
+ }
37
+ }
38
  }
css/admin.css CHANGED
@@ -51,7 +51,8 @@ hr.ws-submenu-separator {
51
  }
52
 
53
  /* No colored bar/marker when hovering over a separator. */
54
- #adminmenu li.ws-submenu-separator-wrap a:hover {
 
55
  box-shadow: none;
56
  }
57
 
51
  }
52
 
53
  /* No colored bar/marker when hovering over a separator. */
54
+ #adminmenu li.ws-submenu-separator-wrap a:hover,
55
+ #adminmenu li.ws-submenu-separator-wrap a:focus {
56
  box-shadow: none;
57
  }
58
 
css/menu-editor.css CHANGED
@@ -102,6 +102,18 @@
102
  width: 16px;
103
  -webkit-font-smoothing: antialiased;
104
  }
 
 
 
 
 
 
 
 
 
 
 
 
105
 
106
  @media screen and (max-width: 782px) {
107
  #ws_menu_editor input[type=checkbox].ws_actor_access_checkbox:indeterminate:before {
@@ -556,7 +568,7 @@ to accommodate the drop-down button.
556
  .ws_custom_actor_permissions_flag::before {
557
  /*content: "\f160";*/
558
  /* padlock */
559
- content: "";
560
  /* human silhouette */
561
  color: black;
562
  filter: alpha(opacity=25);
@@ -572,7 +584,7 @@ to accommodate the drop-down button.
572
  /* Item visibility can't be determined because it depends on a meta capability. */
573
  .ws_uncertain_meta_cap_flag::before {
574
  font: 16px/1 "dashicons";
575
- content: "";
576
  color: black;
577
  filter: alpha(opacity=25);
578
  /*IE 5-7*/
@@ -1568,7 +1580,7 @@ a#ws-ame-delete-color-preset:hover {
1568
  color: #7ad03a;
1569
  }
1570
  #ws_user_selection_panels #ws_selected_users .ws_user_action_button::before {
1571
- content: "";
1572
  }
1573
  #ws_user_selection_panels #ws_selected_users .ws_user_action_button:hover {
1574
  color: #dd3d36;
@@ -1724,7 +1736,7 @@ a#ws-ame-delete-color-preset:hover {
1724
  -webkit-border-radius: 50%;
1725
  border-radius: 50%;
1726
  text-indent: -1px;
1727
- content: "";
1728
  display: inline-block;
1729
  font: normal 20px/1 dashicons;
1730
  -webkit-font-smoothing: antialiased;
@@ -1732,7 +1744,7 @@ a#ws-ame-delete-color-preset:hover {
1732
  text-decoration: none !important;
1733
  }
1734
  .ws_ame_doc_box.closed .button-link .toggle-indicator::before, .ws_ame_custom_postbox.closed .button-link .toggle-indicator::before {
1735
- content: "";
1736
  }
1737
 
1738
  .ws_basic_container .ws_ame_custom_postbox {
@@ -1874,6 +1886,10 @@ span.description {
1874
  font-style: italic;
1875
  }
1876
 
 
 
 
 
1877
  .test-wrap {
1878
  background-color: #444444;
1879
  padding: 30px;
102
  width: 16px;
103
  -webkit-font-smoothing: antialiased;
104
  }
105
+ @media screen and (max-width: 782px) {
106
+ #ws_menu_editor .ws_actor_access_checkbox:indeterminate:before,
107
+ #ws_menu_editor input[type=checkbox].ws_actor_access_checkbox:indeterminate:before {
108
+ height: 1.5625rem;
109
+ width: 1.5625rem;
110
+ line-height: 1.5625rem;
111
+ margin: -1px;
112
+ font-size: 18px;
113
+ font-family: unset;
114
+ font-weight: normal;
115
+ }
116
+ }
117
 
118
  @media screen and (max-width: 782px) {
119
  #ws_menu_editor input[type=checkbox].ws_actor_access_checkbox:indeterminate:before {
568
  .ws_custom_actor_permissions_flag::before {
569
  /*content: "\f160";*/
570
  /* padlock */
571
+ content: "\f110";
572
  /* human silhouette */
573
  color: black;
574
  filter: alpha(opacity=25);
584
  /* Item visibility can't be determined because it depends on a meta capability. */
585
  .ws_uncertain_meta_cap_flag::before {
586
  font: 16px/1 "dashicons";
587
+ content: "\f348";
588
  color: black;
589
  filter: alpha(opacity=25);
590
  /*IE 5-7*/
1580
  color: #7ad03a;
1581
  }
1582
  #ws_user_selection_panels #ws_selected_users .ws_user_action_button::before {
1583
+ content: "\f158";
1584
  }
1585
  #ws_user_selection_panels #ws_selected_users .ws_user_action_button:hover {
1586
  color: #dd3d36;
1736
  -webkit-border-radius: 50%;
1737
  border-radius: 50%;
1738
  text-indent: -1px;
1739
+ content: "\f142";
1740
  display: inline-block;
1741
  font: normal 20px/1 dashicons;
1742
  -webkit-font-smoothing: antialiased;
1744
  text-decoration: none !important;
1745
  }
1746
  .ws_ame_doc_box.closed .button-link .toggle-indicator::before, .ws_ame_custom_postbox.closed .button-link .toggle-indicator::before {
1747
+ content: "\f140";
1748
  }
1749
 
1750
  .ws_basic_container .ws_ame_custom_postbox {
1886
  font-style: italic;
1887
  }
1888
 
1889
+ .wrap :target {
1890
+ background-color: rgba(255, 230, 81, 0.8);
1891
+ }
1892
+
1893
  .test-wrap {
1894
  background-color: #444444;
1895
  padding: 30px;
css/menu-editor.css.map ADDED
@@ -0,0 +1 @@
 
1
+ {"version":3,"sourceRoot":"","sources":["menu-editor.scss","_indeterminate-checkbox.scss","_test-access-screen.scss","_main-tabs.scss"],"names":[],"mappings":";AAAA;AAIA;EACC;;;AAGD;EACC;;;AAQD;EACC;EACA,OAPoB;EAQpB;EACA;EAEA;EACA;EACA;EAEA,eAb2B;EAc3B,oBAd2B;EAe3B,uBAf2B;;;AAkB5B;EACC;EACA;EACA;;;AAGD;EACC;EACA;;;AASD;EACC;EACA;EAEA;EACA;EAEA;;;AAGD;AAAA;AAAA;EAGC;;;AAGD;AAAA;EAEC;;;AAGD;AAAA;AAAA;AAGA;EACI;;;AAGJ;EACI;;;AAIH;EACC;EACA;;AAGD;EACC;EACA;EACA;EAEA;EACA;EACA;EACA;;;AAIF;EACC;;;AAGD;AAAA;AAAA;AAKA;AAAA;EAGI;EACA;EACA;EACA;;ACjHH;AAAA;EACC;EACA,OAH4C;EAU5C;EACA;EAMA;EACA;EACA;EACA;EACA;;AAGD;EACC;AAAA;IAEC,QADU;IAEV,OAFU;IAGV,aAHU;IAIV;IAEA;IACA;IACA;;;;ADqFH;EAEE;IACC;IACA;;;AAKH;AACA;EACI;;;AAGJ;EACI;;;AAGJ;AAEA;EACI;;;AAGJ;EACI;;;AAGJ;AAAA;AAAA;AAIA;EAC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AAGA;AAAA;EAGC;EACA,OANqB;EAOrB;EACA;EAEA;EACA;EAEA;EACA;EACA;EAEA;EACA;EAEA;EACA;EACA;EACA;EAEA;EACA;EACA;EACA;EAEA;EACA;EACA;EACA;;;AAGD;AAAA;EAGC,QA7EsB;EA+EtB;EACA;EACA;EAEA;EACA;EACA;;AAEA;AAAA;EACC;;;AAIF;EACC;EACA;;;AAGD;EACC;;;AAGD;EACC;EACA;;;AAGD;AAAA;AAAA;AAAA;AAIA;AAAA;EAGC;EACA;EAEA;EACA;EAEA;EACA;EAEA;EACA;;;AAGD;EACC;EACA;EACA;;;AAGD;EACC;;;AAGD;EACC;;;AAGD;AACA;EACC;;;AAGD;AAAA;AAAA;AAGA;EACC;EACA;;;AAGD;EACC;EACA;EACA;;;AAGD;EACC;;;AAGD;EACC;EACA;;;AAGD;AAAA;AAAA;AAIA;EACC;EACA;EACA;;;AAGD;EACC;EACA;EACA;EACA;EACA;EACA;;;AAGD;AACA;EACC;;;AAGD;AACA;EACC;EACA;;;AAGD;AACA;EACC;;;AAGD;AACA;EACC;;;AAED;AACC;AAAsB;EACtB;AAAkB;EAClB;EAEA;AAA2B;EAC3B;;;AAGD;AACA;EACC;;;AAGD;AACA;EACC;EACA;EACA;EAEA;AAA2B;EAC3B;;;AAGD;AAMA;AAAA;AAAA;AAIA;EACC;EAEA;EACA;EACA;EAEA;EACA;;;AASD;EACC;EACA;EACA;EAEA;EACA;EAEA;EACA;EACA;EAEA;EACA;EAEA;EACA;EACA;;AAEA;EACC;;;AAIF;EACC;EACA;;;AAID;EACC;;;AAED;EACC;EACA;;;AAED;EACC;EACA;EACA;;;AAGD;EACC;EACA;;;AAGD;EACC;;;AAGD;AAAA;AAAA;AAIA;EACC;EACA;EAEA;EACA;EACA;EAEA;EACA;;;AAID;EACC;EACA;EACA,SAJ0B;;;AAO3B;EACC;;;AAGD;AAAA;AAAA;AAAA;AAAA;AAQA;EACC;EACA;EACA;;AAEA;EACC;EAEA;EACA;EACA;EACA;EAEA;;AAGD;EACC;EACA,qBApBwB;EAqBxB;;AAGD;EACC;;AAGD;EACC;;;AAIF;EACC;EACA;EACA,kBApCyB;;;AAyC1B;AAAA;AAAA;AAIA;EACC;EACA;EACA;EAEA;EACA;EACG;;;AAGJ;EACI;;;AAGJ;EACI;;;AAGJ;EACI;;;AAIJ;EACC;EACA;EAEA;EACA;EACA;EACA;AAEA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGD;AACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGD;EACC;EACA;EACA;;;AAGD;EACC;EACA;;;AAGD;EACI;EACA;EACA;;;AAGJ;EACC;EACA;EACA;EAEA;EACA;;;AAGD;EACC;EACA;;;AAGD;AACA;EACC;EACA;EACA;EAEG;EACA;EACH;;AAEA;EACC,QAneqB;EAoerB,YApeqB;EAqerB;;;AAIF;AACA;EACC;EACA;EACA;AAEA;AAAA;AAAA;AAAA;AAAA;EAKA;EACA;EACA;;AAEA;EACC;;;AAIF;AACA;EACC;EACA;EACA;EACA;;;AAOA;EACC;EACA;EAMA;;AAJA;EACC;;AAMF;EACC;EACA;EACA;;;AAIF;AACA;EACC;EACA;;;AAED;EACC;EACA;;;AAGD;EACC;;;AAGD;AAAA;AAAA;AAIA;EACC;EACA;EAEA;EACA;EACA;EAEA;EACA;;;AAGD;EACC;EACA;EACA;;;AAGD;EACC;EAEA;EACA;EACA;EACA;EAEA;;;AAGD;EACC;;;AAGD;EACC;EACA;EACA;;;AAGD;EACC;;;AAGD;EACC;EACA;AAAe;EACf;EACA;EAEA;EACA;;;AAGD;EACC;EACA;EACA;EAEA;EACA;;;AAGD;EACC;EACA;;;AAGD;EACC;;;AAGD;AAAA;AAAA;AAAA;AAIA;EACC;;;AAID;AAAA;AAAA;AAIA;EACI;EACA;;;AAGJ;EACI;EACA;;;AAGJ;EACI;;;AAGJ;EACI;EACA;EACA;EAEA;EACA;EACA;EAEA;;;AAGJ;EACI;;AAEH;EACC;;;AAIF;EACI;;;AAGJ;EACC;EACA;EACA;;;AAGD;AACA;EACC;EAEA;EACA;EACA;EAEA;;;AAGD;EACC;EACA;;;AAGD;AACC;;;AAGD;EACC;EACA;;;AAED;EACC;;;AAGD;AAKA;EAGI;EACH;EACG,QAJgB;EAKhB,OATc;EAWd,cAVoB;EAWvB;EACG;EAEH;EACG;EACA;EACA;EAEH;;AAEA;EACC;EACA;EAEA;EACA;EAEA;EACA;EACA;;;AAIF;EACC;;;AAGD;EACI;EACA;EACA;EAEA;EACA;EACA;;;AAGJ;EACI;;;AAGJ;AAAA;AAAA;AAIA;EACC;;;AAGD;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAEG;EACA;;;AAGJ;EACI;;;AAIH;EACC;EACA;EAEA;EAEA;EACA;EACA;;AAEA;EACC;EACA;;AAGD;EACC;EACA;EACA;;AAIF;EACC;EACA;EACA;EACA;EAEA;EACA;EACA;EAEA;EACA;EAEA;EACA;EAEA;EACA;EAEA;;AAGD;EACC;EACA;;AAGD;EACC;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;;AAGD;AACC;EACA;;AAQF;EACC;;;AAGD;EACC;;;AAIA;EACC;EACA;;AAGD;EACC;;AAGD;EACC;EACA;EACA;;AAEA;EACC;;AAGD;EACC;;AAGD;EACC;;AAGD;EACC;;;AAKH;EACC;EACA;;;AAGD;AACC;EACA;EACA;EACG;EACA;;;AAGJ;EACC;EACA;EACA;;;AAGD;EACC;;;AAGD;EACI;;;AAGJ;EACI;;;AAGJ;EACI;EACA;EACA;;;AAGJ;EACI;;;AAGJ;EACC;EACA;EAEA;;;AAGD;EACC;;;AAGD;EACC;EACA;EACA;;;AAGD;EACC;;;AAGD;EACI;EACA;;;AAGJ;AAAA;AAAA;AAIA;AAGA;EAEC,OAJuB;EAKvB,cAJwB;;;AAOzB;EACC;EACA;;;AAGD;EACC;EACA;;;AAGD;EACC;;AAEA;EACC;EACA;;;AAIF;EACC;EACA;EACA;EACA;;;AAGD;AAAA;EAEC;EACA;EACA;;;AAGD;AAAA;EAEC;;;AAGD;EACC;;;AAGD;AACC;AAAA;EAEA;EACA;;;AAGD;EACC;EACA;;;AAGD;EACC;EAEA;EACA;EACA;EACA;EACA;EACA;;;AAGD;EACC;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;;;AAGD;EACC;;;AAGD;EACC;;;AAGD;EACC;EACA;EACA;;;AAGD;EACC;EACA;EACA;EAEA;EAEA;EACA;EACA;EACA;;;AAGD;EACC;EACA;EACA;EACA;EAEA;EACA;EAEA;EACA;EACA;;;AAGD;EACC;EACA;EACA;;;AAGD;EACC;;;AAGD;AAAA;AAAA;AAIA;AAAA;AAAA;AAGA;AAuBC;;AArBA;EACC;;AAGD;EACC;;AAGD;EACC;;AAIA;EACC;;AAED;EACC;;AAKF;EACC;;AAEA;EACC;;AAGD;EACC;;AAGD;EACC;;;AAKH;EACC;EACA;EACA;;;AAKD;EACC,cAH0B;EAI1B;EACA;EACA;;;AAGD;EACC;;AAEA;EACC,cAbyB;;AAgB1B;EACC;EACA;;AAGD;AAAA;EAEC;EACA;;AAGD;EACC;EACA;;AAGD;EACC;;AAIA;EACC;;;AAQF;EACC;EACA;EACA;EACA;;AAGD;EACC;;AAID;EACC;;AAED;EACC;;AAKA;EACC;;AAED;EACC;;;AAQF;EACC;;;AAIF;AACA;EACC;EACA;EAEA;EACA;EACA;EAEA;EACA;EAGA;EAEA;EACA;;;AAGD;EACC;EAEA;EACA;EACA;EACA;EACA;EAEA;EAEA;;;AAGD;EACC;;;AAID;EAGC,WAFgB;EAGhB,QAHgB;EAIhB,OAJgB;EAOhB;EAEA;EACA;EACA;;;AAGD;EACC;;;AAGD;AAAA;AAAA;AAQA;EAEC;EACA,SAFoB;;;AAKrB;EACC;;AAEA;EACC;EACA;EACA;EAEA;EACA;EACA;EAEA,OAtBwB;EAuBxB,QAtByB;EAwBzB;EACA;EACA;;AAGD;EACC;;AAGD;EACC;EACA;EACA;EACA;EACA;;AAGD;EACC;EAGA,KAFc;EAGd,MA7C0B;EA8C1B,OA9C0B;EAiD1B;EAEA;EACA;;AAGD;EACC;EAGA;EACA;EACA;EACA;;AAEA;EACC;EACA;EAEA;EACA;;AAGD;EACC;EACA;;AAGD;EACC;;AAGD;EACC;;AAKD;EACC;;AAGD;EACC;;AAID;EACC;;AAMD;EACC;;AAED;EACC;;AAED;EACC;;AAGD;EACC;;AAKA;EACC;;AAaH;EACC;EACA;EACA;EAEA;EACA;;AAGD;EACC;EACA;EACA;EACA;EACA;;;AAIF;EACC;EACA,OAzJ2B;EA0J3B,QA1J2B;EA4J3B;EACA;;;AAKD;AAAA;AAAA;AAIA;EACI;;;AAMJ;AAAA;AAAA;AAIA;EACC;;;AAGD;EACC;EACA;EACA;;;AAGD;EACC;EACA;EACA;EACA;;;AAGD;EACC;EACA;EACA;;;AAGD;EACC;;;AAID;EACC;;;AAID;EACC;EACA;EACA;;;AAGD;EACC;;;AAGD;EACC;;;AAGD;EACC;EACA;EAEA;EACA;EACA;EACA;;;AAGD;EACC;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;EAEA;EACA;EACA;;;AAGD;EACC;EACA;EACA;;;AAGD;EACC;;;AAGD;EACC;EACA;EACA;;;AAIA;EACC;EACA;;AAGD;EACC;EACA;;AAGD;EACC;;AAGD;EACC;EACA;;AAGD;EACC;;AAGD;EACC;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;EAEA;EACA;EACA;;AAGD;EACC;;;AAIF;EAEC;EACA;;;AAGD;EACC;;AAEA;EACC;EACA;EACA;;AAGD;EACC;;AAGD;EACC;EACA;EACA;;;AAIF;AAAA;AAAA;AAGA;EACC;;;AAGD;AAAA;AAAA;AAIA;EACC;EACA;EAEA;EACA;EACA;EAEA;EACA;;AAEA;EACC;EACA;;AAGD;EAEC,aA/0CyB;EAg1CzB,gBAh1CyB;;AAm1C1B;EACC;;AAGD;EACC;;AAEA;EACC;;;AAKH;AAAA;AAAA;AAIA;EACC;EACA;EACA;;;AAIA;EACC;EACA;;AAGD;EACC;EACA;;AAGD;EACC;;;AAIF;EACC;;;AAGD;AACC;AAAA;;;AAID;AAAA;AAAA;AAIA;EACC;;;AAGD;AAAA;AAAA;AAKC;EACC;;AAGD;EACC;EACA;EACA;;AAGD;EACC;EACA;EACA;;;AAIF;AAAA;AAAA;AAIA;EACI;EAEH;EACA;EAEA;EACA;EACA;EACA;;;AAGD;EACC;EACA;EACA;EACA;EAEA;;;AAGD;EACC;EAEA;;;AAGD;EACC;;;AAGD;EACI;EACA;;;AAGJ;EACI;EACA;EACA;EAEA;EACA;EAEA;;;AAGJ;EACI;EACA;EAEA;EACA;;;AAGJ;EACI;;;AEvtEJ;AAAA;AAAA;AAIA;EACC;EACA;;;AAGD;EAEC;;;AAGD;EACC;EACA;EAEA;EACA;EACA;;;AAGD;EACC;EACA;EACA;EACA;EAEA;EACA;EACA;;;AAGD;EACC;EACA;EACA;EAEA;EACA;EACA;;;AAGD;EACC;EACA;EACA;;;AAGD;EACC;EACA;EACA;EACA;;;AAGD;EACC;EACA;EACA;;AAEA;EACC;EACA;EACA;EACA;;;AAIF;EACC;EACA;EAEA;EACA;EACA;EACA;;;AAGD;EACC;EACA;EAEA;EACA;;;AAGD;EACC;EACA;EACA;EAEA;EACA;EACA;EAEA;EACA;EACA;;;AAGD;EACC;EACA;EACA;EAEA;EACA;EACA;EACA;EAEA;EACA;EAEA;EACA;;AAEA;EACC;;;AAIF;EACC;EACA;;;AAGD;EACC;;;ACjID;AAAA;AAAA;AAKC;EACC;;AAGD;EACC;EACA;EACA;;;AAIF;;AAAA;AAAA;AAAA;AAMA;EACC;;;AAIA;EACC;;;AAIF;AAAA;AAEA;EACC","file":"menu-editor.css"}
css/menu-editor.scss CHANGED
@@ -2232,6 +2232,10 @@ span.description {
2232
  font-style: italic;
2233
  }
2234
 
 
 
 
 
2235
  .test-wrap {
2236
  background-color: #444444;
2237
  padding: 30px;
2232
  font-style: italic;
2233
  }
2234
 
2235
+ .wrap :target {
2236
+ background-color: rgba(255, 230, 81, 0.8);
2237
+ }
2238
+
2239
  .test-wrap {
2240
  background-color: #444444;
2241
  padding: 30px;
css/style-modern-one.css CHANGED
@@ -1,181 +1,224 @@
1
- /*
2
- //Alternative: like the "invalid" state in the menu customizer.
3
- $hiddenItemBackground: #f6c9cc;
4
- $hiddenItemBorder: #f1acb1;
5
- //*/
6
- .ws_container {
7
- border: 0 solid transparent;
8
- background: #fafafa;
9
- -webkit-box-sizing: border-box;
10
- -moz-box-sizing: border-box;
11
- box-sizing: border-box;
12
- width: 304px;
13
- padding: 0;
14
- margin-top: 0;
15
- margin-bottom: 9px;
16
- margin-left: 10px;
17
- box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04); }
18
- .ws_container .ws_item_title {
19
- color: #23282D;
20
- padding-left: 0;
21
- font-weight: 600;
22
- font-size: 13px; }
23
- .ws_container .ws_item_head {
24
- border: 1px solid #dfdfdf;
25
- padding: 7px 0 7px 7px; }
26
- .ws_container .ws_flag_container .ws_custom_actor_permissions_flag,
27
- .ws_container .ws_flag_container .ws_custom_flag {
28
- display: none; }
29
-
30
- #ws_menu_editor.ws_is_actor_view input[type="checkbox"].ws_actor_access_checkbox {
31
- margin-right: 5px; }
32
-
33
- .ws_editbox {
34
- background: white;
35
- padding: 7px;
36
- border: 1px solid #dfdfdf;
37
- border-top-width: 0;
38
- -webkit-border-radius: 0;
39
- -moz-border-radius: 0;
40
- border-radius: 0; }
41
-
42
- a.ws_edit_link {
43
- background: transparent;
44
- color: #A0A5AA;
45
- text-align: center;
46
- border-radius: 0; }
47
- a.ws_edit_link::before {
48
- content: "\f140";
49
- font: normal 20px/1 dashicons;
50
- display: block; }
51
- a.ws_edit_link:hover {
52
- color: #777; }
53
-
54
- .ws_edit_link.ws_edit_link_expanded::before {
55
- content: "\f142"; }
56
-
57
- .ws_toolbar .ws_button {
58
- border: 1px solid #C0C0C0; }
59
-
60
- .ws_box {
61
- margin-top: 6px; }
62
-
63
- .ws_menu_separator .ws_item_head::after {
64
- content: '';
65
- display: inline-block;
66
- -webkit-box-sizing: border-box;
67
- -moz-box-sizing: border-box;
68
- box-sizing: border-box;
69
- vertical-align: middle;
70
- width: 249.28px;
71
- height: 0;
72
- border: 2px inset rgba(0, 0, 0, 0.2); }
73
- .ws_menu_separator .ws_item_title {
74
- width: 0;
75
- padding-left: 0;
76
- padding-right: 0; }
77
-
78
- .ws_menu.ws_active::after {
79
- right: -22px; }
80
-
81
- .ws_container.ws_active, .ws_container.ws_is_hidden_for_actor.ws_active {
82
- z-index: 2; }
83
- .ws_container.ws_active .ws_item_head, .ws_container.ws_is_hidden_for_actor.ws_active .ws_item_head {
84
- border-color: #999;
85
- background-color: #c7c7c7; }
86
- .ws_container.ws_active .ws_item_title, .ws_container.ws_is_hidden_for_actor.ws_active .ws_item_title {
87
- color: #23282D; }
88
- .ws_container.ws_active .ws_editbox, .ws_container.ws_is_hidden_for_actor.ws_active .ws_editbox {
89
- border-color: #999; }
90
-
91
- .ws_container.ws_is_hidden_for_actor .ws_item_head {
92
- border-color: #dfdfdf;
93
- background-color: #e3e3e3; }
94
- .ws_container.ws_is_hidden_for_actor .ws_editbox {
95
- border-color: #dfdfdf; }
96
- .ws_container.ws_is_hidden_for_actor .ws_item_title {
97
- color: #888; }
98
-
99
- .ws_compact_layout .ws_container {
100
- margin-top: -1px;
101
- margin-bottom: 0;
102
- -webkit-box-shadow: none;
103
- -moz-box-shadow: none;
104
- box-shadow: none; }
105
- .ws_compact_layout .ws_container .ws_item_head {
106
- padding-top: 4px;
107
- padding-bottom: 4px; }
108
- .ws_compact_layout .ws_container.ws_active {
109
- z-index: 2; }
110
- .ws_compact_layout .ws_container:last-child {
111
- margin-bottom: 9px; }
112
- .ws_compact_layout.ws_is_hidden_for_actor .ws_item_head, .ws_compact_layout.ws_is_hidden_for_actor .ws_editbox {
113
- border-color: #dfdfdf; }
114
- .ws_compact_layout.ws_active .ws_item_head, .ws_compact_layout.ws_active .ws_editbox {
115
- border-color: #999; }
116
-
117
- #ws_menu_editor #ws_toggle_editor_layout {
118
- display: block; }
119
-
120
- #ws_icon_selector, #ws_embedded_page_selector {
121
- z-index: 3; }
122
-
123
- .ws_container.ui-sortable-helper {
124
- box-shadow: 1px 3px 6px 0 rgba(1, 1, 1, 0.4); }
125
-
126
- .ws_main_container {
127
- width: 324px; }
128
- .ws_main_container .ws_toolbar {
129
- padding: 10px 10px 0; }
130
- .ws_main_container .ws_dropzone {
131
- margin-left: 10px;
132
- margin-right: 10px; }
133
-
134
- #ws_editor_sidebar {
135
- padding: 6px 10px; }
136
- #ws_editor_sidebar .ws_main_button {
137
- margin-left: 0;
138
- margin-right: 0; }
139
-
140
- .settings_page_menu_editor .ui-dialog {
141
- background: white;
142
- border: 1px solid #c0c0c0;
143
- border-radius: 0; }
144
- .settings_page_menu_editor .ui-dialog-titlebar {
145
- background-color: #fcfcfc;
146
- border-bottom: 1px solid #dfdfdf;
147
- height: auto;
148
- padding: 0; }
149
- .settings_page_menu_editor .ui-dialog-titlebar .ui-button.ui-dialog-titlebar-close {
150
- background: none;
151
- border-style: none;
152
- color: #666;
153
- cursor: pointer;
154
- padding: 0;
155
- margin: 0;
156
- position: absolute;
157
- top: 0;
158
- right: 0;
159
- width: 36px;
160
- height: 36px;
161
- text-align: center; }
162
- .settings_page_menu_editor .ui-dialog-titlebar .ui-button.ui-dialog-titlebar-close .ui-icon, .settings_page_menu_editor .ui-dialog-titlebar .ui-button.ui-dialog-titlebar-close .ui-button-text {
163
- display: none; }
164
- .settings_page_menu_editor .ui-dialog-titlebar .ui-dialog-titlebar-close::before {
165
- font: normal 20px/36px 'dashicons';
166
- content: '\f158';
167
- vertical-align: middle;
168
- width: 36px;
169
- height: 36px; }
170
- .settings_page_menu_editor .ui-dialog-titlebar .ui-dialog-titlebar-close:hover {
171
- background: transparent none;
172
- color: #2ea2cc; }
173
- .settings_page_menu_editor .ui-dialog-title {
174
- color: #444444;
175
- font-size: 18px;
176
- font-weight: 600;
177
- line-height: 36px;
178
- padding: 0 36px 0 8px;
179
- display: block; }
180
-
181
- /*# sourceMappingURL=style-modern-one.css.map */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ //Alternative: like the "invalid" state in the menu customizer.
3
+ $hiddenItemBackground: #f6c9cc;
4
+ $hiddenItemBorder: #f1acb1;
5
+ //*/
6
+ .ws_container {
7
+ border: 0 solid transparent;
8
+ background: #fafafa;
9
+ -webkit-box-sizing: border-box;
10
+ -moz-box-sizing: border-box;
11
+ box-sizing: border-box;
12
+ width: 304px;
13
+ padding: 0;
14
+ margin-top: 0;
15
+ margin-bottom: 9px;
16
+ margin-left: 10px;
17
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
18
+ }
19
+ .ws_container .ws_item_title {
20
+ color: #23282D;
21
+ padding-left: 0;
22
+ font-weight: 600;
23
+ font-size: 13px;
24
+ }
25
+ .ws_container .ws_item_head {
26
+ border: 1px solid #dfdfdf;
27
+ padding: 7px 0 7px 7px;
28
+ }
29
+ .ws_container .ws_flag_container .ws_custom_actor_permissions_flag,
30
+ .ws_container .ws_flag_container .ws_custom_flag {
31
+ display: none;
32
+ }
33
+
34
+ #ws_menu_editor.ws_is_actor_view input[type=checkbox].ws_actor_access_checkbox {
35
+ margin-right: 5px;
36
+ }
37
+
38
+ .ws_editbox {
39
+ background: white;
40
+ padding: 7px;
41
+ border: 1px solid #dfdfdf;
42
+ border-top-width: 0;
43
+ -webkit-border-radius: 0;
44
+ -moz-border-radius: 0;
45
+ border-radius: 0;
46
+ }
47
+
48
+ a.ws_edit_link {
49
+ background: transparent;
50
+ color: #A0A5AA;
51
+ text-align: center;
52
+ border-radius: 0;
53
+ }
54
+ a.ws_edit_link::before {
55
+ content: "\f140";
56
+ font: normal 20px/1 dashicons;
57
+ display: block;
58
+ }
59
+ a.ws_edit_link:hover {
60
+ color: #777;
61
+ }
62
+
63
+ .ws_edit_link.ws_edit_link_expanded::before {
64
+ content: "\f142";
65
+ }
66
+
67
+ .ws_toolbar .ws_button {
68
+ border: 1px solid #C0C0C0;
69
+ }
70
+
71
+ .ws_box {
72
+ margin-top: 6px;
73
+ }
74
+
75
+ .ws_menu_separator .ws_item_head::after {
76
+ content: "";
77
+ display: inline-block;
78
+ -webkit-box-sizing: border-box;
79
+ -moz-box-sizing: border-box;
80
+ box-sizing: border-box;
81
+ vertical-align: middle;
82
+ width: 249.28px;
83
+ height: 0;
84
+ border: 2px inset rgba(0, 0, 0, 0.2);
85
+ }
86
+ .ws_menu_separator .ws_item_title {
87
+ width: 0;
88
+ padding-left: 0;
89
+ padding-right: 0;
90
+ }
91
+
92
+ .ws_menu.ws_active::after {
93
+ right: -22px;
94
+ }
95
+
96
+ .ws_container.ws_active, .ws_container.ws_is_hidden_for_actor.ws_active {
97
+ z-index: 2;
98
+ }
99
+ .ws_container.ws_active .ws_item_head, .ws_container.ws_is_hidden_for_actor.ws_active .ws_item_head {
100
+ border-color: #999;
101
+ background-color: #c7c7c7;
102
+ }
103
+ .ws_container.ws_active .ws_item_title, .ws_container.ws_is_hidden_for_actor.ws_active .ws_item_title {
104
+ color: #23282D;
105
+ }
106
+ .ws_container.ws_active .ws_editbox, .ws_container.ws_is_hidden_for_actor.ws_active .ws_editbox {
107
+ border-color: #999;
108
+ }
109
+
110
+ .ws_container.ws_is_hidden_for_actor .ws_item_head {
111
+ border-color: #dfdfdf;
112
+ background-color: #e3e3e3;
113
+ }
114
+ .ws_container.ws_is_hidden_for_actor .ws_editbox {
115
+ border-color: #dfdfdf;
116
+ }
117
+ .ws_container.ws_is_hidden_for_actor .ws_item_title {
118
+ color: #888;
119
+ }
120
+
121
+ .ws_compact_layout .ws_container {
122
+ margin-top: -1px;
123
+ margin-bottom: 0;
124
+ -webkit-box-shadow: none;
125
+ -moz-box-shadow: none;
126
+ box-shadow: none;
127
+ }
128
+ .ws_compact_layout .ws_container .ws_item_head {
129
+ padding-top: 4px;
130
+ padding-bottom: 4px;
131
+ }
132
+ .ws_compact_layout .ws_container.ws_active {
133
+ z-index: 2;
134
+ }
135
+ .ws_compact_layout .ws_container:last-child {
136
+ margin-bottom: 9px;
137
+ }
138
+ .ws_compact_layout.ws_is_hidden_for_actor .ws_item_head, .ws_compact_layout.ws_is_hidden_for_actor .ws_editbox {
139
+ border-color: #dfdfdf;
140
+ }
141
+ .ws_compact_layout.ws_active .ws_item_head, .ws_compact_layout.ws_active .ws_editbox {
142
+ border-color: #999;
143
+ }
144
+
145
+ #ws_menu_editor #ws_toggle_editor_layout {
146
+ display: block;
147
+ }
148
+
149
+ #ws_icon_selector, #ws_embedded_page_selector {
150
+ z-index: 3;
151
+ }
152
+
153
+ .ws_container.ui-sortable-helper {
154
+ box-shadow: 1px 3px 6px 0 rgba(1, 1, 1, 0.4);
155
+ }
156
+
157
+ .ws_main_container {
158
+ width: 324px;
159
+ }
160
+ .ws_main_container .ws_toolbar {
161
+ padding: 10px 10px 0;
162
+ }
163
+ .ws_main_container .ws_dropzone {
164
+ margin-left: 10px;
165
+ margin-right: 10px;
166
+ }
167
+
168
+ #ws_editor_sidebar {
169
+ padding: 6px 10px;
170
+ }
171
+ #ws_editor_sidebar .ws_main_button {
172
+ margin-left: 0;
173
+ margin-right: 0;
174
+ }
175
+
176
+ .settings_page_menu_editor .ui-dialog {
177
+ background: white;
178
+ border: 1px solid #c0c0c0;
179
+ border-radius: 0;
180
+ }
181
+ .settings_page_menu_editor .ui-dialog-titlebar {
182
+ background-color: #fcfcfc;
183
+ border-bottom: 1px solid #dfdfdf;
184
+ height: auto;
185
+ padding: 0;
186
+ }
187
+ .settings_page_menu_editor .ui-dialog-titlebar .ui-button.ui-dialog-titlebar-close {
188
+ background: none;
189
+ border-style: none;
190
+ color: #666;
191
+ cursor: pointer;
192
+ padding: 0;
193
+ margin: 0;
194
+ position: absolute;
195
+ top: 0;
196
+ right: 0;
197
+ width: 36px;
198
+ height: 36px;
199
+ text-align: center;
200
+ }
201
+ .settings_page_menu_editor .ui-dialog-titlebar .ui-button.ui-dialog-titlebar-close .ui-icon, .settings_page_menu_editor .ui-dialog-titlebar .ui-button.ui-dialog-titlebar-close .ui-button-text {
202
+ display: none;
203
+ }
204
+ .settings_page_menu_editor .ui-dialog-titlebar .ui-dialog-titlebar-close::before {
205
+ font: normal 20px/36px "dashicons";
206
+ content: "\f158";
207
+ vertical-align: middle;
208
+ width: 36px;
209
+ height: 36px;
210
+ }
211
+ .settings_page_menu_editor .ui-dialog-titlebar .ui-dialog-titlebar-close:hover {
212
+ background: transparent none;
213
+ color: #2ea2cc;
214
+ }
215
+ .settings_page_menu_editor .ui-dialog-title {
216
+ color: #444444;
217
+ font-size: 18px;
218
+ font-weight: 600;
219
+ line-height: 36px;
220
+ padding: 0 36px 0 8px;
221
+ display: block;
222
+ }
223
+
224
+ /*# sourceMappingURL=style-modern-one.css.map */
css/style-modern-one.css.map ADDED
@@ -0,0 +1 @@
 
1
+ {"version":3,"sourceRoot":"","sources":["style-modern-one.scss"],"names":[],"mappings":"AAmBA;AAAA;AAAA;AAAA;AAAA;AAaA;EAGC;EACA,YApCgB;EAsChB;EACA;EACA;EAEA,OA9BW;EA+BX;EAEA;EACA,eAjCkB;EAkClB,aAduB;EAgBvB;;AAEA;EACC,OA9CS;EA+CT;EACA;EACA;;AAGD;EACC;EACA;;AAMA;AAAA;EAEC;;;AAKH;EACC;;;AAGD;EACC;EACA,SArEmB;EAuEnB;EACA;EAEA;EACA;EACA;;;AAGD;EACC;EACA;EAEA;EACA;;AAEA;EACC;EACA;EACA;;AAGD;EACC;;;AAIF;EACC;;;AAGD;EACC;;;AAGD;EACC;;;AAQA;EACC;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;EAGA;;AAGD;EACC;EACA;EACA;;;AAKF;EACC;;;AAMD;EACC;;AAEA;EACC,cA9ImB;EA+InB,kBAhJuB;;AAmJxB;EACC,OAlJiB;;AAqJlB;EACC,cAvJmB;;;AA+JpB;EACC,cA/KW;EAgLX,kBAxJqB;;AA2JtB;EACC,cApLW;;AAuLZ;EACC,OA9Je;;;AA0KhB;EACC;EACA;EAEA;EACA;EACA;;AAEA;EACC,aAXuB;EAYvB,gBAZuB;;AAqBxB;EACC;;AAIF;EACC,eAjNiB;;AAqNjB;EACC,cAlOU;;AAsOX;EACC,cAxNkB;;;AA6NrB;EACC;;;AAOD;EACC;;;AAOD;EACC;;;AAOD;EACC,OAxOoB;;AA0OpB;EACC;;AAGD;EACC,aAhPc;EAiPd,cAjPc;;;AAqPhB;EACC;;AAEA;EACC;EACA;;;AAUD;EACC;EACA;EACA;;AAGD;EACC;EACA;EACA;EACA;;AAEA;EACC;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;EAEA;;AAEA;EACC;;AAIF;EACC;EACA;EAEA;EACA;EACA;;AAGD;EACC;EACA;;AAIF;EACC;EACA;EACA;EACA;EAEA;EACA","file":"style-modern-one.css"}
includes/ame-utils.php CHANGED
@@ -101,6 +101,23 @@ class ameUtils {
101
  }
102
  return ucwords($input);
103
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
104
  }
105
 
106
  class ameFileLock {
101
  }
102
  return ucwords($input);
103
  }
104
+
105
+ /**
106
+ * Check if two arrays have the same keys and values. Arrays with string keys
107
+ * or mixed keys can be in different order and still be considered "equal".
108
+ *
109
+ * @param array $a
110
+ * @param array $b
111
+ * @return bool
112
+ */
113
+ public static function areAssocArraysEqual($a, $b) {
114
+ $secondArraySize = count($b);
115
+ if ( count($a) !== $secondArraySize ) {
116
+ return false;
117
+ }
118
+ $sameItems = array_intersect_assoc($a, $b);
119
+ return count($sameItems) === $secondArraySize;
120
+ }
121
  }
122
 
123
  class ameFileLock {
includes/consistency-check.php CHANGED
@@ -59,7 +59,6 @@ $requiredFiles = array(
59
  'js/menu-highlight-fix.js',
60
  'js/jquery.sort.js',
61
  'js/jquery.qtip.min.js',
62
- 'js/jquery.json.js',
63
  'images/cut.png',
64
  'images/delete.png',
65
  'images/page_white_add.png',
59
  'js/menu-highlight-fix.js',
60
  'js/jquery.sort.js',
61
  'js/jquery.qtip.min.js',
 
62
  'images/cut.png',
63
  'images/delete.png',
64
  'images/page_white_add.png',
includes/menu-editor-core.php CHANGED
@@ -340,6 +340,8 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
340
  'admin.php?page=wpgb-card-builder' => true,
341
  'admin.php?page=wpgb-grid-settings' => true,
342
  'admin.php?page=wpgb-facet-settings' => true,
 
 
343
  );
344
 
345
  //AJAXify screen options
@@ -580,6 +582,9 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
580
  //Let modules do something when loading a specific tab but before output starts.
581
  add_action('load-' . $page, array($this, 'trigger_tab_load_event'));
582
 
 
 
 
583
  //Compatibility fix for All In One Event Calendar; see the callback for details.
584
  add_action("admin_print_scripts-$page", array($this, 'dequeue_ai1ec_scripts'));
585
 
@@ -707,6 +712,20 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
707
  } else {
708
  do_action('admin_menu_editor-menu_replacement_skipped');
709
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
710
  }
711
 
712
  /**
@@ -865,6 +884,9 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
865
 
866
  $this->register_jquery_plugins();
867
 
 
 
 
868
  //Lodash library
869
  wp_register_auto_versioned_script('ame-lodash', plugins_url('js/lodash.min.js', $this->plugin_file));
870
 
@@ -1087,7 +1109,7 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
1087
  $editor_dependencies = array(
1088
  'jquery', 'jquery-ui-sortable', 'jquery-ui-dialog', 'jquery-ui-tabs',
1089
  'ame-jquery-form', 'jquery-ui-droppable', 'jquery-qtip',
1090
- 'jquery-sort', 'jquery-json', 'ame-jquery-cookie',
1091
  'wp-color-picker', 'ame-lodash', 'ame-access-editor', 'ame-actor-manager',
1092
  'ame-actor-selector',
1093
  );
@@ -1315,7 +1337,6 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
1315
  function enqueue_styles(){
1316
  wp_enqueue_auto_versioned_style('jquery-qtip-syle', plugins_url('css/jquery.qtip.min.css', $this->plugin_file), array());
1317
 
1318
- wp_register_auto_versioned_style('menu-editor-base-style', plugins_url('css/menu-editor.css', $this->plugin_file));
1319
  wp_register_auto_versioned_style(
1320
  'menu-editor-colours-classic',
1321
  plugins_url('css/style-classic.css', $this->plugin_file),
@@ -2023,12 +2044,13 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
2023
  }
2024
 
2025
  /**
2026
- * Prepare all of the children (i.e. submenu items) of a menu for output.
2027
  *
2028
  * @param array $menu A menu item.
 
2029
  * @return array
2030
  */
2031
- private function prepare_children_for_output($menu) {
2032
  if ( empty($menu['items']) ) {
2033
  return array();
2034
  }
@@ -2036,13 +2058,13 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
2036
  $new_items = array();
2037
 
2038
  foreach ($menu['items'] as $item) {
2039
- $item = $this->prepare_for_output($item, 'submenu', $menu);
2040
 
2041
  //Make a note of the page's correct title so we can fix it later if necessary.
2042
  $this->title_lookups[$item['file']] = !empty($item['page_title']) ? $item['page_title'] : $item['menu_title'];
2043
 
2044
  if ( !empty($item['items']) ) {
2045
- $item['items'] = $this->prepare_children_for_output($item);
2046
  }
2047
 
2048
  $new_items[] = $item;
@@ -2177,9 +2199,8 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
2177
  'css_class' => 'menu-top ' . $submenuClass,
2178
  'icon_url' => 'dashicons-menu',
2179
 
2180
- //To avoid ID clashes, it would be useful to give each menu a unique slug/URL.
2181
- //However, that breaks menu URL generation because WP also uses the parent URL for that.
2182
- //'file' => '#ds' . $submenuCounter . '-' . $item['file'],
2183
  )
2184
  );
2185
 
@@ -2223,20 +2244,26 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
2223
  * @param array $item Menu item in the internal format.
2224
  * @param string $item_type Either 'menu' or 'submenu'.
2225
  * @param array $parent Optional. The parent of this sub-menu item. Top level menus have no parent.
 
2226
  * @return array Menu item in the internal format.
2227
  */
2228
- private function prepare_for_output($item, $item_type = 'menu', $parent = array()) {
2229
  $parent_file = isset($parent['file']) ? $parent['file'] : null;
2230
 
2231
- // Special case : plugin pages that have been moved from a sub-menu to a different
2232
- // menu or the top level. We'll need to adjust the file field to point to the correct URL.
2233
- // This is required because WP identifies plugin pages using *both* the plugin file
2234
- // and the parent file.
 
 
 
 
 
2235
  if ( $item['template_id'] !== '' && empty($item['separator']) ) {
2236
  $template = $this->item_templates[$item['template_id']];
2237
  if ( $template['defaults']['is_plugin_page'] ) {
2238
  $default_parent = $template['defaults']['parent'];
2239
- if ( $parent_file != $default_parent ){
2240
  $item['file'] = $template['defaults']['url'];
2241
  }
2242
  }
@@ -2319,6 +2346,12 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
2319
  $item['icon_url'] = 'none';
2320
  }
2321
 
 
 
 
 
 
 
2322
  //Submenus must not have the "menu-top" class(-es). In WP versions that support submenu CSS classes,
2323
  //it can break menu display.
2324
  if ( !empty($item['css_class']) && ($item_type === 'submenu') ) {
@@ -3103,7 +3136,7 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
3103
  *
3104
  * @return string
3105
  */
3106
- private function get_settings_page_url() {
3107
  return $this->get_plugin_page_url(array('sub_section' => 'settings'));
3108
  }
3109
 
@@ -3552,6 +3585,7 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
3552
 
3553
  $best_item = null;
3554
  $best_extra_params = PHP_INT_MAX;
 
3555
 
3556
  $base_site_url = get_site_url();
3557
  if ( preg_match('@(^\w+://[^/]+)@', $base_site_url, $matches) ) { //Extract scheme + hostname.
@@ -3636,9 +3670,23 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
3636
  //The current URL must have as few extra parameters as possible.
3637
  $extra_params = $this->arrayDiffAssocRecursive($current_url['params'], $item_url['params']);
3638
 
3639
- if ( $is_close_match && (count($different_params) == 0) && (count($extra_params) < $best_extra_params) ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
3640
  $best_item = $item;
3641
  $best_extra_params = count($extra_params);
 
3642
  }
3643
  }
3644
 
@@ -3922,7 +3970,7 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
3922
  'ame-helper-style',
3923
  plugins_url('css/admin.css', $this->plugin_file),
3924
  array(),
3925
- '20210413'
3926
  );
3927
 
3928
  if ( $this->options['force_custom_dashicons'] ) {
@@ -4629,7 +4677,12 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
4629
  $dismissUrl = remove_query_arg(array('message', 'activate'), $dismissUrl);
4630
 
4631
  if ( is_multisite() && is_network_admin() ) {
4632
- $message = 'Tip: Go to any subsite to access Admin Menu Editor. It will not show up in the network admin.';
 
 
 
 
 
4633
  } else {
4634
  $message = 'Tip: Go to <a href="%1$s">Settings -&gt; %2$s</a> to start customizing the admin menu.';
4635
  }
@@ -4638,7 +4691,7 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
4638
  <p>' . $message . '</p>
4639
  <p><a href="%3$s" id="ame-hide-plugin-menu-notice">Hide this message</a></p>
4640
  </div>',
4641
- esc_attr(admin_url($this->settings_link)),
4642
  apply_filters('admin_menu_editor-self_menu_title', 'Menu Editor'),
4643
  esc_attr($dismissUrl)
4644
  );
@@ -4779,6 +4832,13 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
4779
  'className' => 'ameAdminBarHider',
4780
  'title' => '"Show the Toolbar" checkbox',
4781
  ),
 
 
 
 
 
 
 
4782
  'highlight-new-menus' => array(
4783
  'relativePath' => 'modules/highlight-new-menus/highlight-new-menus.php',
4784
  'className' => 'ameMenuHighlighterWrapper',
@@ -4807,7 +4867,16 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
4807
 
4808
  public function is_module_compatible($module) {
4809
  if ( !empty($module['requiredPhpVersion']) ) {
4810
- return version_compare(phpversion(), $module['requiredPhpVersion'], '>=');
 
 
 
 
 
 
 
 
 
4811
  }
4812
  return true;
4813
  }
@@ -4832,6 +4901,184 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
4832
  return $this->custom_menu_is_deep;
4833
  }
4834
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4835
  } //class
4836
 
4837
 
340
  'admin.php?page=wpgb-card-builder' => true,
341
  'admin.php?page=wpgb-grid-settings' => true,
342
  'admin.php?page=wpgb-facet-settings' => true,
343
+ //Google Analytics for WordPress by MonsterInsights 8.4.0
344
+ 'index.php?page=monsterinsights-getting-started' => true,
345
  );
346
 
347
  //AJAXify screen options
582
  //Let modules do something when loading a specific tab but before output starts.
583
  add_action('load-' . $page, array($this, 'trigger_tab_load_event'));
584
 
585
+ //Notify modules that the menu item has been registered.
586
+ do_action('admin_menu_editor-editor_menu_registered');
587
+
588
  //Compatibility fix for All In One Event Calendar; see the callback for details.
589
  add_action("admin_print_scripts-$page", array($this, 'dequeue_ai1ec_scripts'));
590
 
712
  } else {
713
  do_action('admin_menu_editor-menu_replacement_skipped');
714
  }
715
+
716
+ add_action(
717
+ 'admin_menu_editor-register_hideable_items',
718
+ array($this, 'register_hideable_items'),
719
+ 10,
720
+ 1
721
+ );
722
+
723
+ add_filter(
724
+ 'admin_menu_editor-save_hideable_items-admin-menu',
725
+ array($this, 'save_hideable_items'),
726
+ 10,
727
+ 2
728
+ );
729
  }
730
 
731
  /**
884
 
885
  $this->register_jquery_plugins();
886
 
887
+ //Base styles.
888
+ wp_register_auto_versioned_style('menu-editor-base-style', plugins_url('css/menu-editor.css', $this->plugin_file));
889
+
890
  //Lodash library
891
  wp_register_auto_versioned_script('ame-lodash', plugins_url('js/lodash.min.js', $this->plugin_file));
892
 
1109
  $editor_dependencies = array(
1110
  'jquery', 'jquery-ui-sortable', 'jquery-ui-dialog', 'jquery-ui-tabs',
1111
  'ame-jquery-form', 'jquery-ui-droppable', 'jquery-qtip',
1112
+ 'jquery-sort', 'ame-jquery-cookie',
1113
  'wp-color-picker', 'ame-lodash', 'ame-access-editor', 'ame-actor-manager',
1114
  'ame-actor-selector',
1115
  );
1337
  function enqueue_styles(){
1338
  wp_enqueue_auto_versioned_style('jquery-qtip-syle', plugins_url('css/jquery.qtip.min.css', $this->plugin_file), array());
1339
 
 
1340
  wp_register_auto_versioned_style(
1341
  'menu-editor-colours-classic',
1342
  plugins_url('css/style-classic.css', $this->plugin_file),
2044
  }
2045
 
2046
  /**
2047
+ * Prepare all the children (i.e. submenu items) of a menu for output.
2048
  *
2049
  * @param array $menu A menu item.
2050
+ * @param null|bool $is_deep
2051
  * @return array
2052
  */
2053
+ private function prepare_children_for_output($menu, $is_deep = null) {
2054
  if ( empty($menu['items']) ) {
2055
  return array();
2056
  }
2058
  $new_items = array();
2059
 
2060
  foreach ($menu['items'] as $item) {
2061
+ $item = $this->prepare_for_output($item, 'submenu', $menu, ($is_deep === true));
2062
 
2063
  //Make a note of the page's correct title so we can fix it later if necessary.
2064
  $this->title_lookups[$item['file']] = !empty($item['page_title']) ? $item['page_title'] : $item['menu_title'];
2065
 
2066
  if ( !empty($item['items']) ) {
2067
+ $item['items'] = $this->prepare_children_for_output($item, true);
2068
  }
2069
 
2070
  $new_items[] = $item;
2199
  'css_class' => 'menu-top ' . $submenuClass,
2200
  'icon_url' => 'dashicons-menu',
2201
 
2202
+ //To avoid submenu key collisions and ID clashes, let's give each menu a unique slug/URL.
2203
+ 'file' => '#ame-uds-p' . $submenuCounter . '-' . $item['file'],
 
2204
  )
2205
  );
2206
 
2244
  * @param array $item Menu item in the internal format.
2245
  * @param string $item_type Either 'menu' or 'submenu'.
2246
  * @param array $parent Optional. The parent of this sub-menu item. Top level menus have no parent.
2247
+ * @param bool $is_deep Optional. Whether this is a deeply nested menu item.
2248
  * @return array Menu item in the internal format.
2249
  */
2250
+ private function prepare_for_output($item, $item_type = 'menu', $parent = array(), $is_deep = false) {
2251
  $parent_file = isset($parent['file']) ? $parent['file'] : null;
2252
 
2253
+ /*
2254
+ * Special case: Items that use hooks and whose parent file has changed.
2255
+ * We'll need to set the "file" field to the fully qualified menu URL. This is required
2256
+ * because WP generates menu URLs using *both* the item file and the parent file.
2257
+ *
2258
+ * Applies to:
2259
+ * 1) Items that have been moved from one sub-menu to another, or to the top level.
2260
+ * 2) Deeply nested items. In this case, the parent slug is randomly generated.
2261
+ */
2262
  if ( $item['template_id'] !== '' && empty($item['separator']) ) {
2263
  $template = $this->item_templates[$item['template_id']];
2264
  if ( $template['defaults']['is_plugin_page'] ) {
2265
  $default_parent = $template['defaults']['parent'];
2266
+ if ( ($parent_file != $default_parent) || $is_deep ) {
2267
  $item['file'] = $template['defaults']['url'];
2268
  }
2269
  }
2346
  $item['icon_url'] = 'none';
2347
  }
2348
 
2349
+ //Set a flag on top level menus. It's used when determining the current
2350
+ //menu item based on the current URL.
2351
+ if ( $item_type === 'menu' ) {
2352
+ $item['is_top'] = true;
2353
+ }
2354
+
2355
  //Submenus must not have the "menu-top" class(-es). In WP versions that support submenu CSS classes,
2356
  //it can break menu display.
2357
  if ( !empty($item['css_class']) && ($item_type === 'submenu') ) {
3136
  *
3137
  * @return string
3138
  */
3139
+ public function get_settings_page_url() {
3140
  return $this->get_plugin_page_url(array('sub_section' => 'settings'));
3141
  }
3142
 
3585
 
3586
  $best_item = null;
3587
  $best_extra_params = PHP_INT_MAX;
3588
+ $best_is_submenu = false;
3589
 
3590
  $base_site_url = get_site_url();
3591
  if ( preg_match('@(^\w+://[^/]+)@', $base_site_url, $matches) ) { //Extract scheme + hostname.
3670
  //The current URL must have as few extra parameters as possible.
3671
  $extra_params = $this->arrayDiffAssocRecursive($current_url['params'], $item_url['params']);
3672
 
3673
+ $is_submenu = empty($item['is_top']);
3674
+
3675
+ if (
3676
+ $is_close_match
3677
+ && (count($different_params) == 0)
3678
+ && (
3679
+ (count($extra_params) < $best_extra_params)
3680
+ //When all else is equal, prefer submenu items.
3681
+ || (
3682
+ (count($extra_params) === $best_extra_params)
3683
+ && ($is_submenu && !$best_is_submenu)
3684
+ )
3685
+ )
3686
+ ) {
3687
  $best_item = $item;
3688
  $best_extra_params = count($extra_params);
3689
+ $best_is_submenu = $is_submenu;
3690
  }
3691
  }
3692
 
3970
  'ame-helper-style',
3971
  plugins_url('css/admin.css', $this->plugin_file),
3972
  array(),
3973
+ '20211207'
3974
  );
3975
 
3976
  if ( $this->options['force_custom_dashicons'] ) {
4677
  $dismissUrl = remove_query_arg(array('message', 'activate'), $dismissUrl);
4678
 
4679
  if ( is_multisite() && is_network_admin() ) {
4680
+ if ( $this->is_pro_version() ) {
4681
+ $message = 'Tip: Go to any subsite to edit the regular admin menu. Or go to <a href="%1$s">Settings -&gt; %2$s</a> '
4682
+ . 'in the network admin to edit the network admin menu, roles, and so on.';
4683
+ } else {
4684
+ $message = 'Tip: Go to any subsite to access Admin Menu Editor. It will not show up in the network admin.';
4685
+ }
4686
  } else {
4687
  $message = 'Tip: Go to <a href="%1$s">Settings -&gt; %2$s</a> to start customizing the admin menu.';
4688
  }
4691
  <p>' . $message . '</p>
4692
  <p><a href="%3$s" id="ame-hide-plugin-menu-notice">Hide this message</a></p>
4693
  </div>',
4694
+ esc_attr(self_admin_url($this->settings_link)),
4695
  apply_filters('admin_menu_editor-self_menu_title', 'Menu Editor'),
4696
  esc_attr($dismissUrl)
4697
  );
4832
  'className' => 'ameAdminBarHider',
4833
  'title' => '"Show the Toolbar" checkbox',
4834
  ),
4835
+ 'easy-hide' => array(
4836
+ 'relativePath' => 'extras/modules/easy-hide/easy-hide.php',
4837
+ 'className' => '\\YahnisElsts\\AdminMenuEditor\\EasyHide\\Core',
4838
+ 'title' => 'Easy Hide',
4839
+ 'requiredPhpVersion' => '5.6.20',
4840
+ 'requiredMethods' => array(array('WP_Error', 'merge_from')),
4841
+ ),
4842
  'highlight-new-menus' => array(
4843
  'relativePath' => 'modules/highlight-new-menus/highlight-new-menus.php',
4844
  'className' => 'ameMenuHighlighterWrapper',
4867
 
4868
  public function is_module_compatible($module) {
4869
  if ( !empty($module['requiredPhpVersion']) ) {
4870
+ if ( !version_compare(phpversion(), $module['requiredPhpVersion'], '>=') ) {
4871
+ return false;
4872
+ }
4873
+ }
4874
+ if ( !empty($module['requiredMethods']) ) {
4875
+ foreach ($module['requiredMethods'] as $item) {
4876
+ if ( !method_exists($item[0], $item[1]) ) {
4877
+ return false;
4878
+ }
4879
+ }
4880
  }
4881
  return true;
4882
  }
4901
  return $this->custom_menu_is_deep;
4902
  }
4903
 
4904
+ /**
4905
+ * @param \YahnisElsts\AdminMenuEditor\EasyHide\HideableItemStore $store
4906
+ * @return void
4907
+ */
4908
+ public function register_hideable_items($store) {
4909
+ try {
4910
+ $menu = $this->get_active_admin_menu();
4911
+ if ( empty($menu['tree']) ) {
4912
+ return;
4913
+ }
4914
+ } catch (LogicException $ex) {
4915
+ //This should never happen because the hiding module should
4916
+ //run after the menu is done, but let's not crash if it happens.
4917
+ return;
4918
+ }
4919
+
4920
+ $cat = $store->getOrCreateCategory(
4921
+ 'admin-menu',
4922
+ 'Admin Menu',
4923
+ null,
4924
+ true
4925
+ );
4926
+
4927
+ $this->register_menus_as_hideable($store, $menu['tree'], null, 1, $cat);
4928
+
4929
+ //Also, register visible components.
4930
+ //The word "component" is used in at least two distinct senses here, which is not ideal.
4931
+ $componentsByItemId = apply_filters('admin_menu_editor-hideable_vis_components', array());
4932
+ foreach($componentsByItemId as $itemId => $properties) {
4933
+ $store->addItem(
4934
+ $itemId,
4935
+ $properties['label'],
4936
+ array($store->getOrCreateCategory(
4937
+ 'admin-ui',
4938
+ 'General',
4939
+ null,
4940
+ true
4941
+ )->setSortPriority(1)),
4942
+ null,
4943
+ ameUtils::get($menu, array('component_visibility', $properties['component']), array()),
4944
+ 'admin-menu'
4945
+ );
4946
+ }
4947
+ }
4948
+
4949
+ /**
4950
+ * @param \YahnisElsts\AdminMenuEditor\EasyHide\HideableItemStore $store
4951
+ * @param array[] $menus
4952
+ */
4953
+ private function register_menus_as_hideable(
4954
+ $store,
4955
+ $menus,
4956
+ $parent,
4957
+ $level,
4958
+ $category
4959
+ ) {
4960
+ foreach ($menus as $key => $item) {
4961
+ $id = $this->make_hideable_item_id($item, $level);
4962
+
4963
+ $label = ameMenuItem::get($item, 'menu_title', '');
4964
+ if ( $label !== '' ) {
4965
+ $label = trim(strip_tags(ameMenuItem::remove_update_count($label)));
4966
+ } else {
4967
+ $label = '[' . $key . ']';
4968
+ }
4969
+
4970
+ $hideableItem = $store->addItem(
4971
+ $id,
4972
+ $label,
4973
+ array($category),
4974
+ $parent,
4975
+ isset($item['grant_access']) ? $item['grant_access'] : array(),
4976
+ 'admin-menu'
4977
+ );
4978
+
4979
+ if ( !empty($item['items']) ) {
4980
+ $this->register_menus_as_hideable(
4981
+ $store,
4982
+ $item['items'],
4983
+ $hideableItem,
4984
+ $level + 1,
4985
+ $category
4986
+ );
4987
+ }
4988
+ }
4989
+ }
4990
+
4991
+ /**
4992
+ * @param array $errors
4993
+ * @param array $items
4994
+ * @return array
4995
+ */
4996
+ public function save_hideable_items($errors, $items) {
4997
+ try {
4998
+ $menu = $this->get_active_admin_menu();
4999
+ if ( empty($menu['tree']) ) {
5000
+ return $errors;
5001
+ }
5002
+ } catch (LogicException $ex) {
5003
+ $errors[] = new WP_Error('no_admin_menu', 'Admin menu configuration is not initialised yet.');
5004
+ return $errors;
5005
+ }
5006
+
5007
+ $hasChanged = $this->update_hideable_menu_items($items, $menu['tree'], 1);
5008
+
5009
+ //Update component visibility. It's more efficient to do it here because we
5010
+ //don't need to re-save the whole menu configuration multiple times.
5011
+ if ( !isset($menu['component_visibility']) ) {
5012
+ $menu['component_visibility'] = array();
5013
+ }
5014
+ $componentsByItemId = apply_filters('admin_menu_editor-hideable_vis_components', array());
5015
+
5016
+ foreach($componentsByItemId as $itemId => $properties) {
5017
+ $component = $properties['component'];
5018
+ if ( isset($items[$itemId]) ) {
5019
+ $enabled = ameUtils::get($items[$itemId], 'enabled', array());
5020
+ $oldAccess = ameUtils::get($menu, array('component_visibility', $component), array());
5021
+ if ( !ameUtils::areAssocArraysEqual($enabled, $oldAccess) ) {
5022
+ $menu['component_visibility'][$component] = $enabled;
5023
+ $hasChanged = true;
5024
+ }
5025
+ }
5026
+ }
5027
+
5028
+ if ( $hasChanged ) {
5029
+ if ( !$this->set_custom_menu($menu) ) {
5030
+ $errors[] = new WP_Error('menu_update_failed', 'Failed to save the admin menu.');
5031
+ }
5032
+ }
5033
+
5034
+ return $errors;
5035
+ }
5036
+
5037
+ private function update_hideable_menu_items($hideableItems, &$menus, $level) {
5038
+ $hasChanged = false;
5039
+
5040
+ //Iterate over all admin menus and find the corresponding hideable items.
5041
+ //We could do it the other way around, but parsing IDs is more complex.
5042
+ foreach ($menus as &$menuItem) {
5043
+ $id = $this->make_hideable_item_id($menuItem, $level);
5044
+ if ( isset($hideableItems[$id]) ) {
5045
+ $settings = $hideableItems[$id];
5046
+ $newAccess = !empty($settings['enabled']) ? $settings['enabled'] : array();
5047
+ $oldAccess = isset($menuItem['grant_access']) ? $menuItem['grant_access'] : array();
5048
+
5049
+ $changes1 = array_diff_assoc($oldAccess, $newAccess);
5050
+ $changes2 = array_diff_assoc($newAccess, $oldAccess);
5051
+
5052
+ if ( !empty($changes1) || !empty($changes2) ) {
5053
+ $menuItem['grant_access'] = $newAccess;
5054
+ $hasChanged = true;
5055
+ }
5056
+ }
5057
+
5058
+ if ( !empty($menuItem['items']) ) {
5059
+ $submenusChanged = $this->update_hideable_menu_items(
5060
+ $hideableItems,
5061
+ $menuItem['items'],
5062
+ $level + 1
5063
+ );
5064
+ $hasChanged = $hasChanged || $submenusChanged;
5065
+ }
5066
+ }
5067
+ unset($menuItem); //Not strictly necessary. Just guarding against future bugs.
5068
+
5069
+ return $hasChanged;
5070
+ }
5071
+
5072
+ private function make_hideable_item_id($menuItem, $level) {
5073
+ $templateId = ameMenuItem::template_id($menuItem);
5074
+ if ( !empty($templateId) ) {
5075
+ $suffix = 't/' . $templateId;
5076
+ } else {
5077
+ $suffix = 'u/' . ameMenuItem::get($menuItem, 'file', '');
5078
+ }
5079
+ return 'am/' . $level . '/' . $suffix;
5080
+ }
5081
+
5082
  } //class
5083
 
5084
 
includes/menu-item.php CHANGED
@@ -33,6 +33,9 @@ abstract class ameMenuItem {
33
 
34
  private static $mappable_parent_whitelist = '@^(?:profile|import|post-new|edit-tags)\.php@';
35
 
 
 
 
36
  /**
37
  * Convert a WP menu structure to an associative array.
38
  *
@@ -261,6 +264,26 @@ abstract class ameMenuItem {
261
  $item_file = remove_query_arg('return', $item_file);
262
  }
263
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
264
  //Special case: A menu item can have an empty slug. This is technically very wrong, but it works (sort of)
265
  //as long as the item has at least one submenu. This has happened at least once in practice. A user had
266
  //a theme based on the Redux framework, and inexplicably the framework was configured to use an empty page slug.
@@ -682,4 +705,31 @@ abstract class ameMenuItem {
682
  }
683
  return $menuTitle;
684
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
685
  }
33
 
34
  private static $mappable_parent_whitelist = '@^(?:profile|import|post-new|edit-tags)\.php@';
35
 
36
+ private static $cached_site_url = null;
37
+ private static $is_switch_hook_set = false;
38
+
39
  /**
40
  * Convert a WP menu structure to an associative array.
41
  *
264
  $item_file = remove_query_arg('return', $item_file);
265
  }
266
 
267
+ //Special case: Remove the current site URL from fully qualified URLs.
268
+ //This way template IDs will still match if the menu configuration is imported on a different site.
269
+ if ( strpos($item_file, '://') !== false ) {
270
+ $site_url = self::get_site_url();
271
+ $site_url_length = strlen($site_url);
272
+ if (
273
+ ($site_url_length > 0)
274
+ //Does the item URL start with the site URL?
275
+ && (strncmp($item_file, $site_url, $site_url_length) === 0)
276
+ //Only cut off the site URL if there will be something left.
277
+ //We don't want the ID to be an empty string.
278
+ && (strlen($item_file) > $site_url_length)
279
+ ) {
280
+ //The site URL usually doesn't have a trailing slash, but sometimes it does,
281
+ //so we could end up either with "/wp-admin/foo.php" or "wp-admin/foo.php".
282
+ //For consistency, let's always prepend a slash to the result.
283
+ $item_file = '/' .ltrim(substr($item_file, $site_url_length), '/');
284
+ }
285
+ }
286
+
287
  //Special case: A menu item can have an empty slug. This is technically very wrong, but it works (sort of)
288
  //as long as the item has at least one submenu. This has happened at least once in practice. A user had
289
  //a theme based on the Redux framework, and inexplicably the framework was configured to use an empty page slug.
705
  }
706
  return $menuTitle;
707
  }
708
+
709
+ /**
710
+ * Get the current site URL.
711
+ *
712
+ * This is equivalent to calling the get_site_url() WordPress API function without
713
+ * arguments, except this method caches the result and doesn't run filters every time.
714
+ *
715
+ * @return string
716
+ */
717
+ private static function get_site_url() {
718
+ if ( self::$cached_site_url !== null ) {
719
+ return self::$cached_site_url;
720
+ }
721
+ self::$cached_site_url = get_site_url();
722
+
723
+ //Clear the cache when WordPress switches to a different site.
724
+ if ( !self::$is_switch_hook_set ) {
725
+ self::$is_switch_hook_set = true;
726
+ add_action('switch_blog', array(__CLASS__, 'clear_per_site_cache'), 10, 0);
727
+ }
728
+
729
+ return self::$cached_site_url;
730
+ }
731
+
732
+ public static function clear_per_site_cache() {
733
+ self::$cached_site_url = null;
734
+ }
735
  }
includes/settings-page.php CHANGED
@@ -79,7 +79,11 @@ $isProVersion = apply_filters('admin_menu_editor_is_pro', false);
79
  <?php checked( $settings['plugins_page_allowed_user_id'] !== null ); ?>
80
  <?php disabled( !$isProVersion || ($isMultisite && !is_super_admin()) ); ?>
81
  >
82
- Hide the "Admin Menu Editor<?php if ( $isProVersion ) { echo ' Pro'; } ?>" entry on the "Plugins" page from other users
 
 
 
 
83
  <?php if ( !$isProVersion ) {
84
  echo '(Pro version only)';
85
  } ?>
@@ -119,7 +123,7 @@ $isProVersion = apply_filters('admin_menu_editor_is_pro', false);
119
 
120
  <?php do_action('admin-menu-editor-display_addons'); ?>
121
 
122
- <tr>
123
  <th scope="row">
124
  Modules
125
  <a class="ws_tooltip_trigger"
79
  <?php checked( $settings['plugins_page_allowed_user_id'] !== null ); ?>
80
  <?php disabled( !$isProVersion || ($isMultisite && !is_super_admin()) ); ?>
81
  >
82
+ Hide "Admin Menu Editor<?php if ( $isProVersion ) { echo ' Pro'; } ?>"
83
+ <?php if ( defined('WS_ADMIN_BAR_EDITOR_FILE') || defined('AME_BRANDING_ADD_ON_FILE') ) {
84
+ echo 'and its add-ons';
85
+ } ?>
86
+ from the "Plugins" page for other users
87
  <?php if ( !$isProVersion ) {
88
  echo '(Pro version only)';
89
  } ?>
123
 
124
  <?php do_action('admin-menu-editor-display_addons'); ?>
125
 
126
+ <tr id="ame-available-modules">
127
  <th scope="row">
128
  Modules
129
  <a class="ws_tooltip_trigger"
includes/shortcodes.php CHANGED
@@ -20,6 +20,7 @@ class ameCoreShortcodes {
20
  add_shortcode('ame-wp-admin', array($this, 'handleAdminUrl'));
21
  add_shortcode('ame-home-url', array($this, 'handleHomeUrl'));
22
  add_shortcode('ame-user-info', array($this, 'handleUserInfo'));
 
23
  }
24
 
25
  /** @noinspection PhpUnusedParameterInspection Parameters are required by the shortcode API. */
@@ -69,8 +70,14 @@ class ameCoreShortcodes {
69
  $user = wp_get_current_user();
70
  }
71
 
 
 
 
 
 
 
72
  //Display the placeholder text if nobody is logged in or the user doesn't exist.
73
- if ( empty($user) || !isset($user->ID) || ($user->ID === 0) ) {
74
  return $placeholder;
75
  }
76
 
@@ -105,6 +112,17 @@ class ameCoreShortcodes {
105
  return $placeholder;
106
  }
107
 
 
 
 
 
 
 
 
 
 
 
 
108
  protected function identity($value) {
109
  return $value;
110
  }
20
  add_shortcode('ame-wp-admin', array($this, 'handleAdminUrl'));
21
  add_shortcode('ame-home-url', array($this, 'handleHomeUrl'));
22
  add_shortcode('ame-user-info', array($this, 'handleUserInfo'));
23
+ //todo: Maybe a "current post id" shortcode? Would be useful for toolbar links.
24
  }
25
 
26
  /** @noinspection PhpUnusedParameterInspection Parameters are required by the shortcode API. */
70
  $user = wp_get_current_user();
71
  }
72
 
73
+ //wp_get_current_user() won't work when this shortcode is used in a login redirect (for example),
74
+ //but we can try to get the current user from our "Redirects" module.
75
+ if ( !self::couldBeValidUserObject($user) ) {
76
+ $user = apply_filters('admin_menu_editor-redirected_user', null);
77
+ }
78
+
79
  //Display the placeholder text if nobody is logged in or the user doesn't exist.
80
+ if ( !self::couldBeValidUserObject($user) ) {
81
  return $placeholder;
82
  }
83
 
112
  return $placeholder;
113
  }
114
 
115
+ /**
116
+ * @param WP_User|null $user
117
+ * @return bool
118
+ */
119
+ protected static function couldBeValidUserObject($user) {
120
+ if ( empty($user) || !isset($user->ID) || ($user->ID === 0) ) {
121
+ return false;
122
+ }
123
+ return true;
124
+ }
125
+
126
  protected function identity($value) {
127
  return $value;
128
  }
js/actor-manager.js CHANGED
@@ -154,9 +154,7 @@ var AmeActorManager = /** @class */ (function () {
154
  var user = AmeUser.createFromProperties(userDetails);
155
  _this.users[user.userLogin] = user;
156
  });
157
- if (this.isMultisite) {
158
- this.superAdmin = new AmeSuperAdmin();
159
- }
160
  this.suspectedMetaCaps = suspectedMetaCaps;
161
  var exclusiveCaps = [
162
  'update_core', 'update_plugins', 'delete_plugins', 'install_plugins', 'upload_plugins', 'update_themes',
@@ -569,6 +567,97 @@ var AmeObservableActorSettings = /** @class */ (function () {
569
  }
570
  }
571
  };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
572
  return AmeObservableActorSettings;
573
  }());
574
  if (typeof wsAmeActorData !== 'undefined') {
154
  var user = AmeUser.createFromProperties(userDetails);
155
  _this.users[user.userLogin] = user;
156
  });
157
+ this.superAdmin = new AmeSuperAdmin();
 
 
158
  this.suspectedMetaCaps = suspectedMetaCaps;
159
  var exclusiveCaps = [
160
  'update_core', 'update_plugins', 'delete_plugins', 'install_plugins', 'upload_plugins', 'update_themes',
567
  }
568
  }
569
  };
570
+ AmeObservableActorSettings.prototype.isEnabledFor = function (selectedActor, allActors, roleDefault, superAdminDefault, noValueDefault, outIsIndeterminate) {
571
+ if (allActors === void 0) { allActors = null; }
572
+ if (roleDefault === void 0) { roleDefault = false; }
573
+ if (superAdminDefault === void 0) { superAdminDefault = null; }
574
+ if (noValueDefault === void 0) { noValueDefault = false; }
575
+ if (outIsIndeterminate === void 0) { outIsIndeterminate = null; }
576
+ if ((selectedActor === null) && (allActors === null)) {
577
+ throw 'When the selected actor is NULL, you must provide ' +
578
+ 'a list of all visible actors to determine if the item is enabled for all/any of them';
579
+ }
580
+ if (selectedActor === null) {
581
+ //All: Enabled only if it's enabled for all actors.
582
+ //Handle the theoretically impossible case where the actor list is empty.
583
+ var actorCount = allActors.length;
584
+ if (actorCount <= 0) {
585
+ return noValueDefault;
586
+ }
587
+ var isEnabledForSome = false, isDisabledForSome = false;
588
+ for (var index = 0; index < actorCount; index++) {
589
+ if (this.isEnabledFor(allActors[index], allActors, roleDefault, superAdminDefault, noValueDefault)) {
590
+ isEnabledForSome = true;
591
+ }
592
+ else {
593
+ isDisabledForSome = true;
594
+ }
595
+ }
596
+ if (outIsIndeterminate !== null) {
597
+ outIsIndeterminate(isEnabledForSome && isDisabledForSome);
598
+ }
599
+ return isEnabledForSome && (!isDisabledForSome);
600
+ }
601
+ //Is there an explicit setting for this actor?
602
+ var ownSetting = this.get(selectedActor.getId(), null);
603
+ if (ownSetting !== null) {
604
+ return ownSetting;
605
+ }
606
+ if (selectedActor instanceof AmeUser) {
607
+ //The "Super Admin" setting takes precedence over regular roles.
608
+ if (selectedActor.isSuperAdmin) {
609
+ var superAdminSetting = this.get(AmeSuperAdmin.permanentActorId, superAdminDefault);
610
+ if (superAdminSetting !== null) {
611
+ return superAdminSetting;
612
+ }
613
+ }
614
+ //Use role settings.
615
+ //Enabled for at least one role = enabled.
616
+ //Disabled for at least one role and no settings for other roles = disabled.
617
+ var isEnabled = null;
618
+ for (var i = 0; i < selectedActor.roles.length; i++) {
619
+ var roleSetting = this.get('role:' + selectedActor.roles[i], roleDefault);
620
+ if (roleSetting !== null) {
621
+ if (isEnabled === null) {
622
+ isEnabled = roleSetting;
623
+ }
624
+ else {
625
+ isEnabled = isEnabled || roleSetting;
626
+ }
627
+ }
628
+ }
629
+ if (isEnabled !== null) {
630
+ return isEnabled;
631
+ }
632
+ //If we get this far, it means that none of the user's roles have
633
+ //a setting for this item. Fall through to the final default.
634
+ }
635
+ return noValueDefault;
636
+ };
637
+ AmeObservableActorSettings.prototype.setEnabledFor = function (selectedActor, enabled, allActors, defaultValue) {
638
+ if (allActors === void 0) { allActors = null; }
639
+ if (defaultValue === void 0) { defaultValue = null; }
640
+ if ((selectedActor === null) && (allActors === null)) {
641
+ throw 'When the selected actor is NULL, you must provide ' +
642
+ 'a list of all visible actors so that the item can be enabled or disabled for all of them';
643
+ }
644
+ if (selectedActor === null) {
645
+ //Enable/disable the item for all actors.
646
+ if (enabled === defaultValue) {
647
+ //Since the new value is the same as the default,
648
+ //this is equivalent to removing all settings.
649
+ this.resetAll();
650
+ }
651
+ else {
652
+ for (var i = 0; i < allActors.length; i++) {
653
+ this.set(allActors[i].getId(), enabled);
654
+ }
655
+ }
656
+ }
657
+ else {
658
+ this.set(selectedActor.getId(), enabled);
659
+ }
660
+ };
661
  return AmeObservableActorSettings;
662
  }());
663
  if (typeof wsAmeActorData !== 'undefined') {
js/actor-manager.js.map ADDED
@@ -0,0 +1 @@
 
1
+ {"version":3,"file":"actor-manager.js","sourceRoot":"","sources":["actor-manager.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,oCAAoC;;;;;;;;;;;;;;AAuBpC;IAQC,sBAAsB,EAAU,EAAE,WAAmB,EAAE,YAA2B,EAAE,gBAAoC;QAApC,iCAAA,EAAA,qBAAoC;QANjH,gBAAW,GAAW,6BAA6B,CAAC;QAI3D,gBAAW,GAAa,EAAE,CAAC;QAG1B,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;IAC1C,CAAC;IAED;;;;;;;;OAQG;IACH,gCAAS,GAAT,UAAU,UAAkB;QAC3B,IAAI,IAAI,CAAC,YAAY,CAAC,cAAc,CAAC,UAAU,CAAC,EAAE;YACjD,OAAO,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;SACrC;QACD,IAAI,IAAI,CAAC,gBAAgB,CAAC,cAAc,CAAC,UAAU,CAAC,EAAE;YACrD,OAAO,IAAI,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;SACzC;QACD,OAAO,IAAI,CAAC;IACb,CAAC;IAEM,gCAAmB,GAA1B,UAA2B,OAAe;QACzC,IAAI,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,EACzD,WAAW,GAAG,CAAC,CAAC;QACjB,QAAQ,SAAS,EAAE;YAClB,KAAK,MAAM;gBACV,WAAW,GAAG,CAAC,CAAC;gBAChB,MAAM;YACP,KAAK,SAAS;gBACb,WAAW,GAAG,CAAC,CAAC;gBAChB,MAAM;YACP,KAAK,MAAM;gBACV,WAAW,GAAG,EAAE,CAAC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Ac,CAAC,iBAAiB,CAChC,CAAC;IAEF,IAAI,OAAO,cAAc,CAAC,UAAU,CAAC,KAAK,WAAW,EAAE;QACtD,SAAS,CAAC,6BAA6B,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,CAAC;KACpE;CACD"}
js/actor-manager.ts CHANGED
@@ -228,9 +228,7 @@ class AmeActorManager implements AmeActorManagerInterface {
228
  this.users[user.userLogin] = user;
229
  });
230
 
231
- if (this.isMultisite) {
232
- this.superAdmin = new AmeSuperAdmin();
233
- }
234
 
235
  this.suspectedMetaCaps = suspectedMetaCaps;
236
 
@@ -734,6 +732,112 @@ class AmeObservableActorSettings {
734
  }
735
  }
736
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
737
  }
738
 
739
  if (typeof wsAmeActorData !== 'undefined') {
228
  this.users[user.userLogin] = user;
229
  });
230
 
231
+ this.superAdmin = new AmeSuperAdmin();
 
 
232
 
233
  this.suspectedMetaCaps = suspectedMetaCaps;
234
 
732
  }
733
  }
734
  }
735
+
736
+ isEnabledFor(
737
+ selectedActor: IAmeActor | null,
738
+ allActors: IAmeActor[] | null = null,
739
+ roleDefault: boolean | null = false,
740
+ superAdminDefault: boolean | null = null,
741
+ noValueDefault: boolean = false,
742
+ outIsIndeterminate: KnockoutObservable<boolean> = null
743
+ ): boolean {
744
+ if ((selectedActor === null) && (allActors === null)) {
745
+ throw 'When the selected actor is NULL, you must provide ' +
746
+ 'a list of all visible actors to determine if the item is enabled for all/any of them';
747
+ }
748
+
749
+ if (selectedActor === null) {
750
+ //All: Enabled only if it's enabled for all actors.
751
+
752
+ //Handle the theoretically impossible case where the actor list is empty.
753
+ const actorCount = allActors.length;
754
+ if (actorCount <= 0) {
755
+ return noValueDefault;
756
+ }
757
+
758
+ let isEnabledForSome = false, isDisabledForSome = false;
759
+ for (let index = 0; index < actorCount; index++) {
760
+ if (this.isEnabledFor(allActors[index], allActors, roleDefault, superAdminDefault, noValueDefault)) {
761
+ isEnabledForSome = true;
762
+ } else {
763
+ isDisabledForSome = true;
764
+ }
765
+ }
766
+
767
+ if (outIsIndeterminate !== null) {
768
+ outIsIndeterminate(isEnabledForSome && isDisabledForSome);
769
+ }
770
+
771
+ return isEnabledForSome && (!isDisabledForSome);
772
+ }
773
+
774
+ //Is there an explicit setting for this actor?
775
+ let ownSetting = this.get(selectedActor.getId(), null);
776
+ if (ownSetting !== null) {
777
+ return ownSetting;
778
+ }
779
+
780
+ if (selectedActor instanceof AmeUser) {
781
+ //The "Super Admin" setting takes precedence over regular roles.
782
+ if (selectedActor.isSuperAdmin) {
783
+ let superAdminSetting = this.get(AmeSuperAdmin.permanentActorId, superAdminDefault);
784
+ if (superAdminSetting !== null) {
785
+ return superAdminSetting;
786
+ }
787
+ }
788
+
789
+ //Use role settings.
790
+ //Enabled for at least one role = enabled.
791
+ //Disabled for at least one role and no settings for other roles = disabled.
792
+ let isEnabled: boolean|null = null;
793
+ for (let i = 0; i < selectedActor.roles.length; i++) {
794
+ let roleSetting = this.get('role:' + selectedActor.roles[i], roleDefault);
795
+ if (roleSetting !== null) {
796
+ if (isEnabled === null) {
797
+ isEnabled = roleSetting;
798
+ } else {
799
+ isEnabled = isEnabled || roleSetting;
800
+ }
801
+ }
802
+ }
803
+
804
+ if (isEnabled !== null) {
805
+ return isEnabled;
806
+ }
807
+
808
+ //If we get this far, it means that none of the user's roles have
809
+ //a setting for this item. Fall through to the final default.
810
+ }
811
+
812
+ return noValueDefault;
813
+ }
814
+
815
+ setEnabledFor(
816
+ selectedActor: IAmeActor|null,
817
+ enabled: boolean,
818
+ allActors: IAmeActor[]|null = null,
819
+ defaultValue: boolean|null = null
820
+ ) {
821
+ if ((selectedActor === null) && (allActors === null)) {
822
+ throw 'When the selected actor is NULL, you must provide ' +
823
+ 'a list of all visible actors so that the item can be enabled or disabled for all of them';
824
+ }
825
+
826
+ if (selectedActor === null) {
827
+ //Enable/disable the item for all actors.
828
+ if (enabled === defaultValue) {
829
+ //Since the new value is the same as the default,
830
+ //this is equivalent to removing all settings.
831
+ this.resetAll();
832
+ } else {
833
+ for (let i = 0; i < allActors.length; i++) {
834
+ this.set(allActors[i].getId(), enabled);
835
+ }
836
+ }
837
+ } else {
838
+ this.set(selectedActor.getId(), enabled);
839
+ }
840
+ }
841
  }
842
 
843
  if (typeof wsAmeActorData !== 'undefined') {
js/jquery.qtip.min.js CHANGED
@@ -2,4 +2,3 @@
2
 
3
  !function(a,b,c){!function(a){"use strict";"function"==typeof define&&define.amd?define(["jquery"],a):jQuery&&!jQuery.fn.qtip&&a(jQuery)}(function(d){"use strict";function e(a,b,c,e){this.id=c,this.target=a,this.tooltip=F,this.elements={target:a},this._id=S+"-"+c,this.timers={img:{}},this.options=b,this.plugins={},this.cache={event:{},target:d(),disabled:E,attr:e,onTooltip:E,lastClass:""},this.rendered=this.destroyed=this.disabled=this.waiting=this.hiddenDuringWait=this.positioning=this.triggering=E}function f(a){return a===F||"object"!==d.type(a)}function g(a){return!(d.isFunction(a)||a&&a.attr||a.length||"object"===d.type(a)&&(a.jquery||a.then))}function h(a){var b,c,e,h;return f(a)?E:(f(a.metadata)&&(a.metadata={type:a.metadata}),"content"in a&&(b=a.content,f(b)||b.jquery||b.done?(c=g(b)?E:b,b=a.content={text:c}):c=b.text,"ajax"in b&&(e=b.ajax,h=e&&e.once!==E,delete b.ajax,b.text=function(a,b){var f=c||d(this).attr(b.options.content.attr)||"Loading...",g=d.ajax(d.extend({},e,{context:b})).then(e.success,F,e.error).then(function(a){return a&&h&&b.set("content.text",a),a},function(a,c,d){b.destroyed||0===a.status||b.set("content.text",c+": "+d)});return h?f:(b.set("content.text",f),g)}),"title"in b&&(d.isPlainObject(b.title)&&(b.button=b.title.button,b.title=b.title.text),g(b.title||E)&&(b.title=E))),"position"in a&&f(a.position)&&(a.position={my:a.position,at:a.position}),"show"in a&&f(a.show)&&(a.show=a.show.jquery?{target:a.show}:a.show===D?{ready:D}:{event:a.show}),"hide"in a&&f(a.hide)&&(a.hide=a.hide.jquery?{target:a.hide}:{event:a.hide}),"style"in a&&f(a.style)&&(a.style={classes:a.style}),d.each(R,function(){this.sanitize&&this.sanitize(a)}),a)}function i(a,b){for(var c,d=0,e=a,f=b.split(".");e=e[f[d++]];)d<f.length&&(c=e);return[c||a,f.pop()]}function j(a,b){var c,d,e;for(c in this.checks)if(this.checks.hasOwnProperty(c))for(d in this.checks[c])this.checks[c].hasOwnProperty(d)&&(e=new RegExp(d,"i").exec(a))&&(b.push(e),("builtin"===c||this.plugins[c])&&this.checks[c][d].apply(this.plugins[c]||this,b))}function k(a){return V.concat("").join(a?"-"+a+" ":" ")}function l(a,b){return b>0?setTimeout(d.proxy(a,this),b):void a.call(this)}function m(a){this.tooltip.hasClass(aa)||(clearTimeout(this.timers.show),clearTimeout(this.timers.hide),this.timers.show=l.call(this,function(){this.toggle(D,a)},this.options.show.delay))}function n(a){if(!this.tooltip.hasClass(aa)&&!this.destroyed){var b=d(a.relatedTarget),c=b.closest(W)[0]===this.tooltip[0],e=b[0]===this.options.show.target[0];if(clearTimeout(this.timers.show),clearTimeout(this.timers.hide),this!==b[0]&&"mouse"===this.options.position.target&&c||this.options.hide.fixed&&/mouse(out|leave|move)/.test(a.type)&&(c||e))try{a.preventDefault(),a.stopImmediatePropagation()}catch(f){}else this.timers.hide=l.call(this,function(){this.toggle(E,a)},this.options.hide.delay,this)}}function o(a){!this.tooltip.hasClass(aa)&&this.options.hide.inactive&&(clearTimeout(this.timers.inactive),this.timers.inactive=l.call(this,function(){this.hide(a)},this.options.hide.inactive))}function p(a){this.rendered&&this.tooltip[0].offsetWidth>0&&this.reposition(a)}function q(a,c,e){d(b.body).delegate(a,(c.split?c:c.join("."+S+" "))+"."+S,function(){var a=y.api[d.attr(this,U)];a&&!a.disabled&&e.apply(a,arguments)})}function r(a,c,f){var g,i,j,k,l,m=d(b.body),n=a[0]===b?m:a,o=a.metadata?a.metadata(f.metadata):F,p="html5"===f.metadata.type&&o?o[f.metadata.name]:F,q=a.data(f.metadata.name||"qtipopts");try{q="string"==typeof q?d.parseJSON(q):q}catch(r){}if(k=d.extend(D,{},y.defaults,f,"object"==typeof q?h(q):F,h(p||o)),i=k.position,k.id=c,"boolean"==typeof k.content.text){if(j=a.attr(k.content.attr),k.content.attr===E||!j)return E;k.content.text=j}if(i.container.length||(i.container=m),i.target===E&&(i.target=n),k.show.target===E&&(k.show.target=n),k.show.solo===D&&(k.show.solo=i.container.closest("body")),k.hide.target===E&&(k.hide.target=n),k.position.viewport===D&&(k.position.viewport=i.container),i.container=i.container.eq(0),i.at=new A(i.at,D),i.my=new A(i.my),a.data(S))if(k.overwrite)a.qtip("destroy",!0);else if(k.overwrite===E)return E;return a.attr(T,c),k.suppress&&(l=a.attr("title"))&&a.removeAttr("title").attr(ca,l).attr("title",""),g=new e(a,k,c,!!j),a.data(S,g),g}function s(a){return a.charAt(0).toUpperCase()+a.slice(1)}function t(a,b){var d,e,f=b.charAt(0).toUpperCase()+b.slice(1),g=(b+" "+va.join(f+" ")+f).split(" "),h=0;if(ua[b])return a.css(ua[b]);for(;d=g[h++];)if((e=a.css(d))!==c)return ua[b]=d,e}function u(a,b){return Math.ceil(parseFloat(t(a,b)))}function v(a,b){this._ns="tip",this.options=b,this.offset=b.offset,this.size=[b.width,b.height],this.qtip=a,this.init(a)}function w(a,b){this.options=b,this._ns="-modal",this.qtip=a,this.init(a)}function x(a){this._ns="ie6",this.qtip=a,this.init(a)}var y,z,A,B,C,D=!0,E=!1,F=null,G="x",H="y",I="width",J="height",K="top",L="left",M="bottom",N="right",O="center",P="flipinvert",Q="shift",R={},S="qtip",T="data-hasqtip",U="data-qtip-id",V=["ui-widget","ui-tooltip"],W="."+S,X="click dblclick mousedown mouseup mousemove mouseleave mouseenter".split(" "),Y=S+"-fixed",Z=S+"-default",$=S+"-focus",_=S+"-hover",aa=S+"-disabled",ba="_replacedByqTip",ca="oldtitle",da={ie:function(){var a,c;for(a=4,c=b.createElement("div");(c.innerHTML="<!--[if gt IE "+a+"]><i></i><![endif]-->")&&c.getElementsByTagName("i")[0];a+=1);return a>4?a:NaN}(),iOS:parseFloat((""+(/CPU.*OS ([0-9_]{1,5})|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent)||[0,""])[1]).replace("undefined","3_2").replace("_",".").replace("_",""))||E};z=e.prototype,z._when=function(a){return d.when.apply(d,a)},z.render=function(a){if(this.rendered||this.destroyed)return this;var b=this,c=this.options,e=this.cache,f=this.elements,g=c.content.text,h=c.content.title,i=c.content.button,j=c.position,k=[];return d.attr(this.target[0],"aria-describedby",this._id),e.posClass=this._createPosClass((this.position={my:j.my,at:j.at}).my),this.tooltip=f.tooltip=d("<div/>",{id:this._id,"class":[S,Z,c.style.classes,e.posClass].join(" "),width:c.style.width||"",height:c.style.height||"",tracking:"mouse"===j.target&&j.adjust.mouse,role:"alert","aria-live":"polite","aria-atomic":E,"aria-describedby":this._id+"-content","aria-hidden":D}).toggleClass(aa,this.disabled).attr(U,this.id).data(S,this).appendTo(j.container).append(f.content=d("<div />",{"class":S+"-content",id:this._id+"-content","aria-atomic":D})),this.rendered=-1,this.positioning=D,h&&(this._createTitle(),d.isFunction(h)||k.push(this._updateTitle(h,E))),i&&this._createButton(),d.isFunction(g)||k.push(this._updateContent(g,E)),this.rendered=D,this._setWidget(),d.each(R,function(a){var c;"render"===this.initialize&&(c=this(b))&&(b.plugins[a]=c)}),this._unassignEvents(),this._assignEvents(),this._when(k).then(function(){b._trigger("render"),b.positioning=E,b.hiddenDuringWait||!c.show.ready&&!a||b.toggle(D,e.event,E),b.hiddenDuringWait=E}),y.api[this.id]=this,this},z.destroy=function(a){function b(){if(!this.destroyed){this.destroyed=D;var a,b=this.target,c=b.attr(ca);this.rendered&&this.tooltip.stop(1,0).find("*").remove().end().remove(),d.each(this.plugins,function(){this.destroy&&this.destroy()});for(a in this.timers)this.timers.hasOwnProperty(a)&&clearTimeout(this.timers[a]);b.removeData(S).removeAttr(U).removeAttr(T).removeAttr("aria-describedby"),this.options.suppress&&c&&b.attr("title",c).removeAttr(ca),this._unassignEvents(),this.options=this.elements=this.cache=this.timers=this.plugins=this.mouse=F,delete y.api[this.id]}}return this.destroyed?this.target:(a===D&&"hide"!==this.triggering||!this.rendered?b.call(this):(this.tooltip.one("tooltiphidden",d.proxy(b,this)),!this.triggering&&this.hide()),this.target)},B=z.checks={builtin:{"^id$":function(a,b,c,e){var f=c===D?y.nextid:c,g=S+"-"+f;f!==E&&f.length>0&&!d("#"+g).length?(this._id=g,this.rendered&&(this.tooltip[0].id=this._id,this.elements.content[0].id=this._id+"-content",this.elements.title[0].id=this._id+"-title")):a[b]=e},"^prerender":function(a,b,c){c&&!this.rendered&&this.render(this.options.show.ready)},"^content.text$":function(a,b,c){this._updateContent(c)},"^content.attr$":function(a,b,c,d){this.options.content.text===this.target.attr(d)&&this._updateContent(this.target.attr(c))},"^content.title$":function(a,b,c){return c?(c&&!this.elements.title&&this._createTitle(),void this._updateTitle(c)):this._removeTitle()},"^content.button$":function(a,b,c){this._updateButton(c)},"^content.title.(text|button)$":function(a,b,c){this.set("content."+b,c)},"^position.(my|at)$":function(a,b,c){"string"==typeof c&&(this.position[b]=a[b]=new A(c,"at"===b))},"^position.container$":function(a,b,c){this.rendered&&this.tooltip.appendTo(c)},"^show.ready$":function(a,b,c){c&&(!this.rendered&&this.render(D)||this.toggle(D))},"^style.classes$":function(a,b,c,d){this.rendered&&this.tooltip.removeClass(d).addClass(c)},"^style.(width|height)":function(a,b,c){this.rendered&&this.tooltip.css(b,c)},"^style.widget|content.title":function(){this.rendered&&this._setWidget()},"^style.def":function(a,b,c){this.rendered&&this.tooltip.toggleClass(Z,!!c)},"^events.(render|show|move|hide|focus|blur)$":function(a,b,c){this.rendered&&this.tooltip[(d.isFunction(c)?"":"un")+"bind"]("tooltip"+b,c)},"^(show|hide|position).(event|target|fixed|inactive|leave|distance|viewport|adjust)":function(){if(this.rendered){var a=this.options.position;this.tooltip.attr("tracking","mouse"===a.target&&a.adjust.mouse),this._unassignEvents(),this._assignEvents()}}}},z.get=function(a){if(this.destroyed)return this;var b=i(this.options,a.toLowerCase()),c=b[0][b[1]];return c.precedance?c.string():c};var ea=/^position\.(my|at|adjust|target|container|viewport)|style|content|show\.ready/i,fa=/^prerender|show\.ready/i;z.set=function(a,b){if(this.destroyed)return this;var c,e=this.rendered,f=E,g=this.options;return"string"==typeof a?(c=a,a={},a[c]=b):a=d.extend({},a),d.each(a,function(b,c){if(e&&fa.test(b))return void delete a[b];var h,j=i(g,b.toLowerCase());h=j[0][j[1]],j[0][j[1]]=c&&c.nodeType?d(c):c,f=ea.test(b)||f,a[b]=[j[0],j[1],c,h]}),h(g),this.positioning=D,d.each(a,d.proxy(j,this)),this.positioning=E,this.rendered&&this.tooltip[0].offsetWidth>0&&f&&this.reposition("mouse"===g.position.target?F:this.cache.event),this},z._update=function(a,b){var c=this,e=this.cache;return this.rendered&&a?(d.isFunction(a)&&(a=a.call(this.elements.target,e.event,this)||""),d.isFunction(a.then)?(e.waiting=D,a.then(function(a){return e.waiting=E,c._update(a,b)},F,function(a){return c._update(a,b)})):a===E||!a&&""!==a?E:(a.jquery&&a.length>0?b.empty().append(a.css({display:"block",visibility:"visible"})):b.html(a),this._waitForContent(b).then(function(a){c.rendered&&c.tooltip[0].offsetWidth>0&&c.reposition(e.event,!a.length)}))):E},z._waitForContent=function(a){var b=this.cache;return b.waiting=D,(d.fn.imagesLoaded?a.imagesLoaded():(new d.Deferred).resolve([])).done(function(){b.waiting=E}).promise()},z._updateContent=function(a,b){this._update(a,this.elements.content,b)},z._updateTitle=function(a,b){this._update(a,this.elements.title,b)===E&&this._removeTitle(E)},z._createTitle=function(){var a=this.elements,b=this._id+"-title";a.titlebar&&this._removeTitle(),a.titlebar=d("<div />",{"class":S+"-titlebar "+(this.options.style.widget?k("header"):"")}).append(a.title=d("<div />",{id:b,"class":S+"-title","aria-atomic":D})).insertBefore(a.content).delegate(".qtip-close","mousedown keydown mouseup keyup mouseout",function(a){d(this).toggleClass("ui-state-active ui-state-focus","down"===a.type.substr(-4))}).delegate(".qtip-close","mouseover mouseout",function(a){d(this).toggleClass("ui-state-hover","mouseover"===a.type)}),this.options.content.button&&this._createButton()},z._removeTitle=function(a){var b=this.elements;b.title&&(b.titlebar.remove(),b.titlebar=b.title=b.button=F,a!==E&&this.reposition())},z._createPosClass=function(a){return S+"-pos-"+(a||this.options.position.my).abbrev()},z.reposition=function(c,e){if(!this.rendered||this.positioning||this.destroyed)return this;this.positioning=D;var f,g,h,i,j=this.cache,k=this.tooltip,l=this.options.position,m=l.target,n=l.my,o=l.at,p=l.viewport,q=l.container,r=l.adjust,s=r.method.split(" "),t=k.outerWidth(E),u=k.outerHeight(E),v=0,w=0,x=k.css("position"),y={left:0,top:0},z=k[0].offsetWidth>0,A=c&&"scroll"===c.type,B=d(a),C=q[0].ownerDocument,F=this.mouse;if(d.isArray(m)&&2===m.length)o={x:L,y:K},y={left:m[0],top:m[1]};else if("mouse"===m)o={x:L,y:K},(!r.mouse||this.options.hide.distance)&&j.origin&&j.origin.pageX?c=j.origin:!c||c&&("resize"===c.type||"scroll"===c.type)?c=j.event:F&&F.pageX&&(c=F),"static"!==x&&(y=q.offset()),C.body.offsetWidth!==(a.innerWidth||C.documentElement.clientWidth)&&(g=d(b.body).offset()),y={left:c.pageX-y.left+(g&&g.left||0),top:c.pageY-y.top+(g&&g.top||0)},r.mouse&&A&&F&&(y.left-=(F.scrollX||0)-B.scrollLeft(),y.top-=(F.scrollY||0)-B.scrollTop());else{if("event"===m?c&&c.target&&"scroll"!==c.type&&"resize"!==c.type?j.target=d(c.target):c.target||(j.target=this.elements.target):"event"!==m&&(j.target=d(m.jquery?m:this.elements.target)),m=j.target,m=d(m).eq(0),0===m.length)return this;m[0]===b||m[0]===a?(v=da.iOS?a.innerWidth:m.width(),w=da.iOS?a.innerHeight:m.height(),m[0]===a&&(y={top:(p||m).scrollTop(),left:(p||m).scrollLeft()})):R.imagemap&&m.is("area")?f=R.imagemap(this,m,o,R.viewport?s:E):R.svg&&m&&m[0].ownerSVGElement?f=R.svg(this,m,o,R.viewport?s:E):(v=m.outerWidth(E),w=m.outerHeight(E),y=m.offset()),f&&(v=f.width,w=f.height,g=f.offset,y=f.position),y=this.reposition.offset(m,y,q),(da.iOS>3.1&&da.iOS<4.1||da.iOS>=4.3&&da.iOS<4.33||!da.iOS&&"fixed"===x)&&(y.left-=B.scrollLeft(),y.top-=B.scrollTop()),(!f||f&&f.adjustable!==E)&&(y.left+=o.x===N?v:o.x===O?v/2:0,y.top+=o.y===M?w:o.y===O?w/2:0)}return y.left+=r.x+(n.x===N?-t:n.x===O?-t/2:0),y.top+=r.y+(n.y===M?-u:n.y===O?-u/2:0),R.viewport?(h=y.adjusted=R.viewport(this,y,l,v,w,t,u),g&&h.left&&(y.left+=g.left),g&&h.top&&(y.top+=g.top),h.my&&(this.position.my=h.my)):y.adjusted={left:0,top:0},j.posClass!==(i=this._createPosClass(this.position.my))&&(j.posClass=i,k.removeClass(j.posClass).addClass(i)),this._trigger("move",[y,p.elem||p],c)?(delete y.adjusted,e===E||!z||isNaN(y.left)||isNaN(y.top)||"mouse"===m||!d.isFunction(l.effect)?k.css(y):d.isFunction(l.effect)&&(l.effect.call(k,this,d.extend({},y)),k.queue(function(a){d(this).css({opacity:"",height:""}),da.ie&&this.style.removeAttribute("filter"),a()})),this.positioning=E,this):this},z.reposition.offset=function(a,c,e){function f(a,b){c.left+=b*a.scrollLeft(),c.top+=b*a.scrollTop()}if(!e[0])return c;var g,h,i,j,k=d(a[0].ownerDocument),l=!!da.ie&&"CSS1Compat"!==b.compatMode,m=e[0];do"static"!==(h=d.css(m,"position"))&&("fixed"===h?(i=m.getBoundingClientRect(),f(k,-1)):(i=d(m).position(),i.left+=parseFloat(d.css(m,"borderLeftWidth"))||0,i.top+=parseFloat(d.css(m,"borderTopWidth"))||0),c.left-=i.left+(parseFloat(d.css(m,"marginLeft"))||0),c.top-=i.top+(parseFloat(d.css(m,"marginTop"))||0),g||"hidden"===(j=d.css(m,"overflow"))||"visible"===j||(g=d(m)));while(m=m.offsetParent);return g&&(g[0]!==k[0]||l)&&f(g,1),c};var ga=(A=z.reposition.Corner=function(a,b){a=(""+a).replace(/([A-Z])/," $1").replace(/middle/gi,O).toLowerCase(),this.x=(a.match(/left|right/i)||a.match(/center/)||["inherit"])[0].toLowerCase(),this.y=(a.match(/top|bottom|center/i)||["inherit"])[0].toLowerCase(),this.forceY=!!b;var c=a.charAt(0);this.precedance="t"===c||"b"===c?H:G}).prototype;ga.invert=function(a,b){this[a]=this[a]===L?N:this[a]===N?L:b||this[a]},ga.string=function(a){var b=this.x,c=this.y,d=b!==c?"center"===b||"center"!==c&&(this.precedance===H||this.forceY)?[c,b]:[b,c]:[b];return a!==!1?d.join(" "):d},ga.abbrev=function(){var a=this.string(!1);return a[0].charAt(0)+(a[1]&&a[1].charAt(0)||"")},ga.clone=function(){return new A(this.string(),this.forceY)},z.toggle=function(a,c){var e=this.cache,f=this.options,g=this.tooltip;if(c){if(/over|enter/.test(c.type)&&e.event&&/out|leave/.test(e.event.type)&&f.show.target.add(c.target).length===f.show.target.length&&g.has(c.relatedTarget).length)return this;e.event=d.event.fix(c)}if(this.waiting&&!a&&(this.hiddenDuringWait=D),!this.rendered)return a?this.render(1):this;if(this.destroyed||this.disabled)return this;var h,i,j,k=a?"show":"hide",l=this.options[k],m=this.options.position,n=this.options.content,o=this.tooltip.css("width"),p=this.tooltip.is(":visible"),q=a||1===l.target.length,r=!c||l.target.length<2||e.target[0]===c.target;return(typeof a).search("boolean|number")&&(a=!p),h=!g.is(":animated")&&p===a&&r,i=h?F:!!this._trigger(k,[90]),this.destroyed?this:(i!==E&&a&&this.focus(c),!i||h?this:(d.attr(g[0],"aria-hidden",!a),a?(this.mouse&&(e.origin=d.event.fix(this.mouse)),d.isFunction(n.text)&&this._updateContent(n.text,E),d.isFunction(n.title)&&this._updateTitle(n.title,E),!C&&"mouse"===m.target&&m.adjust.mouse&&(d(b).bind("mousemove."+S,this._storeMouse),C=D),o||g.css("width",g.outerWidth(E)),this.reposition(c,arguments[2]),o||g.css("width",""),l.solo&&("string"==typeof l.solo?d(l.solo):d(W,l.solo)).not(g).not(l.target).qtip("hide",new d.Event("tooltipsolo"))):(clearTimeout(this.timers.show),delete e.origin,C&&!d(W+'[tracking="true"]:visible',l.solo).not(g).length&&(d(b).unbind("mousemove."+S),C=E),this.blur(c)),j=d.proxy(function(){a?(da.ie&&g[0].style.removeAttribute("filter"),g.css("overflow",""),"string"==typeof l.autofocus&&d(this.options.show.autofocus,g).focus(),this.options.show.target.trigger("qtip-"+this.id+"-inactive")):g.css({display:"",visibility:"",opacity:"",left:"",top:""}),this._trigger(a?"visible":"hidden")},this),l.effect===E||q===E?(g[k](),j()):d.isFunction(l.effect)?(g.stop(1,1),l.effect.call(g,this),g.queue("fx",function(a){j(),a()})):g.fadeTo(90,a?1:0,j),a&&l.target.trigger("qtip-"+this.id+"-inactive"),this))},z.show=function(a){return this.toggle(D,a)},z.hide=function(a){return this.toggle(E,a)},z.focus=function(a){if(!this.rendered||this.destroyed)return this;var b=d(W),c=this.tooltip,e=parseInt(c[0].style.zIndex,10),f=y.zindex+b.length;return c.hasClass($)||this._trigger("focus",[f],a)&&(e!==f&&(b.each(function(){this.style.zIndex>e&&(this.style.zIndex=this.style.zIndex-1)}),b.filter("."+$).qtip("blur",a)),c.addClass($)[0].style.zIndex=f),this},z.blur=function(a){return!this.rendered||this.destroyed?this:(this.tooltip.removeClass($),this._trigger("blur",[this.tooltip.css("zIndex")],a),this)},z.disable=function(a){return this.destroyed?this:("toggle"===a?a=!(this.rendered?this.tooltip.hasClass(aa):this.disabled):"boolean"!=typeof a&&(a=D),this.rendered&&this.tooltip.toggleClass(aa,a).attr("aria-disabled",a),this.disabled=!!a,this)},z.enable=function(){return this.disable(E)},z._createButton=function(){var a=this,b=this.elements,c=b.tooltip,e=this.options.content.button,f="string"==typeof e,g=f?e:"Close tooltip";b.button&&b.button.remove(),e.jquery?b.button=e:b.button=d("<a />",{"class":"qtip-close "+(this.options.style.widget?"":S+"-icon"),title:g,"aria-label":g}).prepend(d("<span />",{"class":"ui-icon ui-icon-close",html:"&times;"})),b.button.appendTo(b.titlebar||c).attr("role","button").click(function(b){return c.hasClass(aa)||a.hide(b),E})},z._updateButton=function(a){if(!this.rendered)return E;var b=this.elements.button;a?this._createButton():b.remove()},z._setWidget=function(){var a=this.options.style.widget,b=this.elements,c=b.tooltip,d=c.hasClass(aa);c.removeClass(aa),aa=a?"ui-state-disabled":"qtip-disabled",c.toggleClass(aa,d),c.toggleClass("ui-helper-reset "+k(),a).toggleClass(Z,this.options.style.def&&!a),b.content&&b.content.toggleClass(k("content"),a),b.titlebar&&b.titlebar.toggleClass(k("header"),a),b.button&&b.button.toggleClass(S+"-icon",!a)},z._storeMouse=function(a){return(this.mouse=d.event.fix(a)).type="mousemove",this},z._bind=function(a,b,c,e,f){if(a&&c&&b.length){var g="."+this._id+(e?"-"+e:"");return d(a).bind((b.split?b:b.join(g+" "))+g,d.proxy(c,f||this)),this}},z._unbind=function(a,b){return a&&d(a).unbind("."+this._id+(b?"-"+b:"")),this},z._trigger=function(a,b,c){var e=new d.Event("tooltip"+a);return e.originalEvent=c&&d.extend({},c)||this.cache.event||F,this.triggering=a,this.tooltip.trigger(e,[this].concat(b||[])),this.triggering=E,!e.isDefaultPrevented()},z._bindEvents=function(a,b,c,e,f,g){var h=c.filter(e).add(e.filter(c)),i=[];h.length&&(d.each(b,function(b,c){var e=d.inArray(c,a);e>-1&&i.push(a.splice(e,1)[0])}),i.length&&(this._bind(h,i,function(a){var b=this.rendered?this.tooltip[0].offsetWidth>0:!1;(b?g:f).call(this,a)}),c=c.not(h),e=e.not(h))),this._bind(c,a,f),this._bind(e,b,g)},z._assignInitialEvents=function(a){function b(a){return this.disabled||this.destroyed?E:(this.cache.event=a&&d.event.fix(a),this.cache.target=a&&d(a.target),clearTimeout(this.timers.show),void(this.timers.show=l.call(this,function(){this.render("object"==typeof a||c.show.ready)},c.prerender?0:c.show.delay)))}var c=this.options,e=c.show.target,f=c.hide.target,g=c.show.event?d.trim(""+c.show.event).split(" "):[],h=c.hide.event?d.trim(""+c.hide.event).split(" "):[];this._bind(this.elements.target,["remove","removeqtip"],function(){this.destroy(!0)},"destroy"),/mouse(over|enter)/i.test(c.show.event)&&!/mouse(out|leave)/i.test(c.hide.event)&&h.push("mouseleave"),this._bind(e,"mousemove",function(a){this._storeMouse(a),this.cache.onTarget=D}),this._bindEvents(g,h,e,f,b,function(){return this.timers?void clearTimeout(this.timers.show):E}),(c.show.ready||c.prerender)&&b.call(this,a)},z._assignEvents=function(){var c=this,e=this.options,f=e.position,g=this.tooltip,h=e.show.target,i=e.hide.target,j=f.container,k=f.viewport,l=d(b),q=d(a),r=e.show.event?d.trim(""+e.show.event).split(" "):[],s=e.hide.event?d.trim(""+e.hide.event).split(" "):[];d.each(e.events,function(a,b){c._bind(g,"toggle"===a?["tooltipshow","tooltiphide"]:["tooltip"+a],b,null,g)}),/mouse(out|leave)/i.test(e.hide.event)&&"window"===e.hide.leave&&this._bind(l,["mouseout","blur"],function(a){/select|option/.test(a.target.nodeName)||a.relatedTarget||this.hide(a)}),e.hide.fixed?i=i.add(g.addClass(Y)):/mouse(over|enter)/i.test(e.show.event)&&this._bind(i,"mouseleave",function(){clearTimeout(this.timers.show)}),(""+e.hide.event).indexOf("unfocus")>-1&&this._bind(j.closest("html"),["mousedown","touchstart"],function(a){var b=d(a.target),c=this.rendered&&!this.tooltip.hasClass(aa)&&this.tooltip[0].offsetWidth>0,e=b.parents(W).filter(this.tooltip[0]).length>0;b[0]===this.target[0]||b[0]===this.tooltip[0]||e||this.target.has(b[0]).length||!c||this.hide(a)}),"number"==typeof e.hide.inactive&&(this._bind(h,"qtip-"+this.id+"-inactive",o,"inactive"),this._bind(i.add(g),y.inactiveEvents,o)),this._bindEvents(r,s,h,i,m,n),this._bind(h.add(g),"mousemove",function(a){if("number"==typeof e.hide.distance){var b=this.cache.origin||{},c=this.options.hide.distance,d=Math.abs;(d(a.pageX-b.pageX)>=c||d(a.pageY-b.pageY)>=c)&&this.hide(a)}this._storeMouse(a)}),"mouse"===f.target&&f.adjust.mouse&&(e.hide.event&&this._bind(h,["mouseenter","mouseleave"],function(a){return this.cache?void(this.cache.onTarget="mouseenter"===a.type):E}),this._bind(l,"mousemove",function(a){this.rendered&&this.cache.onTarget&&!this.tooltip.hasClass(aa)&&this.tooltip[0].offsetWidth>0&&this.reposition(a)})),(f.adjust.resize||k.length)&&this._bind(d.event.special.resize?k:q,"resize",p),f.adjust.scroll&&this._bind(q.add(f.container),"scroll",p)},z._unassignEvents=function(){var c=this.options,e=c.show.target,f=c.hide.target,g=d.grep([this.elements.target[0],this.rendered&&this.tooltip[0],c.position.container[0],c.position.viewport[0],c.position.container.closest("html")[0],a,b],function(a){return"object"==typeof a});e&&e.toArray&&(g=g.concat(e.toArray())),f&&f.toArray&&(g=g.concat(f.toArray())),this._unbind(g)._unbind(g,"destroy")._unbind(g,"inactive")},d(function(){q(W,["mouseenter","mouseleave"],function(a){var b="mouseenter"===a.type,c=d(a.currentTarget),e=d(a.relatedTarget||a.target),f=this.options;b?(this.focus(a),c.hasClass(Y)&&!c.hasClass(aa)&&clearTimeout(this.timers.hide)):"mouse"===f.position.target&&f.position.adjust.mouse&&f.hide.event&&f.show.target&&!e.closest(f.show.target[0]).length&&this.hide(a),c.toggleClass(_,b)}),q("["+U+"]",X,o)}),y=d.fn.qtip=function(a,b,e){var f=(""+a).toLowerCase(),g=F,i=d.makeArray(arguments).slice(1),j=i[i.length-1],k=this[0]?d.data(this[0],S):F;return!arguments.length&&k||"api"===f?k:"string"==typeof a?(this.each(function(){var a=d.data(this,S);if(!a)return D;if(j&&j.timeStamp&&(a.cache.event=j),!b||"option"!==f&&"options"!==f)a[f]&&a[f].apply(a,i);else{if(e===c&&!d.isPlainObject(b))return g=a.get(b),E;a.set(b,e)}}),g!==F?g:this):"object"!=typeof a&&arguments.length?void 0:(k=h(d.extend(D,{},a)),this.each(function(a){var b,c;return c=d.isArray(k.id)?k.id[a]:k.id,c=!c||c===E||c.length<1||y.api[c]?y.nextid++:c,b=r(d(this),c,k),b===E?D:(y.api[c]=b,d.each(R,function(){"initialize"===this.initialize&&this(b)}),void b._assignInitialEvents(j))}))},d.qtip=e,y.api={},d.each({attr:function(a,b){if(this.length){var c=this[0],e="title",f=d.data(c,"qtip");if(a===e&&f&&f.options&&"object"==typeof f&&"object"==typeof f.options&&f.options.suppress)return arguments.length<2?d.attr(c,ca):(f&&f.options.content.attr===e&&f.cache.attr&&f.set("content.text",b),this.attr(ca,b))}return d.fn["attr"+ba].apply(this,arguments)},clone:function(a){var b=d.fn["clone"+ba].apply(this,arguments);return a||b.filter("["+ca+"]").attr("title",function(){return d.attr(this,ca)}).removeAttr(ca),b}},function(a,b){if(!b||d.fn[a+ba])return D;var c=d.fn[a+ba]=d.fn[a];d.fn[a]=function(){return b.apply(this,arguments)||c.apply(this,arguments)}}),d.ui||(d["cleanData"+ba]=d.cleanData,d.cleanData=function(a){for(var b,c=0;(b=d(a[c])).length;c++)if(b.attr(T))try{b.triggerHandler("removeqtip")}catch(e){}d["cleanData"+ba].apply(this,arguments)}),y.version="3.0.3",y.nextid=0,y.inactiveEvents=X,y.zindex=15e3,y.defaults={prerender:E,id:E,overwrite:D,suppress:D,content:{text:D,attr:"title",title:E,button:E},position:{my:"top left",at:"bottom right",target:E,container:E,viewport:E,adjust:{x:0,y:0,mouse:D,scroll:D,resize:D,method:"flipinvert flipinvert"},effect:function(a,b){d(this).animate(b,{duration:200,queue:E})}},show:{target:E,event:"mouseenter",effect:D,delay:90,solo:E,ready:E,autofocus:E},hide:{target:E,event:"mouseleave",effect:D,delay:0,fixed:E,inactive:E,leave:"window",distance:E},style:{classes:"",widget:E,width:E,height:E,def:D},events:{render:F,move:F,show:F,hide:F,toggle:F,visible:F,hidden:F,focus:F,blur:F}};var ha,ia,ja,ka,la,ma="margin",na="border",oa="color",pa="background-color",qa="transparent",ra=" !important",sa=!!b.createElement("canvas").getContext,ta=/rgba?\(0, 0, 0(, 0)?\)|transparent|#123456/i,ua={},va=["Webkit","O","Moz","ms"];sa?(ka=a.devicePixelRatio||1,la=function(){var a=b.createElement("canvas").getContext("2d");return a.backingStorePixelRatio||a.webkitBackingStorePixelRatio||a.mozBackingStorePixelRatio||a.msBackingStorePixelRatio||a.oBackingStorePixelRatio||1}(),ja=ka/la):ia=function(a,b,c){return"<qtipvml:"+a+' xmlns="urn:schemas-microsoft.com:vml" class="qtip-vml" '+(b||"")+' style="behavior: url(#default#VML); '+(c||"")+'" />'},d.extend(v.prototype,{init:function(a){var b,c;c=this.element=a.elements.tip=d("<div />",{"class":S+"-tip"}).prependTo(a.tooltip),sa?(b=d("<canvas />").appendTo(this.element)[0].getContext("2d"),b.lineJoin="miter",b.miterLimit=1e5,b.save()):(b=ia("shape",'coordorigin="0,0"',"position:absolute;"),this.element.html(b+b),a._bind(d("*",c).add(c),["click","mousedown"],function(a){a.stopPropagation()},this._ns)),a._bind(a.tooltip,"tooltipmove",this.reposition,this._ns,this),this.create()},_swapDimensions:function(){this.size[0]=this.options.height,this.size[1]=this.options.width},_resetDimensions:function(){this.size[0]=this.options.width,this.size[1]=this.options.height},_useTitle:function(a){var b=this.qtip.elements.titlebar;return b&&(a.y===K||a.y===O&&this.element.position().top+this.size[1]/2+this.options.offset<b.outerHeight(D))},_parseCorner:function(a){var b=this.qtip.options.position.my;return a===E||b===E?a=E:a===D?a=new A(b.string()):a.string||(a=new A(a),a.fixed=D),a},_parseWidth:function(a,b,c){var d=this.qtip.elements,e=na+s(b)+"Width";return(c?u(c,e):u(d.content,e)||u(this._useTitle(a)&&d.titlebar||d.content,e)||u(d.tooltip,e))||0},_parseRadius:function(a){var b=this.qtip.elements,c=na+s(a.y)+s(a.x)+"Radius";return da.ie<9?0:u(this._useTitle(a)&&b.titlebar||b.content,c)||u(b.tooltip,c)||0},_invalidColour:function(a,b,c){var d=a.css(b);return!d||c&&d===a.css(c)||ta.test(d)?E:d},_parseColours:function(a){var b=this.qtip.elements,c=this.element.css("cssText",""),e=na+s(a[a.precedance])+s(oa),f=this._useTitle(a)&&b.titlebar||b.content,g=this._invalidColour,h=[];return h[0]=g(c,pa)||g(f,pa)||g(b.content,pa)||g(b.tooltip,pa)||c.css(pa),h[1]=g(c,e,oa)||g(f,e,oa)||g(b.content,e,oa)||g(b.tooltip,e,oa)||b.tooltip.css(e),d("*",c).add(c).css("cssText",pa+":"+qa+ra+";"+na+":0"+ra+";"),h},_calculateSize:function(a){var b,c,d,e=a.precedance===H,f=this.options.width,g=this.options.height,h="c"===a.abbrev(),i=(e?f:g)*(h?.5:1),j=Math.pow,k=Math.round,l=Math.sqrt(j(i,2)+j(g,2)),m=[this.border/i*l,this.border/g*l];return m[2]=Math.sqrt(j(m[0],2)-j(this.border,2)),m[3]=Math.sqrt(j(m[1],2)-j(this.border,2)),b=l+m[2]+m[3]+(h?0:m[0]),c=b/l,d=[k(c*f),k(c*g)],e?d:d.reverse()},_calculateTip:function(a,b,c){c=c||1,b=b||this.size;var d=b[0]*c,e=b[1]*c,f=Math.ceil(d/2),g=Math.ceil(e/2),h={br:[0,0,d,e,d,0],bl:[0,0,d,0,0,e],tr:[0,e,d,0,d,e],tl:[0,0,0,e,d,e],tc:[0,e,f,0,d,e],bc:[0,0,d,0,f,e],rc:[0,0,d,g,0,e],lc:[d,0,d,e,0,g]};return h.lt=h.br,h.rt=h.bl,h.lb=h.tr,h.rb=h.tl,h[a.abbrev()]},_drawCoords:function(a,b){a.beginPath(),a.moveTo(b[0],b[1]),a.lineTo(b[2],b[3]),a.lineTo(b[4],b[5]),a.closePath()},create:function(){var a=this.corner=(sa||da.ie)&&this._parseCorner(this.options.corner);return this.enabled=!!this.corner&&"c"!==this.corner.abbrev(),this.enabled&&(this.qtip.cache.corner=a.clone(),this.update()),this.element.toggle(this.enabled),this.corner},update:function(b,c){if(!this.enabled)return this;var e,f,g,h,i,j,k,l,m=this.qtip.elements,n=this.element,o=n.children(),p=this.options,q=this.size,r=p.mimic,s=Math.round;b||(b=this.qtip.cache.corner||this.corner),r===E?r=b:(r=new A(r),r.precedance=b.precedance,"inherit"===r.x?r.x=b.x:"inherit"===r.y?r.y=b.y:r.x===r.y&&(r[b.precedance]=b[b.precedance])),f=r.precedance,b.precedance===G?this._swapDimensions():this._resetDimensions(),e=this.color=this._parseColours(b),e[1]!==qa?(l=this.border=this._parseWidth(b,b[b.precedance]),p.border&&1>l&&!ta.test(e[1])&&(e[0]=e[1]),this.border=l=p.border!==D?p.border:l):this.border=l=0,k=this.size=this._calculateSize(b),n.css({width:k[0],height:k[1],lineHeight:k[1]+"px"}),j=b.precedance===H?[s(r.x===L?l:r.x===N?k[0]-q[0]-l:(k[0]-q[0])/2),s(r.y===K?k[1]-q[1]:0)]:[s(r.x===L?k[0]-q[0]:0),s(r.y===K?l:r.y===M?k[1]-q[1]-l:(k[1]-q[1])/2)],sa?(g=o[0].getContext("2d"),g.restore(),g.save(),g.clearRect(0,0,6e3,6e3),h=this._calculateTip(r,q,ja),i=this._calculateTip(r,this.size,ja),o.attr(I,k[0]*ja).attr(J,k[1]*ja),o.css(I,k[0]).css(J,k[1]),this._drawCoords(g,i),g.fillStyle=e[1],g.fill(),g.translate(j[0]*ja,j[1]*ja),this._drawCoords(g,h),g.fillStyle=e[0],g.fill()):(h=this._calculateTip(r),h="m"+h[0]+","+h[1]+" l"+h[2]+","+h[3]+" "+h[4]+","+h[5]+" xe",j[2]=l&&/^(r|b)/i.test(b.string())?8===da.ie?2:1:0,o.css({coordsize:k[0]+l+" "+k[1]+l,antialias:""+(r.string().indexOf(O)>-1),left:j[0]-j[2]*Number(f===G),top:j[1]-j[2]*Number(f===H),width:k[0]+l,height:k[1]+l}).each(function(a){var b=d(this);b[b.prop?"prop":"attr"]({coordsize:k[0]+l+" "+k[1]+l,path:h,fillcolor:e[0],filled:!!a,stroked:!a}).toggle(!(!l&&!a)),!a&&b.html(ia("stroke",'weight="'+2*l+'px" color="'+e[1]+'" miterlimit="1000" joinstyle="miter"'))})),a.opera&&setTimeout(function(){m.tip.css({display:"inline-block",visibility:"visible"})},1),c!==E&&this.calculate(b,k)},calculate:function(a,b){if(!this.enabled)return E;var c,e,f=this,g=this.qtip.elements,h=this.element,i=this.options.offset,j={};
4
  return a=a||this.corner,c=a.precedance,b=b||this._calculateSize(a),e=[a.x,a.y],c===G&&e.reverse(),d.each(e,function(d,e){var h,k,l;e===O?(h=c===H?L:K,j[h]="50%",j[ma+"-"+h]=-Math.round(b[c===H?0:1]/2)+i):(h=f._parseWidth(a,e,g.tooltip),k=f._parseWidth(a,e,g.content),l=f._parseRadius(a),j[e]=Math.max(-f.border,d?k:i+(l>h?l:-h)))}),j[a[c]]-=b[c===G?0:1],h.css({margin:"",top:"",bottom:"",left:"",right:""}).css(j),j},reposition:function(a,b,d){function e(a,b,c,d,e){a===Q&&j.precedance===b&&k[d]&&j[c]!==O?j.precedance=j.precedance===G?H:G:a!==Q&&k[d]&&(j[b]=j[b]===O?k[d]>0?d:e:j[b]===d?e:d)}function f(a,b,e){j[a]===O?p[ma+"-"+b]=o[a]=g[ma+"-"+b]-k[b]:(h=g[e]!==c?[k[b],-g[b]]:[-k[b],g[b]],(o[a]=Math.max(h[0],h[1]))>h[0]&&(d[b]-=k[b],o[b]=E),p[g[e]!==c?e:b]=o[a])}if(this.enabled){var g,h,i=b.cache,j=this.corner.clone(),k=d.adjusted,l=b.options.position.adjust.method.split(" "),m=l[0],n=l[1]||l[0],o={left:E,top:E,x:0,y:0},p={};this.corner.fixed!==D&&(e(m,G,H,L,N),e(n,H,G,K,M),j.string()===i.corner.string()&&i.cornerTop===k.top&&i.cornerLeft===k.left||this.update(j,E)),g=this.calculate(j),g.right!==c&&(g.left=-g.right),g.bottom!==c&&(g.top=-g.bottom),g.user=this.offset,o.left=m===Q&&!!k.left,o.left&&f(G,L,N),o.top=n===Q&&!!k.top,o.top&&f(H,K,M),this.element.css(p).toggle(!(o.x&&o.y||j.x===O&&o.y||j.y===O&&o.x)),d.left-=g.left.charAt?g.user:m!==Q||o.top||!o.left&&!o.top?g.left+this.border:0,d.top-=g.top.charAt?g.user:n!==Q||o.left||!o.left&&!o.top?g.top+this.border:0,i.cornerLeft=k.left,i.cornerTop=k.top,i.corner=j.clone()}},destroy:function(){this.qtip._unbind(this.qtip.tooltip,this._ns),this.qtip.elements.tip&&this.qtip.elements.tip.find("*").remove().end().remove()}}),ha=R.tip=function(a){return new v(a,a.options.style.tip)},ha.initialize="render",ha.sanitize=function(a){if(a.style&&"tip"in a.style){var b=a.style.tip;"object"!=typeof b&&(b=a.style.tip={corner:b}),/string|boolean/i.test(typeof b.corner)||(b.corner=D)}},B.tip={"^position.my|style.tip.(corner|mimic|border)$":function(){this.create(),this.qtip.reposition()},"^style.tip.(height|width)$":function(a){this.size=[a.width,a.height],this.update(),this.qtip.reposition()},"^content.title|style.(classes|widget)$":function(){this.update()}},d.extend(D,y.defaults,{style:{tip:{corner:D,mimic:E,width:6,height:6,border:D,offset:0}}});var wa,xa,ya="qtip-modal",za="."+ya;xa=function(){function a(a){if(d.expr[":"].focusable)return d.expr[":"].focusable;var b,c,e,f=!isNaN(d.attr(a,"tabindex")),g=a.nodeName&&a.nodeName.toLowerCase();return"area"===g?(b=a.parentNode,c=b.name,a.href&&c&&"map"===b.nodeName.toLowerCase()?(e=d("img[usemap=#"+c+"]")[0],!!e&&e.is(":visible")):!1):/input|select|textarea|button|object/.test(g)?!a.disabled:"a"===g?a.href||f:f}function c(a){j.length<1&&a.length?a.not("body").blur():j.first().focus()}function e(a){if(h.is(":visible")){var b,e=d(a.target),g=f.tooltip,i=e.closest(W);b=i.length<1?E:parseInt(i[0].style.zIndex,10)>parseInt(g[0].style.zIndex,10),b||e.closest(W)[0]===g[0]||c(e)}}var f,g,h,i=this,j={};d.extend(i,{init:function(){return h=i.elem=d("<div />",{id:"qtip-overlay",html:"<div></div>",mousedown:function(){return E}}).hide(),d(b.body).bind("focusin"+za,e),d(b).bind("keydown"+za,function(a){f&&f.options.show.modal.escape&&27===a.keyCode&&f.hide(a)}),h.bind("click"+za,function(a){f&&f.options.show.modal.blur&&f.hide(a)}),i},update:function(b){f=b,j=b.options.show.modal.stealfocus!==E?b.tooltip.find("*").filter(function(){return a(this)}):[]},toggle:function(a,e,j){var k=a.tooltip,l=a.options.show.modal,m=l.effect,n=e?"show":"hide",o=h.is(":visible"),p=d(za).filter(":visible:not(:animated)").not(k);return i.update(a),e&&l.stealfocus!==E&&c(d(":focus")),h.toggleClass("blurs",l.blur),e&&h.appendTo(b.body),h.is(":animated")&&o===e&&g!==E||!e&&p.length?i:(h.stop(D,E),d.isFunction(m)?m.call(h,e):m===E?h[n]():h.fadeTo(parseInt(j,10)||90,e?1:0,function(){e||h.hide()}),e||h.queue(function(a){h.css({left:"",top:""}),d(za).length||h.detach(),a()}),g=e,f.destroyed&&(f=F),i)}}),i.init()},xa=new xa,d.extend(w.prototype,{init:function(a){var b=a.tooltip;return this.options.on?(a.elements.overlay=xa.elem,b.addClass(ya).css("z-index",y.modal_zindex+d(za).length),a._bind(b,["tooltipshow","tooltiphide"],function(a,c,e){var f=a.originalEvent;if(a.target===b[0])if(f&&"tooltiphide"===a.type&&/mouse(leave|enter)/.test(f.type)&&d(f.relatedTarget).closest(xa.elem[0]).length)try{a.preventDefault()}catch(g){}else(!f||f&&"tooltipsolo"!==f.type)&&this.toggle(a,"tooltipshow"===a.type,e)},this._ns,this),a._bind(b,"tooltipfocus",function(a,c){if(!a.isDefaultPrevented()&&a.target===b[0]){var e=d(za),f=y.modal_zindex+e.length,g=parseInt(b[0].style.zIndex,10);xa.elem[0].style.zIndex=f-1,e.each(function(){this.style.zIndex>g&&(this.style.zIndex-=1)}),e.filter("."+$).qtip("blur",a.originalEvent),b.addClass($)[0].style.zIndex=f,xa.update(c);try{a.preventDefault()}catch(h){}}},this._ns,this),void a._bind(b,"tooltiphide",function(a){a.target===b[0]&&d(za).filter(":visible").not(b).last().qtip("focus",a)},this._ns,this)):this},toggle:function(a,b,c){return a&&a.isDefaultPrevented()?this:void xa.toggle(this.qtip,!!b,c)},destroy:function(){this.qtip.tooltip.removeClass(ya),this.qtip._unbind(this.qtip.tooltip,this._ns),xa.toggle(this.qtip,E),delete this.qtip.elements.overlay}}),wa=R.modal=function(a){return new w(a,a.options.show.modal)},wa.sanitize=function(a){a.show&&("object"!=typeof a.show.modal?a.show.modal={on:!!a.show.modal}:"undefined"==typeof a.show.modal.on&&(a.show.modal.on=D))},y.modal_zindex=y.zindex-200,wa.initialize="render",B.modal={"^show.modal.(on|blur)$":function(){this.destroy(),this.init(),this.qtip.elems.overlay.toggle(this.qtip.tooltip[0].offsetWidth>0)}},d.extend(D,y.defaults,{show:{modal:{on:E,effect:D,blur:D,stealfocus:D,escape:D}}}),R.viewport=function(c,d,e,f,g,h,i){function j(a,b,c,e,f,g,h,i,j){var k=d[f],s=u[a],t=v[a],w=c===Q,x=s===f?j:s===g?-j:-j/2,y=t===f?i:t===g?-i:-i/2,z=q[f]+r[f]-(n?0:m[f]),A=z-k,B=k+j-(h===I?o:p)-z,C=x-(u.precedance===a||s===u[b]?y:0)-(t===O?i/2:0);return w?(C=(s===f?1:-1)*x,d[f]+=A>0?A:B>0?-B:0,d[f]=Math.max(-m[f]+r[f],k-C,Math.min(Math.max(-m[f]+r[f]+(h===I?o:p),k+C),d[f],"center"===s?k-x:1e9))):(e*=c===P?2:0,A>0&&(s!==f||B>0)?(d[f]-=C+e,l.invert(a,f)):B>0&&(s!==g||A>0)&&(d[f]-=(s===O?-C:C)+e,l.invert(a,g)),d[f]<q[f]&&-d[f]>B&&(d[f]=k,l=u.clone())),d[f]-k}var k,l,m,n,o,p,q,r,s=e.target,t=c.elements.tooltip,u=e.my,v=e.at,w=e.adjust,x=w.method.split(" "),y=x[0],z=x[1]||x[0],A=e.viewport,B=e.container,C={left:0,top:0};return A.jquery&&s[0]!==a&&s[0]!==b.body&&"none"!==w.method?(m=B.offset()||C,n="static"===B.css("position"),k="fixed"===t.css("position"),o=A[0]===a?A.width():A.outerWidth(E),p=A[0]===a?A.height():A.outerHeight(E),q={left:k?0:A.scrollLeft(),top:k?0:A.scrollTop()},r=A.offset()||C,"shift"===y&&"shift"===z||(l=u.clone()),C={left:"none"!==y?j(G,H,y,w.x,L,N,I,f,h):0,top:"none"!==z?j(H,G,z,w.y,K,M,J,g,i):0,my:l}):C},R.polys={polygon:function(a,b){var c,d,e,f={width:0,height:0,position:{top:1e10,right:0,bottom:0,left:1e10},adjustable:E},g=0,h=[],i=1,j=1,k=0,l=0;for(g=a.length;g--;)c=[parseInt(a[--g],10),parseInt(a[g+1],10)],c[0]>f.position.right&&(f.position.right=c[0]),c[0]<f.position.left&&(f.position.left=c[0]),c[1]>f.position.bottom&&(f.position.bottom=c[1]),c[1]<f.position.top&&(f.position.top=c[1]),h.push(c);if(d=f.width=Math.abs(f.position.right-f.position.left),e=f.height=Math.abs(f.position.bottom-f.position.top),"c"===b.abbrev())f.position={left:f.position.left+f.width/2,top:f.position.top+f.height/2};else{for(;d>0&&e>0&&i>0&&j>0;)for(d=Math.floor(d/2),e=Math.floor(e/2),b.x===L?i=d:b.x===N?i=f.width-d:i+=Math.floor(d/2),b.y===K?j=e:b.y===M?j=f.height-e:j+=Math.floor(e/2),g=h.length;g--&&!(h.length<2);)k=h[g][0]-f.position.left,l=h[g][1]-f.position.top,(b.x===L&&k>=i||b.x===N&&i>=k||b.x===O&&(i>k||k>f.width-i)||b.y===K&&l>=j||b.y===M&&j>=l||b.y===O&&(j>l||l>f.height-j))&&h.splice(g,1);f.position={left:h[0][0],top:h[0][1]}}return f},rect:function(a,b,c,d){return{width:Math.abs(c-a),height:Math.abs(d-b),position:{left:Math.min(a,c),top:Math.min(b,d)}}},_angles:{tc:1.5,tr:7/4,tl:5/4,bc:.5,br:.25,bl:.75,rc:2,lc:1,c:0},ellipse:function(a,b,c,d,e){var f=R.polys._angles[e.abbrev()],g=0===f?0:c*Math.cos(f*Math.PI),h=d*Math.sin(f*Math.PI);return{width:2*c-Math.abs(g),height:2*d-Math.abs(h),position:{left:a+g,top:b+h},adjustable:E}},circle:function(a,b,c,d){return R.polys.ellipse(a,b,c,c,d)}},R.svg=function(a,c,e){for(var f,g,h,i,j,k,l,m,n,o=c[0],p=d(o.ownerSVGElement),q=o.ownerDocument,r=(parseInt(c.css("stroke-width"),10)||0)/2;!o.getBBox;)o=o.parentNode;if(!o.getBBox||!o.parentNode)return E;switch(o.nodeName){case"ellipse":case"circle":m=R.polys.ellipse(o.cx.baseVal.value,o.cy.baseVal.value,(o.rx||o.r).baseVal.value+r,(o.ry||o.r).baseVal.value+r,e);break;case"line":case"polygon":case"polyline":for(l=o.points||[{x:o.x1.baseVal.value,y:o.y1.baseVal.value},{x:o.x2.baseVal.value,y:o.y2.baseVal.value}],m=[],k=-1,i=l.numberOfItems||l.length;++k<i;)j=l.getItem?l.getItem(k):l[k],m.push.apply(m,[j.x,j.y]);m=R.polys.polygon(m,e);break;default:m=o.getBBox(),m={width:m.width,height:m.height,position:{left:m.x,top:m.y}}}return n=m.position,p=p[0],p.createSVGPoint&&(g=o.getScreenCTM(),l=p.createSVGPoint(),l.x=n.left,l.y=n.top,h=l.matrixTransform(g),n.left=h.x,n.top=h.y),q!==b&&"mouse"!==a.position.target&&(f=d((q.defaultView||q.parentWindow).frameElement).offset(),f&&(n.left+=f.left,n.top+=f.top)),q=d(q),n.left+=q.scrollLeft(),n.top+=q.scrollTop(),m},R.imagemap=function(a,b,c){b.jquery||(b=d(b));var e,f,g,h,i,j=(b.attr("shape")||"rect").toLowerCase().replace("poly","polygon"),k=d('img[usemap="#'+b.parent("map").attr("name")+'"]'),l=d.trim(b.attr("coords")),m=l.replace(/,$/,"").split(",");if(!k.length)return E;if("polygon"===j)h=R.polys.polygon(m,c);else{if(!R.polys[j])return E;for(g=-1,i=m.length,f=[];++g<i;)f.push(parseInt(m[g],10));h=R.polys[j].apply(this,f.concat(c))}return e=k.offset(),e.left+=Math.ceil((k.outerWidth(E)-k.width())/2),e.top+=Math.ceil((k.outerHeight(E)-k.height())/2),h.position.left+=e.left,h.position.top+=e.top,h};var Aa,Ba='<iframe class="qtip-bgiframe" frameborder="0" tabindex="-1" src="javascript:\'\';" style="display:block; position:absolute; z-index:-1; filter:alpha(opacity=0); -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";"></iframe>';d.extend(x.prototype,{_scroll:function(){var b=this.qtip.elements.overlay;b&&(b[0].style.top=d(a).scrollTop()+"px")},init:function(c){var e=c.tooltip;d("select, object").length<1&&(this.bgiframe=c.elements.bgiframe=d(Ba).appendTo(e),c._bind(e,"tooltipmove",this.adjustBGIFrame,this._ns,this)),this.redrawContainer=d("<div/>",{id:S+"-rcontainer"}).appendTo(b.body),c.elements.overlay&&c.elements.overlay.addClass("qtipmodal-ie6fix")&&(c._bind(a,["scroll","resize"],this._scroll,this._ns,this),c._bind(e,["tooltipshow"],this._scroll,this._ns,this)),this.redraw()},adjustBGIFrame:function(){var a,b,c=this.qtip.tooltip,d={height:c.outerHeight(E),width:c.outerWidth(E)},e=this.qtip.plugins.tip,f=this.qtip.elements.tip;b=parseInt(c.css("borderLeftWidth"),10)||0,b={left:-b,top:-b},e&&f&&(a="x"===e.corner.precedance?[I,L]:[J,K],b[a[1]]-=f[a[0]]()),this.bgiframe.css(b).css(d)},redraw:function(){if(this.qtip.rendered<1||this.drawing)return this;var a,b,c,d,e=this.qtip.tooltip,f=this.qtip.options.style,g=this.qtip.options.position.container;return this.qtip.drawing=1,f.height&&e.css(J,f.height),f.width?e.css(I,f.width):(e.css(I,"").appendTo(this.redrawContainer),b=e.width(),1>b%2&&(b+=1),c=e.css("maxWidth")||"",d=e.css("minWidth")||"",a=(c+d).indexOf("%")>-1?g.width()/100:0,c=(c.indexOf("%")>-1?a:1*parseInt(c,10))||b,d=(d.indexOf("%")>-1?a:1*parseInt(d,10))||0,b=c+d?Math.min(Math.max(b,d),c):b,e.css(I,Math.round(b)).appendTo(g)),this.drawing=0,this},destroy:function(){this.bgiframe&&this.bgiframe.remove(),this.qtip._unbind([a,this.qtip.tooltip],this._ns)}}),Aa=R.ie6=function(a){return 6===da.ie?new x(a):E},Aa.initialize="render",B.ie6={"^content|style$":function(){this.redraw()}}})}(window,document);
5
- //# sourceMappingURL=jquery.qtip.min.map
2
 
3
  !function(a,b,c){!function(a){"use strict";"function"==typeof define&&define.amd?define(["jquery"],a):jQuery&&!jQuery.fn.qtip&&a(jQuery)}(function(d){"use strict";function e(a,b,c,e){this.id=c,this.target=a,this.tooltip=F,this.elements={target:a},this._id=S+"-"+c,this.timers={img:{}},this.options=b,this.plugins={},this.cache={event:{},target:d(),disabled:E,attr:e,onTooltip:E,lastClass:""},this.rendered=this.destroyed=this.disabled=this.waiting=this.hiddenDuringWait=this.positioning=this.triggering=E}function f(a){return a===F||"object"!==d.type(a)}function g(a){return!(d.isFunction(a)||a&&a.attr||a.length||"object"===d.type(a)&&(a.jquery||a.then))}function h(a){var b,c,e,h;return f(a)?E:(f(a.metadata)&&(a.metadata={type:a.metadata}),"content"in a&&(b=a.content,f(b)||b.jquery||b.done?(c=g(b)?E:b,b=a.content={text:c}):c=b.text,"ajax"in b&&(e=b.ajax,h=e&&e.once!==E,delete b.ajax,b.text=function(a,b){var f=c||d(this).attr(b.options.content.attr)||"Loading...",g=d.ajax(d.extend({},e,{context:b})).then(e.success,F,e.error).then(function(a){return a&&h&&b.set("content.text",a),a},function(a,c,d){b.destroyed||0===a.status||b.set("content.text",c+": "+d)});return h?f:(b.set("content.text",f),g)}),"title"in b&&(d.isPlainObject(b.title)&&(b.button=b.title.button,b.title=b.title.text),g(b.title||E)&&(b.title=E))),"position"in a&&f(a.position)&&(a.position={my:a.position,at:a.position}),"show"in a&&f(a.show)&&(a.show=a.show.jquery?{target:a.show}:a.show===D?{ready:D}:{event:a.show}),"hide"in a&&f(a.hide)&&(a.hide=a.hide.jquery?{target:a.hide}:{event:a.hide}),"style"in a&&f(a.style)&&(a.style={classes:a.style}),d.each(R,function(){this.sanitize&&this.sanitize(a)}),a)}function i(a,b){for(var c,d=0,e=a,f=b.split(".");e=e[f[d++]];)d<f.length&&(c=e);return[c||a,f.pop()]}function j(a,b){var c,d,e;for(c in this.checks)if(this.checks.hasOwnProperty(c))for(d in this.checks[c])this.checks[c].hasOwnProperty(d)&&(e=new RegExp(d,"i").exec(a))&&(b.push(e),("builtin"===c||this.plugins[c])&&this.checks[c][d].apply(this.plugins[c]||this,b))}function k(a){return V.concat("").join(a?"-"+a+" ":" ")}function l(a,b){return b>0?setTimeout(d.proxy(a,this),b):void a.call(this)}function m(a){this.tooltip.hasClass(aa)||(clearTimeout(this.timers.show),clearTimeout(this.timers.hide),this.timers.show=l.call(this,function(){this.toggle(D,a)},this.options.show.delay))}function n(a){if(!this.tooltip.hasClass(aa)&&!this.destroyed){var b=d(a.relatedTarget),c=b.closest(W)[0]===this.tooltip[0],e=b[0]===this.options.show.target[0];if(clearTimeout(this.timers.show),clearTimeout(this.timers.hide),this!==b[0]&&"mouse"===this.options.position.target&&c||this.options.hide.fixed&&/mouse(out|leave|move)/.test(a.type)&&(c||e))try{a.preventDefault(),a.stopImmediatePropagation()}catch(f){}else this.timers.hide=l.call(this,function(){this.toggle(E,a)},this.options.hide.delay,this)}}function o(a){!this.tooltip.hasClass(aa)&&this.options.hide.inactive&&(clearTimeout(this.timers.inactive),this.timers.inactive=l.call(this,function(){this.hide(a)},this.options.hide.inactive))}function p(a){this.rendered&&this.tooltip[0].offsetWidth>0&&this.reposition(a)}function q(a,c,e){d(b.body).delegate(a,(c.split?c:c.join("."+S+" "))+"."+S,function(){var a=y.api[d.attr(this,U)];a&&!a.disabled&&e.apply(a,arguments)})}function r(a,c,f){var g,i,j,k,l,m=d(b.body),n=a[0]===b?m:a,o=a.metadata?a.metadata(f.metadata):F,p="html5"===f.metadata.type&&o?o[f.metadata.name]:F,q=a.data(f.metadata.name||"qtipopts");try{q="string"==typeof q?d.parseJSON(q):q}catch(r){}if(k=d.extend(D,{},y.defaults,f,"object"==typeof q?h(q):F,h(p||o)),i=k.position,k.id=c,"boolean"==typeof k.content.text){if(j=a.attr(k.content.attr),k.content.attr===E||!j)return E;k.content.text=j}if(i.container.length||(i.container=m),i.target===E&&(i.target=n),k.show.target===E&&(k.show.target=n),k.show.solo===D&&(k.show.solo=i.container.closest("body")),k.hide.target===E&&(k.hide.target=n),k.position.viewport===D&&(k.position.viewport=i.container),i.container=i.container.eq(0),i.at=new A(i.at,D),i.my=new A(i.my),a.data(S))if(k.overwrite)a.qtip("destroy",!0);else if(k.overwrite===E)return E;return a.attr(T,c),k.suppress&&(l=a.attr("title"))&&a.removeAttr("title").attr(ca,l).attr("title",""),g=new e(a,k,c,!!j),a.data(S,g),g}function s(a){return a.charAt(0).toUpperCase()+a.slice(1)}function t(a,b){var d,e,f=b.charAt(0).toUpperCase()+b.slice(1),g=(b+" "+va.join(f+" ")+f).split(" "),h=0;if(ua[b])return a.css(ua[b]);for(;d=g[h++];)if((e=a.css(d))!==c)return ua[b]=d,e}function u(a,b){return Math.ceil(parseFloat(t(a,b)))}function v(a,b){this._ns="tip",this.options=b,this.offset=b.offset,this.size=[b.width,b.height],this.qtip=a,this.init(a)}function w(a,b){this.options=b,this._ns="-modal",this.qtip=a,this.init(a)}function x(a){this._ns="ie6",this.qtip=a,this.init(a)}var y,z,A,B,C,D=!0,E=!1,F=null,G="x",H="y",I="width",J="height",K="top",L="left",M="bottom",N="right",O="center",P="flipinvert",Q="shift",R={},S="qtip",T="data-hasqtip",U="data-qtip-id",V=["ui-widget","ui-tooltip"],W="."+S,X="click dblclick mousedown mouseup mousemove mouseleave mouseenter".split(" "),Y=S+"-fixed",Z=S+"-default",$=S+"-focus",_=S+"-hover",aa=S+"-disabled",ba="_replacedByqTip",ca="oldtitle",da={ie:function(){var a,c;for(a=4,c=b.createElement("div");(c.innerHTML="<!--[if gt IE "+a+"]><i></i><![endif]-->")&&c.getElementsByTagName("i")[0];a+=1);return a>4?a:NaN}(),iOS:parseFloat((""+(/CPU.*OS ([0-9_]{1,5})|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent)||[0,""])[1]).replace("undefined","3_2").replace("_",".").replace("_",""))||E};z=e.prototype,z._when=function(a){return d.when.apply(d,a)},z.render=function(a){if(this.rendered||this.destroyed)return this;var b=this,c=this.options,e=this.cache,f=this.elements,g=c.content.text,h=c.content.title,i=c.content.button,j=c.position,k=[];return d.attr(this.target[0],"aria-describedby",this._id),e.posClass=this._createPosClass((this.position={my:j.my,at:j.at}).my),this.tooltip=f.tooltip=d("<div/>",{id:this._id,"class":[S,Z,c.style.classes,e.posClass].join(" "),width:c.style.width||"",height:c.style.height||"",tracking:"mouse"===j.target&&j.adjust.mouse,role:"alert","aria-live":"polite","aria-atomic":E,"aria-describedby":this._id+"-content","aria-hidden":D}).toggleClass(aa,this.disabled).attr(U,this.id).data(S,this).appendTo(j.container).append(f.content=d("<div />",{"class":S+"-content",id:this._id+"-content","aria-atomic":D})),this.rendered=-1,this.positioning=D,h&&(this._createTitle(),d.isFunction(h)||k.push(this._updateTitle(h,E))),i&&this._createButton(),d.isFunction(g)||k.push(this._updateContent(g,E)),this.rendered=D,this._setWidget(),d.each(R,function(a){var c;"render"===this.initialize&&(c=this(b))&&(b.plugins[a]=c)}),this._unassignEvents(),this._assignEvents(),this._when(k).then(function(){b._trigger("render"),b.positioning=E,b.hiddenDuringWait||!c.show.ready&&!a||b.toggle(D,e.event,E),b.hiddenDuringWait=E}),y.api[this.id]=this,this},z.destroy=function(a){function b(){if(!this.destroyed){this.destroyed=D;var a,b=this.target,c=b.attr(ca);this.rendered&&this.tooltip.stop(1,0).find("*").remove().end().remove(),d.each(this.plugins,function(){this.destroy&&this.destroy()});for(a in this.timers)this.timers.hasOwnProperty(a)&&clearTimeout(this.timers[a]);b.removeData(S).removeAttr(U).removeAttr(T).removeAttr("aria-describedby"),this.options.suppress&&c&&b.attr("title",c).removeAttr(ca),this._unassignEvents(),this.options=this.elements=this.cache=this.timers=this.plugins=this.mouse=F,delete y.api[this.id]}}return this.destroyed?this.target:(a===D&&"hide"!==this.triggering||!this.rendered?b.call(this):(this.tooltip.one("tooltiphidden",d.proxy(b,this)),!this.triggering&&this.hide()),this.target)},B=z.checks={builtin:{"^id$":function(a,b,c,e){var f=c===D?y.nextid:c,g=S+"-"+f;f!==E&&f.length>0&&!d("#"+g).length?(this._id=g,this.rendered&&(this.tooltip[0].id=this._id,this.elements.content[0].id=this._id+"-content",this.elements.title[0].id=this._id+"-title")):a[b]=e},"^prerender":function(a,b,c){c&&!this.rendered&&this.render(this.options.show.ready)},"^content.text$":function(a,b,c){this._updateContent(c)},"^content.attr$":function(a,b,c,d){this.options.content.text===this.target.attr(d)&&this._updateContent(this.target.attr(c))},"^content.title$":function(a,b,c){return c?(c&&!this.elements.title&&this._createTitle(),void this._updateTitle(c)):this._removeTitle()},"^content.button$":function(a,b,c){this._updateButton(c)},"^content.title.(text|button)$":function(a,b,c){this.set("content."+b,c)},"^position.(my|at)$":function(a,b,c){"string"==typeof c&&(this.position[b]=a[b]=new A(c,"at"===b))},"^position.container$":function(a,b,c){this.rendered&&this.tooltip.appendTo(c)},"^show.ready$":function(a,b,c){c&&(!this.rendered&&this.render(D)||this.toggle(D))},"^style.classes$":function(a,b,c,d){this.rendered&&this.tooltip.removeClass(d).addClass(c)},"^style.(width|height)":function(a,b,c){this.rendered&&this.tooltip.css(b,c)},"^style.widget|content.title":function(){this.rendered&&this._setWidget()},"^style.def":function(a,b,c){this.rendered&&this.tooltip.toggleClass(Z,!!c)},"^events.(render|show|move|hide|focus|blur)$":function(a,b,c){this.rendered&&this.tooltip[(d.isFunction(c)?"":"un")+"bind"]("tooltip"+b,c)},"^(show|hide|position).(event|target|fixed|inactive|leave|distance|viewport|adjust)":function(){if(this.rendered){var a=this.options.position;this.tooltip.attr("tracking","mouse"===a.target&&a.adjust.mouse),this._unassignEvents(),this._assignEvents()}}}},z.get=function(a){if(this.destroyed)return this;var b=i(this.options,a.toLowerCase()),c=b[0][b[1]];return c.precedance?c.string():c};var ea=/^position\.(my|at|adjust|target|container|viewport)|style|content|show\.ready/i,fa=/^prerender|show\.ready/i;z.set=function(a,b){if(this.destroyed)return this;var c,e=this.rendered,f=E,g=this.options;return"string"==typeof a?(c=a,a={},a[c]=b):a=d.extend({},a),d.each(a,function(b,c){if(e&&fa.test(b))return void delete a[b];var h,j=i(g,b.toLowerCase());h=j[0][j[1]],j[0][j[1]]=c&&c.nodeType?d(c):c,f=ea.test(b)||f,a[b]=[j[0],j[1],c,h]}),h(g),this.positioning=D,d.each(a,d.proxy(j,this)),this.positioning=E,this.rendered&&this.tooltip[0].offsetWidth>0&&f&&this.reposition("mouse"===g.position.target?F:this.cache.event),this},z._update=function(a,b){var c=this,e=this.cache;return this.rendered&&a?(d.isFunction(a)&&(a=a.call(this.elements.target,e.event,this)||""),d.isFunction(a.then)?(e.waiting=D,a.then(function(a){return e.waiting=E,c._update(a,b)},F,function(a){return c._update(a,b)})):a===E||!a&&""!==a?E:(a.jquery&&a.length>0?b.empty().append(a.css({display:"block",visibility:"visible"})):b.html(a),this._waitForContent(b).then(function(a){c.rendered&&c.tooltip[0].offsetWidth>0&&c.reposition(e.event,!a.length)}))):E},z._waitForContent=function(a){var b=this.cache;return b.waiting=D,(d.fn.imagesLoaded?a.imagesLoaded():(new d.Deferred).resolve([])).done(function(){b.waiting=E}).promise()},z._updateContent=function(a,b){this._update(a,this.elements.content,b)},z._updateTitle=function(a,b){this._update(a,this.elements.title,b)===E&&this._removeTitle(E)},z._createTitle=function(){var a=this.elements,b=this._id+"-title";a.titlebar&&this._removeTitle(),a.titlebar=d("<div />",{"class":S+"-titlebar "+(this.options.style.widget?k("header"):"")}).append(a.title=d("<div />",{id:b,"class":S+"-title","aria-atomic":D})).insertBefore(a.content).delegate(".qtip-close","mousedown keydown mouseup keyup mouseout",function(a){d(this).toggleClass("ui-state-active ui-state-focus","down"===a.type.substr(-4))}).delegate(".qtip-close","mouseover mouseout",function(a){d(this).toggleClass("ui-state-hover","mouseover"===a.type)}),this.options.content.button&&this._createButton()},z._removeTitle=function(a){var b=this.elements;b.title&&(b.titlebar.remove(),b.titlebar=b.title=b.button=F,a!==E&&this.reposition())},z._createPosClass=function(a){return S+"-pos-"+(a||this.options.position.my).abbrev()},z.reposition=function(c,e){if(!this.rendered||this.positioning||this.destroyed)return this;this.positioning=D;var f,g,h,i,j=this.cache,k=this.tooltip,l=this.options.position,m=l.target,n=l.my,o=l.at,p=l.viewport,q=l.container,r=l.adjust,s=r.method.split(" "),t=k.outerWidth(E),u=k.outerHeight(E),v=0,w=0,x=k.css("position"),y={left:0,top:0},z=k[0].offsetWidth>0,A=c&&"scroll"===c.type,B=d(a),C=q[0].ownerDocument,F=this.mouse;if(d.isArray(m)&&2===m.length)o={x:L,y:K},y={left:m[0],top:m[1]};else if("mouse"===m)o={x:L,y:K},(!r.mouse||this.options.hide.distance)&&j.origin&&j.origin.pageX?c=j.origin:!c||c&&("resize"===c.type||"scroll"===c.type)?c=j.event:F&&F.pageX&&(c=F),"static"!==x&&(y=q.offset()),C.body.offsetWidth!==(a.innerWidth||C.documentElement.clientWidth)&&(g=d(b.body).offset()),y={left:c.pageX-y.left+(g&&g.left||0),top:c.pageY-y.top+(g&&g.top||0)},r.mouse&&A&&F&&(y.left-=(F.scrollX||0)-B.scrollLeft(),y.top-=(F.scrollY||0)-B.scrollTop());else{if("event"===m?c&&c.target&&"scroll"!==c.type&&"resize"!==c.type?j.target=d(c.target):c.target||(j.target=this.elements.target):"event"!==m&&(j.target=d(m.jquery?m:this.elements.target)),m=j.target,m=d(m).eq(0),0===m.length)return this;m[0]===b||m[0]===a?(v=da.iOS?a.innerWidth:m.width(),w=da.iOS?a.innerHeight:m.height(),m[0]===a&&(y={top:(p||m).scrollTop(),left:(p||m).scrollLeft()})):R.imagemap&&m.is("area")?f=R.imagemap(this,m,o,R.viewport?s:E):R.svg&&m&&m[0].ownerSVGElement?f=R.svg(this,m,o,R.viewport?s:E):(v=m.outerWidth(E),w=m.outerHeight(E),y=m.offset()),f&&(v=f.width,w=f.height,g=f.offset,y=f.position),y=this.reposition.offset(m,y,q),(da.iOS>3.1&&da.iOS<4.1||da.iOS>=4.3&&da.iOS<4.33||!da.iOS&&"fixed"===x)&&(y.left-=B.scrollLeft(),y.top-=B.scrollTop()),(!f||f&&f.adjustable!==E)&&(y.left+=o.x===N?v:o.x===O?v/2:0,y.top+=o.y===M?w:o.y===O?w/2:0)}return y.left+=r.x+(n.x===N?-t:n.x===O?-t/2:0),y.top+=r.y+(n.y===M?-u:n.y===O?-u/2:0),R.viewport?(h=y.adjusted=R.viewport(this,y,l,v,w,t,u),g&&h.left&&(y.left+=g.left),g&&h.top&&(y.top+=g.top),h.my&&(this.position.my=h.my)):y.adjusted={left:0,top:0},j.posClass!==(i=this._createPosClass(this.position.my))&&(j.posClass=i,k.removeClass(j.posClass).addClass(i)),this._trigger("move",[y,p.elem||p],c)?(delete y.adjusted,e===E||!z||isNaN(y.left)||isNaN(y.top)||"mouse"===m||!d.isFunction(l.effect)?k.css(y):d.isFunction(l.effect)&&(l.effect.call(k,this,d.extend({},y)),k.queue(function(a){d(this).css({opacity:"",height:""}),da.ie&&this.style.removeAttribute("filter"),a()})),this.positioning=E,this):this},z.reposition.offset=function(a,c,e){function f(a,b){c.left+=b*a.scrollLeft(),c.top+=b*a.scrollTop()}if(!e[0])return c;var g,h,i,j,k=d(a[0].ownerDocument),l=!!da.ie&&"CSS1Compat"!==b.compatMode,m=e[0];do"static"!==(h=d.css(m,"position"))&&("fixed"===h?(i=m.getBoundingClientRect(),f(k,-1)):(i=d(m).position(),i.left+=parseFloat(d.css(m,"borderLeftWidth"))||0,i.top+=parseFloat(d.css(m,"borderTopWidth"))||0),c.left-=i.left+(parseFloat(d.css(m,"marginLeft"))||0),c.top-=i.top+(parseFloat(d.css(m,"marginTop"))||0),g||"hidden"===(j=d.css(m,"overflow"))||"visible"===j||(g=d(m)));while(m=m.offsetParent);return g&&(g[0]!==k[0]||l)&&f(g,1),c};var ga=(A=z.reposition.Corner=function(a,b){a=(""+a).replace(/([A-Z])/," $1").replace(/middle/gi,O).toLowerCase(),this.x=(a.match(/left|right/i)||a.match(/center/)||["inherit"])[0].toLowerCase(),this.y=(a.match(/top|bottom|center/i)||["inherit"])[0].toLowerCase(),this.forceY=!!b;var c=a.charAt(0);this.precedance="t"===c||"b"===c?H:G}).prototype;ga.invert=function(a,b){this[a]=this[a]===L?N:this[a]===N?L:b||this[a]},ga.string=function(a){var b=this.x,c=this.y,d=b!==c?"center"===b||"center"!==c&&(this.precedance===H||this.forceY)?[c,b]:[b,c]:[b];return a!==!1?d.join(" "):d},ga.abbrev=function(){var a=this.string(!1);return a[0].charAt(0)+(a[1]&&a[1].charAt(0)||"")},ga.clone=function(){return new A(this.string(),this.forceY)},z.toggle=function(a,c){var e=this.cache,f=this.options,g=this.tooltip;if(c){if(/over|enter/.test(c.type)&&e.event&&/out|leave/.test(e.event.type)&&f.show.target.add(c.target).length===f.show.target.length&&g.has(c.relatedTarget).length)return this;e.event=d.event.fix(c)}if(this.waiting&&!a&&(this.hiddenDuringWait=D),!this.rendered)return a?this.render(1):this;if(this.destroyed||this.disabled)return this;var h,i,j,k=a?"show":"hide",l=this.options[k],m=this.options.position,n=this.options.content,o=this.tooltip.css("width"),p=this.tooltip.is(":visible"),q=a||1===l.target.length,r=!c||l.target.length<2||e.target[0]===c.target;return(typeof a).search("boolean|number")&&(a=!p),h=!g.is(":animated")&&p===a&&r,i=h?F:!!this._trigger(k,[90]),this.destroyed?this:(i!==E&&a&&this.focus(c),!i||h?this:(d.attr(g[0],"aria-hidden",!a),a?(this.mouse&&(e.origin=d.event.fix(this.mouse)),d.isFunction(n.text)&&this._updateContent(n.text,E),d.isFunction(n.title)&&this._updateTitle(n.title,E),!C&&"mouse"===m.target&&m.adjust.mouse&&(d(b).bind("mousemove."+S,this._storeMouse),C=D),o||g.css("width",g.outerWidth(E)),this.reposition(c,arguments[2]),o||g.css("width",""),l.solo&&("string"==typeof l.solo?d(l.solo):d(W,l.solo)).not(g).not(l.target).qtip("hide",new d.Event("tooltipsolo"))):(clearTimeout(this.timers.show),delete e.origin,C&&!d(W+'[tracking="true"]:visible',l.solo).not(g).length&&(d(b).unbind("mousemove."+S),C=E),this.blur(c)),j=d.proxy(function(){a?(da.ie&&g[0].style.removeAttribute("filter"),g.css("overflow",""),"string"==typeof l.autofocus&&d(this.options.show.autofocus,g).focus(),this.options.show.target.trigger("qtip-"+this.id+"-inactive")):g.css({display:"",visibility:"",opacity:"",left:"",top:""}),this._trigger(a?"visible":"hidden")},this),l.effect===E||q===E?(g[k](),j()):d.isFunction(l.effect)?(g.stop(1,1),l.effect.call(g,this),g.queue("fx",function(a){j(),a()})):g.fadeTo(90,a?1:0,j),a&&l.target.trigger("qtip-"+this.id+"-inactive"),this))},z.show=function(a){return this.toggle(D,a)},z.hide=function(a){return this.toggle(E,a)},z.focus=function(a){if(!this.rendered||this.destroyed)return this;var b=d(W),c=this.tooltip,e=parseInt(c[0].style.zIndex,10),f=y.zindex+b.length;return c.hasClass($)||this._trigger("focus",[f],a)&&(e!==f&&(b.each(function(){this.style.zIndex>e&&(this.style.zIndex=this.style.zIndex-1)}),b.filter("."+$).qtip("blur",a)),c.addClass($)[0].style.zIndex=f),this},z.blur=function(a){return!this.rendered||this.destroyed?this:(this.tooltip.removeClass($),this._trigger("blur",[this.tooltip.css("zIndex")],a),this)},z.disable=function(a){return this.destroyed?this:("toggle"===a?a=!(this.rendered?this.tooltip.hasClass(aa):this.disabled):"boolean"!=typeof a&&(a=D),this.rendered&&this.tooltip.toggleClass(aa,a).attr("aria-disabled",a),this.disabled=!!a,this)},z.enable=function(){return this.disable(E)},z._createButton=function(){var a=this,b=this.elements,c=b.tooltip,e=this.options.content.button,f="string"==typeof e,g=f?e:"Close tooltip";b.button&&b.button.remove(),e.jquery?b.button=e:b.button=d("<a />",{"class":"qtip-close "+(this.options.style.widget?"":S+"-icon"),title:g,"aria-label":g}).prepend(d("<span />",{"class":"ui-icon ui-icon-close",html:"&times;"})),b.button.appendTo(b.titlebar||c).attr("role","button").click(function(b){return c.hasClass(aa)||a.hide(b),E})},z._updateButton=function(a){if(!this.rendered)return E;var b=this.elements.button;a?this._createButton():b.remove()},z._setWidget=function(){var a=this.options.style.widget,b=this.elements,c=b.tooltip,d=c.hasClass(aa);c.removeClass(aa),aa=a?"ui-state-disabled":"qtip-disabled",c.toggleClass(aa,d),c.toggleClass("ui-helper-reset "+k(),a).toggleClass(Z,this.options.style.def&&!a),b.content&&b.content.toggleClass(k("content"),a),b.titlebar&&b.titlebar.toggleClass(k("header"),a),b.button&&b.button.toggleClass(S+"-icon",!a)},z._storeMouse=function(a){return(this.mouse=d.event.fix(a)).type="mousemove",this},z._bind=function(a,b,c,e,f){if(a&&c&&b.length){var g="."+this._id+(e?"-"+e:"");return d(a).bind((b.split?b:b.join(g+" "))+g,d.proxy(c,f||this)),this}},z._unbind=function(a,b){return a&&d(a).unbind("."+this._id+(b?"-"+b:"")),this},z._trigger=function(a,b,c){var e=new d.Event("tooltip"+a);return e.originalEvent=c&&d.extend({},c)||this.cache.event||F,this.triggering=a,this.tooltip.trigger(e,[this].concat(b||[])),this.triggering=E,!e.isDefaultPrevented()},z._bindEvents=function(a,b,c,e,f,g){var h=c.filter(e).add(e.filter(c)),i=[];h.length&&(d.each(b,function(b,c){var e=d.inArray(c,a);e>-1&&i.push(a.splice(e,1)[0])}),i.length&&(this._bind(h,i,function(a){var b=this.rendered?this.tooltip[0].offsetWidth>0:!1;(b?g:f).call(this,a)}),c=c.not(h),e=e.not(h))),this._bind(c,a,f),this._bind(e,b,g)},z._assignInitialEvents=function(a){function b(a){return this.disabled||this.destroyed?E:(this.cache.event=a&&d.event.fix(a),this.cache.target=a&&d(a.target),clearTimeout(this.timers.show),void(this.timers.show=l.call(this,function(){this.render("object"==typeof a||c.show.ready)},c.prerender?0:c.show.delay)))}var c=this.options,e=c.show.target,f=c.hide.target,g=c.show.event?d.trim(""+c.show.event).split(" "):[],h=c.hide.event?d.trim(""+c.hide.event).split(" "):[];this._bind(this.elements.target,["remove","removeqtip"],function(){this.destroy(!0)},"destroy"),/mouse(over|enter)/i.test(c.show.event)&&!/mouse(out|leave)/i.test(c.hide.event)&&h.push("mouseleave"),this._bind(e,"mousemove",function(a){this._storeMouse(a),this.cache.onTarget=D}),this._bindEvents(g,h,e,f,b,function(){return this.timers?void clearTimeout(this.timers.show):E}),(c.show.ready||c.prerender)&&b.call(this,a)},z._assignEvents=function(){var c=this,e=this.options,f=e.position,g=this.tooltip,h=e.show.target,i=e.hide.target,j=f.container,k=f.viewport,l=d(b),q=d(a),r=e.show.event?d.trim(""+e.show.event).split(" "):[],s=e.hide.event?d.trim(""+e.hide.event).split(" "):[];d.each(e.events,function(a,b){c._bind(g,"toggle"===a?["tooltipshow","tooltiphide"]:["tooltip"+a],b,null,g)}),/mouse(out|leave)/i.test(e.hide.event)&&"window"===e.hide.leave&&this._bind(l,["mouseout","blur"],function(a){/select|option/.test(a.target.nodeName)||a.relatedTarget||this.hide(a)}),e.hide.fixed?i=i.add(g.addClass(Y)):/mouse(over|enter)/i.test(e.show.event)&&this._bind(i,"mouseleave",function(){clearTimeout(this.timers.show)}),(""+e.hide.event).indexOf("unfocus")>-1&&this._bind(j.closest("html"),["mousedown","touchstart"],function(a){var b=d(a.target),c=this.rendered&&!this.tooltip.hasClass(aa)&&this.tooltip[0].offsetWidth>0,e=b.parents(W).filter(this.tooltip[0]).length>0;b[0]===this.target[0]||b[0]===this.tooltip[0]||e||this.target.has(b[0]).length||!c||this.hide(a)}),"number"==typeof e.hide.inactive&&(this._bind(h,"qtip-"+this.id+"-inactive",o,"inactive"),this._bind(i.add(g),y.inactiveEvents,o)),this._bindEvents(r,s,h,i,m,n),this._bind(h.add(g),"mousemove",function(a){if("number"==typeof e.hide.distance){var b=this.cache.origin||{},c=this.options.hide.distance,d=Math.abs;(d(a.pageX-b.pageX)>=c||d(a.pageY-b.pageY)>=c)&&this.hide(a)}this._storeMouse(a)}),"mouse"===f.target&&f.adjust.mouse&&(e.hide.event&&this._bind(h,["mouseenter","mouseleave"],function(a){return this.cache?void(this.cache.onTarget="mouseenter"===a.type):E}),this._bind(l,"mousemove",function(a){this.rendered&&this.cache.onTarget&&!this.tooltip.hasClass(aa)&&this.tooltip[0].offsetWidth>0&&this.reposition(a)})),(f.adjust.resize||k.length)&&this._bind(d.event.special.resize?k:q,"resize",p),f.adjust.scroll&&this._bind(q.add(f.container),"scroll",p)},z._unassignEvents=function(){var c=this.options,e=c.show.target,f=c.hide.target,g=d.grep([this.elements.target[0],this.rendered&&this.tooltip[0],c.position.container[0],c.position.viewport[0],c.position.container.closest("html")[0],a,b],function(a){return"object"==typeof a});e&&e.toArray&&(g=g.concat(e.toArray())),f&&f.toArray&&(g=g.concat(f.toArray())),this._unbind(g)._unbind(g,"destroy")._unbind(g,"inactive")},d(function(){q(W,["mouseenter","mouseleave"],function(a){var b="mouseenter"===a.type,c=d(a.currentTarget),e=d(a.relatedTarget||a.target),f=this.options;b?(this.focus(a),c.hasClass(Y)&&!c.hasClass(aa)&&clearTimeout(this.timers.hide)):"mouse"===f.position.target&&f.position.adjust.mouse&&f.hide.event&&f.show.target&&!e.closest(f.show.target[0]).length&&this.hide(a),c.toggleClass(_,b)}),q("["+U+"]",X,o)}),y=d.fn.qtip=function(a,b,e){var f=(""+a).toLowerCase(),g=F,i=d.makeArray(arguments).slice(1),j=i[i.length-1],k=this[0]?d.data(this[0],S):F;return!arguments.length&&k||"api"===f?k:"string"==typeof a?(this.each(function(){var a=d.data(this,S);if(!a)return D;if(j&&j.timeStamp&&(a.cache.event=j),!b||"option"!==f&&"options"!==f)a[f]&&a[f].apply(a,i);else{if(e===c&&!d.isPlainObject(b))return g=a.get(b),E;a.set(b,e)}}),g!==F?g:this):"object"!=typeof a&&arguments.length?void 0:(k=h(d.extend(D,{},a)),this.each(function(a){var b,c;return c=d.isArray(k.id)?k.id[a]:k.id,c=!c||c===E||c.length<1||y.api[c]?y.nextid++:c,b=r(d(this),c,k),b===E?D:(y.api[c]=b,d.each(R,function(){"initialize"===this.initialize&&this(b)}),void b._assignInitialEvents(j))}))},d.qtip=e,y.api={},d.each({attr:function(a,b){if(this.length){var c=this[0],e="title",f=d.data(c,"qtip");if(a===e&&f&&f.options&&"object"==typeof f&&"object"==typeof f.options&&f.options.suppress)return arguments.length<2?d.attr(c,ca):(f&&f.options.content.attr===e&&f.cache.attr&&f.set("content.text",b),this.attr(ca,b))}return d.fn["attr"+ba].apply(this,arguments)},clone:function(a){var b=d.fn["clone"+ba].apply(this,arguments);return a||b.filter("["+ca+"]").attr("title",function(){return d.attr(this,ca)}).removeAttr(ca),b}},function(a,b){if(!b||d.fn[a+ba])return D;var c=d.fn[a+ba]=d.fn[a];d.fn[a]=function(){return b.apply(this,arguments)||c.apply(this,arguments)}}),d.ui||(d["cleanData"+ba]=d.cleanData,d.cleanData=function(a){for(var b,c=0;(b=d(a[c])).length;c++)if(b.attr(T))try{b.triggerHandler("removeqtip")}catch(e){}d["cleanData"+ba].apply(this,arguments)}),y.version="3.0.3",y.nextid=0,y.inactiveEvents=X,y.zindex=15e3,y.defaults={prerender:E,id:E,overwrite:D,suppress:D,content:{text:D,attr:"title",title:E,button:E},position:{my:"top left",at:"bottom right",target:E,container:E,viewport:E,adjust:{x:0,y:0,mouse:D,scroll:D,resize:D,method:"flipinvert flipinvert"},effect:function(a,b){d(this).animate(b,{duration:200,queue:E})}},show:{target:E,event:"mouseenter",effect:D,delay:90,solo:E,ready:E,autofocus:E},hide:{target:E,event:"mouseleave",effect:D,delay:0,fixed:E,inactive:E,leave:"window",distance:E},style:{classes:"",widget:E,width:E,height:E,def:D},events:{render:F,move:F,show:F,hide:F,toggle:F,visible:F,hidden:F,focus:F,blur:F}};var ha,ia,ja,ka,la,ma="margin",na="border",oa="color",pa="background-color",qa="transparent",ra=" !important",sa=!!b.createElement("canvas").getContext,ta=/rgba?\(0, 0, 0(, 0)?\)|transparent|#123456/i,ua={},va=["Webkit","O","Moz","ms"];sa?(ka=a.devicePixelRatio||1,la=function(){var a=b.createElement("canvas").getContext("2d");return a.backingStorePixelRatio||a.webkitBackingStorePixelRatio||a.mozBackingStorePixelRatio||a.msBackingStorePixelRatio||a.oBackingStorePixelRatio||1}(),ja=ka/la):ia=function(a,b,c){return"<qtipvml:"+a+' xmlns="urn:schemas-microsoft.com:vml" class="qtip-vml" '+(b||"")+' style="behavior: url(#default#VML); '+(c||"")+'" />'},d.extend(v.prototype,{init:function(a){var b,c;c=this.element=a.elements.tip=d("<div />",{"class":S+"-tip"}).prependTo(a.tooltip),sa?(b=d("<canvas />").appendTo(this.element)[0].getContext("2d"),b.lineJoin="miter",b.miterLimit=1e5,b.save()):(b=ia("shape",'coordorigin="0,0"',"position:absolute;"),this.element.html(b+b),a._bind(d("*",c).add(c),["click","mousedown"],function(a){a.stopPropagation()},this._ns)),a._bind(a.tooltip,"tooltipmove",this.reposition,this._ns,this),this.create()},_swapDimensions:function(){this.size[0]=this.options.height,this.size[1]=this.options.width},_resetDimensions:function(){this.size[0]=this.options.width,this.size[1]=this.options.height},_useTitle:function(a){var b=this.qtip.elements.titlebar;return b&&(a.y===K||a.y===O&&this.element.position().top+this.size[1]/2+this.options.offset<b.outerHeight(D))},_parseCorner:function(a){var b=this.qtip.options.position.my;return a===E||b===E?a=E:a===D?a=new A(b.string()):a.string||(a=new A(a),a.fixed=D),a},_parseWidth:function(a,b,c){var d=this.qtip.elements,e=na+s(b)+"Width";return(c?u(c,e):u(d.content,e)||u(this._useTitle(a)&&d.titlebar||d.content,e)||u(d.tooltip,e))||0},_parseRadius:function(a){var b=this.qtip.elements,c=na+s(a.y)+s(a.x)+"Radius";return da.ie<9?0:u(this._useTitle(a)&&b.titlebar||b.content,c)||u(b.tooltip,c)||0},_invalidColour:function(a,b,c){var d=a.css(b);return!d||c&&d===a.css(c)||ta.test(d)?E:d},_parseColours:function(a){var b=this.qtip.elements,c=this.element.css("cssText",""),e=na+s(a[a.precedance])+s(oa),f=this._useTitle(a)&&b.titlebar||b.content,g=this._invalidColour,h=[];return h[0]=g(c,pa)||g(f,pa)||g(b.content,pa)||g(b.tooltip,pa)||c.css(pa),h[1]=g(c,e,oa)||g(f,e,oa)||g(b.content,e,oa)||g(b.tooltip,e,oa)||b.tooltip.css(e),d("*",c).add(c).css("cssText",pa+":"+qa+ra+";"+na+":0"+ra+";"),h},_calculateSize:function(a){var b,c,d,e=a.precedance===H,f=this.options.width,g=this.options.height,h="c"===a.abbrev(),i=(e?f:g)*(h?.5:1),j=Math.pow,k=Math.round,l=Math.sqrt(j(i,2)+j(g,2)),m=[this.border/i*l,this.border/g*l];return m[2]=Math.sqrt(j(m[0],2)-j(this.border,2)),m[3]=Math.sqrt(j(m[1],2)-j(this.border,2)),b=l+m[2]+m[3]+(h?0:m[0]),c=b/l,d=[k(c*f),k(c*g)],e?d:d.reverse()},_calculateTip:function(a,b,c){c=c||1,b=b||this.size;var d=b[0]*c,e=b[1]*c,f=Math.ceil(d/2),g=Math.ceil(e/2),h={br:[0,0,d,e,d,0],bl:[0,0,d,0,0,e],tr:[0,e,d,0,d,e],tl:[0,0,0,e,d,e],tc:[0,e,f,0,d,e],bc:[0,0,d,0,f,e],rc:[0,0,d,g,0,e],lc:[d,0,d,e,0,g]};return h.lt=h.br,h.rt=h.bl,h.lb=h.tr,h.rb=h.tl,h[a.abbrev()]},_drawCoords:function(a,b){a.beginPath(),a.moveTo(b[0],b[1]),a.lineTo(b[2],b[3]),a.lineTo(b[4],b[5]),a.closePath()},create:function(){var a=this.corner=(sa||da.ie)&&this._parseCorner(this.options.corner);return this.enabled=!!this.corner&&"c"!==this.corner.abbrev(),this.enabled&&(this.qtip.cache.corner=a.clone(),this.update()),this.element.toggle(this.enabled),this.corner},update:function(b,c){if(!this.enabled)return this;var e,f,g,h,i,j,k,l,m=this.qtip.elements,n=this.element,o=n.children(),p=this.options,q=this.size,r=p.mimic,s=Math.round;b||(b=this.qtip.cache.corner||this.corner),r===E?r=b:(r=new A(r),r.precedance=b.precedance,"inherit"===r.x?r.x=b.x:"inherit"===r.y?r.y=b.y:r.x===r.y&&(r[b.precedance]=b[b.precedance])),f=r.precedance,b.precedance===G?this._swapDimensions():this._resetDimensions(),e=this.color=this._parseColours(b),e[1]!==qa?(l=this.border=this._parseWidth(b,b[b.precedance]),p.border&&1>l&&!ta.test(e[1])&&(e[0]=e[1]),this.border=l=p.border!==D?p.border:l):this.border=l=0,k=this.size=this._calculateSize(b),n.css({width:k[0],height:k[1],lineHeight:k[1]+"px"}),j=b.precedance===H?[s(r.x===L?l:r.x===N?k[0]-q[0]-l:(k[0]-q[0])/2),s(r.y===K?k[1]-q[1]:0)]:[s(r.x===L?k[0]-q[0]:0),s(r.y===K?l:r.y===M?k[1]-q[1]-l:(k[1]-q[1])/2)],sa?(g=o[0].getContext("2d"),g.restore(),g.save(),g.clearRect(0,0,6e3,6e3),h=this._calculateTip(r,q,ja),i=this._calculateTip(r,this.size,ja),o.attr(I,k[0]*ja).attr(J,k[1]*ja),o.css(I,k[0]).css(J,k[1]),this._drawCoords(g,i),g.fillStyle=e[1],g.fill(),g.translate(j[0]*ja,j[1]*ja),this._drawCoords(g,h),g.fillStyle=e[0],g.fill()):(h=this._calculateTip(r),h="m"+h[0]+","+h[1]+" l"+h[2]+","+h[3]+" "+h[4]+","+h[5]+" xe",j[2]=l&&/^(r|b)/i.test(b.string())?8===da.ie?2:1:0,o.css({coordsize:k[0]+l+" "+k[1]+l,antialias:""+(r.string().indexOf(O)>-1),left:j[0]-j[2]*Number(f===G),top:j[1]-j[2]*Number(f===H),width:k[0]+l,height:k[1]+l}).each(function(a){var b=d(this);b[b.prop?"prop":"attr"]({coordsize:k[0]+l+" "+k[1]+l,path:h,fillcolor:e[0],filled:!!a,stroked:!a}).toggle(!(!l&&!a)),!a&&b.html(ia("stroke",'weight="'+2*l+'px" color="'+e[1]+'" miterlimit="1000" joinstyle="miter"'))})),a.opera&&setTimeout(function(){m.tip.css({display:"inline-block",visibility:"visible"})},1),c!==E&&this.calculate(b,k)},calculate:function(a,b){if(!this.enabled)return E;var c,e,f=this,g=this.qtip.elements,h=this.element,i=this.options.offset,j={};
4
  return a=a||this.corner,c=a.precedance,b=b||this._calculateSize(a),e=[a.x,a.y],c===G&&e.reverse(),d.each(e,function(d,e){var h,k,l;e===O?(h=c===H?L:K,j[h]="50%",j[ma+"-"+h]=-Math.round(b[c===H?0:1]/2)+i):(h=f._parseWidth(a,e,g.tooltip),k=f._parseWidth(a,e,g.content),l=f._parseRadius(a),j[e]=Math.max(-f.border,d?k:i+(l>h?l:-h)))}),j[a[c]]-=b[c===G?0:1],h.css({margin:"",top:"",bottom:"",left:"",right:""}).css(j),j},reposition:function(a,b,d){function e(a,b,c,d,e){a===Q&&j.precedance===b&&k[d]&&j[c]!==O?j.precedance=j.precedance===G?H:G:a!==Q&&k[d]&&(j[b]=j[b]===O?k[d]>0?d:e:j[b]===d?e:d)}function f(a,b,e){j[a]===O?p[ma+"-"+b]=o[a]=g[ma+"-"+b]-k[b]:(h=g[e]!==c?[k[b],-g[b]]:[-k[b],g[b]],(o[a]=Math.max(h[0],h[1]))>h[0]&&(d[b]-=k[b],o[b]=E),p[g[e]!==c?e:b]=o[a])}if(this.enabled){var g,h,i=b.cache,j=this.corner.clone(),k=d.adjusted,l=b.options.position.adjust.method.split(" "),m=l[0],n=l[1]||l[0],o={left:E,top:E,x:0,y:0},p={};this.corner.fixed!==D&&(e(m,G,H,L,N),e(n,H,G,K,M),j.string()===i.corner.string()&&i.cornerTop===k.top&&i.cornerLeft===k.left||this.update(j,E)),g=this.calculate(j),g.right!==c&&(g.left=-g.right),g.bottom!==c&&(g.top=-g.bottom),g.user=this.offset,o.left=m===Q&&!!k.left,o.left&&f(G,L,N),o.top=n===Q&&!!k.top,o.top&&f(H,K,M),this.element.css(p).toggle(!(o.x&&o.y||j.x===O&&o.y||j.y===O&&o.x)),d.left-=g.left.charAt?g.user:m!==Q||o.top||!o.left&&!o.top?g.left+this.border:0,d.top-=g.top.charAt?g.user:n!==Q||o.left||!o.left&&!o.top?g.top+this.border:0,i.cornerLeft=k.left,i.cornerTop=k.top,i.corner=j.clone()}},destroy:function(){this.qtip._unbind(this.qtip.tooltip,this._ns),this.qtip.elements.tip&&this.qtip.elements.tip.find("*").remove().end().remove()}}),ha=R.tip=function(a){return new v(a,a.options.style.tip)},ha.initialize="render",ha.sanitize=function(a){if(a.style&&"tip"in a.style){var b=a.style.tip;"object"!=typeof b&&(b=a.style.tip={corner:b}),/string|boolean/i.test(typeof b.corner)||(b.corner=D)}},B.tip={"^position.my|style.tip.(corner|mimic|border)$":function(){this.create(),this.qtip.reposition()},"^style.tip.(height|width)$":function(a){this.size=[a.width,a.height],this.update(),this.qtip.reposition()},"^content.title|style.(classes|widget)$":function(){this.update()}},d.extend(D,y.defaults,{style:{tip:{corner:D,mimic:E,width:6,height:6,border:D,offset:0}}});var wa,xa,ya="qtip-modal",za="."+ya;xa=function(){function a(a){if(d.expr[":"].focusable)return d.expr[":"].focusable;var b,c,e,f=!isNaN(d.attr(a,"tabindex")),g=a.nodeName&&a.nodeName.toLowerCase();return"area"===g?(b=a.parentNode,c=b.name,a.href&&c&&"map"===b.nodeName.toLowerCase()?(e=d("img[usemap=#"+c+"]")[0],!!e&&e.is(":visible")):!1):/input|select|textarea|button|object/.test(g)?!a.disabled:"a"===g?a.href||f:f}function c(a){j.length<1&&a.length?a.not("body").blur():j.first().focus()}function e(a){if(h.is(":visible")){var b,e=d(a.target),g=f.tooltip,i=e.closest(W);b=i.length<1?E:parseInt(i[0].style.zIndex,10)>parseInt(g[0].style.zIndex,10),b||e.closest(W)[0]===g[0]||c(e)}}var f,g,h,i=this,j={};d.extend(i,{init:function(){return h=i.elem=d("<div />",{id:"qtip-overlay",html:"<div></div>",mousedown:function(){return E}}).hide(),d(b.body).bind("focusin"+za,e),d(b).bind("keydown"+za,function(a){f&&f.options.show.modal.escape&&27===a.keyCode&&f.hide(a)}),h.bind("click"+za,function(a){f&&f.options.show.modal.blur&&f.hide(a)}),i},update:function(b){f=b,j=b.options.show.modal.stealfocus!==E?b.tooltip.find("*").filter(function(){return a(this)}):[]},toggle:function(a,e,j){var k=a.tooltip,l=a.options.show.modal,m=l.effect,n=e?"show":"hide",o=h.is(":visible"),p=d(za).filter(":visible:not(:animated)").not(k);return i.update(a),e&&l.stealfocus!==E&&c(d(":focus")),h.toggleClass("blurs",l.blur),e&&h.appendTo(b.body),h.is(":animated")&&o===e&&g!==E||!e&&p.length?i:(h.stop(D,E),d.isFunction(m)?m.call(h,e):m===E?h[n]():h.fadeTo(parseInt(j,10)||90,e?1:0,function(){e||h.hide()}),e||h.queue(function(a){h.css({left:"",top:""}),d(za).length||h.detach(),a()}),g=e,f.destroyed&&(f=F),i)}}),i.init()},xa=new xa,d.extend(w.prototype,{init:function(a){var b=a.tooltip;return this.options.on?(a.elements.overlay=xa.elem,b.addClass(ya).css("z-index",y.modal_zindex+d(za).length),a._bind(b,["tooltipshow","tooltiphide"],function(a,c,e){var f=a.originalEvent;if(a.target===b[0])if(f&&"tooltiphide"===a.type&&/mouse(leave|enter)/.test(f.type)&&d(f.relatedTarget).closest(xa.elem[0]).length)try{a.preventDefault()}catch(g){}else(!f||f&&"tooltipsolo"!==f.type)&&this.toggle(a,"tooltipshow"===a.type,e)},this._ns,this),a._bind(b,"tooltipfocus",function(a,c){if(!a.isDefaultPrevented()&&a.target===b[0]){var e=d(za),f=y.modal_zindex+e.length,g=parseInt(b[0].style.zIndex,10);xa.elem[0].style.zIndex=f-1,e.each(function(){this.style.zIndex>g&&(this.style.zIndex-=1)}),e.filter("."+$).qtip("blur",a.originalEvent),b.addClass($)[0].style.zIndex=f,xa.update(c);try{a.preventDefault()}catch(h){}}},this._ns,this),void a._bind(b,"tooltiphide",function(a){a.target===b[0]&&d(za).filter(":visible").not(b).last().qtip("focus",a)},this._ns,this)):this},toggle:function(a,b,c){return a&&a.isDefaultPrevented()?this:void xa.toggle(this.qtip,!!b,c)},destroy:function(){this.qtip.tooltip.removeClass(ya),this.qtip._unbind(this.qtip.tooltip,this._ns),xa.toggle(this.qtip,E),delete this.qtip.elements.overlay}}),wa=R.modal=function(a){return new w(a,a.options.show.modal)},wa.sanitize=function(a){a.show&&("object"!=typeof a.show.modal?a.show.modal={on:!!a.show.modal}:"undefined"==typeof a.show.modal.on&&(a.show.modal.on=D))},y.modal_zindex=y.zindex-200,wa.initialize="render",B.modal={"^show.modal.(on|blur)$":function(){this.destroy(),this.init(),this.qtip.elems.overlay.toggle(this.qtip.tooltip[0].offsetWidth>0)}},d.extend(D,y.defaults,{show:{modal:{on:E,effect:D,blur:D,stealfocus:D,escape:D}}}),R.viewport=function(c,d,e,f,g,h,i){function j(a,b,c,e,f,g,h,i,j){var k=d[f],s=u[a],t=v[a],w=c===Q,x=s===f?j:s===g?-j:-j/2,y=t===f?i:t===g?-i:-i/2,z=q[f]+r[f]-(n?0:m[f]),A=z-k,B=k+j-(h===I?o:p)-z,C=x-(u.precedance===a||s===u[b]?y:0)-(t===O?i/2:0);return w?(C=(s===f?1:-1)*x,d[f]+=A>0?A:B>0?-B:0,d[f]=Math.max(-m[f]+r[f],k-C,Math.min(Math.max(-m[f]+r[f]+(h===I?o:p),k+C),d[f],"center"===s?k-x:1e9))):(e*=c===P?2:0,A>0&&(s!==f||B>0)?(d[f]-=C+e,l.invert(a,f)):B>0&&(s!==g||A>0)&&(d[f]-=(s===O?-C:C)+e,l.invert(a,g)),d[f]<q[f]&&-d[f]>B&&(d[f]=k,l=u.clone())),d[f]-k}var k,l,m,n,o,p,q,r,s=e.target,t=c.elements.tooltip,u=e.my,v=e.at,w=e.adjust,x=w.method.split(" "),y=x[0],z=x[1]||x[0],A=e.viewport,B=e.container,C={left:0,top:0};return A.jquery&&s[0]!==a&&s[0]!==b.body&&"none"!==w.method?(m=B.offset()||C,n="static"===B.css("position"),k="fixed"===t.css("position"),o=A[0]===a?A.width():A.outerWidth(E),p=A[0]===a?A.height():A.outerHeight(E),q={left:k?0:A.scrollLeft(),top:k?0:A.scrollTop()},r=A.offset()||C,"shift"===y&&"shift"===z||(l=u.clone()),C={left:"none"!==y?j(G,H,y,w.x,L,N,I,f,h):0,top:"none"!==z?j(H,G,z,w.y,K,M,J,g,i):0,my:l}):C},R.polys={polygon:function(a,b){var c,d,e,f={width:0,height:0,position:{top:1e10,right:0,bottom:0,left:1e10},adjustable:E},g=0,h=[],i=1,j=1,k=0,l=0;for(g=a.length;g--;)c=[parseInt(a[--g],10),parseInt(a[g+1],10)],c[0]>f.position.right&&(f.position.right=c[0]),c[0]<f.position.left&&(f.position.left=c[0]),c[1]>f.position.bottom&&(f.position.bottom=c[1]),c[1]<f.position.top&&(f.position.top=c[1]),h.push(c);if(d=f.width=Math.abs(f.position.right-f.position.left),e=f.height=Math.abs(f.position.bottom-f.position.top),"c"===b.abbrev())f.position={left:f.position.left+f.width/2,top:f.position.top+f.height/2};else{for(;d>0&&e>0&&i>0&&j>0;)for(d=Math.floor(d/2),e=Math.floor(e/2),b.x===L?i=d:b.x===N?i=f.width-d:i+=Math.floor(d/2),b.y===K?j=e:b.y===M?j=f.height-e:j+=Math.floor(e/2),g=h.length;g--&&!(h.length<2);)k=h[g][0]-f.position.left,l=h[g][1]-f.position.top,(b.x===L&&k>=i||b.x===N&&i>=k||b.x===O&&(i>k||k>f.width-i)||b.y===K&&l>=j||b.y===M&&j>=l||b.y===O&&(j>l||l>f.height-j))&&h.splice(g,1);f.position={left:h[0][0],top:h[0][1]}}return f},rect:function(a,b,c,d){return{width:Math.abs(c-a),height:Math.abs(d-b),position:{left:Math.min(a,c),top:Math.min(b,d)}}},_angles:{tc:1.5,tr:7/4,tl:5/4,bc:.5,br:.25,bl:.75,rc:2,lc:1,c:0},ellipse:function(a,b,c,d,e){var f=R.polys._angles[e.abbrev()],g=0===f?0:c*Math.cos(f*Math.PI),h=d*Math.sin(f*Math.PI);return{width:2*c-Math.abs(g),height:2*d-Math.abs(h),position:{left:a+g,top:b+h},adjustable:E}},circle:function(a,b,c,d){return R.polys.ellipse(a,b,c,c,d)}},R.svg=function(a,c,e){for(var f,g,h,i,j,k,l,m,n,o=c[0],p=d(o.ownerSVGElement),q=o.ownerDocument,r=(parseInt(c.css("stroke-width"),10)||0)/2;!o.getBBox;)o=o.parentNode;if(!o.getBBox||!o.parentNode)return E;switch(o.nodeName){case"ellipse":case"circle":m=R.polys.ellipse(o.cx.baseVal.value,o.cy.baseVal.value,(o.rx||o.r).baseVal.value+r,(o.ry||o.r).baseVal.value+r,e);break;case"line":case"polygon":case"polyline":for(l=o.points||[{x:o.x1.baseVal.value,y:o.y1.baseVal.value},{x:o.x2.baseVal.value,y:o.y2.baseVal.value}],m=[],k=-1,i=l.numberOfItems||l.length;++k<i;)j=l.getItem?l.getItem(k):l[k],m.push.apply(m,[j.x,j.y]);m=R.polys.polygon(m,e);break;default:m=o.getBBox(),m={width:m.width,height:m.height,position:{left:m.x,top:m.y}}}return n=m.position,p=p[0],p.createSVGPoint&&(g=o.getScreenCTM(),l=p.createSVGPoint(),l.x=n.left,l.y=n.top,h=l.matrixTransform(g),n.left=h.x,n.top=h.y),q!==b&&"mouse"!==a.position.target&&(f=d((q.defaultView||q.parentWindow).frameElement).offset(),f&&(n.left+=f.left,n.top+=f.top)),q=d(q),n.left+=q.scrollLeft(),n.top+=q.scrollTop(),m},R.imagemap=function(a,b,c){b.jquery||(b=d(b));var e,f,g,h,i,j=(b.attr("shape")||"rect").toLowerCase().replace("poly","polygon"),k=d('img[usemap="#'+b.parent("map").attr("name")+'"]'),l=d.trim(b.attr("coords")),m=l.replace(/,$/,"").split(",");if(!k.length)return E;if("polygon"===j)h=R.polys.polygon(m,c);else{if(!R.polys[j])return E;for(g=-1,i=m.length,f=[];++g<i;)f.push(parseInt(m[g],10));h=R.polys[j].apply(this,f.concat(c))}return e=k.offset(),e.left+=Math.ceil((k.outerWidth(E)-k.width())/2),e.top+=Math.ceil((k.outerHeight(E)-k.height())/2),h.position.left+=e.left,h.position.top+=e.top,h};var Aa,Ba='<iframe class="qtip-bgiframe" frameborder="0" tabindex="-1" src="javascript:\'\';" style="display:block; position:absolute; z-index:-1; filter:alpha(opacity=0); -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";"></iframe>';d.extend(x.prototype,{_scroll:function(){var b=this.qtip.elements.overlay;b&&(b[0].style.top=d(a).scrollTop()+"px")},init:function(c){var e=c.tooltip;d("select, object").length<1&&(this.bgiframe=c.elements.bgiframe=d(Ba).appendTo(e),c._bind(e,"tooltipmove",this.adjustBGIFrame,this._ns,this)),this.redrawContainer=d("<div/>",{id:S+"-rcontainer"}).appendTo(b.body),c.elements.overlay&&c.elements.overlay.addClass("qtipmodal-ie6fix")&&(c._bind(a,["scroll","resize"],this._scroll,this._ns,this),c._bind(e,["tooltipshow"],this._scroll,this._ns,this)),this.redraw()},adjustBGIFrame:function(){var a,b,c=this.qtip.tooltip,d={height:c.outerHeight(E),width:c.outerWidth(E)},e=this.qtip.plugins.tip,f=this.qtip.elements.tip;b=parseInt(c.css("borderLeftWidth"),10)||0,b={left:-b,top:-b},e&&f&&(a="x"===e.corner.precedance?[I,L]:[J,K],b[a[1]]-=f[a[0]]()),this.bgiframe.css(b).css(d)},redraw:function(){if(this.qtip.rendered<1||this.drawing)return this;var a,b,c,d,e=this.qtip.tooltip,f=this.qtip.options.style,g=this.qtip.options.position.container;return this.qtip.drawing=1,f.height&&e.css(J,f.height),f.width?e.css(I,f.width):(e.css(I,"").appendTo(this.redrawContainer),b=e.width(),1>b%2&&(b+=1),c=e.css("maxWidth")||"",d=e.css("minWidth")||"",a=(c+d).indexOf("%")>-1?g.width()/100:0,c=(c.indexOf("%")>-1?a:1*parseInt(c,10))||b,d=(d.indexOf("%")>-1?a:1*parseInt(d,10))||0,b=c+d?Math.min(Math.max(b,d),c):b,e.css(I,Math.round(b)).appendTo(g)),this.drawing=0,this},destroy:function(){this.bgiframe&&this.bgiframe.remove(),this.qtip._unbind([a,this.qtip.tooltip],this._ns)}}),Aa=R.ie6=function(a){return 6===da.ie?new x(a):E},Aa.initialize="render",B.ie6={"^content|style$":function(){this.redraw()}}})}(window,document);
 
js/lazyload.d.ts ADDED
@@ -0,0 +1,326 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ interface ILazyLoadOptions {
2
+ /**
3
+ * The CSS selector of the elements to load lazily,
4
+ * which will be selected as descendants of the container object.
5
+ * @default ".lazy"
6
+ */
7
+ elements_selector?: string;
8
+ /**
9
+ * The scrolling container of the elements in the `elements_selector` option.
10
+ *
11
+ * @default document
12
+ */
13
+ container?: HTMLElement;
14
+ /**
15
+ * A number of pixels representing the outer distance off the scrolling area
16
+ * from which to start loading the elements.
17
+ *
18
+ * @default "300 0"
19
+ */
20
+ threshold?: number;
21
+ /**
22
+ *
23
+ * Similar to threshold, but accepting multiple values and both px and % units.
24
+ * It maps directly to the rootMargin property of IntersectionObserver (read more),
25
+ * so it must be a string with a syntax similar to the CSS margin property.
26
+ * You can use it when you need to have different thresholds for the scrolling area.
27
+ * It overrides threshold when passed.
28
+ *
29
+ * @default null
30
+ *
31
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver/rootMargin
32
+ */
33
+ thresholds?: string;
34
+ /**
35
+ * The name of the data attribute containing the element URL to load,
36
+ * excluding the `"data-"` part.
37
+ * E.g. if your data attribute is named `"data-src"`,
38
+ * just pass `"src"`
39
+ *
40
+ * @default "src"
41
+ */
42
+ data_src?: string;
43
+ /**
44
+ * The name of the data attribute containing the image URL set to load,
45
+ * in either img and source tags,
46
+ * excluding the "data-" part.
47
+ * E.g. if your data attribute is named `"data-srcset"`,
48
+ * just pass `"srcset"`
49
+ *
50
+ * @default "srcset"
51
+ */
52
+ data_srcset?: string;
53
+ /**
54
+ * The name of the data attribute containing the sizes attribute to use, excluding the `"data-"` part.
55
+ * E.g. if your data attribute is named `"data-sizes"`, just pass `"sizes"`
56
+ *
57
+ * @default sizes
58
+ */
59
+ data_sizes?: string;
60
+ /**
61
+ * The name of the data attribute containing the URL of `background-image` to load lazily,
62
+ * excluding the `"data-"` part.
63
+ * E.g. if your data attribute is named `"data-bg"`, just pass `"bg"`.
64
+ * The attribute value must be a valid value for `background-image`,
65
+ * including the `url()` part of the CSS instruction.
66
+ *
67
+ *
68
+ * @default "bg"
69
+ */
70
+ data_bg?: string;
71
+ /**
72
+ * The name of the data attribute containing the URL of `background-image`
73
+ * to load lazily on HiDPI screens, excluding the `"data-"` part.
74
+ * E.g. if your data attribute is named `"data-bg-hidpi"`, just pass `"bg-hidpi"`.
75
+ * The attribute value must be a valid value for `background-image`,
76
+ * including the `url()` part of the CSS instruction.
77
+ *
78
+ * @default "bg-hidpi"
79
+ */
80
+ data_bg_hidpi?: string;
81
+ /**
82
+ * The name of the data attribute containing the value of multiple `background-image`
83
+ * to load lazily, excluding the `"data-"` part.
84
+ * E.g. if your data attribute is named `"data-bg-multi"`, just pass `"bg-multi"`.
85
+ * The attribute value must be a valid value for `background-image`,
86
+ * including the `url()` part of the CSS instruction.
87
+ *
88
+ * @default "bg-multi"
89
+ */
90
+ data_bg_multi?: string;
91
+ /**
92
+ * The name of the data attribute containing the value of multiple `background-image`
93
+ * to load lazily on HiDPI screens, excluding the `"data-"` part.
94
+ * E.g. if your data attribute is named `"data-bg-multi-hidpi"`, just pass `"bg-multi-hidpi"`.
95
+ * The attribute value must be a valid value for `background-image`,
96
+ * including the `url()` part of the CSS instruction.
97
+ *
98
+ * @default "bg-multi-hidpi"
99
+ */
100
+ data_bg_multi_hidpi?: string;
101
+ /**
102
+ * The name of the data attribute containing the value of poster to load lazily,
103
+ * excluding the `"data-"` part.
104
+ * E.g. if your data attribute is named `"data-poster"`, just pass `"poster"`.
105
+ *
106
+ * @default "poster"
107
+ */
108
+ data_poster?: string;
109
+
110
+ /**
111
+ * The class applied to the multiple background elements after the multiple background was applied
112
+ *
113
+ * @default "applied"
114
+ */
115
+ class_applied?: string;
116
+ /**
117
+ * The class applied to the elements while the loading is in progress.
118
+ *
119
+ * @default "loading"
120
+ */
121
+ class_loading?: string;
122
+ /**
123
+ * The class applied to the elements when the loading is complete.
124
+ *
125
+ * @default "loaded"
126
+ */
127
+ class_loaded?: string;
128
+ /**
129
+ * The class applied to the elements when the element causes an error.
130
+ *
131
+ * @default "error"
132
+ */
133
+ class_error?: string;
134
+ /**
135
+ * DEPRECATED
136
+ *
137
+ * You should change `load_delay: ___` with `cancel_on_exit: true`.
138
+ *
139
+ * @deprecated
140
+ */
141
+ load_delay?: number;
142
+
143
+ /**
144
+ * A boolean that defines whether or not to cancel the download of the images
145
+ * that exit the viewport while they are still loading,
146
+ * eventually restoring the original attributes.
147
+ * It applies only to images so to the `img` (and `picture`) tags,
148
+ * so it doesn't apply to background images, `iframes` nor `videos`.
149
+ *
150
+ * @default true
151
+ */
152
+ cancel_on_exit?: boolean;
153
+ /**
154
+ * A boolean that defines whether or not to automatically unobserve elements once they entered the viewport
155
+ *
156
+ * @default false
157
+ */
158
+ unobserve_entered?: boolean;
159
+ /**
160
+ * A boolean that defines whether or not to automatically unobserve elements once they've loaded or throwed an error
161
+ *
162
+ * @default true
163
+ */
164
+ unobserve_completed?: boolean;
165
+ /**
166
+ * DEPRECATED
167
+ *
168
+ * You should replace `auto_unobserve` with `unobserve_completed`
169
+ *
170
+ * @deprecated
171
+ */
172
+ auto_unobserve?: boolean;
173
+ /**
174
+ * A callback function which is called whenever a multiple background element starts loading.
175
+ * Arguments: `DOM element`, `lazyload instance`.
176
+ */
177
+ callback_applied?: (elt: HTMLElement, instance: ILazyLoadInstance) => void;
178
+ /**
179
+ * A callback function which is called whenever an element loading is
180
+ * canceled while loading, as for `cancel_on_exit: true`
181
+ */
182
+ callback_cancel?: (
183
+ elt: HTMLElement,
184
+ entry: IntersectionObserverEntry,
185
+ instance: ILazyLoadInstance
186
+ ) => void;
187
+ /**
188
+ * A callback function which is called whenever an element enters the viewport.
189
+ * Arguments: DOM element, intersection observer entry, lazyload instance.
190
+ */
191
+ callback_enter?: (
192
+ elt: HTMLElement,
193
+ entry: IntersectionObserverEntry,
194
+ instance: ILazyLoadInstance
195
+ ) => void;
196
+ /**
197
+ * A callback function which is called whenever an element exits the viewport.
198
+ * Arguments: `DOM element`, `intersection observer entry`, `lazyload instance`.
199
+ */
200
+ callback_exit?: (
201
+ elt: HTMLElement,
202
+ entry: IntersectionObserverEntry,
203
+ instance: ILazyLoadInstance
204
+ ) => void;
205
+ /**
206
+ * A callback function which is called whenever an element starts loading.
207
+ * Arguments: `DOM element`, `lazyload instance`.
208
+ */
209
+ callback_loading?: (elt: HTMLElement, instance: ILazyLoadInstance) => void;
210
+ /**
211
+ * A callback function which is called whenever an element finishes loading.
212
+ * Note that, in version older than 11.0.0, this option went under the name `callback_load`.
213
+ * Arguments: `DOM element`, `lazyload instance`.
214
+ */
215
+ callback_loaded?: (elt: HTMLElement, instance: ILazyLoadInstance) => void;
216
+ /**
217
+ * A callback function which is called whenever an element triggers an error.
218
+ * Arguments: `DOM element`, `lazyload instance`.
219
+ */
220
+ callback_error?: (elt: HTMLElement, instance: ILazyLoadInstance) => void;
221
+ /**
222
+ *
223
+ */
224
+
225
+ /**
226
+ * A callback function which is called when there are no more elements to load and all elements have been downloaded.
227
+ * Arguments: `lazyload instance`.
228
+ */
229
+ callback_finish?: () => void;
230
+ /**
231
+ * This boolean sets whether or not to use [native lazy loading](https://addyosmani.com/blog/lazy-loading/)
232
+ * to do [hybrid lazy loading](https://www.smashingmagazine.com/2019/05/hybrid-lazy-loading-progressive-migration-native/).
233
+ * On browsers that support it, LazyLoad will set the `loading="lazy"` attribute on `images` and `iframes`,
234
+ * and delegate their loading to the browser.
235
+ *
236
+ * @default false
237
+ */
238
+ use_native?: boolean;
239
+ /**
240
+ * DEPRECATED, WILL BE REMOVED IN V. 15
241
+ *
242
+ * @deprecated
243
+ */
244
+ callback_reveal?: (elt: HTMLElement) => void;
245
+ }
246
+
247
+ interface ILazyLoadInstance {
248
+ /**
249
+ * Make LazyLoad to re-check the DOM for `elements_selector` elements inside its `container`.
250
+ *
251
+ * ### Use case
252
+ *
253
+ * Update LazyLoad after you added or removed DOM elements to the page.
254
+ */
255
+ update: (elements?: NodeListOf<HTMLElement>) => void;
256
+
257
+ /**
258
+ * Destroys the instance, unsetting instance variables and removing listeners.
259
+ *
260
+ * ### Use case
261
+ *
262
+ * Free up some memory. Especially useful for Single Page Applications.
263
+ */
264
+ destroy: () => void;
265
+
266
+ load: (element: HTMLElement, force?: boolean) => void;
267
+
268
+ /**
269
+ * Loads all the lazy elements right away and stop observing them,
270
+ * no matter if they are inside or outside the viewport,
271
+ * no matter if they are hidden or visible.
272
+ *
273
+ * ### Use case
274
+ *
275
+ * To load all the remaining elements in advance
276
+ */
277
+ loadAll: () => void;
278
+
279
+ /**
280
+ * The number of elements that are currently downloading from the network
281
+ * (limitedly to the ones managed by the instance of LazyLoad).
282
+ * This is particularly useful to understand whether
283
+ * or not is safe to destroy this instance of LazyLoad.
284
+ */
285
+ loadingCount: number;
286
+
287
+ /**
288
+ * The number of elements that haven't been lazyloaded yet
289
+ * (limitedly to the ones managed by the instance of LazyLoad)
290
+ */
291
+ toLoadCount: number;
292
+ }
293
+
294
+ interface ILazyLoad {
295
+ new (
296
+ options?: ILazyLoadOptions,
297
+ elements?: NodeListOf<HTMLElement>
298
+ ): ILazyLoadInstance;
299
+
300
+ /**
301
+ * Immediately loads the lazy `element`.
302
+ * You can pass your custom options in the settings parameter.
303
+ * Note that the `elements_selector` option has no effect,
304
+ * since you are passing the element as a parameter.
305
+ * Also note that this method has effect only once on a specific `element`.
306
+ *
307
+ * ### Use case
308
+ *
309
+ * To load an `element` at mouseover or at any other event different than "entering the viewport"
310
+ */
311
+ load(element: HTMLElement, settings: ILazyLoadOptions): void;
312
+
313
+ /**
314
+ * Resets the internal status of the given element.
315
+ *
316
+ * ### Use case
317
+ *
318
+ * To tell LazyLoad to consider this `element` again, for example if you changed
319
+ * the `data-src` attribute after the previous `data-src` was loaded,
320
+ * call this method, then call `update()`.
321
+ */
322
+ resetStatus(element: HTMLElement): void;
323
+ }
324
+
325
+ declare var LazyLoad: ILazyLoad;
326
+
js/lazyload.min.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(n,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(n="undefined"!=typeof globalThis?globalThis:n||self).LazyLoad=t()}(this,(function(){"use strict";function n(){return n=Object.assign||function(n){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},n.apply(this,arguments)}var t="undefined"!=typeof window,e=t&&!("onscroll"in window)||"undefined"!=typeof navigator&&/(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent),i=t&&"IntersectionObserver"in window,o=t&&"classList"in document.createElement("p"),a=t&&window.devicePixelRatio>1,r={elements_selector:".lazy",container:e||t?document:null,threshold:300,thresholds:null,data_src:"src",data_srcset:"srcset",data_sizes:"sizes",data_bg:"bg",data_bg_hidpi:"bg-hidpi",data_bg_multi:"bg-multi",data_bg_multi_hidpi:"bg-multi-hidpi",data_poster:"poster",class_applied:"applied",class_loading:"loading",class_loaded:"loaded",class_error:"error",class_entered:"entered",class_exited:"exited",unobserve_completed:!0,unobserve_entered:!1,cancel_on_exit:!0,callback_enter:null,callback_exit:null,callback_applied:null,callback_loading:null,callback_loaded:null,callback_error:null,callback_finish:null,callback_cancel:null,use_native:!1},c=function(t){return n({},r,t)},u=function(n,t){var e,i="LazyLoad::Initialized",o=new n(t);try{e=new CustomEvent(i,{detail:{instance:o}})}catch(n){(e=document.createEvent("CustomEvent")).initCustomEvent(i,!1,!1,{instance:o})}window.dispatchEvent(e)},l="src",s="srcset",f="sizes",d="poster",_="llOriginalAttrs",g="loading",v="loaded",b="applied",p="error",h="native",m="data-",E="ll-status",I=function(n,t){return n.getAttribute(m+t)},y=function(n){return I(n,E)},A=function(n,t){return function(n,t,e){var i="data-ll-status";null!==e?n.setAttribute(i,e):n.removeAttribute(i)}(n,0,t)},k=function(n){return A(n,null)},L=function(n){return null===y(n)},w=function(n){return y(n)===h},x=[g,v,b,p],O=function(n,t,e,i){n&&(void 0===i?void 0===e?n(t):n(t,e):n(t,e,i))},N=function(n,t){o?n.classList.add(t):n.className+=(n.className?" ":"")+t},C=function(n,t){o?n.classList.remove(t):n.className=n.className.replace(new RegExp("(^|\\s+)"+t+"(\\s+|$)")," ").replace(/^\s+/,"").replace(/\s+$/,"")},M=function(n){return n.llTempImage},z=function(n,t){if(t){var e=t._observer;e&&e.unobserve(n)}},R=function(n,t){n&&(n.loadingCount+=t)},T=function(n,t){n&&(n.toLoadCount=t)},G=function(n){for(var t,e=[],i=0;t=n.children[i];i+=1)"SOURCE"===t.tagName&&e.push(t);return e},D=function(n,t){var e=n.parentNode;e&&"PICTURE"===e.tagName&&G(e).forEach(t)},V=function(n,t){G(n).forEach(t)},F=[l],j=[l,d],P=[l,s,f],S=function(n){return!!n[_]},U=function(n){return n[_]},$=function(n){return delete n[_]},q=function(n,t){if(!S(n)){var e={};t.forEach((function(t){e[t]=n.getAttribute(t)})),n[_]=e}},H=function(n,t){if(S(n)){var e=U(n);t.forEach((function(t){!function(n,t,e){e?n.setAttribute(t,e):n.removeAttribute(t)}(n,t,e[t])}))}},B=function(n,t,e){N(n,t.class_loading),A(n,g),e&&(R(e,1),O(t.callback_loading,n,e))},J=function(n,t,e){e&&n.setAttribute(t,e)},K=function(n,t){J(n,f,I(n,t.data_sizes)),J(n,s,I(n,t.data_srcset)),J(n,l,I(n,t.data_src))},Q={IMG:function(n,t){D(n,(function(n){q(n,P),K(n,t)})),q(n,P),K(n,t)},IFRAME:function(n,t){q(n,F),J(n,l,I(n,t.data_src))},VIDEO:function(n,t){V(n,(function(n){q(n,F),J(n,l,I(n,t.data_src))})),q(n,j),J(n,d,I(n,t.data_poster)),J(n,l,I(n,t.data_src)),n.load()}},W=["IMG","IFRAME","VIDEO"],X=function(n,t){!t||function(n){return n.loadingCount>0}(t)||function(n){return n.toLoadCount>0}(t)||O(n.callback_finish,t)},Y=function(n,t,e){n.addEventListener(t,e),n.llEvLisnrs[t]=e},Z=function(n,t,e){n.removeEventListener(t,e)},nn=function(n){return!!n.llEvLisnrs},tn=function(n){if(nn(n)){var t=n.llEvLisnrs;for(var e in t){var i=t[e];Z(n,e,i)}delete n.llEvLisnrs}},en=function(n,t,e){!function(n){delete n.llTempImage}(n),R(e,-1),function(n){n&&(n.toLoadCount-=1)}(e),C(n,t.class_loading),t.unobserve_completed&&z(n,e)},on=function(n,t,e){var i=M(n)||n;nn(i)||function(n,t,e){nn(n)||(n.llEvLisnrs={});var i="VIDEO"===n.tagName?"loadeddata":"load";Y(n,i,t),Y(n,"error",e)}(i,(function(o){!function(n,t,e,i){var o=w(t);en(t,e,i),N(t,e.class_loaded),A(t,v),O(e.callback_loaded,t,i),o||X(e,i)}(0,n,t,e),tn(i)}),(function(o){!function(n,t,e,i){var o=w(t);en(t,e,i),N(t,e.class_error),A(t,p),O(e.callback_error,t,i),o||X(e,i)}(0,n,t,e),tn(i)}))},an=function(n,t,e){!function(n){n.llTempImage=document.createElement("IMG")}(n),on(n,t,e),function(n){S(n)||(n[_]={backgroundImage:n.style.backgroundImage})}(n),function(n,t,e){var i=I(n,t.data_bg),o=I(n,t.data_bg_hidpi),r=a&&o?o:i;r&&(n.style.backgroundImage='url("'.concat(r,'")'),M(n).setAttribute(l,r),B(n,t,e))}(n,t,e),function(n,t,e){var i=I(n,t.data_bg_multi),o=I(n,t.data_bg_multi_hidpi),r=a&&o?o:i;r&&(n.style.backgroundImage=r,function(n,t,e){N(n,t.class_applied),A(n,b),e&&(t.unobserve_completed&&z(n,t),O(t.callback_applied,n,e))}(n,t,e))}(n,t,e)},rn=function(n,t,e){!function(n){return W.indexOf(n.tagName)>-1}(n)?an(n,t,e):function(n,t,e){on(n,t,e),function(n,t,e){var i=Q[n.tagName];i&&(i(n,t),B(n,t,e))}(n,t,e)}(n,t,e)},cn=function(n){n.removeAttribute(l),n.removeAttribute(s),n.removeAttribute(f)},un=function(n){D(n,(function(n){H(n,P)})),H(n,P)},ln={IMG:un,IFRAME:function(n){H(n,F)},VIDEO:function(n){V(n,(function(n){H(n,F)})),H(n,j),n.load()}},sn=function(n,t){(function(n){var t=ln[n.tagName];t?t(n):function(n){if(S(n)){var t=U(n);n.style.backgroundImage=t.backgroundImage}}(n)})(n),function(n,t){L(n)||w(n)||(C(n,t.class_entered),C(n,t.class_exited),C(n,t.class_applied),C(n,t.class_loading),C(n,t.class_loaded),C(n,t.class_error))}(n,t),k(n),$(n)},fn=["IMG","IFRAME","VIDEO"],dn=function(n){return n.use_native&&"loading"in HTMLImageElement.prototype},_n=function(n,t,e){n.forEach((function(n){return function(n){return n.isIntersecting||n.intersectionRatio>0}(n)?function(n,t,e,i){var o=function(n){return x.indexOf(y(n))>=0}(n);A(n,"entered"),N(n,e.class_entered),C(n,e.class_exited),function(n,t,e){t.unobserve_entered&&z(n,e)}(n,e,i),O(e.callback_enter,n,t,i),o||rn(n,e,i)}(n.target,n,t,e):function(n,t,e,i){L(n)||(N(n,e.class_exited),function(n,t,e,i){e.cancel_on_exit&&function(n){return y(n)===g}(n)&&"IMG"===n.tagName&&(tn(n),function(n){D(n,(function(n){cn(n)})),cn(n)}(n),un(n),C(n,e.class_loading),R(i,-1),k(n),O(e.callback_cancel,n,t,i))}(n,t,e,i),O(e.callback_exit,n,t,i))}(n.target,n,t,e)}))},gn=function(n){return Array.prototype.slice.call(n)},vn=function(n){return n.container.querySelectorAll(n.elements_selector)},bn=function(n){return function(n){return y(n)===p}(n)},pn=function(n,t){return function(n){return gn(n).filter(L)}(n||vn(t))},hn=function(n,e){var o=c(n);this._settings=o,this.loadingCount=0,function(n,t){i&&!dn(n)&&(t._observer=new IntersectionObserver((function(e){_n(e,n,t)}),function(n){return{root:n.container===document?null:n.container,rootMargin:n.thresholds||n.threshold+"px"}}(n)))}(o,this),function(n,e){t&&window.addEventListener("online",(function(){!function(n,t){var e;(e=vn(n),gn(e).filter(bn)).forEach((function(t){C(t,n.class_error),k(t)})),t.update()}(n,e)}))}(o,this),this.update(e)};return hn.prototype={update:function(n){var t,o,a=this._settings,r=pn(n,a);T(this,r.length),!e&&i?dn(a)?function(n,t,e){n.forEach((function(n){-1!==fn.indexOf(n.tagName)&&function(n,t,e){n.setAttribute("loading","lazy"),on(n,t,e),function(n,t){var e=Q[n.tagName];e&&e(n,t)}(n,t),A(n,h)}(n,t,e)})),T(e,0)}(r,a,this):(o=r,function(n){n.disconnect()}(t=this._observer),function(n,t){t.forEach((function(t){n.observe(t)}))}(t,o)):this.loadAll(r)},destroy:function(){this._observer&&this._observer.disconnect(),vn(this._settings).forEach((function(n){$(n)})),delete this._observer,delete this._settings,delete this.loadingCount,delete this.toLoadCount},loadAll:function(n){var t=this,e=this._settings;pn(n,e).forEach((function(n){z(n,t),rn(n,e,t)}))},restoreAll:function(){var n=this._settings;vn(n).forEach((function(t){sn(t,n)}))}},hn.load=function(n,t){var e=c(t);rn(n,e)},hn.resetStatus=function(n){k(n)},t&&function(n,t){if(t)if(t.length)for(var e,i=0;e=t[i];i+=1)u(n,e);else u(n,t)}(hn,window.lazyLoadOptions),hn}));
js/menu-editor.js CHANGED
@@ -2337,7 +2337,7 @@ function encodeMenuAsJSON(tree){
2337
  //Compress the admin menu.
2338
  tree = compressMenu(tree);
2339
 
2340
- return $.toJSON(tree);
2341
  }
2342
 
2343
  function readMenuTreeState(){
2337
  //Compress the admin menu.
2338
  tree = compressMenu(tree);
2339
 
2340
+ return JSON.stringify(tree);
2341
  }
2342
 
2343
  function readMenuTreeState(){
menu-editor.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Admin Menu Editor
4
  Plugin URI: http://w-shadow.com/blog/2008/12/20/admin-menu-editor-for-wordpress/
5
  Description: Lets you directly edit the WordPress admin menu. You can re-order, hide or rename existing menus, add custom menus and more.
6
- Version: 1.10
7
  Author: Janis Elsts
8
  Author URI: http://w-shadow.com/blog/
9
  License: GPLv3
3
  Plugin Name: Admin Menu Editor
4
  Plugin URI: http://w-shadow.com/blog/2008/12/20/admin-menu-editor-for-wordpress/
5
  Description: Lets you directly edit the WordPress admin menu. You can re-order, hide or rename existing menus, add custom menus and more.
6
+ Version: 1.10.1
7
  Author: Janis Elsts
8
  Author URI: http://w-shadow.com/blog/
9
  License: GPLv3
modules/actor-selector/actor-selector.js CHANGED
@@ -1,5 +1,4 @@
1
  /// <reference path="../../js/jquery.d.ts" />
2
- /// <reference path="../../js/jquery-json.d.ts" />
3
  /// <reference path="../../js/actor-manager.ts" />
4
  var AmeActorSelector = /** @class */ (function () {
5
  function AmeActorSelector(actorManager, isProVersion, allOptionEnabled) {
@@ -195,7 +194,7 @@ var AmeActorSelector = /** @class */ (function () {
195
  jQuery.post(this.ajaxParams.adminAjaxUrl, {
196
  'action': this.ajaxParams.ajaxUpdateAction,
197
  '_ajax_nonce': this.ajaxParams.ajaxUpdateNonce,
198
- 'visible_users': jQuery.toJSON(this.visibleUsers)
199
  });
200
  };
201
  AmeActorSelector.prototype.getCurrentUserActor = function () {
@@ -215,7 +214,7 @@ var AmeActorSelector = /** @class */ (function () {
215
  return name;
216
  };
217
  /**
218
- * Wrap the selected actor in a computed observable so that it can be used with Knockout.
219
  * @param ko
220
  */
221
  AmeActorSelector.prototype.createKnockoutObservable = function (ko) {
@@ -234,6 +233,31 @@ var AmeActorSelector = /** @class */ (function () {
234
  });
235
  return publicObservable;
236
  };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
237
  AmeActorSelector._ = wsAmeLodash;
238
  return AmeActorSelector;
239
  }());
1
  /// <reference path="../../js/jquery.d.ts" />
 
2
  /// <reference path="../../js/actor-manager.ts" />
3
  var AmeActorSelector = /** @class */ (function () {
4
  function AmeActorSelector(actorManager, isProVersion, allOptionEnabled) {
194
  jQuery.post(this.ajaxParams.adminAjaxUrl, {
195
  'action': this.ajaxParams.ajaxUpdateAction,
196
  '_ajax_nonce': this.ajaxParams.ajaxUpdateNonce,
197
+ 'visible_users': JSON.stringify(this.visibleUsers)
198
  });
199
  };
200
  AmeActorSelector.prototype.getCurrentUserActor = function () {
214
  return name;
215
  };
216
  /**
217
+ * Wrap the selected actor ID in a computed observable so that it can be used with Knockout.
218
  * @param ko
219
  */
220
  AmeActorSelector.prototype.createKnockoutObservable = function (ko) {
233
  });
234
  return publicObservable;
235
  };
236
+ AmeActorSelector.prototype.createIdObservable = function (ko) {
237
+ return this.createKnockoutObservable(ko);
238
+ };
239
+ AmeActorSelector.prototype.createActorObservable = function (ko) {
240
+ var _this = this;
241
+ var internalObservable = ko.observable((this.selectedActor === null) ? null : this.actorManager.getActor(this.selectedActor));
242
+ var publicObservable = ko.computed({
243
+ read: function () {
244
+ return internalObservable();
245
+ },
246
+ write: function (newActor) {
247
+ _this.setSelectedActor((newActor !== null) ? newActor.getId() : null);
248
+ }
249
+ });
250
+ var self = this;
251
+ this.onChange(function (newSelectedActor) {
252
+ if (newSelectedActor === null) {
253
+ internalObservable(null);
254
+ }
255
+ else {
256
+ internalObservable(self.actorManager.getActor(newSelectedActor));
257
+ }
258
+ });
259
+ return publicObservable;
260
+ };
261
  AmeActorSelector._ = wsAmeLodash;
262
  return AmeActorSelector;
263
  }());
modules/actor-selector/actor-selector.js.map ADDED
@@ -0,0 +1 @@
 
1
+ {"version":3,"file":"actor-selector.js","sourceRoot":"","sources":["actor-selector.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,kDAAkD;AAClD,kDAAkD;AAuBlD;IAkBC,0BACC,YAAsC,EACtC,YAAsB,EACtB,gBAAgC;QAAhC,iCAAA,EAAA,uBAAgC;QAHjC,iBA2BC;QA1CM,kBAAa,GAAW,IAAI,CAAC;QAC7B,wBAAmB,GAAW,KAAK,CAAC;QAEnC,iBAAY,GAAa,EAAE,CAAC;QAC5B,gBAAW,GAAmC,EAAE,CAAC;QAGxC,iBAAY,GAAY,KAAK,CAAC;QAE9B,qBAAgB,GAAY,IAAI,CAAC;QAE1C,wBAAmB,GAAgB,IAAI,CAAC;QAS/C,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QAEjC,IAAI,OAAO,YAAY,KAAK,WAAW,EAAE;YACxC,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;SACjC;QACD,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;QAEzC,IAAI,CAAC,gBAAgB,GAAG,sBAAsB,CAAC,gBAAgB,CAAC;QAChE,IAAI,CAAC,YAAY,GAA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G,IAAI,CAAC,UAAU,CAAC,eAAe;YAC/C,eAAe,EAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC;SAClD,CACD,CAAC;IACH,CAAC;IAED,8CAAmB,GAAnB;QACC,OAAO,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;IACzD,CAAC;IAED,sCAAW,GAAX,UAAY,KAAgB;QAC3B,IAAI,IAAI,GAAG,KAAK,CAAC,cAAc,EAAE,CAAC;QAClC,IAAI,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE;YACtC,IAAM,IAAI,GAAG,KAAiB,CAAC;YAC/B,IAAI,IAAI,CAAC,SAAS,KAAK,IAAI,CAAC,gBAAgB,EAAE;gBAC7C,IAAI,GAAG,gBAAgB,GAAG,IAAI,CAAC,SAAS,GAAG,GAAG,CAAC;aAC/C;iBAAM;gBACN,IAAI,GAAG,IAAI,CAAC,cAAc,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC,SAAS,GAAG,GAAG,CAAC;aAC3D;SACD;QACD,OAAO,IAAI,CAAC;IACb,CAAC;IA3Pc,kBAAC,GAAG,WAAW,CAAC;IA4PhC,uBAAC;CAAA,AA7PD,IA6PC"}
modules/actor-selector/actor-selector.ts CHANGED
@@ -1,5 +1,4 @@
1
  /// <reference path="../../js/jquery.d.ts" />
2
- /// <reference path="../../js/jquery-json.d.ts" />
3
  /// <reference path="../../js/actor-manager.ts" />
4
 
5
  declare var wsAmeLodash: _.LoDashStatic;
@@ -273,7 +272,7 @@ class AmeActorSelector {
273
  {
274
  'action': this.ajaxParams.ajaxUpdateAction,
275
  '_ajax_nonce': this.ajaxParams.ajaxUpdateNonce,
276
- 'visible_users': jQuery.toJSON(this.visibleUsers)
277
  }
278
  );
279
  }
@@ -296,7 +295,7 @@ class AmeActorSelector {
296
  }
297
 
298
  /**
299
- * Wrap the selected actor in a computed observable so that it can be used with Knockout.
300
  * @param ko
301
  */
302
  createKnockoutObservable(ko: KnockoutStatic): KnockoutComputed<string> {
@@ -314,4 +313,34 @@ class AmeActorSelector {
314
  });
315
  return publicObservable;
316
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
317
  }
1
  /// <reference path="../../js/jquery.d.ts" />
 
2
  /// <reference path="../../js/actor-manager.ts" />
3
 
4
  declare var wsAmeLodash: _.LoDashStatic;
272
  {
273
  'action': this.ajaxParams.ajaxUpdateAction,
274
  '_ajax_nonce': this.ajaxParams.ajaxUpdateNonce,
275
+ 'visible_users': JSON.stringify(this.visibleUsers)
276
  }
277
  );
278
  }
295
  }
296
 
297
  /**
298
+ * Wrap the selected actor ID in a computed observable so that it can be used with Knockout.
299
  * @param ko
300
  */
301
  createKnockoutObservable(ko: KnockoutStatic): KnockoutComputed<string> {
313
  });
314
  return publicObservable;
315
  }
316
+
317
+ createIdObservable(ko: KnockoutStatic): KnockoutComputed<string|null> {
318
+ return this.createKnockoutObservable(ko);
319
+ }
320
+
321
+ createActorObservable(ko: KnockoutStatic): KnockoutComputed<IAmeActor|null> {
322
+ const internalObservable = ko.observable(
323
+ (this.selectedActor === null) ? null : this.actorManager.getActor(this.selectedActor)
324
+ );
325
+ const publicObservable = ko.computed<IAmeActor|null>({
326
+ read: function () {
327
+ return internalObservable();
328
+ },
329
+ write: (newActor: IAmeActor|null) => {
330
+ this.setSelectedActor(
331
+ (newActor !== null) ? newActor.getId() : null
332
+ );
333
+ }
334
+ });
335
+
336
+ const self = this;
337
+ this.onChange(function (newSelectedActor: string) {
338
+ if (newSelectedActor === null) {
339
+ internalObservable(null);
340
+ } else {
341
+ internalObservable(self.actorManager.getActor(newSelectedActor));
342
+ }
343
+ });
344
+ return publicObservable;
345
+ }
346
  }
modules/plugin-visibility/plugin-visibility.css CHANGED
@@ -1,86 +1,107 @@
1
- /*
2
- Plugin visibility module
3
- ------------------------
4
- */
5
- .plugins thead .ame-check-column,
6
- .plugins tfoot .ame-check-column {
7
- padding: 4px 0 0 6px;
8
- vertical-align: middle;
9
- width: 2.2em; }
10
-
11
- .plugins .ame-check-column {
12
- vertical-align: top; }
13
-
14
- /*
15
- Plugin status indicator on the check column
16
- */
17
- .plugins .active th.ame-check-column,
18
- .plugin-update-tr.active td {
19
- border-left: 4px solid #2ea2cc; }
20
-
21
- .plugins thead th.ame-check-column,
22
- .plugins tfoot th.ame-check-column,
23
- .plugins .inactive th.ame-check-column {
24
- padding-left: 6px; }
25
-
26
- .plugins tbody th.ame-check-column,
27
- .plugins tbody {
28
- padding: 8px 0 0 2px; }
29
-
30
- .plugins tbody th.ame-check-column input[type=checkbox] {
31
- margin-top: 4px; }
32
-
33
- /*
34
- The "Save Changes" form
35
- */
36
- .ame-pv-save-form {
37
- float: right;
38
- margin-top: 5px;
39
- margin-bottom: 6px; }
40
-
41
- #ws_actor_selector_container {
42
- margin-right: 130px; }
43
-
44
- /*
45
- Inline editor
46
- */
47
- #ame-plugin-visibility-editor .inline-edit-row .ame-pv-inline-edit-left {
48
- width: 35%; }
49
- #ame-plugin-visibility-editor .inline-edit-row .ame-pv-inline-edit-right {
50
- width: 65%; }
51
- #ame-plugin-visibility-editor .inline-edit-row span.title {
52
- width: auto; }
53
- #ame-plugin-visibility-editor .inline-edit-row input[type="text"] {
54
- width: 100%; }
55
- #ame-plugin-visibility-editor .inline-edit-row .ame-pv-custom-description {
56
- height: 9em; }
57
- #ame-plugin-visibility-editor .inline-edit-row .ame-pv-inline-reset {
58
- line-height: 28px;
59
- margin-left: 1em; }
60
- #ame-plugin-visibility-editor .inline-edit-row td {
61
- box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.1); }
62
- #ame-plugin-visibility-editor .inline-edit-row p.submit {
63
- margin-bottom: 0.2em; }
64
- #ame-plugin-visibility-editor .inline-edit-row .inline-edit-legend {
65
- margin: 0;
66
- padding: 0.2em 0.5em 0;
67
- line-height: 2.5;
68
- font-weight: 600; }
69
-
70
- /*
71
- The "New Plugins" option is displayed in the table footer.
72
- It needs to override some default footer styles.
73
- */
74
- .plugins tfoot .ame-pv-new-plugin-visibility-row th.ame-check-column {
75
- padding-top: 8px;
76
- vertical-align: top; }
77
- .plugins tfoot .ame-pv-new-plugin-visibility-row th.ame-check-column input[type=checkbox] {
78
- margin-top: 4px; }
79
- .plugins tfoot .ame-pv-new-plugin-visibility-row ul {
80
- list-style: inside disc;
81
- margin-left: 1em;
82
- margin-top: 0.8em; }
83
- .plugins tfoot .ame-pv-new-plugin-visibility-row th, .plugins tfoot .ame-pv-new-plugin-visibility-row td {
84
- border-top: none; }
85
-
86
- /*# sourceMappingURL=plugin-visibility.css.map */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ Plugin visibility module
3
+ ------------------------
4
+ */
5
+ .plugins thead .ame-check-column,
6
+ .plugins tfoot .ame-check-column {
7
+ padding: 4px 0 0 6px;
8
+ vertical-align: middle;
9
+ width: 2.2em;
10
+ }
11
+
12
+ .plugins .ame-check-column {
13
+ vertical-align: top;
14
+ }
15
+
16
+ /*
17
+ Plugin status indicator on the check column
18
+ */
19
+ .plugins .active th.ame-check-column,
20
+ .plugin-update-tr.active td {
21
+ border-left: 4px solid #2ea2cc;
22
+ }
23
+
24
+ .plugins thead th.ame-check-column,
25
+ .plugins tfoot th.ame-check-column,
26
+ .plugins .inactive th.ame-check-column {
27
+ padding-left: 6px;
28
+ }
29
+
30
+ .plugins tbody th.ame-check-column,
31
+ .plugins tbody {
32
+ padding: 8px 0 0 2px;
33
+ }
34
+
35
+ .plugins tbody th.ame-check-column input[type=checkbox] {
36
+ margin-top: 4px;
37
+ }
38
+
39
+ /*
40
+ The "Save Changes" form
41
+ */
42
+ .ame-pv-save-form {
43
+ float: right;
44
+ margin-top: 5px;
45
+ margin-bottom: 6px;
46
+ }
47
+
48
+ #ws_actor_selector_container {
49
+ margin-right: 130px;
50
+ }
51
+
52
+ /*
53
+ Inline editor
54
+ */
55
+ #ame-plugin-visibility-editor .inline-edit-row .ame-pv-inline-edit-left {
56
+ width: 35%;
57
+ }
58
+ #ame-plugin-visibility-editor .inline-edit-row .ame-pv-inline-edit-right {
59
+ width: 65%;
60
+ }
61
+ #ame-plugin-visibility-editor .inline-edit-row span.title {
62
+ width: auto;
63
+ }
64
+ #ame-plugin-visibility-editor .inline-edit-row input[type=text] {
65
+ width: 100%;
66
+ }
67
+ #ame-plugin-visibility-editor .inline-edit-row .ame-pv-custom-description {
68
+ height: 9em;
69
+ }
70
+ #ame-plugin-visibility-editor .inline-edit-row .ame-pv-inline-reset {
71
+ line-height: 28px;
72
+ margin-left: 1em;
73
+ }
74
+ #ame-plugin-visibility-editor .inline-edit-row td {
75
+ box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.1);
76
+ }
77
+ #ame-plugin-visibility-editor .inline-edit-row p.submit {
78
+ margin-bottom: 0.2em;
79
+ }
80
+ #ame-plugin-visibility-editor .inline-edit-row .inline-edit-legend {
81
+ margin: 0;
82
+ padding: 0.2em 0.5em 0;
83
+ line-height: 2.5;
84
+ font-weight: 600;
85
+ }
86
+
87
+ /*
88
+ The "New Plugins" option is displayed in the table footer.
89
+ It needs to override some default footer styles.
90
+ */
91
+ .plugins tfoot .ame-pv-new-plugin-visibility-row th.ame-check-column {
92
+ padding-top: 8px;
93
+ vertical-align: top;
94
+ }
95
+ .plugins tfoot .ame-pv-new-plugin-visibility-row th.ame-check-column input[type=checkbox] {
96
+ margin-top: 4px;
97
+ }
98
+ .plugins tfoot .ame-pv-new-plugin-visibility-row ul {
99
+ list-style: inside disc;
100
+ margin-left: 1em;
101
+ margin-top: 0.8em;
102
+ }
103
+ .plugins tfoot .ame-pv-new-plugin-visibility-row th, .plugins tfoot .ame-pv-new-plugin-visibility-row td {
104
+ border-top: none;
105
+ }
106
+
107
+ /*# sourceMappingURL=plugin-visibility.css.map */
modules/plugin-visibility/plugin-visibility.css.map ADDED
@@ -0,0 +1 @@
 
1
+ {"version":3,"sourceRoot":"","sources":["plugin-visibility.scss"],"names":[],"mappings":"AAAA;AAAA;AAAA;AAAA;AAKA;AAAA;EAEC;EACA;EACA;;;AAGD;EACC;;;AAGD;AAAA;AAAA;AAGA;AAAA;EAEC;;;AAGD;AAAA;AAAA;EAGC;;;AAGD;AAAA;EAEC;;;AAGD;EACC;;;AAGD;AAAA;AAAA;AAIA;EACC;EACA;EACA;;;AAID;EACC;;;AAGD;AAAA;AAAA;AAKC;EACC;;AAGD;EACC;;AAGD;EACC;;AAGD;EACC;;AAGD;EACC;;AAGD;EACC;EACA;;AAGD;EACC;;AAGD;EACC;;AAGD;EACC;EACA;EACA;EACA;;;AAIF;AAAA;AAAA;AAAA;AAKC;EACC;EACA;;AAEA;EACC;;AAIF;EACC;EACA;EACA;;AAGD;EACC","file":"plugin-visibility.css"}
modules/plugin-visibility/plugin-visibility.js CHANGED
@@ -210,7 +210,7 @@ var AmePluginVisibilityModule = /** @class */ (function () {
210
  return !_.isEmpty(value);
211
  });
212
  //Populate form field(s).
213
- this.settingsData(jQuery.toJSON(settings));
214
  return true;
215
  };
216
  AmePluginVisibilityModule._ = wsAmeLodash;
210
  return !_.isEmpty(value);
211
  });
212
  //Populate form field(s).
213
+ this.settingsData(JSON.stringify(settings));
214
  return true;
215
  };
216
  AmePluginVisibilityModule._ = wsAmeLodash;
modules/plugin-visibility/plugin-visibility.js.map ADDED
@@ -0,0 +1 @@
 
1
+ {"version":3,"file":"plugin-visibility.js","sourceRoot":"","sources":["plugin-visibility.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,6CAA6C;AAC7C,+CAA+C;AAC/C,kDAAkD;AAClD,uEAAuE;AACvE,oEAAoE;AAwCpE;IAoBC,mCAAY,UAAsC;QAAlD,iBAgEC;QA/DA,IAAM,CAAC,GAAG,yBAAyB,CAAC,CAAC,CAAC;QAEtC,IAAI,CAAC,aAAa,GAAG,IAAI,gBAAgB,CAAC,SAAS,EAAE,UAAU,CAAC,YAAY,CAAC,CAAC;QAE9E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MAAM,CAAC,UAAU,CAAC;IACjB,mBAAmB,GAAG,IAAI,yBAAyB,CAAC,sBAAsB,CAAC,CAAC;IAC5E,EAAE,CAAC,aAAa,CAAC,mBAAmB,EAAE,QAAQ,CAAC,cAAc,CAAC,8BAA8B,CAAC,CAAC,CAAC;IAE/F,8CAA8C;IAC9C,CAAC,CAAC,sBAAsB,CAAC,CAAC,EAAE,CAAC,OAAO,EAAE,iBAAiB,EAAE;QACxD,MAAM,CAAC,SAAS,CAAC,gCAAgC,CAAC,CAAC,OAAO,EAAE,CAAC;IAC9D,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC"}
modules/plugin-visibility/plugin-visibility.php CHANGED
@@ -98,7 +98,7 @@ class amePluginVisibility extends amePersistentModule {
98
 
99
  //Super Admin is next.
100
  if ($isMultisite && is_super_admin($user->ID)) {
101
- //By default the Super Admin has access to everything.
102
  return ameUtils::get($grantAccess, 'special:super_admin', true);
103
  }
104
 
@@ -333,7 +333,7 @@ class amePluginVisibility extends amePersistentModule {
333
  'ame-plugin-visibility',
334
  plugins_url('plugin-visibility.js', __FILE__),
335
  array(
336
- 'ame-lodash', 'knockout', 'ame-actor-selector', 'jquery-json',
337
  $this->dismissNoticeAction->getScriptHandle(),
338
  )
339
  );
98
 
99
  //Super Admin is next.
100
  if ($isMultisite && is_super_admin($user->ID)) {
101
+ //By default, the Super Admin has access to everything.
102
  return ameUtils::get($grantAccess, 'special:super_admin', true);
103
  }
104
 
333
  'ame-plugin-visibility',
334
  plugins_url('plugin-visibility.js', __FILE__),
335
  array(
336
+ 'ame-lodash', 'knockout', 'ame-actor-selector',
337
  $this->dismissNoticeAction->getScriptHandle(),
338
  )
339
  );
modules/plugin-visibility/plugin-visibility.ts CHANGED
@@ -302,7 +302,7 @@ class AmePluginVisibilityModule {
302
  });
303
 
304
  //Populate form field(s).
305
- this.settingsData(jQuery.toJSON(settings));
306
 
307
  return true;
308
  }
302
  });
303
 
304
  //Populate form field(s).
305
+ this.settingsData(JSON.stringify(settings));
306
 
307
  return true;
308
  }
modules/redirector/redirector.css CHANGED
@@ -1,4 +1,3 @@
1
- @charset "UTF-8";
2
  .ame-rui-redirect-list {
3
  display: flex;
4
  flex-direction: column;
@@ -63,7 +62,7 @@
63
  color: #1d2327;
64
  }
65
  .ame-rui-url-dropdown-trigger .am-rui-trigger-icon:before {
66
- content: "";
67
  font: normal 20px dashicons;
68
  line-height: 28px;
69
  vertical-align: middle;
@@ -341,7 +340,7 @@
341
  padding: 0;
342
  }
343
  #ame-rui-main-actions .ws-ame-postbox-toggle:before {
344
- content: "";
345
  display: inline-block;
346
  vertical-align: middle;
347
  }
@@ -360,7 +359,7 @@
360
  display: none;
361
  }
362
  #ame-rui-main-actions.ws-ame-closed-postbox .ws-ame-postbox-toggle:before {
363
- content: "";
364
  }
365
  #ame-rui-main-actions input.button {
366
  max-width: 150px;
 
1
  .ame-rui-redirect-list {
2
  display: flex;
3
  flex-direction: column;
62
  color: #1d2327;
63
  }
64
  .ame-rui-url-dropdown-trigger .am-rui-trigger-icon:before {
65
+ content: "\f140";
66
  font: normal 20px dashicons;
67
  line-height: 28px;
68
  vertical-align: middle;
340
  padding: 0;
341
  }
342
  #ame-rui-main-actions .ws-ame-postbox-toggle:before {
343
+ content: "\f142";
344
  display: inline-block;
345
  vertical-align: middle;
346
  }
359
  display: none;
360
  }
361
  #ame-rui-main-actions.ws-ame-closed-postbox .ws-ame-postbox-toggle:before {
362
+ content: "\f140";
363
  }
364
  #ame-rui-main-actions input.button {
365
  max-width: 150px;
modules/redirector/redirector.php CHANGED
@@ -39,6 +39,11 @@ class Module extends amePersistentModule {
39
 
40
  protected $searchUsersAction;
41
 
 
 
 
 
 
42
  public function __construct($menuEditor) {
43
  parent::__construct($menuEditor);
44
 
@@ -55,6 +60,10 @@ class Module extends amePersistentModule {
55
  add_filter('logout_redirect', [$this, 'filterLogoutRedirect'], self::FILTER_PRIORITY, 3);
56
  //Registration redirect. This happens after the user is created but before the user logs in.
57
  add_filter('registration_redirect', [$this, 'filterRegistrationRedirect'], self::FILTER_PRIORITY, 1);
 
 
 
 
58
  }
59
 
60
  if ( is_admin() ) {
@@ -156,7 +165,7 @@ class Module extends amePersistentModule {
156
  * @return string
157
  * @noinspection PhpUnusedParameterInspection The parameters are defined by the hook and can't be changed.
158
  */
159
- public function filterLoginRedirect($redirectTo, $requestedRedirectTo, $user = null) {
160
  if ( $this->checkFirstLogin($user) ) {
161
  $trigger = Triggers::FIRST_LOGIN;
162
  } else {
@@ -184,6 +193,7 @@ class Module extends amePersistentModule {
184
  */
185
  protected function filterRedirect($trigger, $redirectTo, $requestedRedirectTo, $user = null) {
186
  if ( !($user instanceof WP_User) ) {
 
187
  return $redirectTo;
188
  }
189
 
@@ -191,7 +201,12 @@ class Module extends amePersistentModule {
191
  if ( $found->nonEmpty() ) {
192
  /** @var Redirect $customRedirect */
193
  $customRedirect = $found->get();
 
 
 
 
194
  $url = $customRedirect->getUrl();
 
195
 
196
  //WordPress uses wp_safe_redirect() for login, logout, and registration redirects, which
197
  //only allows local redirects by default. Let's temporarily add the domain name of the URL
@@ -279,6 +294,17 @@ class Module extends amePersistentModule {
279
  }
280
  }
281
 
 
 
 
 
 
 
 
 
 
 
 
282
  public function registerScripts() {
283
  parent::registerScripts();
284
 
39
 
40
  protected $searchUsersAction;
41
 
42
+ /**
43
+ * @var WP_User|null
44
+ */
45
+ protected $currentRedirectedUser = null;
46
+
47
  public function __construct($menuEditor) {
48
  parent::__construct($menuEditor);
49
 
60
  add_filter('logout_redirect', [$this, 'filterLogoutRedirect'], self::FILTER_PRIORITY, 3);
61
  //Registration redirect. This happens after the user is created but before the user logs in.
62
  add_filter('registration_redirect', [$this, 'filterRegistrationRedirect'], self::FILTER_PRIORITY, 1);
63
+
64
+ //Let other components, like the "[ame-user-info]" shortcode, know which user is being redirected.
65
+ //This is necessary because WP doesn't set the global user object when performing some redirects.
66
+ add_filter('admin_menu_editor-redirected_user', [$this, 'provideRedirectedUser']);
67
  }
68
 
69
  if ( is_admin() ) {
165
  * @return string
166
  * @noinspection PhpUnusedParameterInspection The parameters are defined by the hook and can't be changed.
167
  */
168
+ public function filterLoginRedirect($redirectTo, $requestedRedirectTo = '', $user = null) {
169
  if ( $this->checkFirstLogin($user) ) {
170
  $trigger = Triggers::FIRST_LOGIN;
171
  } else {
193
  */
194
  protected function filterRedirect($trigger, $redirectTo, $requestedRedirectTo, $user = null) {
195
  if ( !($user instanceof WP_User) ) {
196
+ $this->currentRedirectedUser = null;
197
  return $redirectTo;
198
  }
199
 
201
  if ( $found->nonEmpty() ) {
202
  /** @var Redirect $customRedirect */
203
  $customRedirect = $found->get();
204
+
205
+ //Set the user for shortcodes in the redirect URL. wp_get_current_user() doesn't always work,
206
+ //like when the user is still in the process of logging in.
207
+ $this->currentRedirectedUser = $user;
208
  $url = $customRedirect->getUrl();
209
+ $this->currentRedirectedUser = null;
210
 
211
  //WordPress uses wp_safe_redirect() for login, logout, and registration redirects, which
212
  //only allows local redirects by default. Let's temporarily add the domain name of the URL
294
  }
295
  }
296
 
297
+ /**
298
+ * @param $user
299
+ * @return WP_User|null
300
+ */
301
+ public function provideRedirectedUser($user = null) {
302
+ if ( $this->currentRedirectedUser !== null ) {
303
+ return $this->currentRedirectedUser;
304
+ }
305
+ return $user;
306
+ }
307
+
308
  public function registerScripts() {
309
  parent::registerScripts();
310
 
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: whiteshadow
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A6P9S6CE3SRSW
4
  Tags: admin, dashboard, menu, security, wpmu
5
  Requires at least: 4.1
6
- Tested up to: 5.8.1
7
- Stable tag: 1.10
8
 
9
  Lets you edit the WordPress admin menu. You can re-order, hide or rename menus, add custom menus and more.
10
 
@@ -75,6 +75,17 @@ Plugins installed in the `mu-plugins` directory are treated as "always on", so y
75
 
76
  == Changelog ==
77
 
 
 
 
 
 
 
 
 
 
 
 
78
  = 1.10 =
79
  * Added a "Redirects" feature. You can create login redirects, logout redirects, and registration redirects. You can configure redirects for specific roles and users. You can also set up a default redirect that will apply to everyone who doesn't have a specific setting. Redirect URLs can contain shortcodes, but not all shortcodes will work in this context.
80
  * Added a few utility shortcodes: `[ame-wp-admin]`, `[ame-home-url]`, `[ame-user-info field="..."]`. These are mainly intended to be used to create dynamic redirects, but they will also work in posts and pages.
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A6P9S6CE3SRSW
4
  Tags: admin, dashboard, menu, security, wpmu
5
  Requires at least: 4.1
6
+ Tested up to: 5.9.3
7
+ Stable tag: 1.10.1
8
 
9
  Lets you edit the WordPress admin menu. You can re-order, hide or rename menus, add custom menus and more.
10
 
75
 
76
  == Changelog ==
77
 
78
+ = 1.10.1 =
79
+ * Fixed the `[ame-user-info]` shortcode not working in login redirects. It would always output "(No user)" instead of the actual user data.
80
+ * Fixed a warning caused by a conflict with plugins and themes that call the "login_redirect" filter with only 1 parameter instead of the expected 3.
81
+ * Probably fixed a bug where menu items that use fully qualified URLs would lose their custom settings when the site URL changed (such as when migrating the site to a different domain).
82
+ * Fixed a minor conflict with the plugin "Google Analytics for WordPress by MonsterInsights" where the "Getting Started" menu item that is usually hidden would become visible when AME was activated.
83
+ * Fixed an edge case where the plugin would incorrectly show an "is this option enabled for everyone" checkbox in an indeterminate state when it was actually enabled for all roles but was not explicitly enabled (or disabled) for individual users.
84
+ * Fixed a bug where AME did not prefer submenu items when detecting the current menu item based on the current URL.
85
+ * Switched from `jQuery.toJSON()` to `JSON.stringify()`. The old jQuery JSON plugin appears to be unmaintained, and all modern browsers have supported `JSON.stringify()` for a long time.
86
+ * Other minor fixes.
87
+ * Tested up to WP 6.0-beta1.
88
+
89
  = 1.10 =
90
  * Added a "Redirects" feature. You can create login redirects, logout redirects, and registration redirects. You can configure redirects for specific roles and users. You can also set up a default redirect that will apply to everyone who doesn't have a specific setting. Redirect URLs can contain shortcodes, but not all shortcodes will work in this context.
91
  * Added a few utility shortcodes: `[ame-wp-admin]`, `[ame-home-url]`, `[ame-user-info field="..."]`. These are mainly intended to be used to create dynamic redirects, but they will also work in posts and pages.