Brak opisu

layout.html 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  1. <% if sub_menu %>
  2. <script type="text/javascript">
  3. jQuery('#adminmenu #toplevel_page_mailpoet-newsletters')
  4. .addClass('wp-has-current-submenu')
  5. .removeClass('wp-not-current-submenu')
  6. .find('a[href$="<%= sub_menu %>"]')
  7. .addClass('current')
  8. .parent()
  9. .addClass('current');
  10. </script>
  11. <% endif %>
  12. <!-- pre connect to 3d party to speed up page loading -->
  13. <link rel="preconnect" href="https://beacon-v2.helpscout.net/">
  14. <link rel="dns-prefetch" href="https://beacon-v2.helpscout.net/">
  15. <link rel="preconnect" href="http://cdn.mxpnl.com">
  16. <link rel="dns-prefetch" href="http://cdn.mxpnl.com">
  17. <!-- system notices -->
  18. <div id="mailpoet_notice_system" class="mailpoet_notice" style="display:none;"></div>
  19. <!-- handlebars templates -->
  20. <% block templates %><% endblock %>
  21. <!-- main container -->
  22. <% block container %>
  23. <div class="wrap">
  24. <!-- notices -->
  25. <div id="mailpoet_notice_error" class="mailpoet_notice" style="display:none;"></div>
  26. <div id="mailpoet_notice_success" class="mailpoet_notice" style="display:none;"></div>
  27. <!-- React notices -->
  28. <div id="mailpoet_notices"></div>
  29. <!-- Set FROM address modal React root -->
  30. <div id="mailpoet_set_from_address_modal"></div>
  31. <!-- title block -->
  32. <% block title %><% endblock %>
  33. <!-- content block -->
  34. <% block content %><% endblock %>
  35. </div>
  36. <% endblock %>
  37. <!-- stylesheets -->
  38. <%= stylesheet(
  39. 'mailpoet-plugin.css'
  40. )%>
  41. <%= do_action('mailpoet_styles_admin_after') %>
  42. <% block after_css %><% endblock %>
  43. <script type="text/javascript">
  44. var mailpoet_datetime_format = "<%= wp_datetime_format()|escape('js') %>";
  45. var mailpoet_date_format = "<%= wp_date_format()|escape('js') %>";
  46. var mailpoet_time_format = "<%= wp_time_format()|escape('js') %>";
  47. var mailpoet_version = "<%= mailpoet_version() %>";
  48. var mailpoet_locale = "<%= mailpoet_locale() %>";
  49. var mailpoet_wp_week_starts_on = "<%= wp_start_of_week() %>";
  50. var mailpoet_premium_version = <%= json_encode(mailpoet_premium_version()) %>;
  51. var mailpoet_3rd_party_libs_enabled = <%= is_loading_3rd_party_enabled() | json_encode %>;
  52. var mailpoet_analytics_enabled = <%= is_analytics_enabled() | json_encode %>;
  53. var mailpoet_analytics_data = <%= json_encode(get_analytics_data()) %>;
  54. var mailpoet_analytics_public_id = <%= json_encode(get_analytics_public_id()) %>;
  55. var mailpoet_analytics_new_public_id = <%= is_analytics_public_id_new() | json_encode %>;
  56. var mailpoet_free_domains = <%= json_encode(mailpoet_free_domains()) %>;
  57. var mailpoet_woocommerce_active = <%= json_encode(is_woocommerce_active()) %>;
  58. // RFC 5322 standard; http://emailregex.com/ combined with https://google.github.io/closure-library/api/goog.format.EmailAddress.html#isValid
  59. var mailpoet_email_regex = /(?=^[+a-zA-Z0-9_.!#$%&'*\/=?^`{|}~-]+@([a-zA-Z0-9-]+\.)+[a-zA-Z0-9]{2,63}$)(?=^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,})))/;
  60. var mailpoet_feature_flags = <%= json_encode(feature_flags) %>;
  61. var mailpoet_referral_id = <%= json_encode(referral_id) %>;
  62. var mailpoet_feature_announcement_has_news = <%= json_encode(feature_announcement_has_news) %>;
  63. var mailpoet_wp_segment_state = <%= json_encode(wp_segment_state) %>;
  64. </script>
  65. <!-- javascripts -->
  66. <%= javascript(
  67. 'runtime.js',
  68. 'vendor.js',
  69. 'commons.js',
  70. 'mailpoet.js'
  71. )%>
  72. <%= localize({
  73. 'ajaxFailedErrorMessage': __('An error has happened while performing a request, the server has responded with response code %d'),
  74. 'ajaxTimeoutErrorMessage': __('An error has happened while performing a request, the server request has timed out after %d seconds'),
  75. 'senderEmailAddressWarning1': _x('You might not reach the inbox of your subscribers if you use this email address.', 'In the last step, before sending a newsletter. URL: ?page=mailpoet-newsletters#/send/2'),
  76. 'senderEmailAddressWarning2': _x('Use an address like %1$s for the Sender and put %2$s in the <em>Reply-to</em> field below.', 'In the last step, before sending a newsletter. URL: ?page=mailpoet-newsletters#/send/2'),
  77. 'senderEmailAddressWarning3': _x('Read more.'),
  78. 'mailerSendingResumedNotice': __('Sending has been resumed.'),
  79. 'dismissNotice': __('Dismiss this notice.'),
  80. 'subscribersLimitNoticeTitle': __('Congratulations, you now have more than [subscribersLimit] subscribers!'),
  81. 'freeVersionLimit': __('Our free version is limited to [subscribersLimit] subscribers.'),
  82. 'yourPlanLimit': __('Your plan is limited to [subscribersLimit] subscribers.'),
  83. 'youNeedToUpgrade': __('You need to upgrade now to be able to continue using MailPoet.'),
  84. 'youCanDisableWPUsersList': __('If you do not send emails to your WordPress Users list, you can [link]disable it[/link] to lower your number of subscribers.'),
  85. 'upgradeNow': __('Upgrade Now'),
  86. 'refreshMySubscribers': __('I’ve upgraded my subscription, refresh subscriber limit'),
  87. 'setFromAddressModalTitle': __('It’s time to set your default FROM address!', 'mailpoet'),
  88. 'setFromAddressModalDescription': __('Set one of [link]your authorized email addresses[/link] as the default FROM email for your MailPoet emails.', 'mailpoet'),
  89. 'setFromAddressModalSave': __('Save', 'mailpoet'),
  90. 'setFromAddressEmailSuccess': __('Excellent. Your authorized email was saved. You can change it in the [link]Basics tab of the MailPoet settings[/link].', 'mailpoet'),
  91. 'setFromAddressEmailNotAuthorized': __('Can’t use this email yet! [link]Please authorize it first[/link].', 'mailpoet'),
  92. 'setFromAddressEmailUnknownError': __('An error occured when saving FROM email address.', 'mailpoet'),
  93. 'reviewRequestHeading': _x('Thank you! Time to tell the world?', 'After a user gives us positive feedback via the NPS poll, we ask them to review our plugin on WordPress.org.'),
  94. 'reviewRequestDidYouKnow': __('[username], did you know that hundreds of WordPress users read the reviews on the plugin repository? They’re also a source of inspiration for our team.'),
  95. 'reviewRequestUsingForDays': _n('You’ve been using MailPoet for [days] day now, and we would love to read your own review.', 'You’ve been using MailPoet for [days] days now, and we would love to read your own review.', installed_days_ago),
  96. 'reviewRequestUsingForMonths': _n('You’ve been using MailPoet for [months] month now, and we would love to read your own review.', 'You’ve been using MailPoet for [months] months now, and we would love to read your own review.', (installed_days_ago / 30) | round),
  97. 'reviewRequestRateUsNow': _x('Rate us now', 'Review our plugin on WordPress.org.'),
  98. 'reviewRequestNotNow': __('Not now'),
  99. 'sent': __('Sent'),
  100. 'notSentYet': __('Not sent yet!'),
  101. 'allSendingPausedHeader': __('All sending is currently paused!'),
  102. 'allSendingPausedBody': __('Your [link]API key[/link] to send with MailPoet is invalid.'),
  103. 'allSendingPausedLink': __('Purchase a key'),
  104. 'close': __('Close'),
  105. 'today': __('Today'),
  106. 'january': __('January'),
  107. 'february': __('February'),
  108. 'march': __('March'),
  109. 'april': __('April'),
  110. 'may': __('May'),
  111. 'june': __('June'),
  112. 'july': __('July'),
  113. 'august': __('August'),
  114. 'september': __('September'),
  115. 'october': __('October'),
  116. 'november': __('November'),
  117. 'december': __('December'),
  118. 'januaryShort': __('Jan'),
  119. 'februaryShort': __('Feb'),
  120. 'marchShort': __('Mar'),
  121. 'aprilShort': __('Apr'),
  122. 'mayShort': __('May'),
  123. 'juneShort': __('Jun'),
  124. 'julyShort': __('Jul'),
  125. 'augustShort': __('Aug'),
  126. 'septemberShort': __('Sep'),
  127. 'octoberShort': __('Oct'),
  128. 'novemberShort': __('Nov'),
  129. 'decemberShort': __('Dec'),
  130. 'sundayShort': __('Sun'),
  131. 'mondayShort': __('Mon'),
  132. 'tuesdayShort': __('Tue'),
  133. 'wednesdayShort': __('Wed'),
  134. 'thursdayShort': __('Thu'),
  135. 'fridayShort': __('Fri'),
  136. 'saturdayShort': __('Sat'),
  137. 'sundayMin': _x('S', 'Sunday - one letter abbreviation'),
  138. 'mondayMin': _x('M', 'Monday - one letter abbreviation'),
  139. 'tuesdayMin': _x('T', 'Tuesday - one letter abbreviation'),
  140. 'wednesdayMin': _x('W', 'Wednesday - one letter abbreviation'),
  141. 'thursdayMin': _x('T', 'Thursday - one letter abbreviation'),
  142. 'fridayMin': _x('F', 'Friday - one letter abbreviation'),
  143. 'saturdayMin': _x('S', 'Saturday - one letter abbreviation'),
  144. }) %>
  145. <% block translations %><% endblock %>
  146. <% block after_translations %><% endblock %>
  147. <%= javascript(
  148. 'admin_vendor.js'
  149. )%>
  150. <%= do_action('mailpoet_scripts_admin_before') %>
  151. <%= javascript(
  152. 'admin.js'
  153. )%>
  154. <%if is_loading_3rd_party_enabled() %>
  155. <%= javascript('lib/analytics.js') %>
  156. <% set helpscout_form_id = '1c666cab-c0f6-4614-bc06-e5d0ad78db2b' %>
  157. <%if mailpoet_api_key_state.data.support_tier == 'premium' or premium_key_state.data.support_tier == 'premium' %>
  158. <% set helpscout_form_id = 'e93d0423-1fa6-4bbc-9df9-c174f823c35f' %>
  159. <% endif %>
  160. <script type="text/javascript">!function(e,t,n){function a(){var e=t.getElementsByTagName("script")[0],n=t.createElement("script");n.type="text/javascript",n.async=!0,n.src="https://beacon-v2.helpscout.net",e.parentNode.insertBefore(n,e)}if(e.Beacon=n=function(t,n,a){e.Beacon.readyQueue.push({method:t,options:n,data:a})},n.readyQueue=[],"complete"===t.readyState)return a();e.attachEvent?e.attachEvent("onload",a):e.addEventListener("load",a,!1)}(window,document,window.Beacon||function(){});</script>
  161. <script type="text/javascript"></script>
  162. <script type="text/javascript">
  163. if(window['Beacon'] !== undefined && window.hide_mailpoet_beacon !== true) {
  164. window.Beacon('init', '<%= helpscout_form_id %>');
  165. // HelpScout Beacon: Configuration
  166. window.Beacon("config", {
  167. icon: 'message',
  168. zIndex: 50000,
  169. instructions: "<%= __('Want to give feedback to the MailPoet team? Contact us here. Please provide as much information as possible!') %>",
  170. showContactFields: true
  171. });
  172. // HelpScout Beacon: Custom information
  173. window.Beacon("identify",
  174. <%= json_encode(get_helpscout_data()) %>
  175. );
  176. if (window.mailpoet_beacon_articles) {
  177. window.Beacon('suggest', window.mailpoet_beacon_articles)
  178. }
  179. }
  180. </script>
  181. <% endif %>
  182. <script>
  183. Parsley.addMessages('mailpoet', {
  184. defaultMessage: '<%= __("This value seems to be invalid.") %>',
  185. type: {
  186. email: '<%= __("This value should be a valid email.") %>',
  187. url: '<%= __("This value should be a valid url.") %>',
  188. number: '<%= __("This value should be a valid number.") %>',
  189. integer: '<%= __("This value should be a valid integer.") %>',
  190. digits: '<%= __("This value should be digits.") %>',
  191. alphanum: '<%= __("This value should be alphanumeric.") %>'
  192. },
  193. notblank: '<%= __("This value should not be blank.") %>',
  194. required: '<%= __("This value is required.") %>',
  195. pattern: '<%= __("This value seems to be invalid.") %>',
  196. min: '<%= __("This value should be greater than or equal to %s.") %>',
  197. max: '<%= __("This value should be lower than or equal to %s.") %>',
  198. range: '<%= __("This value should be between %s and %s.") %>',
  199. minlength: '<%= __("This value is too short. It should have %s characters or more.") %>',
  200. maxlength: '<%= __("This value is too long. It should have %s characters or fewer.") %>',
  201. length: '<%= __("This value length is invalid. It should be between %s and %s characters long.") %>',
  202. mincheck: '<%= __("You must select at least %s choices.") %>',
  203. maxcheck: '<%= __("You must select %s choices or fewer.") %>',
  204. check: '<%= __("You must select between %s and %s choices.") %>',
  205. equalto: '<%= __("This value should be the same.") %>'
  206. });
  207. Parsley.setLocale('mailpoet');
  208. </script>
  209. <% block after_javascript %><% endblock %>
  210. <div id="mailpoet-modal"></div>