LearnPress – WordPress LMS Plugin - Version 2.0

Version Description

  • Updated database structure for new functions
  • Added view quiz inside a course with sub-permalink
  • Added allow add course's section without a name
  • Added email system to send it to user after buying a course
  • Added popup lightbox to view course's item content in full-screen mode
  • Added option to show/hide list of questions in quiz
  • Added 'Sale Price' for course
  • Added option to combine all scripts/styles enqueued into one file
  • Added option to evaluate course's results by average results of quizzes
  • Added "Passing Grade" to quiz allow evaluate result of quiz is passed/failed
  • Added option to show name of user in profile
  • Added duplicate a question inside quiz
  • Added preview mode of course for instructor or admin
  • Added memorize question type is the most used
  • Added new tab to edit user information in profile page
  • Improved admin course editor
  • Removed "Cart" outside LearnPress core and separated to addon
  • Fixed show answer's explanation right away after user checking question's answer
  • Fixed page does not load after logging in profile
  • Fixed quiz finish automatically right away after starting with duration is zero
  • Fixed displays shortcodes inside content of quiz/lesson
Download this release

Release Info

Developer tunnhn
Plugin Icon 128x128 LearnPress – WordPress LMS Plugin
Version 2.0
Comparing to
See all releases

Code changes from version 1.0.8 to 2.0

Files changed (207) hide show
  1. README.md +0 -136
  2. assets/css/_icons.css +75 -42
  3. assets/css/_icons.less +37 -0
  4. assets/css/_learnpress.css +0 -1047
  5. assets/css/admin/admin.css +1341 -1468
  6. assets/css/admin/admin.less +1627 -0
  7. assets/css/admin/course-editor.css +251 -0
  8. assets/css/admin/course-editor.less +265 -0
  9. assets/css/admin/index.php +1 -0
  10. {inc/libraries/meta-box/css/jqueryui → assets/css/admin}/jquery.ui.core.css +0 -0
  11. {inc/libraries/meta-box/css/jqueryui → assets/css/admin}/jquery.ui.datepicker.css +0 -0
  12. {inc/libraries/meta-box/css/jqueryui → assets/css/admin}/jquery.ui.slider.css +0 -0
  13. {inc/libraries/meta-box/css/jqueryui → assets/css/admin}/jquery.ui.theme.css +64 -63
  14. assets/css/admin/meta-box-course.css +13 -7
  15. assets/css/admin/meta-box-question.css +0 -13
  16. assets/css/{global-style.css → global.css} +33 -1
  17. assets/css/icons.css +0 -36
  18. assets/css/index.php +1 -0
  19. assets/css/jalert.css +40 -0
  20. assets/css/learnpress-0.9.x.css +0 -476
  21. assets/css/learnpress.bak.css +0 -899
  22. assets/css/learnpress.bak.less +0 -1153
  23. assets/css/learnpress.css +2231 -1316
  24. assets/css/learnpress.less +1355 -69
  25. assets/css/{owlcarousel/owl.carousel.css → owl.carousel.css} +0 -0
  26. assets/css/select2/index.php +1 -0
  27. assets/css/timer.css +0 -0
  28. assets/css/tipsy.css +0 -25
  29. assets/css/toastr.css +0 -197
  30. assets/eduma/custom-script.js +0 -309
  31. assets/eduma/custom-style.css +0 -7
  32. assets/fonts/icomoon.eot +0 -0
  33. assets/fonts/icomoon.ttf +0 -0
  34. assets/fonts/icomoon.woff +0 -0
  35. assets/fonts/icomoon.zip +0 -0
  36. assets/fonts/icomoon/Read Me.txt +0 -7
  37. assets/fonts/icomoon/demo-files/demo.css +0 -152
  38. assets/fonts/icomoon/demo-files/demo.js +0 -30
  39. assets/fonts/icomoon/demo-files/demo.min.js +0 -1
  40. assets/fonts/icomoon/demo.html +0 -183
  41. assets/fonts/icomoon/fonts/icomoon.eot +0 -0
  42. assets/fonts/icomoon/fonts/icomoon.svg +0 -19
  43. assets/fonts/icomoon/fonts/icomoon.ttf +0 -0
  44. assets/fonts/icomoon/fonts/icomoon.woff +0 -0
  45. assets/fonts/icomoon/selection.json +0 -312
  46. assets/fonts/icomoon/style.css +0 -54
  47. assets/fonts/icon.eot +0 -0
  48. assets/fonts/icon.svg +0 -14
  49. assets/fonts/icon.ttf +0 -0
  50. assets/fonts/icon.woff +0 -0
  51. assets/fonts/icons.eot +0 -0
  52. assets/fonts/icons.svg +0 -17
  53. assets/fonts/icons.ttf +0 -0
  54. assets/fonts/icons.woff +0 -0
  55. assets/fonts/index.php +1 -0
  56. assets/fonts/lp-icons.eot +0 -0
  57. assets/fonts/{icomoon.svg → lp-icons.svg} +4 -1
  58. assets/fonts/lp-icons.ttf +0 -0
  59. assets/fonts/lp-icons.woff +0 -0
  60. assets/images/index.php +1 -0
  61. assets/images/jqueryui/index.php +1 -0
  62. {inc/libraries/meta-box/img → assets/images}/jqueryui/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  63. {inc/libraries/meta-box/img → assets/images}/jqueryui/ui-bg_flat_75_ffffff_40x100.png +0 -0
  64. {inc/libraries/meta-box/img → assets/images}/jqueryui/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  65. {inc/libraries/meta-box/img → assets/images}/jqueryui/ui-bg_glass_65_ffffff_1x400.png +0 -0
  66. {inc/libraries/meta-box/img → assets/images}/jqueryui/ui-bg_glass_75_dadada_1x400.png +0 -0
  67. {inc/libraries/meta-box/img → assets/images}/jqueryui/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  68. {inc/libraries/meta-box/img → assets/images}/jqueryui/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  69. {inc/libraries/meta-box/img → assets/images}/jqueryui/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  70. {inc/libraries/meta-box/img → assets/images}/jqueryui/ui-icons_222222_256x240.png +0 -0
  71. {inc/libraries/meta-box/img → assets/images}/jqueryui/ui-icons_2e83ff_256x240.png +0 -0
  72. {inc/libraries/meta-box/img → assets/images}/jqueryui/ui-icons_454545_256x240.png +0 -0
  73. {inc/libraries/meta-box/img → assets/images}/jqueryui/ui-icons_888888_256x240.png +0 -0
  74. {inc/libraries/meta-box/img → assets/images}/jqueryui/ui-icons_cd0a0a_256x240.png +0 -0
  75. assets/index.php +1 -0
  76. assets/js/admin/admin.js +73 -13
  77. assets/js/admin/course-editor.js +378 -0
  78. assets/js/admin/duplicate-course.js +89 -0
  79. assets/js/admin/index.php +1 -0
  80. assets/js/admin/meta-box-course.js +140 -72
  81. assets/js/admin/meta-box-order.js +19 -19
  82. assets/js/admin/meta-box-question.js +65 -38
  83. assets/js/admin/meta-box-quiz.js +98 -77
  84. assets/js/admin/modal-search-items.js +28 -19
  85. assets/js/admin/question.min.js +204 -11
  86. assets/js/admin/settings.js +82 -4
  87. assets/js/admin/statistic.js +3 -3
  88. assets/js/frontend/add-to-cart.js +4 -0
  89. assets/js/frontend/become-teacher.js +16 -12
  90. assets/js/frontend/checkout.js +117 -118
  91. assets/js/frontend/course-lesson.js +0 -210
  92. assets/js/frontend/course-quiz.js +0 -46
  93. assets/js/frontend/course-quiz.min.js +0 -1
  94. assets/js/frontend/enroll.js +14 -14
  95. assets/js/frontend/index.php +1 -0
  96. assets/js/frontend/learnpress.js +27 -32
  97. assets/js/frontend/lesson.js +107 -0
  98. assets/js/frontend/profile.js +68 -0
  99. assets/js/frontend/quiz.js +852 -0
  100. assets/js/frontend/shortcodes.js +1 -1
  101. assets/js/frontend/single-course.js +671 -175
  102. assets/js/frontend/single-course.min.js +0 -1
  103. assets/js/frontend/single-course.v2.js +0 -245
  104. assets/js/frontend/single-quiz.js +0 -731
  105. assets/js/frontend/single-quiz.min.js +0 -1
  106. assets/js/global.js +310 -81
  107. assets/js/global.min.js +600 -38
  108. assets/js/index.php +1 -0
  109. assets/js/jquery.tipsy.js +0 -258
  110. assets/js/learnpress.js +0 -575
  111. assets/js/{owlcarousel/owl.carousel.min.js → owl.carousel.min.js} +0 -0
  112. assets/js/toJSON.js +0 -100
  113. assets/load-scripts.php +72 -0
  114. assets/load-styles.php +92 -0
  115. changelog.md +0 -114
  116. dummy-data/index.php +1 -0
  117. inc/abstracts/abstract-lp-assets.php +0 -262
  118. inc/admin/class-lp-admin-ajax.php +262 -15
  119. inc/admin/class-lp-admin-assets.php +0 -55
  120. inc/admin/class-lp-admin-menu.php +19 -11
  121. inc/admin/class-lp-admin-notice.php +1 -1
  122. inc/admin/class-lp-admin-settings.php +2 -14
  123. inc/admin/class-lp-admin.php +60 -4
  124. inc/admin/class-lp-email.php +2 -0
  125. inc/admin/class-lp-plugin-install-list-table.php +1 -1
  126. inc/admin/class-lp-profile.php +2 -2
  127. inc/admin/dashboard-statistics/class-lp-statistic-plugin.php +90 -0
  128. inc/admin/dashboard-statistics/class-lp-statistic-status.php +112 -0
  129. inc/admin/dashboard-statistics/index.php +1 -0
  130. inc/admin/includes/index.php +1 -0
  131. inc/admin/index.php +1 -0
  132. inc/admin/lp-admin-actions.php +135 -0
  133. inc/admin/lp-admin-functions.php +272 -19
  134. inc/admin/meta-boxes/class-curriculum-field.php +8 -12
  135. inc/admin/meta-boxes/class-quiz-questions-field.php +6 -6
  136. inc/admin/meta-boxes/index.php +1 -0
  137. inc/admin/pointers/index.php +1 -0
  138. inc/admin/pointers/pointers.php +1 -1
  139. inc/admin/settings/class-lp-settings-base.php +32 -27
  140. inc/admin/settings/class-lp-settings-checkout.php +3 -3
  141. inc/admin/settings/class-lp-settings-courses.php +10 -4
  142. inc/admin/settings/class-lp-settings-emails.php +41 -32
  143. inc/admin/settings/class-lp-settings-general.php +14 -6
  144. inc/admin/settings/class-lp-settings-pages.php +13 -1
  145. inc/admin/settings/index.php +1 -0
  146. inc/admin/sub-menus/add-ons.php +21 -3
  147. inc/admin/sub-menus/index.php +1 -0
  148. inc/admin/sub-menus/settings.php +10 -13
  149. inc/admin/sub-menus/tools.php +128 -94
  150. inc/admin/views/admin-notice.php +4 -4
  151. inc/admin/views/admin-template.php +30 -4
  152. inc/admin/views/index.php +1 -0
  153. inc/admin/views/meta-boxes/course/curriculum.php +33 -64
  154. inc/admin/views/meta-boxes/course/editor.php +111 -0
  155. inc/admin/views/meta-boxes/course/index.php +1 -0
  156. inc/admin/views/meta-boxes/course/js-template.php +3 -3
  157. inc/admin/views/meta-boxes/course/loop-item.php +39 -43
  158. inc/admin/views/meta-boxes/course/loop-section.php +60 -59
  159. inc/admin/views/meta-boxes/course/review-log.php +4 -4
  160. inc/admin/views/meta-boxes/course/review-logs.php +1 -1
  161. inc/admin/views/meta-boxes/index.php +1 -0
  162. inc/admin/views/meta-boxes/order/actions.php +13 -9
  163. inc/admin/views/meta-boxes/order/details.php +2 -3
  164. inc/admin/views/meta-boxes/order/index.php +1 -0
  165. inc/admin/views/meta-boxes/question/footer.php +1 -1
  166. inc/admin/views/meta-boxes/question/index.php +1 -0
  167. inc/admin/views/meta-boxes/question/multi-choice-options.php +52 -40
  168. inc/admin/views/meta-boxes/question/single-choice-options.php +57 -46
  169. inc/admin/views/meta-boxes/quiz/index.php +1 -0
  170. inc/admin/views/meta-boxes/quiz/js-template.php +1 -1
  171. inc/admin/views/meta-boxes/quiz/question.php +1 -0
  172. inc/admin/views/meta-boxes/quiz/questions.php +1 -1
  173. inc/admin/views/settings/checkout.php +8 -65
  174. inc/admin/views/settings/courses.php +13 -128
  175. inc/admin/views/settings/emails/_email-template.php +107 -0
  176. inc/admin/views/settings/emails/email-template.php +76 -83
  177. inc/admin/views/settings/emails/enrolled-course.php +3 -2
  178. inc/admin/views/settings/emails/finished-course.php +4 -4
  179. inc/admin/views/settings/emails/general.php +1 -1
  180. inc/admin/views/settings/emails/index.php +1 -0
  181. inc/admin/views/settings/emails/new-course.php +3 -3
  182. inc/admin/views/settings/emails/new-order-customer.php +5 -2
  183. inc/admin/views/settings/emails/new-order.php +3 -3
  184. inc/admin/views/settings/emails/published-course.php +2 -2
  185. inc/admin/views/settings/emails/rejected-course.php +2 -2
  186. inc/admin/views/settings/emails/user-order-completed.php +2 -2
  187. inc/admin/views/settings/fields/checkbox.php +0 -1
  188. inc/admin/views/settings/fields/course-permalink.php +3 -3
  189. inc/admin/views/settings/fields/html.php +6 -1
  190. inc/admin/views/settings/fields/index.php +1 -0
  191. inc/admin/views/settings/fields/radio.php +19 -0
  192. inc/admin/views/settings/general.php +5 -86
  193. inc/admin/views/settings/index.php +1 -0
  194. inc/admin/views/settings/pages/index.php +1 -0
  195. inc/admin/views/settings/profile.php +0 -11
  196. inc/admin/views/settings/setting-field.php +1 -4
  197. inc/admin/views/statistics/index.php +1 -0
  198. inc/admin/views/updates/0.9/step-welcome.php +2 -2
  199. inc/admin/views/updates/1.0/step-repair-database.php +0 -19
  200. inc/admin/views/updates/1.0/step-upgraded.php +0 -11
  201. inc/admin/views/updates/1.0/step-welcome.php +0 -10
  202. inc/admin/views/updates/1.0/update-10-wizard.php +0 -29
  203. inc/admin/views/updates/index.php +1 -0
  204. inc/cart/class-lp-cart.php +243 -32
  205. inc/cart/index.php +1 -0
  206. inc/class-lp-ajax.php +185 -216
  207. inc/class-lp-assets.php +399 -49
README.md DELETED
@@ -1,136 +0,0 @@
1
- [![Stories in Ready](https://badge.waffle.io/LearnPress/LearnPress.svg?label=ready&title=Ready)](http://waffle.io/LearnPress/LearnPress)
2
-
3
- <a href="http://thimpress.com/learnpress" target="_blank">LearnPress</a> is a comprehensive WordPress LMS Plugin for WordPress. This WordPress LMS Plugin can be used to easily create & sell courses online. Each course curriculum can be made with lessons & quizzes which can be managed with easy-to-use user interface, we really made it for lazy people.
4
-
5
- [youtube https://www.youtube.com/watch?v=rRWPl5-Hb4k&hd=1&&cc_load_policy=1]
6
-
7
- **LearnPress LMS Plugin works with your theme**
8
- We create LearnPress LMS Plugin to work with any WordPress themes.
9
-
10
- Here are some WordPress Themes designed to work with LearnPress: [Education WordPress Theme](http://themeforest.net/item/education-wordpress-theme-education-wp/14058034 "Education WordPress Theme") and [LMS WordPress theme](http://themeforest.net/item/lms-wordpress-theme-elearning-wp/11797847 "LMS WordPress Theme"). More will coming soon.
11
-
12
-
13
- **LearnPress Support WordPress Multisites**
14
-
15
- **LearnPress features**
16
- *Create course*
17
- LearnPress LMS Plugin provide an excellent user interface to create a course with options you need. You can find it easy to make a full curriculum layout as well as edit and maintain it.
18
- You can also export course and import to other website which also using LearnPress. We will provide the feature allow you to import course from other WordPress LMS plugins soon.
19
-
20
- *Manage course*
21
- With the course you've created, you can share it, manage it, watch statistic about number of student, its trend, etc.
22
-
23
- *Sell course*
24
- LearnPress is free but it still allow you to sell courses you create with support many billing method such as paypal, woocommerce, stripe, etc.
25
-
26
- *Communicate with your students*
27
- With BuddyPress support, LearnPress will help you to communicate with your student or instructor via WordPress forum. Learning is not only on your own. Study, make friends and have fun.
28
-
29
- *LearnPress provide a bunch of add-on*
30
- Add-on is used to providing extra features for LearnPress and you can also write it.
31
-
32
- <a href="http://docs.thimpress.com/learnpress" target="_blank">LearnPress WordPress LMS Plugin Documentation</a>
33
-
34
- **LearnPress is free and always will be**
35
- Education should be free and we want you to bring it to as many people as you can. Therefore, we create LearnPress as a tool for you to create course and share it. We'll continue developing it as long as we can and make it better and better.
36
-
37
- **LearnPress is actively developed**
38
- We are developing and improving LearnPress day by day and bringing new features to you cos we want LearnPress to become the best WordPress plugin in LMS.
39
-
40
- **Free add-ons for LearnPress WordPress LMS Plugin:**
41
-
42
- - [LearnPress Wishlist](https://wordpress.org/plugins/learnpress-wishlist) - add courses to a wishlist for students.
43
- - [LearnPress Course Review](https://wordpress.org/plugins/learnpress-course-review) - review course for enrolled students.
44
- - [LearnPress Import/Export](https://wordpress.org/plugins/learnpress-import-export) - export or import course or courses out-of-box.
45
- - [LearnPress Prerequisites Courses](https://wordpress.org/plugins/learnpress-prerequisites-courses) - require student to pass some courses in order to enroll other course.
46
- - [LearnPress bbPress Integration](https://wordpress.org/plugins/learnpress-bbpress) - add bbPress Forum support for LearnPress WordPress LMS Plugin.
47
- - [LearnPress BuddyPress Integration](https://wordpress.org/plugins/learnpress-buddypress) - add BuddyPress support for LearnPress WordPress LMS Plugin.
48
-
49
- **Premium add-ons for LearnPress WordPress LMS Plugin:**
50
-
51
- - [Certificates add-on for LearnPress](http://thimpress.com/shop/certificates-add-on-for-learnpress/) - adding drag & drop certificates builder as well as selecting designed certificate for each LMS course, your student will get particular certificate when they finished a course.
52
- - [Co-instructors add-on for LearnPress](http://thimpress.com/shop/co-instructors-add-on-for-learnpress/) - multiple instructors support for each LMS course.
53
- - [Collections add-on for LearnPress](http://thimpress.com/shop/collections-add-on-for-learnpress/) - making LMS courses collection by selecting number of courses, this is helpful if you want to combine multiple LMS courses into a collection for a group of skills.
54
- - [Stripe Payment method for LearnPress](http://thimpress.com/shop/stripe-add-on-for-learnpress/) - Stripe payment method for LearnPress WordPress LMS Plugin.
55
- - [WooCommerce add-on for LearnPress](http://thimpress.com/shop/woocommerce-add-on-for-learnpress/) - using WooCommerce as payment gateway for LearnPrss WordPress LMS Plugin.
56
-
57
- **WordPress LMS Plugin - LearnPress ROADMAP:**
58
-
59
- - Payment Method support (first priority)
60
- - Authorize.net
61
- - Google Checkout
62
- - Amazon Payments
63
- - Dwolla
64
- - Braintree
65
- - Samurai by FeeFighters
66
- - WePay
67
- - 2Checkout
68
- - Assignment
69
- - Gradebook
70
- - Paid MemberShip Pro
71
- - Events
72
- - myCRED integration
73
- - Share Grade
74
- - BadgeOS
75
- - Content Drip
76
- - Manually reset quiz for retake
77
- - Create quiz from randoms questions in question bank
78
- - Attachment restriction for lesson
79
- - Mathjax support
80
- - Presentation support (maybe support SlideShare)
81
- - Show enrolled user
82
- - Student ranks
83
- - REST API for mobile app
84
- - No distraction mode (when doing quiz)
85
- - Report/feedback about a question/quiz/lesson
86
- - Commission for payment method
87
- - Instructor's note
88
- - Private message from Admin to teacher
89
- - Group payment
90
- - Announcement (come up with email)
91
-
92
- Any suggestions for this WordPress LMS Plugin? Send us <a href="http://thimpress.com/learnpress-suggestion/" target="_blank">here.</a>
93
-
94
-
95
- ##Installation
96
-
97
- **From your WordPress dashboard**
98
- 1. Visit 'Plugin > Add new'.
99
- 2. Search for 'LearnPress'.
100
- 3. Activate LearnPress from your Plugins page.
101
-
102
- **From WordPress.org**
103
- 1. Search, select and download LearnPress.
104
- 2. Activate the plugin through the 'Plugins' menu in WordPress Dashboard.
105
-
106
- ##Frequently Asked Questions
107
-
108
- **What is LearnPress ?**
109
- LearnPress is a plugin to create a LMS website, to spread out course, or sell course.
110
-
111
- **Where can I find LearnPress documentation and user guides?**
112
- If you want to use LearnPress to build a Learning Management Website, please refer to our user guides in <a href="http://docs.thimpress.com/learnpress/" target="_blank">LearnPress official site.</a>
113
- And if you want to extending or theming LearnPress, see our <a href="https://github.com/LearnPress/LearnPress/wiki">Wiki</a>
114
-
115
- **Where can I get support or talk to other users?**
116
- If you get troubles when using LearnPress you can ask for help on the LearnPres Support Forum
117
-
118
- For help with premium add-ons, use our helpdesk.
119
-
120
- **Where can I ask for new features or suggest ideas or themes for LearnPress?**
121
- You can send us your ideas through form <a href="http://thimpress.com/learnpress-suggestion/" target="_blank">here.</a>here
122
-
123
- **Where can I report bugs or contribute to the project?**
124
- You can also report bugs on LearnPress Support Forum or LearnPress <a href="https://github.com/LearnPress/LearnPress/issues" target="_blank">Github Repository</a>.
125
-
126
- **Where can I find the REST API documentation?**
127
- We will provide documentation about LearnPress REST API really soon.
128
-
129
- **LearnPress is great, can I contribute to it?**
130
- Yes, you can and we appreciate it. Join in our <a href="https://github.com/LearnPress/LearnPress" target="_blank">Github Repository</a>.
131
-
132
- **LearnPress Translation project**
133
- https://www.transifex.com/projects/p/learnpress/
134
-
135
- **Other note**
136
- <a href="http://docs.thimpress.com/learnpress" target="_blank">Documentation</a> is available in ThimPress site.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/css/_icons.css CHANGED
@@ -1,42 +1,75 @@
1
- @font-face {
2
- font-family: 'lp-icons';
3
- src: url('fonts/icons.eot?6gvjr0');
4
- src: url('fonts/icons.eot?6gvjr0#iefix') format('embedded-opentype'), url('fonts/icons.ttf?6gvjr0') format('truetype'), url('fonts/icons.woff?6gvjr0') format('woff'), url('fonts/icons.svg?6gvjr0#icons') format('svg');
5
- font-weight: normal;
6
- font-style: normal;
7
- }
8
- [class^="lp-icon-"],
9
- [class*=" lp-icon-"] {
10
- /* use !important to prevent issues with browser extensions that change fonts */
11
- font-family: 'lp-icons' !important;
12
- speak: none;
13
- font-style: normal;
14
- font-weight: normal;
15
- font-variant: normal;
16
- text-transform: none;
17
- line-height: 1;
18
- /* Better Font Rendering =========== */
19
- -webkit-font-smoothing: antialiased;
20
- -moz-osx-font-smoothing: grayscale;
21
- }
22
- .lp-icon-file-text:before {
23
- content: "\e926";
24
- }
25
- .icon-file-picture:before {
26
- content: "\e927";
27
- }
28
- .icon-file-music:before {
29
- content: "\e928";
30
- }
31
- .icon-file-video:before {
32
- content: "\e92a";
33
- }
34
- .icon-file-zip:before {
35
- content: "\e92b";
36
- }
37
- .icon-paste:before {
38
- content: "\e92d";
39
- }
40
- .icon-alarm:before {
41
- content: "\e950";
42
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @font-face {
2
+ font-family: 'lp-icons';
3
+ src: url('fonts/icons.eot?6gvjr0');
4
+ src: url('fonts/icons.eot?6gvjr0#iefix') format('embedded-opentype'), url('fonts/icons.ttf?6gvjr0') format('truetype'), url('fonts/icons.woff?6gvjr0') format('woff'), url('fonts/icons.svg?6gvjr0#icons') format('svg');
5
+ font-weight: normal;
6
+ font-style: normal;
7
+ }
8
+ [class^="lp-icon-"],
9
+ [class*=" lp-icon-"] {
10
+ /* use !important to prevent issues with browser extensions that change fonts */
11
+ font-family: 'lp-icons' !important;
12
+ speak: none;
13
+ font-style: normal;
14
+ font-weight: normal;
15
+ font-variant: normal;
16
+ text-transform: none;
17
+ line-height: 1;
18
+ /* Better Font Rendering =========== */
19
+ -webkit-font-smoothing: antialiased;
20
+ -moz-osx-font-smoothing: grayscale;
21
+ }
22
+ .lp-icon-file-text:before {
23
+ content: "\e926";
24
+ }
25
+ .icon-file-picture:before {
26
+ content: "\e927";
27
+ }
28
+ .icon-file-music:before {
29
+ content: "\e928";
30
+ }
31
+ .icon-file-video:before {
32
+ content: "\e92a";
33
+ }
34
+ .icon-file-zip:before {
35
+ content: "\e92b";
36
+ }
37
+ .icon-paste:before {
38
+ content: "\e92d";
39
+ }
40
+ .icon-alarm:before {
41
+ content: "\e950";
42
+ }
43
+ @font-face {
44
+ font-family: 'learnpress';
45
+ src: url('../fonts/icon.eot?ym8b3w');
46
+ src: url('../fonts/icon.eot?ym8b3w#iefix') format('embedded-opentype'), url('../fonts/icon.ttf?ym8b3w') format('truetype'), url('../fonts/icon.woff?ym8b3w') format('woff'), url('../fonts/icon.svg?ym8b3w#icon') format('svg');
47
+ font-weight: normal;
48
+ font-style: normal;
49
+ }
50
+ [class^="learn-press-icon-"],
51
+ [class*=" learn-press-icon-"],
52
+ .learn-press-icon {
53
+ font-family: 'learnpress';
54
+ /*speak: none;*/
55
+ font-style: normal;
56
+ font-weight: normal;
57
+ font-variant: normal;
58
+ text-transform: none;
59
+ line-height: 1;
60
+ /* Better Font Rendering =========== */
61
+ -webkit-font-smoothing: antialiased;
62
+ -moz-osx-font-smoothing: grayscale;
63
+ }
64
+ .icon-checkmark:before {
65
+ content: "\e903";
66
+ }
67
+ .icon-books:before {
68
+ content: "\e900";
69
+ }
70
+ .icon-alarm:before {
71
+ content: "\e901";
72
+ }
73
+ .icon-spinner:before {
74
+ content: "\e902";
75
+ }
assets/css/_icons.less CHANGED
@@ -44,4 +44,41 @@
44
  }
45
  .icon-alarm:before {
46
  content: "\e950";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47
  }
44
  }
45
  .icon-alarm:before {
46
  content: "\e950";
47
+ }
48
+
49
+ @font-face {
50
+ font-family: 'learnpress';
51
+ src: url('../fonts/icon.eot?ym8b3w');
52
+ src: url('../fonts/icon.eot?ym8b3w#iefix') format('embedded-opentype'),
53
+ url('../fonts/icon.ttf?ym8b3w') format('truetype'),
54
+ url('../fonts/icon.woff?ym8b3w') format('woff'),
55
+ url('../fonts/icon.svg?ym8b3w#icon') format('svg');
56
+ font-weight: normal;
57
+ font-style: normal;
58
+ }
59
+
60
+ [class^="learn-press-icon-"], [class*=" learn-press-icon-"], .learn-press-icon {
61
+ font-family: 'learnpress';
62
+ /*speak: none;*/
63
+ font-style: normal;
64
+ font-weight: normal;
65
+ font-variant: normal;
66
+ text-transform: none;
67
+ line-height: 1;
68
+
69
+ /* Better Font Rendering =========== */
70
+ -webkit-font-smoothing: antialiased;
71
+ -moz-osx-font-smoothing: grayscale;
72
+ }
73
+ .icon-checkmark:before {
74
+ content: "\e903";
75
+ }
76
+ .icon-books:before {
77
+ content: "\e900";
78
+ }
79
+ .icon-alarm:before {
80
+ content: "\e901";
81
+ }
82
+ .icon-spinner:before {
83
+ content: "\e902";
84
  }
assets/css/_learnpress.css DELETED
@@ -1,1047 +0,0 @@
1
- .clearfix:after {
2
- display: block;
3
- content: '';
4
- clear: both;
5
- }
6
-
7
- .column-lp_course .row-actions,
8
- .column-lp_quiz .row-actions {
9
- display: inline-block;
10
- margin-left: 10px;
11
- }
12
-
13
- .column-lp_course .row-actions a,
14
- .column-lp_quiz .row-actions a {
15
- color: #999;
16
- }
17
-
18
- /**/
19
- /* message box */
20
- #learn-press-message-box-block {
21
- position: fixed;
22
- top: 0;
23
- left: 0;
24
- right: 0;
25
- bottom: 0;
26
- background-color: #000;
27
- z-index: 99999;
28
- opacity: 0.8;
29
- }
30
-
31
- #learn-press-message-box-window {
32
- position: fixed;
33
- top: 0;
34
- bottom: 0;
35
- left: 0;
36
- right: 0;
37
- z-index: 100000;
38
- color: #FFF;
39
- text-align: center;
40
- }
41
-
42
- #message-box-wrap {
43
- margin: 0 auto;
44
- /* text-align: center; */
45
- display: inline-block;
46
- text-align: left;
47
- max-width: 70%;
48
- }
49
-
50
- .message-box-title {
51
- color: #FFF;
52
- margin: 0 0 40px 0;
53
- font-size: 34px;
54
- }
55
-
56
- .message-box-content {
57
- font-size: 16px;
58
- line-height: 1.5;
59
- }
60
-
61
- .message-box-animation {
62
- background-image: url("../images/animation.gif");
63
- width: 220px;
64
- height: 20px;
65
- margin: 20px 0 0;
66
- }
67
-
68
- .message-box-buttons {
69
- margin: 20px 0 0;
70
- border-top: 1px solid #929292;
71
- padding-top: 20px;
72
- }
73
-
74
- .message-box-button {
75
- margin-right: 10px !important;
76
- background-color: #FFFFFF;
77
- color: #999;
78
- }
79
-
80
- .message-box-button:hover {
81
- background-color: #F5F5F5;
82
- }
83
-
84
- .lp-label {
85
- display: inline-block;
86
- padding: 3px 8px;
87
- line-height: 1;
88
- font-size: 65%;
89
- vertical-align: baseline;
90
- color: #FFF;
91
- border-radius: 4px;
92
- }
93
-
94
- .lp-label-quiz {
95
- background-color: #53658C;
96
- }
97
-
98
- .lp-label-preview {
99
- background-color: #5cb85c;
100
- }
101
-
102
- .lp-label-viewing {
103
- background-color: #39afff;
104
- }
105
-
106
- .lp-label-lesson {
107
- background-color: #337ab7;
108
- }
109
-
110
- .lp-label-final {
111
- background-color: #FF6161;
112
- }
113
-
114
- .lp-label-completed {
115
- background-color: #39C7CE;
116
- }
117
-
118
- .lp-label-format {
119
- background-color: #ccc416;
120
- }
121
-
122
- .lp-label-format-aside {
123
- background-color: #ccc416;
124
- }
125
-
126
- .lp-label-format-image {
127
- background-color: #ccc416;
128
- }
129
-
130
- .lp-label-format-video {
131
- background-color: #ccc416;
132
- }
133
-
134
- .lp-label-format-quote {
135
- background-color: #ccc416;
136
- }
137
-
138
- .lp-label-format-link {
139
- background-color: #ccc416;
140
- }
141
-
142
- .lp-label-format-gallery {
143
- background-color: #ccc416;
144
- }
145
-
146
- .lp-label-format-status {
147
- background-color: #ccc416;
148
- }
149
-
150
- .lp-label-format-audio {
151
- background-color: #ccc416;
152
- }
153
-
154
- .lp-label-format-chat {
155
- background-color: #ccc416;
156
- }
157
-
158
- .course-item .lp-label-completed,
159
- .course-item .lp-label-viewing {
160
- display: none;
161
- }
162
-
163
- .course-item.item-completed .lp-label-completed,
164
- .course-item.item-current .lp-label-viewing {
165
- display: inline-block;
166
- }
167
-
168
- .course-meta > * {
169
- display: inline-block;
170
- font-style: italic;
171
- font-size: smaller;
172
- }
173
-
174
- .course-meta > *:after {
175
- content: ' | ';
176
- font-style: italic;
177
- }
178
-
179
- .course-meta > *:last-child:after {
180
- display: none;
181
- }
182
- /**/
183
- .learnpress {
184
-
185
- }
186
-
187
- .learnpress ul,
188
- .learnpress li {
189
- list-style: none;
190
- }
191
-
192
- .learnpress h3 {
193
- font-size: 2.7rem;
194
- line-height: 1.1852;
195
- margin-top: 2.3704em;
196
- margin-bottom: 1.1852em;
197
- }
198
-
199
- .learnpress .learnpress-content {
200
- z-index: 100;
201
- position: relative;
202
- }
203
-
204
- .learnpress .twentyfifteen .learnpress-content {
205
- padding-left: 7.6923%;
206
- padding-right: 7.6923%;
207
- padding-top: 7.6923%;
208
- margin-bottom: 7.6923%;
209
- background: #fff;
210
- box-shadow: 0 0 1px rgba(0, 0, 0, .15);
211
- }
212
-
213
- .learn-press-checkout-payment {
214
-
215
- }
216
-
217
- .payment-method-form {
218
- display: none;
219
- }
220
-
221
- .learn-press-user-form {
222
- float: left;
223
- width: 50%;
224
- box-sizing: border-box;
225
- padding: 0 10px;
226
- }
227
-
228
- .learn-press-user-form .form-heading {
229
- }
230
-
231
- .learn-press-user-form .form-subheading {
232
-
233
- }
234
-
235
- .learn-press-user-form .form-content {
236
-
237
- }
238
-
239
- .learn-press-user-form .form-fields {
240
-
241
- }
242
-
243
- #learn-press-checkout-user-form {
244
- margin: 0 -10px;
245
- }
246
-
247
- /* archive */
248
- .learnpress .twentyfifteen .page-title {
249
- margin: 0 0 30px 0;
250
- }
251
-
252
- .course-introduce {
253
- margin: 20px 0 0 0;
254
- }
255
-
256
- .course-introduce .more-link {
257
-
258
- }
259
-
260
- .course-title,
261
- .course-title h3 {
262
- font-size: 18px;
263
- }
264
-
265
- .archive .lp_course {
266
- }
267
-
268
- /* pagination */
269
- .learn-press-pagination {
270
- text-align: center;
271
- }
272
-
273
- .learn-press-pagination ul > li {
274
- display: inline-block;
275
- }
276
-
277
- .learn-press-pagination ul > li a,
278
- .learn-press-pagination ul > li span {
279
- display: inline-block;
280
- padding: 0 10px;
281
- border: 1px solid #DDD;
282
- background-color: #F5F5F5;
283
- }
284
-
285
- .learn-press-pagination ul > li a {
286
- background-color: #FFF;
287
- }
288
-
289
- .learn-press-breadcrumb {
290
- margin: 0 0 20px 0;
291
- }
292
-
293
- /* course lesson nav */
294
- .course-item-nav {
295
- border-top: 1px dashed #DDD;
296
- overflow: hidden;
297
- margin: 20px 0;
298
- padding-top: 10px;
299
- }
300
-
301
- .course-item-nav .course-item-prev > *,
302
- .course-item-nav .course-item-next > * {
303
- display: block;
304
- }
305
-
306
- .course-item-nav > div > span {
307
- font-size: 70%;
308
- text-transform: uppercase;
309
- font-weight: bold;
310
- }
311
-
312
- .course-item-nav .course-item-prev {
313
- float: left;
314
- text-align: left;
315
- }
316
-
317
- .course-item-nav .course-item-next {
318
- float: right;
319
- text-align: right;
320
- }
321
-
322
- /* curriculum */
323
- .section-header {
324
- margin: 0 0 0 0;
325
- padding: 10px 15px;
326
- background-color: #EEE;
327
- }
328
-
329
- .section-header p {
330
- display: inline-block;
331
- font-weight: normal;
332
- font-style: italic;
333
- color: #999;
334
- font-size: smaller;
335
- margin: 0;
336
- }
337
-
338
- #learn-press-course-curriculum .section {
339
- margin: 0 0 1px 0;
340
- list-style: none;
341
- }
342
-
343
- #learn-press-course-curriculum .section-content {
344
- margin: 0;
345
- background-color: #F5F5F5;
346
- }
347
-
348
- #learn-press-course-curriculum .section .course-item {
349
- margin: 0 0 0;
350
- list-style: none;
351
- padding: 10px 15px;
352
- border-top: 1px solid #FFF;
353
- }
354
-
355
- #learn-press-course-curriculum .section .course-item-meta {
356
- display: block;
357
- float: right;
358
- line-height: 1;
359
- margin: 3px 0;
360
- }
361
-
362
- #learn-press-course-curriculum .section .course-item.section-empty {
363
- background-color: #F5F5F5;
364
- }
365
-
366
- #learn-press-course-curriculum .section .course-item.section-empty .learn-press-message {
367
- margin: 0;
368
- }
369
-
370
- /* QUIZ */
371
- .single-quiz {
372
-
373
- }
374
-
375
- .single-quiz .quiz-summary-left {
376
- float: left;
377
- width: 100%;
378
- padding-right: 320px;
379
- }
380
-
381
- .single-quiz .quiz-sidebar {
382
- float: right;
383
- width: 300px;
384
- margin-left: -300px;
385
- border: 2px solid #DDD;
386
- padding: 20px;
387
- }
388
-
389
- .single-quiz.quiz-completed .quiz-questions-list .learn-press-question-title {
390
- display: none;
391
- }
392
-
393
- .quiz-questions-list .current {
394
- font-weight: bold;
395
- }
396
-
397
- .quiz-questions-list .current a:after {
398
- display: inline-block;
399
- background-color: #0066cc;
400
- /* padding: 0px 8px; */
401
- color: #FFF;
402
- font-size: 70%;
403
- border-radius: 50%;
404
- content: '?';
405
- /* margin-left: 10px; */
406
- width: 20px;
407
- height: 20px;
408
- line-height: 20px;
409
- text-align: center;
410
- vertical-align: middle;
411
- }
412
-
413
- .quiz-countdown {
414
- text-align: center;
415
- }
416
-
417
- .quiz-countdown #quiz-countdown-value {
418
- font-size: 40px;
419
- line-height: 1;
420
- }
421
-
422
- .quiz-countdown .quiz-countdown-label {
423
- font-size: smaller;
424
- font-style: italic;
425
- color: #999;
426
- }
427
-
428
- .quiz-buttons {
429
- text-align: center;
430
- }
431
-
432
- .quiz-result {
433
- width: 100%;
434
- }
435
-
436
- .quiz-result .quiz-result-mark {
437
- float: left;
438
- width: 150px;
439
- height: 150px;
440
- background-color: #F5F5F5;
441
- border-radius: 50%;
442
- text-align: center;
443
- box-sizing: border-box;
444
- padding-top: 30px;
445
- line-height: 1;
446
-
447
- }
448
-
449
- .quiz-result .quiz-result-mark .quiz-mark {
450
- font-size: 60px;
451
- display: block;
452
- }
453
-
454
- .quiz-result .quiz-result-mark .quiz-mark small {
455
- font-size: 20px;
456
- }
457
-
458
- .quiz-result .quiz-result-summary {
459
- float: left;
460
- margin-left: 30px;
461
- }
462
-
463
- .quiz-result .quiz-result-summary .quiz-result-field {
464
- margin: 0;
465
- font-size: 14px;
466
- }
467
-
468
- .quiz-result .quiz-result-summary .quiz-result-field > label {
469
- width: 100px;
470
- display: inline-block;
471
- }
472
-
473
- .quiz-result .quiz-result-summary .quiz-result-field.correct {
474
- color: #0066cc;
475
- }
476
-
477
- .quiz-result .quiz-result-summary .quiz-result-field.wrong {
478
- color: #BC0B0B;
479
- }
480
-
481
- .quiz-result .quiz-result-summary .quiz-result-field.empty {
482
- color: #869791;
483
- }
484
-
485
- .quiz-history {
486
- font-size: 80%;
487
- }
488
-
489
- .quiz-history td {
490
- padding: 10px;
491
- }
492
-
493
- .quiz-history-actions {
494
- margin: 0;
495
- }
496
-
497
- /* profile */
498
- #learn-press-user-profile {
499
- overflow: hidden;
500
- }
501
-
502
- .learn-press-user-profile .user-info {
503
- margin: 0 0 20px;
504
- }
505
-
506
- .learn-press-user-profile .user-basic-info {
507
-
508
- }
509
-
510
- .learn-press-user-profile .learn-press-tabs {
511
- list-style: none;
512
- margin: 0 0 20px;
513
- padding-left: 5px;
514
- border-bottom: 1px solid #DDD;
515
- }
516
-
517
- .learn-press-user-profile .learn-press-tabs > li {
518
- float: left;
519
- }
520
-
521
- .learn-press-user-profile .learn-press-tabs > li > a {
522
- box-shadow: none;
523
- outline: none;
524
- display: block;
525
- border: none;
526
- padding: 5px 10px;
527
- }
528
-
529
- .learn-press-user-profile .learn-press-tabs > li.current a {
530
- background-color: #FFF;
531
- border: 1px solid #DDD;
532
- border-bottom-color: transparent;
533
- z-index: 10;
534
- margin-bottom: -1px;
535
- }
536
-
537
- .learn-press-tabs-wrapper {
538
- margin: 0 0 20px;
539
- }
540
-
541
- .learn-press-user-profile .learn-press-tabs-wrapper > .learn-press-tab {
542
- /*padding: 0;
543
- float: left;
544
- width: 100%;
545
- margin-right: -100%;
546
- visibility: hidden;*/
547
- }
548
-
549
- .learn-press-user-profile .entry-tab-inner {
550
- }
551
-
552
- .learn-press-user-profile .learn-press-tabs-wrapper {
553
- /*float: left;
554
- width: 100%;
555
- padding-left: 170px;*/
556
- }
557
-
558
- .learn-press-user-profile .profile-content-left {
559
- float: left;
560
- margin-left: -100%;
561
- margin-bottom: -100000px;
562
- padding-bottom: 100000px;
563
- background-color: #F5F5F5;
564
- }
565
-
566
- .profile-courses {
567
- list-style: none;
568
- }
569
-
570
- .profile-courses > li {
571
-
572
- }
573
-
574
- .profile-courses > li > a {
575
- }
576
-
577
- .profile-courses-heading {
578
- margin: 0 0 10px !important;
579
- }
580
-
581
- .learn-press-subtabs {
582
- }
583
-
584
- .learn-press-subtabs > li {
585
- display: inline-block;
586
- margin-right: 10px;
587
- }
588
-
589
- .learn-press-subtabs > li.current {
590
- font-weight: bold;
591
- }
592
-
593
- .learn-press-subtab-content {
594
- display: none;
595
- }
596
-
597
- .learn-press-subtab-content.current {
598
- display: block;
599
- }
600
-
601
- .hide-if-js {
602
- display: none;
603
- }
604
-
605
- /**/
606
- .purchase-course .view-cart-button {
607
-
608
- }
609
-
610
- .learn-press-cart-table td,
611
- .learn-press-cart-table th {
612
- vertical-align: top;
613
- }
614
-
615
- .learn-press-cart-table .course-remove {
616
- width: 40px;
617
- }
618
-
619
- .learn-press-cart-table .course-thumbnail {
620
- width: 20%;
621
- }
622
-
623
- .learn-press-cart-table .course-price,
624
- .learn-press-cart-table .course-total {
625
- width: 15%;
626
- }
627
-
628
- /* notices */
629
- .learn-press-notice,
630
- .learn-press-message,
631
- .learn-press-error {
632
- list-style: none;
633
- margin: 0 0 20px 0;
634
- background-color: #F5F5F5;
635
- padding: 8px 15px;
636
- border-left: 5px solid;
637
- }
638
-
639
- .learn-press-notice {
640
- border-color: #1e85be;
641
- }
642
-
643
- .learn-press-message {
644
- border-color: #8fae1b;
645
- }
646
-
647
- .learn-press-error {
648
- border-color: #b81c23;
649
- }
650
-
651
- .open-hand {
652
- cursor: url("../../assets/images/openhand.cur") 7 5, default !important;
653
- }
654
-
655
- a .archive-course:hover {
656
- cursor: pointer;
657
- }
658
-
659
- .archive-course {
660
- border: 1px solid black;
661
- display: table;
662
- margin-bottom: 10px;
663
- width: 100%;
664
- }
665
-
666
- .course-cover {
667
- display: table-cell;
668
- height: 100px;
669
- width: 100px;
670
- }
671
-
672
- .course-detail {
673
- display: table-cell;
674
- vertical-align: top;
675
- padding-left: 10px;
676
- }
677
-
678
- .course-title {
679
- font-weight: bold;
680
- }
681
-
682
- .lp-button-dropdown {
683
- padding-right: 28px !important;
684
- position: relative;
685
- z-index: 99998;
686
- }
687
-
688
- .lp-course-progress {
689
- margin-right: 50px;
690
- }
691
-
692
- .lp-course-progress:after {
693
- display: block;
694
- content: '';
695
- clear: both;
696
- }
697
-
698
- .lp-course-progress .lp-course-progress-heading {
699
- margin: 0 0 40px 0;
700
- }
701
-
702
- .lp-course-progress .lp-progress-bar {
703
- height: 20px;
704
- background: #F5F5F5;
705
- position: relative;
706
- /* margin-right: 80px; */
707
- float: left;
708
- width: 100%;
709
- margin-bottom: 50px;
710
- -webkit-border-radius: 5px;
711
- -moz-border-radius: 5px;
712
- border-radius: 5px;
713
- }
714
-
715
- .lp-course-progress .lp-progress-value {
716
- height: 20px;
717
- background: #DDD;
718
- position: absolute;
719
- left: 0;
720
- -webkit-transition: width 0.25s;
721
- -moz-transition: width 0.25s;
722
- -ms-transition: width 0.25s;
723
- -o-transition: width 0.25s;
724
- transition: width 0.25s;
725
- -webkit-border-radius: 5px;
726
- -moz-border-radius: 5px;
727
- border-radius: 5px;;
728
- }
729
-
730
- .lp-course-progress .lp-progress-value > span,
731
- .lp-course-progress .lp-passing-conditional span {
732
- display: inline-block;
733
- padding: 5px 10px;
734
- font-size: small;
735
- background: #DDD;
736
- position: absolute;
737
- right: 0;
738
- top: -35px;
739
- line-height: 1;
740
- white-space: nowrap;
741
- width: 50px;
742
- text-align: center;
743
- margin-right: -25px;
744
- -webkit-border-radius: 3px;
745
- -moz-border-radius: 3px;
746
- border-radius: 3px;
747
- }
748
-
749
- .lp-course-progress .lp-progress-value > span:after,
750
- .lp-course-progress .lp-passing-conditional span:after {
751
- content: '';
752
- display: block;
753
- border: 6px solid #DDD;
754
- position: absolute;
755
- border-color: transparent;
756
- border-top-color: #DDD;
757
- bottom: -12px;
758
- left: 50%;
759
- margin-left: -6px;
760
- }
761
-
762
- .lp-course-progress .lp-passing-conditional span {
763
- top: 30px;
764
- margin-left: -25px;
765
- }
766
-
767
- .lp-course-progress .lp-passing-conditional span:after {
768
- border-bottom-color: #DDD;
769
- top: -12px;
770
- left: 50%;
771
- border-top-color: transparent;
772
- bottom: auto;
773
- }
774
-
775
- .lp-course-progress .lp-progress-value.left > span {
776
- left: 100%;
777
- right: auto;
778
- }
779
-
780
- .lp-course-progress .lp-progress-value.left > span:after {
781
- bottom: -4px;
782
- transform: rotate(225deg);
783
- left: -10px;
784
- right: auto;
785
- }
786
-
787
- .lp-course-progress.passed .lp-progress-value {
788
- background: #83D0FF;
789
- -webkit-border-radius: 5px;
790
- -moz-border-radius: 5px;
791
- border-radius: 5px;
792
- }
793
-
794
- .lp-course-progress.passed .lp-progress-value > span {
795
- background: #83D0FF;
796
- }
797
-
798
- .lp-course-progress.passed .lp-progress-value > span:after {
799
- border-top-color: #83D0FF;
800
- }
801
-
802
- .lp-course-progress .lp-progress-total {
803
- width: 50px;
804
- float: right;
805
- margin-right: -50px;
806
- height: 20px;
807
- font-size: small;
808
- text-align: right;
809
- line-height: 20px;
810
- }
811
-
812
- .lp-course-progress .lp-passing-conditional {
813
- position: absolute;
814
- height: 20px;
815
- width: 1px;
816
- background-color: #FF0000;
817
- }
818
-
819
- .lp-course-progress .lp-passing-conditional.right span {
820
- right: 0;
821
- }
822
-
823
- .lp-course-progress .lp-passing-conditional.right span:after {
824
- left: auto;
825
- right: -10px;
826
- border-left-color: transparent;
827
- border-bottom-color: #DDD;
828
- }
829
-
830
- .quiz-questions-list .question-title {
831
- font-weight: normal;
832
- }
833
-
834
- .question-results .question-title:after {
835
- content: '';
836
- display: inline-block;
837
- font-family: dashicons;
838
- vertical-align: middle;
839
- font-size: 20px;
840
- }
841
-
842
- .question-results.correct .question-title:after {
843
- content: "\f147";
844
- }
845
-
846
- .question-results.incorrect .question-title:after {
847
- content: "\f335";
848
- }
849
-
850
- .question-results.skipped {
851
- }
852
-
853
- .complete-lesson-button.completed {
854
-
855
- }
856
-
857
- .learn-press-question-wrap {
858
-
859
- }
860
-
861
- .learn-press-question-wrap.checked li.answer-true {
862
- background: #C4EBFF;
863
- }
864
-
865
- .learn-press-question-wrap.checked li.user-answer-false {
866
- color: #FF0000;
867
- }
868
-
869
- /* jAlerts */
870
- #popup_container {
871
- background: #FFF;
872
- }
873
-
874
- #popup_title {
875
- padding: 10px 20px;
876
- background: #18B6C7;
877
- color: #FFF;
878
- }
879
-
880
- #popup_content {
881
- padding: 20px;
882
- }
883
-
884
- #popup_message {
885
- margin-bottom: 20px;
886
- }
887
-
888
- .question-explanation-content,
889
- .question-hint-content {
890
- border: 1px solid #DDD;
891
- padding: 20px;
892
- background: #DDD;
893
- margin-bottom: 20px;
894
- }
895
-
896
- .question-explanation-content:before,
897
- .question-hint-content:before {
898
- content: attr(data-title);
899
- display: block;
900
- font-weight: bold;
901
- }
902
-
903
- .button-fade {
904
- opacity: 0.5;
905
- }
906
-
907
- .button-fade:hover {
908
- opacity: 1;
909
- }
910
-
911
- #learn-press-content-item {
912
- margin-bottom: 20px;
913
- background: #ffffff;
914
- border: 1px solid #DDD;
915
- padding: 20px;
916
- display: none;
917
- }
918
-
919
- #learn-press-content-item .course-lesson-heading {
920
- margin-top: 0;
921
- }
922
- #learn-press-content-item.loading {
923
- height: 50px;
924
- overflow: hidden;
925
- position: relative;
926
- }
927
-
928
- #learn-press-content-item.loading:before,
929
- #learn-press-content-item.loading:after {
930
- position: absolute;
931
- top: 0;
932
- left: 0;
933
- right: 0;
934
- bottom: 0;
935
- z-index: 10;
936
- background: #FFF;
937
- content: '';
938
- }
939
-
940
- #learn-press-content-item.loading:after {
941
- background: url("../images/ajax-loader.gif") center no-repeat;
942
- }
943
-
944
- #learn-press-course-lesson {
945
- }
946
-
947
- .quiz-question-nav-buttons {
948
- margin: 10px 0;
949
- }
950
-
951
- @-ms-viewport {
952
- width: device-width;
953
- }
954
-
955
- @viewport {
956
- width: device-width;
957
- }
958
-
959
- /**
960
- * Mobile Large 620px
961
- */
962
- @media screen and (min-width: 38.75em) {
963
- .twentyfifteen .learnpress-content {
964
- margin-right: 7.6923%;
965
- margin-left: 7.6923%;
966
- margin-top: 8.3333%;
967
- }
968
- }
969
-
970
- @media screen and (max-width: 38.75em) {
971
- .single-quiz .quiz-sidebar {
972
- width: 100%;
973
- }
974
-
975
- .learnpress ul {
976
- margin-left: 0;
977
- }
978
-
979
- #learn-press-course-curriculum .section .course-item-meta {
980
- float: none;
981
- }
982
- }
983
-
984
- /**
985
- * Tablet Small 740px
986
- */
987
-
988
- @media screen and (min-width: 46.25em) {
989
-
990
- }
991
-
992
- /**
993
- * Tablet Large 880px
994
- */
995
-
996
- @media screen and (min-width: 55em) {
997
- }
998
-
999
- /**
1000
- * Desktop Small 955px
1001
- */
1002
-
1003
- @media screen and (min-width: 59.6875em) {
1004
- .twentyfifteen .learnpress-content {
1005
- margin-left: 8.3333%;
1006
- margin-right: 8.3333%;
1007
- padding: 10%;
1008
- }
1009
- }
1010
-
1011
- @media screen and (max-width: 59.6875em) {
1012
-
1013
- .twentyfifteen .learnpress-content {
1014
- padding: 10%;
1015
- }
1016
- }
1017
-
1018
- /**
1019
- * Desktop Medium 1100px
1020
- */
1021
-
1022
- @media screen and (max-width: 68.75em) {
1023
- .single-quiz .quiz-summary-left,
1024
- .single-quiz .quiz-sidebar {
1025
- float: none;
1026
- margin: 0 auto;
1027
- }
1028
-
1029
- .single-quiz .quiz-summary-left {
1030
- padding-right: 0;
1031
- }
1032
- }
1033
-
1034
- /**
1035
- * Desktop Large 1240px
1036
- */
1037
-
1038
- @media screen and (min-width: 77.5em) {
1039
- }
1040
-
1041
- /**
1042
- * Desktop X-Large 1403px
1043
- */
1044
-
1045
- @media screen and (min-width: 87.6875em) {
1046
-
1047
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/css/admin/admin.css CHANGED
@@ -1,1468 +1,1341 @@
1
- /**
2
- * Define all styles for admin side
3
- *
4
- * @author ThimPress
5
- * @version 1.0
6
- */
7
- .lp-nav-tab-wrapper {
8
- border-bottom: 1px solid #ccc;
9
- margin: 0;
10
- padding: 9px 15px 0 0;
11
- line-height: inherit;
12
- }
13
-
14
- .learn-press-quick-add-page-inline {
15
- display: inline-block;
16
- vertical-align: top;
17
- margin: 0 !important;
18
- }
19
-
20
- .learn-press-quick-add-page-inline > * {
21
- vertical-align: top;
22
- }
23
-
24
- .post-type-lp_course .column-price {
25
- width: 10%;
26
- }
27
-
28
- /* message box */
29
- #learn-press-message-box-block {
30
- position: fixed;
31
- top: 0;
32
- left: 0;
33
- right: 0;
34
- bottom: 0;
35
- background-color: #000;
36
- z-index: 99999;
37
- opacity: 0.8;
38
- }
39
-
40
- #learn-press-message-box-window {
41
- position: fixed;
42
- top: 0;
43
- bottom: 0;
44
- left: 0;
45
- right: 0;
46
- z-index: 100000;
47
- color: #FFF;
48
- text-align: center;
49
- }
50
-
51
- #message-box-wrap {
52
- margin: 0 auto;
53
- /* text-align: center; */
54
- display: inline-block;
55
- text-align: left;
56
- max-width: 70%;
57
- }
58
-
59
- .message-box-title {
60
- color: #FFF;
61
- margin: 0 0 40px 0;
62
- font-size: 34px;
63
- }
64
-
65
- .message-box-content {
66
- font-size: 16px;
67
- line-height: 1.5;
68
- }
69
-
70
- .message-box-animation {
71
- background-image: url("../../images/animation.gif");
72
- width: 220px;
73
- height: 20px;
74
- margin: 20px 0 0;
75
- }
76
-
77
- .message-box-buttons {
78
- margin: 20px 0 0;
79
- border-top: 1px solid #929292;
80
- padding-top: 20px;
81
- }
82
-
83
- .message-box-button {
84
- margin-right: 10px !important;
85
- }
86
-
87
- .post-type-lp_lesson .column-format .lp-label {
88
- font-size: 100%;
89
- }
90
-
91
- /*********************************/
92
- .hide {
93
- display: none;
94
- }
95
-
96
- .handle.dashicons {
97
- cursor: move;
98
- margin-right: 10px;
99
- }
100
-
101
- .meta_box_remove .dashicons {
102
- text-decoration: initial;
103
- }
104
-
105
- .meta_box_course_lesson_quiz li input,
106
- .meta_box_course_lesson_quiz li select {
107
- min-width: 250px;
108
- }
109
-
110
- .rwmb-meta-box label {
111
- color: #222;
112
- font-weight: bold;
113
- display: block;
114
- margin: 16px 0;
115
- }
116
-
117
- .description {
118
- margin-top: 5px;
119
- }
120
-
121
- .dashed-placeholder {
122
- border: 2px dashed #999;
123
- padding: 10px;
124
- }
125
-
126
- .learn-press-admin-notice-dismiss:before {
127
- font-family: dashicons;
128
- content: '\f335';
129
- width: 20px;
130
- height: 20px;
131
- display: inline-block;
132
- background-color: #FFFFFF;
133
- border-radius: 50%;
134
- line-height: 20px;
135
- text-align: center;
136
- box-shadow: 0px 0px 1px 1px #F1F1F1;
137
- font-size: 18px;
138
- vertical-align: middle;
139
- float: right;
140
- }
141
-
142
- /**
143
- * Course Metabox
144
- */
145
- li.quiz, li.lesson, li.quick_lesson, li.quick_quiz {
146
- margin-left: 30px;
147
- }
148
-
149
- .wp-core-ui .meta_box_add_section,
150
- .wp-core-ui .meta_box_add_lesson,
151
- .wp-core-ui .meta_box_add_quiz,
152
- .wp-core-ui .meta_box_quick_add_lesson,
153
- .wp-core-ui .meta_box_quick_add_quiz {
154
- margin-right: 10px;
155
- }
156
-
157
- .column-taxonomy-course_category {
158
- width: 15%;
159
- }
160
-
161
- /**/
162
- #lpr-block {
163
- position: fixed;
164
- top: 0;
165
- left: 0;
166
- right: 0;
167
- bottom: 0;
168
- background-color: #000;
169
- display: none;
170
- z-index: 200;
171
- opacity: 0.2;
172
- }
173
-
174
- .lpr-quick-add-form {
175
- background-color: #FFF;
176
- padding: 5px;
177
- position: absolute;
178
- z-index: 210;
179
- border: 1px solid #DDD;
180
- }
181
-
182
- .lpr-quick-add-form input {
183
- font-size: 15px;
184
- border-radius: 3px;
185
- border: 1px solid #DDD;
186
- width: 350px;
187
- }
188
-
189
- .lpr-quick-add-form input,
190
- .lpr-quick-add-form select {
191
- vertical-align: top;
192
- }
193
-
194
- .lpr-quick-add-form .lpr-ajaxload {
195
- display: none;
196
- background: url(../../images/spinner.gif) no-repeat center;
197
- width: 30px;
198
- color: #FFF;
199
- margin-top: 6px;
200
- }
201
-
202
- .lpr-quick-add-form.working .lpr-ajaxload {
203
- display: inline-block;
204
- }
205
-
206
- .lpr-quick-add-form.working button {
207
- display: none;
208
- }
209
-
210
- .post-type-lpr_question .lpr-question-option-label {
211
- display: none;
212
- }
213
-
214
- #lpr-question-options-wrap {
215
- margin-top: 8px;
216
- }
217
-
218
- .lpr-question tr.lpr-disabled .dashicons-trash,
219
- .lpr-question tr.lpr-disabled .dashicons-sort {
220
- display: none;
221
- }
222
-
223
- /*
224
- * Add on page
225
- */
226
-
227
- .lpr-add-ons-wrapper .add-on-info {
228
- width: 65%;
229
- display: inline-block;
230
- }
231
-
232
- .lpr-add-ons-wrapper .add-on-action {
233
- float: right;
234
- }
235
-
236
- .lpr-add-ons-wrapper .add-on-action a {
237
- text-decoration: none;
238
- padding: 20px;
239
- height: 80px;
240
- width: 100px;
241
- background: #EBEBEB;
242
- margin-right: 100px;
243
- }
244
-
245
- .lpr-add-ons-wrapper .add-on-action .add-on-enabled {
246
- text-align: center;
247
- margin: 40px;
248
- }
249
-
250
- .lpr-add-ons-wrapper .add-on-action .add-on-disabled {
251
- text-align: center;
252
- margin: 40px;
253
- }
254
-
255
- .lpr-add-ons-wrapper .add-on-action a:hover {
256
- text-decoration: none;
257
- content: attr(data-text-disable);
258
- }
259
-
260
- .learn-press-add-ons {
261
- margin: 20px 0 0;
262
- }
263
-
264
- .learn-press-add-ons:after {
265
- display: block;
266
- clear: both;
267
- content: '';
268
- }
269
-
270
- .learn-press-add-ons > li {
271
- /*float: left;*/
272
- /*width: 25%;*/
273
- /*position: relative;*/
274
- }
275
-
276
- .learn-press-add-ons > li .add-on-inner {
277
- margin: 0 20px 40px 20px;
278
- border: 1px solid #DDD;
279
- border-radius: 10px;
280
- overflow: hidden;
281
- }
282
-
283
- .learn-press-add-ons > li .add-on-thumbnail {
284
- position: relative;
285
- overflow: hidden;
286
- border-bottom: 1px solid #E3E3E3;
287
- }
288
-
289
- .learn-press-add-ons > li .add-on-thumbnail img {
290
- width: 100%;
291
- height: auto;
292
- vertical-align: top;
293
- }
294
-
295
- .learn-press-add-ons > li .add-on-thumbnail .add-on-overlay {
296
- position: absolute;
297
- left: 0;
298
- right: 0;
299
- height: 100%;
300
- top: 0;
301
- -webkit-transition: all 0.25s;
302
- background-color: #ADE6FF;
303
- opacity: 0;
304
- }
305
-
306
- .learn-press-add-ons > li .add-on-thumbnail .add-on-description {
307
- position: absolute;
308
- left: 20px;
309
- right: 20px;
310
- bottom: 0;
311
- -webkit-transition: all 0.25s;
312
- color: #444;
313
- opacity: 0;
314
- }
315
-
316
- .learn-press-add-ons > li:hover .add-on-overlay {
317
- opacity: 0.3;
318
- }
319
-
320
- .learn-press-add-ons > li:hover .add-on-description {
321
- opacity: 1;
322
- }
323
-
324
- .learn-press-add-ons > li .add-on-info {
325
- min-height: 80px;
326
- padding: 20px;
327
- background-color: #F5F5F5;
328
- border-top: 1px solid #FFF;
329
- }
330
-
331
- .learn-press-add-ons > li .add-on-info > h3 {
332
- margin-top: 0;
333
- }
334
-
335
- .learn-press-add-ons > li .add-on-actions {
336
- position: absolute;
337
- bottom: 43px;
338
- }
339
-
340
- .learn-press-add-ons > li .add-on-actions .add-on-state {
341
- font-size: 36px;
342
- vertical-align: top;
343
- display: none;
344
- margin-top: -8px;
345
- color: #05B3FF;
346
- margin-left: -9px;
347
- }
348
-
349
- .learn-press-add-ons > li .add-on-actions .add-on-state.change {
350
- display: inline-block;
351
- }
352
-
353
- .learn-press-add-ons .plugin-card-top {
354
- min-height: 180px;
355
- }
356
-
357
- .learn-press-add-ons .button.spinner {
358
- background: url(../../images/spinner.gif) no-repeat 4px !important;
359
- padding-left: 30px;
360
- visibility: visible;
361
- width: auto;
362
- }
363
-
364
- .learn-press-add-ons .action-links > span {
365
- display: block;
366
- text-align: right;
367
- font-style: italic;
368
- }
369
-
370
- .learn-press-add-ons .action-links > span.enabled {
371
- color: #7ad03a;
372
- }
373
-
374
- .learn-press-add-ons .action-links > span.disabled {
375
- color: #FF0000;
376
- }
377
-
378
- .learn-press-add-ons .plugin-icon img {
379
- max-width: 100%;
380
- }
381
-
382
- #learn-press-bundle-activate-add-ons.spinner {
383
- float: left !important;
384
- }
385
-
386
- .learn-press-add-ons .plugin-version {
387
- font-weight: bold;
388
- }
389
-
390
- #learn-press-add-ons-wrap #name {
391
- width: 30%;
392
- }
393
-
394
- @media (max-width: 1280px) {
395
- .learn-press-add-ons > li {
396
- width: 33.33%;
397
- }
398
- }
399
-
400
- @media (max-width: 768px) {
401
- .learn-press-add-ons > li {
402
- width: 50%;
403
- }
404
- }
405
-
406
- @media (max-width: 480px) {
407
- .learn-press-add-ons > li {
408
- width: 100%;
409
- }
410
- }
411
-
412
- /**/
413
-
414
- #lpr-quiz-questions-wrap .select2-container .select2-choice {
415
- height: 29px;
416
- padding-top: 3px;
417
- font-size: 14px;
418
- }
419
-
420
- .post-title.column-title {
421
- overflow: visible;
422
- }
423
-
424
- .lpr-row-actions {
425
- display: inline-block;
426
- position: relative;
427
- }
428
-
429
- .lpr-row-action-dropdown {
430
- position: absolute;
431
- top: 100%;
432
- left: 0;
433
- min-width: 150px;
434
- background-color: #FFF;
435
- border: 1px solid #DDD;
436
- padding: 0;
437
- margin: 0;
438
- display: none;
439
- }
440
-
441
- .lpr-row-action-dropdown > li {
442
- margin: 0;
443
- }
444
-
445
- .lpr-row-action-dropdown > li > a {
446
- display: block;
447
- padding: 5px;
448
- }
449
-
450
- .lpr-row-actions > a {
451
- padding-right: 15px;
452
- position: relative;
453
- }
454
-
455
- .lpr-row-actions > a:after {
456
- width: 0;
457
- height: 0;
458
- border: 5px solid transparent;
459
- border-top-color: #DDD;
460
- content: '';
461
- display: inline-block;
462
- position: absolute;
463
- right: 0;
464
- top: 6px;
465
- }
466
-
467
- .lpr-row-actions:hover > ul {
468
- display: block;
469
- }
470
-
471
- /* addons page */
472
- #lpr-add-ons-wrapper {
473
- }
474
-
475
- #lpr-add-ons-wrapper .lpr-add-on-block {
476
- border-bottom: 1px dashed #DDD;
477
- padding-bottom: 20px;
478
- width: 50%;
479
- float: left;
480
- margin-top: 20px;
481
- }
482
-
483
- #lpr-add-ons-wrapper .lpr-add-on-block:after {
484
- content: '';
485
- display: block;
486
- clear: both;
487
- }
488
-
489
- #lpr-add-ons-wrapper .lpr-admin-thumbnail {
490
- float: left;
491
- width: 200px;
492
- }
493
-
494
- #lpr-add-ons-wrapper .lpr-admin-thumbnail img {
495
- vertical-align: top;
496
- }
497
-
498
- #lpr-add-ons-wrapper .lpr-add-on-info {
499
- margin-left: 220px;
500
- margin-right: 20px;
501
- }
502
-
503
- #lpr-add-ons-wrapper .lpr-add-on-info > h3 {
504
- margin-top: 0;
505
- }
506
-
507
- #lpr-add-ons-wrapper .lpr-add-on-info > h3 > span {
508
- display: inline-block;
509
- padding: 0 5px;
510
- background-color: #7AD3FA;
511
- color: #FFF;
512
- border-radius: 3px;
513
- margin-left: 10px;
514
- font-size: 12px;
515
- vertical-align: top;
516
- font-weight: normal;
517
- }
518
-
519
- #lpr-add-ons-wrapper .lpr-add-on-action {
520
- float: right;
521
- width: 100px;
522
- }
523
-
524
- /* toggle */
525
- input.lpr-fancy-checkbox {
526
- display: none;
527
- }
528
-
529
- .lpr-fancy-checkbox.tog {
530
- border-radius: 20px;
531
- box-shadow: inset 0 0 4px rgba(0, 0, 0, .6);
532
- margin: 0 auto;
533
- height: 19px;
534
- width: 50px;
535
- position: relative;
536
- cursor: pointer;
537
- font: 11px/18px arial;
538
- background: #ccc;
539
- -webkit-transition: all .2s ease;
540
- -moz-transition: all .2s ease;
541
- -o-transition: all .2s ease;
542
- transition: all .2s ease;
543
- display: inline-block !important;
544
- }
545
-
546
- .lpr-fancy-checkbox.tog:after {
547
- content: '';
548
- box-shadow: 0 2px 2px rgba(0, 0, 0, .6);
549
- border-radius: 20px;
550
- display: block;
551
- height: 15px;
552
- width: 15px;
553
- background: #fff;
554
- position: absolute;
555
- top: 2px;
556
- left: 2px;
557
- -webkit-transition: all .2s ease;
558
- -moz-transition: all .2s ease;
559
- -o-transition: all .2s ease;
560
- transition: all .2s ease;
561
- }
562
-
563
- .lpr-fancy-checkbox.tog:before {
564
- content: 'OFF';
565
- position: absolute;
566
- right: 7px;
567
- top: 1px;
568
- color: #fff;
569
- }
570
-
571
- .lpr-fancy-checkbox.tog:hover:after {
572
- left: 5px;
573
- }
574
-
575
- .lpr-fancy-checkbox.tog.on:before {
576
- content: 'ON';
577
- right: 28px;
578
- }
579
-
580
- .lpr-fancy-checkbox.tog.on {
581
- background: #05B3FF;
582
- }
583
-
584
- .lpr-fancy-checkbox.tog.on:after {
585
- left: 33px;
586
- }
587
-
588
- .lpr-fancy-checkbox.tog.on:hover:after {
589
- left: 30px;
590
- }
591
-
592
- /**/
593
- .clearfix:after {
594
- display: block;
595
- content: '';
596
- clear: both;
597
- }
598
-
599
- .clear {
600
- display: block;
601
- clear: both;
602
- height: 0;
603
- }
604
-
605
- /**********************************************************************/
606
- /**********************************************************************/
607
-
608
- .lp-list-options {
609
- border: 1px solid #DDD;
610
- border-collapse: collapse;
611
- width: 100%;
612
- }
613
-
614
- .lp-list-option {
615
-
616
- }
617
-
618
- .lp-list-option.lp-list-option-empty td,
619
- .lp-list-option.lp-list-option-empty th {
620
- background-color: #FBE9E9;
621
- }
622
-
623
- .lp-list-option.lp-list-option-empty .lp-answer-check input,
624
- .lp-list-option.lp-list-option-empty .lp-list-option-actions i {
625
- display: none;
626
- }
627
-
628
- .lp-list-option .clm {
629
-
630
- }
631
-
632
- .lp-list-option .lp-item-checkbox {
633
- }
634
-
635
- .lp-list-option .lp-item-name {
636
- }
637
-
638
- .lp-list-option .lp-item-actions {
639
- }
640
-
641
- .lp-list-options thead th {
642
- border: 1px solid #FFF;
643
- background-color: #EAEAEA;
644
- padding: 10px;
645
- text-align: left;
646
-
647
- color: #00A0D2;
648
-
649
- }
650
-
651
- .lp-list-options tbody th,
652
- .lp-list-options tbody td {
653
- border: 1px solid #FFF;
654
- padding: 10px 10px;
655
- text-align: left;
656
- background-color: #F5F5F5;
657
- }
658
-
659
- .lp-list-options .lp-answer-check {
660
- width: 100px;
661
- }
662
-
663
- .lp-list-options tbody th input[type="text"],
664
- .lp-list-options tbody td input[type="text"] {
665
- width: 100%;
666
- }
667
-
668
- .lp-list-options .ui-sortable-placeholder {
669
- visibility: visible !important;
670
- }
671
-
672
- .lp-list-options .ui-sortable-placeholder td {
673
- background-image: url("../../images/stripe.png");
674
- }
675
-
676
- .lp-list-option .lp-answer-text {
677
- color: #777;
678
- background-color: transparent;
679
- border-color: transparent;
680
- box-shadow: none;
681
- }
682
-
683
- .lp-list-option .lp-answer-text:after {
684
- font-family: dashicons;
685
- content: '\f464';
686
- }
687
-
688
- .lp-list-option .lp-answer-text:focus,
689
- .lp-list-option:hover .lp-answer-text {
690
- box-shadow: none;
691
- outline: none;
692
- background-color: transparent;
693
- border-color: transparent;
694
- }
695
-
696
- .lp-list-option:hover .lp-answer-text {
697
- border-style: dashed;
698
- }
699
-
700
- .lp-list-option-actions {
701
- cursor: pointer;
702
- color: #00A0D2;
703
- }
704
-
705
- .lp-list-option-actions.lp-move-list-option {
706
- cursor: move;
707
- }
708
-
709
- .lp-list-option-actions:hover {
710
- color: #156077;
711
- }
712
-
713
- /* Question meta box */
714
- #question_answer .rwmb-question-wrapper {
715
- margin: 12px 0 0 0;
716
- }
717
-
718
- .question-bottom-actions > * {
719
- vertical-align: baseline !important;
720
- }
721
-
722
- /* Quiz meta box */
723
- body.post-type-lp_quiz #questions,
724
- body.post-type-lp_question #question_answer_ {
725
- border: none;
726
- box-shadow: none;
727
- background-color: transparent;
728
- }
729
-
730
- body.post-type-lp_quiz #questions .handlediv,
731
- body.post-type-lp_question #question_answer_ .handlediv {
732
- display: none;
733
- }
734
-
735
- body.post-type-lp_quiz #questions .hndle,
736
- body.post-type-lp_question #question_answer_ .hndle {
737
- display: none;
738
- }
739
-
740
- body.post-type-lp_quiz #questions .inside,
741
- body.post-type-lp_question #question_answer_ .inside {
742
- padding: 0;
743
- }
744
-
745
- #questions .quiz-questions-heading {
746
- margin: 0;
747
- padding: 20px;
748
- background-color: #FFF;
749
- line-height: 1;
750
- border: 1px solid #DDD;
751
- }
752
-
753
- #questions .quiz-questions-heading .questions-toggle {
754
- float: right;
755
- margin: 0;
756
- line-height: 1;
757
- }
758
-
759
- #questions .quiz-questions-heading .questions-toggle a {
760
- color: #DDD;
761
- box-shadow: none;
762
- }
763
-
764
- #questions .quiz-questions-heading .questions-toggle a:hover {
765
- color: #00a0d2;
766
- }
767
-
768
- #questions #learn-press-dropdown-questions {
769
- display: inline-block;
770
- position: relative;
771
- }
772
-
773
- #questions #learn-press-dropdown-questions > ul {
774
- position: absolute;
775
- top: 100%;
776
- margin: 0;
777
- padding: 0;
778
- background-color: #FFF;
779
- left: 0;
780
- right: 0;
781
- border: 1px solid #EEE;
782
- border-top: none;
783
- display: none;
784
- z-index: 50;
785
- }
786
-
787
- #questions #learn-press-dropdown-questions > ul > li {
788
- margin: 0;
789
- }
790
-
791
- #questions #learn-press-dropdown-questions > ul li > a {
792
- display: block;
793
- padding: 5px;
794
- outline: none;
795
- box-shadow: none;
796
- }
797
-
798
- #questions #learn-press-question-name {
799
- font-size: 18px;
800
- min-width: 350px;
801
- margin: 0;
802
- box-shadow: none;
803
- border-color: #EEE;
804
- color: #BBB;
805
- vertical-align: middle;
806
- }
807
-
808
- #questions #learn-press-toggle-questions {
809
- height: 32px;
810
- vertical-align: top;
811
- background-color: #FFF;
812
- border: 1px solid #EEE;
813
- width: 32px;
814
- margin-left: -4px;
815
- text-align: center;
816
- font-size: 30px;
817
- padding: 0;
818
- color: #CCC;
819
- border-left: none;
820
- outline: none;
821
- cursor: pointer;
822
- }
823
-
824
- #questions #learn-press-toggle-questions:hover {
825
- color: #AAAAAA;
826
- }
827
-
828
- #questions #learn-press-button-add-question {
829
- _vertical-align: middle;
830
- }
831
-
832
- #questions input[name="lp-new-question-name"] {
833
-
834
- }
835
-
836
- #questions .question-actions {
837
- background-color: #FFF;
838
- border: 1px solid #DDD;
839
- padding: 10px;
840
- display: inline-block;
841
- margin-top: 20px;
842
- position: relative;
843
- z-index: 999;
844
- }
845
-
846
- #questions .quiz-question {
847
- margin: -1px 0 0 0;
848
- }
849
-
850
- #questions .quiz-question .learn-press-question {
851
- padding: 20px 20px 5px 20px;
852
- background-color: #FFF;
853
- border: 1px solid #DDD;
854
- border-top: none;
855
- }
856
-
857
- #questions .quiz-question-head {
858
- padding: 10px 20px;
859
- border: 1px solid #DDD;
860
- background-color: #F5F5F5;
861
- position: relative;
862
- }
863
-
864
- #questions .quiz-question.is-hidden .quiz-question-head,
865
- #questions .quiz-question.is-hidden .question-name {
866
- background-color: #FFF;
867
- }
868
-
869
- #questions .quiz-question-head .quiz-question-actions {
870
- float: right;
871
- margin: 1px 0;
872
- visibility: hidden;
873
- padding-top: 2px;
874
- }
875
-
876
- #questions .quiz-question-head .quiz-question-actions a {
877
- margin: 0 3px;
878
- color: #DDD;
879
- vertical-align: middle;
880
- box-shadow: none;
881
- }
882
-
883
- #questions .quiz-question-head .quiz-question-actions a:hover {
884
- color: #00a0d2;
885
- }
886
-
887
- #questions .quiz-question-head .quiz-question-actions a.move {
888
- cursor: url("../../images/openhand.cur") 7 5, default;
889
- position: absolute;
890
- right: 0;
891
- height: 50px;
892
- top: 0;
893
- background: url("../../images/grippy_large.png") left no-repeat;
894
- width: 12px;
895
- }
896
-
897
- #questions .quiz-question-head:hover .quiz-question-actions {
898
- visibility: visible;
899
- }
900
-
901
- #questions .quiz-question.ui-sortable-placeholder {
902
- visibility: visible !important;
903
- background-image: url("../../images/stripe.png");
904
- border: 1px solid #DDD;
905
- border-bottom: none;
906
- }
907
-
908
- #questions .question-name {
909
- border: none;
910
- box-shadow: none;
911
- padding-left: 0;
912
- width: 70%;
913
- font-weight: bold;
914
- color: #777;
915
- vertical-align: middle;
916
- background-color: #F5F5F5;
917
- }
918
-
919
- #questions .quiz-question-icon {
920
- display: inline-block;
921
- width: 25px;
922
- height: 25px;
923
- vertical-align: middle;
924
- margin-right: 10px;
925
- }
926
-
927
- #questions .quiz-question-icon img {
928
- max-width: 100%;
929
- height: auto;
930
- }
931
-
932
- #questions #learn-press-dropdown-questions .added {
933
- display: none;
934
- }
935
-
936
- .lpr-curriculum-section > h3 {
937
- padding: 0 !important;
938
- }
939
-
940
- .lpr-curriculum-section > h3 .lpr-action {
941
- top: 0;
942
- right: 0;
943
- }
944
-
945
- .lpr-curriculum-section.lpr-empty > h3 {
946
- cursor: default !important;
947
- }
948
-
949
- .lpr-curriculum-section.lpr-empty .lpr-action {
950
- display: none !important;
951
- }
952
-
953
- .lpr-course-curriculum button span {
954
- text-decoration: underline;
955
- }
956
-
957
- #learn-press-statistic {
958
- margin-top: 20px;
959
- }
960
-
961
- .learn-press-chart {
962
- position: relative;
963
- }
964
-
965
- .learn-press-chart canvas {
966
- height: 70vh;
967
- width: 100vw;
968
- }
969
-
970
- .chart-buttons form {
971
- display: inline-block;
972
- vertical-align: top;
973
- }
974
-
975
- .chart-buttons form input[type="text"] {
976
- width: 105px;
977
- font-size: 14px;
978
- vertical-align: top;
979
- margin: 0;
980
- text-align: center;
981
- font-weight: bold;
982
- padding: 4px;
983
- }
984
-
985
- .chart-buttons form span {
986
- display: inline-block;
987
- vertical-align: middle;
988
- font-weight: bold;
989
- padding: 5px;
990
- }
991
-
992
- .learn-press-chart.loading:after {
993
- content: '';
994
- position: absolute;
995
- top: 0;
996
- left: 0;
997
- right: 0;
998
- bottom: 0;
999
- z-index: 10;
1000
- background: #FFF;
1001
- opacity: 0.5;
1002
- }
1003
-
1004
- .chart-description {
1005
-
1006
- }
1007
-
1008
- .chart-description li {
1009
- display: inline-block;
1010
- margin-right: 15px;
1011
- }
1012
-
1013
- .chart-description li:before {
1014
- content: '';
1015
- display: inline-block;
1016
- width: 10px;
1017
- height: 10px;
1018
- vertical-align: middle;
1019
- margin-right: 5px;
1020
- }
1021
-
1022
- .chart-description li span {
1023
- display: inline-block;
1024
- vertical-align: middle;
1025
- font-weight: bold;
1026
- }
1027
-
1028
- .chart-description li.all:before {
1029
- background: #2FA7FF;
1030
- }
1031
-
1032
- .chart-description li.instructors:before {
1033
- background: #EAC79B;
1034
- }
1035
-
1036
- .chart-description li.students:before {
1037
- background: #D4D0CB;
1038
- }
1039
-
1040
- .lpr-stats-time {
1041
- text-align: center;
1042
- }
1043
-
1044
- .lpr-hidden {
1045
- display: none;
1046
- }
1047
-
1048
- #lpr-custom-time {
1049
- position: relative;
1050
- top: 4px;
1051
- }
1052
-
1053
- /* block page */
1054
- #lpr-page-block {
1055
- position: fixed;
1056
- top: 0;
1057
- left: 0;
1058
- right: 0;
1059
- bottom: 0;
1060
- background-color: #000;
1061
- opacity: 0.5;
1062
- display: none;
1063
- z-index: 9999;
1064
- }
1065
-
1066
- #form-quick-add-lesson-link {
1067
- position: absolute;
1068
- }
1069
-
1070
- #_lpr_course_price_description > span {
1071
- font-weight: bold;
1072
- font-size: 15px;
1073
- }
1074
-
1075
- .lpr-ignore, .lpr-ignore:hover {
1076
- color: #dd3d36;
1077
- }
1078
-
1079
- .lpr-ignore:hover {
1080
- cursor: pointer;
1081
- }
1082
-
1083
- .lpr-quick-add-page-inline,
1084
- .lpr-quick-actions-inline {
1085
- display: inline-block;
1086
- vertical-align: middle;
1087
- margin: 0 !important;
1088
- }
1089
-
1090
- #lpr-toggle-quiz-mode {
1091
- background-color: #0077FF;
1092
- padding: 3px;
1093
- margin-left: 5px;
1094
- display: inline-block;
1095
- border-radius: 3px;
1096
- text-decoration: none;
1097
- color: #FFF;
1098
- }
1099
-
1100
- .column-num_of_question {
1101
- width: 150px;
1102
- }
1103
-
1104
- .lp-search-items input[name="lp-item-name"] {
1105
- width: 500px;
1106
- }
1107
-
1108
- .lp-button-dropdown {
1109
- padding-left: 0 !important;
1110
- padding-right: 28px !important;
1111
- position: relative;
1112
- z-index: 99998;
1113
- }
1114
-
1115
- .lp-button-dropdown .lp-dropdown-label {
1116
- padding-left: 10px;
1117
- }
1118
-
1119
- .lp-button-dropdown .lp-dropdown-arrow {
1120
- display: inline-block;
1121
- /* width: 20px; */
1122
- text-align: center;
1123
- padding: 0 10px;
1124
- position: absolute;
1125
- top: -1px;
1126
- bottom: -1px;
1127
- }
1128
-
1129
- .lp-button-dropdown .lp-dropdown-items {
1130
- position: absolute;
1131
- margin: 0;
1132
- /* width: 100%; */
1133
- background-color: #FFF;
1134
- top: 100%;
1135
- margin-top: 1px;
1136
- border: 1px solid #DDD;
1137
- right: -1px;
1138
- /* right: -1px; */
1139
- width: 200px;
1140
- z-index: 9999999;
1141
- display: none;
1142
- }
1143
-
1144
- .lp-button-dropdown .lp-dropdown-items li {
1145
- margin: 0;
1146
- }
1147
-
1148
- .lp-button-dropdown .lp-dropdown-items li a {
1149
- display: block;
1150
- padding: 10px;
1151
- line-height: 1;
1152
- text-decoration: none;
1153
- outline: none;
1154
- box-shadow: none;
1155
- }
1156
-
1157
- .lp-button-dropdown .lp-dropdown-items li a:hover {
1158
- background-color: #F5F5F5;
1159
- }
1160
-
1161
- .lp-button-dropdown:not(.disabled) .lp-dropdown-arrow:hover + ul,
1162
- .lp-button-dropdown:not(.disabled) ul:hover {
1163
- display: block;
1164
- }
1165
-
1166
- .curriculum-section.lp-empty-section {
1167
- }
1168
-
1169
- .curriculum-section .lp-check-items,
1170
- .curriculum-section .lp-check-items:hover {
1171
- padding-left: 5px;
1172
- padding-right: 12px;
1173
- border-color: transparent;
1174
- background: transparent;
1175
- box-shadow: none;
1176
- }
1177
-
1178
- .column-format,
1179
- .column-is_previewable,
1180
- .column-taxonomy-question-tag {
1181
- width: 10%;
1182
- }
1183
-
1184
- .learn-press-add-ons .plugin-card .install-now:before,
1185
- .learn-press-add-ons .plugin-card .disable-now:before,
1186
- .learn-press-add-ons .plugin-card .enable-now:before {
1187
- margin: 3px 5px 0 -2px;
1188
- display: inline-block;
1189
- font: 400 20px/1 dashicons;
1190
- /*speak: none;*/
1191
- -webkit-font-smoothing: antialiased;
1192
- -moz-osx-font-smoothing: grayscale;
1193
- vertical-align: top;
1194
- }
1195
-
1196
- .learn-press-add-ons .plugin-card .install-now:before {
1197
- content: '\f106';
1198
- color: #0073aa;
1199
- }
1200
-
1201
- .learn-press-add-ons .plugin-card .disable-now:before {
1202
- content: '\f147';
1203
- color: #0073aa;
1204
- }
1205
-
1206
- .learn-press-add-ons .plugin-card .enable-now:before {
1207
- content: '\f335';
1208
- color: #d54e21;
1209
- }
1210
-
1211
- .learn-press-add-ons .plugin-card .disable-now:hover:before {
1212
- content: '\f335';
1213
- color: #d54e21;
1214
- }
1215
-
1216
- .learn-press-add-ons .plugin-card .enable-now:hover:before {
1217
- content: '\f147';
1218
- color: #0073aa;
1219
- }
1220
-
1221
- .learn-press-add-ons .plugin-card .button-working:before {
1222
- content: '\f463' !important;
1223
- -webkit-animation: lp-spinner 2s infinite linear;
1224
- animation: lp-spinner 2s infinite linear;
1225
- margin-right: 0;
1226
- }
1227
-
1228
- .learn-press-add-ons .plugin-card .button-working span {
1229
- display: none;
1230
- }
1231
-
1232
- .lp-button-actions a {
1233
- text-decoration: none;
1234
- margin-left: 5px;
1235
- }
1236
-
1237
- .learn-press-quick-confirm {
1238
- position: absolute;
1239
- z-index: 9999;
1240
- color: rgb(255, 255, 255);
1241
- padding: 2px 8px;
1242
- display: block;
1243
- white-space: nowrap;
1244
- left: -39.625px;
1245
- top: 24px;
1246
- background-color: #C90202;
1247
- cursor: pointer;
1248
- }
1249
-
1250
- .learn-press-quick-confirm:hover,
1251
- .learn-press-quick-confirm:hover:before {
1252
- background-color: #d73b00;
1253
- }
1254
-
1255
- .learn-press-quick-confirm:before {
1256
- content: '';
1257
- display: block;
1258
- position: absolute;
1259
- /* border: 1px solid; */
1260
- transform: rotate(45deg);
1261
- width: 7px;
1262
- height: 7px;
1263
- top: -3px;
1264
- background-color: #C90202;
1265
- right: 7px;
1266
- }
1267
-
1268
- /* course */
1269
- .wp-core-ui .meta_box_add_section,
1270
- .wp-core-ui .meta_box_add_lesson {
1271
- margin-right: 10px;
1272
- }
1273
-
1274
- .hide {
1275
- display: none;
1276
- }
1277
-
1278
- .handle.dashicons {
1279
- cursor: move;
1280
- margin-right: 0;
1281
- }
1282
-
1283
- .meta_box_remove .dashicons {
1284
- text-decoration: initial;
1285
- }
1286
-
1287
- .meta_box_course_lesson_quiz li input,
1288
- .meta_box_course_lesson_quiz li select {
1289
- min-width: 250px;
1290
- }
1291
-
1292
- .rwmb-meta-box label {
1293
- color: #222;
1294
- font-weight: bold;
1295
- display: block;
1296
- margin: 16px 0;
1297
- }
1298
-
1299
- .description {
1300
- margin-top: 5px;
1301
- }
1302
-
1303
- .dashed-placeholder {
1304
- border: 2px dashed #999;
1305
- padding: 10px;
1306
- }
1307
-
1308
- /*
1309
- TuNN added 21 03 2015
1310
- Modified 03 Apr 2015
1311
- */
1312
- /* Course Curriculumn meta box section*/
1313
-
1314
- /************ version 1.0 **************/
1315
-
1316
- /* order */
1317
- .post-type-lp_order #post-body-content,
1318
- .post-type-lp_order #order_details .handlediv,
1319
- .post-type-lp_order #order_details .hndle {
1320
- display: none;
1321
- }
1322
-
1323
- .post-type-lp_order #submitpost .misc-pub-section label {
1324
- display: block;
1325
- font-weight: bold;
1326
- }
1327
-
1328
- #learn-press-order {
1329
- margin: 15px;
1330
- }
1331
-
1332
- #learn-press-order .order-data-number {
1333
- font-size: 36px;
1334
- padding: 0;
1335
- margin-bottom: 20px;
1336
- }
1337
-
1338
- #learn-press-order > h3 {
1339
- margin: 0 0 10px 0;
1340
- padding: 0;
1341
- }
1342
-
1343
- #learn-press-order .order-data-date,
1344
- #learn-press-order .order-data-status,
1345
- #learn-press-order .order-data-payment-method {
1346
- font-size: 18px;
1347
- padding: 0 0 10px 0;
1348
- }
1349
-
1350
- #learn-press-order .user-display-name,
1351
- #learn-press-order .user-email,
1352
- #learn-press-order .user-ip-address {
1353
- padding: 0;
1354
- margin: 0 0 10px 0;
1355
- }
1356
-
1357
- #learn-press-order .order-items table {
1358
- border: 1px solid #DDD;
1359
- border-collapse: collapse;
1360
- width: 100%;
1361
- }
1362
-
1363
- #learn-press-order .order-items table th,
1364
- #learn-press-order .order-items table td {
1365
- text-align: left;
1366
- padding: 10px 15px;
1367
- border: 1px solid #DDD;
1368
- }
1369
-
1370
- #learn-press-install-sample-data-notice .install-sample-data-loading {
1371
- display: none;
1372
- }
1373
-
1374
- /* ios checkbox */
1375
- .learn-press-checkbox {
1376
- display: none !important;
1377
- }
1378
-
1379
- .ios-ui-select {
1380
- background: #dddddd;
1381
- border: none !important;
1382
- height: 18px;
1383
- -webkit-border-radius: 9px;
1384
- border-radius: 9px;
1385
- width: 30px;
1386
- -webkit-transition: all 0.3s ease-in-out;
1387
- -moz-transition: all 0.3s ease-in-out;
1388
- -ms-transition: all 0.3s ease-in-out;
1389
- -o-transition: all 0.3s ease-in-out;
1390
- transition: all 0.3s ease-in-out;
1391
- -webkit-box-shadow: none;
1392
- box-shadow: none;
1393
- cursor: pointer;
1394
- position: relative;
1395
- display: inline-block;
1396
- }
1397
-
1398
- .ios-ui-select.checked {
1399
- -webkit-box-shadow: inset 0 0 0 18px #6ddc5f;
1400
- box-shadow: inset 0 0 0 18px #6ddc5f;
1401
- }
1402
-
1403
- .ios-ui-select.checked .inner {
1404
- left: 13px;
1405
- }
1406
-
1407
- .ios-ui-select .inner {
1408
- width: 16px;
1409
- height: 16px;
1410
- position: absolute;
1411
- top: 1px;
1412
- left: 1px;
1413
- -webkit-border-radius: 100%;
1414
- border-radius: 100%;
1415
- background: white;
1416
- -webkit-transition: all 350ms cubic-bezier(0, 0.89, 0.44, 1);
1417
- -moz-transition: all 350ms cubic-bezier(0, 0.89, 0.44, 1);
1418
- -o-transition: all 350ms cubic-bezier(0, 0.89, 0.44, 1);
1419
- transition: all 350ms cubic-bezier(0, 0.89, 0.44, 1);
1420
- -webkit-box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.2), 0 3px 4px 0 rgba(0, 0, 0, 0.1);
1421
- box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.2), 0 3px 4px 0 rgba(0, 0, 0, 0.1);
1422
- }
1423
-
1424
- .lp-label-counter {
1425
- display: inline-block;
1426
- /* padding: 5px; */
1427
- line-height: 1;
1428
- background-color: #0073AA;
1429
- border-radius: 10px;
1430
- height: 21px;
1431
- line-height: 20px;
1432
- text-align: center;
1433
- min-width: 21px;
1434
- color: #FFF;
1435
- padding: 0 5px;
1436
- }
1437
-
1438
- .column-num_of_question,
1439
- .column-duration {
1440
- width: 100px;
1441
- text-align: left;
1442
- }
1443
-
1444
- #learn-press-admin-settings .form-table th {
1445
- padding: 20px 10px 20px 0 !important;
1446
- }
1447
-
1448
- @-webkit-keyframes lp-spinner {
1449
- 0% {
1450
- -webkit-transform: rotate(0deg);
1451
- transform: rotate(0deg);
1452
- }
1453
- 100% {
1454
- -webkit-transform: rotate(359deg);
1455
- transform: rotate(359deg);
1456
- }
1457
- }
1458
-
1459
- @keyframes lp-spinner {
1460
- 0% {
1461
- -webkit-transform: rotate(0deg);
1462
- transform: rotate(0deg);
1463
- }
1464
- 100% {
1465
- -webkit-transform: rotate(359deg);
1466
- transform: rotate(359deg);
1467
- }
1468
- }
1
+ /**
2
+ * Define all styles for admin side
3
+ *
4
+ * @author ThimPress
5
+ * @version 1.0
6
+ */
7
+ .rwmb-number-wrapper .rwmb-input {
8
+ padding-top: 16px;
9
+ }
10
+ .lp-nav-tab-wrapper {
11
+ border-bottom: 1px solid #ccc;
12
+ margin: 0;
13
+ padding: 9px 15px 0 0;
14
+ line-height: inherit;
15
+ }
16
+ .learn-press-quick-add-page-inline {
17
+ display: inline-block;
18
+ vertical-align: top;
19
+ margin: 0 !important;
20
+ }
21
+ .learn-press-quick-add-page-inline > * {
22
+ vertical-align: top;
23
+ }
24
+ .post-type-lp_course .column-price,
25
+ .post-type-lp_course .column-students {
26
+ width: 10%;
27
+ }
28
+ .post-type-lp_course #course_curriculum .curriculum-section-items .lp-item-empty td.section-item-input {
29
+ padding-left: 40px;
30
+ }
31
+ .post-type-lp_course #course_curriculum .curriculum-section-items .lp-item-empty td.section-item-input.hover {
32
+ padding-left: 0;
33
+ }
34
+ #learn-press-admin-settings #learn_press_email_formats {
35
+ margin-bottom: 10px;
36
+ }
37
+ #learn-press-admin-settings .learn-press-email-variables {
38
+ margin-left: 0;
39
+ margin-top: 5px;
40
+ }
41
+ #learn-press-admin-settings .learn-press-email-variables li {
42
+ display: inline-block;
43
+ cursor: pointer;
44
+ }
45
+ #learn-press-admin-settings .learn-press-email-variables li:hover {
46
+ color: #0085ba;
47
+ }
48
+ #learn-press-admin-settings .nav-tab-wrapper {
49
+ margin-bottom: 20px;
50
+ }
51
+ #learn-press-admin-settings .subsubsub {
52
+ float: left;
53
+ width: 240px;
54
+ position: relative;
55
+ z-index: 10;
56
+ margin: 0 -260px 0 20px;
57
+ padding-top: 11px;
58
+ }
59
+ #learn-press-admin-settings .subsubsub li {
60
+ display: block;
61
+ }
62
+ #learn-press-admin-settings .subsubsub li a {
63
+ display: block;
64
+ outline: none;
65
+ box-shadow: none;
66
+ }
67
+ #learn-press-admin-settings .learn-press-settings-wrap {
68
+ float: left;
69
+ padding: 0 0 15px 300px;
70
+ background: #FFF;
71
+ z-index: 0;
72
+ position: relative;
73
+ width: 100%;
74
+ box-sizing: border-box;
75
+ }
76
+ #learn-press-admin-settings .learn-press-settings-wrap:before {
77
+ content: '';
78
+ position: absolute;
79
+ top: 0;
80
+ bottom: 0;
81
+ border-left: 1px solid #DDD;
82
+ margin-left: -30px;
83
+ }
84
+ #learn-press-admin-settings.no-subtabs .learn-press-settings-wrap {
85
+ float: none;
86
+ margin-left: 0;
87
+ padding-left: 25px;
88
+ }
89
+ #learn-press-admin-settings.no-subtabs .learn-press-settings-wrap:before {
90
+ display: none;
91
+ }
92
+ #learn-press-admin-settings.no-subtabs .subsubsub {
93
+ display: none;
94
+ }
95
+ #learn-press-admin-settings input[type="radio"] {
96
+ margin: 0 !important;
97
+ }
98
+ #learn-press-admin-settings label {
99
+ line-height: 1;
100
+ }
101
+ /* message box */
102
+ #learn-press-message-box-block {
103
+ position: fixed;
104
+ top: 0;
105
+ left: 0;
106
+ right: 0;
107
+ bottom: 0;
108
+ background-color: #000;
109
+ z-index: 99999;
110
+ opacity: 0.8;
111
+ }
112
+ #learn-press-message-box-window {
113
+ position: fixed;
114
+ top: 0;
115
+ bottom: 0;
116
+ left: 0;
117
+ right: 0;
118
+ z-index: 100000;
119
+ color: #FFF;
120
+ text-align: center;
121
+ }
122
+ #message-box-wrap {
123
+ margin: 0 auto;
124
+ /* text-align: center; */
125
+ display: inline-block;
126
+ text-align: left;
127
+ max-width: 70%;
128
+ }
129
+ .message-box-title {
130
+ color: #FFF;
131
+ margin: 0 0 40px 0;
132
+ font-size: 34px;
133
+ }
134
+ .message-box-content {
135
+ font-size: 16px;
136
+ line-height: 1.5;
137
+ }
138
+ .message-box-animation {
139
+ background-image: url("../../images/animation.gif");
140
+ width: 220px;
141
+ height: 20px;
142
+ margin: 20px 0 0;
143
+ }
144
+ .message-box-buttons {
145
+ margin: 20px 0 0;
146
+ border-top: 1px solid #929292;
147
+ padding-top: 20px;
148
+ }
149
+ .message-box-button {
150
+ margin-right: 10px !important;
151
+ }
152
+ .post-type-lp_lesson .column-format .lp-label {
153
+ font-size: 100%;
154
+ }
155
+ /*********************************/
156
+ .hide {
157
+ display: none;
158
+ }
159
+ .handle.dashicons {
160
+ cursor: move;
161
+ margin-right: 10px;
162
+ }
163
+ .meta_box_remove .dashicons {
164
+ text-decoration: initial;
165
+ }
166
+ .meta_box_course_lesson_quiz li input,
167
+ .meta_box_course_lesson_quiz li select {
168
+ min-width: 250px;
169
+ }
170
+ .rwmb-meta-box label {
171
+ color: #222;
172
+ font-weight: bold;
173
+ display: block;
174
+ margin: 16px 0;
175
+ }
176
+ .description {
177
+ margin-top: 5px;
178
+ }
179
+ .dashed-placeholder {
180
+ border: 2px dashed #999;
181
+ padding: 10px;
182
+ }
183
+ .learn-press-admin-notice-dismiss:before {
184
+ font-family: dashicons;
185
+ content: '\f335';
186
+ width: 20px;
187
+ height: 20px;
188
+ display: inline-block;
189
+ background-color: #FFFFFF;
190
+ border-radius: 50%;
191
+ line-height: 20px;
192
+ text-align: center;
193
+ box-shadow: 0px 0px 1px 1px #F1F1F1;
194
+ font-size: 18px;
195
+ vertical-align: middle;
196
+ float: right;
197
+ }
198
+ /**
199
+ * Course Metabox
200
+ */
201
+ li.quiz,
202
+ li.lesson,
203
+ li.quick_lesson,
204
+ li.quick_quiz {
205
+ margin-left: 30px;
206
+ }
207
+ .wp-core-ui .meta_box_add_section,
208
+ .wp-core-ui .meta_box_add_lesson,
209
+ .wp-core-ui .meta_box_add_quiz,
210
+ .wp-core-ui .meta_box_quick_add_lesson,
211
+ .wp-core-ui .meta_box_quick_add_quiz {
212
+ margin-right: 10px;
213
+ }
214
+ .column-taxonomy-course_category {
215
+ width: 15%;
216
+ }
217
+ /**/
218
+ #lpr-block {
219
+ position: fixed;
220
+ top: 0;
221
+ left: 0;
222
+ right: 0;
223
+ bottom: 0;
224
+ background-color: #000;
225
+ display: none;
226
+ z-index: 200;
227
+ opacity: 0.2;
228
+ }
229
+ .lpr-quick-add-form {
230
+ background-color: #FFF;
231
+ padding: 5px;
232
+ position: absolute;
233
+ z-index: 210;
234
+ border: 1px solid #DDD;
235
+ }
236
+ .lpr-quick-add-form input {
237
+ font-size: 15px;
238
+ border-radius: 3px;
239
+ border: 1px solid #DDD;
240
+ width: 350px;
241
+ }
242
+ .lpr-quick-add-form input,
243
+ .lpr-quick-add-form select {
244
+ vertical-align: top;
245
+ }
246
+ .lpr-quick-add-form .lpr-ajaxload {
247
+ display: none;
248
+ background: url(../../images/spinner.gif) no-repeat center;
249
+ width: 30px;
250
+ color: #FFF;
251
+ margin-top: 6px;
252
+ }
253
+ .lpr-quick-add-form.working .lpr-ajaxload {
254
+ display: inline-block;
255
+ }
256
+ .lpr-quick-add-form.working button {
257
+ display: none;
258
+ }
259
+ .post-type-lpr_question .lpr-question-option-label {
260
+ display: none;
261
+ }
262
+ #lpr-question-options-wrap {
263
+ margin-top: 8px;
264
+ }
265
+ .lpr-question tr.lpr-disabled .dashicons-trash,
266
+ .lpr-question tr.lpr-disabled .dashicons-sort {
267
+ display: none;
268
+ }
269
+ /*
270
+ * Add on page
271
+ */
272
+ .lpr-add-ons-wrapper .add-on-info {
273
+ width: 65%;
274
+ display: inline-block;
275
+ }
276
+ .lpr-add-ons-wrapper .add-on-action {
277
+ float: right;
278
+ }
279
+ .lpr-add-ons-wrapper .add-on-action a {
280
+ text-decoration: none;
281
+ padding: 20px;
282
+ height: 80px;
283
+ width: 100px;
284
+ background: #EBEBEB;
285
+ margin-right: 100px;
286
+ }
287
+ .lpr-add-ons-wrapper .add-on-action .add-on-enabled {
288
+ text-align: center;
289
+ margin: 40px;
290
+ }
291
+ .lpr-add-ons-wrapper .add-on-action .add-on-disabled {
292
+ text-align: center;
293
+ margin: 40px;
294
+ }
295
+ .lpr-add-ons-wrapper .add-on-action a:hover {
296
+ text-decoration: none;
297
+ content: attr(data-text-disable);
298
+ }
299
+ .learn-press-add-ons {
300
+ margin: 20px 0 0;
301
+ }
302
+ .learn-press-add-ons:after {
303
+ display: block;
304
+ clear: both;
305
+ content: '';
306
+ }
307
+ .learn-press-add-ons > li {
308
+ /*float: left;*/
309
+ /*width: 25%;*/
310
+ /*position: relative;*/
311
+ }
312
+ .learn-press-add-ons > li .add-on-inner {
313
+ margin: 0 20px 40px 20px;
314
+ border: 1px solid #DDD;
315
+ border-radius: 10px;
316
+ overflow: hidden;
317
+ }
318
+ .learn-press-add-ons > li .add-on-thumbnail {
319
+ position: relative;
320
+ overflow: hidden;
321
+ border-bottom: 1px solid #E3E3E3;
322
+ }
323
+ .learn-press-add-ons > li .add-on-thumbnail img {
324
+ width: 100%;
325
+ height: auto;
326
+ vertical-align: top;
327
+ }
328
+ .learn-press-add-ons > li .add-on-thumbnail .add-on-overlay {
329
+ position: absolute;
330
+ left: 0;
331
+ right: 0;
332
+ height: 100%;
333
+ top: 0;
334
+ -webkit-transition: all 0.25s;
335
+ background-color: #ADE6FF;
336
+ opacity: 0;
337
+ }
338
+ .learn-press-add-ons > li .add-on-thumbnail .add-on-description {
339
+ position: absolute;
340
+ left: 20px;
341
+ right: 20px;
342
+ bottom: 0;
343
+ -webkit-transition: all 0.25s;
344
+ color: #444;
345
+ opacity: 0;
346
+ }
347
+ .learn-press-add-ons > li:hover .add-on-overlay {
348
+ opacity: 0.3;
349
+ }
350
+ .learn-press-add-ons > li:hover .add-on-description {
351
+ opacity: 1;
352
+ }
353
+ .learn-press-add-ons > li .add-on-info {
354
+ min-height: 80px;
355
+ padding: 20px;
356
+ background-color: #F5F5F5;
357
+ border-top: 1px solid #FFF;
358
+ }
359
+ .learn-press-add-ons > li .add-on-info > h3 {
360
+ margin-top: 0;
361
+ }
362
+ .learn-press-add-ons > li .add-on-actions {
363
+ position: absolute;
364
+ bottom: 43px;
365
+ }
366
+ .learn-press-add-ons > li .add-on-actions .add-on-state {
367
+ font-size: 36px;
368
+ vertical-align: top;
369
+ display: none;
370
+ margin-top: -8px;
371
+ color: #05B3FF;
372
+ margin-left: -9px;
373
+ }
374
+ .learn-press-add-ons > li .add-on-actions .add-on-state.change {
375
+ display: inline-block;
376
+ }
377
+ .learn-press-add-ons .plugin-card-top {
378
+ min-height: 180px;
379
+ }
380
+ .learn-press-add-ons .button.spinner {
381
+ background: url(../../images/spinner.gif) no-repeat 4px !important;
382
+ padding-left: 30px;
383
+ visibility: visible;
384
+ width: auto;
385
+ }
386
+ .learn-press-add-ons .action-links > span {
387
+ display: block;
388
+ text-align: right;
389
+ font-style: italic;
390
+ }
391
+ .learn-press-add-ons .action-links > span.enabled {
392
+ color: #7ad03a;
393
+ }
394
+ .learn-press-add-ons .action-links > span.disabled {
395
+ color: #FF0000;
396
+ }
397
+ .learn-press-add-ons .plugin-icon img {
398
+ max-width: 100%;
399
+ }
400
+ #learn-press-bundle-activate-add-ons.spinner {
401
+ float: left !important;
402
+ }
403
+ .learn-press-add-ons .plugin-version {
404
+ font-weight: bold;
405
+ }
406
+ #learn-press-add-ons-wrap #name {
407
+ width: 30%;
408
+ }
409
+ .learn-press-add-ons p:before {
410
+ content: '';
411
+ }
412
+ #learn-press-add-ons-wrap .theme {
413
+ padding: 20px;
414
+ background-color: #fff;
415
+ border: 1px solid #ddd;
416
+ overflow: hidden;
417
+ }
418
+ #learn-press-add-ons-wrap .theme h2 {
419
+ margin: 0 0 20px 0;
420
+ line-height: 1.4;
421
+ }
422
+ #learn-press-add-ons-wrap .theme img {
423
+ width: 400px;
424
+ height: auto;
425
+ max-height: 100%;
426
+ float: left;
427
+ margin: 0 20px 0 0;
428
+ }
429
+ @media (max-width: 1280px) {
430
+ .learn-press-add-ons > li {
431
+ /*width: 33.33%;*/
432
+ }
433
+ }
434
+ @media screen and (max-width: 782px) {
435
+ .learn-press-add-ons .enable-now {
436
+ padding: 5px;
437
+ }
438
+ .learn-press-add-ons .enable-now:before {
439
+ margin: 0 !important;
440
+ }
441
+ .learn-press-add-ons .enable-now:before {
442
+ margin: 0 !important;
443
+ }
444
+ #learn-press-add-ons-wrap .theme img {
445
+ width: 50%;
446
+ }
447
+ }
448
+ @media (max-width: 768px) {
449
+ .learn-press-add-ons > li {
450
+ /*width: 50%;*/
451
+ }
452
+ .learn-press-add-ons > li .column-name {
453
+ margin-right: 150px;
454
+ }
455
+ }
456
+ @media (max-width: 480px) {
457
+ .learn-press-add-ons > li {
458
+ width: 100%;
459
+ }
460
+ #learn-press-add-ons-wrap .theme img {
461
+ width: 100%;
462
+ margin: 0 0 20px 0;
463
+ }
464
+ }
465
+ /**/
466
+ #lpr-quiz-questions-wrap .select2-container .select2-choice {
467
+ height: 29px;
468
+ padding-top: 3px;
469
+ font-size: 14px;
470
+ }
471
+ .post-title.column-title {
472
+ overflow: visible;
473
+ }
474
+ .lpr-row-actions {
475
+ display: inline-block;
476
+ position: relative;
477
+ }
478
+ .lpr-row-action-dropdown {
479
+ position: absolute;
480
+ top: 100%;
481
+ left: 0;
482
+ min-width: 150px;
483
+ background-color: #FFF;
484
+ border: 1px solid #DDD;
485
+ padding: 0;
486
+ margin: 0;
487
+ display: none;
488
+ }
489
+ .lpr-row-action-dropdown > li {
490
+ margin: 0;
491
+ }
492
+ .lpr-row-action-dropdown > li > a {
493
+ display: block;
494
+ padding: 5px;
495
+ }
496
+ .lpr-row-actions > a {
497
+ padding-right: 15px;
498
+ position: relative;
499
+ }
500
+ .lpr-row-actions > a:after {
501
+ width: 0;
502
+ height: 0;
503
+ border: 5px solid transparent;
504
+ border-top-color: #DDD;
505
+ content: '';
506
+ display: inline-block;
507
+ position: absolute;
508
+ right: 0;
509
+ top: 6px;
510
+ }
511
+ .lpr-row-actions:hover > ul {
512
+ display: block;
513
+ }
514
+ /* addons page */
515
+ #lpr-add-ons-wrapper .lpr-add-on-block {
516
+ border-bottom: 1px dashed #DDD;
517
+ padding-bottom: 20px;
518
+ width: 50%;
519
+ float: left;
520
+ margin-top: 20px;
521
+ }
522
+ #lpr-add-ons-wrapper .lpr-add-on-block:after {
523
+ content: '';
524
+ display: block;
525
+ clear: both;
526
+ }
527
+ #lpr-add-ons-wrapper .lpr-admin-thumbnail {
528
+ float: left;
529
+ width: 200px;
530
+ }
531
+ #lpr-add-ons-wrapper .lpr-admin-thumbnail img {
532
+ vertical-align: top;
533
+ }
534
+ #lpr-add-ons-wrapper .lpr-add-on-info {
535
+ margin-left: 220px;
536
+ margin-right: 20px;
537
+ }
538
+ #lpr-add-ons-wrapper .lpr-add-on-info > h3 {
539
+ margin-top: 0;
540
+ }
541
+ #lpr-add-ons-wrapper .lpr-add-on-info > h3 > span {
542
+ display: inline-block;
543
+ padding: 0 5px;
544
+ background-color: #7AD3FA;
545
+ color: #FFF;
546
+ border-radius: 3px;
547
+ margin-left: 10px;
548
+ font-size: 12px;
549
+ vertical-align: top;
550
+ font-weight: normal;
551
+ }
552
+ #lpr-add-ons-wrapper .lpr-add-on-action {
553
+ float: right;
554
+ width: 100px;
555
+ }
556
+ /* toggle */
557
+ input.lpr-fancy-checkbox {
558
+ display: none;
559
+ }
560
+ .lpr-fancy-checkbox.tog {
561
+ border-radius: 20px;
562
+ box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.6);
563
+ margin: 0 auto;
564
+ height: 19px;
565
+ width: 50px;
566
+ position: relative;
567
+ cursor: pointer;
568
+ font: 11px/18px arial;
569
+ background: #ccc;
570
+ -webkit-transition: all .2s ease;
571
+ -moz-transition: all .2s ease;
572
+ -o-transition: all .2s ease;
573
+ transition: all .2s ease;
574
+ display: inline-block !important;
575
+ }
576
+ .lpr-fancy-checkbox.tog:after {
577
+ content: '';
578
+ box-shadow: 0 2px 2px rgba(0, 0, 0, 0.6);
579
+ border-radius: 20px;
580
+ display: block;
581
+ height: 15px;
582
+ width: 15px;
583
+ background: #fff;
584
+ position: absolute;
585
+ top: 2px;
586
+ left: 2px;
587
+ -webkit-transition: all .2s ease;
588
+ -moz-transition: all .2s ease;
589
+ -o-transition: all .2s ease;
590
+ transition: all .2s ease;
591
+ }
592
+ .lpr-fancy-checkbox.tog:before {
593
+ content: 'OFF';
594
+ position: absolute;
595
+ right: 7px;
596
+ top: 1px;
597
+ color: #fff;
598
+ }
599
+ .lpr-fancy-checkbox.tog:hover:after {
600
+ left: 5px;
601
+ }
602
+ .lpr-fancy-checkbox.tog.on:before {
603
+ content: 'ON';
604
+ right: 28px;
605
+ }
606
+ .lpr-fancy-checkbox.tog.on {
607
+ background: #05B3FF;
608
+ }
609
+ .lpr-fancy-checkbox.tog.on:after {
610
+ left: 33px;
611
+ }
612
+ .lpr-fancy-checkbox.tog.on:hover:after {
613
+ left: 30px;
614
+ }
615
+ /**/
616
+ .clearfix:after {
617
+ display: block;
618
+ content: '';
619
+ clear: both;
620
+ }
621
+ .clear {
622
+ display: block;
623
+ clear: both;
624
+ height: 0;
625
+ }
626
+ /**********************************************************************/
627
+ /**********************************************************************/
628
+ .lp-list-options {
629
+ border: 1px solid #DDD;
630
+ border-collapse: collapse;
631
+ width: 100%;
632
+ }
633
+ .lp-list-option.lp-list-option-empty td,
634
+ .lp-list-option.lp-list-option-empty th {
635
+ background-color: #FBE9E9;
636
+ }
637
+ .lp-list-option.lp-list-option-empty .lp-answer-check input,
638
+ .lp-list-option.lp-list-option-empty .lp-list-option-actions i {
639
+ display: none;
640
+ }
641
+ .lp-list-options thead th {
642
+ border: 1px solid #FFF;
643
+ background-color: #EAEAEA;
644
+ padding: 10px;
645
+ text-align: left;
646
+ color: #00A0D2;
647
+ }
648
+ .lp-list-options tbody th,
649
+ .lp-list-options tbody td {
650
+ border: 1px solid #FFF;
651
+ padding: 10px 10px;
652
+ text-align: left;
653
+ background-color: #F5F5F5;
654
+ }
655
+ .lp-list-options .lp-answer-check {
656
+ width: 100px;
657
+ }
658
+ .lp-list-options tbody th input[type="text"],
659
+ .lp-list-options tbody td input[type="text"] {
660
+ width: 100%;
661
+ }
662
+ .lp-list-options .ui-sortable-placeholder {
663
+ visibility: visible !important;
664
+ }
665
+ .lp-list-options .ui-sortable-placeholder td {
666
+ background-image: url("../../images/stripe.png");
667
+ }
668
+ .lp-list-option .lp-answer-text {
669
+ color: #777;
670
+ background-color: transparent;
671
+ border-color: transparent;
672
+ box-shadow: none;
673
+ }
674
+ .lp-list-option .lp-answer-text:after {
675
+ font-family: dashicons;
676
+ content: '\f464';
677
+ }
678
+ .lp-list-option .lp-answer-text:focus,
679
+ .lp-list-option:hover .lp-answer-text {
680
+ box-shadow: none;
681
+ outline: none;
682
+ background-color: transparent;
683
+ border-color: transparent;
684
+ }
685
+ .lp-list-option:hover .lp-answer-text {
686
+ border-style: dashed;
687
+ }
688
+ .lp-list-option-actions {
689
+ cursor: pointer;
690
+ color: #00A0D2;
691
+ }
692
+ .lp-list-option-actions.lp-move-list-option {
693
+ cursor: move;
694
+ }
695
+ .lp-list-option-actions:hover {
696
+ color: #156077;
697
+ }
698
+ /* Question meta box */
699
+ #question_answer .rwmb-question-wrapper {
700
+ margin: 12px 0 0 0;
701
+ }
702
+ .question-bottom-actions > * {
703
+ vertical-align: baseline !important;
704
+ }
705
+ /* Quiz meta box */
706
+ body.post-type-lp_quiz #questions,
707
+ body.post-type-lp_question #question_answer_ {
708
+ border: none;
709
+ box-shadow: none;
710
+ background-color: transparent;
711
+ }
712
+ body.post-type-lp_quiz #questions .handlediv,
713
+ body.post-type-lp_question #question_answer_ .handlediv {
714
+ display: none;
715
+ }
716
+ body.post-type-lp_quiz #questions .hndle,
717
+ body.post-type-lp_question #question_answer_ .hndle {
718
+ display: none;
719
+ }
720
+ body.post-type-lp_quiz #questions .inside,
721
+ body.post-type-lp_question #question_answer_ .inside {
722
+ padding: 0;
723
+ }
724
+ #questions .quiz-questions-heading {
725
+ margin: 0;
726
+ padding: 20px;
727
+ background-color: #FFF;
728
+ line-height: 1;
729
+ border: 1px solid #DDD;
730
+ }
731
+ #questions .quiz-questions-heading .questions-toggle {
732
+ float: right;
733
+ margin: 0;
734
+ line-height: 1;
735
+ }
736
+ #questions .quiz-questions-heading .questions-toggle a {
737
+ color: #666666;
738
+ box-shadow: none;
739
+ }
740
+ #questions .quiz-questions-heading .questions-toggle a:hover {
741
+ color: #00a0d2;
742
+ }
743
+ #questions #learn-press-dropdown-questions {
744
+ display: inline-block;
745
+ position: relative;
746
+ }
747
+ #questions #learn-press-dropdown-questions > ul {
748
+ position: absolute;
749
+ top: 100%;
750
+ margin: 0;
751
+ padding: 0;
752
+ background-color: #FFF;
753
+ left: 0;
754
+ right: 0;
755
+ border: 1px solid #EEE;
756
+ border-top: none;
757
+ display: none;
758
+ z-index: 50;
759
+ }
760
+ #questions #learn-press-dropdown-questions > ul > li {
761
+ margin: 0;
762
+ }
763
+ #questions #learn-press-dropdown-questions > ul li > a {
764
+ display: block;
765
+ padding: 5px;
766
+ outline: none;
767
+ box-shadow: none;
768
+ }
769
+ #questions #learn-press-question-name {
770
+ font-size: 18px;
771
+ min-width: 350px;
772
+ margin: 0;
773
+ box-shadow: none;
774
+ border-color: #EEE;
775
+ color: #BBB;
776
+ vertical-align: middle;
777
+ }
778
+ #questions #learn-press-toggle-questions {
779
+ height: 32px;
780
+ vertical-align: top;
781
+ background-color: #FFF;
782
+ border: 1px solid #EEE;
783
+ width: 32px;
784
+ margin-left: -4px;
785
+ text-align: center;
786
+ font-size: 30px;
787
+ padding: 0;
788
+ color: #CCC;
789
+ border-left: none;
790
+ outline: none;
791
+ cursor: pointer;
792
+ }
793
+ #questions #learn-press-toggle-questions:hover {
794
+ color: #AAAAAA;
795
+ }
796
+ #questions #learn-press-button-add-question {
797
+ _vertical-align: middle;
798
+ }
799
+ #questions .question-actions {
800
+ background-color: #FFF;
801
+ border: 1px solid #DDD;
802
+ padding: 10px;
803
+ display: inline-block;
804
+ margin-top: 20px;
805
+ position: relative;
806
+ z-index: 999;
807
+ }
808
+ #questions .quiz-question {
809
+ margin: -1px 0 0 0;
810
+ }
811
+ #questions .quiz-question .learn-press-question {
812
+ padding: 20px 20px 5px 20px;
813
+ background-color: #FFF;
814
+ border: 1px solid #DDD;
815
+ border-top: none;
816
+ }
817
+ #questions .quiz-question-head {
818
+ padding: 10px 20px;
819
+ border: 1px solid #DDD;
820
+ background-color: #F5F5F5;
821
+ position: relative;
822
+ }
823
+ #questions .quiz-question.is-hidden .quiz-question-head,
824
+ #questions .quiz-question.is-hidden .question-name {
825
+ background-color: #FFF;
826
+ }
827
+ #questions .quiz-question-head .quiz-question-actions {
828
+ float: right;
829
+ margin: 1px 0;
830
+ visibility: hidden;
831
+ padding-top: 2px;
832
+ }
833
+ #questions .quiz-question-head .quiz-question-actions a {
834
+ margin: 0 3px;
835
+ color: #666666;
836
+ vertical-align: middle;
837
+ box-shadow: none;
838
+ }
839
+ #questions .quiz-question-head .quiz-question-actions a:hover {
840
+ color: #00a0d2;
841
+ }
842
+ #questions .quiz-question-head .quiz-question-actions a.move {
843
+ cursor: url("../../images/openhand.cur") 7 5, default;
844
+ position: absolute;
845
+ right: 0;
846
+ height: 50px;
847
+ top: 0;
848
+ background: url("../../images/grippy_large.png") left no-repeat;
849
+ width: 12px;
850
+ }
851
+ #questions .quiz-question-head:hover .quiz-question-actions {
852
+ visibility: visible;
853
+ }
854
+ #questions .quiz-question.ui-sortable-placeholder {
855
+ visibility: visible !important;
856
+ background-image: url("../../images/stripe.png");
857
+ border: 1px solid #DDD;
858
+ border-bottom: none;
859
+ }
860
+ #questions .question-name {
861
+ border: none;
862
+ box-shadow: none;
863
+ padding-left: 0;
864
+ width: 70%;
865
+ font-weight: bold;
866
+ color: #777;
867
+ vertical-align: middle;
868
+ background-color: #F5F5F5;
869
+ }
870
+ #questions .quiz-question-icon {
871
+ display: inline-block;
872
+ width: 25px;
873
+ height: 25px;
874
+ vertical-align: middle;
875
+ margin-right: 10px;
876
+ }
877
+ #questions .quiz-question-icon img {
878
+ max-width: 100%;
879
+ height: auto;
880
+ }
881
+ #questions #learn-press-dropdown-questions .added {
882
+ display: none;
883
+ }
884
+ .lpr-curriculum-section > h3 {
885
+ padding: 0 !important;
886
+ }
887
+ .lpr-curriculum-section > h3 .lpr-action {
888
+ top: 0;
889
+ right: 0;
890
+ }
891
+ .lpr-curriculum-section.lpr-empty > h3 {
892
+ cursor: default !important;
893
+ }
894
+ .lpr-curriculum-section.lpr-empty .lpr-action {
895
+ display: none !important;
896
+ }
897
+ .lpr-course-curriculum button span {
898
+ text-decoration: underline;
899
+ }
900
+ #learn-press-statistic {
901
+ margin-top: 20px;
902
+ }
903
+ .learn-press-chart {
904
+ position: relative;
905
+ }
906
+ .learn-press-chart canvas {
907
+ height: 70vh;
908
+ width: 100vw;
909
+ }
910
+ .chart-buttons form {
911
+ display: inline-block;
912
+ vertical-align: top;
913
+ }
914
+ .chart-buttons form input[type="text"] {
915
+ width: 105px;
916
+ font-size: 14px;
917
+ vertical-align: top;
918
+ margin: 0;
919
+ text-align: center;
920
+ font-weight: bold;
921
+ padding: 4px;
922
+ }
923
+ .chart-buttons form span {
924
+ display: inline-block;
925
+ vertical-align: middle;
926
+ font-weight: bold;
927
+ padding: 5px;
928
+ }
929
+ .learn-press-chart.loading:after {
930
+ content: '';
931
+ position: absolute;
932
+ top: 0;
933
+ left: 0;
934
+ right: 0;
935
+ bottom: 0;
936
+ z-index: 10;
937
+ background: #FFF;
938
+ opacity: 0.5;
939
+ }
940
+ .chart-description li {
941
+ display: inline-block;
942
+ margin-right: 15px;
943
+ }
944
+ .chart-description li:before {
945
+ content: '';
946
+ display: inline-block;
947
+ width: 10px;
948
+ height: 10px;
949
+ vertical-align: middle;
950
+ margin-right: 5px;
951
+ }
952
+ .chart-description li span {
953
+ display: inline-block;
954
+ vertical-align: middle;
955
+ font-weight: bold;
956
+ }
957
+ .chart-description li.all:before {
958
+ background: #2FA7FF;
959
+ }
960
+ .chart-description li.instructors:before {
961
+ background: #EAC79B;
962
+ }
963
+ .chart-description li.students:before {
964
+ background: #D4D0CB;
965
+ }
966
+ .lpr-stats-time {
967
+ text-align: center;
968
+ }
969
+ .lpr-hidden {
970
+ display: none;
971
+ }
972
+ #lpr-custom-time {
973
+ position: relative;
974
+ top: 4px;
975
+ }
976
+ /* block page */
977
+ #lpr-page-block {
978
+ position: fixed;
979
+ top: 0;
980
+ left: 0;
981
+ right: 0;
982
+ bottom: 0;
983
+ background-color: #000;
984
+ opacity: 0.5;
985
+ display: none;
986
+ z-index: 9999;
987
+ }
988
+ #form-quick-add-lesson-link {
989
+ position: absolute;
990
+ }
991
+ #_lpr_course_price_description > span {
992
+ font-weight: bold;
993
+ font-size: 15px;
994
+ }
995
+ .lpr-ignore,
996
+ .lpr-ignore:hover {
997
+ color: #dd3d36;
998
+ }
999
+ .lpr-ignore:hover {
1000
+ cursor: pointer;
1001
+ }
1002
+ .lpr-quick-add-page-inline,
1003
+ .lpr-quick-actions-inline {
1004
+ display: inline-block;
1005
+ vertical-align: middle;
1006
+ margin: 0 !important;
1007
+ }
1008
+ #lpr-toggle-quiz-mode {
1009
+ background-color: #0077FF;
1010
+ padding: 3px;
1011
+ margin-left: 5px;
1012
+ display: inline-block;
1013
+ border-radius: 3px;
1014
+ text-decoration: none;
1015
+ color: #FFF;
1016
+ }
1017
+ .column-num_of_question {
1018
+ width: 150px;
1019
+ }
1020
+ .lp-search-items input[name="lp-item-name"] {
1021
+ width: 500px;
1022
+ }
1023
+ .lp-button-dropdown {
1024
+ padding-left: 0 !important;
1025
+ padding-right: 28px !important;
1026
+ position: relative;
1027
+ z-index: 99998;
1028
+ }
1029
+ .lp-button-dropdown .lp-dropdown-label {
1030
+ padding-left: 10px;
1031
+ }
1032
+ .lp-button-dropdown .lp-dropdown-arrow {
1033
+ display: inline-block;
1034
+ /* width: 20px; */
1035
+ text-align: center;
1036
+ padding: 0 10px;
1037
+ position: absolute;
1038
+ top: -1px;
1039
+ bottom: -1px;
1040
+ }
1041
+ .lp-button-dropdown .lp-dropdown-items {
1042
+ position: absolute;
1043
+ margin: 0;
1044
+ /* width: 100%; */
1045
+ background-color: #FFF;
1046
+ top: 100%;
1047
+ margin-top: 1px;
1048
+ border: 1px solid #DDD;
1049
+ right: -1px;
1050
+ /* right: -1px; */
1051
+ width: 200px;
1052
+ z-index: 9999999;
1053
+ display: none;
1054
+ }
1055
+ .lp-button-dropdown .lp-dropdown-items li {
1056
+ margin: 0;
1057
+ }
1058
+ .lp-button-dropdown .lp-dropdown-items li a {
1059
+ display: block;
1060
+ padding: 10px;
1061
+ line-height: 1;
1062
+ text-decoration: none;
1063
+ outline: none;
1064
+ box-shadow: none;
1065
+ }
1066
+ .lp-button-dropdown .lp-dropdown-items li a:hover {
1067
+ background-color: #F5F5F5;
1068
+ }
1069
+ .lp-button-dropdown:not(.disabled):hover ul,
1070
+ .lp-button-dropdown:not(.disabled) ul:hover {
1071
+ display: block;
1072
+ }
1073
+ .curriculum-section .lp-check-items,
1074
+ .curriculum-section .lp-check-items:hover {
1075
+ padding-left: 5px;
1076
+ padding-right: 34px;
1077
+ border-color: transparent;
1078
+ background: transparent;
1079
+ box-shadow: none;
1080
+ }
1081
+ .column-format,
1082
+ .column-is_previewable,
1083
+ .column-taxonomy-question-tag {
1084
+ width: 10%;
1085
+ }
1086
+ .learn-press-add-ons .plugin-card .install-now:before,
1087
+ .learn-press-add-ons .plugin-card .disable-now:before,
1088
+ .learn-press-add-ons .plugin-card .enable-now:before {
1089
+ margin: 3px 5px 0 -2px;
1090
+ display: inline-block;
1091
+ font: 400 20px/1 dashicons;
1092
+ /*speak: none;*/
1093
+ -webkit-font-smoothing: antialiased;
1094
+ -moz-osx-font-smoothing: grayscale;
1095
+ vertical-align: top;
1096
+ }
1097
+ .learn-press-add-ons .plugin-card .install-now:before {
1098
+ content: '\f106';
1099
+ color: #0073aa;
1100
+ }
1101
+ .learn-press-add-ons .plugin-card .disable-now:before {
1102
+ content: '\f147';
1103
+ color: #0073aa;
1104
+ }
1105
+ .learn-press-add-ons .plugin-card .enable-now:before {
1106
+ content: '\f335';
1107
+ color: #d54e21;
1108
+ }
1109
+ .learn-press-add-ons .plugin-card .disable-now:hover:before {
1110
+ content: '\f335';
1111
+ color: #d54e21;
1112
+ }
1113
+ .learn-press-add-ons .plugin-card .enable-now:hover:before {
1114
+ content: '\f147';
1115
+ color: #0073aa;
1116
+ }
1117
+ .learn-press-add-ons .plugin-card .button-working:before {
1118
+ content: '\f463' !important;
1119
+ -webkit-animation: lp-spinner 2s infinite linear;
1120
+ animation: lp-spinner 2s infinite linear;
1121
+ margin-right: 0;
1122
+ }
1123
+ .learn-press-add-ons .plugin-card .button-working span {
1124
+ display: none;
1125
+ }
1126
+ .lp-button-actions a {
1127
+ text-decoration: none;
1128
+ margin-left: 5px;
1129
+ }
1130
+ .learn-press-quick-confirm {
1131
+ position: absolute;
1132
+ z-index: 9999;
1133
+ color: #ffffff;
1134
+ padding: 2px 8px;
1135
+ display: block;
1136
+ white-space: nowrap;
1137
+ left: -39.625px;
1138
+ top: 24px;
1139
+ background-color: #C90202;
1140
+ cursor: pointer;
1141
+ }
1142
+ .learn-press-quick-confirm:hover,
1143
+ .learn-press-quick-confirm:hover:before {
1144
+ background-color: #d73b00;
1145
+ }
1146
+ .learn-press-quick-confirm:before {
1147
+ content: '';
1148
+ display: block;
1149
+ position: absolute;
1150
+ /* border: 1px solid; */
1151
+ transform: rotate(45deg);
1152
+ width: 7px;
1153
+ height: 7px;
1154
+ top: -3px;
1155
+ background-color: #C90202;
1156
+ right: 7px;
1157
+ }
1158
+ /* course */
1159
+ .wp-core-ui .meta_box_add_section,
1160
+ .wp-core-ui .meta_box_add_lesson {
1161
+ margin-right: 10px;
1162
+ }
1163
+ .hide {
1164
+ display: none;
1165
+ }
1166
+ .handle.dashicons {
1167
+ cursor: move;
1168
+ margin-right: 0;
1169
+ }
1170
+ .meta_box_remove .dashicons {
1171
+ text-decoration: initial;
1172
+ }
1173
+ .meta_box_course_lesson_quiz li input,
1174
+ .meta_box_course_lesson_quiz li select {
1175
+ min-width: 250px;
1176
+ }
1177
+ .rwmb-meta-box label {
1178
+ color: #222;
1179
+ font-weight: bold;
1180
+ display: block;
1181
+ margin: 16px 0;
1182
+ }
1183
+ .description {
1184
+ margin-top: 5px;
1185
+ }
1186
+ .dashed-placeholder {
1187
+ border: 2px dashed #999;
1188
+ padding: 10px;
1189
+ }
1190
+ /*
1191
+ TuNN added 21 03 2015
1192
+ Modified 03 Apr 2015
1193
+ */
1194
+ /* Course Curriculumn meta box section*/
1195
+ /************ version 1.0 **************/
1196
+ /* order */
1197
+ .post-type-lp_order #post-body-content,
1198
+ .post-type-lp_order #order_details .handlediv,
1199
+ .post-type-lp_order #order_details .hndle {
1200
+ display: none;
1201
+ }
1202
+ .post-type-lp_order #submitpost .misc-pub-section label {
1203
+ display: block;
1204
+ font-weight: bold;
1205
+ }
1206
+ #learn-press-order {
1207
+ margin: 15px;
1208
+ }
1209
+ #learn-press-order .order-data-number {
1210
+ font-size: 36px;
1211
+ padding: 0;
1212
+ margin-bottom: 20px;
1213
+ }
1214
+ #learn-press-order > h3 {
1215
+ margin: 0 0 10px 0;
1216
+ padding: 0;
1217
+ }
1218
+ #learn-press-order .order-data-date,
1219
+ #learn-press-order .order-data-status,
1220
+ #learn-press-order .order-data-payment-method {
1221
+ font-size: 18px;
1222
+ padding: 0 0 10px 0;
1223
+ }
1224
+ #learn-press-order .user-display-name,
1225
+ #learn-press-order .user-email,
1226
+ #learn-press-order .user-ip-address {
1227
+ padding: 0;
1228
+ margin: 0 0 10px 0;
1229
+ }
1230
+ #learn-press-order .order-items table {
1231
+ border: 1px solid #DDD;
1232
+ border-collapse: collapse;
1233
+ width: 100%;
1234
+ }
1235
+ #learn-press-order .order-items table th,
1236
+ #learn-press-order .order-items table td {
1237
+ text-align: left;
1238
+ padding: 10px 15px;
1239
+ border: 1px solid #DDD;
1240
+ }
1241
+ #learn-press-install-sample-data-notice .install-sample-data-loading {
1242
+ display: none;
1243
+ }
1244
+ /* learn_press_dashboard_widget */
1245
+ #learn_press_dashboard_widget .subsubsub {
1246
+ float: none;
1247
+ }
1248
+ /* ios checkbox */
1249
+ .learn-press-checkbox {
1250
+ display: none !important;
1251
+ }
1252
+ input.regular-text[id^="learn-press-emails"] {
1253
+ width: 97%;
1254
+ }
1255
+ .ios-ui-select {
1256
+ background: #dddddd;
1257
+ border: none !important;
1258
+ height: 18px;
1259
+ -webkit-border-radius: 9px;
1260
+ border-radius: 9px;
1261
+ width: 30px;
1262
+ -webkit-transition: all 0.3s ease-in-out;
1263
+ -moz-transition: all 0.3s ease-in-out;
1264
+ -ms-transition: all 0.3s ease-in-out;
1265
+ -o-transition: all 0.3s ease-in-out;
1266
+ transition: all 0.3s ease-in-out;
1267
+ -webkit-box-shadow: none;
1268
+ box-shadow: none;
1269
+ cursor: pointer;
1270
+ position: relative;
1271
+ display: inline-block;
1272
+ }
1273
+ .ios-ui-select.checked {
1274
+ -webkit-box-shadow: inset 0 0 0 18px #6ddc5f;
1275
+ box-shadow: inset 0 0 0 18px #6ddc5f;
1276
+ }
1277
+ .ios-ui-select.checked .inner {
1278
+ left: 13px;
1279
+ }
1280
+ .ios-ui-select .inner {
1281
+ width: 16px;
1282
+ height: 16px;
1283
+ position: absolute;
1284
+ top: 1px;
1285
+ left: 1px;
1286
+ -webkit-border-radius: 100%;
1287
+ border-radius: 100%;
1288
+ background: white;
1289
+ -webkit-transition: all 350ms cubic-bezier(0, 0.89, 0.44, 1);
1290
+ -moz-transition: all 350ms cubic-bezier(0, 0.89, 0.44, 1);
1291
+ -o-transition: all 350ms cubic-bezier(0, 0.89, 0.44, 1);
1292
+ transition: all 350ms cubic-bezier(0, 0.89, 0.44, 1);
1293
+ -webkit-box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.2), 0 3px 4px 0 rgba(0, 0, 0, 0.1);
1294
+ box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.2), 0 3px 4px 0 rgba(0, 0, 0, 0.1);
1295
+ }
1296
+ .lp-label-counter {
1297
+ display: inline-block;
1298
+ background-color: #0073AA;
1299
+ border-radius: 10px;
1300
+ height: 21px;
1301
+ line-height: 20px;
1302
+ text-align: center;
1303
+ min-width: 21px;
1304
+ color: #FFF;
1305
+ padding: 0 5px;
1306
+ }
1307
+ .column-num_of_question,
1308
+ .column-preview,
1309
+ .column-duration,
1310
+ .column-type,
1311
+ .column-taxonomy-question_tag {
1312
+ width: 100px;
1313
+ text-align: left;
1314
+ }
1315
+ #learn-press-admin-settings .form-table th {
1316
+ padding: 20px 10px 20px 0 !important;
1317
+ }
1318
+ #learn-press-admin-settings input,
1319
+ #learn-press-admin-settings select {
1320
+ vertical-align: top;
1321
+ }
1322
+ @-webkit-keyframes lp-spinner {
1323
+ 0% {
1324
+ -webkit-transform: rotate(0deg);
1325
+ transform: rotate(0deg);
1326
+ }
1327
+ 100% {
1328
+ -webkit-transform: rotate(359deg);
1329
+ transform: rotate(359deg);
1330
+ }
1331
+ }
1332
+ @keyframes lp-spinner {
1333
+ 0% {
1334
+ -webkit-transform: rotate(0deg);
1335
+ transform: rotate(0deg);
1336
+ }
1337
+ 100% {
1338
+ -webkit-transform: rotate(359deg);
1339
+ transform: rotate(359deg);
1340
+ }
1341
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/css/admin/admin.less ADDED
@@ -0,0 +1,1627 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Define all styles for admin side
3
+ *
4
+ * @author ThimPress
5
+ * @version 1.0
6
+ */
7
+
8
+ // admin variables
9
+ @primary-icon-color: #666666;
10
+ @primary-icon-hover-color: #00a0d2;
11
+
12
+ .rwmb-number-wrapper .rwmb-input {
13
+ padding-top: 16px;
14
+ }
15
+
16
+ .lp-nav-tab-wrapper {
17
+ border-bottom: 1px solid #ccc;
18
+ margin: 0;
19
+ padding: 9px 15px 0 0;
20
+ line-height: inherit;
21
+ }
22
+
23
+ .learn-press-quick-add-page-inline {
24
+ display: inline-block;
25
+ vertical-align: top;
26
+ margin: 0 !important;
27
+ }
28
+
29
+ .learn-press-quick-add-page-inline > * {
30
+ vertical-align: top;
31
+ }
32
+
33
+ .post-type-lp_course {
34
+ & .column-price, & .column-students {
35
+ width: 10%;
36
+ }
37
+
38
+ #course_curriculum .curriculum-section-items .lp-item-empty td.section-item-input {
39
+ padding-left: 40px;
40
+ &.hover {
41
+ padding-left: 0;
42
+ }
43
+ }
44
+ }
45
+
46
+ #learn-press-admin-settings {
47
+ #learn_press_email_formats{
48
+ margin-bottom: 10px;
49
+ }
50
+ .learn-press-email-variables{
51
+ margin-left: 0;
52
+ margin-top: 5px;
53
+ li{
54
+ display: inline-block;
55
+ cursor: pointer;
56
+ &:hover{
57
+ color: #0085ba;
58
+ }
59
+ }
60
+ }
61
+ .nav-tab-wrapper {
62
+ margin-bottom: 20px;
63
+ }
64
+
65
+ .subsubsub {
66
+ float: left;
67
+ width: 240px;
68
+ position: relative;
69
+ z-index: 10;
70
+ margin: 0 -260px 0 20px;
71
+ padding-top: 11px;
72
+ li {
73
+ display: block;
74
+ a {
75
+ display: block;
76
+ outline: none;
77
+ box-shadow: none;
78
+ }
79
+ }
80
+ }
81
+ .learn-press-settings-wrap {
82
+ float: left;
83
+ padding: 0 0 15px 300px;
84
+ background: #FFF;
85
+ z-index: 0;
86
+ position: relative;
87
+ width: 100%;
88
+ box-sizing: border-box;
89
+ &:before {
90
+ content: '';
91
+ position: absolute;
92
+ top: 0;
93
+ bottom: 0;
94
+ border-left: 1px solid #DDD;
95
+ margin-left: -30px;
96
+ }
97
+ }
98
+ &.no-subtabs{
99
+ .learn-press-settings-wrap {
100
+ float: none;
101
+ margin-left: 0;
102
+ padding-left: 25px;
103
+ &:before {
104
+ display: none;
105
+ }
106
+ }
107
+ .subsubsub{
108
+ display: none;
109
+ }
110
+ }
111
+ input[type="radio"] {
112
+ margin: 0 !important;
113
+ }
114
+ label{
115
+ line-height: 1;
116
+ }
117
+ }
118
+ /* message box */
119
+ #learn-press-message-box-block {
120
+ position: fixed;
121
+ top: 0;
122
+ left: 0;
123
+ right: 0;
124
+ bottom: 0;
125
+ background-color: #000;
126
+ z-index: 99999;
127
+ opacity: 0.8;
128
+ }
129
+
130
+ #learn-press-message-box-window {
131
+ position: fixed;
132
+ top: 0;
133
+ bottom: 0;
134
+ left: 0;
135
+ right: 0;
136
+ z-index: 100000;
137
+ color: #FFF;
138
+ text-align: center;
139
+ }
140
+
141
+ #message-box-wrap {
142
+ margin: 0 auto;
143
+ /* text-align: center; */
144
+ display: inline-block;
145
+ text-align: left;
146
+ max-width: 70%;
147
+ }
148
+
149
+ .message-box-title {
150
+ color: #FFF;
151
+ margin: 0 0 40px 0;
152
+ font-size: 34px;
153
+ }
154
+
155
+ .message-box-content {
156
+ font-size: 16px;
157
+ line-height: 1.5;
158
+ }
159
+
160
+ .message-box-animation {
161
+ background-image: url("../../images/animation.gif");
162
+ width: 220px;
163
+ height: 20px;
164
+ margin: 20px 0 0;
165
+ }
166
+
167
+ .message-box-buttons {
168
+ margin: 20px 0 0;
169
+ border-top: 1px solid #929292;
170
+ padding-top: 20px;
171
+ }
172
+
173
+ .message-box-button {
174
+ margin-right: 10px !important;
175
+ }
176
+
177
+ .post-type-lp_lesson .column-format .lp-label {
178
+ font-size: 100%;
179
+ }
180
+
181
+ /*********************************/
182
+ .hide {
183
+ display: none;
184
+ }
185
+
186
+ .handle.dashicons {
187
+ cursor: move;
188
+ margin-right: 10px;
189
+ }
190
+
191
+ .meta_box_remove .dashicons {
192
+ text-decoration: initial;
193
+ }
194
+
195
+ .meta_box_course_lesson_quiz li input,
196
+ .meta_box_course_lesson_quiz li select {
197
+ min-width: 250px;
198
+ }
199
+
200
+ .rwmb-meta-box label {
201
+ color: #222;
202
+ font-weight: bold;
203
+ display: block;
204
+ margin: 16px 0;
205
+ }
206
+
207
+ .description {
208
+ margin-top: 5px;
209
+ }
210
+
211
+ .dashed-placeholder {
212
+ border: 2px dashed #999;
213
+ padding: 10px;
214
+ }
215
+
216
+ .learn-press-admin-notice-dismiss:before {
217
+ font-family: dashicons;
218
+ content: '\f335';
219
+ width: 20px;
220
+ height: 20px;
221
+ display: inline-block;
222
+ background-color: #FFFFFF;
223
+ border-radius: 50%;
224
+ line-height: 20px;
225
+ text-align: center;
226
+ box-shadow: 0px 0px 1px 1px #F1F1F1;
227
+ font-size: 18px;
228
+ vertical-align: middle;
229
+ float: right;
230
+ }
231
+
232
+ /**
233
+ * Course Metabox
234
+ */
235
+ li.quiz, li.lesson, li.quick_lesson, li.quick_quiz {
236
+ margin-left: 30px;
237
+ }
238
+
239
+ .wp-core-ui .meta_box_add_section,
240
+ .wp-core-ui .meta_box_add_lesson,
241
+ .wp-core-ui .meta_box_add_quiz,
242
+ .wp-core-ui .meta_box_quick_add_lesson,
243
+ .wp-core-ui .meta_box_quick_add_quiz {
244
+ margin-right: 10px;
245
+ }
246
+
247
+ .column-taxonomy-course_category {
248
+ width: 15%;
249
+ }
250
+
251
+ /**/
252
+ #lpr-block {
253
+ position: fixed;
254
+ top: 0;
255
+ left: 0;
256
+ right: 0;
257
+ bottom: 0;
258
+ background-color: #000;
259
+ display: none;
260
+ z-index: 200;
261
+ opacity: 0.2;
262
+ }
263
+
264
+ .lpr-quick-add-form {
265
+ background-color: #FFF;
266
+ padding: 5px;
267
+ position: absolute;
268
+ z-index: 210;
269
+ border: 1px solid #DDD;
270
+ }
271
+
272
+ .lpr-quick-add-form input {
273
+ font-size: 15px;
274
+ border-radius: 3px;
275
+ border: 1px solid #DDD;
276
+ width: 350px;
277
+ }
278
+
279
+ .lpr-quick-add-form input,
280
+ .lpr-quick-add-form select {
281
+ vertical-align: top;
282
+ }
283
+
284
+ .lpr-quick-add-form .lpr-ajaxload {
285
+ display: none;
286
+ background: url(../../images/spinner.gif) no-repeat center;
287
+ width: 30px;
288
+ color: #FFF;
289
+ margin-top: 6px;
290
+ }
291
+
292
+ .lpr-quick-add-form.working .lpr-ajaxload {
293
+ display: inline-block;
294
+ }
295
+
296
+ .lpr-quick-add-form.working button {
297
+ display: none;
298
+ }
299
+
300
+ .post-type-lpr_question .lpr-question-option-label {
301
+ display: none;
302
+ }
303
+
304
+ #lpr-question-options-wrap {
305
+ margin-top: 8px;
306
+ }
307
+
308
+ .lpr-question tr.lpr-disabled .dashicons-trash,
309
+ .lpr-question tr.lpr-disabled .dashicons-sort {
310
+ display: none;
311
+ }
312
+
313
+ /*
314
+ * Add on page
315
+ */
316
+
317
+ .lpr-add-ons-wrapper .add-on-info {
318
+ width: 65%;
319
+ display: inline-block;
320
+ }
321
+
322
+ .lpr-add-ons-wrapper .add-on-action {
323
+ float: right;
324
+ }
325
+
326
+ .lpr-add-ons-wrapper .add-on-action a {
327
+ text-decoration: none;
328
+ padding: 20px;
329
+ height: 80px;
330
+ width: 100px;
331
+ background: #EBEBEB;
332
+ margin-right: 100px;
333
+ }
334
+
335
+ .lpr-add-ons-wrapper .add-on-action .add-on-enabled {
336
+ text-align: center;
337
+ margin: 40px;
338
+ }
339
+
340
+ .lpr-add-ons-wrapper .add-on-action .add-on-disabled {
341
+ text-align: center;
342
+ margin: 40px;
343
+ }
344
+
345
+ .lpr-add-ons-wrapper .add-on-action a:hover {
346
+ text-decoration: none;
347
+ content: attr(data-text-disable);
348
+ }
349
+
350
+ .learn-press-add-ons {
351
+ margin: 20px 0 0;
352
+ }
353
+
354
+ .learn-press-add-ons:after {
355
+ display: block;
356
+ clear: both;
357
+ content: '';
358
+ }
359
+
360
+ .learn-press-add-ons > li {
361
+ /*float: left;*/
362
+ /*width: 25%;*/
363
+ /*position: relative;*/
364
+ }
365
+
366
+ .learn-press-add-ons > li .add-on-inner {
367
+ margin: 0 20px 40px 20px;
368
+ border: 1px solid #DDD;
369
+ border-radius: 10px;
370
+ overflow: hidden;
371
+ }
372
+
373
+ .learn-press-add-ons > li .add-on-thumbnail {
374
+ position: relative;
375
+ overflow: hidden;
376
+ border-bottom: 1px solid #E3E3E3;
377
+ }
378
+
379
+ .learn-press-add-ons > li .add-on-thumbnail img {
380
+ width: 100%;
381
+ height: auto;
382
+ vertical-align: top;
383
+ }
384
+
385
+ .learn-press-add-ons > li .add-on-thumbnail .add-on-overlay {
386
+ position: absolute;
387
+ left: 0;
388
+ right: 0;
389
+ height: 100%;
390
+ top: 0;
391
+ -webkit-transition: all 0.25s;
392
+ background-color: #ADE6FF;
393
+ opacity: 0;
394
+ }
395
+
396
+ .learn-press-add-ons > li .add-on-thumbnail .add-on-description {
397
+ position: absolute;
398
+ left: 20px;
399
+ right: 20px;
400
+ bottom: 0;
401
+ -webkit-transition: all 0.25s;
402
+ color: #444;
403
+ opacity: 0;
404
+ }
405
+
406
+ .learn-press-add-ons > li:hover .add-on-overlay {
407
+ opacity: 0.3;
408
+ }
409
+
410
+ .learn-press-add-ons > li:hover .add-on-description {
411
+ opacity: 1;
412
+ }
413
+
414
+ .learn-press-add-ons > li .add-on-info {
415
+ min-height: 80px;
416
+ padding: 20px;
417
+ background-color: #F5F5F5;
418
+ border-top: 1px solid #FFF;
419
+ }
420
+
421
+ .learn-press-add-ons > li .add-on-info > h3 {
422
+ margin-top: 0;
423
+ }
424
+
425
+ .learn-press-add-ons > li .add-on-actions {
426
+ position: absolute;
427
+ bottom: 43px;
428
+ }
429
+
430
+ .learn-press-add-ons > li .add-on-actions .add-on-state {
431
+ font-size: 36px;
432
+ vertical-align: top;
433
+ display: none;
434
+ margin-top: -8px;
435
+ color: #05B3FF;
436
+ margin-left: -9px;
437
+ }
438
+
439
+ .learn-press-add-ons > li .add-on-actions .add-on-state.change {
440
+ display: inline-block;
441
+ }
442
+
443
+ .learn-press-add-ons .plugin-card-top {
444
+ min-height: 180px;
445
+ }
446
+
447
+ .learn-press-add-ons .button.spinner {
448
+ background: url(../../images/spinner.gif) no-repeat 4px !important;
449
+ padding-left: 30px;
450
+ visibility: visible;
451
+ width: auto;
452
+ }
453
+
454
+ .learn-press-add-ons .action-links > span {
455
+ display: block;
456
+ text-align: right;
457
+ font-style: italic;
458
+ }
459
+
460
+ .learn-press-add-ons .action-links > span.enabled {
461
+ color: #7ad03a;
462
+ }
463
+
464
+ .learn-press-add-ons .action-links > span.disabled {
465
+ color: #FF0000;
466
+ }
467
+
468
+ .learn-press-add-ons .plugin-icon img {
469
+ max-width: 100%;
470
+ }
471
+
472
+ #learn-press-bundle-activate-add-ons.spinner {
473
+ float: left !important;
474
+ }
475
+
476
+ .learn-press-add-ons .plugin-version {
477
+ font-weight: bold;
478
+ }
479
+
480
+ #learn-press-add-ons-wrap #name {
481
+ width: 30%;
482
+ }
483
+
484
+ .learn-press-add-ons p:before {
485
+ content: '';
486
+ }
487
+
488
+ #learn-press-add-ons-wrap .theme {
489
+ padding: 20px;
490
+ background-color: #fff;
491
+ border: 1px solid #ddd;
492
+ overflow: hidden;
493
+ }
494
+
495
+ #learn-press-add-ons-wrap .theme h2 {
496
+ margin: 0 0 20px 0;
497
+ line-height: 1.4;
498
+ }
499
+
500
+ #learn-press-add-ons-wrap .theme img {
501
+ width: 400px;
502
+ height: auto;
503
+ max-height: 100%;
504
+ float: left;
505
+ margin: 0 20px 0 0;
506
+ }
507
+
508
+ @media (max-width: 1280px) {
509
+ .learn-press-add-ons > li {
510
+ /*width: 33.33%;*/
511
+ }
512
+ }
513
+
514
+ @media screen and (max-width: 782px) {
515
+ .learn-press-add-ons .enable-now {
516
+ padding: 5px;
517
+ }
518
+
519
+ .learn-press-add-ons .enable-now:before {
520
+ margin: 0 !important;
521
+ }
522
+
523
+ .learn-press-add-ons .enable-now:before {
524
+ margin: 0 !important;
525
+ }
526
+
527
+ #learn-press-add-ons-wrap .theme img {
528
+ width: 50%;
529
+ }
530
+ }
531
+
532
+ @media (max-width: 768px) {
533
+ .learn-press-add-ons > li {
534
+ /*width: 50%;*/
535
+ }
536
+
537
+ .learn-press-add-ons > li .column-name {
538
+ margin-right: 150px;
539
+ }
540
+ }
541
+
542
+ @media (max-width: 480px) {
543
+ .learn-press-add-ons > li {
544
+ width: 100%;
545
+ }
546
+
547
+ #learn-press-add-ons-wrap .theme img {
548
+ width: 100%;
549
+ margin: 0 0 20px 0;
550
+ }
551
+ }
552
+
553
+ /**/
554
+
555
+ #lpr-quiz-questions-wrap .select2-container .select2-choice {
556
+ height: 29px;
557
+ padding-top: 3px;
558
+ font-size: 14px;
559
+ }
560
+
561
+ .post-title.column-title {
562
+ overflow: visible;
563
+ }
564
+
565
+ .lpr-row-actions {
566
+ display: inline-block;
567
+ position: relative;
568
+ }
569
+
570
+ .lpr-row-action-dropdown {
571
+ position: absolute;
572
+ top: 100%;
573
+ left: 0;
574
+ min-width: 150px;
575
+ background-color: #FFF;
576
+ border: 1px solid #DDD;
577
+ padding: 0;
578
+ margin: 0;
579
+ display: none;
580
+ }
581
+
582
+ .lpr-row-action-dropdown > li {
583
+ margin: 0;
584
+ }
585
+
586
+ .lpr-row-action-dropdown > li > a {
587
+ display: block;
588
+ padding: 5px;
589
+ }
590
+
591
+ .lpr-row-actions > a {
592
+ padding-right: 15px;
593
+ position: relative;
594
+ }
595
+
596
+ .lpr-row-actions > a:after {
597
+ width: 0;
598
+ height: 0;
599
+ border: 5px solid transparent;
600
+ border-top-color: #DDD;
601
+ content: '';
602
+ display: inline-block;
603
+ position: absolute;
604
+ right: 0;
605
+ top: 6px;
606
+ }
607
+
608
+ .lpr-row-actions:hover > ul {
609
+ display: block;
610
+ }
611
+
612
+ /* addons page */
613
+ #lpr-add-ons-wrapper {
614
+ }
615
+
616
+ #lpr-add-ons-wrapper .lpr-add-on-block {
617
+ border-bottom: 1px dashed #DDD;
618
+ padding-bottom: 20px;
619
+ width: 50%;
620
+ float: left;
621
+ margin-top: 20px;
622
+ }
623
+
624
+ #lpr-add-ons-wrapper .lpr-add-on-block:after {
625
+ content: '';
626
+ display: block;
627
+ clear: both;
628
+ }
629
+
630
+ #lpr-add-ons-wrapper .lpr-admin-thumbnail {
631
+ float: left;
632
+ width: 200px;
633
+ }
634
+
635
+ #lpr-add-ons-wrapper .lpr-admin-thumbnail img {
636
+ vertical-align: top;
637
+ }
638
+
639
+ #lpr-add-ons-wrapper .lpr-add-on-info {
640
+ margin-left: 220px;
641
+ margin-right: 20px;
642
+ }
643
+
644
+ #lpr-add-ons-wrapper .lpr-add-on-info > h3 {
645
+ margin-top: 0;
646
+ }
647
+
648
+ #lpr-add-ons-wrapper .lpr-add-on-info > h3 > span {
649
+ display: inline-block;
650
+ padding: 0 5px;
651
+ background-color: #7AD3FA;
652
+ color: #FFF;
653
+ border-radius: 3px;
654
+ margin-left: 10px;
655
+ font-size: 12px;
656
+ vertical-align: top;
657
+ font-weight: normal;
658
+ }
659
+
660
+ #lpr-add-ons-wrapper .lpr-add-on-action {
661
+ float: right;
662
+ width: 100px;
663
+ }
664
+
665
+ /* toggle */
666
+ input.lpr-fancy-checkbox {
667
+ display: none;
668
+ }
669
+
670
+ .lpr-fancy-checkbox.tog {
671
+ border-radius: 20px;
672
+ box-shadow: inset 0 0 4px rgba(0, 0, 0, .6);
673
+ margin: 0 auto;
674
+ height: 19px;
675
+ width: 50px;
676
+ position: relative;
677
+ cursor: pointer;
678
+ font: 11px/18px arial;
679
+ background: #ccc;
680
+ -webkit-transition: all .2s ease;
681
+ -moz-transition: all .2s ease;
682
+ -o-transition: all .2s ease;
683
+ transition: all .2s ease;
684
+ display: inline-block !important;
685
+ }
686
+
687
+ .lpr-fancy-checkbox.tog:after {
688
+ content: '';
689
+ box-shadow: 0 2px 2px rgba(0, 0, 0, .6);
690
+ border-radius: 20px;
691
+ display: block;
692
+ height: 15px;
693
+ width: 15px;
694
+ background: #fff;
695
+ position: absolute;
696
+ top: 2px;
697
+ left: 2px;
698
+ -webkit-transition: all .2s ease;
699
+ -moz-transition: all .2s ease;
700
+ -o-transition: all .2s ease;
701
+ transition: all .2s ease;
702
+ }
703
+
704
+ .lpr-fancy-checkbox.tog:before {
705
+ content: 'OFF';
706
+ position: absolute;
707
+ right: 7px;
708
+ top: 1px;
709
+ color: #fff;
710
+ }
711
+
712
+ .lpr-fancy-checkbox.tog:hover:after {
713
+ left: 5px;
714
+ }
715
+
716
+ .lpr-fancy-checkbox.tog.on:before {
717
+ content: 'ON';
718
+ right: 28px;
719
+ }
720
+
721
+ .lpr-fancy-checkbox.tog.on {
722
+ background: #05B3FF;
723
+ }
724
+
725
+ .lpr-fancy-checkbox.tog.on:after {
726
+ left: 33px;
727
+ }
728
+
729
+ .lpr-fancy-checkbox.tog.on:hover:after {
730
+ left: 30px;
731
+ }
732
+
733
+ /**/
734
+ .clearfix:after {
735
+ display: block;
736
+ content: '';
737
+ clear: both;
738
+ }
739
+
740
+ .clear {
741
+ display: block;
742
+ clear: both;
743
+ height: 0;
744
+ }
745
+
746
+ /**********************************************************************/
747
+ /**********************************************************************/
748
+
749
+ .lp-list-options {
750
+ border: 1px solid #DDD;
751
+ border-collapse: collapse;
752
+ width: 100%;
753
+ }
754
+
755
+ .lp-list-option {
756
+
757
+ }
758
+
759
+ .lp-list-option.lp-list-option-empty td,
760
+ .lp-list-option.lp-list-option-empty th {
761
+ background-color: #FBE9E9;
762
+ }
763
+
764
+ .lp-list-option.lp-list-option-empty .lp-answer-check input,
765
+ .lp-list-option.lp-list-option-empty .lp-list-option-actions i {
766
+ display: none;
767
+ }
768
+
769
+ .lp-list-option .clm {
770
+
771
+ }
772
+
773
+ .lp-list-option .lp-item-checkbox {
774
+ }
775
+
776
+ .lp-list-option .lp-item-name {
777
+ }
778
+
779
+ .lp-list-option .lp-item-actions {
780
+ }
781
+
782
+ .lp-list-options thead th {
783
+ border: 1px solid #FFF;
784
+ background-color: #EAEAEA;
785
+ padding: 10px;
786
+ text-align: left;
787
+
788
+ color: #00A0D2;
789
+
790
+ }
791
+
792
+ .lp-list-options tbody th,
793
+ .lp-list-options tbody td {
794
+ border: 1px solid #FFF;
795
+ padding: 10px 10px;
796
+ text-align: left;
797
+ background-color: #F5F5F5;
798
+ }
799
+
800
+ .lp-list-options .lp-answer-check {
801
+ width: 100px;
802
+ }
803
+
804
+ .lp-list-options tbody th input[type="text"],
805
+ .lp-list-options tbody td input[type="text"] {
806
+ width: 100%;
807
+ }
808
+
809
+ .lp-list-options .ui-sortable-placeholder {
810
+ visibility: visible !important;
811
+ }
812
+
813
+ .lp-list-options .ui-sortable-placeholder td {
814
+ background-image: url("../../images/stripe.png");
815
+ }
816
+
817
+ .lp-list-option .lp-answer-text {
818
+ color: #777;
819
+ background-color: transparent;
820
+ border-color: transparent;
821
+ box-shadow: none;
822
+ }
823
+
824
+ .lp-list-option .lp-answer-text:after {
825
+ font-family: dashicons;
826
+ content: '\f464';
827
+ }
828
+
829
+ .lp-list-option .lp-answer-text:focus,
830
+ .lp-list-option:hover .lp-answer-text {
831
+ box-shadow: none;
832
+ outline: none;
833
+ background-color: transparent;
834
+ border-color: transparent;
835
+ }
836
+
837
+ .lp-list-option:hover .lp-answer-text {
838
+ border-style: dashed;
839
+ }
840
+
841
+ .lp-list-option-actions {
842
+ cursor: pointer;
843
+ color: #00A0D2;
844
+ }
845
+
846
+ .lp-list-option-actions.lp-move-list-option {
847
+ cursor: move;
848
+ }
849
+
850
+ .lp-list-option-actions:hover {
851
+ color: #156077;
852
+ }
853
+
854
+ /* Question meta box */
855
+ #question_answer .rwmb-question-wrapper {
856
+ margin: 12px 0 0 0;
857
+ }
858
+
859
+ .question-bottom-actions > * {
860
+ vertical-align: baseline !important;
861
+ }
862
+
863
+ /* Quiz meta box */
864
+ body.post-type-lp_quiz #questions,
865
+ body.post-type-lp_question #question_answer_ {
866
+ border: none;
867
+ box-shadow: none;
868
+ background-color: transparent;
869
+ }
870
+
871
+ body.post-type-lp_quiz #questions .handlediv,
872
+ body.post-type-lp_question #question_answer_ .handlediv {
873
+ display: none;
874
+ }
875
+
876
+ body.post-type-lp_quiz #questions .hndle,
877
+ body.post-type-lp_question #question_answer_ .hndle {
878
+ display: none;
879
+ }
880
+
881
+ body.post-type-lp_quiz #questions .inside,
882
+ body.post-type-lp_question #question_answer_ .inside {
883
+ padding: 0;
884
+ }
885
+
886
+ #questions .quiz-questions-heading {
887
+ margin: 0;
888
+ padding: 20px;
889
+ background-color: #FFF;
890
+ line-height: 1;
891
+ border: 1px solid #DDD;
892
+ }
893
+
894
+ #questions .quiz-questions-heading .questions-toggle {
895
+ float: right;
896
+ margin: 0;
897
+ line-height: 1;
898
+ }
899
+
900
+ #questions .quiz-questions-heading .questions-toggle a {
901
+ color: @primary-icon-color;
902
+ box-shadow: none;
903
+ }
904
+
905
+ #questions .quiz-questions-heading .questions-toggle a:hover {
906
+ color: #00a0d2;
907
+ }
908
+
909
+ #questions #learn-press-dropdown-questions {
910
+ display: inline-block;
911
+ position: relative;
912
+ }
913
+
914
+ #questions #learn-press-dropdown-questions > ul {
915
+ position: absolute;
916
+ top: 100%;
917
+ margin: 0;
918
+ padding: 0;
919
+ background-color: #FFF;
920
+ left: 0;
921
+ right: 0;
922
+ border: 1px solid #EEE;
923
+ border-top: none;
924
+ display: none;
925
+ z-index: 50;
926
+ }
927
+
928
+ #questions #learn-press-dropdown-questions > ul > li {
929
+ margin: 0;
930
+ }
931
+
932
+ #questions #learn-press-dropdown-questions > ul li > a {
933
+ display: block;
934
+ padding: 5px;
935
+ outline: none;
936
+ box-shadow: none;
937
+ }
938
+
939
+ #questions #learn-press-question-name {
940
+ font-size: 18px;
941
+ min-width: 350px;
942
+ margin: 0;
943
+ box-shadow: none;
944
+ border-color: #EEE;
945
+ color: #BBB;
946
+ vertical-align: middle;
947
+ }
948
+
949
+ #questions #learn-press-toggle-questions {
950
+ height: 32px;
951
+ vertical-align: top;
952
+ background-color: #FFF;
953
+ border: 1px solid #EEE;
954
+ width: 32px;
955
+ margin-left: -4px;
956
+ text-align: center;
957
+ font-size: 30px;
958
+ padding: 0;
959
+ color: #CCC;
960
+ border-left: none;
961
+ outline: none;
962
+ cursor: pointer;
963
+ }
964
+
965
+ #questions #learn-press-toggle-questions:hover {
966
+ color: #AAAAAA;
967
+ }
968
+
969
+ #questions #learn-press-button-add-question {
970
+ _vertical-align: middle;
971
+ }
972
+
973
+ #questions input[name="lp-new-question-name"] {
974
+
975
+ }
976
+
977
+ #questions .question-actions {
978
+ background-color: #FFF;
979
+ border: 1px solid #DDD;
980
+ padding: 10px;
981
+ display: inline-block;
982
+ margin-top: 20px;
983
+ position: relative;
984
+ z-index: 999;
985
+ }
986
+
987
+ #questions .quiz-question {
988
+ margin: -1px 0 0 0;
989
+ }
990
+
991
+ #questions .quiz-question .learn-press-question {
992
+ padding: 20px 20px 5px 20px;
993
+ background-color: #FFF;
994
+ border: 1px solid #DDD;
995
+ border-top: none;
996
+ }
997
+
998
+ #questions .quiz-question-head {
999
+ padding: 10px 20px;
1000
+ border: 1px solid #DDD;
1001
+ background-color: #F5F5F5;
1002
+ position: relative;
1003
+ }
1004
+
1005
+ #questions .quiz-question.is-hidden .quiz-question-head,
1006
+ #questions .quiz-question.is-hidden .question-name {
1007
+ background-color: #FFF;
1008
+ }
1009
+
1010
+ #questions .quiz-question-head .quiz-question-actions {
1011
+ float: right;
1012
+ margin: 1px 0;
1013
+ visibility: hidden;
1014
+ padding-top: 2px;
1015
+ }
1016
+
1017
+ #questions .quiz-question-head .quiz-question-actions a {
1018
+ margin: 0 3px;
1019
+ color: @primary-icon-color;
1020
+ vertical-align: middle;
1021
+ box-shadow: none;
1022
+ }
1023
+
1024
+ #questions .quiz-question-head .quiz-question-actions a:hover {
1025
+ color: #00a0d2;
1026
+ }
1027
+
1028
+ #questions .quiz-question-head .quiz-question-actions a.move {
1029
+ cursor: url("../../images/openhand.cur") 7 5, default;
1030
+ position: absolute;
1031
+ right: 0;
1032
+ height: 50px;
1033
+ top: 0;
1034
+ background: url("../../images/grippy_large.png") left no-repeat;
1035
+ width: 12px;
1036
+ }
1037
+
1038
+ #questions .quiz-question-head:hover .quiz-question-actions {
1039
+ visibility: visible;
1040
+ }
1041
+
1042
+ #questions .quiz-question.ui-sortable-placeholder {
1043
+ visibility: visible !important;
1044
+ background-image: url("../../images/stripe.png");
1045
+ border: 1px solid #DDD;
1046
+ border-bottom: none;
1047
+ }
1048
+
1049
+ #questions .question-name {
1050
+ border: none;
1051
+ box-shadow: none;
1052
+ padding-left: 0;
1053
+ width: 70%;
1054
+ font-weight: bold;
1055
+ color: #777;
1056
+ vertical-align: middle;
1057
+ background-color: #F5F5F5;
1058
+ }
1059
+
1060
+ #questions .quiz-question-icon {
1061
+ display: inline-block;
1062
+ width: 25px;
1063
+ height: 25px;
1064
+ vertical-align: middle;
1065
+ margin-right: 10px;
1066
+ }
1067
+
1068
+ #questions .quiz-question-icon img {
1069
+ max-width: 100%;
1070
+ height: auto;
1071
+ }
1072
+
1073
+ #questions #learn-press-dropdown-questions .added {
1074
+ display: none;
1075
+ }
1076
+
1077
+ .lpr-curriculum-section > h3 {
1078
+ padding: 0 !important;
1079
+ }
1080
+
1081
+ .lpr-curriculum-section > h3 .lpr-action {
1082
+ top: 0;
1083
+ right: 0;
1084
+ }
1085
+
1086
+ .lpr-curriculum-section.lpr-empty > h3 {
1087
+ cursor: default !important;
1088
+ }
1089
+
1090
+ .lpr-curriculum-section.lpr-empty .lpr-action {
1091
+ display: none !important;
1092
+ }
1093
+
1094
+ .lpr-course-curriculum button span {
1095
+ text-decoration: underline;
1096
+ }
1097
+
1098
+ #learn-press-statistic {
1099
+ margin-top: 20px;
1100
+ }
1101
+
1102
+ .learn-press-chart {
1103
+ position: relative;
1104
+ }
1105
+
1106
+ .learn-press-chart canvas {
1107
+ height: 70vh;
1108
+ width: 100vw;
1109
+ }
1110
+
1111
+ .chart-buttons form {
1112
+ display: inline-block;
1113
+ vertical-align: top;
1114
+ }
1115
+
1116
+ .chart-buttons form input[type="text"] {
1117
+ width: 105px;
1118
+ font-size: 14px;
1119
+ vertical-align: top;
1120
+ margin: 0;
1121
+ text-align: center;
1122
+ font-weight: bold;
1123
+ padding: 4px;
1124
+ }
1125
+
1126
+ .chart-buttons form span {
1127
+ display: inline-block;
1128
+ vertical-align: middle;
1129
+ font-weight: bold;
1130
+ padding: 5px;
1131
+ }
1132
+
1133
+ .learn-press-chart.loading:after {
1134
+ content: '';
1135
+ position: absolute;
1136
+ top: 0;
1137
+ left: 0;
1138
+ right: 0;
1139
+ bottom: 0;
1140
+ z-index: 10;
1141
+ background: #FFF;
1142
+ opacity: 0.5;
1143
+ }
1144
+
1145
+ .chart-description {
1146
+
1147
+ }
1148
+
1149
+ .chart-description li {
1150
+ display: inline-block;
1151
+ margin-right: 15px;
1152
+ }
1153
+
1154
+ .chart-description li:before {
1155
+ content: '';
1156
+ display: inline-block;
1157
+ width: 10px;
1158
+ height: 10px;
1159
+ vertical-align: middle;
1160
+ margin-right: 5px;
1161
+ }
1162
+
1163
+ .chart-description li span {
1164
+ display: inline-block;
1165
+ vertical-align: middle;
1166
+ font-weight: bold;
1167
+ }
1168
+
1169
+ .chart-description li.all:before {
1170
+ background: #2FA7FF;
1171
+ }
1172
+
1173
+ .chart-description li.instructors:before {
1174
+ background: #EAC79B;
1175
+ }
1176
+
1177
+ .chart-description li.students:before {
1178
+ background: #D4D0CB;
1179
+ }
1180
+
1181
+ .lpr-stats-time {
1182
+ text-align: center;
1183
+ }
1184
+
1185
+ .lpr-hidden {
1186
+ display: none;
1187
+ }
1188
+
1189
+ #lpr-custom-time {
1190
+ position: relative;
1191
+ top: 4px;
1192
+ }
1193
+
1194
+ /* block page */
1195
+ #lpr-page-block {
1196
+ position: fixed;
1197
+ top: 0;
1198
+ left: 0;
1199
+ right: 0;
1200
+ bottom: 0;
1201
+ background-color: #000;
1202
+ opacity: 0.5;
1203
+ display: none;
1204
+ z-index: 9999;
1205
+ }
1206
+
1207
+ #form-quick-add-lesson-link {
1208
+ position: absolute;
1209
+ }
1210
+
1211
+ #_lpr_course_price_description > span {
1212
+ font-weight: bold;
1213
+ font-size: 15px;
1214
+ }
1215
+
1216
+ .lpr-ignore, .lpr-ignore:hover {
1217
+ color: #dd3d36;
1218
+ }
1219
+
1220
+ .lpr-ignore:hover {
1221
+ cursor: pointer;
1222
+ }
1223
+
1224
+ .lpr-quick-add-page-inline,
1225
+ .lpr-quick-actions-inline {
1226
+ display: inline-block;
1227
+ vertical-align: middle;
1228
+ margin: 0 !important;
1229
+ }
1230
+
1231
+ #lpr-toggle-quiz-mode {
1232
+ background-color: #0077FF;
1233
+ padding: 3px;
1234
+ margin-left: 5px;
1235
+ display: inline-block;
1236
+ border-radius: 3px;
1237
+ text-decoration: none;
1238
+ color: #FFF;
1239
+ }
1240
+
1241
+ .column-num_of_question {
1242
+ width: 150px;
1243
+ }
1244
+
1245
+ .lp-search-items input[name="lp-item-name"] {
1246
+ width: 500px;
1247
+ }
1248
+
1249
+ .lp-button-dropdown {
1250
+ padding-left: 0 !important;
1251
+ padding-right: 28px !important;
1252
+ position: relative;
1253
+ z-index: 99998;
1254
+ }
1255
+
1256
+ .lp-button-dropdown .lp-dropdown-label {
1257
+ padding-left: 10px;
1258
+ }
1259
+
1260
+ .lp-button-dropdown .lp-dropdown-arrow {
1261
+ display: inline-block;
1262
+ /* width: 20px; */
1263
+ text-align: center;
1264
+ padding: 0 10px;
1265
+ position: absolute;
1266
+ top: -1px;
1267
+ bottom: -1px;
1268
+ }
1269
+
1270
+ .lp-button-dropdown .lp-dropdown-items {
1271
+ position: absolute;
1272
+ margin: 0;
1273
+ /* width: 100%; */
1274
+ background-color: #FFF;
1275
+ top: 100%;
1276
+ margin-top: 1px;
1277
+ border: 1px solid #DDD;
1278
+ right: -1px;
1279
+ /* right: -1px; */
1280
+ width: 200px;
1281
+ z-index: 9999999;
1282
+ display: none;
1283
+ }
1284
+
1285
+ .lp-button-dropdown .lp-dropdown-items li {
1286
+ margin: 0;
1287
+ }
1288
+
1289
+ .lp-button-dropdown .lp-dropdown-items li a {
1290
+ display: block;
1291
+ padding: 10px;
1292
+ line-height: 1;
1293
+ text-decoration: none;
1294
+ outline: none;
1295
+ box-shadow: none;
1296
+ }
1297
+
1298
+ .lp-button-dropdown .lp-dropdown-items li a:hover {
1299
+ background-color: #F5F5F5;
1300
+ }
1301
+
1302
+ .lp-button-dropdown:not(.disabled):hover ul,
1303
+ .lp-button-dropdown:not(.disabled) ul:hover {
1304
+ display: block;
1305
+ }
1306
+
1307
+ .curriculum-section.lp-empty-section {
1308
+ }
1309
+
1310
+ .curriculum-section .lp-check-items,
1311
+ .curriculum-section .lp-check-items:hover {
1312
+ padding-left: 5px;
1313
+ padding-right: 34px;
1314
+ border-color: transparent;
1315
+ background: transparent;
1316
+ box-shadow: none;
1317
+ }
1318
+
1319
+ .column-format,
1320
+ .column-is_previewable,
1321
+ .column-taxonomy-question-tag {
1322
+ width: 10%;
1323
+ }
1324
+
1325
+ .learn-press-add-ons .plugin-card .install-now:before,
1326
+ .learn-press-add-ons .plugin-card .disable-now:before,
1327
+ .learn-press-add-ons .plugin-card .enable-now:before {
1328
+ margin: 3px 5px 0 -2px;
1329
+ display: inline-block;
1330
+ font: 400 20px/1 dashicons;
1331
+ /*speak: none;*/
1332
+ -webkit-font-smoothing: antialiased;
1333
+ -moz-osx-font-smoothing: grayscale;
1334
+ vertical-align: top;
1335
+ }
1336
+
1337
+ .learn-press-add-ons .plugin-card .install-now:before {
1338
+ content: '\f106';
1339
+ color: #0073aa;
1340
+ }
1341
+
1342
+ .learn-press-add-ons .plugin-card .disable-now:before {
1343
+ content: '\f147';
1344
+ color: #0073aa;
1345
+ }
1346
+
1347
+ .learn-press-add-ons .plugin-card .enable-now:before {
1348
+ content: '\f335';
1349
+ color: #d54e21;
1350
+ }
1351
+
1352
+ .learn-press-add-ons .plugin-card .disable-now:hover:before {
1353
+ content: '\f335';
1354
+ color: #d54e21;
1355
+ }
1356
+
1357
+ .learn-press-add-ons .plugin-card .enable-now:hover:before {
1358
+ content: '\f147';
1359
+ color: #0073aa;
1360
+ }
1361
+
1362
+ .learn-press-add-ons .plugin-card .button-working:before {
1363
+ content: '\f463' !important;
1364
+ -webkit-animation: lp-spinner 2s infinite linear;
1365
+ animation: lp-spinner 2s infinite linear;
1366
+ margin-right: 0;
1367
+ }
1368
+
1369
+ .learn-press-add-ons .plugin-card .button-working span {
1370
+ display: none;
1371
+ }
1372
+
1373
+ .lp-button-actions a {
1374
+ text-decoration: none;
1375
+ margin-left: 5px;
1376
+ }
1377
+
1378
+ .learn-press-quick-confirm {
1379
+ position: absolute;
1380
+ z-index: 9999;
1381
+ color: rgb(255, 255, 255);
1382
+ padding: 2px 8px;
1383
+ display: block;
1384
+ white-space: nowrap;
1385
+ left: -39.625px;
1386
+ top: 24px;
1387
+ background-color: #C90202;
1388
+ cursor: pointer;
1389
+ }
1390
+
1391
+ .learn-press-quick-confirm:hover,
1392
+ .learn-press-quick-confirm:hover:before {
1393
+ background-color: #d73b00;
1394
+ }
1395
+
1396
+ .learn-press-quick-confirm:before {
1397
+ content: '';
1398
+ display: block;
1399
+ position: absolute;
1400
+ /* border: 1px solid; */
1401
+ transform: rotate(45deg);
1402
+ width: 7px;
1403
+ height: 7px;
1404
+ top: -3px;
1405
+ background-color: #C90202;
1406
+ right: 7px;
1407
+ }
1408
+
1409
+ /* course */
1410
+ .wp-core-ui .meta_box_add_section,
1411
+ .wp-core-ui .meta_box_add_lesson {
1412
+ margin-right: 10px;
1413
+ }
1414
+
1415
+ .hide {
1416
+ display: none;
1417
+ }
1418
+
1419
+ .handle.dashicons {
1420
+ cursor: move;
1421
+ margin-right: 0;
1422
+ }
1423
+
1424
+ .meta_box_remove .dashicons {
1425
+ text-decoration: initial;
1426
+ }
1427
+
1428
+ .meta_box_course_lesson_quiz li input,
1429
+ .meta_box_course_lesson_quiz li select {
1430
+ min-width: 250px;
1431
+ }
1432
+
1433
+ .rwmb-meta-box label {
1434
+ color: #222;
1435
+ font-weight: bold;
1436
+ display: block;
1437
+ margin: 16px 0;
1438
+ }
1439
+
1440
+ .description {
1441
+ margin-top: 5px;
1442
+ }
1443
+
1444
+ .dashed-placeholder {
1445
+ border: 2px dashed #999;
1446
+ padding: 10px;
1447
+ }
1448
+
1449
+ /*
1450
+ TuNN added 21 03 2015
1451
+ Modified 03 Apr 2015
1452
+ */
1453
+ /* Course Curriculumn meta box section*/
1454
+
1455
+ /************ version 1.0 **************/
1456
+
1457
+ /* order */
1458
+ .post-type-lp_order #post-body-content,
1459
+ .post-type-lp_order #order_details .handlediv,
1460
+ .post-type-lp_order #order_details .hndle {
1461
+ display: none;
1462
+ }
1463
+
1464
+ .post-type-lp_order #submitpost .misc-pub-section label {
1465
+ display: block;
1466
+ font-weight: bold;
1467
+ }
1468
+
1469
+ #learn-press-order {
1470
+ margin: 15px;
1471
+ }
1472
+
1473
+ #learn-press-order .order-data-number {
1474
+ font-size: 36px;
1475
+ padding: 0;
1476
+ margin-bottom: 20px;
1477
+ }
1478
+
1479
+ #learn-press-order > h3 {
1480
+ margin: 0 0 10px 0;
1481
+ padding: 0;
1482
+ }
1483
+
1484
+ #learn-press-order .order-data-date,
1485
+ #learn-press-order .order-data-status,
1486
+ #learn-press-order .order-data-payment-method {
1487
+ font-size: 18px;
1488
+ padding: 0 0 10px 0;
1489
+ }
1490
+
1491
+ #learn-press-order .user-display-name,
1492
+ #learn-press-order .user-email,
1493
+ #learn-press-order .user-ip-address {
1494
+ padding: 0;
1495
+ margin: 0 0 10px 0;
1496
+ }
1497
+
1498
+ #learn-press-order .order-items table {
1499
+ border: 1px solid #DDD;
1500
+ border-collapse: collapse;
1501
+ width: 100%;
1502
+ }
1503
+
1504
+ #learn-press-order .order-items table th,
1505
+ #learn-press-order .order-items table td {
1506
+ text-align: left;
1507
+ padding: 10px 15px;
1508
+ border: 1px solid #DDD;
1509
+ }
1510
+
1511
+ #learn-press-install-sample-data-notice .install-sample-data-loading {
1512
+ display: none;
1513
+ }
1514
+
1515
+ /* learn_press_dashboard_widget */
1516
+ #learn_press_dashboard_widget {
1517
+ .subsubsub {
1518
+ float: none;
1519
+ }
1520
+ }
1521
+
1522
+ /* ios checkbox */
1523
+ .learn-press-checkbox {
1524
+ display: none !important;
1525
+ }
1526
+
1527
+ input.regular-text[id^="learn-press-emails"] {
1528
+ width: 97%;
1529
+ }
1530
+
1531
+ .ios-ui-select {
1532
+ background: #dddddd;
1533
+ border: none !important;
1534
+ height: 18px;
1535
+ -webkit-border-radius: 9px;
1536
+ border-radius: 9px;
1537
+ width: 30px;
1538
+ -webkit-transition: all 0.3s ease-in-out;
1539
+ -moz-transition: all 0.3s ease-in-out;
1540
+ -ms-transition: all 0.3s ease-in-out;
1541
+ -o-transition: all 0.3s ease-in-out;
1542
+ transition: all 0.3s ease-in-out;
1543
+ -webkit-box-shadow: none;
1544
+ box-shadow: none;
1545
+ cursor: pointer;
1546
+ position: relative;
1547
+ display: inline-block;
1548
+ }
1549
+
1550
+ .ios-ui-select.checked {
1551
+ -webkit-box-shadow: inset 0 0 0 18px #6ddc5f;
1552
+ box-shadow: inset 0 0 0 18px #6ddc5f;
1553
+ }
1554
+
1555
+ .ios-ui-select.checked .inner {
1556
+ left: 13px;
1557
+ }
1558
+
1559
+ .ios-ui-select .inner {
1560
+ width: 16px;
1561
+ height: 16px;
1562
+ position: absolute;
1563
+ top: 1px;
1564
+ left: 1px;
1565
+ -webkit-border-radius: 100%;
1566
+ border-radius: 100%;
1567
+ background: white;
1568
+ -webkit-transition: all 350ms cubic-bezier(0, 0.89, 0.44, 1);
1569
+ -moz-transition: all 350ms cubic-bezier(0, 0.89, 0.44, 1);
1570
+ -o-transition: all 350ms cubic-bezier(0, 0.89, 0.44, 1);
1571
+ transition: all 350ms cubic-bezier(0, 0.89, 0.44, 1);
1572
+ -webkit-box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.2), 0 3px 4px 0 rgba(0, 0, 0, 0.1);
1573
+ box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.2), 0 3px 4px 0 rgba(0, 0, 0, 0.1);
1574
+ }
1575
+
1576
+ .lp-label-counter {
1577
+ display: inline-block;
1578
+ background-color: #0073AA;
1579
+ border-radius: 10px;
1580
+ height: 21px;
1581
+ line-height: 20px;
1582
+ text-align: center;
1583
+ min-width: 21px;
1584
+ color: #FFF;
1585
+ padding: 0 5px;
1586
+ }
1587
+
1588
+ .column-num_of_question,
1589
+ .column-preview,
1590
+ .column-duration,
1591
+ .column-type,
1592
+ .column-taxonomy-question_tag {
1593
+ width: 100px;
1594
+ text-align: left;
1595
+ }
1596
+
1597
+ #learn-press-admin-settings .form-table th {
1598
+ padding: 20px 10px 20px 0 !important;
1599
+ }
1600
+
1601
+ #learn-press-admin-settings {
1602
+ input, select {
1603
+ vertical-align: top;
1604
+ }
1605
+ }
1606
+
1607
+ @-webkit-keyframes lp-spinner {
1608
+ 0% {
1609
+ -webkit-transform: rotate(0deg);
1610
+ transform: rotate(0deg);
1611
+ }
1612
+ 100% {
1613
+ -webkit-transform: rotate(359deg);
1614
+ transform: rotate(359deg);
1615
+ }
1616
+ }
1617
+
1618
+ @keyframes lp-spinner {
1619
+ 0% {
1620
+ -webkit-transform: rotate(0deg);
1621
+ transform: rotate(0deg);
1622
+ }
1623
+ 100% {
1624
+ -webkit-transform: rotate(359deg);
1625
+ transform: rotate(359deg);
1626
+ }
1627
+ }
assets/css/admin/course-editor.css ADDED
@@ -0,0 +1,251 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #learn-press-course-editor {
2
+ margin-bottom: 20px;
3
+ background: #FFF;
4
+ padding: 20px;
5
+ box-shadow: 0 0 10px #DDD;
6
+ }
7
+ #learn-press-course-editor:after {
8
+ display: block;
9
+ clear: both;
10
+ content: '';
11
+ }
12
+ #learn-press-course-editor #course-curriculum {
13
+ width: 38%;
14
+ border: 1px solid #DDD;
15
+ margin-bottom: 20px;
16
+ }
17
+ #learn-press-course-editor #course-curriculum .course-section {
18
+ background: #FFF;
19
+ position: relative;
20
+ border-bottom: 3px solid #B7B7B7;
21
+ }
22
+ #learn-press-course-editor #course-curriculum .course-section .section-head {
23
+ border-bottom: 1px solid #DDD;
24
+ background: #F9F9F9;
25
+ position: relative;
26
+ }
27
+ #learn-press-course-editor #course-curriculum .course-section .section-head input[type="text"] {
28
+ display: block;
29
+ width: 100%;
30
+ margin: 0;
31
+ border: none;
32
+ height: 50px;
33
+ font-weight: bold;
34
+ font-size: 20px;
35
+ padding: 10px 15px;
36
+ color: #777;
37
+ background: transparent;
38
+ }
39
+ #learn-press-course-editor #course-curriculum .course-section .section-head:hover .section-move,
40
+ #learn-press-course-editor #course-curriculum .course-section .section-head:hover .course-row-actions {
41
+ display: inline-block;
42
+ }
43
+ #learn-press-course-editor #course-curriculum .course-section .section-head:hover:after {
44
+ content: '';
45
+ display: block;
46
+ position: absolute;
47
+ top: 0;
48
+ left: 0;
49
+ width: 100%;
50
+ height: 100%;
51
+ background: #0085ba;
52
+ opacity: 0.1;
53
+ pointer-events: none;
54
+ }
55
+ #learn-press-course-editor #course-curriculum .course-section .section-add-content {
56
+ margin: 10px 10px;
57
+ }
58
+ #learn-press-course-editor #course-curriculum .course-section .section-add-content > ul {
59
+ margin-bottom: 10px;
60
+ display: none;
61
+ }
62
+ #learn-press-course-editor #course-curriculum .course-section .section-add-content > ul > li {
63
+ display: inline-block;
64
+ width: 70px;
65
+ border: 1px solid #DDD;
66
+ font-size: 48px;
67
+ height: 60px;
68
+ line-height: 60px;
69
+ border-radius: 3px;
70
+ margin-right: 6px;
71
+ background: #FFF;
72
+ }
73
+ #learn-press-course-editor #course-curriculum .course-section .section-add-content > ul > li:before {
74
+ color: #DDD;
75
+ }
76
+ #learn-press-course-editor #course-curriculum .course-section .section-add-content > ul > li:hover {
77
+ cursor: move;
78
+ }
79
+ #learn-press-course-editor #course-curriculum .course-section .section-add-content > ul > li:hover:before {
80
+ color: #00A0D2;
81
+ }
82
+ #learn-press-course-editor #course-curriculum .course-section .section-items {
83
+ margin: 0;
84
+ min-height: 40px;
85
+ }
86
+ #learn-press-course-editor #course-curriculum .course-section .section-items.section-empty:after {
87
+ content: 'Add item here';
88
+ display: block;
89
+ height: 50px;
90
+ font-size: 18px;
91
+ text-align: center;
92
+ line-height: 50px;
93
+ }
94
+ #learn-press-course-editor #course-curriculum .course-section .section-items li {
95
+ margin: 0;
96
+ border-bottom: 1px solid #DDD;
97
+ position: relative;
98
+ background: #FFF;
99
+ }
100
+ #learn-press-course-editor #course-curriculum .course-section .section-items li input[type="text"] {
101
+ width: 100%;
102
+ box-sizing: border-box;
103
+ margin: 0;
104
+ border: none;
105
+ padding: 10px 15px;
106
+ background: transparent;
107
+ color: #777;
108
+ }
109
+ #learn-press-course-editor #course-curriculum .course-section .section-items li:hover .section-item-move,
110
+ #learn-press-course-editor #course-curriculum .course-section .section-items li:hover .course-row-actions {
111
+ display: inline-block;
112
+ }
113
+ #learn-press-course-editor #course-curriculum .course-section .section-items li:hover:after {
114
+ content: '';
115
+ display: block;
116
+ position: absolute;
117
+ top: 0;
118
+ left: 0;
119
+ width: 100%;
120
+ height: 100%;
121
+ background: #0085ba;
122
+ opacity: 0.1;
123
+ pointer-events: none;
124
+ }
125
+ #learn-press-course-editor #course-curriculum .course-section .section-items li.ui-sortable-placeholder {
126
+ visibility: visible !important;
127
+ background: #FFF;
128
+ box-shadow: 0 0 20px #DDD inset;
129
+ }
130
+ #learn-press-course-editor #course-curriculum .course-section .section-items li.ui-sortable-placeholder:after {
131
+ content: 'Drop item here!';
132
+ position: absolute;
133
+ width: 100%;
134
+ height: 40px;
135
+ line-height: 40px;
136
+ text-align: center;
137
+ font-size: 20px;
138
+ color: #777;
139
+ }
140
+ #learn-press-course-editor #course-curriculum .course-section .section-move,
141
+ #learn-press-course-editor #course-curriculum .course-section .section-item-move {
142
+ display: none;
143
+ width: 15px;
144
+ height: 30px;
145
+ background: url("../../images/grippy_large.png") 4px center no-repeat;
146
+ position: absolute;
147
+ top: 50%;
148
+ margin-top: -15px;
149
+ cursor: url("../../../assets/images/openhand.cur") 7 5, default;
150
+ }
151
+ #learn-press-course-editor #course-curriculum .course-section.ui-sortable-placeholder {
152
+ visibility: visible !important;
153
+ background: #FFF;
154
+ box-shadow: 0 0 20px #DDD inset;
155
+ }
156
+ #learn-press-course-editor #course-curriculum .course-section.ui-sortable-placeholder:after {
157
+ content: 'Drop section here!';
158
+ position: absolute;
159
+ width: 100%;
160
+ height: 40px;
161
+ line-height: 40px;
162
+ text-align: center;
163
+ font-size: 20px;
164
+ color: #777;
165
+ top: 50%;
166
+ margin-top: -20px;
167
+ }
168
+ #learn-press-course-editor #course-curriculum .course-section .course-row-actions {
169
+ position: absolute;
170
+ right: 4px;
171
+ height: 24px;
172
+ top: 50%;
173
+ margin-top: -13px;
174
+ line-height: 24px;
175
+ background: #F5F5F5;
176
+ padding: 0 8px;
177
+ font-size: 11px;
178
+ border-radius: 3px;
179
+ border: 1px solid #efefef;
180
+ display: none;
181
+ }
182
+ #learn-press-course-editor #course-curriculum .course-section .course-row-actions a,
183
+ #learn-press-course-editor #course-curriculum .course-section .course-row-actions > div {
184
+ text-decoration: none;
185
+ color: #9c9c9c;
186
+ text-shadow: 1px 1px #fff;
187
+ }
188
+ #learn-press-course-editor #course-curriculum .course-section .course-row-actions a:hover,
189
+ #learn-press-course-editor #course-curriculum .course-section .course-row-actions > div:hover {
190
+ color: #39afff;
191
+ }
192
+ #learn-press-course-editor #course-curriculum .course-section .course-row-actions a.remove {
193
+ margin-right: 3px;
194
+ }
195
+ #learn-press-course-editor #course-curriculum .course-section .course-row-actions a.remove:hover {
196
+ color: #FF0000;
197
+ }
198
+ #learn-press-course-editor #course-curriculum .course-section .course-row-actions .toggle {
199
+ display: inline-block;
200
+ width: 24px;
201
+ margin-right: -8px;
202
+ text-align: center;
203
+ font-size: 20px;
204
+ vertical-align: middle;
205
+ line-height: 23px;
206
+ border-left: 1px solid #efefef;
207
+ height: 24px;
208
+ background: #efefef;
209
+ margin-top: -2px;
210
+ }
211
+ #learn-press-course-editor #course-curriculum .course-section .course-row-actions div.add {
212
+ margin-left: 3px;
213
+ display: inline-block;
214
+ }
215
+ #learn-press-course-editor #course-curriculum .course-section .course-row-actions div.add > div {
216
+ display: none;
217
+ position: absolute;
218
+ min-width: 303px;
219
+ right: 0;
220
+ top: 100%;
221
+ background: #F5F5F5;
222
+ border: 1px solid #DDD;
223
+ z-index: 999;
224
+ text-align: right;
225
+ padding: 10px 10px 3px 10px;
226
+ }
227
+ #learn-press-course-editor #course-curriculum .course-section .course-row-actions div.add > div ul {
228
+ margin-bottom: 10px;
229
+ }
230
+ #learn-press-course-editor #course-curriculum .course-section .course-row-actions div.add > div ul li {
231
+ width: 65px;
232
+ height: 48px;
233
+ font-size: 48px;
234
+ border: 1px solid #DDD;
235
+ border-radius: 3px;
236
+ margin-left: 5px;
237
+ }
238
+ #learn-press-course-editor #course-curriculum .course-section .course-row-actions div.add > div a {
239
+ text-align: right;
240
+ margin-left: 8px;
241
+ }
242
+ #learn-press-course-editor #course-curriculum .course-section .course-row-actions div.add:hover > div {
243
+ display: block;
244
+ }
245
+ #learn-press-course-editor #course-item-editor {
246
+ width: 60%;
247
+ float: right;
248
+ border: 1px solid #DDD;
249
+ padding: 0 20px;
250
+ box-sizing: border-box;
251
+ }
assets/css/admin/course-editor.less ADDED
@@ -0,0 +1,265 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #learn-press-course-editor {
2
+ margin-bottom: 20px;
3
+ background: #FFF;
4
+ padding: 20px;
5
+ box-shadow: 0 0 10px #DDD;
6
+ &:after {
7
+ display: block;
8
+ clear: both;
9
+ content: '';
10
+ }
11
+ #course-curriculum, #course-item-editor {
12
+
13
+ }
14
+ #course-curriculum {
15
+ width: 38%;
16
+ border: 1px solid #DDD;
17
+ margin-bottom: 20px;
18
+ .course-section {
19
+ background: #FFF;
20
+ position: relative;
21
+ border-bottom: 3px solid #B7B7B7;
22
+ .section-head {
23
+ border-bottom: 1px solid #DDD;
24
+ background: #F9F9F9;
25
+ position: relative;
26
+ input[type="text"] {
27
+ display: block;
28
+ width: 100%;
29
+ margin: 0;
30
+ border: none;
31
+ height: 50px;
32
+ font-weight: bold;
33
+ font-size: 20px;
34
+ padding: 10px 15px;
35
+ color: #777;
36
+ background: transparent;
37
+ }
38
+ &:hover {
39
+ .section-move, .course-row-actions {
40
+ display: inline-block;
41
+ }
42
+ &:after {
43
+ content: '';
44
+ display: block;
45
+ position: absolute;
46
+ top: 0;
47
+ left: 0;
48
+ width: 100%;
49
+ height: 100%;
50
+ background: #0085ba;
51
+ opacity: 0.1;
52
+ pointer-events: none;
53
+ }
54
+ }
55
+ }
56
+ .section-add-content {
57
+ margin: 10px 10px;
58
+ > ul {
59
+ margin-bottom: 10px;
60
+ display: none;
61
+ > li {
62
+ display: inline-block;
63
+ width: 70px;
64
+ border: 1px solid #DDD;
65
+ font-size: 48px;
66
+ height: 60px;
67
+ line-height: 60px;
68
+ border-radius: 3px;
69
+ margin-right: 6px;
70
+ background: #FFF;
71
+ &:before {
72
+ color: #DDD;
73
+ }
74
+ &:hover {
75
+ cursor: move;
76
+ &:before {
77
+ color: #00A0D2;
78
+ }
79
+ }
80
+ }
81
+ }
82
+ }
83
+ .section-items {
84
+ margin: 0;
85
+ min-height: 40px;
86
+ &.section-empty {
87
+ &:after {
88
+ content: 'Add item here';
89
+ display: block;
90
+ height: 50px;
91
+ font-size: 18px;
92
+ text-align: center;
93
+ line-height: 50px;
94
+ }
95
+ }
96
+ li {
97
+ margin: 0;
98
+ border-bottom: 1px solid #DDD;
99
+ position: relative;
100
+ background: #FFF;
101
+ input[type="text"] {
102
+ width: 100%;
103
+ box-sizing: border-box;
104
+ margin: 0;
105
+ border: none;
106
+ padding: 10px 15px;
107
+ background: transparent;
108
+ color: #777;
109
+
110
+ }
111
+
112
+ &:hover {
113
+ .section-item-move,
114
+ .course-row-actions {
115
+ display: inline-block;
116
+ }
117
+ &:after {
118
+ content: '';
119
+ display: block;
120
+ position: absolute;
121
+ top: 0;
122
+ left: 0;
123
+ width: 100%;
124
+ height: 100%;
125
+ background: #0085ba;
126
+ opacity: 0.1;
127
+ pointer-events: none;
128
+ }
129
+ }
130
+ &.ui-sortable-placeholder {
131
+ visibility: visible !important;
132
+ background: #FFF;
133
+ box-shadow: 0 0 20px #DDD inset;
134
+ &:after {
135
+ content: 'Drop item here!';
136
+ position: absolute;
137
+ width: 100%;
138
+ height: 40px;
139
+ line-height: 40px;
140
+ text-align: center;
141
+ font-size: 20px;
142
+ color: #777;
143
+ }
144
+ }
145
+ }
146
+ }
147
+ .section-move, .section-item-move {
148
+ display: none;
149
+ width: 15px;
150
+ height: 30px;
151
+ background: url("../../images/grippy_large.png") 4px center no-repeat;
152
+ position: absolute;
153
+ top: 50%;
154
+ margin-top: -15px;
155
+ cursor: url("../../../assets/images/openhand.cur") 7 5, default;
156
+ }
157
+ &.ui-sortable-placeholder {
158
+ visibility: visible !important;
159
+ background: #FFF;
160
+ box-shadow: 0 0 20px #DDD inset;
161
+ &:after {
162
+ content: 'Drop section here!';
163
+ position: absolute;
164
+ width: 100%;
165
+ height: 40px;
166
+ line-height: 40px;
167
+ text-align: center;
168
+ font-size: 20px;
169
+ color: #777;
170
+ top: 50%;
171
+ margin-top: -20px;
172
+ }
173
+ }
174
+ &.active {
175
+
176
+ }
177
+ .course-row-actions {
178
+ position: absolute;
179
+ right: 4px;
180
+ height: 24px;
181
+ top: 50%;
182
+ margin-top: -13px;
183
+ line-height: 24px;
184
+ background: #F5F5F5;
185
+ padding: 0 8px;
186
+ font-size: 11px;
187
+ border-radius: 3px;
188
+ border: 1px solid #efefef;
189
+ display: none;
190
+ a, > div {
191
+ text-decoration: none;
192
+ color: #9c9c9c;
193
+ text-shadow: 1px 1px #fff;
194
+ &:hover {
195
+ color: #39afff;
196
+ }
197
+ }
198
+ a.remove {
199
+ margin-right: 3px;
200
+ &:hover {
201
+ color: #FF0000;
202
+ }
203
+ }
204
+ .toggle{
205
+ display: inline-block;
206
+ width: 24px;
207
+ margin-right: -8px;
208
+ text-align: center;
209
+ font-size: 20px;
210
+ vertical-align: middle;
211
+ line-height: 23px;
212
+ border-left: 1px solid #efefef;
213
+ height: 24px;
214
+ background: #efefef;
215
+ margin-top: -2px;
216
+ }
217
+ div.add {
218
+ margin-left: 3px;
219
+ display: inline-block;
220
+ > div {
221
+ display: none;
222
+ position: absolute;
223
+ min-width: 303px;
224
+ right: 0;
225
+ top: 100%;
226
+ background: #F5F5F5;
227
+ border: 1px solid #DDD;
228
+ z-index: 999;
229
+ text-align: right;
230
+ padding: 10px 10px 3px 10px;
231
+ ul {
232
+ margin-bottom: 10px;
233
+ li {
234
+ width: 65px;
235
+ height: 48px;
236
+ font-size: 48px;
237
+ border: 1px solid #DDD;
238
+ border-radius: 3px;
239
+ margin-left: 5px;
240
+ }
241
+
242
+ }
243
+ a {
244
+ text-align: right;
245
+ margin-left: 8px;
246
+ }
247
+ }
248
+ &:hover {
249
+ > div {
250
+ display: block;
251
+ }
252
+ }
253
+ }
254
+
255
+ }
256
+ }
257
+ }
258
+ #course-item-editor {
259
+ width: 60%;
260
+ float: right;
261
+ border: 1px solid #DDD;
262
+ padding: 0 20px;
263
+ box-sizing: border-box;
264
+ }
265
+ }
assets/css/admin/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php // Silence is golden.
{inc/libraries/meta-box/css/jqueryui → assets/css/admin}/jquery.ui.core.css RENAMED
File without changes
{inc/libraries/meta-box/css/jqueryui → assets/css/admin}/jquery.ui.datepicker.css RENAMED
File without changes
{inc/libraries/meta-box/css/jqueryui → assets/css/admin}/jquery.ui.slider.css RENAMED
File without changes
{inc/libraries/meta-box/css/jqueryui → assets/css/admin}/jquery.ui.theme.css RENAMED
@@ -14,7 +14,7 @@
14
  ----------------------------------*/
15
  .ui-widget {
16
  font-family: Verdana, Arial, sans-serif;
17
- font-size: 1.1em;
18
  }
19
 
20
  .ui-widget .ui-widget {
@@ -23,13 +23,13 @@
23
 
24
  .ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button {
25
  font-family: Verdana, Arial, sans-serif;
26
- font-size: 1em;
27
  }
28
 
29
  .ui-widget-content {
30
- border: 1px solid #aaaaaa;
31
- background: #ffffff url(../../img/jqueryui/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x;
32
- color: #222222;
33
  }
34
 
35
  .ui-widget-content a {
@@ -37,9 +37,9 @@
37
  }
38
 
39
  .ui-widget-header {
40
- border: 1px solid #aaaaaa;
41
- background: #cccccc url(../../img/jqueryui/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x;
42
- color: #222222;
43
  font-weight: bold;
44
  }
45
 
@@ -50,38 +50,38 @@
50
  /* Interaction states
51
  ----------------------------------*/
52
  .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default {
53
- border: 1px solid #d3d3d3;
54
- background: #e6e6e6 url(../../img/jqueryui/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x;
55
  font-weight: normal;
56
- color: #555555;
57
  }
58
 
59
  .ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited {
60
- color: #555555;
61
  text-decoration: none;
62
  }
63
 
64
  .ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus {
65
- border: 1px solid #999999;
66
- background: #dadada url(../../img/jqueryui/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x;
67
  font-weight: normal;
68
- color: #212121;
69
  }
70
 
71
  .ui-state-hover a, .ui-state-hover a:hover {
72
- color: #212121;
73
  text-decoration: none;
74
  }
75
 
76
  .ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active {
77
- border: 1px solid #aaaaaa;
78
- background: #ffffff url(../../img/jqueryui/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x;
79
  font-weight: normal;
80
- color: #212121;
81
  }
82
 
83
  .ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited {
84
- color: #212121;
85
  text-decoration: none;
86
  }
87
 
@@ -92,9 +92,9 @@
92
  /* Interaction Cues
93
  ----------------------------------*/
94
  .ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {
95
- border: 1px solid #fcefa1;
96
- background: #fbf9ee url(../../img/jqueryui/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x;
97
- color: #363636;
98
  }
99
 
100
  .ui-state-highlight a, .ui-widget-content .ui-state-highlight a, .ui-widget-header .ui-state-highlight a {
@@ -102,9 +102,9 @@
102
  }
103
 
104
  .ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {
105
- border: 1px solid #cd0a0a;
106
- background: #fef1ec url(../../img/jqueryui/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x;
107
- color: #cd0a0a;
108
  }
109
 
110
  .ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a {
@@ -120,14 +120,14 @@
120
  }
121
 
122
  .ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary {
123
- opacity: .7;
124
- filter: Alpha(Opacity=70);
125
  font-weight: normal;
126
  }
127
 
128
  .ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled {
129
- opacity: .35;
130
- filter: Alpha(Opacity=35);
131
  background-image: none;
132
  }
133
 
@@ -136,37 +136,38 @@
136
 
137
  /* states and images */
138
  .ui-icon {
139
- width: 16px;
140
- height: 16px;
141
- background-image: url(../../img/jqueryui/ui-icons_222222_256x240.png);
 
142
  }
143
 
144
  .ui-widget-content .ui-icon {
145
- background-image: url(../../img/jqueryui/ui-icons_222222_256x240.png);
146
  }
147
 
148
  .ui-widget-header .ui-icon {
149
- background-image: url(../../img/jqueryui/ui-icons_222222_256x240.png);
150
  }
151
 
152
  .ui-state-default .ui-icon {
153
- background-image: url(../../img/jqueryui/ui-icons_888888_256x240.png);
154
  }
155
 
156
  .ui-state-hover .ui-icon, .ui-state-focus .ui-icon {
157
- background-image: url(../../img/jqueryui/ui-icons_454545_256x240.png);
158
  }
159
 
160
  .ui-state-active .ui-icon {
161
- background-image: url(../../img/jqueryui/ui-icons_454545_256x240.png);
162
  }
163
 
164
  .ui-state-highlight .ui-icon {
165
- background-image: url(../../img/jqueryui/ui-icons_2e83ff_256x240.png);
166
  }
167
 
168
  .ui-state-error .ui-icon, .ui-state-error-text .ui-icon {
169
- background-image: url(../../img/jqueryui/ui-icons_cd0a0a_256x240.png);
170
  }
171
 
172
  /* positioning */
@@ -872,48 +873,48 @@
872
 
873
  /* Corner radius */
874
  .ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl {
875
- -moz-border-radius-topleft: 4px;
876
  -webkit-border-top-left-radius: 4px;
877
- -khtml-border-top-left-radius: 4px;
878
- border-top-left-radius: 4px;
879
  }
880
 
881
  .ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr {
882
- -moz-border-radius-topright: 4px;
883
  -webkit-border-top-right-radius: 4px;
884
- -khtml-border-top-right-radius: 4px;
885
- border-top-right-radius: 4px;
886
  }
887
 
888
  .ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl {
889
- -moz-border-radius-bottomleft: 4px;
890
  -webkit-border-bottom-left-radius: 4px;
891
- -khtml-border-bottom-left-radius: 4px;
892
- border-bottom-left-radius: 4px;
893
  }
894
 
895
  .ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br {
896
- -moz-border-radius-bottomright: 4px;
897
  -webkit-border-bottom-right-radius: 4px;
898
- -khtml-border-bottom-right-radius: 4px;
899
- border-bottom-right-radius: 4px;
900
  }
901
 
902
  /* Overlays */
903
  .ui-widget-overlay {
904
- background: #aaaaaa url(../../img/jqueryui/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;
905
- opacity: .30;
906
- filter: Alpha(Opacity=30);
907
  }
908
 
909
  .ui-widget-shadow {
910
- margin: -8px 0 0 -8px;
911
- padding: 8px;
912
- background: #aaaaaa url(../../img/jqueryui/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;
913
- opacity: .30;
914
- filter: Alpha(Opacity=30);
915
- -moz-border-radius: 8px;
916
- -khtml-border-radius: 8px;
917
  -webkit-border-radius: 8px;
918
- border-radius: 8px;
919
  }
14
  ----------------------------------*/
15
  .ui-widget {
16
  font-family: Verdana, Arial, sans-serif;
17
+ font-size: 1.1em;
18
  }
19
 
20
  .ui-widget .ui-widget {
23
 
24
  .ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button {
25
  font-family: Verdana, Arial, sans-serif;
26
+ font-size: 1em;
27
  }
28
 
29
  .ui-widget-content {
30
+ border: 1px solid #aaaaaa;
31
+ background: #ffffff url(../../images/jqueryui/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x;
32
+ color: #222222;
33
  }
34
 
35
  .ui-widget-content a {
37
  }
38
 
39
  .ui-widget-header {
40
+ border: 1px solid #aaaaaa;
41
+ background: #cccccc url(../../images/jqueryui/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x;
42
+ color: #222222;
43
  font-weight: bold;
44
  }
45
 
50
  /* Interaction states
51
  ----------------------------------*/
52
  .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default {
53
+ border: 1px solid #d3d3d3;
54
+ background: #e6e6e6 url(../../images/jqueryui/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x;
55
  font-weight: normal;
56
+ color: #555555;
57
  }
58
 
59
  .ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited {
60
+ color: #555555;
61
  text-decoration: none;
62
  }
63
 
64
  .ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus {
65
+ border: 1px solid #999999;
66
+ background: #dadada url(../../images/jqueryui/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x;
67
  font-weight: normal;
68
+ color: #212121;
69
  }
70
 
71
  .ui-state-hover a, .ui-state-hover a:hover {
72
+ color: #212121;
73
  text-decoration: none;
74
  }
75
 
76
  .ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active {
77
+ border: 1px solid #aaaaaa;
78
+ background: #ffffff url(../../images/jqueryui/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x;
79
  font-weight: normal;
80
+ color: #212121;
81
  }
82
 
83
  .ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited {
84
+ color: #212121;
85
  text-decoration: none;
86
  }
87
 
92
  /* Interaction Cues
93
  ----------------------------------*/
94
  .ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {
95
+ border: 1px solid #fcefa1;
96
+ background: #fbf9ee url(../../images/jqueryui/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x;
97
+ color: #363636;
98
  }
99
 
100
  .ui-state-highlight a, .ui-widget-content .ui-state-highlight a, .ui-widget-header .ui-state-highlight a {
102
  }
103
 
104
  .ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {
105
+ border: 1px solid #cd0a0a;
106
+ background: #fef1ec url(../../images/jqueryui/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x;
107
+ color: #cd0a0a;
108
  }
109
 
110
  .ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a {
120
  }
121
 
122
  .ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary {
123
+ opacity: .7;
124
+ filter: Alpha(Opacity=70);
125
  font-weight: normal;
126
  }
127
 
128
  .ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled {
129
+ opacity: .35;
130
+ filter: Alpha(Opacity=35);
131
  background-image: none;
132
  }
133
 
136
 
137
  /* states and images */
138
  .ui-icon {
139
+ width: 16px;
140
+ height: 16px;
141
+ background-image: url(../../images/jqueryui/ui-icons_222222_256x240.png);
142
+ text-indent: -999999px;
143
  }
144
 
145
  .ui-widget-content .ui-icon {
146
+ background-image: url(../../images/jqueryui/ui-icons_222222_256x240.png);
147
  }
148
 
149
  .ui-widget-header .ui-icon {
150
+ background-image: url(../../images/jqueryui/ui-icons_222222_256x240.png);
151
  }
152
 
153
  .ui-state-default .ui-icon {
154
+ background-image: url(../../images/jqueryui/ui-icons_888888_256x240.png);
155
  }
156
 
157
  .ui-state-hover .ui-icon, .ui-state-focus .ui-icon {
158
+ background-image: url(../../images/jqueryui/ui-icons_454545_256x240.png);
159
  }
160
 
161
  .ui-state-active .ui-icon {
162
+ background-image: url(../../images/jqueryui/ui-icons_454545_256x240.png);
163
  }
164
 
165
  .ui-state-highlight .ui-icon {
166
+ background-image: url(../../images/jqueryui/ui-icons_2e83ff_256x240.png);
167
  }
168
 
169
  .ui-state-error .ui-icon, .ui-state-error-text .ui-icon {
170
+ background-image: url(../../images/jqueryui/ui-icons_cd0a0a_256x240.png);
171
  }
172
 
173
  /* positioning */
873
 
874
  /* Corner radius */
875
  .ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl {
876
+ -moz-border-radius-topleft: 4px;
877
  -webkit-border-top-left-radius: 4px;
878
+ -khtml-border-top-left-radius: 4px;
879
+ border-top-left-radius: 4px;
880
  }
881
 
882
  .ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr {
883
+ -moz-border-radius-topright: 4px;
884
  -webkit-border-top-right-radius: 4px;
885
+ -khtml-border-top-right-radius: 4px;
886
+ border-top-right-radius: 4px;
887
  }
888
 
889
  .ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl {
890
+ -moz-border-radius-bottomleft: 4px;
891
  -webkit-border-bottom-left-radius: 4px;
892
+ -khtml-border-bottom-left-radius: 4px;
893
+ border-bottom-left-radius: 4px;
894
  }
895
 
896
  .ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br {
897
+ -moz-border-radius-bottomright: 4px;
898
  -webkit-border-bottom-right-radius: 4px;
899
+ -khtml-border-bottom-right-radius: 4px;
900
+ border-bottom-right-radius: 4px;
901
  }
902
 
903
  /* Overlays */
904
  .ui-widget-overlay {
905
+ background: #aaaaaa url(../../images/jqueryui/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;
906
+ opacity: .30;
907
+ filter: Alpha(Opacity=30);
908
  }
909
 
910
  .ui-widget-shadow {
911
+ margin: -8px 0 0 -8px;
912
+ padding: 8px;
913
+ background: #aaaaaa url(../../images/jqueryui/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;
914
+ opacity: .30;
915
+ filter: Alpha(Opacity=30);
916
+ -moz-border-radius: 8px;
917
+ -khtml-border-radius: 8px;
918
  -webkit-border-radius: 8px;
919
+ border-radius: 8px;
920
  }
assets/css/admin/meta-box-course.css CHANGED
@@ -1,3 +1,8 @@
 
 
 
 
 
1
  .post-type-lp_course #postdivrich{
2
  visibility: hidden;
3
  }
@@ -93,7 +98,7 @@
93
  }
94
  #course_curriculum .curriculum-section .lp-section-actions a{
95
  vertical-align: middle;
96
- color: #DDD;
97
  width: 24px;
98
  height: 24px;
99
  box-shadow: none;
@@ -143,7 +148,7 @@
143
  color: #444;
144
  }
145
  #course_curriculum .curriculum-section.lp-empty-section .curriculum-section-content{
146
- display: none;
147
  }
148
  #course_curriculum .curriculum-section-items{
149
  border-collapse: collapse;
@@ -166,7 +171,7 @@
166
  }
167
  #course_curriculum .curriculum-section-items .lp-section-item .lp-item-actions a{
168
  vertical-align: middle;
169
- color: #DDD;
170
  margin-top: -2px;
171
  box-shadow: none;
172
  }
@@ -207,7 +212,7 @@
207
  height: 34px;
208
  border: none;
209
  line-height: 32px;
210
- padding: 0 7px 0 0;
211
  margin: 0 4px 0 10px;
212
  cursor: url("../../../assets/images/openhand.cur") 7 5, default;
213
  visibility: visible;
@@ -215,9 +220,7 @@
215
  #course_curriculum .curriculum-section-items .lp-section-item .item-checkbox input{
216
  opacity: 0.4;
217
  }
218
- #course_curriculum .curriculum-section-items .lp-section-item:not(.lp-item-empty):hover .item-checkbox{
219
- background: url("../../../assets/images/grippy_large.png") right no-repeat;
220
- }
221
  #course_curriculum .curriculum-section-items .lp-section-item:not(.lp-item-empty):hover .item-checkbox input{
222
  opacity: 1;
223
  }
@@ -259,6 +262,9 @@
259
  font-size: 16px;
260
  width: 100%;
261
  vertical-align: middle;
 
 
 
262
  }
263
  #course_curriculum .lp-section-describe{
264
  border: none;
1
+ /* meta box course */
2
+ .rwmb-duration-wrapper input[type="text"],
3
+ .rwmb-duration-wrapper select {
4
+ vertical-align: baseline;
5
+ }
6
  .post-type-lp_course #postdivrich{
7
  visibility: hidden;
8
  }
98
  }
99
  #course_curriculum .curriculum-section .lp-section-actions a{
100
  vertical-align: middle;
101
+ color: #666666;
102
  width: 24px;
103
  height: 24px;
104
  box-shadow: none;
148
  color: #444;
149
  }
150
  #course_curriculum .curriculum-section.lp-empty-section .curriculum-section-content{
151
+ _display: none;
152
  }
153
  #course_curriculum .curriculum-section-items{
154
  border-collapse: collapse;
171
  }
172
  #course_curriculum .curriculum-section-items .lp-section-item .lp-item-actions a{
173
  vertical-align: middle;
174
+ color: #666;
175
  margin-top: -2px;
176
  box-shadow: none;
177
  }
212
  height: 34px;
213
  border: none;
214
  line-height: 32px;
215
+ padding: 0 0 0 0;
216
  margin: 0 4px 0 10px;
217
  cursor: url("../../../assets/images/openhand.cur") 7 5, default;
218
  visibility: visible;
220
  #course_curriculum .curriculum-section-items .lp-section-item .item-checkbox input{
221
  opacity: 0.4;
222
  }
223
+
 
 
224
  #course_curriculum .curriculum-section-items .lp-section-item:not(.lp-item-empty):hover .item-checkbox input{
225
  opacity: 1;
226
  }
262
  font-size: 16px;
263
  width: 100%;
264
  vertical-align: middle;
265
+ text-overflow:ellipsis;
266
+ overflow: hidden;
267
+ white-space: nowrap;
268
  }
269
  #course_curriculum .lp-section-describe{
270
  border: none;
assets/css/admin/meta-box-question.css CHANGED
@@ -50,16 +50,3 @@
50
  .lpr-question-option input[type="text"] {
51
  width: 100%;
52
  }
53
- .lp-modal-search{
54
- background-color: #F5F5F5;
55
- color: #777;
56
- padding: 20px;
57
- height: 100%;
58
- }
59
- .lp-modal-search ul{
60
-
61
- }
62
- .lp-highlight-color{
63
- text-decoration: underline;
64
- color: #00a0d2;
65
- }
50
  .lpr-question-option input[type="text"] {
51
  width: 100%;
52
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/css/{global-style.css → global.css} RENAMED
@@ -1,3 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  .button.loading{
2
  }
3
  .button.loading:after,
@@ -70,12 +87,15 @@
70
  max-width: 100%;
71
  color: #777;
72
  }
 
 
 
73
  #learn-press-modal-search-items header input{
74
  width: 100%;
75
  }
76
  #learn-press-modal-search-items article{
77
  overflow: auto;
78
- margin: 20px 0;
79
  }
80
  #learn-press-modal-search-items article .lp-list-items{
81
  margin: 0;
@@ -90,6 +110,18 @@
90
 
91
  }
92
 
 
 
 
 
 
 
 
 
 
 
 
 
93
  .modal-inner{
94
  margin: 20px;
95
  }
1
+ .rwmb-duration-wrapper input[type="text"],
2
+ .rwmb-duration-wrapper select {
3
+ vertical-align: baseline;
4
+ }
5
+ .lp-modal-search{
6
+ background-color: #F5F5F5;
7
+ color: #777;
8
+ padding: 20px;
9
+ height: 100%;
10
+ }
11
+ .lp-modal-search ul{
12
+
13
+ }
14
+ .lp-highlight-color{
15
+ text-decoration: underline;
16
+ color: #00a0d2;
17
+ }
18
  .button.loading{
19
  }
20
  .button.loading:after,
87
  max-width: 100%;
88
  color: #777;
89
  }
90
+ .learnpress-search-notices.notice{
91
+ margin: 0 0 10px 0;
92
+ }
93
  #learn-press-modal-search-items header input{
94
  width: 100%;
95
  }
96
  #learn-press-modal-search-items article{
97
  overflow: auto;
98
+ margin: 10px 0;
99
  }
100
  #learn-press-modal-search-items article .lp-list-items{
101
  margin: 0;
110
 
111
  }
112
 
113
+ /* tooltip */
114
+ .learn-press-tooltip-bubble {
115
+ position: absolute;
116
+ background: rgba(26, 26, 26, 0.9);
117
+ color: #ffffff;
118
+ padding: 8px 10px;
119
+ font-size: 12px;
120
+ z-index: 9999999;
121
+ line-height: 1;
122
+ border-radius: 3px;
123
+ }
124
+
125
  .modal-inner{
126
  margin: 20px;
127
  }
assets/css/icons.css DELETED
@@ -1,36 +0,0 @@
1
- @font-face {
2
- font-family: 'learnpress';
3
- src: url('../fonts/icon.eot?ym8b3w');
4
- src: url('../fonts/icon.eot?ym8b3w#iefix') format('embedded-opentype'),
5
- url('../fonts/icon.ttf?ym8b3w') format('truetype'),
6
- url('../fonts/icon.woff?ym8b3w') format('woff'),
7
- url('../fonts/icon.svg?ym8b3w#icon') format('svg');
8
- font-weight: normal;
9
- font-style: normal;
10
- }
11
-
12
- [class^="learn-press-icon-"], [class*=" learn-press-icon-"], .learn-press-icon {
13
- font-family: 'learnpress';
14
- /*speak: none;*/
15
- font-style: normal;
16
- font-weight: normal;
17
- font-variant: normal;
18
- text-transform: none;
19
- line-height: 1;
20
-
21
- /* Better Font Rendering =========== */
22
- -webkit-font-smoothing: antialiased;
23
- -moz-osx-font-smoothing: grayscale;
24
- }
25
- .icon-checkmark:before {
26
- content: "\e903";
27
- }
28
- .icon-books:before {
29
- content: "\e900";
30
- }
31
- .icon-alarm:before {
32
- content: "\e901";
33
- }
34
- .icon-spinner:before {
35
- content: "\e902";
36
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/css/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php // Silence is golden.
assets/css/jalert.css ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* jAlerts */
2
+ #popup_container {
3
+ background: #FFF;
4
+ }
5
+ #popup_container #popup_title {
6
+ padding: 10px 20px;
7
+ background: #18B6C7;
8
+ color: #FFF;
9
+ font-size: 18px;
10
+ margin: 0;
11
+ }
12
+ #popup_container #popup_content {
13
+ padding: 20px;
14
+ }
15
+ #popup_container #popup_content #popup_message {
16
+ margin-bottom: 20px;
17
+ }
18
+ #popup_container #popup_panel {
19
+ text-align: center;
20
+ }
21
+ .single-lp_course .course-students {
22
+ padding-top: 10px;
23
+ }
24
+ .single-lp_course .course-students-list {
25
+ margin-top: 10px;
26
+ }
27
+ .single-lp_course .course-students-list .students {
28
+ list-style-type: none;
29
+ margin: 0;
30
+ }
31
+ .single-lp_course .course-students-list .students li {
32
+ display: inline-block;
33
+ margin-right: 10px;
34
+ }
35
+ .single-lp_course .course-students-list .students p {
36
+ margin-top: 15px;
37
+ }
38
+ .single-lp_course .lp_course .entry-footer {
39
+ display: none;
40
+ }
assets/css/learnpress-0.9.x.css DELETED
@@ -1,476 +0,0 @@
1
- .clearfix:after {
2
- display: block;
3
- content: '';
4
- clear: both;
5
- }
6
-
7
- .learnpress{
8
-
9
- }
10
-
11
- .learnpress h3{
12
- font-size: 2.7rem;
13
- line-height: 1.1852;
14
- margin-top: 2.3704em;
15
- margin-bottom: 1.1852em;
16
- }
17
-
18
- .learnpress .twentyfifteen .learnpress-content{
19
- padding-left: 7.6923%;
20
- padding-right: 7.6923%;
21
- padding-top: 7.6923%;
22
- margin-bottom: 7.6923%;
23
- background: #fff;
24
- box-shadow: 0 0 1px rgba(0,0,0,.15);
25
- }
26
- @media screen and (min-width: 59.6875em) {
27
- .twentyfifteen .learnpress-content{
28
- margin-left: 8.3333%;
29
- margin-right: 8.3333%;
30
- padding: 10%;
31
- }
32
- }
33
- @media screen and (min-width: 38.75em) {
34
- .twentyfifteen .learnpress-content {
35
- margin-right: 7.6923%;
36
- margin-left: 7.6923%;
37
- margin-top: 8.3333%;
38
- }
39
- }
40
- /***************************/
41
-
42
- #course-header {
43
-
44
- }
45
-
46
- #course-header:after {
47
- display: block;
48
- content: '';
49
- clear: both;
50
- }
51
-
52
- #course-main {
53
- }
54
-
55
- #course-main:after {
56
- content: '';
57
- display: block;
58
- clear: both;
59
- }
60
-
61
- #course-desc {
62
- width: 100%;
63
- }
64
-
65
- .course-info {
66
- width: 75%;
67
- float: left;
68
- }
69
-
70
- .course-getting, .course-related {
71
- width: 25%;
72
- float: right;
73
- }
74
-
75
- .course-free-button {
76
-
77
- }
78
-
79
- .learn-press {
80
-
81
- }
82
-
83
- .learn-press ul {
84
- list-style: none;
85
- }
86
-
87
- /* Course */
88
- .course-curriculum {
89
-
90
- }
91
-
92
- .course-curriculum .curriculum-sections {
93
-
94
- }
95
-
96
- .curriculum-sections .section {
97
- overflow: hidden;
98
- }
99
-
100
- .curriculum-sections .section .section-header {
101
- margin: 0 0 20px 0;
102
- }
103
-
104
- .curriculum-sections .section .section-header a {
105
- outline: none;
106
- font-size: 12px;
107
- float: right;
108
- }
109
-
110
- .curriculum-sections .section-content {
111
-
112
- }
113
-
114
- .curriculum-sections .section-content .course-lesson,
115
- .curriculum-sections .section-content .course-quiz {
116
- margin: 0 0 10px 0;
117
- }
118
-
119
- .curriculum-sections .section-content .lesson-quiz-icon {
120
- margin-right: 5px;
121
- }
122
-
123
- .curriculum-sections .section-content .course-lesson .lesson-quiz-icon:before,
124
- .curriculum-sections .section-content .course-quiz .lesson-quiz-icon:before {
125
- display: inline-block;
126
- width: 25px;
127
- height: 25px;
128
- border-radius: 50%;
129
- text-align: center;
130
- line-height: 25px;
131
- font-size: 12px;
132
- color: #FFF;
133
- background-color: #999;
134
- vertical-align: middle;
135
- }
136
-
137
- .curriculum-sections .section-content .course-lesson .lesson-quiz-icon.lesson:before {
138
- content: 'L';
139
- }
140
-
141
- .curriculum-sections .section-content .course-lesson.current .lesson-quiz-icon:before {
142
- content: "\f177";
143
- font-family: dashicons;
144
- background-color: transparent;
145
- color: #90DFFF;
146
- font-size: 24px;
147
- }
148
-
149
- .curriculum-sections .section-content .course-quiz .lesson-quiz-icon.quiz:before {
150
- content: 'Q';
151
- }
152
-
153
- .curriculum-sections .section-content .course-lesson.completed a,
154
- .curriculum-sections .section-content .course-quiz.completed a {
155
- text-decoration: line-through;
156
- border-bottom: none;
157
- }
158
-
159
- .curriculum-sections .section-content .course-lesson.loading .lesson-quiz-icon:before {
160
- content: '';
161
- background: url(../images/ajaxload.gif) no-repeat center;
162
- }
163
-
164
- .course-content-lesson-nav,
165
- .course-content-lesson-nav-text {
166
- overflow: hidden;
167
- }
168
-
169
- .course-content-lesson-nav-text {
170
- margin-top: 20px;
171
- margin-bottom: 0;
172
- text-transform: uppercase;
173
- font-size: 12px;
174
- font-weight: bold;
175
- border-top: 1px dashed #e0e0e0;
176
- padding-top: 20px;
177
- }
178
-
179
- .course-content-lesson-nav a {
180
- }
181
-
182
- .course-content-lesson-nav a.next-lesson,
183
- .course-content-lesson-nav-text .next-lesson-text {
184
- float: right;
185
- }
186
-
187
- #lesson-quiz-tooltip-container {
188
- display: none;
189
- visibility: hidden;
190
- }
191
-
192
- .lesson-quiz-tooltip {
193
- font-size: 14px;
194
- }
195
-
196
- /* Single Quiz Pagge*/
197
- .twentyfifteen .single-quiz {
198
- padding-left: 10%;
199
- padding-right: 10%;
200
- padding-bottom: 10%;
201
- }
202
-
203
- .quiz-question-nav-buttons button {
204
- _display: none;
205
- }
206
-
207
- .single-quiz .no-question {
208
- font-size: 14px;
209
- border: 1px solid #FFB6B6;
210
- padding: 10px;
211
- color: #FF7979;
212
- }
213
-
214
- .quiz-started .quiz-content, .quiz-completed .quiz-content {
215
- display: none;
216
- }
217
-
218
- .quiz-question-nav {
219
- margin-right: -250px;
220
- float: left;
221
- width: 100%;
222
- }
223
-
224
- .quiz-question-nav .lp-question-wrap {
225
- margin-right: 200px;
226
- }
227
-
228
- .quiz-sidebar {
229
- width: 230px;
230
- float: right;
231
- }
232
-
233
- #quiz-countdown {
234
- font-size: 48px;
235
- text-align: center;
236
- }
237
-
238
- .quiz-countdown-text {
239
- text-align: center;
240
- margin: 10px;
241
- line-height: 1.5;
242
- }
243
-
244
- .quiz-countdown-text span {
245
- display: block;
246
- }
247
-
248
- .quiz-buttons {
249
- text-align: center;
250
- }
251
-
252
- .quiz-questions > ul {
253
- list-style: none;
254
- margin: 20px 0;
255
- }
256
-
257
- .quiz-questions > ul li {
258
- list-style: none;
259
- margin: 0 0 15px 0;
260
- font-size: 14px;
261
- line-height: 1;
262
- }
263
-
264
- .quiz-questions > ul > li > h4 {
265
- font-weight: normal;
266
- }
267
-
268
- .quiz-questions > ul li.current > h4 {
269
- font-weight: bold;
270
- }
271
-
272
- .quiz-sidebar, .quiz-question-nav {
273
- margin-top: 20px;
274
- }
275
-
276
- .button-finish-quiz {
277
- display: none;
278
- }
279
-
280
- .quiz-started .button-finish-quiz {
281
- display: inline;
282
- }
283
-
284
- .quiz-result {
285
- margin-top: 20px;
286
- float: left;
287
- margin-right: -300px;
288
- width: 100%;
289
- }
290
-
291
- .quiz-result .quiz-result-mark {
292
- float: left;
293
- width: 150px;
294
- height: 150px;
295
- background-color: #F5F5F5;
296
- border-radius: 50%;
297
- text-align: center;
298
- box-sizing: border-box;
299
- padding-top: 30px;
300
- line-height: 1;
301
-
302
- }
303
-
304
- .quiz-result .quiz-result-mark .quiz-mark {
305
- font-size: 60px;
306
- display: block;
307
- }
308
-
309
- .quiz-result .quiz-result-mark .quiz-mark small {
310
- font-size: 20px;
311
- }
312
-
313
- .quiz-result .quiz-result-summary {
314
- float: left;
315
- margin-left: 30px;
316
- }
317
-
318
- .quiz-result .quiz-result-summary .quiz-result-field {
319
- margin: 0;
320
- font-size: 14px;
321
- }
322
-
323
- .quiz-result .quiz-result-summary .quiz-result-field > label {
324
- width: 100px;
325
- display: inline-block;
326
- }
327
-
328
- .quiz-result .quiz-result-summary .quiz-result-field.correct {
329
- color: #0066cc;
330
- }
331
-
332
- .quiz-result .quiz-result-summary .quiz-result-field.wrong {
333
- color: #BC0B0B;
334
- }
335
-
336
- .quiz-result .quiz-result-summary .quiz-result-field.empty {
337
- color: #869791;
338
- }
339
-
340
- #learn_press_payment_form {
341
- display: none;
342
- }
343
-
344
- #learn_press_payment_form .learn_press_payment_form {
345
- display: none;
346
- }
347
-
348
- #quiz-accordion > div {
349
- height: auto !important;
350
- }
351
-
352
- @media screen and (max-width: 480px) {
353
- .quiz-question-nav {
354
- margin-right: 0;
355
- float: none;
356
- }
357
-
358
- .quiz-sidebar {
359
- width: 100%;
360
- float: none;
361
- }
362
- }
363
-
364
- .lpr-question-hint {
365
- margin-top: 10px;
366
- line-height: 1.5;
367
- }
368
-
369
- .lpr-question-hint .correct {
370
- background: #CFE6FD;
371
- }
372
-
373
- .lpr-question-hint .wrong {
374
- background: #FCCED3;
375
- }
376
-
377
- .learn-press .message {
378
- border: 1px solid #90DFFF;
379
- background-color: #DFF6FF;
380
- padding: 10px;
381
- font-size: 12px;
382
- margin: 20px 0;
383
- border-radius: 5px;
384
- }
385
-
386
- .learn-press .message.error {
387
- border-color: #FF9090;
388
- background-color: #FFDFDF;
389
- }
390
-
391
- /* jAlert */
392
- #popup_container {
393
- border: 1px solid rgb(221, 221, 221);
394
- background-color: rgb(255, 255, 255);
395
- min-width: 350px;
396
- }
397
-
398
- #popup_container #popup_title,
399
- #popup_container #popup_content {
400
- margin: 20px;
401
- }
402
-
403
- #popup_container #popup_message {
404
- margin-bottom: 20px;
405
- }
406
-
407
- .lpr_course.has-post-thumbnail {
408
- padding-top: 8.3333% !important;
409
- }
410
-
411
- #course_taken .course,
412
- #course_made .course{
413
- list-style: none;
414
- }
415
- #course_taken .course > li,
416
- #course_made .course > li{
417
- margin: 0 0 20px 0;
418
- }
419
- #course_taken .course-status{
420
- font-size: 12px;
421
- display: inline-block;
422
- border-radius: 3px;
423
- padding: 0 5px;
424
- margin: 0 10px;
425
- }
426
- #course_taken .course-status.passed{
427
- background-color: #90DFFF;
428
- color: #FFF;
429
- }
430
- #user_quizzes:after {
431
- content: "";
432
- display: block;
433
- clear: both;
434
- }
435
- .videoWrapper {
436
- position: relative;
437
- padding-bottom: 56.25%; /* 16:9 */
438
- padding-top: 25px;
439
- height: 0;
440
- margin-bottom: 25px;
441
- }
442
- .videoWrapper iframe {
443
- position: absolute;
444
- top: 0;
445
- left: 0;
446
- width: 100%;
447
- height: 100%;
448
- }
449
-
450
- .question-hint-title {
451
-
452
- }
453
-
454
- .question-hint-title:hover {
455
- cursor: pointer;
456
- }
457
- .block-ui:before,
458
- .block-ui:after{
459
- position: absolute;
460
- top: 0;
461
- left: 0;
462
- right: 0;
463
- bottom: 0;
464
- content: '';
465
- }
466
- .block-ui:before{
467
- background-color: #E4E4E4;
468
- opacity: 0.3;
469
- }
470
- .block-ui:after{
471
- background: url(../images/ajax-loader.gif) no-repeat center;
472
- }
473
-
474
- .lpr_quiz {
475
- visibility: hidden;
476
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/css/learnpress.bak.css DELETED
@@ -1,899 +0,0 @@
1
- body.course-has-popup {
2
- overflow: hidden;
3
- }
4
- #course-curriculum-popup {
5
- position: fixed;
6
- top: 0;
7
- left: 0;
8
- right: 0;
9
- bottom: 0;
10
- background: #000;
11
- z-index: 999999;
12
- }
13
- #course-curriculum-popup #popup-sidebar {
14
- float: left;
15
- width: 350px;
16
- position: absolute;
17
- top: 0;
18
- bottom: 0;
19
- overflow: auto;
20
- background: #FFF;
21
- border-right: 1px solid #DDD;
22
- }
23
- #course-curriculum-popup #popup-sidebar .course-curriculum-title {
24
- display: none;
25
- }
26
- #course-curriculum-popup #popup-sidebar .curriculum-sections {
27
- margin: 0;
28
- font-size: smaller;
29
- }
30
- #course-curriculum-popup #popup-main {
31
- position: absolute;
32
- top: 0;
33
- left: 350px;
34
- right: 0;
35
- bottom: 0;
36
- background: #FFF;
37
- }
38
- #course-curriculum-popup #popup-main #popup-header {
39
- position: absolute;
40
- top: 0;
41
- left: 0;
42
- right: 0;
43
- height: 50px;
44
- background: #F5F5F5;
45
- border-bottom: 1px solid #DDD;
46
- }
47
- #course-curriculum-popup #popup-main #popup-header .popup-close {
48
- width: 50px;
49
- height: 50px;
50
- position: absolute;
51
- right: 0;
52
- top: 0;
53
- }
54
- #course-curriculum-popup #popup-main #popup-header .popup-close:before,
55
- #course-curriculum-popup #popup-main #popup-header .popup-close:after {
56
- content: '';
57
- border-top: 3px solid #636060;
58
- width: 30px;
59
- display: inline-block;
60
- position: absolute;
61
- }
62
- #course-curriculum-popup #popup-main #popup-header .popup-close:before {
63
- -webkit-transform: rotate(45deg);
64
- top: 25px;
65
- }
66
- #course-curriculum-popup #popup-main #popup-header .popup-close:after {
67
- -webkit-transform: rotate(-45deg);
68
- top: 25px;
69
- }
70
- #course-curriculum-popup #popup-main #popup-header h3 {
71
- margin: 0;
72
- height: 50px;
73
- line-height: 50px;
74
- padding: 0 20px;
75
- }
76
- #course-curriculum-popup #popup-main #popup-content {
77
- position: absolute;
78
- top: 50px;
79
- bottom: 50px;
80
- left: 0;
81
- right: 0;
82
- overflow: auto;
83
- }
84
- #course-curriculum-popup #popup-main #popup-content #popup-content-inner {
85
- margin: 20px;
86
- }
87
- #course-curriculum-popup #popup-main #popup-footer {
88
- position: absolute;
89
- bottom: 0;
90
- left: 0;
91
- right: 0;
92
- height: 50px;
93
- background: #F5F5F5;
94
- border-top: 1px solid #DDD;
95
- }
96
- .tp_single_event {
97
- color: red;
98
- }
99
- .tp_single_event :before {
100
- content: '';
101
- position: absolute;
102
- top: 0;
103
- left: 0;
104
- right: 0;
105
- bottom: 0;
106
- background: rgba(0, 0, 0, 0.5);
107
- }
108
- /*
109
- .column-lp_course .row-actions,
110
- .column-lp_quiz .row-actions {
111
- display: inline-block;
112
- margin-left: 10px;
113
- }
114
-
115
- .column-lp_course .row-actions a,
116
- .column-lp_quiz .row-actions a {
117
- color: #999;
118
- }*/
119
- /**/
120
- /* message box */
121
- #learn-press-message-box-block {
122
- position: fixed;
123
- top: 0;
124
- left: 0;
125
- right: 0;
126
- bottom: 0;
127
- background-color: #000;
128
- z-index: 99999;
129
- opacity: 0.8;
130
- }
131
- #learn-press-message-box-window {
132
- position: fixed;
133
- top: 0;
134
- bottom: 0;
135
- left: 0;
136
- right: 0;
137
- z-index: 100000;
138
- color: #FFF;
139
- text-align: center;
140
- }
141
- #message-box-wrap {
142
- margin: 0 auto;
143
- /* text-align: center; */
144
- display: inline-block;
145
- text-align: left;
146
- max-width: 70%;
147
- }
148
- .message-box-title {
149
- color: #FFF;
150
- margin: 0 0 40px 0;
151
- font-size: 34px;
152
- }
153
- .message-box-content {
154
- font-size: 16px;
155
- line-height: 1.5;
156
- }
157
- .message-box-animation {
158
- background-image: url("../images/animation.gif");
159
- width: 220px;
160
- height: 20px;
161
- margin: 20px 0 0;
162
- }
163
- .message-box-buttons {
164
- margin: 20px 0 0;
165
- border-top: 1px solid #929292;
166
- padding-top: 20px;
167
- }
168
- .message-box-button {
169
- margin-right: 10px !important;
170
- background-color: #FFFFFF;
171
- color: #999;
172
- }
173
- .message-box-button:hover {
174
- background-color: #F5F5F5;
175
- }
176
- .lp-label {
177
- display: inline-block;
178
- padding: 3px 8px;
179
- line-height: 1;
180
- font-size: 65%;
181
- vertical-align: baseline;
182
- color: #FFF;
183
- border-radius: 4px;
184
- }
185
- .lp-label-quiz {
186
- background-color: #53658C;
187
- }
188
- .lp-label-preview {
189
- background-color: #5cb85c;
190
- }
191
- .lp-label-viewing {
192
- background-color: #39afff;
193
- }
194
- .lp-label-lesson {
195
- background-color: #337ab7;
196
- }
197
- .lp-label-final {
198
- background-color: #FF6161;
199
- }
200
- .lp-label-completed {
201
- background-color: #39C7CE;
202
- }
203
- .lp-label-format {
204
- background-color: #ccc416;
205
- }
206
- .lp-label-format-aside {
207
- background-color: #ccc416;
208
- }
209
- .lp-label-format-image {
210
- background-color: #ccc416;
211
- }
212
- .lp-label-format-video {
213
- background-color: #ccc416;
214
- }
215
- .lp-label-format-quote {
216
- background-color: #ccc416;
217
- }
218
- .lp-label-format-link {
219
- background-color: #ccc416;
220
- }
221
- .lp-label-format-gallery {
222
- background-color: #ccc416;
223
- }
224
- .lp-label-format-status {
225
- background-color: #ccc416;
226
- }
227
- .lp-label-format-audio {
228
- background-color: #ccc416;
229
- }
230
- .lp-label-format-chat {
231
- background-color: #ccc416;
232
- }
233
- .course-item .lp-label-completed,
234
- .course-item .lp-label-viewing {
235
- display: none;
236
- }
237
- .course-item.item-completed .lp-label-completed,
238
- .course-item.item-current .lp-label-viewing {
239
- display: inline-block;
240
- }
241
- .course-meta > * {
242
- display: inline-block;
243
- font-style: italic;
244
- font-size: smaller;
245
- }
246
- .course-meta > *:after {
247
- content: ' | ';
248
- font-style: italic;
249
- }
250
- .course-meta > *:last-child:after {
251
- display: none;
252
- }
253
- /**/
254
- .learnpress ul,
255
- .learnpress li {
256
- list-style: none;
257
- }
258
- .learnpress h3 {
259
- font-size: 2.7rem;
260
- line-height: 1.1852;
261
- margin-top: 2.3704em;
262
- margin-bottom: 1.1852em;
263
- }
264
- .learnpress .learnpress-content {
265
- z-index: 100;
266
- position: relative;
267
- }
268
- .learnpress .twentyfifteen .learnpress-content {
269
- padding-left: 7.6923%;
270
- padding-right: 7.6923%;
271
- padding-top: 7.6923%;
272
- margin-bottom: 7.6923%;
273
- background: #fff;
274
- box-shadow: 0 0 1px rgba(0, 0, 0, 0.15);
275
- }
276
- .payment-method-form {
277
- display: none;
278
- }
279
- .learn-press-user-form {
280
- float: left;
281
- width: 50%;
282
- box-sizing: border-box;
283
- padding: 0 10px;
284
- }
285
- #learn-press-checkout-user-form {
286
- margin: 0 -10px;
287
- }
288
- /* archive */
289
- .learnpress .twentyfifteen .page-title {
290
- margin: 0 0 30px 0;
291
- }
292
- .course-introduce {
293
- margin: 20px 0 0 0;
294
- }
295
- .course-title,
296
- .course-title h3 {
297
- font-size: 18px;
298
- }
299
- /* pagination */
300
- .learn-press-pagination {
301
- text-align: center;
302
- }
303
- .learn-press-pagination ul > li {
304
- display: inline-block;
305
- }
306
- .learn-press-pagination ul > li a,
307
- .learn-press-pagination ul > li span {
308
- display: inline-block;
309
- padding: 0 10px;
310
- border: 1px solid #DDD;
311
- background-color: #F5F5F5;
312
- }
313
- .learn-press-pagination ul > li a {
314
- background-color: #FFF;
315
- }
316
- .learn-press-breadcrumb {
317
- margin: 0 0 20px 0;
318
- }
319
- /* course lesson nav */
320
- .course-item-nav {
321
- border-top: 1px dashed #DDD;
322
- overflow: hidden;
323
- margin: 20px 0;
324
- padding-top: 10px;
325
- }
326
- .course-item-nav .course-item-prev > *,
327
- .course-item-nav .course-item-next > * {
328
- display: block;
329
- }
330
- .course-item-nav > div > span {
331
- font-size: 70%;
332
- text-transform: uppercase;
333
- font-weight: bold;
334
- }
335
- .course-item-nav .course-item-prev {
336
- float: left;
337
- text-align: left;
338
- }
339
- .course-item-nav .course-item-next {
340
- float: right;
341
- text-align: right;
342
- }
343
- /* curriculum */
344
- .section-header {
345
- margin: 0 0 0 0;
346
- padding: 10px 15px;
347
- background-color: #EEE;
348
- }
349
- .section-header p {
350
- display: inline-block;
351
- font-weight: normal;
352
- font-style: italic;
353
- color: #999;
354
- font-size: smaller;
355
- margin: 0;
356
- }
357
- #learn-press-course-curriculum .section {
358
- margin: 0 0 1px 0;
359
- list-style: none;
360
- }
361
- #learn-press-course-curriculum .section-content {
362
- margin: 0;
363
- background-color: #F5F5F5;
364
- }
365
- #learn-press-course-curriculum .section .course-item {
366
- margin: 0 0 0;
367
- list-style: none;
368
- padding: 10px 15px;
369
- border-top: 1px solid #FFF;
370
- }
371
- #learn-press-course-curriculum .section .course-item-meta {
372
- display: block;
373
- float: right;
374
- line-height: 1;
375
- margin: 3px 0;
376
- }
377
- #learn-press-course-curriculum .section .course-item.section-empty {
378
- background-color: #F5F5F5;
379
- }
380
- #learn-press-course-curriculum .section .course-item.section-empty .learn-press-message {
381
- margin: 0;
382
- }
383
- /* QUIZ */
384
- .single-quiz .quiz-summary-left {
385
- float: left;
386
- width: 100%;
387
- padding-right: 320px;
388
- }
389
- .single-quiz .quiz-sidebar {
390
- float: right;
391
- width: 300px;
392
- margin-left: -300px;
393
- border: 2px solid #DDD;
394
- padding: 20px;
395
- }
396
- .single-quiz.quiz-completed .quiz-questions-list .learn-press-question-title {
397
- display: none;
398
- }
399
- .quiz-questions-list .current {
400
- font-weight: bold;
401
- }
402
- .quiz-questions-list .current a:after {
403
- display: inline-block;
404
- background-color: #0066cc;
405
- /* padding: 0px 8px; */
406
- color: #FFF;
407
- font-size: 70%;
408
- border-radius: 50%;
409
- content: '?';
410
- /* margin-left: 10px; */
411
- width: 20px;
412
- height: 20px;
413
- line-height: 20px;
414
- text-align: center;
415
- vertical-align: middle;
416
- }
417
- .quiz-countdown {
418
- text-align: center;
419
- }
420
- .quiz-countdown #quiz-countdown-value {
421
- font-size: 40px;
422
- line-height: 1;
423
- }
424
- .quiz-countdown .quiz-countdown-label {
425
- font-size: smaller;
426
- font-style: italic;
427
- color: #999;
428
- }
429
- .quiz-buttons {
430
- text-align: center;
431
- }
432
- .quiz-result {
433
- width: 100%;
434
- }
435
- .quiz-result .quiz-result-mark {
436
- float: left;
437
- width: 150px;
438
- height: 150px;
439
- background-color: #F5F5F5;
440
- border-radius: 50%;
441
- text-align: center;
442
- box-sizing: border-box;
443
- padding-top: 30px;
444
- line-height: 1;
445
- }
446
- .quiz-result .quiz-result-mark .quiz-mark {
447
- font-size: 60px;
448
- display: block;
449
- }
450
- .quiz-result .quiz-result-mark .quiz-mark small {
451
- font-size: 20px;
452
- }
453
- .quiz-result .quiz-result-summary {
454
- float: left;
455
- margin-left: 30px;
456
- }
457
- .quiz-result .quiz-result-summary .quiz-result-field {
458
- margin: 0;
459
- font-size: 14px;
460
- }
461
- .quiz-result .quiz-result-summary .quiz-result-field > label {
462
- width: 100px;
463
- display: inline-block;
464
- }
465
- .quiz-result .quiz-result-summary .quiz-result-field.correct {
466
- color: #0066cc;
467
- }
468
- .quiz-result .quiz-result-summary .quiz-result-field.wrong {
469
- color: #BC0B0B;
470
- }
471
- .quiz-result .quiz-result-summary .quiz-result-field.empty {
472
- color: #869791;
473
- }
474
- .quiz-history {
475
- font-size: 80%;
476
- }
477
- .quiz-history td {
478
- padding: 10px;
479
- }
480
- .quiz-history-actions {
481
- margin: 0;
482
- }
483
- /* profile */
484
- #learn-press-user-profile {
485
- overflow: hidden;
486
- }
487
- .learn-press-user-profile .user-info {
488
- margin: 0 0 20px;
489
- }
490
- .learn-press-user-profile .learn-press-tabs {
491
- list-style: none;
492
- margin: 0 0 20px;
493
- padding-left: 5px;
494
- border-bottom: 1px solid #DDD;
495
- }
496
- .learn-press-user-profile .learn-press-tabs > li {
497
- float: left;
498
- }
499
- .learn-press-user-profile .learn-press-tabs > li > a {
500
- box-shadow: none;
501
- outline: none;
502
- display: block;
503
- border: none;
504
- padding: 5px 10px;
505
- }
506
- .learn-press-user-profile .learn-press-tabs > li.current a {
507
- background-color: #FFF;
508
- border: 1px solid #DDD;
509
- border-bottom-color: transparent;
510
- z-index: 10;
511
- margin-bottom: -1px;
512
- }
513
- .learn-press-tabs-wrapper {
514
- margin: 0 0 20px;
515
- }
516
- .learn-press-user-profile .learn-press-tabs-wrapper > .learn-press-tab {
517
- /*padding: 0;
518
- float: left;
519
- width: 100%;
520
- margin-right: -100%;
521
- visibility: hidden;*/
522
- }
523
- .learn-press-user-profile .learn-press-tabs-wrapper {
524
- /*float: left;
525
- width: 100%;
526
- padding-left: 170px;*/
527
- }
528
- .learn-press-user-profile .profile-content-left {
529
- float: left;
530
- margin-left: -100%;
531
- margin-bottom: -100000px;
532
- padding-bottom: 100000px;
533
- background-color: #F5F5F5;
534
- }
535
- .profile-courses {
536
- list-style: none;
537
- }
538
- .profile-courses-heading {
539
- margin: 0 0 10px !important;
540
- }
541
- .learn-press-subtabs > li {
542
- display: inline-block;
543
- margin-right: 10px;
544
- }
545
- .learn-press-subtabs > li.current {
546
- font-weight: bold;
547
- }
548
- .learn-press-subtab-content {
549
- display: none;
550
- }
551
- .learn-press-subtab-content.current {
552
- display: block;
553
- }
554
- .hide-if-js {
555
- display: none;
556
- }
557
- /**/
558
- .learn-press-cart-table td,
559
- .learn-press-cart-table th {
560
- vertical-align: top;
561
- }
562
- .learn-press-cart-table .course-remove {
563
- width: 40px;
564
- }
565
- .learn-press-cart-table .course-thumbnail {
566
- width: 20%;
567
- }
568
- .learn-press-cart-table .course-price,
569
- .learn-press-cart-table .course-total {
570
- width: 15%;
571
- }
572
- /* notices */
573
- .learn-press-notice,
574
- .learn-press-message,
575
- .learn-press-error {
576
- list-style: none;
577
- margin: 0 0 20px 0;
578
- background-color: #F5F5F5;
579
- padding: 8px 15px;
580
- border-left: 5px solid;
581
- }
582
- .learn-press-notice {
583
- border-color: #1e85be;
584
- }
585
- .learn-press-message {
586
- border-color: #8fae1b;
587
- }
588
- .learn-press-error {
589
- border-color: #b81c23;
590
- }
591
- .open-hand {
592
- cursor: url("../../assets/images/openhand.cur") 7 5, default !important;
593
- }
594
- a .archive-course:hover {
595
- cursor: pointer;
596
- }
597
- .archive-course {
598
- border: 1px solid black;
599
- display: table;
600
- margin-bottom: 10px;
601
- width: 100%;
602
- }
603
- .course-cover {
604
- display: table-cell;
605
- height: 100px;
606
- width: 100px;
607
- }
608
- .course-detail {
609
- display: table-cell;
610
- vertical-align: top;
611
- padding-left: 10px;
612
- }
613
- .course-title {
614
- font-weight: bold;
615
- }
616
- .lp-button-dropdown {
617
- padding-right: 28px !important;
618
- position: relative;
619
- z-index: 99998;
620
- }
621
- .lp-course-progress {
622
- margin-right: 50px;
623
- }
624
- .lp-course-progress:after {
625
- display: block;
626
- content: '';
627
- clear: both;
628
- }
629
- .lp-course-progress .lp-course-progress-heading {
630
- margin: 0 0 40px 0;
631
- }
632
- .lp-course-progress .lp-progress-bar {
633
- height: 20px;
634
- background: #F5F5F5;
635
- position: relative;
636
- /* margin-right: 80px; */
637
- float: left;
638
- width: 100%;
639
- margin-bottom: 50px;
640
- -webkit-border-radius: 5px;
641
- -moz-border-radius: 5px;
642
- border-radius: 5px;
643
- }
644
- .lp-course-progress .lp-progress-value {
645
- height: 20px;
646
- background: #DDD;
647
- position: absolute;
648
- left: 0;
649
- -webkit-transition: width 0.25s;
650
- -moz-transition: width 0.25s;
651
- -ms-transition: width 0.25s;
652
- -o-transition: width 0.25s;
653
- transition: width 0.25s;
654
- -webkit-border-radius: 5px;
655
- -moz-border-radius: 5px;
656
- border-radius: 5px;
657
- }
658
- .lp-course-progress .lp-progress-value > span,
659
- .lp-course-progress .lp-passing-conditional span {
660
- display: inline-block;
661
- padding: 5px 10px;
662
- font-size: small;
663
- background: #DDD;
664
- position: absolute;
665
- right: 0;
666
- top: -35px;
667
- line-height: 1;
668
- white-space: nowrap;
669
- width: 50px;
670
- text-align: center;
671
- margin-right: -25px;
672
- -webkit-border-radius: 3px;
673
- -moz-border-radius: 3px;
674
- border-radius: 3px;
675
- }
676
- .lp-course-progress .lp-progress-value > span:after,
677
- .lp-course-progress .lp-passing-conditional span:after {
678
- content: '';
679
- display: block;
680
- border: 6px solid #DDD;
681
- position: absolute;
682
- border-color: transparent;
683
- border-top-color: #DDD;
684
- bottom: -12px;
685
- left: 50%;
686
- margin-left: -6px;
687
- }
688
- .lp-course-progress .lp-passing-conditional span {
689
- top: 30px;
690
- margin-left: -25px;
691
- }
692
- .lp-course-progress .lp-passing-conditional span:after {
693
- border-bottom-color: #DDD;
694
- top: -12px;
695
- left: 50%;
696
- border-top-color: transparent;
697
- bottom: auto;
698
- }
699
- .lp-course-progress .lp-progress-value.left > span {
700
- left: 100%;
701
- right: auto;
702
- }
703
- .lp-course-progress .lp-progress-value.left > span:after {
704
- bottom: -4px;
705
- transform: rotate(225deg);
706
- left: -10px;
707
- right: auto;
708
- }
709
- .lp-course-progress.passed .lp-progress-value {
710
- background: #83D0FF;
711
- -webkit-border-radius: 5px;
712
- -moz-border-radius: 5px;
713
- border-radius: 5px;
714
- }
715
- .lp-course-progress.passed .lp-progress-value > span {
716
- background: #83D0FF;
717
- }
718
- .lp-course-progress.passed .lp-progress-value > span:after {
719
- border-top-color: #83D0FF;
720
- }
721
- .lp-course-progress .lp-progress-total {
722
- width: 50px;
723
- float: right;
724
- margin-right: -50px;
725
- height: 20px;
726
- font-size: small;
727
- text-align: right;
728
- line-height: 20px;
729
- }
730
- .lp-course-progress .lp-passing-conditional {
731
- position: absolute;
732
- height: 20px;
733
- width: 1px;
734
- background-color: #FF0000;
735
- }
736
- .lp-course-progress .lp-passing-conditional.right span {
737
- right: 0;
738
- }
739
- .lp-course-progress .lp-passing-conditional.right span:after {
740
- left: auto;
741
- right: -10px;
742
- border-left-color: transparent;
743
- border-bottom-color: #DDD;
744
- }
745
- .quiz-questions-list .question-title {
746
- font-weight: normal;
747
- }
748
- .question-results .question-title:after {
749
- content: '';
750
- display: inline-block;
751
- font-family: dashicons;
752
- vertical-align: middle;
753
- font-size: 20px;
754
- }
755
- .question-results.correct .question-title:after {
756
- content: "\f147";
757
- }
758
- .question-results.incorrect .question-title:after {
759
- content: "\f335";
760
- }
761
- .learn-press-question-wrap.checked li.answer-true {
762
- background: #C4EBFF;
763
- }
764
- .learn-press-question-wrap.checked li.user-answer-false {
765
- color: #FF0000;
766
- }
767
- /* jAlerts */
768
- #popup_container {
769
- background: #FFF;
770
- }
771
- #popup_title {
772
- padding: 10px 20px;
773
- background: #18B6C7;
774
- color: #FFF;
775
- }
776
- #popup_content {
777
- padding: 20px;
778
- }
779
- #popup_message {
780
- margin-bottom: 20px;
781
- }
782
- .question-explanation-content,
783
- .question-hint-content {
784
- border: 1px solid #DDD;
785
- padding: 20px;
786
- background: #DDD;
787
- margin-bottom: 20px;
788
- }
789
- .question-explanation-content:before,
790
- .question-hint-content:before {
791
- content: attr(data-title);
792
- display: block;
793
- font-weight: bold;
794
- }
795
- .button-fade {
796
- opacity: 0.5;
797
- }
798
- .button-fade:hover {
799
- opacity: 1;
800
- }
801
- #learn-press-content-item {
802
- margin-bottom: 20px;
803
- background: #ffffff;
804
- border: 1px solid #DDD;
805
- padding: 20px;
806
- display: none;
807
- }
808
- #learn-press-content-item .course-lesson-heading {
809
- margin-top: 0;
810
- }
811
- #learn-press-content-item.loading {
812
- height: 50px;
813
- overflow: hidden;
814
- position: relative;
815
- }
816
- #learn-press-content-item.loading:before,
817
- #learn-press-content-item.loading:after {
818
- position: absolute;
819
- top: 0;
820
- left: 0;
821
- right: 0;
822
- bottom: 0;
823
- z-index: 10;
824
- background: #FFF;
825
- content: '';
826
- }
827
- #learn-press-content-item.loading:after {
828
- background: url("../images/ajax-loader.gif") center no-repeat;
829
- }
830
- .quiz-question-nav-buttons {
831
- margin: 10px 0;
832
- }
833
- @-ms-viewport {
834
- width: device-width;
835
- }
836
- @viewport {
837
- width: device-width;
838
- }
839
- /**
840
- * Mobile Large 620px
841
- */
842
- @media screen and (min-width: 38.75em) {
843
- .twentyfifteen .learnpress-content {
844
- margin-right: 7.6923%;
845
- margin-left: 7.6923%;
846
- margin-top: 8.3333%;
847
- }
848
- }
849
- @media screen and (max-width: 38.75em) {
850
- .single-quiz .quiz-sidebar {
851
- width: 100%;
852
- }
853
- .learnpress ul {
854
- margin-left: 0;
855
- }
856
- #learn-press-course-curriculum .section .course-item-meta {
857
- float: none;
858
- }
859
- }
860
- /**
861
- * Tablet Small 740px
862
- */
863
- /**
864
- * Tablet Large 880px
865
- */
866
- /**
867
- * Desktop Small 955px
868
- */
869
- @media screen and (min-width: 59.6875em) {
870
- .twentyfifteen .learnpress-content {
871
- margin-left: 8.3333%;
872
- margin-right: 8.3333%;
873
- padding: 10%;
874
- }
875
- }
876
- @media screen and (max-width: 59.6875em) {
877
- .twentyfifteen .learnpress-content {
878
- padding: 10%;
879
- }
880
- }
881
- /**
882
- * Desktop Medium 1100px
883
- */
884
- @media screen and (max-width: 68.75em) {
885
- .single-quiz .quiz-summary-left,
886
- .single-quiz .quiz-sidebar {
887
- float: none;
888
- margin: 0 auto;
889
- }
890
- .single-quiz .quiz-summary-left {
891
- padding-right: 0;
892
- }
893
- }
894
- /**
895
- * Desktop Large 1240px
896
- */
897
- /**
898
- * Desktop X-Large 1403px
899
- */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/css/learnpress.bak.less DELETED
@@ -1,1153 +0,0 @@
1
-
2
- body.course-has-popup{
3
- overflow: hidden;
4
- }
5
- #course-curriculum-popup {
6
- position: fixed;
7
- top: 0;
8
- left: 0;
9
- right: 0;
10
- bottom: 0;
11
- background: #000;
12
- z-index: 999999;
13
- #popup-sidebar {
14
- float: left;
15
- width: 350px;
16
- position: absolute;
17
- top: 0;
18
- bottom: 0;
19
- overflow: auto;
20
- background: #FFF;
21
- border-right: 1px solid #DDD;
22
- .course-curriculum-title{
23
- display: none;
24
- }
25
- .curriculum-sections{
26
- margin: 0;
27
- font-size: smaller;
28
- }
29
- }
30
- #popup-main {
31
- position: absolute;
32
- top: 0;
33
- left: 350px;
34
- right: 0;
35
- bottom: 0;
36
- background: #FFF;
37
- #popup-header {
38
- position: absolute;
39
- top: 0;
40
- left: 0;
41
- right: 0;
42
- height: 50px;
43
- background: #F5F5F5;
44
- border-bottom: 1px solid #DDD;
45
- .popup-close{
46
- width: 50px;
47
- height: 50px;
48
- position: absolute;
49
- right: 0;
50
- top: 0;
51
- &:before,
52
- &:after{
53
- content: '';
54
- border-top: 3px solid #636060;
55
- width: 30px;
56
- display: inline-block;
57
- position: absolute;
58
- }
59
- &:before{
60
- -webkit-transform: rotate(45deg);
61
- top: 25px;
62
- }
63
- &:after{
64
- -webkit-transform: rotate(-45deg);
65
- top: 25px;
66
- }
67
- }
68
- h3{
69
- margin: 0;
70
- height: 50px;
71
- line-height: 50px;
72
- padding: 0 20px;
73
- }
74
-
75
- }
76
- #popup-content{
77
- position: absolute;
78
- top:50px;
79
- bottom: 50px;
80
- left: 0;
81
- right: 0;
82
- overflow: auto;
83
- #popup-content-inner{
84
- margin: 20px;
85
- }
86
- }
87
- #popup-footer {
88
- position: absolute;
89
- bottom: 0;
90
- left: 0;
91
- right: 0;
92
- height: 50px;
93
- background: #F5F5F5;
94
- border-top:1px solid #DDD;
95
- }
96
- }
97
- }
98
- .tp_single_event &{
99
- color: red;
100
- &:before {
101
- content: '';
102
- position: absolute;
103
- top: 0;
104
- left: 0;
105
- right: 0;
106
- bottom: 0;
107
- background: rgba(0, 0, 0, 0.5);
108
- }
109
- }
110
- /*
111
- .column-lp_course .row-actions,
112
- .column-lp_quiz .row-actions {
113
- display: inline-block;
114
- margin-left: 10px;
115
- }
116
-
117
- .column-lp_course .row-actions a,
118
- .column-lp_quiz .row-actions a {
119
- color: #999;
120
- }*/
121
-
122
- /**/
123
- /* message box */
124
- #learn-press-message-box-block {
125
- position: fixed;
126
- top: 0;
127
- left: 0;
128
- right: 0;
129
- bottom: 0;
130
- background-color: #000;
131
- z-index: 99999;
132
- opacity: 0.8;
133
- }
134
-
135
- #learn-press-message-box-window {
136
- position: fixed;
137
- top: 0;
138
- bottom: 0;
139
- left: 0;
140
- right: 0;
141
- z-index: 100000;
142
- color: #FFF;
143
- text-align: center;
144
- }
145
-
146
- #message-box-wrap {
147
- margin: 0 auto;
148
- /* text-align: center; */
149
- display: inline-block;
150
- text-align: left;
151
- max-width: 70%;
152
- }
153
-
154
- .message-box-title {
155
- color: #FFF;
156
- margin: 0 0 40px 0;
157
- font-size: 34px;
158
- }
159
-
160
- .message-box-content {
161
- font-size: 16px;
162
- line-height: 1.5;
163
- }
164
-
165
- .message-box-animation {
166
- background-image: url("../images/animation.gif");
167
- width: 220px;
168
- height: 20px;
169
- margin: 20px 0 0;
170
- }
171
-
172
- .message-box-buttons {
173
- margin: 20px 0 0;
174
- border-top: 1px solid #929292;
175
- padding-top: 20px;
176
- }
177
-
178
- .message-box-button {
179
- margin-right: 10px !important;
180
- background-color: #FFFFFF;
181
- color: #999;
182
- }
183
-
184
- .message-box-button:hover {
185
- background-color: #F5F5F5;
186
- }
187
-
188
- .lp-label {
189
- display: inline-block;
190
- padding: 3px 8px;
191
- line-height: 1;
192
- font-size: 65%;
193
- vertical-align: baseline;
194
- color: #FFF;
195
- border-radius: 4px;
196
- }
197
-
198
- .lp-label-quiz {
199
- background-color: #53658C;
200
- }
201
-
202
- .lp-label-preview {
203
- background-color: #5cb85c;
204
- }
205
-
206
- .lp-label-viewing {
207
- background-color: #39afff;
208
- }
209
-
210
- .lp-label-lesson {
211
- background-color: #337ab7;
212
- }
213
-
214
- .lp-label-final {
215
- background-color: #FF6161;
216
- }
217
-
218
- .lp-label-completed {
219
- background-color: #39C7CE;
220
- }
221
-
222
- .lp-label-format {
223
- background-color: #ccc416;
224
- }
225
-
226
- .lp-label-format-aside {
227
- background-color: #ccc416;
228
- }
229
-
230
- .lp-label-format-image {
231
- background-color: #ccc416;
232
- }
233
-
234
- .lp-label-format-video {
235
- background-color: #ccc416;
236
- }
237
-
238
- .lp-label-format-quote {
239
- background-color: #ccc416;
240
- }
241
-
242
- .lp-label-format-link {
243
- background-color: #ccc416;
244
- }
245
-
246
- .lp-label-format-gallery {
247
- background-color: #ccc416;
248
- }
249
-
250
- .lp-label-format-status {
251
- background-color: #ccc416;
252
- }
253
-
254
- .lp-label-format-audio {
255
- background-color: #ccc416;
256
- }
257
-
258
- .lp-label-format-chat {
259
- background-color: #ccc416;
260
- }
261
-
262
- .course-item .lp-label-completed,
263
- .course-item .lp-label-viewing {
264
- display: none;
265
- }
266
-
267
- .course-item.item-completed .lp-label-completed,
268
- .course-item.item-current .lp-label-viewing {
269
- display: inline-block;
270
- }
271
-
272
- .course-meta > * {
273
- display: inline-block;
274
- font-style: italic;
275
- font-size: smaller;
276
- }
277
-
278
- .course-meta > *:after {
279
- content: ' | ';
280
- font-style: italic;
281
- }
282
-
283
- .course-meta > *:last-child:after {
284
- display: none;
285
- }
286
-
287
- /**/
288
- .learnpress {
289
-
290
- }
291
-
292
- .learnpress ul,
293
- .learnpress li {
294
- list-style: none;
295
- }
296
-
297
- .learnpress h3 {
298
- font-size: 2.7rem;
299
- line-height: 1.1852;
300
- margin-top: 2.3704em;
301
- margin-bottom: 1.1852em;
302
- }
303
-
304
- .learnpress .learnpress-content {
305
- z-index: 100;
306
- position: relative;
307
- }
308
-
309
- .learnpress .twentyfifteen .learnpress-content {
310
- padding-left: 7.6923%;
311
- padding-right: 7.6923%;
312
- padding-top: 7.6923%;
313
- margin-bottom: 7.6923%;
314
- background: #fff;
315
- box-shadow: 0 0 1px rgba(0, 0, 0, .15);
316
- }
317
-
318
- .learn-press-checkout-payment {
319
-
320
- }
321
-
322
- .payment-method-form {
323
- display: none;
324
- }
325
-
326
- .learn-press-user-form {
327
- float: left;
328
- width: 50%;
329
- box-sizing: border-box;
330
- padding: 0 10px;
331
- }
332
-
333
- .learn-press-user-form .form-heading {
334
- }
335
-
336
- .learn-press-user-form .form-subheading {
337
-
338
- }
339
-
340
- .learn-press-user-form .form-content {
341
-
342
- }
343
-
344
- .learn-press-user-form .form-fields {
345
-
346
- }
347
-
348
- #learn-press-checkout-user-form {
349
- margin: 0 -10px;
350
- }
351
-
352
- /* archive */
353
- .learnpress .twentyfifteen .page-title {
354
- margin: 0 0 30px 0;
355
- }
356
-
357
- .course-introduce {
358
- margin: 20px 0 0 0;
359
- }
360
-
361
- .course-introduce .more-link {
362
-
363
- }
364
-
365
- .course-title,
366
- .course-title h3 {
367
- font-size: 18px;
368
- }
369
-
370
- .archive .lp_course {
371
- }
372
-
373
- /* pagination */
374
- .learn-press-pagination {
375
- text-align: center;
376
- }
377
-
378
- .learn-press-pagination ul > li {
379
- display: inline-block;
380
- }
381
-
382
- .learn-press-pagination ul > li a,
383
- .learn-press-pagination ul > li span {
384
- display: inline-block;
385
- padding: 0 10px;
386
- border: 1px solid #DDD;
387
- background-color: #F5F5F5;
388
- }
389
-
390
- .learn-press-pagination ul > li a {
391
- background-color: #FFF;
392
- }
393
-
394
- .learn-press-breadcrumb {
395
- margin: 0 0 20px 0;
396
- }
397
-
398
- /* course lesson nav */
399
- .course-item-nav {
400
- border-top: 1px dashed #DDD;
401
- overflow: hidden;
402
- margin: 20px 0;
403
- padding-top: 10px;
404
- }
405
-
406
- .course-item-nav .course-item-prev > *,
407
- .course-item-nav .course-item-next > * {
408
- display: block;
409
- }
410
-
411
- .course-item-nav > div > span {
412
- font-size: 70%;
413
- text-transform: uppercase;
414
- font-weight: bold;
415
- }
416
-
417
- .course-item-nav .course-item-prev {
418
- float: left;
419
- text-align: left;
420
- }
421
-
422
- .course-item-nav .course-item-next {
423
- float: right;
424
- text-align: right;
425
- }
426
-
427
- /* curriculum */
428
- .section-header {
429
- margin: 0 0 0 0;
430
- padding: 10px 15px;
431
- background-color: #EEE;
432
- }
433
-
434
- .section-header p {
435
- display: inline-block;
436
- font-weight: normal;
437
- font-style: italic;
438
- color: #999;
439
- font-size: smaller;
440
- margin: 0;
441
- }
442
-
443
- #learn-press-course-curriculum .section {
444
- margin: 0 0 1px 0;
445
- list-style: none;
446
- }
447
-
448
- #learn-press-course-curriculum .section-content {
449
- margin: 0;
450
- background-color: #F5F5F5;
451
- }
452
-
453
- #learn-press-course-curriculum .section .course-item {
454
- margin: 0 0 0;
455
- list-style: none;
456
- padding: 10px 15px;
457
- border-top: 1px solid #FFF;
458
- }
459
-
460
- #learn-press-course-curriculum .section .course-item-meta {
461
- display: block;
462
- float: right;
463
- line-height: 1;
464
- margin: 3px 0;
465
- }
466
-
467
- #learn-press-course-curriculum .section .course-item.section-empty {
468
- background-color: #F5F5F5;
469
- }
470
-
471
- #learn-press-course-curriculum .section .course-item.section-empty .learn-press-message {
472
- margin: 0;
473
- }
474
-
475
- /* QUIZ */
476
- .single-quiz {
477
-
478
- }
479
-
480
- .single-quiz .quiz-summary-left {
481
- float: left;
482
- width: 100%;
483
- padding-right: 320px;
484
- }
485
-
486
- .single-quiz .quiz-sidebar {
487
- float: right;
488
- width: 300px;
489
- margin-left: -300px;
490
- border: 2px solid #DDD;
491
- padding: 20px;
492
- }
493
-
494
- .single-quiz.quiz-completed .quiz-questions-list .learn-press-question-title {
495
- display: none;
496
- }
497
-
498
- .quiz-questions-list .current {
499
- font-weight: bold;
500
- }
501
-
502
- .quiz-questions-list .current a:after {
503
- display: inline-block;
504
- background-color: #0066cc;
505
- /* padding: 0px 8px; */
506
- color: #FFF;
507
- font-size: 70%;
508
- border-radius: 50%;
509
- content: '?';
510
- /* margin-left: 10px; */
511
- width: 20px;
512
- height: 20px;
513
- line-height: 20px;
514
- text-align: center;
515
- vertical-align: middle;
516
- }
517
-
518
- .quiz-countdown {
519
- text-align: center;
520
- }
521
-
522
- .quiz-countdown #quiz-countdown-value {
523
- font-size: 40px;
524
- line-height: 1;
525
- }
526
-
527
- .quiz-countdown .quiz-countdown-label {
528
- font-size: smaller;
529
- font-style: italic;
530
- color: #999;
531
- }
532
-
533
- .quiz-buttons {
534
- text-align: center;
535
- }
536
-
537
- .quiz-result {
538
- width: 100%;
539
- }
540
-
541
- .quiz-result .quiz-result-mark {
542
- float: left;
543
- width: 150px;
544
- height: 150px;
545
- background-color: #F5F5F5;
546
- border-radius: 50%;
547
- text-align: center;
548
- box-sizing: border-box;
549
- padding-top: 30px;
550
- line-height: 1;
551
-
552
- }
553
-
554
- .quiz-result .quiz-result-mark .quiz-mark {
555
- font-size: 60px;
556
- display: block;
557
- }
558
-
559
- .quiz-result .quiz-result-mark .quiz-mark small {
560
- font-size: 20px;
561
- }
562
-
563
- .quiz-result .quiz-result-summary {
564
- float: left;
565
- margin-left: 30px;
566
- }
567
-
568
- .quiz-result .quiz-result-summary .quiz-result-field {
569
- margin: 0;
570
- font-size: 14px;
571
- }
572
-
573
- .quiz-result .quiz-result-summary .quiz-result-field > label {
574
- width: 100px;
575
- display: inline-block;
576
- }
577
-
578
- .quiz-result .quiz-result-summary .quiz-result-field.correct {
579
- color: #0066cc;
580
- }
581
-
582
- .quiz-result .quiz-result-summary .quiz-result-field.wrong {
583
- color: #BC0B0B;
584
- }
585
-
586
- .quiz-result .quiz-result-summary .quiz-result-field.empty {
587
- color: #869791;
588
- }
589
-
590
- .quiz-history {
591
- font-size: 80%;
592
- }
593
-
594
- .quiz-history td {
595
- padding: 10px;
596
- }
597
-
598
- .quiz-history-actions {
599
- margin: 0;
600
- }
601
-
602
- /* profile */
603
- #learn-press-user-profile {
604
- overflow: hidden;
605
- }
606
-
607
- .learn-press-user-profile .user-info {
608
- margin: 0 0 20px;
609
- }
610
-
611
- .learn-press-user-profile .user-basic-info {
612
-
613
- }
614
-
615
- .learn-press-user-profile .learn-press-tabs {
616
- list-style: none;
617
- margin: 0 0 20px;
618
- padding-left: 5px;
619
- border-bottom: 1px solid #DDD;
620
- }
621
-
622
- .learn-press-user-profile .learn-press-tabs > li {
623
- float: left;
624
- }
625
-
626
- .learn-press-user-profile .learn-press-tabs > li > a {
627
- box-shadow: none;
628
- outline: none;
629
- display: block;
630
- border: none;
631
- padding: 5px 10px;
632
- }
633
-
634
- .learn-press-user-profile .learn-press-tabs > li.current a {
635
- background-color: #FFF;
636
- border: 1px solid #DDD;
637
- border-bottom-color: transparent;
638
- z-index: 10;
639
- margin-bottom: -1px;
640
- }
641
-
642
- .learn-press-tabs-wrapper {
643
- margin: 0 0 20px;
644
- }
645
-
646
- .learn-press-user-profile .learn-press-tabs-wrapper > .learn-press-tab {
647
- /*padding: 0;
648
- float: left;
649
- width: 100%;
650
- margin-right: -100%;
651
- visibility: hidden;*/
652
- }
653
-
654
- .learn-press-user-profile .entry-tab-inner {
655
- }
656
-
657
- .learn-press-user-profile .learn-press-tabs-wrapper {
658
- /*float: left;
659
- width: 100%;
660
- padding-left: 170px;*/
661
- }
662
-
663
- .learn-press-user-profile .profile-content-left {
664
- float: left;
665
- margin-left: -100%;
666
- margin-bottom: -100000px;
667
- padding-bottom: 100000px;
668
- background-color: #F5F5F5;
669
- }
670
-
671
- .profile-courses {
672
- list-style: none;
673
- }
674
-
675
- .profile-courses > li {
676
-
677
- }
678
-
679
- .profile-courses > li > a {
680
- }
681
-
682
- .profile-courses-heading {
683
- margin: 0 0 10px !important;
684
- }
685
-
686
- .learn-press-subtabs {
687
- }
688
-
689
- .learn-press-subtabs > li {
690
- display: inline-block;
691
- margin-right: 10px;
692
- }
693
-
694
- .learn-press-subtabs > li.current {
695
- font-weight: bold;
696
- }
697
-
698
- .learn-press-subtab-content {
699
- display: none;
700
- }
701
-
702
- .learn-press-subtab-content.current {
703
- display: block;
704
- }
705
-
706
- .hide-if-js {
707
- display: none;
708
- }
709
-
710
- /**/
711
- .purchase-course .view-cart-button {
712
-
713
- }
714
-
715
- .learn-press-cart-table td,
716
- .learn-press-cart-table th {
717
- vertical-align: top;
718
- }
719
-
720
- .learn-press-cart-table .course-remove {
721
- width: 40px;
722
- }
723
-
724
- .learn-press-cart-table .course-thumbnail {
725
- width: 20%;
726
- }
727
-
728
- .learn-press-cart-table .course-price,
729
- .learn-press-cart-table .course-total {
730
- width: 15%;
731
- }
732
-
733
- /* notices */
734
- .learn-press-notice,
735
- .learn-press-message,
736
- .learn-press-error {
737
- list-style: none;
738
- margin: 0 0 20px 0;
739
- background-color: #F5F5F5;
740
- padding: 8px 15px;
741
- border-left: 5px solid;
742
- }
743
-
744
- .learn-press-notice {
745
- border-color: #1e85be;
746
- }
747
-
748
- .learn-press-message {
749
- border-color: #8fae1b;
750
- }
751
-
752
- .learn-press-error {
753
- border-color: #b81c23;
754
- }
755
-
756
- .open-hand {
757
- cursor: url("../../assets/images/openhand.cur") 7 5, default !important;
758
- }
759
-
760
- a .archive-course:hover {
761
- cursor: pointer;
762
- }
763
-
764
- .archive-course {
765
- border: 1px solid black;
766
- display: table;
767
- margin-bottom: 10px;
768
- width: 100%;
769
- }
770
-
771
- .course-cover {
772
- display: table-cell;
773
- height: 100px;
774
- width: 100px;
775
- }
776
-
777
- .course-detail {
778
- display: table-cell;
779
- vertical-align: top;
780
- padding-left: 10px;
781
- }
782
-
783
- .course-title {
784
- font-weight: bold;
785
- }
786
-
787
- .lp-button-dropdown {
788
- padding-right: 28px !important;
789
- position: relative;
790
- z-index: 99998;
791
- }
792
-
793
- .lp-course-progress {
794
- margin-right: 50px;
795
- }
796
-
797
- .lp-course-progress:after {
798
- display: block;
799
- content: '';
800
- clear: both;
801
- }
802
-
803
- .lp-course-progress .lp-course-progress-heading {
804
- margin: 0 0 40px 0;
805
- }
806
-
807
- .lp-course-progress .lp-progress-bar {
808
- height: 20px;
809
- background: #F5F5F5;
810
- position: relative;
811
- /* margin-right: 80px; */
812
- float: left;
813
- width: 100%;
814
- margin-bottom: 50px;
815
- -webkit-border-radius: 5px;
816
- -moz-border-radius: 5px;
817
- border-radius: 5px;
818
- }
819
-
820
- .lp-course-progress .lp-progress-value {
821
- height: 20px;
822
- background: #DDD;
823
- position: absolute;
824
- left: 0;
825
- -webkit-transition: width 0.25s;
826
- -moz-transition: width 0.25s;
827
- -ms-transition: width 0.25s;
828
- -o-transition: width 0.25s;
829
- transition: width 0.25s;
830
- -webkit-border-radius: 5px;
831
- -moz-border-radius: 5px;
832
- border-radius: 5px;;
833
- }
834
-
835
- .lp-course-progress .lp-progress-value > span,
836
- .lp-course-progress .lp-passing-conditional span {
837
- display: inline-block;
838
- padding: 5px 10px;
839
- font-size: small;
840
- background: #DDD;
841
- position: absolute;
842
- right: 0;
843
- top: -35px;
844
- line-height: 1;
845
- white-space: nowrap;
846
- width: 50px;
847
- text-align: center;
848
- margin-right: -25px;
849
- -webkit-border-radius: 3px;
850
- -moz-border-radius: 3px;
851
- border-radius: 3px;
852
- }
853
-
854
- .lp-course-progress .lp-progress-value > span:after,
855
- .lp-course-progress .lp-passing-conditional span:after {
856
- content: '';
857
- display: block;
858
- border: 6px solid #DDD;
859
- position: absolute;
860
- border-color: transparent;
861
- border-top-color: #DDD;
862
- bottom: -12px;
863
- left: 50%;
864
- margin-left: -6px;
865
- }
866
-
867
- .lp-course-progress .lp-passing-conditional span {
868
- top: 30px;
869
- margin-left: -25px;
870
- }
871
-
872
- .lp-course-progress .lp-passing-conditional span:after {
873
- border-bottom-color: #DDD;
874
- top: -12px;
875
- left: 50%;
876
- border-top-color: transparent;
877
- bottom: auto;
878
- }
879
-
880
- .lp-course-progress .lp-progress-value.left > span {
881
- left: 100%;
882
- right: auto;
883
- }
884
-
885
- .lp-course-progress .lp-progress-value.left > span:after {
886
- bottom: -4px;
887
- transform: rotate(225deg);
888
- left: -10px;
889
- right: auto;
890
- }
891
-
892
- .lp-course-progress.passed .lp-progress-value {
893
- background: #83D0FF;
894
- -webkit-border-radius: 5px;
895
- -moz-border-radius: 5px;
896
- border-radius: 5px;
897
- }
898
-
899
- .lp-course-progress.passed .lp-progress-value > span {
900
- background: #83D0FF;
901
- }
902
-
903
- .lp-course-progress.passed .lp-progress-value > span:after {
904
- border-top-color: #83D0FF;
905
- }
906
-
907
- .lp-course-progress .lp-progress-total {
908
- width: 50px;
909
- float: right;
910
- margin-right: -50px;
911
- height: 20px;
912
- font-size: small;
913
- text-align: right;
914
- line-height: 20px;
915
- }
916
-
917
- .lp-course-progress .lp-passing-conditional {
918
- position: absolute;
919
- height: 20px;
920
- width: 1px;
921
- background-color: #FF0000;
922
- }
923
-
924
- .lp-course-progress .lp-passing-conditional.right span {
925
- right: 0;
926
- }
927
-
928
- .lp-course-progress .lp-passing-conditional.right span:after {
929
- left: auto;
930
- right: -10px;
931
- border-left-color: transparent;
932
- border-bottom-color: #DDD;
933
- }
934
-
935
- .quiz-questions-list .question-title {
936
- font-weight: normal;
937
- }
938
-
939
- .question-results .question-title:after {
940
- content: '';
941
- display: inline-block;
942
- font-family: dashicons;
943
- vertical-align: middle;
944
- font-size: 20px;
945
- }
946
-
947
- .question-results.correct .question-title:after {
948
- content: "\f147";
949
- }
950
-
951
- .question-results.incorrect .question-title:after {
952
- content: "\f335";
953
- }
954
-
955
- .question-results.skipped {
956
- }
957
-
958
- .complete-lesson-button.completed {
959
-
960
- }
961
-
962
- .learn-press-question-wrap {
963
-
964
- }
965
-
966
- .learn-press-question-wrap.checked li.answer-true {
967
- background: #C4EBFF;
968
- }
969
-
970
- .learn-press-question-wrap.checked li.user-answer-false {
971
- color: #FF0000;
972
- }
973
-
974
- /* jAlerts */
975
- #popup_container {
976
- background: #FFF;
977
- }
978
-
979
- #popup_title {
980
- padding: 10px 20px;
981
- background: #18B6C7;
982
- color: #FFF;
983
- }
984
-
985
- #popup_content {
986
- padding: 20px;
987
- }
988
-
989
- #popup_message {
990
- margin-bottom: 20px;
991
- }
992
-
993
- .question-explanation-content,
994
- .question-hint-content {
995
- border: 1px solid #DDD;
996
- padding: 20px;
997
- background: #DDD;
998
- margin-bottom: 20px;
999
- }
1000
-
1001
- .question-explanation-content:before,
1002
- .question-hint-content:before {
1003
- content: attr(data-title);
1004
- display: block;
1005
- font-weight: bold;
1006
- }
1007
-
1008
- .button-fade {
1009
- opacity: 0.5;
1010
- }
1011
-
1012
- .button-fade:hover {
1013
- opacity: 1;
1014
- }
1015
-
1016
- #learn-press-content-item {
1017
- margin-bottom: 20px;
1018
- background: #ffffff;
1019
- border: 1px solid #DDD;
1020
- padding: 20px;
1021
- display: none;
1022
- }
1023
-
1024
- #learn-press-content-item .course-lesson-heading {
1025
- margin-top: 0;
1026
- }
1027
-
1028
- #learn-press-content-item.loading {
1029
- height: 50px;
1030
- overflow: hidden;
1031
- position: relative;
1032
- }
1033
-
1034
- #learn-press-content-item.loading:before,
1035
- #learn-press-content-item.loading:after {
1036
- position: absolute;
1037
- top: 0;
1038
- left: 0;
1039
- right: 0;
1040
- bottom: 0;
1041
- z-index: 10;
1042
- background: #FFF;
1043
- content: '';
1044
- }
1045
-
1046
- #learn-press-content-item.loading:after {
1047
- background: url("../images/ajax-loader.gif") center no-repeat;
1048
- }
1049
-
1050
- #learn-press-course-lesson {
1051
- }
1052
-
1053
- .quiz-question-nav-buttons {
1054
- margin: 10px 0;
1055
- }
1056
-
1057
- @-ms-viewport {
1058
- width: device-width;
1059
- }
1060
-
1061
- @viewport {
1062
- width: device-width;
1063
- }
1064
-
1065
- /**
1066
- * Mobile Large 620px
1067
- */
1068
- @media screen and (min-width: 38.75em) {
1069
- .twentyfifteen .learnpress-content {
1070
- margin-right: 7.6923%;
1071
- margin-left: 7.6923%;
1072
- margin-top: 8.3333%;
1073
- }
1074
- }
1075
-
1076
- @media screen and (max-width: 38.75em) {
1077
- .single-quiz .quiz-sidebar {
1078
- width: 100%;
1079
- }
1080
-
1081
- .learnpress ul {
1082
- margin-left: 0;
1083
- }
1084
-
1085
- #learn-press-course-curriculum .section .course-item-meta {
1086
- float: none;
1087
- }
1088
- }
1089
-
1090
- /**
1091
- * Tablet Small 740px
1092
- */
1093
-
1094
- @media screen and (min-width: 46.25em) {
1095
-
1096
- }
1097
-
1098
- /**
1099
- * Tablet Large 880px
1100
- */
1101
-
1102
- @media screen and (min-width: 55em) {
1103
- }
1104
-
1105
- /**
1106
- * Desktop Small 955px
1107
- */
1108
-
1109
- @media screen and (min-width: 59.6875em) {
1110
- .twentyfifteen .learnpress-content {
1111
- margin-left: 8.3333%;
1112
- margin-right: 8.3333%;
1113
- padding: 10%;
1114
- }
1115
- }
1116
-
1117
- @media screen and (max-width: 59.6875em) {
1118
-
1119
- .twentyfifteen .learnpress-content {
1120
- padding: 10%;
1121
- }
1122
- }
1123
-
1124
- /**
1125
- * Desktop Medium 1100px
1126
- */
1127
-
1128
- @media screen and (max-width: 68.75em) {
1129
- .single-quiz .quiz-summary-left,
1130
- .single-quiz .quiz-sidebar {
1131
- float: none;
1132
- margin: 0 auto;
1133
- }
1134
-
1135
- .single-quiz .quiz-summary-left {
1136
- padding-right: 0;
1137
- }
1138
- }
1139
-
1140
- /**
1141
- * Desktop Large 1240px
1142
- */
1143
-
1144
- @media screen and (min-width: 77.5em) {
1145
- }
1146
-
1147
- /**
1148
- * Desktop X-Large 1403px
1149
- */
1150
-
1151
- @media screen and (min-width: 87.6875em) {
1152
-
1153
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/css/learnpress.css CHANGED
@@ -1,1316 +1,2231 @@
1
- .clearfix:after {
2
- display: block;
3
- content: '';
4
- clear: both;
5
- }
6
-
7
- .column-lp_course .row-actions,
8
- .column-lp_quiz .row-actions {
9
- display: inline-block;
10
- margin-left: 10px;
11
- }
12
-
13
- .column-lp_course .row-actions a,
14
- .column-lp_quiz .row-actions a {
15
- color: #999;
16
- }
17
-
18
- /**/
19
- /* message box */
20
- #learn-press-message-box-block {
21
- position: fixed;
22
- top: 0;
23
- left: 0;
24
- right: 0;
25
- bottom: 0;
26
- background-color: #000;
27
- z-index: 99999;
28
- opacity: 0.8;
29
- }
30
-
31
- #learn-press-message-box-window {
32
- position: fixed;
33
- top: 0;
34
- bottom: 0;
35
- left: 0;
36
- right: 0;
37
- z-index: 100000;
38
- color: #FFF;
39
- text-align: center;
40
- }
41
-
42
- #message-box-wrap {
43
- margin: 0 auto;
44
- /* text-align: center; */
45
- display: inline-block;
46
- text-align: left;
47
- max-width: 70%;
48
- }
49
-
50
- .message-box-title {
51
- color: #FFF;
52
- margin: 0 0 40px 0;
53
- font-size: 34px;
54
- }
55
-
56
- .message-box-content {
57
- font-size: 16px;
58
- line-height: 1.5;
59
- }
60
-
61
- .message-box-animation {
62
- background-image: url("../images/animation.gif");
63
- width: 220px;
64
- height: 20px;
65
- margin: 20px 0 0;
66
- }
67
-
68
- .message-box-buttons {
69
- margin: 20px 0 0;
70
- border-top: 1px solid #929292;
71
- padding-top: 20px;
72
- }
73
-
74
- .message-box-button {
75
- margin-right: 10px !important;
76
- background-color: #FFFFFF;
77
- color: #999;
78
- }
79
-
80
- .message-box-button:hover {
81
- background-color: #F5F5F5;
82
- }
83
-
84
- .lp-label {
85
- display: inline-block;
86
- padding: 3px 8px;
87
- line-height: 1;
88
- font-size: 65%;
89
- vertical-align: baseline;
90
- color: #FFF;
91
- border-radius: 4px;
92
- }
93
-
94
- .lp-label-quiz {
95
- background-color: #53658C;
96
- }
97
-
98
- .lp-label-preview {
99
- background-color: #5cb85c;
100
- }
101
-
102
- .lp-label-viewing {
103
- background-color: #39afff;
104
- }
105
-
106
- .lp-label-lesson {
107
- background-color: #337ab7;
108
- }
109
-
110
- .lp-label-final {
111
- background-color: #FF6161;
112
- }
113
-
114
- .lp-label-completed {
115
- background-color: #39C7CE;
116
- }
117
-
118
- .lp-label-format {
119
- background-color: #ccc416;
120
- }
121
-
122
- .lp-label-format-aside {
123
- background-color: #ccc416;
124
- }
125
-
126
- .lp-label-format-image {
127
- background-color: #ccc416;
128
- }
129
-
130
- .lp-label-format-video {
131
- background-color: #ccc416;
132
- }
133
-
134
- .lp-label-format-quote {
135
- background-color: #ccc416;
136
- }
137
-
138
- .lp-label-format-link {
139
- background-color: #ccc416;
140
- }
141
-
142
- .lp-label-format-gallery {
143
- background-color: #ccc416;
144
- }
145
-
146
- .lp-label-format-status {
147
- background-color: #ccc416;
148
- }
149
-
150
- .lp-label-format-audio {
151
- background-color: #ccc416;
152
- }
153
-
154
- .lp-label-format-chat {
155
- background-color: #ccc416;
156
- }
157
-
158
- .course-item .lp-label-completed,
159
- .course-item .lp-label-viewing {
160
- display: none;
161
- }
162
-
163
- .course-item.item-completed .lp-label-completed,
164
- .course-item.item-current .lp-label-viewing {
165
- display: inline-block;
166
- }
167
-
168
- .course-meta > * {
169
- display: inline-block;
170
- font-style: italic;
171
- font-size: smaller;
172
- }
173
-
174
- .course-meta > *:after {
175
- content: ' | ';
176
- font-style: italic;
177
- }
178
-
179
- .course-meta > *:last-child:after {
180
- display: none;
181
- }
182
- /**/
183
- .learnpress {
184
-
185
- }
186
-
187
- .learnpress ul,
188
- .learnpress li {
189
- list-style: none;
190
- }
191
-
192
- .learnpress h3 {
193
- font-size: 2.7rem;
194
- line-height: 1.1852;
195
- margin-top: 2.3704em;
196
- margin-bottom: 1.1852em;
197
- }
198
-
199
- .learnpress .learnpress-content {
200
- z-index: 100;
201
- position: relative;
202
- }
203
-
204
- .learnpress .twentyfifteen .learnpress-content {
205
- padding-left: 7.6923%;
206
- padding-right: 7.6923%;
207
- padding-top: 7.6923%;
208
- margin-bottom: 7.6923%;
209
- background: #fff;
210
- box-shadow: 0 0 1px rgba(0, 0, 0, .15);
211
- }
212
-
213
- .learn-press-checkout-payment {
214
-
215
- }
216
-
217
- .payment-method-form {
218
- display: none;
219
- }
220
-
221
- .learn-press-user-form {
222
- float: left;
223
- width: 50%;
224
- box-sizing: border-box;
225
- padding: 0 10px;
226
- }
227
-
228
- .learn-press-user-form .form-heading {
229
- }
230
-
231
- .learn-press-user-form .form-subheading {
232
-
233
- }
234
-
235
- .learn-press-user-form .form-content {
236
-
237
- }
238
-
239
- .learn-press-user-form .form-fields {
240
-
241
- }
242
-
243
- #learn-press-checkout-user-form {
244
- margin: 0 -10px;
245
- }
246
-
247
- /* archive */
248
- .learnpress .twentyfifteen .page-title {
249
- margin: 0 0 30px 0;
250
- }
251
-
252
- .course-introduce {
253
- margin: 20px 0 0 0;
254
- }
255
-
256
- .course-introduce .more-link {
257
-
258
- }
259
-
260
- .course-title,
261
- .course-title h3 {
262
- font-size: 18px;
263
- }
264
-
265
- .archive .lp_course {
266
- }
267
-
268
- /* pagination */
269
- .learn-press-pagination {
270
- text-align: center;
271
- }
272
-
273
- .learn-press-pagination ul > li {
274
- display: inline-block;
275
- }
276
-
277
- .learn-press-pagination ul > li a,
278
- .learn-press-pagination ul > li span {
279
- display: inline-block;
280
- padding: 0 10px;
281
- border: 1px solid #DDD;
282
- background-color: #F5F5F5;
283
- }
284
-
285
- .learn-press-pagination ul > li a {
286
- background-color: #FFF;
287
- }
288
-
289
- .learn-press-breadcrumb {
290
- margin: 0 0 20px 0;
291
- }
292
-
293
- /* course lesson nav */
294
- .course-item-nav {
295
- border-top: 1px dashed #DDD;
296
- overflow: hidden;
297
- margin: 20px 0;
298
- padding-top: 10px;
299
- }
300
-
301
- .course-item-nav .course-item-prev > *,
302
- .course-item-nav .course-item-next > * {
303
- display: block;
304
- }
305
-
306
- .course-item-nav > div > span {
307
- font-size: 70%;
308
- text-transform: uppercase;
309
- font-weight: bold;
310
- }
311
-
312
- .course-item-nav .course-item-prev {
313
- float: left;
314
- text-align: left;
315
- }
316
-
317
- .course-item-nav .course-item-next {
318
- float: right;
319
- text-align: right;
320
- }
321
-
322
- /* curriculum */
323
- .section-header {
324
- margin: 0 0 0 0;
325
- padding: 10px 15px;
326
- background-color: #EEE;
327
- }
328
-
329
- .section-header p {
330
- display: inline-block;
331
- font-weight: normal;
332
- font-style: italic;
333
- color: #999;
334
- font-size: smaller;
335
- margin: 0;
336
- }
337
-
338
- #learn-press-course-curriculum .section {
339
- margin: 0 0 1px 0;
340
- list-style: none;
341
- }
342
-
343
- #learn-press-course-curriculum .section-content {
344
- margin: 0;
345
- background-color: #F5F5F5;
346
- }
347
-
348
- #learn-press-course-curriculum .section .course-item {
349
- margin: 0 0 0;
350
- list-style: none;
351
- padding: 10px 15px;
352
- border-top: 1px solid #FFF;
353
- }
354
-
355
- #learn-press-course-curriculum .section .course-item-meta {
356
- display: block;
357
- float: right;
358
- line-height: 1;
359
- margin: 3px 0;
360
- }
361
-
362
- #learn-press-course-curriculum .section .course-item.section-empty {
363
- background-color: #F5F5F5;
364
- }
365
-
366
- #learn-press-course-curriculum .section .course-item.section-empty .learn-press-message {
367
- margin: 0;
368
- }
369
-
370
- /* QUIZ */
371
- .single-quiz {
372
-
373
- }
374
-
375
- .single-quiz .quiz-summary-left {
376
- float: left;
377
- width: 100%;
378
- padding-right: 320px;
379
- }
380
-
381
- .single-quiz .quiz-sidebar {
382
- float: right;
383
- width: 300px;
384
- margin-left: -300px;
385
- border: 2px solid #DDD;
386
- padding: 20px;
387
- }
388
-
389
- .single-quiz.quiz-completed .quiz-questions-list .learn-press-question-title {
390
- display: none;
391
- }
392
-
393
- .quiz-questions-list .current {
394
- font-weight: bold;
395
- }
396
-
397
- .quiz-questions-list .current a:after {
398
- display: inline-block;
399
- background-color: #0066cc;
400
- /* padding: 0px 8px; */
401
- color: #FFF;
402
- font-size: 70%;
403
- border-radius: 50%;
404
- content: '?';
405
- /* margin-left: 10px; */
406
- width: 20px;
407
- height: 20px;
408
- line-height: 20px;
409
- text-align: center;
410
- vertical-align: middle;
411
- }
412
-
413
- .quiz-countdown {
414
- text-align: center;
415
- }
416
-
417
- .quiz-countdown #quiz-countdown-value {
418
- font-size: 40px;
419
- line-height: 1;
420
- }
421
-
422
- .quiz-countdown .quiz-countdown-label {
423
- font-size: smaller;
424
- font-style: italic;
425
- color: #999;
426
- }
427
-
428
- .quiz-buttons {
429
- text-align: center;
430
- }
431
-
432
- .quiz-result {
433
- width: 100%;
434
- }
435
-
436
- .quiz-result .quiz-result-mark {
437
- float: left;
438
- width: 150px;
439
- height: 150px;
440
- background-color: #F5F5F5;
441
- border-radius: 50%;
442
- text-align: center;
443
- box-sizing: border-box;
444
- padding-top: 30px;
445
- line-height: 1;
446
-
447
- }
448
-
449
- .quiz-result .quiz-result-mark .quiz-mark {
450
- font-size: 60px;
451
- display: block;
452
- }
453
-
454
- .quiz-result .quiz-result-mark .quiz-mark small {
455
- font-size: 20px;
456
- }
457
-
458
- .quiz-result .quiz-result-summary {
459
- float: left;
460
- margin-left: 30px;
461
- }
462
-
463
- .quiz-result .quiz-result-summary .quiz-result-field {
464
- margin: 0;
465
- font-size: 14px;
466
- }
467
-
468
- .quiz-result .quiz-result-summary .quiz-result-field > label {
469
- width: 100px;
470
- display: inline-block;
471
- }
472
-
473
- .quiz-result .quiz-result-summary .quiz-result-field.correct {
474
- color: #0066cc;
475
- }
476
-
477
- .quiz-result .quiz-result-summary .quiz-result-field.wrong {
478
- color: #BC0B0B;
479
- }
480
-
481
- .quiz-result .quiz-result-summary .quiz-result-field.empty {
482
- color: #869791;
483
- }
484
-
485
- .quiz-history {
486
- font-size: 80%;
487
- }
488
-
489
- .quiz-history td {
490
- padding: 10px;
491
- }
492
-
493
- .quiz-history-actions {
494
- margin: 0;
495
- }
496
-
497
- /* profile */
498
- #learn-press-user-profile {
499
- overflow: hidden;
500
- }
501
-
502
- .learn-press-user-profile .user-info {
503
- margin: 0 0 20px;
504
- }
505
-
506
- .learn-press-user-profile .user-basic-info {
507
-
508
- }
509
-
510
- .learn-press-user-profile .learn-press-tabs {
511
- list-style: none;
512
- margin: 0 0 20px;
513
- padding-left: 5px;
514
- border-bottom: 1px solid #DDD;
515
- }
516
-
517
- .learn-press-user-profile .learn-press-tabs > li {
518
- float: left;
519
- }
520
-
521
- .learn-press-user-profile .learn-press-tabs > li > a {
522
- box-shadow: none;
523
- outline: none;
524
- display: block;
525
- border: none;
526
- padding: 5px 10px;
527
- }
528
-
529
- .learn-press-user-profile .learn-press-tabs > li.current a {
530
- background-color: #FFF;
531
- border: 1px solid #DDD;
532
- border-bottom-color: transparent;
533
- z-index: 10;
534
- margin-bottom: -1px;
535
- }
536
-
537
- .learn-press-tabs-wrapper {
538
- margin: 0 0 20px;
539
- }
540
-
541
- .learn-press-user-profile .learn-press-tabs-wrapper > .learn-press-tab {
542
- /*padding: 0;
543
- float: left;
544
- width: 100%;
545
- margin-right: -100%;
546
- visibility: hidden;*/
547
- }
548
-
549
- .learn-press-user-profile .entry-tab-inner {
550
- }
551
-
552
- .learn-press-user-profile .learn-press-tabs-wrapper {
553
- /*float: left;
554
- width: 100%;
555
- padding-left: 170px;*/
556
- }
557
-
558
- .learn-press-user-profile .profile-content-left {
559
- float: left;
560
- margin-left: -100%;
561
- margin-bottom: -100000px;
562
- padding-bottom: 100000px;
563
- background-color: #F5F5F5;
564
- }
565
-
566
- .profile-courses {
567
- list-style: none;
568
- }
569
-
570
- .profile-courses > li {
571
-
572
- }
573
-
574
- .profile-courses > li > a {
575
- }
576
-
577
- .profile-courses-heading {
578
- margin: 0 0 10px !important;
579
- }
580
-
581
- .learn-press-subtabs {
582
- }
583
-
584
- .learn-press-subtabs > li {
585
- display: inline-block;
586
- margin-right: 10px;
587
- }
588
-
589
- .learn-press-subtabs > li.current {
590
- font-weight: bold;
591
- }
592
-
593
- .learn-press-subtab-content {
594
- display: none;
595
- }
596
-
597
- .learn-press-subtab-content.current {
598
- display: block;
599
- }
600
-
601
- .hide-if-js {
602
- display: none;
603
- }
604
-
605
- /**/
606
- .purchase-course .view-cart-button {
607
-
608
- }
609
-
610
- .learn-press-cart-table td,
611
- .learn-press-cart-table th {
612
- vertical-align: top;
613
- }
614
-
615
- .learn-press-cart-table .course-remove {
616
- width: 40px;
617
- }
618
-
619
- .learn-press-cart-table .course-thumbnail {
620
- width: 20%;
621
- }
622
-
623
- .learn-press-cart-table .course-price,
624
- .learn-press-cart-table .course-total {
625
- width: 15%;
626
- }
627
-
628
- /* notices */
629
- .learn-press-notice,
630
- .learn-press-message,
631
- .learn-press-error {
632
- list-style: none;
633
- margin: 0 0 20px 0;
634
- background-color: #F5F5F5;
635
- padding: 8px 15px;
636
- border-left: 5px solid;
637
- }
638
-
639
- .learn-press-notice {
640
- border-color: #1e85be;
641
- }
642
-
643
- .learn-press-message {
644
- border-color: #8fae1b;
645
- }
646
-
647
- .learn-press-error {
648
- border-color: #b81c23;
649
- }
650
-
651
- .open-hand {
652
- cursor: url("../../assets/images/openhand.cur") 7 5, default !important;
653
- }
654
-
655
- a .archive-course:hover {
656
- cursor: pointer;
657
- }
658
-
659
- .archive-course {
660
- border: 1px solid black;
661
- display: table;
662
- margin-bottom: 10px;
663
- width: 100%;
664
- }
665
-
666
- .course-cover {
667
- display: table-cell;
668
- height: 100px;
669
- width: 100px;
670
- }
671
-
672
- .course-detail {
673
- display: table-cell;
674
- vertical-align: top;
675
- padding-left: 10px;
676
- }
677
-
678
- .course-title {
679
- font-weight: bold;
680
- }
681
-
682
- .lp-button-dropdown {
683
- padding-right: 28px !important;
684
- position: relative;
685
- z-index: 99998;
686
- }
687
-
688
- .lp-course-progress {
689
- margin-right: 50px;
690
- }
691
-
692
- .lp-course-progress:after {
693
- display: block;
694
- content: '';
695
- clear: both;
696
- }
697
-
698
- .lp-course-progress .lp-course-progress-heading {
699
- margin: 0 0 40px 0;
700
- }
701
-
702
- .lp-course-progress .lp-progress-bar {
703
- height: 20px;
704
- background: #F5F5F5;
705
- position: relative;
706
- /* margin-right: 80px; */
707
- float: left;
708
- width: 100%;
709
- margin-bottom: 50px;
710
- -webkit-border-radius: 5px;
711
- -moz-border-radius: 5px;
712
- border-radius: 5px;
713
- }
714
-
715
- .lp-course-progress .lp-progress-value {
716
- height: 20px;
717
- background: #DDD;
718
- position: absolute;
719
- left: 0;
720
- -webkit-transition: width 0.25s;
721
- -moz-transition: width 0.25s;
722
- -ms-transition: width 0.25s;
723
- -o-transition: width 0.25s;
724
- transition: width 0.25s;
725
- -webkit-border-radius: 5px;
726
- -moz-border-radius: 5px;
727
- border-radius: 5px;;
728
- }
729
-
730
- .lp-course-progress .lp-progress-value > span,
731
- .lp-course-progress .lp-passing-conditional span {
732
- display: inline-block;
733
- padding: 5px 10px;
734
- font-size: small;
735
- background: #DDD;
736
- position: absolute;
737
- right: 0;
738
- top: -35px;
739
- line-height: 1;
740
- white-space: nowrap;
741
- width: 50px;
742
- text-align: center;
743
- margin-right: -25px;
744
- -webkit-border-radius: 3px;
745
- -moz-border-radius: 3px;
746
- border-radius: 3px;
747
- }
748
-
749
- .lp-course-progress .lp-progress-value > span:after,
750
- .lp-course-progress .lp-passing-conditional span:after {
751
- content: '';
752
- display: block;
753
- border: 6px solid #DDD;
754
- position: absolute;
755
- border-color: transparent;
756
- border-top-color: #DDD;
757
- bottom: -12px;
758
- left: 50%;
759
- margin-left: -6px;
760
- }
761
-
762
- .lp-course-progress .lp-passing-conditional span {
763
- top: 30px;
764
- margin-left: -25px;
765
- }
766
-
767
- .lp-course-progress .lp-passing-conditional span:after {
768
- border-bottom-color: #DDD;
769
- top: -12px;
770
- left: 50%;
771
- border-top-color: transparent;
772
- bottom: auto;
773
- }
774
-
775
- .lp-course-progress .lp-progress-value.left > span {
776
- left: 100%;
777
- right: auto;
778
- }
779
-
780
- .lp-course-progress .lp-progress-value.left > span:after {
781
- bottom: -4px;
782
- transform: rotate(225deg);
783
- left: -10px;
784
- right: auto;
785
- }
786
-
787
- .lp-course-progress.passed .lp-progress-value {
788
- background: #83D0FF;
789
- -webkit-border-radius: 5px;
790
- -moz-border-radius: 5px;
791
- border-radius: 5px;
792
- }
793
-
794
- .lp-course-progress.passed .lp-progress-value > span {
795
- background: #83D0FF;
796
- }
797
-
798
- .lp-course-progress.passed .lp-progress-value > span:after {
799
- border-top-color: #83D0FF;
800
- }
801
-
802
- .lp-course-progress .lp-progress-total {
803
- width: 50px;
804
- float: right;
805
- margin-right: -50px;
806
- height: 20px;
807
- font-size: small;
808
- text-align: right;
809
- line-height: 20px;
810
- }
811
-
812
- .lp-course-progress .lp-passing-conditional {
813
- position: absolute;
814
- height: 20px;
815
- width: 1px;
816
- background-color: #FF0000;
817
- }
818
-
819
- .lp-course-progress .lp-passing-conditional.right span {
820
- right: 0;
821
- }
822
-
823
- .lp-course-progress .lp-passing-conditional.right span:after {
824
- left: auto;
825
- right: -10px;
826
- border-left-color: transparent;
827
- border-bottom-color: #DDD;
828
- }
829
-
830
- .quiz-questions-list .question-title {
831
- font-weight: normal;
832
- }
833
-
834
- .question-results .question-title:after {
835
- content: '';
836
- display: inline-block;
837
- font-family: dashicons;
838
- vertical-align: middle;
839
- font-size: 20px;
840
- }
841
-
842
- .question-results.correct .question-title:after {
843
- content: "\f147";
844
- }
845
-
846
- .question-results.incorrect .question-title:after {
847
- content: "\f335";
848
- }
849
-
850
- .question-results.skipped {
851
- }
852
-
853
- .complete-lesson-button.completed {
854
-
855
- }
856
-
857
- .learn-press-question-wrap {
858
-
859
- }
860
-
861
- .learn-press-question-wrap.checked li.answer-true {
862
- background: #C4EBFF;
863
- }
864
-
865
- .learn-press-question-wrap.checked li.user-answer-false {
866
- color: #FF0000;
867
- }
868
-
869
- /* jAlerts */
870
- #popup_container {
871
- background: #FFF;
872
- }
873
-
874
- #popup_title {
875
- padding: 10px 20px;
876
- background: #18B6C7;
877
- color: #FFF;
878
- }
879
-
880
- #popup_content {
881
- padding: 20px;
882
- }
883
-
884
- #popup_message {
885
- margin-bottom: 20px;
886
- }
887
-
888
- .question-explanation-content,
889
- .question-hint-content {
890
- border: 1px solid #DDD;
891
- padding: 20px;
892
- background: #DDD;
893
- margin-bottom: 20px;
894
- }
895
-
896
- .question-explanation-content:before,
897
- .question-hint-content:before {
898
- content: attr(data-title);
899
- display: block;
900
- font-weight: bold;
901
- }
902
-
903
- .button-fade {
904
- opacity: 0.5;
905
- }
906
-
907
- .button-fade:hover {
908
- opacity: 1;
909
- }
910
-
911
- #learn-press-content-item {
912
- margin-bottom: 20px;
913
- background: #ffffff;
914
- border: 1px solid #DDD;
915
- padding: 20px;
916
- display: none;
917
- }
918
- #learn-press-content-item .course-lesson-heading{
919
- margin-top: 0;
920
- }
921
- #learn-press-content-item.loading {
922
- height: 50px;
923
- overflow: hidden;
924
- position: relative;
925
- }
926
-
927
- #learn-press-content-item.loading:before,
928
- #learn-press-content-item.loading:after {
929
- position: absolute;
930
- top: 0;
931
- left: 0;
932
- right: 0;
933
- bottom: 0;
934
- z-index: 10;
935
- background: #FFF;
936
- content: '';
937
- }
938
-
939
- #learn-press-content-item.loading:after {
940
- background: url("../images/ajax-loader.gif") center no-repeat;
941
- }
942
-
943
- #learn-press-course-lesson {
944
- }
945
-
946
- .quiz-question-nav-buttons {
947
- margin: 10px 0;
948
- }
949
-
950
- @-ms-viewport {
951
- width: device-width;
952
- }
953
-
954
- @viewport {
955
- width: device-width;
956
- }
957
-
958
- /**
959
- * Mobile Large 620px
960
- */
961
- @media screen and (min-width: 38.75em) {
962
- .twentyfifteen .learnpress-content {
963
- margin-right: 7.6923%;
964
- margin-left: 7.6923%;
965
- margin-top: 8.3333%;
966
- }
967
- }
968
-
969
- @media screen and (max-width: 38.75em) {
970
- .single-quiz .quiz-sidebar {
971
- width: 100%;
972
- }
973
-
974
- .learnpress ul {
975
- margin-left: 0;
976
- }
977
-
978
- #learn-press-course-curriculum .section .course-item-meta {
979
- float: none;
980
- }
981
- }
982
-
983
- /**
984
- * Tablet Small 740px
985
- */
986
-
987
- @media screen and (min-width: 46.25em) {
988
-
989
- }
990
-
991
- /**
992
- * Tablet Large 880px
993
- */
994
-
995
- @media screen and (min-width: 55em) {
996
- }
997
-
998
- /**
999
- * Desktop Small 955px
1000
- */
1001
-
1002
- @media screen and (min-width: 59.6875em) {
1003
- .twentyfifteen .learnpress-content {
1004
- margin-left: 8.3333%;
1005
- margin-right: 8.3333%;
1006
- padding: 10%;
1007
- }
1008
- }
1009
-
1010
- @media screen and (max-width: 59.6875em) {
1011
-
1012
- .twentyfifteen .learnpress-content {
1013
- padding: 10%;
1014
- }
1015
- }
1016
-
1017
- /**
1018
- * Desktop Medium 1100px
1019
- */
1020
-
1021
- @media screen and (max-width: 68.75em) {
1022
- .single-quiz .quiz-summary-left,
1023
- .single-quiz .quiz-sidebar {
1024
- float: none;
1025
- margin: 0 auto;
1026
- }
1027
-
1028
- .single-quiz .quiz-summary-left {
1029
- padding-right: 0;
1030
- }
1031
- }
1032
-
1033
- /**
1034
- * Desktop Large 1240px
1035
- */
1036
-
1037
- @media screen and (min-width: 77.5em) {
1038
- }
1039
-
1040
- /**
1041
- * Desktop X-Large 1403px
1042
- */
1043
-
1044
- @media screen and (min-width: 87.6875em) {
1045
-
1046
- }
1047
-
1048
-
1049
-
1050
-
1051
-
1052
- /**
1053
- * global style for widgets
1054
- **/
1055
- .archive-course-widget-outer .course-title{
1056
- font-size: 16px;
1057
- line-height: 1.3;
1058
- }
1059
-
1060
- /**
1061
- * styles for archive course widget
1062
- * template: default
1063
- */
1064
- .archive-course-widget-outer.default{
1065
-
1066
- }
1067
-
1068
- .archive-course-widget-outer.default .course-entry{
1069
- margin-top: 8px;
1070
- }
1071
-
1072
- .archive-course-widget-outer.default .course-entry .course-meta-data{
1073
- font-size: smaller;
1074
- }
1075
- .archive-course-widget-outer.default .course-entry .course-meta-data .section{
1076
- display: block;
1077
- }
1078
-
1079
- .archive-course-widget-outer.default .course-entry .course-meta-data .section.inline .meta-field{
1080
- display: inline-block;
1081
- }
1082
-
1083
- .archive-course-widget-outer.default .course-entry .course-meta-data .section.inline .meta-field:not(:last-child):after{
1084
- content : '|';
1085
- font-style: italic;
1086
- }
1087
-
1088
- .archive-course-widget-outer.default .widget-footer .pull-right{
1089
- float: right;
1090
- }
1091
-
1092
- /**
1093
- * global styles for archive course shortcode
1094
- **/
1095
- .archive-course-collection-outer a:link{
1096
- text-decoration: none;
1097
- border-bottom: none;
1098
- }
1099
-
1100
- .archive-course-collection-outer .course-title{
1101
- line-height: 1.3;
1102
- font-size: 16px;
1103
- }
1104
-
1105
- .archive-course-collection-outer .course-description{
1106
- font-size: small;
1107
- }
1108
-
1109
- .archive-course-collection-outer .course-meta-data{
1110
- font-size: small;
1111
- padding-top: 4px;
1112
- line-height: 1.4;
1113
- }
1114
-
1115
- .owl-buttons{
1116
- margin-top: 15px;
1117
- text-align: center;
1118
- }
1119
-
1120
- .owl-next, .owl-prev{
1121
- margin: 2px;
1122
- display: inline-block;
1123
- border: 1px solid #DDD;
1124
- background-color: #F5F5F5;
1125
- color: black;
1126
- box-sizing: border-box;
1127
- padding: 0 10px;
1128
- }
1129
-
1130
- /**
1131
- * style for archive course shortcodes/courses collection
1132
- * template: list
1133
- **/
1134
-
1135
- .archive-course-collection-outer.list{
1136
-
1137
- }
1138
-
1139
- .archive-course-collection-outer.list .collection-body{
1140
- width: 100%;
1141
- }
1142
-
1143
- .archive-course-collection-outer.list .course-entry{
1144
- padding: 10px 0;
1145
- border-bottom: solid 4px whitesmoke;
1146
- }
1147
-
1148
- .archive-course-collection-outer.list .course-title{
1149
- line-height: normal;
1150
- font-size: 18px;
1151
- padding-bottom: 4px;
1152
- }
1153
-
1154
- .archive-course-collection-outer.list .course-entry .course-meta-data{
1155
- font-size: smaller;
1156
- }
1157
- .archive-course-collection-outer.list .course-entry .course-meta-data .section{
1158
- display: block;
1159
- }
1160
-
1161
- .archive-course-collection-outer.list .course-entry .course-meta-data .section.inline .meta-field{
1162
- display: inline-block;
1163
- }
1164
-
1165
- .archive-course-collection-outer.list .course-entry .course-meta-data .section.inline .meta-field:not(:last-child):after{
1166
- content : '|';
1167
- font-style: italic;
1168
- }
1169
-
1170
- .archive-course-collection-outer.list .collection-footer .pull-right{
1171
- float: right;
1172
- }
1173
-
1174
- /**
1175
- * style for archive course shortcodes/courses collection
1176
- * template: grids
1177
- **/
1178
-
1179
- .archive-course-collection-outer.grids{
1180
- width: 100%;
1181
- overflow: hidden;
1182
- position: relative;
1183
- }
1184
- .archive-course-collection-outer.grids .item{
1185
- margin: 10px 5px;
1186
- min-width: 150px;
1187
- max-width: 400px;
1188
- }
1189
-
1190
- .archive-course-collection-outer.grids .collection-body {
1191
- display: flex;
1192
- flex-direction: row;
1193
- flex-wrap: wrap;
1194
- width: 100%;
1195
- white-space: normal;
1196
- }
1197
-
1198
- .archive-course-collection-outer.grids .course-entry-outer{
1199
- width: 25%;
1200
- overflow: hidden;
1201
- padding: 5px;
1202
- }
1203
-
1204
- .archive-course-collection-outer.grids .course-entry{
1205
- height: 100%;
1206
-
1207
- }
1208
-
1209
- .archive-course-collection-outer.grids .course-cover{
1210
- display: block;
1211
- width: 100%;
1212
- }
1213
- .archive-course-collection-outer.grids .course-cover .img-link,
1214
- .archive-course-collection-outer.grids .course-cover .img-link img{
1215
- width: 100%;
1216
- height: 100%;
1217
- }
1218
- .archive-course-collection-outer.grids .course-detail{
1219
- padding: 5px;
1220
- }
1221
- .archive-course-collection-outer.grids .course-title{
1222
- min-height: 5em;
1223
- text-align: center;
1224
- }
1225
-
1226
- .archive-course-collection-outer.grids .course-entry .course-meta-data{
1227
- font-size: smaller;
1228
- }
1229
-
1230
- .archive-course-collection-outer.grids .course-entry .course-meta-data .section{
1231
- display: block;
1232
- }
1233
-
1234
- .archive-course-collection-outer.grids .course-entry .course-meta-data .section.inline .meta-field{
1235
- display: inline-block;
1236
- }
1237
-
1238
- .archive-course-collection-outer.grids .course-entry .course-meta-data .section.inline .meta-field:not(:last-child):after{
1239
-
1240
- }
1241
-
1242
- .archive-course-collection-outer.grids .collection-footer .pull-right{
1243
- float: right;
1244
- }
1245
-
1246
- .archive-course-collection-outer.grids.shadow .item{
1247
- -webkit-box-shadow: 2px 2px 10px 0px rgba(0, 0, 0,0.2);
1248
- -moz-box-shadow: 2px 2px 10px 0px rgba(0, 0, 0,0.2);
1249
- box-shadow: 2px 2px 10px 0px rgba(0, 0, 0,0.2);
1250
- }
1251
- /**
1252
- * style for archive course shortcodes/courses collection
1253
- * template: cards
1254
- **/
1255
-
1256
- .archive-course-collection-outer.cards{
1257
-
1258
- }
1259
- .archive-course-collection-outer.cards .item{
1260
- height: 280px;
1261
- margin: 10px 5px;
1262
- min-width: 200px;
1263
- max-width: 400px;
1264
- -webkit-box-shadow: 2px 2px 10px 0px rgba(0, 0, 0,0.2);
1265
- -moz-box-shadow: 2px 2px 10px 0px rgba(0, 0, 0,0.2);
1266
- box-shadow: 2px 2px 10px 0px rgba(0, 0, 0,0.2);
1267
- }
1268
- .archive-course-collection-outer.cards .course-entry{
1269
- }
1270
-
1271
- .archive-course-collection-outer.cards .course-cover{
1272
- position: relative;
1273
- display: block;
1274
- width: 100%;
1275
- height: 60%;
1276
- }
1277
-
1278
- .archive-course-collection-outer.cards .course-cover img{
1279
- width: 100%;
1280
- height: 100%;
1281
- }
1282
-
1283
- .archive-course-collection-outer.cards .course-title {
1284
- text-align: center;
1285
- padding-top: 1em;
1286
- height: 40%;
1287
- }
1288
-
1289
- .archive-course-collection-outer.cards .course-entry:hover .course-detail{
1290
- display: block;
1291
- opacity: 1;
1292
- }
1293
-
1294
- .archive-course-collection-outer.cards .course-detail{
1295
- position: absolute;
1296
- display: block;
1297
- opacity: 0;
1298
- top: 0;
1299
- width: 100%;
1300
- height: 100%;
1301
- color: white;
1302
- background-color: rgba(0,0, 0, 0.8);
1303
- transition: opacity 0.7s;
1304
- }
1305
- .archive-course-collection-outer.cards .course-meta-data{
1306
- font-size: 100%;
1307
- line-height: 1.6;
1308
- }
1309
-
1310
- .archive-course-collection-outer.cards .course-detail a{
1311
- color: green;
1312
- }
1313
-
1314
- .archive-course-collection-outer.cards .course-detail a:hover{
1315
- color: #419641;
1316
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @font-face {
2
+ font-family: 'lp-icons';
3
+ src: url('../fonts/lp-icons.eot?f41nl');
4
+ src: url('../fonts/lp-icons.eot?f41nl#iefix') format('embedded-opentype'), url('../fonts/lp-icons.ttf?f41nl') format('truetype'), url('../fonts/lp-icons.woff?f41nl') format('woff'), url('../fonts/lp-icons.svg?f41nl#lp-icons') format('svg');
5
+ font-weight: normal;
6
+ font-style: normal;
7
+ }
8
+ [class^="lp-icon-"],
9
+ [class*=" lp-icon-"] {
10
+ /* use !important to prevent issues with browser extensions that change fonts */
11
+ font-family: 'lp-icons' !important;
12
+ speak: none;
13
+ font-style: normal;
14
+ font-weight: normal;
15
+ font-variant: normal;
16
+ text-transform: none;
17
+ line-height: 1;
18
+ /* Better Font Rendering =========== */
19
+ -webkit-font-smoothing: antialiased;
20
+ -moz-osx-font-smoothing: grayscale;
21
+ }
22
+ .lp-icon-file-text2:before {
23
+ content: "\e926";
24
+ }
25
+ .lp-icon-file-picture:before {
26
+ content: "\e927";
27
+ }
28
+ .lp-icon-file-music:before {
29
+ content: "\e928";
30
+ }
31
+ .lp-icon-file-video:before {
32
+ content: "\e92a";
33
+ }
34
+ .lp-icon-file-zip:before {
35
+ content: "\e92b";
36
+ }
37
+ .lp-icon-paste:before {
38
+ content: "\e92d";
39
+ }
40
+ .lp-icon-alarm:before {
41
+ content: "\e950";
42
+ }
43
+ .lp-icon-cross:before {
44
+ content: "\ea0f";
45
+ }
46
+ .lp-icon-checkmark:before {
47
+ content: "\ea10";
48
+ }
49
+ .lp-icon-spinner2:before {
50
+ content: "\e97b";
51
+ }
52
+ .lp-icon-plus:before {
53
+ content: "\ea0a";
54
+ }
55
+ .lp-icon-minus:before {
56
+ content: "\ea0b";
57
+ }
58
+ .clearfix:after {
59
+ display: block;
60
+ content: '';
61
+ clear: both;
62
+ }
63
+ .overlay-processing:before,
64
+ .overlay-processing:after {
65
+ content: '';
66
+ display: block;
67
+ position: fixed;
68
+ top: 0;
69
+ left: 0;
70
+ width: 100%;
71
+ height: 100%;
72
+ z-index: 999999;
73
+ }
74
+ .overlay-processing:before {
75
+ background: #000;
76
+ opacity: 0.5;
77
+ }
78
+ .overlay-processing:after {
79
+ background: #FFF;
80
+ }
81
+ /* PROGRESS CIRCLE */
82
+ .hide-if-js {
83
+ display: none !important;
84
+ }
85
+ /* Archive courses */
86
+ .learn-press-courses {
87
+ list-style: none;
88
+ clear: both;
89
+ margin: 0 -30px 0 0;
90
+ padding: 0;
91
+ }
92
+ .learn-press-courses:after {
93
+ display: block;
94
+ content: '';
95
+ clear: both;
96
+ }
97
+ .learn-press-courses li.course {
98
+ list-style-type: none;
99
+ float: left;
100
+ width: 23%;
101
+ margin: 0 2% 30px 0;
102
+ padding: 0;
103
+ box-sizing: border-box;
104
+ border: 1px solid #DDD;
105
+ background: #FFF;
106
+ }
107
+ .learn-press-courses li.course h3 {
108
+ padding: 15px;
109
+ margin: 0;
110
+ font-size: 18px;
111
+ line-height: 1.5;
112
+ }
113
+ .learn-press-courses li.course .course-thumbnail {
114
+ position: relative;
115
+ }
116
+ .learn-press-courses li.course .course-thumbnail img {
117
+ max-width: 100%;
118
+ height: auto;
119
+ }
120
+ .learn-press-courses li.course .course-thumbnail:after {
121
+ content: '';
122
+ position: absolute;
123
+ width: 100%;
124
+ height: 100%;
125
+ left: 0;
126
+ top: 0;
127
+ }
128
+ .learn-press-courses li.course .course-info {
129
+ padding: 0 15px 15px;
130
+ font-size: 14px;
131
+ overflow: hidden;
132
+ }
133
+ .learn-press-courses li.course .course-students {
134
+ float: left;
135
+ }
136
+ .learn-press-courses li.course .course-instructor {
137
+ margin-bottom: 20px;
138
+ }
139
+ .learn-press-courses li.course .course-price {
140
+ float: right;
141
+ color: #54b551;
142
+ }
143
+ .learn-press-courses li.course .course-info > * {
144
+ display: block;
145
+ }
146
+ .learn-press-notice .button {
147
+ float: right;
148
+ }
149
+ #learn-press-course-curriculum ul.curriculum-sections,
150
+ #learn-press-course-curriculum ul.section-content {
151
+ list-style: none;
152
+ margin: 0;
153
+ padding: 0;
154
+ background-color: #F5F5F5;
155
+ }
156
+ #learn-press-course-curriculum ul.curriculum-sections li.section,
157
+ #learn-press-course-curriculum ul.section-content li.section {
158
+ list-style-type: none;
159
+ }
160
+ #learn-press-course-curriculum .section-header {
161
+ background-color: #EEE;
162
+ margin: 0;
163
+ padding: 20px 15px;
164
+ border-top: 1px solid #FFF;
165
+ }
166
+ #learn-press-course-curriculum .section-header p {
167
+ display: inline-block;
168
+ font-weight: normal;
169
+ font-style: italic;
170
+ color: #999999;
171
+ font-size: smaller;
172
+ margin: 0;
173
+ }
174
+ #learn-press-course-curriculum .section-header:hover {
175
+ background: #DDD;
176
+ }
177
+ #learn-press-course-curriculum .section-header .meta {
178
+ font-size: smaller;
179
+ font-weight: normal;
180
+ float: right;
181
+ /*margin-top: 5px;*/
182
+ }
183
+ #learn-press-course-curriculum .section-header .meta .collapse {
184
+ display: inline-block;
185
+ position: relative;
186
+ font-family: 'lp-icons';
187
+ background: #95e6f9;
188
+ width: 24px;
189
+ height: 24px;
190
+ line-height: 24px;
191
+ text-align: center;
192
+ color: #FFF;
193
+ border-radius: 5px;
194
+ vertical-align: middle;
195
+ margin-left: 5px;
196
+ }
197
+ #learn-press-course-curriculum .section-header .meta .collapse:before {
198
+ content: "\ea0b";
199
+ }
200
+ #learn-press-course-curriculum .section-header .meta .collapse:hover {
201
+ cursor: pointer;
202
+ }
203
+ #learn-press-course-curriculum .section-header .meta .collapse.plus:before {
204
+ content: "\ea0a";
205
+ }
206
+ #learn-press-course-curriculum .course-item {
207
+ margin: 0;
208
+ list-style: none;
209
+ padding: 15px 15px;
210
+ border-top: 1px solid #ffffff;
211
+ position: relative;
212
+ -webkit-transition: background linear 0.5s;
213
+ -khtml-transition: background linear 0.5s;
214
+ -moz-transition: background linear 0.5s;
215
+ -ms-transition: background linear 0.5s;
216
+ -o-transition: background linear 0.5s;
217
+ transition: background linear 0.5s;
218
+ }
219
+ #learn-press-course-curriculum .course-item .lp-label-viewing,
220
+ #learn-press-course-curriculum .course-item .lp-label-completed {
221
+ display: none;
222
+ }
223
+ #learn-press-course-curriculum .course-item .course-item-title:before {
224
+ display: inline-block;
225
+ font-size: 16px;
226
+ margin-right: 5px;
227
+ font-family: 'lp-icons';
228
+ }
229
+ #learn-press-course-curriculum .course-item .lp-icon {
230
+ display: none;
231
+ }
232
+ #learn-press-course-curriculum .course-item.viewable {
233
+ cursor: pointer;
234
+ }
235
+ #learn-press-course-curriculum .course-item.viewable:hover {
236
+ background: #e7ecfb;
237
+ -webkit-transition: background linear 0s;
238
+ -khtml-transition: background linear 0s;
239
+ -moz-transition: background linear 0s;
240
+ -ms-transition: background linear 0s;
241
+ -o-transition: background linear 0s;
242
+ transition: background linear 0s;
243
+ }
244
+ #learn-press-course-curriculum .course-item.course-lesson .course-item-title:before {
245
+ content: '\e926';
246
+ }
247
+ #learn-press-course-curriculum .course-item.course-quiz .course-item-title:before {
248
+ content: '\e950';
249
+ }
250
+ #learn-press-course-curriculum .course-item.item-current {
251
+ background: #FFF;
252
+ }
253
+ #learn-press-course-curriculum .course-item.item-current:before {
254
+ display: block;
255
+ width: 3px;
256
+ background: #95e6f9;
257
+ position: absolute;
258
+ left: 0;
259
+ top: 0;
260
+ height: 100%;
261
+ content: '';
262
+ }
263
+ #learn-press-course-curriculum .course-item.item-has-status .item-status {
264
+ display: inline-block;
265
+ background: #d6d6d6;
266
+ margin-left: 5px;
267
+ }
268
+ #learn-press-course-curriculum .course-item.item-has-status .item-status:before {
269
+ content: '\ea10';
270
+ }
271
+ #learn-press-course-curriculum .course-item.item-has-status.item-completed .item-status {
272
+ background: #95e6f9;
273
+ }
274
+ #learn-press-course-curriculum .course-item.focus {
275
+ background: #ffb710;
276
+ }
277
+ #learn-press-course-curriculum .course-item.focus.off {
278
+ -webkit-transition: none;
279
+ -khtml-transition: none;
280
+ -moz-transition: none;
281
+ -ms-transition: none;
282
+ -o-transition: none;
283
+ transition: none;
284
+ }
285
+ #learn-press-course-curriculum .course-item-meta {
286
+ display: block;
287
+ float: right;
288
+ line-height: 1;
289
+ }
290
+ .lp-icon {
291
+ display: inline-block;
292
+ font-family: 'lp-icons';
293
+ background: #95e6f9;
294
+ width: 24px;
295
+ height: 24px;
296
+ line-height: 24px;
297
+ text-align: center;
298
+ color: #FFF;
299
+ border-radius: 5px;
300
+ vertical-align: middle;
301
+ }
302
+ .lp-icon:before {
303
+ width: 32px;
304
+ height: 32px;
305
+ }
306
+ .lp-label {
307
+ display: inline-block;
308
+ line-height: 24px;
309
+ font-size: 78%;
310
+ vertical-align: middle;
311
+ color: #ffffff;
312
+ padding: 0 10px;
313
+ background: #DDD;
314
+ height: 24px;
315
+ -webkit-border-radius: 4px;
316
+ -khtml-border-radius: 4px;
317
+ -moz-border-radius: 4px;
318
+ -ms-border-radius: 4px;
319
+ -o-border-radius: 4px;
320
+ border-radius: 4px;
321
+ }
322
+ .lp-label.lp-label-viewing {
323
+ background-color: #39afff;
324
+ }
325
+ .lp-label.lp-label-completed {
326
+ background-color: #39c7ce;
327
+ }
328
+ .lp-label.lp-label-lesson {
329
+ background-color: #337ab7;
330
+ }
331
+ .lp-label.lp-label-quiz {
332
+ background-color: #53658c;
333
+ }
334
+ .lp-label.lp-label-preview {
335
+ background-color: #02a7ce;
336
+ }
337
+ .learn-press-content-protected-message {
338
+ border: 3px solid #ff8484;
339
+ background: #FFF;
340
+ padding: 20px;
341
+ color: #ff8484;
342
+ margin: 10px 0;
343
+ border-radius: 6px;
344
+ }
345
+ .learn-press-content-protected-message .icon {
346
+ position: relative;
347
+ display: inline-block;
348
+ width: 30px;
349
+ height: 30px;
350
+ margin-right: 10px;
351
+ vertical-align: middle;
352
+ }
353
+ .learn-press-content-protected-message .icon:before,
354
+ .learn-press-content-protected-message .icon:after {
355
+ width: 3px;
356
+ background: #ff8484;
357
+ height: 30px;
358
+ content: '';
359
+ display: inline-block;
360
+ position: absolute;
361
+ top: 0;
362
+ left: 13.5px;
363
+ }
364
+ .learn-press-content-protected-message .icon:before {
365
+ -webkit-transform: rotate(-45deg);
366
+ -khtml-transform: rotate(-45deg);
367
+ -moz-transform: rotate(-45deg);
368
+ -ms-transform: rotate(-45deg);
369
+ -o-transform: rotate(-45deg);
370
+ transform: rotate(-45deg);
371
+ }
372
+ .learn-press-content-protected-message .icon:after {
373
+ -webkit-transform: rotate(45deg);
374
+ -khtml-transform: rotate(45deg);
375
+ -moz-transform: rotate(45deg);
376
+ -ms-transform: rotate(45deg);
377
+ -o-transform: rotate(45deg);
378
+ transform: rotate(45deg);
379
+ }
380
+ /** BREADCRUMB */
381
+ .learn-press-breadcrumb {
382
+ margin-bottom: 20px;
383
+ }
384
+ /** COURSE PROGRESS **/
385
+ .single-lp_course .learn-press-course-results-progress {
386
+ margin-bottom: 40px;
387
+ }
388
+ .single-lp_course .learn-press-course-results-progress .items-progress {
389
+ float: left;
390
+ width: 68%;
391
+ margin-right: 2%;
392
+ clear: left;
393
+ }
394
+ .single-lp_course .learn-press-course-results-progress .lp-course-progress-heading {
395
+ margin-bottom: 10px;
396
+ }
397
+ .single-lp_course .learn-press-course-results-progress .course-progress {
398
+ float: left;
399
+ width: 30%;
400
+ }
401
+ .single-lp_course .learn-press-course-results-progress .number,
402
+ .single-lp_course .learn-press-course-results-progress .percentage-sign {
403
+ display: inline-block;
404
+ vertical-align: bottom;
405
+ line-height: 1;
406
+ font-size: 25px;
407
+ }
408
+ .single-lp_course .learn-press-course-results-progress .percentage-sign {
409
+ margin-left: 5px;
410
+ }
411
+ .single-lp_course .learn-press-course-results-progress:after {
412
+ display: block;
413
+ content: '';
414
+ clear: both;
415
+ }
416
+ .lp-course-progress {
417
+ position: relative;
418
+ }
419
+ .lp-course-progress .lp-progress-bar {
420
+ height: 15px;
421
+ background: #DDD;
422
+ margin: 10px 0 15px 0;
423
+ overflow: hidden;
424
+ -webkit-border-radius: 3px;
425
+ -khtml-border-radius: 3px;
426
+ -moz-border-radius: 3px;
427
+ -ms-border-radius: 3px;
428
+ -o-border-radius: 3px;
429
+ border-radius: 3px;
430
+ }
431
+ .lp-course-progress .lp-progress-bar .lp-progress-value {
432
+ width: 50%;
433
+ height: 15px;
434
+ background: #95e6f9;
435
+ }
436
+ .lp-course-progress .lp-passing-conditional {
437
+ left: 0%;
438
+ position: absolute;
439
+ height: 25px;
440
+ top: -5px;
441
+ margin-left: -5px;
442
+ cursor: pointer;
443
+ }
444
+ .lp-course-progress .lp-passing-conditional:before,
445
+ .lp-course-progress .lp-passing-conditional:after {
446
+ content: '';
447
+ display: inline-block;
448
+ border: 5px solid transparent;
449
+ left: 0;
450
+ position: absolute;
451
+ }
452
+ .lp-course-progress .lp-passing-conditional:before {
453
+ border-top-color: #DDD;
454
+ }
455
+ .lp-course-progress .lp-passing-conditional:after {
456
+ border-bottom-color: #DDD;
457
+ bottom: 0;
458
+ }
459
+ #learn-press-content-item {
460
+ border: 1px solid #DDD;
461
+ display: none;
462
+ }
463
+ /** COURSE TABS **/
464
+ .learn-press-tabs .learn-press-nav-tabs {
465
+ list-style: none;
466
+ padding: 0 0 0 15px;
467
+ margin: 0 0 20px 0;
468
+ border-bottom: 1px solid #DDD;
469
+ }
470
+ .learn-press-tabs .learn-press-nav-tabs .learn-press-nav-tab {
471
+ list-style-type: none;
472
+ float: left;
473
+ margin-bottom: -1px;
474
+ position: relative;
475
+ }
476
+ .learn-press-tabs .learn-press-nav-tabs .learn-press-nav-tab a {
477
+ display: inline-block;
478
+ padding: 10px 15px;
479
+ outline: none;
480
+ }
481
+ .learn-press-tabs .learn-press-nav-tabs .learn-press-nav-tab.active {
482
+ border: 1px solid #DDD;
483
+ border-top-right-radius: 5px;
484
+ border-top-left-radius: 5px;
485
+ }
486
+ .learn-press-tabs .learn-press-nav-tabs .learn-press-nav-tab.active:after {
487
+ position: absolute;
488
+ width: 100%;
489
+ border-bottom: 1px solid #FFF;
490
+ bottom: -1px;
491
+ content: '';
492
+ }
493
+ .learn-press-tabs .learn-press-nav-tabs:after {
494
+ content: '';
495
+ display: block;
496
+ clear: both;
497
+ }
498
+ .learn-press-tabs .learn-press-tab-panel {
499
+ display: none;
500
+ margin-bottom: 20px;
501
+ }
502
+ .learn-press-tabs .learn-press-tab-panel.active {
503
+ display: block;
504
+ }
505
+ /* POPUP */
506
+ #popup_overlay {
507
+ z-index: 10000000 !important;
508
+ }
509
+ #popup_container {
510
+ z-index: 10000001 !important;
511
+ }
512
+ body.course-has-popup {
513
+ overflow: hidden;
514
+ }
515
+ #course-curriculum-popup {
516
+ position: fixed;
517
+ top: 0;
518
+ left: 0;
519
+ right: 0;
520
+ bottom: 0;
521
+ background: #000;
522
+ z-index: 999999;
523
+ }
524
+ #course-curriculum-popup * {
525
+ box-sizing: border-box;
526
+ }
527
+ #course-curriculum-popup #popup-sidebar {
528
+ float: left;
529
+ width: 350px;
530
+ position: absolute;
531
+ top: 60px;
532
+ bottom: 0;
533
+ overflow: auto;
534
+ background: #FFF;
535
+ border-right: 1px solid #DDD;
536
+ }
537
+ #course-curriculum-popup #popup-sidebar .course-curriculum-title {
538
+ display: none;
539
+ }
540
+ #course-curriculum-popup #popup-sidebar .curriculum-sections {
541
+ margin: 0;
542
+ font-size: smaller;
543
+ }
544
+ #course-curriculum-popup #popup-sidebar .learn-press-course-results-progress {
545
+ padding: 15px 20px;
546
+ margin-bottom: 0;
547
+ }
548
+ #course-curriculum-popup #popup-sidebar .learn-press-course-results-progress .items-progress,
549
+ #course-curriculum-popup #popup-sidebar .learn-press-course-results-progress .course-progress {
550
+ width: 100%;
551
+ margin: 0 !important;
552
+ }
553
+ #course-curriculum-popup #popup-main {
554
+ position: absolute;
555
+ top: 0;
556
+ left: 350px;
557
+ right: 0;
558
+ bottom: 0;
559
+ background: #FFF;
560
+ }
561
+ #course-curriculum-popup #popup-main #popup-header {
562
+ position: absolute;
563
+ top: 0;
564
+ left: -350px;
565
+ right: 0;
566
+ height: 60px;
567
+ background: #cc540d;
568
+ border-bottom: 1px solid #ab4a10;
569
+ }
570
+ #course-curriculum-popup #popup-main #popup-header .popup-menu {
571
+ position: absolute;
572
+ height: 60px;
573
+ width: 350px;
574
+ border-right: 1px solid #ab4a10;
575
+ }
576
+ #course-curriculum-popup #popup-main #popup-header .popup-close,
577
+ #course-curriculum-popup #popup-main #popup-header .sidebar-hide-btn,
578
+ #course-curriculum-popup #popup-main #popup-header .sidebar-show-btn {
579
+ width: 59px;
580
+ height: 59px;
581
+ position: absolute;
582
+ top: 0;
583
+ cursor: pointer;
584
+ font-size: 34px;
585
+ line-height: 60px;
586
+ text-align: center;
587
+ color: #FFF;
588
+ }
589
+ #course-curriculum-popup #popup-main #popup-header .popup-close:hover,
590
+ #course-curriculum-popup #popup-main #popup-header .sidebar-hide-btn:hover,
591
+ #course-curriculum-popup #popup-main #popup-header .sidebar-show-btn:hover {
592
+ background: #b34c10;
593
+ }
594
+ #course-curriculum-popup #popup-main #popup-header .sidebar-hide-btn {
595
+ left: 0;
596
+ }
597
+ #course-curriculum-popup #popup-main #popup-header .sidebar-show-btn {
598
+ position: relative;
599
+ margin-left: -20px;
600
+ margin-right: 20px;
601
+ }
602
+ #course-curriculum-popup #popup-main #popup-header .popup-close {
603
+ right: 0;
604
+ }
605
+ #course-curriculum-popup #popup-main #popup-header .popup-close:before,
606
+ #course-curriculum-popup #popup-main #popup-header .popup-close:after {
607
+ content: '';
608
+ border-top: 3px solid #FFF;
609
+ width: 30px;
610
+ display: inline-block;
611
+ position: absolute;
612
+ top: 29px;
613
+ left: 15px;
614
+ }
615
+ #course-curriculum-popup #popup-main #popup-header .popup-close:before {
616
+ -webkit-transform: rotate(45deg);
617
+ }
618
+ #course-curriculum-popup #popup-main #popup-header .popup-close:after {
619
+ -webkit-transform: rotate(-45deg);
620
+ }
621
+ #course-curriculum-popup #popup-main #popup-header .popup-close:hover {
622
+ background: #b34c10;
623
+ }
624
+ #course-curriculum-popup #popup-main #popup-header .popup-close:hover:before,
625
+ #course-curriculum-popup #popup-main #popup-header .popup-close:hover:after {
626
+ border-color: #FFF;
627
+ }
628
+ #course-curriculum-popup #popup-main #popup-header .popup-title {
629
+ margin: 0 0 0 350px;
630
+ height: 60px;
631
+ line-height: 60px;
632
+ padding: 0 20px;
633
+ color: #FFF;
634
+ position: relative;
635
+ }
636
+ #course-curriculum-popup #popup-main #popup-content {
637
+ position: absolute;
638
+ top: 60px;
639
+ bottom: 50px;
640
+ left: 0;
641
+ right: 0;
642
+ overflow: auto;
643
+ }
644
+ #course-curriculum-popup #popup-main #popup-content #popup-content-inner {
645
+ margin: 20px 40px;
646
+ }
647
+ #course-curriculum-popup #popup-main #popup-footer {
648
+ position: absolute;
649
+ bottom: 0;
650
+ left: 0;
651
+ right: 0;
652
+ height: 50px;
653
+ background: #F5F5F5;
654
+ border-top: 1px solid #DDD;
655
+ }
656
+ #course-curriculum-popup #popup-main #popup-footer .footer-control {
657
+ display: block;
658
+ height: 50px;
659
+ line-height: 50px;
660
+ padding: 0 20px;
661
+ background: #FFF;
662
+ }
663
+ #course-curriculum-popup #popup-main #popup-footer .footer-control.prev-item {
664
+ float: left;
665
+ }
666
+ #course-curriculum-popup #popup-main #popup-footer .footer-control.next-item {
667
+ float: right;
668
+ }
669
+ #course-curriculum-popup iframe {
670
+ position: absolute;
671
+ top: 0;
672
+ left: 0;
673
+ height: 100%;
674
+ width: 100%;
675
+ border: none;
676
+ margin: 0;
677
+ background: #FFF;
678
+ }
679
+ .learn-press-content-item-title {
680
+ margin-bottom: 20px;
681
+ border-bottom: 2px solid #DDD;
682
+ padding-bottom: 20px;
683
+ }
684
+ .learn-press-content-item-title.content-item-quiz-title {
685
+ display: block;
686
+ content: '';
687
+ clear: both;
688
+ }
689
+ .learn-press-content-item-title.content-item-quiz-title h4 {
690
+ float: left;
691
+ font-size: 24px;
692
+ margin-bottom: 0;
693
+ }
694
+ .learn-press-content-item-title.content-item-quiz-title .quiz-countdown {
695
+ float: right;
696
+ position: relative;
697
+ min-width: 100px;
698
+ background: #F5F5F5;
699
+ text-align: center;
700
+ font-size: 18px;
701
+ }
702
+ .learn-press-content-item-title.content-item-quiz-title .quiz-countdown:after,
703
+ .learn-press-content-item-title.content-item-quiz-title .quiz-countdown:before {
704
+ padding: 0 10px;
705
+ height: 3px;
706
+ position: absolute;
707
+ bottom: -3px;
708
+ background: #000;
709
+ content: '';
710
+ left: 0;
711
+ }
712
+ .learn-press-content-item-title.content-item-quiz-title .quiz-countdown:before {
713
+ width: 100%;
714
+ }
715
+ .learn-press-content-item-title.content-item-quiz-title .quiz-countdown:after {
716
+ background: #00adff;
717
+ padding: 0;
718
+ }
719
+ .learn-press-content-item-title.content-item-quiz-title .quiz-countdown.warning-time-over:after {
720
+ background: #FF0000;
721
+ }
722
+ .learn-press-content-item-title.content-item-quiz-title:after {
723
+ content: '';
724
+ display: block;
725
+ clear: both;
726
+ }
727
+ .learn-press-content-item-summary {
728
+ /*padding: 20px;
729
+ border-top: 1px solid #DDD;*/
730
+ margin-bottom: 30px;
731
+ }
732
+ .learn-press-content-item-summary .quiz-question-title {
733
+ margin-bottom: 20px;
734
+ }
735
+ .learn-press-content-item-summary .learn-press-question-explanation,
736
+ .learn-press-content-item-summary .learn-press-question-hint {
737
+ background: #F5F5F5;
738
+ padding: 15px 20px;
739
+ font-style: italic;
740
+ margin-bottom: 20px;
741
+ }
742
+ .learn-press-content-item-summary .learn-press-question-explanation .hint-title,
743
+ .learn-press-content-item-summary .learn-press-question-hint .hint-title,
744
+ .learn-press-content-item-summary .learn-press-question-explanation .explanation-title,
745
+ .learn-press-content-item-summary .learn-press-question-hint .explanation-title {
746
+ font-style: normal;
747
+ }
748
+ .button-finish-quiz {
749
+ float: right;
750
+ }
751
+ .learnpress form.purchase-course {
752
+ margin-bottom: 20px;
753
+ }
754
+ #learn-press-block-content {
755
+ display: none;
756
+ width: 100%;
757
+ height: 100%;
758
+ background: rgba(255, 255, 255, 0.25);
759
+ position: fixed;
760
+ z-index: 99999999;
761
+ top: 0;
762
+ left: 0;
763
+ }
764
+ #learn-press-block-content:before,
765
+ #learn-press-block-content:after,
766
+ #learn-press-block-content span {
767
+ position: absolute;
768
+ -webkit-border-radius: 50%;
769
+ -khtml-border-radius: 50%;
770
+ -moz-border-radius: 50%;
771
+ -ms-border-radius: 50%;
772
+ -o-border-radius: 50%;
773
+ border-radius: 50%;
774
+ left: 50%;
775
+ top: 50%;
776
+ box-sizing: border-box;
777
+ }
778
+ #learn-press-block-content:before {
779
+ content: '';
780
+ border: 2px solid #000;
781
+ z-index: 10;
782
+ -webkit-animation: spin-13 1.5s infinite;
783
+ -moz-animation: spin-13 1.5s infinite;
784
+ animation: spin-13 1.5s infinite;
785
+ }
786
+ #learn-press-block-content:after {
787
+ z-index: 0;
788
+ content: '';
789
+ border: 10px solid #000000;
790
+ margin-left: -80px;
791
+ margin-top: -80px;
792
+ width: 160px;
793
+ height: 160px;
794
+ opacity: 0;
795
+ }
796
+ #learn-press-block-content span {
797
+ z-index: 20;
798
+ -webkit-animation: spin-12 1.5s infinite;
799
+ -moz-animation: spin-12 1.5s infinite;
800
+ animation: spin-12 1.5s infinite;
801
+ }
802
+ #learn-press-block-content span:before {
803
+ content: '';
804
+ border: 6px solid #95e6f9;
805
+ position: absolute;
806
+ -webkit-border-radius: 50%;
807
+ -khtml-border-radius: 50%;
808
+ -moz-border-radius: 50%;
809
+ -ms-border-radius: 50%;
810
+ -o-border-radius: 50%;
811
+ border-radius: 50%;
812
+ box-sizing: border-box;
813
+ }
814
+ #learn-press-block-content:before {
815
+ width: 80px;
816
+ height: 80px;
817
+ margin-left: -40px;
818
+ margin-top: -40px;
819
+ /*-76px;*/
820
+ -webkit-clip-path: polygon(0px 80px, 80px 80px, 80px 40px, 40px 40px, 40px 0, 0 0);
821
+ }
822
+ #learn-press-block-content span {
823
+ clip: rect(0, 84px, 42px, 42px);
824
+ width: 84px;
825
+ height: 84px;
826
+ margin-left: -42px;
827
+ margin-top: -42px;
828
+ }
829
+ #learn-press-block-content span:before {
830
+ width: 84px;
831
+ height: 84px;
832
+ }
833
+ body.block-content #learn-press-block-content {
834
+ display: block;
835
+ }
836
+ /* COURSE QUIZ */
837
+ .quiz-buttons {
838
+ margin-bottom: 20px;
839
+ clear: both;
840
+ }
841
+ .quiz-intro {
842
+ list-style: none;
843
+ padding: 0;
844
+ }
845
+ .quiz-questions-list {
846
+ margin: 0 0 20px 0;
847
+ padding: 0;
848
+ list-style-position: inside;
849
+ }
850
+ .quiz-questions-list li {
851
+ margin: 0 0 10px 0;
852
+ }
853
+ .quiz-questions-list .question-title {
854
+ margin: 0 0 5px 0;
855
+ }
856
+ .quiz-questions-list .current .question-title {
857
+ font-weight: bold;
858
+ }
859
+ .quiz-description .learn-press-question-title,
860
+ .question-content .learn-press-question-title {
861
+ margin-bottom: 20px;
862
+ }
863
+ .quiz-countdown {
864
+ float: right;
865
+ position: relative;
866
+ min-width: 150px;
867
+ background: #F5F5F5;
868
+ text-align: center;
869
+ font-size: 18px;
870
+ padding: 5px 0;
871
+ }
872
+ #quiz-countdown .progress-circle {
873
+ overflow: hidden;
874
+ box-shadow: 0 0 3px #bdbdbd inset;
875
+ }
876
+ #quiz-countdown .progress-circle .inside {
877
+ line-height: 1;
878
+ }
879
+ #quiz-countdown .progress-circle .inside .countdown {
880
+ font-size: 48px;
881
+ color: #087998;
882
+ _text-shadow: 1px 1px #8ee5fd;
883
+ margin-top: 110px;
884
+ }
885
+ #quiz-countdown .progress-circle .inside p {
886
+ margin: 10px 0 0 0;
887
+ color: #DDD;
888
+ }
889
+ #quiz-countdown .progress-circle:after {
890
+ background: #00b9eb;
891
+ box-shadow: 0 0 6px #097a98;
892
+ }
893
+ #quiz-progress .progress-circle {
894
+ width: 200px;
895
+ height: 200px;
896
+ border-radius: 50%;
897
+ background-color: #DDD;
898
+ position: relative;
899
+ }
900
+ #quiz-progress .progress-circle .background {
901
+ content: "";
902
+ position: absolute;
903
+ border-radius: 50%;
904
+ width: 200px;
905
+ height: 200px;
906
+ clip: rect(0, 200px, 200px, 100px);
907
+ }
908
+ #quiz-progress .progress-circle .background .fill {
909
+ content: "";
910
+ position: absolute;
911
+ border-radius: 50%;
912
+ width: 200px;
913
+ height: 200px;
914
+ clip: rect(0, 100px, 200px, 0);
915
+ background: #FF0000;
916
+ transform: rotate(0deg);
917
+ }
918
+ #quiz-progress .progress-circle:after {
919
+ content: '';
920
+ width: 170px;
921
+ height: 170px;
922
+ background: #FFF;
923
+ -webkit-border-radius: 50%;
924
+ -khtml-border-radius: 50%;
925
+ -moz-border-radius: 50%;
926
+ -ms-border-radius: 50%;
927
+ -o-border-radius: 50%;
928
+ border-radius: 50%;
929
+ position: absolute;
930
+ top: 50%;
931
+ left: 50%;
932
+ margin-top: -85px;
933
+ margin-left: -85px;
934
+ pointer-events: none;
935
+ }
936
+ #quiz-progress .progress-circle .inside {
937
+ position: absolute;
938
+ width: 100%;
939
+ height: 100%;
940
+ line-height: 200px;
941
+ text-align: center;
942
+ z-index: 10;
943
+ }
944
+ #quiz-progress .progress-circle.gt-50 {
945
+ background-color: #FF0000;
946
+ }
947
+ #quiz-progress .progress-circle.gt-50 .background {
948
+ clip: rect(0, 100px, 200px, 0);
949
+ }
950
+ #quiz-progress .progress-circle.gt-50 .fill {
951
+ clip: rect(0, 200px, 200px, 100px);
952
+ background: #DDD;
953
+ }
954
+ .quiz-result .quiz-result-mark {
955
+ margin-bottom: 20px;
956
+ }
957
+ .quiz-result .quiz-result-mark .progress-circle {
958
+ width: 200px;
959
+ height: 200px;
960
+ border-radius: 50%;
961
+ background-color: #DDD;
962
+ position: relative;
963
+ }
964
+ .quiz-result .quiz-result-mark .progress-circle .background {
965
+ content: "";
966
+ position: absolute;
967
+ border-radius: 50%;
968
+ width: 200px;
969
+ height: 200px;
970
+ clip: rect(0, 200px, 200px, 100px);
971
+ }
972
+ .quiz-result .quiz-result-mark .progress-circle .background .fill {
973
+ content: "";
974
+ position: absolute;
975
+ border-radius: 50%;
976
+ width: 200px;
977
+ height: 200px;
978
+ clip: rect(0, 100px, 200px, 0);
979
+ background: #95e6f9;
980
+ transform: rotate(0deg);
981
+ }
982
+ .quiz-result .quiz-result-mark .progress-circle:after {
983
+ content: '';
984
+ width: 170px;
985
+ height: 170px;
986
+ background: #FFF;
987
+ -webkit-border-radius: 50%;
988
+ -khtml-border-radius: 50%;
989
+ -moz-border-radius: 50%;
990
+ -ms-border-radius: 50%;
991
+ -o-border-radius: 50%;
992
+ border-radius: 50%;
993
+ position: absolute;
994
+ top: 50%;
995
+ left: 50%;
996
+ margin-top: -85px;
997
+ margin-left: -85px;
998
+ pointer-events: none;
999
+ }
1000
+ .quiz-result .quiz-result-mark .progress-circle .inside {
1001
+ position: absolute;
1002
+ width: 100%;
1003
+ height: 100%;
1004
+ line-height: 200px;
1005
+ text-align: center;
1006
+ z-index: 10;
1007
+ }
1008
+ .quiz-result .quiz-result-mark .progress-circle.gt-50 {
1009
+ background-color: #95e6f9;
1010
+ }
1011
+ .quiz-result .quiz-result-mark .progress-circle.gt-50 .background {
1012
+ clip: rect(0, 100px, 200px, 0);
1013
+ }
1014
+ .quiz-result .quiz-result-mark .progress-circle.gt-50 .fill {
1015
+ clip: rect(0, 200px, 200px, 100px);
1016
+ background: #DDD;
1017
+ }
1018
+ .quiz-result .quiz-result-summary {
1019
+ margin-bottom: 20px;
1020
+ max-width: 500px;
1021
+ }
1022
+ .quiz-result .quiz-result-summary .quiz-result-field {
1023
+ position: relative;
1024
+ background: #F5F5F5;
1025
+ color: #fff;
1026
+ margin: 0 0 8px 0;
1027
+ font-size: 12px;
1028
+ padding: 5px 10px;
1029
+ -webkit-border-radius: 4px;
1030
+ -khtml-border-radius: 4px;
1031
+ -moz-border-radius: 4px;
1032
+ -ms-border-radius: 4px;
1033
+ -o-border-radius: 4px;
1034
+ border-radius: 4px;
1035
+ overflow: hidden;
1036
+ }
1037
+ .quiz-result .quiz-result-summary .quiz-result-field span,
1038
+ .quiz-result .quiz-result-summary .quiz-result-field span:after,
1039
+ .quiz-result .quiz-result-summary .quiz-result-field:before {
1040
+ display: block;
1041
+ position: absolute;
1042
+ top: 0;
1043
+ left: 0;
1044
+ height: 100%;
1045
+ content: attr(data-text);
1046
+ color: #FFF;
1047
+ white-space: nowrap;
1048
+ overflow: hidden;
1049
+ padding: 3px 10px;
1050
+ background: transparent;
1051
+ transition: width 0.5s;
1052
+ }
1053
+ .quiz-result .quiz-result-summary .quiz-result-field:before {
1054
+ content: '';
1055
+ padding: 0;
1056
+ }
1057
+ .quiz-result .quiz-result-summary .quiz-result-field span {
1058
+ padding: 0;
1059
+ }
1060
+ .quiz-result .quiz-result-summary .quiz-result-field span:after {
1061
+ margin: 3px 10px;
1062
+ padding: 0;
1063
+ width: 100%;
1064
+ }
1065
+ .quiz-result .quiz-result-summary .quiz-result-field.correct {
1066
+ background: #22b4ff;
1067
+ }
1068
+ .quiz-result .quiz-result-summary .quiz-result-field.wrong {
1069
+ background: #ff5425;
1070
+ }
1071
+ .quiz-result .quiz-result-summary .quiz-result-field.empty {
1072
+ color: #656D6D;
1073
+ }
1074
+ .quiz-result p.quiz-result-time {
1075
+ margin: 0 0 10px 0;
1076
+ }
1077
+ .quiz-result .quiz-grade p {
1078
+ margin: 0 0 10px 0;
1079
+ }
1080
+ .quiz-result .quiz-grade p span {
1081
+ font-weight: bold;
1082
+ }
1083
+ .quiz-result .quiz-grade p span.passed {
1084
+ color: #22b4ff;
1085
+ }
1086
+ .quiz-result .quiz-grade p span.failed {
1087
+ color: #ff5425;
1088
+ }
1089
+ .single-quiz .quiz-result-field[data-value="0"]:before,
1090
+ .single-quiz .quiz-result-field[data-value="0"] span,
1091
+ #quiz-countdown[data-value="0"]:after {
1092
+ width: 0%;
1093
+ }
1094
+ .single-quiz .quiz-result-field[data-value="1"]:before,
1095
+ .single-quiz .quiz-result-field[data-value="1"] span,
1096
+ #quiz-countdown[data-value="1"]:after {
1097
+ width: 1%;
1098
+ }
1099
+ .single-quiz .quiz-result-field[data-value="2"]:before,
1100
+ .single-quiz .quiz-result-field[data-value="2"] span,
1101
+ #quiz-countdown[data-value="2"]:after {
1102
+ width: 2%;
1103
+ }
1104
+ .single-quiz .quiz-result-field[data-value="3"]:before,
1105
+ .single-quiz .quiz-result-field[data-value="3"] span,
1106
+ #quiz-countdown[data-value="3"]:after {
1107
+ width: 3%;
1108
+ }
1109
+ .single-quiz .quiz-result-field[data-value="4"]:before,
1110
+ .single-quiz .quiz-result-field[data-value="4"] span,
1111
+ #quiz-countdown[data-value="4"]:after {
1112
+ width: 4%;
1113
+ }
1114
+ .single-quiz .quiz-result-field[data-value="5"]:before,
1115
+ .single-quiz .quiz-result-field[data-value="5"] span,
1116
+ #quiz-countdown[data-value="5"]:after {
1117
+ width: 5%;
1118
+ }
1119
+ .single-quiz .quiz-result-field[data-value="6"]:before,
1120
+ .single-quiz .quiz-result-field[data-value="6"] span,
1121
+ #quiz-countdown[data-value="6"]:after {
1122
+ width: 6%;
1123
+ }
1124
+ .single-quiz .quiz-result-field[data-value="7"]:before,
1125
+ .single-quiz .quiz-result-field[data-value="7"] span,
1126
+ #quiz-countdown[data-value="7"]:after {
1127
+ width: 7%;
1128
+ }
1129
+ .single-quiz .quiz-result-field[data-value="8"]:before,
1130
+ .single-quiz .quiz-result-field[data-value="8"] span,
1131
+ #quiz-countdown[data-value="8"]:after {
1132
+ width: 8%;
1133
+ }
1134
+ .single-quiz .quiz-result-field[data-value="9"]:before,
1135
+ .single-quiz .quiz-result-field[data-value="9"] span,
1136
+ #quiz-countdown[data-value="9"]:after {
1137
+ width: 9%;
1138
+ }
1139
+ .single-quiz .quiz-result-field[data-value="10"]:before,
1140
+ .single-quiz .quiz-result-field[data-value="10"] span,
1141
+ #quiz-countdown[data-value="10"]:after {
1142
+ width: 10%;
1143
+ }
1144
+ .single-quiz .quiz-result-field[data-value="11"]:before,
1145
+ .single-quiz .quiz-result-field[data-value="11"] span,
1146
+ #quiz-countdown[data-value="11"]:after {
1147
+ width: 11%;
1148
+ }
1149
+ .single-quiz .quiz-result-field[data-value="12"]:before,
1150
+ .single-quiz .quiz-result-field[data-value="12"] span,
1151
+ #quiz-countdown[data-value="12"]:after {
1152
+ width: 12%;
1153
+ }
1154
+ .single-quiz .quiz-result-field[data-value="13"]:before,
1155
+ .single-quiz .quiz-result-field[data-value="13"] span,
1156
+ #quiz-countdown[data-value="13"]:after {
1157
+ width: 13%;
1158
+ }
1159
+ .single-quiz .quiz-result-field[data-value="14"]:before,
1160
+ .single-quiz .quiz-result-field[data-value="14"] span,
1161
+ #quiz-countdown[data-value="14"]:after {
1162
+ width: 14%;
1163
+ }
1164
+ .single-quiz .quiz-result-field[data-value="15"]:before,
1165
+ .single-quiz .quiz-result-field[data-value="15"] span,
1166
+ #quiz-countdown[data-value="15"]:after {
1167
+ width: 15%;
1168
+ }
1169
+ .single-quiz .quiz-result-field[data-value="16"]:before,
1170
+ .single-quiz .quiz-result-field[data-value="16"] span,
1171
+ #quiz-countdown[data-value="16"]:after {
1172
+ width: 16%;
1173
+ }
1174
+ .single-quiz .quiz-result-field[data-value="17"]:before,
1175
+ .single-quiz .quiz-result-field[data-value="17"] span,
1176
+ #quiz-countdown[data-value="17"]:after {
1177
+ width: 17%;
1178
+ }
1179
+ .single-quiz .quiz-result-field[data-value="18"]:before,
1180
+ .single-quiz .quiz-result-field[data-value="18"] span,
1181
+ #quiz-countdown[data-value="18"]:after {
1182
+ width: 18%;
1183
+ }
1184
+ .single-quiz .quiz-result-field[data-value="19"]:before,
1185
+ .single-quiz .quiz-result-field[data-value="19"] span,
1186
+ #quiz-countdown[data-value="19"]:after {
1187
+ width: 19%;
1188
+ }
1189
+ .single-quiz .quiz-result-field[data-value="20"]:before,
1190
+ .single-quiz .quiz-result-field[data-value="20"] span,
1191
+ #quiz-countdown[data-value="20"]:after {
1192
+ width: 20%;
1193
+ }
1194
+ .single-quiz .quiz-result-field[data-value="21"]:before,
1195
+ .single-quiz .quiz-result-field[data-value="21"] span,
1196
+ #quiz-countdown[data-value="21"]:after {
1197
+ width: 21%;
1198
+ }
1199
+ .single-quiz .quiz-result-field[data-value="22"]:before,
1200
+ .single-quiz .quiz-result-field[data-value="22"] span,
1201
+ #quiz-countdown[data-value="22"]:after {
1202
+ width: 22%;
1203
+ }
1204
+ .single-quiz .quiz-result-field[data-value="23"]:before,
1205
+ .single-quiz .quiz-result-field[data-value="23"] span,
1206
+ #quiz-countdown[data-value="23"]:after {
1207
+ width: 23%;
1208
+ }
1209
+ .single-quiz .quiz-result-field[data-value="24"]:before,
1210
+ .single-quiz .quiz-result-field[data-value="24"] span,
1211
+ #quiz-countdown[data-value="24"]:after {
1212
+ width: 24%;
1213
+ }
1214
+ .single-quiz .quiz-result-field[data-value="25"]:before,
1215
+ .single-quiz .quiz-result-field[data-value="25"] span,
1216
+ #quiz-countdown[data-value="25"]:after {
1217
+ width: 25%;
1218
+ }
1219
+ .single-quiz .quiz-result-field[data-value="26"]:before,
1220
+ .single-quiz .quiz-result-field[data-value="26"] span,
1221
+ #quiz-countdown[data-value="26"]:after {
1222
+ width: 26%;
1223
+ }
1224
+ .single-quiz .quiz-result-field[data-value="27"]:before,
1225
+ .single-quiz .quiz-result-field[data-value="27"] span,
1226
+ #quiz-countdown[data-value="27"]:after {
1227
+ width: 27%;
1228
+ }
1229
+ .single-quiz .quiz-result-field[data-value="28"]:before,
1230
+ .single-quiz .quiz-result-field[data-value="28"] span,
1231
+ #quiz-countdown[data-value="28"]:after {
1232
+ width: 28%;
1233
+ }
1234
+ .single-quiz .quiz-result-field[data-value="29"]:before,
1235
+ .single-quiz .quiz-result-field[data-value="29"] span,
1236
+ #quiz-countdown[data-value="29"]:after {
1237
+ width: 29%;
1238
+ }
1239
+ .single-quiz .quiz-result-field[data-value="30"]:before,
1240
+ .single-quiz .quiz-result-field[data-value="30"] span,
1241
+ #quiz-countdown[data-value="30"]:after {
1242
+ width: 30%;
1243
+ }
1244
+ .single-quiz .quiz-result-field[data-value="31"]:before,
1245
+ .single-quiz .quiz-result-field[data-value="31"] span,
1246
+ #quiz-countdown[data-value="31"]:after {
1247
+ width: 31%;
1248
+ }
1249
+ .single-quiz .quiz-result-field[data-value="32"]:before,
1250
+ .single-quiz .quiz-result-field[data-value="32"] span,
1251
+ #quiz-countdown[data-value="32"]:after {
1252
+ width: 32%;
1253
+ }
1254
+ .single-quiz .quiz-result-field[data-value="33"]:before,
1255
+ .single-quiz .quiz-result-field[data-value="33"] span,
1256
+ #quiz-countdown[data-value="33"]:after {
1257
+ width: 33%;
1258
+ }
1259
+ .single-quiz .quiz-result-field[data-value="34"]:before,
1260
+ .single-quiz .quiz-result-field[data-value="34"] span,
1261
+ #quiz-countdown[data-value="34"]:after {
1262
+ width: 34%;
1263
+ }
1264
+ .single-quiz .quiz-result-field[data-value="35"]:before,
1265
+ .single-quiz .quiz-result-field[data-value="35"] span,
1266
+ #quiz-countdown[data-value="35"]:after {
1267
+ width: 35%;
1268
+ }
1269
+ .single-quiz .quiz-result-field[data-value="36"]:before,
1270
+ .single-quiz .quiz-result-field[data-value="36"] span,
1271
+ #quiz-countdown[data-value="36"]:after {
1272
+ width: 36%;
1273
+ }
1274
+ .single-quiz .quiz-result-field[data-value="37"]:before,
1275
+ .single-quiz .quiz-result-field[data-value="37"] span,
1276
+ #quiz-countdown[data-value="37"]:after {
1277
+ width: 37%;
1278
+ }
1279
+ .single-quiz .quiz-result-field[data-value="38"]:before,
1280
+ .single-quiz .quiz-result-field[data-value="38"] span,
1281
+ #quiz-countdown[data-value="38"]:after {
1282
+ width: 38%;
1283
+ }
1284
+ .single-quiz .quiz-result-field[data-value="39"]:before,
1285
+ .single-quiz .quiz-result-field[data-value="39"] span,
1286
+ #quiz-countdown[data-value="39"]:after {
1287
+ width: 39%;
1288
+ }
1289
+ .single-quiz .quiz-result-field[data-value="40"]:before,
1290
+ .single-quiz .quiz-result-field[data-value="40"] span,
1291
+ #quiz-countdown[data-value="40"]:after {
1292
+ width: 40%;
1293
+ }
1294
+ .single-quiz .quiz-result-field[data-value="41"]:before,
1295
+ .single-quiz .quiz-result-field[data-value="41"] span,
1296
+ #quiz-countdown[data-value="41"]:after {
1297
+ width: 41%;
1298
+ }
1299
+ .single-quiz .quiz-result-field[data-value="42"]:before,
1300
+ .single-quiz .quiz-result-field[data-value="42"] span,
1301
+ #quiz-countdown[data-value="42"]:after {
1302
+ width: 42%;
1303
+ }
1304
+ .single-quiz .quiz-result-field[data-value="43"]:before,
1305
+ .single-quiz .quiz-result-field[data-value="43"] span,
1306
+ #quiz-countdown[data-value="43"]:after {
1307
+ width: 43%;
1308
+ }
1309
+ .single-quiz .quiz-result-field[data-value="44"]:before,
1310
+ .single-quiz .quiz-result-field[data-value="44"] span,
1311
+ #quiz-countdown[data-value="44"]:after {
1312
+ width: 44%;
1313
+ }
1314
+ .single-quiz .quiz-result-field[data-value="45"]:before,
1315
+ .single-quiz .quiz-result-field[data-value="45"] span,
1316
+ #quiz-countdown[data-value="45"]:after {
1317
+ width: 45%;
1318
+ }
1319
+ .single-quiz .quiz-result-field[data-value="46"]:before,
1320
+ .single-quiz .quiz-result-field[data-value="46"] span,
1321
+ #quiz-countdown[data-value="46"]:after {
1322
+ width: 46%;
1323
+ }
1324
+ .single-quiz .quiz-result-field[data-value="47"]:before,
1325
+ .single-quiz .quiz-result-field[data-value="47"] span,
1326
+ #quiz-countdown[data-value="47"]:after {
1327
+ width: 47%;
1328
+ }
1329
+ .single-quiz .quiz-result-field[data-value="48"]:before,
1330
+ .single-quiz .quiz-result-field[data-value="48"] span,
1331
+ #quiz-countdown[data-value="48"]:after {
1332
+ width: 48%;
1333
+ }
1334
+ .single-quiz .quiz-result-field[data-value="49"]:before,
1335
+ .single-quiz .quiz-result-field[data-value="49"] span,
1336
+ #quiz-countdown[data-value="49"]:after {
1337
+ width: 49%;
1338
+ }
1339
+ .single-quiz .quiz-result-field[data-value="50"]:before,
1340
+ .single-quiz .quiz-result-field[data-value="50"] span,
1341
+ #quiz-countdown[data-value="50"]:after {
1342
+ width: 50%;
1343
+ }
1344
+ .single-quiz .quiz-result-field[data-value="51"]:before,
1345
+ .single-quiz .quiz-result-field[data-value="51"] span,
1346
+ #quiz-countdown[data-value="51"]:after {
1347
+ width: 51%;
1348
+ }
1349
+ .single-quiz .quiz-result-field[data-value="52"]:before,
1350
+ .single-quiz .quiz-result-field[data-value="52"] span,
1351
+ #quiz-countdown[data-value="52"]:after {
1352
+ width: 52%;
1353
+ }
1354
+ .single-quiz .quiz-result-field[data-value="53"]:before,
1355
+ .single-quiz .quiz-result-field[data-value="53"] span,
1356
+ #quiz-countdown[data-value="53"]:after {
1357
+ width: 53%;
1358
+ }
1359
+ .single-quiz .quiz-result-field[data-value="54"]:before,
1360
+ .single-quiz .quiz-result-field[data-value="54"] span,
1361
+ #quiz-countdown[data-value="54"]:after {
1362
+ width: 54%;
1363
+ }
1364
+ .single-quiz .quiz-result-field[data-value="55"]:before,
1365
+ .single-quiz .quiz-result-field[data-value="55"] span,
1366
+ #quiz-countdown[data-value="55"]:after {
1367
+ width: 55%;
1368
+ }
1369
+ .single-quiz .quiz-result-field[data-value="56"]:before,
1370
+ .single-quiz .quiz-result-field[data-value="56"] span,
1371
+ #quiz-countdown[data-value="56"]:after {
1372
+ width: 56%;
1373
+ }
1374
+ .single-quiz .quiz-result-field[data-value="57"]:before,
1375
+ .single-quiz .quiz-result-field[data-value="57"] span,
1376
+ #quiz-countdown[data-value="57"]:after {
1377
+ width: 57%;
1378
+ }
1379
+ .single-quiz .quiz-result-field[data-value="58"]:before,
1380
+ .single-quiz .quiz-result-field[data-value="58"] span,
1381
+ #quiz-countdown[data-value="58"]:after {
1382
+ width: 58%;
1383
+ }
1384
+ .single-quiz .quiz-result-field[data-value="59"]:before,
1385
+ .single-quiz .quiz-result-field[data-value="59"] span,
1386
+ #quiz-countdown[data-value="59"]:after {
1387
+ width: 59%;
1388
+ }
1389
+ .single-quiz .quiz-result-field[data-value="60"]:before,
1390
+ .single-quiz .quiz-result-field[data-value="60"] span,
1391
+ #quiz-countdown[data-value="60"]:after {
1392
+ width: 60%;
1393
+ }
1394
+ .single-quiz .quiz-result-field[data-value="61"]:before,
1395
+ .single-quiz .quiz-result-field[data-value="61"] span,
1396
+ #quiz-countdown[data-value="61"]:after {
1397
+ width: 61%;
1398
+ }
1399
+ .single-quiz .quiz-result-field[data-value="62"]:before,
1400
+ .single-quiz .quiz-result-field[data-value="62"] span,
1401
+ #quiz-countdown[data-value="62"]:after {
1402
+ width: 62%;
1403
+ }
1404
+ .single-quiz .quiz-result-field[data-value="63"]:before,
1405
+ .single-quiz .quiz-result-field[data-value="63"] span,
1406
+ #quiz-countdown[data-value="63"]:after {
1407
+ width: 63%;
1408
+ }
1409
+ .single-quiz .quiz-result-field[data-value="64"]:before,
1410
+ .single-quiz .quiz-result-field[data-value="64"] span,
1411
+ #quiz-countdown[data-value="64"]:after {
1412
+ width: 64%;
1413
+ }
1414
+ .single-quiz .quiz-result-field[data-value="65"]:before,
1415
+ .single-quiz .quiz-result-field[data-value="65"] span,
1416
+ #quiz-countdown[data-value="65"]:after {
1417
+ width: 65%;
1418
+ }
1419
+ .single-quiz .quiz-result-field[data-value="66"]:before,
1420
+ .single-quiz .quiz-result-field[data-value="66"] span,
1421
+ #quiz-countdown[data-value="66"]:after {
1422
+ width: 66%;
1423
+ }
1424
+ .single-quiz .quiz-result-field[data-value="67"]:before,
1425
+ .single-quiz .quiz-result-field[data-value="67"] span,
1426
+ #quiz-countdown[data-value="67"]:after {
1427
+ width: 67%;
1428
+ }
1429
+ .single-quiz .quiz-result-field[data-value="68"]:before,
1430
+ .single-quiz .quiz-result-field[data-value="68"] span,
1431
+ #quiz-countdown[data-value="68"]:after {
1432
+ width: 68%;
1433
+ }
1434
+ .single-quiz .quiz-result-field[data-value="69"]:before,
1435
+ .single-quiz .quiz-result-field[data-value="69"] span,
1436
+ #quiz-countdown[data-value="69"]:after {
1437
+ width: 69%;
1438
+ }
1439
+ .single-quiz .quiz-result-field[data-value="70"]:before,
1440
+ .single-quiz .quiz-result-field[data-value="70"] span,
1441
+ #quiz-countdown[data-value="70"]:after {
1442
+ width: 70%;
1443
+ }
1444
+ .single-quiz .quiz-result-field[data-value="71"]:before,
1445
+ .single-quiz .quiz-result-field[data-value="71"] span,
1446
+ #quiz-countdown[data-value="71"]:after {
1447
+ width: 71%;
1448
+ }
1449
+ .single-quiz .quiz-result-field[data-value="72"]:before,
1450
+ .single-quiz .quiz-result-field[data-value="72"] span,
1451
+ #quiz-countdown[data-value="72"]:after {
1452
+ width: 72%;
1453
+ }
1454
+ .single-quiz .quiz-result-field[data-value="73"]:before,
1455
+ .single-quiz .quiz-result-field[data-value="73"] span,
1456
+ #quiz-countdown[data-value="73"]:after {
1457
+ width: 73%;
1458
+ }
1459
+ .single-quiz .quiz-result-field[data-value="74"]:before,
1460
+ .single-quiz .quiz-result-field[data-value="74"] span,
1461
+ #quiz-countdown[data-value="74"]:after {
1462
+ width: 74%;
1463
+ }
1464
+ .single-quiz .quiz-result-field[data-value="75"]:before,
1465
+ .single-quiz .quiz-result-field[data-value="75"] span,
1466
+ #quiz-countdown[data-value="75"]:after {
1467
+ width: 75%;
1468
+ }
1469
+ .single-quiz .quiz-result-field[data-value="76"]:before,
1470
+ .single-quiz .quiz-result-field[data-value="76"] span,
1471
+ #quiz-countdown[data-value="76"]:after {
1472
+ width: 76%;
1473
+ }
1474
+ .single-quiz .quiz-result-field[data-value="77"]:before,
1475
+ .single-quiz .quiz-result-field[data-value="77"] span,
1476
+ #quiz-countdown[data-value="77"]:after {
1477
+ width: 77%;
1478
+ }
1479
+ .single-quiz .quiz-result-field[data-value="78"]:before,
1480
+ .single-quiz .quiz-result-field[data-value="78"] span,
1481
+ #quiz-countdown[data-value="78"]:after {
1482
+ width: 78%;
1483
+ }
1484
+ .single-quiz .quiz-result-field[data-value="79"]:before,
1485
+ .single-quiz .quiz-result-field[data-value="79"] span,
1486
+ #quiz-countdown[data-value="79"]:after {
1487
+ width: 79%;
1488
+ }
1489
+ .single-quiz .quiz-result-field[data-value="80"]:before,
1490
+ .single-quiz .quiz-result-field[data-value="80"] span,
1491
+ #quiz-countdown[data-value="80"]:after {
1492
+ width: 80%;
1493
+ }
1494
+ .single-quiz .quiz-result-field[data-value="81"]:before,
1495
+ .single-quiz .quiz-result-field[data-value="81"] span,
1496
+ #quiz-countdown[data-value="81"]:after {
1497
+ width: 81%;
1498
+ }
1499
+ .single-quiz .quiz-result-field[data-value="82"]:before,
1500
+ .single-quiz .quiz-result-field[data-value="82"] span,
1501
+ #quiz-countdown[data-value="82"]:after {
1502
+ width: 82%;
1503
+ }
1504
+ .single-quiz .quiz-result-field[data-value="83"]:before,
1505
+ .single-quiz .quiz-result-field[data-value="83"] span,
1506
+ #quiz-countdown[data-value="83"]:after {
1507
+ width: 83%;
1508
+ }
1509
+ .single-quiz .quiz-result-field[data-value="84"]:before,
1510
+ .single-quiz .quiz-result-field[data-value="84"] span,
1511
+ #quiz-countdown[data-value="84"]:after {
1512
+ width: 84%;
1513
+ }
1514
+ .single-quiz .quiz-result-field[data-value="85"]:before,
1515
+ .single-quiz .quiz-result-field[data-value="85"] span,
1516
+ #quiz-countdown[data-value="85"]:after {
1517
+ width: 85%;
1518
+ }
1519
+ .single-quiz .quiz-result-field[data-value="86"]:before,
1520
+ .single-quiz .quiz-result-field[data-value="86"] span,
1521
+ #quiz-countdown[data-value="86"]:after {
1522
+ width: 86%;
1523
+ }
1524
+ .single-quiz .quiz-result-field[data-value="87"]:before,
1525
+ .single-quiz .quiz-result-field[data-value="87"] span,
1526
+ #quiz-countdown[data-value="87"]:after {
1527
+ width: 87%;
1528
+ }
1529
+ .single-quiz .quiz-result-field[data-value="88"]:before,
1530
+ .single-quiz .quiz-result-field[data-value="88"] span,
1531
+ #quiz-countdown[data-value="88"]:after {
1532
+ width: 88%;
1533
+ }
1534
+ .single-quiz .quiz-result-field[data-value="89"]:before,
1535
+ .single-quiz .quiz-result-field[data-value="89"] span,
1536
+ #quiz-countdown[data-value="89"]:after {
1537
+ width: 89%;
1538
+ }
1539
+ .single-quiz .quiz-result-field[data-value="90"]:before,
1540
+ .single-quiz .quiz-result-field[data-value="90"] span,
1541
+ #quiz-countdown[data-value="90"]:after {
1542
+ width: 90%;
1543
+ }
1544
+ .single-quiz .quiz-result-field[data-value="91"]:before,
1545
+ .single-quiz .quiz-result-field[data-value="91"] span,
1546
+ #quiz-countdown[data-value="91"]:after {
1547
+ width: 91%;
1548
+ }
1549
+ .single-quiz .quiz-result-field[data-value="92"]:before,
1550
+ .single-quiz .quiz-result-field[data-value="92"] span,
1551
+ #quiz-countdown[data-value="92"]:after {
1552
+ width: 92%;
1553
+ }
1554
+ .single-quiz .quiz-result-field[data-value="93"]:before,
1555
+ .single-quiz .quiz-result-field[data-value="93"] span,
1556
+ #quiz-countdown[data-value="93"]:after {
1557
+ width: 93%;
1558
+ }
1559
+ .single-quiz .quiz-result-field[data-value="94"]:before,
1560
+ .single-quiz .quiz-result-field[data-value="94"] span,
1561
+ #quiz-countdown[data-value="94"]:after {
1562
+ width: 94%;
1563
+ }
1564
+ .single-quiz .quiz-result-field[data-value="95"]:before,
1565
+ .single-quiz .quiz-result-field[data-value="95"] span,
1566
+ #quiz-countdown[data-value="95"]:after {
1567
+ width: 95%;
1568
+ }
1569
+ .single-quiz .quiz-result-field[data-value="96"]:before,
1570
+ .single-quiz .quiz-result-field[data-value="96"] span,
1571
+ #quiz-countdown[data-value="96"]:after {
1572
+ width: 96%;
1573
+ }
1574
+ .single-quiz .quiz-result-field[data-value="97"]:before,
1575
+ .single-quiz .quiz-result-field[data-value="97"] span,
1576
+ #quiz-countdown[data-value="97"]:after {
1577
+ width: 97%;
1578
+ }
1579
+ .single-quiz .quiz-result-field[data-value="98"]:before,
1580
+ .single-quiz .quiz-result-field[data-value="98"] span,
1581
+ #quiz-countdown[data-value="98"]:after {
1582
+ width: 98%;
1583
+ }
1584
+ .single-quiz .quiz-result-field[data-value="99"]:before,
1585
+ .single-quiz .quiz-result-field[data-value="99"] span,
1586
+ #quiz-countdown[data-value="99"]:after {
1587
+ width: 99%;
1588
+ }
1589
+ .single-quiz .quiz-result-field[data-value="100"]:before,
1590
+ .single-quiz .quiz-result-field[data-value="100"] span,
1591
+ #quiz-countdown[data-value="100"]:after {
1592
+ width: 100%;
1593
+ }
1594
+ /* QUESTION */
1595
+ .learn-press-question-options {
1596
+ list-style: none;
1597
+ margin: 0 0 20px 0;
1598
+ padding: 0;
1599
+ }
1600
+ .learn-press-question-options > li.answer-option {
1601
+ font-size: 16px;
1602
+ background: #F5F5F5;
1603
+ margin-bottom: 20px;
1604
+ position: relative;
1605
+ -webkit-border-radius: 4px;
1606
+ -khtml-border-radius: 4px;
1607
+ -moz-border-radius: 4px;
1608
+ -ms-border-radius: 4px;
1609
+ -o-border-radius: 4px;
1610
+ border-radius: 4px;
1611
+ }
1612
+ .learn-press-question-options > li.answer-option > label {
1613
+ display: block;
1614
+ }
1615
+ .learn-press-question-options > li.answer-option > label input[type="checkbox"],
1616
+ .learn-press-question-options > li.answer-option > label input[type="radio"] {
1617
+ border: 0;
1618
+ -webkit-appearance: initial;
1619
+ width: 30px;
1620
+ height: 30px;
1621
+ background: #fff;
1622
+ border-radius: 4px;
1623
+ outline: none;
1624
+ position: absolute;
1625
+ top: 10px;
1626
+ left: 15px;
1627
+ margin: 0;
1628
+ }
1629
+ .learn-press-question-options > li.answer-option > label input[type="checkbox"]:checked:before,
1630
+ .learn-press-question-options > li.answer-option > label input[type="radio"]:checked:before {
1631
+ content: '';
1632
+ border: 4px solid #00b9eb;
1633
+ display: inline-block;
1634
+ width: 10px;
1635
+ height: 15px;
1636
+ border-top: none;
1637
+ border-left: none;
1638
+ position: absolute;
1639
+ top: 3px;
1640
+ left: 8px;
1641
+ box-sizing: content-box;
1642
+ -webkit-transform: rotate(36deg);
1643
+ -khtml-transform: rotate(36deg);
1644
+ -moz-transform: rotate(36deg);
1645
+ -ms-transform: rotate(36deg);
1646
+ -o-transform: rotate(36deg);
1647
+ transform: rotate(36deg);
1648
+ }
1649
+ .learn-press-question-options > li.answer-option > label input[type="checkbox"]:checked + p,
1650
+ .learn-press-question-options > li.answer-option > label input[type="radio"]:checked + p {
1651
+ font-weight: bold;
1652
+ background: #00b9eb;
1653
+ color: #FFF;
1654
+ }
1655
+ .learn-press-question-options > li.answer-option > label input[type="checkbox"][disabled],
1656
+ .learn-press-question-options > li.answer-option > label input[type="radio"][disabled] {
1657
+ opacity: 1;
1658
+ }
1659
+ .learn-press-question-options > li.answer-option > label input[type="radio"] {
1660
+ -webkit-border-radius: 50%;
1661
+ -khtml-border-radius: 50%;
1662
+ -moz-border-radius: 50%;
1663
+ -ms-border-radius: 50%;
1664
+ -o-border-radius: 50%;
1665
+ border-radius: 50%;
1666
+ }
1667
+ .learn-press-question-options > li.answer-option > label p {
1668
+ min-height: 50px;
1669
+ padding: 5px 20px 5px 60px;
1670
+ margin: 0;
1671
+ box-sizing: border-box;
1672
+ line-height: 1.5;
1673
+ }
1674
+ .learn-press-question-options > li.answer-option > label p.single-lines {
1675
+ padding: 0 20px 0 60px;
1676
+ line-height: 50px;
1677
+ /* middle */
1678
+ }
1679
+ .learn-press-question-options > li.answer-option label p {
1680
+ -webkit-border-radius: 4px;
1681
+ -khtml-border-radius: 4px;
1682
+ -moz-border-radius: 4px;
1683
+ -ms-border-radius: 4px;
1684
+ -o-border-radius: 4px;
1685
+ border-radius: 4px;
1686
+ }
1687
+ .learn-press-question-options > li.answer-option.answer-true label p {
1688
+ background: #00b9eb;
1689
+ color: #FFF;
1690
+ }
1691
+ .learn-press-question-options > li.answer-option:hover label p {
1692
+ background: #D4D4D4;
1693
+ cursor: pointer;
1694
+ }
1695
+ .learn-press-question-options > li.answer-option.user-answer-false {
1696
+ background: #F5F5F5;
1697
+ }
1698
+ .learn-press-question-options > li.answer-option.user-answer-false > label input[type="checkbox"] + p,
1699
+ .learn-press-question-options > li.answer-option.user-answer-false > label input[type="radio"] + p {
1700
+ text-decoration: line-through;
1701
+ color: #FF0000;
1702
+ background: #F5F5F5;
1703
+ }
1704
+ .learn-press-question-options .answer-option-result label p {
1705
+ display: inline-block;
1706
+ margin: 0;
1707
+ font-size: smaller;
1708
+ }
1709
+ .learn-press-question-options .answer-option-result label input[disabled] {
1710
+ opacity: 1;
1711
+ }
1712
+ .learnpress-content {
1713
+ margin-bottom: 20px;
1714
+ }
1715
+ .course-meta {
1716
+ margin-bottom: 20px;
1717
+ }
1718
+ .course-meta .course-origin-price {
1719
+ padding-right: 5px;
1720
+ text-decoration: line-through;
1721
+ }
1722
+ .course-meta .course-price {
1723
+ font-weight: bold;
1724
+ }
1725
+ /** MESSAGE */
1726
+ .learn-press-message {
1727
+ background: #F5F5F5;
1728
+ border-left: 5px solid #00A0D2;
1729
+ padding: 10px 20px 1px 20px;
1730
+ margin-bottom: 20px;
1731
+ }
1732
+ .learn-press-message button {
1733
+ float: right;
1734
+ }
1735
+ .learn-press-message p {
1736
+ margin-bottom: 10px;
1737
+ }
1738
+ .learn-press-message:after {
1739
+ clear: both;
1740
+ content: '';
1741
+ display: block;
1742
+ }
1743
+ .learn-press-message.notice {
1744
+ border-left-color: #b3d20a;
1745
+ }
1746
+ .learn-press-message.error {
1747
+ border-left-color: #b81c23;
1748
+ }
1749
+ .learn-press-message ul {
1750
+ list-style-type: none;
1751
+ }
1752
+ /**/
1753
+ .learn-press-checkout-comment,
1754
+ .learn-press-checkout-payment {
1755
+ margin-bottom: 20px;
1756
+ }
1757
+ .learn-press-checkout-payment .payment-methods {
1758
+ list-style: none;
1759
+ margin: 0;
1760
+ }
1761
+ /* COURSE QUIZ */
1762
+ .single-quiz .quiz-questions-list {
1763
+ padding: 0;
1764
+ }
1765
+ .single-quiz .quiz-intro {
1766
+ list-style: none;
1767
+ padding: 10px 20px;
1768
+ background: #F5F5F5;
1769
+ margin: 0 0 20px 0;
1770
+ }
1771
+ .single-quiz h4 {
1772
+ margin-bottom: 10px;
1773
+ font-size: 18px;
1774
+ }
1775
+ .learn-press-tooltip {
1776
+ font-size: 20px;
1777
+ display: inline-block;
1778
+ vertical-align: middle;
1779
+ background: #0f4956;
1780
+ cursor: pointer;
1781
+ line-height: 1;
1782
+ width: 10px;
1783
+ height: 10px;
1784
+ border-radius: 50%;
1785
+ font-weight: 700;
1786
+ position: relative;
1787
+ }
1788
+ .learn-press-tooltip:before {
1789
+ content: "?";
1790
+ font-size: 7px;
1791
+ color: white;
1792
+ position: absolute;
1793
+ top: 2px;
1794
+ left: 3px;
1795
+ }
1796
+ .learn-press-user-profile .learn-press-tabs {
1797
+ list-style: none;
1798
+ margin: 30px 0 20px;
1799
+ padding-left: 5px;
1800
+ border-bottom: 1px solid #DDD;
1801
+ }
1802
+ .learn-press-user-profile .learn-press-tabs > li {
1803
+ float: left;
1804
+ list-style-type: none;
1805
+ }
1806
+ .learn-press-user-profile .learn-press-tabs > li > a {
1807
+ box-shadow: none;
1808
+ outline: none;
1809
+ display: block;
1810
+ border: none;
1811
+ padding: 5px 10px;
1812
+ }
1813
+ .learn-press-user-profile .learn-press-tabs > li.current a {
1814
+ background-color: #FFF;
1815
+ border: 1px solid #DDD;
1816
+ border-bottom-color: transparent;
1817
+ z-index: 10;
1818
+ margin-bottom: -1px;
1819
+ }
1820
+ .learn-press-user-profile .learn-press-tabs-wrapper-x .learn-press-subtabs > li {
1821
+ display: inline-block;
1822
+ margin-right: 10px;
1823
+ }
1824
+ .learn-press-user-profile .learn-press-tabs-wrapper-x .learn-press-subtabs > li.current {
1825
+ font-weight: bold;
1826
+ }
1827
+ .learn-press-user-profile .learn-press-tabs-wrapper-x .learn-press-subtab-content {
1828
+ display: none;
1829
+ }
1830
+ .learn-press-user-profile .learn-press-tabs-wrapper-x .learn-press-subtab-content.current {
1831
+ display: block;
1832
+ }
1833
+ .learn-press-user-profile .learn-press-tabs-wrapper-x .learn-press-subtab-content li.course h3 {
1834
+ padding-bottom: 10px;
1835
+ }
1836
+ .learn-press-user-profile .learn-press-tabs-wrapper-x .learn-press-subtab-content .profile-courses {
1837
+ list-style-type: none;
1838
+ }
1839
+ .learn-press-user-profile .learn-press-tabs-wrapper-x .learn-press-subtab-content .profile-courses .learn-press-course-results-progress {
1840
+ padding: 0 15px 15px 15px;
1841
+ margin: 0;
1842
+ }
1843
+ .learn-press-pagination {
1844
+ text-align: center;
1845
+ }
1846
+ .learn-press-pagination ul {
1847
+ list-style: disc;
1848
+ }
1849
+ .learn-press-pagination ul > li {
1850
+ display: inline-block;
1851
+ }
1852
+ .learn-press-pagination ul > li span {
1853
+ display: inline-block;
1854
+ padding: 0 10px;
1855
+ border: 1px solid #DDD;
1856
+ background-color: #F5F5F5;
1857
+ }
1858
+ .learn-press-pagination ul > li a {
1859
+ display: inline-block;
1860
+ padding: 0 10px;
1861
+ border: 1px solid #DDD;
1862
+ background-color: #FFF;
1863
+ }
1864
+ .learn-press-become-teacher-form ul {
1865
+ list-style: none;
1866
+ padding: 0;
1867
+ }
1868
+ .learn-press-become-teacher-form ul li {
1869
+ margin-bottom: 20px;
1870
+ }
1871
+ /* jAlerts */
1872
+ #popup_container {
1873
+ background: #FFF;
1874
+ }
1875
+ #popup_container #popup_title {
1876
+ padding: 10px 20px;
1877
+ background: #18B6C7;
1878
+ color: #FFF;
1879
+ font-size: 18px;
1880
+ margin: 0;
1881
+ }
1882
+ #popup_container #popup_content {
1883
+ padding: 20px;
1884
+ }
1885
+ #popup_container #popup_content #popup_message {
1886
+ margin-bottom: 20px;
1887
+ }
1888
+ #popup_container #popup_panel {
1889
+ text-align: center;
1890
+ }
1891
+ .single-lp_course .course-students {
1892
+ padding-top: 10px;
1893
+ }
1894
+ .single-lp_course .course-students-list {
1895
+ margin-top: 10px;
1896
+ }
1897
+ .single-lp_course .course-students-list .students {
1898
+ list-style-type: none;
1899
+ margin: 0;
1900
+ }
1901
+ .single-lp_course .course-students-list .students li {
1902
+ display: inline-block;
1903
+ margin-right: 10px;
1904
+ }
1905
+ .single-lp_course .course-students-list .students p {
1906
+ margin-top: 15px;
1907
+ }
1908
+ .single-lp_course .lp_course .entry-footer {
1909
+ display: none;
1910
+ }
1911
+ /* tooltip */
1912
+ .learn-press-tooltip-bubble {
1913
+ position: absolute;
1914
+ background: rgba(26, 26, 26, 0.9);
1915
+ color: #ffffff;
1916
+ padding: 8px 10px;
1917
+ font-size: 12px;
1918
+ z-index: 9999999;
1919
+ line-height: 1;
1920
+ border-radius: 3px;
1921
+ }
1922
+ /* fill in blank */
1923
+ input.blank-fill-correct {
1924
+ width: auto;
1925
+ }
1926
+ body.content-item-only {
1927
+ background: #FFF;
1928
+ opacity: 0;
1929
+ }
1930
+ body.content-item-only .learn-press-content-item-only {
1931
+ position: fixed;
1932
+ z-index: 9999999;
1933
+ left: 0;
1934
+ top: 0;
1935
+ width: 100%;
1936
+ height: 100%;
1937
+ background: #FFF;
1938
+ overflow: auto;
1939
+ padding: 20px;
1940
+ margin: 0;
1941
+ }
1942
+ body.content-item-only #learn-press-content-item {
1943
+ border: none;
1944
+ display: block;
1945
+ }
1946
+ .lp-group-heading-title.toggle-off,
1947
+ .lp-group-heading-title.toggle-on {
1948
+ cursor: pointer;
1949
+ }
1950
+ .lp-group-heading-title.toggle-off .toggle-icon,
1951
+ .lp-group-heading-title.toggle-on .toggle-icon {
1952
+ display: inline-block;
1953
+ font-size: larger;
1954
+ line-height: 1;
1955
+ font-weight: bold;
1956
+ margin-left: 5px;
1957
+ }
1958
+ .lp-group-heading-title.toggle-off .toggle-icon:before,
1959
+ .lp-group-heading-title.toggle-on .toggle-icon:before {
1960
+ content: '+';
1961
+ }
1962
+ .lp-group-heading-title.toggle-on .toggle-icon:before {
1963
+ content: '-';
1964
+ }
1965
+ /*
1966
+ .sidebar-hide-btn, .sidebar-show-btn {
1967
+ cursor: pointer;
1968
+ width: 60px;
1969
+ height: 60px;
1970
+ display: inline-block;
1971
+ font-size: 34px;
1972
+ line-height: 60px;
1973
+ text-align: center;
1974
+ color: #FFF;
1975
+ position: absolute;
1976
+
1977
+
1978
+ }*/
1979
+ .user-profile-edit-form .info-field {
1980
+ margin-bottom: 20px;
1981
+ }
1982
+ .user-profile-edit-form .description {
1983
+ margin-top: 5px;
1984
+ }
1985
+ .user-profile-edit-form .user-profile-picture {
1986
+ clear: both;
1987
+ }
1988
+ .user-profile-edit-form .user-profile-picture .picture,
1989
+ .user-profile-edit-form .user-profile-picture .change-picture {
1990
+ display: inline-block;
1991
+ }
1992
+ .user-profile-edit-form .user-profile-picture .change-picture .description {
1993
+ margin: 0 0 10px 0;
1994
+ }
1995
+ .user-profile-edit-form .user-profile-picture img {
1996
+ float: left;
1997
+ margin-right: 20px;
1998
+ }
1999
+ .user-profile-edit-form .user-profile-picture:after {
2000
+ display: block;
2001
+ content: '';
2002
+ clear: both;
2003
+ }
2004
+ .user-profile-edit-form .user-profile-picture:after:after {
2005
+ content: '';
2006
+ display: block;
2007
+ clear: both;
2008
+ }
2009
+ .user-profile-edit-form .profile-field-name {
2010
+ font-weight: bold;
2011
+ margin-bottom: 10px;
2012
+ }
2013
+ .user-profile-edit-form .change-password {
2014
+ margin-bottom: 10px;
2015
+ }
2016
+ .user-profile-edit-form #user_profile_password_form input {
2017
+ margin-bottom: 20px;
2018
+ }
2019
+ .user-profile-edit-form #user_profile_password_form .description {
2020
+ margin-top: -15px;
2021
+ }
2022
+ .user-profile-edit-form .update-profile {
2023
+ margin-top: 20px;
2024
+ }
2025
+ .payment-method-form.payment_method_authorizenet {
2026
+ background: #f7f7f7;
2027
+ border-radius: 5px;
2028
+ -webkit-border-radius: 5px;
2029
+ -moz-border-radius: 5px;
2030
+ padding-top: 25px;
2031
+ }
2032
+ .payment-method-form.payment_method_authorizenet .row-fluid {
2033
+ clear: both;
2034
+ padding-bottom: 25px;
2035
+ }
2036
+ .payment-method-form.payment_method_authorizenet .row-fluid .span6:first-child {
2037
+ width: 50%;
2038
+ float: left;
2039
+ }
2040
+ .payment-method-form.payment_method_authorizenet .row-fluid .span6:first-child label {
2041
+ margin-left: 17px;
2042
+ }
2043
+ .payment-method-form.payment_method_authorizenet .row-fluid .span6:first-child select,
2044
+ .payment-method-form.payment_method_authorizenet .row-fluid .span6:first-child input {
2045
+ margin-left: 10px;
2046
+ }
2047
+ .payment-method-form.payment_method_authorizenet .row-fluid .span6 select,
2048
+ .payment-method-form.payment_method_authorizenet .row-fluid .span6 input {
2049
+ padding: 8px 0;
2050
+ }
2051
+ .payment-method-form.payment_method_authorizenet .row-fluid .span6 select.required {
2052
+ color: #000;
2053
+ }
2054
+ .place-order-action {
2055
+ margin-top: 20px;
2056
+ }
2057
+ .learn-press-search-course-form {
2058
+ margin-bottom: 20px;
2059
+ }
2060
+ .learn-press-search-course-form input.search-course-input[name="s"] {
2061
+ margin-right: -200px;
2062
+ width: 100%;
2063
+ }
2064
+ .learn-press-search-course-form .search-course-button {
2065
+ vertical-align: middle;
2066
+ float: right;
2067
+ z-index: 10;
2068
+ position: relative;
2069
+ }
2070
+ @-moz-keyframes spin-12 {
2071
+ 0% {
2072
+ -moz-transform: rotate(0deg) translate(0px);
2073
+ }
2074
+ 100% {
2075
+ -moz-transform: rotate(360deg) translate(0px);
2076
+ }
2077
+ }
2078
+ @-webkit-keyframes spin-12 {
2079
+ 0% {
2080
+ -webkit-transform: rotate(0deg) translate(0px);
2081
+ }
2082
+ 100% {
2083
+ -webkit-transform: rotate(360deg) translate(0px);
2084
+ }
2085
+ }
2086
+ @keyframes spin-12 {
2087
+ 0% {
2088
+ -webkit-transform: rotate(0deg) translate(0px);
2089
+ transform: rotate(0deg) translate(0px);
2090
+ }
2091
+ 100% {
2092
+ -webkit-transform: rotate(360deg) translate(0px);
2093
+ transform: rotate(360deg) translate(0px);
2094
+ }
2095
+ }
2096
+ @-moz-keyframes spin-13 {
2097
+ 100% {
2098
+ -moz-transform: rotate(0deg) translate(0px);
2099
+ }
2100
+ 0% {
2101
+ -moz-transform: rotate(360deg) translate(0px);
2102
+ }
2103
+ }
2104
+ @-webkit-keyframes spin-13 {
2105
+ 0% {
2106
+ -webkit-transform: rotate(0deg) translate(0px);
2107
+ }
2108
+ 100% {
2109
+ -webkit-transform: rotate(360deg) translate(0px);
2110
+ }
2111
+ }
2112
+ @keyframes spin-13 {
2113
+ 100% {
2114
+ -webkit-transform: rotate(0deg) translate(0px);
2115
+ transform: rotate(0deg) translate(0px);
2116
+ }
2117
+ 0% {
2118
+ -webkit-transform: rotate(360deg) translate(0px);
2119
+ transform: rotate(360deg) translate(0px);
2120
+ }
2121
+ }
2122
+ @media screen and (max-width: 1250px) {
2123
+ .single-lp_course .learn-press-course-results-progress .items-progress,
2124
+ .single-lp_course .learn-press-course-results-progress .course-progress {
2125
+ float: none;
2126
+ width: 100%;
2127
+ }
2128
+ .single-lp_course .learn-press-course-results-progress .items-progress {
2129
+ margin-bottom: 50px;
2130
+ }
2131
+ }
2132
+ @media screen and (max-width: 768px) {
2133
+ #learn-press-block-content:before {
2134
+ width: 60px;
2135
+ height: 60px;
2136
+ margin-left: -30px;
2137
+ margin-top: -30px;
2138
+ /*-76px;*/
2139
+ -webkit-clip-path: polygon(0px 60px, 60px 60px, 60px 30px, 30px 30px, 30px 0, 0 0);
2140
+ }
2141
+ #learn-press-block-content span {
2142
+ clip: rect(0, 64px, 32px, 32px);
2143
+ width: 64px;
2144
+ height: 64px;
2145
+ margin-left: -32px;
2146
+ margin-top: -32px;
2147
+ }
2148
+ #learn-press-block-content span:before {
2149
+ width: 64px;
2150
+ height: 64px;
2151
+ }
2152
+ .learn-press-course-results-progress .items-progress,
2153
+ .learn-press-course-results-progress .course-progress {
2154
+ width: 100%;
2155
+ margin-right: 0;
2156
+ }
2157
+ }
2158
+ @media (min-width: 992px) {
2159
+ .learn-press-courses li.course:nth-child(4n+1) {
2160
+ clear: left;
2161
+ }
2162
+ }
2163
+ @media (max-width: 992px) {
2164
+ .learn-press-courses {
2165
+ margin: 0;
2166
+ }
2167
+ }
2168
+ @media (max-width: 992px) and (min-width: 600px) {
2169
+ .learn-press-courses li.course {
2170
+ width: 31.33%;
2171
+ margin: 0 2% 30px 0;
2172
+ /* padding: 0 20px; */
2173
+ }
2174
+ .learn-press-courses li.course:nth-child(3n+1) {
2175
+ clear: left;
2176
+ margin-left: 0;
2177
+ }
2178
+ }
2179
+ @media (max-width: 600px) and (min-width: 400px) {
2180
+ .learn-press-courses li.course {
2181
+ width: 48%;
2182
+ margin: 0 2% 30px 0;
2183
+ /* padding: 0 20px; */
2184
+ }
2185
+ .learn-press-courses li.course:nth-child(2n+1) {
2186
+ clear: left;
2187
+ margin-left: 0;
2188
+ }
2189
+ }
2190
+ @media (max-width: 400px) {
2191
+ .learn-press-courses li.course {
2192
+ width: 100%;
2193
+ margin: 0 0 30px 0;
2194
+ clear: left;
2195
+ }
2196
+ }
2197
+ /* full width with twentysixteen theme */
2198
+ @media screen and (min-width: 61.5625em) {
2199
+ body.single-lp_course article.lp_course .entry-content {
2200
+ width: 100%;
2201
+ }
2202
+ body.single-lp_course article.lp_course .entry-footer {
2203
+ display: none;
2204
+ }
2205
+ }
2206
+ @media screen and (max-width: 615px) {
2207
+ .payment-method-form.payment_method_authorizenet .row-fluid {
2208
+ padding-bottom: 15px;
2209
+ }
2210
+ .payment-method-form.payment_method_authorizenet .row-fluid .span6:first-child {
2211
+ width: 100%;
2212
+ margin-bottom: 15px;
2213
+ }
2214
+ .payment-method-form.payment_method_authorizenet .row-fluid .span6 label {
2215
+ margin-left: 17px;
2216
+ }
2217
+ .payment-method-form.payment_method_authorizenet .row-fluid .span6 select,
2218
+ .payment-method-form.payment_method_authorizenet .row-fluid .span6 input {
2219
+ margin-left: 10px;
2220
+ }
2221
+ .payment-method-form.payment_method_authorizenet .row-fluid .span6 select,
2222
+ .payment-method-form.payment_method_authorizenet .row-fluid .span6 input {
2223
+ padding: 8px 0;
2224
+ }
2225
+ .payment-method-form.payment_method_authorizenet .row-fluid .span6 select.required {
2226
+ color: #000;
2227
+ }
2228
+ .payment-method-form.payment_method_authorizenet .row-fluid .span6 #learn-press-authorizenet-payment-expmonth {
2229
+ margin-bottom: 10px;
2230
+ }
2231
+ }
assets/css/learnpress.less CHANGED
@@ -1,11 +1,11 @@
1
- @icon-url: '../fonts/icomoon';
2
  @font-face {
3
  font-family: 'lp-icons';
4
- src: url('@{icon-url}.eot?6gvjr0');
5
- src: url('@{icon-url}.eot?6gvjr0#iefix') format('embedded-opentype'),
6
- url('@{icon-url}.ttf?6gvjr0') format('truetype'),
7
- url('@{icon-url}.woff?6gvjr0') format('woff'),
8
- url('@{icon-url}.svg?6gvjr0#icons') format('svg');
9
  font-weight: normal;
10
  font-style: normal;
11
  }
@@ -25,13 +25,67 @@
25
  -moz-osx-font-smoothing: grayscale;
26
  }
27
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
  .clearfix:after {
29
  display: block;
30
  content: '';
31
  clear: both;
32
  }
33
 
34
- .border-radius(@a: 3px, @b: 3px, @c: 3px, @d: 3px) {
35
  -webkit-border-radius: @arguments;
36
  -khtml-border-radius: @arguments;
37
  -moz-border-radius: @arguments;
@@ -78,8 +132,102 @@
78
  }
79
  }
80
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
81
  .hide-if-js {
82
- display: none;
83
  }
84
 
85
  /* Archive courses */
@@ -94,10 +242,11 @@
94
  clear: both;
95
  }
96
  li.course {
 
97
  float: left;
98
  width: 23%;
99
  margin: 0 2% 30px 0;
100
- /* padding: 0 20px; */
101
  box-sizing: border-box;
102
  border: 1px solid #DDD;
103
  background: #FFF;
@@ -108,10 +257,19 @@
108
  line-height: 1.5;
109
  }
110
  .course-thumbnail {
111
- & img {
 
112
  max-width: 100%;
113
  height: auto;
114
  }
 
 
 
 
 
 
 
 
115
  }
116
  .course-info {
117
  padding: 0 15px 15px;
@@ -131,10 +289,6 @@
131
  .course-info > * {
132
  display: block;
133
  }
134
- &:nth-child(4n+1) {
135
- clear: left;
136
- margin-left: 0px;
137
- }
138
  }
139
  }
140
 
@@ -142,6 +296,8 @@
142
  float: right;
143
  }
144
 
 
 
145
  #learn-press-course-curriculum {
146
  ul.curriculum-sections,
147
  ul.section-content {
@@ -149,10 +305,13 @@
149
  margin: 0;
150
  padding: 0;
151
  background-color: #F5F5F5;
 
 
 
152
  }
153
  .section-header {
154
  background-color: #EEE;
155
- margin: 0px;
156
  padding: 20px 15px;
157
  border-top: 1px solid #FFF;
158
  p {
@@ -161,25 +320,49 @@
161
  font-style: italic;
162
  color: rgb(153, 153, 153);
163
  font-size: smaller;
164
- margin: 0px;
165
  }
166
  &:hover {
167
  background: #DDD;
168
  }
169
- span {
170
  font-size: smaller;
171
  font-weight: normal;
172
  float: right;
173
- margin-top: 5px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
174
  }
175
  }
176
  .course-item {
177
- margin: 0px;
178
  list-style: none;
179
  padding: 15px 15px;
180
  border-top: 1px solid rgb(255, 255, 255);
181
  position: relative;
182
- cursor: pointer;
183
  .transition(background linear 0.5s);
184
  .lp-label-viewing,
185
  .lp-label-completed {
@@ -196,6 +379,13 @@
196
  .lp-icon {
197
  display: none;
198
  }
 
 
 
 
 
 
 
199
  &.course-lesson {
200
  .course-item-title {
201
  &:before {
@@ -226,6 +416,7 @@
226
  &.item-has-status .item-status {
227
  display: inline-block;
228
  background: #d6d6d6;
 
229
  &:before {
230
  content: '\ea10';
231
  }
@@ -241,10 +432,6 @@
241
  .transition(none);
242
  }
243
  }
244
- &:hover {
245
- background: #e7ecfb;
246
- .transition(background linear 0s);
247
- }
248
  }
249
 
250
  .course-item-meta {
@@ -274,11 +461,13 @@
274
 
275
  .lp-label {
276
  display: inline-block;
277
- line-height: 1;
278
- font-size: 65%;
279
- vertical-align: baseline;
280
- color: rgb(255, 255, 255);
281
- padding: 3px 8px;
 
 
282
  .border-radius(4px);
283
  &.lp-label-viewing {
284
  background-color: rgb(57, 175, 255);
@@ -292,6 +481,9 @@
292
  &.lp-label-quiz {
293
  background-color: #53658c;
294
  }
 
 
 
295
  }
296
 
297
  .learn-press-content-protected-message {
@@ -312,13 +504,51 @@
312
  }
313
  }
314
 
 
 
 
 
 
315
  /** COURSE PROGRESS **/
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
316
  .lp-course-progress {
317
  position: relative;
318
  .lp-progress-bar {
319
  height: 15px;
320
  background: #DDD;
321
- margin: 10px 0px 20px 0px;
322
  overflow: hidden;
323
  .border-radius(3px);
324
  .lp-progress-value {
@@ -332,6 +562,8 @@
332
  position: absolute;
333
  height: 25px;
334
  top: -5px;
 
 
335
  &:before,
336
  &:after {
337
  content: '';
@@ -352,15 +584,8 @@
352
 
353
  #learn-press-content-item {
354
  border: 1px solid #DDD;
355
- .learn-press-content-item-title {
356
- padding: 20px;
357
- background: #F5F5F5;
358
- margin: 0;
359
- }
360
- .learn-press-content-item-summary {
361
- padding: 20px;
362
- border-top: 1px solid #DDD;
363
- }
364
  }
365
 
366
  /** COURSE TABS **/
@@ -368,18 +593,22 @@
368
  .learn-press-nav-tabs {
369
  list-style: none;
370
  padding: 0 0 0 15px;
371
- margin: 0;
372
  border-bottom: 1px solid #DDD;
373
  .learn-press-nav-tab {
 
374
  float: left;
375
  margin-bottom: -1px;
376
  position: relative;
377
  a {
378
  display: inline-block;
379
  padding: 10px 15px;
 
380
  }
381
  &.active {
382
  border: 1px solid #DDD;
 
 
383
  }
384
  &.active:after {
385
  position: absolute;
@@ -400,14 +629,45 @@
400
  }
401
  .learn-press-tab-panel {
402
  display: none;
 
403
  &.active {
404
  display: block;
405
  }
406
  }
407
  }
408
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
409
  /* POPUP */
410
 
 
 
 
 
 
 
 
 
411
  body.course-has-popup {
412
  overflow: hidden;
413
  }
@@ -420,11 +680,14 @@ body.course-has-popup {
420
  bottom: 0;
421
  background: #000;
422
  z-index: 999999;
 
 
 
423
  #popup-sidebar {
424
  float: left;
425
  width: 350px;
426
  position: absolute;
427
- top: 0;
428
  bottom: 0;
429
  overflow: auto;
430
  background: #FFF;
@@ -436,6 +699,14 @@ body.course-has-popup {
436
  margin: 0;
437
  font-size: smaller;
438
  }
 
 
 
 
 
 
 
 
439
  }
440
  #popup-main {
441
  position: absolute;
@@ -447,55 +718,85 @@ body.course-has-popup {
447
  #popup-header {
448
  position: absolute;
449
  top: 0;
450
- left: 0;
451
  right: 0;
452
- height: 50px;
453
- background: #F5F5F5;
454
- border-bottom: 1px solid #DDD;
455
- .popup-close {
456
- width: 50px;
457
- height: 50px;
 
 
 
 
 
 
 
 
458
  position: absolute;
459
- right: 0;
460
  top: 0;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
461
  &:before,
462
  &:after {
463
  content: '';
464
- border-top: 3px solid #636060;
465
  width: 30px;
466
  display: inline-block;
467
  position: absolute;
 
 
468
  }
469
  &:before {
470
  -webkit-transform: rotate(45deg);
471
- top: 25px;
472
  }
473
  &:after {
474
  -webkit-transform: rotate(-45deg);
475
- top: 25px;
 
 
 
 
 
476
  }
477
  }
478
- h3 {
479
- margin: 0;
480
- height: 50px;
481
- line-height: 50px;
482
  padding: 0 20px;
 
 
483
  }
484
 
485
  }
486
  #popup-content {
487
  position: absolute;
488
- top: 50px;
489
  bottom: 50px;
490
  left: 0;
491
  right: 0;
492
  overflow: auto;
493
  #popup-content-inner {
494
- margin: 20px;
495
- }
496
- .learn-press-course-results-progress{
497
- margin: 20px;
498
-
499
  }
500
  }
501
  #popup-footer {
@@ -521,16 +822,1001 @@ body.course-has-popup {
521
  }
522
  }
523
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
524
  }
525
 
526
  /* COURSE QUIZ */
527
- .single-quiz {
528
- .quiz-questions-list {
529
- list-style: none;
530
- padding: 0;
 
 
 
 
 
 
 
 
 
 
 
 
 
531
  }
532
- .quiz-intro {
533
- list-style: none;
534
- padding: 0;
 
 
 
 
 
 
 
 
 
 
 
535
  }
536
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @icon-url: '../fonts/lp-icons';
2
  @font-face {
3
  font-family: 'lp-icons';
4
+ src: url('@{icon-url}.eot?f41nl');
5
+ src: url('@{icon-url}.eot?f41nl#iefix') format('embedded-opentype'),
6
+ url('@{icon-url}.ttf?f41nl') format('truetype'),
7
+ url('@{icon-url}.woff?f41nl') format('woff'),
8
+ url('@{icon-url}.svg?f41nl#lp-icons') format('svg');
9
  font-weight: normal;
10
  font-style: normal;
11
  }
25
  -moz-osx-font-smoothing: grayscale;
26
  }
27
 
28
+ .lp-icon-file-text2:before {
29
+ content: "\e926";
30
+ }
31
+
32
+ .lp-icon-file-picture:before {
33
+ content: "\e927";
34
+ }
35
+
36
+ .lp-icon-file-music:before {
37
+ content: "\e928";
38
+ }
39
+
40
+ .lp-icon-file-video:before {
41
+ content: "\e92a";
42
+ }
43
+
44
+ .lp-icon-file-zip:before {
45
+ content: "\e92b";
46
+ }
47
+
48
+ .lp-icon-paste:before {
49
+ content: "\e92d";
50
+ }
51
+
52
+ .lp-icon-alarm:before {
53
+ content: "\e950";
54
+ }
55
+
56
+ .lp-icon-cross:before {
57
+ content: "\ea0f";
58
+ }
59
+
60
+ .lp-icon-checkmark:before {
61
+ content: "\ea10";
62
+ }
63
+
64
+ .lp-icon-spinner2:before {
65
+ content: "\e97b";
66
+ }
67
+
68
+ .lp-icon-plus:before {
69
+ content: "\ea0a";
70
+ }
71
+
72
+ .lp-icon-minus:before {
73
+ content: "\ea0b";
74
+ }
75
+
76
+ .clearfix() {
77
+ display: block;
78
+ content: '';
79
+ clear: both;
80
+ }
81
+
82
  .clearfix:after {
83
  display: block;
84
  content: '';
85
  clear: both;
86
  }
87
 
88
+ .border-radius(@args) {
89
  -webkit-border-radius: @arguments;
90
  -khtml-border-radius: @arguments;
91
  -moz-border-radius: @arguments;
132
  }
133
  }
134
 
135
+ .animation(@args) {
136
+ -webkit-animation: @arguments;
137
+ -moz-animation: @arguments;
138
+ animation: @arguments;
139
+ }
140
+
141
+ .overlay-processing {
142
+ &:before, &:after {
143
+ content: '';
144
+ display: block;
145
+ position: fixed;
146
+ top: 0;
147
+ left: 0;
148
+ width: 100%;
149
+ height: 100%;
150
+ z-index: 999999;
151
+ }
152
+ &:before {
153
+ background: #000;
154
+ opacity: 0.5;
155
+ }
156
+ &:after {
157
+ background: #FFF;
158
+ }
159
+ }
160
+
161
+ /* PROGRESS CIRCLE */
162
+ .progress-circle(@size: 200px, @background: #DDD, @fill: #95e6f9, @initialize: 0, @inside-size: 170px, @inside-background: #FFF) {
163
+ .progress-circle {
164
+ width: @size;
165
+ height: @size;
166
+ border-radius: 50%;
167
+ background-color: @background;
168
+ position: relative;
169
+ .background {
170
+ content: "";
171
+ position: absolute;
172
+ border-radius: 50%;
173
+ width: @size;
174
+ height: @size;
175
+ clip: rect(0, @size, @size, @size / 2);
176
+ .fill {
177
+ content: "";
178
+ position: absolute;
179
+ border-radius: 50%;
180
+ width: @size;
181
+ height: @size;
182
+ clip: rect(0, @size / 2, @size, 0);
183
+ background: @fill;
184
+ transform: rotate(unit(@initialize*3.6, deg));
185
+ }
186
+ }
187
+ &:after {
188
+ content: '';
189
+ width: @inside-size;
190
+ height: @inside-size;
191
+ background: @inside-background;
192
+ .border-radius(50%);
193
+ position: absolute;
194
+ top: 50%;
195
+ left: 50%;
196
+ margin-top: -@inside-size / 2;
197
+ margin-left: -@inside-size / 2;
198
+ pointer-events: none;
199
+ }
200
+ .inside {
201
+ position: absolute;
202
+ width: 100%;
203
+ height: 100%;
204
+ line-height: @size;
205
+ text-align: center;
206
+ z-index: 10;
207
+ }
208
+ &.gt-50 {
209
+ background-color: @fill;
210
+ .background {
211
+ clip: rect(0, @size/2, @size, 0);
212
+ }
213
+ .fill {
214
+ clip: rect(0, @size, @size, @size/2);
215
+ background: @background;
216
+ }
217
+ }
218
+ }
219
+ }
220
+
221
+ .clearfix() {
222
+ &:after {
223
+ content: '';
224
+ display: block;
225
+ clear: both;
226
+ }
227
+ }
228
+
229
  .hide-if-js {
230
+ display: none !important;
231
  }
232
 
233
  /* Archive courses */
242
  clear: both;
243
  }
244
  li.course {
245
+ list-style-type: none;
246
  float: left;
247
  width: 23%;
248
  margin: 0 2% 30px 0;
249
+ padding: 0;
250
  box-sizing: border-box;
251
  border: 1px solid #DDD;
252
  background: #FFF;
257
  line-height: 1.5;
258
  }
259
  .course-thumbnail {
260
+ position: relative;
261
+ img {
262
  max-width: 100%;
263
  height: auto;
264
  }
265
+ &:after {
266
+ content: '';
267
+ position: absolute;
268
+ width: 100%;
269
+ height: 100%;
270
+ left: 0;
271
+ top: 0;
272
+ }
273
  }
274
  .course-info {
275
  padding: 0 15px 15px;
289
  .course-info > * {
290
  display: block;
291
  }
 
 
 
 
292
  }
293
  }
294
 
296
  float: right;
297
  }
298
 
299
+ //
300
+
301
  #learn-press-course-curriculum {
302
  ul.curriculum-sections,
303
  ul.section-content {
305
  margin: 0;
306
  padding: 0;
307
  background-color: #F5F5F5;
308
+ li.section {
309
+ list-style-type: none;
310
+ }
311
  }
312
  .section-header {
313
  background-color: #EEE;
314
+ margin: 0;
315
  padding: 20px 15px;
316
  border-top: 1px solid #FFF;
317
  p {
320
  font-style: italic;
321
  color: rgb(153, 153, 153);
322
  font-size: smaller;
323
+ margin: 0;
324
  }
325
  &:hover {
326
  background: #DDD;
327
  }
328
+ .meta {
329
  font-size: smaller;
330
  font-weight: normal;
331
  float: right;
332
+ /*margin-top: 5px;*/
333
+ .collapse {
334
+ display: inline-block;
335
+ position: relative;
336
+ font-family: 'lp-icons';
337
+ background: #95e6f9;
338
+ width: 24px;
339
+ height: 24px;
340
+ line-height: 24px;
341
+ text-align: center;
342
+ color: #FFF;
343
+ border-radius: 5px;
344
+ vertical-align: middle;
345
+ margin-left: 5px;
346
+ &:before {
347
+ content: "\ea0b";
348
+ }
349
+ &:hover {
350
+ cursor: pointer;
351
+ }
352
+ &.plus {
353
+ &:before {
354
+ content: "\ea0a";
355
+ }
356
+ }
357
+ }
358
  }
359
  }
360
  .course-item {
361
+ margin: 0;
362
  list-style: none;
363
  padding: 15px 15px;
364
  border-top: 1px solid rgb(255, 255, 255);
365
  position: relative;
 
366
  .transition(background linear 0.5s);
367
  .lp-label-viewing,
368
  .lp-label-completed {
379
  .lp-icon {
380
  display: none;
381
  }
382
+ &.viewable {
383
+ cursor: pointer;
384
+ &:hover {
385
+ background: #e7ecfb;
386
+ .transition(background linear 0s);
387
+ }
388
+ }
389
  &.course-lesson {
390
  .course-item-title {
391
  &:before {
416
  &.item-has-status .item-status {
417
  display: inline-block;
418
  background: #d6d6d6;
419
+ margin-left: 5px;
420
  &:before {
421
  content: '\ea10';
422
  }
432
  .transition(none);
433
  }
434
  }
 
 
 
 
435
  }
436
 
437
  .course-item-meta {
461
 
462
  .lp-label {
463
  display: inline-block;
464
+ line-height: 24px;
465
+ font-size: 78%;
466
+ vertical-align: middle;
467
+ color: #ffffff;
468
+ padding: 0 10px;
469
+ background: #DDD;
470
+ height: 24px;
471
  .border-radius(4px);
472
  &.lp-label-viewing {
473
  background-color: rgb(57, 175, 255);
481
  &.lp-label-quiz {
482
  background-color: #53658c;
483
  }
484
+ &.lp-label-preview {
485
+ background-color: #02a7ce;
486
+ }
487
  }
488
 
489
  .learn-press-content-protected-message {
504
  }
505
  }
506
 
507
+ /** BREADCRUMB */
508
+ .learn-press-breadcrumb {
509
+ margin-bottom: 20px;
510
+ }
511
+
512
  /** COURSE PROGRESS **/
513
+ .single-lp_course {
514
+ .learn-press-course-results-progress {
515
+ margin-bottom: 40px;
516
+ .items-progress {
517
+ float: left;
518
+ width: 68%;
519
+ margin-right: 2%;
520
+ clear: left;
521
+ }
522
+ .lp-course-progress-heading {
523
+ margin-bottom: 10px;
524
+ }
525
+ .course-progress {
526
+ float: left;
527
+ width: 30%;
528
+ }
529
+ .number, .percentage-sign {
530
+ display: inline-block;
531
+ vertical-align: bottom;
532
+ line-height: 1;
533
+ font-size: 25px;
534
+ }
535
+ .percentage-sign {
536
+ margin-left: 5px;
537
+ }
538
+ &:after {
539
+ display: block;
540
+ content: '';
541
+ clear: both;
542
+ }
543
+ }
544
+ }
545
+
546
  .lp-course-progress {
547
  position: relative;
548
  .lp-progress-bar {
549
  height: 15px;
550
  background: #DDD;
551
+ margin: 10px 0 15px 0;
552
  overflow: hidden;
553
  .border-radius(3px);
554
  .lp-progress-value {
562
  position: absolute;
563
  height: 25px;
564
  top: -5px;
565
+ margin-left: -5px;
566
+ cursor: pointer;
567
  &:before,
568
  &:after {
569
  content: '';
584
 
585
  #learn-press-content-item {
586
  border: 1px solid #DDD;
587
+ display: none;
588
+
 
 
 
 
 
 
 
589
  }
590
 
591
  /** COURSE TABS **/
593
  .learn-press-nav-tabs {
594
  list-style: none;
595
  padding: 0 0 0 15px;
596
+ margin: 0 0 20px 0;
597
  border-bottom: 1px solid #DDD;
598
  .learn-press-nav-tab {
599
+ list-style-type: none;
600
  float: left;
601
  margin-bottom: -1px;
602
  position: relative;
603
  a {
604
  display: inline-block;
605
  padding: 10px 15px;
606
+ outline: none;
607
  }
608
  &.active {
609
  border: 1px solid #DDD;
610
+ border-top-right-radius: 5px;
611
+ border-top-left-radius: 5px;
612
  }
613
  &.active:after {
614
  position: absolute;
629
  }
630
  .learn-press-tab-panel {
631
  display: none;
632
+ margin-bottom: 20px;
633
  &.active {
634
  display: block;
635
  }
636
  }
637
  }
638
 
639
+ .learn-press-block-content-mixin(@w) {
640
+ &:before {
641
+ width: (@w);
642
+ height: (@w);
643
+ margin-left: -(@w/2);
644
+ margin-top: -(@w/2); /*-76px;*/
645
+ -webkit-clip-path: polygon(0px @w, @w @w, @w @w/2, @w/2 @w/2, @w/2 0, 0 0);
646
+ }
647
+
648
+ span {
649
+ clip: rect(0, @w+4, @w/2+2, @w/2+2);
650
+ width: @w+4;
651
+ height: @w+4;
652
+ margin-left: -(@w/2+2);
653
+ margin-top: -(@w/2+2);
654
+ &:before {
655
+ width: @w+4;
656
+ height: @w+4;
657
+ }
658
+ }
659
+ }
660
+
661
  /* POPUP */
662
 
663
+ #popup_overlay {
664
+ z-index: 10000000 !important;
665
+ }
666
+
667
+ #popup_container {
668
+ z-index: 10000001 !important;
669
+ }
670
+
671
  body.course-has-popup {
672
  overflow: hidden;
673
  }
680
  bottom: 0;
681
  background: #000;
682
  z-index: 999999;
683
+ * {
684
+ box-sizing: border-box;
685
+ }
686
  #popup-sidebar {
687
  float: left;
688
  width: 350px;
689
  position: absolute;
690
+ top: 60px;
691
  bottom: 0;
692
  overflow: auto;
693
  background: #FFF;
699
  margin: 0;
700
  font-size: smaller;
701
  }
702
+ .learn-press-course-results-progress {
703
+ padding: 15px 20px;
704
+ margin-bottom: 0;
705
+ .items-progress, .course-progress {
706
+ width: 100%;
707
+ margin: 0 !important;
708
+ }
709
+ }
710
  }
711
  #popup-main {
712
  position: absolute;
718
  #popup-header {
719
  position: absolute;
720
  top: 0;
721
+ left: -350px;
722
  right: 0;
723
+ height: 60px;
724
+ background: #cc540d;
725
+ border-bottom: 1px solid #ab4a10;
726
+ .popup-menu {
727
+ position: absolute;
728
+ height: 60px;
729
+ width: 350px;
730
+ border-right: 1px solid #ab4a10;
731
+ }
732
+ .popup-close,
733
+ .sidebar-hide-btn,
734
+ .sidebar-show-btn {
735
+ width: 59px;
736
+ height: 59px;
737
  position: absolute;
 
738
  top: 0;
739
+ cursor: pointer;
740
+ font-size: 34px;
741
+ line-height: 60px;
742
+ text-align: center;
743
+ color: #FFF;
744
+ &:hover {
745
+ background: #b34c10;
746
+ }
747
+ }
748
+ .sidebar-hide-btn {
749
+ left: 0;
750
+ }
751
+ .sidebar-show-btn {
752
+ position: relative;
753
+ margin-left: -20px;
754
+ margin-right: 20px;
755
+ }
756
+ .popup-close {
757
+ right: 0;
758
  &:before,
759
  &:after {
760
  content: '';
761
+ border-top: 3px solid #FFF;
762
  width: 30px;
763
  display: inline-block;
764
  position: absolute;
765
+ top: 29px;
766
+ left: 15px;
767
  }
768
  &:before {
769
  -webkit-transform: rotate(45deg);
 
770
  }
771
  &:after {
772
  -webkit-transform: rotate(-45deg);
773
+ }
774
+ &:hover {
775
+ background: #b34c10;
776
+ &:before, &:after {
777
+ border-color: #FFF;
778
+ }
779
  }
780
  }
781
+ .popup-title {
782
+ margin: 0 0 0 350px;
783
+ height: 60px;
784
+ line-height: 60px;
785
  padding: 0 20px;
786
+ color: #FFF;
787
+ position: relative;
788
  }
789
 
790
  }
791
  #popup-content {
792
  position: absolute;
793
+ top: 60px;
794
  bottom: 50px;
795
  left: 0;
796
  right: 0;
797
  overflow: auto;
798
  #popup-content-inner {
799
+ margin: 20px 40px;
 
 
 
 
800
  }
801
  }
802
  #popup-footer {
822
  }
823
  }
824
  }
825
+ iframe {
826
+ position: absolute;
827
+ top: 0;
828
+ left: 0;
829
+ height: 100%;
830
+ width: 100%;
831
+ border: none;
832
+ margin: 0;
833
+ background: #FFF;
834
+ }
835
+ }
836
+
837
+ .learn-press-content-item-title {
838
+ margin-bottom: 20px;
839
+ border-bottom: 2px solid #DDD;
840
+ padding-bottom: 20px;
841
+ &.content-item-quiz-title {
842
+ h4 {
843
+ float: left;
844
+ font-size: 24px;
845
+ margin-bottom: 0;
846
+ }
847
+ .quiz-countdown {
848
+ float: right;
849
+ position: relative;
850
+ min-width: 100px;
851
+ background: #F5F5F5;
852
+ text-align: center;
853
+ font-size: 18px;
854
+ &:after, &:before {
855
+ padding: 0 10px;
856
+ height: 3px;
857
+ position: absolute;
858
+ bottom: -3px;
859
+ background: #000;
860
+ content: '';
861
+ left: 0;
862
+ }
863
+ &:before {
864
+ width: 100%;
865
+ }
866
+ &:after {
867
+ background: #00adff;
868
+ padding: 0;
869
+ }
870
+ &.warning-time-over {
871
+ &:after {
872
+ background: #FF0000;
873
+ }
874
+ }
875
+ .countdown {
876
+
877
+ }
878
+ }
879
+ .clearfix();
880
+ }
881
+ }
882
+
883
+ .learn-press-content-item-summary {
884
+ /*padding: 20px;
885
+ border-top: 1px solid #DDD;*/
886
+ margin-bottom: 30px;
887
+ .quiz-question-title {
888
+ margin-bottom: 20px;
889
+ }
890
+ .learn-press-question-explanation, .learn-press-question-hint {
891
+ background: #F5F5F5;
892
+ padding: 15px 20px;
893
+ font-style: italic;
894
+ margin-bottom: 20px;
895
+ .hint-title, .explanation-title {
896
+ font-style: normal;
897
+ }
898
+ }
899
+ }
900
+
901
+ .button-finish-quiz {
902
+ float: right;
903
+ }
904
+
905
+ .learnpress form.purchase-course {
906
+ margin-bottom: 20px;
907
+ }
908
+
909
+ #learn-press-block-content {
910
+ display: none;
911
+ width: 100%;
912
+ height: 100%;
913
+ background: fade(#FFF, 25%);
914
+ position: fixed;
915
+ z-index: 99999999;
916
+ top: 0;
917
+ left: 0;
918
+ &:before, &:after, span {
919
+ position: absolute;
920
+ .border-radius(50%);
921
+ left: 50%;
922
+ top: 50%;
923
+ box-sizing: border-box;
924
+ }
925
+ &:before {
926
+ content: '';
927
+ border: 2px solid #000;
928
+ z-index: 10;
929
+ .animation(spin-13 1.5s infinite);
930
+ }
931
+ &:after {
932
+ z-index: 0;
933
+ content: '';
934
+ border: 10px solid #000000;
935
+ margin-left: -80px;
936
+ margin-top: -80px;
937
+ width: 160px;
938
+ height: 160px;
939
+ opacity: 0;
940
+ }
941
+ span {
942
+ z-index: 20;
943
+ .animation(spin-12 1.5s infinite);
944
+ &:before {
945
+ content: '';
946
+ border: 6px solid #95e6f9;
947
+ position: absolute;
948
+ .border-radius(50%);
949
+ box-sizing: border-box;
950
+ }
951
+ }
952
+
953
+ .learn-press-block-content-mixin(80px);
954
+ }
955
+
956
+ body.block-content {
957
+ #learn-press-block-content {
958
+ display: block;
959
+ }
960
  }
961
 
962
  /* COURSE QUIZ */
963
+ //.single-quiz {
964
+ .quiz-buttons {
965
+ margin-bottom: 20px;
966
+ clear: both;
967
+ }
968
+
969
+ .quiz-intro {
970
+ list-style: none;
971
+ padding: 0;
972
+ }
973
+
974
+ .quiz-questions-list {
975
+ margin: 0 0 20px 0;
976
+ padding: 0;
977
+ list-style-position: inside;
978
+ li {
979
+ margin: 0 0 10px 0;
980
  }
981
+ .question-title {
982
+ margin: 0 0 5px 0;
983
+ }
984
+ .current {
985
+ .question-title {
986
+ font-weight: bold;
987
+ }
988
+ }
989
+ }
990
+
991
+ .quiz-description,
992
+ .question-content {
993
+ .learn-press-question-title {
994
+ margin-bottom: 20px;
995
  }
996
  }
997
+
998
+ .quiz-countdown {
999
+ float: right;
1000
+ position: relative;
1001
+ min-width: 150px;
1002
+ background: #F5F5F5;
1003
+ text-align: center;
1004
+ font-size: 18px;
1005
+ padding: 5px 0;
1006
+ }
1007
+
1008
+ #quiz-countdown {
1009
+ //.progress-circle(@initialize: 100%, @size: 260px, @inside-size: 200px);
1010
+ .progress-circle {
1011
+ overflow: hidden;
1012
+ box-shadow: 0 0 3px #bdbdbd inset;
1013
+ .inside {
1014
+ line-height: 1;
1015
+ .countdown {
1016
+ font-size: 48px;
1017
+ color: #087998;
1018
+ _text-shadow: 1px 1px #8ee5fd;
1019
+ margin-top: 110px;
1020
+ }
1021
+ p {
1022
+ margin: 10px 0 0 0;
1023
+ color: #DDD;
1024
+ }
1025
+ }
1026
+ &:after {
1027
+ background: #00b9eb;
1028
+ box-shadow: 0 0 6px #097a98;
1029
+ }
1030
+ }
1031
+ }
1032
+
1033
+ #quiz-progress {
1034
+ .progress-circle(@size: 200px, @background: #DDD, @fill: #FF0000, @initialize: 0%, @inside-size: 170px, @inside-background: #FFF);
1035
+ }
1036
+
1037
+ .quiz-result {
1038
+ .quiz-result-mark {
1039
+ .progress-circle();
1040
+ margin-bottom: 20px;
1041
+ }
1042
+ .quiz-result-summary {
1043
+ margin-bottom: 20px;
1044
+ max-width: 500px;
1045
+ .quiz-result-field {
1046
+ position: relative;
1047
+ background: #F5F5F5;
1048
+ color: #fff;
1049
+ margin: 0 0 8px 0;
1050
+ font-size: 12px;
1051
+ padding: 5px 10px;
1052
+ .border-radius(4px);
1053
+ overflow: hidden;
1054
+
1055
+ span, span:after, &:before {
1056
+ display: block;
1057
+ position: absolute;
1058
+ top: 0;
1059
+ left: 0;
1060
+ height: 100%;
1061
+ content: attr(data-text);
1062
+ color: #FFF;
1063
+ white-space: nowrap;
1064
+ overflow: hidden;
1065
+ padding: 3px 10px;
1066
+ background: transparent;
1067
+ transition: width 0.5s;
1068
+ }
1069
+ &:before {
1070
+ content: '';
1071
+ padding: 0;
1072
+ }
1073
+ span {
1074
+ padding: 0;
1075
+ }
1076
+ span:after {
1077
+ margin: 3px 10px;
1078
+ padding: 0;
1079
+ width: 100%;
1080
+ }
1081
+ &.correct {
1082
+ background: #22b4ff;
1083
+ }
1084
+ &.wrong {
1085
+ background: #ff5425;
1086
+ }
1087
+ &.empty {
1088
+ color: #656D6D;
1089
+ }
1090
+ }
1091
+ }
1092
+ p.quiz-result-time {
1093
+ margin: 0 0 10px 0;
1094
+ }
1095
+ .quiz-grade {
1096
+ p {
1097
+ margin: 0 0 10px 0;
1098
+ span {
1099
+ font-weight: bold;
1100
+ &.passed {
1101
+ color: #22b4ff;
1102
+ }
1103
+ &.failed {
1104
+ color: #ff5425;
1105
+ }
1106
+ }
1107
+ }
1108
+ }
1109
+ }
1110
+
1111
+ .element-data-percent-loop (@i) when (@i <= 100) {
1112
+ .single-quiz .quiz-result-field[data-value="@{i}"]:before,
1113
+ .single-quiz .quiz-result-field[data-value="@{i}"] span,
1114
+ #quiz-countdown[data-value="@{i}"]:after {
1115
+ width: ~"@{i}%";
1116
+ }
1117
+ .element-data-percent-loop(@i + 1);
1118
+ }
1119
+
1120
+ .element-data-percent-loop (0);
1121
+
1122
+ /* QUESTION */
1123
+ .learn-press-question-options {
1124
+ list-style: none;
1125
+ margin: 0 0 20px 0;
1126
+ padding: 0;
1127
+ > li.answer-option {
1128
+ font-size: 16px;
1129
+ background: #F5F5F5;
1130
+ margin-bottom: 20px;
1131
+ position: relative;
1132
+ .border-radius(4px);
1133
+ > label {
1134
+ display: block;
1135
+ input[type="checkbox"], input[type="radio"] {
1136
+ border: 0;
1137
+ -webkit-appearance: initial;
1138
+ width: 30px;
1139
+ height: 30px;
1140
+ background: #fff;
1141
+ border-radius: 4px;
1142
+ outline: none;
1143
+ position: absolute;
1144
+ top: 10px;
1145
+ left: 15px;
1146
+ margin: 0;
1147
+ &:checked:before {
1148
+ content: '';
1149
+ border: 4px solid #00b9eb;
1150
+ display: inline-block;
1151
+ width: 10px;
1152
+ height: 15px;
1153
+ border-top: none;
1154
+ border-left: none;
1155
+ position: absolute;
1156
+ top: 3px;
1157
+ left: 8px;
1158
+ box-sizing: content-box;
1159
+ .transform(rotate(36deg));
1160
+ }
1161
+ &:checked + p {
1162
+ font-weight: bold;
1163
+ background: #00b9eb;
1164
+ color: #FFF;
1165
+ }
1166
+ }
1167
+ input[type="checkbox"][disabled], input[type="radio"][disabled] {
1168
+ opacity: 1;
1169
+ }
1170
+ input[type="radio"] {
1171
+ .border-radius(50%);
1172
+ }
1173
+ p {
1174
+ min-height: 50px;
1175
+ padding: 5px 20px 5px 60px;
1176
+ margin: 0;
1177
+ box-sizing: border-box;
1178
+ line-height: 1.5;
1179
+ &.single-lines {
1180
+ padding: 0 20px 0 60px;
1181
+ line-height: 50px; /* middle */
1182
+ }
1183
+ }
1184
+ }
1185
+ label p {
1186
+ .border-radius(4px);
1187
+ }
1188
+ &.answer-true label p {
1189
+ background: #00b9eb;
1190
+ color: #FFF;
1191
+ }
1192
+ &:hover label p {
1193
+ background: #D4D4D4;
1194
+ cursor: pointer;
1195
+ }
1196
+ &.user-answer-false {
1197
+ background: #F5F5F5;
1198
+ > label {
1199
+ input[type="checkbox"] + p, input[type="radio"] + p {
1200
+ text-decoration: line-through;
1201
+ color: #FF0000;
1202
+ background: #F5F5F5;
1203
+ }
1204
+ }
1205
+ }
1206
+ }
1207
+ .answer-option-result {
1208
+ label {
1209
+ p {
1210
+ display: inline-block;
1211
+ margin: 0;
1212
+ font-size: smaller;
1213
+ }
1214
+ input[disabled] {
1215
+ opacity: 1;
1216
+ }
1217
+ }
1218
+ }
1219
+ }
1220
+
1221
+ .learnpress-content {
1222
+ margin-bottom: 20px;
1223
+ }
1224
+
1225
+ .course-meta {
1226
+ margin-bottom: 20px;
1227
+ .course-origin-price {
1228
+ padding-right: 5px;
1229
+ text-decoration: line-through;
1230
+ }
1231
+ .course-price {
1232
+ font-weight: bold;
1233
+ }
1234
+
1235
+ }
1236
+
1237
+ /** MESSAGE */
1238
+ .learn-press-message {
1239
+ background: #F5F5F5;
1240
+ border-left: 5px solid #00A0D2;
1241
+ padding: 10px 20px 1px 20px;
1242
+ margin-bottom: 20px;
1243
+ button {
1244
+ float: right;
1245
+ }
1246
+ p {
1247
+ margin-bottom: 10px;
1248
+ }
1249
+ &:after {
1250
+ clear: both;
1251
+ content: '';
1252
+ display: block;
1253
+ }
1254
+ &.notice {
1255
+ border-left-color: #b3d20a;
1256
+ }
1257
+ &.error {
1258
+ border-left-color: #b81c23;
1259
+ }
1260
+ ul {
1261
+ list-style-type: none;
1262
+ }
1263
+ }
1264
+
1265
+ /**/
1266
+ .learn-press-checkout-comment,
1267
+ .learn-press-checkout-payment {
1268
+ margin-bottom: 20px;
1269
+ }
1270
+
1271
+ .learn-press-checkout-payment {
1272
+ .payment-methods {
1273
+ list-style: none;
1274
+ margin: 0;
1275
+ }
1276
+ }
1277
+
1278
+ /* COURSE QUIZ */
1279
+ .single-quiz {
1280
+ .quiz-questions-list {
1281
+ padding: 0;
1282
+ }
1283
+ .quiz-intro {
1284
+ list-style: none;
1285
+ padding: 10px 20px;
1286
+ background: #F5F5F5;
1287
+ margin: 0 0 20px 0;
1288
+ }
1289
+ h4 {
1290
+ margin-bottom: 10px;
1291
+ font-size: 18px;
1292
+ }
1293
+ }
1294
+
1295
+ .learn-press-tooltip {
1296
+ font-size: 20px;
1297
+ display: inline-block;
1298
+ vertical-align: middle;
1299
+ background: #0f4956;
1300
+ cursor: pointer;
1301
+ line-height: 1;
1302
+ width: 10px;
1303
+ height: 10px;
1304
+ border-radius: 50%;
1305
+ font-weight: 700;
1306
+ position: relative;
1307
+ &:before {
1308
+ content: "?";
1309
+ font-size: 7px;
1310
+ color: white;
1311
+ position: absolute;
1312
+ top: 2px;
1313
+ left: 3px;
1314
+ }
1315
+ }
1316
+
1317
+ .learn-press-user-profile {
1318
+ .learn-press-tabs {
1319
+ list-style: none;
1320
+ margin: 30px 0 20px;
1321
+ padding-left: 5px;
1322
+ border-bottom: 1px solid #DDD;
1323
+ & > li {
1324
+ float: left;
1325
+ list-style-type: none;
1326
+ & > a {
1327
+ box-shadow: none;
1328
+ outline: none;
1329
+ display: block;
1330
+ border: none;
1331
+ padding: 5px 10px;
1332
+ }
1333
+ &.current a {
1334
+ background-color: #FFF;
1335
+ border: 1px solid #DDD;
1336
+ border-bottom-color: transparent;
1337
+ z-index: 10;
1338
+ margin-bottom: -1px;
1339
+ }
1340
+ }
1341
+ }
1342
+ .learn-press-tabs-wrapper-x {
1343
+ .learn-press-subtabs {
1344
+ & > li {
1345
+ display: inline-block;
1346
+ margin-right: 10px;
1347
+ &.current {
1348
+ font-weight: bold;
1349
+ }
1350
+ }
1351
+ }
1352
+ .learn-press-subtab-content {
1353
+ display: none;
1354
+ &.current {
1355
+ display: block;
1356
+ }
1357
+ li.course {
1358
+ h3 {
1359
+ padding-bottom: 10px;
1360
+ }
1361
+ }
1362
+ .profile-courses {
1363
+ list-style-type: none;
1364
+ .learn-press-course-results-progress {
1365
+ padding: 0 15px 15px 15px;
1366
+ margin: 0;
1367
+ }
1368
+ }
1369
+ }
1370
+ }
1371
+ }
1372
+
1373
+ .learn-press-pagination {
1374
+ text-align: center;
1375
+ ul {
1376
+ list-style: disc;
1377
+ & > li {
1378
+ display: inline-block;
1379
+ span {
1380
+ display: inline-block;
1381
+ padding: 0 10px;
1382
+ border: 1px solid #DDD;
1383
+ background-color: #F5F5F5;
1384
+ }
1385
+ a {
1386
+ display: inline-block;
1387
+ padding: 0 10px;
1388
+ border: 1px solid #DDD;
1389
+ background-color: #FFF;
1390
+ }
1391
+ }
1392
+ }
1393
+ }
1394
+
1395
+ .learn-press-become-teacher-form {
1396
+ ul {
1397
+ list-style: none;
1398
+ padding: 0;
1399
+ li {
1400
+ margin-bottom: 20px;
1401
+ }
1402
+ }
1403
+ }
1404
+
1405
+ /* jAlerts */
1406
+ #popup_container {
1407
+ background: #FFF;
1408
+
1409
+ #popup_title {
1410
+ padding: 10px 20px;
1411
+ background: #18B6C7;
1412
+ color: #FFF;
1413
+ font-size: 18px;
1414
+ margin: 0;
1415
+ }
1416
+
1417
+ #popup_content {
1418
+ padding: 20px;
1419
+ #popup_message {
1420
+ margin-bottom: 20px;
1421
+ }
1422
+ }
1423
+
1424
+ #popup_panel {
1425
+ text-align: center;
1426
+ }
1427
+ }
1428
+
1429
+ .single-lp_course {
1430
+ .course-students {
1431
+ padding-top: 10px;
1432
+ }
1433
+ .course-students-list {
1434
+ margin-top: 10px;
1435
+ .students {
1436
+ list-style-type: none;
1437
+ margin: 0;
1438
+ li {
1439
+ display: inline-block;
1440
+ margin-right: 10px;
1441
+ }
1442
+ p {
1443
+ margin-top: 15px;
1444
+ }
1445
+ }
1446
+ }
1447
+ .lp_course {
1448
+ .entry-content {
1449
+ //width: 100%;
1450
+ }
1451
+ .entry-footer {
1452
+ display: none;
1453
+ }
1454
+ }
1455
+ }
1456
+
1457
+ /* tooltip */
1458
+ .learn-press-tooltip-bubble {
1459
+ position: absolute;
1460
+ background: rgba(26, 26, 26, 0.9);
1461
+ color: #ffffff;
1462
+ padding: 8px 10px;
1463
+ font-size: 12px;
1464
+ z-index: 9999999;
1465
+ line-height: 1;
1466
+ border-radius: 3px;
1467
+ }
1468
+
1469
+ /* fill in blank */
1470
+ input.blank-fill-correct {
1471
+ width: auto;
1472
+ }
1473
+
1474
+ body.content-item-only {
1475
+ background: #FFF;
1476
+ opacity: 0;
1477
+ .learn-press-content-item-only {
1478
+ position: fixed;
1479
+ z-index: 9999999;
1480
+ left: 0;
1481
+ top: 0;
1482
+ width: 100%;
1483
+ height: 100%;
1484
+ background: #FFF;
1485
+ overflow: auto;
1486
+ padding: 20px;
1487
+ margin: 0;
1488
+ }
1489
+
1490
+ #learn-press-content-item {
1491
+ border: none;
1492
+ display: block;
1493
+ }
1494
+ }
1495
+
1496
+ .lp-group-heading-title {
1497
+ &.toggle-off, &.toggle-on {
1498
+ cursor: pointer;
1499
+ .toggle-icon {
1500
+ display: inline-block;
1501
+ font-size: larger;
1502
+ line-height: 1;
1503
+ font-weight: bold;
1504
+ margin-left: 5px;
1505
+ &:before {
1506
+ content: '+';
1507
+ }
1508
+ }
1509
+ }
1510
+ &.toggle-on {
1511
+ .toggle-icon {
1512
+ &:before {
1513
+ content: '-';
1514
+ }
1515
+ }
1516
+ }
1517
+ }
1518
+
1519
+ /*
1520
+ .sidebar-hide-btn, .sidebar-show-btn {
1521
+ cursor: pointer;
1522
+ width: 60px;
1523
+ height: 60px;
1524
+ display: inline-block;
1525
+ font-size: 34px;
1526
+ line-height: 60px;
1527
+ text-align: center;
1528
+ color: #FFF;
1529
+ position: absolute;
1530
+
1531
+
1532
+ }*/
1533
+
1534
+ .user-profile-edit-form {
1535
+ .info-field {
1536
+ margin-bottom: 20px;
1537
+ }
1538
+
1539
+ .description {
1540
+ margin-top: 5px;
1541
+ }
1542
+
1543
+ .user-profile-picture {
1544
+ clear: both;
1545
+ .picture, .change-picture {
1546
+ display: inline-block;
1547
+ }
1548
+ .change-picture {
1549
+ .description {
1550
+ margin: 0 0 10px 0;
1551
+ }
1552
+ }
1553
+ img {
1554
+ float: left;
1555
+ margin-right: 20px;
1556
+ }
1557
+ &:after {
1558
+ .clearfix();
1559
+ }
1560
+ }
1561
+
1562
+ .profile-field-name {
1563
+ font-weight: bold;
1564
+ margin-bottom: 10px;
1565
+ }
1566
+
1567
+ .change-password {
1568
+ margin-bottom: 10px;
1569
+ }
1570
+
1571
+ #user_profile_password_form {
1572
+ input {
1573
+ margin-bottom: 20px;
1574
+ }
1575
+ .description {
1576
+ margin-top: -15px;
1577
+ }
1578
+ }
1579
+
1580
+ .update-profile {
1581
+ margin-top: 20px;
1582
+ }
1583
+ }
1584
+
1585
+ .payment-method-form {
1586
+ &.payment_method_authorizenet {
1587
+ background: #f7f7f7;
1588
+ border-radius: 5px;
1589
+ -webkit-border-radius: 5px;
1590
+ -moz-border-radius: 5px;
1591
+ padding-top: 25px;
1592
+ .row-fluid {
1593
+ clear: both;
1594
+ padding-bottom: 25px;
1595
+ .span6 {
1596
+ &:first-child {
1597
+ width: 50%;
1598
+ float: left;
1599
+ label {
1600
+ margin-left: 17px;
1601
+ }
1602
+ select, input {
1603
+ margin-left: 10px;
1604
+ }
1605
+ }
1606
+ select, input {
1607
+ padding: 8px 0;
1608
+ }
1609
+ select.required {
1610
+ color: #000;
1611
+ }
1612
+ }
1613
+ }
1614
+ }
1615
+ }
1616
+
1617
+ .place-order-action {
1618
+ margin-top: 20px;
1619
+ }
1620
+
1621
+ .learn-press-search-course-form {
1622
+ margin-bottom: 20px;
1623
+ input.search-course-input[name="s"] {
1624
+ margin-right: -200px;
1625
+ width: 100%;
1626
+ }
1627
+ .search-course-button{
1628
+ vertical-align: middle;
1629
+ float: right;
1630
+ z-index: 10;
1631
+ position: relative;
1632
+ }
1633
+ }
1634
+
1635
+ @-moz-keyframes spin-12 {
1636
+ 0% {
1637
+ -moz-transform: rotate(0deg) translate(0px);
1638
+ }
1639
+ 100% {
1640
+ -moz-transform: rotate(360deg) translate(0px);
1641
+ }
1642
+ }
1643
+
1644
+ @-webkit-keyframes spin-12 {
1645
+ 0% {
1646
+ -webkit-transform: rotate(0deg) translate(0px);
1647
+ }
1648
+ 100% {
1649
+ -webkit-transform: rotate(360deg) translate(0px);
1650
+ }
1651
+ }
1652
+
1653
+ @keyframes spin-12 {
1654
+ 0% {
1655
+ -webkit-transform: rotate(0deg) translate(0px);
1656
+ transform: rotate(0deg) translate(0px);
1657
+ }
1658
+ 100% {
1659
+ -webkit-transform: rotate(360deg) translate(0px);
1660
+ transform: rotate(360deg) translate(0px);
1661
+ }
1662
+ }
1663
+
1664
+ @-moz-keyframes spin-13 {
1665
+ 100% {
1666
+ -moz-transform: rotate(0deg) translate(0px);
1667
+ }
1668
+ 0% {
1669
+ -moz-transform: rotate(360deg) translate(0px);
1670
+ }
1671
+ }
1672
+
1673
+ @-webkit-keyframes spin-13 {
1674
+ 0% {
1675
+ -webkit-transform: rotate(0deg) translate(0px);
1676
+ }
1677
+ 100% {
1678
+ -webkit-transform: rotate(360deg) translate(0px);
1679
+ }
1680
+ }
1681
+
1682
+ @keyframes spin-13 {
1683
+ 100% {
1684
+ -webkit-transform: rotate(0deg) translate(0px);
1685
+ transform: rotate(0deg) translate(0px);
1686
+ }
1687
+ 0% {
1688
+ -webkit-transform: rotate(360deg) translate(0px);
1689
+ transform: rotate(360deg) translate(0px);
1690
+ }
1691
+ }
1692
+
1693
+ @media screen and (max-width: 1250px) {
1694
+ .single-lp_course .learn-press-course-results-progress {
1695
+ .items-progress, .course-progress {
1696
+ float: none;
1697
+ width: 100%;
1698
+ }
1699
+ .items-progress {
1700
+ margin-bottom: 50px;
1701
+ }
1702
+ }
1703
+ }
1704
+
1705
+ @media screen and (max-width: 768px) {
1706
+ #learn-press-block-content {
1707
+ .learn-press-block-content-mixin(60px);
1708
+ }
1709
+
1710
+ .learn-press-course-results-progress {
1711
+ .items-progress, .course-progress {
1712
+ width: 100%;
1713
+ margin-right: 0;
1714
+ }
1715
+ }
1716
+
1717
+ }
1718
+
1719
+ @media (min-width: 992px) {
1720
+ .learn-press-courses {
1721
+ li.course {
1722
+ &:nth-child(4n+1) {
1723
+ clear: left;
1724
+ }
1725
+ }
1726
+ }
1727
+ }
1728
+
1729
+ @media (max-width: 992px) {
1730
+ .learn-press-courses {
1731
+ margin: 0;
1732
+ }
1733
+ }
1734
+
1735
+ @media (max-width: 992px) and (min-width: 600px ) {
1736
+
1737
+ .learn-press-courses {
1738
+ li.course {
1739
+ width: 31.33%;
1740
+ margin: 0 2% 30px 0;
1741
+ /* padding: 0 20px; */
1742
+ &:nth-child(3n+1) {
1743
+ clear: left;
1744
+ margin-left: 0;
1745
+ }
1746
+ }
1747
+ }
1748
+
1749
+ }
1750
+
1751
+ @media (max-width: 600px) and (min-width: 400px ) {
1752
+
1753
+ .learn-press-courses {
1754
+ li.course {
1755
+ width: 48%;
1756
+ margin: 0 2% 30px 0;
1757
+ /* padding: 0 20px; */
1758
+ &:nth-child(2n+1) {
1759
+ clear: left;
1760
+ margin-left: 0;
1761
+ }
1762
+ }
1763
+ }
1764
+
1765
+ }
1766
+
1767
+ @media (max-width: 400px) {
1768
+
1769
+ .learn-press-courses {
1770
+ li.course {
1771
+ width: 100%;
1772
+ margin: 0 0 30px 0;
1773
+ clear: left;
1774
+ }
1775
+ }
1776
+
1777
+ }
1778
+
1779
+ /* full width with twentysixteen theme */
1780
+ @media screen and (min-width: 61.5625em) {
1781
+ body.single-lp_course {
1782
+ article.lp_course {
1783
+ .entry-content {
1784
+ width: 100%;
1785
+ }
1786
+ .entry-footer {
1787
+ display: none;
1788
+ }
1789
+ }
1790
+ }
1791
+ }
1792
+
1793
+ @media screen and (max-width: 615px) {
1794
+ .payment-method-form {
1795
+ &.payment_method_authorizenet {
1796
+ .row-fluid {
1797
+ padding-bottom: 15px;
1798
+ .span6 {
1799
+ &:first-child {
1800
+ width: 100%;
1801
+ margin-bottom: 15px;
1802
+ }
1803
+ label {
1804
+ margin-left: 17px;
1805
+ }
1806
+ select, input {
1807
+ margin-left: 10px;
1808
+ }
1809
+ select, input {
1810
+ padding: 8px 0;
1811
+ }
1812
+ select.required {
1813
+ color: #000;
1814
+ }
1815
+ #learn-press-authorizenet-payment-expmonth {
1816
+ margin-bottom: 10px;
1817
+ }
1818
+ }
1819
+ }
1820
+ }
1821
+ }
1822
+ }
assets/css/{owlcarousel/owl.carousel.css → owl.carousel.css} RENAMED
File without changes
assets/css/select2/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php // Silence is golden.
assets/css/timer.css DELETED
File without changes
assets/css/tipsy.css DELETED
@@ -1,25 +0,0 @@
1
- .tipsy { font-size: 10px; position: absolute; padding: 5px; z-index: 100000; }
2
- .tipsy-inner { background-color: #000; color: #FFF; max-width: 200px; padding: 5px 8px 4px 8px; text-align: center; }
3
-
4
- /* Rounded corners */
5
- .tipsy-inner { border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px; }
6
-
7
- /* Uncomment for shadow */
8
- /*.tipsy-inner { box-shadow: 0 0 5px #000000; -webkit-box-shadow: 0 0 5px #000000; -moz-box-shadow: 0 0 5px #000000; }*/
9
-
10
- .tipsy-arrow { position: absolute; width: 0; height: 0; line-height: 0; border: 5px dashed #000; }
11
-
12
- /* Rules to colour arrows */
13
- .tipsy-arrow-n { border-bottom-color: #000; }
14
- .tipsy-arrow-s { border-top-color: #000; }
15
- .tipsy-arrow-e { border-left-color: #000; }
16
- .tipsy-arrow-w { border-right-color: #000; }
17
-
18
- .tipsy-n .tipsy-arrow { top: 0px; left: 50%; margin-left: -5px; border-bottom-style: solid; border-top: none; border-left-color: transparent; border-right-color: transparent; }
19
- .tipsy-nw .tipsy-arrow { top: 0; left: 10px; border-bottom-style: solid; border-top: none; border-left-color: transparent; border-right-color: transparent;}
20
- .tipsy-ne .tipsy-arrow { top: 0; right: 10px; border-bottom-style: solid; border-top: none; border-left-color: transparent; border-right-color: transparent;}
21
- .tipsy-s .tipsy-arrow { bottom: 0; left: 50%; margin-left: -5px; border-top-style: solid; border-bottom: none; border-left-color: transparent; border-right-color: transparent; }
22
- .tipsy-sw .tipsy-arrow { bottom: 0; left: 10px; border-top-style: solid; border-bottom: none; border-left-color: transparent; border-right-color: transparent; }
23
- .tipsy-se .tipsy-arrow { bottom: 0; right: 10px; border-top-style: solid; border-bottom: none; border-left-color: transparent; border-right-color: transparent; }
24
- .tipsy-e .tipsy-arrow { right: 0; top: 50%; margin-top: -5px; border-left-style: solid; border-right: none; border-top-color: transparent; border-bottom-color: transparent; }
25
- .tipsy-w .tipsy-arrow { left: 0; top: 50%; margin-top: -5px; border-right-style: solid; border-left: none; border-top-color: transparent; border-bottom-color: transparent; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/css/toastr.css DELETED
@@ -1,197 +0,0 @@
1
- .toast-title {
2
- font-weight: bold;
3
- }
4
- .toast-message {
5
- -ms-word-wrap: break-word;
6
- word-wrap: break-word;
7
- }
8
- .toast-message a,
9
- .toast-message label {
10
- color: #ffffff;
11
- }
12
- .toast-message a:hover {
13
- color: #cccccc;
14
- text-decoration: none;
15
- }
16
- .toast-close-button {
17
- position: relative;
18
- right: -0.3em;
19
- top: -0.3em;
20
- float: right;
21
- font-size: 20px;
22
- font-weight: bold;
23
- color: #ffffff;
24
- -webkit-text-shadow: 0 1px 0 #ffffff;
25
- text-shadow: 0 1px 0 #ffffff;
26
- opacity: 0.8;
27
- -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=80);
28
- filter: alpha(opacity=80);
29
- }
30
- .toast-close-button:hover,
31
- .toast-close-button:focus {
32
- color: #000000;
33
- text-decoration: none;
34
- cursor: pointer;
35
- opacity: 0.4;
36
- -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=40);
37
- filter: alpha(opacity=40);
38
- }
39
- /*Additional properties for button version
40
- iOS requires the button element instead of an anchor tag.
41
- If you want the anchor version, it requires `href="#"`.*/
42
- button.toast-close-button {
43
- padding: 0;
44
- cursor: pointer;
45
- background: transparent;
46
- border: 0;
47
- -webkit-appearance: none;
48
- }
49
- .toast-top-center {
50
- top: 0;
51
- right: 0;
52
- width: 100%;
53
- }
54
- .toast-bottom-center {
55
- bottom: 0;
56
- right: 0;
57
- width: 100%;
58
- }
59
- .toast-top-full-width {
60
- top: 0;
61
- right: 0;
62
- width: 100%;
63
- }
64
- .toast-bottom-full-width {
65
- bottom: 0;
66
- right: 0;
67
- width: 100%;
68
- }
69
- .toast-top-left {
70
- top: 12px;
71
- left: 12px;
72
- }
73
- .toast-top-right {
74
- top: 12px;
75
- right: 12px;
76
- }
77
- .toast-bottom-right {
78
- right: 12px;
79
- bottom: 12px;
80
- }
81
- .toast-bottom-left {
82
- bottom: 12px;
83
- left: 12px;
84
- }
85
- #toast-container {
86
- position: fixed;
87
- z-index: 999999;
88
- /*overrides*/
89
-
90
- }
91
- #toast-container * {
92
- -moz-box-sizing: border-box;
93
- -webkit-box-sizing: border-box;
94
- box-sizing: border-box;
95
- }
96
- #toast-container > div {
97
- position: relative;
98
- overflow: hidden;
99
- margin: 0 0 6px;
100
- padding: 15px 15px 15px 50px;
101
- width: 300px;
102
- -moz-border-radius: 3px 3px 3px 3px;
103
- -webkit-border-radius: 3px 3px 3px 3px;
104
- border-radius: 3px 3px 3px 3px;
105
- background-position: 15px center;
106
- background-repeat: no-repeat;
107
- -moz-box-shadow: 0 0 12px #999999;
108
- -webkit-box-shadow: 0 0 12px #999999;
109
- box-shadow: 0 0 12px #999999;
110
- color: #ffffff;
111
- opacity: 0.8;
112
- -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=80);
113
- filter: alpha(opacity=80);
114
- }
115
- #toast-container > :hover {
116
- -moz-box-shadow: 0 0 12px #000000;
117
- -webkit-box-shadow: 0 0 12px #000000;
118
- box-shadow: 0 0 12px #000000;
119
- opacity: 1;
120
- -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100);
121
- filter: alpha(opacity=100);
122
- cursor: pointer;
123
- }
124
- #toast-container > .toast-info {
125
- background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGwSURBVEhLtZa9SgNBEMc9sUxxRcoUKSzSWIhXpFMhhYWFhaBg4yPYiWCXZxBLERsLRS3EQkEfwCKdjWJAwSKCgoKCcudv4O5YLrt7EzgXhiU3/4+b2ckmwVjJSpKkQ6wAi4gwhT+z3wRBcEz0yjSseUTrcRyfsHsXmD0AmbHOC9Ii8VImnuXBPglHpQ5wwSVM7sNnTG7Za4JwDdCjxyAiH3nyA2mtaTJufiDZ5dCaqlItILh1NHatfN5skvjx9Z38m69CgzuXmZgVrPIGE763Jx9qKsRozWYw6xOHdER+nn2KkO+Bb+UV5CBN6WC6QtBgbRVozrahAbmm6HtUsgtPC19tFdxXZYBOfkbmFJ1VaHA1VAHjd0pp70oTZzvR+EVrx2Ygfdsq6eu55BHYR8hlcki+n+kERUFG8BrA0BwjeAv2M8WLQBtcy+SD6fNsmnB3AlBLrgTtVW1c2QN4bVWLATaIS60J2Du5y1TiJgjSBvFVZgTmwCU+dAZFoPxGEEs8nyHC9Bwe2GvEJv2WXZb0vjdyFT4Cxk3e/kIqlOGoVLwwPevpYHT+00T+hWwXDf4AJAOUqWcDhbwAAAAASUVORK5CYII=") !important;
126
- }
127
- #toast-container > .toast-error {
128
- background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHOSURBVEhLrZa/SgNBEMZzh0WKCClSCKaIYOED+AAKeQQLG8HWztLCImBrYadgIdY+gIKNYkBFSwu7CAoqCgkkoGBI/E28PdbLZmeDLgzZzcx83/zZ2SSXC1j9fr+I1Hq93g2yxH4iwM1vkoBWAdxCmpzTxfkN2RcyZNaHFIkSo10+8kgxkXIURV5HGxTmFuc75B2RfQkpxHG8aAgaAFa0tAHqYFfQ7Iwe2yhODk8+J4C7yAoRTWI3w/4klGRgR4lO7Rpn9+gvMyWp+uxFh8+H+ARlgN1nJuJuQAYvNkEnwGFck18Er4q3egEc/oO+mhLdKgRyhdNFiacC0rlOCbhNVz4H9FnAYgDBvU3QIioZlJFLJtsoHYRDfiZoUyIxqCtRpVlANq0EU4dApjrtgezPFad5S19Wgjkc0hNVnuF4HjVA6C7QrSIbylB+oZe3aHgBsqlNqKYH48jXyJKMuAbiyVJ8KzaB3eRc0pg9VwQ4niFryI68qiOi3AbjwdsfnAtk0bCjTLJKr6mrD9g8iq/S/B81hguOMlQTnVyG40wAcjnmgsCNESDrjme7wfftP4P7SP4N3CJZdvzoNyGq2c/HWOXJGsvVg+RA/k2MC/wN6I2YA2Pt8GkAAAAASUVORK5CYII=") !important;
129
- }
130
- #toast-container > .toast-success {
131
- background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAADsSURBVEhLY2AYBfQMgf///3P8+/evAIgvA/FsIF+BavYDDWMBGroaSMMBiE8VC7AZDrIFaMFnii3AZTjUgsUUWUDA8OdAH6iQbQEhw4HyGsPEcKBXBIC4ARhex4G4BsjmweU1soIFaGg/WtoFZRIZdEvIMhxkCCjXIVsATV6gFGACs4Rsw0EGgIIH3QJYJgHSARQZDrWAB+jawzgs+Q2UO49D7jnRSRGoEFRILcdmEMWGI0cm0JJ2QpYA1RDvcmzJEWhABhD/pqrL0S0CWuABKgnRki9lLseS7g2AlqwHWQSKH4oKLrILpRGhEQCw2LiRUIa4lwAAAABJRU5ErkJggg==") !important;
132
- }
133
- #toast-container > .toast-warning {
134
- background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGYSURBVEhL5ZSvTsNQFMbXZGICMYGYmJhAQIJAICYQPAACiSDB8AiICQQJT4CqQEwgJvYASAQCiZiYmJhAIBATCARJy+9rTsldd8sKu1M0+dLb057v6/lbq/2rK0mS/TRNj9cWNAKPYIJII7gIxCcQ51cvqID+GIEX8ASG4B1bK5gIZFeQfoJdEXOfgX4QAQg7kH2A65yQ87lyxb27sggkAzAuFhbbg1K2kgCkB1bVwyIR9m2L7PRPIhDUIXgGtyKw575yz3lTNs6X4JXnjV+LKM/m3MydnTbtOKIjtz6VhCBq4vSm3ncdrD2lk0VgUXSVKjVDJXJzijW1RQdsU7F77He8u68koNZTz8Oz5yGa6J3H3lZ0xYgXBK2QymlWWA+RWnYhskLBv2vmE+hBMCtbA7KX5drWyRT/2JsqZ2IvfB9Y4bWDNMFbJRFmC9E74SoS0CqulwjkC0+5bpcV1CZ8NMej4pjy0U+doDQsGyo1hzVJttIjhQ7GnBtRFN1UarUlH8F3xict+HY07rEzoUGPlWcjRFRr4/gChZgc3ZL2d8oAAAAASUVORK5CYII=") !important;
135
- }
136
- #toast-container.toast-top-center > div,
137
- #toast-container.toast-bottom-center > div {
138
- width: 300px;
139
- margin: auto;
140
- }
141
- #toast-container.toast-top-full-width > div,
142
- #toast-container.toast-bottom-full-width > div {
143
- width: 96%;
144
- margin: auto;
145
- }
146
- .toast {
147
- background-color: #030303;
148
- }
149
- .toast-success {
150
- background-color: #51a351;
151
- }
152
- .toast-error {
153
- background-color: #bd362f;
154
- }
155
- .toast-info {
156
- background-color: #2f96b4;
157
- }
158
- .toast-warning {
159
- background-color: #f89406;
160
- }
161
- .toast-progress {
162
- position: absolute;
163
- left: 0;
164
- bottom: 0;
165
- height: 4px;
166
- background-color: #000000;
167
- opacity: 0.4;
168
- -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=40);
169
- filter: alpha(opacity=40);
170
- }
171
- /*Responsive Design*/
172
- @media all and (max-width: 240px) {
173
- #toast-container > div {
174
- padding: 8px 8px 8px 50px;
175
- width: 11em;
176
- }
177
- #toast-container .toast-close-button {
178
- right: -0.2em;
179
- top: -0.2em;
180
- }
181
- }
182
- @media all and (min-width: 241px) and (max-width: 480px) {
183
- #toast-container > div {
184
- padding: 8px 8px 8px 50px;
185
- width: 18em;
186
- }
187
- #toast-container .toast-close-button {
188
- right: -0.2em;
189
- top: -0.2em;
190
- }
191
- }
192
- @media all and (min-width: 481px) and (max-width: 768px) {
193
- #toast-container > div {
194
- padding: 15px 15px 15px 50px;
195
- width: 25em;
196
- }
197
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/eduma/custom-script.js DELETED
@@ -1,309 +0,0 @@
1
- /**
2
- * Custom functions to improves popup that display content of course's item
3
- * Combine this functions to main file when release theme
4
- */
5
- ;(function ($) {
6
- "use strict";
7
- var $doc = $(document),
8
- $body = null,
9
- $popup = null,
10
- $popupOverlay = null,
11
- resizeTimer = null,
12
- navItems = null,
13
- thim_scroll = false;
14
-
15
- function _init() {
16
- navItems = LP.Views.Course.model.items;
17
- $().extend(navItems, {
18
- getNext: function () {
19
- var current = this.getCurrent(),
20
- next = false,
21
- _at = false;
22
- for (var i = 0; i < this.length; i++) {
23
- _at = this.at(i);
24
- if (_at && (_at.get('current') == true)) {
25
- for (var j = i + 1; j < this.length; j++) {
26
- _at = this.at(j);
27
- if (_at && _at.get('viewable')) {
28
- next = this.at(j);
29
- break;
30
- }
31
- }
32
- }
33
- if (next) break;
34
- }
35
- return next;
36
- },
37
- getPrev: function () {
38
- var current = this.getCurrent(),
39
- prev = false,
40
- _at = false;
41
- for (var n = this.length, i = n - 1; i >= 0; i--) {
42
- _at = this.at(i);
43
- if (_at && (_at.get('current') == true)) {
44
- for (var j = i - 1; j >= 0; j--) {
45
- _at = this.at(j);
46
- if (_at && _at.get('viewable')) {
47
- prev = this.at(j);
48
- break;
49
- }
50
- }
51
- }
52
- if (prev) break;
53
- }
54
- return prev;
55
- }
56
- });
57
-
58
- if (navItems.getCurrent()) {
59
- $('.course-content-item').css({
60
- visibility: 'visible'
61
- });
62
- showPopup();
63
- $('.mfp-content').prepend($('.popup-title'));
64
- $('.mfp-wrap').scroll(function () {
65
- $(this).find('.popup-title').css('top', 'inherit').attr('x', Math.random());
66
- });
67
- ///$('.popup-title').css('top', 32)
68
- }
69
-
70
- }
71
-
72
- function showPopup($content) {
73
- $.magnificPopup.open({
74
- closeOnBgClick: false,
75
- preloader : false,
76
- showCloseBtn : false,
77
- items : {
78
- src : $content || $('.popup-content'),
79
- type: 'inline'
80
- },
81
- mainClass : 'mfp-with-fade',
82
- removalDelay : 300,
83
- callbacks : {
84
- open : function () {
85
- thim_scroll = false;
86
- if ($('.thim-course-menu-landing').length > 0) {
87
- $('.thim-course-menu-landing').addClass('thim-hidden');
88
- }
89
-
90
- //Cancel event close when loading
91
- $.magnificPopup.instance.close = function () {
92
- if ($('.thim-loading-container').length > 0) {
93
- return;
94
- }
95
- thim_scroll = true;
96
- $('.thim-course-menu-landing.thim-hidden').removeClass('thim-hidden');
97
- $.magnificPopup.proto.close.call(this);
98
- $('.course-content').removeClass('rendered');
99
- };
100
- this.container.css('padding-top', 0).parent().css({
101
- top : $('html').css('margin-top'),
102
- height: 'auto',
103
- bottom: 0
104
- })
105
-
106
- },
107
- resize: function () {
108
- var $courseContent = $('.course-content'),
109
- $title = $courseContent.find('.popup-title'),
110
- position = $('.mfp-content').position() || {top: 0, left: 0},
111
- htmlPadding = parseInt($('html').css('margin-top'));
112
- /*$title.css({
113
- 'left' : position.left,
114
- 'top' : position.top + htmlPadding,
115
- 'width': $courseContent.innerWidth()
116
- });*/
117
- }
118
- }
119
- });
120
- }
121
-
122
- $doc.ready(_init);
123
-
124
- return;
125
-
126
- function _ready() {
127
- $body = $(document.body);
128
- $popup = $('.course-content-item.popup-content');
129
- $popupOverlay = $('.popup-overlay');
130
-
131
-
132
- $(window).bind('resize.thim_resize_popup', function () {
133
- resizeTimer && clearTimeout(resizeTimer);
134
- resizeTimer = setTimeout(_resize, 150);
135
- });
136
-
137
- LP.Views.Course.setElement($body);
138
-
139
- var navItems = LP.Views.Course.model.items;
140
- $().extend(navItems, {
141
- getNext: function () {
142
- var current = this.getCurrent(),
143
- next = false,
144
- _at = false;
145
- for (var i = 0; i < this.length; i++) {
146
- _at = this.at(i);
147
- if (_at && (_at.get('current') == true)) {
148
- for (var j = i + 1; j < this.length; j++) {
149
- _at = this.at(j);
150
- if (_at && _at.get('viewable')) {
151
- next = this.at(j);
152
- break;
153
- }
154
- }
155
- }
156
- if (next) break;
157
- }
158
- return next;
159
- },
160
- getPrev: function () {
161
- var current = this.getCurrent(),
162
- prev = false,
163
- _at = false;
164
- for (var n = this.length, i = n - 1; i >= 0; i--) {
165
- _at = this.at(i);
166
- if (_at && (_at.get('current') == true)) {
167
- for (var j = i - 1; j >= 0; j--) {
168
- _at = this.at(j);
169
- if (_at && _at.get('viewable')) {
170
- prev = this.at(j);
171
- break;
172
- }
173
- }
174
- }
175
- if (prev) break;
176
- }
177
- return prev;
178
- }
179
- });
180
-
181
- $doc
182
- //.unbind('learn_press_item_loaded')
183
- .unbind('learn_press_item_current_changed')
184
- .on('learn_press_item_current_changed', function () {
185
- if (!$popup.is(':visible')) {
186
- $popupOverlay.fadeIn();
187
- $popup.show();
188
- }
189
- $popup.addClass('ajax-loading');
190
-
191
- }).on('learn_press_item_loaded', function (e, data) {
192
- var newHeading = $popup.find('#learn-press-content-item .popup-title'),
193
- oldHeading = $popup.find('.popup-title').not(newHeading),
194
- newNav = $popup.find('.yyyyy .course-item-nav'),
195
- oldNav = $popup.find('.course-item-nav').not(newNav);
196
- if (newHeading.length == 0) {
197
- newHeading = oldHeading;
198
- }
199
- if (data.item) {
200
- newHeading.find('.index').remove();
201
- newHeading.find('.title').html(data.item.get('title'));
202
- newHeading.prepend(data.item.get('el').find('.index').clone());
203
- console.log("xxx", data.item.get('title'));
204
-
205
- }
206
- if (oldHeading.length) {
207
- oldHeading.replaceWith(newHeading);
208
- } else {
209
- $popup.find('.xxxxx').prepend(newHeading);
210
- }
211
- var prev = navItems.getPrev(),
212
- next = navItems.getNext();
213
- if (next) {
214
- oldNav.find('.course-item-next').show().find('a').attr({
215
- 'data-id': next.get('id'),
216
- 'href' : next.get('url')
217
- }).html(next.get('title'));
218
- } else {
219
- oldNav.find('.course-item-next').hide();
220
- }
221
- if (prev) {
222
- oldNav.find('.course-item-prev').show().find('a').attr({
223
- 'data-id': prev.get('id'),
224
- 'href' : prev.get('url')
225
- }).html(prev.get('title'));
226
- } else {
227
- oldNav.find('.course-item-prev').hide();
228
- }
229
- $popup.removeClass('ajax-loading');
230
- $(window).trigger('resize.thim_resize_popup');
231
- }).on('learn_press_item_redirect_url', function (e, data) {
232
- var item = data.item,
233
- _callback = function (item) {
234
- var iframe = $('<iframe />', {id: 'thim-popup-quiz', src: item.get('url')});
235
- $('#learn-press-content-item').html(iframe)
236
- iframe.load(function () {
237
- $(this).css({
238
- width : '100%',
239
- height: $(this).contents().find('body').height()
240
- })
241
- $(window).trigger('resize.thim_resize_popup')
242
- });
243
- LP.setUrl(LP.Views.Course.model.get('url'));
244
- }
245
- if (item.get('type') == 'lp_quiz') {
246
- _callback(item);
247
- $doc.bind('learn_press_set_course_url.quiz_url', function (e, a) {
248
- $doc.unbind('learn_press_set_course_url.quiz_url');
249
- return false;
250
- })
251
- return false;
252
- }
253
- return data;
254
- }
255
- ).on('click', '.mfp-close', function (e) {
256
- e.preventDefault();
257
- $('.popup-content,.popup-overlay').fadeOut();
258
- var cur = navItems.getCurrent();
259
- if (cur) {
260
- cur.set('current', false);
261
- LP.setUrl(LP.Views.Course.model.get('url'))
262
- }
263
- });
264
-
265
- $body.prepend($popup).prepend($popupOverlay);
266
- $popup.css({visibility: 'visible', display: 'none'});
267
- var cur = navItems.getCurrent();
268
- if (cur) {
269
- $doc.triggerHandler('learn_press_item_current_changed');
270
- $doc.triggerHandler('learn_press_item_loaded', {html: cur.get('content'), item: cur});
271
- }
272
- }
273
-
274
- function _resize() {
275
- var $el = $popup.find('.yyyyy'),
276
- $xx = $popup.find('.xxxxx'),
277
- popH = 0,
278
- winH = 0,
279
- dx = 0,
280
- $ifr = $popup.find('#thim-popup-quiz');
281
- winH = $(window).height();
282
- if ($ifr.length) {
283
- var ifrH = $ifr.contents().find('body').outerHeight(),
284
- contentH = winH - 240;
285
- if (ifrH > contentH) {
286
- //$ifr.height(contentH);
287
- } else {
288
- contentH = ifrH - 80;
289
- }
290
- popH = contentH + 240;// including header
291
- dx = (dx = (winH - popH) / 2) >= 10 ? dx : 10
292
-
293
- } else {
294
- popH = $el.find('#learn-press-content-item').outerHeight() + 240;// including header
295
- dx = (dx = (winH - popH) / 2) >= 10 ? dx : 10
296
- }
297
- $popup.stop().animate({
298
- top : dx,
299
- bottom: dx
300
- }, 'fast', function () {
301
- //$xx.height($el.height()+180)
302
- });
303
- console.log('resize:' + dx)
304
-
305
- }
306
-
307
- $doc.ready(_ready);
308
- })
309
- (jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/eduma/custom-style.css DELETED
@@ -1,7 +0,0 @@
1
- .mfp-content .popup-title{
2
- top: inherit;
3
- left:inherit;
4
- }
5
- .learn-press .popup-content #learn-press-course-lesson{
6
- display: block;
7
- }
 
 
 
 
 
 
 
assets/fonts/icomoon.eot DELETED
Binary file
assets/fonts/icomoon.ttf DELETED
Binary file
assets/fonts/icomoon.woff DELETED
Binary file
assets/fonts/icomoon.zip DELETED
Binary file
assets/fonts/icomoon/Read Me.txt DELETED
@@ -1,7 +0,0 @@
1
- Open *demo.html* to see a list of all the glyphs in your font along with their codes/ligatures.
2
-
3
- To use the generated font in desktop programs, you can install the TTF font. In order to copy the character associated with each icon, refer to the text box at the bottom right corner of each glyph in demo.html. The character inside this text box may be invisible; but it can still be copied. See this guide for more info: https://icomoon.io/#docs/local-fonts
4
-
5
- You won't need any of the files located under the *demo-files* directory when including the generated font in your own projects.
6
-
7
- You can import *selection.json* back to the IcoMoon app using the *Import Icons* button (or via Main Menu → Manage Projects) to retrieve your icon selection.
 
 
 
 
 
 
 
assets/fonts/icomoon/demo-files/demo.css DELETED
@@ -1,152 +0,0 @@
1
- body {
2
- padding: 0;
3
- margin: 0;
4
- font-family: sans-serif;
5
- font-size: 1em;
6
- line-height: 1.5;
7
- color: #555;
8
- background: #fff;
9
- }
10
- h1 {
11
- font-size: 1.5em;
12
- font-weight: normal;
13
- }
14
- small {
15
- font-size: .66666667em;
16
- }
17
- a {
18
- color: #e74c3c;
19
- text-decoration: none;
20
- }
21
- a:hover, a:focus {
22
- box-shadow: 0 1px #e74c3c;
23
- }
24
- .bshadow0, input {
25
- box-shadow: inset 0 -2px #e7e7e7;
26
- }
27
- input:hover {
28
- box-shadow: inset 0 -2px #ccc;
29
- }
30
- input, fieldset {
31
- font-family: sans-serif;
32
- font-size: 1em;
33
- margin: 0;
34
- padding: 0;
35
- border: 0;
36
- }
37
- input {
38
- color: inherit;
39
- line-height: 1.5;
40
- height: 1.5em;
41
- padding: .25em 0;
42
- }
43
- input:focus {
44
- outline: none;
45
- box-shadow: inset 0 -2px #449fdb;
46
- }
47
- .glyph {
48
- font-size: 16px;
49
- width: 15em;
50
- padding-bottom: 1em;
51
- margin-right: 4em;
52
- margin-bottom: 1em;
53
- float: left;
54
- overflow: hidden;
55
- }
56
- .liga {
57
- width: 80%;
58
- width: calc(100% - 2.5em);
59
- }
60
- .talign-right {
61
- text-align: right;
62
- }
63
- .talign-center {
64
- text-align: center;
65
- }
66
- .bgc1 {
67
- background: #f1f1f1;
68
- }
69
- .fgc1 {
70
- color: #999;
71
- }
72
- .fgc0 {
73
- color: #000;
74
- }
75
- p {
76
- margin-top: 1em;
77
- margin-bottom: 1em;
78
- }
79
- .mvm {
80
- margin-top: .75em;
81
- margin-bottom: .75em;
82
- }
83
- .mtn {
84
- margin-top: 0;
85
- }
86
- .mtl, .mal {
87
- margin-top: 1.5em;
88
- }
89
- .mbl, .mal {
90
- margin-bottom: 1.5em;
91
- }
92
- .mal, .mhl {
93
- margin-left: 1.5em;
94
- margin-right: 1.5em;
95
- }
96
- .mhmm {
97
- margin-left: 1em;
98
- margin-right: 1em;
99
- }
100
- .mls {
101
- margin-left: .25em;
102
- }
103
- .ptl {
104
- padding-top: 1.5em;
105
- }
106
- .pbs, .pvs {
107
- padding-bottom: .25em;
108
- }
109
- .pvs, .pts {
110
- padding-top: .25em;
111
- }
112
- .unit {
113
- float: left;
114
- }
115
- .unitRight {
116
- float: right;
117
- }
118
- .size1of2 {
119
- width: 50%;
120
- }
121
- .size1of1 {
122
- width: 100%;
123
- }
124
- .clearfix:before, .clearfix:after {
125
- content: " ";
126
- display: table;
127
- }
128
- .clearfix:after {
129
- clear: both;
130
- }
131
- .hidden-true {
132
- display: none;
133
- }
134
- .textbox0 {
135
- width: 3em;
136
- background: #f1f1f1;
137
- padding: .25em .5em;
138
- line-height: 1.5;
139
- height: 1.5em;
140
- }
141
- #testDrive {
142
- display: block;
143
- padding-top: 24px;
144
- line-height: 1.5;
145
- }
146
- .fs0 {
147
- font-size: 16px;
148
- }
149
- .fs1 {
150
- font-size: 32px;
151
- }
152
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/fonts/icomoon/demo-files/demo.js DELETED
@@ -1,30 +0,0 @@
1
- if (!('boxShadow' in document.body.style)) {
2
- document.body.setAttribute('class', 'noBoxShadow');
3
- }
4
-
5
- document.body.addEventListener("click", function(e) {
6
- var target = e.target;
7
- if (target.tagName === "INPUT" &&
8
- target.getAttribute('class').indexOf('liga') === -1) {
9
- target.select();
10
- }
11
- });
12
-
13
- (function() {
14
- var fontSize = document.getElementById('fontSize'),
15
- testDrive = document.getElementById('testDrive'),
16
- testText = document.getElementById('testText');
17
- function updateTest() {
18
- testDrive.innerHTML = testText.value || String.fromCharCode(160);
19
- if (window.icomoonLiga) {
20
- window.icomoonLiga(testDrive);
21
- }
22
- }
23
- function updateSize() {
24
- testDrive.style.fontSize = fontSize.value + 'px';
25
- }
26
- fontSize.addEventListener('change', updateSize, false);
27
- testText.addEventListener('input', updateTest, false);
28
- testText.addEventListener('change', updateTest, false);
29
- updateSize();
30
- }());
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/fonts/icomoon/demo-files/demo.min.js DELETED
@@ -1 +0,0 @@
1
- if(!("boxShadow" in document.body.style)){document.body.setAttribute("class","noBoxShadow")}document.body.addEventListener("click",function(b){var a=b.target;if(a.tagName==="INPUT"&&a.getAttribute("class").indexOf("liga")===-1){a.select()}});(function(){var e=document.getElementById("fontSize"),d=document.getElementById("testDrive"),c=document.getElementById("testText");function b(){d.innerHTML=c.value||String.fromCharCode(160);if(window.icomoonLiga){window.icomoonLiga(d)}}function a(){d.style.fontSize=e.value+"px"}e.addEventListener("change",a,false);c.addEventListener("input",b,false);c.addEventListener("change",b,false);a()}());
 
assets/fonts/icomoon/demo.html DELETED
@@ -1,183 +0,0 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8">
5
- <title>IcoMoon Demo</title>
6
- <meta name="description" content="An Icon Font Generated By IcoMoon.io">
7
- <meta name="viewport" content="width=device-width, initial-scale=1">
8
- <link rel="stylesheet" href="demo-files/demo.css">
9
- <link rel="stylesheet" href="style.css"></head>
10
- <body>
11
- <div class="bgc1 clearfix">
12
- <h1 class="mhmm mvm"><span class="fgc1">Font Name:</span> icomoon <small class="fgc1">(Glyphs:&nbsp;9)</small></h1>
13
- </div>
14
- <div class="clearfix mhl ptl">
15
- <h1 class="mvm mtn fgc1">Grid Size: 16</h1>
16
- <div class="glyph fs1">
17
- <div class="clearfix bshadow0 pbs">
18
- <span class="icon-file-text2">
19
-
20
- </span>
21
- <span class="mls"> icon-file-text2</span>
22
- </div>
23
- <fieldset class="fs0 size1of1 clearfix hidden-false">
24
- <input type="text" readonly value="e926" class="unit size1of2" />
25
- <input type="text" maxlength="1" readonly value="&#xe926;" class="unitRight size1of2 talign-right" />
26
- </fieldset>
27
- <div class="fs0 bshadow0 clearfix hidden-true">
28
- <span class="unit pvs fgc1">liga: </span>
29
- <input type="text" readonly value="file-text2, file4" class="liga unitRight" />
30
- </div>
31
- </div>
32
- <div class="glyph fs1">
33
- <div class="clearfix bshadow0 pbs">
34
- <span class="icon-file-picture">
35
-
36
- </span>
37
- <span class="mls"> icon-file-picture</span>
38
- </div>
39
- <fieldset class="fs0 size1of1 clearfix hidden-false">
40
- <input type="text" readonly value="e927" class="unit size1of2" />
41
- <input type="text" maxlength="1" readonly value="&#xe927;" class="unitRight size1of2 talign-right" />
42
- </fieldset>
43
- <div class="fs0 bshadow0 clearfix hidden-true">
44
- <span class="unit pvs fgc1">liga: </span>
45
- <input type="text" readonly value="file-picture, file5" class="liga unitRight" />
46
- </div>
47
- </div>
48
- <div class="glyph fs1">
49
- <div class="clearfix bshadow0 pbs">
50
- <span class="icon-file-music">
51
-
52
- </span>
53
- <span class="mls"> icon-file-music</span>
54
- </div>
55
- <fieldset class="fs0 size1of1 clearfix hidden-false">
56
- <input type="text" readonly value="e928" class="unit size1of2" />
57
- <input type="text" maxlength="1" readonly value="&#xe928;" class="unitRight size1of2 talign-right" />
58
- </fieldset>
59
- <div class="fs0 bshadow0 clearfix hidden-true">
60
- <span class="unit pvs fgc1">liga: </span>
61
- <input type="text" readonly value="file-music, file6" class="liga unitRight" />
62
- </div>
63
- </div>
64
- <div class="glyph fs1">
65
- <div class="clearfix bshadow0 pbs">
66
- <span class="icon-file-video">
67
-
68
- </span>
69
- <span class="mls"> icon-file-video</span>
70
- </div>
71
- <fieldset class="fs0 size1of1 clearfix hidden-false">
72
- <input type="text" readonly value="e92a" class="unit size1of2" />
73
- <input type="text" maxlength="1" readonly value="&#xe92a;" class="unitRight size1of2 talign-right" />
74
- </fieldset>
75
- <div class="fs0 bshadow0 clearfix hidden-true">
76
- <span class="unit pvs fgc1">liga: </span>
77
- <input type="text" readonly value="file-video, file8" class="liga unitRight" />
78
- </div>
79
- </div>
80
- <div class="glyph fs1">
81
- <div class="clearfix bshadow0 pbs">
82
- <span class="icon-file-zip">
83
-
84
- </span>
85
- <span class="mls"> icon-file-zip</span>
86
- </div>
87
- <fieldset class="fs0 size1of1 clearfix hidden-false">
88
- <input type="text" readonly value="e92b" class="unit size1of2" />
89
- <input type="text" maxlength="1" readonly value="&#xe92b;" class="unitRight size1of2 talign-right" />
90
- </fieldset>
91
- <div class="fs0 bshadow0 clearfix hidden-true">
92
- <span class="unit pvs fgc1">liga: </span>
93
- <input type="text" readonly value="file-zip, file9" class="liga unitRight" />
94
- </div>
95
- </div>
96
- <div class="glyph fs1">
97
- <div class="clearfix bshadow0 pbs">
98
- <span class="icon-paste">
99
-
100
- </span>
101
- <span class="mls"> icon-paste</span>
102
- </div>
103
- <fieldset class="fs0 size1of1 clearfix hidden-false">
104
- <input type="text" readonly value="e92d" class="unit size1of2" />
105
- <input type="text" maxlength="1" readonly value="&#xe92d;" class="unitRight size1of2 talign-right" />
106
- </fieldset>
107
- <div class="fs0 bshadow0 clearfix hidden-true">
108
- <span class="unit pvs fgc1">liga: </span>
109
- <input type="text" readonly value="paste, clipboard-file" class="liga unitRight" />
110
- </div>
111
- </div>
112
- <div class="glyph fs1">
113
- <div class="clearfix bshadow0 pbs">
114
- <span class="icon-alarm">
115
-
116
- </span>
117
- <span class="mls"> icon-alarm</span>
118
- </div>
119
- <fieldset class="fs0 size1of1 clearfix hidden-false">
120
- <input type="text" readonly value="e950" class="unit size1of2" />
121
- <input type="text" maxlength="1" readonly value="&#xe950;" class="unitRight size1of2 talign-right" />
122
- </fieldset>
123
- <div class="fs0 bshadow0 clearfix hidden-true">
124
- <span class="unit pvs fgc1">liga: </span>
125
- <input type="text" readonly value="alarm, time4" class="liga unitRight" />
126
- </div>
127
- </div>
128
- <div class="glyph fs1">
129
- <div class="clearfix bshadow0 pbs">
130
- <span class="icon-cross">
131
-
132
- </span>
133
- <span class="mls"> icon-cross</span>
134
- </div>
135
- <fieldset class="fs0 size1of1 clearfix hidden-false">
136
- <input type="text" readonly value="ea0f" class="unit size1of2" />
137
- <input type="text" maxlength="1" readonly value="&#xea0f;" class="unitRight size1of2 talign-right" />
138
- </fieldset>
139
- <div class="fs0 bshadow0 clearfix hidden-true">
140
- <span class="unit pvs fgc1">liga: </span>
141
- <input type="text" readonly value="cross, cancel" class="liga unitRight" />
142
- </div>
143
- </div>
144
- <div class="glyph fs1">
145
- <div class="clearfix bshadow0 pbs">
146
- <span class="icon-checkmark">
147
-
148
- </span>
149
- <span class="mls"> icon-checkmark</span>
150
- </div>
151
- <fieldset class="fs0 size1of1 clearfix hidden-false">
152
- <input type="text" readonly value="ea10" class="unit size1of2" />
153
- <input type="text" maxlength="1" readonly value="&#xea10;" class="unitRight size1of2 talign-right" />
154
- </fieldset>
155
- <div class="fs0 bshadow0 clearfix hidden-true">
156
- <span class="unit pvs fgc1">liga: </span>
157
- <input type="text" readonly value="checkmark, tick" class="liga unitRight" />
158
- </div>
159
- </div>
160
- </div>
161
-
162
- <!--[if gt IE 8]><!-->
163
- <div class="mhl clearfix mbl">
164
- <h1>Font Test Drive</h1>
165
- <label>
166
- Font Size: <input id="fontSize" type="number" class="textbox0 mbm"
167
- min="8" value="48" />
168
- px
169
- </label>
170
- <input id="testText" type="text" class="phl size1of1 mvl"
171
- placeholder="Type some text to test..." value=""/>
172
- </label>
173
- <div id="testDrive" class="icon-">&nbsp;
174
- </div>
175
- </div>
176
- <!--<![endif]-->
177
- <div class="bgc1 clearfix">
178
- <p class="mhl">Generated by <a href="https://icomoon.io/app">IcoMoon</a></p>
179
- </div>
180
-
181
- <script src="demo-files/demo.js"></script>
182
- </body>
183
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/fonts/icomoon/fonts/icomoon.eot DELETED
Binary file
assets/fonts/icomoon/fonts/icomoon.svg DELETED
@@ -1,19 +0,0 @@
1
- <?xml version="1.0" standalone="no"?>
2
- <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
3
- <svg xmlns="http://www.w3.org/2000/svg">
4
- <metadata>Generated by IcoMoon</metadata>
5
- <defs>
6
- <font id="icomoon" horiz-adv-x="1024">
7
- <font-face units-per-em="1024" ascent="960" descent="-64" />
8
- <missing-glyph horiz-adv-x="1024" />
9
- <glyph unicode="&#x20;" horiz-adv-x="512" d="" />
10
- <glyph unicode="&#xe926;" glyph-name="file-text2" d="M917.806 730.924c-22.212 30.292-53.174 65.7-87.178 99.704s-69.412 64.964-99.704 87.178c-51.574 37.82-76.592 42.194-90.924 42.194h-496c-44.112 0-80-35.888-80-80v-864c0-44.112 35.888-80 80-80h736c44.112 0 80 35.888 80 80v624c0 14.332-4.372 39.35-42.194 90.924zM785.374 785.374c30.7-30.7 54.8-58.398 72.58-81.374h-153.954v153.946c22.984-17.78 50.678-41.878 81.374-72.572zM896 16c0-8.672-7.328-16-16-16h-736c-8.672 0-16 7.328-16 16v864c0 8.672 7.328 16 16 16 0 0 495.956 0.002 496 0v-224c0-17.672 14.326-32 32-32h224v-624zM736 128h-448c-17.672 0-32 14.326-32 32s14.328 32 32 32h448c17.674 0 32-14.326 32-32s-14.326-32-32-32zM736 256h-448c-17.672 0-32 14.326-32 32s14.328 32 32 32h448c17.674 0 32-14.326 32-32s-14.326-32-32-32zM736 384h-448c-17.672 0-32 14.326-32 32s14.328 32 32 32h448c17.674 0 32-14.326 32-32s-14.326-32-32-32z" />
11
- <glyph unicode="&#xe927;" glyph-name="file-picture" d="M832 64h-640v128l192 320 263-320 185 128v-256zM832 480c0-53.020-42.98-96-96-96-53.022 0-96 42.98-96 96s42.978 96 96 96c53.020 0 96-42.98 96-96zM917.806 730.924c-22.212 30.292-53.174 65.7-87.178 99.704s-69.412 64.964-99.704 87.178c-51.574 37.82-76.592 42.194-90.924 42.194h-496c-44.112 0-80-35.888-80-80v-864c0-44.112 35.888-80 80-80h736c44.112 0 80 35.888 80 80v624c0 14.332-4.372 39.35-42.194 90.924zM785.374 785.374c30.7-30.7 54.8-58.398 72.58-81.374h-153.954v153.946c22.984-17.78 50.678-41.878 81.374-72.572zM896 16c0-8.672-7.328-16-16-16h-736c-8.672 0-16 7.328-16 16v864c0 8.672 7.328 16 16 16 0 0 495.956 0.002 496 0v-224c0-17.672 14.326-32 32-32h224v-624z" />
12
- <glyph unicode="&#xe928;" glyph-name="file-music" d="M917.806 730.924c-22.21 30.292-53.174 65.7-87.178 99.704s-69.412 64.964-99.704 87.178c-51.574 37.82-76.592 42.194-90.924 42.194h-496c-44.112 0-80-35.888-80-80v-864c0-44.112 35.886-80 80-80h736c44.112 0 80 35.888 80 80v624c0 14.332-4.372 39.35-42.194 90.924v0zM785.374 785.374c30.7-30.7 54.8-58.398 72.58-81.374h-153.954v153.946c22.982-17.78 50.678-41.878 81.374-72.572v0zM896 16c0-8.672-7.328-16-16-16h-736c-8.672 0-16 7.328-16 16v864c0 8.672 7.328 16 16 16 0 0 495.956 0.002 496 0v-224c0-17.672 14.324-32 32-32h224v-624zM756.288 568.748c-7.414 6.080-17.164 8.514-26.562 6.632l-320-64c-14.958-2.994-25.726-16.126-25.726-31.38v-236.876c-18.832 8.174-40.678 12.876-64 12.876-70.692 0-128-42.98-128-96s57.308-96 128-96 128 42.98 128 96v229.766l256 51.202v-133.842c-18.832 8.174-40.678 12.876-64 12.876-70.692 0-128-42.98-128-96s57.308-96 128-96 128 42.98 128 96v319.998c0 9.586-4.298 18.668-11.712 24.748z" />
13
- <glyph unicode="&#xe92a;" glyph-name="file-video" d="M917.806 730.924c-22.208 30.292-53.174 65.7-87.178 99.704s-69.412 64.964-99.704 87.178c-51.574 37.82-76.594 42.194-90.924 42.194h-496c-44.112 0-80-35.888-80-80v-864c0-44.112 35.882-80 80-80h736c44.112 0 80 35.888 80 80v624c0 14.332-4.372 39.35-42.194 90.924v0 0zM785.374 785.374c30.7-30.7 54.8-58.398 72.58-81.374h-153.954v153.946c22.98-17.78 50.678-41.878 81.374-72.572v0 0zM896 16c0-8.672-7.328-16-16-16h-736c-8.672 0-16 7.328-16 16v864c0 8.672 7.328 16 16 16 0 0 495.956 0.002 496 0v-224c0-17.672 14.32-32 32-32h224v-624zM256 448h320v-320h-320v320zM576 320l192 128v-320l-192 128z" />
14
- <glyph unicode="&#xe92b;" glyph-name="file-zip" d="M917.806 730.924c-22.208 30.292-53.174 65.7-87.178 99.704s-69.412 64.964-99.704 87.178c-51.574 37.82-76.592 42.194-90.924 42.194h-496c-44.112 0-80-35.888-80-80v-864c0-44.112 35.884-80 80-80h736c44.112 0 80 35.888 80 80v624c0 14.332-4.372 39.35-42.194 90.924v0 0zM785.374 785.374c30.7-30.7 54.8-58.398 72.58-81.374h-153.954v153.946c22.98-17.78 50.678-41.878 81.374-72.572v0 0zM896 16c0-8.672-7.328-16-16-16h-736c-8.672 0-16 7.328-16 16v864c0 8.672 7.328 16 16 16 0 0 495.956 0.002 496 0v-224c0-17.672 14.322-32 32-32h224v-624zM256 896h128v-64h-128v64zM384 832h128v-64h-128v64zM256 768h128v-64h-128v64zM384 704h128v-64h-128v64zM256 640h128v-64h-128v64zM384 576h128v-64h-128v64zM256 512h128v-64h-128v64zM384 448h128v-64h-128v64zM256 112c0-26.4 21.6-48 48-48h160c26.4 0 48 21.6 48 48v160c0 26.4-21.6 48-48 48h-80v64h-128v-272zM448 192v-64h-128v64h128z" />
15
- <glyph unicode="&#xe92d;" glyph-name="paste" d="M704 832h-128v64c0 35.2-28.8 64-64 64h-128c-35.204 0-64-28.8-64-64v-64h-128v-128h512v128zM512 832h-128v63.886c0.034 0.038 0.072 0.078 0.114 0.114h127.768c0.042-0.036 0.082-0.076 0.118-0.114v-63.886zM832 640v160c0 17.6-14.4 32-32 32h-64v-64h32v-128h-192l-192-192v-256h-256v576h32v64h-64c-17.602 0-32-14.4-32-32v-640c0-17.6 14.398-32 32-32h288v-192h640v704h-192zM576 549.49v-101.49h-101.49l101.49 101.49zM960 0h-512v384h192v192h320v-576z" />
16
- <glyph unicode="&#xe950;" glyph-name="alarm" d="M512 832c-247.424 0-448-200.576-448-448s200.576-448 448-448 448 200.576 448 448-200.576 448-448 448zM512 24c-198.824 0-360 161.178-360 360 0 198.824 161.176 360 360 360 198.822 0 360-161.176 360-360 0-198.822-161.178-360-360-360zM934.784 672.826c16.042 28.052 25.216 60.542 25.216 95.174 0 106.040-85.96 192-192 192-61.818 0-116.802-29.222-151.92-74.596 131.884-27.236 245.206-105.198 318.704-212.578v0zM407.92 885.404c-35.116 45.374-90.102 74.596-151.92 74.596-106.040 0-192-85.96-192-192 0-34.632 9.174-67.122 25.216-95.174 73.5 107.38 186.822 185.342 318.704 212.578zM512 384v256h-64v-320h256v64z" />
17
- <glyph unicode="&#xea0f;" glyph-name="cross" d="M1014.662 137.34c-0.004 0.004-0.008 0.008-0.012 0.010l-310.644 310.65 310.644 310.65c0.004 0.004 0.008 0.006 0.012 0.010 3.344 3.346 5.762 7.254 7.312 11.416 4.246 11.376 1.824 24.682-7.324 33.83l-146.746 146.746c-9.148 9.146-22.45 11.566-33.828 7.32-4.16-1.55-8.070-3.968-11.418-7.31 0-0.004-0.004-0.006-0.008-0.010l-310.648-310.652-310.648 310.65c-0.004 0.004-0.006 0.006-0.010 0.010-3.346 3.342-7.254 5.76-11.414 7.31-11.38 4.248-24.682 1.826-33.83-7.32l-146.748-146.748c-9.148-9.148-11.568-22.452-7.322-33.828 1.552-4.16 3.97-8.072 7.312-11.416 0.004-0.002 0.006-0.006 0.010-0.010l310.65-310.648-310.65-310.652c-0.002-0.004-0.006-0.006-0.008-0.010-3.342-3.346-5.76-7.254-7.314-11.414-4.248-11.376-1.826-24.682 7.322-33.83l146.748-146.746c9.15-9.148 22.452-11.568 33.83-7.322 4.16 1.552 8.070 3.97 11.416 7.312 0.002 0.004 0.006 0.006 0.010 0.010l310.648 310.65 310.648-310.65c0.004-0.002 0.008-0.006 0.012-0.008 3.348-3.344 7.254-5.762 11.414-7.314 11.378-4.246 24.684-1.826 33.828 7.322l146.746 146.748c9.148 9.148 11.57 22.454 7.324 33.83-1.552 4.16-3.97 8.068-7.314 11.414z" />
18
- <glyph unicode="&#xea10;" glyph-name="checkmark" d="M864 832l-480-480-224 224-160-160 384-384 640 640z" />
19
- </font></defs></svg>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/fonts/icomoon/fonts/icomoon.ttf DELETED
Binary file
assets/fonts/icomoon/fonts/icomoon.woff DELETED
Binary file
assets/fonts/icomoon/selection.json DELETED
@@ -1,312 +0,0 @@
1
- {
2
- "IcoMoonType": "selection",
3
- "icons": [
4
- {
5
- "icon": {
6
- "paths": [
7
- "M917.806 229.076c-22.212-30.292-53.174-65.7-87.178-99.704s-69.412-64.964-99.704-87.178c-51.574-37.82-76.592-42.194-90.924-42.194h-496c-44.112 0-80 35.888-80 80v864c0 44.112 35.888 80 80 80h736c44.112 0 80-35.888 80-80v-624c0-14.332-4.372-39.35-42.194-90.924zM785.374 174.626c30.7 30.7 54.8 58.398 72.58 81.374h-153.954v-153.946c22.984 17.78 50.678 41.878 81.374 72.572zM896 944c0 8.672-7.328 16-16 16h-736c-8.672 0-16-7.328-16-16v-864c0-8.672 7.328-16 16-16 0 0 495.956-0.002 496 0v224c0 17.672 14.326 32 32 32h224v624z",
8
- "M736 832h-448c-17.672 0-32-14.326-32-32s14.328-32 32-32h448c17.674 0 32 14.326 32 32s-14.326 32-32 32z",
9
- "M736 704h-448c-17.672 0-32-14.326-32-32s14.328-32 32-32h448c17.674 0 32 14.326 32 32s-14.326 32-32 32z",
10
- "M736 576h-448c-17.672 0-32-14.326-32-32s14.328-32 32-32h448c17.674 0 32 14.326 32 32s-14.326 32-32 32z"
11
- ],
12
- "tags": [
13
- "file-text",
14
- "file",
15
- "document",
16
- "list",
17
- "paper",
18
- "page"
19
- ],
20
- "defaultCode": 59686,
21
- "grid": 16,
22
- "attrs": []
23
- },
24
- "attrs": [],
25
- "properties": {
26
- "ligatures": "file-text2, file4",
27
- "name": "file-text2",
28
- "order": 2,
29
- "id": 39,
30
- "prevSize": 32,
31
- "code": 59686
32
- },
33
- "setIdx": 0,
34
- "setId": 1,
35
- "iconIdx": 38
36
- },
37
- {
38
- "icon": {
39
- "paths": [
40
- "M832 896h-640v-128l192-320 263 320 185-128v256z",
41
- "M832 480c0 53.020-42.98 96-96 96-53.022 0-96-42.98-96-96s42.978-96 96-96c53.020 0 96 42.98 96 96z",
42
- "M917.806 229.076c-22.212-30.292-53.174-65.7-87.178-99.704s-69.412-64.964-99.704-87.178c-51.574-37.82-76.592-42.194-90.924-42.194h-496c-44.112 0-80 35.888-80 80v864c0 44.112 35.888 80 80 80h736c44.112 0 80-35.888 80-80v-624c0-14.332-4.372-39.35-42.194-90.924zM785.374 174.626c30.7 30.7 54.8 58.398 72.58 81.374h-153.954v-153.946c22.984 17.78 50.678 41.878 81.374 72.572zM896 944c0 8.672-7.328 16-16 16h-736c-8.672 0-16-7.328-16-16v-864c0-8.672 7.328-16 16-16 0 0 495.956-0.002 496 0v224c0 17.672 14.326 32 32 32h224v624z"
43
- ],
44
- "tags": [
45
- "file-picture",
46
- "file",
47
- "document",
48
- "file-image"
49
- ],
50
- "defaultCode": 59687,
51
- "grid": 16,
52
- "attrs": []
53
- },
54
- "attrs": [],
55
- "properties": {
56
- "ligatures": "file-picture, file5",
57
- "name": "file-picture",
58
- "order": 3,
59
- "id": 40,
60
- "prevSize": 32,
61
- "code": 59687
62
- },
63
- "setIdx": 0,
64
- "setId": 1,
65
- "iconIdx": 39
66
- },
67
- {
68
- "icon": {
69
- "paths": [
70
- "M917.806 229.076c-22.21-30.292-53.174-65.7-87.178-99.704s-69.412-64.964-99.704-87.178c-51.574-37.82-76.592-42.194-90.924-42.194h-496c-44.112 0-80 35.888-80 80v864c0 44.112 35.886 80 80 80h736c44.112 0 80-35.888 80-80v-624c0-14.332-4.372-39.35-42.194-90.924v0zM785.374 174.626c30.7 30.7 54.8 58.398 72.58 81.374h-153.954v-153.946c22.982 17.78 50.678 41.878 81.374 72.572v0zM896 944c0 8.672-7.328 16-16 16h-736c-8.672 0-16-7.328-16-16v-864c0-8.672 7.328-16 16-16 0 0 495.956-0.002 496 0v224c0 17.672 14.324 32 32 32h224v624z",
71
- "M756.288 391.252c-7.414-6.080-17.164-8.514-26.562-6.632l-320 64c-14.958 2.994-25.726 16.126-25.726 31.38v236.876c-18.832-8.174-40.678-12.876-64-12.876-70.692 0-128 42.98-128 96s57.308 96 128 96 128-42.98 128-96v-229.766l256-51.202v133.842c-18.832-8.174-40.678-12.876-64-12.876-70.692 0-128 42.98-128 96s57.308 96 128 96 128-42.98 128-96v-319.998c0-9.586-4.298-18.668-11.712-24.748z"
72
- ],
73
- "tags": [
74
- "file-music",
75
- "file",
76
- "document",
77
- "file-song",
78
- "file-audio"
79
- ],
80
- "defaultCode": 59688,
81
- "grid": 16,
82
- "attrs": []
83
- },
84
- "attrs": [],
85
- "properties": {
86
- "ligatures": "file-music, file6",
87
- "name": "file-music",
88
- "order": 4,
89
- "id": 41,
90
- "prevSize": 32,
91
- "code": 59688
92
- },
93
- "setIdx": 0,
94
- "setId": 1,
95
- "iconIdx": 40
96
- },
97
- {
98
- "icon": {
99
- "paths": [
100
- "M917.806 229.076c-22.208-30.292-53.174-65.7-87.178-99.704s-69.412-64.964-99.704-87.178c-51.574-37.82-76.594-42.194-90.924-42.194h-496c-44.112 0-80 35.888-80 80v864c0 44.112 35.882 80 80 80h736c44.112 0 80-35.888 80-80v-624c0-14.332-4.372-39.35-42.194-90.924v0 0zM785.374 174.626c30.7 30.7 54.8 58.398 72.58 81.374h-153.954v-153.946c22.98 17.78 50.678 41.878 81.374 72.572v0 0zM896 944c0 8.672-7.328 16-16 16h-736c-8.672 0-16-7.328-16-16v-864c0-8.672 7.328-16 16-16 0 0 495.956-0.002 496 0v224c0 17.672 14.32 32 32 32h224v624z",
101
- "M256 512h320v320h-320v-320z",
102
- "M576 640l192-128v320l-192-128z"
103
- ],
104
- "tags": [
105
- "file-video",
106
- "file",
107
- "document",
108
- "file-camera"
109
- ],
110
- "defaultCode": 59690,
111
- "grid": 16,
112
- "attrs": []
113
- },
114
- "attrs": [],
115
- "properties": {
116
- "ligatures": "file-video, file8",
117
- "name": "file-video",
118
- "order": 5,
119
- "id": 43,
120
- "prevSize": 32,
121
- "code": 59690
122
- },
123
- "setIdx": 0,
124
- "setId": 1,
125
- "iconIdx": 42
126
- },
127
- {
128
- "icon": {
129
- "paths": [
130
- "M917.806 229.076c-22.208-30.292-53.174-65.7-87.178-99.704s-69.412-64.964-99.704-87.178c-51.574-37.82-76.592-42.194-90.924-42.194h-496c-44.112 0-80 35.888-80 80v864c0 44.112 35.884 80 80 80h736c44.112 0 80-35.888 80-80v-624c0-14.332-4.372-39.35-42.194-90.924v0 0zM785.374 174.626c30.7 30.7 54.8 58.398 72.58 81.374h-153.954v-153.946c22.98 17.78 50.678 41.878 81.374 72.572v0 0zM896 944c0 8.672-7.328 16-16 16h-736c-8.672 0-16-7.328-16-16v-864c0-8.672 7.328-16 16-16 0 0 495.956-0.002 496 0v224c0 17.672 14.322 32 32 32h224v624z",
131
- "M256 64h128v64h-128v-64z",
132
- "M384 128h128v64h-128v-64z",
133
- "M256 192h128v64h-128v-64z",
134
- "M384 256h128v64h-128v-64z",
135
- "M256 320h128v64h-128v-64z",
136
- "M384 384h128v64h-128v-64z",
137
- "M256 448h128v64h-128v-64z",
138
- "M384 512h128v64h-128v-64z",
139
- "M256 848c0 26.4 21.6 48 48 48h160c26.4 0 48-21.6 48-48v-160c0-26.4-21.6-48-48-48h-80v-64h-128v272zM448 768v64h-128v-64h128z"
140
- ],
141
- "tags": [
142
- "file-zip",
143
- "file",
144
- "document",
145
- "file-compressed",
146
- "file-type",
147
- "file-format"
148
- ],
149
- "defaultCode": 59691,
150
- "grid": 16,
151
- "attrs": []
152
- },
153
- "attrs": [],
154
- "properties": {
155
- "ligatures": "file-zip, file9",
156
- "name": "file-zip",
157
- "order": 6,
158
- "id": 44,
159
- "prevSize": 32,
160
- "code": 59691
161
- },
162
- "setIdx": 0,
163
- "setId": 1,
164
- "iconIdx": 43
165
- },
166
- {
167
- "icon": {
168
- "paths": [
169
- "M704 128h-128v-64c0-35.2-28.8-64-64-64h-128c-35.204 0-64 28.8-64 64v64h-128v128h512v-128zM512 128h-128v-63.886c0.034-0.038 0.072-0.078 0.114-0.114h127.768c0.042 0.036 0.082 0.076 0.118 0.114v63.886zM832 320v-160c0-17.6-14.4-32-32-32h-64v64h32v128h-192l-192 192v256h-256v-576h32v-64h-64c-17.602 0-32 14.4-32 32v640c0 17.6 14.398 32 32 32h288v192h640v-704h-192zM576 410.51v101.49h-101.49l101.49-101.49zM960 960h-512v-384h192v-192h320v576z"
170
- ],
171
- "tags": [
172
- "paste",
173
- "clipboard-file"
174
- ],
175
- "defaultCode": 59693,
176
- "grid": 16,
177
- "attrs": []
178
- },
179
- "attrs": [],
180
- "properties": {
181
- "ligatures": "paste, clipboard-file",
182
- "name": "paste",
183
- "order": 7,
184
- "id": 46,
185
- "prevSize": 32,
186
- "code": 59693
187
- },
188
- "setIdx": 0,
189
- "setId": 1,
190
- "iconIdx": 45
191
- },
192
- {
193
- "icon": {
194
- "paths": [
195
- "M512 128c-247.424 0-448 200.576-448 448s200.576 448 448 448 448-200.576 448-448-200.576-448-448-448zM512 936c-198.824 0-360-161.178-360-360 0-198.824 161.176-360 360-360 198.822 0 360 161.176 360 360 0 198.822-161.178 360-360 360zM934.784 287.174c16.042-28.052 25.216-60.542 25.216-95.174 0-106.040-85.96-192-192-192-61.818 0-116.802 29.222-151.92 74.596 131.884 27.236 245.206 105.198 318.704 212.578v0zM407.92 74.596c-35.116-45.374-90.102-74.596-151.92-74.596-106.040 0-192 85.96-192 192 0 34.632 9.174 67.122 25.216 95.174 73.5-107.38 186.822-185.342 318.704-212.578z",
196
- "M512 576v-256h-64v320h256v-64z"
197
- ],
198
- "tags": [
199
- "alarm",
200
- "time",
201
- "clock"
202
- ],
203
- "defaultCode": 59728,
204
- "grid": 16,
205
- "attrs": []
206
- },
207
- "attrs": [],
208
- "properties": {
209
- "ligatures": "alarm, time4",
210
- "name": "alarm",
211
- "order": 8,
212
- "id": 81,
213
- "prevSize": 32,
214
- "code": 59728
215
- },
216
- "setIdx": 0,
217
- "setId": 1,
218
- "iconIdx": 80
219
- },
220
- {
221
- "icon": {
222
- "paths": [
223
- "M1014.662 822.66c-0.004-0.004-0.008-0.008-0.012-0.010l-310.644-310.65 310.644-310.65c0.004-0.004 0.008-0.006 0.012-0.010 3.344-3.346 5.762-7.254 7.312-11.416 4.246-11.376 1.824-24.682-7.324-33.83l-146.746-146.746c-9.148-9.146-22.45-11.566-33.828-7.32-4.16 1.55-8.070 3.968-11.418 7.31 0 0.004-0.004 0.006-0.008 0.010l-310.648 310.652-310.648-310.65c-0.004-0.004-0.006-0.006-0.010-0.010-3.346-3.342-7.254-5.76-11.414-7.31-11.38-4.248-24.682-1.826-33.83 7.32l-146.748 146.748c-9.148 9.148-11.568 22.452-7.322 33.828 1.552 4.16 3.97 8.072 7.312 11.416 0.004 0.002 0.006 0.006 0.010 0.010l310.65 310.648-310.65 310.652c-0.002 0.004-0.006 0.006-0.008 0.010-3.342 3.346-5.76 7.254-7.314 11.414-4.248 11.376-1.826 24.682 7.322 33.83l146.748 146.746c9.15 9.148 22.452 11.568 33.83 7.322 4.16-1.552 8.070-3.97 11.416-7.312 0.002-0.004 0.006-0.006 0.010-0.010l310.648-310.65 310.648 310.65c0.004 0.002 0.008 0.006 0.012 0.008 3.348 3.344 7.254 5.762 11.414 7.314 11.378 4.246 24.684 1.826 33.828-7.322l146.746-146.748c9.148-9.148 11.57-22.454 7.324-33.83-1.552-4.16-3.97-8.068-7.314-11.414z"
224
- ],
225
- "tags": [
226
- "cross",
227
- "cancel",
228
- "close",
229
- "quit",
230
- "remove"
231
- ],
232
- "defaultCode": 59919,
233
- "grid": 16,
234
- "attrs": []
235
- },
236
- "attrs": [],
237
- "properties": {
238
- "ligatures": "cross, cancel",
239
- "name": "cross",
240
- "order": 10,
241
- "id": 272,
242
- "prevSize": 32,
243
- "code": 59919
244
- },
245
- "setIdx": 0,
246
- "setId": 1,
247
- "iconIdx": 271
248
- },
249
- {
250
- "icon": {
251
- "paths": [
252
- "M864 128l-480 480-224-224-160 160 384 384 640-640z"
253
- ],
254
- "tags": [
255
- "checkmark",
256
- "tick",
257
- "correct",
258
- "accept",
259
- "ok"
260
- ],
261
- "defaultCode": 59920,
262
- "grid": 16,
263
- "attrs": []
264
- },
265
- "attrs": [],
266
- "properties": {
267
- "ligatures": "checkmark, tick",
268
- "name": "checkmark",
269
- "order": 9,
270
- "id": 273,
271
- "prevSize": 32,
272
- "code": 59920
273
- },
274
- "setIdx": 0,
275
- "setId": 1,
276
- "iconIdx": 272
277
- }
278
- ],
279
- "height": 1024,
280
- "metadata": {
281
- "name": "icomoon"
282
- },
283
- "preferences": {
284
- "showGlyphs": true,
285
- "showQuickUse": true,
286
- "showQuickUse2": true,
287
- "showSVGs": true,
288
- "fontPref": {
289
- "prefix": "icon-",
290
- "metadata": {
291
- "fontFamily": "icomoon"
292
- },
293
- "metrics": {
294
- "emSize": 1024,
295
- "baseline": 6.25,
296
- "whitespace": 50
297
- },
298
- "embed": false
299
- },
300
- "imagePref": {
301
- "prefix": "icon-",
302
- "png": true,
303
- "useClassSelector": true,
304
- "color": 0,
305
- "bgColor": 16777215,
306
- "classSelector": ".icon"
307
- },
308
- "historySize": 100,
309
- "showCodes": true,
310
- "gridSize": 16
311
- }
312
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/fonts/icomoon/style.css DELETED
@@ -1,54 +0,0 @@
1
- @font-face {
2
- font-family: 'icomoon';
3
- src: url('fonts/icomoon.eot?8uirti');
4
- src: url('fonts/icomoon.eot?8uirti#iefix') format('embedded-opentype'),
5
- url('fonts/icomoon.ttf?8uirti') format('truetype'),
6
- url('fonts/icomoon.woff?8uirti') format('woff'),
7
- url('fonts/icomoon.svg?8uirti#icomoon') format('svg');
8
- font-weight: normal;
9
- font-style: normal;
10
- }
11
-
12
- [class^="icon-"], [class*=" icon-"] {
13
- /* use !important to prevent issues with browser extensions that change fonts */
14
- font-family: 'icomoon' !important;
15
- speak: none;
16
- font-style: normal;
17
- font-weight: normal;
18
- font-variant: normal;
19
- text-transform: none;
20
- line-height: 1;
21
-
22
- /* Better Font Rendering =========== */
23
- -webkit-font-smoothing: antialiased;
24
- -moz-osx-font-smoothing: grayscale;
25
- }
26
-
27
- .icon-file-text2:before {
28
- content: "\e926";
29
- }
30
- .icon-file-picture:before {
31
- content: "\e927";
32
- }
33
- .icon-file-music:before {
34
- content: "\e928";
35
- }
36
- .icon-file-video:before {
37
- content: "\e92a";
38
- }
39
- .icon-file-zip:before {
40
- content: "\e92b";
41
- }
42
- .icon-paste:before {
43
- content: "\e92d";
44
- }
45
- .icon-alarm:before {
46
- content: "\e950";
47
- }
48
- .icon-cross:before {
49
- content: "\ea0f";
50
- }
51
- .icon-checkmark:before {
52
- content: "\ea10";
53
- }
54
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/fonts/icon.eot DELETED
Binary file
assets/fonts/icon.svg DELETED
@@ -1,14 +0,0 @@
1
- <?xml version="1.0" standalone="no"?>
2
- <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
3
- <svg xmlns="http://www.w3.org/2000/svg">
4
- <metadata>Icon Font</metadata>
5
- <defs>
6
- <font id="icon" horiz-adv-x="1024">
7
- <font-face units-per-em="1024" ascent="960" descent="-64" />
8
- <missing-glyph horiz-adv-x="1024" />
9
- <glyph unicode="&#x20;" horiz-adv-x="512" d="" />
10
- <glyph unicode="&#xe900;" glyph-name="books" horiz-adv-x="1152" d="M224 832h-192c-17.6 0-32-14.4-32-32v-704c0-17.6 14.4-32 32-32h192c17.6 0 32 14.4 32 32v704c0 17.6-14.4 32-32 32zM192 640h-128v64h128v-64zM544 832h-192c-17.6 0-32-14.4-32-32v-704c0-17.6 14.4-32 32-32h192c17.6 0 32 14.4 32 32v704c0 17.6-14.4 32-32 32zM512 640h-128v64h128v-64zM765.088 782.52l-171.464-86.394c-15.716-7.918-22.096-27.258-14.178-42.976l287.978-571.548c7.918-15.718 27.258-22.098 42.976-14.178l171.464 86.392c15.716 7.92 22.096 27.26 14.178 42.974l-287.978 571.55c-7.92 15.718-27.26 22.1-42.976 14.18zM928 96c0-17.673-14.327-32-32-32s-32 14.327-32 32c0 17.673 14.327 32 32 32s32-14.327 32-32z" />
11
- <glyph unicode="&#xe901;" glyph-name="alarm" d="M512 832c-247.424 0-448-200.576-448-448s200.576-448 448-448 448 200.576 448 448-200.576 448-448 448zM512 24c-198.824 0-360 161.178-360 360 0 198.824 161.176 360 360 360 198.822 0 360-161.176 360-360 0-198.822-161.178-360-360-360zM934.784 672.826c16.042 28.052 25.216 60.542 25.216 95.174 0 106.040-85.96 192-192 192-61.818 0-116.802-29.222-151.92-74.596 131.884-27.236 245.206-105.198 318.704-212.578v0zM407.92 885.404c-35.116 45.374-90.102 74.596-151.92 74.596-106.040 0-192-85.96-192-192 0-34.632 9.174-67.122 25.216-95.174 73.5 107.38 186.822 185.342 318.704 212.578zM512 384v256h-64v-320h256v64z" />
12
- <glyph unicode="&#xe902;" glyph-name="spinner10" d="M0.042 446.382l-0.022-0.004c0 0 0.012-0.090 0.028-0.222 0.11-3.878 0.55-7.676 1.322-11.352 0.204-1.746 0.428-3.66 0.674-5.774 0.222-1.886 0.46-3.914 0.718-6.078 0.374-2.566 0.77-5.292 1.19-8.176 0.856-5.746 1.8-12.124 2.908-18.958 1.348-6.446 2.804-13.414 4.364-20.864 0.71-3.718 1.776-7.504 2.786-11.406 1.024-3.89 2.078-7.894 3.16-12.004 0.566-2.042 1.040-4.132 1.708-6.208 0.656-2.074 1.32-4.176 1.988-6.3 1.348-4.234 2.726-8.566 4.136-12.988 0.352-1.106 0.708-2.21 1.064-3.324 0.408-1.102 0.814-2.208 1.226-3.316 0.826-2.218 1.658-4.458 2.502-6.714 1.696-4.496 3.422-9.078 5.18-13.742 1.968-4.566 3.97-9.214 6.004-13.934 1.018-2.348 2.044-4.714 3.078-7.098 1.048-2.376 2.27-4.704 3.408-7.074 2.322-4.714 4.678-9.496 7.062-14.332 2.47-4.786 5.208-9.512 7.846-14.328 1.336-2.398 2.68-4.808 4.028-7.23 1.368-2.41 2.902-4.75 4.356-7.14 2.95-4.738 5.93-9.524 8.934-14.348 12.64-18.894 26.676-37.566 42.21-55.278 15.712-17.578 32.726-34.25 50.692-49.602 18.18-15.136 37.264-28.902 56.726-41.114 19.604-12.036 39.644-22.312 59.376-31.144 5.004-2.040 9.964-4.062 14.878-6.066 2.462-0.972 4.868-2.032 7.336-2.918 2.47-0.868 4.93-1.734 7.376-2.594 4.898-1.684 9.678-3.468 14.484-4.992 4.832-1.43 9.604-2.844 14.312-4.242 2.356-0.672 4.66-1.426 7.004-2.012 2.346-0.574 4.676-1.14 6.986-1.704 4.606-1.118 9.142-2.214 13.604-3.296 4.5-0.868 8.926-1.722 13.27-2.558 2.166-0.41 4.31-0.82 6.434-1.222 1.062-0.2 2.118-0.398 3.166-0.598 1.060-0.148 2.118-0.292 3.166-0.442 4.192-0.582 8.292-1.152 12.3-1.71 1.998-0.274 3.972-0.546 5.922-0.816 1.946-0.286 3.904-0.378 5.814-0.57 3.822-0.336 7.544-0.664 11.164-0.98 3.616-0.304 7.104-0.688 10.526-0.738 0.23-0.008 0.452-0.016 0.682-0.026 0.614-34.812 29.008-62.846 63.968-62.846 0.542 0 1.080 0.028 1.62 0.042v-0.022c0 0 0.090 0.012 0.224 0.028 3.878 0.11 7.674 0.55 11.35 1.322 1.748 0.204 3.662 0.426 5.776 0.672 1.884 0.222 3.912 0.462 6.076 0.718 2.566 0.376 5.292 0.772 8.176 1.192 5.746 0.856 12.124 1.8 18.958 2.908 6.446 1.348 13.414 2.804 20.864 4.362 3.718 0.712 7.504 1.778 11.406 2.786 3.892 1.026 7.894 2.080 12.004 3.162 2.044 0.566 4.132 1.040 6.208 1.708 2.074 0.656 4.174 1.318 6.3 1.988 4.232 1.348 8.564 2.726 12.988 4.134 1.104 0.354 2.21 0.708 3.324 1.066 1.1 0.406 2.206 0.814 3.316 1.226 2.216 0.824 4.456 1.658 6.714 2.5 4.496 1.698 9.078 3.424 13.74 5.182 4.568 1.968 9.216 3.97 13.936 6.004 2.348 1.018 4.714 2.044 7.098 3.078 2.376 1.048 4.702 2.27 7.074 3.408 4.714 2.322 9.494 4.678 14.33 7.062 4.786 2.47 9.512 5.208 14.328 7.846 2.398 1.336 4.808 2.678 7.23 4.028 2.41 1.366 4.75 2.9 7.14 4.354 4.738 2.952 9.524 5.93 14.35 8.936 18.89 12.64 37.564 26.674 55.278 42.21 17.574 15.712 34.248 32.726 49.602 50.69 15.136 18.182 28.902 37.264 41.112 56.728 12.036 19.602 22.314 39.644 31.142 59.376 2.042 5.002 4.062 9.964 6.068 14.878 0.974 2.462 2.032 4.868 2.918 7.334 0.87 2.472 1.732 4.932 2.592 7.376 1.686 4.898 3.468 9.678 4.994 14.484 1.432 4.832 2.846 9.604 4.24 14.31 0.674 2.358 1.43 4.66 2.016 7.004 0.57 2.348 1.138 4.676 1.702 6.988 1.118 4.606 2.216 9.14 3.296 13.602 0.868 4.502 1.72 8.928 2.558 13.272 0.41 2.164 0.818 4.308 1.222 6.434 0.2 1.060 0.398 2.116 0.596 3.164 0.148 1.062 0.296 2.118 0.444 3.168 0.582 4.19 1.152 8.292 1.708 12.3 0.278 1.996 0.55 3.97 0.82 5.922 0.284 1.946 0.376 3.902 0.568 5.812 0.336 3.822 0.664 7.546 0.98 11.164 0.304 3.616 0.686 7.106 0.738 10.528 0.020 0.534 0.040 1.044 0.058 1.574 35.224 0.146 63.732 28.738 63.732 63.992 0 0.542-0.028 1.080-0.042 1.62h0.022c0 0-0.012 0.090-0.028 0.224-0.11 3.878-0.55 7.674-1.322 11.35-0.204 1.748-0.428 3.662-0.674 5.776-0.222 1.886-0.46 3.914-0.718 6.076-0.374 2.566-0.77 5.294-1.19 8.176-0.856 5.746-1.8 12.124-2.908 18.958-1.348 6.444-2.804 13.414-4.364 20.862-0.71 3.72-1.776 7.506-2.786 11.408-1.024 3.892-2.078 7.894-3.16 12.002-0.566 2.044-1.040 4.134-1.708 6.208-0.656 2.076-1.32 4.174-1.988 6.3-1.348 4.234-2.726 8.566-4.136 12.99-0.352 1.102-0.708 2.21-1.064 3.324-0.408 1.1-0.814 2.206-1.226 3.316-0.826 2.216-1.658 4.454-2.502 6.714-1.696 4.498-3.422 9.080-5.18 13.74-1.968 4.57-3.97 9.216-6.004 13.936-1.020 2.348-2.044 4.714-3.078 7.098-1.048 2.376-2.27 4.702-3.408 7.076-2.322 4.714-4.678 9.494-7.062 14.33-2.47 4.786-5.208 9.512-7.846 14.328-1.336 2.398-2.68 4.808-4.028 7.23-1.368 2.41-2.902 4.75-4.356 7.14-2.95 4.74-5.93 9.524-8.934 14.35-12.64 18.892-26.676 37.564-42.21 55.278-15.712 17.576-32.726 34.25-50.692 49.602-18.18 15.136-37.264 28.902-56.726 41.112-19.604 12.036-39.644 22.314-59.376 31.142-5.004 2.040-9.964 4.062-14.878 6.068-2.462 0.974-4.868 2.032-7.336 2.918-2.47 0.87-4.93 1.734-7.376 2.592-4.898 1.684-9.678 3.468-14.484 4.994-4.832 1.432-9.604 2.846-14.312 4.242-2.356 0.672-4.66 1.428-7.004 2.014-2.346 0.572-4.676 1.138-6.986 1.702-4.606 1.118-9.142 2.216-13.604 3.298-4.5 0.868-8.926 1.72-13.27 2.558-2.166 0.412-4.31 0.82-6.434 1.222-1.062 0.2-2.118 0.398-3.166 0.596-1.060 0.148-2.118 0.296-3.166 0.442-4.192 0.584-8.292 1.154-12.3 1.71-1.998 0.276-3.972 0.55-5.922 0.82-1.946 0.284-3.904 0.376-5.814 0.57-3.822 0.336-7.544 0.664-11.164 0.98-3.616 0.304-7.104 0.686-10.526 0.738-0.852 0.032-1.674 0.062-2.512 0.092-0.65 34.78-29.028 62.778-63.966 62.778-0.542 0-1.080-0.028-1.62-0.042l-0.002 0.022c0 0-0.090-0.012-0.222-0.028-3.878-0.11-7.676-0.55-11.352-1.322-1.748-0.204-3.662-0.426-5.776-0.672-1.884-0.222-3.912-0.462-6.076-0.718-2.566-0.376-5.292-0.772-8.176-1.192-5.746-0.856-12.124-1.8-18.958-2.908-6.446-1.348-13.414-2.804-20.864-4.362-3.718-0.712-7.504-1.778-11.406-2.786-3.892-1.026-7.894-2.080-12.004-3.162-2.044-0.566-4.132-1.040-6.208-1.708-2.074-0.656-4.174-1.318-6.3-1.988-4.232-1.348-8.564-2.726-12.988-4.134-1.104-0.354-2.21-0.708-3.324-1.066-1.1-0.406-2.206-0.814-3.316-1.226-2.216-0.824-4.456-1.658-6.714-2.5-4.496-1.698-9.078-3.424-13.74-5.182-4.568-1.968-9.216-3.97-13.936-6.004-2.348-1.018-4.714-2.044-7.098-3.078-2.376-1.048-4.702-2.27-7.074-3.408-4.714-2.322-9.494-4.678-14.33-7.062-4.786-2.47-9.512-5.208-14.328-7.846-2.398-1.336-4.808-2.678-7.23-4.028-2.41-1.366-4.75-2.9-7.14-4.354-4.738-2.952-9.524-5.93-14.35-8.936-18.89-12.64-37.564-26.674-55.278-42.21-17.574-15.712-34.248-32.726-49.602-50.69-15.136-18.182-28.902-37.264-41.112-56.728-12.036-19.602-22.314-39.644-31.142-59.376-2.042-5.002-4.062-9.964-6.068-14.878-0.974-2.462-2.032-4.868-2.918-7.334-0.87-2.472-1.732-4.932-2.592-7.376-1.686-4.898-3.468-9.678-4.994-14.484-1.432-4.832-2.846-9.604-4.24-14.31-0.674-2.358-1.43-4.66-2.016-7.004-0.57-2.348-1.138-4.676-1.702-6.988-1.118-4.606-2.216-9.14-3.296-13.602-0.868-4.502-1.72-8.928-2.558-13.272-0.41-2.164-0.818-4.308-1.222-6.434-0.2-1.060-0.398-2.116-0.596-3.164-0.148-1.062-0.296-2.118-0.444-3.168-0.582-4.19-1.152-8.292-1.708-12.3-0.278-1.996-0.55-3.97-0.82-5.922-0.284-1.946-0.376-3.902-0.568-5.812-0.336-3.822-0.664-7.546-0.98-11.164-0.304-3.616-0.686-7.106-0.738-10.528-0.020-0.548-0.040-1.076-0.058-1.62-34.376-1.112-61.902-29.304-61.902-63.946 0-0.542 0.028-1.078 0.042-1.618zM73.518 511.294c0.042 0.196 0.086 0.384 0.128 0.58 0.644 3.248 1.632 6.542 2.556 9.942 0.934 3.388 1.894 6.876 2.88 10.454 0.516 1.78 0.934 3.602 1.546 5.406 0.596 1.802 1.202 3.628 1.81 5.476 1.218 3.682 2.464 7.45 3.736 11.294 0.316 0.958 0.634 1.924 0.956 2.892 0.37 0.954 0.74 1.914 1.114 2.876 0.746 1.924 1.5 3.868 2.26 5.83 1.52 3.904 3.070 7.882 4.646 11.93 1.768 3.96 3.566 7.99 5.392 12.080 0.908 2.038 1.824 4.090 2.746 6.156 0.932 2.060 2.036 4.072 3.052 6.126 2.070 4.084 4.17 8.222 6.294 12.412 2.202 4.142 4.654 8.224 6.998 12.392 1.184 2.074 2.374 4.16 3.57 6.256 1.21 2.086 2.586 4.102 3.876 6.166 2.616 4.098 5.256 8.232 7.918 12.402 11.234 16.298 23.632 32.398 37.33 47.638 13.874 15.104 28.842 29.404 44.598 42.548 15.974 12.928 32.686 24.65 49.676 35.022 17.13 10.194 34.6 18.838 51.734 26.258 4.35 1.7 8.662 3.382 12.934 5.050 2.136 0.812 4.216 1.71 6.36 2.444 2.146 0.714 4.28 1.428 6.404 2.136 4.25 1.386 8.382 2.888 12.548 4.142 4.184 1.174 8.314 2.332 12.392 3.474 2.038 0.55 4.026 1.19 6.054 1.662 2.030 0.458 4.044 0.914 6.044 1.368 3.978 0.91 7.896 1.806 11.748 2.688 3.888 0.686 7.71 1.36 11.462 2.022 1.868 0.33 3.716 0.658 5.546 0.98 0.914 0.162 1.824 0.324 2.728 0.484 0.916 0.112 1.828 0.222 2.734 0.332 3.612 0.448 7.148 0.882 10.604 1.31 1.72 0.216 3.422 0.432 5.102 0.644 1.674 0.226 3.364 0.266 5.010 0.408 3.292 0.238 6.498 0.472 9.616 0.7 3.11 0.218 6.11 0.524 9.058 0.508 5.848 0.132 11.32 0.256 16.38 0.372 4.664-0.168 8.948-0.324 12.818-0.462 1.914-0.054 3.726-0.108 5.432-0.156 2.122-0.134 4.108-0.26 5.958-0.378 2.13-0.138 4.060-0.266 5.82-0.38 3.256-0.51 6.592-0.782 9.99-0.782 0.466 0 0.93 0.026 1.396 0.036 0.132-0.008 0.224-0.014 0.224-0.014v0.020c31.14 0.778 56.75 23.784 61.556 53.754 0.542-0.12 1.064-0.236 1.612-0.356 3.246-0.644 6.542-1.632 9.942-2.556 3.386-0.934 6.876-1.894 10.454-2.88 1.778-0.516 3.602-0.934 5.404-1.546 1.802-0.596 3.63-1.202 5.478-1.812 3.68-1.218 7.448-2.464 11.292-3.736 0.96-0.316 1.924-0.634 2.892-0.956 0.956-0.37 1.914-0.74 2.876-1.112 1.926-0.746 3.868-1.5 5.83-2.26 3.904-1.52 7.884-3.070 11.932-4.646 3.96-1.768 7.988-3.566 12.080-5.392 2.038-0.908 4.088-1.824 6.156-2.746 2.060-0.932 4.072-2.036 6.126-3.054 4.082-2.070 8.222-4.17 12.41-6.294 4.144-2.202 8.226-4.654 12.394-6.998 2.074-1.184 4.16-2.374 6.256-3.572 2.086-1.21 4.102-2.586 6.166-3.876 4.098-2.616 8.23-5.256 12.402-7.918 16.296-11.234 32.398-23.632 47.636-37.33 15.104-13.874 29.406-28.842 42.55-44.598 12.928-15.974 24.648-32.686 35.020-49.676 10.196-17.13 18.84-34.6 26.26-51.736 1.698-4.348 3.382-8.662 5.050-12.932 0.812-2.136 1.71-4.216 2.444-6.36 0.714-2.146 1.428-4.28 2.136-6.404 1.386-4.25 2.888-8.384 4.142-12.548 1.174-4.184 2.33-8.316 3.474-12.392 0.55-2.038 1.19-4.026 1.66-6.054 0.46-2.030 0.916-4.046 1.368-6.046 0.91-3.978 1.808-7.896 2.688-11.748 0.688-3.888 1.362-7.71 2.024-11.462 0.33-1.868 0.656-3.716 0.98-5.548 0.162-0.914 0.324-1.824 0.484-2.728 0.11-0.916 0.222-1.828 0.332-2.734 0.446-3.612 0.882-7.148 1.31-10.604 0.216-1.72 0.432-3.42 0.642-5.1 0.226-1.674 0.268-3.364 0.41-5.010 0.238-3.292 0.472-6.498 0.7-9.616 0.218-3.11 0.524-6.11 0.508-9.058 0.132-5.848 0.256-11.32 0.372-16.38-0.168-4.664-0.324-8.948-0.462-12.818-0.054-1.914-0.108-3.726-0.156-5.432-0.134-2.122-0.26-4.108-0.378-5.958-0.138-2.13-0.266-4.060-0.38-5.82-0.498-3.256-0.768-6.592-0.768-9.99 0-0.468 0.026-0.93 0.036-1.396-0.008-0.132-0.016-0.224-0.016-0.224h0.022c0.768-30.766 23.236-56.128 52.682-61.37-0.066-0.296-0.13-0.584-0.198-0.884-0.644-3.248-1.632-6.542-2.556-9.942-0.934-3.388-1.894-6.876-2.88-10.454-0.516-1.78-0.934-3.602-1.546-5.406-0.596-1.802-1.202-3.628-1.81-5.476-1.218-3.682-2.464-7.45-3.736-11.294-0.316-0.958-0.634-1.924-0.956-2.892-0.37-0.954-0.74-1.914-1.114-2.876-0.746-1.924-1.5-3.868-2.26-5.83-1.52-3.904-3.070-7.882-4.646-11.93-1.768-3.96-3.566-7.99-5.392-12.080-0.908-2.038-1.824-4.090-2.746-6.156-0.932-2.060-2.036-4.072-3.052-6.126-2.070-4.084-4.17-8.222-6.294-12.412-2.202-4.142-4.654-8.224-6.998-12.392-1.184-2.074-2.374-4.16-3.57-6.256-1.21-2.086-2.586-4.102-3.876-6.166-2.616-4.098-5.256-8.232-7.918-12.402-11.234-16.298-23.632-32.398-37.33-47.638-13.874-15.104-28.842-29.404-44.598-42.548-15.974-12.928-32.686-24.65-49.676-35.022-17.13-10.194-34.6-18.838-51.734-26.258-4.35-1.7-8.662-3.382-12.934-5.050-2.136-0.812-4.216-1.71-6.36-2.444-2.146-0.714-4.28-1.428-6.404-2.136-4.25-1.386-8.382-2.888-12.548-4.142-4.184-1.174-8.314-2.332-12.392-3.474-2.038-0.55-4.026-1.19-6.054-1.662-2.030-0.458-4.044-0.914-6.044-1.368-3.978-0.91-7.896-1.806-11.748-2.688-3.888-0.686-7.71-1.36-11.462-2.022-1.868-0.33-3.716-0.658-5.546-0.98-0.914-0.162-1.824-0.324-2.728-0.484-0.916-0.112-1.828-0.222-2.734-0.332-3.612-0.448-7.148-0.882-10.604-1.31-1.72-0.216-3.422-0.432-5.102-0.644-1.674-0.226-3.364-0.266-5.010-0.408-3.292-0.238-6.498-0.472-9.616-0.7-3.11-0.218-6.11-0.524-9.058-0.508-5.848-0.132-11.32-0.256-16.38-0.372-4.664 0.168-8.948 0.324-12.818 0.462-1.914 0.054-3.726 0.108-5.432 0.156-2.122 0.134-4.108 0.26-5.958 0.378-2.13 0.138-4.060 0.266-5.82 0.38-3.256 0.51-6.592 0.782-9.99 0.782-0.466 0-0.93-0.026-1.396-0.036-0.132 0.008-0.224 0.014-0.224 0.014v-0.020c-31.004-0.774-56.524-23.586-61.488-53.364-3.2 0.64-6.446 1.61-9.792 2.522-3.386 0.934-6.876 1.894-10.454 2.878-1.778 0.516-3.602 0.938-5.404 1.546-1.802 0.598-3.63 1.204-5.478 1.812-3.68 1.218-7.448 2.464-11.292 3.738-0.96 0.316-1.924 0.632-2.892 0.954-0.956 0.372-1.914 0.742-2.876 1.114-1.926 0.746-3.868 1.5-5.83 2.258-3.904 1.524-7.884 3.070-11.932 4.648-3.96 1.77-7.988 3.566-12.080 5.39-2.038 0.91-4.088 1.824-6.156 2.746-2.060 0.934-4.072 2.036-6.126 3.054-4.082 2.070-8.222 4.172-12.41 6.296-4.144 2.2-8.226 4.652-12.394 6.996-2.074 1.184-4.16 2.376-6.256 3.57-2.086 1.21-4.102 2.586-6.166 3.878-4.098 2.614-8.23 5.254-12.402 7.918-16.296 11.23-32.398 23.632-47.636 37.328-15.104 13.876-29.406 28.84-42.55 44.598-12.928 15.972-24.648 32.684-35.020 49.676-10.196 17.128-18.84 34.602-26.26 51.734-1.698 4.352-3.382 8.664-5.050 12.934-0.812 2.136-1.71 4.218-2.444 6.36-0.714 2.148-1.428 4.282-2.136 6.406-1.386 4.25-2.888 8.382-4.142 12.546-1.174 4.184-2.33 8.316-3.474 12.394-0.55 2.036-1.19 4.024-1.66 6.054-0.46 2.028-0.916 4.042-1.368 6.042-0.91 3.98-1.808 7.898-2.688 11.75-0.688 3.886-1.362 7.71-2.024 11.46-0.33 1.868-0.656 3.718-0.98 5.546-0.162 0.914-0.324 1.824-0.484 2.73-0.11 0.914-0.222 1.828-0.332 2.734-0.446 3.61-0.882 7.148-1.31 10.602-0.216 1.722-0.432 3.422-0.642 5.102-0.226 1.676-0.268 3.364-0.41 5.012-0.238 3.29-0.472 6.496-0.7 9.614-0.218 3.11-0.524 6.11-0.508 9.058-0.132 5.848-0.256 11.32-0.372 16.382 0.168 4.664 0.324 8.946 0.462 12.816 0.054 1.914 0.108 3.726 0.156 5.434 0.134 2.122 0.26 4.106 0.378 5.958 0.138 2.128 0.266 4.058 0.38 5.82 0.496 3.26 0.766 6.596 0.766 9.994 0 0.466-0.026 0.93-0.036 1.396 0.008 0.132 0.016 0.224 0.016 0.224h-0.022c-0.78 31.38-24.134 57.154-54.44 61.674z" />
13
- <glyph unicode="&#xe903;" glyph-name="checkmark" d="M864 832l-480-480-224 224-160-160 384-384 640 640z" />
14
- </font></defs></svg>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/fonts/icon.ttf DELETED
Binary file
assets/fonts/icon.woff DELETED
Binary file
assets/fonts/icons.eot DELETED
Binary file
assets/fonts/icons.svg DELETED
@@ -1,17 +0,0 @@
1
- <?xml version="1.0" standalone="no"?>
2
- <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
3
- <svg xmlns="http://www.w3.org/2000/svg">
4
- <metadata>Generated by IcoMoon</metadata>
5
- <defs>
6
- <font id="icomoon" horiz-adv-x="1024">
7
- <font-face units-per-em="1024" ascent="960" descent="-64" />
8
- <missing-glyph horiz-adv-x="1024" />
9
- <glyph unicode="&#x20;" horiz-adv-x="512" d="" />
10
- <glyph unicode="&#xe926;" glyph-name="file-text2" d="M917.806 730.924c-22.212 30.292-53.174 65.7-87.178 99.704s-69.412 64.964-99.704 87.178c-51.574 37.82-76.592 42.194-90.924 42.194h-496c-44.112 0-80-35.888-80-80v-864c0-44.112 35.888-80 80-80h736c44.112 0 80 35.888 80 80v624c0 14.332-4.372 39.35-42.194 90.924zM785.374 785.374c30.7-30.7 54.8-58.398 72.58-81.374h-153.954v153.946c22.984-17.78 50.678-41.878 81.374-72.572zM896 16c0-8.672-7.328-16-16-16h-736c-8.672 0-16 7.328-16 16v864c0 8.672 7.328 16 16 16 0 0 495.956 0.002 496 0v-224c0-17.672 14.326-32 32-32h224v-624zM736 128h-448c-17.672 0-32 14.326-32 32s14.328 32 32 32h448c17.674 0 32-14.326 32-32s-14.326-32-32-32zM736 256h-448c-17.672 0-32 14.326-32 32s14.328 32 32 32h448c17.674 0 32-14.326 32-32s-14.326-32-32-32zM736 384h-448c-17.672 0-32 14.326-32 32s14.328 32 32 32h448c17.674 0 32-14.326 32-32s-14.326-32-32-32z" />
11
- <glyph unicode="&#xe927;" glyph-name="file-picture" d="M832 64h-640v128l192 320 263-320 185 128v-256zM832 480c0-53.020-42.98-96-96-96-53.022 0-96 42.98-96 96s42.978 96 96 96c53.020 0 96-42.98 96-96zM917.806 730.924c-22.212 30.292-53.174 65.7-87.178 99.704s-69.412 64.964-99.704 87.178c-51.574 37.82-76.592 42.194-90.924 42.194h-496c-44.112 0-80-35.888-80-80v-864c0-44.112 35.888-80 80-80h736c44.112 0 80 35.888 80 80v624c0 14.332-4.372 39.35-42.194 90.924zM785.374 785.374c30.7-30.7 54.8-58.398 72.58-81.374h-153.954v153.946c22.984-17.78 50.678-41.878 81.374-72.572zM896 16c0-8.672-7.328-16-16-16h-736c-8.672 0-16 7.328-16 16v864c0 8.672 7.328 16 16 16 0 0 495.956 0.002 496 0v-224c0-17.672 14.326-32 32-32h224v-624z" />
12
- <glyph unicode="&#xe928;" glyph-name="file-music" d="M917.806 730.924c-22.21 30.292-53.174 65.7-87.178 99.704s-69.412 64.964-99.704 87.178c-51.574 37.82-76.592 42.194-90.924 42.194h-496c-44.112 0-80-35.888-80-80v-864c0-44.112 35.886-80 80-80h736c44.112 0 80 35.888 80 80v624c0 14.332-4.372 39.35-42.194 90.924v0zM785.374 785.374c30.7-30.7 54.8-58.398 72.58-81.374h-153.954v153.946c22.982-17.78 50.678-41.878 81.374-72.572v0zM896 16c0-8.672-7.328-16-16-16h-736c-8.672 0-16 7.328-16 16v864c0 8.672 7.328 16 16 16 0 0 495.956 0.002 496 0v-224c0-17.672 14.324-32 32-32h224v-624zM756.288 568.748c-7.414 6.080-17.164 8.514-26.562 6.632l-320-64c-14.958-2.994-25.726-16.126-25.726-31.38v-236.876c-18.832 8.174-40.678 12.876-64 12.876-70.692 0-128-42.98-128-96s57.308-96 128-96 128 42.98 128 96v229.766l256 51.202v-133.842c-18.832 8.174-40.678 12.876-64 12.876-70.692 0-128-42.98-128-96s57.308-96 128-96 128 42.98 128 96v319.998c0 9.586-4.298 18.668-11.712 24.748z" />
13
- <glyph unicode="&#xe92a;" glyph-name="file-video" d="M917.806 730.924c-22.208 30.292-53.174 65.7-87.178 99.704s-69.412 64.964-99.704 87.178c-51.574 37.82-76.594 42.194-90.924 42.194h-496c-44.112 0-80-35.888-80-80v-864c0-44.112 35.882-80 80-80h736c44.112 0 80 35.888 80 80v624c0 14.332-4.372 39.35-42.194 90.924v0 0zM785.374 785.374c30.7-30.7 54.8-58.398 72.58-81.374h-153.954v153.946c22.98-17.78 50.678-41.878 81.374-72.572v0 0zM896 16c0-8.672-7.328-16-16-16h-736c-8.672 0-16 7.328-16 16v864c0 8.672 7.328 16 16 16 0 0 495.956 0.002 496 0v-224c0-17.672 14.32-32 32-32h224v-624zM256 448h320v-320h-320v320zM576 320l192 128v-320l-192 128z" />
14
- <glyph unicode="&#xe92b;" glyph-name="file-zip" d="M917.806 730.924c-22.208 30.292-53.174 65.7-87.178 99.704s-69.412 64.964-99.704 87.178c-51.574 37.82-76.592 42.194-90.924 42.194h-496c-44.112 0-80-35.888-80-80v-864c0-44.112 35.884-80 80-80h736c44.112 0 80 35.888 80 80v624c0 14.332-4.372 39.35-42.194 90.924v0 0zM785.374 785.374c30.7-30.7 54.8-58.398 72.58-81.374h-153.954v153.946c22.98-17.78 50.678-41.878 81.374-72.572v0 0zM896 16c0-8.672-7.328-16-16-16h-736c-8.672 0-16 7.328-16 16v864c0 8.672 7.328 16 16 16 0 0 495.956 0.002 496 0v-224c0-17.672 14.322-32 32-32h224v-624zM256 896h128v-64h-128v64zM384 832h128v-64h-128v64zM256 768h128v-64h-128v64zM384 704h128v-64h-128v64zM256 640h128v-64h-128v64zM384 576h128v-64h-128v64zM256 512h128v-64h-128v64zM384 448h128v-64h-128v64zM256 112c0-26.4 21.6-48 48-48h160c26.4 0 48 21.6 48 48v160c0 26.4-21.6 48-48 48h-80v64h-128v-272zM448 192v-64h-128v64h128z" />
15
- <glyph unicode="&#xe92d;" glyph-name="paste" d="M704 832h-128v64c0 35.2-28.8 64-64 64h-128c-35.204 0-64-28.8-64-64v-64h-128v-128h512v128zM512 832h-128v63.886c0.034 0.038 0.072 0.078 0.114 0.114h127.768c0.042-0.036 0.082-0.076 0.118-0.114v-63.886zM832 640v160c0 17.6-14.4 32-32 32h-64v-64h32v-128h-192l-192-192v-256h-256v576h32v64h-64c-17.602 0-32-14.4-32-32v-640c0-17.6 14.398-32 32-32h288v-192h640v704h-192zM576 549.49v-101.49h-101.49l101.49 101.49zM960 0h-512v384h192v192h320v-576z" />
16
- <glyph unicode="&#xe950;" glyph-name="alarm" d="M512 832c-247.424 0-448-200.576-448-448s200.576-448 448-448 448 200.576 448 448-200.576 448-448 448zM512 24c-198.824 0-360 161.178-360 360 0 198.824 161.176 360 360 360 198.822 0 360-161.176 360-360 0-198.822-161.178-360-360-360zM934.784 672.826c16.042 28.052 25.216 60.542 25.216 95.174 0 106.040-85.96 192-192 192-61.818 0-116.802-29.222-151.92-74.596 131.884-27.236 245.206-105.198 318.704-212.578v0zM407.92 885.404c-35.116 45.374-90.102 74.596-151.92 74.596-106.040 0-192-85.96-192-192 0-34.632 9.174-67.122 25.216-95.174 73.5 107.38 186.822 185.342 318.704 212.578zM512 384v256h-64v-320h256v64z" />
17
- </font></defs></svg>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/fonts/icons.ttf DELETED
Binary file
assets/fonts/icons.woff DELETED
Binary file
assets/fonts/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php // Silence is golden.
assets/fonts/lp-icons.eot ADDED
Binary file
assets/fonts/{icomoon.svg → lp-icons.svg} RENAMED
@@ -3,7 +3,7 @@
3
  <svg xmlns="http://www.w3.org/2000/svg">
4
  <metadata>Generated by IcoMoon</metadata>
5
  <defs>
6
- <font id="icomoon" horiz-adv-x="1024">
7
  <font-face units-per-em="1024" ascent="960" descent="-64" />
8
  <missing-glyph horiz-adv-x="1024" />
9
  <glyph unicode="&#x20;" horiz-adv-x="512" d="" />
@@ -14,6 +14,9 @@
14
  <glyph unicode="&#xe92b;" glyph-name="file-zip" d="M917.806 730.924c-22.208 30.292-53.174 65.7-87.178 99.704s-69.412 64.964-99.704 87.178c-51.574 37.82-76.592 42.194-90.924 42.194h-496c-44.112 0-80-35.888-80-80v-864c0-44.112 35.884-80 80-80h736c44.112 0 80 35.888 80 80v624c0 14.332-4.372 39.35-42.194 90.924v0 0zM785.374 785.374c30.7-30.7 54.8-58.398 72.58-81.374h-153.954v153.946c22.98-17.78 50.678-41.878 81.374-72.572v0 0zM896 16c0-8.672-7.328-16-16-16h-736c-8.672 0-16 7.328-16 16v864c0 8.672 7.328 16 16 16 0 0 495.956 0.002 496 0v-224c0-17.672 14.322-32 32-32h224v-624zM256 896h128v-64h-128v64zM384 832h128v-64h-128v64zM256 768h128v-64h-128v64zM384 704h128v-64h-128v64zM256 640h128v-64h-128v64zM384 576h128v-64h-128v64zM256 512h128v-64h-128v64zM384 448h128v-64h-128v64zM256 112c0-26.4 21.6-48 48-48h160c26.4 0 48 21.6 48 48v160c0 26.4-21.6 48-48 48h-80v64h-128v-272zM448 192v-64h-128v64h128z" />
15
  <glyph unicode="&#xe92d;" glyph-name="paste" d="M704 832h-128v64c0 35.2-28.8 64-64 64h-128c-35.204 0-64-28.8-64-64v-64h-128v-128h512v128zM512 832h-128v63.886c0.034 0.038 0.072 0.078 0.114 0.114h127.768c0.042-0.036 0.082-0.076 0.118-0.114v-63.886zM832 640v160c0 17.6-14.4 32-32 32h-64v-64h32v-128h-192l-192-192v-256h-256v576h32v64h-64c-17.602 0-32-14.4-32-32v-640c0-17.6 14.398-32 32-32h288v-192h640v704h-192zM576 549.49v-101.49h-101.49l101.49 101.49zM960 0h-512v384h192v192h320v-576z" />
16
  <glyph unicode="&#xe950;" glyph-name="alarm" d="M512 832c-247.424 0-448-200.576-448-448s200.576-448 448-448 448 200.576 448 448-200.576 448-448 448zM512 24c-198.824 0-360 161.178-360 360 0 198.824 161.176 360 360 360 198.822 0 360-161.176 360-360 0-198.822-161.178-360-360-360zM934.784 672.826c16.042 28.052 25.216 60.542 25.216 95.174 0 106.040-85.96 192-192 192-61.818 0-116.802-29.222-151.92-74.596 131.884-27.236 245.206-105.198 318.704-212.578v0zM407.92 885.404c-35.116 45.374-90.102 74.596-151.92 74.596-106.040 0-192-85.96-192-192 0-34.632 9.174-67.122 25.216-95.174 73.5 107.38 186.822 185.342 318.704 212.578zM512 384v256h-64v-320h256v64z" />
 
 
 
17
  <glyph unicode="&#xea0f;" glyph-name="cross" d="M1014.662 137.34c-0.004 0.004-0.008 0.008-0.012 0.010l-310.644 310.65 310.644 310.65c0.004 0.004 0.008 0.006 0.012 0.010 3.344 3.346 5.762 7.254 7.312 11.416 4.246 11.376 1.824 24.682-7.324 33.83l-146.746 146.746c-9.148 9.146-22.45 11.566-33.828 7.32-4.16-1.55-8.070-3.968-11.418-7.31 0-0.004-0.004-0.006-0.008-0.010l-310.648-310.652-310.648 310.65c-0.004 0.004-0.006 0.006-0.010 0.010-3.346 3.342-7.254 5.76-11.414 7.31-11.38 4.248-24.682 1.826-33.83-7.32l-146.748-146.748c-9.148-9.148-11.568-22.452-7.322-33.828 1.552-4.16 3.97-8.072 7.312-11.416 0.004-0.002 0.006-0.006 0.010-0.010l310.65-310.648-310.65-310.652c-0.002-0.004-0.006-0.006-0.008-0.010-3.342-3.346-5.76-7.254-7.314-11.414-4.248-11.376-1.826-24.682 7.322-33.83l146.748-146.746c9.15-9.148 22.452-11.568 33.83-7.322 4.16 1.552 8.070 3.97 11.416 7.312 0.002 0.004 0.006 0.006 0.010 0.010l310.648 310.65 310.648-310.65c0.004-0.002 0.008-0.006 0.012-0.008 3.348-3.344 7.254-5.762 11.414-7.314 11.378-4.246 24.684-1.826 33.828 7.322l146.746 146.748c9.148 9.148 11.57 22.454 7.324 33.83-1.552 4.16-3.97 8.068-7.314 11.414z" />
18
  <glyph unicode="&#xea10;" glyph-name="checkmark" d="M864 832l-480-480-224 224-160-160 384-384 640 640z" />
19
  </font></defs></svg>
3
  <svg xmlns="http://www.w3.org/2000/svg">
4
  <metadata>Generated by IcoMoon</metadata>
5
  <defs>
6
+ <font id="lp-icons" horiz-adv-x="1024">
7
  <font-face units-per-em="1024" ascent="960" descent="-64" />
8
  <missing-glyph horiz-adv-x="1024" />
9
  <glyph unicode="&#x20;" horiz-adv-x="512" d="" />
14
  <glyph unicode="&#xe92b;" glyph-name="file-zip" d="M917.806 730.924c-22.208 30.292-53.174 65.7-87.178 99.704s-69.412 64.964-99.704 87.178c-51.574 37.82-76.592 42.194-90.924 42.194h-496c-44.112 0-80-35.888-80-80v-864c0-44.112 35.884-80 80-80h736c44.112 0 80 35.888 80 80v624c0 14.332-4.372 39.35-42.194 90.924v0 0zM785.374 785.374c30.7-30.7 54.8-58.398 72.58-81.374h-153.954v153.946c22.98-17.78 50.678-41.878 81.374-72.572v0 0zM896 16c0-8.672-7.328-16-16-16h-736c-8.672 0-16 7.328-16 16v864c0 8.672 7.328 16 16 16 0 0 495.956 0.002 496 0v-224c0-17.672 14.322-32 32-32h224v-624zM256 896h128v-64h-128v64zM384 832h128v-64h-128v64zM256 768h128v-64h-128v64zM384 704h128v-64h-128v64zM256 640h128v-64h-128v64zM384 576h128v-64h-128v64zM256 512h128v-64h-128v64zM384 448h128v-64h-128v64zM256 112c0-26.4 21.6-48 48-48h160c26.4 0 48 21.6 48 48v160c0 26.4-21.6 48-48 48h-80v64h-128v-272zM448 192v-64h-128v64h128z" />
15
  <glyph unicode="&#xe92d;" glyph-name="paste" d="M704 832h-128v64c0 35.2-28.8 64-64 64h-128c-35.204 0-64-28.8-64-64v-64h-128v-128h512v128zM512 832h-128v63.886c0.034 0.038 0.072 0.078 0.114 0.114h127.768c0.042-0.036 0.082-0.076 0.118-0.114v-63.886zM832 640v160c0 17.6-14.4 32-32 32h-64v-64h32v-128h-192l-192-192v-256h-256v576h32v64h-64c-17.602 0-32-14.4-32-32v-640c0-17.6 14.398-32 32-32h288v-192h640v704h-192zM576 549.49v-101.49h-101.49l101.49 101.49zM960 0h-512v384h192v192h320v-576z" />
16
  <glyph unicode="&#xe950;" glyph-name="alarm" d="M512 832c-247.424 0-448-200.576-448-448s200.576-448 448-448 448 200.576 448 448-200.576 448-448 448zM512 24c-198.824 0-360 161.178-360 360 0 198.824 161.176 360 360 360 198.822 0 360-161.176 360-360 0-198.822-161.178-360-360-360zM934.784 672.826c16.042 28.052 25.216 60.542 25.216 95.174 0 106.040-85.96 192-192 192-61.818 0-116.802-29.222-151.92-74.596 131.884-27.236 245.206-105.198 318.704-212.578v0zM407.92 885.404c-35.116 45.374-90.102 74.596-151.92 74.596-106.040 0-192-85.96-192-192 0-34.632 9.174-67.122 25.216-95.174 73.5 107.38 186.822 185.342 318.704 212.578zM512 384v256h-64v-320h256v64z" />
17
+ <glyph unicode="&#xe97b;" glyph-name="spinner2" d="M1024 448c-1.278 66.862-15.784 133.516-42.576 194.462-26.704 61-65.462 116.258-113.042 161.92-47.552 45.696-103.944 81.82-164.984 105.652-61.004 23.924-126.596 35.352-191.398 33.966-64.81-1.282-129.332-15.374-188.334-41.356-59.048-25.896-112.542-63.47-156.734-109.576-44.224-46.082-79.16-100.708-102.186-159.798-23.114-59.062-34.128-122.52-32.746-185.27 1.286-62.76 14.964-125.148 40.134-182.206 25.088-57.1 61.476-108.828 106.11-151.548 44.61-42.754 97.472-76.504 154.614-98.72 57.118-22.304 118.446-32.902 179.142-31.526 60.708 1.29 120.962 14.554 176.076 38.914 55.15 24.282 105.116 59.48 146.366 102.644 41.282 43.14 73.844 94.236 95.254 149.43 13.034 33.458 21.88 68.4 26.542 103.798 1.246-0.072 2.498-0.12 3.762-0.12 35.346 0 64 28.652 64 64 0 1.796-0.094 3.572-0.238 5.332h0.238zM922.306 278.052c-23.472-53.202-57.484-101.4-99.178-141.18-41.67-39.81-91-71.186-144.244-91.79-53.228-20.678-110.29-30.452-166.884-29.082-56.604 1.298-112.596 13.736-163.82 36.474-51.25 22.666-97.684 55.49-135.994 95.712-38.338 40.198-68.528 87.764-88.322 139.058-19.87 51.284-29.228 106.214-27.864 160.756 1.302 54.552 13.328 108.412 35.254 157.69 21.858 49.3 53.498 93.97 92.246 130.81 38.73 36.868 84.53 65.87 133.874 84.856 49.338 19.060 102.136 28.006 154.626 26.644 52.5-1.306 104.228-12.918 151.562-34.034 47.352-21.050 90.256-51.502 125.624-88.782 35.396-37.258 63.21-81.294 81.39-128.688 18.248-47.392 26.782-98.058 25.424-148.496h0.238c-0.144-1.76-0.238-3.536-0.238-5.332 0-33.012 24.992-60.174 57.086-63.624-6.224-34.822-16.53-68.818-30.78-100.992z" />
18
+ <glyph unicode="&#xea0a;" glyph-name="plus" d="M992 576h-352v352c0 17.672-14.328 32-32 32h-192c-17.672 0-32-14.328-32-32v-352h-352c-17.672 0-32-14.328-32-32v-192c0-17.672 14.328-32 32-32h352v-352c0-17.672 14.328-32 32-32h192c17.672 0 32 14.328 32 32v352h352c17.672 0 32 14.328 32 32v192c0 17.672-14.328 32-32 32z" />
19
+ <glyph unicode="&#xea0b;" glyph-name="minus" d="M0 544v-192c0-17.672 14.328-32 32-32h960c17.672 0 32 14.328 32 32v192c0 17.672-14.328 32-32 32h-960c-17.672 0-32-14.328-32-32z" />
20
  <glyph unicode="&#xea0f;" glyph-name="cross" d="M1014.662 137.34c-0.004 0.004-0.008 0.008-0.012 0.010l-310.644 310.65 310.644 310.65c0.004 0.004 0.008 0.006 0.012 0.010 3.344 3.346 5.762 7.254 7.312 11.416 4.246 11.376 1.824 24.682-7.324 33.83l-146.746 146.746c-9.148 9.146-22.45 11.566-33.828 7.32-4.16-1.55-8.070-3.968-11.418-7.31 0-0.004-0.004-0.006-0.008-0.010l-310.648-310.652-310.648 310.65c-0.004 0.004-0.006 0.006-0.010 0.010-3.346 3.342-7.254 5.76-11.414 7.31-11.38 4.248-24.682 1.826-33.83-7.32l-146.748-146.748c-9.148-9.148-11.568-22.452-7.322-33.828 1.552-4.16 3.97-8.072 7.312-11.416 0.004-0.002 0.006-0.006 0.010-0.010l310.65-310.648-310.65-310.652c-0.002-0.004-0.006-0.006-0.008-0.010-3.342-3.346-5.76-7.254-7.314-11.414-4.248-11.376-1.826-24.682 7.322-33.83l146.748-146.746c9.15-9.148 22.452-11.568 33.83-7.322 4.16 1.552 8.070 3.97 11.416 7.312 0.002 0.004 0.006 0.006 0.010 0.010l310.648 310.65 310.648-310.65c0.004-0.002 0.008-0.006 0.012-0.008 3.348-3.344 7.254-5.762 11.414-7.314 11.378-4.246 24.684-1.826 33.828 7.322l146.746 146.748c9.148 9.148 11.57 22.454 7.324 33.83-1.552 4.16-3.97 8.068-7.314 11.414z" />
21
  <glyph unicode="&#xea10;" glyph-name="checkmark" d="M864 832l-480-480-224 224-160-160 384-384 640 640z" />
22
  </font></defs></svg>
assets/fonts/lp-icons.ttf ADDED
Binary file
assets/fonts/lp-icons.woff ADDED
Binary file
assets/images/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php // Silence is golden.
assets/images/jqueryui/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php // Silence is golden.
{inc/libraries/meta-box/img → assets/images}/jqueryui/ui-bg_flat_0_aaaaaa_40x100.png RENAMED
File without changes
{inc/libraries/meta-box/img → assets/images}/jqueryui/ui-bg_flat_75_ffffff_40x100.png RENAMED
File without changes
{inc/libraries/meta-box/img → assets/images}/jqueryui/ui-bg_glass_55_fbf9ee_1x400.png RENAMED
File without changes
{inc/libraries/meta-box/img → assets/images}/jqueryui/ui-bg_glass_65_ffffff_1x400.png RENAMED
File without changes
{inc/libraries/meta-box/img → assets/images}/jqueryui/ui-bg_glass_75_dadada_1x400.png RENAMED
File without changes
{inc/libraries/meta-box/img → assets/images}/jqueryui/ui-bg_glass_75_e6e6e6_1x400.png RENAMED
File without changes
{inc/libraries/meta-box/img → assets/images}/jqueryui/ui-bg_glass_95_fef1ec_1x400.png RENAMED
File without changes
{inc/libraries/meta-box/img → assets/images}/jqueryui/ui-bg_highlight-soft_75_cccccc_1x100.png RENAMED
File without changes
{inc/libraries/meta-box/img → assets/images}/jqueryui/ui-icons_222222_256x240.png RENAMED
File without changes
{inc/libraries/meta-box/img → assets/images}/jqueryui/ui-icons_2e83ff_256x240.png RENAMED
File without changes
{inc/libraries/meta-box/img → assets/images}/jqueryui/ui-icons_454545_256x240.png RENAMED
File without changes
{inc/libraries/meta-box/img → assets/images}/jqueryui/ui-icons_888888_256x240.png RENAMED
File without changes
{inc/libraries/meta-box/img → assets/images}/jqueryui/ui-icons_cd0a0a_256x240.png RENAMED
File without changes
assets/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php // Silence is golden.
assets/js/admin/admin.js CHANGED
@@ -21,8 +21,8 @@
21
  transient = $notice.attr('data-transient');
22
  if(context){
23
  $.ajax({
24
- url: LearnPress_Settings.ajax,
25
- data: {
26
  action: 'learnpress_dismiss_notice',
27
  context: context,
28
  transient: transient
@@ -59,7 +59,7 @@
59
  yes: action
60
  },
61
  success: function(response){
62
- response = LearnPress.parseJSON(response);
63
  if( response.url ){
64
  $.ajax({
65
  url: response.url,
@@ -124,16 +124,16 @@
124
 
125
  $('.learn-press-toggle-lesson-preview').on('change', function(){
126
  $.ajax({
127
- url: LearnPress_Settings.ajax,
128
- data: {
129
  action: 'learnpress_toggle_lesson_preview',
130
  lesson_id: this.value,
131
  previewable: this.checked ? 'yes' : 'no',
132
  nonce: $(this).attr('data-nonce')
133
  },
134
  dataType: 'text',
135
- success: function(response){
136
- response = LearnPress.parseJSON(response);
137
  }
138
  });
139
  });
@@ -145,17 +145,17 @@
145
  * Created by foobla on 3/10/2015.
146
  */
147
 
148
- if( typeof LearnPress == 'undefined' ) LearnPress = {};
149
 
150
  jQuery(document).ready(function ($) {
151
  $('.meta_box_edit').click(function (event) {
152
  event.preventDefault();
153
- LearnPress.log("haha");
154
  var post_id = jQuery(this).closest('select').val();
155
  var edit_link = jQuery('.meta_box_course_lesson_quiz').attr('site_url');
156
  edit_link += "wp-admin/post.php?post=" + post_id + "&action=edit";
157
  var new_window = window.open(edit_link);
158
- LearnPress.log(post_id);
159
  })
160
  });
161
 
@@ -475,7 +475,7 @@ lprHook.addAction('lpr_admin_quiz_question_html', _lprAdminQuestionHTML);
475
  success: function(response){
476
  if(action == 'install-now' || action == 'update-now' || action == 'active-now'){
477
  if( $link.hasClass('thimpress') ){
478
- response = LearnPress.parseJSON( response );
479
  $link.removeClass( 'spinner' );
480
  if( response.status == 'activate' ){
481
  $link.addClass('disabled').html(response.status_text).removeAttr('href').removeAttr('data-action');
@@ -499,7 +499,7 @@ lprHook.addAction('lpr_admin_quiz_question_html', _lprAdminQuestionHTML);
499
  },
500
  dataType: 'html',
501
  success: function(response){
502
- response = LearnPress.parseJSON( response );
503
  if( response.addons ){
504
  for(var slug in response.addons ){
505
  var plugin = response.addons[slug];
@@ -638,7 +638,7 @@ lprHook.addAction('lpr_admin_quiz_question_html', _lprAdminQuestionHTML);
638
 
639
  })
640
 
641
- $.extend( LearnPress, {
642
  parse_json: function(response){
643
  if( typeof reposnse == 'object' ) return response;
644
  try {
@@ -820,5 +820,65 @@ jQuery(document).ready( function($) {
820
  var switchery = new Switchery( html, { size: 'small' } );
821
  });
822
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
823
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
824
  })(jQuery);
21
  transient = $notice.attr('data-transient');
22
  if(context){
23
  $.ajax({
24
+ url : LP_Settings.ajax,
25
+ data : {
26
  action: 'learnpress_dismiss_notice',
27
  context: context,
28
  transient: transient
59
  yes: action
60
  },
61
  success: function(response){
62
+ response = LP.parseJSON(response);
63
  if( response.url ){
64
  $.ajax({
65
  url: response.url,
124
 
125
  $('.learn-press-toggle-lesson-preview').on('change', function(){
126
  $.ajax({
127
+ url : LP_Settings.ajax,
128
+ data : {
129
  action: 'learnpress_toggle_lesson_preview',
130
  lesson_id: this.value,
131
  previewable: this.checked ? 'yes' : 'no',
132
  nonce: $(this).attr('data-nonce')
133
  },
134
  dataType: 'text',
135
+ success : function(response){
136
+ response = LP.parseJSON(response);
137
  }
138
  });
139
  });
145
  * Created by foobla on 3/10/2015.
146
  */
147
 
148
+ if (typeof LP == 'undefined') LP = {};
149
 
150
  jQuery(document).ready(function ($) {
151
  $('.meta_box_edit').click(function (event) {
152
  event.preventDefault();
153
+ LP.log("haha");
154
  var post_id = jQuery(this).closest('select').val();
155
  var edit_link = jQuery('.meta_box_course_lesson_quiz').attr('site_url');
156
  edit_link += "wp-admin/post.php?post=" + post_id + "&action=edit";
157
  var new_window = window.open(edit_link);
158
+ LP.log(post_id);
159
  })
160
  });
161
 
475
  success: function(response){
476
  if(action == 'install-now' || action == 'update-now' || action == 'active-now'){
477
  if( $link.hasClass('thimpress') ){
478
+ response = LP.parseJSON(response);
479
  $link.removeClass( 'spinner' );
480
  if( response.status == 'activate' ){
481
  $link.addClass('disabled').html(response.status_text).removeAttr('href').removeAttr('data-action');
499
  },
500
  dataType: 'html',
501
  success: function(response){
502
+ response = LP.parseJSON(response);
503
  if( response.addons ){
504
  for(var slug in response.addons ){
505
  var plugin = response.addons[slug];
638
 
639
  })
640
 
641
+ $.extend(LP, {
642
  parse_json: function(response){
643
  if( typeof reposnse == 'object' ) return response;
644
  try {
820
  var switchery = new Switchery( html, { size: 'small' } );
821
  });
822
  }
823
+ if ( typeof $.fn.datepicker !== 'undefined' ) {
824
+ $('.rwmb-datetime[name$="lp_sale_start"')
825
+ .first()
826
+ .datepicker(
827
+ 'option',
828
+ 'onSelect',
829
+ function(a, b) {
830
+ var minDate = new Date(a);
831
+ $('.rwmb-datetime[name$="lp_sale_end"')
832
+ .first()
833
+ .datepicker(
834
+ 'option',
835
+ 'minDate',
836
+ minDate
837
+ );
838
+ }
839
+ );
840
+ }
841
+
842
+ if( jQuery('.rwmb-datetime[name$="lp_sale_start"]').first().length ){
843
+ jQuery('.rwmb-datetime[name$="lp_sale_start"]')
844
+ .first()
845
+ .datepicker(
846
+ 'option',
847
+ 'onSelect',
848
+ function(a, b) {
849
+ var minDate = new Date(a);
850
+ console.log(minDate);
851
+ jQuery('.rwmb-datetime[name$="lp_sale_end"')
852
+ .first()
853
+ .datepicker(
854
+ 'option',
855
+ 'minDate',
856
+ minDate
857
+ );
858
+ }
859
+ );
860
+ }
861
+
862
  });
863
+
864
+
865
+ })(jQuery);
866
+
867
+ (function($){
868
+
869
+ $( document ).on( 'click', '.wp-list-table .lp-duplicate-course', function( e ){
870
+ e.preventDefault();
871
+ var _this = $( this ),
872
+ _tr = _this.closest( 'tr' ),
873
+ _id = _tr.find('.check-column input[type="checkbox"]').val(),
874
+ _title = _tr.find( '.title strong' ).text();
875
+
876
+ _this.LP_Course_Duplicator( {
877
+ _target: _this,
878
+ course_id: _id,
879
+ course_title: _title
880
+ } );
881
+ return false;
882
+ } );
883
+
884
  })(jQuery);
assets/js/admin/course-editor.js ADDED
@@ -0,0 +1,378 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ;(function ($) {
2
+ var Course_Editor = function (args) {
3
+ this.model = new Course_Editor.Model(args);
4
+ this.view = new Course_Editor.View({model: this.model});
5
+ };
6
+
7
+ var xxx = {
8
+ time : 0,
9
+ check: function (v) {
10
+ if (v == undefined || this.time == 0) {
11
+ this.time = (new Date()).getTime();
12
+ } else {
13
+ var old = this.time;
14
+ this.time = 0;
15
+ return (new Date()).getTime() - old < v;
16
+ }
17
+ return true;
18
+ }
19
+ };
20
+
21
+ Course_Editor.View = Backbone.View.extend({
22
+ $editor : null,
23
+ el : 'body',
24
+ events : {
25
+ //'focus .item-name' : '_selectItem',
26
+ 'focus .section-name' : '_selectSection',
27
+ 'click .button-add-section' : '_addNewSection',
28
+ 'click .button-add-content' : '_showContentTypes',
29
+ 'click .section-content-types > span': '_addNewItem',
30
+ 'click .course-row-actions a' : '_rowActions'
31
+ },
32
+ initialize : function () {
33
+ this.render();
34
+ },
35
+ render : function () {
36
+ this.$editor = this.template('course-editor');
37
+ var $curriculum = this.$editor.find('#course-curriculum');
38
+ this.model.sections.forEach(function (section) {
39
+ var $section = this._createSection(section);
40
+ $curriculum.append($section);
41
+ }, this);
42
+
43
+ this.addEmptySection({}, $curriculum);
44
+
45
+ $curriculum.sortable({
46
+ axis : 'y',
47
+ handle: '.section-move'
48
+ });
49
+
50
+
51
+ $('#postbox-container-2').prepend(this.$editor);
52
+ },
53
+ _createSection : function (section, options) {
54
+ var that = this,
55
+ sectionArgs = section.toJSON(),
56
+ $section = this.template('course-section', sectionArgs),
57
+ $container = $section.find('.section-items');
58
+ options = $.extend({}, options || {})
59
+ //section.$el = $section;
60
+ section.$el = $section;
61
+ section.items.forEach(function (item) {
62
+ var $item = this._createItem(item, section);
63
+ $container.append($item);
64
+ }, this);
65
+ if (!options.addEmptyItem) {
66
+ this.addEmptyItem({section: sectionArgs}, section);
67
+ }
68
+ $container.sortable({
69
+ axis : 'y',
70
+ handle : '.section-item-move',
71
+ connectWith: '.section-items',
72
+ stop: function(e, ui){
73
+ if(!ui.item.hasClass('ui-draggable')){
74
+ return;
75
+ }
76
+ var temp_id = parseInt($(this).closest('.course-section').data('temp_id')),
77
+ args = ui.item.data(),
78
+ section = that.model.findSection({temp_id: temp_id});
79
+ var $item = that.addEmptyItem(args, section);
80
+ $item.insertBefore(ui.item);
81
+ $item.find('.item-name').focus();
82
+ ui.item.remove();
83
+ //ui.draggable.remove();
84
+ console.log('DROPPED')
85
+ }
86
+ });
87
+
88
+ $section.find('.section-content-types li').draggable({
89
+ revert : 'invalid',
90
+ connectToSortable: '.section-items',
91
+ helper : function(){
92
+
93
+ var $helper = $(this).clone();
94
+ $helper.get(0).className = 'ui-draggable ui-draggable-handle course-section-item';
95
+ return $helper[0];
96
+ },
97
+ });
98
+ $section.find('.section-items').droppable({
99
+ accept: '.dashicons',
100
+ drop : function (e, ui) {
101
+
102
+ if(!xxx.check(10)){
103
+ //return;
104
+ }
105
+
106
+
107
+ }
108
+ });
109
+
110
+ return $section;
111
+ },
112
+ _addNewItem : function (e) {
113
+ e.preventDefault();
114
+ var temp_id = parseInt($(e.target).closest('.course-section').data('temp_id')),
115
+ args = $(e.target).data(),
116
+ section = this.model.findSection({temp_id: temp_id});
117
+ var $item = this.addEmptyItem(args, section);
118
+ $item.find('.item-name').focus();
119
+ },
120
+ _createItem : function (item, section) {
121
+ var itemArgs = {},
122
+ sectionArgs = {};
123
+ if (!$.isPlainObject(item)) {
124
+ itemArgs = item.toJSON();
125
+ } else {
126
+ itemArgs = item;
127
+ }
128
+
129
+ if (!$.isPlainObject(section)) {
130
+ sectionArgs = section.toJSON();
131
+ } else {
132
+ sectionArgs = section;
133
+ }
134
+
135
+ item.set('$el', $item);
136
+
137
+ var $item = this.template('course-section-item', $.extend(itemArgs, {section: sectionArgs}));
138
+ return $item;
139
+ },
140
+ _selectItem : function (e) {
141
+
142
+ },
143
+ _selectSection : function (e) {
144
+ var $el = $(e.target);
145
+ $el.closest('.course-section').addClass('active').siblings().removeClass('active');
146
+ },
147
+ _addNewSection : function (e) {
148
+ var section = new Course_Editor.Section({});
149
+ this.model.sections.add(section);
150
+
151
+ var $section = this._createSection(section);
152
+ this.$editor.find('#course-curriculum').append($section);
153
+ $section.find('.section-name').focus();
154
+ },
155
+ _showContentTypes: function (e) {
156
+ e.preventDefault();
157
+ var that = this,
158
+ $content = $(e.target).siblings('.section-content-types');
159
+ if (!$content.is(':visible')) {
160
+ that.$('.section-content-types').not($content).slideUp();
161
+ }
162
+ $content.slideToggle();
163
+
164
+ },
165
+ _rowActions : function (e) {
166
+ e.preventDefault();
167
+ var $el = $(e.target),
168
+ action = $el.data('action'),
169
+ temp_id = parseInt($el.closest('.course-section-item').data('temp_id'));
170
+ switch (action) {
171
+ case 'quick-edit':
172
+ this.showQuickEdit(temp_id);
173
+ break;
174
+ case 'remove-item':
175
+ this.model.remove({temp_id: temp_id});
176
+ break;
177
+ case 'toggle':
178
+ $el.closest('.course-section').find('.section-body').slideToggle();
179
+ }
180
+ },
181
+ showQuickEdit : function (temp_id) {
182
+ var that = this;
183
+ //this.$('.course-section-item').removeClass('active');
184
+ var /*temp_id = parseInt($el.closest('.course-section-item').addClass('active').data('temp_id')),*/
185
+ model = this.model.findItem({temp_id: temp_id});
186
+ if (!model) {
187
+ return;
188
+ }
189
+ var $tmpl = this.template('course-item-editor', model.toJSON());
190
+ this.$('#course-item-editor .course-item-editor').remove();
191
+ $tmpl.appendTo(this.$('#course-item-editor'));
192
+
193
+ ( function (editor_id) {
194
+ var init, id, $wrap;
195
+ tinymce.execCommand('mceRemoveEditor', true, that.editor_id);
196
+ if (typeof tinymce !== 'undefined') {
197
+ init = tinyMCEPreInit.mceInit['content'];
198
+ init.selector = '#' + editor_id;
199
+ init.tabfocus_elements = init.tabfocus_elements.replace('content', editor_id);
200
+ init.body_class = init.body_class.replace('content', editor_id);
201
+ init.setup = function (ed) {
202
+ ed.on('change', function (e) {
203
+ model.set('post_content', ed.getContent());
204
+ });
205
+ }
206
+
207
+ $wrap = tinymce.$('#wp-' + editor_id + '-wrap');
208
+ tinyMCEPreInit.mceInit[editor_id] = init;
209
+
210
+ if (( $wrap.hasClass('tmce-active') || !tinyMCEPreInit.qtInit.hasOwnProperty(editor_id) ) && !init.wp_skip_init) {
211
+ tinymce.init(init);
212
+
213
+ if (!window.wpActiveEditor) {
214
+ window.wpActiveEditor = editor_id;
215
+ }
216
+ }
217
+ $wrap.css('visibility', '');
218
+ }
219
+
220
+ if (typeof quicktags !== 'undefined') {
221
+ var xxx = tinyMCEPreInit.qtInit['content'];
222
+ xxx.id = editor_id;
223
+
224
+ tinyMCEPreInit.qtInit[editor_id] = xxx;
225
+
226
+ quicktags(xxx);
227
+
228
+ if (!window.wpActiveEditor) {
229
+ window.wpActiveEditor = editor_id;
230
+ }
231
+ }
232
+ ///tinymce.execCommand('mceAddEditor', true, editor_id);
233
+ QTags._buttonsInit();
234
+ that.editor_id = editor_id;
235
+ }('course-item-content-' + temp_id));
236
+ },
237
+ addEmptySection : function (args, $curriculum) {
238
+ // add empty section
239
+ var section = new Course_Editor.Section(args);
240
+ this.model.sections.add(section);
241
+
242
+ var $section = this._createSection(section);
243
+ if ($curriculum) {
244
+ $curriculum.append($section);
245
+ }
246
+ return $section;
247
+ },
248
+ addEmptyItem : function (args, section) {
249
+ // add empty section
250
+ var item = new Backbone.Model(args);
251
+ section.items.add(item);
252
+ var $item = this.template('course-section-item', $.extend(item.toJSON()));
253
+ if (section.$el) {
254
+ section.$el.find('.section-items').append($item);
255
+ }
256
+ item.set('$el', $item);
257
+ return $item;
258
+ },
259
+ template : function (id, args) {
260
+ return $(wp.template(id)(args));
261
+ }
262
+ });
263
+
264
+ Course_Editor.Model = Backbone.Model.extend({
265
+ sections : null,
266
+ rawArgs : null,
267
+ initialize : function (args) {
268
+ this.rawArgs = args;
269
+ this.initSections();
270
+ },
271
+ initSections : function () {
272
+ this.sections = new Course_Editor.Sections();
273
+ _.forEach(this.rawArgs.sections, function (section) {
274
+ this.sections.add(new Course_Editor.Section(section))
275
+ }, this);
276
+ },
277
+ findItemWhere: function (atts) {
278
+ var items = [];
279
+ this.sections.forEach(function (section) {
280
+ var find = section.items.findWhere(atts);
281
+ if (find) {
282
+ _.union(items, find);
283
+ }
284
+ });
285
+ return items;
286
+ },
287
+ findItem : function (atts) {
288
+ var item = undefined;
289
+ this.sections.forEach(function (section) {
290
+ if (item) {
291
+ return true;
292
+ }
293
+ item = section.items.find(atts);
294
+
295
+ });
296
+ return item;
297
+ },
298
+ findSection : function (atts) {
299
+ return this.sections.find(atts);
300
+ },
301
+ remove : function (atts) {
302
+ var section = this.findSection(atts);
303
+ if (section) {
304
+ this.sections.remove(section);
305
+ } else {
306
+ //var items = this.findItem(atts);
307
+ this.sections.forEach(function (section) {
308
+ var item = section.items.find(atts);
309
+ if (item) {
310
+ section.items.remove(item);
311
+ }
312
+ })
313
+ }
314
+ }
315
+ });
316
+
317
+ Course_Editor.Section = Backbone.Model.extend({
318
+ items : null,
319
+ initialize: function (args) {
320
+ this.items = new Course_Editor.Items();
321
+ _.forEach(args.items, function (v) {
322
+ this.items.add(v);
323
+ }, this);
324
+ },
325
+ toJSON : function () {
326
+ var keys = ['section_id', 'section_name', 'section_course_id', 'section_order', 'section_description', 'temp_id'],
327
+ json = {};
328
+ _.forEach(keys, function (key) {
329
+ json[key] = this.get(key);
330
+ }, this);
331
+ return json;
332
+ }
333
+ });
334
+
335
+ Course_Editor.Sections = Backbone.Collection.extend({
336
+ temp_id : 1,
337
+ model : function (args, b) {
338
+ return new Course_Editor.Section(args);
339
+ },
340
+ initialize: function (args) {
341
+ _.bindAll(this, 'incTempId');
342
+ this.on('add', this.incTempId);
343
+ this.on('remove', function (a, b) {
344
+ console.log('remove section: ', a, b)
345
+ })
346
+ /*_.forEach(args, function(v, k){
347
+ this.sections.add(v);
348
+ }, this);*/
349
+ },
350
+ incTempId : function (model) {
351
+ model.set('temp_id', Course_Editor.temp_id);
352
+ Course_Editor.temp_id++;
353
+ }
354
+ });
355
+
356
+ Course_Editor.Items = Backbone.Collection.extend({
357
+ temp_id : 1,
358
+ initialize: function (args) {
359
+ _.bindAll(this, 'incTempId');
360
+ this.on('add', this.incTempId);
361
+ this.on('remove', function (a, b) {
362
+ console.log(a, a.get('$el'))
363
+ if (a.get('$el')) {
364
+ a.get('$el').remove();
365
+ }
366
+ })
367
+ },
368
+ incTempId : function (model) {
369
+ model.set('temp_id', Course_Editor.temp_id);
370
+ Course_Editor.temp_id++;
371
+ }
372
+ });
373
+
374
+ Course_Editor.temp_id = 1;
375
+ $(document).ready(function () {
376
+ new Course_Editor(Course_Settings);
377
+ });
378
+ })(jQuery);
assets/js/admin/duplicate-course.js ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ;
2
+ ( function ( $, _, Backbone ) {
3
+
4
+ var LP_Course_Duplicator = window.LP_Course_Duplicator = Backbone.View.extend( {
5
+ el: 'learn-press-duplicate-course',
6
+ tagName: 'div',
7
+ template: null,
8
+ course_id: null,
9
+ course_title: null,
10
+ _target: null,
11
+ events: {
12
+ 'click .lp-duplicate-course' : '_duplicate',
13
+ },
14
+ initialize: function ( data ) {
15
+ _.bindAll( this, 'render' );
16
+ this.course_id = data.course_id;
17
+ this.course_title = data.course_title;
18
+ this._target = data._target;
19
+
20
+ this.render();
21
+ },
22
+
23
+ /**
24
+ * Render html template
25
+ *
26
+ * @returns html
27
+ */
28
+ render: function() {
29
+ var _this = this;
30
+ this.template = wp.template( 'learn-press-duplicate-course' )({
31
+ title: _this.course_title,
32
+ id: _this.course_id
33
+ });
34
+ LP.MessageBox.show( this.template );
35
+ //// This line to set $el of this view to MessageBox inorder to makes events work
36
+ this.setElement($('#learn-press-message-box-window'));
37
+ this.delegateEvents();
38
+ $( '.learn-press-tooltip' ).tooltip({offset: [50, -30]});
39
+ },
40
+
41
+ /**
42
+ * Event Click Duplicate course
43
+ * @returns mixed
44
+ */
45
+ _duplicate: function( e ) {
46
+ e.preventDefault();
47
+ var _this = $( e.currentTarget ),
48
+ nonce = _this.attr( 'data-nonce' ),
49
+ id = _this.attr( 'data-id' ),
50
+ text = _this.text(),
51
+ processing = _this.attr( 'data-text' ),
52
+ _class = _this.attr( 'class' ),
53
+ data = {
54
+ course_id: id,
55
+ _nonce: nonce,
56
+ action: 'learnpress_duplicate_course'
57
+ },
58
+ buttons = _this.parents( '#learn-press-duplicate-course' ).find( 'button' );
59
+ data.content = _this.hasClass( 'all-content' ) ? 1 : 0;
60
+ $.ajax({
61
+ url: ajaxurl,
62
+ type: 'POST',
63
+ data: data,
64
+ dataType: 'json',
65
+ beforeSend: function() {
66
+ _this.text( processing );
67
+ _this.attr( 'data-text', processing );
68
+ buttons.attr( 'disabled', true );
69
+ }
70
+ }).done(function( res ){
71
+ if ( typeof res.redirect !== 'undefined' ) {
72
+ window.location.href = res.redirect;
73
+ }
74
+ });
75
+ return false;
76
+ }
77
+
78
+ } );
79
+
80
+ $.fn.LP_Course_Duplicator = function ( args ) {
81
+ args = $.extend( {}, {
82
+ _target: null,
83
+ course_id: null,
84
+ course_title: null
85
+ }, args );
86
+ return new LP_Course_Duplicator( args );
87
+ };
88
+
89
+ } )( jQuery, _, Backbone );
assets/js/admin/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php // Silence is golden.
assets/js/admin/meta-box-course.js CHANGED
@@ -1,7 +1,7 @@
1
  ;
2
  (function ($) {
3
- if (typeof LearnPress == 'undefined') {
4
- LearnPress = {};
5
  }
6
  $(document).ready(function () {
7
  if (typeof Backbone == 'undefined') return;
@@ -58,10 +58,13 @@
58
  this.render();
59
  _.bindAll(this, 'render', 'searchItem', 'addItemsToSection', 'addItemToSection', 'addNewItem', 'toggleAddItemButtonState', 'getSelectedItems', '_sectionActionHandler', '_changeItemType', '_updateItem');
60
  this.initPage();
61
- LearnPress.Hook.addAction('learn_press_message_box_before_resize', this.resetModalSearch)
62
- LearnPress.Hook.addAction('learn_press_message_box_resize', this.updateModalSearch);
63
  $(document).on('learn_press_modal_search_items_response', this.addItemsToSection);
64
- LearnPress.Hook.addFilter('learn_press_modal_search_items_exclude', this.getSelectedItems);
 
 
 
65
  },
66
  _focusItem : function (e) {
67
  $(e.target).closest('tr').removeClass('focus');
@@ -85,23 +88,31 @@
85
  $row.attr({
86
  'data-type': type
87
  }).find('.lp-item-type').val(type);
88
- $icon.addClass('item-selected').parent().siblings().find('span').removeClass('item-selected');
89
- var pos = $icon.parent().position(),
 
 
 
 
90
  $rep = $icon.closest('.learn-press-dropdown-item-types').find('>span'),
91
- $i = $icon.clone().removeAttr('title').insertAfter($icon).css({
92
  position: 'absolute',
93
- top : pos.top + 2,
94
- left : pos.left + 2,
95
- zIndex : 20
96
  }).animate({
97
- left: -32
98
  });
 
 
 
99
  $rep.fadeOut(function () {
100
- $i.css({position: '', top: '', left: '', zIndex: ''});
101
- $(this).replaceWith($i);
 
 
102
  $row.removeClass('focus');
103
  });
104
- //$icon.closest('.learn-press-dropdown-item-types').find('>span').replaceWith();
105
  },
106
  _updateItem : function (e) {
107
  var $inp = $(e.target),
@@ -111,7 +122,7 @@
111
  $('.lp-modal-search ul').css('height', height - 120).css('overflow', 'auto');
112
  },
113
  resetModalSearch : function ($app) {
114
- $('.lp-modal-search ul').css('height', '').css('overflow', '')
115
  },
116
  initPage : function () {
117
  var that = this;
@@ -120,7 +131,7 @@
120
  if ($(e.target).hasClass('no-submit')) {
121
  return false;
122
  }
123
- return this.onSave()
124
  }, this));
125
  $('input[name="_lp_course_result"]').bind('click change', function () {
126
  return;
@@ -136,9 +147,43 @@
136
  var toggle = this.value != 'yes';
137
  $('.lp-course-price-field').toggleClass('hide-if-js', toggle).attr('xxx', Math.random());
138
  $('.lp-course-required-enroll').toggleClass('hide-if-js', !toggle);
 
 
 
 
 
 
 
 
 
 
139
  })
140
  $chkPayment.filter(':checked').trigger('change');
141
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
142
  if ($('input[name="_lp_course_result"]:checked').length == 0) {
143
  $('input[name="_lp_course_result"]').filter(function () {
144
  return this.value == 'evaluate_lesson';
@@ -165,7 +210,7 @@
165
  if (that.isShowing != 'searchQuizForm') {
166
  $item.removeClass('hover');
167
  }
168
- if (($e.val() + '').length == 0) {
169
  if ($item.hasClass('lp-item-new')) {
170
  ///$item.remove();
171
  } else {
@@ -187,6 +232,10 @@
187
  $(ui.item).removeClass('lp-sorting');
188
  }
189
  });
 
 
 
 
190
  this.$('.lp-curriculum-sections .lp-section-items').sortable({
191
  axis : 'y',
192
  items : 'li:not(.lp-item-empty)',
@@ -244,9 +293,9 @@
244
  } else {
245
  $checkAll = $checkbox.closest('.curriculum-section-content').find('input.lp-check-all-items')
246
  }
247
- (len = $all.filter(function () {
248
  return this.checked
249
- }).length)
250
  ? (
251
  $checkbox.closest('.curriculum-section-content')
252
  .find('.item-bulk-actions button')
@@ -285,7 +334,7 @@
285
  this.removeItem($items, true, function () {
286
  $button.closest('.item-bulk-actions').find('button').map(function () {
287
  var $b = $(this).html($(this).attr('data-title'));
288
- ($.inArray($b.attr('data-action'), ['cancel', 'delete']) != -1) && $b.hide();
289
  });
290
  }, $button);
291
  break;
@@ -320,7 +369,7 @@
320
  .attr('data-type', to)
321
  .find('.lp-item-type', to);
322
  }
323
- LearnPress.Hook.doAction('learn_press_change_section_item_type', from, to);
324
  },
325
  getPrevInput : function ($input) {
326
  var $inputs = this.$('input.no-submit:visible'),
@@ -337,7 +386,7 @@
337
  preventSubmit : function (e) {
338
  var $input = $(e.target);
339
  if ($input.hasClass('no-submit')) {
340
- if (($input.val() + '').length >= 2) {
341
  $input.closest('.lp-item-empty').removeClass('lp-item-empty');
342
  $input.closest('.lp-empty-section').removeClass('lp-empty-section');
343
  } else {
@@ -368,13 +417,13 @@
368
  if ($target.hasClass('disabled')) {
369
  return;
370
  }
371
- if (($input.val() + '').length == 0) {
372
  alert('Please enter item name');
373
  $input.focus();
374
  return;
375
  }
376
  $.ajax({
377
- url : LearnPress_Settings.ajax,
378
  data : {
379
  action: 'learnpress_add_new_item',
380
  name : $input.val(),
@@ -383,7 +432,7 @@
383
  type : 'post',
384
  dataType: 'html',
385
  success : function (response) {
386
- var json = LearnPress.parseJSON(response);
387
  if (json.post && json.post.ID) {
388
  $item = that.createItem({
389
  id : json.post.ID,
@@ -406,9 +455,9 @@
406
  $section = $item.length ? $item.closest('.curriculum-section') : $input.closest('.curriculum-section'),
407
  value = $input.val(),
408
  textLen = value.length,
409
- type = $input.data('field');
 
410
  if ($input.attr('name') == 'lp-new-item-name') {
411
- LearnPress.log(textLen)
412
  if (textLen > 0) {
413
  $input.siblings('.lp-button-add-item').removeClass('disabled');
414
  } else {
@@ -418,9 +467,22 @@
418
  switch (e.keyCode) {
419
  case 13:
420
  if ($input.attr('name') == 'lp-new-item-name') {
421
- $input.siblings('.lp-button-add-item').trigger('click')
422
  return;
423
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
424
  case 40:
425
  var $next = this.getNextInput($input);
426
  $next.focus();
@@ -463,7 +525,6 @@
463
 
464
  if ($nextSection.length == 0 && textLen >= 1) {
465
  var $emptySection = this.createSection();
466
-
467
  }
468
  } else if (type == 'item-name') {
469
  var $nextItem = $item.next();
@@ -473,7 +534,7 @@
473
  $emptyItem.insertAfter($last);
474
  }
475
  }
476
-
477
  }
478
 
479
  },
@@ -496,7 +557,7 @@
496
 
497
  var tmpl = wp.template('section-item'),
498
  $item = $(tmpl(args || {}));
499
- $item = LearnPress.Hook.applyFilters('learn_press_create_new_item', $item, $section);
500
  return $item;
501
  },
502
  needCreateNewSection : function () {
@@ -507,9 +568,9 @@
507
  $section = $button.closest('.lp-curriculum-section');
508
  $section.find('.lp-curriculum-section-content').stop().slideToggle(function () {
509
  if ($(this).is(':visible')) {
510
- $(this).parent().addClass('open')
511
  } else {
512
- $(this).parent().removeClass('open')
513
  }
514
  });
515
  },
@@ -524,21 +585,22 @@
524
  },
525
  getSelectedItems : function () {
526
  return this.$('.lp-section-item[data-item_id]').map(function () {
527
- return ($(this).attr('data-item_id'))
528
  }).filter(function (i, c) {
529
- return c > 0
530
  }).get();
531
  },
532
- showFormItems : function (type, action, $button) {
533
- var $form = LearnPress.ModalSearchItems({
534
  template : 'tmpl-learn-press-search-items',
535
  type : type,
536
  section : $button.closest('.curriculum-section'),
537
  context : 'course-items',
538
  context_id: $('#post_ID').val(),
539
- exclude : this.getSelectedItems()
 
540
  });
541
- LearnPress.MessageBox.show($form.$el);
542
  $form.$el.find('header input').focus();
543
 
544
  },
@@ -547,14 +609,15 @@
547
  $button = $(e.target),
548
  action = $button.data('action'),
549
  type = $button.data('type'),
 
550
  $form = null;
551
  switch (action) {
552
  case 'add-lp_quiz':
553
  case 'add-lp_lesson':
554
- this.showFormItems(type, action, $button);
555
  break;
556
  default:
557
- LearnPress.Hook.doAction('learn_press_section_button_click', $button, action, this);
558
  }
559
  },
560
  searchItem : function (e) {
@@ -566,7 +629,6 @@
566
  return a.length
567
  }).join('|'), "ig"),
568
  found = 0;
569
- LearnPress.log(text)
570
  found = $lis.filter(function () {
571
  var $el = $(this),
572
  itemText = $el.data('text') + '',
@@ -590,7 +652,7 @@
590
  selected = $items, //$form.find('li:visible input:checked'),
591
  $section = $view.options.section;
592
  selected.each(function () {
593
- var $li = $(this),//.closest('li').addClass('selected'),
594
  args = $li.dataToJSON(),
595
  $item = that.createItem(args, $section);
596
  if ($item) {
@@ -610,12 +672,12 @@
610
  $item.removeClass('focus').find('.learn-press-dropdown-item-types ul').remove();
611
  }
612
  this.model.addItem(parseInt($item.attr('data-id')));
613
- LearnPress.Hook.doAction('learn_press_add_item_to_section', $item, $section);
614
  },
615
  addNewItem : function (e) {
616
  var $form = $(e.target).closest('.lp-modal-search');
617
  $.ajax({
618
- url : LearnPress_Settings.ajax,
619
  data : {
620
  action: 'learnpress_quick_add_item',
621
  name : $form.find('input[name="lp-item-name"]').val(),
@@ -624,7 +686,7 @@
624
  type : 'post',
625
  dataType: 'html',
626
  success : function (response) {
627
- var json = LearnPress.parseJSON(response);
628
  if (json.html) {
629
  var $item = $(json.html)
630
  $form.find('ul').append($item);
@@ -633,6 +695,13 @@
633
  }
634
  });
635
  },
 
 
 
 
 
 
 
636
  toggleAddItemButtonState: function (e) {
637
  var $form = $(e.target).closest('.lp-modal-search'),
638
  selected = $form.find('li input:checked'),
@@ -735,6 +804,7 @@
735
  caretPos = $target.attr('type') == 'text' ? $target.caret() : false,
736
  caretLen = text.length,
737
  that = this;
 
738
  if (field == 'item-name') {
739
  var $item = $target.closest('.lp-section-item');
740
  if (text.match(/\\q\?/i) || this.isShowing == 'searchQuizForm') {
@@ -817,11 +887,12 @@
817
  that.appendSectionItem($item);
818
  }
819
  }
 
820
  }
821
  if (lastCode == keyCode && text.length == 0) {
822
  var keyRepeat = $target.data('keyRepeat');
823
  if (!keyRepeat) {
824
- keyCode = 1
825
  }
826
  $target.data('keyRepeat', keyRepeat + 1);
827
  } else {
@@ -936,7 +1007,7 @@
936
  $item.removeClass('.lp-item-lp_lesson lp-item-empty lp-item-new').addClass('lp-item-' + type).attr({
937
  'data-type': type,
938
  'data-id' : id
939
- })
940
  } else {
941
  $(e.target).val($(e.target).val().replace(/\\q\?[\s]*/ig, ''));
942
  }
@@ -952,14 +1023,14 @@
952
  },
953
  _getNextSection : function ($section, loop) {
954
  var $nextSection = $section.next();
955
- if ($nextSection.length == 0 && ((typeof loop == 'undefined') || (loop == true))) {
956
  $nextSection = $section.parent().children().first();
957
  }
958
  return $nextSection;
959
  },
960
  _getPrevSection : function ($section, loop) {
961
  var $prevSection = $section.prev();
962
- if ($prevSection.length == 0 && ((typeof loop == 'undefined') || (loop == true))) {
963
  $prevSection = $section.parent().children().last();
964
  }
965
  return $prevSection;
@@ -984,7 +1055,7 @@
984
  return $(this).find('.lp-item-name').val()
985
  }).get().join('</p><p>+&nbsp;');
986
 
987
- LearnPress.MessageBox.quickConfirm(target, {
988
  onOk : function (a) {
989
  var ids = [];
990
  a.items && a.items.each(function () {
@@ -1011,7 +1082,7 @@
1011
  .find('.item-bulk-actions button')
1012
  .map(function () {
1013
  var $b = $(this);
1014
- ($.inArray($b.attr('data-action'), ['cancel', 'delete']) != -1) && $b.hide();
1015
  if ($b.attr('data-action') == 'delete') $b.html($b.attr('data-title'))
1016
  });
1017
  },
@@ -1024,13 +1095,12 @@
1024
  },
1025
  removeItemDB : function (id) {
1026
  $.ajax({
1027
- url : LearnPress_Settings.ajax,
1028
  data : {
1029
  action: 'learnpress_remove_course_items',
1030
  id : id
1031
  },
1032
  success: function (response) {
1033
- LearnPress.log(response)
1034
  }
1035
  });
1036
  },
@@ -1076,12 +1146,12 @@
1076
  });
1077
  break;
1078
  case 'remove':
1079
- LearnPress.MessageBox.quickConfirm($button, {
1080
  onOk: function (a) {
1081
  var $section = $(a);
1082
 
1083
  $.ajax({
1084
- url : LearnPress_Settings.ajax,
1085
  data : {
1086
  action: 'learnpress_remove_course_section',
1087
  id : $section.attr('data-id')
@@ -1094,7 +1164,7 @@
1094
  data: $button.closest('.curriculum-section')
1095
  });
1096
  break;
1097
- LearnPress.MessageBox.show('Do you want to remove this section?', {
1098
  buttons: 'yesNo',
1099
  data : $button.closest('.curriculum-section'),
1100
  events : {
@@ -1102,7 +1172,7 @@
1102
  var $section = $(args.data);
1103
 
1104
  $.ajax({
1105
- url : LearnPress_Settings.ajax,
1106
  data : {
1107
  action: 'learnpress_remove_course_section',
1108
  id : $section.attr('data-id')
@@ -1121,11 +1191,13 @@
1121
  }
1122
  }
1123
  });
1124
- var model = new LP_Curriculum_Model(LP_Curriculum_Settings),
1125
- view = new LP_Curriculum_View(model);
 
1126
 
1127
- LearnPress.$LP_Curriculum_Model = model;
1128
- LearnPress.$LP_Curriculum_View = view;
 
1129
  });
1130
 
1131
  function updateHiddenCurriculum(hidden) {
@@ -1151,7 +1223,7 @@
1151
  }
1152
 
1153
  $.ajax({
1154
- url : LearnPress_Settings.ajax,
1155
  data : {
1156
  action : 'learnpress_update_curriculum_section_state',
1157
  course_id: $('#post_ID').val(),
@@ -1245,7 +1317,7 @@
1245
  }
1246
  ;
1247
  $.ajax({
1248
- url : LearnPress_Settings.ajax,
1249
  type : 'post',
1250
  data : {
1251
  action : 'learnpress_update_editor_hidden',
@@ -1280,6 +1352,7 @@
1280
  // Set helper cell sizes to match the original sizes
1281
  $(this).width($originals.eq(index).width());
1282
  });
 
1283
 
1284
  $(tr).parent().append($helper);
1285
 
@@ -1298,14 +1371,9 @@
1298
  ui.placeholder.html('<td colspan="' + cellCount + '">&nbsp;</td>');
1299
  },
1300
  sort : function (e, ui) {
1301
- LearnPress.log(ui.helper.html())
1302
  },
1303
  stop : function (e, ui) {
1304
  var $emptyItem = ui.item.parent().find('.lp-item-empty:last');
1305
- LearnPress.log('empty:')
1306
- LearnPress.log($emptyItem.get(0))
1307
- LearnPress.log('next:')
1308
- LearnPress.log($emptyItem.next().get(0))
1309
  if ($emptyItem.next().is(ui.item.get(0))) {
1310
  $emptyItem.insertAfter(ui.item);
1311
  }
@@ -1314,7 +1382,7 @@
1314
  }
1315
 
1316
  function _ready() {
1317
- $('#learn-press-button-toggle-editor').off('click _click').on('click _click', _toggleEditorHandler).trigger('_click');
1318
 
1319
  _makeListSortable();
1320
  }
1
  ;
2
  (function ($) {
3
+ if (typeof LP == 'undefined') {
4
+ LP = {};
5
  }
6
  $(document).ready(function () {
7
  if (typeof Backbone == 'undefined') return;
58
  this.render();
59
  _.bindAll(this, 'render', 'searchItem', 'addItemsToSection', 'addItemToSection', 'addNewItem', 'toggleAddItemButtonState', 'getSelectedItems', '_sectionActionHandler', '_changeItemType', '_updateItem');
60
  this.initPage();
61
+ LP.Hook.addAction('learn_press_message_box_before_resize', this.resetModalSearch);
62
+ LP.Hook.addAction('learn_press_message_box_resize', this.updateModalSearch);
63
  $(document).on('learn_press_modal_search_items_response', this.addItemsToSection);
64
+ LP.Hook.addFilter('learn_press_modal_search_items_exclude', this.getSelectedItems);
65
+ LP.Hook.addFilter('learn_press_create_new_item', this.newItemFilter);
66
+ $('#course_curriculum.postbox').removeClass('closed');
67
+
68
  },
69
  _focusItem : function (e) {
70
  $(e.target).closest('tr').removeClass('focus');
88
  $row.attr({
89
  'data-type': type
90
  }).find('.lp-item-type').val(type);
91
+
92
+ if ( $icon.addClass('item-selected').parent().siblings().length > 0 ) {
93
+ $icon.addClass('item-selected').parent().hide().siblings().show().find('span').removeClass('item-selected');
94
+ }
95
+ var iconIindex = $icon.parent().index();
96
+ var pos = ( iconIindex === 0 ) ? 1 : iconIindex,
97
  $rep = $icon.closest('.learn-press-dropdown-item-types').find('>span'),
98
+ $i = $icon.clone().show().removeAttr('title').insertAfter($icon).css({
99
  position: 'absolute',
100
+ top : 0,
101
+ left : 32 * ( pos ),
102
+ zIndex : 40
103
  }).animate({
104
+ left: 0
105
  });
106
+
107
+ $rep.parent().prepend($i);
108
+
109
  $rep.fadeOut(function () {
110
+ var $ic = $i.clone();
111
+ $i.remove();
112
+ $ic.css({position: '', display: '', top: '', left: '', zIndex: ''});
113
+ $(this).replaceWith($ic);
114
  $row.removeClass('focus');
115
  });
 
116
  },
117
  _updateItem : function (e) {
118
  var $inp = $(e.target),
122
  $('.lp-modal-search ul').css('height', height - 120).css('overflow', 'auto');
123
  },
124
  resetModalSearch : function ($app) {
125
+ $('.lp-modal-search ul').css('height', '').css('overflow', '');
126
  },
127
  initPage : function () {
128
  var that = this;
131
  if ($(e.target).hasClass('no-submit')) {
132
  return false;
133
  }
134
+ return this.onSave();
135
  }, this));
136
  $('input[name="_lp_course_result"]').bind('click change', function () {
137
  return;
147
  var toggle = this.value != 'yes';
148
  $('.lp-course-price-field').toggleClass('hide-if-js', toggle).attr('xxx', Math.random());
149
  $('.lp-course-required-enroll').toggleClass('hide-if-js', !toggle);
150
+ if(toggle){
151
+ $('.lp-course-sale_start-field').hide();
152
+ $('.lp-course-sale_end-field').hide();
153
+ }else{
154
+ if( $('input[name="_lp_sale_start"]').val()!='' ){
155
+ $('.lp-course-sale_start-field').show();
156
+ $('.lp-course-sale_end-field').show();
157
+ $('#_lp_sale_price_schedule').hide();
158
+ }
159
+ }
160
  })
161
  $chkPayment.filter(':checked').trigger('change');
162
+
163
+ // add schedule button
164
+ if( $('input[name="_lp_sale_start"]').val()!='' ){
165
+ $('.lp-course-sale_start-field').show();
166
+ $('.lp-course-sale_end-field').show();
167
+ $('#_lp_sale_price_schedule').hide();
168
+ }
169
+ $('#_lp_sale_price_schedule').on('click', function(event){
170
+ event.preventDefault();
171
+ $('.lp-course-sale_start-field').show();
172
+ $('.lp-course-sale_end-field').show();
173
+ $(this).hide();
174
+ });
175
+ $('#_lp_sale_price_schedule_cancel').on('click', function(event){
176
+ event.preventDefault();
177
+ $('.lp-course-sale_start-field').hide();
178
+ $('.lp-course-sale_end-field').hide();
179
+ $('input[name="_lp_sale_start"]').val('');
180
+ $('input[name="_lp_sale_end"]').val('');
181
+ $('#_lp_sale_price_schedule').show();
182
+ });
183
+
184
+
185
+
186
+
187
  if ($('input[name="_lp_course_result"]:checked').length == 0) {
188
  $('input[name="_lp_course_result"]').filter(function () {
189
  return this.value == 'evaluate_lesson';
210
  if (that.isShowing != 'searchQuizForm') {
211
  $item.removeClass('hover');
212
  }
213
+ if (( $e.val() + '' ).length == 0) {
214
  if ($item.hasClass('lp-item-new')) {
215
  ///$item.remove();
216
  } else {
232
  $(ui.item).removeClass('lp-sorting');
233
  }
234
  });
235
+ this.$el
236
+ .find('.section-item-icon .learn-press-dropdown-item-types ul .item-selected')
237
+ .parent()
238
+ .hide();
239
  this.$('.lp-curriculum-sections .lp-section-items').sortable({
240
  axis : 'y',
241
  items : 'li:not(.lp-item-empty)',
293
  } else {
294
  $checkAll = $checkbox.closest('.curriculum-section-content').find('input.lp-check-all-items')
295
  }
296
+ ( len = $all.filter(function () {
297
  return this.checked
298
+ }).length )
299
  ? (
300
  $checkbox.closest('.curriculum-section-content')
301
  .find('.item-bulk-actions button')
334
  this.removeItem($items, true, function () {
335
  $button.closest('.item-bulk-actions').find('button').map(function () {
336
  var $b = $(this).html($(this).attr('data-title'));
337
+ ( $.inArray($b.attr('data-action'), ['cancel', 'delete']) != -1 ) && $b.hide();
338
  });
339
  }, $button);
340
  break;
369
  .attr('data-type', to)
370
  .find('.lp-item-type', to);
371
  }
372
+ LP.Hook.doAction('learn_press_change_section_item_type', from, to);
373
  },
374
  getPrevInput : function ($input) {
375
  var $inputs = this.$('input.no-submit:visible'),
386
  preventSubmit : function (e) {
387
  var $input = $(e.target);
388
  if ($input.hasClass('no-submit')) {
389
+ if (( $input.val() + '' ).length >= 2) {
390
  $input.closest('.lp-item-empty').removeClass('lp-item-empty');
391
  $input.closest('.lp-empty-section').removeClass('lp-empty-section');
392
  } else {
417
  if ($target.hasClass('disabled')) {
418
  return;
419
  }
420
+ if (( $input.val() + '' ).length == 0) {
421
  alert('Please enter item name');
422
  $input.focus();
423
  return;
424
  }
425
  $.ajax({
426
+ url : LP_Settings.ajax,
427
  data : {
428
  action: 'learnpress_add_new_item',
429
  name : $input.val(),
432
  type : 'post',
433
  dataType: 'html',
434
  success : function (response) {
435
+ var json = LP.parseJSON(response);
436
  if (json.post && json.post.ID) {
437
  $item = that.createItem({
438
  id : json.post.ID,
455
  $section = $item.length ? $item.closest('.curriculum-section') : $input.closest('.curriculum-section'),
456
  value = $input.val(),
457
  textLen = value.length,
458
+ type = $input.data('field'),
459
+ that = this;
460
  if ($input.attr('name') == 'lp-new-item-name') {
 
461
  if (textLen > 0) {
462
  $input.siblings('.lp-button-add-item').removeClass('disabled');
463
  } else {
467
  switch (e.keyCode) {
468
  case 13:
469
  if ($input.attr('name') == 'lp-new-item-name') {
470
+ $input.siblings('.lp-button-add-item').trigger('click');
471
  return;
472
  }
473
+ // allow add cource item without name/title
474
+ if ($input.data('field') == 'section-name') {
475
+ var total_item = $('.curriculum-section').length;
476
+
477
+ if ($section.hasClass('lp-empty-section')) {
478
+ var $emptySection = this.createSection();
479
+ that.appendSection($section);
480
+ $section.removeClass('lp-empty-section');
481
+ }
482
+ }
483
+ var $next = this.getNextInput($input);
484
+ $next.focus();
485
+ break;
486
  case 40:
487
  var $next = this.getNextInput($input);
488
  $next.focus();
525
 
526
  if ($nextSection.length == 0 && textLen >= 1) {
527
  var $emptySection = this.createSection();
 
528
  }
529
  } else if (type == 'item-name') {
530
  var $nextItem = $item.next();
534
  $emptyItem.insertAfter($last);
535
  }
536
  }
537
+ break;
538
  }
539
 
540
  },
557
 
558
  var tmpl = wp.template('section-item'),
559
  $item = $(tmpl(args || {}));
560
+ $item = LP.Hook.applyFilters('learn_press_create_new_item', $item, $section);
561
  return $item;
562
  },
563
  needCreateNewSection : function () {
568
  $section = $button.closest('.lp-curriculum-section');
569
  $section.find('.lp-curriculum-section-content').stop().slideToggle(function () {
570
  if ($(this).is(':visible')) {
571
+ $(this).parent().addClass('open');
572
  } else {
573
+ $(this).parent().removeClass('open');
574
  }
575
  });
576
  },
585
  },
586
  getSelectedItems : function () {
587
  return this.$('.lp-section-item[data-item_id]').map(function () {
588
+ return ( $(this).attr('data-item_id') );
589
  }).filter(function (i, c) {
590
+ return c > 0;
591
  }).get();
592
  },
593
+ showFormItems : function (type, action, $button, notices) {
594
+ var $form = LP.ModalSearchItems({
595
  template : 'tmpl-learn-press-search-items',
596
  type : type,
597
  section : $button.closest('.curriculum-section'),
598
  context : 'course-items',
599
  context_id: $('#post_ID').val(),
600
+ exclude : this.getSelectedItems(),
601
+ notices : notices
602
  });
603
+ LP.MessageBox.show($form.$el);
604
  $form.$el.find('header input').focus();
605
 
606
  },
609
  $button = $(e.target),
610
  action = $button.data('action'),
611
  type = $button.data('type'),
612
+ notices = $button.data('notices'),
613
  $form = null;
614
  switch (action) {
615
  case 'add-lp_quiz':
616
  case 'add-lp_lesson':
617
+ this.showFormItems(type, action, $button, notices);
618
  break;
619
  default:
620
+ LP.Hook.doAction('learn_press_section_button_click', $button, action, this);
621
  }
622
  },
623
  searchItem : function (e) {
629
  return a.length
630
  }).join('|'), "ig"),
631
  found = 0;
 
632
  found = $lis.filter(function () {
633
  var $el = $(this),
634
  itemText = $el.data('text') + '',
652
  selected = $items, //$form.find('li:visible input:checked'),
653
  $section = $view.options.section;
654
  selected.each(function () {
655
+ var $li = $(this), //.closest('li').addClass('selected'),
656
  args = $li.dataToJSON(),
657
  $item = that.createItem(args, $section);
658
  if ($item) {
672
  $item.removeClass('focus').find('.learn-press-dropdown-item-types ul').remove();
673
  }
674
  this.model.addItem(parseInt($item.attr('data-id')));
675
+ LP.Hook.doAction('learn_press_add_item_to_section', $item, $section);
676
  },
677
  addNewItem : function (e) {
678
  var $form = $(e.target).closest('.lp-modal-search');
679
  $.ajax({
680
+ url : LP_Settings.ajax,
681
  data : {
682
  action: 'learnpress_quick_add_item',
683
  name : $form.find('input[name="lp-item-name"]').val(),
686
  type : 'post',
687
  dataType: 'html',
688
  success : function (response) {
689
+ var json = LP.parseJSON(response);
690
  if (json.html) {
691
  var $item = $(json.html)
692
  $form.find('ul').append($item);
695
  }
696
  });
697
  },
698
+ newItemFilter : function ($item) {
699
+ if (!$item) return;
700
+ $item.find('.section-item-icon .learn-press-dropdown-item-types ul .item-selected')
701
+ .parent()
702
+ .hide();
703
+ return $item;
704
+ },
705
  toggleAddItemButtonState: function (e) {
706
  var $form = $(e.target).closest('.lp-modal-search'),
707
  selected = $form.find('li input:checked'),
804
  caretPos = $target.attr('type') == 'text' ? $target.caret() : false,
805
  caretLen = text.length,
806
  that = this;
807
+
808
  if (field == 'item-name') {
809
  var $item = $target.closest('.lp-section-item');
810
  if (text.match(/\\q\?/i) || this.isShowing == 'searchQuizForm') {
887
  that.appendSectionItem($item);
888
  }
889
  }
890
+ break;
891
  }
892
  if (lastCode == keyCode && text.length == 0) {
893
  var keyRepeat = $target.data('keyRepeat');
894
  if (!keyRepeat) {
895
+ keyCode = 1;
896
  }
897
  $target.data('keyRepeat', keyRepeat + 1);
898
  } else {
1007
  $item.removeClass('.lp-item-lp_lesson lp-item-empty lp-item-new').addClass('lp-item-' + type).attr({
1008
  'data-type': type,
1009
  'data-id' : id
1010
+ });
1011
  } else {
1012
  $(e.target).val($(e.target).val().replace(/\\q\?[\s]*/ig, ''));
1013
  }
1023
  },
1024
  _getNextSection : function ($section, loop) {
1025
  var $nextSection = $section.next();
1026
+ if ($nextSection.length == 0 && ( ( typeof loop == 'undefined' ) || ( loop == true ) )) {
1027
  $nextSection = $section.parent().children().first();
1028
  }
1029
  return $nextSection;
1030
  },
1031
  _getPrevSection : function ($section, loop) {
1032
  var $prevSection = $section.prev();
1033
+ if ($prevSection.length == 0 && ( ( typeof loop == 'undefined' ) || ( loop == true ) )) {
1034
  $prevSection = $section.parent().children().last();
1035
  }
1036
  return $prevSection;
1055
  return $(this).find('.lp-item-name').val()
1056
  }).get().join('</p><p>+&nbsp;');
1057
 
1058
+ LP.MessageBox.quickConfirm(target, {
1059
  onOk : function (a) {
1060
  var ids = [];
1061
  a.items && a.items.each(function () {
1082
  .find('.item-bulk-actions button')
1083
  .map(function () {
1084
  var $b = $(this);
1085
+ ( $.inArray($b.attr('data-action'), ['cancel', 'delete']) != -1 ) && $b.hide();
1086
  if ($b.attr('data-action') == 'delete') $b.html($b.attr('data-title'))
1087
  });
1088
  },
1095
  },
1096
  removeItemDB : function (id) {
1097
  $.ajax({
1098
+ url : LP_Settings.ajax,
1099
  data : {
1100
  action: 'learnpress_remove_course_items',
1101
  id : id
1102
  },
1103
  success: function (response) {
 
1104
  }
1105
  });
1106
  },
1146
  });
1147
  break;
1148
  case 'remove':
1149
+ LP.MessageBox.quickConfirm($button, {
1150
  onOk: function (a) {
1151
  var $section = $(a);
1152
 
1153
  $.ajax({
1154
+ url : LP_Settings.ajax,
1155
  data : {
1156
  action: 'learnpress_remove_course_section',
1157
  id : $section.attr('data-id')
1164
  data: $button.closest('.curriculum-section')
1165
  });
1166
  break;
1167
+ LP.MessageBox.show('Do you want to remove this section?', {
1168
  buttons: 'yesNo',
1169
  data : $button.closest('.curriculum-section'),
1170
  events : {
1172
  var $section = $(args.data);
1173
 
1174
  $.ajax({
1175
+ url : LP_Settings.ajax,
1176
  data : {
1177
  action: 'learnpress_remove_course_section',
1178
  id : $section.attr('data-id')
1191
  }
1192
  }
1193
  });
1194
+ if (typeof LP_Curriculum_Settings != 'undefined') {
1195
+ var model = new LP_Curriculum_Model(LP_Curriculum_Settings),
1196
+ view = new LP_Curriculum_View(model);
1197
 
1198
+ LP.$LP_Curriculum_Model = model;
1199
+ LP.$LP_Curriculum_View = view;
1200
+ }
1201
  });
1202
 
1203
  function updateHiddenCurriculum(hidden) {
1223
  }
1224
 
1225
  $.ajax({
1226
+ url : LP_Settings.ajax,
1227
  data : {
1228
  action : 'learnpress_update_curriculum_section_state',
1229
  course_id: $('#post_ID').val(),
1317
  }
1318
  ;
1319
  $.ajax({
1320
+ url : LP_Settings.ajax,
1321
  type : 'post',
1322
  data : {
1323
  action : 'learnpress_update_editor_hidden',
1352
  // Set helper cell sizes to match the original sizes
1353
  $(this).width($originals.eq(index).width());
1354
  });
1355
+ $helper.height( $( tr ).height() + 10 );
1356
 
1357
  $(tr).parent().append($helper);
1358
 
1371
  ui.placeholder.html('<td colspan="' + cellCount + '">&nbsp;</td>');
1372
  },
1373
  sort : function (e, ui) {
 
1374
  },
1375
  stop : function (e, ui) {
1376
  var $emptyItem = ui.item.parent().find('.lp-item-empty:last');
 
 
 
 
1377
  if ($emptyItem.next().is(ui.item.get(0))) {
1378
  $emptyItem.insertAfter(ui.item);
1379
  }
1382
  }
1383
 
1384
  function _ready() {
1385
+ $('#learn-press-button-toggle-editor').on('click _click', _toggleEditorHandler).trigger('_click');
1386
 
1387
  _makeListSortable();
1388
  }
assets/js/admin/meta-box-order.js CHANGED
@@ -12,8 +12,8 @@
12
  },
13
  initialize : function () {
14
  _.bindAll(this, 'resetModal', 'updateModal', '_updateDescription');
15
- LearnPress.Hook.addAction('learn_press_message_box_before_resize', this.resetModal);
16
- LearnPress.Hook.addAction('learn_press_message_box_resize', this.updateModal);
17
  this.userSuggest();
18
  },
19
  _updateDescription: function (e) {
@@ -25,7 +25,7 @@
25
  var m = d.match(/(lp-.*)\s?/);
26
  return m ? m[0] : '';
27
  }).addClass($option.val()).fadeIn('fast');
28
- })
29
  },
30
  userSuggest : function () {
31
  var id = ( typeof current_site_id !== 'undefined' ) ? '&site_id=' + current_site_id : '';
@@ -40,7 +40,7 @@
40
  autocompleteField = ( typeof $this.data('autocompleteField') !== 'undefined' ) ? $this.data('autocompleteField') : 'user_login';
41
 
42
  $this.autocomplete({
43
- source : LearnPress_Settings.ajax + '?action=learnpress_search_users&autocomplete_type=' + autocompleteType + '&autocomplete_field=' + autocompleteField + id,
44
  delay : 500,
45
  minLength: 2,
46
  position : position,
@@ -51,7 +51,7 @@
51
  $(this).removeClass('open');
52
  },
53
  select : function (a, b) {
54
- LearnPress.log(a, b)
55
  }
56
  });
57
  });
@@ -60,14 +60,14 @@
60
  this.$('#learn-press-courses-result').css('height', height - 120).css('overflow', 'auto');
61
  },
62
  updateModal : function ($app) {
63
- this.$('#learn-press-courses-result').css('height', '').css('overflow', '')
64
  },
65
  _addItem : function (e) {
66
  var $form = $('#learn-press-modal-add-order-courses');
67
  if ($form.length == 0) {
68
  $form = $(wp.template('learn-press-modal-add-order-courses')());
69
  }
70
- LearnPress.MessageBox.show($form);
71
  },
72
  addItem : function (e) {
73
  var that = this,
@@ -76,7 +76,7 @@
76
  //return true;
77
  }
78
  $.ajax({
79
- url : LearnPress_Settings.ajax,
80
  data : {
81
  action : 'learnpress_add_item_to_order',
82
  order_id: parseInt($('input#post_ID').val()),
@@ -86,9 +86,9 @@
86
  dataType: 'text',
87
  type : 'post',
88
  success : function (response) {
89
- LearnPress.log(response);
90
- response = LearnPress.parseJSON(response);
91
- if (response.result == 'success') {
92
  var $order_table = that.$('.order-items'),
93
  $no_item = $order_table.find('.no-order-items');
94
  $(response.item_html).insertBefore($no_item);
@@ -99,7 +99,7 @@
99
  $no_item.addClass('hide-if-js');
100
  }
101
  }
102
- })
103
 
104
  return false;
105
  },
@@ -112,7 +112,7 @@
112
  return;
113
  }
114
  $.ajax({
115
- url : LearnPress_Settings.ajax,
116
  data : {
117
  action : 'learnpress_remove_order_item',
118
  order_id : $('#post_ID').val(),
@@ -122,12 +122,12 @@
122
  type : 'post',
123
  dataType: 'text',
124
  success : function (response) {
125
- response = LearnPress.parseJSON(response);
126
- if (response.result == 'success') {
127
  var $order_table = that.$('.order-items'),
128
  $no_item = $order_table.find('.no-order-items'),
129
  $other_items = $item.siblings().filter(function () {
130
- return !$(this).is($no_item)
131
  });
132
  $order_table.find('.order-subtotal').html(response.order_data.subtotal_html);
133
  $order_table.find('.order-total').html(response.order_data.total_html);
@@ -138,7 +138,7 @@
138
  });
139
  },
140
  calculateTotal : function (e) {
141
- LearnPress.log(e)
142
  },
143
  fetchResults : function (results) {
144
  var $list = this.$('#learn-press-courses-result'),
@@ -156,7 +156,7 @@
156
  term = $input.val(),
157
  _search = function () {
158
  $.ajax({
159
- url : LearnPress_Settings.ajax,
160
  data : {
161
  action: 'learnpress_search_courses',
162
  nonce : $input.attr('data-nonce'),
@@ -165,7 +165,7 @@
165
  type : 'get',
166
  dataType: 'text',
167
  success : function (response) {
168
- response = LearnPress.parseJSON(response);
169
  that.fetchResults(response);
170
  }
171
  });
12
  },
13
  initialize : function () {
14
  _.bindAll(this, 'resetModal', 'updateModal', '_updateDescription');
15
+ LP.Hook.addAction('learn_press_message_box_before_resize', this.resetModal);
16
+ LP.Hook.addAction('learn_press_message_box_resize', this.updateModal);
17
  this.userSuggest();
18
  },
19
  _updateDescription: function (e) {
25
  var m = d.match(/(lp-.*)\s?/);
26
  return m ? m[0] : '';
27
  }).addClass($option.val()).fadeIn('fast');
28
+ });
29
  },
30
  userSuggest : function () {
31
  var id = ( typeof current_site_id !== 'undefined' ) ? '&site_id=' + current_site_id : '';
40
  autocompleteField = ( typeof $this.data('autocompleteField') !== 'undefined' ) ? $this.data('autocompleteField') : 'user_login';
41
 
42
  $this.autocomplete({
43
+ source : LP_Settings.ajax + '?action=learnpress_search_users&autocomplete_type=' + autocompleteType + '&autocomplete_field=' + autocompleteField + id,
44
  delay : 500,
45
  minLength: 2,
46
  position : position,
51
  $(this).removeClass('open');
52
  },
53
  select : function (a, b) {
54
+ LP.log(a, b);
55
  }
56
  });
57
  });
60
  this.$('#learn-press-courses-result').css('height', height - 120).css('overflow', 'auto');
61
  },
62
  updateModal : function ($app) {
63
+ this.$('#learn-press-courses-result').css('height', '').css('overflow', '');
64
  },
65
  _addItem : function (e) {
66
  var $form = $('#learn-press-modal-add-order-courses');
67
  if ($form.length == 0) {
68
  $form = $(wp.template('learn-press-modal-add-order-courses')());
69
  }
70
+ LP.MessageBox.show($form);
71
  },
72
  addItem : function (e) {
73
  var that = this,
76
  //return true;
77
  }
78
  $.ajax({
79
+ url : LP_Settings.ajax,
80
  data : {
81
  action : 'learnpress_add_item_to_order',
82
  order_id: parseInt($('input#post_ID').val()),
86
  dataType: 'text',
87
  type : 'post',
88
  success : function (response) {
89
+ LP.log(response);
90
+ response = LP.parseJSON(response);
91
+ if (response.result === 'success') {
92
  var $order_table = that.$('.order-items'),
93
  $no_item = $order_table.find('.no-order-items');
94
  $(response.item_html).insertBefore($no_item);
99
  $no_item.addClass('hide-if-js');
100
  }
101
  }
102
+ });
103
 
104
  return false;
105
  },
112
  return;
113
  }
114
  $.ajax({
115
+ url : LP_Settings.ajax,
116
  data : {
117
  action : 'learnpress_remove_order_item',
118
  order_id : $('#post_ID').val(),
122
  type : 'post',
123
  dataType: 'text',
124
  success : function (response) {
125
+ response = LP.parseJSON(response);
126
+ if (response.result === 'success') {
127
  var $order_table = that.$('.order-items'),
128
  $no_item = $order_table.find('.no-order-items'),
129
  $other_items = $item.siblings().filter(function () {
130
+ return !$(this).is($no_item);
131
  });
132
  $order_table.find('.order-subtotal').html(response.order_data.subtotal_html);
133
  $order_table.find('.order-total').html(response.order_data.total_html);
138
  });
139
  },
140
  calculateTotal : function (e) {
141
+ LP.log(e);
142
  },
143
  fetchResults : function (results) {
144
  var $list = this.$('#learn-press-courses-result'),
156
  term = $input.val(),
157
  _search = function () {
158
  $.ajax({
159
+ url : LP_Settings.ajax,
160
  data : {
161
  action: 'learnpress_search_courses',
162
  nonce : $input.attr('data-nonce'),
165
  type : 'get',
166
  dataType: 'text',
167
  success : function (response) {
168
+ response = LP.parseJSON(response);
169
  that.fetchResults(response);
170
  }
171
  });
assets/js/admin/meta-box-question.js CHANGED
@@ -4,18 +4,19 @@
4
  * @version 1.0
5
  */
6
  ;
7
- if (typeof window.LearnPress == 'undefined') {
8
- window.LearnPress = {};
9
  }
 
10
  ;(function ($) {
11
  var $doc = $(document);
12
- LearnPress.Hook.addFilter('before_add_question_option', function($el, args){
13
  return true;
14
  }).addAction('question_option_added', function($el){
15
  //$el.find('input[type="text"]').focus();
16
- })
17
 
18
- LearnPress.Question = {
19
  _getEmptyOption: function(question_id){
20
  var $options = $('#learn-press-list-options-' + question_id + ' tbody .lp-list-option-empty');
21
  return $options.length ? $options : false;
@@ -29,14 +30,14 @@ if (typeof window.LearnPress == 'undefined') {
29
  var templateArgs = {
30
  question_id: question_id,
31
  text : '',
32
- value : LearnPress.uniqueId()
33
  },
34
  tmpl = wp.template($('#learn-press-question-' + question_id).attr('data-type') + '-option'),
35
  $list = $('#learn-press-list-options-' + question_id + ' tbody');
36
  $newOption = $(tmpl(templateArgs));
37
- if (LearnPress.Hook.applyFilters('before_add_question_option', $newOption, args) !== false) {
38
  $list.append($newOption);
39
- LearnPress.Hook.doAction('question_option_added', $newOption, args);
40
  }
41
  }
42
  if($newOption && args.autoFocus){
@@ -50,9 +51,9 @@ if (typeof window.LearnPress == 'undefined') {
50
  }else{
51
  $theOption = $(theOption);
52
  }
53
- if( LearnPress.Hook.applyFilters('before_remove_question_option', true, $theOption) !== false ) {
54
  $theOption.remove();
55
- LearnPress.Hook.doAction('question_option_removed', $theOption);
56
  }
57
  },
58
  addQuestion: function (args) {
@@ -69,19 +70,19 @@ if (typeof window.LearnPress == 'undefined') {
69
  action: 'learnpress_add_question'
70
  }, args);
71
 
72
- post_data = LearnPress.Hook.applyFilters( 'LearnPress.add_question_post_data', post_data );
73
 
74
  $.ajax({
75
- url : LearnPress_Settings.ajax,
76
  dataType: 'html',
77
  type : 'post',
78
  data : post_data,
79
  success : function (response) {
80
- response = LearnPress.parseJSON(response);
81
  var $newQuestion = $(response.html);
82
  $('#learn-press-list-questions').append($newQuestion);
83
- LearnPress.Question._hideQuestion( args.id )
84
- LearnPress.Hook.doAction( 'learn_press_add_quiz_question', $newQuestion, args);
85
  }
86
  });
87
  },
@@ -93,7 +94,7 @@ if (typeof window.LearnPress == 'undefined') {
93
  },
94
  _showQuestion: function(question){
95
  if($.type( question ) == 'number' ) {
96
- question = $('#learn-press-dropdown-questions .question a[data-id="' + question + '"]').parent()
97
  }
98
  $(question).removeClass('added');
99
  }
@@ -120,8 +121,8 @@ if (typeof window.LearnPress == 'undefined') {
120
  }
121
 
122
  $.ajax({
123
- url: LearnPress_Settings.ajax,
124
- data: {
125
  action: 'learnpress_update_quiz_question_state',
126
  quiz_id: $('#post_ID').val(),
127
  hidden: hidden
@@ -132,7 +133,8 @@ if (typeof window.LearnPress == 'undefined') {
132
  });
133
  return hidden;
134
  }
135
- LearnPress.sortableQuestionAnswers = function( $questions, args ){
 
136
  args = $.extend({
137
  stop: function(){}
138
  }, args || {});
@@ -163,23 +165,23 @@ if (typeof window.LearnPress == 'undefined') {
163
 
164
  $doc.on('click', '#learn-press-dropdown-questions ul li a', function (e) {
165
  e.preventDefault();
166
- LearnPress.Question.addQuestion({id: $(this).data('id')});
167
  $(this).closest('ul').hide();
168
  });
169
 
170
  $('#learn-press-button-add-question').on('click', function () {
171
- //LearnPress.Question.addQuestion({name: $('#learn-press-question-name').val(), type: 'true_or_false'});
172
  });
173
 
174
  $doc.on('click', '.add-question-option-button', function (e, data) {
175
  var question_id = $(this).attr('data-id');
176
- LearnPress.Question.addOption(question_id, data);
177
  }).on('click', '.lp-remove-list-option', function () {
178
  var $option = $(this).closest('tr');
179
- LearnPress.MessageBox.quickConfirm( $('i', this), {
180
  message: 'Are you sure you want to remove this option?',
181
  onOk: function (a) {
182
- LearnPress.Question.removeOption($option);
183
  }
184
  });
185
  }).on('change', '.lp-dropdown-question-types', function(){
@@ -189,20 +191,20 @@ if (typeof window.LearnPress == 'undefined') {
189
  from = $select.data('selected'),
190
  to = this.value,
191
  _do = function(){
192
- LearnPress.MessageBox.blockUI();
193
  $.ajax({
194
- url: LearnPress_Settings.ajax,
195
- type: 'post',
196
  dataType: 'html',
197
- data: {
198
  action: 'learnpress_convert_question_type',
199
  question_id: questionId,
200
  from: from,
201
  to: to,
202
  data: $('#post').serialize()//$wrap.find('input, select, textarea').
203
  },
204
- success: function(response){
205
- response = LearnPress.parseJSON(response);
206
  var $newOptions = $(response.html),
207
  $question = $('#learn-press-question-'+questionId),
208
  $icon = $question.closest('.quiz-question').find('.quiz-question-icon img');
@@ -210,13 +212,13 @@ if (typeof window.LearnPress == 'undefined') {
210
  if($icon.length){
211
  $icon.replaceWith(response.icon)
212
  }
213
- LearnPress.Hook.doAction('learn_press_convert_question_type', questionId, from, to, $newOptions );
214
- LearnPress.MessageBox.hide();
215
  }
216
  });
217
  };
218
 
219
- LearnPress.MessageBox.show( 'Are you sure you want to convert to new type?', {
220
  buttons: 'yesNo',
221
  events: {
222
  onYes: function () {
@@ -300,8 +302,33 @@ if (typeof window.LearnPress == 'undefined') {
300
  updateHiddenQuestions();
301
  });
302
  break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
303
  case 'remove':
304
- LearnPress.MessageBox.quickConfirm( $link, {
305
  onOk: function(a){
306
  var $question = $(a);
307
  $.ajax({
@@ -322,7 +349,7 @@ if (typeof window.LearnPress == 'undefined') {
322
  data: $(this).closest('.quiz-question')
323
  });
324
  break;
325
- LearnPress.MessageBox.show( 'Do you want to remove this question from quiz?', {
326
  buttons: 'yesNo',
327
  data: $(this).closest('.quiz-question'),
328
  events: {
@@ -344,7 +371,7 @@ if (typeof window.LearnPress == 'undefined') {
344
  })
345
  break;
346
  //case 'edit':
347
- //LearnPress.MessageBox.show('<iframe src="'+$(this).attr('href')+'" />');
348
 
349
  }
350
  if( action ){
@@ -353,7 +380,7 @@ if (typeof window.LearnPress == 'undefined') {
353
  }).on('keydown', '.no-submit', function(e){
354
  if(e.keyCode == 13) {
355
  e.preventDefault();
356
- LearnPress.log('no submit form');
357
  }
358
  }).on('change keyup', '.lp-answer-text', function(e){
359
  var $input = $(this),
@@ -366,7 +393,7 @@ if (typeof window.LearnPress == 'undefined') {
366
  case 8:
367
  case 46:
368
  var pressed = $input.data('key-'+ e.keyCode) || 1;
369
- LearnPress.log('pressed:'+pressed)
370
  if(pressed > 1){
371
  if(e.keyCode == 38){
372
  ( $prev = $input.findPrev('.key-nav') ) && $prev.focus();
4
  * @version 1.0
5
  */
6
  ;
7
+ if (typeof window.LP == 'undefined') {
8
+ window.LP = window.LearnPress = {};
9
  }
10
+
11
  ;(function ($) {
12
  var $doc = $(document);
13
+ LP.Hook.addFilter('before_add_question_option', function ($el, args) {
14
  return true;
15
  }).addAction('question_option_added', function($el){
16
  //$el.find('input[type="text"]').focus();
17
+ });
18
 
19
+ LP.Question = {
20
  _getEmptyOption: function(question_id){
21
  var $options = $('#learn-press-list-options-' + question_id + ' tbody .lp-list-option-empty');
22
  return $options.length ? $options : false;
30
  var templateArgs = {
31
  question_id: question_id,
32
  text : '',
33
+ value : LP.uniqueId()
34
  },
35
  tmpl = wp.template($('#learn-press-question-' + question_id).attr('data-type') + '-option'),
36
  $list = $('#learn-press-list-options-' + question_id + ' tbody');
37
  $newOption = $(tmpl(templateArgs));
38
+ if (LP.Hook.applyFilters('before_add_question_option', $newOption, args) !== false) {
39
  $list.append($newOption);
40
+ LP.Hook.doAction('question_option_added', $newOption, args);
41
  }
42
  }
43
  if($newOption && args.autoFocus){
51
  }else{
52
  $theOption = $(theOption);
53
  }
54
+ if (LP.Hook.applyFilters('before_remove_question_option', true, $theOption) !== false) {
55
  $theOption.remove();
56
+ LP.Hook.doAction('question_option_removed', $theOption);
57
  }
58
  },
59
  addQuestion: function (args) {
70
  action: 'learnpress_add_question'
71
  }, args);
72
 
73
+ post_data = LP.Hook.applyFilters('LP.add_question_post_data', post_data);
74
 
75
  $.ajax({
76
+ url : LP_Settings.ajax,
77
  dataType: 'html',
78
  type : 'post',
79
  data : post_data,
80
  success : function (response) {
81
+ response = LP.parseJSON(response);
82
  var $newQuestion = $(response.html);
83
  $('#learn-press-list-questions').append($newQuestion);
84
+ LP.Question._hideQuestion(args.id);
85
+ LP.Hook.doAction('learn_press_add_quiz_question', $newQuestion, args);
86
  }
87
  });
88
  },
94
  },
95
  _showQuestion: function(question){
96
  if($.type( question ) == 'number' ) {
97
+ question = $('#learn-press-dropdown-questions .question a[data-id="' + question + '"]').parent();
98
  }
99
  $(question).removeClass('added');
100
  }
121
  }
122
 
123
  $.ajax({
124
+ url : LP_Settings.ajax,
125
+ data : {
126
  action: 'learnpress_update_quiz_question_state',
127
  quiz_id: $('#post_ID').val(),
128
  hidden: hidden
133
  });
134
  return hidden;
135
  }
136
+
137
+ LP.sortableQuestionAnswers = function ($questions, args) {
138
  args = $.extend({
139
  stop: function(){}
140
  }, args || {});
165
 
166
  $doc.on('click', '#learn-press-dropdown-questions ul li a', function (e) {
167
  e.preventDefault();
168
+ LP.Question.addQuestion({id: $(this).data('id')});
169
  $(this).closest('ul').hide();
170
  });
171
 
172
  $('#learn-press-button-add-question').on('click', function () {
173
+ //LP.Question.addQuestion({name: $('#learn-press-question-name').val(), type: 'true_or_false'});
174
  });
175
 
176
  $doc.on('click', '.add-question-option-button', function (e, data) {
177
  var question_id = $(this).attr('data-id');
178
+ LP.Question.addOption(question_id, data);
179
  }).on('click', '.lp-remove-list-option', function () {
180
  var $option = $(this).closest('tr');
181
+ LP.MessageBox.quickConfirm($('i', this), {
182
  message: 'Are you sure you want to remove this option?',
183
  onOk: function (a) {
184
+ LP.Question.removeOption($option);
185
  }
186
  });
187
  }).on('change', '.lp-dropdown-question-types', function(){
191
  from = $select.data('selected'),
192
  to = this.value,
193
  _do = function(){
194
+ LP.MessageBox.blockUI();
195
  $.ajax({
196
+ url : LP_Settings.ajax,
197
+ type : 'post',
198
  dataType: 'html',
199
+ data : {
200
  action: 'learnpress_convert_question_type',
201
  question_id: questionId,
202
  from: from,
203
  to: to,
204
  data: $('#post').serialize()//$wrap.find('input, select, textarea').
205
  },
206
+ success : function(response){
207
+ response = LP.parseJSON(response);
208
  var $newOptions = $(response.html),
209
  $question = $('#learn-press-question-'+questionId),
210
  $icon = $question.closest('.quiz-question').find('.quiz-question-icon img');
212
  if($icon.length){
213
  $icon.replaceWith(response.icon)
214
  }
215
+ LP.Hook.doAction('learn_press_convert_question_type', questionId, from, to, $newOptions);
216
+ LP.MessageBox.hide();
217
  }
218
  });
219
  };
220
 
221
+ LP.MessageBox.show('Are you sure you want to convert to new type?', {
222
  buttons: 'yesNo',
223
  events: {
224
  onYes: function () {
302
  updateHiddenQuestions();
303
  });
304
  break;
305
+ case 'duplicate':
306
+ if ( jConfirm( learn_press_admin_localize.duplicate_question.message, learn_press_admin_localize.duplicate_question.title, function( confirm ){
307
+ if ( confirm ) {
308
+ var buttons = $('#popup_panel').find( 'button' );
309
+ $.ajax({
310
+ url: LP_Settings.ajax,
311
+ type: 'POST',
312
+ dataType: 'html',
313
+ data: {
314
+ 'question-id' : $link.attr( 'data-id' ),
315
+ 'quiz-id' : $link.attr( 'data-quiz' ),
316
+ 'action' : 'learnpress_duplicate_question',
317
+ '_nonce' : learn_press_admin_localize.nonces.duplicate_question
318
+ },
319
+ beforeSend: function(){
320
+ buttons.attr( 'disabled', true );
321
+ }
322
+ }).done( function( response ){
323
+ response = LP.parseJSON(response);
324
+ var $newQuestion = $(response.html);
325
+ $('#learn-press-list-questions').append($newQuestion);
326
+ } );
327
+ }
328
+ } ) );
329
+ break;
330
  case 'remove':
331
+ LP.MessageBox.quickConfirm($link, {
332
  onOk: function(a){
333
  var $question = $(a);
334
  $.ajax({
349
  data: $(this).closest('.quiz-question')
350
  });
351
  break;
352
+ LP.MessageBox.show( learn_press_admin_localize.remove_question, {
353
  buttons: 'yesNo',
354
  data: $(this).closest('.quiz-question'),
355
  events: {
371
  })
372
  break;
373
  //case 'edit':
374
+ //LP.MessageBox.show('<iframe src="'+$(this).attr('href')+'" />');
375
 
376
  }
377
  if( action ){
380
  }).on('keydown', '.no-submit', function(e){
381
  if(e.keyCode == 13) {
382
  e.preventDefault();
383
+ LP.log('no submit form');
384
  }
385
  }).on('change keyup', '.lp-answer-text', function(e){
386
  var $input = $(this),
393
  case 8:
394
  case 46:
395
  var pressed = $input.data('key-'+ e.keyCode) || 1;
396
+ LP.log('pressed:' + pressed)
397
  if(pressed > 1){
398
  if(e.keyCode == 38){
399
  ( $prev = $input.findPrev('.key-nav') ) && $prev.focus();
assets/js/admin/meta-box-quiz.js CHANGED
@@ -9,60 +9,59 @@
9
  var LP_Quiz_Question_Model = window.LP_Quiz_Question_Model = Backbone.Model.extend({})
10
 
11
  var LP_Quiz_Question_View = window.LP_Quiz_Question_View = Backbone.View.extend({
12
- el : 'body',
13
- events : {
14
- 'click #learn-press-button-add-question': 'showListQuestions',
15
  'keyup #lp-modal-quiz-questions input[name="lp-item-name"]': 'searchItem',
16
- 'click #lp-modal-quiz-questions input[type="checkbox"]': 'toggleAddItemButtonState',
17
- 'change #lp-modal-quiz-questions input[type="checkbox"]': 'toggleAddItemButtonState',
18
- 'click #lp-modal-quiz-questions .lp-add-item': 'addItemToQuiz',
19
- 'keyup input[name="lp-new-question-name"]': 'toggleAddButtonState',
20
- 'keydown .no-submit': 'preventSubmitForm',
21
- 'click .lp-button-add-question': 'addNewItem'
22
  },
23
- initialize: function () {
24
  $('#learn-press-list-questions').sortable({
25
  handle: '.quiz-question-actions .move',
26
- axis: 'y'
27
  });
28
- _.bindAll( this, 'addItemsToSection', 'getSelectedItems' );
29
- LearnPress.Hook.addAction( 'learn_press_message_box_before_resize', this.resetModalSearch);
30
- LearnPress.Hook.addAction( 'learn_press_message_box_resize', this.updateModalSearch);
31
- LearnPress.Hook.addFilter( 'learn_press_modal_search_items_exclude', this.getSelectedItems );
32
 
33
- $(document).on('learn_press_modal_search_items_response', this.addItemsToSection );
34
  },
35
- updateModalSearch: function(height, $app){
36
  $('.lp-modal-search ul.lp-list-items').css('height', height - 120).css('overflow', 'auto');
37
  },
38
- resetModalSearch: function($app){
39
  $('.lp-modal-search ul.lp-list-items').css('height', '').css('overflow', '')
40
  },
41
- toggleAddButtonState: function(e){
42
- LearnPress.log(e.target.value)
43
- if((e.target.value+'').length == 0){
44
  $('.lp-button-add-question').addClass('disabled')
45
- }else{
46
  $('.lp-button-add-question').removeClass('disabled')
47
  }
48
- if(e.keyCode == 13){
49
  $(e.target).siblings('.lp-button-add-question').trigger('click')
50
  }
51
  },
52
- preventSubmitForm: function(e){
53
- if(e.keyCode == 13){
54
  return false;
55
  }
56
  },
57
- showListQuestions: function(){
58
- var $form = LearnPress.ModalSearchItems( {
59
- template: 'tmpl-learn-press-search-items',
60
- type: 'lp_question',
61
- context: 'quiz-items',
62
  context_id: $('#post_ID').val(),
63
- exclude: this.getSelectedItems()
64
- } );
65
- LearnPress.MessageBox.show($form.$el);
66
  $form.$el.find('header input').focus();
67
 
68
  return;
@@ -72,61 +71,65 @@
72
  $form = $(wp.template('lp-modal-quiz-questions')());
73
  }
74
 
75
- LearnPress.MessageBox.show($form);
76
  $form.find('[name="lp-item-name"]').focus().trigger('keyup');
77
  $button.html($button.attr('data-text'));
78
  },
79
- searchItem: function(e){
80
  var that = this,
81
  $input = $(e.target);
82
- if($input.val() == $input.data('search-term')){
83
  return;
84
  }
85
- $input.data('search-term', $input.val() );
86
  var $form = $input.closest('.lp-modal-search'),
87
  text = $input.val().replace(/\\q\?[\s]*/ig, ''),
88
  $button = $form.find('.lp-add-item'),
89
  timer = $input.data('timer'),
90
- _search = function(){
91
  $.ajax({
92
- url: LearnPress_Settings.ajax,
93
- data: {
94
- action: 'learnpress_search_questions',
95
  quiz_id: $('#post_ID').val(),
96
- term: text,
97
  exclude: that.getAddedQuestions()
98
  },
99
  dataType: 'text',
100
- success: function(response){
101
- response = LearnPress.parseJSON(response);
102
- LearnPress.log(response);
103
  $form.find('.lp-list-items').html(response.html).removeClass('lp-ajaxload');
104
  $(window).trigger('resize');
105
  }
106
  });
107
  };
108
  $form.find('.lp-list-items').html('').addClass('lp-ajaxload');
109
- $button.html( $button.attr('data-text')).prop('disabled', true);
110
  timer && clearTimeout(timer);
111
  timer = setTimeout(_search, 300);
112
  $input.data('timer', timer);
113
  $(window).trigger('resize');
114
 
115
  },
116
- toggleAddItemButtonState: function(e){
117
  var $form = $(e.target).closest('.lp-modal-search'),
118
  selected = $form.find('.lp-list-items li:visible input:checked'),
119
  $button = $form.find('.lp-add-item');
120
- if( selected.length ){
121
- $button.removeAttr('disabled').html($button.attr('data-text')+' (+'+selected.length+')');
122
- }else{
123
  $button.attr('disabled', true).html($button.attr('data-text'));
124
  }
125
  },
126
- getSelectedItems: function( exclude ){
127
- return this.$('.learn-press-question[data-id]').map(function(){return ($(this).attr('data-id'))}).filter(function(i, c){return c > 0}).get();
 
 
 
 
128
  },
129
- addItemsToSection: function(e, $view, $items) {
130
  var that = this,
131
  selected = $items;
132
  selected.each(function () {
@@ -136,7 +139,7 @@
136
  $li.remove();
137
  });
138
  },
139
- addQuestion: function (args) {
140
  args = $.extend({
141
  id : 0,
142
  type: null,
@@ -148,46 +151,46 @@
148
  }
149
  var that = this,
150
  post_data = $.extend({
151
- action: 'learnpress_add_quiz_question',
152
  quiz_id: $('#post_ID').val()
153
  }, args);
154
 
155
- post_data = LearnPress.Hook.applyFilters( 'LearnPress.add_question_post_data', post_data );
156
 
157
  $.ajax({
158
- url : LearnPress_Settings.ajax,
159
  dataType: 'html',
160
  type : 'post',
161
  data : post_data,
162
  success : function (response) {
163
- response = LearnPress.parseJSON(response);
164
  var $newQuestion = $(response.html);
165
  $('#learn-press-list-questions').append($newQuestion);
166
- that.$('#lp-modal-quiz-questions li[data-id="'+response.id+'"]').addClass('selected hide-if-js');
167
- //LearnPress.Question._hideQuestion( args.id )
168
- LearnPress.Hook.doAction( 'learn_press_add_quiz_question', $newQuestion, args);
169
  }
170
  });
171
  },
172
- addNewItem: function(e){
173
  e.preventDefault();
174
  var $target = $(e.target),
175
  $form = $target.closest('.lp-modal-search'),
176
  $input = this.$('input[name="lp-new-question-name"]'),
177
  type = null;
178
- if($target.is('a')){
179
  type = $target.attr('data-type');
180
  $target = $target.closest('.lp-button-add-question');
181
- }else{
182
- if(!$target.is('.lp-button-add-question')){
183
  $target = $target.closest('.lp-button-add-question');
184
  }
185
  type = $target.find('ul > li > a:first').attr('data-type');
186
  }
187
- if($target.hasClass('disabled')){
188
  return;
189
  }
190
- if( ($input.val()+'').length == 0 ){
191
  alert('Please enter question name');
192
  $input.focus();
193
  return;
@@ -198,41 +201,59 @@
198
  });
199
  $input.focus().val('').trigger('keyup')
200
  },
201
- addItemToQuiz: function(e){
202
  var that = this,
203
  $form = $(e.target).closest('.lp-modal-search'),
204
  selected = $form.find('li:visible input:checked'),
205
  $section = $form.data('section');
206
- selected.each(function(){
207
  var $li = $(this).closest('li').addClass('selected'),
208
  args = $li.dataToJSON();
209
- /*$item = that.createItem( args, $section );
210
- $item.removeClass('lp-item-empty');*/
211
  that.addQuestion({id: $(this).val()});
212
  });
213
  $form.remove();
214
- LearnPress.MessageBox.hide();
215
  },
216
- createItem: function(args, $section){
217
  var tmpl = wp.template('quiz-question'),
218
  $item = $(tmpl(args));
219
- if( $section ) {
220
  var $last = $section.find('.curriculum-section-items li:last');
221
  $item.insertBefore($last);
222
  }
223
  return $item;
224
  },
225
- getAddedQuestions: function(){
226
  var ids =
227
  this.$('.learn-press-question')
228
- .map(function(){
229
  return parseInt($(this).attr('data-id'))
230
  }).get();
231
- return ids;
232
  }
233
  });
234
 
235
  new LP_Quiz_Question_View(new LP_Quiz_Question_Model());
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
236
  });
237
 
238
  return
9
  var LP_Quiz_Question_Model = window.LP_Quiz_Question_Model = Backbone.Model.extend({})
10
 
11
  var LP_Quiz_Question_View = window.LP_Quiz_Question_View = Backbone.View.extend({
12
+ el : 'body',
13
+ events : {
14
+ 'click #learn-press-button-add-question' : 'showListQuestions',
15
  'keyup #lp-modal-quiz-questions input[name="lp-item-name"]': 'searchItem',
16
+ 'click #lp-modal-quiz-questions input[type="checkbox"]' : 'toggleAddItemButtonState',
17
+ 'change #lp-modal-quiz-questions input[type="checkbox"]' : 'toggleAddItemButtonState',
18
+ 'click #lp-modal-quiz-questions .lp-add-item' : 'addItemToQuiz',
19
+ 'keyup input[name="lp-new-question-name"]' : 'toggleAddButtonState',
20
+ 'keydown .no-submit' : 'preventSubmitForm',
21
+ 'click .lp-button-add-question' : 'addNewItem'
22
  },
23
+ initialize : function () {
24
  $('#learn-press-list-questions').sortable({
25
  handle: '.quiz-question-actions .move',
26
+ axis : 'y'
27
  });
28
+ _.bindAll(this, 'addItemsToSection', 'getSelectedItems');
29
+ LP.Hook.addAction('learn_press_message_box_before_resize', this.resetModalSearch);
30
+ LP.Hook.addAction('learn_press_message_box_resize', this.updateModalSearch);
31
+ LP.Hook.addFilter('learn_press_modal_search_items_exclude', this.getSelectedItems);
32
 
33
+ $(document).on('learn_press_modal_search_items_response', this.addItemsToSection);
34
  },
35
+ updateModalSearch : function (height, $app) {
36
  $('.lp-modal-search ul.lp-list-items').css('height', height - 120).css('overflow', 'auto');
37
  },
38
+ resetModalSearch : function ($app) {
39
  $('.lp-modal-search ul.lp-list-items').css('height', '').css('overflow', '')
40
  },
41
+ toggleAddButtonState : function (e) {
42
+ if ((e.target.value + '').length == 0) {
 
43
  $('.lp-button-add-question').addClass('disabled')
44
+ } else {
45
  $('.lp-button-add-question').removeClass('disabled')
46
  }
47
+ if (e.keyCode == 13) {
48
  $(e.target).siblings('.lp-button-add-question').trigger('click')
49
  }
50
  },
51
+ preventSubmitForm : function (e) {
52
+ if (e.keyCode == 13) {
53
  return false;
54
  }
55
  },
56
+ showListQuestions : function () {
57
+ var $form = LP.ModalSearchItems({
58
+ template : 'tmpl-learn-press-search-items',
59
+ type : 'lp_question',
60
+ context : 'quiz-items',
61
  context_id: $('#post_ID').val(),
62
+ exclude : this.getSelectedItems()
63
+ });
64
+ LP.MessageBox.show($form.$el);
65
  $form.$el.find('header input').focus();
66
 
67
  return;
71
  $form = $(wp.template('lp-modal-quiz-questions')());
72
  }
73
 
74
+ LP.MessageBox.show($form);
75
  $form.find('[name="lp-item-name"]').focus().trigger('keyup');
76
  $button.html($button.attr('data-text'));
77
  },
78
+ searchItem : function (e) {
79
  var that = this,
80
  $input = $(e.target);
81
+ if ($input.val() == $input.data('search-term')) {
82
  return;
83
  }
84
+ $input.data('search-term', $input.val());
85
  var $form = $input.closest('.lp-modal-search'),
86
  text = $input.val().replace(/\\q\?[\s]*/ig, ''),
87
  $button = $form.find('.lp-add-item'),
88
  timer = $input.data('timer'),
89
+ _search = function () {
90
  $.ajax({
91
+ url : LP_Settings.ajax,
92
+ data : {
93
+ action : 'learnpress_search_questions',
94
  quiz_id: $('#post_ID').val(),
95
+ term : text,
96
  exclude: that.getAddedQuestions()
97
  },
98
  dataType: 'text',
99
+ success : function (response) {
100
+ response = LP.parseJSON(response);
101
+ LP.log(response);
102
  $form.find('.lp-list-items').html(response.html).removeClass('lp-ajaxload');
103
  $(window).trigger('resize');
104
  }
105
  });
106
  };
107
  $form.find('.lp-list-items').html('').addClass('lp-ajaxload');
108
+ $button.html($button.attr('data-text')).prop('disabled', true);
109
  timer && clearTimeout(timer);
110
  timer = setTimeout(_search, 300);
111
  $input.data('timer', timer);
112
  $(window).trigger('resize');
113
 
114
  },
115
+ toggleAddItemButtonState: function (e) {
116
  var $form = $(e.target).closest('.lp-modal-search'),
117
  selected = $form.find('.lp-list-items li:visible input:checked'),
118
  $button = $form.find('.lp-add-item');
119
+ if (selected.length) {
120
+ $button.removeAttr('disabled').html($button.attr('data-text') + ' (+' + selected.length + ')');
121
+ } else {
122
  $button.attr('disabled', true).html($button.attr('data-text'));
123
  }
124
  },
125
+ getSelectedItems : function (exclude) {
126
+ return this.$('.learn-press-question[data-id]').map(function () {
127
+ return ($(this).attr('data-id'))
128
+ }).filter(function (i, c) {
129
+ return c > 0
130
+ }).get();
131
  },
132
+ addItemsToSection : function (e, $view, $items) {
133
  var that = this,
134
  selected = $items;
135
  selected.each(function () {
139
  $li.remove();
140
  });
141
  },
142
+ addQuestion : function (args) {
143
  args = $.extend({
144
  id : 0,
145
  type: null,
151
  }
152
  var that = this,
153
  post_data = $.extend({
154
+ action : 'learnpress_add_quiz_question',
155
  quiz_id: $('#post_ID').val()
156
  }, args);
157
 
158
+ post_data = LP.Hook.applyFilters('LP.add_question_post_data', post_data);
159
 
160
  $.ajax({
161
+ url : LP_Settings.ajax,
162
  dataType: 'html',
163
  type : 'post',
164
  data : post_data,
165
  success : function (response) {
166
+ response = LP.parseJSON(response);
167
  var $newQuestion = $(response.html);
168
  $('#learn-press-list-questions').append($newQuestion);
169
+ that.$('#lp-modal-quiz-questions li[data-id="' + response.id + '"]').addClass('selected hide-if-js');
170
+ //LP.Question._hideQuestion( args.id )
171
+ LP.Hook.doAction('learn_press_add_quiz_question', $newQuestion, args);
172
  }
173
  });
174
  },
175
+ addNewItem : function (e) {
176
  e.preventDefault();
177
  var $target = $(e.target),
178
  $form = $target.closest('.lp-modal-search'),
179
  $input = this.$('input[name="lp-new-question-name"]'),
180
  type = null;
181
+ if ($target.is('a')) {
182
  type = $target.attr('data-type');
183
  $target = $target.closest('.lp-button-add-question');
184
+ } else {
185
+ if (!$target.is('.lp-button-add-question')) {
186
  $target = $target.closest('.lp-button-add-question');
187
  }
188
  type = $target.find('ul > li > a:first').attr('data-type');
189
  }
190
+ if ($target.hasClass('disabled')) {
191
  return;
192
  }
193
+ if (($input.val() + '').length == 0) {
194
  alert('Please enter question name');
195
  $input.focus();
196
  return;
201
  });
202
  $input.focus().val('').trigger('keyup')
203
  },
204
+ addItemToQuiz : function (e) {
205
  var that = this,
206
  $form = $(e.target).closest('.lp-modal-search'),
207
  selected = $form.find('li:visible input:checked'),
208
  $section = $form.data('section');
209
+ selected.each(function () {
210
  var $li = $(this).closest('li').addClass('selected'),
211
  args = $li.dataToJSON();
212
+ /*$item = that.createItem( args, $section );
213
+ $item.removeClass('lp-item-empty');*/
214
  that.addQuestion({id: $(this).val()});
215
  });
216
  $form.remove();
217
+ LP.MessageBox.hide();
218
  },
219
+ createItem : function (args, $section) {
220
  var tmpl = wp.template('quiz-question'),
221
  $item = $(tmpl(args));
222
+ if ($section) {
223
  var $last = $section.find('.curriculum-section-items li:last');
224
  $item.insertBefore($last);
225
  }
226
  return $item;
227
  },
228
+ getAddedQuestions : function () {
229
  var ids =
230
  this.$('.learn-press-question')
231
+ .map(function () {
232
  return parseInt($(this).attr('data-id'))
233
  }).get();
234
+ return ids;
235
  }
236
  });
237
 
238
  new LP_Quiz_Question_View(new LP_Quiz_Question_Model());
239
+
240
+ $('input[name="_lp_passing_grade_type"]').change(function () {
241
+ var t = $('input[name="_lp_passing_grade_type"]:checked').val(),
242
+ $el = $('label[for="_lp_passing_grade"]');
243
+ switch (t) {
244
+ case 'percentage':
245
+ $el.closest('.rwmb-field').show();
246
+ t = '%';
247
+ break;
248
+ case 'point':
249
+ $el.closest('.rwmb-field').show();
250
+ break;
251
+ case 'no':
252
+ case '':
253
+ $el.closest('.rwmb-field').hide();
254
+ }
255
+ $el.find('span').html(t);
256
+ }).filter(':checked').trigger('change');
257
  });
258
 
259
  return
assets/js/admin/modal-search-items.js CHANGED
@@ -2,11 +2,11 @@
2
  ( function ($, Backbone, _) {
3
  'use strict';
4
 
5
- LearnPress.ModalSearchItems = function (options) {
6
- return new LearnPress.ModalSearchItems.View(options);
7
  };
8
 
9
- LearnPress.ModalSearchItems.View = Backbone.View.extend({
10
  tagName : 'div',
11
  id : 'learn-press-modal-search-items',
12
  options : {
@@ -27,13 +27,14 @@
27
  this.options = options;
28
  _.bindAll(this, 'render');
29
  this.render();
30
- LearnPress.Hook
31
  .addAction('learn_press_message_box_before_resize', function () {
32
  that.$('article').css('height', '');
33
  })
34
  .addAction('learn_press_message_box_resize', function (height, app) {
35
  that.$('article').css({
36
- height: height - 135
 
37
  });
38
  });
39
  },
@@ -41,7 +42,7 @@
41
  this.$el.attr({
42
  tabindex : 0,
43
  'data-tmpl': this.options.template
44
- }).append(LearnPress.template(this.options.template));
45
 
46
  $(document.body).css({
47
  'overflow': 'hidden'
@@ -60,13 +61,13 @@
60
  $button.each(function () {
61
  var $btn = $(this);
62
  $btn.removeAttr('disabled').html($btn.attr('data-text') + ' (+' + $selected.length + ')');
63
- })
64
 
65
  } else {
66
  $button.each(function () {
67
  var $btn = $(this);
68
  $btn.attr('disabled', true).html($btn.attr('data-text'));
69
- })
70
 
71
  }
72
  },
@@ -78,7 +79,11 @@
78
  },
79
  _fetchItems : function (response) {
80
  this.$('article .lp-list-items').removeClass('lp-ajaxload').html(response.html);
81
- LearnPress.log(response.html);
 
 
 
 
82
  this.refreshModal();
83
  $(document.body).trigger('learn_press_modal_search_items_fetch', this);
84
  },
@@ -91,7 +96,7 @@
91
  exclude: ''
92
  }, args || {});
93
  $.ajax({
94
- url : LearnPress_Settings.ajax,
95
  data : {
96
  action : 'learnpress_modal_search_items',
97
  type : this.options.type,
@@ -103,28 +108,32 @@
103
  type : 'get',
104
  dataType: 'text',
105
  success : function (response) {
106
- response = LearnPress.parseJSON(response);
107
  that._fetchItems(response);
 
 
108
  }
109
- })
110
  },
111
  _closeModal : function (e) {
112
  e.preventDefault();
113
  $(document.body).trigger('learn_press_modal_search_items_before_remove', this);
114
  this.undelegateEvents();
115
  $(document).off('focusin');
116
- $(document.body).css({
117
- 'overflow': 'auto'
118
- });
 
119
  this.remove();
120
- LearnPress.MessageBox.hide();
121
  $(document.body).trigger('learn_press_modal_search_items_removed', this);
122
  },
123
  _addItems : function (e) {
 
124
  $(document.body).trigger('learn_press_modal_search_items_response', [this, this.getItems()]);
125
  this.refreshModal(e);
126
  if ($(e.target).hasClass('close')) {
127
- this.$('.close-modal').trigger('click')
128
  }
129
  },
130
  refreshModal : function (e) {
@@ -134,7 +143,7 @@
134
  },
135
  getItems : function () {
136
  return this.$('li input:checked').map(function () {
137
- return $(this).closest('li')
138
  });
139
  },
140
  keyboardActions : function (e) {
@@ -146,7 +155,7 @@
146
  this.searchTimer = setTimeout(function () {
147
  that.search({
148
  term : e.target.value,
149
- exclude: LearnPress.Hook.applyFilters('learn_press_modal_search_items_exclude', that.options.exclude, that)
150
  });
151
  }, 300);
152
  this.searchTerm = e.target.value;
2
  ( function ($, Backbone, _) {
3
  'use strict';
4
 
5
+ LP.ModalSearchItems = function (options) {
6
+ return new LP.ModalSearchItems.View(options);
7
  };
8
 
9
+ LP.ModalSearchItems.View = Backbone.View.extend({
10
  tagName : 'div',
11
  id : 'learn-press-modal-search-items',
12
  options : {
27
  this.options = options;
28
  _.bindAll(this, 'render');
29
  this.render();
30
+ LP.Hook
31
  .addAction('learn_press_message_box_before_resize', function () {
32
  that.$('article').css('height', '');
33
  })
34
  .addAction('learn_press_message_box_resize', function (height, app) {
35
  that.$('article').css({
36
+ // height: height - 135
37
+ height: height - 50 - $( '#learn-press-modal-search-items header' ).height() - $( '#learn-press-modal-search-items footer' ).height()
38
  });
39
  });
40
  },
42
  this.$el.attr({
43
  tabindex : 0,
44
  'data-tmpl': this.options.template
45
+ }).append(LP.template(this.options.template, this.options));
46
 
47
  $(document.body).css({
48
  'overflow': 'hidden'
61
  $button.each(function () {
62
  var $btn = $(this);
63
  $btn.removeAttr('disabled').html($btn.attr('data-text') + ' (+' + $selected.length + ')');
64
+ });
65
 
66
  } else {
67
  $button.each(function () {
68
  var $btn = $(this);
69
  $btn.attr('disabled', true).html($btn.attr('data-text'));
70
+ });
71
 
72
  }
73
  },
79
  },
80
  _fetchItems : function (response) {
81
  this.$('article .lp-list-items').removeClass('lp-ajaxload').html(response.html);
82
+ if ( this.$('.learnpress-search-notices').length == 0 ) {
83
+ // console.debug( $('#learn-press-modal-search-items footer') );
84
+ $('#learn-press-modal-search-items header').prepend( response.notices );
85
+ }
86
+ LP.log(response.html);
87
  this.refreshModal();
88
  $(document.body).trigger('learn_press_modal_search_items_fetch', this);
89
  },
96
  exclude: ''
97
  }, args || {});
98
  $.ajax({
99
+ url : LP_Settings.ajax,
100
  data : {
101
  action : 'learnpress_modal_search_items',
102
  type : this.options.type,
108
  type : 'get',
109
  dataType: 'text',
110
  success : function (response) {
111
+ response = LP.parseJSON(response);
112
  that._fetchItems(response);
113
+ // console.debug( that.$('#learn-press-modal-search-items footer') );
114
+ // that.$('#learn-press-modal-search-items footer').append( response.notices );
115
  }
116
+ });
117
  },
118
  _closeModal : function (e) {
119
  e.preventDefault();
120
  $(document.body).trigger('learn_press_modal_search_items_before_remove', this);
121
  this.undelegateEvents();
122
  $(document).off('focusin');
123
+ // $(document.body).css({
124
+ // 'overflow': 'auto'
125
+ // });
126
+ $(document.body).removeAttr( 'style' );
127
  this.remove();
128
+ LP.MessageBox.hide();
129
  $(document.body).trigger('learn_press_modal_search_items_removed', this);
130
  },
131
  _addItems : function (e) {
132
+ e.preventDefault();
133
  $(document.body).trigger('learn_press_modal_search_items_response', [this, this.getItems()]);
134
  this.refreshModal(e);
135
  if ($(e.target).hasClass('close')) {
136
+ this.$('.close-modal').trigger('click');
137
  }
138
  },
139
  refreshModal : function (e) {
143
  },
144
  getItems : function () {
145
  return this.$('li input:checked').map(function () {
146
+ return $(this).closest('li');
147
  });
148
  },
149
  keyboardActions : function (e) {
155
  this.searchTimer = setTimeout(function () {
156
  that.search({
157
  term : e.target.value,
158
+ exclude: LP.Hook.applyFilters('learn_press_modal_search_items_exclude', that.options.exclude, that)
159
  });
160
  }, 300);
161
  this.searchTerm = e.target.value;
assets/js/admin/question.min.js CHANGED
@@ -1,18 +1,211 @@
1
- if(typeof window.LearnPress=='undefined'){window.LearnPress={}};(function($){var $doc=$(document);LearnPress.Hook.addFilter('before_add_question_option',function($el,args){return !0}).addAction('question_option_added',function($el){})
2
- LearnPress.Question={_getEmptyOption:function(question_id){var $options=$('#learn-press-list-options-'+question_id+' tbody .lp-list-option-empty');return $options.length?$options:!1},addOption:function(question_id,args){var $newOption=this._getEmptyOption(question_id);args=$.extend({autoFocus:!0},args||{});if($newOption){}else{var templateArgs={question_id:question_id,text:'',value:LearnPress.uniqueId()},tmpl=wp.template($('#learn-press-question-'+question_id).attr('data-type')+'-option'),$list=$('#learn-press-list-options-'+question_id+' tbody');$newOption=$(tmpl(templateArgs));if(LearnPress.Hook.applyFilters('before_add_question_option',$newOption,args)!==!1){$list.append($newOption);LearnPress.Hook.doAction('question_option_added',$newOption,args)}}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  if($newOption&&args.autoFocus){$newOption.find('.lp-answer-text').focus()}},removeOption:function(theOption){var $theOption=null;if($.type(theOption)=='integer'){$theOption=$('lp-list-option-'+theOption)}else{$theOption=$(theOption)}
4
- if(LearnPress.Hook.applyFilters('before_remove_question_option',!0,$theOption)!==!1){$theOption.remove();LearnPress.Hook.doAction('question_option_removed',$theOption)}},addQuestion:function(args){args=$.extend({id:0,type:null,name:null},args);if(!args.id&&!args.type){alert('ERROR');return}
5
- var post_data=$.extend({action:'learnpress_add_question'},args);post_data=LearnPress.Hook.applyFilters('LearnPress.add_question_post_data',post_data);$.ajax({url:LearnPress_Settings.ajax,dataType:'html',type:'post',data:post_data,success:function(response){response=LearnPress.parseJSON(response);var $newQuestion=$(response.html);$('#learn-press-list-questions').append($newQuestion);LearnPress.Question._hideQuestion(args.id)
6
- LearnPress.Hook.doAction('learn_press_add_quiz_question',$newQuestion,args)}})},_hideQuestion:function(question){if($.type(question)=='number'){question=$('#learn-press-dropdown-questions .question a[data-id="'+question+'"]').parent()}
7
- $(question).addClass('added')},_showQuestion:function(question){if($.type(question)=='number'){question=$('#learn-press-dropdown-questions .question a[data-id="'+question+'"]').parent()}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  $(question).removeClass('added')}};function updateHiddenQuestions(hidden){if(hidden==undefined){hidden=[];var len=$('.quiz-question-content').each(function(){if($(this).is(':hidden')){hidden.push($('.learn-press-question',this).attr('data-id'))}}).length;if(hidden.length==0){$('.questions-toggle a[data-action="collapse"]').show().siblings('a[data-action="expand"]').hide()}else if(hidden.length==len){$('.questions-toggle a[data-action="collapse"]').hide().siblings('a[data-action="expand"]').show()}}
9
- $.ajax({url:LearnPress_Settings.ajax,data:{action:'learnpress_update_quiz_question_state',quiz_id:$('#post_ID').val(),hidden:hidden},success:function(){}});return hidden}
10
- LearnPress.sortableQuestionAnswers=function($questions){$questions.find('.lp-list-options tbody').sortable({handle:'.lp-move-list-option',axis:'y',start:function(e,ui){var $heads=ui.item.parent().closest('table').find('tr > th');ui.item.children().each(function(i){$(this).css({width:$heads.eq(i).width()})})
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  var $this=$(this),cols=$this.find('tr:first').children().length;$this.find('.ui-sortable-placeholder td:gt(0)').remove();$this.find('.ui-sortable-placeholder td:eq(0)').attr('colspan',cols)},stop:function(){}})}
12
- function _ready(){$('#learn-press-toggle-questions').on('click',function(){$(this).siblings('ul').toggle()});$doc.on('click','#learn-press-dropdown-questions ul li a',function(e){e.preventDefault();LearnPress.Question.addQuestion({id:$(this).data('id')});$(this).closest('ul').hide()});$('#learn-press-button-add-question').on('click',function(){});$doc.on('click','.add-question-option-button',function(e,data){var question_id=$(this).attr('data-id');LearnPress.Question.addOption(question_id,data)}).on('click','.lp-remove-list-option',function(){var $option=$(this).closest('tr');LearnPress.Question.removeOption($option)}).on('change','.lp-dropdown-question-types',function(){var $select=$(this),$wrap=$select.closest('.learn-press-question'),questionId=$wrap.data('id'),from=$select.data('selected'),to=this.value,_do=function(){LearnPress.MessageBox.blockUI();$.ajax({url:LearnPress_Settings.ajax,type:'post',dataType:'html',data:{action:'learnpress_convert_question_type',question_id:questionId,from:from,to:to,data:$('#post').serialize()},success:function(response){response=LearnPress.parseJSON(response);var $newOptions=$(response.html),$question=$('#learn-press-question-'+questionId),$icon=$question.closest('.quiz-question').find('.quiz-question-icon img');$question.replaceWith($newOptions);if($icon.length){$icon.replaceWith(response.icon)}
13
- LearnPress.Hook.doAction('learn_press_convert_question_type',questionId,from,to,$newOptions);LearnPress.MessageBox.hide()}})};LearnPress.MessageBox.show('Are you sure you want to convert to new type?',{buttons:'yesNo',events:{onYes:function(){_do()},onNo:function(){$select.val(from)}}});return}).on('click','.questions-toggle a',function(e){e.preventDefault();var action=$(this).attr('data-action');switch(action){case 'expand':var $items=$('.quiz-question'),len=$items.length,i=0;$(this).hide().siblings('a[data-action="collapse"]').show();$items.removeClass('is-hidden').find('.quiz-question-content').slideDown(function(){if(++i==len){updateHiddenQuestions([])}});$items.find('a[data-action="collapse"]').show();$items.find('a[data-action="expand"]').hide();break;case 'collapse':var $items=$('.quiz-question'),len=$items.length,i=0,hidden=[];$(this).hide().siblings('a[data-action="expand"]').show();$items.addClass('is-hidden').find('.quiz-question-content').slideUp(function(){hidden.push($('.learn-press-question',this).attr('data-id'));if(++i==len){updateHiddenQuestions(hidden)}});$items.find('a[data-action="collapse"]').hide();$items.find('a[data-action="expand"]').show();break}}).on('click','.quiz-question-actions a',function(e){var $link=$(this),action=$link.attr('data-action');switch(action){case 'expand':$(this).hide().siblings('a[data-action="collapse"]').show().closest('.quiz-question').removeClass('is-hidden').find('.quiz-question-content').slideDown(function(){if(updateHiddenQuestions().length==0){}});break;case 'collapse':$(this).hide().siblings('a[data-action="expand"]').show().closest('.quiz-question').addClass('is-hidden').find('.quiz-question-content').slideUp(function(){updateHiddenQuestions()});break;case 'remove':LearnPress.MessageBox.show('Do you want to remove this question from quiz?',{buttons:'yesNo',data:$(this).closest('.quiz-question'),events:{onYes:function(instance){var $question=$(instance.data);$.ajax({url:$link.attr('href'),success:function(){$question.fadeOut(function(){$(this).remove()})}})}}})
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  break}
15
- if(action){e.preventDefault()}}).on('keydown','.no-submit',function(e){if(e.keyCode==13){e.preventDefault();LearnPress.log('no submit form')}}).on('change keyup','.lp-answer-text',function(e){var $input=$(this),$option=$input.closest('.lp-list-option'),value=$input.val()+'';if(e.keyCode!=13){switch(e.keyCode){case 38:case 40:case 8:case 46:var pressed=$input.data('key-'+e.keyCode)||1;LearnPress.log('pressed:'+pressed)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  if(pressed>1){if(e.keyCode==38){($prev=$input.findPrev('.key-nav'))&&$prev.focus();pressed=0}else if(e.keyCode==40){($next=$input.findNext('.key-nav'))&&$next.focus();pressed=0}else if(e.keyCode==8&&value.length==0){var $row=$input.closest('tr'),$prev=$row.prev();if($prev.length){$prev.find('.lp-answer-text').focus();$row.remove()}}else if(e.keyCode==46&&value.length==0){var $row=$input.closest('tr'),$next=$row.next();if(!$next.hasClass('lp-list-option-empty')){$next.find('.lp-answer-text').focus();$row.remove()}}
17
  $input.data('key-'+e.keyCode,0)}else{if(e.keyCode==8||e.keyCode==46){if(value.length==0){$input.data('key-'+e.keyCode,pressed+1)}}else{$input.data('key-'+e.keyCode,pressed+1)}}
18
  break}
1
+ if (typeof window.LP == 'undefined') {
2
+ window.LP = {}
3
+ }
4
+ ;(function ($) {
5
+ var $doc = $(document);
6
+ LP.Hook.addFilter('before_add_question_option', function ($el, args) {
7
+ return !0
8
+ }).addAction('question_option_added', function ($el) {
9
+ })
10
+ LP.Question = {
11
+ _getEmptyOption : function (question_id) {
12
+ var $options = $('#learn-press-list-options-' + question_id + ' tbody .lp-list-option-empty');
13
+ return $options.length ? $options : !1
14
+ }, addOption : function (question_id, args) {
15
+ var $newOption = this._getEmptyOption(question_id);
16
+ args = $.extend({autoFocus: !0}, args || {});
17
+ if ($newOption) {
18
+ } else {
19
+ var templateArgs = {
20
+ question_id: question_id,
21
+ text : '',
22
+ value : LP.uniqueId()
23
+ }, tmpl = wp.template($('#learn-press-question-' + question_id).attr('data-type') + '-option'), $list = $('#learn-press-list-options-' + question_id + ' tbody');
24
+ $newOption = $(tmpl(templateArgs));
25
+ if (LP.Hook.applyFilters('before_add_question_option', $newOption, args) !== !1) {
26
+ $list.append($newOption);
27
+ LP.Hook.doAction('question_option_added', $newOption, args)
28
+ }
29
+ }
30
  if($newOption&&args.autoFocus){$newOption.find('.lp-answer-text').focus()}},removeOption:function(theOption){var $theOption=null;if($.type(theOption)=='integer'){$theOption=$('lp-list-option-'+theOption)}else{$theOption=$(theOption)}
31
+ if (LP.Hook.applyFilters('before_remove_question_option', !0, $theOption) !== !1) {
32
+ $theOption.remove();
33
+ LP.Hook.doAction('question_option_removed', $theOption)
34
+ }
35
+ }, addQuestion : function (args) {
36
+ args = $.extend({id: 0, type: null, name: null}, args);
37
+ if (!args.id && !args.type) {
38
+ alert('ERROR');
39
+ return
40
+ }
41
+ var post_data = $.extend({action: 'learnpress_add_question'}, args);
42
+ post_data = LP.Hook.applyFilters('LP.add_question_post_data', post_data);
43
+ $.ajax({
44
+ url: LP_Settings.ajax, dataType: 'html', type: 'post', data: post_data, success: function (response) {
45
+ response = LP.parseJSON(response);
46
+ var $newQuestion = $(response.html);
47
+ $('#learn-press-list-questions').append($newQuestion);
48
+ LP.Question._hideQuestion(args.id)
49
+ LP.Hook.doAction('learn_press_add_quiz_question', $newQuestion, args)
50
+ }
51
+ })
52
+ }, _hideQuestion : function (question) {
53
+ if ($.type(question) == 'number') {
54
+ question = $('#learn-press-dropdown-questions .question a[data-id="' + question + '"]').parent()
55
+ }
56
+ $(question).addClass('added')},_showQuestion :function(question){if($.type(question)=='number'){question=$('#learn-press-dropdown-questions .question a[data-id="'+question+'"]').parent()}
57
  $(question).removeClass('added')}};function updateHiddenQuestions(hidden){if(hidden==undefined){hidden=[];var len=$('.quiz-question-content').each(function(){if($(this).is(':hidden')){hidden.push($('.learn-press-question',this).attr('data-id'))}}).length;if(hidden.length==0){$('.questions-toggle a[data-action="collapse"]').show().siblings('a[data-action="expand"]').hide()}else if(hidden.length==len){$('.questions-toggle a[data-action="collapse"]').hide().siblings('a[data-action="expand"]').show()}}
58
+ $.ajax({
59
+ url : LP_Settings.ajax,
60
+ data : {action: 'learnpress_update_quiz_question_state', quiz_id: $('#post_ID').val(), hidden: hidden},
61
+ success: function () {
62
+ }
63
+ });
64
+ return hidden
65
+ }
66
+
67
+ LP.sortableQuestionAnswers = function ($questions) {
68
+ $questions.find('.lp-list-options tbody').sortable({
69
+ handle : '.lp-move-list-option',
70
+ axis : 'y',
71
+ start : function (e, ui) {
72
+ var $heads = ui.item.parent().closest('table').find('tr > th');
73
+ ui.item.children().each(function (i) {
74
+ $(this).css({width: $heads.eq(i).width()})
75
+ })
76
  var $this=$(this),cols=$this.find('tr:first').children().length;$this.find('.ui-sortable-placeholder td:gt(0)').remove();$this.find('.ui-sortable-placeholder td:eq(0)').attr('colspan',cols)},stop:function(){}})}
77
+ function _ready() {
78
+ $('#learn-press-toggle-questions').on('click', function () {
79
+ $(this).siblings('ul').toggle()
80
+ });
81
+ $doc.on('click', '#learn-press-dropdown-questions ul li a', function (e) {
82
+ e.preventDefault();
83
+ LP.Question.addQuestion({id: $(this).data('id')});
84
+ $(this).closest('ul').hide()
85
+ });
86
+ $('#learn-press-button-add-question').on('click', function () {
87
+ });
88
+ $doc.on('click', '.add-question-option-button', function (e, data) {
89
+ var question_id = $(this).attr('data-id');
90
+ LP.Question.addOption(question_id, data)
91
+ }).on('click', '.lp-remove-list-option', function () {
92
+ var $option = $(this).closest('tr');
93
+ LP.Question.removeOption($option)
94
+ }).on('change', '.lp-dropdown-question-types', function () {
95
+ var $select = $(this), $wrap = $select.closest('.learn-press-question'), questionId = $wrap.data('id'), from = $select.data('selected'), to = this.value, _do = function () {
96
+ LP.MessageBox.blockUI();
97
+ $.ajax({
98
+ url : LP_Settings.ajax,
99
+ type : 'post',
100
+ dataType: 'html',
101
+ data : {
102
+ action : 'learnpress_convert_question_type',
103
+ question_id: questionId,
104
+ from : from,
105
+ to : to,
106
+ data : $('#post').serialize()
107
+ },
108
+ success : function (response) {
109
+ response = LP.parseJSON(response);
110
+ var $newOptions = $(response.html), $question = $('#learn-press-question-' + questionId), $icon = $question.closest('.quiz-question').find('.quiz-question-icon img');
111
+ $question.replaceWith($newOptions);
112
+ if ($icon.length) {
113
+ $icon.replaceWith(response.icon);
114
+ }
115
+ LP.Hook.doAction('learn_press_convert_question_type', questionId, from, to, $newOptions);
116
+ LP.MessageBox.hide();
117
+ }
118
+ });
119
+ };
120
+ LP.MessageBox.show('Are you sure you want to convert to new type?', {
121
+ buttons: 'yesNo',
122
+ events : {
123
+ onYes : function () {
124
+ _do();
125
+ }, onNo: function () {
126
+ $select.val(from);
127
+ }
128
+ }
129
+ });
130
+ return;
131
+ }).on('click', '.questions-toggle a', function (e) {
132
+ e.preventDefault();
133
+ var action = $(this).attr('data-action');
134
+ switch (action) {
135
+ case 'expand':
136
+ var $items = $('.quiz-question'), len = $items.length, i = 0;
137
+ $(this).hide().siblings('a[data-action="collapse"]').show();
138
+ $items.removeClass('is-hidden').find('.quiz-question-content').slideDown(function () {
139
+ if (++i == len) {
140
+ updateHiddenQuestions([]);
141
+ }
142
+ });
143
+ $items.find('a[data-action="collapse"]').show();
144
+ $items.find('a[data-action="expand"]').hide();
145
+ break;
146
+ case 'collapse':
147
+ var $items = $('.quiz-question'), len = $items.length, i = 0, hidden = [];
148
+ $(this).hide().siblings('a[data-action="expand"]').show();
149
+ $items.addClass('is-hidden').find('.quiz-question-content').slideUp(function () {
150
+ hidden.push($('.learn-press-question', this).attr('data-id'));
151
+ if (++i == len) {
152
+ updateHiddenQuestions(hidden);
153
+ }
154
+ });
155
+ $items.find('a[data-action="collapse"]').hide();
156
+ $items.find('a[data-action="expand"]').show();
157
+ break
158
+ }
159
+ }).on('click', '.quiz-question-actions a', function (e) {
160
+ var $link = $(this), action = $link.attr('data-action');
161
+ switch (action) {
162
+ case 'expand':
163
+ $(this).hide().siblings('a[data-action="collapse"]').show().closest('.quiz-question').removeClass('is-hidden').find('.quiz-question-content').slideDown(function () {
164
+ if (updateHiddenQuestions().length == 0) {
165
+ }
166
+ });
167
+ break;
168
+ case 'collapse':
169
+ $(this).hide().siblings('a[data-action="expand"]').show().closest('.quiz-question').addClass('is-hidden').find('.quiz-question-content').slideUp(function () {
170
+ updateHiddenQuestions();
171
+ });
172
+ break;
173
+ case 'remove':
174
+ LP.MessageBox.show('Do you want to remove this question from quiz?', {
175
+ buttons: 'yesNo',
176
+ data : $(this).closest('.quiz-question'),
177
+ events : {
178
+ onYes: function (instance) {
179
+ var $question = $(instance.data);
180
+ $.ajax({
181
+ url: $link.attr('href'), success: function () {
182
+ $question.fadeOut(function () {
183
+ $(this).remove();
184
+ });
185
+ }
186
+ });
187
+ }
188
+ }
189
+ });
190
  break}
191
+ if (action) {
192
+ e.preventDefault();
193
+ }
194
+ }).on('keydown', '.no-submit', function (e) {
195
+ if (e.keyCode == 13) {
196
+ e.preventDefault();
197
+ LP.log('no submit form');
198
+ }
199
+ }).on('change keyup', '.lp-answer-text', function (e) {
200
+ var $input = $(this), $option = $input.closest('.lp-list-option'), value = $input.val() + '';
201
+ if (e.keyCode != 13) {
202
+ switch (e.keyCode) {
203
+ case 38:
204
+ case 40:
205
+ case 8:
206
+ case 46:
207
+ var pressed = $input.data('key-' + e.keyCode) || 1;
208
+ LP.log('pressed:' + pressed)
209
  if(pressed>1){if(e.keyCode==38){($prev=$input.findPrev('.key-nav'))&&$prev.focus();pressed=0}else if(e.keyCode==40){($next=$input.findNext('.key-nav'))&&$next.focus();pressed=0}else if(e.keyCode==8&&value.length==0){var $row=$input.closest('tr'),$prev=$row.prev();if($prev.length){$prev.find('.lp-answer-text').focus();$row.remove()}}else if(e.keyCode==46&&value.length==0){var $row=$input.closest('tr'),$next=$row.next();if(!$next.hasClass('lp-list-option-empty')){$next.find('.lp-answer-text').focus();$row.remove()}}
210
  $input.data('key-'+e.keyCode,0)}else{if(e.keyCode==8||e.keyCode==46){if(value.length==0){$input.data('key-'+e.keyCode,pressed+1)}}else{$input.data('key-'+e.keyCode,pressed+1)}}
211
  break}
assets/js/admin/settings.js CHANGED
@@ -22,8 +22,70 @@
22
  });
23
  }
24
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
  function _ready() {
26
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
  $('.learn-press-dropdown-pages').each(function () {
28
  $(this).change(function () {
29
  var $select = $(this),
@@ -34,7 +96,7 @@
34
  if (this.value != 'add_new_page') {
35
  if (parseInt(this.value)) {
36
  $actions.find('a.edit-page').attr('href', 'post.php?post=' + this.value + '&action=edit');
37
- $actions.find('a.view-page').attr('href', LearnPress_Settings.siteurl + '?page_id=' + this.value);
38
  $actions.removeClass('hide-if-js');
39
  $select.attr('data-selected', this.value);
40
  }
@@ -58,7 +120,7 @@
58
  }
59
 
60
  $.ajax({
61
- url : LearnPress_Settings.ajax,
62
  data : {
63
  action : 'learnpress_create_page',
64
  page_name: page_name
@@ -66,7 +128,7 @@
66
  type : 'post',
67
  dataType: 'html',
68
  success : function (response) {
69
- response = LearnPress.parseJSON(response);
70
  if (response.page) {
71
  addPageToAllDropdowns({
72
  ID : response.page.ID,
@@ -98,7 +160,19 @@
98
  } else if (e.keyCode == 27 && e.type == 'keydown') {
99
  $(this).siblings('a').trigger('click')
100
  }
101
- });
 
 
 
 
 
 
 
 
 
 
 
 
102
  $('#learn-press-admin-settings').on('click', '.nav-tab, .subsubsub > li > a', function (e) {
103
  e.preventDefault();
104
  var redirect = $(this).attr('href'),
@@ -120,6 +194,10 @@
120
  window.location.href = redirect;
121
  }
122
  });
 
 
 
 
123
  // hold current settings to know if user changed anything
124
  oldData = $('#mainform').serialize();
125
  }
22
  });
23
  }
24
 
25
+ function _insertVariableToEditor(edId, variable) {
26
+ var ed = null,
27
+ editorId = null,
28
+ activeEditor = tinyMCE.activeEditor;
29
+ for (editorId in tinyMCE.editors) {
30
+ if (editorId == edId) {
31
+ break;
32
+ }
33
+ editorId = null;
34
+ }
35
+ if (!editorId) {
36
+ _insertVariableToTextarea(edId, variable);
37
+ return;
38
+ }
39
+ if(activeEditor && $(activeEditor.getElement()).attr('id') == editorId){
40
+ activeEditor.execCommand('insertHTML', false, variable);
41
+ if($(activeEditor.getElement()).is(':visible')){
42
+ _insertVariableToTextarea(edId, variable);
43
+ }
44
+ }else{
45
+
46
+ }
47
+ }
48
+
49
+ function _insertVariableToTextarea(eId, varibale) {
50
+ var $el = $('#' + eId).get(0);
51
+ if (document.selection) {
52
+ $el.focus();
53
+ sel = document.selection.createRange();
54
+ sel.text = varibale;
55
+ $el.focus();
56
+ }
57
+ else if ($el.selectionStart || $el.selectionStart == '0') {
58
+ var startPos = $el.selectionStart;
59
+ var endPos = $el.selectionEnd;
60
+ var scrollTop = $el.scrollTop;
61
+ $el.value = $el.value.substring(0, startPos) + varibale + $el.value.substring(endPos, $el.value.length);
62
+ $el.focus();
63
+ $el.selectionStart = startPos + varibale.length;
64
+ $el.selectionEnd = startPos + varibale.length;
65
+ $el.scrollTop = scrollTop;
66
+ } else {
67
+ $el.value += varibale;
68
+ $el.focus();
69
+ }
70
+ }
71
+
72
  function _ready() {
73
 
74
+ $('#learn_press_email_formats').change(function () {
75
+ $('.learn-press-email-template.' + this.value).removeClass('hide-if-js').siblings().addClass('hide-if-js');
76
+ });
77
+ $('.learn-press-email-variables').each(function () {
78
+ var $list = $(this),
79
+ hasEditor = $list.hasClass('has-editor');
80
+ $list.on('click', 'li', function () {
81
+ if (hasEditor) {
82
+ _insertVariableToEditor($list.attr('data-target'), $(this).data('variable'));
83
+ } else {
84
+ _insertVariableToTextarea($list.attr('data-target'), $(this).data('variable'));
85
+ }
86
+ })
87
+ });
88
+
89
  $('.learn-press-dropdown-pages').each(function () {
90
  $(this).change(function () {
91
  var $select = $(this),
96
  if (this.value != 'add_new_page') {
97
  if (parseInt(this.value)) {
98
  $actions.find('a.edit-page').attr('href', 'post.php?post=' + this.value + '&action=edit');
99
+ $actions.find('a.view-page').attr('href', LP_Settings.siteurl + '?page_id=' + this.value);
100
  $actions.removeClass('hide-if-js');
101
  $select.attr('data-selected', this.value);
102
  }
120
  }
121
 
122
  $.ajax({
123
+ url : LP_Settings.ajax,
124
  data : {
125
  action : 'learnpress_create_page',
126
  page_name: page_name
128
  type : 'post',
129
  dataType: 'html',
130
  success : function (response) {
131
+ response = LP.parseJSON(response);
132
  if (response.page) {
133
  addPageToAllDropdowns({
134
  ID : response.page.ID,
160
  } else if (e.keyCode == 27 && e.type == 'keydown') {
161
  $(this).siblings('a').trigger('click')
162
  }
163
+ }).on( 'change', '.woo_payment_type', function( e ) {
164
+ e.preventDefault();
165
+
166
+ var _this = $( this ),
167
+ _value = _this.val(),
168
+ _wrapper = $( '.woocommercer_payment_available' );
169
+ if ( _value === 'payment' ) {
170
+ _wrapper.removeClass( 'hide-if-js' );
171
+ } else {
172
+ _wrapper.addClass( 'hide-if-js' );
173
+ }
174
+ return false;
175
+ } );
176
  $('#learn-press-admin-settings').on('click', '.nav-tab, .subsubsub > li > a', function (e) {
177
  e.preventDefault();
178
  var redirect = $(this).attr('href'),
194
  window.location.href = redirect;
195
  }
196
  });
197
+
198
+ if ($('#learn-press-admin-settings .subsubsub').length) {
199
+ $('#learn-press-admin-settings').removeClass('no-subtabs')
200
+ }
201
  // hold current settings to know if user changed anything
202
  oldData = $('#mainform').serialize();
203
  }
assets/js/admin/statistic.js CHANGED
@@ -38,7 +38,7 @@
38
  },
39
  dataType: 'text',
40
  success : function (response) {
41
- response = LearnPress.parseJSON(response);
42
  $container.LP_Chart_Line(response, LP_Chart_Config);
43
  $container.removeClass('loading');
44
  }
@@ -86,7 +86,7 @@
86
  },
87
  dataType: 'text',
88
  success : function (response) {
89
- response = LearnPress.parseJSON(response);
90
  $container.LP_Chart_Line(response, LP_Chart_Config);
91
  $container.removeClass('loading');
92
  }
@@ -134,7 +134,7 @@
134
  },
135
  dataType: 'text',
136
  success : function (response) {
137
- response = LearnPress.parseJSON(response);
138
  $container.LP_Chart_Line(response, LP_Chart_Config);
139
  $container.removeClass('loading');
140
  }
38
  },
39
  dataType: 'text',
40
  success : function (response) {
41
+ response = LP.parseJSON(response);
42
  $container.LP_Chart_Line(response, LP_Chart_Config);
43
  $container.removeClass('loading');
44
  }
86
  },
87
  dataType: 'text',
88
  success : function (response) {
89
+ response = LP.parseJSON(response);
90
  $container.LP_Chart_Line(response, LP_Chart_Config);
91
  $container.removeClass('loading');
92
  }
134
  },
135
  dataType: 'text',
136
  success : function (response) {
137
+ response = LP.parseJSON(response);
138
  $container.LP_Chart_Line(response, LP_Chart_Config);
139
  $container.removeClass('loading');
140
  }
assets/js/frontend/add-to-cart.js CHANGED
@@ -13,8 +13,12 @@
13
  },
14
  dataType: 'html',
15
  success: function(response){
 
16
  $button.addClass('added').removeClass('loading');
17
  $view_cart.removeClass('hide-if-js');
 
 
 
18
  }
19
  });
20
  return false;
13
  },
14
  dataType: 'html',
15
  success: function(response){
16
+ response = LP.parseJSON( response );
17
  $button.addClass('added').removeClass('loading');
18
  $view_cart.removeClass('hide-if-js');
19
+ if ( typeof response.redirect === 'string' ) {
20
+ window.location.href = response.redirect;
21
+ }
22
  }
23
  });
24
  return false;
assets/js/frontend/become-teacher.js CHANGED
@@ -9,23 +9,27 @@
9
  $submit.prop('disabled', true).html($submit.data('text-process'));
10
  if ($form.triggerHandler('become_teacher_send') !== false) {
11
  $.ajax({
12
- url : $form.attr('action'),
13
- data : $form.serialize(),
14
- dataType: 'html',
15
- type : 'post',
16
- success : function (code) {
17
- var response = LearnPress.parseJSON(code);
 
 
 
 
 
 
 
 
 
 
18
  if (response.message) {
19
  for (var n = response.message.length, i = n - 1; i >= 0; i--) {
20
  $form.prepend($(response.message[i]))
21
  }
22
  }
23
- if (response.result == 'success') {
24
- $form.find('input, select, textarea, button').prop('disabled', true);
25
- } else {
26
- $submit.prop('disabled', false);
27
- }
28
- $submit.html($submit.data('text'))
29
  }
30
  });
31
  }
9
  $submit.prop('disabled', true).html($submit.data('text-process'));
10
  if ($form.triggerHandler('become_teacher_send') !== false) {
11
  $.ajax({
12
+ url : $form.attr('action'),
13
+ data : $form.serialize(),
14
+ dataType : 'html',
15
+ type : 'post',
16
+ beforeSubmit: function () {
17
+ $form.find('input, select, textarea, button').prop('disabled', true);
18
+ },
19
+ success : function (code) {
20
+ var response = LP.parseJSON(code);
21
+
22
+ if (response.result == 'success') {
23
+ $form.find('.become-teacher-fields').remove();//find('input, select, textarea, button').prop('disabled', true);
24
+ } else {
25
+ $submit.prop('disabled', false);
26
+ $submit.html($submit.data('text'));
27
+ }
28
  if (response.message) {
29
  for (var n = response.message.length, i = n - 1; i >= 0; i--) {
30
  $form.prepend($(response.message[i]))
31
  }
32
  }
 
 
 
 
 
 
33
  }
34
  });
35
  }
assets/js/frontend/checkout.js CHANGED
@@ -1,123 +1,122 @@
1
- if (typeof window.LearnPress == 'undefined') {
2
- window.LearnPress = {};
3
  }
4
  ;
5
- (function ($) {
6
- "use strict";
7
- LearnPress.reload = function (url) {
8
- if (!url) {
9
- url = window.location.href;
10
- }
11
- window.location.href = url;
12
- }
13
- LearnPress.Checkout = {
14
- $form : null,
15
- init : function () {
16
- var $doc = $(document);
17
- this.$form = $('form[name="lp-checkout"]');
18
- $doc.on('click', 'input[name="payment_method"]', this.selectPaymentMethod);
19
- $doc.on('click', '#learn-press-checkout-login-button', this.login);
20
 
21
- $('input[name="payment_method"]:checked').trigger('click');
22
- this.$form.on('submit', this.doCheckout);
23
- },
24
- selectPaymentMethod: function () {
25
- if ($('.payment-methods input.input-radio').length > 1) {
26
- var $paymentForm = $('div.payment-method-form.' + $(this).attr('id'));
27
- if ($(this).is(':checked') && !$paymentForm.is(':visible')) {
28
- $('div.payment-method-form').filter(':visible').slideUp(250);
 
 
 
 
 
29
 
30
- $('div.payment-method-form.' + $(this).attr('id')).slideDown(250);
31
- }
32
- } else {
33
- $('div.payment-method-form ').show();
34
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
 
36
- if ($(this).data('order_button_text')) {
37
- $('#learn-press-checkout').val($('#learn-press-checkout').data('order_button_text'));
38
- } else {
39
- $('#learn-press-checkout').val($('#learn-press-checkout').data('value'));
40
- }
41
- },
42
- login : function () {
43
- var $form = $(this.form);
44
- if ($form.triggerHandler('checkout_login') !== false) {
45
- $.ajax({
46
- url : LearnPress_Settings.siteurl +'/?lp-ajax=checkout-login',
47
- dataType: 'html',
48
- data : $form.serialize(),
49
- type : 'post',
50
- success : function (response) {
51
- response = LearnPress.parseJSON(response);
52
- if (response.result == 'fail') {
53
- if (response.messages) {
54
- LearnPress.Checkout.showErrors(response.messages);
55
- } else {
56
- LearnPress.Checkout.showErrors('<div class="learn-press-error">Unknown error!</div>');
57
- }
58
- } else {
59
- if (response.redirect) {
60
- window.location.href = response.redirect;
61
- }
62
- }
63
- }
64
- })
65
- }
66
- return false;
67
- },
68
- doCheckout : function () {
69
- var $form = $(this),
70
- $place_order = $form.find( '#learn-press-checkout'),
71
- processing_text = $place_order.attr('data-processing-text'),
72
- text = $place_order.attr('value');
73
- if ($form.triggerHandler('learn_press_checkout_place_order') !== false && $form.triggerHandler('learn_press_checkout_place_order_' + $('#order_review').find('input[name=payment_method]:checked').val()) !== false) {
74
- if( processing_text ){
75
- $place_order.val(processing_text)
76
- }
77
- $place_order.prop('disabled', true);
78
- $.ajax({
79
- url : LearnPress_Settings.siteurl + '/?lp-ajax=checkout',
80
- dataType: 'html',
81
- data : $form.serialize(),
82
- type : 'post',
83
- success : function (response) {
84
- response = LearnPress.parseJSON(response);
85
- if (response.result == 'fail') {
86
- if (response.messages) {
87
- LearnPress.Checkout.showErrors(response.messages);
88
- } else {
89
- LearnPress.Checkout.showErrors('<div class="learn-press-error">Unknown error!</div>');
90
- }
91
- } else if( response.result == 'success'){
92
- if (response.redirect) {
93
- $place_order.val('Redirecting')
94
- LearnPress.reload(response.redirect);
95
- return;
96
- }
97
- }
98
- $place_order.val(text)
99
- $place_order.prop('disabled', false);
100
- },
101
- error: function( jqXHR, textStatus, errorThrown ) {
102
- LearnPress.Checkout.showErrors('<div class="learn-press-error">'+errorThrown+'</div>');
103
- $place_order.val(text)
104
- $place_order.prop('disabled', false)
105
-
106
- }
107
- })
108
- }
109
- return false;
110
- },
111
- showErrors : function (messages) {
112
- $('.learn-press-error, .learn-press-notice, .learn-press-message').remove();
113
- this.$form.prepend(messages);
114
- $('html, body').animate({
115
- scrollTop: ( LearnPress.Checkout.$form.offset().top - 100 )
116
- }, 1000);
117
- $(document).trigger('learnpress_checkout_error');
118
- }
119
- }
120
- $(document).ready(function () {
121
- LearnPress.Checkout.init()
122
- });
123
- })(jQuery);
1
+ if ( typeof window.LP === 'undefined' ) {
2
+ window.LP = {};
3
  }
4
  ;
5
+ ( function ( $ ) {
6
+ "use strict";
7
+ LP.reload = function ( url ) {
8
+ if ( !url ) {
9
+ url = window.location.href;
10
+ }
11
+ window.location.href = url;
12
+ };
13
+ LP.Checkout = {
14
+ $form: null,
15
+ init: function () {
16
+ var $doc = $( document );
17
+ this.$form = $( 'form[name="lp-checkout"]' );
18
+ $doc.on( 'click', 'input[name="payment_method"]', this.selectPaymentMethod );
19
+ $doc.on( 'click', '#learn-press-checkout-login-button', this.login );
20
 
21
+ $( 'input[name="payment_method"]:checked' ).trigger( 'click' );
22
+ this.$form.on( 'submit', this.doCheckout );
23
+ },
24
+ selectPaymentMethod: function () {
25
+ if ( $( '.payment-methods input.input-radio' ).length > 1 ) {
26
+ var $paymentForm = $( 'div.payment-method-form.' + $( this ).attr( 'id' ) );
27
+ if ( $( this ).is( ':checked' ) ) { // && !$paymentForm.is(':visible')
28
+ $( 'div.payment-method-form' ).filter( ':visible' ).slideUp( 250 );
29
+ $( this ).parents('li:first').find( '.payment-method-form.' + $( this ).attr( 'id' ) ).slideDown( 250 );
30
+ }
31
+ } else {
32
+ $( 'div.payment-method-form' ).show();
33
+ }
34
 
35
+ if ( $( this ).data( 'order_button_text' ) ) {
36
+ $( '#learn-press-checkout' ).val( $( '#learn-press-checkout' ).data( 'order_button_text' ) );
37
+ } else {
38
+ $( '#learn-press-checkout' ).val( $( '#learn-press-checkout' ).data( 'value' ) );
39
+ }
40
+ },
41
+ login: function () {
42
+ var $form = $( this.form );
43
+ if ( $form.triggerHandler( 'checkout_login' ) !== false ) {
44
+ $.ajax( {
45
+ url: LP_Settings.siteurl + '/?lp-ajax=checkout-login',
46
+ dataType: 'html',
47
+ data: $form.serialize(),
48
+ type: 'post',
49
+ success: function ( response ) {
50
+ response = LP.parseJSON( response );
51
+ if ( response.result === 'fail' ) {
52
+ if ( response.messages ) {
53
+ LP.Checkout.showErrors( response.messages );
54
+ } else {
55
+ LP.Checkout.showErrors( '<div class="learn-press-error">Unknown error!</div>' );
56
+ }
57
+ } else {
58
+ if ( response.redirect ) {
59
+ window.location.href = response.redirect;
60
+ }
61
+ }
62
+ }
63
+ } );
64
+ }
65
+ return false;
66
+ },
67
+ doCheckout: function () {
68
+ var $form = $( this ),
69
+ $place_order = $form.find( '#learn-press-checkout' ),
70
+ processing_text = $place_order.attr( 'data-processing-text' ),
71
+ text = $place_order.attr( 'value' );
72
+ if ( $form.triggerHandler( 'learn_press_checkout_place_order' ) !== false && $form.triggerHandler( 'learn_press_checkout_place_order_' + $( '#order_review' ).find( 'input[name=payment_method]:checked' ).val() ) !== false ) {
73
+ if ( processing_text ) {
74
+ $place_order.val( processing_text );
75
+ }
76
+ $place_order.prop( 'disabled', true );
77
+ $.ajax( {
78
+ url: LP_Settings.siteurl + '/?lp-ajax=checkout',
79
+ dataType: 'html',
80
+ data: $form.serialize(),
81
+ type: 'post',
82
+ success: function ( response ) {
83
+ response = LP.parseJSON( response );
84
+ if ( response.result === 'fail' ) {
85
+ if ( response.messages ) {
86
+ LP.Checkout.showErrors( response.messages );
87
+ } else {
88
+ LP.Checkout.showErrors( '<div class="learn-press-error">Unknown error!</div>' );
89
+ }
90
+ } else if ( response.result === 'success' ) {
91
+ if ( response.redirect ) {
92
+ $place_order.val( 'Redirecting' );
93
+ LP.reload( response.redirect );
94
+ return;
95
+ }
96
+ }
97
+ $place_order.val( text );
98
+ $place_order.prop( 'disabled', false );
99
+ },
100
+ error: function ( jqXHR, textStatus, errorThrown ) {
101
+ LP.Checkout.showErrors( '<div class="learn-press-error">' + errorThrown + '</div>' );
102
+ $place_order.val( text );
103
+ $place_order.prop( 'disabled', false );
104
 
105
+ }
106
+ } );
107
+ }
108
+ return false;
109
+ },
110
+ showErrors: function ( messages ) {
111
+ $( '.learn-press-error, .learn-press-notice, .learn-press-message' ).remove();
112
+ this.$form.prepend( messages );
113
+ $( 'html, body' ).animate( {
114
+ scrollTop: ( LP.Checkout.$form.offset().top - 100 )
115
+ }, 1000 );
116
+ $( document ).trigger( 'learnpress_checkout_error' );
117
+ }
118
+ };
119
+ $( document ).ready( function () {
120
+ LP.Checkout.init();
121
+ } );
122
+ } )( jQuery );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/frontend/course-lesson.js DELETED
@@ -1,210 +0,0 @@
1
- ;(function ($) {
2
- "use strict";
3
- $.LP_Course_Item = function () {
4
-
5
- }
6
- $.LP_Course_Item.Model = Backbone.Model.extend({
7
- url : function () {
8
- return this.rootUrl
9
- },
10
- rootUrl : '',
11
- initialize: function (data) {
12
- this.rootUrl = data.rootUrl;
13
- },
14
- load : function (callback) {
15
- var that = this,
16
- _completed = function (response, success) {
17
- var $html = $(response || ''),
18
- $lesson = $html.find('#learn-press-course-lesson');
19
- if ($lesson.length == 0) {
20
- $lesson = $('<div id="learn-press-course-lesson" />');
21
- }
22
- if (LearnPress.Hook.applyFilters('learn_press_update_item_content', $lesson, that) !== false) {
23
- that.set('content', $lesson);
24
- $(document).trigger('learn_press_course_item_content_replaced', $lesson, that);
25
- $('.course-item.item-current')
26
- .removeClass('item-current');
27
- $('.course-item.course-item-' + that.get('id'))
28
- .addClass('item-current');
29
- }
30
- $.isFunction(callback) && callback.call(that, response);
31
- };
32
- $.ajax({
33
- url : this.url(),
34
- dataType: 'html',
35
- success : function (response) {
36
- _completed(response, true);
37
- },
38
- error : function () {
39
- _completed('', false)
40
- }
41
- });
42
- },
43
- complete : function (args) {
44
- var that = this;
45
- args = $.extend({
46
- data : null,
47
- success: null
48
- }, args || {});
49
- $.ajax({
50
- url : LearnPress_Settings.ajax,
51
- dataType: 'html',
52
- data : $.extend({
53
- action: 'learnpress_complete_lesson',
54
- id : this.get('id')
55
- }, args.data || {}),
56
- success : function (response) {
57
- response = LearnPress.parseJSON(response);
58
- $.isFunction(args.success) && args.success.call(that, $.extend(response, {id: that.get('id')}))
59
- }
60
- })
61
- }
62
- });
63
-
64
- $.LP_Course_Item.View = Backbone.View.extend({
65
- el : '#learn-press-course-lesson',
66
- events : {
67
- 'click .complete-lesson-button': '_completeLesson'
68
- },
69
- initialize : function () {
70
- _.bindAll(this, 'updateItem', '_completeLesson');
71
- this.model.on('change', this.updateItem, this);
72
-
73
- if (LearnPress.Hook.applyFilters('learn_press_before_load_item', this) !== false) {
74
- if (this.model.get('id') /*&& this.$('input[name="learn-press-lesson-viewing"]').val() != this.model.get('id')*/) {
75
- if (this.model.get('content') == 'no-cache') {
76
- this.updateItem();
77
- } else {
78
- this.model.load();
79
- }
80
- } else if (this.model.get('content')) {
81
- LearnPress.Hook.doAction('learn_press_item_content_loaded', this.model.get('content'), this);
82
- }
83
- }
84
- },
85
- updateItem : function () {
86
- var $content = this.model.get('content');
87
- this.$el.replaceWith($content);
88
- this.setElement($content.show());
89
- var url = LearnPress.Hook.applyFilters('learn_press_set_item_url', this.model.get('rootUrl'), this);
90
- if (url) {
91
- LearnPress.setUrl(url);
92
- }
93
- $content.closest('#learn-press-content-item').show();
94
- LearnPress.Hook.doAction('learn_press_item_content_loaded', $content, this);
95
- },
96
- _autoNextItem : function (item, delay) {
97
- var $link = this.$('.course-item-next a[data-id="' + item + '"]');
98
- if (!$link.length) {
99
- return;
100
- }
101
- var duration = 3,
102
- $span = $('<span>Auto next in ' + duration + 's</span>').insertAfter(this.$('.complete-lesson-button'));
103
- setInterval(function () {
104
- duration--;
105
- $span.html('Auto next in ' + duration + 's');
106
- if (duration == 0) {
107
- $link.trigger('click')
108
- }
109
- }, 1000);
110
- },
111
- _completeLesson: function (e) {
112
- var that = this;
113
- this.model.complete({
114
- data : $(e.target).data(),
115
- success: function (response) {
116
- response = LearnPress.Hook.applyFilters('learn_press_user_complete_lesson_response', response);
117
- if (response.next_item) {
118
- //that._autoNextItem(response.next_item, 3);
119
- }
120
- LearnPress.Hook.doAction('learn_press_user_completed_lesson', response, that);
121
- }
122
- });
123
- }
124
- });
125
- $.LP_Course_Item.Collection = Backbone.Collection.extend({
126
- model : $.LP_Course_Item.Model,
127
- current : 0,
128
- lastLoaded: null,
129
-
130
- initialize: function () {
131
- var that = this;
132
- _.bindAll(this, 'initItems', 'loadItem');
133
- this.initItems();
134
- },
135
- initItems : function () {
136
- var that = this;
137
- $('.section-content .course-item').each(function () {
138
- var $li = $(this),
139
- $link = $li.find('a'),
140
- id = parseInt($link.attr('data-id')),
141
- args = {
142
- id : id,
143
- nonce : {
144
- complete: $link.attr('data-complete-nonce')
145
- },
146
- rootUrl: $link.attr('href'),
147
- type : $li.data('type')
148
- };
149
- if ($li.hasClass('item-current')) {
150
- that.current = id;
151
- //args.content = $('#learn-press-course-lesson')
152
- }
153
- var model = new $.LP_Course_Item.Model(args);
154
- that.add(model);
155
- });
156
-
157
- },
158
- loadItem : function (item, link) {
159
-
160
- if ($.isNumeric(item)) {
161
- item = this.findWhere({id: item});
162
- } else if ($.type(item) == 'string') {
163
- item = this.findWhere({rootUrl: item});
164
- } else {
165
-
166
- }
167
- if (LearnPress.Hook.applyFilters('learn_press_load_item_content', true, item, link) !== false) {
168
- if (item) {
169
- if (this.view) {
170
- this.view.undelegateEvents();
171
- //this.view.model.set('content', this.view.$el);
172
- $('.course-item.item-current')
173
- .removeClass('item-current');
174
- $('.course-item.course-item-' + item.get('id'))
175
- .addClass('item-current');
176
- }
177
- if (link) {
178
- item.set('rootUrl', link);
179
- item.rootUrl = link;
180
- }
181
- this.view = new $.LP_Course_Item.View({model: item});
182
- }
183
- }
184
- }
185
- });
186
-
187
- $.LP_Course_Item_List_View = Backbone.View.extend({
188
- model : $.LP_Course_Item.Collection,
189
- el : 'body',
190
- events : {
191
- 'click .section-content .course-item a': '_loadItem',
192
- 'click .course-item-nav a' : '_loadItem'
193
- },
194
- initialize: function (args) {
195
- _.bindAll(this, '_loadItem');
196
- },
197
- _loadItem : function (e) {
198
- e.preventDefault();
199
- var $item = $(e.target).closest('a'),
200
- id = parseInt($item.attr('data-id')),
201
- link = $item.attr('href');
202
- var item = id ? id : link;
203
- if (this.lastLoaded == item) {
204
- return;
205
- }
206
- this.model.loadItem(item, link);
207
- }
208
- });
209
-
210
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/frontend/course-quiz.js DELETED
@@ -1,46 +0,0 @@
1
- /**
2
- * Quiz functions
3
- *
4
- * @author ThimPress
5
- * @version 1.1
6
- */
7
- if (typeof LP == 'undefined') {
8
- window.LP = {};
9
- }
10
- ;(function ($, bb, _) {
11
- var Quiz = function (args) {
12
- this.model = new Quiz.Model(args);
13
- this.view = new Quiz.View({
14
- model: this.model
15
- });
16
- }, Questions = bb.Collection.extend({
17
- initialize: function () {
18
- console.log(this.length)
19
- }
20
- });
21
- Quiz.View = bb.View.extend({
22
- initialize: function () {
23
- LP.log('Quiz.View.initialize');
24
- }
25
- });
26
- Quiz.Model = bb.Model.extend({
27
- questions : null,
28
- initialize: function () {
29
- this.questions = new Questions();
30
- this.questions.add(_.values(this.get('questions')));
31
- console.log(this.questions.length);
32
- }
33
- });
34
- $.extend(LP, {
35
- Quiz : Quiz,
36
- $quiz : null,
37
- _initQuiz: function (args) {
38
- if (!this.$quiz || this.$quiz.model.get('id') != args.id) {
39
- delete this.$quiz;
40
- this.$quiz = new Quiz(args);
41
- }
42
- return this.$quiz;
43
- }
44
- });
45
- })(jQuery, Backbone, _);
46
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/frontend/course-quiz.min.js DELETED
@@ -1 +0,0 @@
1
- if(typeof LP=="undefined"){window.LP={}}(function(d,e,b){var a=function(f){this.model=new a.Model(f);this.view=new a.View({model:this.model})},c=e.Collection.extend({initialize:function(){console.log(this.length)}});a.View=e.View.extend({initialize:function(){LP.log("Quiz.View.initialize")}});a.Model=e.Model.extend({questions:null,initialize:function(){this.questions=new c();this.questions.add(b.values(this.get("questions")));console.log(this.questions.length)}});d.extend(LP,{Quiz:a,$quiz:null,_initQuiz:function(f){if(!this.$quiz||this.$quiz.model.get("id")!=f.id){delete this.$quiz;this.$quiz=new a(f)}return this.$quiz}})})(jQuery,Backbone,_);
 
assets/js/frontend/enroll.js CHANGED
@@ -1,10 +1,10 @@
1
- if (typeof window.LearnPress == 'undefined') {
2
- window.LearnPress = {};
3
  }
4
  ;
5
  (function ($) {
6
  "use strict";
7
- LearnPress.Enroll = {
8
  $form : null,
9
  init : function () {
10
  var $doc = $(document);
@@ -18,30 +18,30 @@ if (typeof window.LearnPress == 'undefined') {
18
  if (!$button.hasClass('enrolled') && $form.triggerHandler('learn_press_enroll_course') !== false ) {
19
  $button.removeClass('enrolled failed').addClass('loading');
20
  $.ajax({
21
- url : LearnPress.getUrl(),
22
  dataType: 'html',
23
  data : $form.serialize(),
24
  type : 'post',
25
  success : function (response) {
26
- response = LearnPress.parseJSON(response);
27
  if (response.result == 'fail') {
28
- if( LearnPress.Hook.applyFilters( 'learn_press_user_enroll_course_failed', course_id ) !== false ) {
29
  if (response.redirect) {
30
- LearnPress.reload(response.redirect);
31
  }
32
  }
33
  } else {
34
- if( LearnPress.Hook.applyFilters( 'learn_press_user_enrolled_course', course_id ) !== false ) {
35
  if (response.redirect) {
36
- LearnPress.reload(response.redirect);
37
  }
38
  }
39
  }
40
  },
41
- error: function( jqXHR, textStatus, errorThrown ) {
42
- LearnPress.Hook.doAction( 'learn_press_user_enroll_course_failed', course_id );
43
  $button.removeClass('loading').addClass('failed');
44
- LearnPress.Enroll.showErrors('<div class="learn-press-error">'+errorThrown+'</div>');
45
  }
46
  })
47
  }
@@ -51,7 +51,7 @@ if (typeof window.LearnPress == 'undefined') {
51
  this.removeErrors();
52
  this.$form.prepend(messages);
53
  $('html, body').animate({
54
- scrollTop: ( LearnPress.Enroll.$form.offset().top - 100 )
55
  }, 1000);
56
  $(document.body).trigger('learn_press_enroll_error');
57
  },
@@ -60,6 +60,6 @@ if (typeof window.LearnPress == 'undefined') {
60
  }
61
  }
62
  $(document).ready(function () {
63
- LearnPress.Enroll.init()
64
  });
65
  })(jQuery);
1
+ if (typeof window.LP == 'undefined') {
2
+ window.LP = {};
3
  }
4
  ;
5
  (function ($) {
6
  "use strict";
7
+ LP.Enroll = {
8
  $form : null,
9
  init : function () {
10
  var $doc = $(document);
18
  if (!$button.hasClass('enrolled') && $form.triggerHandler('learn_press_enroll_course') !== false ) {
19
  $button.removeClass('enrolled failed').addClass('loading');
20
  $.ajax({
21
+ url : LP.getUrl(),
22
  dataType: 'html',
23
  data : $form.serialize(),
24
  type : 'post',
25
  success : function (response) {
26
+ response = LP.parseJSON(response);
27
  if (response.result == 'fail') {
28
+ if (LP.Hook.applyFilters('learn_press_user_enroll_course_failed', course_id) !== false) {
29
  if (response.redirect) {
30
+ LP.reload(response.redirect);
31
  }
32
  }
33
  } else {
34
+ if (LP.Hook.applyFilters('learn_press_user_enrolled_course', course_id) !== false) {
35
  if (response.redirect) {
36
+ LP.reload(response.redirect);
37
  }
38
  }
39
  }
40
  },
41
+ error : function( jqXHR, textStatus, errorThrown ) {
42
+ LP.Hook.doAction('learn_press_user_enroll_course_failed', course_id);
43
  $button.removeClass('loading').addClass('failed');
44
+ LP.Enroll.showErrors('<div class="learn-press-error">' + errorThrown + '</div>');
45
  }
46
  })
47
  }
51
  this.removeErrors();
52
  this.$form.prepend(messages);
53
  $('html, body').animate({
54
+ scrollTop: ( LP.Enroll.$form.offset().top - 100 )
55
  }, 1000);
56
  $(document.body).trigger('learn_press_enroll_error');
57
  },
60
  }
61
  }
62
  $(document).ready(function () {
63
+ LP.Enroll.init()
64
  });
65
  })(jQuery);
assets/js/frontend/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php // Silence is golden.
assets/js/frontend/learnpress.js CHANGED
@@ -3,22 +3,25 @@
3
  * @package LearnPress/Javascript
4
  * @version 1.0
5
  */
6
- ;if (typeof window.LearnPress == 'undefined') {
7
- window.LearnPress = {};
8
  }
9
  ;(function ($) {
10
  "use strict";
11
- LearnPress = $.extend({
12
- setUrl : function (url, title) {
13
- history.pushState({}, title, url);
 
 
 
14
  },
15
- reload : function (url) {
16
  if (!url) {
17
  url = window.location.href;
18
  }
19
  window.location.href = url;
20
  },
21
- parseJSON: function (data) {
22
  var m = data.match(/<!-- LP_AJAX_START -->(.*)<!-- LP_AJAX_END -->/);
23
  try {
24
  if (m) {
@@ -27,12 +30,12 @@
27
  data = $.parseJSON(data);
28
  }
29
  } catch (e) {
30
- LearnPress.log(e);
31
  data = {};
32
  }
33
  return data;
34
  },
35
- toElement: function (element, args) {
36
  args = $.extend({
37
  delay : 300,
38
  duration: 'slow',
@@ -45,29 +48,21 @@
45
  .animate({
46
  scrollTop: $(element).offset().top - args.offset
47
  }, args.duration, args.callback);
48
- }
49
- }, LearnPress);
50
-
51
- $(document).on('submit', '#learn-press-form-login', function (e) {
52
- LearnPress.doAjax({
53
- data : {
54
- 'lp-ajax': 'login',
55
- data : $(this).serialize()
56
- },
57
- success: function (response, raw) {
58
- if (response.message) {
59
- LearnPress.alert(response.message, function () {
60
- if (response.redirect) {
61
- LearnPress.reload(response.redirect);
62
- }
63
- });
64
- } else {
65
- if (response.redirect) {
66
- LearnPress.reload(response.redirect);
67
- }
68
  }
 
 
 
69
  }
70
- })
71
- return false;
72
- });
 
 
73
  })(jQuery);
3
  * @package LearnPress/Javascript
4
  * @version 1.0
5
  */
6
+ ;if (typeof window.LP == 'undefined') {
7
+ window.LP = {};
8
  }
9
  ;(function ($) {
10
  "use strict";
11
+ LP = $.extend({
12
+ setUrlx : function (url, title) {
13
+
14
+ if (url) {
15
+ history.pushState({}, title, url);
16
+ }
17
  },
18
+ reload : function (url) {
19
  if (!url) {
20
  url = window.location.href;
21
  }
22
  window.location.href = url;
23
  },
24
+ parseJSON : function (data) {
25
  var m = data.match(/<!-- LP_AJAX_START -->(.*)<!-- LP_AJAX_END -->/);
26
  try {
27
  if (m) {
30
  data = $.parseJSON(data);
31
  }
32
  } catch (e) {
33
+ LP.log(e);
34
  data = {};
35
  }
36
  return data;
37
  },
38
+ toElement : function (element, args) {
39
  args = $.extend({
40
  delay : 300,
41
  duration: 'slow',
48
  .animate({
49
  scrollTop: $(element).offset().top - args.offset
50
  }, args.duration, args.callback);
51
+ },
52
+ showMessages: function (messages, target, code) {
53
+ $(target).find('.learn-press-error, .learn-press-notice, .learn-press-message').fadeOut();
54
+ if ($.isArray(messages)) {
55
+ for (var i = messages.length - 1; i >= 0; i--) {
56
+ var $message = $(messages[i]).hide();
57
+ $(target).prepend($message.fadeIn());
 
 
 
 
 
 
 
 
 
 
 
 
 
58
  }
59
+ } else {
60
+ var $message = $(messages).hide();
61
+ $(target).prepend($message.fadeIn());
62
  }
63
+ LP.Hook.doAction('learnpress_show_message', messages, target, code);
64
+ }
65
+ }, LP);
66
+
67
+
68
  })(jQuery);
assets/js/frontend/lesson.js ADDED
@@ -0,0 +1,107 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Single Quiz functions
3
+ *
4
+ * @author ThimPress
5
+ * @package LearnPress/JS
6
+ * @version 1.1
7
+ */
8
+ ;(function ($) {
9
+
10
+ var Lesson = function (args) {
11
+ this.model = new Lesson.Model(args);
12
+ this.view = new Lesson.View({
13
+ model: this.model
14
+ });
15
+ }, windowTarget = parent.window || window;
16
+
17
+ Lesson.Model = Backbone.Model.extend({
18
+
19
+ });
20
+ Lesson.View = Backbone.View.extend({
21
+ el : function () {
22
+ return 'body';
23
+ },
24
+ events : {
25
+ 'click .button-complete-item' : '_completeItem'
26
+ },
27
+ _completeItem : function (e) {
28
+ var that = this,
29
+ $button = $(e.target),
30
+ security = $button.data('security'),
31
+ $item = $button.closest('.course-item');
32
+ windowTarget.LP.blockContent();
33
+ return;
34
+ this.complete({
35
+ security : security,
36
+ course_id : this.model.get('courseId'),
37
+ callback : function (response, item) {
38
+ if (response.result == 'success') {
39
+ // highlight item
40
+ item.$el.removeClass('item-started').addClass('item-completed focus off');
41
+ // then restore back after 3 seconds
42
+ _.delay(function (item) {
43
+ item.$el.removeClass('focus off');
44
+ }, 3000, item);
45
+
46
+ /*that.$('.learn-press-course-results-progress').replaceWith($(response.html.progress));
47
+ $section.find('.section-header').replaceWith($(response.html.section_header));
48
+ that.$('.learn-press-course-buttons').replaceWith($(response.html.buttons));
49
+ that.currentItem.set('content', $(response.html.content))*/
50
+ windowTarget.LP.setUrl(that.model.get('permalink'));
51
+ var data = response.course_result;
52
+ data.messageType = 'update-course';
53
+ LP.sendMessage(data, windowTarget);
54
+ }
55
+ windowTarget.LP.unblockContent();
56
+ }
57
+ });
58
+ },
59
+ complete : function (args) {
60
+ var that = this;
61
+ args = $.extend({
62
+ context : null,
63
+ callback: null,
64
+ format : 'json'
65
+ }, this.model.toJSON(), args || {});
66
+ var data = {};
67
+
68
+ // Omit unwanted fields
69
+ _.forEach(args, function (v, k) {
70
+ if (($.inArray(k, ['content', 'current', 'title', 'url']) == -1) && !$.isFunction(v)) {
71
+ data[k] = v;
72
+ }
73
+ ;
74
+ });
75
+ LP.ajax({
76
+ url : this.model.get('url'),
77
+ action : 'complete-item',
78
+ data : data,
79
+ dataType: 'json',
80
+ success : function (response) {
81
+ ///response = LP.parseJSON(response);
82
+ LP.Hook.doAction('learn_press_course_item_completed', response, that);
83
+ response = LP.Hook.applyFilters('learn_press_course_item_complete_response', response, that);
84
+ $.isFunction(args.callback) && args.callback.call(args.context, response, that);
85
+ }
86
+ });
87
+ },
88
+ _validateObject: function (obj) {
89
+ var ret = {};
90
+ for (var i in obj) {
91
+ if (!$.isFunction(obj[i])) {
92
+ ret[i] = obj[i];
93
+ }
94
+ }
95
+ return ret;
96
+ }
97
+ });
98
+
99
+ window.LP_Lesson = Lesson;
100
+ $(document).ready(function () {
101
+ if (typeof LP_Lesson_Params != 'undefined') {
102
+ window.$LP_Lesson = new LP_Lesson($.extend({course: LP.$LP_Course}, LP_Lesson_Params));
103
+ }
104
+ windowTarget.LP.unblockContent();
105
+ })
106
+
107
+ })(jQuery);
assets/js/frontend/profile.js ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ;(function ($) {
2
+ "use strict";
3
+ $(document).ready(function () {
4
+ $(document).on('click', '.table-orders .cancel-order', function (e) {
5
+ e.preventDefault();
6
+ var _this = $(this),
7
+ _href = _this.attr('href');
8
+ LP.alert(learn_press_js_localize.confirm_cancel_order, function (confirm) {
9
+ if (confirm) {
10
+ window.location.href = _href;
11
+ }
12
+ });
13
+ return false;
14
+ });
15
+
16
+ $(document).on('submit', '#learn-press-form-login', function (e) {
17
+ var $form = $(this),
18
+ data = $form.serialize();
19
+ $form.find('.learn-press-error, .learn-press-notice, .learn-press-message').fadeOut();
20
+ $form.find('input').attr('disabled', true);
21
+ LP.doAjax({
22
+ data : {
23
+ 'lp-ajax': 'login',
24
+ data : data
25
+ },
26
+ success: function (response, raw) {
27
+ LP.showMessages(response.message, $form, 'LOGIN_ERROR');
28
+ if (response.result == 'error') {
29
+ $form.find('input').attr('disabled', false);
30
+ $('#learn-press-form-login input[type="text"]').focus();
31
+ }
32
+ if (response.redirect) {
33
+ LP.reload(response.redirect);
34
+ }
35
+ },
36
+ error : function () {
37
+ LP.showMessages('', $form, 'LOGIN_ERROR');
38
+ $form.find('input').attr('disabled', false);
39
+ $('#learn-press-form-login input[type="text"]').focus();
40
+ }
41
+ });
42
+ return false;
43
+ });
44
+
45
+ $('.user-profile-edit-form').on('change', 'select[name="profile_picture_type"]', function () {
46
+ var selected = $(this).val();
47
+ $('.profile-avatar-hidden, .profile-avatar-current').each(function () {
48
+ $(this).toggleClass('hide-if-js', function () {
49
+ return !$(this).hasClass(selected);
50
+ });
51
+ });
52
+ $('#profile-picture-gravatar').toggleClass('hide-if-js', selected == 'picture');
53
+ $('#profile-picture-picture').toggleClass('hide-if-js', selected != 'picture');
54
+ });
55
+
56
+ $('#learn-press-toggle-password').click(function (e) {
57
+ e.preventDefault();
58
+ var $el = $('#user_profile_password_form');
59
+ if ($el.hasClass('hide-if-js')) {
60
+ $el.removeClass('hide-if-js').hide();
61
+ }
62
+ $el.slideToggle(function () {
63
+ $el.find('input').attr('disabled', !$el.is(':visible'));
64
+ });
65
+ });
66
+ $('#learn-press-form-login input[type="text"]').focus();
67
+ });
68
+ })(jQuery);
assets/js/frontend/quiz.js ADDED
@@ -0,0 +1,852 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Single Quiz functions
3
+ *
4
+ * @author ThimPress
5
+ * @package LearnPress/JS
6
+ * @version 1.1
7
+ */
8
+ ;(function ($) {
9
+
10
+ var Quiz = function (args) {
11
+ this.model = new Quiz.Model(args);
12
+ this.view = new Quiz.View({
13
+ model: this.model
14
+ });
15
+ this.destroy = function () {
16
+ this.model.questions.forEach(function (m) {
17
+ try {
18
+ m instanceof Model_Question ? (
19
+ // prevent trigger 'sync' action
20
+ m.set('id', null),
21
+ m.destroy()
22
+ ) : false;
23
+ } catch (ex) {
24
+ console.log(ex);
25
+ }
26
+ });
27
+ this.model.set('id', null);
28
+ this.model.destroy();
29
+ this.view.destroy();
30
+ this.view.undelegateEvents();
31
+ };
32
+ }, Model_Question, List_Questions, windowTarget = parent.window || window;
33
+
34
+ Quiz.Model_Question = Model_Question = Backbone.Model.extend({
35
+ defaults : {
36
+ //question_id: 0
37
+ },
38
+ data : null,
39
+ view : false,
40
+ url : function () {
41
+ return this.urlRoot;
42
+ },
43
+ urlRoot : function () {
44
+ return 'abc';
45
+ },
46
+ initialize: function () {
47
+ },
48
+ element : function () {
49
+ return $(this.get('content'));
50
+ },
51
+ submit : function (args) {
52
+ var that = this;
53
+ args = $.extend({
54
+ complete: null,
55
+ data : {}
56
+ }, args || {});
57
+ this.fetch({
58
+ data : $.extend({
59
+ action : 'learnpress_load_quiz_question',
60
+ user_id : this.get('user_id'),
61
+ quiz_id : this.get('quiz_id'),
62
+ question_id: this.get('id')
63
+ }, args.data || {}),
64
+ complete: (function (e) {
65
+ var response = LP.parseJSON(e.responseText);
66
+ if (response.result == 'success') {
67
+ //if (!that.get('content')) {
68
+ that.set(response.question);
69
+ if (response.permalink) {
70
+ LP.setUrl(response.permalink);
71
+ }
72
+ //}
73
+ $.isFunction(args.complete) && args.complete.call(that, response);
74
+ }
75
+ })
76
+ });
77
+ },
78
+ check : function (args) {
79
+ var that = this;
80
+ if ($.isFunction(args)) {
81
+ args = {
82
+ complete: args
83
+ }
84
+ } else {
85
+ args = $.extend({
86
+ complete: null,
87
+ data : {}
88
+ }, args || {});
89
+ }
90
+ LP.doAjax({
91
+ data : $.extend({
92
+ 'lp-ajax' : 'check-question',
93
+ question_id: this.get('id')
94
+ //question_answer: $('form#learn-press-quiz-question').serializeJSON()
95
+ }, args.data || {}),
96
+ dataType: 'html',
97
+ success : function (response, raw) {
98
+ var $content = that.get('response');
99
+ if ($content) {
100
+ $content.find('.learn-press-question-options').replaceWith($(response).filter('.learn-press-question-options'));
101
+ }
102
+ that.set({checked: 'yes', response: $content});
103
+ $.isFunction(args.complete) && args.complete.call(that, response);
104
+ }
105
+ });
106
+ },
107
+ showHint : function (args) {
108
+ var that = this;
109
+ LP.doAjax({
110
+ data : $.extend({
111
+ 'lp-ajax' : 'get-question-hint',
112
+ user_id : this.get('user_id'),
113
+ quiz_id : this.get('quiz_id'),
114
+ question_id : this.get('id'),
115
+ question_answer: $('form#learn-press-quiz-question').serializeJSON()
116
+ }, args.data || {}),
117
+ success: function (response, raw) {
118
+ that.set('checked', response.checked);
119
+ $.isFunction(args.complete) && args.complete.call(that, response);
120
+ }
121
+ });
122
+ }
123
+ });
124
+ /**
125
+ * List Questions
126
+ */
127
+ Quiz.List_Questions = List_Questions = Backbone.Collection.extend({
128
+ url : 'admin-ajax.php',
129
+ urlRoot : function () {
130
+ return '';
131
+ },
132
+ len : 0,
133
+ model : Model_Question,
134
+ initialize : function () {
135
+ this.on('add', function (model) {
136
+ this.listenTo(model, 'change', this.onChange);
137
+ this.listenTo(model, 'change:hasShowedHint', this.onChangedHint);
138
+ this.listenTo(model, 'change:checked', function (a) {
139
+ if (a.changed['checked'] && a.changed['checked'] === 'yes') {
140
+ var $dom = a.get('response');
141
+ if ($dom) $dom.find('.button-check-answer').attr('disabled', true);
142
+ }
143
+ }, this);
144
+ model.set('index', this.len++);
145
+ }, this);
146
+ this.on('change:view', function () {
147
+ this.questions.view = this.get('view');
148
+ });
149
+
150
+ },
151
+ onChangedHint: function (a, b) {
152
+
153
+ },
154
+ onChange : function (a, b) {
155
+
156
+ if (a.changed['current']) {
157
+ if (a.get('current') !== 'yes') {
158
+
159
+ } else {
160
+ this.current = a;
161
+ for (var i = 0; i < this.length; i++) {
162
+ var e = this.at(i);
163
+ if (e.get('id') == a.get('id')) {
164
+ $('.question-' + e.get('id')).toggleClass('current', true);
165
+ continue;
166
+ }
167
+ if (e.get('current') != 'yes') {
168
+ continue;
169
+ }
170
+ this.stopListening(e, 'change', this.onChange);
171
+ e.set('current', 'no');
172
+ this.listenTo(e, 'change', this.onChange);
173
+ $('.question-' + e.get('id')).toggleClass('current', false)
174
+ }
175
+ try {
176
+ this.view.updateUrl();
177
+ } catch (e) {
178
+ }
179
+ }
180
+ }
181
+ }
182
+ });
183
+
184
+ Quiz.Model = Backbone.Model.extend({
185
+ _args : null,
186
+ questions : null,
187
+ initialize : function (args) {
188
+ _.bindAll(this, 'getQuizData');
189
+ this._args = args || {};
190
+ this.on('change:view', function () {
191
+ this.questions.view = this.get('view');
192
+ });
193
+ this._initQuestions();
194
+ this.set('remainingTime', args.totalTime - args.userTime);
195
+ LP.Hook.addFilter('learn_press_finish_quiz_data', this.getQuizData);
196
+
197
+ },
198
+ _initQuestions : function () {
199
+ this.questions = new List_Questions();
200
+ _.forEach(this._args.questions, function (q) {
201
+ this.questions.add(q);
202
+ }, this);
203
+ if (this.questions.length && !this.current()) {
204
+ this.questions.at(0).set('current', 'yes');
205
+ }
206
+ },
207
+ _secondsToDHMS : function (t) {
208
+ var d = Math.floor(t / (24 * 3600)), t = t - d * 24 * 3600, h = Math.floor(t / 3600), t = t - h * 3600, m = Math.floor(t / 60), s = Math.floor(t - m * 60);
209
+ return {d: d, h: h, m: m, s: s}
210
+ },
211
+ getRemainingTime : function (format) {
212
+ var t = this.get('remainingTime');
213
+ if (format == 'dhms') {
214
+ t = this._secondsToDHMS(t);
215
+ }
216
+ return t;
217
+ },
218
+ getTotalTime : function (format) {
219
+ var t = this.get('totalTime');
220
+ if (format == 'dhms') {
221
+ t = this._secondsToDHMS(t);
222
+ }
223
+ return t;
224
+ },
225
+ getUserTime : function (format) {
226
+ var t = this.get('userTime');
227
+ if (format == 'dhms') {
228
+ t = this._secondsToDHMS(t);
229
+ }
230
+ return t;
231
+ },
232
+ inc : function (seconds) {
233
+ var userTime = this.get('userTime') + (seconds || 1);
234
+ var t = {
235
+ userTime : userTime,
236
+ remainingTime: Math.max(this.get('totalTime') - userTime, 0)
237
+ };
238
+ this.set(t);
239
+ return t;
240
+ },
241
+ decr : function (seconds) {
242
+ var userTime = this.get('userTime') - (seconds || 1);
243
+ var t = {
244
+ userTime : userTime,
245
+ remainingTime: Math.max(this.get('totalTime') - userTime, 0)
246
+ };
247
+ this.set(t);
248
+ return t;
249
+ },
250
+ fetchCurrent : function (callback) {
251
+ var current = this.getCurrent(),
252
+ that = this;
253
+ if (!current) {
254
+ return;
255
+ }
256
+ LP.Hook.doAction('learn_press_before_fetch_question', current.get('id'), that);
257
+ $.ajax({
258
+ url : current.get('url'),
259
+ dataType: 'html',
260
+ success : function (response) {
261
+ that.set('response', response);
262
+ $.isFunction(callback) && callback(response, that);
263
+ }
264
+ });
265
+ },
266
+ next : function (callback, args) {
267
+ var next = this.findNext(),
268
+ that = this,
269
+ id = 0;
270
+ if (!next) {
271
+ return;
272
+ }
273
+ id = parseInt(next.get('id'));
274
+ LP.Hook.doAction('learn_press_before_next_question', id, that);
275
+ this.select(id, function (args) {
276
+ LP.Hook.doAction('learn_press_previous_question', id, that);
277
+ callback && callback.apply(null, arguments);
278
+ }, args);
279
+ },
280
+ prev : function (callback, args) {
281
+ var prev = this.findPrev(),
282
+ that = this,
283
+ id = 0;
284
+ if (!prev) {
285
+ return;
286
+ }
287
+ id = prev.get('id');
288
+ LP.Hook.doAction('learn_press_before_previous_question', id, that);
289
+ this.select(id, function () {
290
+ LP.Hook.doAction('learn_press_previous_question', id, that);
291
+ callback && callback.apply(null, arguments);
292
+ }, args);
293
+ },
294
+ select : function (id, callback, args) {
295
+ var question = this.questions.findWhere({id: parseInt(id)}),
296
+ that = this,
297
+ loadedCallback = function () {
298
+ $.isFunction(callback) && callback(question, that);
299
+ LP.Hook.doAction('learn_press_select_question', question, that);
300
+ };
301
+ if (!question) {
302
+ return;
303
+ }
304
+ if (question.get('current') === 'yes') {
305
+ windowTarget.LP.unblockContent();
306
+ return;
307
+ }
308
+ LP.Hook.doAction('learn_press_before_select_question', question, that);
309
+ question.set('current', 'yes');
310
+ if (question.get('response')) {
311
+ loadedCallback();
312
+ } else {
313
+ $.ajax({
314
+ url : question.get('url'),
315
+ data : $.extend({
316
+ id : question.get('id'),
317
+ data : $('form[name="quiz-question-content"]').serialize(),
318
+ 'lp-ajax': 'fetch-question'
319
+ }, args || {}),
320
+ dataType: 'html',
321
+ success : function (response) {
322
+ var $html = $(response).contents().find('.learn-press-content-item-summary');
323
+ question.set('response', $html);
324
+ loadedCallback();
325
+ }
326
+ });
327
+ }
328
+ },
329
+ getQuestionPosition : function (question_id) {
330
+ question_id = question_id || this.get('question_id');
331
+ return _.indexOf(this.getIds(), question_id);
332
+ },
333
+ countQuestions : function () {
334
+ return this.questions.length;
335
+ },
336
+ isLast : function (question_id) {
337
+ question_id = question_id || this.getCurrent('id');
338
+ var q = this.questions.findWhere({id: parseInt(question_id)});
339
+ return q ? q.get('index') == this.questions.length - 1 : false;
340
+ },
341
+ isFirst : function (question_id) {
342
+ question_id = question_id || this.getCurrent('id');
343
+ var q = this.questions.findWhere({id: parseInt(question_id)});
344
+ return q ? q.get('index') == 0 : false;
345
+ },
346
+ findNext : function (question_id) {
347
+ question_id = question_id || this.getCurrent('id');
348
+ var q = this.questions.findWhere({id: parseInt(question_id)}),
349
+ next = false;
350
+ if (q) {
351
+ var index = q.get('index');
352
+ next = this.questions.at(index + 1);
353
+ }
354
+ return next;
355
+ },
356
+ findPrev : function (question_id) {
357
+ question_id = question_id || this.getCurrent('id');
358
+ var q = this.questions.findWhere({id: parseInt(question_id)}),
359
+ prev = false;
360
+ if (q) {
361
+ var index = q.get('index');
362
+ prev = this.questions.at(index - 1);
363
+ }
364
+ return prev;
365
+ },
366
+ getCurrent : function (_field, _default) {
367
+ var current = this.current(),
368
+ r = _default;
369
+ if (current) {
370
+ r = current.get(_field);
371
+ }
372
+ return r;
373
+ },
374
+ current : function (create) {
375
+ var current = this.questions.findWhere({current: 'yes'});
376
+ if (!current && create) {
377
+ current = new Model_Question();
378
+ }
379
+ return current;
380
+ },
381
+ getIds : function () {
382
+ return $.map(this.get('questions'), function (i, v) {
383
+ return parseInt(i.id);
384
+ });
385
+ },
386
+ showHint : function (callback, args) {
387
+ this.current().showHint({
388
+ complete: callback,
389
+ data : this.getRequestParams(args)
390
+ });
391
+ },
392
+ checkAnswer : function (callback, args) {
393
+ if (!args) {
394
+ args = {};
395
+ }
396
+ args.question_answer = this.getQuestionAnswerData(this.current());
397
+ this.current().check({
398
+ complete: callback,
399
+ data : this.getRequestParams(args)
400
+ });
401
+ },
402
+ getRequestParams : function (args) {
403
+ var defaults = LP.Hook.applyFilters('learn_press_request_quiz_params', {
404
+ quiz_id : this.get('id'),
405
+ user_id : this.get('user_id'),
406
+ course_id: this.get('courseId')
407
+ });
408
+
409
+ return $.extend(defaults, args || {});
410
+ },
411
+ getQuestion : function (thing) {
412
+ var question = false;
413
+ if ($.isNumeric(thing)) {
414
+ question = this.questions.findWhere({id: parseInt(thing)});
415
+ } else if ($.isPlainObject(thing)) {
416
+ question = this.questions.findWhere(thing);
417
+ } else if ($.type(thing) == 'undefined' || $.type(thing) == null) {
418
+ question = this.current();
419
+ } else if (thing instanceof Model_Question) {
420
+ question = thing;
421
+ }
422
+ return question;
423
+ },
424
+ getQuizData : function (data) {
425
+ data.answers = {};
426
+ this.questions.forEach(function (model) {
427
+ data.answers[model.get('id')] = this.getQuestionAnswerData(model);
428
+ }, this);
429
+ return data;
430
+ },
431
+ getQuestionAnswerData: function (question) {
432
+ question = this.getQuestion(question);
433
+ if (!question) {
434
+ return undefined;
435
+ }
436
+ var $html = question.get('response'),
437
+ answer = {},
438
+ $form = $('<form />');
439
+ if ($html) {
440
+ var $content = $html.find('.quiz-question-content');
441
+ $form.html($content.clone());
442
+ answer = $form.serializeJSON();
443
+ }
444
+ return LP.Hook.applyFilters('learn_press_question_answer_data', answer, $form, question, this);
445
+ }
446
+ });
447
+ Quiz.View = Backbone.View.extend({
448
+ el : function () {
449
+ return 'body';
450
+ },
451
+ events : {
452
+ 'click .button-prev-question' : '_prevQuestion',
453
+ 'click .button-next-question' : '_nextQuestion',
454
+ 'click .button-hint' : '_showHint',
455
+ 'click .button-check-answer' : '_checkAnswer',
456
+ 'click .quiz-questions-list .question-title': '_selectQuestion',
457
+ 'click .button-start-quiz' : '_startQuiz',
458
+ 'click .button-finish-quiz' : '_finishQuiz',
459
+ 'click .button-retake-quiz' : '_retakeQuiz',
460
+ 'click .button-complete-item' : '_completeItem'
461
+ },
462
+ timeout : 0,
463
+ delayTimeout : 0,
464
+ delayTime : 0,
465
+ localized : null,
466
+ initialize : function () {
467
+ _.bindAll(this, 'pause', '_onTick', 'itemUrl', '_loadQuestionCompleted', '_checkAnswerCompleted', '_checkAnswer', '_onDestroy', 'destroy');
468
+ LP.Hook.addAction('learn_press_before_finish_quiz', this.destroy);
469
+ LP.Hook.addFilter('learn_press_get_current_item_url', this.itemUrl);
470
+ this.model.current(true).set('response', this.$('.learn-press-content-item-summary'));
471
+ this.model.set('view', this);
472
+ this.model.on('destroy', this._onDestroy);
473
+ this._initCountDown();
474
+ this.updateButtons();
475
+ this.windowTarget = windowTarget;
476
+ this.localized = window.learn_press_single_course_localize || {};
477
+ $(document).ready(function () {
478
+ $(window).trigger('load');
479
+ $(document).trigger('resize');
480
+ });
481
+ },
482
+ _initCountDown : function () {
483
+ if (this.model.get('status') != 'started' || this.model.get('totalTime') <= 0) {
484
+ return;
485
+ }
486
+ this.updateCountdown();
487
+ setTimeout($.proxy(function () {
488
+ this.$('.quiz-countdown').removeClass('hide-if-js');
489
+ this.start();
490
+ }, this), 500);
491
+ },
492
+ _addLeadingZero : function (n) {
493
+ return n < 10 ? "0" + n : "" + n;
494
+ },
495
+ _onDestroy : function () {
496
+ this.pause();
497
+ },
498
+ _onTick : function () {
499
+ this.timeout && clearTimeout(this.timeout);
500
+ var timer = this.model.inc();
501
+ this.updateCountdown();
502
+
503
+ if (timer.remainingTime == 0) {
504
+ LP.Hook.doAction('learn_press_quiz_timeout', this);
505
+ this.$('.button-finish-quiz').trigger('click');
506
+ return;
507
+ }
508
+ this.timeout = setTimeout(this._onTick, 1000);
509
+ },
510
+ _prevQuestion : function (e) {
511
+ e.preventDefault();
512
+ var delayTime = this.delayTime;
513
+ this._beforeFetchQuestion();
514
+ this.model.prev(this._loadQuestionCompleted, {delayTime: delayTime});
515
+ },
516
+ _nextQuestion : function (e) {
517
+ e.preventDefault();
518
+ var delayTime = this.delayTime;
519
+ this._beforeFetchQuestion();
520
+ this.model.next(this._loadQuestionCompleted, {delayTime: delayTime});
521
+ },
522
+ _selectQuestion : function (e) {
523
+ e.preventDefault();
524
+ if (this.model.get('status') == 'started') {
525
+ var id = $(e.target).closest('li').attr('data-id'),
526
+ delayTime = this.delayTime;
527
+ if (this.model.current().get('id') == id) {
528
+ return;
529
+ }
530
+ this._beforeFetchQuestion();
531
+ this.model.select(id, this._loadQuestionCompleted, {delayTime: delayTime});
532
+ }
533
+ },
534
+ _beforeFetchQuestion : function () {
535
+ windowTarget.LP.blockContent();
536
+ this.pause();
537
+ this.incrDelay(true);
538
+ this.model.current(true).set('response', this.$('.learn-press-content-item-summary'));
539
+ },
540
+ _loadQuestionCompleted: function (question, model) {
541
+ var loaded = model.get('loaded'),
542
+ $newElement = question.get('response'),
543
+ $oldElement = this.$('.learn-press-content-item-summary');
544
+ $newElement.show().insertAfter($oldElement);
545
+ $oldElement.detach();
546
+ if (this.model.get('show-list')) {
547
+ $newElement.find('.lp-group-heading-title').addClass('active');
548
+ $newElement.find('.lp-group-content-wrap').removeClass('hide-if-js');
549
+ }
550
+ this.updateButtons();
551
+ if (model.getCurrent('hasShowedHint') === 'yes') {
552
+ this.$('.button-hint').attr('disabled', true);
553
+ this.$('.question-hint-content').removeClass('hide-if-js');
554
+ } else {
555
+ this.$('.button-hint').attr('disabled', false);
556
+ this.$('.question-hint-content').addClass('hide-if-js');
557
+ }
558
+ this.start();
559
+ $(window).trigger('load');
560
+ $(document).trigger('resize');
561
+ windowTarget.LP.setUrl(question.get('url'));
562
+ windowTarget.LP.unblockContent();
563
+ },
564
+ _showHint : function (e) {
565
+ e.preventDefault();
566
+ this.model.current().set('hasShowedHint', 'yes');
567
+ this.$('.button-hint').attr('disabled', true);
568
+ this.$('.learn-press-question-hint').removeClass('hide-if-js');
569
+ },
570
+ _showHintCompleted : function (response) {
571
+ windowTarget.LP.unblockContent();
572
+ },
573
+ _checkAnswer : function (e) {
574
+ e.preventDefault();
575
+ var that = this,
576
+ $button = $(e.target),
577
+ security = $button.data('security');
578
+ windowTarget.LP.blockContent();
579
+ this.pause();
580
+ this.model.checkAnswer(this._checkAnswerCompleted, $button.data());
581
+ },
582
+ _checkAnswerCompleted : function (question) {
583
+ this.start();
584
+ this.$('.button-check-answer, .button-hint').hide();
585
+ windowTarget.LP.unblockContent();
586
+ },
587
+ updateButtons : function () {
588
+ if (this.model.get('status') === 'started') {
589
+ this.$('.button-prev-question').toggleClass('hide-if-js', this.model.isFirst());
590
+ this.$('.button-next-question').toggleClass('hide-if-js', this.model.isLast());
591
+ var current = this.model.current();
592
+ if (current) {
593
+ this.$('.button-check-answer').toggleClass('hide-if-js', current.get('hasCheckAnswer') !== 'yes');
594
+ this.$('.button-hint').toggleClass('hide-if-js', current.get('hasHint') !== 'yes');
595
+ }
596
+ }
597
+ },
598
+ start : function () {
599
+ if (this.model.get('status') != 'started' || this.model.get('totalTime') <= 0) {
600
+ return;
601
+ }
602
+ this.delayTimeout && clearTimeout(this.delayTimeout);
603
+ this._onTick();
604
+ },
605
+ pause : function () {
606
+ this.timeout && clearTimeout(this.timeout);
607
+ },
608
+ incrDelay : function (t) {
609
+ if (t) {
610
+ this.delayTime = 0;
611
+ }
612
+ this.delayTimeout && clearTimeout(this.delayTimeout);
613
+ this.delayTime++;
614
+ this.delayTimeout = setTimeout($.proxy(function () {
615
+ this.incrDelay();
616
+ }, this), 990);
617
+ },
618
+ updateCountdown : function () {
619
+ var totalTime = this.model.getTotalTime('dhms'),
620
+ remainingTime = this.model.getRemainingTime('dhms'),
621
+ strTime = [];
622
+ if (totalTime.d) {
623
+ strTime.push(this._addLeadingZero(remainingTime.d));
624
+ }
625
+ if (totalTime.h) {
626
+ strTime.push(this._addLeadingZero(remainingTime.h));
627
+ }
628
+ strTime.push(this._addLeadingZero(remainingTime.m));
629
+ strTime.push(this._addLeadingZero(remainingTime.s));
630
+ var t = parseInt(this.model.get('remainingTime') / this.model.get('totalTime') * 100);// * 360;
631
+ this.$('.quiz-countdown').attr('data-value', t).attr('data-' + this.model.get('id'), 100).toggleClass('warning-time-over', t < 10).find('.countdown').html(strTime.join(':'));
632
+ },
633
+ itemUrl : function (url, item) {
634
+ if (item.get('id') == this.model.get('id')) {
635
+ var questionName = this.model.getCurrent('name'), reg;
636
+ if (questionName && this.model.get('status') !== 'completed') {
637
+ reg = new RegExp(questionName, '');
638
+ if (!url.match(reg)) {
639
+ url = url.replace(/\/$/, '') + '/' + questionName + '/';
640
+ }
641
+ }
642
+ }
643
+ return url;
644
+ },
645
+ destroy : function () {
646
+ this.pause();
647
+ LP.Hook.removeAction('learn_press_before_finish_quiz');
648
+ LP.Hook.removeFilter('learn_press_get_current_item_url');
649
+ },
650
+ /********************************/
651
+ _submit : function (args) {
652
+ var data = {};
653
+ data = this.model.getQuizData(data);
654
+
655
+ args = $.extend({
656
+ security: '',
657
+ action : ''
658
+ }, args || {});
659
+ windowTarget.LP.blockContent();
660
+ LP.Hook.doAction('learn_press_before_start_quiz', this.currentItem, this);
661
+ var $form = this.$('form.quiz-buttons');
662
+ this.model.questions.forEach(function (m) {
663
+ var $content = m.get('response');
664
+ if (!$content) {
665
+ return;
666
+ }
667
+ var $question = $content.find('.quiz-question-content').clone().hide();
668
+ $form.append($question);
669
+ });
670
+ $form.find('input[name="security"]').val(args.security);
671
+ $form.find('input[name="lp-ajax"]').val(args.action);
672
+ var extraArgs = _.omit(args, ['security', 'action']);
673
+ _.forEach(extraArgs, function (v, k) {
674
+ $form.append('<input type="hidden" name="' + k + '" value="' + v + '" />');
675
+ });
676
+ $form.submit();
677
+ },
678
+ _confirm : function (localize, onYes, onNo) {
679
+ var that = this,
680
+ loc = this.localized[localize] || {},
681
+ message = loc.message || '',
682
+ title = loc.title || '';
683
+ windowTarget.jConfirm(message, title, function (confirm) {
684
+ if (confirm && $.isFunction(onYes)) {
685
+ onYes.call(that);
686
+ } else if ($.isFunction(onNo)) {
687
+ onNo.call(that);
688
+ }
689
+ });
690
+ },
691
+ _startQuiz : function (e) {
692
+ var that = this,
693
+ $button = $(e.target);
694
+ windowTarget.LP.Hook.doAction('learn_press_before_start_quiz', this);
695
+ this._submit($button.data());
696
+ return false;
697
+ },
698
+ _finishQuiz : function (e) {
699
+ var that = this,
700
+ $button = $(e.target);
701
+ e.preventDefault();
702
+ if (typeof e.originalEvent === 'undefined') {
703
+ windowTarget.LP.Hook.doAction('learn_press_before_finish_quiz', this);
704
+ that._submit($.extend($button.data(), {auto_finish: 'yes'}));
705
+ } else {
706
+ this._confirm('confirm_finish_quiz', function () {
707
+ windowTarget.LP.Hook.doAction('learn_press_before_finish_quiz', this);
708
+ that._submit($button.data());
709
+ });
710
+ }
711
+ return false;
712
+ },
713
+ _doFinishQuiz : function (security) {
714
+ var that = this;
715
+ LP.Hook.doAction('learn_press_before_finish_quiz', that.currentItem, that);
716
+ that.finishQuiz({
717
+ security : security,
718
+ beforeSend: windowTarget.LP.blockContent(),
719
+ callback : function (response, item) {
720
+ windowTarget.LP.unblockContent();
721
+ that.$('#learn-press-content-item').html(response.html.content);
722
+ windowTarget.LP.setUrl(that.model.get('permalink'));
723
+ var data = response.course_result;
724
+ data.messageType = 'update-course';
725
+ LP.sendMessage(data, windowTarget);
726
+ }
727
+ });
728
+ },
729
+ _retakeQuiz : function (e) {
730
+ e.preventDefault();
731
+ var that = this,
732
+ $button = $(e.target);
733
+ this._confirm('confirm_retake_quiz', function () {
734
+ LP.Hook.doAction('learn_press_before_retake_quiz', this);
735
+ that._submit($button.data());
736
+ });
737
+ return false;
738
+ },
739
+
740
+ complete : function (args) {
741
+ var that = this;
742
+ args = $.extend({
743
+ context : null,
744
+ callback: null,
745
+ format : 'json'
746
+ }, this.toJSON(), args || {});
747
+ var data = {};
748
+
749
+ // Omit unwanted fields
750
+ _.forEach(args, function (v, k) {
751
+ if (($.inArray(k, ['content', 'current', 'title', 'url']) == -1) && !$.isFunction(v)) {
752
+ data[k] = v;
753
+ }
754
+ ;
755
+ });
756
+ LP.ajax({
757
+ url : this.get('url'),
758
+ action : 'complete-item',
759
+ data : data,
760
+ dataType: 'json',
761
+ success : function (response) {
762
+ ///response = LP.parseJSON(response);
763
+ LP.Hook.doAction('learn_press_course_item_completed', response, that);
764
+ response = LP.Hook.applyFilters('learn_press_course_item_complete_response', response, that);
765
+ $.isFunction(args.callback) && args.callback.call(args.context, response, that);
766
+ }
767
+ });
768
+ },
769
+ startQuiz : function (args) {
770
+ var args = $.extend({
771
+ course_id: this.model.get('courseId'),
772
+ quiz_id : this.model.get('id'),
773
+ security : null
774
+ }, args || {});
775
+ var data = this._validateObject(args), that = this;
776
+ LP.ajax({
777
+ url : this.model.get('url'),
778
+ action : 'start-quiz',
779
+ data : data,
780
+ dataType: 'json',
781
+ success : function (response) {
782
+ $.isFunction(args.callback) && args.callback.call(args.context, response, that);
783
+ }
784
+ });
785
+ },
786
+ finishQuiz : function (args) {
787
+ var args = $.extend({
788
+ course_id: this.model.get('courseId'),
789
+ quiz_id : this.model.get('id'),
790
+ security : null
791
+ }, args || {});
792
+ var data = this._validateObject(args), that = this;
793
+ data = LP.Hook.applyFilters('learn_press_finish_quiz_data', data);
794
+ var beforeSend = args.beforeSend || function () {
795
+ };
796
+ LP.ajax({
797
+ url : this.model.get('url'),
798
+ action : 'finish-quiz',
799
+ data : data,
800
+ dataType : 'json',
801
+ beforeSend: beforeSend,
802
+ success : function (response) {
803
+ windowTarget.LP.unblockContent();
804
+ $.isFunction(args.callback) && args.callback.call(args.context, response, that);
805
+ }
806
+ });
807
+ },
808
+ retakeQuiz : function (args) {
809
+ var args = $.extend({
810
+ course_id: this.model.get('courseId'),
811
+ quiz_id : this.model.get('id'),
812
+ security : null
813
+ }, args || {});
814
+ var data = this._validateObject(args), that = this;
815
+ LP.ajax({
816
+ url : this.model.get('url'),
817
+ action : 'retake-quiz',
818
+ data : data,
819
+ dataType : 'json',
820
+ beforeSend: function () {
821
+ windowTarget.LP.blockContent();
822
+ },
823
+ success : function (response) {
824
+ windowTarget.LP.unblockContent();
825
+ $.isFunction(args.callback) && args.callback.call(args.context, response, that);
826
+ }
827
+ });
828
+ },
829
+ _toJSON : function () {
830
+ // call parent method
831
+ var json = Course_Item.__super__.toJSON.apply(this, arguments);
832
+ },
833
+ _validateObject: function (obj) {
834
+ var ret = {};
835
+ for (var i in obj) {
836
+ if (!$.isFunction(obj[i])) {
837
+ ret[i] = obj[i];
838
+ }
839
+ }
840
+ return ret;
841
+ }
842
+ });
843
+
844
+ window.LP_Quiz = Quiz;
845
+ $(document).ready(function () {
846
+ if (typeof LP_Quiz_Params != 'undefined') {
847
+ window.$LP_Quiz = new LP_Quiz($.extend({course: LP.$LP_Course}, LP_Quiz_Params));
848
+ }
849
+ windowTarget.LP.unblockContent();
850
+ });
851
+
852
+ })(jQuery);
assets/js/frontend/shortcodes.js CHANGED
@@ -34,7 +34,7 @@ jQuery(function ($) {
34
 
35
  var options = getDataOptions();
36
 
37
- function getDataOptions() {
38
  var dataOptions = carouselElement.data();
39
  for(var op in defaultOptions){
40
  var prop = op.toLowerCase();
34
 
35
  var options = getDataOptions();
36
 
37
+ function getDataOptions() {
38
  var dataOptions = carouselElement.data();
39
  for(var op in defaultOptions){
40
  var prop = op.toLowerCase();
assets/js/frontend/single-course.js CHANGED
@@ -1,220 +1,716 @@
1
  /**
2
  * Single course functions
3
  */
4
- if (typeof LearnPress == 'undefined') {
5
- window.LearnPress = {}
6
  }
7
  ;(function ($) {
8
  "use strict";
9
  LearnPress.Course = $.extend(
10
  LearnPress.Course || {}, {
11
  finish: function (data, callback) {
12
- LearnPress.$Course && LearnPress.$Course.finishCourse({data: data, success: callback});
13
  }
14
  }
15
  );
16
- var LearnPress_View_Course = window.LearnPress_View_Course = Backbone.View.extend({
17
- $doc : null,
18
- $body : null,
19
- courseItems : null,
20
- courseItemsView : null,
21
- el : '.course-summary',
22
- events : {
23
- //'click .curriculum-sections .section-content > li a': '_loadLesson',
24
- //'click .course-item-nav a': '_loadLesson',
25
- 'click #learn-press-finish-course': '_finishCourse'
26
- },
27
- initialize : function (args) {
28
-
29
-
30
- var id = parseInt($('.course-item.item-current').find('>a').attr('data-id')),
31
- item = null;
32
- if (id) {
33
- $('[id="learn-press-course-lesson"]').html('')
34
- //this.model.loadItem(item);
35
- }
36
- this.courseItems = new $.LP_Course_Item.Collection();
37
- this.courseItemsView = new $.LP_Course_Item_List_View({model: this.courseItems});
38
-
39
- if (id) {
40
- this.courseItems.loadItem(id);
41
- }
42
-
43
- _.bindAll(this, '_finishCourse', '_sanitizeProgress', 'completeLesson');
44
- this.$doc = $(document);
45
- this.$body = $(document.body);
46
- LearnPress.Hook.addFilter('learn_press_before_load_item', function ($view) {
47
- LearnPress.MessageBox.blockUI();
48
- if ($view.model.get('type') == 'lp_quiz') {
49
- var redirect = LearnPress.Hook.applyFilters('learn_press_course_item_redirect_url', $('.course-item-' + $view.model.get('id') + ' a').prop('href'), $view);
50
- if (redirect !== false) {
51
- var win = window.open(redirect, '_blank');
52
- try {
53
- win.focus();
54
- } catch (e) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
55
  }
 
 
 
56
  }
57
  }
58
- return true;
59
- });
60
- LearnPress.Hook
61
- .addAction('learn_press_item_content_loaded', this.itemLoaded)
62
- .addAction('learn_press_user_completed_lesson', this.completeLesson)
63
- .addAction('learn_press_user_passed_course_condition', function () {
64
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
65
 
66
- this._sanitizeProgress();
 
 
67
 
 
68
  },
69
- itemLoaded : function ($content, $view) {
70
- LearnPress.toElement('#learn-press-course-lesson-heading');
71
- LearnPress.MessageBox.hide();
 
72
  },
73
- completeLesson : function (response, that) {
74
- if (response && response.result == 'success') {
75
- var $button = this.$('.complete-lesson-button').addClass('completed').prop('disabled', true).html(response.button_text);
76
- $('.course-item-' + response.id).addClass('item-completed');
77
- if (response.course_result) {
78
- if (response.can_finish) {
79
- this.$('#learn-press-finish-course').removeClass('hide-if-js');
80
- LearnPress.Hook.doAction('learn_press_user_passed_course_condition', response, this, that);
81
- }
82
- if (response.message) {
83
- $(response.message).insertBefore($button);
84
- }
85
- this.updateProgress(response);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
86
  }
 
 
 
 
 
 
 
87
  }
88
  },
89
- updateProgress : function (data) {
90
- $('.lp-course-progress')
91
- .attr({
92
- 'data-value': data.course_result
93
- })
94
- this._sanitizeProgress();
95
  },
96
- _loadLesson : function (e) {
97
- this.loadLesson($(e.target).attr('href'));
 
 
 
98
  },
99
- loadLesson : function (permalink, args) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
100
  var that = this;
101
- LearnPress.Hook.doAction('learn_press_before_load_lesson', permalink, this);
102
- args = $.extend({
103
- success: function () {
104
- return true;
105
- },
106
- error : function () {
107
- }
108
- }, args || {})
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
109
 
110
- $.ajax({
111
- url : permalink,
112
- success: function (response) {
113
- var ret = true;
114
- $.isFunction(args.success) && ( ret = args.success.call(this, response) );
115
- if (ret === true) {
116
- var $html = $(response),
117
- $newLesson = $html.find('#learn-press-course-lesson-summary'),
118
- $newHeading = $html.find('#learn-press-course-lesson-heading');
119
-
120
- $('title').html($html.filter('title').text());
121
- $('#learn-press-course-description-heading, #learn-press-course-lesson-heading').replaceWith($newHeading)
122
- $('#learn-press-course-description, #learn-press-course-lesson-summary').replaceWith($newLesson);
123
-
124
- LearnPress.Hook.doAction('learn_press_load_lesson_completed', permalink, that);
125
- LearnPress.Hook.doAction('learn_press_lesson_content_loaded', $html, this);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
126
 
 
 
 
 
127
  }
128
- },
129
- error : function () {
130
- // TODO: handle the error here
131
- LearnPress.MessageBox.hide();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
132
  }
133
- })
134
  },
135
  _finishCourse : function (e) {
136
- var that = this,
137
- $button = $(e.target),
138
- data = $button.data();
139
- data = LearnPress.Hook.applyFilters('learn_press_user_finish_course_data', data);
140
- if (data && data.id) {
141
- $button.prop('disabled', true);
142
- this.finishCourse({
143
- data : data,
144
- success: function (response) {
145
- LearnPress.Hook.applyFilters('learn_press_finish_course_params', response);
146
-
147
- if (response && response.result == 'success') {
148
- that.$('#learn-press-finish-course, .complete-lesson-button').remove();
149
- LearnPress.Hook.doAction('learn_press_finish_course', response);
150
- }
151
- if (response.message) {
152
- LearnPress.alert(response.message, function () {
153
- if (response.redirect) {
154
- LearnPress.reload(response.redirect);
155
  }
156
- });
157
- } else {
158
- if (response.redirect) {
159
- LearnPress.reload(response.redirect);
160
  }
161
- }
162
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
163
  });
164
  }
165
  },
166
- finishCourse : function (args) {
167
- args = args || {};
168
- var _do = function (e) {
169
- if (e) {
170
- LearnPress.doAjax({
171
- prefix : '',
172
- data : data,
173
- success: _success
174
- });
175
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
176
  },
177
- _success = function (response) {
178
- $.isFunction(args.success) && args.success.call(that, response);
 
 
 
 
 
 
 
 
 
 
 
 
 
179
  },
180
- that = this,
181
- data = $.extend({
182
- 'lp-ajax': 'finish_course'
183
- }, args.data || {});
184
- LearnPress.confirm(single_course_localize.confirm_finish_course, _do);
185
- },
186
- _sanitizeProgress: function () {
187
- var $el = $('.lp-course-progress'),
188
- $progress = $('.lp-progress-value', $el),
189
- $passing = $('.lp-passing-conditional', $el),
190
- value = parseFloat($el.attr('data-value')),
191
- passing_condition = parseFloat($el.attr('data-passing-condition')),
192
- _done = function () {
193
- var progress = parseInt($progress.css('width')),
194
- passing = parseInt($passing.css('left'));
195
-
196
- if (value >= passing_condition) {
197
- $el.addClass('passed');
198
- }
199
- };
200
- $progress.css('width', value + '%').find('span span').html(value);
201
- setTimeout(_done, 500);
202
-
203
  }
204
  });
205
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
206
  $(document).ready(function () {
207
- //LearnPress.Course.init( $(this), $(document.body) );
208
- LearnPress.$Course = new LearnPress_View_Course();
 
 
 
 
209
 
210
- LearnPress.Hook.addAction('learn_press_item_content_loaded', function (a, b) {
211
- setTimeout(function () {
212
- try {
213
- //console.log(a.html())
214
- window.wp.mediaelement.initialize();
215
- } catch (e) {
216
- }
217
- }, 300);
218
- })
219
  });
 
 
 
 
 
 
 
 
 
 
 
 
220
  })(jQuery);
1
  /**
2
  * Single course functions
3
  */
4
+ if (typeof LearnPress === 'undefined') {
5
+ window.LP = window.LearnPress = {};
6
  }
7
  ;(function ($) {
8
  "use strict";
9
  LearnPress.Course = $.extend(
10
  LearnPress.Course || {}, {
11
  finish: function (data, callback) {
12
+ LearnPress.$LP_Course && LearnPress.$LP_Course.finishCourse({data: data, success: callback});
13
  }
14
  }
15
  );
16
+
17
+ var Course = function (args) {
18
+ this.model = new Course.Model(args);
19
+ this.view = new Course.View({
20
+ model: this.model
21
+ });
22
+ },
23
+ Template = function (id, tmpl_data) {
24
+ var compiled,
25
+ options = {
26
+ evaluate : /<#([\s\S]+?)#>/g,
27
+ interpolate: /\{\{\{([\s\S]+?)\}\}\}/g,
28
+ escape : /\{\{([^\}]+?)\}\}(?!\})/g,
29
+ variable : 'data'
30
+ },
31
+ template = function (data) {
32
+ compiled = compiled || _.template($('#learn-press-template-' + id).html(), null, options);
33
+ return compiled(data);
34
+ };
35
+ return tmpl_data ? $(template(tmpl_data)) : template;
36
+ },
37
+ Course_Item = window.Course_Item = Backbone.Model.extend({
38
+ initialize : function () {
39
+ this.on('change:content', this._changeContent);
40
+ this.on('change:current', this._changeCurrent);
41
+ },
42
+ _changeContent : function () {
43
+ LP.Hook.doAction('learn_press_update_item_content', this);
44
+ },
45
+ _changeCurrent : function (m) {
46
+
47
+ },
48
+ request : function (args) {
49
+ var that = this;
50
+ if (!this.get('url')) {
51
+ return false;
52
+ }
53
+ args = $.extend({
54
+ context : null,
55
+ callback: null
56
+ }, args || {});
57
+ LP.ajax({
58
+ url : this.get('url'),
59
+ action : 'load-item',
60
+ data : $.extend({
61
+ format: 'html'
62
+ }, this.toJSON()),
63
+ dataType: 'html',
64
+ success : function (response) {
65
+ LP.Hook.doAction('learn_press_course_item_loaded', response, that);
66
+ response = LP.Hook.applyFilters('learn_press_course_item_content', response, that);
67
+ $.isFunction(args.callback) && args.callback.call(args.context, response, that);
68
+ }
69
+ });
70
+ return this;
71
+ },
72
+ complete : function (args) {
73
+ var that = this;
74
+ args = $.extend({
75
+ context : null,
76
+ callback: null,
77
+ format : 'json'
78
+ }, this.toJSON(), args || {});
79
+ var data = {};
80
+
81
+ // Omit unwanted fields
82
+ _.forEach(args, function (v, k) {
83
+ if (($.inArray(k, ['content', 'current', 'title', 'url']) == -1) && !$.isFunction(v)) {
84
+ data[k] = v;
85
+ }
86
+ ;
87
+ });
88
+ LP.ajax({
89
+ url : this.get('url'),
90
+ action : 'complete-item',
91
+ data : data,
92
+ dataType: 'json',
93
+ success : function (response) {
94
+ ///response = LP.parseJSON(response);
95
+ LP.Hook.doAction('learn_press_course_item_completed', response, that);
96
+ response = LP.Hook.applyFilters('learn_press_course_item_complete_response', response, that);
97
+ $.isFunction(args.callback) && args.callback.call(args.context, response, that);
98
+ }
99
+ });
100
+ },
101
+ start : function (args) {
102
+ var args = $.extend({
103
+ course_id: 0,
104
+ quiz_id : this.get('id'),
105
+ security : null
106
+ }, args || {});
107
+ var data = this._validateObject(args), that = this;
108
+ LP.ajax({
109
+ url : this.get('url'),
110
+ action : 'start-quiz',
111
+ data : data,
112
+ dataType: 'json',
113
+ success : function (response) {
114
+ $.isFunction(args.callback) && args.callback.call(args.context, response, that);
115
+ }
116
+ });
117
+ },
118
+ finishQuiz : function (args) {
119
+ var args = $.extend({
120
+ course_id: 0,
121
+ quiz_id : this.get('id'),
122
+ security : null
123
+ }, args || {});
124
+ var data = this._validateObject(args), that = this;
125
+ data = LP.Hook.applyFilters('learn_press_finish_quiz_data', data);
126
+ var beforeSend = args.beforeSend || function () {
127
+ };
128
+ LP.ajax({
129
+ url : this.get('url'),
130
+ action : 'finish-quiz',
131
+ data : data,
132
+ dataType : 'json',
133
+ beforeSend: beforeSend,
134
+ success : function (response) {
135
+ LP.unblockContent();
136
+ $.isFunction(args.callback) && args.callback.call(args.context, response, that);
137
+ }
138
+ });
139
+ },
140
+ retakeQuiz : function (args) {
141
+ var args = $.extend({
142
+ course_id: 0,
143
+ quiz_id : this.get('id'),
144
+ security : null
145
+ }, args || {});
146
+ var data = this._validateObject(args), that = this;
147
+ LP.ajax({
148
+ url : this.get('url'),
149
+ action : 'retake-quiz',
150
+ data : data,
151
+ dataType : 'json',
152
+ beforeSend: function () {
153
+ LP.blockContent();
154
+ },
155
+ success : function (response) {
156
+ LP.unblockContent();
157
+ $.isFunction(args.callback) && args.callback.call(args.context, response, that);
158
+ }
159
+ });
160
+ },
161
+ _toJSON : function () {
162
+ // call parent method
163
+ var json = Course_Item.__super__.toJSON.apply(this, arguments);
164
+ },
165
+ _validateObject: function (obj) {
166
+ var ret = {};
167
+ for (var i in obj) {
168
+ if (!$.isFunction(obj[i])) {
169
+ ret[i] = obj[i];
170
+ }
171
+ }
172
+ return ret;
173
+ }
174
+ }),
175
+ Course_Items = Backbone.Collection.extend({
176
+ model : Course_Item,
177
+ current : null,
178
+ len : 0,
179
+ initialize : function () {
180
+
181
+ this.on('add', function (model) {
182
+ this.listenTo(model, 'change', this.onChange);
183
+ model.set('index', this.len++);
184
+ }, this);
185
+
186
+ },
187
+ onChange : function (a, b) {
188
+ if (a.get('current') == true) {
189
+ this.current = a;
190
+ for (var i = 0; i < this.length; i++) {
191
+ var e = this.at(i);
192
+ if (e.get('id') == a.get('id')) {
193
+ continue;
194
+ }
195
+ if (e.get('current') == false) {
196
+ continue;
197
  }
198
+ this.stopListening(e, 'change', this.onChange);
199
+ e.set('current', false);
200
+ this.listenTo(e, 'change', this.onChange);
201
  }
202
  }
203
+ a.$el && a.$el.toggleClass('item-current', a.get('current'));
204
+ },
205
+ getNextItem: function () {
206
+ var next = false;
207
+ if (this.current) {
208
+ var index = this.current.get('index') + 1;
209
+ next = this.at(index);
210
+ while (next && !next.$el.hasClass('viewable')) {
211
+ index++;
212
+ next = this.at(index);
213
+ if (!next || index > 1000) {
214
+ break;
215
+ }
216
+ }
217
+ }
218
+ return next;
219
+ },
220
+ getPrevItem: function () {
221
+ var prev = false;
222
+ if (this.current) {
223
+ var index = this.current.get('index') - 1;
224
+ if (index >= 0) {
225
+ prev = this.at(index);
226
+ while (!prev.$el.hasClass('viewable')) {
227
+ index--;
228
+ prev = this.at(index);
229
+ if (!prev || index < 0) {
230
+ break;
231
+ }
232
+ }
233
+ }
234
+ }
235
+ return prev;
236
+ }
237
+ });
238
+ Course.View = Backbone.View.extend({
239
+ el : 'body', //'.course-summary',
240
+ itemEl : null,
241
+ cached : {},
242
+ events : {
243
+ 'click .viewable .button-load-item': '_loadItem',
244
+ 'click .prev-item, .next-item' : '_loadItem',
245
+ 'click .viewable' : '_loadItem',
246
+ 'click .section-header' : '_toggleSection',
247
+ 'click .learn-press-nav-tab' : '_tabClick',
248
+ /*'click .button-start-quiz' : '_startQuiz',
249
+ 'click .button-finish-quiz' : '_finishQuiz',
250
+ 'click .button-retake-quiz' : '_retakeQuiz',
251
+ 'click .button-complete-item' : '_completeItem',*/
252
+ 'click .button-retake-course' : '_retakeCourse',
253
+ 'click .button-finish-course' : '_finishCourse'
254
+
255
+ //'click #learn-press-button-complete-item': '_c'
256
+ },
257
+ itemLoading : 0,
258
+ currentItem : null,
259
+ initialize : function () {
260
+ var $item = this.$('.course-item');
261
+ _.bindAll(this, 'receiveMessage', 'pushContent', 'onPopState', 'updateItemContent', '_tabClick', '_showPopup', 'removePopup');
262
+ this.itemEl = this.$('#learn-press-content-item');
263
+ this.model.items.forEach(function (v, k) {
264
+ v.course = this;
265
+ v.$el = $item.filter('.course-item-' + v.get('id'));
266
+ }, this);
267
+ this._initHooks();
268
+ this._loadDefaultContent();
269
 
270
+ if (typeof window.onpopstate !== 'undefined') {
271
+ $(window).on('popstate', this.onPopState);
272
+ }
273
 
274
+ LP.Hook.addAction('learn_press_receive_message', this.receiveMessage);
275
  },
276
+ receiveMessage : function (data) {
277
+ if (data.messageType === 'update-course') {
278
+ this.update(data);
279
+ }
280
  },
281
+ update : function (data) {
282
+ if (!data) {
283
+ return;
284
+ }
285
+ var itemsCount = data.items ? data.items.length : 0,
286
+ itemsCompleted = 0,
287
+ sections = {},
288
+ $progress = this.$('.course-progress').find('.number, .percentage-sign'),
289
+ $itemProgress = this.$('.items-progress').find('.number, .percentage-sign');
290
+ $progress.eq(0).html(parseInt(data.results));
291
+
292
+ data.items && data.items.forEach(function (item) {
293
+ var $item = this.$('.course-item.course-item-' + item.id);
294
+ if (!sections[item.section_id]) {
295
+ sections[item.section_id] = [0, 0];
296
+ }
297
+ if (item.status === 'completed') {
298
+ itemsCompleted++;
299
+ $item.addClass('item-has-status item-completed');
300
+ sections[item.section_id][1]++;
301
+ } else if (item.status) {
302
+ $item.addClass('item-has-status').removeClass('item-completed');
303
+ } else {
304
+ $item.removeClass('item-has-status').removeClass('item-completed');
305
+ }
306
+ if (item.type === 'lp_quiz') {
307
+ $item.find('.item-result').html(LP.Hook.applyFilters('item_result_text', item.results + '%'));
308
+ }
309
+ sections[item.section_id][0]++;
310
+ }, this);
311
+ this.$('.curriculum-sections .section').each(function () {
312
+ var $section = $(this),
313
+ id = $section.data('id'),
314
+ data = sections[id];
315
+ if(!data){
316
+ return;
317
  }
318
+ $section.find('.section-header span.step').html(LP.Hook.applyFilters('section_header_span_text', data[1] + '/' + data[0]));
319
+ });
320
+ $itemProgress.eq(0).html(data.completed_items_text.replace('%d', itemsCompleted).replace('%d', itemsCount));
321
+ var passingCondition = parseInt(this.$('.course-progress .lp-course-progress').data('passing-condition'));
322
+ this.$('.button-finish-course').toggleClass('hide-if-js', !(data.results >= passingCondition));
323
+ if (data.setUrl) {
324
+ LP.setUrl(data.setUrl);
325
  }
326
  },
327
+ getHash : function (url) {
328
+ var courseUrl = this.model.get('url'),
329
+ hash = url.replace(courseUrl, '');
330
+ return hash;
 
 
331
  },
332
+ onPopState : function () {
333
+ var hash = this.getHash(window.location.href);
334
+ if (!hash) {
335
+ return;
336
+ }
337
  },
338
+ pushContent : function (url) {
339
+ var hash = this.getHash(url);
340
+ if (!hash) {
341
+ return;
342
+ }
343
+ this.cached[hash] = Math.random();
344
+ //console.log('push:' + hash)
345
+ },
346
+ _initHooks : function () {
347
+ LP.Hook.addAction('learn_press_update_item_content', this.updateItemContent);
348
+ LP.Hook.addAction('learn_press_set_location_url', this.pushContent);
349
+
350
+ $(document).on('learn_press_popup_course_remove', this.removePopup);
351
+ },
352
+ _loadDefaultContent: function () {
353
  var that = this;
354
+ setTimeout(function () {
355
+ that.$('.course-item.item-current .button-load-item').trigger('click', {force: true});
356
+ }, 500);
357
+ },
358
+ _loadItem : function (e, f) {
359
+ e.preventDefault();
360
+ var that = this,
361
+ $target = $(e.target),
362
+ id = $target.hasClass('button-load-item') ? $target.data('id') : $target.find('.button-load-item').data('id');
363
+ f = f || {force: false};
364
+ if (!id || this.itemLoading) {
365
+ return;
366
+ }
367
+ if ($target.closest('.course-item').hasClass('item-current') && !f.force) {
368
+ return;
369
+ }
370
+ this.blockContent();
371
+ if (this.currentItem) {
372
+ var $iframe = this.currentItem.get('content');
373
+ $iframe && $iframe.detach();
374
+ }
375
+ this.itemLoading = id;
376
+ this.currentItem = this.model.getItem(id);
377
+ this.showPopup();
378
+ var $content = this.currentItem.get('content'),
379
+ isNew = !($content && $content.length);
380
+ if (!$content) {
381
+ $content = $('<iframe />');
382
+ this.currentItem.set('content', $content);
383
+ }
384
 
385
+ that.viewItem(id);
386
+ this.$('#popup-content-inner').html($content);
387
+ if (isNew) {
388
+ $content.attr('src', LP.addQueryVar('content-item-only', 'yes', this.currentItem.get('url')));
389
+ }
390
+ $content.unbind('load').load(function () {
391
+ that.itemLoading = 0;
392
+ });
393
+ },
394
+ viewItem : function (id, args) {
395
+ var item = this.model.getItem(id);
396
+ if (item) {
397
+ item.set('current', true);
398
+ }
399
+ this.itemEl.show();
400
+ this.currentItem = item;
401
+ this.$('.item-current').removeClass('item-current');
402
+ this.$('.course-item [data-id="' + item.get('id') + '"]').parent().addClass('item-current');
403
+ this.$('#course-curriculum-popup').attr('data-item-id', item.get('id'));
404
+ this.updateUrl();
405
+ //this.updateItemContent(item);
406
+ this.updateFooterNav();
407
+ if (item.get('type') === 'lp_quiz') {
408
+ this.loadQuiz();
409
+ }
410
+ return item;
411
+ },
412
+ _completeItem : function (e) {
413
+ var that = this,
414
+ $button = $(e.target),
415
+ security = $button.data('security'),
416
+ $section = this.getCurrentSection(),
417
+ $item = $button.closest('.course-item');
418
+ LP.blockContent();
419
+ this.currentItem.complete({
420
+ security : security,
421
+ course_id : this.model.get('id'),
422
+ section_id: $section.length ? $section.data('id') : 0,
423
+ callback : function (response, item) {
424
+ if (response.result === 'success') {
425
+ // highlight item
426
+ item.$el.removeClass('item-started').addClass('item-completed focus off');
427
+ // then restore back after 3 seconds
428
+ _.delay(function (item) {
429
+ item.$el.removeClass('focus off');
430
+ }, 3000, item);
431
 
432
+ that.$('.learn-press-course-results-progress').replaceWith($(response.html.progress));
433
+ $section.find('.section-header').replaceWith($(response.html.section_header));
434
+ that.$('.learn-press-course-buttons').replaceWith($(response.html.buttons));
435
+ that.currentItem.set('content', $(response.html.content));
436
  }
437
+ LP.unblockContent();
438
+ }
439
+ });
440
+ },
441
+ _toggleSection : function (e) {
442
+ var $head = $(e.target).closest('.section-header'),
443
+ $sec = $head.siblings('ul.section-content');
444
+ $head.find('.collapse').toggleClass('plus');
445
+ $sec.slideToggle();
446
+ },
447
+ _tabClick : function (e) {
448
+ var tab = $(e.target).closest('.learn-press-nav-tab').data('tab');
449
+ if (tab === 'overview') {
450
+ //LP.setUrl(this.model.get('url'))
451
+ } else if (tab === 'curriculum') {
452
+ if (this.currentItem) {
453
+ //LP.setUrl(this.currentItem.get('url'))
454
+ }
455
+ }
456
+ },
457
+
458
+ _retakeCourse : function (e) {
459
+ e.preventDefault();
460
+ var that = this;
461
+ jConfirm(learn_press_single_course_localize.confirm_retake_course.message, learn_press_single_course_localize.confirm_retake_course.title, function (confirm) {
462
+ if (confirm) {
463
+ var $button = $(e.target),
464
+ data = $button.data(),
465
+ args = {
466
+ data : data,
467
+ callback: function (response) {
468
+ if (response.result === 'success') {
469
+ if (response.redirect) {
470
+ LP.reload(response.redirect);
471
+ }
472
+ }
473
+ }
474
+ };
475
+ that.model.retakeCourse(args);
476
  }
477
+ });
478
  },
479
  _finishCourse : function (e) {
480
+ e.preventDefault();
481
+ var _this = this;
482
+ jConfirm(learn_press_single_course_localize.confirm_finish_course.message, learn_press_single_course_localize.confirm_finish_course.title, function (confirm) {
483
+ if (confirm) {
484
+ var $button = $(e.target),
485
+ data = $button.data(),
486
+ args = {
487
+ data : data,
488
+ callback: function (response) {
489
+ if (response.result === 'success') {
490
+ if (response.redirect) {
491
+ LP.reload(response.redirect);
492
+ }
 
 
 
 
 
 
493
  }
 
 
 
 
494
  }
495
+ };
496
+ _this.model.finishCourse(args);
497
+ }
498
+ });
499
+ },
500
+ _showPopup : function (e) {
501
+ e.preventDefault();
502
+ var args = {
503
+ model : new Course.ModelPopup(),
504
+ course: this
505
+ };
506
+ },
507
+ showPopup : function () {
508
+ if (!this.popup) {
509
+ this.popup = new Course.Popup({
510
+ model : new Course.ModelPopup(),
511
+ course: this
512
  });
513
  }
514
  },
515
+ loadQuiz : function () {
516
+ if (window.$Quiz) {
517
+ window.$Quiz.destroy();
518
+ }
519
+ if (typeof window.LP_Quiz_Params !== 'undefined') {
520
+ window.$Quiz = new LP_Quiz(window.LP_Quiz_Params);
521
+ }
522
+ },
523
+ removePopup : function () {
524
+ this.popup = null;
525
+ this.model.items.forEach(function (m) {
526
+ m.set('current', false);
527
+ });
528
+ },
529
+ getCurrentSection: function () {
530
+ return this.currentItem.$el.closest('.section');
531
+ },
532
+ updateItemContent: function (item) {
533
+ ///this.itemEl.html(item.get('content'));
534
+ this.$('#popup-content-inner').html(item.get('content'));
535
+ },
536
+ updateFooterNav : function () {
537
+ var prev = this.model.getPrevItem(),
538
+ next = this.model.getNextItem();
539
+ this.$('#popup-footer').find('.prev-item, .next-item').remove();
540
+ if (prev) {
541
+ this.$('#popup-footer').append(Template('course-prev-item', prev.toJSON()));
542
+ }
543
+ if (next) {
544
+ this.$('#popup-footer').append(Template('course-next-item', next.toJSON()));
545
+ }
546
+ },
547
+
548
+ updateUrl : function (url) {
549
+ if (!url && this.currentItem) {
550
+ url = LP.Hook.applyFilters('learn_press_get_current_item_url', this.currentItem.get('url'), this.currentItem);
551
+ }
552
+ if (url) {
553
+ LP.setUrl(url);
554
+ }
555
+ },
556
+ blockContent : function () {
557
+ LP.blockContent();
558
+ },
559
+ unblockContent: function () {
560
+ LP.unblockContent();
561
+ }
562
+ });
563
+ Course.Model = Backbone.Model.extend({
564
+ items : null,
565
+ initialize : function () {
566
+ this.createItems();
567
+ },
568
+ createItems : function () {
569
+ this.items = new Course_Items();
570
+ this.items.add(this.get('items'));
571
+ },
572
+ retakeCourse: function (args) {
573
+ var that = this;
574
+ LP.ajax({
575
+ url : this.get('url'),
576
+ action : 'retake-course',
577
+ data : args.data,
578
+ dataType : 'json',
579
+ beforeSend: function () {
580
+ LP.blockContent();
581
  },
582
+ success : function (response) {
583
+ LP.unblockContent();
584
+ $.isFunction(args.callback) && args.callback.call(args.context, response, that);
585
+ }
586
+ });
587
+ },
588
+ finishCourse: function (args) {
589
+ var that = this;
590
+ LP.ajax({
591
+ url : this.get('url'),
592
+ action : 'finish-course',
593
+ data : args.data,
594
+ dataType : 'json',
595
+ beforeSend: function () {
596
+ LP.blockContent();
597
  },
598
+ success : function (response) {
599
+ LP.unblockContent();
600
+ $.isFunction(args.callback) && args.callback.call(args.context, response, that);
601
+ }
602
+ });
603
+ },
604
+ getItem : function (args) {
605
+ return $.isPlainObject(args) ? this.items.findWhere(args) : this.items.findWhere({id: args});
606
+ },
607
+ getNextItem : function () {
608
+ return this.items.getNextItem();
609
+ },
610
+ getPrevItem : function () {
611
+ return this.items.getPrevItem();
612
+ },
613
+ getItems : function (args) {
614
+ return typeof args === 'undefined' ? this.items : this.items.where(args);
615
+ },
616
+ getCurrent : function () {
 
 
 
 
617
  }
618
  });
619
 
620
+ Course.Popup = Backbone.View.extend({
621
+ course : null,
622
+ events : {
623
+ 'click .popup-close' : '_closePopup'
624
+ //'click .button-load-item': '_loadItem'
625
+ , 'click .sidebar-hide-btn': '_closeSidebar'
626
+ , 'click .sidebar-show-btn': '_showSidebar'
627
+ },
628
+ initialize : function (args) {
629
+ _.bindAll(this, '_ajaxLoadItemSuccess');
630
+ this.course = args.course;
631
+ this.render();
632
+ },
633
+ render : function () {
634
+ $('.learn-press-content-item-summary').remove();
635
+
636
+ this.$el.attr('tabindex', '0').append(Template('curriculum-popup', {})).css({}).appendTo($(document.body));
637
+ this.curriculumPlaceholder = $('<span />');
638
+ this.progressPlaceholder = $('<span />');
639
+
640
+ var $curriculum = this.course.$('#learn-press-course-curriculum');
641
+ var $progress = this.course.$('.learn-press-course-results-progress');
642
+
643
+ this.progressPlaceholder.insertAfter($progress);
644
+ $progress.appendTo(this.$('#popup-sidebar'));
645
+
646
+ this.curriculumPlaceholder.insertAfter($curriculum);
647
+ $curriculum.appendTo(this.$('#popup-sidebar'));
648
+
649
+ $('body').css({overflow: 'hidden'});
650
+ $(".sidebar-show-btn").hide();
651
+ },
652
+ _closePopup : function (e) {
653
+ e.preventDefault();
654
+ LP.setUrl(this.course.model.get('url'));
655
+ $('#learn-press-content-item').hide();
656
+ this.curriculumPlaceholder.replaceWith(this.$('#learn-press-course-curriculum'));
657
+ this.progressPlaceholder.replaceWith(this.$('.learn-press-course-results-progress'));
658
+ this.undelegateEvents();
659
+ this.remove();
660
+ $(document).off('focusin');
661
+ $('body').css('overflow', '').trigger('learn_press_popup_course_remove');
662
+ },
663
+ _closeSidebar : function (e) {
664
+ e.preventDefault();
665
+ $('#popup-sidebar').stop().animate({'margin-left': -350});
666
+ $('#popup-main').stop().animate({'left': '0px'});
667
+ $('#popup-main .sidebar-show-btn').css('display', 'inline-block');
668
+ },
669
+ _showSidebar : function (e) {
670
+ e.preventDefault();
671
+ $('#popup-sidebar').stop().animate({'margin-left': '0'});
672
+ $('#popup-main').stop().animate({'left': '350px'});
673
+ $('#popup-main .sidebar-show-btn').css('display', 'none');
674
+ },
675
+ _loadItem : function (e) {
676
+ var $iframe = $('<iframe />').src($(e.target).attr('href') + '?content-item-only=yes');
677
+ this.$('#popup-content-inner').html($iframe);
678
+ return '';
679
+ e.preventDefault();
680
+ $.ajax({
681
+ url : $(e.target).attr('href'),
682
+ success: this._ajaxLoadItemSuccess
683
+ });
684
+ },
685
+ _ajaxLoadItemSuccess: function (response) {
686
+ this.$('#popup-content-inner').html($(response).contents().find('.lp_course'));
687
+ }
688
+ }),
689
+ Course.ModelPopup = Backbone.Model.extend({
690
+ initialize: function () {
691
+ }
692
+ });
693
+
694
+ LP.Course = Course;
695
  $(document).ready(function () {
696
+ // Ensure that all other 'ready' callback have executed
697
+ (typeof window.LP_Course_Params != 'undefined') && $(document).ready(function () {
698
+ LP.$LP_Course = new Course(LP_Course_Params);
699
+ LP.Hook.doAction('learn_press_course_initialize', LP.$LP_Course);
700
+ $(window).trigger('resize.check-lines');
701
+ });
702
 
 
 
 
 
 
 
 
 
 
703
  });
704
+
705
+ $(document).ajaxComplete(function (a, b, c) {
706
+ if (c.data && c.data.match(/lp-ajax=/)) {
707
+ $(document).trigger('ready');
708
+ $(window).trigger('resize');
709
+ LP.unblockContent();
710
+ $('.learn-press-tooltip').tooltip({offset: [24, 24]});
711
+ }
712
+ }).ajaxError(function () {
713
+ LP.unblockContent();
714
+ });
715
+
716
  })(jQuery);
assets/js/frontend/single-course.min.js DELETED
@@ -1 +0,0 @@
1
- if(typeof LP=="undefined"){window.LP={}}(function(c){LP.Course=c.extend(LP.Course||{},{finish:function(f,g){LP.$Course&&LP.$Course.finishCourse({data:f,success:g})}});var d=function(f){this.model=new d.Model(f);this.view=new d.View({model:this.model})},e=Backbone.Model.extend({initialize:function(){this.on("change:content",this._changeContent)},_changeContent:function(){LP.Hook.doAction("learn_press_update_item_content",this)},request:function(f){var g=this;if(!this.get("url")){return false}alert();f=c.extend({context:null,callback:null},f||{});LP.ajax({url:this.get("url"),action:"load-item",data:c.extend({format:"html"},this.toJSON()),dataType:"html",success:function(h){LP.Hook.doAction("learn_press_course_item_loaded",h,g);h=LP.Hook.applyFilters("learn_press_course_item_content",h,g);c.isFunction(f.callback)&&f.callback.call(f.context,h,g)}});return this},complete:function(f){var g=this;f=c.extend({context:null,callback:null,format:"json"},this.toJSON(),f||{});var h={};_.forEach(f,function(j,i){if((c.inArray(i,["content","current","title","url"])==-1)&&!c.isFunction(j)){h[i]=j}});LP.ajax({url:this.get("url"),action:"complete-item",data:h,dataType:"json",success:function(i){LP.Hook.doAction("learn_press_course_item_completed",i,g);i=LP.Hook.applyFilters("learn_press_course_item_complete_response",i,g);c.isFunction(f.callback)&&f.callback.call(f.context,i,g)}})},_toJSON:function(){var f=e.__super__.toJSON.apply(this,arguments);console.log(f);alert()}}),b=Backbone.Collection.extend({model:e,initialize:function(){this.on("add",function(f){})}});d.View=Backbone.View.extend({el:".course-summary",itemEl:null,events:{"click .button-load-item":"_loadItem","click .button-complete-item":"_completeItem","click .section-header":"_toggleSection"},currentItem:null,initialize:function(){var f=this.$(".course-item");_.bindAll(this,"updateItemContent");this.itemEl=this.$("#learn-press-content-item");this.model.items.forEach(function(h,g){h.course=this;h.$el=f.filter(".course-item-"+h.get("id"))},this);this._initHooks();if(this.$(".course-item.item-current").length){this.viewItem(this.$(".course-item.item-current .button-load-item").data("id"),{content:this.itemEl.html()})}LP.log(this.model.get("results"))},_initHooks:function(){LP.Hook.addAction("learn_press_update_item_content",this.updateItemContent)},_loadItem:function(g){g.preventDefault();var f=this,h=c(g.target).data("id");alert("xxxxxxxxxxxxxx");this.currentItem=this.model.getItem(h).request({context:this,item:this.currentItem,callback:function(i){f.viewItem(h,{content:c(i).html()})}})},_completeItem:function(i){var f=this,g=c(i.target),h=g.data("security");this.currentItem.complete({security:h,course_id:this.model.get("id"),callback:function(j,k){if(j.result=="success"){k.$el.removeClass("item-started").addClass("item-completed focus off");_.delay(function(l){l.$el.removeClass("focus off")},3000,k);f.$(".learn-press-course-results-progress").replaceWith(c(j.html))}}})},_toggleSection:function(h){var f=c(h.target).closest(".section-header"),g=f.siblings("ul.section-content");g.slideToggle()},updateItemContent:function(f){this.itemEl.html(f.get("content"))},viewItem:function(h,f){var g=this.model.getItem(h);if(g){g.set(f);g.set("current",true)}this.itemEl.show();this.currentItem=g;this.$('.course-item [data-id="'+g.get("id")+'"]').parent().addClass("item-current item-has-status").siblings(".item-current").removeClass("item-current");LP.setUrl(g.get("url"));return g}});d.Model=Backbone.Model.extend({items:null,initialize:function(){LP.log("Course.Model.initialize");this.createItems()},createItems:function(){this.items=new b();this.items.add(this.get("items"))},getItem:function(f){return c.isPlainObject(f)?this.items.findWhere(f):this.items.findWhere({id:f})},getItems:function(f){return typeof f=="undefined"?this.items:this.items.where(f)},getCurrent:function(){}});LP.Course=d;LP.$Course=new d(LP_Course_Params);return;var a=window.LP_View_Course=Backbone.View.extend({$doc:null,$body:null,courseItems:null,courseItemsView:null,el:".course-summary",events:{"click #learn-press-finish-course":"_finishCourse"},initialize:function(f){var h=parseInt(c(".course-item.item-current").find(">a").attr("data-id")),g=null;if(h){c('[id="learn-press-course-lesson"]').html("")}this.courseItems=new c.LP_Course_Item.Collection();this.courseItemsView=new c.LP_Course_Item_List_View({model:this.courseItems});if(h){this.courseItems.loadItem(h)}_.bindAll(this,"_finishCourse","_sanitizeProgress","completeLesson");this.$doc=c(document);this.$body=c(document.body);LP.Hook.addFilter("learn_press_before_load_item",function(k){LP.MessageBox.blockUI();if(k.model.get("type")=="lp_quiz"){var l=LP.Hook.applyFilters("learn_press_course_item_redirect_url",c(".course-item-"+k.model.get("id")+" a").prop("href"),k);if(l!==false){var j=window.open(l,"_blank");try{j.focus()}catch(i){}}}return true});LP.Hook.addAction("learn_press_item_content_loaded",this.itemLoaded).addAction("learn_press_user_completed_lesson",this.completeLesson).addAction("learn_press_user_passed_course_condition",function(){});this._sanitizeProgress()},itemLoaded:function(f,g){LP.toElement("#learn-press-course-lesson-heading");LP.MessageBox.hide()},completeLesson:function(f,g){if(f&&f.result=="success"){var h=this.$(".complete-lesson-button").addClass("completed").prop("disabled",true).html(f.button_text);c(".course-item-"+f.id).addClass("item-completed");if(f.course_result){if(f.can_finish){this.$("#learn-press-finish-course").removeClass("hide-if-js");LP.Hook.doAction("learn_press_user_passed_course_condition",f,this,g)}if(f.message){c(f.message).insertBefore(h)}this.updateProgress(f)}}},updateProgress:function(f){c(".lp-course-progress").attr({"data-value":f.course_result});this._sanitizeProgress()},_loadLesson:function(f){this.loadLesson(c(f.target).attr("href"))},loadLesson:function(h,f){var g=this;LP.Hook.doAction("learn_press_before_load_lesson",h,this);f=c.extend({success:function(){return true},error:function(){}},f||{});c.ajax({url:h,success:function(l){var m=true;c.isFunction(f.success)&&(m=f.success.call(this,l));if(m===true){var i=c(l),k=i.find("#learn-press-course-lesson-summary"),j=i.find("#learn-press-course-lesson-heading");c("title").html(i.filter("title").text());c("#learn-press-course-description-heading, #learn-press-course-lesson-heading").replaceWith(j);c("#learn-press-course-description, #learn-press-course-lesson-summary").replaceWith(k);LP.Hook.doAction("learn_press_load_lesson_completed",h,g);LP.Hook.doAction("learn_press_lesson_content_loaded",i,this)}},error:function(){LP.MessageBox.hide()}})},_finishCourse:function(i){var f=this,h=c(i.target),g=h.data();g=LP.Hook.applyFilters("learn_press_user_finish_course_data",g);if(g&&g.id){h.prop("disabled",true);this.finishCourse({data:g,success:function(j){LP.Hook.applyFilters("learn_press_finish_course_params",j);if(j&&j.result=="success"){f.$("#learn-press-finish-course, .complete-lesson-button").remove();LP.Hook.doAction("learn_press_finish_course",j)}if(j.message){LP.alert(j.message,function(){if(j.redirect){LP.reload(j.redirect)}})}else{if(j.redirect){LP.reload(j.redirect)}}}})}},finishCourse:function(f){f=f||{};var g=function(k){if(k){LP.doAjax({prefix:"",data:j,success:i})}},i=function(k){c.isFunction(f.success)&&f.success.call(h,k)},h=this,j=c.extend({"lp-ajax":"finish_course"},f.data||{});LP.confirm(single_course_localize.confirm_finish_course,g)},_sanitizeProgress:function(){var h=c(".lp-course-progress"),f=c(".lp-progress-value",h),i=c(".lp-passing-conditional",h),j=parseFloat(h.attr("data-value")),g=parseFloat(h.attr("data-passing-condition")),k=function(){var l=parseInt(f.css("width")),m=parseInt(i.css("left"));if(j>=g){h.addClass("passed")}};f.css("width",j+"%").find("span span").html(j);setTimeout(k,500)}});c(document).ready(function(){LP.$Course=new a();LP.Hook.addAction("learn_press_item_content_loaded",function(g,f){setTimeout(function(){try{window.wp.mediaelement.initialize()}catch(h){}},300)})})})(jQuery);
 
assets/js/frontend/single-course.v2.js DELETED
@@ -1,245 +0,0 @@
1
- /**
2
- * Single course JS
3
- *
4
- * @requires jQuery, Backbone
5
- */
6
- ;(function ($) {
7
-
8
- window.LP_V2 = true;
9
- if (typeof jQuery == 'undefined' || typeof Backbone == 'undefined') {
10
- console.log('Error');
11
- return;
12
- }
13
-
14
- if (typeof LP == 'undefined') {
15
- window.LP = {};
16
- }
17
-
18
- $.extend(LP, {
19
- Views: {},
20
- Model: {}
21
- });
22
-
23
- var CourseModel,
24
- CourseView,
25
- CourseItem,
26
- CourseItems;
27
-
28
- CourseItem = LP.CourseItem = Backbone.Model.extend({
29
- $doc : false,
30
- initialize : function () {
31
- this.$doc = $(document);
32
- this.on('change', this.onChange);
33
- _.bindAll(this, 'itemLoaded');
34
- },
35
- onChange : function (a, b) {
36
- var that = this,
37
- data = {
38
- item: this
39
- };
40
- if (a.changed['current'] !== undefined) {
41
- $.extend(data, {
42
- key : 'current',
43
- value: a.changed['current']
44
- });
45
- this.get('el').find('.lp-label-viewing').toggle(a.changed['current']);
46
- if (this.onChangeCurrent(data) !== false && a.changed['current']) {
47
- if (that.get('content')) {
48
- that.itemLoaded.apply(that, [that.get('content')])
49
- } else {
50
- if (that.get('type') == 'lp_lesson') {
51
- $.ajax({
52
- url : that.get('url'),
53
- dataType: 'html',
54
- success : that.itemLoaded
55
- });
56
- } else {
57
- that.itemLoaded()
58
- }
59
- }
60
- }
61
- }
62
- },
63
- onChangeCurrent: function (data) {
64
- return this.$doc.triggerHandler('learn_press_item_current_changed', data)
65
- },
66
- isCurrent : function () {
67
- return this.get('current') == true;
68
- },
69
- itemLoaded : function (response) {
70
- var $html = $(response);
71
- this.set('content', response);
72
- switch (this.get('type')) {
73
- case 'lp_lesson':
74
- var $content = $html.find('#learn-press-content-item').html();
75
- $('#learn-press-content-item').html($content).show();
76
- break;
77
- case 'lp_quiz':
78
- var data = this.$doc.triggerHandler('learn_press_item_redirect_url', {
79
- url : this.get('url'),
80
- item: this
81
- });
82
- if (data !== false) {
83
- if (data == undefined || data.redirect == undefined) {
84
- data.redirect = this.get('url');
85
- }
86
- LearnPress.reload(data.redirect);
87
- }
88
- break;
89
- default:
90
- this._trigger('learn_press_item_' + this.get('type') + '_loaded', {html: $html, item: this});
91
- }
92
- try {
93
- window.wp.mediaelement.initialize();
94
- } catch (e) {
95
- }
96
- this.$doc.triggerHandler('learn_press_item_loaded', {html: $html, item: this});
97
- },
98
- _trigger : function () {
99
- var args = [];
100
- for (var i = 0, n = arguments.length; i < n; i++) {
101
- args.push(arguments[i]);
102
- }
103
- return this.$doc.triggerHandler.apply(this.$doc[0], args);
104
- }
105
- });
106
-
107
- CourseItems = LP.CourseItems = Backbone.Collection.extend({
108
- getCurrent: function () {
109
- var item = this.findWhere({current: true});
110
- return item;
111
- },
112
- setCurrent: function (item) {
113
- if (!item instanceof CourseItem) {
114
- item = this.findWhere({id: item});
115
- }
116
- this.map(function (item) {
117
- if (item.get('current')) {
118
- item.set('current', false);
119
- }
120
- });
121
- if (item) {
122
- item.set('current', true);
123
- var _r = $(document).triggerHandler('learn_press_set_course_url', {url: item.get('url')});
124
- if (_r !== false) {
125
- if (_r == undefined) {
126
- _r = item.get('url')
127
- }
128
- try {
129
- LearnPress.setUrl(_r);
130
- } catch (e) {
131
- }
132
- }
133
- }
134
- }
135
- });
136
-
137
- CourseModel = LP.CourseModel = Backbone.Model.extend({
138
- items : new CourseItems(),
139
- initialize: function (args) {
140
- this.parseItems(args);
141
- },
142
- parseItems: function (args) {
143
- var $items = $('.course-curriculum .course-item');
144
- _.forEach(args.items, function (item, i) {
145
- item.el = $items.filter('.course-item-' + item.id);
146
- this.items.add(new CourseItem(item));
147
- }, this);
148
- }
149
- });
150
-
151
- CourseView = LP.CourseView = Backbone.View.extend({
152
- el : 'body',
153
- events : {
154
- 'click .button-load-item' : '_loadItem',
155
- 'click .course-item-nav a': '_loadItemNav',
156
- 'click .finish-course' : '_finishCourse'
157
- },
158
- initialize : function () {
159
- _.bindAll(this, '_itemChanged', '_itemLoaded');
160
- this.initEvents();
161
- this.initCurrent();
162
- },
163
- initEvents : function () {
164
- $(document)
165
- .on('learn_press_item_current_changed', this._itemChanged)
166
- .on('learn_press_item_loaded', this._itemLoaded)
167
-
168
- },
169
- initCurrent : function () {
170
- var current = this.model.items.getCurrent();
171
- if (!current) {
172
- return;
173
- }
174
- current.itemLoaded($("html").html());
175
- },
176
- _itemChanged : function (e, data) {
177
- var that = this;
178
- switch (data.key) {
179
- case 'current':
180
- if (data.value == true) {
181
- if (data.item.get('type') == 'lp_quiz') {
182
- data.callback && data.callback();
183
- return;
184
- }
185
- $('#learn-press-content-item').addClass('loading');
186
- LearnPress.toElement('#learn-press-content-item', {
187
- delay : 0,
188
- duration: 0,
189
- callback: function () {
190
-
191
- }
192
- });
193
- }
194
- }
195
- },
196
- _itemLoaded : function (e, data) {
197
- $('.course-description-heading, .course-description').hide();
198
- $('#learn-press-content-item').removeClass('loading');
199
- return data;
200
- },
201
- _loadItem : function (e) {
202
- e.preventDefault();
203
- var $tag = $(e.target).closest('.button-load-item');
204
- if (!$tag.is('a')) {
205
- return false;
206
- }
207
- var id = parseInt($tag.data('id')),
208
- type = $tag.closest('.course-item').data('type'),
209
- $item = this.model.items.findWhere({id: id});
210
- if (!$item) {
211
- return false;
212
- }
213
- if ($item.isCurrent()) {
214
- return false;
215
- }
216
- this.model.items.setCurrent($item);
217
- },
218
- _loadItemNav : function (e) {
219
- e.preventDefault();
220
-
221
- var id = $(e.target).attr('data-id'),
222
- $item = this.$('.section-content a.button-load-item[data-id="' + id + '"]');
223
- $item.trigger('click');
224
- },
225
- _finishCourse: function (e) {
226
-
227
- },
228
- loadItem : function (item) {
229
- },
230
- extend : function (obj) {
231
- for (var i in obj) {
232
- this[i] = obj[i];
233
- }
234
- return this;
235
- }
236
- });
237
-
238
- $(document).ready(function () {
239
- if (typeof SingleCourse_Params != 'undefined') {
240
- LP.Views.Course = new CourseView({
241
- model: new CourseModel(SingleCourse_Params)
242
- });
243
- }
244
- })
245
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/frontend/single-quiz.js DELETED
@@ -1,731 +0,0 @@
1
- if (typeof LearnPress == 'undefined') var LearnPress = {};
2
- (function ($) {
3
- "use strict";
4
-
5
- var LearnPress_Model_Quiz = window.LearnPress_Model_Quiz = Backbone.Model.extend({
6
- defaults : {
7
- //question_id: 0
8
- },
9
- data : null,
10
- view : false,
11
- url : function () {
12
- },
13
- urlRoot : '',
14
- questions : null,
15
- initialize : function () {
16
-
17
- this.createQuestionsList();
18
-
19
- },
20
- createQuestionsList: function () {
21
- this.questions = new LearnPress_Collection_Questions();
22
- _.each(this.get('questions'), function (args, i) {
23
- var $model = new LearnPress_Model_Question($.extend({
24
- quiz_id: this.get('id'),
25
- user_id: this.get('user_id'),
26
- }, args));
27
- $model.urlRoot = this.get('ajaxurl');
28
- $model.view = this.view;
29
- this.questions.add($model);
30
- }, this);
31
- },
32
- next : function (callback) {
33
- if (!this.isLast()) {
34
- var next_id = this.findNext(),
35
- question = this.questions.findWhere({id: next_id}),
36
- that = this;
37
- question.submit({
38
- data : {
39
- save_id : that.get('question_id'),
40
- question_answer: this.view.$('form').serialize(),
41
- time_remaining : that.get('time_remaining')
42
- },
43
- complete: function () {
44
- that.set('question_id', next_id);
45
- $.isFunction(callback) && callback.apply(that);
46
- LearnPress.Hook.doAction('learn_press_next_question', next_id, that);
47
- }
48
- });
49
- }
50
- },
51
- prev : function (callback) {
52
- if (!this.isFirst()) {
53
- var prev_id = this.findPrev(),
54
- question = this.questions.findWhere({id: prev_id}),
55
- that = this;
56
- //if (!question.get('content')) {
57
- question.submit({
58
- data : {
59
- save_id : that.get('question_id'),
60
- question_answer: this.view.$('form').serialize(),
61
- time_remaining : that.get('time_remaining')
62
- },
63
- complete: function () {
64
- that.set('question_id', prev_id);
65
- $.isFunction(callback) && callback.apply(that);
66
- LearnPress.Hook.doAction('learn_press_previous_question', prev_id, that);
67
- }
68
- });
69
-
70
- }
71
- },
72
- select : function (id, callback) {
73
- var question = this.questions.findWhere({id: id}),
74
- that = this;
75
- question && question.submit({
76
- data : {
77
- save_id : that.get('question_id'),
78
- question_answer: this.view.$('form').serialize(), //$('input, select, textarea', this.view.$('form')).toJSON(),
79
- time_remaining : that.get('time_remaining')
80
- },
81
- complete: function (response) {
82
- that.set('question_id', id);
83
- $.isFunction(callback) && callback.apply(that, [response])
84
- }
85
- });
86
- },
87
- getQuestionPosition: function (question_id) {
88
- question_id = question_id || this.get('question_id');
89
- return _.indexOf(this.getIds(), question_id);
90
- },
91
- countQuestions : function () {
92
- return this.questions.length;
93
- },
94
- isLast : function (question_id) {
95
- question_id = question_id || this.get('question_id');
96
- return this.getQuestionPosition(question_id) == (this.countQuestions() - 1);
97
- },
98
- isFirst : function (question_id) {
99
- question_id = question_id || this.get('question_id');
100
- return this.getQuestionPosition(question_id) == 0;
101
- },
102
- findNext : function (question_id) {
103
- question_id = question_id || this.get('question_id');
104
- var ids = this.getIds(),
105
- pos = this.getQuestionPosition(question_id);
106
- pos++;
107
- if (typeof ids[pos] == 'undefined') return false;
108
- return ids[pos];
109
- },
110
- findPrev : function (question_id) {
111
- question_id = question_id || this.get('question_id');
112
- var ids = this.getIds(),
113
- pos = this.getQuestionPosition(question_id);
114
- pos--;
115
- if (typeof ids[pos] == 'undefined') return false;
116
- return ids[pos];
117
- },
118
- current : function () {
119
- return this.questions.findWhere({id: parseInt(this.get('question_id'))});
120
- },
121
- getIds : function () {
122
- return $.map(this.get('questions'), function (i, v) {
123
- return parseInt(i.id)
124
- });
125
- }
126
- });
127
-
128
- var LearnPress_Model_Question = window.LearnPress_Model_Question = Backbone.Model.extend({
129
- defaults : {
130
- //question_id: 0
131
- },
132
- data : null,
133
- view : false,
134
- url : function () {
135
- return this.urlRoot;
136
- },
137
- urlRoot : '',
138
- initialize: function () {
139
- },
140
- element : function () {
141
- return $(this.get('content'));
142
- },
143
- submit : function (args) {
144
- var that = this;
145
- args = $.extend({
146
- complete: null,
147
- data : {}
148
- }, args || {});
149
- this.fetch({
150
- data : $.extend({
151
- action : 'learnpress_load_quiz_question',
152
- user_id : this.get('user_id'),
153
- quiz_id : this.get('quiz_id'),
154
- question_id: this.get('id')
155
- }, args.data || {}),
156
- complete: (function (e) {
157
- var response = LearnPress.parseJSON(e.responseText);
158
- if (response.result == 'success') {
159
- //if (!that.get('content')) {
160
- that.set(response.question);
161
- if (response.permalink) {
162
- LearnPress.setUrl(response.permalink);
163
- }
164
- //}
165
- $.isFunction(args.complete) && args.complete.call(that, response);
166
- }
167
- })
168
- });
169
- },
170
- check : function (args) {
171
- var that = this;
172
- if ($.isFunction(args)) {
173
- args = {
174
- complete: args
175
- }
176
- } else {
177
- args = $.extend({
178
- complete: null,
179
- data : {}
180
- }, args || {});
181
- }
182
- LearnPress.doAjax({
183
- data : $.extend({
184
- 'lp-ajax' : 'check-question',
185
- user_id : this.get('user_id'),
186
- quiz_id : this.get('quiz_id'),
187
- question_id : this.get('id'),
188
- save_id : this.get('id'),
189
- question_answer: $('form#learn-press-quiz-question').serialize()
190
- }, args.data || {}),
191
- success: function (response, raw) {
192
- that.set('checked', response.checked);
193
- $.isFunction(args.complete) && args.complete.call(that, response)
194
- }
195
- })
196
- }
197
- });
198
-
199
- var LearnPress_Collection_Questions = window.LearnPress_Collection_Questions = Backbone.Collection.extend({
200
- url : 'admin-ajax.php',
201
- model: LearnPress_Model_Question
202
- });
203
-
204
- var LearnPress_View_Quiz = window.LearnPress_View_Quiz = Backbone.View.extend({
205
- model : {},
206
- events : {
207
- 'click .button-start-quiz' : '_startQuiz',
208
- 'click .button-finish-quiz' : '_finishQuiz',
209
- 'click .button-retake-quiz' : '_retakeQuiz',
210
- 'click .next-question' : '_nextQuestion',
211
- 'click .prev-question' : '_prevQuestion',
212
- 'click .check-question' : '_checkQuestion',
213
- 'click .quiz-questions-list li a': '_selectQuestion',
214
- 'click .hint-question' : '_hintQuestion',
215
- 'click .explain-question' : '_explainQuestion'
216
- },
217
- el : '.single-quiz',
218
- isRendered : false,
219
- $buttons : {},
220
- initialize : function (model) {
221
- this.model = model;
222
- this.model.view = this;
223
- this.listenTo(this.model, 'change:question_id', this.changeQuestion);
224
- this.listenTo(this.model, 'change', this.render);
225
- this.listenTo(this.model, 'change', this.updateCountdown);
226
-
227
- LearnPress.Hook
228
- .addAction('learn_press_check_question', function (response, that) {
229
- that.updateAnswer.apply(that, [response]);
230
- })
231
- .addAction('learn_press_update_question_content', function ($newQuestion, $oldQuestion, that) {
232
- var $current = that.model.current();
233
- setTimeout(function () {
234
- if ($current.get('checked')) {
235
- that.updateAnswer.apply(that, [{checked: $current.get('checked'), result: 'success'}]);
236
- }
237
- }, 100)
238
-
239
- });
240
- _.bindAll(this, 'render', '_timeOver', '_checkQuestion', '_hintQuestion', 'updateAnswer', 'updateCountdown');
241
-
242
- this._create();
243
- this.render();
244
- this.updateCountdown(true);
245
- },
246
- _create : function () {
247
- this.$buttons = {
248
- start : this.$('.button-start-quiz'),
249
- finish : this.$('.button-finish-quiz'),
250
- retake : this.$('.button-retake-quiz'),
251
- next : this.$('.next-question'),
252
- prev : this.$('.prev-question'),
253
- check : this.$('.check-question'),
254
- hint : this.$('.hint-question'),
255
- explain: this.$('.explain-question'),
256
- };
257
- if (this.model.get('status') == 'started') {
258
- this.initCountdown();
259
-
260
- var $current = this.model.current();
261
- if ($current) {
262
- $current.set({
263
- content: $('#learn-press-quiz-question .question-' + $current.get('id'))
264
- });
265
- this._updateQuestion($current.element());
266
- }
267
- }
268
- var that = this;
269
- this.setButtonsState();
270
- },
271
- changeQuestion : function () {
272
- var $current = this.model.current();
273
- if ($current) {
274
- this._updateQuestion($current.element());
275
- }
276
- },
277
- updateCountdown : function (force) {
278
- if (!this.model.hasChanged('status') && !force) {
279
- return;
280
- }
281
- if (this.model.get('status') == 'started') {
282
- if (!this.$countdown) {
283
- this.initCountdown();
284
- }
285
- this.$countdown.backward_timer('start');
286
- }
287
- },
288
- render : function () {
289
- if (!this.model.hasChanged('question_id') && !this.model.hasChanged('status')) {
290
- //return;
291
- }
292
- var $question = this.model.current();
293
-
294
- this.setButtonsState();
295
- switch (this.model.get('status')) {
296
- case 'started':
297
- this.$('.quiz-intro').remove();
298
- this.$('.quiz-countdown').removeClass('hide-if-js');
299
- }
300
- if ($question && this.model.get('status') == 'started') {
301
- this.$('form[name="learn-press-quiz-question"]').html($question.get('content'));
302
- this.$('#learn-press-quiz-questions li[data-id="' + $question.get('id') + '"]')
303
- .addClass('current')
304
- .siblings('.current').removeClass('current');
305
- }
306
-
307
- this.isRendered = true;
308
- this.$el.css('visibility', 'visible');
309
- },
310
- setButtonsState : function () {
311
- var hidden = 'hide-if-js',
312
- current = this.model.current();
313
- switch (this.model.get('status').toLowerCase()) {
314
- case 'completed':
315
- this.$buttons.start.addClass(hidden);
316
- this.$buttons.finish.addClass(hidden);
317
- this.$buttons.check.addClass(hidden);
318
- this.$buttons.retake.removeClass(hidden);
319
- break;
320
- case 'started':
321
- this.$buttons.start.addClass(hidden);
322
- this.$buttons.finish.removeClass(hidden);
323
- this.$buttons.retake.addClass(hidden);
324
-
325
- if (this.model.countQuestions() <= 1) {
326
- this.$buttons.next.addClass(hidden);
327
- this.$buttons.prev.addClass(hidden);
328
- } else {
329
- this.$buttons.next.removeClass(hidden);
330
- this.$buttons.prev.removeClass(hidden);
331
- if (this.model.isLast()) {
332
- this.$buttons.next.addClass(hidden);
333
- this.$buttons.finish.filter('[data-area="nav"]').removeClass(hidden);
334
- } else {
335
- this.$buttons.finish.filter('[data-area="nav"]').addClass(hidden);
336
- }
337
- if (this.model.isFirst()) {
338
- this.$buttons.prev.addClass(hidden);
339
- }
340
- }
341
- if (current && current.get('check_answer')) {
342
- this.$buttons.check.removeClass(hidden);
343
- } else {
344
- this.$buttons.check.addClass(hidden);
345
- }
346
- if (current && current.get('hint')) {
347
- this.$buttons.hint.removeClass(hidden);
348
- } else {
349
- this.$buttons.hint.addClass(hidden);
350
- }
351
- if (current && current.get('explanation')) {
352
- this.$buttons.explain.removeClass(hidden);
353
- } else {
354
- this.$buttons.explain.addClass(hidden);
355
- }
356
- break;
357
- default:
358
- this.$buttons.next.addClass(hidden);
359
- this.$buttons.prev.addClass(hidden);
360
- this.$buttons.start.removeClass(hidden);
361
- this.$buttons.finish.addClass(hidden);
362
- this.$buttons.retake.addClass(hidden);
363
- this.$('.quiz-questions .qq.current').removeClass('current');
364
- }
365
-
366
- },
367
- startQuiz : function (args) {
368
- this.block_page();
369
- args = $.extend({
370
- complete: false
371
- }, args || {});
372
-
373
- var that = this,
374
- data = $.extend({
375
- 'lp-ajax': 'start-quiz',
376
- quiz_id : this.model.get('id'),
377
- nonce : this.model.get('nonce')
378
- }, args.data || {});
379
- LearnPress.doAjax({
380
- url : window.location.href,
381
- data : data,
382
- success: function (response, raw) {
383
- LearnPress.MessageBox.hide();
384
- var response = LearnPress.Hook.applyFilters('learn_press_start_quiz_results', response, that);
385
- if (response.result == 'success') {
386
- that.model.current().set(response.question);
387
- that.model.set({status: response.data.status, question_id: response.question.id});
388
- LearnPress.setUrl(response.question.permalink);
389
- }
390
- $.isFunction(args.complete) && args.complete.call(that, response)
391
- }
392
- });
393
- },
394
- finishQuiz : function (args) {
395
- this.pause();
396
- this.block_page();
397
- args = $.extend({
398
- complete: false
399
- }, args || {});
400
-
401
- var that = this,
402
- data = $.extend({
403
- 'lp-ajax': 'finish-quiz',
404
- quiz_id : this.model.get('id'),
405
- nonce : this.model.get('nonce')
406
- }, args.data || {});
407
- LearnPress.doAjax({
408
- data : data,
409
- success: function (response) {
410
- var callbackReturn = undefined;
411
- $.isFunction(args.complete) && ( callbackReturn = args.complete.call(LearnPress.Quiz, response) );
412
- LearnPress.Hook.doAction('learn_press_finish_quiz', that.model.get('id'), that);
413
- LearnPress.MessageBox.show(single_quiz_localize.finished_quiz, {
414
- autohide: 2000,
415
- onHide : function () {
416
- if (callbackReturn && callbackReturn.redirect) {
417
- LearnPress.reload(callbackReturn.redirect);
418
- } else if (callbackReturn == undefined && response.redirect) {
419
- LearnPress.reload(response.redirect);
420
- }
421
- }
422
- });
423
- }
424
- });
425
- },
426
- retakeQuiz : function (args) {
427
- this.block_page();
428
- args = $.extend({
429
- complete: false
430
- }, args || {});
431
-
432
- var that = this,
433
- data = $.extend({
434
- 'lp-ajax': 'retake-quiz',
435
- quiz_id : this.model.get('id'),
436
- nonce : this.model.get('nonce')
437
- }, args.data || {});
438
- LearnPress.doAjax({
439
- data : data,
440
- success: function (response, raw) {
441
- LearnPress.MessageBox.hide();
442
- if (response.result == 'success') {
443
- $.isFunction(args.complete) && args.complete.call(LearnPress.Quiz, response);
444
- LearnPress.MessageBox.show(single_quiz_localize.retaken_quiz, {
445
- autohide: 2000,
446
- onHide : function () {
447
- LearnPress.reload(response.redirect);
448
- }
449
- });
450
- } else {
451
- LearnPress.alert(response.message);
452
- }
453
- }
454
- });
455
- },
456
- updateAnswer : function (response) {
457
- if (!response || response.result != 'success') {
458
- return;
459
- }
460
- var $current = this.model.current(),
461
- $content = $($current.get('content'));
462
- switch ($current.get('type')) {
463
- case 'true_or_false':
464
- case 'single_choice':
465
- case 'multi_choice':
466
- $.each(response.checked, function (k, v) {
467
- var $input = $content.find('input[value="' + v.value + '"]'),
468
- $li = $input.closest('li').removeClass('answer-true user-answer-false');
469
- if (v.is_true == 'yes') {
470
- $li.addClass('answer-true')
471
- }
472
- if (response.answered) {
473
- if (typeof response.answered == 'string') {
474
- if (response.answered == v.value) {
475
- $input.prop('checked', true);
476
- }
477
- } else if ($.inArray(v.value, response.answered) != -1) {
478
- $input.prop('checked', true);
479
- }
480
- }
481
- if ($input.is(':checked') && v.is_true == 'yes') {
482
- } else {
483
- $li.addClass('user-answer-false');
484
- }
485
-
486
- });
487
- $content.addClass('checked').find('input, select, textarea').prop('disabled', true);
488
- $current.set({
489
- content: $content
490
- });
491
- }
492
- //LearnPress.Hook.doAction('learn_press_check_question', response, $current);
493
- this.render();
494
- },
495
- _checkQuestion : function () {
496
- if (LearnPress.Hook.applyFilters('learn_press_before_check_question', true, this) !== false) {
497
- var that = this;
498
- this.$buttons.next.prop('disabled', true);
499
- this.$buttons.prev.prop('disabled', true);
500
- this.$buttons.finish.prop('disabled', true);
501
- this.$buttons.check.prop('disabled', true);
502
- this.pause();
503
- this.block_page();
504
- this.model.current().check({
505
- complete: function (response) {
506
- that.$buttons.next.prop('disabled', false);
507
- that.$buttons.prev.prop('disabled', false);
508
- that.$buttons.finish.prop('disabled', false);
509
- that.$buttons.check.prop('disabled', false);
510
- LearnPress.Hook.doAction('learn_press_check_question', response, that);
511
- that.resume();
512
- },
513
- data : {nonce: this.model.get('nonce')}
514
- });
515
- }
516
- },
517
- _hintQuestion : function (e) {
518
- e.preventDefault();
519
- var current = this.model.current();
520
- if (current && current.get('hint')) {
521
- $('#learn-press-question-hint-' + current.get('id')).toggleClass('hide-if-js')
522
- }
523
-
524
- },
525
- _explainQuestion: function (e) {
526
- e.preventDefault();
527
- var current = this.model.current();
528
- if (current && current.get('explanation')) {
529
- $('#learn-press-question-explanation-' + current.get('id')).toggleClass('hide-if-js')
530
- }
531
-
532
- },
533
- _nextQuestion : function () {
534
- if (LearnPress.Hook.applyFilters('learn_press_before_next_question', true, this) !== false) {
535
- var that = this;
536
- this.$buttons.next.prop('disabled', true);
537
- this.$buttons.prev.prop('disabled', true);
538
- this.$buttons.finish.prop('disabled', true);
539
- this.pause();
540
- this.block_page();
541
- this.model.next(function () {
542
- that.$buttons.next.prop('disabled', false);
543
- that.$buttons.prev.prop('disabled', false);
544
- that.$buttons.finish.prop('disabled', false);
545
- });
546
- }
547
- },
548
- _prevQuestion : function () {
549
- if (LearnPress.Hook.applyFilters('learn_press_before_prev_question', true, this) !== false) {
550
- var that = this;
551
- this.$buttons.next.prop('disabled', true);
552
- this.$buttons.prev.prop('disabled', true);
553
- this.$buttons.finish.prop('disabled', true);
554
- this.pause();
555
- this.block_page();
556
- this.model.prev(function () {
557
- that.$buttons.next.prop('disabled', false);
558
- that.$buttons.prev.prop('disabled', false);
559
- that.$buttons.finish.prop('disabled', false);
560
- });
561
- }
562
- },
563
- _selectQuestion : function (e) {
564
- e.preventDefault();
565
- var that = this,
566
- id = $(e.target).closest('.learn-press-question-wrap').data('id');
567
- if (this.model.get('status') != 'started') {
568
- return false;
569
- }
570
- if (LearnPress.Hook.applyFilters('learn_press_before_select_question', true, that) !== false) {
571
- this.pause();
572
- this.$buttons.next.prop('disabled', true);
573
- this.$buttons.prev.prop('disabled', true);
574
- this.$buttons.finish.prop('disabled', true);
575
- this.pause();
576
- this.model.select(id, function (response) {
577
- LearnPress.Hook.doAction('learn_press_selected_question', id, that);
578
- that.$buttons.next.prop('disabled', false);
579
- that.$buttons.prev.prop('disabled', false);
580
- that.$buttons.finish.prop('disabled', false);
581
- });
582
- }
583
- },
584
- _getNonce : function (field) {
585
- return this.$('input#' + field + '-nonce').val();
586
- },
587
- _startQuiz : function () {
588
- var that = this;
589
- if (LearnPress.Hook.applyFilters('learn_press_before_start_quiz', true, that) !== false) {
590
- that.$buttons.next.prop('disabled', true);
591
- that.$buttons.prev.prop('disabled', true);
592
- that.$buttons.finish.prop('disabled', true);
593
- LearnPress.MessageBox.blockUI();
594
- that.startQuiz({
595
- complete: function (response) {
596
- LearnPress.MessageBox.hide();
597
- if (response.message) {
598
- LearnPress.alert(response.message, function () {
599
- if (response.redirect) {
600
- LearnPress.reload(response.redirect)
601
- }
602
- });
603
- } else {
604
- if (response.redirect) {
605
- LearnPress.reload(response.redirect)
606
- }
607
- }
608
- that.$buttons.next.prop('disabled', false);
609
- that.$buttons.prev.prop('disabled', false);
610
- that.$buttons.finish.prop('disabled', false);
611
- LearnPress.Hook.doAction('learn_press_start_quiz', response, that);
612
- }
613
- });
614
- }
615
- },
616
- _retakeQuiz : function () {
617
- var that = this;
618
- if (LearnPress.Hook.applyFilters('learn_press_before_retake_quiz', true, that) !== false) {
619
- LearnPress.confirm(single_quiz_localize.confirm_retake_quiz, function (confirm) {
620
- if (!confirm) {
621
- return;
622
- }
623
- that.$buttons.retake.prop('disabled', true);
624
- LearnPress.MessageBox.blockUI();
625
- that.retakeQuiz({
626
- complete: function (response) {
627
- LearnPress.MessageBox.hide();
628
- LearnPress.Hook.doAction('learn_press_user_retaken_quiz', response, that);
629
- }
630
- });
631
- })
632
- }
633
- },
634
- _finishQuiz : function () {
635
- var that = this;
636
- if (LearnPress.Hook.applyFilters('learn_press_before_finish_quiz', true, that) !== false) {
637
- LearnPress.confirm(single_quiz_localize.confirm_finish_quiz, function (confirm) {
638
- if (!confirm) {
639
- return;
640
- }
641
- that.$buttons.next.prop('disabled', true);
642
- that.$buttons.prev.prop('disabled', true);
643
- that.$buttons.finish.prop('disabled', true);
644
- LearnPress.MessageBox.blockUI();
645
- that.finishQuiz({
646
- data : {
647
- save_id : that.model.get('question_id'),
648
- question_answer: that.$('form').serialize(),
649
- time_remaining : that.model.get('time_remaining')
650
- },
651
- complete: function (response) {
652
- LearnPress.MessageBox.hide();
653
- LearnPress.Hook.doAction('learn_press_user_finished_quiz', response, that);
654
- }
655
- });
656
- });
657
- }
658
- },
659
- _updateQuestion : function ($newQuestion) {
660
- var $container = this.$('.quiz-question-content form'),
661
- $oldQuestion = $container.find('.learn-press-question-wrap');
662
- if ($oldQuestion.length) {
663
- $oldQuestion.replaceWith($newQuestion);
664
- } else {
665
- $container.append($newQuestion);
666
- }
667
- LearnPress.Hook.doAction('learn_press_update_question_content', $newQuestion, $oldQuestion, this);
668
- LearnPress.setUrl($newQuestion.find('input[name="learn-press-question-permalink"]').val());
669
-
670
- },
671
- initCountdown : function () {
672
- var that = this,
673
- $countdown = this.$countdown;
674
- if (!$countdown) {
675
- this.$countdown = $("#quiz-countdown-value");
676
- this.$countdown.backward_timer({
677
- seconds : parseInt(this.model.get('time_remaining')),
678
- format : that.model.get('time_format'),
679
- on_exhausted: function (timer) {
680
- that._timeOver(timer)
681
- },
682
- on_tick : function (timer) {
683
- var color = (timer.seconds_left <= 5) ? "#F00" : "";
684
- if (color) timer.target.css('color', color);
685
- //that.model.set('time_remaining', timer.seconds_left);
686
- }
687
- });
688
- }
689
- },
690
- pause : function () {
691
- this.$countdown.backward_timer('cancel');
692
- },
693
- resume : function () {
694
- this.$countdown.backward_timer('start');
695
- },
696
- loadPage : function (url) {
697
- url = url || window.location.href;
698
- window.location.href = url;
699
- },
700
- _timeOver : function (timer) {
701
- timer.target.css('color', '#F00');
702
- LearnPress.MessageBox.blockUI(single_quiz_localize.quiz_time_is_over_message);
703
- this.finishQuiz({
704
- complete: function (response) {
705
- LearnPress.MessageBox.hide();
706
- if (response.redirect) {
707
- LearnPress.reload(response.redirect);
708
- }
709
- }
710
- });
711
- },
712
- block_page : function () {
713
- //this.$el.block_ui();
714
- },
715
- unblock_page : function () {
716
- //this.$el.unblock_ui();
717
- }
718
- });
719
- LearnPress.Quiz = {
720
- init: function (data) {
721
- var model = new LearnPress_Model_Quiz(data);
722
- new LearnPress_View_Quiz(model);
723
- }
724
- }
725
-
726
-
727
- $(document).ready(function () {
728
- var json = JSON.stringify(single_quiz_params);
729
- LearnPress.Quiz.init(single_quiz_params);
730
- })
731
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/frontend/single-quiz.min.js DELETED
@@ -1 +0,0 @@
1
- if(typeof LP=="undefined"){var LP={}}(function(d){var e=window.LP_Model_Quiz=Backbone.Model.extend({defaults:{},data:null,view:false,url:function(){},urlRoot:"",questions:null,initialize:function(){this.createQuestionsList()},createQuestionsList:function(){this.questions=new c();_.each(this.get("questions"),function(g,h){var f=new a(d.extend({quiz_id:this.get("id"),user_id:this.get("user_id")},g));f.urlRoot=this.get("ajaxurl");f.view=this.view;this.questions.add(f)},this)},next:function(i){if(!this.isLast()){var g=this.findNext(),f=this.questions.findWhere({id:g}),h=this;f.submit({data:{save_id:h.get("question_id"),question_answer:this.view.$("form").serializeJSON(),time_remaining:h.get("time_remaining")},complete:function(){h.set("question_id",g);d.isFunction(i)&&i.apply(h);LP.Hook.doAction("learn_press_next_question",g,h)}})}},prev:function(i){if(!this.isFirst()){var h=this.findPrev(),f=this.questions.findWhere({id:h}),g=this;f.submit({data:{save_id:g.get("question_id"),question_answer:this.view.$("form").serializeJSON(),time_remaining:g.get("time_remaining")},complete:function(){g.set("question_id",h);d.isFunction(i)&&i.apply(g);LP.Hook.doAction("learn_press_previous_question",h,g)}})}},select:function(i,h){var f=this.questions.findWhere({id:i}),g=this;f&&f.submit({data:{save_id:g.get("question_id"),question_answer:this.view.$("form").serializeJSON(),time_remaining:g.get("time_remaining")},complete:function(j){g.set("question_id",i);d.isFunction(h)&&h.apply(g,[j])}})},getQuestionPosition:function(f){f=f||this.get("question_id");return _.indexOf(this.getIds(),f)},countQuestions:function(){return this.questions.length},isLast:function(f){f=f||this.get("question_id");return this.getQuestionPosition(f)==(this.countQuestions()-1)},isFirst:function(f){f=f||this.get("question_id");return this.getQuestionPosition(f)==0},findNext:function(f){f=f||this.get("question_id");var g=this.getIds(),h=this.getQuestionPosition(f);h++;if(typeof g[h]=="undefined"){return false}return g[h]},findPrev:function(f){f=f||this.get("question_id");var g=this.getIds(),h=this.getQuestionPosition(f);h--;if(typeof g[h]=="undefined"){return false}return g[h]},current:function(){return this.questions.findWhere({id:parseInt(this.get("question_id"))})},getIds:function(){return d.map(this.get("questions"),function(g,f){return parseInt(g.id)})}});var a=window.LP_Model_Question=Backbone.Model.extend({defaults:{},data:null,view:false,url:function(){return this.urlRoot},urlRoot:"",initialize:function(){},element:function(){return d(this.get("content"))},submit:function(f){var g=this;f=d.extend({complete:null,data:{}},f||{});this.fetch({data:d.extend({action:"learnpress_load_quiz_question",user_id:this.get("user_id"),quiz_id:this.get("quiz_id"),question_id:this.get("id")},f.data||{}),complete:(function(i){var h=LP.parseJSON(i.responseText);if(h.result=="success"){g.set(h.question);if(h.permalink){LP.setUrl(h.permalink)}d.isFunction(f.complete)&&f.complete.call(g,h)}})})},check:function(f){var g=this;if(d.isFunction(f)){f={complete:f}}else{f=d.extend({complete:null,data:{}},f||{})}LP.doAjax({data:d.extend({"lp-ajax":"check-question",user_id:this.get("user_id"),quiz_id:this.get("quiz_id"),question_id:this.get("id"),save_id:this.get("id"),question_answer:d("form#learn-press-quiz-question").serializeJSON()},f.data||{}),success:function(h,i){g.set("checked",h.checked);d.isFunction(f.complete)&&f.complete.call(g,h)}})}});var c=window.LP_Collection_Questions=Backbone.Collection.extend({url:"admin-ajax.php",model:a});var b=window.LP_View_Quiz=Backbone.View.extend({model:{},events:{"click .button-start-quiz":"_startQuiz","click .button-finish-quiz":"_finishQuiz","click .button-retake-quiz":"_retakeQuiz","click .next-question":"_nextQuestion","click .prev-question":"_prevQuestion","click .check-question":"_checkQuestion","click .quiz-questions-list li a":"_selectQuestion","click .hint-question":"_hintQuestion","click .explain-question":"_explainQuestion"},el:".single-quiz",isRendered:false,$buttons:{},initialize:function(f){this.model=f;this.model.view=this;this.listenTo(this.model,"change:question_id",this.changeQuestion);this.listenTo(this.model,"change",this.render);this.listenTo(this.model,"change",this.updateCountdown);LP.Hook.addAction("learn_press_check_question",function(g,h){h.updateAnswer.apply(h,[g])}).addAction("learn_press_update_question_content",function(h,g,j){var i=j.model.current();setTimeout(function(){if(i.get("checked")){j.updateAnswer.apply(j,[{checked:i.get("checked"),result:"success"}])}},100)});_.bindAll(this,"render","_timeOver","_checkQuestion","_hintQuestion","updateAnswer","updateCountdown");this._create();this.render();this.updateCountdown(true)},_create:function(){this.$buttons={start:this.$(".button-start-quiz"),finish:this.$(".button-finish-quiz"),retake:this.$(".button-retake-quiz"),next:this.$(".next-question"),prev:this.$(".prev-question"),check:this.$(".check-question"),hint:this.$(".hint-question"),explain:this.$(".explain-question")};if(this.model.get("status")=="started"){this.initCountdown();var f=this.model.current();if(f){f.set({content:d("#learn-press-quiz-question .question-"+f.get("id"))});this._updateQuestion(f.element())}}var g=this;this.setButtonsState()},changeQuestion:function(){var f=this.model.current();if(f){this._updateQuestion(f.element())}},updateCountdown:function(f){if(!this.model.hasChanged("status")&&!f){return}if(this.model.get("status")=="started"){if(!this.$countdown){this.initCountdown()}this.$countdown.backward_timer("start")}},render:function(){if(!this.model.hasChanged("question_id")&&!this.model.hasChanged("status")){}var f=this.model.current();this.setButtonsState();switch(this.model.get("status")){case"started":this.$(".quiz-intro").remove();this.$(".quiz-countdown").removeClass("hide-if-js")}if(f&&this.model.get("status")=="started"){this.$('form[name="learn-press-quiz-question"]').html(f.get("content"));this.$('#learn-press-quiz-questions li[data-id="'+f.get("id")+'"]').addClass("current").siblings(".current").removeClass("current")}this.isRendered=true;this.$el.css("visibility","visible")},setButtonsState:function(){var f="hide-if-js",g=this.model.current();switch(this.model.get("status").toLowerCase()){case"completed":this.$buttons.start.addClass(f);this.$buttons.finish.addClass(f);this.$buttons.check.addClass(f);this.$buttons.retake.removeClass(f);break;case"started":this.$buttons.start.addClass(f);this.$buttons.finish.removeClass(f);this.$buttons.retake.addClass(f);if(this.model.countQuestions()<=1){this.$buttons.next.addClass(f);this.$buttons.prev.addClass(f)}else{this.$buttons.next.removeClass(f);this.$buttons.prev.removeClass(f);if(this.model.isLast()){this.$buttons.next.addClass(f);this.$buttons.finish.filter('[data-area="nav"]').removeClass(f)}else{this.$buttons.finish.filter('[data-area="nav"]').addClass(f)}if(this.model.isFirst()){this.$buttons.prev.addClass(f)}}if(g&&g.get("check_answer")){this.$buttons.check.removeClass(f)}else{this.$buttons.check.addClass(f)}if(g&&g.get("hint")){this.$buttons.hint.removeClass(f)}else{this.$buttons.hint.addClass(f)}if(g&&g.get("explanation")){this.$buttons.explain.removeClass(f)}else{this.$buttons.explain.addClass(f)}break;default:this.$buttons.next.addClass(f);this.$buttons.prev.addClass(f);this.$buttons.start.removeClass(f);this.$buttons.finish.addClass(f);this.$buttons.retake.addClass(f);this.$(".quiz-questions .qq.current").removeClass("current")}},startQuiz:function(f){this.block_page();f=d.extend({complete:false},f||{});var g=this,h=d.extend({"lp-ajax":"start-quiz",quiz_id:this.model.get("id"),nonce:this.model.get("nonce")},f.data||{});LP.doAjax({url:window.location.href,data:h,success:function(i,j){LP.MessageBox.hide();var i=LP.Hook.applyFilters("learn_press_start_quiz_results",i,g);if(i.result=="success"){g.model.current().set(i.question);g.model.set({status:i.data.status,question_id:i.question.id});LP.setUrl(i.question.permalink)}d.isFunction(f.complete)&&f.complete.call(g,i)}})},finishQuiz:function(f){this.pause();this.block_page();f=d.extend({complete:false},f||{});var g=this,h=d.extend({"lp-ajax":"finish-quiz",quiz_id:this.model.get("id"),nonce:this.model.get("nonce")},f.data||{});LP.doAjax({data:h,success:function(i){var j=undefined;d.isFunction(f.complete)&&(j=f.complete.call(LP.Quiz,i));LP.Hook.doAction("learn_press_finish_quiz",g.model.get("id"),g);LP.MessageBox.show(single_quiz_localize.finished_quiz,{autohide:2000,onHide:function(){if(j&&j.redirect){LP.reload(j.redirect)}else{if(j==undefined&&i.redirect){LP.reload(i.redirect)}}}})}})},retakeQuiz:function(f){this.block_page();f=d.extend({complete:false},f||{});var g=this,h=d.extend({"lp-ajax":"retake-quiz",quiz_id:this.model.get("id"),nonce:this.model.get("nonce")},f.data||{});LP.doAjax({data:h,success:function(i,j){LP.MessageBox.hide();if(i.result=="success"){d.isFunction(f.complete)&&f.complete.call(LP.Quiz,i);LP.MessageBox.show(single_quiz_localize.retaken_quiz,{autohide:2000,onHide:function(){LP.reload(i.redirect)}})}else{LP.alert(i.message)}}})},updateAnswer:function(f){if(!f||f.result!="success"){return}var h=this.model.current(),g=d(h.get("content"));switch(h.get("type")){case"true_or_false":case"single_choice":case"multi_choice":d.each(f.checked,function(j,i){var m=g.find('input[value="'+i.value+'"]'),l=m.closest("li").removeClass("answer-true user-answer-false");if(i.is_true=="yes"){l.addClass("answer-true")}if(f.answered){if(typeof f.answered=="string"){if(f.answered==i.value){m.prop("checked",true)}}else{if(d.inArray(i.value,f.answered)!=-1){m.prop("checked",true)}}}if(m.is(":checked")&&i.is_true=="yes"){}else{l.addClass("user-answer-false")}});g.addClass("checked").find("input, select, textarea").prop("disabled",true);h.set({content:g})}this.render()},_checkQuestion:function(){if(LP.Hook.applyFilters("learn_press_before_check_question",true,this)!==false){var f=this;this.$buttons.next.prop("disabled",true);this.$buttons.prev.prop("disabled",true);this.$buttons.finish.prop("disabled",true);this.$buttons.check.prop("disabled",true);this.pause();this.block_page();this.model.current().check({complete:function(g){f.$buttons.next.prop("disabled",false);f.$buttons.prev.prop("disabled",false);f.$buttons.finish.prop("disabled",false);f.$buttons.check.prop("disabled",false);LP.Hook.doAction("learn_press_check_question",g,f);f.resume()},data:{nonce:this.model.get("nonce")}})}},_hintQuestion:function(g){g.preventDefault();var f=this.model.current();if(f&&f.get("hint")){d("#learn-press-question-hint-"+f.get("id")).toggleClass("hide-if-js")}},_explainQuestion:function(g){g.preventDefault();var f=this.model.current();if(f&&f.get("explanation")){d("#learn-press-question-explanation-"+f.get("id")).toggleClass("hide-if-js")}},_nextQuestion:function(){if(LP.Hook.applyFilters("learn_press_before_next_question",true,this)!==false){var f=this;this.$buttons.next.prop("disabled",true);this.$buttons.prev.prop("disabled",true);this.$buttons.finish.prop("disabled",true);this.pause();this.block_page();this.model.next(function(){f.$buttons.next.prop("disabled",false);f.$buttons.prev.prop("disabled",false);f.$buttons.finish.prop("disabled",false)})}},_prevQuestion:function(){if(LP.Hook.applyFilters("learn_press_before_prev_question",true,this)!==false){var f=this;this.$buttons.next.prop("disabled",true);this.$buttons.prev.prop("disabled",true);this.$buttons.finish.prop("disabled",true);this.pause();this.block_page();this.model.prev(function(){f.$buttons.next.prop("disabled",false);f.$buttons.prev.prop("disabled",false);f.$buttons.finish.prop("disabled",false)})}},_selectQuestion:function(g){g.preventDefault();var f=this,h=d(g.target).closest(".learn-press-question-wrap").data("id");if(this.model.get("status")!="started"){return false}if(LP.Hook.applyFilters("learn_press_before_select_question",true,f)!==false){this.pause();this.$buttons.next.prop("disabled",true);this.$buttons.prev.prop("disabled",true);this.$buttons.finish.prop("disabled",true);this.pause();this.model.select(h,function(i){LP.Hook.doAction("learn_press_selected_question",h,f);f.$buttons.next.prop("disabled",false);f.$buttons.prev.prop("disabled",false);f.$buttons.finish.prop("disabled",false)})}},_getNonce:function(f){return this.$("input#"+f+"-nonce").val()},_startQuiz:function(){var f=this;if(LP.Hook.applyFilters("learn_press_before_start_quiz",true,f)!==false){f.$buttons.next.prop("disabled",true);f.$buttons.prev.prop("disabled",true);f.$buttons.finish.prop("disabled",true);LP.MessageBox.blockUI();f.startQuiz({complete:function(g){LP.MessageBox.hide();if(g.message){LP.alert(g.message,function(){if(g.redirect){LP.reload(g.redirect)}})}else{if(g.redirect){LP.reload(g.redirect)}}f.$buttons.next.prop("disabled",false);f.$buttons.prev.prop("disabled",false);f.$buttons.finish.prop("disabled",false);LP.Hook.doAction("learn_press_start_quiz",g,f)}})}},_retakeQuiz:function(){var f=this;if(LP.Hook.applyFilters("learn_press_before_retake_quiz",true,f)!==false){LP.confirm(single_quiz_localize.confirm_retake_quiz,function(g){if(!g){return}f.$buttons.retake.prop("disabled",true);LP.MessageBox.blockUI();f.retakeQuiz({complete:function(h){LP.MessageBox.hide();LP.Hook.doAction("learn_press_user_retaken_quiz",h,f)}})})}},_finishQuiz:function(){var f=this;if(LP.Hook.applyFilters("learn_press_before_finish_quiz",true,f)!==false){LP.confirm(single_quiz_localize.confirm_finish_quiz,function(g){if(!g){return}f.$buttons.next.prop("disabled",true);f.$buttons.prev.prop("disabled",true);f.$buttons.finish.prop("disabled",true);LP.MessageBox.blockUI();f.finishQuiz({data:{save_id:f.model.get("question_id"),question_answer:f.$("form").serializeJSON(),time_remaining:f.model.get("time_remaining")},complete:function(h){LP.MessageBox.hide();LP.Hook.doAction("learn_press_user_finished_quiz",h,f)}})})}},_updateQuestion:function(g){var h=this.$(".quiz-question-content form"),f=h.find(".learn-press-question-wrap");if(f.length){f.replaceWith(g)}else{h.append(g)}LP.Hook.doAction("learn_press_update_question_content",g,f,this);LP.setUrl(g.find('input[name="learn-press-question-permalink"]').val())},initCountdown:function(){var g=this,f=this.$countdown;if(!f){this.$countdown=d("#quiz-countdown-value");this.$countdown.backward_timer({seconds:parseInt(this.model.get("time_remaining")),format:g.model.get("time_format"),on_exhausted:function(h){g._timeOver(h)},on_tick:function(i){var h=(i.seconds_left<=5)?"#F00":"";if(h){i.target.css("color",h)}}})}},pause:function(){this.$countdown.backward_timer("cancel")},resume:function(){this.$countdown.backward_timer("start")},loadPage:function(f){f=f||window.location.href;window.location.href=f},_timeOver:function(f){f.target.css("color","#F00");LP.MessageBox.blockUI(single_quiz_localize.quiz_time_is_over_message);this.finishQuiz({complete:function(g){LP.MessageBox.hide();if(g.redirect){LP.reload(g.redirect)}}})},block_page:function(){},unblock_page:function(){}});LP.Quiz={init:function(g){var f=new e(g);new b(f)}};d(document).ready(function(){var f=JSON.stringify(single_quiz_params);LP.Quiz.init(single_quiz_params)})})(jQuery);
 
assets/js/global.js CHANGED
@@ -1,10 +1,10 @@
1
  /**
2
  * Common functions/utils used in all page
3
  */
4
- if (typeof window.LearnPress == 'undefined') {
5
- window.LearnPress = {};
6
  }
7
- ;
8
  (function ($) {
9
  $.fn.serializeJSON = function () {
10
  var unIndexed = $(this).serializeArray(),
@@ -70,22 +70,60 @@ if (typeof window.LearnPress == 'undefined') {
70
  } else {
71
  indexed[match[0]] = this.value;
72
  }
73
- indexed['how-old-are-you'] = 11
74
  });
75
  return indexed;
76
  };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
77
  $.fn.hasEvent = function (name) {
78
  var events = $(this).data('events');
79
- if (typeof events.LearnPress == 'undefined') {
80
  return false;
81
  }
82
- for (i = 0; i < events.LearnPress.length; i++) {
83
- if (events.LearnPress[i].namespace == name) {
84
  return true;
85
  }
86
  }
87
  return false;
88
- }
89
  $.fn.dataToJSON = function () {
90
  var json = {};
91
  $.each(this[0].attributes, function () {
@@ -95,14 +133,14 @@ if (typeof window.LearnPress == 'undefined') {
95
  }
96
  });
97
  return json;
98
- }
99
-
100
  String.prototype.getQueryVar = function (name) {
101
  name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
102
  var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
103
  results = regex.exec(this);
104
  return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
105
- }
106
  String.prototype.addQueryVar = function (name, value) {
107
  var url = this;
108
  if (name.match(/\[/)) {
@@ -117,26 +155,27 @@ if (typeof window.LearnPress == 'undefined') {
117
  }
118
  }
119
  return url;
120
- }
121
  String.prototype.removeQueryVar = function (name) {
122
  var url = this;
123
  name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
124
  var regex = new RegExp("[\\?&]" + name + "([\[][^=]*)?=([^&#]*)", 'g');
125
  url = url.replace(regex, '');
126
  return url;
127
- }
128
- if($.isEmptyObject("") == false){
129
- $.isEmptyObject = function(a){
 
130
  for (prop in a) {
131
  if (a.hasOwnProperty(prop)) {
132
  return false;
133
  }
134
  }
135
  return true;
136
- }
137
  }
138
 
139
- LearnPress.MessageBox = {
140
  /*
141
  *
142
  */
@@ -148,7 +187,7 @@ if (typeof window.LearnPress == 'undefined') {
148
  quickConfirm : function (elem, args) {
149
  var $e = $(elem);
150
  $('[learn-press-quick-confirm]').each(function () {
151
- ( $ins = $(this).data('quick-confirm') ) && (console.log($ins), $ins.destroy() );
152
  });
153
  !$e.attr('learn-press-quick-confirm') && $e.attr('learn-press-quick-confirm', 'true').data('quick-confirm',
154
  new (function (elem, args) {
@@ -232,11 +271,11 @@ if (typeof window.LearnPress == 'undefined') {
232
  autohide: false,
233
  message : message,
234
  data : false,
235
- id : LearnPress.uniqueId(),
236
  onHide : null
237
  }, args || {});
238
 
239
- this.instances.push(args)
240
  this.instance = args;
241
 
242
  var $doc = $(document),
@@ -248,7 +287,7 @@ if (typeof window.LearnPress == 'undefined') {
248
  if (!this.$window) {
249
  this.$window = $('<div id="learn-press-message-box-window"><div id="message-box-wrap"></div> </div>').insertAfter(this.$block);
250
  this.$window.click(function () {
251
- })
252
  }
253
  //this.events = args.events || {};
254
  this._createWindow(message, args.title, args.buttons);
@@ -260,11 +299,11 @@ if (typeof window.LearnPress == 'undefined') {
260
  this.update(true);
261
  if (args.autohide) {
262
  setTimeout(function () {
263
- LearnPress.MessageBox.hide();
264
- $.isFunction(args.onHide) && args.onHide.call(LearnPress.MessageBox, args);
265
- }, args.autohide)
266
  }
267
- }, this)()
268
  },
269
  blockUI : function (message) {
270
 
@@ -289,7 +328,7 @@ if (typeof window.LearnPress == 'undefined') {
289
  .unbind('scroll.message-box', this.update);
290
  } else {
291
  if (this.instance) {
292
- this._createWindow(this.instance.message, this.instance.title, this.instance.buttons)
293
  }
294
  }
295
 
@@ -299,7 +338,7 @@ if (typeof window.LearnPress == 'undefined') {
299
  $wrap = this.$window.find('#message-box-wrap'),
300
  timer = $wrap.data('timer'),
301
  _update = function () {
302
- LearnPress.Hook.doAction('learn_press_message_box_before_resize', that);
303
  var $content = $wrap.find('.message-box-content').css("height", "").css('overflow', 'hidden'),
304
  width = $wrap.outerWidth(),
305
  height = $wrap.outerHeight(),
@@ -308,16 +347,16 @@ if (typeof window.LearnPress == 'undefined') {
308
  top = $wrap.offset().top;
309
  if (contentHeight > windowHeight - 50) {
310
  $content.css({
311
- height: windowHeight - 50
312
  });
313
- height = $wrap.outerHeight()
314
  } else {
315
  $content.css("height", "").css('overflow', '');
316
  }
317
  $wrap.css({
318
  marginTop: ( $(window).height() - height ) / 2
319
  });
320
- LearnPress.Hook.doAction('learn_press_message_box_resize', height, that);
321
  };
322
  if (force) _update();
323
  timer && clearTimeout(timer);
@@ -332,10 +371,10 @@ if (typeof window.LearnPress == 'undefined') {
332
  var len = this.instances.length;
333
  if (len) {
334
  this.instance = this.instances[len - 1];
335
- this.$window.attr('instance', this.instance.id)
336
  } else {
337
  this.instance = false;
338
- this.$window.removeAttr('instance')
339
  }
340
  break;
341
  }
@@ -359,15 +398,15 @@ if (typeof window.LearnPress == 'undefined') {
359
  var $buttons = $('<div class="message-box-buttons"></div>');
360
  switch (buttons) {
361
  case 'yesNo':
362
- $buttons.append(this._createButton(LearnPress_Settings.localize.button_yes, 'yes'));
363
- $buttons.append(this._createButton(LearnPress_Settings.localize.button_no, 'no'));
364
  break;
365
  case 'okCancel':
366
- $buttons.append(this._createButton(LearnPress_Settings.localize.button_ok, 'ok'));
367
- $buttons.append(this._createButton(LearnPress_Settings.localize.button_cancel, 'cancel'));
368
  break;
369
  default:
370
- $buttons.append(this._createButton(LearnPress_Settings.localize.button_ok, 'ok'));
371
  }
372
  $wrap.append($buttons);
373
  }
@@ -379,19 +418,19 @@ if (typeof window.LearnPress == 'undefined') {
379
  var instance = $(this).data('instance'),
380
  callback = instance.events[$(this).data('callback')];
381
  if ($.type(callback) == 'function') {
382
- if (callback.apply(LearnPress.MessageBox, [instance]) === false) {
383
  return;
384
  } else {
385
- LearnPress.MessageBox.hide(null, instance);
386
  }
387
  } else {
388
- LearnPress.MessageBox.hide(null, instance);
389
  }
390
  }).data('instance', this.instance);
391
  return $button;
392
  }
393
- }
394
- LearnPress.Hook = {
395
  hooks : {action: {}, filter: {}},
396
  addAction : function (action, callable, priority, tag) {
397
  this.addHook('action', action, callable, priority, tag);
@@ -436,7 +475,7 @@ if (typeof window.LearnPress == 'undefined') {
436
  var hooks = this.hooks[hookType][action], hook;
437
  //sort by priority
438
  hooks.sort(function (a, b) {
439
- return a["priority"] - b["priority"]
440
  });
441
  for (var i = 0; i < hooks.length; i++) {
442
  hook = hooks[i].callable;
@@ -466,26 +505,61 @@ if (typeof window.LearnPress == 'undefined') {
466
  return this;
467
  }
468
  };
469
- LearnPress = $.extend({
470
- setUrl : function (url, title) {
471
- history.pushState({}, title, url);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
472
  },
473
- getUrl : function () {
474
  return window.location.href;
475
  },
476
- addQueryVar : function (name, value, url) {
477
  return (url == undefined ? window.location.href : url).addQueryVar(name, value);
478
  },
479
- removeQueryVar: function (name, url) {
480
  return (url == undefined ? window.location.href : url).removeQueryVar(name);
481
  },
482
- reload : function (url) {
483
  if (!url) {
484
  url = window.location.href;
485
  }
486
  window.location.href = url;
487
  },
488
- parseJSON : function (data) {
 
 
 
 
 
 
 
 
489
  var m = data.match(/<!-- LP_AJAX_START -->(.*)<!-- LP_AJAX_END -->/);
490
  try {
491
  if (m) {
@@ -494,19 +568,35 @@ if (typeof window.LearnPress == 'undefined') {
494
  data = $.parseJSON(data);
495
  }
496
  } catch (e) {
497
- LearnPress.log(e);
498
  data = {};
499
  }
500
  return data;
501
  },
502
- parseResponse : function (response, type) {
503
- var m = response.match(/<!-- LP_AJAX_START -->(.*)<!-- LP_AJAX_END -->/);
504
- if (m) {
505
- response = m[1];
506
- }
507
- return ( type || 'json' ) == 'json' ? this.parseJSON(response) : response;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
508
  },
509
- doAjax : function (args) {
510
  var type = args.type || 'post',
511
  dataType = args.dataType || 'json',
512
  action = ( ( args.prefix == undefined ) || 'learnpress_') + args.action,
@@ -518,11 +608,11 @@ if (typeof window.LearnPress == 'undefined') {
518
  type : type,
519
  dataType: 'html',
520
  success : function (raw) {
521
- var response = LearnPress.parseResponse(raw, dataType);
522
  $.isFunction(args.success) && args.success(response, raw);
523
  },
524
  error : function () {
525
- $.isFunction(args.error) && args.error.apply(null, LearnPress.funcArgs2Array());
526
  }
527
  });
528
  },
@@ -536,9 +626,9 @@ if (typeof window.LearnPress == 'undefined') {
536
  },
537
  addFilter : function (action, callback) {
538
  var $doc = $(document),
539
- event = 'LearnPress.' + action;
540
  $doc.on(event, callback);
541
- LearnPress.log($doc.data('events'));
542
  return this;
543
  },
544
  applyFilters : function () {
@@ -546,7 +636,7 @@ if (typeof window.LearnPress == 'undefined') {
546
  action = arguments[0],
547
  args = this.funcArgs2Array(arguments);
548
  if ($doc.hasEvent(action)) {
549
- args[0] = 'LearnPress.' + action;
550
  return $doc.triggerHandler.apply($doc, args);
551
  }
552
  return args[1];
@@ -559,7 +649,7 @@ if (typeof window.LearnPress == 'undefined') {
559
  action = arguments[0],
560
  args = this.funcArgs2Array(arguments);
561
  if ($doc.hasEvent(action)) {
562
- args[0] = 'LearnPress.' + action;
563
  $doc.trigger.apply($doc, args);
564
  }
565
  },
@@ -623,11 +713,26 @@ if (typeof window.LearnPress == 'undefined') {
623
  return retId;
624
  },
625
  log : function () {
626
- if (typeof LEARN_PRESS_DEBUG != 'undefined' && LEARN_PRESS_DEBUG && console) {
627
- for (var i = 0, n = arguments.length; i < n; i++) {
628
- console.log(arguments[i]);
629
- }
630
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
631
  },
632
  template : _.memoize(function (id, data) {
633
  var compiled,
@@ -644,7 +749,7 @@ if (typeof window.LearnPress == 'undefined') {
644
  };
645
  return data ? tmpl(data) : tmpl;
646
  }, function (a, b) {
647
- return JSON.stringify(b)
648
  }),
649
  alert : function (localize, callback) {
650
  var title = '',
@@ -660,7 +765,7 @@ if (typeof window.LearnPress == 'undefined') {
660
  }
661
  }
662
  $.alerts.alert(message, title, function (e) {
663
- LearnPress._on_alert_hide();
664
  callback && callback(e);
665
  });
666
  this._on_alert_show();
@@ -680,7 +785,7 @@ if (typeof window.LearnPress == 'undefined') {
680
  }
681
  }
682
  $.alerts.confirm(message, title, function (e) {
683
- LearnPress._on_alert_hide();
684
  callback && callback(e);
685
  });
686
  this._on_alert_show();
@@ -705,10 +810,40 @@ if (typeof window.LearnPress == 'undefined') {
705
  top : '+=50',
706
  opacity: 0
707
  }, 250, function () {
708
- $(this).remove()
709
- })
 
 
 
 
 
 
 
 
 
 
 
 
 
 
710
  }
711
- }, LearnPress);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
712
 
713
  $.fn.findNext = function (selector) {
714
  var $selector = $(selector),
@@ -716,7 +851,7 @@ if (typeof window.LearnPress == 'undefined') {
716
  index = $selector.index($root),
717
  $next = $selector.eq(index + 1);
718
  return $next.length ? $next : false;
719
- }
720
 
721
  $.fn.findPrev = function (selector) {
722
  var $selector = $(selector),
@@ -724,7 +859,49 @@ if (typeof window.LearnPress == 'undefined') {
724
  index = $selector.index($root),
725
  $prev = $selector.eq(index - 1);
726
  return $prev.length ? $prev : false;
727
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
728
 
729
  function __initSubtabs() {
730
  $('.learn-press-subtabs').each(function () {
@@ -737,15 +914,15 @@ if (typeof window.LearnPress == 'undefined') {
737
  $tab.parent().addClass('current').siblings().removeClass('current');
738
  current = $($contentID).addClass('current');
739
  current.siblings().removeClass('current');
740
- //LearnPress.setUrl($contentID);
741
  e.preventDefault();
742
  }).filter(function () {
743
  return $(this).attr('href') == window.location.hash;
744
  }).trigger('click');
745
  if (!current) {
746
- $tabs.first().trigger('click')
747
  }
748
- })
749
  }
750
 
751
  $(document).ready(function () {
@@ -753,6 +930,58 @@ if (typeof window.LearnPress == 'undefined') {
753
  $.alerts.overlayColor = '#000';
754
  $.alerts.overlayOpacity = 0.5;
755
  }
756
- });
757
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
758
  })(jQuery);
1
  /**
2
  * Common functions/utils used in all page
3
  */
4
+ if (typeof window.LP == 'undefined') {
5
+ window.LP = window.LearnPress = {};
6
  }
7
+
8
  (function ($) {
9
  $.fn.serializeJSON = function () {
10
  var unIndexed = $(this).serializeArray(),
70
  } else {
71
  indexed[match[0]] = this.value;
72
  }
 
73
  });
74
  return indexed;
75
  };
76
+ $.fn.tooltip = function (options) {
77
+ options = $.extend({}, {
78
+ offset: [0, 0]
79
+ }, options || {});
80
+ return $.each(this, function () {
81
+ var $el = $(this),
82
+ content = $el.data('content');
83
+ if (!content || ($el.data('tooltip') != undefined)) {
84
+ return;
85
+ }
86
+ var $tooltip = null;
87
+ $el.hover(function (e) {
88
+ $tooltip = $('<div class="learn-press-tooltip-bubble"/>').html(content).appendTo($('body')).hide();
89
+ var position = $el.offset();
90
+ if ($.isArray(options.offset)) {
91
+ var top = options.offset[1],
92
+ left = options.offset[0];
93
+ if ($.isNumeric(left)) {
94
+ position.left += left;
95
+ } else {
96
+
97
+ }
98
+ if ($.isNumeric(top)) {
99
+ position.top += top;
100
+ } else {
101
+
102
+ }
103
+ }
104
+ $tooltip.css({
105
+ top : position.top,
106
+ left: position.left
107
+ });
108
+ $tooltip.fadeIn();
109
+ }, function () {
110
+ $tooltip && $tooltip.remove();
111
+ });
112
+ $el.data('tooltip', true);
113
+ });
114
+ };
115
  $.fn.hasEvent = function (name) {
116
  var events = $(this).data('events');
117
+ if (typeof events.LP == 'undefined') {
118
  return false;
119
  }
120
+ for (i = 0; i < events.LP.length; i++) {
121
+ if (events.LP[i].namespace == name) {
122
  return true;
123
  }
124
  }
125
  return false;
126
+ };
127
  $.fn.dataToJSON = function () {
128
  var json = {};
129
  $.each(this[0].attributes, function () {
133
  }
134
  });
135
  return json;
136
+ };
137
+
138
  String.prototype.getQueryVar = function (name) {
139
  name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
140
  var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
141
  results = regex.exec(this);
142
  return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
143
+ };
144
  String.prototype.addQueryVar = function (name, value) {
145
  var url = this;
146
  if (name.match(/\[/)) {
155
  }
156
  }
157
  return url;
158
+ };
159
  String.prototype.removeQueryVar = function (name) {
160
  var url = this;
161
  name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
162
  var regex = new RegExp("[\\?&]" + name + "([\[][^=]*)?=([^&#]*)", 'g');
163
  url = url.replace(regex, '');
164
  return url;
165
+ };
166
+
167
+ if ($.isEmptyObject("") == false) {
168
+ $.isEmptyObject = function (a) {
169
  for (prop in a) {
170
  if (a.hasOwnProperty(prop)) {
171
  return false;
172
  }
173
  }
174
  return true;
175
+ };
176
  }
177
 
178
+ LP.MessageBox = {
179
  /*
180
  *
181
  */
187
  quickConfirm : function (elem, args) {
188
  var $e = $(elem);
189
  $('[learn-press-quick-confirm]').each(function () {
190
+ ( $ins = $(this).data('quick-confirm') ) && ( console.log($ins), $ins.destroy() );
191
  });
192
  !$e.attr('learn-press-quick-confirm') && $e.attr('learn-press-quick-confirm', 'true').data('quick-confirm',
193
  new (function (elem, args) {
271
  autohide: false,
272
  message : message,
273
  data : false,
274
+ id : LP.uniqueId(),
275
  onHide : null
276
  }, args || {});
277
 
278
+ this.instances.push(args);
279
  this.instance = args;
280
 
281
  var $doc = $(document),
287
  if (!this.$window) {
288
  this.$window = $('<div id="learn-press-message-box-window"><div id="message-box-wrap"></div> </div>').insertAfter(this.$block);
289
  this.$window.click(function () {
290
+ });
291
  }
292
  //this.events = args.events || {};
293
  this._createWindow(message, args.title, args.buttons);
299
  this.update(true);
300
  if (args.autohide) {
301
  setTimeout(function () {
302
+ LP.MessageBox.hide();
303
+ $.isFunction(args.onHide) && args.onHide.call(LP.MessageBox, args);
304
+ }, args.autohide);
305
  }
306
+ }, this)();
307
  },
308
  blockUI : function (message) {
309
 
328
  .unbind('scroll.message-box', this.update);
329
  } else {
330
  if (this.instance) {
331
+ this._createWindow(this.instance.message, this.instance.title, this.instance.buttons);
332
  }
333
  }
334
 
338
  $wrap = this.$window.find('#message-box-wrap'),
339
  timer = $wrap.data('timer'),
340
  _update = function () {
341
+ LP.Hook.doAction('learn_press_message_box_before_resize', that);
342
  var $content = $wrap.find('.message-box-content').css("height", "").css('overflow', 'hidden'),
343
  width = $wrap.outerWidth(),
344
  height = $wrap.outerHeight(),
347
  top = $wrap.offset().top;
348
  if (contentHeight > windowHeight - 50) {
349
  $content.css({
350
+ height: windowHeight - 25
351
  });
352
+ height = $wrap.outerHeight();
353
  } else {
354
  $content.css("height", "").css('overflow', '');
355
  }
356
  $wrap.css({
357
  marginTop: ( $(window).height() - height ) / 2
358
  });
359
+ LP.Hook.doAction('learn_press_message_box_resize', height, that);
360
  };
361
  if (force) _update();
362
  timer && clearTimeout(timer);
371
  var len = this.instances.length;
372
  if (len) {
373
  this.instance = this.instances[len - 1];
374
+ this.$window.attr('instance', this.instance.id);
375
  } else {
376
  this.instance = false;
377
+ this.$window.removeAttr('instance');
378
  }
379
  break;
380
  }
398
  var $buttons = $('<div class="message-box-buttons"></div>');
399
  switch (buttons) {
400
  case 'yesNo':
401
+ $buttons.append(this._createButton(LP_Settings.localize.button_yes, 'yes'));
402
+ $buttons.append(this._createButton(LP_Settings.localize.button_no, 'no'));
403
  break;
404
  case 'okCancel':
405
+ $buttons.append(this._createButton(LP_Settings.localize.button_ok, 'ok'));
406
+ $buttons.append(this._createButton(LP_Settings.localize.button_cancel, 'cancel'));
407
  break;
408
  default:
409
+ $buttons.append(this._createButton(LP_Settings.localize.button_ok, 'ok'));
410
  }
411
  $wrap.append($buttons);
412
  }
418
  var instance = $(this).data('instance'),
419
  callback = instance.events[$(this).data('callback')];
420
  if ($.type(callback) == 'function') {
421
+ if (callback.apply(LP.MessageBox, [instance]) === false) {
422
  return;
423
  } else {
424
+ LP.MessageBox.hide(null, instance);
425
  }
426
  } else {
427
+ LP.MessageBox.hide(null, instance);
428
  }
429
  }).data('instance', this.instance);
430
  return $button;
431
  }
432
+ };
433
+ LP.Hook = {
434
  hooks : {action: {}, filter: {}},
435
  addAction : function (action, callable, priority, tag) {
436
  this.addHook('action', action, callable, priority, tag);
475
  var hooks = this.hooks[hookType][action], hook;
476
  //sort by priority
477
  hooks.sort(function (a, b) {
478
+ return a["priority"] - b["priority"];
479
  });
480
  for (var i = 0; i < hooks.length; i++) {
481
  hook = hooks[i].callable;
505
  return this;
506
  }
507
  };
508
+ LP = $.extend({
509
+ setUrl : function (url, ember, title) {
510
+ if (url) {
511
+ history.pushState({}, title, url);
512
+ LP.Hook.doAction('learn_press_set_location_url', url);
513
+ }
514
+ },
515
+ toggleGroupSection: function (el, target) {
516
+ var $el = $(el),
517
+ isHide = $el.hasClass('hide-if-js');
518
+ if(isHide){
519
+ $el.hide().removeClass('hide-if-js');
520
+ }
521
+ $el.removeClass('hide-if-js').slideToggle(function () {
522
+ var $this = $(this);
523
+ if ($this.is(':visible')) {
524
+ $(target).addClass('toggle-on').removeClass('toggle-off');
525
+ } else {
526
+ $(target).addClass('toggle-off').removeClass('toggle-on');
527
+ }
528
+ });
529
+ },
530
+ overflow : function (el, v) {
531
+ var $el = $(el),
532
+ overflow = $el.css('overflow');
533
+ if (v) {
534
+ $el.css('overflow', v).data('overflow', overflow);
535
+ } else {
536
+ $el.css('overflow', $el.data('overflow'));
537
+ }
538
  },
539
+ getUrl : function () {
540
  return window.location.href;
541
  },
542
+ addQueryVar : function (name, value, url) {
543
  return (url == undefined ? window.location.href : url).addQueryVar(name, value);
544
  },
545
+ removeQueryVar : function (name, url) {
546
  return (url == undefined ? window.location.href : url).removeQueryVar(name);
547
  },
548
+ reload : function (url) {
549
  if (!url) {
550
  url = window.location.href;
551
  }
552
  window.location.href = url;
553
  },
554
+
555
+ parseResponse: function (response, type) {
556
+ var m = response.match(/<!-- LP_AJAX_START -->(.*)<!-- LP_AJAX_END -->/);
557
+ if (m) {
558
+ response = m[1];
559
+ }
560
+ return (type || "json") == "json" ? this.parseJSON(response) : response;
561
+ },
562
+ parseJSON : function (data) {
563
  var m = data.match(/<!-- LP_AJAX_START -->(.*)<!-- LP_AJAX_END -->/);
564
  try {
565
  if (m) {
568
  data = $.parseJSON(data);
569
  }
570
  } catch (e) {
571
+ LP.log(e);
572
  data = {};
573
  }
574
  return data;
575
  },
576
+ ajax : function (args) {
577
+ var type = args.type || 'post',
578
+ dataType = args.dataType || 'json',
579
+ data = args.action ? $.extend(args.data, {'lp-ajax': args.action}) : args.data,
580
+ beforeSend = args.beforeSend || function () {
581
+ },
582
+ url = args.url || window.location.href;
583
+ // console.debug( beforeSend );
584
+ $.ajax({
585
+ data : data,
586
+ url : url,
587
+ type : type,
588
+ dataType : 'html',
589
+ beforeSend: beforeSend.apply(null, args),
590
+ success : function (raw) {
591
+ var response = LP.parseResponse(raw, dataType);
592
+ $.isFunction(args.success) && args.success(response, raw);
593
+ },
594
+ error : function () {
595
+ $.isFunction(args.error) && args.error.apply(null, LP.funcArgs2Array());
596
+ }
597
+ });
598
  },
599
+ doAjax : function (args) {
600
  var type = args.type || 'post',
601
  dataType = args.dataType || 'json',
602
  action = ( ( args.prefix == undefined ) || 'learnpress_') + args.action,
608
  type : type,
609
  dataType: 'html',
610
  success : function (raw) {
611
+ var response = LP.parseResponse(raw, dataType);
612
  $.isFunction(args.success) && args.success(response, raw);
613
  },
614
  error : function () {
615
+ $.isFunction(args.error) && args.error.apply(null, LP.funcArgs2Array());
616
  }
617
  });
618
  },
626
  },
627
  addFilter : function (action, callback) {
628
  var $doc = $(document),
629
+ event = 'LP.' + action;
630
  $doc.on(event, callback);
631
+ LP.log($doc.data('events'));
632
  return this;
633
  },
634
  applyFilters : function () {
636
  action = arguments[0],
637
  args = this.funcArgs2Array(arguments);
638
  if ($doc.hasEvent(action)) {
639
+ args[0] = 'LP.' + action;
640
  return $doc.triggerHandler.apply($doc, args);
641
  }
642
  return args[1];
649
  action = arguments[0],
650
  args = this.funcArgs2Array(arguments);
651
  if ($doc.hasEvent(action)) {
652
+ args[0] = 'LP.' + action;
653
  $doc.trigger.apply($doc, args);
654
  }
655
  },
713
  return retId;
714
  },
715
  log : function () {
716
+ //if (typeof LEARN_PRESS_DEBUG != 'undefined' && LEARN_PRESS_DEBUG && console) {
717
+ for (var i = 0, n = arguments.length; i < n; i++) {
718
+ console.log(arguments[i]);
 
719
  }
720
+ //}
721
+ },
722
+ blockContent : function () {
723
+ if ($('#learn-press-block-content').length == 0) {
724
+ $(LP.template('learn-press-template-block-content', {})).appendTo($('body'));
725
+ }
726
+ var $root = $('body').addClass('block-content'),
727
+ overflow = $root.css('overflow');
728
+ $root.css('overflow', 'hidden').attr('overflow', overflow);
729
+ },
730
+ unblockContent: function () {
731
+ setTimeout(function () {
732
+ var $root = $('body, html').removeClass('block-content'),
733
+ overflow = $root.attr('overflow');
734
+ $root.css('overflow', overflow).removeAttr('overflow');
735
+ }, 350);
736
  },
737
  template : _.memoize(function (id, data) {
738
  var compiled,
749
  };
750
  return data ? tmpl(data) : tmpl;
751
  }, function (a, b) {
752
+ return JSON.stringify(b);
753
  }),
754
  alert : function (localize, callback) {
755
  var title = '',
765
  }
766
  }
767
  $.alerts.alert(message, title, function (e) {
768
+ LP._on_alert_hide();
769
  callback && callback(e);
770
  });
771
  this._on_alert_show();
785
  }
786
  }
787
  $.alerts.confirm(message, title, function (e) {
788
+ LP._on_alert_hide();
789
  callback && callback(e);
790
  });
791
  this._on_alert_show();
810
  top : '+=50',
811
  opacity: 0
812
  }, 250, function () {
813
+ $(this).remove();
814
+ });
815
+ },
816
+ sendMessage : function (data, object, targetOrigin, transfer) {
817
+ if ($.isPlainObject(data)) {
818
+ data = JSON.stringify(data);
819
+ }
820
+ object = object || window;
821
+ targetOrigin = targetOrigin || '*';
822
+ object.postMessage(data, targetOrigin, transfer);
823
+ },
824
+ receiveMessage: function (evt, b) {
825
+ var target = event.origin || event.originalEvent.origin,
826
+ data = event.data || event.originalEvent.data;
827
+ var json = data.indexOf('{') == 0 ? LP.parseJSON(data) : false;
828
+ LP.Hook.doAction('learn_press_receive_message', json ? json : data, target);
829
  }
830
+ }, LP);
831
+
832
+ $.fn.rows = function () {
833
+ var h = $(this).height();
834
+ var lh = $(this).css('line-height').replace("px", "");
835
+ $(this).attr({height: h, 'line-height': lh});
836
+ return Math.floor(h / parseInt(lh));
837
+ };
838
+
839
+ $.fn.checkLines = function (p) {
840
+ return this.each(function () {
841
+ var $e = $(this),
842
+ rows = $e.rows();
843
+
844
+ p.call(this, rows);
845
+ });
846
+ };
847
 
848
  $.fn.findNext = function (selector) {
849
  var $selector = $(selector),
851
  index = $selector.index($root),
852
  $next = $selector.eq(index + 1);
853
  return $next.length ? $next : false;
854
+ };
855
 
856
  $.fn.findPrev = function (selector) {
857
  var $selector = $(selector),
859
  index = $selector.index($root),
860
  $prev = $selector.eq(index - 1);
861
  return $prev.length ? $prev : false;
862
+ };
863
+
864
+ $.each(['progress'], function (i, property) {
865
+ $.Tween.propHooks[property] = {
866
+ get: function (tween) {
867
+ return $(tween.elem).css('transform');
868
+ },
869
+ set: function (tween) {
870
+ /*var style = tween.elem.style;
871
+ var p_begin = parseColor($(tween.elem).css(property));
872
+ var p_end = parseColor(tween.end);
873
+ tween.run = function(progress) {
874
+ style[property] = calculateColor(p_begin, p_end, progress);
875
+ }*/
876
+ if (tween.now < 180) {
877
+ $(this).find('.progress-circle').removeClass('gt-50');
878
+ } else {
879
+ $(this).find('.progress-circle').addClass('gt-50');
880
+ }
881
+ $(tween.elem).find('.fill').css({
882
+ transform: 'rotate(' + tween.end + 'deg)'
883
+ });
884
+ }
885
+ };
886
+ });
887
+
888
+ $.fn.progress = function (v) {
889
+ return this.each(function () {
890
+ var t = parseInt(v / 100 * 360),
891
+ timer = null,
892
+ $this = $(this);
893
+
894
+ if (t < 180) {
895
+ $this.find('.progress-circle').removeClass('gt-50');
896
+ } else {
897
+ $this.find('.progress-circle').addClass('gt-50');
898
+ }
899
+ $this.find('.fill').css({
900
+ transform: 'rotate(' + t + 'deg)'
901
+ });
902
+
903
+ });
904
+ };
905
 
906
  function __initSubtabs() {
907
  $('.learn-press-subtabs').each(function () {
914
  $tab.parent().addClass('current').siblings().removeClass('current');
915
  current = $($contentID).addClass('current');
916
  current.siblings().removeClass('current');
917
+ //LP.setUrl($contentID);
918
  e.preventDefault();
919
  }).filter(function () {
920
  return $(this).attr('href') == window.location.hash;
921
  }).trigger('click');
922
  if (!current) {
923
+ $tabs.first().trigger('click');
924
  }
925
+ });
926
  }
927
 
928
  $(document).ready(function () {
930
  $.alerts.overlayColor = '#000';
931
  $.alerts.overlayOpacity = 0.5;
932
  }
 
933
 
934
+ $('body')
935
+ .on('click', '.learn-press-nav-tabs li a', function (e) {
936
+ e.preventDefault();
937
+ var $tab = $(this);
938
+ $tab.closest('li').addClass('active').siblings().removeClass('active');
939
+ $($tab.attr('data-tab')).addClass('active').siblings().removeClass('active');
940
+ });
941
+ $('.learn-press-nav-tabs li.active a').trigger('click');
942
+
943
+ ///
944
+ (function () {
945
+ var timer = null,
946
+ callback = function () {
947
+ $('.auto-check-lines').checkLines(function (r) {
948
+ if (r > 1) {
949
+ $(this).removeClass('single-lines');
950
+ } else {
951
+ $(this).addClass('single-lines');
952
+ }
953
+ $(this).attr('rows', r);
954
+ });
955
+ };
956
+ $(window).on('resize.check-lines', function () {
957
+ if (timer) {
958
+ timer && clearTimeout(timer);
959
+ timer = setTimeout(callback, 300);
960
+ } else {
961
+ callback();
962
+ }
963
+ });
964
+ })();
965
+
966
+ $(document).on('click', '[data-block-content="yes"]', function () {
967
+ LP.blockContent();
968
+ });
969
+
970
+ $('.learn-press-tooltip, .lp-passing-conditional').tooltip({offset: [24, 24]});
971
+
972
+ $('.learn-press-icon').tooltip({offset: [30, 30]});
973
+
974
+ $('.learn-press-message[data-autoclose]').each(function(){
975
+ var $el = $(this), delay = parseInt($el.data('autoclose'));
976
+ if(delay){
977
+ setTimeout(function($el){
978
+ $el.fadeOut();
979
+ }, delay, $el);
980
+ }
981
+ })
982
+
983
+ //$(window).on("message onmessage", LP.receiveMessage, false);
984
+ window.addEventListener("message", LP.receiveMessage, false);
985
+ });
986
+ LearnPress = LP;
987
  })(jQuery);
assets/js/global.min.js CHANGED
@@ -1,38 +1,600 @@
1
- if(typeof window.LearnPress=='undefined'){window.LearnPress={}};(function($){$.fn.hasEvent=function(name){var events=$(this).data('events');if(typeof events.LearnPress=='undefined'){return !1}
2
- for(i=0;i<events.LearnPress.length;i++){if(events.LearnPress[i].namespace==name){return !0}}
3
- return !1}
4
- $.fn.dataToJSON=function(){var json={};$.each(this[0].attributes,function(){var m=this.name.match(/^data-(.*)/);if(m){json[m[1]]=this.value}});return json}
5
- String.prototype.getQueryVar=function(name){name=name.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var regex=new RegExp("[\\?&]"+name+"=([^&#]*)"),results=regex.exec(this);return results===null?"":decodeURIComponent(results[1].replace(/\+/g," "))}
6
- String.prototype.addQueryVar=function(name,value){var url=this;if(name.match(/\[/)){url+=url.match(/\?/)?'&':'?';url+=name+'='+value}else{if((url.indexOf('&'+name+'=')!=-1)||(url.indexOf('?'+name+'=')!=-1)){url=url.replace(new RegExp(name+"=([^&#]*)",'g'),name+'='+value)}else{url+=url.match(/\?/)?'&':'?';url+=name+'='+value}}
7
- return url}
8
- String.prototype.removeQueryVar=function(name){var url=this;name=name.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var regex=new RegExp("[\\?&]"+name+"([\[][^=]*)?=([^&#]*)",'g');url=url.replace(regex,'');return url}
9
- LearnPress.MessageBox={$block:null,$window:null,events:{},instances:[],instance:null,show:function(message,args){$.proxy(function(){args=$.extend({title:'',buttons:'',events:!1,autohide:!1,message:message,data:!1,id:LearnPress.uniqueId(),onHide:null},args||{});this.instances.push(args)
10
- this.instance=args;var $doc=$(document),$body=$(document.body);if(!this.$block){this.$block=$('<div id="learn-press-message-box-block"></div>').appendTo($body)}
11
- if(!this.$window){this.$window=$('<div id="learn-press-message-box-window"><div id="message-box-wrap"></div> </div>').insertAfter(this.$block);this.$window.click(function(){})}
12
- this._createWindow(message,args.title,args.buttons);this.$block.show();this.$window.show().attr('instance',args.id);$(window).bind('resize.message-box',$.proxy(this.update,this)).bind('scroll.message-box',$.proxy(this.update,this));this.update(!0);if(args.autohide){setTimeout(function(){LearnPress.MessageBox.hide();$.isFunction(args.onHide)&&args.onHide.call(LearnPress.MessageBox,args)},args.autohide)}},this)()},blockUI:function(message){message=(message!==!1?(message?message:'Wait a moment'):'')+'<div class="message-box-animation"></div>';this.show(message)},hide:function(delay,instance){if(instance){this._removeInstance(instance.id)}else{this._removeInstance(this.instance.id)}
13
- if(this.instances.length==0){if(this.$block){this.$block.hide()}
14
- if(this.$window){this.$window.hide()}
15
- $(window).unbind('resize.message-box',this.update).unbind('scroll.message-box',this.update)}else{this._createWindow(this.instance.message,this.instance.title,this.instance.buttons)}},update:function(force){var that=this,$wrap=this.$window.find('#message-box-wrap'),timer=$wrap.data('timer'),_update=function(){LearnPress.Hook.doAction('learn_press_message_box_before_resize',that);var $content=$wrap.find('.message-box-content').css("height","").css('overflow','hidden'),width=$wrap.outerWidth(),height=$wrap.outerHeight(),contentHeight=$content.height(),windowHeight=$(window).height(),top=$wrap.offset().top;if(contentHeight>windowHeight-50){$content.css({height:windowHeight-50});height=$wrap.outerHeight()}else{$content.css("height","").css('overflow','')}
16
- $wrap.css({marginTop:($(window).height()-height)/2});LearnPress.Hook.doAction('learn_press_message_box_resize',height,that)};if(force)_update();timer&&clearTimeout(timer);timer=setTimeout(_update,250)},_removeInstance:function(id){for(var i=0;i<this.instances.length;i++){if(this.instances[i].id==id){this.instances.splice(i,1);var len=this.instances.length;if(len){this.instance=this.instances[len-1];this.$window.attr('instance',this.instance.id)}else{this.instance=!1;this.$window.removeAttr('instance')}
17
- break}}},_getInstance:function(id){for(var i=0;i<this.instances.length;i++){if(this.instances[i].id==id){return this.instances[i];break}}},_createWindow:function(message,title,buttons){var $wrap=this.$window.find('#message-box-wrap').html('');if(title){$wrap.append('<h3 class="message-box-title">'+title+'</h3>')}
18
- $wrap.append($('<div class="message-box-content"></div>').html(message));if(buttons){var $buttons=$('<div class="message-box-buttons"></div>');switch(buttons){case 'yesNo':$buttons.append(this._createButton('Yes','yes'));$buttons.append(this._createButton('No','no'));break;case 'okCancel':$buttons.append(this._createButton('Ok','ok'));$buttons.append(this._createButton('Cancel','cancel'));break;default:$buttons.append(this._createButton('Ok','ok'))}
19
- $wrap.append($buttons)}},_createButton:function(title,type){var $button=$('<button type="button" class="button message-box-button message-box-button-'+type+'">'+title+'</button>'),callback='on'+(type.substr(0,1).toUpperCase()+type.substr(1));$button.data('callback',callback).click(function(){var instance=$(this).data('instance'),callback=instance.events[$(this).data('callback')];if($.type(callback)=='function'){if(callback.apply(LearnPress.MessageBox,[instance])===!1){return}else{LearnPress.MessageBox.hide(null,instance)}}else{LearnPress.MessageBox.hide(null,instance)}}).data('instance',this.instance);return $button}}
20
- LearnPress.Hook={hooks:{action:{},filter:{}},addAction:function(action,callable,priority,tag){this.addHook('action',action,callable,priority,tag);return this},addFilter:function(action,callable,priority,tag){this.addHook('filter',action,callable,priority,tag);return this},doAction:function(action){this.doHook('action',action,arguments);return this},applyFilters:function(action){return this.doHook('filter',action,arguments)},removeAction:function(action,tag){this.removeHook('action',action,tag);return this},removeFilter:function(action,priority,tag){this.removeHook('filter',action,priority,tag);return this},addHook:function(hookType,action,callable,priority,tag){if(undefined==this.hooks[hookType][action]){this.hooks[hookType][action]=[]}
21
- var hooks=this.hooks[hookType][action];if(undefined==tag){tag=action+'_'+hooks.length}
22
- this.hooks[hookType][action].push({tag:tag,callable:callable,priority:priority});return this},doHook:function(hookType,action,args){args=Array.prototype.slice.call(args,1);if(undefined!=this.hooks[hookType][action]){var hooks=this.hooks[hookType][action],hook;hooks.sort(function(a,b){return a.priority-b.priority});for(var i=0;i<hooks.length;i++){hook=hooks[i].callable;if(typeof hook!='function')
23
- hook=window[hook];if('action'==hookType){hook.apply(null,args)}else{args[0]=hook.apply(null,args)}}}
24
- if('filter'==hookType){return args[0]}
25
- return this},removeHook:function(hookType,action,priority,tag){if(undefined!=this.hooks[hookType][action]){var hooks=this.hooks[hookType][action];for(var i=hooks.length-1;i>=0;i--){if((undefined==tag||tag==hooks[i].tag)&&(undefined==priority||priority==hooks[i].priority)){hooks.splice(i,1)}}}
26
- return this}};LearnPress=$.extend({setUrl:function(url,title){history.pushState({},title,url)},getUrl:function(){return window.location.href},addQueryVar:function(name,value,url){return(url==undefined?window.location.href:url).addQueryVar(name,value)},removeQueryVar:function(name,url){return(url==undefined?window.location.href:url).removeQueryVar(name)},reload:function(url){if(!url){url=window.location.href}
27
- window.location.href=url},parseJSON:function(data){var m=data.match(/<!-- LP_AJAX_START -->(.*)<!-- LP_AJAX_END -->/);try{if(m){data=$.parseJSON(m[1])}else{data=$.parseJSON(data)}}catch(e){LearnPress.log(e);data={}}
28
- return data},funcArgs2Array:function(args){var arr=[];for(var i=0;i<args.length;i++){arr.push(args[i])}
29
- return arr},addFilter:function(action,callback){var $doc=$(document),event='LearnPress.'+action;$doc.on(event,callback);LearnPress.log($doc.data('events'));return this},applyFilters:function(){var $doc=$(document),action=arguments[0],args=this.funcArgs2Array(arguments);if($doc.hasEvent(action)){args[0]='LearnPress.'+action;return $doc.triggerHandler.apply($doc,args)}
30
- return args[1]},addAction:function(action,callback){return this.addFilter(action,callback)},doAction:function(){var $doc=$(document),action=arguments[0],args=this.funcArgs2Array(arguments);if($doc.hasEvent(action)){args[0]='LearnPress.'+action;$doc.trigger.apply($doc,args)}},toElement:function(element,args){if($(element).length==0){return}
31
- args=$.extend({delay:300,duration:'slow',offset:50},args||{});$('body, html').fadeIn(10).delay(args.delay).animate({scrollTop:$(element).offset().top-args.offset},args.duration)},uniqueId:function(prefix,more_entropy){if(typeof prefix==='undefined'){prefix=''}
32
- var retId;var formatSeed=function(seed,reqWidth){seed=parseInt(seed,10).toString(16);if(reqWidth<seed.length){return seed.slice(seed.length-reqWidth)}
33
- if(reqWidth>seed.length){return Array(1+(reqWidth-seed.length)).join('0')+seed}
34
- return seed};if(!this.php_js){this.php_js={}}
35
- if(!this.php_js.uniqidSeed){this.php_js.uniqidSeed=Math.floor(Math.random()*0x75bcd15)}
36
- this.php_js.uniqidSeed++;retId=prefix;retId+=formatSeed(parseInt(new Date().getTime()/1000,10),8);retId+=formatSeed(this.php_js.uniqidSeed,5);if(more_entropy){retId+=(Math.random()*10).toFixed(8).toString()}
37
- return retId},log:function(){if(typeof LEARN_PRESS_DEBUG!='undefined'&&LEARN_PRESS_DEBUG&&console){for(var i=0,n=arguments.length;i<n;i++){console.log(arguments[i])}}},template:_.memoize(function(id,data){var compiled,options={evaluate:/<#([\s\S]+?)#>/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g,variable:'data'};var tmpl=function(data){compiled=compiled||_.template($('#'+id).html(),null,options);return compiled(data)};return data?tmpl(data):tmpl},function(a,b){return JSON.stringify(b)})},LearnPress);$.fn.findNext=function(selector){var $selector=$(selector),$root=this.first(),index=$selector.index($root),$next=$selector.eq(index+1);return $next.length?$next:!1}
38
- $.fn.findPrev=function(selector){var $selector=$(selector),$root=this.first(),index=$selector.index($root),$prev=$selector.eq(index-1);return $prev.length?$prev:!1}})(jQuery)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ if (typeof window.LP == "undefined") {
2
+ window.LP = {}
3
+ }
4
+ (function ($) {
5
+ $.fn.serializeJSON = function () {
6
+ var unIndexed = $(this).serializeArray(), indexed = {}, validate = /(\[([a-zA-Z0-9_-]+)?\]?)/g, arrayKeys = {}, end = false;
7
+ $.each(unIndexed, function () {
8
+ var that = this, match = this.name.match(/^([0-9a-zA-Z_-]+)/);
9
+ if (!match) {
10
+ return
11
+ }
12
+ var keys = this.name.match(validate), objPath = "indexed['" + match[0] + "']";
13
+ if (keys) {
14
+ if (typeof indexed[match[0]] != "object") {
15
+ indexed[match[0]] = {}
16
+ }
17
+ $.each(keys, function (i, prop) {
18
+ prop = prop.replace(/\]|\[/g, "");
19
+ var rawPath = objPath.replace(/'|\[|\]/g, ""), objExp = "", preObjPath = objPath;
20
+ if (prop == "") {
21
+ if (arrayKeys[rawPath] == undefined) {
22
+ arrayKeys[rawPath] = 0
23
+ } else {
24
+ arrayKeys[rawPath]++
25
+ }
26
+ objPath += "['" + arrayKeys[rawPath] + "']"
27
+ } else {
28
+ if (!isNaN(prop)) {
29
+ arrayKeys[rawPath] = prop
30
+ }
31
+ objPath += "['" + prop + "']"
32
+ }
33
+ try {
34
+ if (i == keys.length - 1) {
35
+ objExp = objPath + "=that.value;";
36
+ end = true
37
+ } else {
38
+ objExp = objPath + "={}";
39
+ end = false
40
+ }
41
+ var evalString = "if( typeof " + objPath + " == 'undefined'){" + objExp + ";}else{if(end){if(typeof " + preObjPath + "!='object'){" + preObjPath + "={};}" + objExp + "}}";
42
+ eval(evalString)
43
+ } catch (e) {
44
+ console.log("Error:" + e + "\n" + objExp)
45
+ }
46
+ })
47
+ } else {
48
+ indexed[match[0]] = this.value
49
+ }
50
+ indexed["how-old-are-you"] = 11
51
+ });
52
+ return indexed
53
+ };
54
+ $.fn.hasEvent = function (name) {
55
+ var events = $(this).data("events");
56
+ if (typeof events.LP == "undefined") {
57
+ return false
58
+ }
59
+ for (i = 0; i < events.LP.length; i++) {
60
+ if (events.LP[i].namespace == name) {
61
+ return true
62
+ }
63
+ }
64
+ return false
65
+ };
66
+ $.fn.dataToJSON = function () {
67
+ var json = {};
68
+ $.each(this[0].attributes, function () {
69
+ var m = this.name.match(/^data-(.*)/);
70
+ if (m) {
71
+ json[m[1]] = this.value
72
+ }
73
+ });
74
+ return json
75
+ };
76
+ String.prototype.getQueryVar = function (name) {
77
+ name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
78
+ var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), results = regex.exec(this);
79
+ return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "))
80
+ };
81
+ String.prototype.addQueryVar = function (name, value) {
82
+ var url = this;
83
+ if (name.match(/\[/)) {
84
+ url += url.match(/\?/) ? "&" : "?";
85
+ url += name + "=" + value
86
+ } else {
87
+ if ((url.indexOf("&" + name + "=") != -1) || (url.indexOf("?" + name + "=") != -1)) {
88
+ url = url.replace(new RegExp(name + "=([^&#]*)", "g"), name + "=" + value)
89
+ } else {
90
+ url += url.match(/\?/) ? "&" : "?";
91
+ url += name + "=" + value
92
+ }
93
+ }
94
+ return url
95
+ };
96
+ String.prototype.removeQueryVar = function (name) {
97
+ var url = this;
98
+ name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
99
+ var regex = new RegExp("[\\?&]" + name + "([[][^=]*)?=([^&#]*)", "g");
100
+ url = url.replace(regex, "");
101
+ return url
102
+ };
103
+ LP.MessageBox = {
104
+ $block : null,
105
+ $window : null,
106
+ events : {},
107
+ instances : [],
108
+ instance : null,
109
+ quickConfirm : function (elem, args) {
110
+ var $e = $(elem);
111
+ $("[learn-press-quick-confirm]").each(function () {
112
+ ($ins = $(this).data("quick-confirm")) && (console.log($ins), $ins.destroy())
113
+ });
114
+ !$e.attr("learn-press-quick-confirm") && $e.attr("learn-press-quick-confirm", "true").data("quick-confirm", new (function (elem, args) {
115
+ var $elem = $(elem), $div = $('<span class="learn-press-quick-confirm"></span>').insertAfter($elem), offset = $(elem).position() || {
116
+ left: 0,
117
+ top : 0
118
+ }, timerOut = null, timerHide = null, n = 3, hide = function () {
119
+ $div.fadeOut("fast", function () {
120
+ $(this).remove();
121
+ $div.parent().css("position", "")
122
+ });
123
+ $elem.removeAttr("learn-press-quick-confirm").data("quick-confirm", undefined);
124
+ stop()
125
+ }, stop = function () {
126
+ timerHide && clearInterval(timerHide);
127
+ timerOut && clearInterval(timerOut)
128
+ }, start = function () {
129
+ timerOut = setInterval(function () {
130
+ if (--n == 0) {
131
+ hide.call($div[0]);
132
+ $.isFunction(args.onCancel) && args.onCancel(args.data);
133
+ stop()
134
+ }
135
+ $div.find("span").html(" (" + n + ")")
136
+ }, 1000);
137
+ timerHide = setInterval(function () {
138
+ if (!$elem.is(":visible") || $elem.css("visibility") == "hidden") {
139
+ stop();
140
+ $div.remove();
141
+ $div.parent().css("position", "");
142
+ $.isFunction(args.onCancel) && args.onCancel(args.data)
143
+ }
144
+ }, 350)
145
+ };
146
+ args = $.extend({
147
+ message : "",
148
+ data : null,
149
+ onOk : null,
150
+ onCancel: null,
151
+ offset : {top: 0, left: 0}
152
+ }, args || {});
153
+ $div.html(args.message || $elem.attr("data-confirm-remove") || "Are you sure?").append("<span> (" + n + ")</span>").css({});
154
+ $div.click(function () {
155
+ $.isFunction(args.onOk) && args.onOk(args.data);
156
+ hide()
157
+ }).hover(function () {
158
+ stop()
159
+ }, function () {
160
+ start()
161
+ });
162
+ $div.css({
163
+ left: ((offset.left + $elem.outerWidth()) - $div.outerWidth()) + args.offset.left,
164
+ top : offset.top + $elem.outerHeight() + args.offset.top + 5
165
+ }).hide().fadeIn("fast");
166
+ start();
167
+ this.destroy = function () {
168
+ $div.remove();
169
+ $elem.removeAttr("learn-press-quick-confirm").data("quick-confirm", undefined);
170
+ stop();
171
+ console.log("die")
172
+ }
173
+ })(elem, args))
174
+ },
175
+ show : function (message, args) {
176
+ $.proxy(function () {
177
+ args = $.extend({
178
+ title : "",
179
+ buttons : "",
180
+ events : false,
181
+ autohide: false,
182
+ message : message,
183
+ data : false,
184
+ id : LP.uniqueId(),
185
+ onHide : null
186
+ }, args || {});
187
+ this.instances.push(args);
188
+ this.instance = args;
189
+ var $doc = $(document), $body = $(document.body);
190
+ if (!this.$block) {
191
+ this.$block = $('<div id="learn-press-message-box-block"></div>').appendTo($body)
192
+ }
193
+ if (!this.$window) {
194
+ this.$window = $('<div id="learn-press-message-box-window"><div id="message-box-wrap"></div> </div>').insertAfter(this.$block);
195
+ this.$window.click(function () {
196
+ })
197
+ }
198
+ this._createWindow(message, args.title, args.buttons);
199
+ this.$block.show();
200
+ this.$window.show().attr("instance", args.id);
201
+ $(window).bind("resize.message-box", $.proxy(this.update, this)).bind("scroll.message-box", $.proxy(this.update, this));
202
+ this.update(true);
203
+ if (args.autohide) {
204
+ setTimeout(function () {
205
+ LP.MessageBox.hide();
206
+ $.isFunction(args.onHide) && args.onHide.call(LP.MessageBox, args)
207
+ }, args.autohide)
208
+ }
209
+ }, this)()
210
+ },
211
+ blockUI : function (message) {
212
+ message = (message !== false ? (message ? message : "Wait a moment") : "") + '<div class="message-box-animation"></div>';
213
+ this.show(message)
214
+ },
215
+ hide : function (delay, instance) {
216
+ if (instance) {
217
+ this._removeInstance(instance.id)
218
+ } else {
219
+ if (this.instance) {
220
+ this._removeInstance(this.instance.id)
221
+ }
222
+ }
223
+ if (this.instances.length == 0) {
224
+ if (this.$block) {
225
+ this.$block.hide()
226
+ }
227
+ if (this.$window) {
228
+ this.$window.hide()
229
+ }
230
+ $(window).unbind("resize.message-box", this.update).unbind("scroll.message-box", this.update)
231
+ } else {
232
+ if (this.instance) {
233
+ this._createWindow(this.instance.message, this.instance.title, this.instance.buttons)
234
+ }
235
+ }
236
+ },
237
+ update : function (force) {
238
+ var that = this, $wrap = this.$window.find("#message-box-wrap"), timer = $wrap.data("timer"), _update = function () {
239
+ LP.Hook.doAction("learn_press_message_box_before_resize", that);
240
+ var $content = $wrap.find(".message-box-content").css("height", "").css("overflow", "hidden"), width = $wrap.outerWidth(), height = $wrap.outerHeight(), contentHeight = $content.height(), windowHeight = $(window).height(), top = $wrap.offset().top;
241
+ if (contentHeight > windowHeight - 50) {
242
+ $content.css({height: windowHeight - 50});
243
+ height = $wrap.outerHeight()
244
+ } else {
245
+ $content.css("height", "").css("overflow", "")
246
+ }
247
+ $wrap.css({marginTop: ($(window).height() - height) / 2});
248
+ LP.Hook.doAction("learn_press_message_box_resize", height, that)
249
+ };
250
+ if (force) {
251
+ _update()
252
+ }
253
+ timer && clearTimeout(timer);
254
+ timer = setTimeout(_update, 250)
255
+ },
256
+ _removeInstance: function (id) {
257
+ for (var i = 0; i < this.instances.length; i++) {
258
+ if (this.instances[i].id == id) {
259
+ this.instances.splice(i, 1);
260
+ var len = this.instances.length;
261
+ if (len) {
262
+ this.instance = this.instances[len - 1];
263
+ this.$window.attr("instance", this.instance.id)
264
+ } else {
265
+ this.instance = false;
266
+ this.$window.removeAttr("instance")
267
+ }
268
+ break
269
+ }
270
+ }
271
+ },
272
+ _getInstance : function (id) {
273
+ for (var i = 0; i < this.instances.length; i++) {
274
+ if (this.instances[i].id == id) {
275
+ return this.instances[i];
276
+ break
277
+ }
278
+ }
279
+ },
280
+ _createWindow : function (message, title, buttons) {
281
+ var $wrap = this.$window.find("#message-box-wrap").html("");
282
+ if (title) {
283
+ $wrap.append('<h3 class="message-box-title">' + title + "</h3>")
284
+ }
285
+ $wrap.append($('<div class="message-box-content"></div>').html(message));
286
+ if (buttons) {
287
+ var $buttons = $('<div class="message-box-buttons"></div>');
288
+ switch (buttons) {
289
+ case"yesNo":
290
+ $buttons.append(this._createButton(LP_Settings.localize.button_yes, "yes"));
291
+ $buttons.append(this._createButton(LP_Settings.localize.button_no, "no"));
292
+ break;
293
+ case"okCancel":
294
+ $buttons.append(this._createButton(LP_Settings.localize.button_ok, "ok"));
295
+ $buttons.append(this._createButton(LP_Settings.localize.button_cancel, "cancel"));
296
+ break;
297
+ default:
298
+ $buttons.append(this._createButton(LP_Settings.localize.button_ok, "ok"))
299
+ }
300
+ $wrap.append($buttons)
301
+ }
302
+ },
303
+ _createButton : function (title, type) {
304
+ var $button = $('<button type="button" class="button message-box-button message-box-button-' + type + '">' + title + "</button>"), callback = "on" + (type.substr(0, 1).toUpperCase() + type.substr(1));
305
+ $button.data("callback", callback).click(function () {
306
+ var instance = $(this).data("instance"), callback = instance.events[$(this).data("callback")];
307
+ if ($.type(callback) == "function") {
308
+ if (callback.apply(LP.MessageBox, [instance]) === false) {
309
+ return
310
+ } else {
311
+ LP.MessageBox.hide(null, instance)
312
+ }
313
+ } else {
314
+ LP.MessageBox.hide(null, instance)
315
+ }
316
+ }).data("instance", this.instance);
317
+ return $button
318
+ }
319
+ };
320
+ LP.Hook = {
321
+ hooks : {action: {}, filter: {}}, addAction: function (action, callable, priority, tag) {
322
+ this.addHook("action", action, callable, priority, tag);
323
+ return this
324
+ }, addFilter : function (action, callable, priority, tag) {
325
+ this.addHook("filter", action, callable, priority, tag);
326
+ return this
327
+ }, doAction : function (action) {
328
+ this.doHook("action", action, arguments);
329
+ return this
330
+ }, applyFilters: function (action) {
331
+ return this.doHook("filter", action, arguments)
332
+ }, removeAction: function (action, tag) {
333
+ this.removeHook("action", action, tag);
334
+ return this
335
+ }, removeFilter: function (action, priority, tag) {
336
+ this.removeHook("filter", action, priority, tag);
337
+ return this
338
+ }, addHook : function (hookType, action, callable, priority, tag) {
339
+ if (undefined == this.hooks[hookType][action]) {
340
+ this.hooks[hookType][action] = []
341
+ }
342
+ var hooks = this.hooks[hookType][action];
343
+ if (undefined == tag) {
344
+ tag = action + "_" + hooks.length
345
+ }
346
+ this.hooks[hookType][action].push({tag: tag, callable: callable, priority: priority});
347
+ return this
348
+ }, doHook : function (hookType, action, args) {
349
+ args = Array.prototype.slice.call(args, 1);
350
+ if (undefined != this.hooks[hookType][action]) {
351
+ var hooks = this.hooks[hookType][action], hook;
352
+ hooks.sort(function (a, b) {
353
+ return a.priority - b.priority
354
+ });
355
+ for (var i = 0; i < hooks.length; i++) {
356
+ hook = hooks[i].callable;
357
+ if (typeof hook != "function") {
358
+ hook = window[hook]
359
+ }
360
+ if ("action" == hookType) {
361
+ hook.apply(null, args)
362
+ } else {
363
+ args[0] = hook.apply(null, args)
364
+ }
365
+ }
366
+ }
367
+ if ("filter" == hookType) {
368
+ return args[0]
369
+ }
370
+ return this
371
+ }, removeHook : function (hookType, action, priority, tag) {
372
+ if (undefined != this.hooks[hookType][action]) {
373
+ var hooks = this.hooks[hookType][action];
374
+ for (var i = hooks.length - 1; i >= 0; i--) {
375
+ if ((undefined == tag || tag == hooks[i].tag) && (undefined == priority || priority == hooks[i].priority)) {
376
+ hooks.splice(i, 1)
377
+ }
378
+ }
379
+ }
380
+ return this
381
+ }
382
+ };
383
+ LP = $.extend({
384
+ setUrl : function (url, title) {
385
+ history.pushState({}, title, url)
386
+ }, getUrl : function () {
387
+ return window.location.href
388
+ }, addQueryVar : function (name, value, url) {
389
+ return (url == undefined ? window.location.href : url).addQueryVar(name, value)
390
+ }, removeQueryVar: function (name, url) {
391
+ return (url == undefined ? window.location.href : url).removeQueryVar(name)
392
+ }, reload : function (url) {
393
+ if (!url) {
394
+ url = window.location.href
395
+ }
396
+ window.location.href = url
397
+ }, parseJSON : function (data) {
398
+ var m = data.match(/<!-- LP_AJAX_START -->(.*)<!-- LP_AJAX_END -->/);
399
+ try {
400
+ if (m) {
401
+ data = $.parseJSON(m[1])
402
+ } else {
403
+ data = $.parseJSON(data)
404
+ }
405
+ } catch (e) {
406
+ LP.log(e);
407
+ data = {}
408
+ }
409
+ return data
410
+ }, parseResponse : function (response, type) {
411
+ var m = response.match(/<!-- LP_AJAX_START -->(.*)<!-- LP_AJAX_END -->/);
412
+ if (m) {
413
+ response = m[1]
414
+ }
415
+ return (type || "json") == "json" ? this.parseJSON(response) : response
416
+ }, ajax : function (args) {
417
+ var type = args.type || "post", dataType = args.dataType || "json", data = args.action ? $.extend(args.data, {"lp-ajax": args.action}) : args.data, url = args.url || window.location.href;
418
+ $.ajax({
419
+ data : data, url: url, type: type, dataType: "html", success: function (raw) {
420
+ var response = LP.parseResponse(raw, dataType);
421
+ $.isFunction(args.success) && args.success(response, raw)
422
+ }, error: function () {
423
+ $.isFunction(args.error) && args.error.apply(null, LP.funcArgs2Array())
424
+ }
425
+ })
426
+ }, doAjax : function (args) {
427
+ var type = args.type || "post", dataType = args.dataType || "json", action = ((args.prefix == undefined) || "learnpress_") + args.action, data = args.action ? $.extend(args.data, {action: action}) : args.data;
428
+ $.ajax({
429
+ data : data,
430
+ url : (args.url || window.location.href),
431
+ type : type,
432
+ dataType: "html",
433
+ success : function (raw) {
434
+ var response = LP.parseResponse(raw, dataType);
435
+ $.isFunction(args.success) && args.success(response, raw)
436
+ },
437
+ error : function () {
438
+ $.isFunction(args.error) && args.error.apply(null, LP.funcArgs2Array())
439
+ }
440
+ })
441
+ }, funcArgs2Array: function (args) {
442
+ var arr = [];
443
+ for (var i = 0; i < args.length; i++) {
444
+ arr.push(args[i])
445
+ }
446
+ return arr
447
+ }, addFilter : function (action, callback) {
448
+ var $doc = $(document), event = "LP." + action;
449
+ $doc.on(event, callback);
450
+ LP.log($doc.data("events"));
451
+ return this
452
+ }, applyFilters : function () {
453
+ var $doc = $(document), action = arguments[0], args = this.funcArgs2Array(arguments);
454
+ if ($doc.hasEvent(action)) {
455
+ args[0] = "LP." + action;
456
+ return $doc.triggerHandler.apply($doc, args)
457
+ }
458
+ return args[1]
459
+ }, addAction : function (action, callback) {
460
+ return this.addFilter(action, callback)
461
+ }, doAction : function () {
462
+ var $doc = $(document), action = arguments[0], args = this.funcArgs2Array(arguments);
463
+ if ($doc.hasEvent(action)) {
464
+ args[0] = "LP." + action;
465
+ $doc.trigger.apply($doc, args)
466
+ }
467
+ }, toElement : function (element, args) {
468
+ if ($(element).length == 0) {
469
+ return
470
+ }
471
+ args = $.extend({delay: 300, duration: "slow", offset: 50, callback: null}, args || {});
472
+ $("body, html").fadeIn(10).delay(args.delay).animate({scrollTop: $(element).offset().top - args.offset}, args.duration, args.callback)
473
+ }, uniqueId : function (prefix, more_entropy) {
474
+ if (typeof prefix === "undefined") {
475
+ prefix = ""
476
+ }
477
+ var retId;
478
+ var formatSeed = function (seed, reqWidth) {
479
+ seed = parseInt(seed, 10).toString(16);
480
+ if (reqWidth < seed.length) {
481
+ return seed.slice(seed.length - reqWidth)
482
+ }
483
+ if (reqWidth > seed.length) {
484
+ return Array(1 + (reqWidth - seed.length)).join("0") + seed
485
+ }
486
+ return seed
487
+ };
488
+ if (!this.php_js) {
489
+ this.php_js = {}
490
+ }
491
+ if (!this.php_js.uniqidSeed) {
492
+ this.php_js.uniqidSeed = Math.floor(Math.random() * 123456789)
493
+ }
494
+ this.php_js.uniqidSeed++;
495
+ retId = prefix;
496
+ retId += formatSeed(parseInt(new Date().getTime() / 1000, 10), 8);
497
+ retId += formatSeed(this.php_js.uniqidSeed, 5);
498
+ if (more_entropy) {
499
+ retId += (Math.random() * 10).toFixed(8).toString()
500
+ }
501
+ return retId
502
+ }, log : function () {
503
+ for (var i = 0, n = arguments.length; i < n; i++) {
504
+ console.log(arguments[i])
505
+ }
506
+ }, template : _.memoize(function (id, data) {
507
+ var compiled, options = {
508
+ evaluate : /<#([\s\S]+?)#>/g,
509
+ interpolate: /\{\{\{([\s\S]+?)\}\}\}/g,
510
+ escape : /\{\{([^\}]+?)\}\}(?!\})/g,
511
+ variable : "data"
512
+ };
513
+ var tmpl = function (data) {
514
+ compiled = compiled || _.template($("#" + id).html(), null, options);
515
+ return compiled(data)
516
+ };
517
+ return data ? tmpl(data) : tmpl
518
+ }, function (a, b) {
519
+ return JSON.stringify(b)
520
+ }), alert : function (localize, callback) {
521
+ var title = "", message = "";
522
+ if (typeof localize == "string") {
523
+ message = localize
524
+ } else {
525
+ if (typeof localize.title != "undefined") {
526
+ title = localize.title
527
+ }
528
+ if (typeof localize.message != "undefined") {
529
+ message = localize.message
530
+ }
531
+ }
532
+ $.alerts.alert(message, title, function (e) {
533
+ LP._on_alert_hide();
534
+ callback && callback(e)
535
+ });
536
+ this._on_alert_show()
537
+ }, confirm : function (localize, callback) {
538
+ var title = "", message = "";
539
+ if (typeof localize == "string") {
540
+ message = localize
541
+ } else {
542
+ if (typeof localize.title != "undefined") {
543
+ title = localize.title
544
+ }
545
+ if (typeof localize.message != "undefined") {
546
+ message = localize.message
547
+ }
548
+ }
549
+ $.alerts.confirm(message, title, function (e) {
550
+ LP._on_alert_hide();
551
+ callback && callback(e)
552
+ });
553
+ this._on_alert_show()
554
+ }, _on_alert_show: function () {
555
+ var $container = $("#popup_container"), $placeholder = $('<span id="popup_container_placeholder" />').insertAfter($container).data("xxx", $container);
556
+ $container.stop().css("top", "-=50").css("opacity", "0").animate({top: "+=50", opacity: 1}, 250)
557
+ }, _on_alert_hide: function () {
558
+ var $holder = $("#popup_container_placeholder"), $container = $holder.data("xxx");
559
+ if ($container) {
560
+ $container.replaceWith($holder)
561
+ }
562
+ $container.appendTo($(document.body));
563
+ $container.stop().animate({top: "+=50", opacity: 0}, 250, function () {
564
+ $(this).remove()
565
+ })
566
+ }
567
+ }, LP);
568
+ $.fn.findNext = function (selector) {
569
+ var $selector = $(selector), $root = this.first(), index = $selector.index($root), $next = $selector.eq(index + 1);
570
+ return $next.length ? $next : false
571
+ };
572
+ $.fn.findPrev = function (selector) {
573
+ var $selector = $(selector), $root = this.first(), index = $selector.index($root), $prev = $selector.eq(index - 1);
574
+ return $prev.length ? $prev : false
575
+ };
576
+ function __initSubtabs() {
577
+ $(".learn-press-subtabs").each(function () {
578
+ var $tabContainer = $(this), $tabs = $tabContainer.find("a"), current = null;
579
+ $tabs.click(function (e) {
580
+ var $tab = $(this), $contentID = $tab.attr("href");
581
+ $tab.parent().addClass("current").siblings().removeClass("current");
582
+ current = $($contentID).addClass("current");
583
+ current.siblings().removeClass("current");
584
+ e.preventDefault()
585
+ }).filter(function () {
586
+ return $(this).attr("href") == window.location.hash
587
+ }).trigger("click");
588
+ if (!current) {
589
+ $tabs.first().trigger("click")
590
+ }
591
+ })
592
+ }
593
+
594
+ $(document).ready(function () {
595
+ if (typeof $.alerts != "undefined") {
596
+ $.alerts.overlayColor = "#000";
597
+ $.alerts.overlayOpacity = 0.5
598
+ }
599
+ })
600
+ })(jQuery);
assets/js/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php // Silence is golden.
assets/js/jquery.tipsy.js DELETED
@@ -1,258 +0,0 @@
1
- // tipsy, facebook style tooltips for jquery
2
- // version 1.0.0a
3
- // (c) 2008-2010 jason frame [jason@onehackoranother.com]
4
- // released under the MIT license
5
-
6
- (function($) {
7
-
8
- function maybeCall(thing, ctx) {
9
- return (typeof thing == 'function') ? (thing.call(ctx)) : thing;
10
- };
11
-
12
- function isElementInDOM(ele) {
13
- while (ele = ele.parentNode) {
14
- if (ele == document) return true;
15
- }
16
- return false;
17
- };
18
-
19
- function Tipsy(element, options) {
20
- this.$element = $(element);
21
- this.options = options;
22
- this.enabled = true;
23
- this.fixTitle();
24
- };
25
-
26
- Tipsy.prototype = {
27
- show: function() {
28
- var title = this.getTitle();
29
- if (title && this.enabled) {
30
- var $tip = this.tip();
31
-
32
- $tip.find('.tipsy-inner')[this.options.html ? 'html' : 'text'](title);
33
- $tip[0].className = 'tipsy'; // reset classname in case of dynamic gravity
34
- $tip.remove().css({top: 0, left: 0, visibility: 'hidden', display: 'block'}).prependTo(document.body);
35
-
36
- var pos = $.extend({}, this.$element.offset(), {
37
- width: this.$element[0].offsetWidth,
38
- height: this.$element[0].offsetHeight
39
- });
40
-
41
- var actualWidth = $tip[0].offsetWidth,
42
- actualHeight = $tip[0].offsetHeight,
43
- gravity = maybeCall(this.options.gravity, this.$element[0]);
44
-
45
- var tp;
46
- switch (gravity.charAt(0)) {
47
- case 'n':
48
- tp = {top: pos.top + pos.height + this.options.offset, left: pos.left + pos.width / 2 - actualWidth / 2};
49
- break;
50
- case 's':
51
- tp = {top: pos.top - actualHeight - this.options.offset, left: pos.left + pos.width / 2 - actualWidth / 2};
52
- break;
53
- case 'e':
54
- tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth - this.options.offset};
55
- break;
56
- case 'w':
57
- tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width + this.options.offset};
58
- break;
59
- }
60
-
61
- if (gravity.length == 2) {
62
- if (gravity.charAt(1) == 'w') {
63
- tp.left = pos.left + pos.width / 2 - 15;
64
- } else {
65
- tp.left = pos.left + pos.width / 2 - actualWidth + 15;
66
- }
67
- }
68
-
69
- $tip.css(tp).addClass('tipsy-' + gravity);
70
- $tip.find('.tipsy-arrow')[0].className = 'tipsy-arrow tipsy-arrow-' + gravity.charAt(0);
71
- if (this.options.className) {
72
- $tip.addClass(maybeCall(this.options.className, this.$element[0]));
73
- }
74
-
75
- if (this.options.fade) {
76
- $tip.stop().css({opacity: 0, display: 'block', visibility: 'visible'}).animate({opacity: this.options.opacity});
77
- } else {
78
- $tip.css({visibility: 'visible', opacity: this.options.opacity});
79
- }
80
- }
81
- },
82
-
83
- hide: function() {
84
- if (this.options.fade) {
85
- this.tip().stop().fadeOut(function() { $(this).remove(); });
86
- } else {
87
- this.tip().remove();
88
- }
89
- },
90
-
91
- fixTitle: function() {
92
- var $e = this.$element;
93
- if ($e.attr('title') || typeof($e.attr('original-title')) != 'string') {
94
- $e.attr('original-title', $e.attr('title') || '').removeAttr('title');
95
- }
96
- },
97
-
98
- getTitle: function() {
99
- var title, $e = this.$element, o = this.options;
100
- this.fixTitle();
101
- var title, o = this.options;
102
- if (typeof o.title == 'string') {
103
- title = $e.attr(o.title == 'title' ? 'original-title' : o.title);
104
- } else if (typeof o.title == 'function') {
105
- title = o.title.call($e[0]);
106
- }
107
- title = ('' + title).replace(/(^\s*|\s*$)/, "");
108
- return title || o.fallback;
109
- },
110
-
111
- tip: function() {
112
- if (!this.$tip) {
113
- this.$tip = $('<div class="tipsy"></div>').html('<div class="tipsy-arrow"></div><div class="tipsy-inner"></div>');
114
- this.$tip.data('tipsy-pointee', this.$element[0]);
115
- }
116
- return this.$tip;
117
- },
118
-
119
- validate: function() {
120
- if (!this.$element[0].parentNode) {
121
- this.hide();
122
- this.$element = null;
123
- this.options = null;
124
- }
125
- },
126
-
127
- enable: function() { this.enabled = true; },
128
- disable: function() { this.enabled = false; },
129
- toggleEnabled: function() { this.enabled = !this.enabled; }
130
- };
131
-
132
- $.fn.tipsy = function(options) {
133
-
134
- if (options === true) {
135
- return this.data('tipsy');
136
- } else if (typeof options == 'string') {
137
- var tipsy = this.data('tipsy');
138
- if (tipsy) tipsy[options]();
139
- return this;
140
- }
141
-
142
- options = $.extend({}, $.fn.tipsy.defaults, options);
143
-
144
- function get(ele) {
145
- var tipsy = $.data(ele, 'tipsy');
146
- if (!tipsy) {
147
- tipsy = new Tipsy(ele, $.fn.tipsy.elementOptions(ele, options));
148
- $.data(ele, 'tipsy', tipsy);
149
- }
150
- return tipsy;
151
- }
152
-
153
- function enter() {
154
- var tipsy = get(this);
155
- tipsy.hoverState = 'in';
156
- if (options.delayIn == 0) {
157
- tipsy.show();
158
- } else {
159
- tipsy.fixTitle();
160
- setTimeout(function() { if (tipsy.hoverState == 'in') tipsy.show(); }, options.delayIn);
161
- }
162
- };
163
-
164
- function leave() {
165
- var tipsy = get(this);
166
- tipsy.hoverState = 'out';
167
- if (options.delayOut == 0) {
168
- tipsy.hide();
169
- } else {
170
- setTimeout(function() { if (tipsy.hoverState == 'out') tipsy.hide(); }, options.delayOut);
171
- }
172
- };
173
-
174
- if (!options.live) this.each(function() { get(this); });
175
-
176
- if (options.trigger != 'manual') {
177
- var binder = options.live ? 'live' : 'bind',
178
- eventIn = options.trigger == 'hover' ? 'mouseenter' : 'focus',
179
- eventOut = options.trigger == 'hover' ? 'mouseleave' : 'blur';
180
- this[binder](eventIn, enter)[binder](eventOut, leave);
181
- }
182
-
183
- return this;
184
-
185
- };
186
-
187
- $.fn.tipsy.defaults = {
188
- className: null,
189
- delayIn: 0,
190
- delayOut: 0,
191
- fade: false,
192
- fallback: '',
193
- gravity: 'n',
194
- html: false,
195
- live: false,
196
- offset: 0,
197
- opacity: 0.8,
198
- title: 'title',
199
- trigger: 'hover'
200
- };
201
-
202
- $.fn.tipsy.revalidate = function() {
203
- $('.tipsy').each(function() {
204
- var pointee = $.data(this, 'tipsy-pointee');
205
- if (!pointee || !isElementInDOM(pointee)) {
206
- $(this).remove();
207
- }
208
- });
209
- };
210
-
211
- // Overwrite this method to provide options on a per-element basis.
212
- // For example, you could store the gravity in a 'tipsy-gravity' attribute:
213
- // return $.extend({}, options, {gravity: $(ele).attr('tipsy-gravity') || 'n' });
214
- // (remember - do not modify 'options' in place!)
215
- $.fn.tipsy.elementOptions = function(ele, options) {
216
- return $.metadata ? $.extend({}, options, $(ele).metadata()) : options;
217
- };
218
-
219
- $.fn.tipsy.autoNS = function() {
220
- return $(this).offset().top > ($(document).scrollTop() + $(window).height() / 2) ? 's' : 'n';
221
- };
222
-
223
- $.fn.tipsy.autoWE = function() {
224
- return $(this).offset().left > ($(document).scrollLeft() + $(window).width() / 2) ? 'e' : 'w';
225
- };
226
-
227
- /**
228
- * yields a closure of the supplied parameters, producing a function that takes
229
- * no arguments and is suitable for use as an autogravity function like so:
230
- *
231
- * @param margin (int) - distance from the viewable region edge that an
232
- * element should be before setting its tooltip's gravity to be away
233
- * from that edge.
234
- * @param prefer (string, e.g. 'n', 'sw', 'w') - the direction to prefer
235
- * if there are no viewable region edges effecting the tooltip's
236
- * gravity. It will try to vary from this minimally, for example,
237
- * if 'sw' is preferred and an element is near the right viewable
238
- * region edge, but not the top edge, it will set the gravity for
239
- * that element's tooltip to be 'se', preserving the southern
240
- * component.
241
- */
242
- $.fn.tipsy.autoBounds = function(margin, prefer) {
243
- return function() {
244
- var dir = {ns: prefer[0], ew: (prefer.length > 1 ? prefer[1] : false)},
245
- boundTop = $(document).scrollTop() + margin,
246
- boundLeft = $(document).scrollLeft() + margin,
247
- $this = $(this);
248
-
249
- if ($this.offset().top < boundTop) dir.ns = 'n';
250
- if ($this.offset().left < boundLeft) dir.ew = 'w';
251
- if ($(window).width() + $(document).scrollLeft() - $this.offset().left < margin) dir.ew = 'e';
252
- if ($(window).height() + $(document).scrollTop() - $this.offset().top < margin) dir.ns = 's';
253
-
254
- return dir.ns + (dir.ew ? dir.ew : '');
255
- }
256
- };
257
-
258
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/learnpress.js DELETED
@@ -1,575 +0,0 @@
1
- if (typeof LearnPress == 'undefined') window.LearnPress = {};
2
- ;
3
- (function ($) {
4
-
5
- $.fn.outerHTML = function () {
6
- // IE, Chrome & Safari will comply with the non-standard outerHTML, all others (FF) will have a fall-back for cloning
7
- return (!this.length) ? this : (this[0].outerHTML || (function (el) {
8
- var div = document.createElement('div');
9
- div.appendChild(el.cloneNode(true));
10
- var contents = div.innerHTML;
11
- div = null;
12
- return $(contents);
13
- })(this[0]));
14
-
15
- }
16
- $.extend(LearnPress, {
17
- complete_lesson: function (lesson, user_id) {
18
- $.ajax({
19
- type : "POST",
20
- dataType: 'html',
21
- url : ajaxurl,
22
- data : {
23
- action : 'learnpress_complete_lesson',
24
- lesson : lesson,
25
- user_id: user_id
26
- },
27
- success : function (response) {
28
- var response = LearnPress.parseJSON(response);
29
- response = $(document).triggerHandler('learn_press_user_complete_lesson', response);
30
- if(response.result == 'success'){
31
- $('.course-item-' + lesson).addClass('item-completed');
32
- }
33
- if (response.url) {
34
- LearnPress.reload(response.url)
35
- } else {
36
- LearnPress.reload();
37
- }
38
- }
39
- })
40
- },
41
- retake_course : function (course_id, user_id) {
42
- $.ajax({
43
- type : 'POST',
44
- url : '',
45
- data : {
46
- action : 'learn_press_retake_course',
47
- course_id: course_id,
48
- user_id : user_id
49
- },
50
- success: function (response) {
51
- if (response) {
52
- if (response.message) alert(response.message);
53
- if (response.redirect)
54
- LearnPress.reload(response.redirect)
55
- }
56
- }
57
- });
58
- },
59
- finishCourse : function (course_id, callback) {
60
- if (!confirm(confirm_finish_course.confirm_finish_course)) return;
61
- },
62
-
63
- load_lesson: function (permalink, args) {
64
- args = $.extend({
65
- success: function () {
66
- },
67
- error : function () {
68
- }
69
- }, args || {})
70
- $.ajax({
71
- url : permalink,
72
- success: function (response) {
73
- var $response = $(response),
74
- $new_lesson = $('.course-content', $response);
75
- if ($new_lesson.length) {
76
- $('.course-content').replaceWith($new_lesson);
77
- $('title').html($response.filter('title').text());
78
- $.isFunction(args.success) && args.success.call(this, response)
79
- } else {
80
- if (!( $.isFunction(args.error) && args.error.call(this, response) )) {
81
- alert("UNKNOW ERROR")
82
- }
83
- }
84
- }
85
- })
86
- }
87
- });
88
-
89
- var $doc = $(document),
90
- $win = $(window);
91
-
92
- function complete_lesson(event) {
93
- event.preventDefault();
94
- if (!confirm(learn_press_js_localize.confirm_complete_lesson)) return;
95
- var lesson = $(this).attr('data-id');
96
- LearnPress.complete_lesson(lesson);
97
- }
98
-
99
- function finish_course() {
100
- var $button = $(this),
101
- course_id = $button.data('id');
102
- LearnPress.finish_course(course_id);
103
- }
104
-
105
- function retake_course() {
106
- if (!confirm(learn_press_js_localize.confirm_retake_course)) return;
107
- var $button = $(this),
108
- course_id = $button.data('id');
109
- LearnPress.retake_course(course_id);
110
- }
111
-
112
- function load_lesson(evt) {
113
- return;
114
- evt.preventDefault();
115
- var $link = $(this),
116
- $parent = $link.parent(),
117
- permalink = $link.attr('href');
118
- if (!$link.data('id')) return false;
119
- if ($parent.hasClass('current')) return false;
120
- if ($parent.hasClass('course-lesson')) {
121
- $('.curriculum-sections .course-lesson.loading').removeClass('loading')
122
- $parent.addClass('loading')
123
- }
124
- history.pushState({}, '', permalink);
125
- LearnPress.load_lesson(permalink, {
126
- success: function () {
127
- $('.curriculum-sections .course-lesson.current').removeClass('current')
128
- if ($parent.hasClass('course-lesson')) {
129
- $parent.removeClass('loading');
130
- $parent.addClass('current');
131
- } else {
132
- $('.curriculum-sections .course-lesson a[lesson-id="' + $link.data('id') + '"]').parent().addClass('current')
133
- }
134
- $('body, html').fadeIn(100).delay(300).animate({scrollTop: $('.course-content').offset().top - 50}, 'slow');
135
- }
136
- });
137
- }
138
-
139
- function _ready() {
140
- /*$doc
141
- .on('click', '.complete-lesson-button', complete_lesson)
142
- .on('click', '#finish-course', finish_course)
143
- .on('click', '#learn_press_retake_course', retake_course)
144
- .on('click', '.course-content-lesson-nav a', load_lesson)
145
- .on('click', '.section-content .course-lesson a', load_lesson);
146
- */
147
- $('.lesson-quiz-icon', '.section-content').each(function () {
148
- var $target = $(this), $parent = $target.closest('li');
149
- $target.tipsy({
150
- title : function () {
151
- var tip = undefined;
152
- if ($parent.hasClass('completed')) {
153
- tip = $('#lesson-quiz-tip-completed-' + $(this).next().data('id')).html();
154
- } else if ($parent.hasClass('current')) {
155
- tip = $('#lesson-quiz-tip-current-' + $(this).next().data('id')).html();
156
- }
157
- if (tip == undefined) {
158
- tip = $('#lesson-quiz-tip-message-' + $(this).next().data('id')).html();
159
- }
160
- return tip;
161
- },
162
- gravity: 's',
163
- fade : true,
164
- html : true
165
- })
166
- });
167
- }
168
-
169
- $doc.ready(_ready);
170
-
171
- })(jQuery);
172
-
173
- ;
174
- jQuery(document).ready(function ($) {
175
- $('#clear_previous_submissions').click(function (event) {
176
- event.preventDefault();
177
- var $this = $(this);
178
- var defaulttxt = $this.html();
179
- $this.prepend('<i class="fa fa-spinner fa-spin">&nbsp;</i>');
180
-
181
- $.ajax({
182
- type : "POST",
183
- url : ajaxurl,
184
- data : {
185
- action : 'clear_previous_submissions',
186
- id : $this.attr('data-id'),
187
- security: $this.attr('data-security')
188
- },
189
- cache : false,
190
- success: function (html) {
191
- $this.find('i').remove();
192
- $this.html(html);
193
- setTimeout(function () {
194
- location.reload();
195
- }, 3000);
196
- }
197
- });
198
-
199
- });
200
-
201
- $.ajaxSetup({cache: false});
202
- $("#btn_roll").click(function () {
203
- event.preventDefault();
204
- var post_link = $(this).attr("rel");
205
- $("#course_main").html("loading...");
206
- $("#course_main").load(post_link);
207
- return false;
208
- });
209
- });
210
-
211
- jQuery(document).ready(function ($) {
212
- $('.quiz-curriculum').click(function (event) {
213
- event.preventDefault();
214
-
215
- $.ajax({
216
- type : "POST",
217
- url : ajaxurl,
218
- data : {
219
- action: 'learnpress_list_quiz'
220
- },
221
- success: function (html) {
222
- $('.course-content').html(html);
223
- }
224
- })
225
- })
226
- });
227
-
228
- jQuery(document).ready(function ($) {
229
- $('.list-quiz-question').click(function (event) {
230
- event.preventDefault();
231
- var $this = $(this);
232
-
233
- $.ajax({
234
- type : "POST",
235
- url : ajaxurl,
236
- data : {
237
- action : 'learnpress_load_quiz_question',
238
- course_id : $('.quiz-main').attr('course-id'),
239
- quiz_id : window.quiz_id,
240
- question_id: $this.attr('question-id')
241
- },
242
- success: function (html) {
243
- $('.quiz-question').html(html);
244
- $('.qq').removeClass('current');
245
- var cl = ".qq:nth-child(" + $this.attr('question-index') + ")";
246
- $(cl).addClass('current');
247
- //$this.attr('question-id').addClass('active');
248
-
249
- if (jQuery('.quiz-questions li').first().hasClass('current')) {
250
- jQuery('.button-prev-question').addClass('hidden');
251
- } else if ($('.button-prev-question').hasClass('hidden')) {
252
- $('.button-prev-question').removeClass('hidden')
253
- }
254
-
255
-
256
- if (jQuery('.quiz-questions li').last().hasClass('current')) {
257
- jQuery('.button-next-question').addClass('hidden');
258
- } else if ($('.button-next-question').hasClass('hidden')) {
259
- $('.button-next-question').removeClass('hidden');
260
- }
261
- }
262
- });
263
- });
264
- });
265
-
266
- jQuery(document).ready(function ($) {
267
- $('.lesson_curriculum').click(function (event) {
268
- event.preventDefault();
269
- var $this = $(this);
270
- var $url = $(this).attr('href');
271
- var link = window.location.href;
272
-
273
- $.ajax({
274
- type : "POST",
275
- url : $url, //ajaxurl,
276
- data : {
277
- action : 'learnpress_load_lesson_content',
278
- lesson_id: $(this).attr('lesson-id')
279
- },
280
- success: function (html) {
281
- LearnPress.log($url);
282
- history.pushState({}, '', $url);
283
- $('.course-content').html($('.course-content', html).html());
284
- $('html, body').animate({scrollTop: $('.course-content').offset().top}, 'slow');
285
- $('.button-prev-lesson').removeClass('hidden');
286
- $('.button-complete-lesson').removeClass('hidden');
287
- $('.button-next-lesson').removeClass('hidden');
288
- $('.course-curriculum').find('.current').removeClass('current');
289
- $this.addClass('current');
290
- }
291
- });
292
- });
293
- });
294
-
295
- jQuery(document).ready(function ($) {
296
- $('.button-finish-quiz').click(function ($event) {
297
- return;
298
- $event.preventDefault();
299
- var $temp = jQuery(".question-form").serializeArray();
300
- var $question_answer = 1;
301
- if (0 < $temp.length) {
302
- $question_answer = $temp[0].value;
303
- }
304
- var $question_id = jQuery('.quiz-questions').find('li.current a').attr('question-id');
305
-
306
- $.ajax({
307
- type : "POST",
308
- url : ajaxurl,
309
- data : {
310
- action : 'learnpress_finish_quiz',
311
- course_id : $('.quiz-main').attr('course-id'),
312
- quiz_id : $(this).attr('quiz-id'),
313
- question_id : $question_id,
314
- question_answer: $question_answer
315
- },
316
- success: function (html) {
317
- LearnPress.log(html);
318
- location.reload(true);
319
- }
320
- })
321
- })
322
- });
323
-
324
- jQuery(document).ready(function ($) {
325
- $('#lpr-join-event').click(function (event) {
326
- event.preventDefault();
327
- var $this = $(this);
328
-
329
- $.ajax({
330
- type : "POST",
331
- url : ajaxurl,
332
- data : {
333
- action : 'learnpress_join_event',
334
- event_id: $(this).attr('event-id')
335
- },
336
- success: function (html) {
337
- $this.html(html);
338
- $this.removeAttr('id').attr('id', 'lpr-not-going');
339
- }
340
- });
341
- });
342
- });
343
-
344
- jQuery(document).ready(function ($) {
345
- $('#lpr-not-going').click(function (event) {
346
- event.preventDefault();
347
- var $this = $(this);
348
-
349
- $.ajax({
350
- type : "POST",
351
- url : ajaxurl,
352
- data : {
353
- action : 'learnpress_not_going',
354
- event_id: $(this).attr('event-id')
355
- },
356
- success: function (html) {
357
- $this.html(html);
358
- $this.removeAttr('id').attr('id', 'lpr-join-event');
359
- }
360
- });
361
- });
362
- });
363
-
364
-
365
- jQuery(document).ready(function ($) {
366
- $('.course-free-button').click(function (event) {
367
- event.preventDefault();
368
- var $this = $(this);
369
- $.ajax({
370
- type : "POST",
371
- url : ajaxurl,
372
- data : {
373
- action : 'learnpress_take_free_course',
374
- course_id: $this.attr('course-id')
375
- },
376
- success: function (html) {
377
- if (html == 'not prerequisite') {
378
- //jAlert('You have to complete prereqisite courses before taking this course');
379
- $('.error-notice').html('You have to complete prereqisite courses before taking this course');
380
- } else if (html == 'not logged in') {
381
- $('.error-notice').html('You have to log in to take this course');
382
- } else {
383
- location.reload(true);
384
- }
385
- }
386
- })
387
- });
388
-
389
- $('#myModal').on('shown.bs.modal', function () {
390
- $('#myInput').focus()
391
- })
392
- });
393
-
394
- jQuery(document).ready(function ($) {
395
- $('.button-prev-lesson').on("click", function (event) {
396
- event.preventDefault();
397
- var $lesson_link = $('.course-curriculum').find('.current').parent().prevAll('.course-lesson').first().find('a').attr('href');
398
- var $current = $('.course-curriculum').find('.current');
399
-
400
- if ($lesson_link != '') {
401
- window.location.replace($lesson_link);
402
- } else {
403
- $.ajax({
404
- type : "POST",
405
- url : ajaxurl,
406
- data : {
407
- action : 'learnpress_load_prev_lesson',
408
- lesson_id: $('.course-curriculum').find('.current').parent().prevAll('.course-lesson').first().find('a').attr('lesson-id')
409
- },
410
- success: function (html) {
411
- $('.course-content').html(html);
412
- $current.removeClass('current');
413
- $current.parent().prevAll('.course-lesson').first().find('a').addClass('current');
414
- var $forum_link = $('.course-curriculum').find('.current').attr('data-link');
415
- $('.button-forum').removeClass('hidden').attr('href', $forum_link);
416
- }
417
- })
418
- }
419
- });
420
- });
421
-
422
- jQuery(document).ready(function ($) {
423
- $('.button-next-lesson').on("click", function (event) {
424
- event.preventDefault();
425
- var $lesson_link = $('.course-curriculum').find('.current').parent().nextAll('.course-lesson').first().find('a').attr('href');
426
- var $current = $('.course-curriculum').find('.current');
427
-
428
- if ($lesson_link != '') {
429
- window.location.replace($lesson_link);
430
- } else {
431
- $.ajax({
432
- type : "POST",
433
- url : ajaxurl,
434
- data : {
435
- action : 'learnpress_load_next_lesson',
436
- lesson_id: $('.course-curriculum').find('.current').parent().nextAll('.course-lesson').first().find('a').attr('lesson-id')
437
- },
438
- success: function (html) {
439
- $('.course-content').html(html);
440
- $current.removeClass('current');
441
- $current.parent().nextAll('.course-lesson').first().find('a').addClass('current');
442
- }
443
- })
444
- }
445
- });
446
- });
447
-
448
-
449
- jQuery(document).ready(function ($) {
450
-
451
- $('.button-finish-course').click(function (event) {
452
- event.preventDefault();
453
- var $this = $(this);
454
- var $certi_link = $this.attr("certi_link");
455
- LearnPress.log($certi_link);
456
- $.ajax({
457
- type : "POST",
458
- url : ajaxurl,
459
- data : {
460
- action : 'learnpress_finish_course',
461
- course_id: $this.attr('course-id')
462
- },
463
- success: function (html) {
464
- LearnPress.log(html);
465
- if (html == 'success') {
466
- if ($certi_link) {
467
- window.location.replace($certi_link);
468
- } else {
469
- jAlert('Congratulation ! You have finished this course.')
470
- }
471
- } else {
472
- jAlert(html);
473
- }
474
- }
475
- })
476
- });
477
-
478
- var $payment_form = $('form[name="learn_press_payment_form"]');
479
- $('input[name="payment_method"]', $payment_form).click(function () {
480
- var $this = $(this);
481
- if ($this.is(":checked")) {
482
- $this.closest('li').find('.learn_press_payment_form').slideDown();
483
- $('.learn_press_payment_form', $this.closest('li').siblings()).slideUp();
484
- }
485
- });
486
- $('#learn_press_take_course')
487
- .click(function () {
488
- var button = $(this),
489
- payment_methods = $('input[name="payment_method"]', $payment_form),
490
- take = false,
491
- payment = payment_methods.filter(":checked").val();
492
- if (0 == payment_methods.length) {
493
- take = true;
494
- } else if (1 == payment_methods.length) {
495
- payment_methods.attr('checked', true);
496
- take = true;
497
- } else {
498
- if ($payment_form.is(':visible')) {
499
- if (!payment) {
500
- alert(learn_press_js_localize.no_payment_method);
501
- return;
502
- } else {
503
- take = true
504
- }
505
- } else {
506
- $payment_form.show();
507
- return;
508
- }
509
- }
510
- if (!take) return;
511
- $(this).html($(this).data('loading-text') || 'Processing').attr('disabled', true);
512
- if ($payment_form.triggerHandler('learn_press_place_order') !== false && $payment_form.triggerHandler('learn_press_place_order_' + payment) !== false) {
513
- var data = {
514
- action : 'learnpress_take_course',
515
- payment_method: payment_methods.filter(":checked").val(),
516
- course_id : button.data('id'),
517
- data : $payment_form.serialize()
518
- }
519
-
520
- $.ajax({
521
- url : ajaxurl,
522
- type : 'POST',
523
- dataType: 'html',
524
- data : $payment_form.serialize(),
525
- success : function (res) {
526
- var matches = res.match(/<!-- LP_AJAX_START -->(.*)<!-- LP_AJAX_END -->/),
527
- message = '';
528
- if (matches && matches[1]) {
529
- var json = JSON.parse(matches[1]);
530
- if (json) {
531
- if (json.redirect && (json.result.toLowerCase() == 'success')) {
532
- window.location.href = json.redirect;
533
- return;
534
- } else {
535
- message = json.message
536
- }
537
- } else {
538
- message = matches[1];
539
- }
540
- } else {
541
- message = res
542
- }
543
- if (message) {
544
- alert(message);
545
- }
546
- button.removeAttr('disabled').html(button.data('text'))
547
- }
548
- });
549
- }
550
- return false;
551
- });
552
- });
553
-
554
- jQuery(document).ready(function ($) {
555
- $('#wp-admin-bar-be_teacher').click(function () {
556
- $.ajax({
557
- url : ajaxurl,
558
- data : {
559
- action: 'learnpress_be_teacher'
560
- },
561
- success: function () {
562
- alert(learn_press_js_localize.you_are_instructor_now);
563
- setTimeout(function () {
564
- location.reload();
565
- }, 500);
566
- }
567
- })
568
- });
569
- });
570
-
571
- // jQuery(document).ready(function ($) {
572
- // $('#question-hint').on('click', function(){
573
- // $('.question-hint-content').fadeToggle();
574
- // });
575
- // });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/{owlcarousel/owl.carousel.min.js → owl.carousel.min.js} RENAMED
File without changes
assets/js/toJSON.js DELETED
@@ -1,100 +0,0 @@
1
- (function($){
2
- $.fn.toJSON = function(options){
3
- options = $.extend({}, options);
4
- var self = this,
5
- json = {},
6
- push_counters = {},
7
- patterns = {
8
- "validate": /^[a-zA-Z_\-][a-zA-Z0-9_\-]*(?:\[(?:\d*|[a-zA-Z0-9_\-]+)\])*$/,
9
- "key": /[a-zA-Z0-9_\-]+|(?=\[\])/g,
10
- "push": /^$/,
11
- "fixed": /^\d+$/,
12
- "named": /^[a-zA-Z0-9_\-]+$/
13
- };
14
- this.build = function(base, key, value){
15
- base[key] = value;
16
- return base;
17
- };
18
- this.push_counter = function(key){
19
- if(push_counters[key] === undefined){
20
- push_counters[key] = 0;
21
- }
22
- return push_counters[key]++;
23
- };
24
-
25
- $.each($(this).serializeArray(), function(){
26
- //alert(this.name)
27
- // skip invalid keys
28
- if(!patterns.validate.test(this.name)){
29
- return;
30
- }
31
- //alert(this.name)
32
- var k,
33
- keys = this.name.match(patterns.key),
34
- merge = this.value,
35
- reverse_key = this.name;
36
- while((k = keys.pop()) !== undefined){
37
- // adjust reverse_key
38
- reverse_key = reverse_key.replace(new RegExp("\\[" + k + "\\]$"), '');
39
- // push
40
- if(k.match(patterns.push)){
41
- var key = self.push_counter(reverse_key);
42
- merge = self.build([], key, merge);
43
- }
44
- // fixed
45
- else if(k.match(patterns.fixed)){
46
- merge = self.build([], k, merge);
47
- }
48
-
49
- // named
50
- else if(k.match(patterns.named)){
51
- merge = self.build({}, k, merge);
52
- }
53
- }
54
- json = $.extend(true, json, merge);
55
- });
56
- var trimObject = function(obj){
57
- if(typeof obj == 'undefined') return ;
58
- if(obj.constructor === Array){
59
- obj.clean(null);
60
- for(var i = 0; i < obj.length;i++) trimObject(obj[i]);
61
- }else if(obj.constructor === Object){
62
-
63
- for(var i in obj){
64
- trimObject(obj[i]);
65
- }
66
- }
67
-
68
- }
69
- //trimObject(json);
70
- return json;
71
- };
72
-
73
- jQuery.fn.serializeObject = function() {
74
- var arrayData, objectData;
75
- arrayData = this.serializeArray();
76
- objectData = {};
77
-
78
- $.each(arrayData, function() {
79
- var value;
80
-
81
- if (this.value != null) {
82
- value = this.value;
83
- } else {
84
- value = '';
85
- }
86
-
87
- if (objectData[this.name] != null) {
88
- if (!objectData[this.name].push) {
89
- objectData[this.name] = [objectData[this.name]];
90
- }
91
-
92
- objectData[this.name].push(value);
93
- } else {
94
- objectData[this.name] = value;
95
- }
96
- });
97
-
98
- return objectData;
99
- };
100
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/load-scripts.php ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Disable error reporting
4
+ *
5
+ * Set this to error_reporting( -1 ) for debugging.
6
+ */
7
+ error_reporting( 0 );
8
+
9
+ /** Set ABSPATH for execution */
10
+ define( 'ABSPATH', str_replace( 'wp-content/plugins/learnpress/assets/load-scripts.php', '', $_SERVER['SCRIPT_FILENAME'] ) );
11
+ define( 'WPINC', 'wp-includes' );
12
+ define( 'LP_PATH', '/wp-content/plugins/learnpress/' );
13
+ $load = $_GET['load'];
14
+ if ( is_array( $load ) )
15
+ $load = implode( '', $load );
16
+
17
+ $load = preg_replace( '/[^a-z0-9,_-]+/i', '', $load );
18
+ $load = array_unique( explode( ',', $load ) );
19
+
20
+ if ( empty( $load ) )
21
+ exit;
22
+
23
+ require( ABSPATH . 'wp-admin/includes/noop.php' );
24
+ require( ABSPATH . WPINC . '/script-loader.php' );
25
+ require( ABSPATH . WPINC . '/version.php' );
26
+ require( ABSPATH . LP_PATH . 'inc/class-lp-assets.php' );
27
+
28
+
29
+ $compress = ( isset( $_GET['c'] ) && $_GET['c'] );
30
+ $force_gzip = ( $compress && 'gzip' == $_GET['c'] );
31
+ $expires_offset = 31536000; // 1 year
32
+ $out = '';
33
+ $wp_scripts = new WP_Scripts();
34
+
35
+ // Tell WP Core load their default scripts
36
+ wp_default_scripts( $wp_scripts );
37
+
38
+ // Tell LP load default scripts
39
+ LP_Assets::default_scripts( $wp_scripts );
40
+
41
+ foreach ( $load as $handle ) {
42
+ $handle = 'learn-press-' . $handle;
43
+ if ( !array_key_exists( $handle, $wp_scripts->registered ) )
44
+ continue;
45
+ $path = ABSPATH . $wp_scripts->registered[$handle]->src;
46
+ /**
47
+ * If debug mode is turn of but min file does not exists
48
+ * then, try to find file without .min inside
49
+ */
50
+ if ( !file_exists( $path ) ) {
51
+ $path = preg_replace( '~\.min.~', '.', $path );
52
+ }
53
+ //
54
+ $out .= get_file( $path ) . ";\n";
55
+ }
56
+ header( 'Content-Type: application/javascript; charset=UTF-8' );
57
+ header( 'Expires: ' . gmdate( "D, d M Y H:i:s", time() + $expires_offset ) . ' GMT' );
58
+ header( "Cache-Control: public, max-age=$expires_offset" );
59
+
60
+ if ( $compress && !ini_get( 'zlib.output_compression' ) && 'ob_gzhandler' != ini_get( 'output_handler' ) && isset( $_SERVER['HTTP_ACCEPT_ENCODING'] ) ) {
61
+ header( 'Vary: Accept-Encoding' ); // Handle proxies
62
+ if ( false !== stripos( $_SERVER['HTTP_ACCEPT_ENCODING'], 'deflate' ) && function_exists( 'gzdeflate' ) && !$force_gzip ) {
63
+ header( 'Content-Encoding: deflate' );
64
+ $out = gzdeflate( $out, 3 );
65
+ } elseif ( false !== stripos( $_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip' ) && function_exists( 'gzencode' ) ) {
66
+ header( 'Content-Encoding: gzip' );
67
+ $out = gzencode( $out, 3 );
68
+ }
69
+ }
70
+
71
+ echo $out;
72
+ exit;
assets/load-styles.php ADDED
@@ -0,0 +1,92 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Disable error reporting
5
+ *
6
+ * Set this to error_reporting( -1 ) for debugging
7
+ */
8
+ error_reporting( 0 );
9
+
10
+ /** Set ABSPATH for execution */
11
+ if ( !defined( 'ABSPATH' ) ) {
12
+ define( 'ABSPATH', str_replace( 'wp-content/plugins/learnpress/assets/load-styles.php', '', $_SERVER['SCRIPT_FILENAME'] ) );
13
+ }
14
+ define( 'WPINC', 'wp-includes' );
15
+ define( 'LP_PATH', '/wp-content/plugins/learnpress/' );
16
+ require( ABSPATH . 'wp-admin/includes/noop.php' );
17
+ require( ABSPATH . WPINC . '/script-loader.php' );
18
+ require( ABSPATH . WPINC . '/version.php' );
19
+ require( ABSPATH . LP_PATH . 'inc/class-lp-assets.php' );
20
+ $load = $_GET['load'];
21
+ if ( is_array( $load ) ) {
22
+ $load = implode( '', $load );
23
+ }
24
+ $load = preg_replace( '/[^a-z0-9,_-]+/i', '', $load );
25
+ $load = array_unique( explode( ',', $load ) );
26
+
27
+ if ( empty( $load ) )
28
+ exit;
29
+
30
+ $compress = ( isset( $_GET['c'] ) && $_GET['c'] );
31
+ $force_gzip = ( $compress && 'gzip' == $_GET['c'] );
32
+ $rtl = ( isset( $_GET['dir'] ) && 'rtl' == $_GET['dir'] );
33
+ $expires_offset = 31536000; // 1 year
34
+ $out = '';
35
+
36
+ $wp_styles = new WP_Styles();
37
+
38
+ wp_default_styles( $wp_styles );
39
+
40
+ // Tell LP load default styles
41
+ LP_Assets::default_styles( $wp_styles );
42
+
43
+ if ( isset( $_SERVER['HTTP_IF_NONE_MATCH'] ) && stripslashes( $_SERVER['HTTP_IF_NONE_MATCH'] ) === $wp_version ) {
44
+ $protocol = $_SERVER['SERVER_PROTOCOL'];
45
+ if ( !in_array( $protocol, array( 'HTTP/1.1', 'HTTP/2', 'HTTP/2.0' ) ) ) {
46
+ $protocol = 'HTTP/1.0';
47
+ }
48
+ header( "$protocol 304 Not Modified" );
49
+ exit();
50
+ }
51
+
52
+ foreach ( $load as $handle ) {
53
+ $handle = 'learn-press-' . $handle;
54
+ if ( !array_key_exists( $handle, $wp_styles->registered ) )
55
+ continue;
56
+
57
+ $path = ABSPATH . $wp_styles->registered[$handle]->src;
58
+ /**
59
+ * If debug mode is turn of but min file does not exists
60
+ * then, try to find file without .min inside
61
+ */
62
+ if ( !file_exists( $path ) ) {
63
+ $path = preg_replace( '~\.min.~', '.', $path );
64
+ }
65
+ $content = get_file( $path ) . "\n";
66
+ if ( strpos( $path, '/learnpress/assets/' ) !== false ) {
67
+ $content = str_replace( '../../images/', 'images/', $content );
68
+ $content = str_replace( '../fonts/', 'fonts/', $content );
69
+ $out .= $content;
70
+ } else {
71
+ $out .= $content;
72
+ }
73
+
74
+ }
75
+ header( "Etag: $wp_version" );
76
+ header( 'Content-Type: text/css; charset=UTF-8' );
77
+ header( 'Expires: ' . gmdate( "D, d M Y H:i:s", time() + $expires_offset ) . ' GMT' );
78
+ header( "Cache-Control: public, max-age=$expires_offset" );
79
+
80
+ if ( $compress && !ini_get( 'zlib.output_compression' ) && 'ob_gzhandler' != ini_get( 'output_handler' ) && isset( $_SERVER['HTTP_ACCEPT_ENCODING'] ) ) {
81
+ header( 'Vary: Accept-Encoding' ); // Handle proxies
82
+ if ( false !== stripos( $_SERVER['HTTP_ACCEPT_ENCODING'], 'deflate' ) && function_exists( 'gzdeflate' ) && !$force_gzip ) {
83
+ header( 'Content-Encoding: deflate' );
84
+ $out = gzdeflate( $out, 3 );
85
+ } elseif ( false !== stripos( $_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip' ) && function_exists( 'gzencode' ) ) {
86
+ header( 'Content-Encoding: gzip' );
87
+ $out = gzencode( $out, 3 );
88
+ }
89
+ }
90
+
91
+ echo $out;
92
+ exit;
changelog.md DELETED
@@ -1,114 +0,0 @@
1
- **0.9.14**
2
- - Fixed can not start a quiz for guest.
3
- - Fixed course evaluation error and shows wrong message
4
- - Added "preload icon" for quiz actions and question navigation
5
- - Added option for instructors registration
6
- - Updated default language file.
7
-
8
- **0.9.13.1**
9
- - Added lacked files.
10
-
11
- **0.9.13**
12
- - Fixed profile link problem.
13
- - Fixed conflict with Woo payments add-on.
14
- - Added shortcodes to display free courses, paid courses and newest courses.
15
- - Added shortcodes to display course summary.
16
- - Provided premium add-on assignments.
17
- - Provided premium add-on gradebook.
18
-
19
- **0.9.12**
20
- - Support languages: Italian, Indonesian, German.
21
-
22
- **0.9.11**
23
- - Fixed resets all user settings back to default when re-active LearnPress.
24
- - Fixed certificates trigger error "header already sent" when saving templates.
25
- - Made translatable strings in javascript code.
26
- - Fixed course review add-on error on PHP version 5.3.x.
27
- - Fixed text domain error on translating plugin.
28
-
29
- **0.9.10**
30
- - Fixed bug: Template loader missing header and footer.
31
- - Updated default language file.
32
-
33
- **0.9.9**
34
- - Fixed bug: Course price always showing "FREE" on category page.
35
- - Updated language Polish.
36
-
37
- **0.9.8**
38
- - Fixed wrong placeholder in email settings.
39
- - Updated addon Certificates for GUI and functions with more options
40
- - Used Google Fonts instead of True Type Font (*.ttf)
41
- - Color picker
42
- - Text align (vertical and horizontal)
43
- - Text rotation
44
- - Text transform ( scale X and scale Y)
45
- - More options to display the name of a user:
46
- + User login
47
- + User nice name
48
- + Nickname
49
- + First name
50
- + Last name
51
- + First name then Last name
52
- + Last name then First name
53
- - Support Dutch and French (special thank to Bart Kleijheeg and fxbenard)
54
-
55
- **0.9.7**
56
- Fixed wrong query of quizzes result in Profile.
57
-
58
- **0.9.6**
59
- - Fix translation textdomain error - Thank polischmen for your concern.
60
- - Updated question hint
61
- - Option to set course is public or enrolled require
62
- - Certificates add-on:
63
- - Add more fonts
64
- - Option to display the full name with {firstname}=User first name and {lastname}=User last name
65
- - Option to format date
66
- - Created a sample Certificate when plugin is activated
67
-
68
-
69
- **0.9.5**
70
- - Added showing question answer and explaination feature
71
- - Fixed bugs for addon Fill In Blank question
72
- - Fixed bugs for addon Sorting Choice question
73
- - Fixed bugs for addon Certificates
74
- - Fixed bugs for addon WooCommerce Payment
75
- - Prevent access to lesson directly by using permalink
76
- - Random quiz questions addon (premium add-on)
77
- - Content Drip addon (premium add-on)
78
- - Support multi language
79
-
80
- **0.9.4**
81
- - Set up sample data for LearnPress
82
- - Provided sorting question type (you can find it in premium add-on list)
83
- - Provided fill in blank question type (we are uploading it to WordPress.org so if you cannot find it, wait for it to be available soon)
84
- - Fixed bug profile template
85
- - Updated LearnPress profile method
86
-
87
- **0.9.3**
88
- - Fix menu position problem (3.14).
89
- - Fix bug shortcut key @l to insert lesson link when writing a lesson.
90
- - Fix bug when add Lesson/Quiz into a section but it is not assigned to the course.
91
- - List the addons from wordpress.org in addons page.
92
- - Add new option into settings page lets to choose the page to display form "Become a teacher".
93
- - Add shortcode to insert form "Become a teacher".
94
- - Update lesson/quiz title also update its slug.
95
- - Align review form to center of the page.
96
- - Course review pagination.
97
- - Provide related courses function.
98
- - Support full width embed video.
99
-
100
- **0.9.2**
101
- - Update add-on management page.
102
- - Add auto next lesson after complete a quiz feature.
103
- - Fix course-review bugs.
104
- - Fix bug on curriculum when use "shift + (" or "shift+&" ..... to edit Lesson title or Section title.
105
- - Fix course result bug.
106
- - Fix export/import addon - sometime the image is not imported.
107
- - Fix bug show certificate after user finished a course.
108
-
109
- **0.9.1**
110
- The first beta release.
111
-
112
- **Upgrade Notice**
113
- *0.9.2*
114
- We have changed directory structure and separated all out core add-ons to become independence plugins, so after upgrading version, if you face any add-ons problems, please completely delete the old version and re-install LearnPress. Thank!
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
dummy-data/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php // Silence is golden.
inc/abstracts/abstract-lp-assets.php DELETED
@@ -1,262 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Class LP_Abstract_Assets
5
- *
6
- * @author ThimPress
7
- * @package LearnPress/Classes
8
- * @version 1.0
9
- */
10
-
11
- if ( !defined( 'ABSPATH' ) ) {
12
- exit; // Exit if accessed directly
13
- }
14
-
15
- abstract class LP_Abstract_Assets {
16
-
17
- /**
18
- * Styles
19
- *
20
- * @var array
21
- */
22
- protected static $styles = array();
23
-
24
- /**
25
- * Scripts
26
- *
27
- * @var array
28
- */
29
- protected static $scripts = array();
30
-
31
- /**
32
- * Localize scripts
33
- *
34
- * @var array
35
- */
36
- protected static $wp_localize_scripts = array();
37
-
38
- /**
39
- * Params
40
- *
41
- * @var array
42
- */
43
- protected static $wp_params = array();
44
-
45
- protected static $wp_script_codes = array();
46
-
47
- /**
48
- * Localized flag
49
- *
50
- * @var bool
51
- */
52
- protected static $localized = false;
53
-
54
- /**
55
- * @var int
56
- */
57
- protected static $id = 0;
58
-
59
- protected static $caller = '';
60
-
61
- /**
62
- * Constructor
63
- */
64
- public function __construct() {
65
-
66
- }
67
-
68
- /**
69
- * Init Asset
70
- */
71
- public static function init() {
72
- if ( !self::$caller ) {
73
- return;
74
- }
75
- self::$id = is_admin() ? 0 : 1;
76
-
77
- $class = self::$caller;
78
- if ( self::$id ) {
79
- add_action( 'wp_enqueue_scripts', array( $class, 'load_scripts' ) );
80
- add_action( 'wp_enqueue_scripts', array( $class, 'wp_assets' ) );
81
- add_action( 'wp_print_scripts', array( $class, 'localize_printed_scripts' ), 5 );
82
- add_action( 'wp_print_footer_scripts', array( $class, 'localize_printed_scripts' ), 5 );
83
- } else {
84
- add_action( 'admin_enqueue_scripts', array( $class, 'load_scripts' ) );
85
- add_action( 'admin_enqueue_scripts', array( $class, 'wp_assets' ) );
86
- add_action( 'admin_print_scripts', array( $class, 'localize_printed_scripts' ), 5 );
87
- add_action( 'admin_print_footer_scripts', array( $class, 'localize_printed_scripts' ), 5 );
88
- }
89
-
90
- add_filter( 'script_loader_src', array( $class, 'script_params' ), 999, 2 );
91
- }
92
-
93
- /**
94
- * register script
95
- *
96
- * @param string $handle
97
- * @param string $src
98
- * @param array $deps
99
- * @param string $version
100
- * @param boolean $in_footer
101
- */
102
- public static function add_script( $handle, $src, $deps = array( 'jquery' ), $version = LEARNPRESS_VERSION, $in_footer = true ) {
103
- self::$scripts[] = $handle;
104
- wp_register_script( $handle, $src, $deps, $version, $in_footer );
105
- }
106
-
107
- /**
108
- * register style
109
- *
110
- * @param string $handle
111
- * @param string $src
112
- * @param array $deps
113
- * @param string $version
114
- * @param string $media
115
- */
116
- public static function add_style( $handle, $src, $deps = array(), $version = LEARNPRESS_VERSION, $media = 'all' ) {
117
- self::$styles[] = $handle;
118
- wp_register_style( $handle, $src, $deps, $version, $media );
119
- }
120
-
121
- /**
122
- * enqueue script
123
- *
124
- * @param string $handle
125
- * @param string $src
126
- * @param array $deps
127
- * @param string $version
128
- * @param boolean $in_footer
129
- */
130
- public static function enqueue_script( $handle, $src = '', $deps = array( 'jquery' ), $version = LEARNPRESS_VERSION, $in_footer = true ) {
131
- if ( !in_array( $handle, self::$scripts ) && $src ) {
132
- self::add_script( $handle, $src, $deps, $version, $in_footer );
133
- }
134
- wp_enqueue_script( $handle );
135
- }
136
-
137
- /**
138
- * enqueue style
139
- *
140
- * @param string $handle
141
- * @param string $src
142
- * @param array $deps
143
- * @param string $version
144
- * @param string $media
145
- */
146
- public static function enqueue_style( $handle, $src = '', $deps = array(), $version = LEARNPRESS_VERSION, $media = 'all' ) {
147
- if ( !in_array( $handle, self::$styles ) && $src ) {
148
- self::add_style( $handle, $src, $deps, $version, $media );
149
- }
150
- wp_enqueue_style( $handle );
151
- }
152
-
153
- /**
154
- * add translate text
155
- *
156
- * @param string
157
- * @param array $localize
158
- * @param string
159
- */
160
- public static function add_localize( $key, $localize = null, $handle = 'learn-press-js' ) {
161
- if ( is_array( $key ) ) {
162
- foreach ( $key as $k => $v ) {
163
- self::add_localize( $k, $v, $handle );
164
- }
165
- } elseif ( is_string( $key ) && strlen( $key ) ) {
166
- if ( !$handle ) $handle = 'learn-press-js';
167
- if ( empty( self::$wp_localize_scripts[$handle] ) ) self::$wp_localize_scripts[$handle] = array();
168
- self::$wp_localize_scripts[$handle][$key] = $localize;
169
- }
170
- }
171
-
172
- /**
173
- * Add js param
174
- *
175
- * @param string
176
- * @param array
177
- * @param string
178
- */
179
- public static function add_param( $key, $param = null, $handle = 'learn-press-js' ) {
180
- if ( is_array( $key ) ) {
181
- foreach ( $key as $k => $v ) {
182
- self::add_param( $k, $v, $handle );
183
- }
184
- } elseif ( is_string( $key ) && strlen( $key ) ) {
185
- if ( !$handle ) $handle = 'learn-press-js';
186
- if ( empty( self::$wp_params[$handle] ) ) self::$wp_params[$handle] = array();
187
- self::$wp_params[$handle][$key] = $param;
188
- }
189
- }
190
-
191
- /**
192
- * Localize script
193
- *
194
- * @param mixed $handle
195
- */
196
- private static function localize_script( $handle ) {
197
- $data = !empty( self::$wp_localize_scripts[$handle] ) ? self::$wp_localize_scripts[$handle] : false;
198
- if ( wp_script_is( $handle ) && $data ) {
199
- $name = str_replace( '-', '_', $handle ) . '_localize';
200
- unset( self::$wp_localize_scripts[$handle] );
201
- wp_localize_script( $handle, $name, apply_filters( $name, $data ) );
202
- }
203
- }
204
-
205
- /**
206
- * Print script params
207
- *
208
- * @param mixed $handle
209
- */
210
- private static function script_paramsx( $handle ) {
211
- $data = !empty( self::$wp_params[$handle] ) ? self::$wp_params[$handle] : false;
212
- if ( wp_script_is( $handle ) && $data ) {
213
- $name = str_replace( '-', '_', $handle ) . '_params';
214
- unset( self::$wp_params[$handle] );
215
- //$data = learn_press_sanitize_json( $data );
216
- //wp_localize_script( $handle, $name, apply_filters( $name, $data ) );
217
- }
218
- }
219
-
220
- public static function add_script_tag( $code, $handle = '' ) {
221
- if ( empty( self::$wp_script_codes[$handle] ) ) {
222
- self::$wp_script_codes[$handle] = '';
223
- }
224
- self::$wp_script_codes[$handle] .= preg_replace( '!</?script(.*)>!', '', $code );
225
- }
226
-
227
- public static function wp_assets() {
228
- do_action( 'learn_press_print_assets', is_admin() );
229
- }
230
-
231
- public static function script_params( $src, $handle ) {
232
- $data = !empty( self::$wp_params[$handle] ) ? self::$wp_params[$handle] : false;
233
- if ( wp_script_is( $handle ) && $data ) {
234
- $name = str_replace( '-', '_', $handle ) . '_params';
235
- echo "<script type='text/javascript'>\n"; // CDATA and type='text/javascript' is not needed for HTML 5
236
- echo "/* <![CDATA[ */\n";
237
- echo "var {$name}=" . wp_json_encode( $data ) . "\n";
238
- echo "/* ]]> */\n";
239
- echo "</script>\n";
240
- unset( self::$wp_params[$handle] );
241
- }
242
- return $src;
243
- }
244
-
245
- /**
246
- * Load Script
247
- */
248
- public static function load_scripts() {
249
- }
250
-
251
- public static function localize_printed_scripts() {
252
- if ( self::$scripts ) foreach ( self::$scripts as $handle ) {
253
- self::localize_script( $handle );
254
- //self::script_params( $handle );
255
- if ( !empty( self::$wp_script_codes[$handle] ) ) {
256
- learn_press_get_template( 'global/scripts.php', array( 'code' => self::$wp_script_codes[$handle] ) );
257
- unset( self::$wp_script_codes[$handle] );
258
- }
259
- }
260
-
261
- }
262
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/admin/class-lp-admin-ajax.php CHANGED
@@ -47,7 +47,10 @@ if ( !class_exists( 'LP_Admin_Ajax' ) ) {
47
  'update_add_on_status' => false,
48
  'plugin_install' => false,
49
  'bundle_activate_add_ons' => false,
50
- 'install_sample_data' => false
 
 
 
51
  );
52
  foreach ( $ajaxEvents as $ajaxEvent => $nopriv ) {
53
  add_action( 'wp_ajax_learnpress_' . $ajaxEvent, array( __CLASS__, $ajaxEvent ) );
@@ -130,7 +133,7 @@ if ( !class_exists( 'LP_Admin_Ajax' ) ) {
130
  public static function json_search_customer_name( $query ) {
131
  global $wpdb;
132
 
133
- $term = wc_clean( stripslashes( $_GET['term'] ) );
134
  if ( method_exists( $wpdb, 'esc_like' ) ) {
135
  $term = $wpdb->esc_like( $term );
136
  } else {
@@ -188,6 +191,13 @@ if ( !class_exists( 'LP_Admin_Ajax' ) ) {
188
  }
189
  break;
190
  case 'lp_question':
 
 
 
 
 
 
 
191
 
192
  }
193
  if ( $exclude2 && $exclude ) {
@@ -290,10 +300,13 @@ if ( !class_exists( 'LP_Admin_Ajax' ) ) {
290
  echo '<li>' . apply_filters( 'learn_press_modal_search_items_not_found', __( 'No item found', 'learnpress' ), $type ) . '</li>';
291
  }
292
 
 
 
293
  $response = array(
294
  'html' => ob_get_clean(),
295
  'data' => $found_items,
296
- 'args' => $args
 
297
  );
298
  learn_press_send_json( $response );
299
  }
@@ -311,6 +324,18 @@ if ( !class_exists( 'LP_Admin_Ajax' ) ) {
311
  AND question_id = %d
312
  ", $quiz_id, $question_id );
313
  $wpdb->query( $query );
 
 
 
 
 
 
 
 
 
 
 
 
314
  die();
315
  }
316
 
@@ -320,7 +345,7 @@ if ( !class_exists( 'LP_Admin_Ajax' ) ) {
320
  $quiz_id = learn_press_get_request( 'quiz_id' );
321
  $user = learn_press_get_current_user();
322
  if ( !$user->is_admin() && get_post_field( 'post_author', $quiz_id ) != get_current_user_id() ) {
323
- wp_die( __( 'You have not permission to access this section', 'learnpress' ) );
324
  }
325
  $term = (string) ( stripslashes( learn_press_get_request( 'term' ) ) );
326
  $exclude = array();
@@ -377,7 +402,7 @@ if ( !class_exists( 'LP_Admin_Ajax' ) ) {
377
  ', $id, $question );
378
  }
379
  } else {
380
- echo '<li>' . __( 'No question found', 'learnpress' ) . '</li>';
381
  }
382
 
383
  $response = array(
@@ -664,10 +689,10 @@ if ( !class_exists( 'LP_Admin_Ajax' ) ) {
664
  $response['html'] = '<a href="' . get_edit_post_link( $page_id ) . '" target="_blank">' . __( 'Edit Page', 'learnpress' ) . '</a>&nbsp;';
665
  $response['html'] .= '<a href="' . get_permalink( $page_id ) . '" target="_blank">' . __( 'View Page', 'learnpress' ) . '</a>';
666
  } else {
667
- $response['error'] = __( 'Error! Can not create page. Please try again!', 'learnpress' );
668
  }
669
  } else {
670
- $response['error'] = __( 'Page name is empty!', 'learnpress' );
671
  }
672
  learn_press_send_json( $response );
673
  die();
@@ -679,6 +704,7 @@ if ( !class_exists( 'LP_Admin_Ajax' ) ) {
679
  $quiz_id = learn_press_get_request( 'quiz_id' );
680
  $type = learn_press_get_request( 'type' );
681
  $name = learn_press_get_request( 'name' );
 
682
  $response = array(
683
  'id' => $id
684
  );
@@ -688,7 +714,7 @@ if ( !class_exists( 'LP_Admin_Ajax' ) ) {
688
  $id = wp_insert_post(
689
  array(
690
  'post_title' => $name,
691
- 'post_type' => LP()->question_post_type,
692
  'post_status' => 'publish'
693
  )
694
  );
@@ -713,6 +739,14 @@ if ( !class_exists( 'LP_Admin_Ajax' ) ) {
713
  $question = LP_Question_Factory::get_question( $id );
714
  learn_press_admin_view( 'meta-boxes/quiz/question.php', array( 'question' => $question ) );
715
  $response['html'] = ob_get_clean();
 
 
 
 
 
 
 
 
716
  }
717
  learn_press_send_json( $response );
718
  die();
@@ -725,6 +759,15 @@ if ( !class_exists( 'LP_Admin_Ajax' ) ) {
725
 
726
  do_action( 'learn_press_convert_question_type', $question_id, $from, $to, $data );
727
  $question = LP_Question_Factory::get_question( $question_id, array( 'type' => $to ) );
 
 
 
 
 
 
 
 
 
728
  learn_press_send_json(
729
  array(
730
  'html' => $question->admin_interface( array( 'echo' => false ) ),
@@ -732,7 +775,8 @@ if ( !class_exists( 'LP_Admin_Ajax' ) ) {
732
  )
733
  );
734
  } else {
735
- throw new Exception( __( 'Convert question type must be specify the id, source and destination type', 'learnpress' ) );
 
736
  }
737
  die();
738
  }
@@ -771,7 +815,7 @@ if ( !class_exists( 'LP_Admin_Ajax' ) ) {
771
  );
772
  $response['url'] = $url = $url . '&' . http_build_query( $postdata ) . "\n";
773
  $response['result'] = 'success';
774
- $response['message'] = sprintf( '<p>%s <a href="edit.php?post_type=lp_course">%s</a> </p>', __( 'Import sample data successfully.', 'learnpress' ), __( 'View courses', 'learnpress' ) );
775
  }
776
  }
777
  if ( $response['result'] == 'fail' ) {
@@ -897,7 +941,7 @@ if ( !class_exists( 'LP_Admin_Ajax' ) ) {
897
 
898
  $new_lesson = array(
899
  'post_title' => wp_strip_all_tags( $lesson_title ),
900
- 'post_type' => LP()->lesson_post_type,
901
  'post_status' => 'publish'
902
  );
903
 
@@ -905,7 +949,7 @@ if ( !class_exists( 'LP_Admin_Ajax' ) ) {
905
 
906
  $args = array(
907
  'numberposts' => 1,
908
- 'post_type' => LP()->lesson_post_type,
909
  'post_status' => 'publish'
910
  );
911
  $lesson = wp_get_recent_posts( $args );
@@ -926,7 +970,7 @@ if ( !class_exists( 'LP_Admin_Ajax' ) ) {
926
 
927
  $new_quiz = array(
928
  'post_title' => wp_strip_all_tags( $quiz_title ),
929
- 'post_type' => LP()->quiz_post_type,
930
  'post_status' => 'publish'
931
  );
932
 
@@ -934,7 +978,7 @@ if ( !class_exists( 'LP_Admin_Ajax' ) ) {
934
 
935
  $args = array(
936
  'numberposts' => 1,
937
- 'post_type' => LP()->quiz_post_type,
938
  'post_status' => 'publish'
939
  );
940
  $quiz = wp_get_recent_posts( $args );
@@ -950,7 +994,7 @@ if ( !class_exists( 'LP_Admin_Ajax' ) ) {
950
  public static function be_teacher() {
951
  $user_id = get_current_user_id();
952
  $be_teacher = new WP_User( $user_id );
953
- $be_teacher->set_role( LP()->teacher_role );
954
  die;
955
  }
956
 
@@ -958,6 +1002,209 @@ if ( !class_exists( 'LP_Admin_Ajax' ) ) {
958
  update_option( '_lpr_ignore_setting_up', 1, true );
959
  die;
960
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
961
  }
962
  }
963
  LP_Admin_Ajax::init();
47
  'update_add_on_status' => false,
48
  'plugin_install' => false,
49
  'bundle_activate_add_ons' => false,
50
+ 'install_sample_data' => false,
51
+ // Duplicate Course
52
+ 'duplicate_course' => false,
53
+ 'duplicate_question' => false
54
  );
55
  foreach ( $ajaxEvents as $ajaxEvent => $nopriv ) {
56
  add_action( 'wp_ajax_learnpress_' . $ajaxEvent, array( __CLASS__, $ajaxEvent ) );
133
  public static function json_search_customer_name( $query ) {
134
  global $wpdb;
135
 
136
+ $term = stripslashes( $_GET['term'] );
137
  if ( method_exists( $wpdb, 'esc_like' ) ) {
138
  $term = $wpdb->esc_like( $term );
139
  } else {
191
  }
192
  break;
193
  case 'lp_question':
194
+ $query = $wpdb->prepare( "
195
+ SELECT question_id
196
+ FROM {$wpdb->prefix}learnpress_quiz_questions
197
+ WHERE %d
198
+ ", 1 );
199
+ $exclude2 = $wpdb->get_col( $query );
200
+ break;
201
 
202
  }
203
  if ( $exclude2 && $exclude ) {
300
  echo '<li>' . apply_filters( 'learn_press_modal_search_items_not_found', __( 'No item found', 'learnpress' ), $type ) . '</li>';
301
  }
302
 
303
+ $item_object = $type ? get_post_type_object( $type ) : '';
304
+ $post_type = $context_id ? get_post_type_object( get_post_type( $context_id ) ) : '';
305
  $response = array(
306
  'html' => ob_get_clean(),
307
  'data' => $found_items,
308
+ 'args' => $args,
309
+ 'notices' => '<div class="learnpress-search-notices notice notice-warning">' . sprintf( '<p><strong>%s</strong>' . __( ' can not assign more than 1 ', 'learnpress' ) . '%s</p>', $item_object->labels->singular_name, $post_type->labels->singular_name ) . '</div>'
310
  );
311
  learn_press_send_json( $response );
312
  }
324
  AND question_id = %d
325
  ", $quiz_id, $question_id );
326
  $wpdb->query( $query );
327
+
328
+ // trigger change user memorize question types
329
+ $user_id = get_current_user_id();
330
+ $type = get_post_meta( $question_id, '_lp_type', true );
331
+ if ( $type ) {
332
+ $question_types = get_user_meta( $user_id, '_learn_press_memorize_question_types', true );
333
+ $question_types = ! $question_types ? array() : $question_types;
334
+ $counter = ! empty ( $question_types[$type] ) && $question_types[$type] ? absint( $question_types[$type] ) : 0;
335
+ $question_types[$type] = $counter ? $counter-- : 0;
336
+ update_user_meta( $user_id, '_learn_press_memorize_question_types', $question_types );
337
+ }
338
+ // end trigger change user memorize question types
339
  die();
340
  }
341
 
345
  $quiz_id = learn_press_get_request( 'quiz_id' );
346
  $user = learn_press_get_current_user();
347
  if ( !$user->is_admin() && get_post_field( 'post_author', $quiz_id ) != get_current_user_id() ) {
348
+ wp_die( __( 'You have no permission to access this section.', 'learnpress' ) );
349
  }
350
  $term = (string) ( stripslashes( learn_press_get_request( 'term' ) ) );
351
  $exclude = array();
402
  ', $id, $question );
403
  }
404
  } else {
405
+ echo '<li>' . __( 'No questions found', 'learnpress' ) . '</li>';
406
  }
407
 
408
  $response = array(
689
  $response['html'] = '<a href="' . get_edit_post_link( $page_id ) . '" target="_blank">' . __( 'Edit Page', 'learnpress' ) . '</a>&nbsp;';
690
  $response['html'] .= '<a href="' . get_permalink( $page_id ) . '" target="_blank">' . __( 'View Page', 'learnpress' ) . '</a>';
691
  } else {
692
+ $response['error'] = __( 'Error! Create page failed. Please try again!', 'learnpress' );
693
  }
694
  } else {
695
+ $response['error'] = __( 'Empty page name!', 'learnpress' );
696
  }
697
  learn_press_send_json( $response );
698
  die();
704
  $quiz_id = learn_press_get_request( 'quiz_id' );
705
  $type = learn_press_get_request( 'type' );
706
  $name = learn_press_get_request( 'name' );
707
+ $user_id = get_current_user_id();
708
  $response = array(
709
  'id' => $id
710
  );
714
  $id = wp_insert_post(
715
  array(
716
  'post_title' => $name,
717
+ 'post_type' => LP_QUESTION_CPT,
718
  'post_status' => 'publish'
719
  )
720
  );
739
  $question = LP_Question_Factory::get_question( $id );
740
  learn_press_admin_view( 'meta-boxes/quiz/question.php', array( 'question' => $question ) );
741
  $response['html'] = ob_get_clean();
742
+
743
+ // trigger change user memorize question types
744
+ $question_types = get_user_meta( $user_id, '_learn_press_memorize_question_types', true );
745
+ $question_types = ! $question_types ? array() : $question_types;
746
+ $type = get_post_meta( $id, '_lp_type', true );
747
+ $question_types[$type] = ! empty ( $question_types[$type] ) ? absint( $question_types[$type] ) + 1 : 1;
748
+ update_user_meta( $user_id, '_learn_press_memorize_question_types', $question_types );
749
+ // end trigger change user memorize question types
750
  }
751
  learn_press_send_json( $response );
752
  die();
759
 
760
  do_action( 'learn_press_convert_question_type', $question_id, $from, $to, $data );
761
  $question = LP_Question_Factory::get_question( $question_id, array( 'type' => $to ) );
762
+
763
+ // trigger change user memorize question types
764
+ $user_id = get_current_user_id();
765
+ $question_types = get_user_meta( $user_id, '_learn_press_memorize_question_types', true );
766
+ $question_types[$from] = ! empty( $question_types[$from] ) && $question_types[$from] ? absint( $question_types[$from] ) - 1 : 0;
767
+ $question_types[$to] = ! empty( $question_types[$to] ) && $question_types[$to] ? absint( $question_types[$to] ) + 1 : 1;
768
+ update_user_meta( $user_id, '_learn_press_memorize_question_types', $question_types );
769
+ // end trigger change user memorize question types
770
+
771
  learn_press_send_json(
772
  array(
773
  'html' => $question->admin_interface( array( 'echo' => false ) ),
775
  )
776
  );
777
  } else {
778
+ //throw new Exception( __( 'Convert question type must be specify the id, source and destination type', 'learnpress' ) );
779
+ throw new Exception( __( 'Something went wrong! Please try again or ask <a href="https://wordpress.org/support/">support forums</a>.', 'learnpress' ) );
780
  }
781
  die();
782
  }
815
  );
816
  $response['url'] = $url = $url . '&' . http_build_query( $postdata ) . "\n";
817
  $response['result'] = 'success';
818
+ $response['message'] = sprintf( '<p>%s <a href="edit.php?post_type=lp_course">%s</a> </p>', __( 'Import sample data successes.', 'learnpress' ), __( 'View courses', 'learnpress' ) );
819
  }
820
  }
821
  if ( $response['result'] == 'fail' ) {
941
 
942
  $new_lesson = array(
943
  'post_title' => wp_strip_all_tags( $lesson_title ),
944
+ 'post_type' => LP_LESSON_CPT,
945
  'post_status' => 'publish'
946
  );
947
 
949
 
950
  $args = array(
951
  'numberposts' => 1,
952
+ 'post_type' => LP_LESSON_CPT,
953
  'post_status' => 'publish'
954
  );
955
  $lesson = wp_get_recent_posts( $args );
970
 
971
  $new_quiz = array(
972
  'post_title' => wp_strip_all_tags( $quiz_title ),
973
+ 'post_type' => LP_QUIZ_CPT,
974
  'post_status' => 'publish'
975
  );
976
 
978
 
979
  $args = array(
980
  'numberposts' => 1,
981
+ 'post_type' => LP_QUIZ_CPT,
982
  'post_status' => 'publish'
983
  );
984
  $quiz = wp_get_recent_posts( $args );
994
  public static function be_teacher() {
995
  $user_id = get_current_user_id();
996
  $be_teacher = new WP_User( $user_id );
997
+ $be_teacher->set_role( LP_TEACHER_ROLE );
998
  die;
999
  }
1000
 
1002
  update_option( '_lpr_ignore_setting_up', 1, true );
1003
  die;
1004
  }
1005
+
1006
+ public static function duplicate_course() {
1007
+ if ( empty( $_POST['course_id'] ) || empty( $_POST['_nonce'] ) || !wp_verify_nonce( $_POST['_nonce'], 'lp-duplicate-course' ) ) {
1008
+ return;
1009
+ }
1010
+ global $wpdb;
1011
+ $course_id = absint( $_POST['course_id'] );
1012
+ $duplicate_content = ! empty( $_POST['content'] ) && $_POST['content'] ? true : false;
1013
+ if ( !function_exists( '_learn_press_get_course_curriculum' ) ) {
1014
+ require_once LP_PLUGIN_PATH . 'inc/lp-init.php';
1015
+ }
1016
+ $results = array(
1017
+ 'redirect' => admin_url( 'edit.php?post_type=' . LP_COURSE_CPT )
1018
+ );
1019
+
1020
+ if ( $course_id && is_array( $course_id ) ) {
1021
+ $course_id = array_shift( $course_id );
1022
+ }
1023
+ // check for post is exists
1024
+ if ( ! $course_id || ! ( $post = get_post( $course_id ) ) ) {
1025
+ LP_Admin_Notice::add_redirect( __( '<p>Op! The course does not exists</p>', 'learnpress' ), 'error' );
1026
+ } else {
1027
+ // ensure that user can create course
1028
+ if ( !current_user_can( 'edit_posts' ) ) {
1029
+ LP_Admin_Notice::add_redirect( __( '<p>Sorry! You have not permission to duplicate this course</p>', 'learnpress' ), 'error' );
1030
+ } else {
1031
+ // duplicate course
1032
+ $new_course_id = learn_press_duplicate_post( $course_id );
1033
+ if ( ! $new_course_id || is_wp_error( $new_course_id ) ) {
1034
+ LP_Admin_Notice::add_redirect( __( '<p>Sorry! Duplicate course failed!</p>', 'learnpress' ), 'error' );
1035
+ } else {
1036
+ $curriculums = _learn_press_get_course_curriculum( $course_id );
1037
+ foreach ( $curriculums as $section_id => $section ) {
1038
+ $new_section_id = learn_press_course_insert_section( array(
1039
+ 'section_name' => $section->section_name,
1040
+ 'section_course_id' => $new_course_id,
1041
+ 'section_order' => $section->section_order,
1042
+ 'section_description' => $section->section_description
1043
+ ) );
1044
+
1045
+ if ( $section->items ) {
1046
+ foreach ( $section->items as $item ) {
1047
+ // duplicate item
1048
+ $item_id = learn_press_duplicate_post( $item->ID, array( 'post_status' => 'publish' ), $meta = true );
1049
+ if ( $duplicate_content ) {
1050
+ $section_item_id = learn_press_course_insert_section_item( array(
1051
+ 'section_id' => $new_section_id,
1052
+ 'item_id' => $item_id,
1053
+ 'item_order' => $item->item_order,
1054
+ 'item_type' => $item->item_type
1055
+ ) );
1056
+ if ( $item->post_type === LP_QUIZ_CPT ) {
1057
+ // $questions = _learn_press_get_quiz_questions( $item->ID );
1058
+ $quiz = LP_Quiz::get_quiz( $item->ID );
1059
+ $questions = $quiz->get_questions();
1060
+ if ( $questions ) {
1061
+ $questions = array_keys( $questions );
1062
+ foreach ( $questions as $question_id ) {
1063
+ $new_question_id = learn_press_duplicate_post( $question_id );
1064
+ // learnpress_quiz_questions
1065
+ $sql = $wpdb->prepare( "
1066
+ SELECT * FROM $wpdb->learnpress_quiz_questions WHERE quiz_id = %d AND question_id = %d
1067
+ ", $item->ID, $question_id );
1068
+ $quiz_question_data = $wpdb->get_row( $sql );
1069
+ if ( $quiz_question_data ) {
1070
+ $wpdb->insert(
1071
+ $wpdb->learnpress_quiz_questions,
1072
+ array(
1073
+ 'quiz_id' => $item_id,
1074
+ 'question_id' => $new_question_id,
1075
+ 'question_order' => $quiz_question_data->question_order,
1076
+ 'params' => $quiz_question_data->params
1077
+ ),
1078
+ array(
1079
+ '%d',
1080
+ '%d',
1081
+ '%d',
1082
+ '%s'
1083
+ )
1084
+ );
1085
+ }
1086
+ // learnpress_question_answers
1087
+ $sql = $wpdb->prepare( "
1088
+ SELECT * FROM $wpdb->learnpress_question_answers WHERE question_id = %d
1089
+ ", $question_id );
1090
+ $question_answers = $wpdb->get_results( $sql );
1091
+ if ( $question_answers ) {
1092
+ foreach ( $question_answers as $q_a ) {
1093
+ $wpdb->insert(
1094
+ $wpdb->learnpress_question_answers,
1095
+ array(
1096
+ 'question_id' => $new_question_id,
1097
+ 'answer_data' => $q_a->answer_data,
1098
+ 'answer_order' => $q_a->answer_order
1099
+ ),
1100
+ array(
1101
+ '%d',
1102
+ '%s',
1103
+ '%s'
1104
+ )
1105
+ );
1106
+ }
1107
+ }
1108
+ }
1109
+ }
1110
+ }
1111
+ }
1112
+ }
1113
+ }
1114
+ }
1115
+ LP_Admin_Notice::add_redirect( sprintf( '<strong>%s</strong> %s', get_the_title( $course_id ), __( ' course has duplicated', 'learnpress' ) ), 'updated' );
1116
+ $results['redirect'] = admin_url( 'post.php?post=' . $new_course_id . '&action=edit' );
1117
+ }
1118
+ }
1119
+ }
1120
+
1121
+ wp_send_json( $results ); die();
1122
+ }
1123
+
1124
+ public static function duplicate_question() {
1125
+ if ( empty( $_POST['_nonce'] ) || !wp_verify_nonce( $_POST['_nonce'], 'duplicate-question' ) ) {
1126
+ return;
1127
+ }
1128
+ global $wpdb;
1129
+ $question_id = learn_press_get_request( 'question-id' );
1130
+ $quiz_id = learn_press_get_request( 'quiz-id' );
1131
+ $new_question_id = learn_press_duplicate_post( $question_id );
1132
+ // learnpress_quiz_questions
1133
+ $sql = $wpdb->prepare( "
1134
+ SELECT * FROM $wpdb->learnpress_quiz_questions WHERE quiz_id = %d AND question_id = %d
1135
+ ", $quiz_id, $question_id );
1136
+ $quiz_question_data = $wpdb->get_row( $sql );
1137
+ $max_order = $wpdb->get_var( $wpdb->prepare( "SELECT max(question_order) FROM {$wpdb->prefix}learnpress_quiz_questions WHERE quiz_id = %d", $quiz_id ) );
1138
+
1139
+ if ( $quiz_question_data ) {
1140
+ $wpdb->insert(
1141
+ $wpdb->learnpress_quiz_questions,
1142
+ array(
1143
+ 'quiz_id' => $quiz_id,
1144
+ 'question_id' => $new_question_id,
1145
+ 'question_order' => $max_order + 1,
1146
+ 'params' => $quiz_question_data->params
1147
+ ),
1148
+ array(
1149
+ '%d',
1150
+ '%d',
1151
+ '%d',
1152
+ '%s'
1153
+ )
1154
+ );
1155
+ }
1156
+ // learnpress_question_answers
1157
+ $sql = $wpdb->prepare( "
1158
+ SELECT * FROM $wpdb->learnpress_question_answers WHERE question_id = %d
1159
+ ", $question_id );
1160
+ $question_answers = $wpdb->get_results( $sql );
1161
+ if ( $question_answers ) {
1162
+ foreach ( $question_answers as $q_a ) {
1163
+ $wpdb->insert(
1164
+ $wpdb->learnpress_question_answers,
1165
+ array(
1166
+ 'question_id' => $new_question_id,
1167
+ 'answer_data' => $q_a->answer_data,
1168
+ 'answer_order' => $q_a->answer_order
1169
+ ),
1170
+ array(
1171
+ '%d',
1172
+ '%s',
1173
+ '%s'
1174
+ )
1175
+ );
1176
+ }
1177
+ }
1178
+ if ( $new_question_id && $quiz_id ) {
1179
+ $max_order = $wpdb->get_var( $wpdb->prepare( "SELECT max(question_order) FROM {$wpdb->prefix}learnpress_quiz_questions WHERE quiz_id = %d", $quiz_id ) );
1180
+ $wpdb->insert(
1181
+ $wpdb->prefix . 'learnpress_quiz_questions',
1182
+ array(
1183
+ 'quiz_id' => $quiz_id,
1184
+ 'question_id' => $new_question_id,
1185
+ 'question_order' => $max_order + 1
1186
+ ),
1187
+ array( '%d', '%d', '%d' )
1188
+ );
1189
+ ob_start();
1190
+ $question = LP_Question_Factory::get_question( $new_question_id );
1191
+ $post = get_post( $quiz_id );
1192
+ setup_postdata( $post );
1193
+ _learn_press_setup_question( $new_question_id );
1194
+ learn_press_admin_view( 'meta-boxes/quiz/question.php', array( 'question' => $question ) );
1195
+ $response['html'] = ob_get_clean();
1196
+
1197
+ // trigger change user memorize question types
1198
+ $question_types = get_user_meta( $user_id, '_learn_press_memorize_question_types', true );
1199
+ $question_types = ! $question_types ? array() : $question_types;
1200
+ $type = get_post_meta( $new_question_id, '_lp_type', true );
1201
+ $question_types[$type] = ! empty ( $question_types[$type] ) ? absint( $question_types[$type] ) + 1 : 1;
1202
+ update_user_meta( $user_id, '_learn_press_memorize_question_types', $question_types );
1203
+ // end trigger change user memorize question types
1204
+ }
1205
+ learn_press_send_json( $response );
1206
+ die();
1207
+ }
1208
  }
1209
  }
1210
  LP_Admin_Ajax::init();
inc/admin/class-lp-admin-assets.php DELETED
@@ -1,55 +0,0 @@
1
- <?php
2
- /**
3
- * Class LP_Assets
4
- *
5
- * @author ThimPress
6
- * @package LearnPress/Classes
7
- * @version 1.0
8
- * @extends LP_Abstract_Assets
9
- */
10
-
11
- if ( !defined( 'ABSPATH' ) ) {
12
- exit; // Exit if accessed directly
13
- }
14
-
15
- learn_press_include( 'abstracts/abstract-lp-assets.php' );
16
- class LP_Admin_Assets extends LP_Abstract_Assets {
17
-
18
- public static function init() {
19
- parent::$caller = __CLASS__;
20
- add_action( 'learn_press_print_assets', array( __CLASS__, '_print_assets' ) );
21
- parent::init();
22
- }
23
- /**
24
- * Load assets for admin
25
- */
26
- public static function load_scripts() {
27
- $screen = get_current_screen();
28
- $screen_id = $screen->id;
29
- $page_id = !empty( $_REQUEST['page'] ) ? $_REQUEST['page'] : '';
30
- if( in_array( $screen_id, learn_press_get_screens() ) || in_array( $page_id, learn_press_get_admin_pages() ) ) {
31
- self::add_style( 'learn-press-global', learn_press_plugin_url( 'assets/css/global-style.css' ) );
32
- self::add_style( 'learn-press-admin', learn_press_plugin_url( 'assets/css/admin/admin.css' ), array( 'learn-press-global' ) );
33
- self::add_style( 'learn-press-icons', learn_press_plugin_url( 'assets/css/icons.css' ) );
34
-
35
- //self::add_script( 'learn-press-ui', learn_press_plugin_url( 'assets/js/ui.js' ) );
36
- self::add_script( 'learn-press-admin', learn_press_plugin_url( 'assets/js/admin/admin.js' ) );
37
- self::add_script( 'modal-search-items', learn_press_plugin_url( 'assets/js/admin/modal-search-items.js' ), array( 'jquery' ) );
38
- }
39
- if( in_array( $screen_id, array( 'lp_order', 'order', 'edit-lp_order' ) ) ){
40
- self::add_style( 'learn-press-order', learn_press_plugin_url( 'assets/css/admin/meta-box-order.css' ) );
41
- self::add_script( 'learn-press-order', learn_press_plugin_url( 'assets/js/admin/meta-box-order.js' ), array( 'backbone', 'wp-util' ) );
42
- }
43
- }
44
-
45
- public static function _print_assets() {
46
- self::enqueue_style( 'learn-press-icons' );
47
- self::enqueue_style( 'learn-press-admin' );
48
-
49
- self::enqueue_style( 'learn-press-order' );
50
- self::enqueue_script( 'learn-press-order' );
51
-
52
- self::enqueue_script( 'learn-press-admin' );
53
- }
54
- }
55
- LP_Admin_Assets::init();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/admin/class-lp-admin-menu.php CHANGED
@@ -46,7 +46,7 @@ class LP_Admin_Menu {
46
  * Register for menu for admin
47
  */
48
  public function admin_menu() {
49
- $capacity = 'edit_' . LP()->course_post_type . 's';
50
  add_menu_page(
51
  __( 'Learning Management System', 'learnpress' ),
52
  __( 'LearnPress', 'learnpress' ),
@@ -66,14 +66,6 @@ class LP_Admin_Menu {
66
  'learn_press_statistics',
67
  array( $this, 'menu_page' )
68
  ),
69
- 'settings' => array(
70
- 'options-general.php',
71
- __( 'LearnPress Settings', 'learnpress' ),
72
- __( 'LearnPress', 'learnpress' ),
73
- 'manage_options',
74
- 'learn_press_settings',
75
- 'learn_press_settings_page'
76
- ),
77
  'addons' => array(
78
  'learn_press',
79
  __( 'Add-ons', 'learnpress' ),
@@ -81,6 +73,22 @@ class LP_Admin_Menu {
81
  'manage_options',
82
  'learn_press_add_ons',
83
  'learn_press_add_ons_page'
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
84
  )
85
  );
86
 
@@ -91,7 +99,7 @@ class LP_Admin_Menu {
91
  call_user_func_array( 'add_submenu_page', $item );
92
  }
93
 
94
- add_submenu_page( 'tools.php', __( 'Database tools', 'learnpress' ), __( 'LearnPress', 'learnpress' ), 'manage_options', 'learn_press_tools', 'learn_press_tools_page' );
95
  }
96
 
97
  /*
@@ -103,7 +111,7 @@ class LP_Admin_Menu {
103
  if ( !in_array( 'administrator', $current_user->roles ) ) {
104
  return;
105
  }
106
- $count_courses = wp_count_posts( LP()->course_post_type );
107
  $awaiting_mod = $count_courses->pending;
108
  $menu['3.14'][0] .= " <span class='awaiting-mod count-$awaiting_mod'><span class='pending-count'>" . number_format_i18n( $awaiting_mod ) . "</span></span>";
109
  }
46
  * Register for menu for admin
47
  */
48
  public function admin_menu() {
49
+ $capacity = 'edit_' . LP_COURSE_CPT . 's';
50
  add_menu_page(
51
  __( 'Learning Management System', 'learnpress' ),
52
  __( 'LearnPress', 'learnpress' ),
66
  'learn_press_statistics',
67
  array( $this, 'menu_page' )
68
  ),
 
 
 
 
 
 
 
 
69
  'addons' => array(
70
  'learn_press',
71
  __( 'Add-ons', 'learnpress' ),
73
  'manage_options',
74
  'learn_press_add_ons',
75
  'learn_press_add_ons_page'
76
+ ),
77
+ 'settings' => array(
78
+ 'learn_press',
79
+ __( 'Settings', 'learnpress' ),
80
+ __( 'Settings', 'learnpress' ),
81
+ 'manage_options',
82
+ 'learn_press_settings',
83
+ 'learn_press_settings_page'
84
+ ),
85
+ 'tools' => array(
86
+ 'learn_press',
87
+ __( 'Tools', 'learnpress' ),
88
+ __( 'Tools', 'learnpress' ),
89
+ 'manage_options',
90
+ 'learn_press_tools',
91
+ 'learn_press_tools_page'
92
  )
93
  );
94
 
99
  call_user_func_array( 'add_submenu_page', $item );
100
  }
101
 
102
+ //add_submenu_page( 'tools.php', __( 'Database tools', 'learnpress' ), __( 'LearnPress', 'learnpress' ), 'manage_options', 'learn_press_tools', 'learn_press_tools_page' );
103
  }
104
 
105
  /*
111
  if ( !in_array( 'administrator', $current_user->roles ) ) {
112
  return;
113
  }
114
+ $count_courses = wp_count_posts( LP_COURSE_CPT );
115
  $awaiting_mod = $count_courses->pending;
116
  $menu['3.14'][0] .= " <span class='awaiting-mod count-$awaiting_mod'><span class='pending-count'>" . number_format_i18n( $awaiting_mod ) . "</span></span>";
117
  }
inc/admin/class-lp-admin-notice.php CHANGED
@@ -35,7 +35,7 @@ class LP_Admin_Notice {
35
  * @param string $id Custom id for html element's ID
36
  * @param bool
37
  */
38
- public static function add( $message, $type = 'updated', $id = '', $redirect = false ) {
39
  if ( $redirect ) {
40
  $notices = get_transient( 'learn_press_redirect_notices' );
41
  if ( empty( $notices ) ) {
35
  * @param string $id Custom id for html element's ID
36
  * @param bool
37
  */
38
+ public static function add( $message, $type = 'success', $id = '', $redirect = false ) {
39
  if ( $redirect ) {
40
  $notices = get_transient( 'learn_press_redirect_notices' );
41
  if ( empty( $notices ) ) {
inc/admin/class-lp-admin-settings.php CHANGED
@@ -180,13 +180,7 @@ class LP_Admin_Settings {
180
  update_option( $this->_key, $this->_options );
181
  }
182
 
183
- /**
184
- * Unique an instance of the class by the key of the options want to initial
185
- *
186
- * @param $key
187
- *
188
- * @return mixed
189
- */
190
  public static function instance( $key ) {
191
  static $instances = array();
192
  $key = '_lpr_settings_' . $key;
@@ -194,11 +188,5 @@ class LP_Admin_Settings {
194
  $instances[$key] = new LP_Admin_Settings( $key );
195
  }
196
  return $instances[$key];
197
- }
198
- }
199
-
200
- if ( !function_exists( 'learn_press_admin_settings' ) ) {
201
- function learn_press_admin_settings( $key ) {
202
- return LP_Admin_Settings::instance( $key );
203
- }
204
  }
180
  update_option( $this->_key, $this->_options );
181
  }
182
 
183
+ /*** XXXXXXXXXXXXXXXXXXXX
 
 
 
 
 
 
184
  public static function instance( $key ) {
185
  static $instances = array();
186
  $key = '_lpr_settings_' . $key;
188
  $instances[$key] = new LP_Admin_Settings( $key );
189
  }
190
  return $instances[$key];
191
+ }*/
 
 
 
 
 
 
192
  }
inc/admin/class-lp-admin.php CHANGED
@@ -19,8 +19,61 @@ if ( !class_exists( 'LP_Admin' ) ) {
19
  public function __construct() {
20
  $this->includes();
21
  add_action( 'admin_print_scripts', array( $this, 'plugin_js_settings' ) );
22
- //add_action( 'init', array( $this, 'include_update' ) );
23
  add_action( 'template_redirect', array( $this, '_redirect' ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  }
25
 
26
  /**
@@ -42,9 +95,9 @@ if ( !class_exists( 'LP_Admin' ) ) {
42
  'button_no' => __( 'No', 'learnpress' )
43
  )
44
  );
45
- echo '<script type="text/javascript">var LearnPress_Settings = ' . json_encode( $js ) . '</script>';
46
- if( LP_Settings::instance()->get('debug') == 'yes' ){
47
- echo '<script type="text/javascript">var LEARN_PRESS_DEBUG = true;</script>';
48
  }
49
  $did = true;
50
  }
@@ -75,6 +128,8 @@ if ( !class_exists( 'LP_Admin' ) ) {
75
  public function includes() {
76
  // Common function used in admin
77
  include_once( 'lp-admin-functions.php' );
 
 
78
  //Ajax Class
79
  include_once( 'class-lp-admin-ajax.php' );
80
  // Admin menu
@@ -83,5 +138,6 @@ if ( !class_exists( 'LP_Admin' ) ) {
83
 
84
  }
85
  }
 
86
  new LP_Admin();
87
  }
19
  public function __construct() {
20
  $this->includes();
21
  add_action( 'admin_print_scripts', array( $this, 'plugin_js_settings' ) );
 
22
  add_action( 'template_redirect', array( $this, '_redirect' ) );
23
+ add_action( 'delete_user', array( $this, 'delete_user_data' ) );
24
+ add_action( 'delete_user_form', array( $this, 'delete_user_form' ) );
25
+ add_action( 'wp_ajax_learn_press_rated', array( $this, 'rated' ) );
26
+ add_filter( 'admin_footer_text', array( $this, 'admin_footer_text' ), 1 );
27
+ if ( !get_option( 'permalink_structure' ) ) {
28
+ learn_press_add_notice( sprintf( __( 'LearnPress requires permalink option <strong>Post name</strong> is enabled. Please enable it <a href="%s">here</a> to ensure that all functions work properly.', 'learnpress' ), admin_url( 'options-permalink.php' ) ), 'error' );
29
+ }
30
+ }
31
+
32
+ public function rated() {
33
+ update_option( 'learn_press_message_user_rated', 'yes' );
34
+ die();
35
+ }
36
+
37
+ public function admin_footer_text( $footer_text ) {
38
+ $current_screen = get_current_screen();
39
+ $pages = learn_press_get_screens();
40
+ if ( isset( $current_screen->id ) && apply_filters( 'learn_press_display_admin_footer_text', in_array( $current_screen->id, $pages ) ) ) {
41
+ if ( !get_option( 'learn_press_message_user_rated' ) ) {
42
+ $footer_text = sprintf( __( 'If you like <strong>LearnPress</strong> please leave us a %s&#9733;&#9733;&#9733;&#9733;&#9733;%s rating. A huge thanks in advance!', 'learnpress' ), '<a href="https://wordpress.org/support/plugin/learnpress/reviews/?filter=5#postform" target="_blank" class="lp-rating-link" data-rated="' . esc_attr__( 'Thanks :)', 'learnpress' ) . '">', '</a>' );
43
+ ob_start(); ?>
44
+ <script type="text/javascript">
45
+ var $ratingLink = $('a.lp-rating-link').click(function (e) {
46
+ $.ajax({
47
+ url : '<?php echo admin_url( 'admin-ajax.php' );?>',
48
+ data : {
49
+ action: 'learn_press_rated'
50
+ },
51
+ success: function () {
52
+ $ratingLink.parent().html($ratingLink.data('rated'));
53
+ }
54
+ });
55
+ });
56
+ </script>
57
+ <?php
58
+ $code = ob_get_clean();
59
+ LP_Assets::add_script_tag( $code, '__all' );
60
+ } else {
61
+ }
62
+ }
63
+ return $footer_text;
64
+ }
65
+
66
+ function delete_user_form() {
67
+ // What should be displayed here?
68
+ }
69
+
70
+ /**
71
+ * Delete records related user being deleted in other tables
72
+ *
73
+ * @param int $user_id
74
+ */
75
+ function delete_user_data( $user_id ) {
76
+ learn_press_delete_user_data( $user_id );
77
  }
78
 
79
  /**
95
  'button_no' => __( 'No', 'learnpress' )
96
  )
97
  );
98
+ LP_Assets::add_param( $js, false, 'learn-press-global', 'LP_Settings' );
99
+ if ( LP_Settings::instance()->get( 'debug' ) == 'yes' ) {
100
+ LP_Assets::add_var( 'LEARN_PRESS_DEBUG', 'true', '__all' );
101
  }
102
  $did = true;
103
  }
128
  public function includes() {
129
  // Common function used in admin
130
  include_once( 'lp-admin-functions.php' );
131
+ // Admin actions
132
+ include_once( 'lp-admin-actions.php' );
133
  //Ajax Class
134
  include_once( 'class-lp-admin-ajax.php' );
135
  // Admin menu
138
 
139
  }
140
  }
141
+
142
  new LP_Admin();
143
  }
inc/admin/class-lp-email.php CHANGED
@@ -97,4 +97,6 @@ class LP_Email_bakup {
97
 
98
  return wp_mail( $this->to, $this->filter( $this->subject ), stripslashes( $this->message ), $headers );
99
  }
 
 
100
  }
97
 
98
  return wp_mail( $this->to, $this->filter( $this->subject ), stripslashes( $this->message ), $headers );
99
  }
100
+
101
+
102
  }
inc/admin/class-lp-plugin-install-list-table.php CHANGED
@@ -159,7 +159,7 @@ class LP_Plugin_Install_List_Table extends WP_List_Table {
159
 
160
 
161
  public function no_items() {
162
- $message = __( 'No plugins found.', 'learnpress' );
163
 
164
  echo '<div class="no-plugin-results">' . $message . '</div>';
165
  }
159
 
160
 
161
  public function no_items() {
162
+ $message = __( 'No plugin found.', 'learnpress' );
163
 
164
  echo '<div class="no-plugin-results">' . $message . '</div>';
165
  }
inc/admin/class-lp-profile.php CHANGED
@@ -76,12 +76,12 @@ if ( ! class_exists( 'LP_Profile' ) ) {
76
  'tab_id' => 'user_courses',
77
  'tab_name' => __( 'Courses', 'learnpress' ),
78
  'tab_content' => apply_filters( 'learn_press_user_courses_tab_content', $content, $user )
79
- ),
80
  30 => array(
81
  'tab_id' => 'user_quizzes',
82
  'tab_name' => __( 'Quiz Results', 'learnpress' ),
83
  'tab_content' => apply_filters( 'learn_press_user_quizzes_tab_content', $content, $user )
84
- )
85
  ),
86
  $user
87
  );
76
  'tab_id' => 'user_courses',
77
  'tab_name' => __( 'Courses', 'learnpress' ),
78
  'tab_content' => apply_filters( 'learn_press_user_courses_tab_content', $content, $user )
79
+ )/*,
80
  30 => array(
81
  'tab_id' => 'user_quizzes',
82
  'tab_name' => __( 'Quiz Results', 'learnpress' ),
83
  'tab_content' => apply_filters( 'learn_press_user_quizzes_tab_content', $content, $user )
84
+ )*/
85
  ),
86
  $user
87
  );
inc/admin/dashboard-statistics/class-lp-statistic-plugin.php ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ defined( 'ABSPATH' ) || exit();
4
+
5
+ if ( !class_exists( 'LP_Statistic_Plugin' ) ) :
6
+
7
+ class LP_Statistic_Plugin {
8
+
9
+ /**
10
+ * LearnPress statistic layout
11
+ *
12
+ * @since 2.0
13
+ */
14
+ public static function render() {
15
+ $plugins_data = self::get_data();
16
+ if ( ! $plugins_data ) {
17
+ ?>
18
+ <div class="rss-widget">
19
+ <ul>
20
+ <li>
21
+ <p><?php _e( 'No results found', 'learnpress' ) ?></p>
22
+ </li>
23
+ </ul>
24
+ </div>
25
+ <?php
26
+ } else {
27
+ ?>
28
+ <div class="rss-widget">
29
+ <ul>
30
+ <li>
31
+ <a href="<?php echo esc_url( $plugins_data->homepage ) ?>" class="rsswidget" target="_blank"><?php echo esc_html( $plugins_data->name ) ?></a>
32
+ </li>
33
+ <li>
34
+ <?php printf( '<span class="rss-date"><strong>%s</strong></span>: %s', __( 'Downloaded', 'learnpress' ), number_format( $plugins_data->downloaded ) ) ?>
35
+ <?php printf( '<span class="rss-date"><strong>%s</strong></span>: %s', __( 'Active Installed', 'learnpress' ), number_format( $plugins_data->active_installs ) ) ?>
36
+ </li>
37
+ </ul>
38
+ </div>
39
+ <div class="rss-widget">
40
+ <ul>
41
+ <li>
42
+ <div class="rssSummary">
43
+ <?php echo esc_html( $plugins_data->short_description ) ?>
44
+ </div>
45
+ </li>
46
+ </ul>
47
+ </div>
48
+ <ul class="subsubsub">
49
+ <li>
50
+ <?php printf( '<strong>%s</strong>: %s', __( 'Published', 'learnpress' ), date_i18n( get_option( 'date_format' ), strtotime( $plugins_data->added ) ) ) ?> |
51
+ </li>
52
+ <li>
53
+ <?php printf( '<strong>%s</strong>: %s', __( 'Updated', 'learnpress' ), date_i18n( get_option( 'date_format' ), strtotime( $plugins_data->last_updated ) ) ) ?> |
54
+ </li>
55
+ <li>
56
+ <?php printf( '<strong>%s</strong>: %s', __( 'Current Version', 'learnpress' ), $plugins_data->version ) ?>
57
+ </li>
58
+ </ul>
59
+ <?php //var_dump( $plugins_data );
60
+ }
61
+ }
62
+
63
+ /**
64
+ * Get data from wordpress.org
65
+ *
66
+ * @since 2.0
67
+ */
68
+ public static function get_data() {
69
+
70
+ if ( !function_exists( 'plugins_api' ) ) {
71
+ require_once ABSPATH . 'wp-admin/includes/plugin-install.php';
72
+ }
73
+
74
+ if ( false === get_transient( 'learn_press_statistic_plugin' ) ) {
75
+ // get plugin information from wordpress.org
76
+ $api = plugins_api( 'plugin_information', array( 'slug' => 'learnpress', 'fields' => array(
77
+ 'active_installs' => true,
78
+ 'short_description' => true,
79
+ 'description' => true,
80
+ 'ratings' => true
81
+ ) ) );
82
+ set_transient( 'learn_press_statistic_plugin', $api, 12 * HOUR_IN_SECONDS );
83
+ }
84
+
85
+ return apply_filters( 'learn_press_statistic_plugin', get_transient( 'learn_press_statistic_plugin' ) );
86
+ }
87
+
88
+ }
89
+
90
+ endif;
inc/admin/dashboard-statistics/class-lp-statistic-status.php ADDED
@@ -0,0 +1,112 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ defined( 'ABSPATH' ) || exit();
4
+
5
+ if ( !class_exists( 'LP_Statistic_Status' ) ) :
6
+
7
+ class LP_Statistic_Status {
8
+
9
+ /**
10
+ * LearnPress statistic layout
11
+ *
12
+ * @since 2.0
13
+ */
14
+ public static function render() {
15
+ global $lp_order_statuses;
16
+ $eduma_data = self::get_eduma_info( 14058034 );
17
+ // $total_orders = learn_press_get_orders( array( 'post_status' => array_keys( $lp_order_statuses ) ) );
18
+ $specific_statuses = array( 'lp-completed', 'lp-failed', 'lp-on-hold' );
19
+ ?>
20
+ <ul class="learnpress-statistic-status">
21
+ <li class="full-width">
22
+ <a href="#" class="total-raised">
23
+ <span>
24
+ <?php echo _learn_press_total_raised() ?>
25
+ <small><?php _e( 'Total Raised', 'learnpress' ); ?></small>
26
+ </span>
27
+ </a>
28
+ </li>
29
+ <?php foreach ( $specific_statuses as $status ) : $count = count( learn_press_get_orders( array( 'post_status' => $status ) ) ); ?>
30
+ <li>
31
+ <a href="<?php echo esc_url( admin_url( 'edit.php?post_status=' . LP_ORDER_CPT . '&post_type=' . $status ) ); ?>" class="<?php echo esc_attr( $status ) ?>">
32
+ <span><?php printf( translate_nooped_plural( _n_noop( '%d order', '%d orders' ), $count, 'learnpress' ), $count ) ?></span>
33
+ <small><?php printf( '%s', get_post_status_object( $status )->label ) ?></small>
34
+ </a>
35
+ </li>
36
+ <?php endforeach; ?>
37
+ <?php foreach ( $lp_order_statuses as $status => $args ) : if ( in_array( $status, $specific_statuses ) ) continue; $count = count( learn_press_get_orders( array( 'post_status' => $status ) ) ); ?>
38
+ <li class="halp-width">
39
+ <a href="<?php echo esc_url( admin_url( 'edit.php?post_status=' . LP_ORDER_CPT . '&post_type=' . $status ) ); ?>" class="<?php echo esc_attr( $status ) ?>">
40
+ <span><?php printf( translate_nooped_plural( _n_noop( '%d order', '%d orders' ), $count, 'learnpress' ), $count ) ?></span>
41
+ <small><?php printf( '%s', get_post_status_object( $status )->label ) ?></small>
42
+ </a>
43
+ </li>
44
+ <?php endforeach; ?>
45
+ <li class="full-width featured-theme">
46
+ <span><?php _e( 'Featured: ', 'learnpress' ); ?></span>
47
+ <a href="<?php echo esc_url( $eduma_data['item']['url'] ) ?>">
48
+ <?php echo esc_html( $eduma_data['item']['item'] ) ?>
49
+ </a>-
50
+ <span class="price"><?php printf( '%s%s', '$', $eduma_data['item']['cost'] ) ?></span>
51
+ <span><?php _e( 'Created by: ', 'learnpress' ) ?></span>
52
+ <a href="https://thimpress.com/" class="author"><?php echo esc_html( $eduma_data['item']['user'] ); ?></a>
53
+ </li>
54
+ </ul>
55
+ <?php
56
+ }
57
+
58
+ /**
59
+ * @param String $item_id - The ID of an Envato Marketplace item
60
+ * @returns Array - The item informations
61
+ */
62
+ public static function get_eduma_info( $item_id ) {
63
+
64
+ /* Data cache timeout in seconds - It send a new request each hour instead of each page refresh */
65
+ $CACHE_EXPIRATION = 3600;
66
+
67
+ /* Set the transient ID for caching */
68
+ $transient_id = 'learnpress_envato_item_data';
69
+
70
+ /* Get the cached data */
71
+ $cached_item = get_transient( $transient_id );
72
+
73
+ /* Check if the function has to send a new API request */
74
+ if ( !$cached_item || ( $cached_item->item_id != $item_id ) ) {
75
+
76
+ /* Set the API URL, %s will be replaced with the item ID */
77
+ $api_url = "http://marketplace.envato.com/api/edge/item:%s.json";
78
+
79
+ /* Fetch data using the WordPress function wp_remote_get() */
80
+ $response = wp_safe_remote_get( sprintf( $api_url, $item_id ) );
81
+
82
+ /* Check for errors, if there are some errors return false */
83
+ if ( is_wp_error( $response ) or ( wp_remote_retrieve_response_code( $response ) != 200 ) ) {
84
+ return false;
85
+ }
86
+
87
+ /* Transform the JSON string into a PHP array */
88
+ $item_data = json_decode( wp_remote_retrieve_body( $response ), true );
89
+
90
+ /* Check for incorrect data */
91
+ if ( !is_array( $item_data ) ) {
92
+ return false;
93
+ }
94
+ /* Prepare data for caching */
95
+ $data_to_cache = new stdClass();
96
+ $data_to_cache->item_id = $item_id;
97
+ $data_to_cache->item_info = $item_data;
98
+
99
+ /* Set the transient - cache item data */
100
+ set_transient( $transient_id, $data_to_cache, $CACHE_EXPIRATION );
101
+
102
+ /* Return item info array */
103
+ return $item_data;
104
+ }
105
+
106
+ /* If the item is already cached return the cached info */
107
+ return $cached_item->item_info;
108
+ }
109
+
110
+ }
111
+
112
+ endif;
inc/admin/dashboard-statistics/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php // Silence is golden.
inc/admin/includes/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php // Silence is golden.
inc/admin/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php // Silence is golden.
inc/admin/lp-admin-actions.php ADDED
@@ -0,0 +1,135 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Defines the functions which called by hooks
4
+ */
5
+
6
+ /**
7
+ * Filter post types the user can access in admin
8
+ *
9
+ * @param $query
10
+ */
11
+ function _learn_press_set_user_items( $query ) {
12
+ global $post_type, $pagenow, $wpdb;
13
+
14
+ if ( current_user_can( 'manage_options' ) || !current_user_can( LP_TEACHER_ROLE ) || !is_admin() || ( $pagenow != 'edit.php' ) ) {
15
+ return $query;
16
+ }
17
+ if ( !in_array( $post_type, array( 'lp_course', LP_LESSON_CPT, LP_QUIZ_CPT, LP_QUESTION_CPT ) ) ) {
18
+ return;
19
+ }
20
+ $items = $wpdb->get_col(
21
+ $wpdb->prepare(
22
+ "SELECT ID FROM $wpdb->posts
23
+ WHERE post_type = %s
24
+ AND post_author = %d",
25
+ $post_type,
26
+ get_current_user_id()
27
+ )
28
+ );
29
+
30
+ if ( count( $items ) == 0 ) {
31
+ $query->set( 'post_type', 'no-item-access' );
32
+ } else {
33
+ $query->set( 'post__in', $items );
34
+ }
35
+ add_filter( 'views_edit-' . $post_type . '', '_learn_press_restrict_view_items', 10 );
36
+ }
37
+
38
+ add_action( 'pre_get_posts', '_learn_press_set_user_items', 10 );
39
+
40
+ /**
41
+ * Restrict user views
42
+ *
43
+ * @param $views
44
+ *
45
+ * @return mixed
46
+ */
47
+ function _learn_press_restrict_view_items( $views ) {
48
+ $post_type = get_query_var( 'post_type' );
49
+ $new_views = array(
50
+ 'all' => __( 'All', 'learnpress' ),
51
+ 'publish' => __( 'Published', 'learnpress' ),
52
+ 'private' => __( 'Private', 'learnpress' ),
53
+ 'pending' => __( 'Pending Review', 'learnpress' ),
54
+ 'future' => __( 'Scheduled', 'learnpress' ),
55
+ 'draft' => __( 'Draft', 'learnpress' ),
56
+ 'trash' => __( 'Trash', 'learnpress' ),
57
+ );
58
+ $url = 'edit.php';
59
+ foreach ( $new_views as $view => $name ) {
60
+ $query = array(
61
+ 'post_type' => $post_type
62
+ );
63
+ if ( $view == 'all' ) {
64
+ $query['all_posts'] = 1;
65
+ $class = ( get_query_var( 'all_posts' ) == 1 || ( get_query_var( 'post_status' ) == '' && get_query_var( 'author' ) == '' ) ) ? ' class="current"' : '';
66
+ } else {
67
+ $query['post_status'] = $view;
68
+ $class = ( get_query_var( 'post_status' ) == $view ) ? ' class="current"' : '';
69
+ }
70
+ $result = new WP_Query( $query );
71
+ if ( $result->found_posts > 0 ) {
72
+ $views[$view] = sprintf(
73
+ '<a href="%s"' . $class . '>' . __( $name, 'learnpress' ) . ' <span class="count">(%d)</span></a>',
74
+ esc_url( add_query_arg( $query, $url ) ),
75
+ $result->found_posts
76
+ );
77
+ } else {
78
+ unset( $views[$view] );
79
+ }
80
+ }
81
+ // remove view 'mine'
82
+ unset( $views['mine'] );
83
+ return $views;
84
+ }
85
+
86
+ /**
87
+ * Update permalink structure for course
88
+ */
89
+ function learn_press_update_permalink_structure() {
90
+ global $pagenow;
91
+ if ( $pagenow != 'options-permalink.php' ) {
92
+ return;
93
+ }
94
+ if ( strtolower( $_SERVER['REQUEST_METHOD'] ) != 'post' ) {
95
+ return;
96
+ }
97
+ $rewrite_prefix = '';
98
+ $permalink_structure = !empty( $_REQUEST['permalink_structure'] ) ? $_REQUEST['permalink_structure'] : '';
99
+ if ( $permalink_structure ) {
100
+ $segs = explode( '/', $permalink_structure );
101
+ if ( sizeof( $segs ) ) {
102
+ foreach ( $segs as $seg ) {
103
+ if ( strpos( $seg, '%' ) !== false || $seg == 'archives' ) {
104
+ break;
105
+ }
106
+ $rewrite_prefix[] = $seg;
107
+ }
108
+ }
109
+ $rewrite_prefix = array_filter( $rewrite_prefix );
110
+ if ( sizeof( $rewrite_prefix ) ) {
111
+ $rewrite_prefix = join( '/', $rewrite_prefix ) . '/';
112
+ } else {
113
+ $rewrite_prefix = '';
114
+ }
115
+ }
116
+ update_option( 'learn_press_permalink_structure', $rewrite_prefix );
117
+ }
118
+
119
+ add_action( 'init', 'learn_press_update_permalink_structure' );
120
+
121
+ add_action( 'wp_dashboard_setup', 'learnpress_dashboard_widgets' );
122
+
123
+ if ( !function_exists( 'learnpress_dashboard_widgets' ) ) {
124
+ /**
125
+ * Register dashboard widgets
126
+ *
127
+ * LearnPress statistic
128
+ * Eduma statistic
129
+ * @since 2.0
130
+ */
131
+ function learnpress_dashboard_widgets() {
132
+ wp_add_dashboard_widget( 'learn_press_dashboard_widget', __( 'LearnPress Plugin', 'learnpress' ), array( 'LP_Statistic_Plugin', 'render' ) );
133
+ wp_add_dashboard_widget( 'learn_press_dashboard_widget_status', __( 'LearnPress Status', 'learnpress' ), array( 'LP_Statistic_Status', 'render' ) );
134
+ }
135
+ }
inc/admin/lp-admin-functions.php CHANGED
@@ -135,6 +135,73 @@ function learn_press_pages_dropdown( $name, $selected = false, $args = array() )
135
  return $output;
136
  }
137
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
138
 
139
  /**************************************************/
140
  /**************************************************/
@@ -146,10 +213,22 @@ function learn_press_pages_dropdown( $name, $selected = false, $args = array() )
146
  function learn_press_admin_localize_script() {
147
  if ( defined( 'DOING_AJAX' ) || !is_admin() ) return;
148
  $translate = array(
149
- 'quizzes_is_not_available' => __( 'Quiz is not available', 'learnpress' ),
150
- 'lessons_is_not_available' => __( 'Lesson is not available', 'learnpress' )
 
 
 
 
 
 
 
 
 
 
 
 
151
  );
152
- LP_Admin_Assets::add_localize( $translate );
153
  }
154
 
155
  add_action( 'init', 'learn_press_admin_localize_script' );
@@ -200,7 +279,7 @@ function learn_press_get_order_by_time( $by, $time ) {
200
  AND m.meta_key = %s
201
  AND m.meta_value = %s
202
  AND YEAR(p.post_date) = %s AND MONTH(p.post_date) = %s AND DAY(p.post_date) = %s",
203
- $user_id, LP()->order_post_type, 'publish', '_learn_press_transaction_status', 'completed', $y, $m, $d
204
  )
205
  );
206
  break;
@@ -216,7 +295,7 @@ function learn_press_get_order_by_time( $by, $time ) {
216
  AND m.meta_key = %s
217
  AND m.meta_value = %s
218
  AND YEAR(p.post_date) = %s AND MONTH(p.post_date) = %s",
219
- $user_id, LP()->order_post_type, 'publish', '_learn_press_transaction_status', 'completed', $y, $m
220
  )
221
  );
222
  break;
@@ -241,7 +320,7 @@ function learn_press_get_courses_by_status( $status ) {
241
  WHERE post_author = %d
242
  AND post_type = %s
243
  AND post_status = %s",
244
- $user_id, LP()->course_post_type, $status
245
  )
246
  );
247
  return $courses;
@@ -267,7 +346,7 @@ function learn_press_get_courses_by_price( $fee ) {
267
  AND p.post_status IN (%s, %s)
268
  AND m.meta_key = %s
269
  AND m.meta_value = %s",
270
- $user_id, LP()->course_post_type, 'publish', 'pending', '_lpr_course_payment', $fee
271
  )
272
  );
273
  return $courses;
@@ -845,7 +924,7 @@ function set_post_order_in_admin( $wp_query ) {
845
  if ( isset( $_GET['post_type'] ) ) {
846
  $post_type = $_GET['post_type'];
847
  } else $post_type = '';
848
- if ( is_admin() && 'edit.php' == $pagenow && $post_type == LP()->course_post_type && !isset( $_GET['orderby'] ) ) {
849
  $wp_query->set( 'orderby', 'date' );
850
  $wp_query->set( 'order', 'DSC' );
851
  }
@@ -861,13 +940,13 @@ add_filter( 'pre_get_posts', 'set_post_order_in_admin' );
861
  */
862
  function learn_press_add_row_action_link( $actions ) {
863
  global $post;
864
- if ( LP()->course_post_type == $post->post_type ) {
865
  $duplicate_link = admin_url( 'edit.php?post_type=lp_course&action=lp-duplicate-course&post=' . $post->ID . '&nonce=' . wp_create_nonce( 'lp-duplicate-' . $post->ID ) );
866
  $duplicate_link = array(
867
  array(
868
  'link' => $duplicate_link,
869
  'title' => __( 'Duplicate this course', 'learnpress' ),
870
- 'class' => ''
871
  )
872
  );
873
  $links = apply_filters( 'learn_press_row_action_links', $duplicate_link );
@@ -920,7 +999,7 @@ function learn_press_process_duplicate_action() {
920
  $wp_list_table = _get_list_table( 'WP_Posts_List_Table' );
921
  $action = $wp_list_table->current_action();
922
 
923
- if ( isset( $_REQUEST['action'] ) && ( $action = $_REQUEST['action'] ) == 'lp-duplicate-course' ) {
924
  $post_id = isset( $_REQUEST['post'] ) ? $_REQUEST['post'] : 0;
925
  $nonce = !empty( $_REQUEST['nonce'] ) ? $_REQUEST['nonce'] : '';
926
  if ( !wp_verify_nonce( $nonce, 'lp-duplicate-' . $post_id ) ) {
@@ -931,11 +1010,11 @@ function learn_press_process_duplicate_action() {
931
  }
932
  // check for post is exists
933
  if ( !( $post_id && $post = get_post( $post_id ) ) ) {
934
- wp_die( __( 'Op! The course does not exists', 'learnpress' ) );
935
  }
936
  // ensure that user can create course
937
  if ( !current_user_can( 'edit_posts' ) ) {
938
- wp_die( __( 'Sorry! You have not permission to duplicate this course', 'learnpress' ) );
939
  }
940
 
941
  // assign course to current user
@@ -964,7 +1043,7 @@ function learn_press_process_duplicate_action() {
964
  $new_post_id = wp_insert_post( $args );
965
 
966
  if ( !$new_post_id ) {
967
- LP_Admin_Notice::add_redirect( __( '<p>Sorry! Duplicate the course failed!</p>', 'learnpress' ) );
968
  wp_redirect( admin_url( 'edit.php?post_type=lp_course' ) );
969
  exit();
970
  }
@@ -1104,7 +1183,7 @@ function learn_press_accept_become_a_teacher() {
1104
 
1105
  if ( !learn_press_user_maybe_is_a_teacher( $user_id ) ) {
1106
  $be_teacher = new WP_User( $user_id );
1107
- $be_teacher->set_role( LP()->teacher_role );
1108
  delete_transient( 'learn_press_become_teacher_sent_' . $user_id );
1109
  do_action( 'learn_press_user_become_a_teacher', $user_id );
1110
  $redirect = add_query_arg( 'become-a-teacher-accepted', 'yes' );
@@ -1160,7 +1239,7 @@ function learn_press_plugin_basename_from_slug( $slug ) {
1160
  function learn_press_one_click_install_sample_data_notice() {
1161
  $courses = get_posts(
1162
  array(
1163
- 'post_type' => LP()->course_post_type,
1164
  'post_status' => 'any'
1165
  )
1166
  );
@@ -1177,7 +1256,7 @@ function learn_press_one_click_install_sample_data_notice() {
1177
  </div>
1178
  </div>',
1179
  __( 'You haven\'t got any courses yet! Would you like to import sample data?', 'learnpress' ),
1180
- __( 'If yes, it requires to install addon named', 'learnpress' ),
1181
  __( 'LearnPress Import/Export', 'learnpress' ),
1182
  __( 'but don\'t worry because it is completely automated.', 'learnpress' ),
1183
  __( 'Import now', 'learnpress' ),
@@ -1190,7 +1269,7 @@ function learn_press_one_click_install_sample_data_notice() {
1190
 
1191
  function learn_press_request_query( $vars = array() ) {
1192
  global $typenow, $wp_query, $wp_post_statuses;
1193
- if ( LP()->order_post_type === $typenow ) {
1194
  // Status
1195
  if ( !isset( $vars['post_status'] ) ) {
1196
  $post_statuses = learn_press_get_order_statuses();
@@ -1267,7 +1346,7 @@ function learn_press_get_screens() {
1267
  $screen_id . '_page_learn_press_statistics',
1268
  $screen_id . '_page_learn_press_add_ons'
1269
  );
1270
- foreach ( array( 'lp_course', 'lp_lesson', 'lp_quiz', 'lp_lesson', 'lp_order' ) as $post_type ) {
1271
  $screens[] = 'edit-' . $post_type;
1272
  $screens[] = $post_type;
1273
  }
@@ -1284,9 +1363,183 @@ function learn_press_get_admin_pages() {
1284
  );
1285
  }
1286
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1287
  function learn_press_get_notice_dismiss( $context, $type = 'transient' ) {
1288
  if ( $type == 'transient' ) {
1289
  return get_transient( 'learn_press_dismiss_notice_' . $context );
1290
  }
1291
  return get_option( 'learn_press_dismiss_notice_' . $context );
1292
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
135
  return $output;
136
  }
137
 
138
+ /**
139
+ * List all registered question types into dropdown
140
+ *
141
+ * @param array
142
+ *
143
+ * @return string
144
+ */
145
+ function learn_press_dropdown_question_types( $args = array() ) {
146
+ $args = wp_parse_args(
147
+ $args,
148
+ array(
149
+ 'name' => 'learn-press-dropdown-question-types',
150
+ 'id' => '',
151
+ 'class' => '',
152
+ 'selected' => '',
153
+ 'echo' => true
154
+ )
155
+ );
156
+ if ( !$args['id'] ) {
157
+ $args['id'] = $args['name'];
158
+ }
159
+ $args['class'] = 'lp-dropdown-question-types' . ( $args['class'] ? ' ' . $args['class'] : '' );
160
+ $types = learn_press_question_types();
161
+ $output = sprintf( '<select name="%s" id="%s" class="%s"%s>', $args['name'], $args['id'], $args['class'], $args['selected'] ? 'data-selected="' . $args['selected'] . '"' : '' );
162
+ foreach ( $types as $slug => $name ) {
163
+ $output .= sprintf( '<option value="%s"%s>%s</option>', $slug, selected( $slug == $args['selected'], true, false ), $name );
164
+ }
165
+ $output .= '</select>';
166
+ if ( $args['echo'] ) {
167
+ echo $output;
168
+ }
169
+ return $output;
170
+ }
171
+
172
+ /**
173
+ * Displays email formats support into a dropdown
174
+ *
175
+ * @param array $args
176
+ *
177
+ * @return string
178
+ */
179
+ function learn_press_email_formats_dropdown( $args = array() ) {
180
+ $args = wp_parse_args(
181
+ $args,
182
+ array(
183
+ 'name' => 'learn-press-dropdown-email-formats',
184
+ 'id' => '',
185
+ 'class' => '',
186
+ 'selected' => '',
187
+ 'echo' => true
188
+ )
189
+ );
190
+ $formats = array(
191
+ //'text_message' => __( 'Text message', 'learnpress' ),
192
+ 'plain_text' => __( 'Plain text', 'learnpress' ),
193
+ 'html' => __( 'HTML', 'learnpress' ),
194
+ //'multipart' => __( 'Multipart', 'learnpress' )
195
+ );
196
+ $output = sprintf( '<select name="%s" id="%s" class="%s" %s>', $args['name'], $args['id'], $args['class'], '' );
197
+ foreach ( $formats as $name => $text ) {
198
+ $output .= sprintf( '<option value="%s" %s>%s</option>', $name, selected( $args['selected'] == $name, true, false ), $text ) . "\n";
199
+ }
200
+ $output .= '</select>';
201
+
202
+ if ( $args['echo'] ) echo $output;
203
+ return $output;
204
+ }
205
 
206
  /**************************************************/
207
  /**************************************************/
213
  function learn_press_admin_localize_script() {
214
  if ( defined( 'DOING_AJAX' ) || !is_admin() ) return;
215
  $translate = array(
216
+ 'quizzes_is_not_available' => __( 'Quiz is not available', 'learnpress' ),
217
+ 'lessons_is_not_available' => __( 'Lesson is not available', 'learnpress' ),
218
+ 'duplicate_course' => array(
219
+ 'title' => __( 'Duplicate course', 'learnpress' ),
220
+ 'message' => __( 'Duplicate course curriculum?', 'learnpress' )
221
+ ),
222
+ 'duplicate_question' => array(
223
+ 'title' => __( 'Duplicate Question', 'learnpress' ),
224
+ 'message' => __( 'Do you want to duplicate this question?', 'learnpress' )
225
+ ),
226
+ 'remove_question' => __( 'Do you want to remove this question from quiz?', 'learnpress' ),
227
+ 'nonces' => array(
228
+ 'duplicate_question' => wp_create_nonce( 'duplicate-question' )
229
+ )
230
  );
231
+ LP_Assets::add_localize( $translate );
232
  }
233
 
234
  add_action( 'init', 'learn_press_admin_localize_script' );
279
  AND m.meta_key = %s
280
  AND m.meta_value = %s
281
  AND YEAR(p.post_date) = %s AND MONTH(p.post_date) = %s AND DAY(p.post_date) = %s",
282
+ $user_id, LP_ORDER_CPT, 'publish', '_learn_press_transaction_status', 'completed', $y, $m, $d
283
  )
284
  );
285
  break;
295
  AND m.meta_key = %s
296
  AND m.meta_value = %s
297
  AND YEAR(p.post_date) = %s AND MONTH(p.post_date) = %s",
298
+ $user_id, LP_ORDER_CPT, 'publish', '_learn_press_transaction_status', 'completed', $y, $m
299
  )
300
  );
301
  break;
320
  WHERE post_author = %d
321
  AND post_type = %s
322
  AND post_status = %s",
323
+ $user_id, LP_COURSE_CPT, $status
324
  )
325
  );
326
  return $courses;
346
  AND p.post_status IN (%s, %s)
347
  AND m.meta_key = %s
348
  AND m.meta_value = %s",
349
+ $user_id, LP_COURSE_CPT, 'publish', 'pending', '_lpr_course_payment', $fee
350
  )
351
  );
352
  return $courses;
924
  if ( isset( $_GET['post_type'] ) ) {
925
  $post_type = $_GET['post_type'];
926
  } else $post_type = '';
927
+ if ( is_admin() && 'edit.php' == $pagenow && $post_type == LP_COURSE_CPT && !isset( $_GET['orderby'] ) ) {
928
  $wp_query->set( 'orderby', 'date' );
929
  $wp_query->set( 'order', 'DSC' );
930
  }
940
  */
941
  function learn_press_add_row_action_link( $actions ) {
942
  global $post;
943
+ if ( LP_COURSE_CPT == $post->post_type ) {
944
  $duplicate_link = admin_url( 'edit.php?post_type=lp_course&action=lp-duplicate-course&post=' . $post->ID . '&nonce=' . wp_create_nonce( 'lp-duplicate-' . $post->ID ) );
945
  $duplicate_link = array(
946
  array(
947
  'link' => $duplicate_link,
948
  'title' => __( 'Duplicate this course', 'learnpress' ),
949
+ 'class' => 'lp-duplicate-course'
950
  )
951
  );
952
  $links = apply_filters( 'learn_press_row_action_links', $duplicate_link );
999
  $wp_list_table = _get_list_table( 'WP_Posts_List_Table' );
1000
  $action = $wp_list_table->current_action();
1001
 
1002
+ if ( isset( $_REQUEST['action'] ) && $action == 'lp-duplicate-course' ) {
1003
  $post_id = isset( $_REQUEST['post'] ) ? $_REQUEST['post'] : 0;
1004
  $nonce = !empty( $_REQUEST['nonce'] ) ? $_REQUEST['nonce'] : '';
1005
  if ( !wp_verify_nonce( $nonce, 'lp-duplicate-' . $post_id ) ) {
1010
  }
1011
  // check for post is exists
1012
  if ( !( $post_id && $post = get_post( $post_id ) ) ) {
1013
+ wp_die( __( 'Oops! The course does not exists.', 'learnpress' ) );
1014
  }
1015
  // ensure that user can create course
1016
  if ( !current_user_can( 'edit_posts' ) ) {
1017
+ wp_die( __( 'Sorry! You have not permission to duplicate this course.', 'learnpress' ) );
1018
  }
1019
 
1020
  // assign course to current user
1043
  $new_post_id = wp_insert_post( $args );
1044
 
1045
  if ( !$new_post_id ) {
1046
+ LP_Admin_Notice::add_redirect( __( '<p>Sorry! Duplicate course failed!</p>', 'learnpress' ) );
1047
  wp_redirect( admin_url( 'edit.php?post_type=lp_course' ) );
1048
  exit();
1049
  }
1183
 
1184
  if ( !learn_press_user_maybe_is_a_teacher( $user_id ) ) {
1185
  $be_teacher = new WP_User( $user_id );
1186
+ $be_teacher->set_role( LP_TEACHER_ROLE );
1187
  delete_transient( 'learn_press_become_teacher_sent_' . $user_id );
1188
  do_action( 'learn_press_user_become_a_teacher', $user_id );
1189
  $redirect = add_query_arg( 'become-a-teacher-accepted', 'yes' );
1239
  function learn_press_one_click_install_sample_data_notice() {
1240
  $courses = get_posts(
1241
  array(
1242
+ 'post_type' => LP_COURSE_CPT,
1243
  'post_status' => 'any'
1244
  )
1245
  );
1256
  </div>
1257
  </div>',
1258
  __( 'You haven\'t got any courses yet! Would you like to import sample data?', 'learnpress' ),
1259
+ __( 'If yes, it requires to install addon name', 'learnpress' ),
1260
  __( 'LearnPress Import/Export', 'learnpress' ),
1261
  __( 'but don\'t worry because it is completely automated.', 'learnpress' ),
1262
  __( 'Import now', 'learnpress' ),
1269
 
1270
  function learn_press_request_query( $vars = array() ) {
1271
  global $typenow, $wp_query, $wp_post_statuses;
1272
+ if ( LP_ORDER_CPT === $typenow ) {
1273
  // Status
1274
  if ( !isset( $vars['post_status'] ) ) {
1275
  $post_statuses = learn_press_get_order_statuses();
1346
  $screen_id . '_page_learn_press_statistics',
1347
  $screen_id . '_page_learn_press_add_ons'
1348
  );
1349
+ foreach ( array( 'lp_course', 'lp_lesson', 'lp_quiz', 'lp_question', 'lp_order' ) as $post_type ) {
1350
  $screens[] = 'edit-' . $post_type;
1351
  $screens[] = $post_type;
1352
  }
1363
  );
1364
  }
1365
 
1366
+ function learn_press_is_post_type_screen( $post_type, $union = 'OR' ) {
1367
+ if ( is_array( $post_type ) ) {
1368
+ $return = null;
1369
+ foreach ( $post_type as $_post_type ) {
1370
+ $check = learn_press_is_post_type_screen( $_post_type );
1371
+ if ( $union == 'OR' && $check ) {
1372
+ return true;
1373
+ }
1374
+ if ( $return == null ) {
1375
+ $return = $check;
1376
+ } else {
1377
+ $return = $return && $check;
1378
+ }
1379
+ if ( $union !== 'OR' ) {
1380
+ return $return;
1381
+ }
1382
+ }
1383
+ return $return;
1384
+ }
1385
+ $screen = get_current_screen();
1386
+ if ( !$screen ) {
1387
+ return;
1388
+ }
1389
+ $screen_id = $screen->id;
1390
+ return in_array( $screen_id, array( $post_type, "edit-{$post_type}" ) );
1391
+ }
1392
+
1393
  function learn_press_get_notice_dismiss( $context, $type = 'transient' ) {
1394
  if ( $type == 'transient' ) {
1395
  return get_transient( 'learn_press_dismiss_notice_' . $context );
1396
  }
1397
  return get_option( 'learn_press_dismiss_notice_' . $context );
1398
  }
1399
+
1400
+ if ( !function_exists( 'learn_press_course_insert_section' ) ) {
1401
+
1402
+ function learn_press_course_insert_section( $section = array() ) {
1403
+ global $wpdb;
1404
+ $section = wp_parse_args(
1405
+ $section,
1406
+ array(
1407
+ 'section_name' => '',
1408
+ 'section_course_id' => 0,
1409
+ 'section_order' => 0,
1410
+ 'section_description' => ''
1411
+ )
1412
+ );
1413
+ $section = stripslashes_deep($section);
1414
+ extract($section);
1415
+
1416
+ $insert_data = compact('section_name', 'section_course_id', 'section_order', 'section_description');
1417
+ $wpdb->insert(
1418
+ $wpdb->learnpress_sections,
1419
+ $insert_data,
1420
+ array('%s', '%d', '%d')
1421
+ );
1422
+
1423
+ return $wpdb->insert_id;
1424
+ }
1425
+
1426
+ }
1427
+
1428
+ if ( !function_exists( 'learn_press_course_insert_section_item' ) ) {
1429
+
1430
+ function learn_press_course_insert_section_item( $item_data = array() ) {
1431
+ global $wpdb;
1432
+ $wpdb->insert(
1433
+ $wpdb->learnpress_section_items,
1434
+ array(
1435
+ 'section_id' => $item_data['section_id'],
1436
+ 'item_id' => $item_data['item_id'],
1437
+ 'item_order' => $item_data['item_order'],
1438
+ 'item_type' => $item_data['item_type']
1439
+ ),
1440
+ array(
1441
+ '%d',
1442
+ '%d',
1443
+ '%d',
1444
+ '%s',
1445
+ )
1446
+ );
1447
+ return $wpdb->insert_id;
1448
+ }
1449
+
1450
+ }
1451
+
1452
+ if ( !function_exists( 'learn_press_duplicate_post' ) ) {
1453
+
1454
+ function learn_press_duplicate_post( $post_id = null, $args = array(), $meta = true ) {
1455
+ $post = get_post( $post_id );
1456
+ if ( ! $post ) return;
1457
+ $defalts = array(
1458
+ 'comment_status' => $post->comment_status,
1459
+ 'ping_status' => $post->ping_status,
1460
+ 'post_author' => get_current_user_id(),
1461
+ 'post_content' => $post->post_content,
1462
+ 'post_excerpt' => $post->post_excerpt,
1463
+ 'post_parent' => $post->post_parent,
1464
+ 'post_password' => $post->post_password,
1465
+ 'post_status' => 'draft',
1466
+ 'post_title' => $post->post_title . ' - Copy',
1467
+ 'post_type' => $post->post_type,
1468
+ 'to_ping' => $post->to_ping,
1469
+ 'menu_order' => $post->menu_order
1470
+ );
1471
+ $args = wp_parse_args( $args, $defalts );
1472
+ $new_post_id = wp_insert_post( $args );
1473
+
1474
+ if ( $meta ) {
1475
+ learn_press_duplicate_post_meta( $post_id, $new_post_id );
1476
+ // assign related tags/categories to new course
1477
+ $taxonomies = get_object_taxonomies( $post->post_type );
1478
+ foreach ( $taxonomies as $taxonomy ) {
1479
+ $post_terms = wp_get_object_terms( $post_id, $taxonomy, array( 'fields' => 'slugs' ) );
1480
+ wp_set_object_terms( $new_post_id, $post_terms, $taxonomy, false );
1481
+ }
1482
+ }
1483
+ return apply_filters( 'learn_press_duplicate_post', $new_post_id, $post_id );
1484
+ }
1485
+ }
1486
+
1487
+ if ( !function_exists( 'learn_press_duplicate_post_meta' ) ) {
1488
+ /**
1489
+ * duplicate all post meta just in two SQL queries
1490
+ */
1491
+ function learn_press_duplicate_post_meta( $old_post_id, $new_post_id, $excerpt = array() ) {
1492
+ global $wpdb;
1493
+ $post_meta_infos = $wpdb->get_results( "SELECT meta_key, meta_value FROM $wpdb->postmeta WHERE post_id=$old_post_id" );
1494
+ if ( count( $post_meta_infos )!= 0 ) {
1495
+ $excerpt = array_merge( array( '_edit_lock', '_edit_last' ), $excerpt );
1496
+ $sql_query = "INSERT INTO $wpdb->postmeta (post_id, meta_key, meta_value) ";
1497
+ $sql_query_sel = array();
1498
+ foreach ( $post_meta_infos as $meta ) {
1499
+ if ( in_array( $meta->meta_value, $excerpt ) ) {
1500
+ continue;
1501
+ }
1502
+ $meta_key = $meta->meta_key;
1503
+ $meta_value = addslashes($meta->meta_value);
1504
+ $sql_query_sel[]= "SELECT $new_post_id, '$meta_key', '$meta_value'";
1505
+ }
1506
+ $sql_query.= implode(" UNION ALL ", $sql_query_sel);
1507
+ $wpdb->query( $sql_query );
1508
+ }
1509
+ }
1510
+
1511
+ }
1512
+
1513
+ add_filter( 'learn_press_question_types', 'learn_press_sort_questions', 99 );
1514
+ if ( !function_exists( 'learn_press_sort_questions' ) ) {
1515
+ function learn_press_sort_questions( $types ) {
1516
+ $user_id = get_current_user_id();
1517
+ $question_types = get_user_meta( $user_id, '_learn_press_memorize_question_types', true );
1518
+ if ( ! empty( $question_types ) ) {
1519
+ $sort = array();
1520
+ // re-sort array descending
1521
+ arsort( $question_types );
1522
+ $new_types = array();
1523
+ $ktypes = array_keys( $types );
1524
+
1525
+ for( $i = 0; $i < count( $ktypes ) - 1; $i++ ) {
1526
+ $max = $i;
1527
+ if ( !isset( $question_types[ $ktypes[$i] ] ) ) {
1528
+ $question_types[ $ktypes[$i] ] = 0;
1529
+ }
1530
+ for( $j = $i + 1; $j < count( $ktypes ); $j++ ) {
1531
+ if ( isset( $question_types[ $ktypes[$j] ], $question_types[ $ktypes[$max] ] )
1532
+ && $question_types[ $ktypes[$j] ] > $question_types[ $ktypes[$max] ] ) {
1533
+ $max = $j;
1534
+ }
1535
+ }
1536
+ $tmp = $ktypes[$i];
1537
+ $ktypes[$i] = $ktypes[$max];
1538
+ $ktypes[$max] = $tmp;
1539
+ }
1540
+ $ktypes = array_flip( $ktypes );
1541
+ $types = array_merge( $ktypes, $types );
1542
+ }
1543
+ return $types;
1544
+ }
1545
+ }
inc/admin/meta-boxes/class-curriculum-field.php CHANGED
@@ -17,12 +17,9 @@ if ( !class_exists( 'RWMB_Curriculum_Field' ) ) {
17
  * @return void
18
  */
19
  public static function admin_enqueue_scripts() {
20
- LP_Admin_Assets::enqueue_style( 'meta-box-course', LP()->plugin_url( 'assets/css/admin/meta-box-course.css' ) );
21
- LP_Admin_Assets::enqueue_style( 'select2', RWMB_CSS_URL . 'select2/select2.css' );
22
- LP_Admin_Assets::enqueue_script( 'select2', RWMB_JS_URL . 'select2/select2.min.js' );
23
- LP_Admin_Assets::enqueue_script( 'modal-search-items' );
24
- LP_Admin_Assets::enqueue_script( 'meta-box-course', learn_press_plugin_url( 'assets/js/admin/meta-box-course.js' ), array( 'jquery' ) );
25
- LP_Admin_Assets::add_localize(
26
  array(
27
  'confirm_remove_section_lesson' => __( 'Do you want to remove this lesson permanently?', 'learnpress' ),
28
  'confirm_remove_section_quiz' => __( 'Do you want to remove this quiz permanently?', 'learnpress' ),
@@ -40,11 +37,10 @@ if ( !class_exists( 'RWMB_Curriculum_Field' ) ) {
40
  'quick_edit_name' => __( 'Click to quick edit name', 'learnpress' ),
41
  'save_course' => __( 'Save Course', 'learnpress' ),
42
  'submit_course_review' => __( 'Submit for Review', 'learnpress' )
43
- ), null, 'meta-box-course'
44
  );
45
  }
46
 
47
-
48
  /**
49
  * Get field HTML
50
  *
@@ -136,11 +132,11 @@ if ( !class_exists( 'RWMB_Curriculum_Field' ) ) {
136
  // Do same actions as file field
137
  parent::add_actions();
138
 
139
- add_action( 'wp_ajax_lpr_quick_add', array( __CLASS__, 'quick_add' ) );
140
  add_action( 'wp_ajax_lpr_update_course_curriculum', array( __CLASS__, 'update_course_curriculum' ) );
141
  add_action( 'wp_ajax_lpr_quick_edit_lesson_quiz_name', array( __CLASS__, 'quick_edit_lesson_quiz_name' ) );
142
  add_action( 'wp_ajax_lpr_update_section_state', array( __CLASS__, 'update_section_state' ) );
143
- add_action( 'wp_ajax_lpr_remove_lesson_quiz', array( __CLASS__, 'remove_lesson_quiz' ) );
144
 
145
  ///add_action( 'save_post', array( __CLASS__, 'update_course_curriculum' ) );
146
  add_filter( 'learn_press_loop_section_buttons', array( __CLASS__, 'add_section_buttons' ) );
@@ -176,7 +172,7 @@ if ( !class_exists( 'RWMB_Curriculum_Field' ) ) {
176
  <td>
177
  <input type="checkbox" />
178
 
179
- <p class="description"><?php _e( 'User must be completed the final quiz to finish a section', 'learnpress' ); ?></p>
180
 
181
  </td>
182
  </tr>
@@ -250,7 +246,7 @@ if ( !class_exists( 'RWMB_Curriculum_Field' ) ) {
250
  $course_id = isset( $_POST['course_id'] ) ? intval( $_POST['course_id'] ) : 0;
251
  $is_ajax = true;
252
  } else {
253
- if ( LP()->course_post_type != get_post_type() ) return;
254
  global $post;
255
  $course_id = $post->ID;
256
  }
17
  * @return void
18
  */
19
  public static function admin_enqueue_scripts() {
20
+
21
+ LP_Assets::enqueue_script( 'learn-press-modal-search-items' );
22
+ LP_Assets::add_localize(
 
 
 
23
  array(
24
  'confirm_remove_section_lesson' => __( 'Do you want to remove this lesson permanently?', 'learnpress' ),
25
  'confirm_remove_section_quiz' => __( 'Do you want to remove this quiz permanently?', 'learnpress' ),
37
  'quick_edit_name' => __( 'Click to quick edit name', 'learnpress' ),
38
  'save_course' => __( 'Save Course', 'learnpress' ),
39
  'submit_course_review' => __( 'Submit for Review', 'learnpress' )
40
+ ), null, 'learn-press-mb-course'
41
  );
42
  }
43
 
 
44
  /**
45
  * Get field HTML
46
  *
132
  // Do same actions as file field
133
  parent::add_actions();
134
 
135
+ /*add_action( 'wp_ajax_lpr_quick_add', array( __CLASS__, 'quick_add' ) );
136
  add_action( 'wp_ajax_lpr_update_course_curriculum', array( __CLASS__, 'update_course_curriculum' ) );
137
  add_action( 'wp_ajax_lpr_quick_edit_lesson_quiz_name', array( __CLASS__, 'quick_edit_lesson_quiz_name' ) );
138
  add_action( 'wp_ajax_lpr_update_section_state', array( __CLASS__, 'update_section_state' ) );
139
+ add_action( 'wp_ajax_lpr_remove_lesson_quiz', array( __CLASS__, 'remove_lesson_quiz' ) );*/
140
 
141
  ///add_action( 'save_post', array( __CLASS__, 'update_course_curriculum' ) );
142
  add_filter( 'learn_press_loop_section_buttons', array( __CLASS__, 'add_section_buttons' ) );
172
  <td>
173
  <input type="checkbox" />
174
 
175
+ <p class="description"><?php _e( 'User must be complete the final quiz to finish a section.', 'learnpress' ); ?></p>
176
 
177
  </td>
178
  </tr>
246
  $course_id = isset( $_POST['course_id'] ) ? intval( $_POST['course_id'] ) : 0;
247
  $is_ajax = true;
248
  } else {
249
+ if ( LP_COURSE_CPT != get_post_type() ) return;
250
  global $post;
251
  $course_id = $post->ID;
252
  }
inc/admin/meta-boxes/class-quiz-questions-field.php CHANGED
@@ -23,10 +23,10 @@ if ( !class_exists( 'RWMB_Quiz_Questions_Field' ) ) {
23
  public static function admin_enqueue_scripts() {
24
  /*$q = new LP_Question();
25
  $q->admin_script();*/
26
- LP_Admin_Assets::enqueue_style( 'select2', RWMB_CSS_URL . 'select2/select2.css' );
27
- LP_Admin_Assets::enqueue_script( 'select2', RWMB_JS_URL . 'select2/select2.min.js' );
28
- LP_Admin_Assets::enqueue_script( 'lpr-quiz-question', learn_press_plugin_url( 'assets/js/admin/meta-box-quiz.js' ) );
29
- wp_enqueue_script( 'modal-search-items' );
30
 
31
  }
32
 
@@ -61,7 +61,7 @@ if ( !class_exists( 'RWMB_Quiz_Questions_Field' ) ) {
61
  if ( $question ) {
62
  if ( !$question_id ) {
63
  $question->set( 'post_title', $text ? $text : 'Your question text here' );
64
- $question->set( 'post_type', LP()->question_post_type );
65
  $question->set( 'post_status', 'publish' );
66
  }
67
 
@@ -87,7 +87,7 @@ if ( !class_exists( 'RWMB_Quiz_Questions_Field' ) ) {
87
  learn_press_debug($_POST);
88
  die();
89
  static $has_updated;
90
- $questions = isset( $_POST[LP()->question_post_type] ) ? $_POST[LP()->question_post_type] : null;
91
  if ( !$questions ) return;
92
  $postmeta = array();
93
 
23
  public static function admin_enqueue_scripts() {
24
  /*$q = new LP_Question();
25
  $q->admin_script();*/
26
+ LP_Assets::enqueue_style( 'select2', RWMB_CSS_URL . 'select2/select2.css' );
27
+ LP_Assets::enqueue_script( 'select2', RWMB_JS_URL . 'select2/select2.min.js' );
28
+ LP_Assets::enqueue_script( 'learn-press-mb-quiz' );
29
+ LP_Assets::enqueue_script( 'learn-press-modal-search-items' );
30
 
31
  }
32
 
61
  if ( $question ) {
62
  if ( !$question_id ) {
63
  $question->set( 'post_title', $text ? $text : 'Your question text here' );
64
+ $question->set( 'post_type', LP_QUESTION_CPT );
65
  $question->set( 'post_status', 'publish' );
66
  }
67
 
87
  learn_press_debug($_POST);
88
  die();
89
  static $has_updated;
90
+ $questions = isset( $_POST[LP_QUESTION_CPT] ) ? $_POST[LP_QUESTION_CPT] : null;
91
  if ( !$questions ) return;
92
  $postmeta = array();
93
 
inc/admin/meta-boxes/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php // Silence is golden.
inc/admin/pointers/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php // Silence is golden.
inc/admin/pointers/pointers.php CHANGED
@@ -64,7 +64,7 @@ function learn_press_register_pointer_in_edit_course( $pointer ) {
64
  'options' => array(
65
  'content' => sprintf( '<h3> %s </h3> <p> %s </p>',
66
  __( 'Course Curriculum', 'learnpress' ),
67
- __( 'Build a course by selecting created lessons and quizzes or adding new ones. Sorting, editing, shortcuts (l and q), it never gets easier with LearnPress.', 'learnpress' )
68
  ),
69
  'position' => array( 'edge' => 'top', 'align' => 'middle' )
70
  )
64
  'options' => array(
65
  'content' => sprintf( '<h3> %s </h3> <p> %s </p>',
66
  __( 'Course Curriculum', 'learnpress' ),
67
+ __( 'Build a course by selecting created lessons and quizzes or adding new ones. Sorting, editing, shortcuts (l and q), it never gets easier with LP.', 'learnpress' )
68
  ),
69
  'position' => array( 'edge' => 'top', 'align' => 'middle' )
70
  )
inc/admin/settings/class-lp-settings-base.php CHANGED
@@ -1,5 +1,4 @@
1
  <?php
2
-
3
  /**
4
  * Class LP_Settings_Base
5
  *
@@ -7,7 +6,6 @@
7
  * @package LearnPress/Classes
8
  * @version 1.0
9
  */
10
-
11
  if ( !defined( 'ABSPATH' ) ) {
12
  exit; // Exit if accessed directly
13
  }
@@ -51,7 +49,7 @@ class LP_Settings_Base {
51
  * Constructor
52
  */
53
  public function __construct() {
54
- if( strtolower( current_filter() ) == 'activate_learnpress/learnpress.php' ){
55
  return;
56
  }
57
  $current_tab = isset( $_GET['tab'] ) ? $_GET['tab'] : '';
@@ -75,28 +73,30 @@ class LP_Settings_Base {
75
  */
76
  if ( $sections ) {
77
  $array_keys = array_keys( $sections );
78
- if ( !$current_section ) $current_section = reset( $array_keys );
 
79
  if ( !empty( $sections[$current_section] ) ) {
80
  $this->section = $sections[$current_section];
81
  } else {
82
  $this->section = array( 'id' => null, 'title' => '' );
83
  }
84
-
85
  } else {
86
  $this->section = array( 'id' => null, 'title' => '' );
87
  }
88
 
89
- if ( $sections = $this->get_sections() ) foreach ( $sections as $id => $text ) {
90
- $callback = apply_filters( 'learn_press_section_callback_' . $this->id . '_' . $id, array( $this, 'output_section_' . $id ) );
91
- if ( is_callable( $callback ) ) {
92
- add_action( 'learn_press_section_' . $this->id . '_' . $id, $callback );
 
 
93
  }
94
- }
95
-
96
  // hooks
97
  add_action( 'learn_press_sections_' . $this->id, array( $this, 'output_sections' ) );
98
  add_action( 'learn_press_settings_' . $this->id, array( $this, 'output' ) );
99
  add_action( 'learn_press_settings_save_' . $this->id, array( $this, 'save' ) );
 
100
  }
101
 
102
  /**
@@ -108,19 +108,20 @@ class LP_Settings_Base {
108
 
109
  if ( $sections && sizeof( $sections ) > 1 ) {
110
  $array_keys = array_keys( $sections );
111
- echo '<ul class="subsubsub clearfix">';
112
  foreach ( $sections as $name => $section ) {
113
  ?>
114
  <li>
115
  <a href="<?php echo '?page=learn_press_settings&tab=' . $this->id . '&section=' . sanitize_title( $name ); ?>" class="<?php echo $current_section == $name ? 'current' : ''; ?>">
116
  <?php echo $section['title']; ?>
117
  </a>
118
- <?php echo( end( $array_keys ) == $name ? '' : '|' ); ?>
119
  </li>
120
  <?php
121
  }
122
  echo '</ul>';
123
- echo '<div class="clear"></div>';
 
124
  }
125
  }
126
 
@@ -136,8 +137,9 @@ class LP_Settings_Base {
136
  */
137
  public function save() {
138
  foreach ( $_POST as $k => $v ) {
139
- if ( ( strpos( $k, 'learn_press_' ) === false ) || ( !apply_filters( 'learn_press_abort_update_option', true, $k ) ) ) continue;
140
- update_option( $k, apply_filters( 'learn_press_update_option_value', $v, $k ) );
 
141
  }
142
  }
143
 
@@ -183,13 +185,14 @@ class LP_Settings_Base {
183
  public function output_settings() {
184
 
185
  $settings = new LP_Settings_Base();
186
- if( $fields = $this->get_settings() ) foreach ( $fields as $field ) {
187
- $settings->output_field( $field );
188
- }
 
189
  }
190
 
191
  public function output_field( $options ) {
192
- if ( ! isset( $options['type'] ) ) {
193
  return;
194
  }
195
  if ( !isset( $options['id'] ) ) {
@@ -225,13 +228,13 @@ class LP_Settings_Base {
225
  }
226
  }
227
 
228
- if( !empty( $options['desc'] ) ){
229
  $description = sprintf( '<p class="description">%s</p>', $options['desc'] );
230
- }else{
231
  $description = '';
232
  }
233
  $file = $options['type'];
234
- if( in_array( $file, array( 'text', 'email', 'color', 'password', 'number' ) ) ){
235
  $file = 'text';
236
  }
237
  require learn_press_get_admin_view( 'settings/fields/' . $file . '.php' );
@@ -247,10 +250,10 @@ class LP_Settings_Base {
247
  // Get value
248
  $option_values = get_option( $option_name, '' );
249
 
250
- $key = key( $option_array[ $option_name ] );
251
 
252
- if ( isset( $option_values[ $key ] ) ) {
253
- $option_value = $option_values[ $key ];
254
  } else {
255
  $option_value = null;
256
  }
@@ -262,11 +265,13 @@ class LP_Settings_Base {
262
 
263
  if ( is_array( $option_value ) ) {
264
  $option_value = array_map( 'stripslashes', $option_value );
265
- } elseif ( ! is_null( $option_value ) ) {
266
  $option_value = stripslashes( $option_value );
267
  }
268
 
269
  return $option_value === null ? $default : $option_value;
270
  }
 
271
  }
 
272
  return new LP_Settings_Base();
1
  <?php
 
2
  /**
3
  * Class LP_Settings_Base
4
  *
6
  * @package LearnPress/Classes
7
  * @version 1.0
8
  */
 
9
  if ( !defined( 'ABSPATH' ) ) {
10
  exit; // Exit if accessed directly
11
  }
49
  * Constructor
50
  */
51
  public function __construct() {
52
+ if ( strtolower( current_filter() ) == 'activate_learnpress/learnpress.php' ) {
53
  return;
54
  }
55
  $current_tab = isset( $_GET['tab'] ) ? $_GET['tab'] : '';
73
  */
74
  if ( $sections ) {
75
  $array_keys = array_keys( $sections );
76
+ if ( !$current_section )
77
+ $current_section = reset( $array_keys );
78
  if ( !empty( $sections[$current_section] ) ) {
79
  $this->section = $sections[$current_section];
80
  } else {
81
  $this->section = array( 'id' => null, 'title' => '' );
82
  }
 
83
  } else {
84
  $this->section = array( 'id' => null, 'title' => '' );
85
  }
86
 
87
+ if ( $sections = $this->get_sections() )
88
+ foreach ( $sections as $id => $text ) {
89
+ $callback = apply_filters( 'learn_press_section_callback_' . $this->id . '_' . $id, array( $this, 'output_section_' . $id ) );
90
+ if ( is_callable( $callback ) ) {
91
+ add_action( 'learn_press_section_' . $this->id . '_' . $id, $callback );
92
+ }
93
  }
94
+ self::$current_tab = $current_tab;
 
95
  // hooks
96
  add_action( 'learn_press_sections_' . $this->id, array( $this, 'output_sections' ) );
97
  add_action( 'learn_press_settings_' . $this->id, array( $this, 'output' ) );
98
  add_action( 'learn_press_settings_save_' . $this->id, array( $this, 'save' ) );
99
+
100
  }
101
 
102
  /**
108
 
109
  if ( $sections && sizeof( $sections ) > 1 ) {
110
  $array_keys = array_keys( $sections );
111
+ echo '<ul class="subsubsub">';
112
  foreach ( $sections as $name => $section ) {
113
  ?>
114
  <li>
115
  <a href="<?php echo '?page=learn_press_settings&tab=' . $this->id . '&section=' . sanitize_title( $name ); ?>" class="<?php echo $current_section == $name ? 'current' : ''; ?>">
116
  <?php echo $section['title']; ?>
117
  </a>
118
+ <?php //echo( end( $array_keys ) == $name ? '' : '|' ); ?>
119
  </li>
120
  <?php
121
  }
122
  echo '</ul>';
123
+ //echo '<div class="clear"></div>';
124
+ }else{
125
  }
126
  }
127
 
137
  */
138
  public function save() {
139
  foreach ( $_POST as $k => $v ) {
140
+ if ( ( strpos( $k, 'learn_press_' ) === false ) || ( !apply_filters( 'learn_press_abort_update_option', true, $k ) ) )
141
+ continue;
142
+ update_option( $k, apply_filters( 'learn_press_update_option_value', ( $v ), $k ) );
143
  }
144
  }
145
 
185
  public function output_settings() {
186
 
187
  $settings = new LP_Settings_Base();
188
+ if ( $fields = $this->get_settings() )
189
+ foreach ( $fields as $field ) {
190
+ $settings->output_field( $field );
191
+ }
192
  }
193
 
194
  public function output_field( $options ) {
195
+ if ( !isset( $options['type'] ) ) {
196
  return;
197
  }
198
  if ( !isset( $options['id'] ) ) {
228
  }
229
  }
230
 
231
+ if ( !empty( $options['desc'] ) ) {
232
  $description = sprintf( '<p class="description">%s</p>', $options['desc'] );
233
+ } else {
234
  $description = '';
235
  }
236
  $file = $options['type'];
237
+ if ( in_array( $file, array( 'text', 'email', 'color', 'password', 'number' ) ) ) {
238
  $file = 'text';
239
  }
240
  require learn_press_get_admin_view( 'settings/fields/' . $file . '.php' );
250
  // Get value
251
  $option_values = get_option( $option_name, '' );
252
 
253
+ $key = key( $option_array[$option_name] );
254
 
255
+ if ( isset( $option_values[$key] ) ) {
256
+ $option_value = $option_values[$key];
257
  } else {
258
  $option_value = null;
259
  }
265
 
266
  if ( is_array( $option_value ) ) {
267
  $option_value = array_map( 'stripslashes', $option_value );
268
+ } elseif ( !is_null( $option_value ) ) {
269
  $option_value = stripslashes( $option_value );
270
  }
271
 
272
  return $option_value === null ? $default : $option_value;
273
  }
274
+
275
  }
276
+
277
  return new LP_Settings_Base();
inc/admin/settings/class-lp-settings-checkout.php CHANGED
@@ -49,15 +49,15 @@ class LP_Settings_Checkout extends LP_Settings_Base {
49
  'learn_press_checkout_settings',
50
  array(
51
  array(
52
- 'title' => __( 'No checkout free course', 'learnpress' ),
53
- 'desc' => __( 'Check this option to enable user can enroll course immediate without add to cart', 'learnpress' ),
54
  'id' => $this->get_field_name( 'no_checkout_free_course' ),
55
  'default' => 'yes',
56
  'type' => 'checkbox'
57
  ),
58
  array(
59
  'title' => __( 'Disable auto enroll', 'learnpress' ),
60
- 'desc' => __( 'Disable auto enroll a user after they bought a course', 'learnpress' ),
61
  'id' => $this->get_field_name( 'disable_auto_enroll' ),
62
  'default' => 'no',
63
  'type' => 'checkbox'
49
  'learn_press_checkout_settings',
50
  array(
51
  array(
52
+ 'title' => __( 'No checkout Free course', 'learnpress' ),
53
+ 'desc' => __( 'Check this option to allow user to enroll course immediately without adding to cart.', 'learnpress' ),
54
  'id' => $this->get_field_name( 'no_checkout_free_course' ),
55
  'default' => 'yes',
56
  'type' => 'checkbox'
57
  ),
58
  array(
59
  'title' => __( 'Disable auto enroll', 'learnpress' ),
60
+ 'desc' => __( 'Disable auto enroll a user after they buy a course.', 'learnpress' ),
61
  'id' => $this->get_field_name( 'disable_auto_enroll' ),
62
  'default' => 'no',
63
  'type' => 'checkbox'
inc/admin/settings/class-lp-settings-courses.php CHANGED
@@ -41,7 +41,6 @@ class LP_Settings_Courses extends LP_Settings_Base {
41
 
42
  update_option( 'learn_press_course_base', $course_base );
43
 
44
-
45
  $courses_page_id = learn_press_get_page_id( 'courses' );
46
  $courses_permalink = ( $courses_page_id > 0 && get_post( $courses_page_id ) ) ? get_page_uri( $courses_page_id ) : _x( 'courses', 'default-slug', 'learnpress' );
47
 
@@ -81,25 +80,32 @@ class LP_Settings_Courses extends LP_Settings_Base {
81
  ),
82
  array(
83
  'title' => __( 'Review course before publish', 'learnpress' ),
84
- 'desc' => __( 'The course need to review by admin before it can be published', 'learnpress' ),
85
  'id' => $this->get_field_name( 'required_review' ),
86
  'default' => 'yes',
87
  'type' => 'checkbox'
88
  ),
89
  array(
90
  'title' => __( 'Enable edit published course', 'learnpress' ),
91
- 'desc' => __( 'Allows instructor edit the course that published without review.<br /> If this option is disabled, the course status will be changed to Pending Review when the instructor update course', 'learnpress' ),
92
  'id' => $this->get_field_name( 'enable_edit_published' ),
93
  'default' => 'yes',
94
  'type' => 'checkbox'
95
  ),
 
 
 
 
 
 
 
96
  array(
97
  'title' => __( 'Archive', 'learnpress' ),
98
  'type' => 'title'
99
  ),
100
  array(
101
  'title' => __( 'Courses limit', 'learnpress' ),
102
- 'desc' => __( 'Number of courses display per page', 'learnpress' ),
103
  'id' => $this->get_field_name( 'archive_course_limit' ),
104
  'default' => '10',
105
  'type' => 'number'
41
 
42
  update_option( 'learn_press_course_base', $course_base );
43
 
 
44
  $courses_page_id = learn_press_get_page_id( 'courses' );
45
  $courses_permalink = ( $courses_page_id > 0 && get_post( $courses_page_id ) ) ? get_page_uri( $courses_page_id ) : _x( 'courses', 'default-slug', 'learnpress' );
46
 
80
  ),
81
  array(
82
  'title' => __( 'Review course before publish', 'learnpress' ),
83
+ 'desc' => __( 'The course needs to be reviewed by admin before it can be published.', 'learnpress' ),
84
  'id' => $this->get_field_name( 'required_review' ),
85
  'default' => 'yes',
86
  'type' => 'checkbox'
87
  ),
88
  array(
89
  'title' => __( 'Enable edit published course', 'learnpress' ),
90
+ 'desc' => __( 'Allow instructors to edit the course that are published without review.<br /> If this option is disabled, the course status will be changed to Pending Review when the instructor update course.', 'learnpress' ),
91
  'id' => $this->get_field_name( 'enable_edit_published' ),
92
  'default' => 'yes',
93
  'type' => 'checkbox'
94
  ),
95
+ array(
96
+ 'title' => __( 'Hide list of question in quiz', 'learnpress' ),
97
+ 'desc' => __( 'Hide list of question in quiz<br /> If this option is enabled, the course status will be changed to Pending Review when the instructor update course', 'learnpress' ),
98
+ 'id' => $this->get_field_name( 'disable_question_in_quiz' ),
99
+ 'default' => 'no',
100
+ 'type' => 'checkbox'
101
+ ),
102
  array(
103
  'title' => __( 'Archive', 'learnpress' ),
104
  'type' => 'title'
105
  ),
106
  array(
107
  'title' => __( 'Courses limit', 'learnpress' ),
108
+ 'desc' => __( 'Number of courses displayed per page.', 'learnpress' ),
109
  'id' => $this->get_field_name( 'archive_course_limit' ),
110
  'default' => '10',
111
  'type' => 'number'
inc/admin/settings/class-lp-settings-emails.php CHANGED
@@ -7,12 +7,16 @@
7
  * @package LearnPress/Classes
8
  * @version 1.0
9
  */
10
-
11
  if ( !defined( 'ABSPATH' ) ) {
12
  exit; // Exit if accessed directly
13
  }
14
 
15
  class LP_Settings_Emails extends LP_Settings_Base {
 
 
 
 
 
16
  /**
17
  * Constructor
18
  */
@@ -35,21 +39,22 @@ class LP_Settings_Emails extends LP_Settings_Base {
35
  'general' => array( 'id' => 'general', 'title' => __( 'General options', 'learnpress' ) )
36
  );
37
 
38
- if ( $emails ) foreach ( $emails as $email ) {
39
- $sections[$email->id] = array(
40
- 'id' => $email->id,
41
- 'title' => $email->title
42
- );
43
- }
 
44
 
45
- /*$sections = array(
46
- 'general' => __( 'General options', 'learnpress' ),
47
- 'new_course' => __( 'New course', 'learnpress' ),
48
- 'published_course' => __( 'Published course', 'learnpress' ),
49
- 'new_order' => __( 'New order', 'learnpress' ),
50
- 'enrolled_course' => __( 'Enrolled course', 'learnpress' ),
51
- 'passed_course' => __( 'Passed course', 'learnpress' ),
52
- );*/
53
  return $sections = apply_filters( 'learn_press_settings_sections_' . $this->id, $sections );
54
  }
55
 
@@ -61,24 +66,22 @@ class LP_Settings_Emails extends LP_Settings_Base {
61
  $content = stripslashes( $settings->get( $this->section['id'] . '.message', $default_message ) );
62
  $editor_id = 'email_message';
63
  wp_editor(
64
- stripslashes( $content ),
65
- $editor_id,
66
- array(
67
  'textarea_rows' => 10,
68
  'wpautop' => false,
69
  'textarea_name' => "lpr_settings[$this->id][message]",
70
  )
71
  );
72
-
73
  }
74
 
75
  public function get_email_class( $id ) {
76
  $emails = LP_Emails::instance()->emails;
77
- if ( $emails ) foreach ( $emails as $email ) {
78
- if ( $email->id == $id ) {
79
- return $email;
 
 
80
  }
81
- }
82
  return false;
83
  }
84
 
@@ -114,6 +117,12 @@ class LP_Settings_Emails extends LP_Settings_Base {
114
  }
115
  }
116
 
 
 
 
 
 
 
117
  public function output_section_published_course() {
118
  if ( $email = $this->get_email_class( 'published_course' ) ) {
119
  $email->admin_options( $this );
@@ -143,16 +152,9 @@ class LP_Settings_Emails extends LP_Settings_Base {
143
  include_once $view;
144
  }
145
 
146
- public function output_section_new_order_customer() {
147
- if ( $email = $this->get_email_class( 'new_order_customer' ) ) {
148
- $email->admin_options( $this );
149
- }
150
- }
151
-
152
  public function get_settings() {
153
  return apply_filters(
154
- 'learn_press_email_settings',
155
- array(
156
  array(
157
  'title' => __( 'Profile page', 'learnpress' ),
158
  'id' => $this->get_field_name( 'profile_page_id' ),
@@ -163,7 +165,14 @@ class LP_Settings_Emails extends LP_Settings_Base {
163
  )
164
  );
165
  }
 
 
 
 
 
 
 
166
  }
167
 
168
  //
169
- return new LP_Settings_Emails();
7
  * @package LearnPress/Classes
8
  * @version 1.0
9
  */
 
10
  if ( !defined( 'ABSPATH' ) ) {
11
  exit; // Exit if accessed directly
12
  }
13
 
14
  class LP_Settings_Emails extends LP_Settings_Base {
15
+ /**
16
+ * @var null
17
+ */
18
+ protected static $_instance = null;
19
+
20
  /**
21
  * Constructor
22
  */
39
  'general' => array( 'id' => 'general', 'title' => __( 'General options', 'learnpress' ) )
40
  );
41
 
42
+ if ( $emails )
43
+ foreach ( $emails as $email ) {
44
+ $sections[$email->id] = array(
45
+ 'id' => $email->id,
46
+ 'title' => $email->title
47
+ );
48
+ }
49
 
50
+ /* $sections = array(
51
+ 'general' => __( 'General options', 'learnpress' ),
52
+ 'new_course' => __( 'New course', 'learnpress' ),
53
+ 'published_course' => __( 'Published course', 'learnpress' ),
54
+ 'new_order' => __( 'New order', 'learnpress' ),
55
+ 'enrolled_course' => __( 'Enrolled course', 'learnpress' ),
56
+ 'passed_course' => __( 'Passed course', 'learnpress' ),
57
+ ); */
58
  return $sections = apply_filters( 'learn_press_settings_sections_' . $this->id, $sections );
59
  }
60
 
66
  $content = stripslashes( $settings->get( $this->section['id'] . '.message', $default_message ) );
67
  $editor_id = 'email_message';
68
  wp_editor(
69
+ stripslashes( $content ), $editor_id, array(
 
 
70
  'textarea_rows' => 10,
71
  'wpautop' => false,
72
  'textarea_name' => "lpr_settings[$this->id][message]",
73
  )
74
  );
 
75
  }
76
 
77
  public function get_email_class( $id ) {
78
  $emails = LP_Emails::instance()->emails;
79
+ if ( $emails )
80
+ foreach ( $emails as $email ) {
81
+ if ( $email->id == $id ) {
82
+ return $email;
83
+ }
84
  }
 
85
  return false;
86
  }
87
 
117
  }
118
  }
119
 
120
+ public function output_section_new_order_customer() {
121
+ if ( $email = $this->get_email_class( 'new_order_customer' ) ) {
122
+ $email->admin_options( $this );
123
+ }
124
+ }
125
+
126
  public function output_section_published_course() {
127
  if ( $email = $this->get_email_class( 'published_course' ) ) {
128
  $email->admin_options( $this );
152
  include_once $view;
153
  }
154
 
 
 
 
 
 
 
155
  public function get_settings() {
156
  return apply_filters(
157
+ 'learn_press_email_settings', array(
 
158
  array(
159
  'title' => __( 'Profile page', 'learnpress' ),
160
  'id' => $this->get_field_name( 'profile_page_id' ),
165
  )
166
  );
167
  }
168
+
169
+ public static function instance() {
170
+ if ( !self::$_instance ) {
171
+ self::$_instance = new self();
172
+ }
173
+ return self::$_instance;
174
+ }
175
  }
176
 
177
  //
178
+ return LP_Settings_Emails::instance();
inc/admin/settings/class-lp-settings-general.php CHANGED
@@ -77,12 +77,26 @@ class LP_Settings_General extends LP_Settings_Base {
77
  'type' => 'text',
78
  'options' => $this->_get_currency_positions()
79
  ),
 
 
 
 
 
 
 
80
  array(
81
  'title' => __( 'Debug mode', 'learnpress' ),
82
  'id' => $this->get_field_name( 'debug' ),
83
  'default' => 'yes',
84
  'type' => 'checkbox',
85
  'desc' => __( 'Turn on/off debug mode for developer', 'learnpress' )
 
 
 
 
 
 
 
86
  )
87
  )
88
  );
@@ -120,12 +134,6 @@ class LP_Settings_General extends LP_Settings_Base {
120
  }
121
  return $positions;
122
  }
123
-
124
- /*function save() {
125
- $settings = LP_Admin_Settings::instance( 'general' );// $_POST['lpr_settings']['general'];
126
- $settings->bind( $_POST['learn_press'] );
127
- $settings->update();
128
- }*/
129
  }
130
 
131
  return new LP_Settings_General();
77
  'type' => 'text',
78
  'options' => $this->_get_currency_positions()
79
  ),
80
+ array(
81
+ 'title' => __( 'Load css', 'learnpress' ),
82
+ 'id' => $this->get_field_name( 'load_css' ),
83
+ 'default' => 'yes',
84
+ 'type' => 'checkbox',
85
+ 'desc' => __( 'Load default stylesheet for LearnPress', 'learnpress' )
86
+ ),
87
  array(
88
  'title' => __( 'Debug mode', 'learnpress' ),
89
  'id' => $this->get_field_name( 'debug' ),
90
  'default' => 'yes',
91
  'type' => 'checkbox',
92
  'desc' => __( 'Turn on/off debug mode for developer', 'learnpress' )
93
+ ),
94
+ array(
95
+ 'title' => __( 'Course thumbnail', 'learnpress' ),
96
+ 'id' => $this->get_field_name( 'generate_course_thumbnail' ),
97
+ 'default' => 'yes',
98
+ 'type' => 'checkbox',
99
+ 'desc' => __( 'Turn on/off courses extra thumbnail', 'learnpress' )
100
  )
101
  )
102
  );
134
  }
135
  return $positions;
136
  }
 
 
 
 
 
 
137
  }
138
 
139
  return new LP_Settings_General();
inc/admin/settings/class-lp-settings-pages.php CHANGED
@@ -30,6 +30,17 @@ class LP_Settings_Pages extends LP_Settings_Base {
30
  }
31
 
32
  public function get_settings() {
 
 
 
 
 
 
 
 
 
 
 
33
  return apply_filters(
34
  'learn_press_page_settings',
35
  array(
@@ -40,6 +51,7 @@ class LP_Settings_Pages extends LP_Settings_Base {
40
  'default' => '',
41
  'type' => 'pages-dropdown'
42
  ),
 
43
  array(
44
  'title' => __( 'Add link to admin bar', 'learnpress' ),
45
  'id' => $this->get_field_name( 'admin_bar_link' ),
@@ -123,7 +135,7 @@ class LP_Settings_Pages extends LP_Settings_Base {
123
  'id' => $this->get_field_name( 'quiz_restrict_access' ),
124
  'default' => '404',
125
  'type' => 'select',
126
- 'desc' => __( 'Page display if user has not permission to view quiz.', 'learnpress' ),
127
  'options' => array(
128
  '404' => __( '404 page', 'learnpress' ),
129
  'custom' => __( 'Restrict page', 'learnpress' ),
30
  }
31
 
32
  public function get_settings() {
33
+
34
+ $display_name = array(
35
+ 'nice' => esc_html__('Nicename','learnpress'),
36
+ 'first' => esc_html__('First name','learnpress'),
37
+ 'last' => esc_html__('Last name','learnpress'),
38
+ 'nick' => esc_html__('Nickname','learnpress'),
39
+ 'firstlast' => esc_html__('First name + Last name','learnpress'),
40
+ 'lastfirst' => esc_html__('Last name + First name','learnpress'),
41
+
42
+ );
43
+
44
  return apply_filters(
45
  'learn_press_page_settings',
46
  array(
51
  'default' => '',
52
  'type' => 'pages-dropdown'
53
  ),
54
+
55
  array(
56
  'title' => __( 'Add link to admin bar', 'learnpress' ),
57
  'id' => $this->get_field_name( 'admin_bar_link' ),
135
  'id' => $this->get_field_name( 'quiz_restrict_access' ),
136
  'default' => '404',
137
  'type' => 'select',
138
+ 'desc' => __( 'Page to display if the user has no permission to view quiz.', 'learnpress' ),
139
  'options' => array(
140
  '404' => __( '404 page', 'learnpress' ),
141
  'custom' => __( 'Restrict page', 'learnpress' ),
inc/admin/settings/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php // Silence is golden.
inc/admin/sub-menus/add-ons.php CHANGED
@@ -16,11 +16,12 @@ if ( !defined( 'ABSPATH' ) ) {
16
  */
17
  function learn_press_add_ons_page() {
18
  $current = isset( $_GET['tab'] ) ? $_GET['tab'] : '';
19
-
 
20
  ?>
21
  <div id="learn-press-add-ons-wrap" class="wrap">
22
  <h2><?php echo __( 'LearnPress Add-ons', 'learnpress' ); ?></h2>
23
- <!-- <p class="top-description"><?php _e( 'Add-ons are features that you can add or remove depending on your needs', 'learnpress' ); ?></p>-->
24
  <ul class="subsubsub">
25
  <?php
26
  do_action( 'learn_press_add_ons_before_head_tab' );
@@ -56,7 +57,24 @@ function learn_press_add_ons_page() {
56
  ?>
57
  </ul>
58
  <div class="clear"></div>
59
- <?php do_action( 'learn_press_add_ons_content_tab_' . $current, $current ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
60
  </div>
61
  <?php
62
  }
16
  */
17
  function learn_press_add_ons_page() {
18
  $current = isset( $_GET['tab'] ) ? $_GET['tab'] : '';
19
+
20
+ $theme = wp_get_theme();
21
  ?>
22
  <div id="learn-press-add-ons-wrap" class="wrap">
23
  <h2><?php echo __( 'LearnPress Add-ons', 'learnpress' ); ?></h2>
24
+ <!-- <p class="top-description"><?php _e( 'Features add-ons that you can add or remove depending on your needs.', 'learnpress' ); ?></p>-->
25
  <ul class="subsubsub">
26
  <?php
27
  do_action( 'learn_press_add_ons_before_head_tab' );
57
  ?>
58
  </ul>
59
  <div class="clear"></div>
60
+
61
+ <?php do_action( 'learn_press_add_ons_content_tab_' . $current, $current ); ?>
62
+
63
+ <?php if ( strtolower( $theme->name ) !== 'eduma' ) : ?>
64
+ <div class="theme">
65
+ <a href="https://themeforest.net/item/education-wordpress-theme-education-wp/14058034?s_rank=3">
66
+ <img src="https://thimpress.com/wp-content/uploads/2016/09/01_preview-4.jpg" />
67
+ </a>
68
+ <h2><?php _e( 'Looking for an excellent LMS and Education WordPress theme?', 'learnpress' ); ?></h2>
69
+ <p><?php printf( '%s <strong>%s</strong>', __( 'We recommend Education WP,', 'learnpress' ), __( 'the #1 Best Selling Education Theme of 2016', 'learnpress' ) ); ?></p>
70
+ <p><?php _e( 'Education WP is completely dedicated to learning with 10+ pre-designed demos and full functionalities for schools, universities, kindergartens, training centers, eLearnings, MOOCS or online courses websites.', 'learnpress' ); ?></p>
71
+ <p><?php _e( 'It is easy to use and easy to install. Your dream online school is only a few clicks away. It also comes with a bonus package of premium add-ons for LearnPress LMS that worths 439$+.', 'learnpress' ); ?></p>
72
+ <p>
73
+ <a href="https://thimpress.com/education-wordpress-theme-education-wp/" class="button" target="_blank"><?php _e( 'Read all about it', 'learnpress' ); ?></a>
74
+ <a href="https://themeforest.net/item/education-wordpress-theme-education-wp/14058034?ref=ThimPress&utm_source=learnpress&utm_medium=addondashboard" class="button button-primary" target="_blank"><?php _e( 'Get it now for only 64$', 'learnpress' ); ?></a>
75
+ </p>
76
+ </div>
77
+ <?php endif; ?>
78
  </div>
79
  <?php
80
  }
inc/admin/sub-menus/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php // Silence is golden.
inc/admin/sub-menus/settings.php CHANGED
@@ -14,9 +14,6 @@ if ( !defined( 'ABSPATH' ) ) {
14
  * Setting page
15
  */
16
  function learn_press_settings_page() {
17
- LP_Assets::enqueue_style( 'learn-press-admin' );
18
- LP_Assets::enqueue_script( 'learn-press-admin-settings', LP()->plugin_url( 'assets/js/admin/settings.js' ) );
19
-
20
 
21
  $current_tab = isset( $_GET['tab'] ) ? $_GET['tab'] : '';
22
 
@@ -36,7 +33,7 @@ function learn_press_settings_page() {
36
  </div>
37
  <?php endif; ?>
38
 
39
- <div class="wrap" id="learn-press-admin-settings">
40
  <div id="learn-press-updating-message" class="error hide-if-js">
41
  <p><?php esc_html_e( 'Settings changed. Updating...', 'learnpress' ); ?></p>
42
  </div>
@@ -52,14 +49,14 @@ function learn_press_settings_page() {
52
  <?php } ?>
53
  <?php do_action( 'learn_press_settings_tabs' ); ?>
54
  </h2>
55
- <?php
56
- do_action( 'learn_press_sections_' . $current_tab );
57
- do_action( 'learn_press_settings_' . $current_tab );
58
- ?>
59
- <p>
60
- <button class="button button-primary"><?php _e( 'Save settings', 'learnpress' ); ?></button>
61
- </p>
62
- <?php wp_nonce_field( 'learn_press_settings', 'learn_press_settings_nonce' ); ?>
63
  </form>
64
  </div>
65
  <?php
@@ -104,7 +101,7 @@ function learn_press_admin_update_settings() {
104
  $section = !empty( $_REQUEST['section'] ) ? '&section=' . $_REQUEST['section'] : '';
105
  LP_Admin_Notice::add( '<p><strong>' . __( 'Settings saved', 'learnpress' ) . '</strong></p>' );
106
 
107
- wp_redirect( admin_url( 'options-general.php?page=learn_press_settings&tab=' . $current_tab . $section . '&settings-updated=true' ) );
108
  exit();
109
  }
110
  }
14
  * Setting page
15
  */
16
  function learn_press_settings_page() {
 
 
 
17
 
18
  $current_tab = isset( $_GET['tab'] ) ? $_GET['tab'] : '';
19
 
33
  </div>
34
  <?php endif; ?>
35
 
36
+ <div class="wrap no-subtabs" id="learn-press-admin-settings">
37
  <div id="learn-press-updating-message" class="error hide-if-js">
38
  <p><?php esc_html_e( 'Settings changed. Updating...', 'learnpress' ); ?></p>
39
  </div>
49
  <?php } ?>
50
  <?php do_action( 'learn_press_settings_tabs' ); ?>
51
  </h2>
52
+ <?php do_action( 'learn_press_sections_' . $current_tab ); ?>
53
+ <div class="learn-press-settings-wrap">
54
+ <?php do_action( 'learn_press_settings_' . $current_tab ); ?>
55
+ <p>
56
+ <button class="button button-primary"><?php _e( 'Save settings', 'learnpress' ); ?></button>
57
+ </p>
58
+ <?php wp_nonce_field( 'learn_press_settings', 'learn_press_settings_nonce' ); ?>
59
+ </div>
60
  </form>
61
  </div>
62
  <?php
101
  $section = !empty( $_REQUEST['section'] ) ? '&section=' . $_REQUEST['section'] : '';
102
  LP_Admin_Notice::add( '<p><strong>' . __( 'Settings saved', 'learnpress' ) . '</strong></p>' );
103
 
104
+ wp_redirect( admin_url( 'admin.php?page=learn_press_settings&tab=' . $current_tab . $section . '&settings-updated=true' ) );
105
  exit();
106
  }
107
  }
inc/admin/sub-menus/tools.php CHANGED
@@ -10,105 +10,137 @@
10
  if ( !defined( 'ABSPATH' ) ) {
11
  exit; // Exit if accessed directly
12
  }
13
- if ( 'learn-press-remove-data' == learn_press_get_request( 'action' ) ) {
14
- add_action( 'init', 'learn_press_remove_data' );
15
- function learn_press_remove_data() {
16
- $nonce = learn_press_get_request( 'remove-data-nonce' );
17
- if ( !wp_verify_nonce( $nonce, 'learn-press-remove-data' ) ) {
18
- return;
19
- }
20
- global $wpdb;
21
- $tables = array(
22
- 'learnpress_sections',
23
- 'learnpress_section_items',
24
- 'learnpress_review_logs',
25
- 'learnpress_quiz_questions',
26
- 'learnpress_question_answers',
27
- 'learnpress_user_courses',
28
- 'learnpress_user_lessons',
29
- 'learnpress_user_quizmeta',
30
- 'learnpress_user_quizzes',
31
- 'learnpress_order_itemmeta',
32
- 'learnpress_order_items'
33
- );
34
- // drop all data in our tables
35
- foreach ( $tables as $table ) {
36
- $wpdb->query( "DELETE FROM {$wpdb->prefix}{$table}" );
37
  }
 
38
 
39
- $query = "
40
- SELECT p.ID
41
- FROM {$wpdb->posts} p
42
- WHERE p.post_type IN ('lp_course', 'lp_lesson', 'lp_quiz', 'lp_question', 'lp_order', 'lp_cert')
43
- ";
44
 
45
- // delete all custom post types and meta data
46
- if ( $ids = $wpdb->get_col( $query ) ) {
47
- $object_terms = array();
48
- foreach ( $ids as $post_id ) {
49
- // get all terms
50
- $terms = wp_get_object_terms( $post_id, array( 'course_tag', 'course_category' ) );
51
- if ( $terms ) {
52
- foreach ( $terms as $term ) {
53
- $object_terms[$term->term_id] = $term->term_id;
54
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
55
  }
56
- LP_Debug::instance()->add( $terms );
57
- }
58
 
59
- $q = $wpdb->prepare( "
60
- DELETE FROM p, pm
61
- USING {$wpdb->posts} AS p INNER JOIN {$wpdb->postmeta} AS pm ON p.ID = pm.post_id AND p.post_type IN('lp_course', 'lp_lesson', 'lp_quiz', 'lp_question', 'lp_order', 'lp_cert')
62
- WHERE %d AND p.ID IN (" . join( ',', $ids ) . ");
63
- ", 1 );
64
- $wpdb->query( $q );
65
 
66
- $wpdb->query(
67
- $wpdb->prepare( "
68
- DELETE FROM {$wpdb->postmeta} WHERE meta_key = %s
69
- ", '_learn_press_upgraded' )
70
- );
 
 
 
 
 
 
 
 
71
 
72
- if ( $object_terms ) {
73
- $deleted_terms = array();
74
- if ( $object_terms ) {
75
- foreach ( $object_terms as $term_id => $taxonomy ) {
76
- wp_delete_term( $term_id, $taxonomy );
77
- $deleted_terms[$term_id] = $taxonomy;
78
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
79
  }
80
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
81
  }
82
- // delete all options
83
- $q = $wpdb->prepare( "
84
- DELETE FROM {$wpdb->options}
85
- WHERE
86
- option_name LIKE %s
87
- OR option_name LIKE %s;
88
- ", '%' . $wpdb->esc_like( 'learn_press' ) . '%', '%' . $wpdb->esc_like( 'learnpress' ) . '%' );
89
- $wpdb->query( $q );
90
- delete_option( 'learnpress_db_version' );
91
- delete_option( 'learnpress_version' );
92
- flush_rewrite_rules();
93
- wp_redirect( admin_url( 'tools.php?page=learn_press_tools&learn-press-remove-data=1' ) );
94
- exit();
95
- }
96
  }
97
- if ( 'learn-press-remove-old-data' == learn_press_get_request( 'action' ) ) {
98
- add_action( 'init', 'learn_press_remove_old_data' );
99
- function learn_press_remove_old_data() {
 
100
  $nonce = learn_press_get_request( 'remove-old-data-nonce' );
101
  if ( !wp_verify_nonce( $nonce, 'learn-press-remove-old-data' ) ) {
102
  return;
103
  }
104
-
105
  global $wpdb;
106
- $query = "
107
- SELECT p.ID
108
- FROM {$wpdb->posts} p
109
- WHERE p.post_type IN ('lpr_course', 'lpr_lesson', 'lpr_quiz', 'lpr_question', 'lpr_order', 'lpr_certificate')
110
- ";
111
-
112
  // delete all custom post types and meta data
113
  if ( $ids = $wpdb->get_col( $query ) ) {
114
  $object_terms = array();
@@ -159,11 +191,13 @@ if ( 'learn-press-remove-old-data' == learn_press_get_request( 'action' ) ) {
159
  OR meta_key LIKE %s
160
  ", '%' . $wpdb->esc_like( 'lpr_' ) . '%', $wpdb->esc_like( 'lpr_' ) . '%' )
161
  );
162
- }
163
 
164
- flush_rewrite_rules();
165
- wp_redirect( admin_url( 'tools.php?page=learn_press_tools' ) );
166
- exit();
 
 
 
167
  }
168
  /**
169
  * Add-on page
@@ -176,10 +210,10 @@ function learn_press_tools_page() {
176
  <h2><?php _e( 'Upgrade courses', 'learnpress' ); ?></h2>
177
  <p><?php _e( 'Upgrade courses, lessons, quizzes and questions from version less than 1.0.', 'learnpress' ); ?></p>
178
  <div class="learn-press-message">
179
- <?php _e( 'Use this action to force system upgrade outdated data to new version.', 'learnpress' ); ?>
180
  </div>
181
  <div class="learn-press-error">
182
- <?php _e( 'All course will be upgraded whether you have done this action in the past. So please remove all courses before upgrade to prevent courses is duplicated.', 'learnpress' ); ?>
183
  </div>
184
  <p>
185
  <a class="button" href="<?php echo wp_nonce_url( admin_url( 'options-general.php?page=learn_press_upgrade_from_09&force=true' ), 'learn-press-upgrade-09' ); ?>"><?php esc_html_e( 'Upgrade', 'learnpress' ); ?></a>
@@ -190,11 +224,11 @@ function learn_press_tools_page() {
190
  <p><?php _e( 'Remove all courses, lessons, quizzes and questions', 'learnpress' ); ?></p>
191
  <form method="post" name="learn-press-form-remove-data">
192
  <div class="learn-press-message learn-press-error">
193
- <?php _e( 'Be careful before use this action!', 'learnpress' ); ?>
194
  </div>
195
  <label class="hide-if-js">
196
  <input type="checkbox" name="action" value="learn-press-remove-data" />
197
- <?php _e( 'Check this box and click button again to confirm.', 'learnpress' ); ?>
198
  </label>
199
  <p>
200
  <button class="button button-fade"><?php esc_html_e( 'Remove', 'learnpress' ); ?></button>
@@ -207,11 +241,11 @@ function learn_press_tools_page() {
207
  <p><?php _e( 'Remove all courses, lessons, quizzes and questions from version less than 1.0.', 'learnpress' ); ?></p>
208
  <form method="post" name="learn-press-form-remove-data">
209
  <div class="learn-press-message learn-press-error">
210
- <?php _e( 'Be careful before use this action! Only use this action in case all data is outdated has upgraded.', 'learnpress' ); ?>
211
  </div>
212
  <label class="hide-if-js">
213
  <input type="checkbox" name="action" value="learn-press-remove-old-data" />
214
- <?php _e( 'Check this box and click button again to confirm.', 'learnpress' ); ?>
215
  </label>
216
  <p>
217
  <button class="button button-fade"><?php esc_html_e( 'Remove', 'learnpress' ); ?></button>
10
  if ( !defined( 'ABSPATH' ) ) {
11
  exit; // Exit if accessed directly
12
  }
13
+ add_action( 'init', 'learn_press_tool_request_actions' );
14
+ if ( !function_exists( 'learn_press_tool_request_actions' ) ) {
15
+
16
+ function learn_press_tool_request_actions() {
17
+ $action = learn_press_get_request( 'action' );
18
+ if ( ! $action ) return;
19
+ if ( current_user_can( 'manage_options' ) ) {
20
+ switch ( $action ) {
21
+ case 'learn-press-remove-data':
22
+ learn_press_remove_data();
23
+ break;
24
+ case 'learn-press-remove-old-data':
25
+ learn_press_remove_old_data();
26
+ break;
27
+ default:
28
+ break;
29
+ }
30
+ } else {
31
+ wp_die( __( 'Sorry, you are nto allowed to access this page.', 'learnpress' ) );
 
 
 
 
 
32
  }
33
+ }
34
 
35
+ }
 
 
 
 
36
 
37
+ if ( !function_exists( 'learn_press_remove_data' ) ) {
38
+ function learn_press_remove_data() {
39
+ $nonce = learn_press_get_request( 'remove-data-nonce' );
40
+ if ( !wp_verify_nonce( $nonce, 'learn-press-remove-data' ) ) {
41
+ return;
42
+ }
43
+ global $wpdb;
44
+ $tables = array(
45
+ 'learnpress_sections',
46
+ 'learnpress_section_items',
47
+ 'learnpress_review_logs',
48
+ 'learnpress_quiz_questions',
49
+ 'learnpress_question_answers',
50
+ 'learnpress_user_courses',
51
+ 'learnpress_user_lessons',
52
+ 'learnpress_user_quizmeta',
53
+ 'learnpress_user_quizzes',
54
+ 'learnpress_order_itemmeta',
55
+ 'learnpress_order_items'
56
+ );
57
+ // drop all data in our tables
58
+ foreach ( $tables as $table ) {
59
+ $table = $wpdb->prefix.$table;
60
+ if ( $wpdb->get_var("SHOW TABLES LIKE '{$table}'") === $table ) {
61
+ $wpdb->query( "DELETE FROM {$table}" );
62
+ }
63
  }
 
 
64
 
65
+ $query = "
66
+ SELECT p.ID
67
+ FROM {$wpdb->posts} p
68
+ WHERE p.post_type IN ('lp_course', 'lp_lesson', 'lp_quiz', 'lp_question', 'lp_order', 'lp_cert')
69
+ ";
 
70
 
71
+ // delete all custom post types and meta data
72
+ if ( $ids = $wpdb->get_col( $query ) ) {
73
+ $object_terms = array();
74
+ foreach ( $ids as $post_id ) {
75
+ // get all terms
76
+ $terms = wp_get_object_terms( $post_id, array( 'course_tag', 'course_category' ) );
77
+ if ( $terms ) {
78
+ foreach ( $terms as $term ) {
79
+ $object_terms[$term->term_id] = $term->term_id;
80
+ }
81
+ }
82
+ LP_Debug::instance()->add( $terms );
83
+ }
84
 
85
+ $q = $wpdb->prepare( "
86
+ DELETE FROM p, pm
87
+ USING {$wpdb->posts} AS p INNER JOIN {$wpdb->postmeta} AS pm ON p.ID = pm.post_id AND p.post_type IN('lp_course', 'lp_lesson', 'lp_quiz', 'lp_question', 'lp_order', 'lp_cert')
88
+ WHERE %d AND p.ID IN (" . join( ',', $ids ) . ");
89
+ ", 1 );
90
+ $wpdb->query( $q );
91
+
92
+ $wpdb->query(
93
+ $wpdb->prepare( "
94
+ DELETE FROM {$wpdb->postmeta} WHERE meta_key = %s
95
+ ", '_learn_press_upgraded' )
96
+ );
97
+
98
+ if ( $object_terms ) {
99
+ $deleted_terms = array();
100
+ if ( $object_terms ) {
101
+ foreach ( $object_terms as $term_id => $taxonomy ) {
102
+ wp_delete_term( $term_id, $taxonomy );
103
+ $deleted_terms[$term_id] = $taxonomy;
104
+ }
105
+ }
106
+ }
107
  }
108
+ // delete all options
109
+ $q = $wpdb->prepare( "
110
+ DELETE FROM {$wpdb->options}
111
+ WHERE
112
+ option_name LIKE %s
113
+ OR option_name LIKE %s;
114
+ ", '%' . $wpdb->esc_like( 'learn_press' ) . '%', '%' . $wpdb->esc_like( 'learnpress' ) . '%' );
115
+ $wpdb->query( $q );
116
+ delete_option( 'learnpress_db_version' );
117
+ delete_option( 'learnpress_version' );
118
+
119
+ # Remove categories
120
+ $q = $wpdb->prepare( "
121
+ DELETE tt , t
122
+ FROM {$wpdb->term_taxonomy} tt
123
+ INNER JOIN
124
+ {$wpdb->terms} AS t ON tt.term_id = t.term_id
125
+ WHERE
126
+ tt.taxonomy = 'course_category'");
127
+ $wpdb->query( $q );
128
+ LP_Admin_Notice::add( __( 'All courses, lessons, quizzes and questions have been removed', 'learnpress' ), 'updated', '', true );
129
+ // flush_rewrite_rules();
130
+ wp_redirect( admin_url( 'admin.php?page=learn_press_tools&learn-press-remove-data=1' ) );
131
+ exit();
132
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
133
  }
134
+
135
+ if ( !function_exists( 'learn_press_remove_old_data' ) ) {
136
+
137
+ function learn_press_remove_old_data() {
138
  $nonce = learn_press_get_request( 'remove-old-data-nonce' );
139
  if ( !wp_verify_nonce( $nonce, 'learn-press-remove-old-data' ) ) {
140
  return;
141
  }
 
142
  global $wpdb;
143
+ $query = $wpdb->prepare("SELECT ID FROM {$wpdb->posts} WHERE post_type IN ( %s, %s, %s, %s, %s, %s )", 'lpr_course', 'lpr_lesson', 'lpr_quiz', 'lpr_question', 'lpr_order', 'lpr_certificate');
 
 
 
 
 
144
  // delete all custom post types and meta data
145
  if ( $ids = $wpdb->get_col( $query ) ) {
146
  $object_terms = array();
191
  OR meta_key LIKE %s
192
  ", '%' . $wpdb->esc_like( 'lpr_' ) . '%', $wpdb->esc_like( 'lpr_' ) . '%' )
193
  );
 
194
 
195
+ LP_Admin_Notice::add( __( 'Outdated data from version less than 1.0 have been removed', 'learnpress' ), 'updated', '', true );
196
+ //flush_rewrite_rules();
197
+ // header('Location: '.admin_url( 'admin.php?page=learn_press_tools' ));
198
+ wp_redirect( admin_url( 'admin.php?page=learn_press_tools' ) );
199
+ exit();
200
+ }
201
  }
202
  /**
203
  * Add-on page
210
  <h2><?php _e( 'Upgrade courses', 'learnpress' ); ?></h2>
211
  <p><?php _e( 'Upgrade courses, lessons, quizzes and questions from version less than 1.0.', 'learnpress' ); ?></p>
212
  <div class="learn-press-message">
213
+ <?php _e( 'Use this action to force system to upgrade outdated data to latest version.', 'learnpress' ); ?>
214
  </div>
215
  <div class="learn-press-error">
216
+ <?php _e( 'All courses will be upgraded whether you have done this action in the past. So please remove all courses before you upgrade to prevent duplicated courses.', 'learnpress' ); ?>
217
  </div>
218
  <p>
219
  <a class="button" href="<?php echo wp_nonce_url( admin_url( 'options-general.php?page=learn_press_upgrade_from_09&force=true' ), 'learn-press-upgrade-09' ); ?>"><?php esc_html_e( 'Upgrade', 'learnpress' ); ?></a>
224
  <p><?php _e( 'Remove all courses, lessons, quizzes and questions', 'learnpress' ); ?></p>
225
  <form method="post" name="learn-press-form-remove-data">
226
  <div class="learn-press-message learn-press-error">
227
+ <?php _e( 'Be careful before using this action!', 'learnpress' ); ?>
228
  </div>
229
  <label class="hide-if-js">
230
  <input type="checkbox" name="action" value="learn-press-remove-data" />
231
+ <?php _e( 'Check this box and click this button again to confirm.', 'learnpress' ); ?>
232
  </label>
233
  <p>
234
  <button class="button button-fade"><?php esc_html_e( 'Remove', 'learnpress' ); ?></button>
241
  <p><?php _e( 'Remove all courses, lessons, quizzes and questions from version less than 1.0.', 'learnpress' ); ?></p>
242
  <form method="post" name="learn-press-form-remove-data">
243
  <div class="learn-press-message learn-press-error">
244
+ <?php _e( 'Be careful before using this action! Only use this action in case all outdated data has been upgraded.', 'learnpress' ); ?>
245
  </div>
246
  <label class="hide-if-js">
247
  <input type="checkbox" name="action" value="learn-press-remove-old-data" />
248
+ <?php _e( 'Check this box and click this button again to confirm.', 'learnpress' ); ?>
249
  </label>
250
  <p>
251
  <button class="button button-fade"><?php esc_html_e( 'Remove', 'learnpress' ); ?></button>
inc/admin/views/admin-notice.php CHANGED
@@ -3,11 +3,11 @@
3
  * Template for display a notice in admin
4
  */
5
 
6
- if ( ! defined( 'ABSPATH' ) ) {
7
  exit;
8
  }
9
-
10
  ?>
11
- <div<?php if( ! empty( $id ) ) echo ' id="' . $id . '"';?> class="<?php echo $type;?>">
12
- <?php echo $message;?>
13
  </div>
3
  * Template for display a notice in admin
4
  */
5
 
6
+ if ( !defined( 'ABSPATH' ) ) {
7
  exit;
8
  }
9
+ $classes = array( $type );
10
  ?>
11
+ <div<?php if ( !empty( $id ) ) echo ' id="' . $id . '"'; ?> class="<?php echo join( ' ', $classes ); ?>">
12
+ <p><?php echo $message; ?></p>
13
  </div>
inc/admin/views/admin-template.php CHANGED
@@ -13,11 +13,37 @@
13
  <# if(data.addText){ #>{{data.addText}}<# }else{ #><?php _e( 'Add', 'learnpress' );?><# } #>
14
  </button>
15
  <button class="lp-add-item close button" disabled="disabled" data-text="<# if(data.addAndCloseText){ #>{{data.addAndCloseText}}<# }else{ #><?php _e( 'Add and Close', 'learnpress' ); ?><# } #>">
16
- <# if(data.addAndCloseText){ #>{{data.addAndCloseText}}
17
- <# }else{ #><?php _e( 'Add and Close', 'learnpress' ); ?>
18
- <# } #>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  </button>
20
- <button class="close-modal button" onclick="LearnPress.MessageBox.hide();"><# if(data.closeText){ #>{{data.closeText}}<# }else{ #><?php _e( 'Close', 'learnpress' );?><# } #></button>
21
  </footer>
22
  </div>
23
  </script>
13
  <# if(data.addText){ #>{{data.addText}}<# }else{ #><?php _e( 'Add', 'learnpress' );?><# } #>
14
  </button>
15
  <button class="lp-add-item close button" disabled="disabled" data-text="<# if(data.addAndCloseText){ #>{{data.addAndCloseText}}<# }else{ #><?php _e( 'Add and Close', 'learnpress' ); ?><# } #>">
16
+ <# if(data.addAndCloseText){ #>
17
+ {{data.addAndCloseText}}
18
+ <# }else{ #>
19
+ <?php _e( 'Add and Close', 'learnpress' ); ?>
20
+ <# } #>
21
+ </button>
22
+ <button class="close-modal button" onclick="LP.MessageBox.hide();">
23
+ <# if(data.closeText){ #>
24
+ {{data.closeText}}
25
+ <# }else{ #>
26
+ <?php _e( 'Close', 'learnpress' ); ?>
27
+ <# } #>
28
+ </button>
29
+ </footer>
30
+ </div>
31
+ </script>
32
+ <script type="text/html" id="tmpl-learn-press-duplicate-course">
33
+ <div id="learn-press-duplicate-course" class="modal-inner lp-modal-search">
34
+ <header>
35
+ <h3><?php _e( 'Duplicate', 'learnpress' ); ?> <strong>{{ data.title }}</strong> <?php _e( 'course', 'learnpress' ); ?></h3>
36
+ </header>
37
+ <footer>
38
+ <button class="lp-duplicate-course all-content button learn-press-tooltip" data-id="{{ data.id }}" data-nonce="<?php echo esc_attr( wp_create_nonce( 'lp-duplicate-course' ) ) ?>" data-text="<?php esc_attr_e( 'Duplicating ...', 'learnpress' ) ?>" data-content="<?php esc_attr_e( 'Duplicate course\'s curriculum', 'learnpress' ); ?>">
39
+ <?php _e( 'All Content', 'learnpress' ); ?>
40
+ </button>
41
+ <button class="lp-duplicate-course button learn-press-tooltip" data-id="{{ data.id }}" data-nonce="<?php echo esc_attr( wp_create_nonce( 'lp-duplicate-course' ) ) ?>" data-text="<?php esc_attr_e( 'Duplicating ...', 'learnpress' ) ?>" data-content="<?php esc_attr_e( 'Duplicate course no curriculum', 'learnpress' ); ?>">
42
+ <?php _e( 'No Content', 'learnpress' ); ?>
43
+ </button>
44
+ <button class="close-modal button" onclick="LP.MessageBox.hide();">
45
+ <?php _e( 'Close', 'learnpress' ); ?>
46
  </button>
 
47
  </footer>
48
  </div>
49
  </script>
inc/admin/views/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php // Silence is golden.
inc/admin/views/meta-boxes/course/curriculum.php CHANGED
@@ -1,75 +1,44 @@
1
  <?php
2
- /*
3
- $exclude_quiz = array();
4
- $exclude_lesson = array();
5
- $current_user = get_current_user_id();
6
- global $wpdb;
7
- $q = $wpdb->prepare(
8
- "SELECT pm.meta_value
9
- FROM $wpdb->posts AS p
10
- INNER JOIN $wpdb->postmeta AS pm ON p.ID = pm.post_id
11
- WHERE p.post_type = %s
12
- AND p.post_author = %d
13
- AND pm.meta_key = %s",
14
- LP()->course_post_type,
15
- $current_user,
16
- '_lpr_course_lesson_quiz'
17
- );
18
- $used_item = $wpdb->get_col(
19
- $q
20
- );
21
-
22
- for ( $i = 0; $i < count( $used_item ); $i ++ ) {
23
- $lesson_quiz_array = unserialize( $used_item[$i] );
24
- for ( $j = 0; $j < count( $lesson_quiz_array ); $j ++ ) {
25
- if ( isset( $lesson_quiz_array[$j]['lesson_quiz'] ) ) {
26
- foreach ( $lesson_quiz_array[$j]['lesson_quiz'] as $key => $value ) {
27
- array_push( $exclude_lesson, $value );
28
- array_push( $exclude_quiz, $value );
29
- }
30
- }
31
- }
32
- }*/
33
  global $post;
34
  $course_sections = $course->get_curriculum();
35
-
36
  $hidden_sections = (array) get_post_meta( $post->ID, '_admin_hidden_sections', true );
37
  ?>
38
  <div id="lp-course-curriculum" class="lp-course-curriculum">
39
- <h3 class="curriculum-heading">
40
- <?php _e( 'Curriculum', 'learnpress' ); ?>
41
- <span class="description"><?php _e( 'Outline your course and add content with sections, lessons and quizzes.', 'learnpress' ); ?></span>
42
 
43
- <p align="right" class="items-toggle">
44
- <a href="" data-action="expand" class="dashicons dashicons-arrow-down<?php echo !sizeof( $hidden_sections ) ? ' hide-if-js' : ''; ?>" title="<?php _e( 'Expand All', 'learnpress' ); ?>"></a>
45
- <a href="" data-action="collapse" class="dashicons dashicons-arrow-up<?php echo sizeof( $hidden_sections ) ? ' hide-if-js' : ''; ?>" title="<?php _e( 'Collapse All', 'learnpress' ); ?>"></a>
46
- </p>
47
- </h3>
48
- <!---->
49
- <ul class="curriculum-sections">
50
- <?php
51
- if ( $course_sections ):
52
- foreach ( $course_sections as $k => $section ):
53
 
54
- $content_items = '';
55
 
56
- if ( $section->items ):
57
- foreach ( $section->items as $item ):
58
- $loop_item_view = learn_press_get_admin_view( 'meta-boxes/course/loop-item.php' );
59
- ob_start();
60
- include $loop_item_view;
61
- $content_items .= "\n" . ob_get_clean();
62
- endforeach;
63
- endif;
64
 
65
- include learn_press_get_admin_view( 'meta-boxes/course/loop-section.php' );
66
- endforeach;
67
- unset( $content_items );
68
- endif;
69
- if ( !empty( $section ) ) foreach ( get_object_vars( $section ) as $k => $v ) {
70
- $section->{$k} = null;
71
- }
72
- include learn_press_get_admin_view( 'meta-boxes/course/loop-section.php' );
73
- ?>
74
- </ul>
 
75
  </div>
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  global $post;
3
  $course_sections = $course->get_curriculum();
 
4
  $hidden_sections = (array) get_post_meta( $post->ID, '_admin_hidden_sections', true );
5
  ?>
6
  <div id="lp-course-curriculum" class="lp-course-curriculum">
7
+ <h3 class="curriculum-heading">
8
+ <?php _e( 'Curriculum', 'learnpress' ); ?>
9
+ <span class="description"><?php _e( 'Outline your course and add content with sections, lessons and quizzes.', 'learnpress' ); ?></span>
10
 
11
+ <p align="right" class="items-toggle">
12
+ <a href="" data-action="expand" class="dashicons dashicons-arrow-down<?php echo!sizeof( $hidden_sections ) ? ' hide-if-js' : ''; ?>" title="<?php _e( 'Expand All', 'learnpress' ); ?>"></a>
13
+ <a href="" data-action="collapse" class="dashicons dashicons-arrow-up<?php echo sizeof( $hidden_sections ) ? ' hide-if-js' : ''; ?>" title="<?php _e( 'Collapse All', 'learnpress' ); ?>"></a>
14
+ </p>
15
+ </h3>
16
+ <!---->
17
+ <ul class="curriculum-sections">
18
+ <?php
19
+ if ( $course_sections ):
20
+ foreach ( $course_sections as $k => $section ):
21
 
22
+ $content_items = '';
23
 
24
+ if ( $section->items ):
25
+ foreach ( $section->items as $item ):
26
+ $loop_item_view = learn_press_get_admin_view( 'meta-boxes/course/loop-item.php' );
27
+ ob_start();
28
+ include $loop_item_view;
29
+ $content_items .= "\n" . ob_get_clean();
30
+ endforeach;
31
+ endif;
32
 
33
+ include learn_press_get_admin_view( 'meta-boxes/course/loop-section.php' );
34
+ endforeach;
35
+ unset( $content_items );
36
+ endif;
37
+ if ( !empty( $section ) )
38
+ foreach ( get_object_vars( $section ) as $k => $v ) {
39
+ $section->{$k} = null;
40
+ }
41
+ include learn_press_get_admin_view( 'meta-boxes/course/loop-section.php' );
42
+ ?>
43
+ </ul>
44
  </div>
inc/admin/views/meta-boxes/course/editor.php CHANGED
@@ -1,3 +1,114 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  <div id="course-editor" class="course-editor">
2
  <div class="course-curriculum">
3
  asdsadsad
1
+ <script type="text/html" id="tmpl-course-editor">
2
+ <div id="learn-press-course-editor" class="course-editor">
3
+ <div id="course-item-editor"></div>
4
+ <div id="course-curriculum">
5
+
6
+ </div>
7
+ <button class="button button-add-section" type="button"><?php esc_html_e( 'Add Section', 'learnpress' ); ?></button>
8
+ </div>
9
+ </script>
10
+
11
+ <script type="text/html" id="tmpl-course-section">
12
+ <div class="course-section" data-section_id="{{data.section_id}}" data-temp_id="{{data.temp_id}}">
13
+ <input type="hidden" name="LP[section][{{data.temp_id}}][_origin_id]" value="{{data.section_id}}" />
14
+ <div class="section-head">
15
+ <input type="text" class="section-name" name="LP[section][{{data.temp_id}}][title]" placeholder="<?php esc_attr_e( 'New section title', 'learnpress' ); ?>" value="{{data.section_name}}" />
16
+ <span class="section-move"></span>
17
+ <div class="course-row-actions">
18
+ <a class="remove" data-action="remove" href=""><?php esc_html_e( 'Remove', 'learnpress' ); ?></a>
19
+ <a class="add" data-action="add" href=""><?php esc_html_e( 'Add', 'learnpress' ); ?></a>
20
+ <a class="toggle" data-action="toggle" href="">+</a>
21
+ </div>
22
+ </div>
23
+ <div class="section-body">
24
+ <ul class="section-items section-empty">
25
+
26
+ </ul>
27
+ <div class="section-add-content">
28
+ <ul class="section-content-types">
29
+ <li class="dashicons dashicons-clock" data-post_type="lp_quiz" data-post_title="<?php esc_attr_e( 'New quiz name', 'learnpress' ); ?>"></li>
30
+ <li class="dashicons dashicons-media-default" data-post_type="lp_lesson" data-post_title="<?php esc_attr_e( 'New lesson name', 'learnpress' ); ?>"></li>
31
+ </ul>
32
+ <button class="button button-add-content"><?php esc_html_e( 'Add Content', 'learnpress' ); ?></button>
33
+ <button class="button button-add-exists-content"><?php esc_html_e( 'Add Existing Content', 'learnpress' ); ?></button>
34
+ </div>
35
+ </div>
36
+ </div>
37
+ </script>
38
+
39
+ <script type="text/html" id="tmpl-course-section-item">
40
+ <li class="course-section-item" data-ID="{{data.ID}}" data-temp_id="{{data.temp_id}}">
41
+ <input type="hidden" name="LP[section][{{data.section.temp_id}}][items][{{data.temp_id}}][_origin_id]" value="{{data.section_item_id}}" />
42
+ <input type="hidden" name="LP[section][{{data.section.temp_id}}][items][{{data.temp_id}}][item_id]" value="{{data.ID}}" />
43
+ <input type="hidden" name="LP[section][{{data.section.temp_id}}][items][{{data.temp_id}}][item_type]" value="{{data.post_type}}" />
44
+
45
+ <input type="text" class="item-name" name="LP[section][{{data.section.temp_id}}][items][{{data.temp_id}}][title]" placeholder="<?php esc_attr_e( 'New item title', 'learnpress' ); ?>" value="{{data.post_title}}">
46
+ <span class="section-item-move"></span>
47
+ <div class="course-row-actions ">
48
+ <a class="remove" data-action="remove-item" href=""><?php esc_html_e( 'Remove', 'learnpress' ); ?></a>
49
+ <a class="quick-edit" data-action="quick-edit" href=""><?php esc_html_e( 'Quick edit', 'learnpress' ); ?></a>
50
+ </div>
51
+ </li>
52
+ </script>
53
+
54
+ <script type="text/html" id="tmpl-course-item-editor">
55
+ <div class="course-item-editor">
56
+ <ul>
57
+ <li>
58
+ <h3><?php esc_html_e( 'Title', 'learnpress' ); ?></th></h3>
59
+ <input type="text" class="regular-text" value="{{data.post_title}}" />
60
+ </li>
61
+ <li>
62
+ <h3><?php esc_html_e( 'Content', 'learnpress' ); ?></h3>
63
+ <#
64
+ var editor = jQuery(wp.template('course-item-wp-editor')({id: 'course-item-content-'+data.temp_id, content: data.post_content})).html();
65
+ #>
66
+ {{{editor}}}
67
+ </li>
68
+ </ul>
69
+ </div>
70
+ </script>
71
+
72
+ <script type="text/html" id="tmpl-course-item-wp-editor">
73
+ <div>
74
+ <div id="wp-{{data.id}}-wrap" class="wp-core-ui wp-editor-wrap html-active" style="visibility: hidden">
75
+ <div id="wp-{{data.id}}-editor-tools" class="wp-editor-tools hide-if-no-js">
76
+ <div id="wp-{{data.id}}-media-buttons" class="wp-media-buttons">
77
+ <button type="button" id="insert-media-button" class="button insert-media add_media" data-editor="{{data.id}}">
78
+ <span class="wp-media-buttons-icon"></span> Add Media
79
+ </button>
80
+ </div>
81
+ <div class="wp-editor-tabs">
82
+ <button type="button" id="{{data.id}}-tmce" class="wp-switch-editor switch-tmce" data-wp-editor-id="{{data.id}}">Visual</button>
83
+ <button type="button" id="{{data.id}}-html" class="wp-switch-editor switch-html" data-wp-editor-id="{{data.id}}">Text</button>
84
+ </div>
85
+ </div>
86
+ <div id="wp-{{data.id}}-editor-container" class="wp-editor-container">
87
+ <div id="qt_{{data.id}}_toolbar" class="quicktags-toolbar"></div>
88
+ <textarea class="wp-editor-area" rows="20" autocomplete="off" cols="40" name="{{data.id}}" id="{{data.id}}">{{data.content}}</textarea>
89
+ </div>
90
+ </div>
91
+ </div>
92
+ </script>
93
+
94
+ <script type="text/html" id="tmpl-section-content-types">
95
+ <div class="section-content-types">
96
+ <span class="dashicons dashicons-clock" data-post_type="lp_quiz"></span>
97
+ <span class="dashicons dashicons-media-default" data-post_type="lp_lesson"></span>
98
+ </div>
99
+ </script>
100
+
101
+ <?php
102
+
103
+ global $post;
104
+ $course = learn_press_get_course( $post->ID );
105
+ $json = array(
106
+ 'sections' => $course->get_curriculum()
107
+ )
108
+ ?>
109
+ <script type="text/javascript">
110
+ var Course_Settings = <?php echo wp_json_encode( $json, JSON_PRETTY_PRINT );?>
111
+ </script>
112
  <div id="course-editor" class="course-editor">
113
  <div class="course-curriculum">
114
  asdsadsad
inc/admin/views/meta-boxes/course/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php // Silence is golden.
inc/admin/views/meta-boxes/course/js-template.php CHANGED
@@ -30,7 +30,7 @@
30
  </script>
31
  <script type="text/html" id="tmpl-section-item">
32
  <?php
33
- $item = learn_press_post_object( array( 'post_type' => LP()->lesson_post_type ) );
34
  $item->post_title = '{{data.text}}';
35
  $item->item_id = '{{data.id}}';
36
  $item->post_type = '{{data.type}}';
@@ -73,7 +73,7 @@
73
  <li class="lp-search-no-results hide-if-js" data-id="0"><?php _e( 'No results', 'learnpress' );?></li>
74
  </ul>
75
  <button class="lp-add-item button" disabled="disabled" data-text="<?php _e( 'Add to section', 'learnpress' );?>"><?php _e( 'Add to section', 'learnpress' );?></button>
76
- <button class="lp-close-lightbox button" onclick="LearnPress.MessageBox.hide();"><?php _e( 'Close', 'learnpress' );?></button>
77
  </div>
78
  </script>
79
  <script type="text/html" id="tmpl-lp-modal-search-quiz">
@@ -106,7 +106,7 @@
106
  <li class="lp-search-no-results hide-if-js" data-id="0"><?php _e( 'No results', 'learnpress' );?></li>
107
  </ul>
108
  <button class="lp-add-item button" disabled="disabled" data-text="<?php _e( 'Add to section', 'learnpress' );?>"><?php _e( 'Add to section', 'learnpress' );?></button>
109
- <button class="lp-close-lightbox button" onclick="LearnPress.MessageBox.hide();"><?php _e( 'Close', 'learnpress' );?></button>
110
  </div>
111
  </script>
112
  <script type="text/javascript">
30
  </script>
31
  <script type="text/html" id="tmpl-section-item">
32
  <?php
33
+ $item = learn_press_post_object( array( 'post_type' => LP_LESSON_CPT ) );
34
  $item->post_title = '{{data.text}}';
35
  $item->item_id = '{{data.id}}';
36
  $item->post_type = '{{data.type}}';
73
  <li class="lp-search-no-results hide-if-js" data-id="0"><?php _e( 'No results', 'learnpress' );?></li>
74
  </ul>
75
  <button class="lp-add-item button" disabled="disabled" data-text="<?php _e( 'Add to section', 'learnpress' );?>"><?php _e( 'Add to section', 'learnpress' );?></button>
76
+ <button class="lp-close-lightbox button" onclick="LP.MessageBox.hide();"><?php _e( 'Close', 'learnpress' ); ?></button>
77
  </div>
78
  </script>
79
  <script type="text/html" id="tmpl-lp-modal-search-quiz">
106
  <li class="lp-search-no-results hide-if-js" data-id="0"><?php _e( 'No results', 'learnpress' );?></li>
107
  </ul>
108
  <button class="lp-add-item button" disabled="disabled" data-text="<?php _e( 'Add to section', 'learnpress' );?>"><?php _e( 'Add to section', 'learnpress' );?></button>
109
+ <button class="lp-close-lightbox button" onclick="LP.MessageBox.hide();"><?php _e( 'Close', 'learnpress' ); ?></button>
110
  </div>
111
  </script>
112
  <script type="text/javascript">
inc/admin/views/meta-boxes/course/loop-item.php CHANGED
@@ -5,58 +5,54 @@
5
  * @package Admin/Views
6
  */
7
  if ( !isset( $section ) ) {
8
- $section = null;
9
  }
10
  $section_item_id = !empty( $item->section_item_id ) ? $item->section_item_id : null;
11
- $item_id = !empty( $item->item_id ) ? $item->item_id : null;
12
- $group_name = '_lp_curriculum[__SECTION__][items][' . ( $section_item_id ? $section_item_id : '__ITEM__' ) . ']';
13
 
14
- $support_types = apply_filters(
15
- 'learn_press_support_item_types', array(
16
- 'lp_lesson' => __( 'Lesson', 'learnpress' ),
17
- 'lp_quiz' => __( 'Quiz', 'learnpress' )
18
- )
19
- );
20
  if ( !empty( $support_types[$item->post_type] ) ) {
21
- $item_selected = $item->post_type;
22
  } else {
23
- $item_selected = key( $support_types );
24
  }
25
  ?>
26
 
27
  <?php do_action( 'learn_press_admin_before_section_loop_item', $item, $section ); ?>
28
 
29
  <tr <?php learn_press_admin_section_loop_item_class( $item, $section ); ?> data-text="<?php echo esc_attr( $item->post_title ); ?>" data-item_id="<?php echo $item_id; ?>" data-section_item_id="<?php echo $section_item_id; ?>" data-type="<?php echo $item->post_type; ?>">
30
- <?php do_action( 'learn_press_admin_begin_section_item', $item, $section ); ?>
31
- <td class="section-item-icon">
32
- <div class="learn-press-dropdown-item-types">
33
- <span class="learn-press-icon item-<?php echo $item->post_type; ?>" data-type="<?php echo $item->post_type; ?>"></span>
34
- <ul>
35
- <?php foreach ( $support_types as $_type => $text ) { ?>
36
- <li>
37
- <span class="learn-press-icon<?php echo $_type == $item_selected ? ' item-selected' : ''; ?> item-<?php echo $_type; ?>" title="<?php echo sprintf( __( 'Switch to %s', 'learnpress' ), $text ); ?>" data-type="<?php echo $_type; ?>"></span>
38
- </li>
39
- <?php } ?>
40
- </ul>
41
- </div>
42
- </td>
43
- <td class="section-item-input">
44
- <input type="text" name="<?php echo $group_name; ?>[name]" class="lp-item-name no-submit" data-field="item-name" value="<?php echo esc_attr( $item->post_title ); ?>" placeholder="<?php _e( 'Enter name of new item here and press Enter', 'learnpress' ); ?>" />
45
- <input type="hidden" name="<?php echo $group_name; ?>[old_name]" value="<?php echo esc_attr( $item->post_title ); ?>" />
46
- <input type="hidden" name="<?php echo $group_name; ?>[item_id]" value="<?php echo $item_id; ?>" />
47
- <input type="hidden" name="<?php echo $group_name; ?>[section_item_id]" value="<?php echo $section_item_id; ?>" />
48
- <input type="hidden" class="lp-item-type" name="<?php echo $group_name; ?>[post_type]" value="<?php echo $item->post_type; ?>" />
49
- </td>
50
- <td class="section-item-actions">
51
- <p class="lp-item-actions lp-button-actions">
52
- <?php do_action( 'learn_press_admin_begin_section_item_actions', $item, $section ); ?>
53
- <a href="<?php echo absint( $item_id ) ? get_edit_post_link( $item_id ) : '{{data.edit_link}}'; ?>" class="lp-item-action lp-edit dashicons dashicons-edit" target="_blank"><?php _e( '', 'learnpress' ); ?></a>
54
- <a href="" class="lp-item-action lp-remove dashicons dashicons-trash" data-confirm-remove="<?php _e( 'Are you sure you want to remove this item?', 'learnpress' ); ?>"><?php _e( '', 'learnpress' ); ?></a>
55
- <span class="item-checkbox">
56
- <input type="checkbox" value="<?php echo $section_item_id; ?>" />
57
- </span>
58
- <?php do_action( 'learn_press_admin_end_section_item_actions', $item, $section ); ?>
59
- </p>
60
- </td>
61
- <?php do_action( 'learn_press_admin_end_section_item', $item, $section ); ?>
 
62
  </tr>
5
  * @package Admin/Views
6
  */
7
  if ( !isset( $section ) ) {
8
+ $section = null;
9
  }
10
  $section_item_id = !empty( $item->section_item_id ) ? $item->section_item_id : null;
11
+ $item_id = !empty( $item->item_id ) ? $item->item_id : null;
12
+ $group_name = '_lp_curriculum[__SECTION__][items][' . ( $section_item_id ? $section_item_id : '__ITEM__' ) . ']';
13
 
14
+ $support_types = learn_press_course_get_support_item_types();
 
 
 
 
 
15
  if ( !empty( $support_types[$item->post_type] ) ) {
16
+ $item_selected = $item->post_type;
17
  } else {
18
+ $item_selected = key( $support_types );
19
  }
20
  ?>
21
 
22
  <?php do_action( 'learn_press_admin_before_section_loop_item', $item, $section ); ?>
23
 
24
  <tr <?php learn_press_admin_section_loop_item_class( $item, $section ); ?> data-text="<?php echo esc_attr( $item->post_title ); ?>" data-item_id="<?php echo $item_id; ?>" data-section_item_id="<?php echo $section_item_id; ?>" data-type="<?php echo $item->post_type; ?>">
25
+ <?php do_action( 'learn_press_admin_begin_section_item', $item, $section ); ?>
26
+ <td class="section-item-icon">
27
+ <div class="learn-press-dropdown-item-types">
28
+ <span class="learn-press-icon item-<?php echo $item->post_type; ?>" data-type="<?php echo $item->post_type; ?>"></span>
29
+ <ul>
30
+ <?php foreach ( $support_types as $_type => $text ) { ?>
31
+ <li>
32
+ <span class="learn-press-icon<?php echo $_type == $item_selected ? ' item-selected' : ''; ?> item-<?php echo $_type; ?>" data-content="<?php echo sprintf( __( 'Switch to %s', 'learnpress' ), $text ); ?>" data-type="<?php echo $_type; ?>"></span>
33
+ </li>
34
+ <?php } ?>
35
+ </ul>
36
+ </div>
37
+ </td>
38
+ <td class="section-item-input">
39
+ <input type="text" autocomplete="off" name="<?php echo $group_name; ?>[name]" class="lp-item-name no-submit" data-field="item-name" value="<?php echo esc_attr( $item->post_title ); ?>" placeholder="<?php _e( 'Add new item here and press Enter', 'learnpress' ); ?>" />
40
+ <input type="hidden" name="<?php echo $group_name; ?>[old_name]" value="<?php echo esc_attr( $item->post_title ); ?>" />
41
+ <input type="hidden" name="<?php echo $group_name; ?>[item_id]" value="<?php echo $item_id; ?>" />
42
+ <input type="hidden" name="<?php echo $group_name; ?>[section_item_id]" value="<?php echo $section_item_id; ?>" />
43
+ <input type="hidden" class="lp-item-type" name="<?php echo $group_name; ?>[post_type]" value="<?php echo $item->post_type; ?>" />
44
+ </td>
45
+ <td class="section-item-actions">
46
+ <p class="lp-item-actions lp-button-actions">
47
+ <?php do_action( 'learn_press_admin_begin_section_item_actions', $item, $section ); ?>
48
+ <a href="<?php echo absint( $item_id ) ? get_edit_post_link( $item_id ) : '{{data.edit_link}}'; ?>" class="lp-item-action lp-edit dashicons dashicons-edit" target="_blank"><?php _e( '', 'learnpress' ); ?></a>
49
+ <a href="" class="lp-item-action lp-remove dashicons dashicons-trash" data-confirm-remove="<?php _e( 'Are you sure you want to remove this item?', 'learnpress' ); ?>"><?php _e( '', 'learnpress' ); ?></a>
50
+ <span class="item-checkbox">
51
+ <input type="checkbox" value="<?php echo $section_item_id; ?>" />
52
+ <a class="dashicons dashicons-menu"></a>
53
+ </span>
54
+ <?php do_action( 'learn_press_admin_end_section_item_actions', $item, $section ); ?>
55
+ </p>
56
+ </td>
57
+ <?php do_action( 'learn_press_admin_end_section_item', $item, $section ); ?>
58
  </tr>
inc/admin/views/meta-boxes/course/loop-section.php CHANGED
@@ -8,41 +8,42 @@
8
  * @param $content_items
9
  */
10
  if ( empty( $section ) ) {
11
- $section = (object) array(
12
- 'section_id' => null,
13
- 'section_name' => '',
14
- 'section_course_id' => null,
15
- 'section_order' => null,
16
- 'section_description' => ''
17
- );
18
  }
19
  $is_hidden = $section->section_id && is_array( $hidden_sections ) && in_array( $section->section_id, $hidden_sections );
20
- $class = array(
21
- 'curriculum-section'
 
22
  );
23
  if ( !$section->section_id ) {
24
- $class[] = 'lp-empty-section';
25
  }
26
  if ( $is_hidden ) {
27
- $class[] = 'is_hidden';
28
  }
29
  ?>
30
  <li class="<?php echo join( ' ', $class ); ?>" data-id="<?php echo $section ? $section->section_id : ''; ?>">
31
- <h3 class="curriculum-section-head">
32
- <input name="_lp_curriculum[__SECTION__][name]" type="text" data-field="section-name" placeholder="<?php _e( 'Enter section name and hit enter', 'learnpress' ); ?>" class="lp-section-name no-submit" value="<?php echo esc_attr( $section->section_name ); ?>" />
33
- <p class="lp-section-actions lp-button-actions">
34
- <a href="" data-action="expand" class="dashicons dashicons-arrow-down<?php echo $is_hidden ? '' : ' hide-if-js'; ?>" title="<?php _e( 'Expand', 'learnpress' ); ?>"></a>
35
- <a href="" data-action="collapse" class="dashicons dashicons-arrow-up<?php echo !$is_hidden ? '' : ' hide-if-js'; ?>" title="<?php _e( 'Collapse', 'learnpress' ); ?>"></a>
36
- <a href="" data-action="remove" class="dashicons dashicons-trash" data-confirm-remove="<?php _e( 'Are you sure you want to remove this section?', 'learnpress' ); ?>"><?php _e( '', 'learnpress' ); ?></a>
37
- <a href="" class="move"></a>
38
- </p>
39
- </h3>
40
- <div class="curriculum-section-content<?php echo $is_hidden ? ' hide-if-js' : ''; ?>">
41
- <div class="item-bulk-actions">
42
- <input name="_lp_curriculum[__SECTION__][description]" class="lp-section-describe" type="text" value="<?php echo esc_attr( $section->section_description ); ?>" placeholder="<?php _e( 'Describe about this section', 'learnpress' ); ?>" />
43
- <button class="button hide-if-js" type="button" data-action="delete" data-title="<?php _e( 'Remove', 'learnpress' ); ?>" data-confirm-remove="<?php _e( 'Are you sure you want to remove these items from section?', 'learnpress' ); ?>"><?php _e( 'Remove', 'learnpress' ); ?></button>
44
- <!--
45
- <button class="button" type="button" data-action="delete-forever" disabled="disabled" data-title="<?php _e( 'Delete Forever', 'learnpress' ); ?>"><?php _e( 'Delete Forever', 'learnpress' ); ?></button>
46
 
47
  <button class="button hide-if-js" type="button" data-action="cancel"><?php _e( 'Cancel', 'learnpress' ); ?></button>-->
48
  <!--<div class="button lp-check-all-items">
@@ -56,40 +57,40 @@ if ( $is_hidden ) {
56
  <table class="curriculum-section-items">
57
  <?php echo isset( $content_items ) ? $content_items : ''; ?>
58
  <?php
59
- $item = learn_press_post_object( array( 'post_type' => LP()->lesson_post_type ) );
60
  ?>
61
  <?php learn_press_admin_view( 'meta-boxes/course/loop-item.php', array( 'item' => $item ) ); ?>
62
 
63
- </table>
64
- <?php do_action( 'learn_press_after_section_items', $section ); ?>
65
- <?php if ( $buttons = apply_filters( 'learn_press_loop_section_buttons', array() ) ): ?>
66
- <br />
67
- <div class="lp-add-buttons">
68
- <!--<input type="text" class="regular-text no-submit" name="lp-new-item-name" placeholder="<?php _e( 'Enter name of new question or quiz', 'learnpress' ); ?>" />
69
- <div class="button lp-button-dropdown lp-button-add-item disabled">
70
- <span class="lp-dropdown-label lp-add-new-item"><?php _e( 'Add New', 'learnpress' ); ?></span>
71
- <span class="lp-dropdown-arrow">+</span>
72
- <ul class="lp-dropdown-items">
73
- <?php foreach ( learn_press_section_item_types() as $slug => $name ) { ?>
74
- <li>
75
- <a href="" data-type="<?php echo $slug; ?>"><?php echo $name; ?></a>
76
- </li>
77
- <?php } ?>
78
- </ul>
79
- </div>
80
- <?php _e( '-OR-', 'learnpress' ); ?>-->
81
- <?php foreach ( learn_press_section_item_types() as $slug => $name ) { ?>
82
- <?php if ( apply_filters( 'learn_press_button_type_select_items', true, $slug ) ) { ?>
83
- <button class="button" type="button" data-action="add-<?php echo $slug; ?>" data-type="<?php echo $slug; ?>">
84
- <?php echo sprintf( __( 'Select %s', 'learnpress' ), $name ); ?>
85
- </button>
86
- <?php } ?>
87
- <?php } ?>
88
- <!--<button class="button " id="add-quiz" type="button" data-action="add-quiz" data-type="lp_quiz">
89
- <?php _e( 'Select Quizzes', 'learnpress' ); ?>
90
- </button>-->
91
- </div>
92
- <?php endif; ?>
93
- <?php do_action( 'learn_press_after_section_content', $section ); ?>
94
- </div>
95
  </li>
8
  * @param $content_items
9
  */
10
  if ( empty( $section ) ) {
11
+ $section = (object) array(
12
+ 'section_id' => null,
13
+ 'section_name' => '',
14
+ 'section_course_id' => null,
15
+ 'section_order' => null,
16
+ 'section_description' => ''
17
+ );
18
  }
19
  $is_hidden = $section->section_id && is_array( $hidden_sections ) && in_array( $section->section_id, $hidden_sections );
20
+
21
+ $class = array(
22
+ 'curriculum-section'
23
  );
24
  if ( !$section->section_id ) {
25
+ $class[] = 'lp-empty-section';
26
  }
27
  if ( $is_hidden ) {
28
+ $class[] = 'is_hidden';
29
  }
30
  ?>
31
  <li class="<?php echo join( ' ', $class ); ?>" data-id="<?php echo $section ? $section->section_id : ''; ?>">
32
+ <h3 class="curriculum-section-head">
33
+ <input name="_lp_curriculum[__SECTION__][name]" type="text" data-field="section-name" placeholder="<?php _e( 'Enter section name and hit enter', 'learnpress' ); ?>" class="lp-section-name no-submit" value="<?php echo esc_attr( $section->section_name ); ?>" />
34
+ <p class="lp-section-actions lp-button-actions">
35
+ <a href="" data-action="expand" class="dashicons dashicons-arrow-down<?php echo $is_hidden ? '' : ' hide-if-js'; ?>" title="<?php _e( 'Expand', 'learnpress' ); ?>"></a>
36
+ <a href="" data-action="collapse" class="dashicons dashicons-arrow-up<?php echo!$is_hidden ? '' : ' hide-if-js'; ?>" title="<?php _e( 'Collapse', 'learnpress' ); ?>"></a>
37
+ <a href="" data-action="remove" class="dashicons dashicons-trash" data-confirm-remove="<?php _e( 'Are you sure you want to remove this section?', 'learnpress' ); ?>"><?php _e( '', 'learnpress' ); ?></a>
38
+ <a href="" class="move"></a>
39
+ </p>
40
+ </h3>
41
+ <div class="curriculum-section-content<?php echo $is_hidden ? ' hide-if-js' : ''; ?>">
42
+ <div class="item-bulk-actions">
43
+ <input name="_lp_curriculum[__SECTION__][description]" class="lp-section-describe" type="text" value="<?php echo esc_attr( $section->section_description ); ?>" placeholder="<?php _e( 'Describe about this section', 'learnpress' ); ?>" />
44
+ <button class="button hide-if-js" type="button" data-action="delete" data-title="<?php _e( 'Remove', 'learnpress' ); ?>" data-confirm-remove="<?php _e( 'Are you sure you want to remove these items from section?', 'learnpress' ); ?>"><?php _e( 'Remove', 'learnpress' ); ?></button>
45
+ <!--
46
+ <button class="button" type="button" data-action="delete-forever" disabled="disabled" data-title="<?php _e( 'Delete Forever', 'learnpress' ); ?>"><?php _e( 'Delete Forever', 'learnpress' ); ?></button>
47
 
48
  <button class="button hide-if-js" type="button" data-action="cancel"><?php _e( 'Cancel', 'learnpress' ); ?></button>-->
49
  <!--<div class="button lp-check-all-items">
57
  <table class="curriculum-section-items">
58
  <?php echo isset( $content_items ) ? $content_items : ''; ?>
59
  <?php
60
+ $item = learn_press_post_object( array( 'post_type' => LP_LESSON_CPT ) );
61
  ?>
62
  <?php learn_press_admin_view( 'meta-boxes/course/loop-item.php', array( 'item' => $item ) ); ?>
63
 
64
+ </table>
65
+ <?php do_action( 'learn_press_after_section_items', $section ); ?>
66
+ <?php if ( $buttons = apply_filters( 'learn_press_loop_section_buttons', array() ) ): ?>
67
+ <br />
68
+ <div class="lp-add-buttons">
69
+ <!--<input type="text" class="regular-text no-submit" name="lp-new-item-name" placeholder="<?php _e( 'Add new lesson or quiz and press Enter', 'learnpress' ); ?>" />
70
+ <div class="button lp-button-dropdown lp-button-add-item disabled">
71
+ <span class="lp-dropdown-label lp-add-new-item"><?php _e( 'Add New', 'learnpress' ); ?></span>
72
+ <span class="lp-dropdown-arrow">+</span>
73
+ <ul class="lp-dropdown-items">
74
+ <?php foreach ( learn_press_section_item_types() as $slug => $name ) { ?>
75
+ <li>
76
+ <a href="" data-type="<?php echo $slug; ?>"><?php echo $name; ?></a>
77
+ </li>
78
+ <?php } ?>
79
+ </ul>
80
+ </div>
81
+ <?php _e( '-OR-', 'learnpress' ); ?>-->
82
+ <?php foreach ( learn_press_section_item_types() as $slug => $name ) { ?>
83
+ <?php if ( apply_filters( 'learn_press_button_type_select_items', true, $slug ) ) { ?>
84
+ <button class="button" type="button" data-action="add-<?php echo $slug; ?>" data-type="<?php echo $slug; ?>">
85
+ <?php echo sprintf( __( 'Select %s', 'learnpress' ), $name ); ?>
86
+ </button>
87
+ <?php } ?>
88
+ <?php } ?>
89
+ <!--<button class="button " id="add-quiz" type="button" data-action="add-quiz" data-type="lp_quiz">
90
+ <?php _e( 'Select Quizzes', 'learnpress' ); ?>
91
+ </button>-->
92
+ </div>
93
+ <?php endif; ?>
94
+ <?php do_action( 'learn_press_after_section_content', $section ); ?>
95
+ </div>
96
  </li>
inc/admin/views/meta-boxes/course/review-log.php CHANGED
@@ -29,7 +29,7 @@ if ( $user->is_instructor() && ( ( get_post() != 'publish' ) ) ) {
29
  </div>
30
  <?php if( $required_review && !$enable_edit_published ){?>
31
  <p class="description submitdelete">
32
- <?php _e( 'Warning! Your course will become to Pending Review for admin reviews before it can be published when you update' ); ?>
33
  </p>
34
  <?php } ?>
35
  </div>
@@ -38,7 +38,7 @@ if ( $user->is_instructor() && ( ( get_post() != 'publish' ) ) ) {
38
  jQuery('#post').submit(function (e) {
39
  var $review = $('textarea[name="review_message"]');
40
  if (!($review.val() + '').length && $('#learn-press-notice-check').is(':checked')) {
41
- alert('<?php _e( 'Please write your message to Reviewer', 'learnpress' );?>');
42
  $review.focus();
43
  return false;
44
  }
@@ -65,7 +65,7 @@ if ( $user->is_instructor() && ( ( get_post() != 'publish' ) ) ) {
65
  </label>
66
  </p>
67
  <div class="hide-if-js">
68
- <textarea class="widefat" rows="5" disabled="disabled" name="review_message" resize="none" placeholder="<?php _e( 'Enter some information here for instructor. E.g: for reason why the course is rejected etc...', 'learnpress' ); ?>"></textarea>
69
  </div>
70
  </div>
71
  <?php ob_start(); ?>
@@ -77,7 +77,7 @@ if ( $user->is_instructor() && ( ( get_post() != 'publish' ) ) ) {
77
  clicked = $(':focus', this).attr('name');
78
 
79
  if ( ( ( clicked == 'save' || clicked == 'publish' ) && ( status != current_status ) || ( clicked == 'publish' ) && ( status == 'pending' ) )&& !($review.val() + '').length) {
80
- alert('<?php _e( 'Please write your message to Instructor', 'learnpress' );?>');
81
  var $check = $('input[name="learn_press_submit_course_notice_instructor"]').prop('checked', true);
82
  $check.trigger('change');
83
  return false;
29
  </div>
30
  <?php if( $required_review && !$enable_edit_published ){?>
31
  <p class="description submitdelete">
32
+ <?php _e( 'Warning! Your course will become Pending Review for admins to review before it can be published when you update.' ); ?>
33
  </p>
34
  <?php } ?>
35
  </div>
38
  jQuery('#post').submit(function (e) {
39
  var $review = $('textarea[name="review_message"]');
40
  if (!($review.val() + '').length && $('#learn-press-notice-check').is(':checked')) {
41
+ alert('<?php _e( 'Please write your message to the Reviewer', 'learnpress' );?>');
42
  $review.focus();
43
  return false;
44
  }
65
  </label>
66
  </p>
67
  <div class="hide-if-js">
68
+ <textarea class="widefat" rows="5" disabled="disabled" name="review_message" resize="none" placeholder="<?php _e( 'Enter some information here for instructors. E.g: the reason why the course is rejected etc...', 'learnpress' ); ?>"></textarea>
69
  </div>
70
  </div>
71
  <?php ob_start(); ?>
77
  clicked = $(':focus', this).attr('name');
78
 
79
  if ( ( ( clicked == 'save' || clicked == 'publish' ) && ( status != current_status ) || ( clicked == 'publish' ) && ( status == 'pending' ) )&& !($review.val() + '').length) {
80
+ alert('<?php _e( 'Please write your message to the Instructor', 'learnpress' );?>');
81
  var $check = $('input[name="learn_press_submit_course_notice_instructor"]').prop('checked', true);
82
  $check.trigger('change');
83
  return false;
inc/admin/views/meta-boxes/course/review-logs.php CHANGED
@@ -6,7 +6,7 @@ $index = $total_reviews;
6
  <?php if ( $total_reviews ) { ?>
7
  <?php printf( _nx( '%d review', '%d reviews', $total_reviews, 'learnpress' ), $total_reviews ); ?>
8
  <?php } else { ?>
9
- <?php _e( 'This course has not got any review yet', 'learnpress' ); ?>
10
  <?php } ?>
11
  </h4>
12
  <ul class="learn-press-review-logs clearfix">
6
  <?php if ( $total_reviews ) { ?>
7
  <?php printf( _nx( '%d review', '%d reviews', $total_reviews, 'learnpress' ), $total_reviews ); ?>
8
  <?php } else { ?>
9
+ <?php _e( 'This course has not got any reviews yet', 'learnpress' ); ?>
10
  <?php } ?>
11
  </h4>
12
  <ul class="learn-press-review-logs clearfix">
inc/admin/views/meta-boxes/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php // Silence is golden.
inc/admin/views/meta-boxes/order/actions.php CHANGED
@@ -54,15 +54,19 @@ if ( 0 != $post->ID ) {
54
  <input name="order-customer" type="text" class="wp-suggest-user ui-autocomplete-input" id="admin-email" data-autocomplete-type="search" data-autocomplete-field="user_email" autocomplete="off">
55
  -->
56
  <?php
57
- wp_dropdown_users(
58
- array(
59
- 'show_option_none' => __( '[Guest]', 'learnpress' ),
60
- 'show_option_none' => __( '[Guest]', 'learnpress' ),
61
- 'name' => 'order-customer',
62
- 'id' => null,
63
- 'selected' => $order->get_user( 'ID' )
64
- )
65
- );
 
 
 
 
66
  ?>
67
  </div>
68
 
54
  <input name="order-customer" type="text" class="wp-suggest-user ui-autocomplete-input" id="admin-email" data-autocomplete-type="search" data-autocomplete-field="user_email" autocomplete="off">
55
  -->
56
  <?php
57
+ // if($order->get_status() =='' || $order->has_status('pending') ) {
58
+ wp_dropdown_users(
59
+ array(
60
+ 'show_option_none' => __( '[Guest]', 'learnpress' ),
61
+ 'show_option_none' => __( '[Guest]', 'learnpress' ),
62
+ 'name' => 'order-customer',
63
+ 'id' => null,
64
+ 'selected' => $order->get_user( 'ID' )
65
+ )
66
+ );
67
+ // }else{
68
+ // echo $order->get_customer_name();
69
+ // }
70
  ?>
71
  </div>
72
 
inc/admin/views/meta-boxes/order/details.php CHANGED
@@ -22,8 +22,7 @@ global $post;
22
  </div>
23
  <div class="order-user-meta">
24
  <div class="user-display-name">
25
- <?php $display_name = $order->get_user( 'display_name' );
26
- echo empty( $display_name ) ? __( 'Guest', 'learnpress' ) : $display_name; ?>
27
  </div>
28
  <div class="user-email">
29
  <?php $user_email = $order->get_user( 'user_email' );
@@ -102,6 +101,6 @@ global $post;
102
  <ul id="learn-press-courses-result">
103
  <li class="lp-search-no-results hide-if-js" data-id="0"><?php _e( 'No results', 'learnpress' ); ?></li>
104
  </ul>
105
- <button class="lp-close-lightbox button" onclick="LearnPress.MessageBox.hide();"><?php _e( 'Close', 'learnpress' ); ?></button>
106
  </div>
107
  </script>
22
  </div>
23
  <div class="order-user-meta">
24
  <div class="user-display-name">
25
+ <?php echo $order->get_customer_name(); ?>
 
26
  </div>
27
  <div class="user-email">
28
  <?php $user_email = $order->get_user( 'user_email' );
101
  <ul id="learn-press-courses-result">
102
  <li class="lp-search-no-results hide-if-js" data-id="0"><?php _e( 'No results', 'learnpress' ); ?></li>
103
  </ul>
104
+ <button class="lp-close-lightbox button" onclick="LP.MessageBox.hide();"><?php _e( 'Close', 'learnpress' ); ?></button>
105
  </div>
106
  </script>
inc/admin/views/meta-boxes/order/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php // Silence is golden.
inc/admin/views/meta-boxes/question/footer.php CHANGED
@@ -2,6 +2,6 @@
2
  </div>
3
  <script type="text/javascript">
4
  jQuery(function ($) {
5
- LearnPress.sortableQuestionAnswers($('#learn-press-question-<?php echo $this->id;?>'));
6
  })
7
  </script>
2
  </div>
3
  <script type="text/javascript">
4
  jQuery(function ($) {
5
+ LP.sortableQuestionAnswers($('#learn-press-question-<?php echo $this->id;?>'));
6
  })
7
  </script>
inc/admin/views/meta-boxes/question/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php // Silence is golden.
inc/admin/views/meta-boxes/question/multi-choice-options.php CHANGED
@@ -1,65 +1,77 @@
1
  <div class="learn-press-question" id="learn-press-question-<?php echo $this->id;?>" data-type="multi-choice" data-id="<?php echo $this->id;?>">
2
- <table class="lp-sortable lp-list-options" id="learn-press-list-options-<?php echo $this->id;?>">
3
- <thead>
4
 
5
- <th><?php _e( 'Answer Text', 'learnpress' ); ?></th>
6
- <th><?php _e( 'Is Correct?', 'learnpress' ); ?></th>
7
- <th width="20"></th>
8
- <th width="20"></th>
9
- </thead>
10
- <tbody>
 
 
 
 
 
 
 
 
11
 
12
- <?php $answers = $this->answers; if ( $answers ): ?>
13
- <?php foreach ( $answers as $answer ): ?>
14
- <?php
15
- $value = $this->_get_option_value( $answer['value'] );
16
- ?>
 
17
 
18
- <?php do_action( 'learn_press_before_question_answer_option', $this ); ?>
 
 
 
 
19
 
20
- <tr class="lp-list-option lp-list-option-<?php echo $value;?>" data-id="<?php echo $value;?>">
21
 
22
- <td>
23
- <input class="lp-answer-text no-submit key-nav" type="text" name="learn_press_question[<?php echo $this->id; ?>][answer][text][]" value="<?php echo esc_attr( $answer['text'] ); ?>" />
24
- </td>
25
- <th class="lp-answer-check">
26
- <input type="hidden" name="learn_press_question[<?php echo $this->id; ?>][answer][value][]" value="<?php echo $value; ?>" />
27
- <input type="checkbox" name="learn_press_question[<?php echo $this->id; ?>][checked][]" <?php checked( $answer['is_true'] == 'yes', true ); ?> value="<?php echo $value; ?>" />
28
- </th>
29
- <td class="lp-list-option-actions lp-remove-list-option">
30
- <i class="dashicons dashicons-trash"></i>
31
- </td>
32
- <td class="lp-list-option-actions lp-move-list-option open-hand">
33
- <i class="dashicons dashicons-sort"></i>
34
- </td>
35
- </tr>
36
 
37
- <?php do_action( 'learn_press_after_question_answer_option', $this ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
38
 
39
- <?php endforeach; ?>
40
- <?php endif; ?>
41
- </tbody>
42
- </table>
 
 
43
  <p class="question-bottom-actions">
44
  <?php
45
- $buttons = apply_filters(
46
  'learn_press_question_bottom_buttons',
47
  array(
48
  'add_option' => sprintf(
49
  __( '<button class="button add-question-option-button add-question-option-button-%1$d" data-id="%1$d" type="button">%2$s</button>', 'learnpress' ),
50
  $this->id,
51
  __( 'Add Option', 'learnpress' )
52
- ),
53
- 'change_type' => learn_press_dropdown_question_types(array('echo' => false, 'id' => 'learn-press-dropdown-question-types-' . $this->id, 'selected' => $this->type ))
54
  ),
55
  $this
56
  );
57
- echo join( "\n", $buttons );
58
  ?>
59
  </p>
60
  </div>
61
  <script type="text/javascript">
62
  jQuery(function ($) {
63
- LearnPress.sortableQuestionAnswers($('#learn-press-question-<?php echo $this->id;?>'));
64
- })
65
  </script>
1
  <div class="learn-press-question" id="learn-press-question-<?php echo $this->id;?>" data-type="multi-choice" data-id="<?php echo $this->id;?>">
 
 
2
 
3
+ <p class="question-bottom-actions">
4
+ <?php
5
+ $top_buttons = apply_filters(
6
+ 'learn_press_question_top_buttons',
7
+ array(
8
+ 'change_type' => learn_press_dropdown_question_types(array('echo' => false, 'id' => 'learn-press-dropdown-question-types-' . $this->id, 'selected' => $this->type ))
9
+ ),
10
+ $this
11
+ );
12
+ echo join( "\n", $top_buttons );
13
+ ?>
14
+ </p>
15
+ <table class="lp-sortable lp-list-options" id="learn-press-list-options-<?php echo $this->id;?>">
16
+ <thead>
17
 
18
+ <th><?php _e( 'Answer Text', 'learnpress' ); ?></th>
19
+ <th><?php _e( 'Is Correct?', 'learnpress' ); ?></th>
20
+ <th width="20"></th>
21
+ <th width="20"></th>
22
+ </thead>
23
+ <tbody>
24
 
25
+ <?php $answers = $this->answers; if ( $answers ): ?>
26
+ <?php foreach ( $answers as $answer ): ?>
27
+ <?php
28
+ $value = $this->_get_option_value( $answer['value'] );
29
+ ?>
30
 
31
+ <?php do_action( 'learn_press_before_question_answer_option', $this ); ?>
32
 
33
+ <tr class="lp-list-option lp-list-option-<?php echo $value;?>" data-id="<?php echo $value;?>">
 
 
 
 
 
 
 
 
 
 
 
 
 
34
 
35
+ <td>
36
+ <input class="lp-answer-text no-submit key-nav" type="text" name="learn_press_question[<?php echo $this->id; ?>][answer][text][]" value="<?php echo esc_attr( $answer['text'] ); ?>" />
37
+ </td>
38
+ <th class="lp-answer-check">
39
+ <input type="hidden" name="learn_press_question[<?php echo $this->id; ?>][answer][value][]" value="<?php echo $value; ?>" />
40
+ <input type="checkbox" name="learn_press_question[<?php echo $this->id; ?>][checked][]" <?php checked( $answer['is_true'] == 'yes', true ); ?> value="<?php echo $value; ?>" />
41
+ </th>
42
+ <td class="lp-list-option-actions lp-remove-list-option">
43
+ <i class="dashicons dashicons-trash"></i>
44
+ </td>
45
+ <td class="lp-list-option-actions lp-move-list-option open-hand">
46
+ <i class="dashicons dashicons-sort"></i>
47
+ </td>
48
+ </tr>
49
 
50
+ <?php do_action( 'learn_press_after_question_answer_option', $this ); ?>
51
+
52
+ <?php endforeach; ?>
53
+ <?php endif; ?>
54
+ </tbody>
55
+ </table>
56
  <p class="question-bottom-actions">
57
  <?php
58
+ $bottom_buttons = apply_filters(
59
  'learn_press_question_bottom_buttons',
60
  array(
61
  'add_option' => sprintf(
62
  __( '<button class="button add-question-option-button add-question-option-button-%1$d" data-id="%1$d" type="button">%2$s</button>', 'learnpress' ),
63
  $this->id,
64
  __( 'Add Option', 'learnpress' )
65
+ )
 
66
  ),
67
  $this
68
  );
69
+ echo join( "\n", $bottom_buttons );
70
  ?>
71
  </p>
72
  </div>
73
  <script type="text/javascript">
74
  jQuery(function ($) {
75
+ LP.sortableQuestionAnswers($('#learn-press-question-<?php echo $this->id;?>'));
76
+ });
77
  </script>
inc/admin/views/meta-boxes/question/single-choice-options.php CHANGED
@@ -1,72 +1,83 @@
1
  <div class="learn-press-question" id="learn-press-question-<?php echo $this->id;?>" data-type="<?php echo str_replace( '_', '-', $this->type );?>" data-id="<?php echo $this->id;?>">
2
- <table class="lp-sortable lp-list-options" id="learn-press-list-options-<?php echo $this->id;?>">
3
- <thead>
4
- <th><?php _e( 'Answer Text', 'learnpress' ); ?></th>
5
- <th><?php _e( 'Is Correct?', 'learnpress' ); ?></th>
6
- <th width="20"></th>
7
- <?php if ( $this->type == 'single_choice' ): ?>
 
 
 
 
 
 
 
 
 
 
 
8
  <th width="20"></th>
9
- <?php endif;?>
10
- </thead>
11
- <tbody>
 
 
12
 
13
- <?php $answers = $this->answers; if ( $answers ): ?>
14
- <?php foreach ( $answers as $answer ): ?>
15
- <?php
16
- $value = $this->_get_option_value( $answer['value'] );
17
- $id = $value;
18
- ?>
19
 
20
- <?php do_action( 'learn_press_before_question_answer_option', $this ); ?>
21
 
22
- <tr class="lp-list-option lp-list-option-<?php echo $id;?>" data-id="<?php echo $id;?>">
23
- <td>
24
- <input class="lp-answer-text no-submit key-nav" type="text" name="learn_press_question[<?php echo $this->id; ?>][answer][text][]" value="<?php echo esc_attr( $answer['text'] ); ?>" />
25
- </td>
26
- <th class="lp-answer-check">
27
- <input type="hidden" name="learn_press_question[<?php echo $this->id; ?>][answer][value][]" value="<?php echo $value; ?>" />
28
- <input type="radio" name="learn_press_question[<?php echo $this->id; ?>][checked][]" <?php checked( $answer['is_true'] == 'yes', true ); ?> value="<?php echo $value; ?>" />
29
- </th>
30
- <?php if ( $this->type == 'single_choice' ): ?>
31
- <td class="lp-list-option-actions lp-remove-list-option">
32
- <i class="dashicons dashicons-trash"></i>
33
- </td>
34
- <?php endif;?>
35
- <td class="lp-list-option-actions lp-move-list-option open-hand">
36
- <i class="dashicons dashicons-sort"></i>
37
- </td>
38
- </tr>
39
 
40
- <?php do_action( 'learn_press_after_question_answer_option', $this ); ?>
41
 
42
- <?php endforeach; ?>
43
- <?php endif; ?>
44
- </tbody>
45
- </table>
46
  <p class="question-bottom-actions">
47
  <?php
48
- $buttons = array(
49
- 'change_type' => learn_press_dropdown_question_types(array('echo' => false, 'id' => 'learn-press-dropdown-question-types-' . $this->id, 'selected' => $this->type ))
50
- );
51
  if( $this->type != 'true_or_false' ){
52
- array_splice($buttons, 0, 0, sprintf(
53
  __( '<button class="button add-question-option-button add-question-option-button-%1$d" data-id="%1$d" type="button">%2$s</button>', 'learnpress' ),
54
  $this->id,
55
  __( 'Add Option', 'learnpress' )
56
  )
57
  );
58
  }
59
- $buttons = apply_filters(
60
  'learn_press_question_bottom_buttons',
61
- $buttons,
62
  $this
63
  );
64
- echo join( "\n", $buttons );
65
  ?>
66
  </p>
67
  </div>
68
  <script type="text/javascript">
69
  jQuery(function ($) {
70
- LearnPress.sortableQuestionAnswers($('#learn-press-question-<?php echo $this->id;?>'));
71
  })
72
  </script>
1
  <div class="learn-press-question" id="learn-press-question-<?php echo $this->id;?>" data-type="<?php echo str_replace( '_', '-', $this->type );?>" data-id="<?php echo $this->id;?>">
2
+ <p class="question-bottom-actions">
3
+ <?php
4
+ $top_buttons = array(
5
+ 'change_type' => learn_press_dropdown_question_types(array('echo' => false, 'id' => 'learn-press-dropdown-question-types-' . $this->id, 'selected' => $this->type ))
6
+ );
7
+ $top_buttons = apply_filters(
8
+ 'learn_press_question_top_buttons',
9
+ $top_buttons,
10
+ $this
11
+ );
12
+ echo join( "\n", $top_buttons );
13
+ ?>
14
+ </p>
15
+ <table class="lp-sortable lp-list-options" id="learn-press-list-options-<?php echo $this->id;?>">
16
+ <thead>
17
+ <th><?php _e( 'Answer Text', 'learnpress' ); ?></th>
18
+ <th><?php _e( 'Is Correct?', 'learnpress' ); ?></th>
19
  <th width="20"></th>
20
+ <?php if ( $this->type == 'single_choice' ): ?>
21
+ <th width="20"></th>
22
+ <?php endif;?>
23
+ </thead>
24
+ <tbody>
25
 
26
+ <?php $answers = $this->answers; if ( $answers ): ?>
27
+ <?php foreach ( $answers as $answer ): ?>
28
+ <?php
29
+ $value = $this->_get_option_value( $answer['value'] );
30
+ $id = $value;
31
+ ?>
32
 
33
+ <?php do_action( 'learn_press_before_question_answer_option', $this ); ?>
34
 
35
+ <tr class="lp-list-option lp-list-option-<?php echo $id;?>" data-id="<?php echo $id;?>">
36
+ <td>
37
+ <input class="lp-answer-text no-submit key-nav" type="text" name="learn_press_question[<?php echo $this->id; ?>][answer][text][]" value="<?php echo esc_attr( $answer['text'] ); ?>" />
38
+ </td>
39
+ <th class="lp-answer-check">
40
+ <input type="hidden" name="learn_press_question[<?php echo $this->id; ?>][answer][value][]" value="<?php echo $value; ?>" />
41
+ <input type="radio" name="learn_press_question[<?php echo $this->id; ?>][checked][]" <?php checked( $answer['is_true'] == 'yes', true ); ?> value="<?php echo $value; ?>" />
42
+ </th>
43
+ <?php if ( $this->type == 'single_choice' ): ?>
44
+ <td class="lp-list-option-actions lp-remove-list-option">
45
+ <i class="dashicons dashicons-trash"></i>
46
+ </td>
47
+ <?php endif;?>
48
+ <td class="lp-list-option-actions lp-move-list-option open-hand">
49
+ <i class="dashicons dashicons-sort"></i>
50
+ </td>
51
+ </tr>
52
 
53
+ <?php do_action( 'learn_press_after_question_answer_option', $this ); ?>
54
 
55
+ <?php endforeach; ?>
56
+ <?php endif; ?>
57
+ </tbody>
58
+ </table>
59
  <p class="question-bottom-actions">
60
  <?php
61
+ $bottom_buttons = array();
 
 
62
  if( $this->type != 'true_or_false' ){
63
+ array_splice( $bottom_buttons, 0, 0, sprintf(
64
  __( '<button class="button add-question-option-button add-question-option-button-%1$d" data-id="%1$d" type="button">%2$s</button>', 'learnpress' ),
65
  $this->id,
66
  __( 'Add Option', 'learnpress' )
67
  )
68
  );
69
  }
70
+ $bottom_buttons = apply_filters(
71
  'learn_press_question_bottom_buttons',
72
+ $bottom_buttons,
73
  $this
74
  );
75
+ echo join( "\n", $bottom_buttons );
76
  ?>
77
  </p>
78
  </div>
79
  <script type="text/javascript">
80
  jQuery(function ($) {
81
+ LP.sortableQuestionAnswers($('#learn-press-question-<?php echo $this->id;?>'));
82
  })
83
  </script>
inc/admin/views/meta-boxes/quiz/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php // Silence is golden.
inc/admin/views/meta-boxes/quiz/js-template.php CHANGED
@@ -40,6 +40,6 @@
40
  <li class="lp-search-no-results hide-if-js" data-id="0"><?php _e( 'No results', 'learnpress' );?></li>
41
  </ul>
42
  <button class="lp-add-item button" disabled="disabled" data-text="<?php _e( 'Add to quiz', 'learnpress' );?>"><?php _e( 'Add to quiz', 'learnpress' );?></button>
43
- <button class="lp-close-lightbox button" onclick="LearnPress.MessageBox.hide();"><?php _e( 'Close', 'learnpress' );?></button>
44
  </div>
45
  </script>
40
  <li class="lp-search-no-results hide-if-js" data-id="0"><?php _e( 'No results', 'learnpress' );?></li>
41
  </ul>
42
  <button class="lp-add-item button" disabled="disabled" data-text="<?php _e( 'Add to quiz', 'learnpress' );?>"><?php _e( 'Add to quiz', 'learnpress' );?></button>
43
+ <button class="lp-close-lightbox button" onclick="LP.MessageBox.hide();"><?php _e( 'Close', 'learnpress' ); ?></button>
44
  </div>
45
  </script>
inc/admin/views/meta-boxes/quiz/question.php CHANGED
@@ -28,6 +28,7 @@ if ( empty ( $question->id ) ) {
28
  <a href="" data-action="expand" class="dashicons dashicons-plus <?php echo $is_hidden ? '' : 'hide-if-js'; ?>" title="<?php _e( 'Expand', 'learnpress' ); ?>"></a>
29
  <a href="" data-action="collapse" class="dashicons dashicons-minus <?php echo !$is_hidden ? '' : 'hide-if-js'; ?>" title="<?php _e( 'Collapse', 'learnpress' ); ?>"></a>
30
  <a href="<?php echo get_edit_post_link( $question->id ); ?>" class="dashicons dashicons-edit" data-action="" title="<?php _e( 'Edit', 'learnpress' ); ?>"></a>
 
31
  <a href="<?php echo wp_nonce_url( admin_url( 'admin-ajax.php?action=learnpress_remove_quiz_question&quiz_id=' . $post->ID . '&question_id=' . $question->id ), 'remove_quiz_question', 'remove-nonce' ); ?>"
32
  class="dashicons dashicons-trash"
33
  data-action="remove"
28
  <a href="" data-action="expand" class="dashicons dashicons-plus <?php echo $is_hidden ? '' : 'hide-if-js'; ?>" title="<?php _e( 'Expand', 'learnpress' ); ?>"></a>
29
  <a href="" data-action="collapse" class="dashicons dashicons-minus <?php echo !$is_hidden ? '' : 'hide-if-js'; ?>" title="<?php _e( 'Collapse', 'learnpress' ); ?>"></a>
30
  <a href="<?php echo get_edit_post_link( $question->id ); ?>" class="dashicons dashicons-edit" data-action="" title="<?php _e( 'Edit', 'learnpress' ); ?>"></a>
31
+ <a href="" data-action="duplicate" class="dashicons-before dashicons-admin-page" title="<?php _e( 'Duplicate', 'learnpress' ); ?>" data-id="<?php echo esc_attr( $question->id ); ?>" data-quiz="<?php echo esc_attr( $post->ID ) ?>"></a>
32
  <a href="<?php echo wp_nonce_url( admin_url( 'admin-ajax.php?action=learnpress_remove_quiz_question&quiz_id=' . $post->ID . '&question_id=' . $question->id ), 'remove_quiz_question', 'remove-nonce' ); ?>"
33
  class="dashicons dashicons-trash"
34
  data-action="remove"
inc/admin/views/meta-boxes/quiz/questions.php CHANGED
@@ -31,7 +31,7 @@ $hidden_all = sizeof( $hidden ) && ( sizeof( array_diff( $hidden, $question_ids
31
  <?php $exclude_ids = array_keys( $questions ); endif; ?>
32
  </div>
33
  <div class="question-actions">
34
- <input type="text" class="regular-text no-submit" name="lp-new-question-name" placeholder="<?php _e( 'The name of new question and hit enter', 'learnpress' );?>" />
35
  <div class="button lp-button-dropdown lp-button-add-question disabled">
36
  <span class="lp-dropdown-label lp-add-new-item"><?php _e( 'Add New', 'learnpress' );?></span>
37
  <span class="lp-dropdown-arrow">+</span>
31
  <?php $exclude_ids = array_keys( $questions ); endif; ?>
32
  </div>
33
  <div class="question-actions">
34
+ <input type="text" class="regular-text no-submit" name="lp-new-question-name" placeholder="<?php _e( 'Add question title and press Enter', 'learnpress' );?>" />
35
  <div class="button lp-button-dropdown lp-button-add-question disabled">
36
  <span class="lp-dropdown-label lp-add-new-item"><?php _e( 'Add New', 'learnpress' );?></span>
37
  <span class="lp-dropdown-arrow">+</span>
inc/admin/views/settings/checkout.php CHANGED
@@ -13,70 +13,13 @@ if ( !defined( 'ABSPATH' ) ) {
13
 
14
  $settings = LP()->settings;
15
  ?>
16
- <table class="form-table">
17
- <tbody>
18
- <?php do_action( 'learn_press_before_' . $this->id . '_' . $this->section['id'] . '_settings_fields', $this ); ?>
19
- <?php foreach( $this->get_settings() as $field ){?>
20
- <?php $this->output_field( $field );?>
21
- <?php }?>
22
- <?php if( 1 == 0 ){?>
23
- <tr>
24
- <th scope="row"><label for="learn-press-checkout-enable-cart"><?php _e( 'Enable cart', 'learnpress' ); ?></label></th>
25
- <td>
26
- <input type="hidden" name="<?php echo $this->get_field_name( 'enable_cart' ); ?>" value="no" />
27
- <input id="learn-press-checkout-enable-cart" type="checkbox" name="<?php echo $this->get_field_name( 'enable_cart' ); ?>" value="yes" <?php checked( $settings->get( 'enable_cart' ) == 'yes', true ); ?> />
28
- <p class="description"><?php _e( 'Check this option to enable user can purchase multiple course at one time', 'learnpress' );?></p>
29
- </td>
30
- </tr>
31
- <tr>
32
- <th scope="row"><label for="learn-press-checkout-add-to-cart-redirect"><?php _e( 'Add to cart redirect', 'learnpress' ); ?></label></th>
33
- <td>
34
- <input type="hidden" name="<?php echo $this->get_field_name( 'redirect_after_add' ); ?>" value="no" />
35
- <input id="learn-press-checkout-add-to-cart-redirect" type="checkbox" name="<?php echo $this->get_field_name( 'redirect_after_add' ); ?>" value="yes" <?php checked( $settings->get( 'redirect_after_add' ) == 'yes', true ); ?> />
36
- <p class="description"><?php _e( 'Redirect to checkout immediately after add course to cart', 'learnpress' );?></p>
37
- </td>
38
- </tr>
39
- <tr>
40
- <th scope="row"><label for="learn-press-checkout-add-to-cart-ajax"><?php _e( 'AJAX add to cart', 'learnpress' ); ?></label></th>
41
- <td>
42
- <input type="hidden" name="<?php echo $this->get_field_name( 'ajax_add_to_cart' ); ?>" value="no" />
43
- <input id="learn-press-checkout-add-to-cart-ajax" type="checkbox" name="<?php echo $this->get_field_name( 'ajax_add_to_cart' ); ?>" value="yes" <?php checked( $settings->get( 'ajax_add_to_cart' ) == 'yes', true ); ?> />
44
- <p class="description"><?php _e( 'Using AJAX to add course to the cart', 'learnpress' );?></p>
45
- </td>
46
- </tr>
47
- <tr>
48
- <th scope="row"><label><?php _e( 'Cart page', 'learnpress' ); ?></label></th>
49
- <td>
50
- <?php
51
- $cart_page_id = $settings->get( 'cart_page_id', 0 );
52
- learn_press_pages_dropdown( $this->get_field_name( "cart_page_id" ), $cart_page_id );
53
- ?>
54
- </td>
55
- </tr>
56
- <tr>
57
- <th scope="row"><label><?php _e( 'Checkout page', 'learnpress' ); ?></label></th>
58
- <td>
59
- <?php
60
- $checkout_page_id = $settings->get( 'checkout_page_id', 0 );
61
- learn_press_pages_dropdown( $this->get_field_name( "checkout_page_id" ), $checkout_page_id );
62
- ?>
63
- </td>
64
- </tr>
65
- <?php }?>
66
  </tbody>
67
 
68
- </table>
69
- <?php if( 1 == 0 ){?>
70
- <h3><?php _e( 'Checkout Endpoints', 'learnpress' );?></h3>
71
- <table class="form-table">
72
- <tbody>
73
- <tr>
74
- <th scope="row"><label><?php _e( 'Order received', 'learnpress' ); ?></label></th>
75
- <td>
76
- <input type="text" class="regular-text" name="<?php echo $this->get_field_name( 'checkout_endpoints[lp_order_received]' );?>" value="<?php echo $settings->get( 'checkout_endpoints.lp_order_received', 'lp-order-received' );?>" />
77
- </td>
78
- </tr>
79
- <?php do_action( 'learn_press_after_' . $this->id . '_' . $this->section['id'] . '_settings_fields', $this ); ?>
80
- </tbody>
81
- </table>
82
- <?php } ?>
13
 
14
  $settings = LP()->settings;
15
  ?>
16
+
17
+ <table class="form-table">
18
+ <tbody>
19
+ <?php
20
+ do_action( 'learn_press_before_' . $this->id . '_' . $this->section['id'] . '_settings_fields', $this );
21
+ $this->output_settings();
22
+ ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  </tbody>
24
 
25
+ </table>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/admin/views/settings/courses.php CHANGED
@@ -15,140 +15,25 @@ $settings = LP_Settings::instance();
15
  <h3 class=""><?php echo $this->section['title']; ?></h3>
16
  <table class="form-table">
17
  <tbody>
18
- <?php do_action( 'learn_press_before_' . $this->id . '_' . $this->section['id'] . '_settings_fields', $settings ); ?>
19
- <?php foreach( $this->get_settings() as $field ){?>
20
- <?php $this->output_field( $field );?>
21
- <?php }?>
22
- <?php if( 1 == 0 ){?>
23
- <tr>
24
- <th scope="row"><label><?php _e( 'Courses Page', 'learnpress' ); ?></label></th>
25
- <td>
26
- <?php
27
- learn_press_pages_dropdown( $this->get_field_name( "courses_page_id" ), $courses_page_id );
28
- ?>
29
- </td>
30
- </tr>
31
- <tr>
32
- <th scope="row"><label><?php _e( 'Course category base', 'learnpress' ); ?></label></th>
33
- <td>
34
- <input type="text" class="regular-text" name="<?php echo $this->get_field_name( "course_category_base" ); ?>" value="<?php echo $settings->get( 'course_category_base' ); ?>" placeholder="<?php echo 'course-category'; ?>" />
35
- </td>
36
- </tr>
37
- <tr>
38
- <th scope="row"><label><?php _e( 'Course tag base', 'learnpress' ); ?></label></th>
39
- <td>
40
- <input type="text" class="regular-text" name="<?php echo $this->get_field_name( "course_tag_base" ); ?>" value="<?php echo $settings->get( 'course_tag_base' ); ?>" placeholder="<?php echo 'course-tag'; ?>" />
41
- </td>
42
- </tr>
43
- <tr>
44
- <th scope="row"><label><?php _e( 'Review course before publish', 'learnpress' ); ?></label></th>
45
- <td>
46
- <input type="hidden" name="<?php echo $this->get_field_name( "required_review" ); ?>" value="no" />
47
- <input type="checkbox" name="<?php echo $this->get_field_name( "required_review" ); ?>" value="yes" <?php checked( $settings->get( 'required_review' ) == 'yes' );?> />
48
- <p class="description">
49
- <?php _e( 'The course need to review by admin before it can be published', 'learnpress' );?>
50
- </p>
51
- </td>
52
- </tr>
53
- <tr>
54
- <th scope="row"><label><?php _e( 'Enable edit published course', 'learnpress' ); ?></label></th>
55
- <td>
56
- <input type="hidden" name="<?php echo $this->get_field_name( "enable_edit_published" ); ?>" value="no" />
57
- <input type="checkbox" name="<?php echo $this->get_field_name( "enable_edit_published" ); ?>" value="yes" <?php checked( $settings->get( 'enable_edit_published' ) == 'yes' );?> />
58
- <p class="description">
59
- <?php _e( 'Allows instructor edit the course that published without review.<br /> If this option is disabled, the course status will be changed to Pending Review when the instructor update course', 'learnpress' );?>
60
- </p>
61
- </td>
62
- </tr>
63
- <!-- thumbnail -->
64
- <tr>
65
- <th colspan="2">
66
- <h3><?php _e( 'Course images', 'learnpress' );?></h3>
67
- </th>
68
- </tr>
69
- <tr>
70
- <th scope="row"><label><?php _e( 'Single course', 'learnpress' ); ?></label></th>
71
- <td>
72
- <input type="text" size="4" name="<?php echo $this->get_field_name( "single_course_image_size[width]" ); ?>" value="<?php echo $settings->get( 'single_course_image_size.width' ); ?>" placeholder="" />
73
- &times;
74
- <input type="text" size="4" name="<?php echo $this->get_field_name( "single_course_image_size[height]" ); ?>" value="<?php echo $settings->get( 'single_course_image_size.height' ); ?>" placeholder="" />
75
- <?php _e( 'px', 'learnpress' );?>
76
- &nbsp;&nbsp;&nbsp;
77
- <input type="hidden" name="<?php echo $this->get_field_name( "single_course_image_size[crop]" ); ?>" value="no" />
78
- <label>
79
- <input type="checkbox" name="<?php echo $this->get_field_name( "single_course_image_size[crop]" ); ?>" value="yes" <?php checked( $settings->get( 'single_course_image_size.crop' ) == 'yes' ); ?>" />
80
- <?php _e( 'Crop?', 'learn_pres' );?>
81
- </label>
82
- </td>
83
- </tr>
84
- <tr>
85
- <th scope="row"><label><?php _e( 'Course thumbnail', 'learnpress' ); ?></label></th>
86
- <td>
87
- <input type="text" size="4" name="<?php echo $this->get_field_name( "course_thumbnail_image_size[width]" ); ?>" value="<?php echo $settings->get( 'course_thumbnail_image_size.width' ); ?>" placeholder="" />
88
- &times;
89
- <input type="text" size="4" name="<?php echo $this->get_field_name( "course_thumbnail_image_size[height]" ); ?>" value="<?php echo $settings->get( 'course_thumbnail_image_size.height' ); ?>" placeholder="" />
90
- <?php _e( 'px', 'learnpress' );?>
91
- &nbsp;&nbsp;&nbsp;
92
- <input type="hidden" name="<?php echo $this->get_field_name( "course_thumbnail_image_size[crop]" ); ?>" value="no" />
93
- <label>
94
- <input type="checkbox" name="<?php echo $this->get_field_name( "course_thumbnail_image_size[crop]" ); ?>" value="yes" <?php checked( $settings->get( 'course_thumbnail_image_size.crop' ) == 'yes' ); ?>" />
95
- <?php _e( 'Crop?', 'learn_pres' );?>
96
- </label>
97
- </td>
98
- </tr>
99
- <!-- permalink -->
100
- <tr>
101
- <th colspan="2">
102
- <h3><?php _e( 'Single course permalink', 'learnpress' );?></h3>
103
- </th>
104
- </tr>
105
- <?php foreach( $structures as $k => $structure ): ?>
106
- <tr<?php if( $k == 2 || $k == 3 ){ echo ' class="learn-press-courses-page-id'; echo !$courses_page_id ? ' hide-if-js"' : '""'; };?> >
107
- <th>
108
- <?php
109
- $is_checked = checked( ( $course_permalink == '' && $structure['value'] == '' ) || ( $structure['value'] == trailingslashit( $course_permalink ) ), true, false );
110
- if( $is_custom && $is_checked ) {
111
- $is_custom = false;
112
- }
113
- ?>
114
- <label>
115
- <input name="<?php echo $this->get_field_name( "course_base" ); ?>" type="radio" value="<?php echo esc_attr( $structure['value'] ); ?>" class="learn-press-course-base" <?php echo $is_checked; ?> />
116
- <?php echo $structure['text']; ?>
117
- </label>
118
- </th>
119
- <td>
120
- <code><?php echo $structure['code'];?></code>
121
- </td>
122
- </tr>
123
- <?php endforeach; ?>
124
- <tr>
125
- <th>
126
- <label>
127
- <input name="<?php echo $this->get_field_name( "course_base" ); ?>" id="learn_press_custom_permalink" type="radio" value="custom" <?php checked( $is_custom, true ); ?> />
128
- <?php _e( 'Custom Base', 'learnpress' ); ?>
129
- </label>
130
- </th>
131
- <td>
132
- <input name="course_permalink_structure" id="course_permalink_structure" type="text" value="<?php echo esc_attr( $course_permalink ); ?>" class="regular-text code" />
133
- <p class="description"><?php _e( 'Enter a custom base to use. A base <strong>must</strong> be set or WordPress will use default instead.', 'learnpress' ); ?></p>
134
- </td>
135
- </tr>
136
- <?php }?>
137
- <?php do_action( 'learn_press_after_' . $this->id . '_' . $this->section['id'] . '_settings_fields', $settings ); ?>
138
  </tbody>
139
  </table>
140
  <script type="text/javascript">
141
- jQuery( function($) {
142
- $('input.learn-press-course-base').change(function() {
143
- $('#course_permalink_structure').val( $( this ).val() );
144
  });
145
 
146
- $('#course_permalink_structure').focus( function(){
147
  $('#learn_press_custom_permalink').click();
148
- } );
149
 
150
- $('#learn_press_courses_page_id').change(function(){
151
- $('tr.learn-press-courses-page-id').toggleClass( 'hide-if-js', !parseInt( this.value ) )
152
  });
153
- } );
154
  </script>
15
  <h3 class=""><?php echo $this->section['title']; ?></h3>
16
  <table class="form-table">
17
  <tbody>
18
+ <?php
19
+ do_action( 'learn_press_before_' . $this->id . '_' . $this->section['id'] . '_settings_fields', $settings );
20
+ $this->output_settings();
21
+ do_action( 'learn_press_after_' . $this->id . '_' . $this->section['id'] . '_settings_fields', $settings );
22
+ ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  </tbody>
24
  </table>
25
  <script type="text/javascript">
26
+ jQuery(function ($) {
27
+ $('input.learn-press-course-base').change(function () {
28
+ $('#course_permalink_structure').val($(this).val());
29
  });
30
 
31
+ $('#course_permalink_structure').focus(function () {
32
  $('#learn_press_custom_permalink').click();
33
+ });
34
 
35
+ $('#learn_press_courses_page_id').change(function () {
36
+ $('tr.learn-press-courses-page-id').toggleClass('hide-if-js', !parseInt(this.value))
37
  });
38
+ });
39
  </script>
inc/admin/views/settings/emails/_email-template.php ADDED
@@ -0,0 +1,107 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <tr>
2
+ <th scope="row">
3
+ <label for="learn-press-emails-<?php echo $this->id; ?>-email-content"><?php _e( 'Email content', 'learnpress' ); ?></label>
4
+ </th>
5
+ <td>
6
+ <?php learn_press_email_formats_dropdown( array( 'name' => $settings_class->get_field_name( 'emails_' . $this->id . '[email_format]' ), 'id' => 'learn_press_email_formats', 'selected' => $settings->get( 'emails_' . $this->id . '.email_format' ) ) ); ?>
7
+ <?php if ( current_user_can( 'edit_themes' ) && ( !empty( $this->template_html ) || !empty( $this->template_plain ) ) ) { ?>
8
+ <div id="templates">
9
+ <?php
10
+ $templates = array(
11
+ 'html' => __( 'HTML template', 'learnpress' ),
12
+ 'plain' => __( 'Plain text template', 'learnpress' )
13
+ );
14
+ foreach ( $templates as $template_type => $title ) :
15
+ $template = $this->get_template( 'template_' . $template_type );
16
+ /*if ( empty( $template ) ) {
17
+ continue;
18
+ }*/
19
+
20
+ $local_file = $this->get_theme_template_file( $template );
21
+ $template_file = $this->template_base . $template;
22
+ $template_dir = learn_press_template_path();
23
+ ?>
24
+ <div class="template <?php echo $template_type == 'html' ? $template_type . ' multipart' : 'plain_text'; ?>">
25
+
26
+ <?php if ( file_exists( $local_file ) ): ?>
27
+ <p class="description">
28
+ <?php printf( __( 'This template has been overridden by your theme and can be found in: <code>%s</code>. Please open the file in an editor program to edit', 'learnpress' ), 'yourtheme/' . $template_dir . '/' . $template ); ?>
29
+ </p>
30
+ <?php else: ?>
31
+
32
+ <?php endif; ?>
33
+
34
+ <?php if ( file_exists( $local_file ) ) { ?>
35
+ <?php //if( $template_type == 'plain' ){ ?>
36
+ <!-- <div class="editor">
37
+ <textarea name="<?php echo $settings_class->get_field_name( 'emails_' . $this->id . '[email_content_plain]' ); ?>" class="code" cols="25" rows="20" style="width: 97%;"><?php echo file_get_contents( $local_file ); ?></textarea>
38
+ </div>-->
39
+ <?php //} else { ?>
40
+ <?php
41
+ // wp_editor(
42
+ // stripslashes( file_get_contents( $local_file ) ),
43
+ // 'learn_press_email_content_' . $template_type,
44
+ // array(
45
+ // 'textarea_rows' => 20,
46
+ // 'wpautop' => false,
47
+ // 'textarea_name' => $settings_class->get_field_name( 'emails_' . $this->id . '[email_content_html]' )
48
+ // )
49
+ // );
50
+ ?>
51
+ <?php //} ?>
52
+ <h4><?php echo wp_kses_post( $title ); ?></h4>
53
+
54
+ <p class="description">
55
+ <?php printf( __( 'This template has been overridden by your theme and can be found in: <code>%s</code>.', 'learnpress' ), 'yourtheme/' . $template_dir . '/' . $template ); ?>
56
+ </p>
57
+ <p>
58
+ <?php if ( is_writable( $local_file ) ) : ?>
59
+ <a href="<?php echo esc_url( wp_nonce_url( remove_query_arg( array( 'move_template', 'saved' ), add_query_arg( 'delete_template', $template_type ) ), 'learn_press_email_template_nonce', '_learn_press_email_nonce' ) ); ?>" class="delete_template button">
60
+ <?php _e( 'Delete template file', 'learnpress' ); ?>
61
+ </a>
62
+ <?php endif; ?>
63
+ </p>
64
+ <?php } elseif ( file_exists( $template_file ) ) { ?>
65
+ <!-- <div class="editor">
66
+ <textarea class="code" readonly="readonly" disabled="disabled" cols="25" rows="20" style="width: 97%;"><?php echo file_get_contents( $template_file ); ?></textarea>
67
+ </div>-->
68
+ <h4><?php echo wp_kses_post( $title ); ?></h4>
69
+ <p class="description">
70
+ <?php printf( __( 'To override and edit this email template copy <code>%s</code> to your theme folder: <code>%s</code>.', 'learnpress' ), plugin_basename( $template_file ), 'yourtheme/' . $template_dir . '/' . $template ); ?>
71
+ </p>
72
+ <p>
73
+ <?php if ( ( is_dir( get_stylesheet_directory() . '/' . $template_dir . '/emails/' ) && is_writable( get_stylesheet_directory() . '/' . $template_dir . '/emails/' ) ) || is_writable( get_stylesheet_directory() ) ) { ?>
74
+ <a href="<?php echo esc_url( wp_nonce_url( remove_query_arg( array( 'delete_template', 'saved' ), add_query_arg( 'move_template', $template_type ) ), 'learn_press_email_template_nonce', '_learn_press_email_nonce' ) ); ?>" class="button">
75
+ <?php _e( 'Copy file to theme', 'learnpress' ); ?>
76
+ </a>
77
+ <?php } ?>
78
+ </p>
79
+ <?php } else { ?>
80
+
81
+ <p><?php _e( 'File was not found.', 'learnpress' ); ?></p>
82
+
83
+ <?php } ?>
84
+ </div>
85
+ <?php
86
+ endforeach;
87
+ ?>
88
+ <div class="template text_message">
89
+ <?php
90
+ wp_editor(
91
+ $this->get_content_text_message(),
92
+ 'learn_press_email_content_text_message',
93
+ array(
94
+ 'textarea_rows' => 20,
95
+ 'wpautop' => false,
96
+ 'textarea_name' => $settings_class->get_field_name( 'emails_' . $this->id . '[content_text_message]' )
97
+ )
98
+ );
99
+ ?>
100
+ <p class="description">
101
+ <?php printf( '%s', $this->email_text_message_description ); ?>
102
+ </p>
103
+ </div>
104
+ </div>
105
+ <?php } ?>
106
+ </td>
107
+ </tr>
inc/admin/views/settings/emails/email-template.php CHANGED
@@ -1,94 +1,87 @@
 
 
 
1
  <tr>
2
  <th scope="row">
3
- <label for="learn-press-emails-new-course-email-content"><?php _e( 'Email content', 'learnpress' ); ?></label>
4
  </th>
5
  <td>
6
- <?php if ( current_user_can( 'edit_themes' ) && ( !empty( $this->template_html ) || !empty( $this->template_plain ) ) ) { ?>
7
- <div id="templates">
8
- <?php
9
- $templates = array(
10
- 'html' => __( 'HTML template', 'learnpress' ),
11
- 'plain' => __( 'Plain text template', 'learnpress' )
12
- );
13
-
14
- foreach ( $templates as $template_type => $title ) :
15
- $template = $this->get_template( 'template_' . $template_type );
16
-
17
- if ( empty( $template ) ) {
18
- continue;
19
- }
20
 
21
- $local_file = $this->get_theme_template_file( $template );
22
- $template_file = $this->template_base . $template;
23
- $template_dir = learn_press_template_path();
24
- ?>
25
- <div class="template <?php echo $template_type == 'html' ? $template_type . ' multipart' : 'plain_text'; ?>" style="display: none;">
 
 
 
 
 
 
 
 
 
 
26
 
27
- <?php if ( file_exists( $local_file ) ) { ?>
28
- <?php if( $template_type == 'plain' ){ ?>
29
- <div class="editor">
30
- <textarea name="<?php echo $settings_class->get_field_name( 'emails_' . $this->id . '[email_content_plain]' );?>" class="code" cols="25" rows="20" style="width: 97%;"><?php echo file_get_contents( $local_file ); ?></textarea>
31
- </div>
32
- <?php } else { ?>
33
- <?php
34
- wp_editor(
35
- stripslashes( file_get_contents( $local_file ) ),
36
- 'learn_press_email_content_' . $template_type,
37
- array(
38
- 'textarea_rows' => 20,
39
- 'wpautop' => false,
40
- 'textarea_name' => $settings_class->get_field_name( 'emails_' . $this->id . '[email_content_html]' )
41
- )
42
- );
43
- ?>
44
- <?php } ?>
45
- <h4><?php echo wp_kses_post( $title ); ?></h4>
46
 
47
- <p class="description">
48
- <?php printf( __( 'This template has been overridden by your theme and can be found in: <code>%s</code>.', 'learnpress' ), 'yourtheme/' . $template_dir . '/' . $template ); ?>
49
- </p>
50
- <p>
51
- <?php if ( is_writable( $local_file ) ) : ?>
52
- <a href="<?php echo esc_url( wp_nonce_url( remove_query_arg( array( 'move_template', 'saved' ), add_query_arg( 'delete_template', $template_type ) ), 'learn_press_email_template_nonce', '_learn_press_email_nonce' ) ); ?>" class="delete_template button">
53
- <?php _e( 'Delete template file', 'learnpress' ); ?>
54
- </a>
55
- <?php endif; ?>
56
- </p>
57
- <?php } elseif ( file_exists( $template_file ) ) { ?>
 
 
 
 
 
 
 
 
58
  <div class="editor">
59
- <textarea class="code" readonly="readonly" disabled="disabled" cols="25" rows="20" style="width: 97%;"><?php echo file_get_contents( $template_file ); ?></textarea>
60
  </div>
61
- <h4><?php echo wp_kses_post( $title ); ?></h4>
62
- <p class="description">
63
- <?php printf( __( 'To override and edit this email template copy <code>%s</code> to your theme folder: <code>%s</code>.', 'learnpress' ), plugin_basename( $template_file ), 'yourtheme/' . $template_dir . '/' . $template ); ?>
64
- </p>
65
- <p>
66
- <?php if ( ( is_dir( get_stylesheet_directory() . '/' . $template_dir . '/emails/' ) && is_writable( get_stylesheet_directory() . '/' . $template_dir . '/emails/' ) ) || is_writable( get_stylesheet_directory() ) ) { ?>
67
- <a href="<?php echo esc_url( wp_nonce_url( remove_query_arg( array( 'delete_template', 'saved' ), add_query_arg( 'move_template', $template_type ) ), 'learn_press_email_template_nonce', '_learn_press_email_nonce' ) ); ?>" class="button">
68
- <?php _e( 'Copy file to theme', 'learnpress' ); ?>
69
- </a>
70
- <?php } ?>
71
- </p>
72
- <?php } else { ?>
73
-
74
- <p><?php _e( 'File was not found.', 'learnpress' ); ?></p>
75
-
76
- <?php } ?>
77
  </div>
78
- <?php
79
- endforeach;
80
- ?>
81
- </div>
82
- <?php } ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
83
  </td>
84
- </tr>
85
- <?php ob_start();?>
86
- <script>
87
- jQuery(function($){
88
- $('#learn_press_email_formats').change(function(){
89
- var format = $(this).val();
90
- $('.'+format).show().siblings().hide();
91
- }).change();
92
- });
93
- </script>
94
- <?php learn_press_enqueue_script( preg_replace( '!</?script>!', '', ob_get_clean() ) );?>
1
+ <?php
2
+ $email_format = $settings->get( 'emails_' . $this->id . '.email_format' );
3
+ ?>
4
  <tr>
5
  <th scope="row">
6
+ <label for="learn-press-emails-<?php echo $this->id; ?>-email-content"><?php _e( 'Email content', 'learnpress' ); ?></label>
7
  </th>
8
  <td>
9
+ <p><?php learn_press_email_formats_dropdown( array( 'name' => $settings_class->get_field_name( 'emails_' . $this->id . '[email_format]' ), 'id' => 'learn_press_email_formats', 'selected' => $email_format ) ); ?></p>
10
+ <div id="templates">
11
+ <?php
12
+ $templates = array(
13
+ 'html' => __( 'HTML template', 'learnpress' ),
14
+ 'plain' => __( 'Plain text template', 'learnpress' )
15
+ );
16
+ foreach ( $templates as $template_type => $title ) :
17
+ $template = $this->get_template( 'template_' . $template_type );
18
+ /*if ( empty( $template ) ) {
19
+ continue;
20
+ }*/
 
 
21
 
22
+ $local_file = $this->get_theme_template_file( $template, $this->template_path );
23
+ $template_file = $this->template_base . $template;
24
+ $template_dir = $this->template_path;//learn_press_template_path();
25
+ $classes = array( 'learn-press-email-template' );
26
+ if ( $template_type == 'html' ) {
27
+ $classes[] = $template_type . ' multipart';
28
+ } else {
29
+ $classes[] = 'plain_text';
30
+ }
31
+ if ( $template_type == $email_format || ( ( $email_format == 'plain_text' || !$email_format ) && $template_type == 'plain' ) ) {
32
+ } else {
33
+ $classes[] = 'hide-if-js';
34
+ }
35
+ $content_html = stripslashes( $settings->get( 'emails_' . $this->id . '.email_content_html', file_get_contents( $template_file ) ) );
36
+ $content_plain = stripslashes( $settings->get( 'emails_' . $this->id . '.email_content_plain', file_get_contents( $template_file ) ) );
37
 
38
+ $has_local_file = file_exists( $local_file );
39
+ ?>
40
+ <div class="<?php echo join( ' ', $classes ); ?>">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41
 
42
+ <?php if ( $has_local_file ): ?>
43
+ <textarea rows="10" style="width: 90%;" readonly="readonly"><?php echo stripslashes( file_get_contents( $local_file ) ); ?></textarea>
44
+ <p class="description">
45
+ <?php printf( __( 'This template has been overridden by your theme and can be found in: <code>%s</code>. Please open the file in an editor program to edit', 'learnpress' ), 'yourtheme/' . $template_dir . '/' . $template ); ?>
46
+ </p>
47
+ <?php endif; ?>
48
+ <div class="<?php echo $has_local_file ? 'hide-if-js' : ''; ?>">
49
+ <?php if ( $template_type == 'html' ): ?>
50
+ <?php
51
+ wp_editor(
52
+ $content_html,
53
+ 'learn_press_emails_' . $this->id . '_' . $template_type,
54
+ array(
55
+ 'textarea_rows' => 20,
56
+ 'wpautop' => false,
57
+ 'textarea_name' => $settings_class->get_field_name( 'emails_' . $this->id . '[email_content_html]' )
58
+ )
59
+ ); ?>
60
+ <?php else: ?>
61
  <div class="editor">
62
+ <textarea id="<?php echo esc_attr( 'learn_press_emails_' . $this->id . '_' . $template_type ); ?>" name="<?php echo $settings_class->get_field_name( 'emails_' . $this->id . '[email_content_plain]' ); ?>" class="code" cols="25" rows="20" style="width: 97%;"><?php echo $content_plain; ?></textarea>
63
  </div>
64
+ <?php endif; ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
65
  </div>
66
+
67
+ <?php if ( !$has_local_file ): ?>
68
+ <?php if ( $this->support_variables ): ?>
69
+ <p><strong><?php esc_html_e( 'Click on variables to add it into email content', 'learnpress' ); ?></strong></p>
70
+ <ol class="learn-press-email-variables<?php echo $template_type == 'html' ? ' has-editor' : ''; ?>" data-target="<?php echo esc_attr( 'learn_press_emails_' . $this->id . '_' . $template_type ); ?>">
71
+ <?php foreach ( $this->support_variables as $variable ): ?>
72
+ <li data-variable="<?php echo esc_attr( $variable ); ?>">
73
+ <code><?php echo $variable; ?></code></li>
74
+ <?php endforeach; ?>
75
+ </ol>
76
+ <?php endif; ?>
77
+ <p class="description">
78
+ <?php printf( __( 'To override and edit this email template copy <code>%s</code> to your theme folder: <code>%s</code>.', 'learnpress' ), plugin_basename( $template_file ), 'yourtheme/' . $template_dir . '/' . $template ); ?>
79
+ </p>
80
+ <?php endif; ?>
81
+ </div>
82
+ <?php
83
+ endforeach;
84
+ ?>
85
+ </div>
86
  </td>
87
+ </tr>
 
 
 
 
 
 
 
 
 
 
inc/admin/views/settings/emails/enrolled-course.php CHANGED
@@ -14,7 +14,7 @@ $settings = LP()->settings;
14
  ?>
15
  <h3><?php _e( 'Enrolled course', 'learnpress' ); ?></h3>
16
  <p class="description">
17
- <?php _e( 'Send this email to user when they enroll to course', 'learnpress' ); ?>
18
  </p>
19
  <table class="form-table">
20
  <tbody>
@@ -49,6 +49,7 @@ $settings = LP()->settings;
49
  </p>
50
  </td>
51
  </tr>
 
52
  <tr>
53
  <th scope="row">
54
  <label for="learn-press-emails-enrolled-course-email-format"><?php _e( 'Email format', 'learnpress' ); ?></label>
@@ -56,7 +57,7 @@ $settings = LP()->settings;
56
  <td>
57
  <?php learn_press_email_formats_dropdown( array( 'name' => $settings_class->get_field_name( 'emails_enrolled_course[email_format]' ), 'id' => 'learn_press_email_formats', 'selected' => $settings->get( 'emails_enrolled_course.email_format' ) ) ); ?>
58
  </td>
59
- </tr>
60
  <?php
61
  $view = learn_press_get_admin_view( 'settings/emails/email-template.php' );
62
  include_once $view;
14
  ?>
15
  <h3><?php _e( 'Enrolled course', 'learnpress' ); ?></h3>
16
  <p class="description">
17
+ <?php _e( 'Send this email to user when they enroll in the course.', 'learnpress' ); ?>
18
  </p>
19
  <table class="form-table">
20
  <tbody>
49
  </p>
50
  </td>
51
  </tr>
52
+ <!--
53
  <tr>
54
  <th scope="row">
55
  <label for="learn-press-emails-enrolled-course-email-format"><?php _e( 'Email format', 'learnpress' ); ?></label>
57
  <td>
58
  <?php learn_press_email_formats_dropdown( array( 'name' => $settings_class->get_field_name( 'emails_enrolled_course[email_format]' ), 'id' => 'learn_press_email_formats', 'selected' => $settings->get( 'emails_enrolled_course.email_format' ) ) ); ?>
59
  </td>
60
+ </tr>-->
61
  <?php
62
  $view = learn_press_get_admin_view( 'settings/emails/email-template.php' );
63
  include_once $view;
inc/admin/views/settings/emails/finished-course.php CHANGED
@@ -14,7 +14,7 @@ $settings = LP()->settings;
14
  ?>
15
  <h3><?php _e( 'Finished course', 'learnpress' ); ?></h3>
16
  <p class="description">
17
- <?php _e( 'Send this email to user when a course finished', 'learnpress' ); ?>
18
  </p>
19
  <table class="form-table">
20
  <tbody>
@@ -24,7 +24,7 @@ $settings = LP()->settings;
24
  <label for="learn-press-emails-finished-course-enable"><?php _e( 'Enable', 'learnpress' ); ?></label></th>
25
  <td>
26
  <input type="hidden" name="<?php echo $settings_class->get_field_name( 'emails_finished_course[enable]' ); ?>" value="no" />
27
- <input id="learn-press-emails-finished-course-enable" type="checkbox" name="<?php echo $settings_class->get_field_name( 'emails_finished_course[enable]' ); ?>" value="yes" <?php checked( $settings->get( 'emails_finished_course.enable' ) == 'yes' ); ?>" />
28
  </td>
29
  </tr>
30
  <tr>
@@ -49,14 +49,14 @@ $settings = LP()->settings;
49
  </p>
50
  </td>
51
  </tr>
52
- <tr>
53
  <th scope="row">
54
  <label for="learn-press-emails-finished-course-email-format"><?php _e( 'Email format', 'learnpress' ); ?></label>
55
  </th>
56
  <td>
57
  <?php learn_press_email_formats_dropdown( array( 'name' => $settings_class->get_field_name( 'emails_finished_course[email_format]' ), 'id' => 'learn_press_email_formats', 'selected' => $settings->get( 'emails_finished_course.email_format' ) ) ); ?>
58
  </td>
59
- </tr>
60
  <?php
61
  $view = learn_press_get_admin_view( 'settings/emails/email-template.php' );
62
  include_once $view;
14
  ?>
15
  <h3><?php _e( 'Finished course', 'learnpress' ); ?></h3>
16
  <p class="description">
17
+ <?php _e( 'Send this email to user when a user finished a course.', 'learnpress' ); ?>
18
  </p>
19
  <table class="form-table">
20
  <tbody>
24
  <label for="learn-press-emails-finished-course-enable"><?php _e( 'Enable', 'learnpress' ); ?></label></th>
25
  <td>
26
  <input type="hidden" name="<?php echo $settings_class->get_field_name( 'emails_finished_course[enable]' ); ?>" value="no" />
27
+ <input id="learn-press-emails-finished-course-enable" type="checkbox" name="<?php echo $settings_class->get_field_name( 'emails_finished_course[enable]' ); ?>" value="yes" <?php checked( $settings->get( 'emails_finished_course.enable' ) == 'yes' ); ?> />
28
  </td>
29
  </tr>
30
  <tr>
49
  </p>
50
  </td>
51
  </tr>
52
+ <!--<tr>
53
  <th scope="row">
54
  <label for="learn-press-emails-finished-course-email-format"><?php _e( 'Email format', 'learnpress' ); ?></label>
55
  </th>
56
  <td>
57
  <?php learn_press_email_formats_dropdown( array( 'name' => $settings_class->get_field_name( 'emails_finished_course[email_format]' ), 'id' => 'learn_press_email_formats', 'selected' => $settings->get( 'emails_finished_course.email_format' ) ) ); ?>
58
  </td>
59
+ </tr>-->
60
  <?php
61
  $view = learn_press_get_admin_view( 'settings/emails/email-template.php' );
62
  include_once $view;
inc/admin/views/settings/emails/general.php CHANGED
@@ -40,7 +40,7 @@ $settings = LP()->settings;
40
  <th scope="row"><label for="learn-press-emails-general-header-image"><?php _e( 'Header image', 'learnpress' ); ?></label></th>
41
  <td>
42
  <input id="learn-press-emails-general-header-image" class="regular-text" type="text" name="<?php echo $this->get_field_name( 'emails_general[header_image]');?>" value="<?php echo $settings->get( 'emails_general.header_image' ); ?>" />
43
- <p class="description"><?php _e( 'The image display in the top of email', 'learnpress' );?></p>
44
  </td>
45
  </tr>
46
  <tr>
40
  <th scope="row"><label for="learn-press-emails-general-header-image"><?php _e( 'Header image', 'learnpress' ); ?></label></th>
41
  <td>
42
  <input id="learn-press-emails-general-header-image" class="regular-text" type="text" name="<?php echo $this->get_field_name( 'emails_general[header_image]');?>" value="<?php echo $settings->get( 'emails_general.header_image' ); ?>" />
43
+ <p class="description"><?php _e( 'The image will be displayed in the top of the email.', 'learnpress' );?></p>
44
  </td>
45
  </tr>
46
  <tr>
inc/admin/views/settings/emails/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php // Silence is golden.
inc/admin/views/settings/emails/new-course.php CHANGED
@@ -15,7 +15,7 @@ $settings = LP()->settings;
15
  ?>
16
  <h3><?php _e( 'New course for review', 'learnpress' ); ?></h3>
17
  <p class="description">
18
- <?php _e( 'Settings for email when a new course submit for review', 'learnpress' ); ?>
19
  </p>
20
  <table class="form-table">
21
  <tbody>
@@ -64,14 +64,14 @@ $settings = LP()->settings;
64
  </p>
65
  </td>
66
  </tr>
67
- <tr>
68
  <th scope="row">
69
  <label for="learn-press-emails-new-course-email-format"><?php _e( 'Email format', 'learnpress' ); ?></label>
70
  </th>
71
  <td>
72
  <?php learn_press_email_formats_dropdown( array( 'name' => $settings_class->get_field_name( 'emails_new_course[email_format]' ), 'id' => 'learn_press_email_formats', 'selected' => $settings->get( 'emails_new_course.email_format' ) ) ); ?>
73
  </td>
74
- </tr>
75
  <?php
76
  $view = learn_press_get_admin_view( 'settings/emails/email-template.php' );
77
  include_once $view;
15
  ?>
16
  <h3><?php _e( 'New course for review', 'learnpress' ); ?></h3>
17
  <p class="description">
18
+ <?php _e( 'Email settings when a new course is submitted for review.', 'learnpress' ); ?>
19
  </p>
20
  <table class="form-table">
21
  <tbody>
64
  </p>
65
  </td>
66
  </tr>
67
+ <!--<tr>
68
  <th scope="row">
69
  <label for="learn-press-emails-new-course-email-format"><?php _e( 'Email format', 'learnpress' ); ?></label>
70
  </th>
71
  <td>
72
  <?php learn_press_email_formats_dropdown( array( 'name' => $settings_class->get_field_name( 'emails_new_course[email_format]' ), 'id' => 'learn_press_email_formats', 'selected' => $settings->get( 'emails_new_course.email_format' ) ) ); ?>
73
  </td>
74
+ </tr>-->
75
  <?php
76
  $view = learn_press_get_admin_view( 'settings/emails/email-template.php' );
77
  include_once $view;
inc/admin/views/settings/emails/new-order-customer.php CHANGED
@@ -11,10 +11,11 @@ if ( !defined( 'ABSPATH' ) ) {
11
  }
12
 
13
  $settings = LP()->settings;
 
14
  ?>
15
  <h3><?php _e( 'New order customer', 'learnpress' ); ?></h3>
16
  <p class="description">
17
- <?php _e( 'Send email to customer email address when a new order is placed', 'learnpress' ); ?>
18
  </p>
19
  <table class="form-table">
20
  <tbody>
@@ -24,7 +25,7 @@ $settings = LP()->settings;
24
  <label for="learn-press-emails-new-order-enable"><?php _e( 'Enable', 'learnpress' ); ?></label></th>
25
  <td>
26
  <input type="hidden" name="<?php echo $settings_class->get_field_name( 'emails_new_order_customer[enable]' ); ?>" value="no" />
27
- <input id="learn-press-emails-new-order-enable" type="checkbox" name="<?php echo $settings_class->get_field_name( 'emails_new_order_customer[enable]' ); ?>" value="yes" <?php checked( $settings->get( 'emails_new_order_customer.enable' ) == 'yes' ); ?>" />
28
  </td>
29
  </tr>
30
  <tr>
@@ -51,6 +52,7 @@ $settings = LP()->settings;
51
  </p>
52
  </td>
53
  </tr>
 
54
  <tr>
55
  <th scope="row">
56
  <label for="learn-press-emails-new-order-email-format"><?php _e( 'Email format', 'learnpress' ); ?></label>
@@ -59,6 +61,7 @@ $settings = LP()->settings;
59
  <?php learn_press_email_formats_dropdown( array( 'name' => $settings_class->get_field_name( 'emails_new_order_customer[email_format]' ), 'id' => 'learn_press_email_formats', 'selected' => $settings->get( 'emails_new_order_customer.email_format', $default ) ) ); ?>
60
  </td>
61
  </tr>
 
62
  <?php
63
  $view = learn_press_get_admin_view( 'settings/emails/email-template.php' );
64
  include_once $view;
11
  }
12
 
13
  $settings = LP()->settings;
14
+
15
  ?>
16
  <h3><?php _e( 'New order customer', 'learnpress' ); ?></h3>
17
  <p class="description">
18
+ <?php _e( 'Send email to a specific address when a new order is placed.', 'learnpress' ); ?>
19
  </p>
20
  <table class="form-table">
21
  <tbody>
25
  <label for="learn-press-emails-new-order-enable"><?php _e( 'Enable', 'learnpress' ); ?></label></th>
26
  <td>
27
  <input type="hidden" name="<?php echo $settings_class->get_field_name( 'emails_new_order_customer[enable]' ); ?>" value="no" />
28
+ <input id="learn-press-emails-new-order-enable" type="checkbox" name="<?php echo $settings_class->get_field_name( 'emails_new_order_customer[enable]' ); ?>" value="yes" <?php checked( $settings->get( 'emails_new_order_customer.enable' ), 'yes' ); ?> />
29
  </td>
30
  </tr>
31
  <tr>
52
  </p>
53
  </td>
54
  </tr>
55
+ <!--
56
  <tr>
57
  <th scope="row">
58
  <label for="learn-press-emails-new-order-email-format"><?php _e( 'Email format', 'learnpress' ); ?></label>
61
  <?php learn_press_email_formats_dropdown( array( 'name' => $settings_class->get_field_name( 'emails_new_order_customer[email_format]' ), 'id' => 'learn_press_email_formats', 'selected' => $settings->get( 'emails_new_order_customer.email_format', $default ) ) ); ?>
62
  </td>
63
  </tr>
64
+ -->
65
  <?php
66
  $view = learn_press_get_admin_view( 'settings/emails/email-template.php' );
67
  include_once $view;
inc/admin/views/settings/emails/new-order.php CHANGED
@@ -14,7 +14,7 @@ $settings = LP()->settings;
14
  ?>
15
  <h3><?php _e( 'New order', 'learnpress' ); ?></h3>
16
  <p class="description">
17
- <?php _e( 'Send email to specific address when a new order is placed', 'learnpress' ); ?>
18
  </p>
19
  <table class="form-table">
20
  <tbody>
@@ -64,14 +64,14 @@ $settings = LP()->settings;
64
  </p>
65
  </td>
66
  </tr>
67
- <tr>
68
  <th scope="row">
69
  <label for="learn-press-emails-new-order-email-format"><?php _e( 'Email format', 'learnpress' ); ?></label>
70
  </th>
71
  <td>
72
  <?php learn_press_email_formats_dropdown( array( 'name' => $settings_class->get_field_name( 'emails_new_order[email_format]' ), 'id' => 'learn_press_email_formats', 'selected' => $settings->get( 'emails_new_order.email_format', $default ) ) ); ?>
73
  </td>
74
- </tr>
75
  <?php
76
  $view = learn_press_get_admin_view( 'settings/emails/email-template.php' );
77
  include_once $view;
14
  ?>
15
  <h3><?php _e( 'New order', 'learnpress' ); ?></h3>
16
  <p class="description">
17
+ <?php _e( 'Send email to a specific address when a new order is placed', 'learnpress' ); ?>
18
  </p>
19
  <table class="form-table">
20
  <tbody>
64
  </p>
65
  </td>
66
  </tr>
67
+ <!--<tr>
68
  <th scope="row">
69
  <label for="learn-press-emails-new-order-email-format"><?php _e( 'Email format', 'learnpress' ); ?></label>
70
  </th>
71
  <td>
72
  <?php learn_press_email_formats_dropdown( array( 'name' => $settings_class->get_field_name( 'emails_new_order[email_format]' ), 'id' => 'learn_press_email_formats', 'selected' => $settings->get( 'emails_new_order.email_format', $default ) ) ); ?>
73
  </td>
74
+ </tr>-->
75
  <?php
76
  $view = learn_press_get_admin_view( 'settings/emails/email-template.php' );
77
  include_once $view;
inc/admin/views/settings/emails/published-course.php CHANGED
@@ -46,14 +46,14 @@ $settings = LP()->settings;
46
  </p>
47
  </td>
48
  </tr>
49
- <tr>
50
  <th scope="row">
51
  <label for="learn-press-emails-published-course-email-format"><?php _e( 'Email format', 'learnpress' ); ?></label>
52
  </th>
53
  <td>
54
  <?php learn_press_email_formats_dropdown( array( 'name' => $settings_class->get_field_name( 'emails_published_course[email_format]' ), 'id' => 'learn_press_email_formats', 'selected' => $settings->get( 'emails_published_course.email_format' ) ) ); ?>
55
  </td>
56
- </tr>
57
  <?php
58
  $view = learn_press_get_admin_view( 'settings/emails/email-template.php' );
59
  include_once $view;
46
  </p>
47
  </td>
48
  </tr>
49
+ <!--<tr>
50
  <th scope="row">
51
  <label for="learn-press-emails-published-course-email-format"><?php _e( 'Email format', 'learnpress' ); ?></label>
52
  </th>
53
  <td>
54
  <?php learn_press_email_formats_dropdown( array( 'name' => $settings_class->get_field_name( 'emails_published_course[email_format]' ), 'id' => 'learn_press_email_formats', 'selected' => $settings->get( 'emails_published_course.email_format' ) ) ); ?>
55
  </td>
56
+ </tr>-->
57
  <?php
58
  $view = learn_press_get_admin_view( 'settings/emails/email-template.php' );
59
  include_once $view;
inc/admin/views/settings/emails/rejected-course.php CHANGED
@@ -50,14 +50,14 @@ $settings = LP()->settings;
50
  </p>
51
  </td>
52
  </tr>
53
- <tr>
54
  <th scope="row">
55
  <label for="learn-press-emails-rejected-course-email-format"><?php _e( 'Email format', 'learnpress' ); ?></label>
56
  </th>
57
  <td>
58
  <?php learn_press_email_formats_dropdown( array( 'name' => $settings_class->get_field_name( 'emails_rejected_course[email_format]' ), 'id' => 'learn_press_email_formats', 'selected' => $settings->get( 'emails_rejected_course.email_format' ) ) ); ?>
59
  </td>
60
- </tr>
61
  <?php
62
  $view = learn_press_get_admin_view( 'settings/emails/email-template.php' );
63
  include_once $view;
50
  </p>
51
  </td>
52
  </tr>
53
+ <!--<tr>
54
  <th scope="row">
55
  <label for="learn-press-emails-rejected-course-email-format"><?php _e( 'Email format', 'learnpress' ); ?></label>
56
  </th>
57
  <td>
58
  <?php learn_press_email_formats_dropdown( array( 'name' => $settings_class->get_field_name( 'emails_rejected_course[email_format]' ), 'id' => 'learn_press_email_formats', 'selected' => $settings->get( 'emails_rejected_course.email_format' ) ) ); ?>
59
  </td>
60
+ </tr>-->
61
  <?php
62
  $view = learn_press_get_admin_view( 'settings/emails/email-template.php' );
63
  include_once $view;
inc/admin/views/settings/emails/user-order-completed.php CHANGED
@@ -51,14 +51,14 @@ $settings = LP()->settings;
51
  </p>
52
  </td>
53
  </tr>
54
- <tr>
55
  <th scope="row">
56
  <label for="learn-press-emails-new-order-email-format"><?php _e( 'Email format', 'learnpress' ); ?></label>
57
  </th>
58
  <td>
59
  <?php learn_press_email_formats_dropdown( array( 'name' => $settings_class->get_field_name( 'emails_user_order_completed[email_format]' ), 'id' => 'learn_press_email_formats', 'selected' => $settings->get( 'emails_user_order_completed.email_format', $default ) ) ); ?>
60
  </td>
61
- </tr>
62
  <?php
63
  $view = learn_press_get_admin_view( 'settings/emails/email-template.php' );
64
  include_once $view;
51
  </p>
52
  </td>
53
  </tr>
54
+ <!--<tr>
55
  <th scope="row">
56
  <label for="learn-press-emails-new-order-email-format"><?php _e( 'Email format', 'learnpress' ); ?></label>
57
  </th>
58
  <td>
59
  <?php learn_press_email_formats_dropdown( array( 'name' => $settings_class->get_field_name( 'emails_user_order_completed[email_format]' ), 'id' => 'learn_press_email_formats', 'selected' => $settings->get( 'emails_user_order_completed.email_format', $default ) ) ); ?>
60
  </td>
61
+ </tr>-->
62
  <?php
63
  $view = learn_press_get_admin_view( 'settings/emails/email-template.php' );
64
  include_once $view;
inc/admin/views/settings/fields/checkbox.php CHANGED
@@ -1,7 +1,6 @@
1
  <?php
2
  $option_value = $this->get_option( $options['id'], $options['default'] );
3
  $visbility_class = array();
4
-
5
  if ( !isset( $options['hide_if_checked'] ) ) {
6
  $options['hide_if_checked'] = false;
7
  }
1
  <?php
2
  $option_value = $this->get_option( $options['id'], $options['default'] );
3
  $visbility_class = array();
 
4
  if ( !isset( $options['hide_if_checked'] ) ) {
5
  $options['hide_if_checked'] = false;
6
  }
inc/admin/views/settings/fields/course-permalink.php CHANGED
@@ -2,8 +2,8 @@
2
 
3
  $settings = LP()->settings;
4
  global $wp_post_types;
5
- if ( !empty( $wp_post_types[LP()->course_post_type] ) ) {
6
- $course_type = $wp_post_types[LP()->course_post_type];
7
  $default_courses_slug = $course_type->rewrite['slug'];
8
  } else {
9
  $default_courses_slug = '';
@@ -78,6 +78,6 @@ $base_type = get_option( 'learn_press_course_base_type' );
78
  <td>
79
  <input name="course_permalink_structure" id="course_permalink_structure" type="text" value="<?php echo esc_attr( $course_permalink ); ?>" class="regular-text code" />
80
 
81
- <p class="description"><?php _e( 'Enter a custom base to use. A base <strong>must</strong> be set or WordPress will use default instead.', 'learnpress' ); ?></p>
82
  </td>
83
  </tr>
2
 
3
  $settings = LP()->settings;
4
  global $wp_post_types;
5
+ if ( !empty( $wp_post_types[LP_COURSE_CPT] ) ) {
6
+ $course_type = $wp_post_types[LP_COURSE_CPT];
7
  $default_courses_slug = $course_type->rewrite['slug'];
8
  } else {
9
  $default_courses_slug = '';
78
  <td>
79
  <input name="course_permalink_structure" id="course_permalink_structure" type="text" value="<?php echo esc_attr( $course_permalink ); ?>" class="regular-text code" />
80
 
81
+ <p class="description"><?php _e( 'Enter a custom base to use. A base <strong>must</strong> be set or WordPress will use default values instead.', 'learnpress' ); ?></p>
82
  </td>
83
  </tr>
inc/admin/views/settings/fields/html.php CHANGED
@@ -1,6 +1,11 @@
1
  <?php
 
 
 
 
 
2
  ?>
3
- <tr valign="top">
4
  <th scope="row" class="titledesc">
5
  <label for="<?php echo esc_attr( $options['id'] ); ?>"><?php echo esc_html( $options['title'] ); ?></label>
6
  </th>
1
  <?php
2
+ $visbility_class = array();
3
+ if ( 'yes' == $options['hide_if_checked'] ) {
4
+ $visbility_class[] = 'hide-if-js';
5
+ }
6
+ $visbility_class[] = $options['class'];
7
  ?>
8
+ <tr valign="top"class="<?php echo esc_attr( implode( ' ', $visbility_class ) ); ?>">
9
  <th scope="row" class="titledesc">
10
  <label for="<?php echo esc_attr( $options['id'] ); ?>"><?php echo esc_html( $options['title'] ); ?></label>
11
  </th>
inc/admin/views/settings/fields/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php // Silence is golden.
inc/admin/views/settings/fields/radio.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $option_value = $this->get_option( $options['id'], $options['default'] );
3
+ $visbility_class = array();
4
+ ?>
5
+ <tr valign="top" class="<?php echo esc_attr( implode( ' ', $visbility_class ) ); ?>">
6
+ <th scope="row" class="titledesc"><?php echo esc_html( $options['title'] ) ?></th>
7
+ <td class="forminp forminp-checkbox">
8
+ <fieldset>
9
+ <?php if ( $options['options'] ) : foreach ( $options['options'] as $value => $text ) : ?>
10
+ <p>
11
+ <label for="<?php echo esc_attr( $options['id'] . $value ) ?>">
12
+ <input type="radio" name="<?php echo esc_attr( $options['id'] ) ?>" value="<?php echo esc_attr( $value ) ?>" class="<?php echo esc_attr( isset( $options['class'] ) ? $options['class'] : '' ); ?>" id="<?php echo esc_attr( $options['id'] . $value ) ?>" <?php checked( $option_value, $value ) ?>/>
13
+ <?php echo esc_html( $text ) ?>
14
+ </label>
15
+ </p>
16
+ <?php endforeach; endif; ?>
17
+ </fieldset>
18
+ </td>
19
+ </tr>
inc/admin/views/settings/general.php CHANGED
@@ -13,93 +13,12 @@ if ( !defined( 'ABSPATH' ) ) {
13
 
14
  $settings = LP()->settings;
15
  ?>
 
16
  <table class="form-table">
17
  <tbody>
18
- <?php do_action( 'learn_press_before_general_settings_fields', $settings ); ?>
19
- <?php foreach( $this->get_settings() as $field ){?>
20
- <?php $this->output_field( $field );?>
21
- <?php }?>
22
-
23
- <?php if(1 == 0){?>
24
- <tr>
25
- <th scope="row">
26
- <label><?php _e( 'Instructors registration', 'learnpress' ); ?></label>
27
- </th>
28
- <td>
29
- <input type="hidden" name="<?php echo $this->get_field_name( 'instructor_registration' ); ?>" value="no">
30
- <input type="checkbox" name="<?php echo $this->get_field_name( 'instructor_registration' ); ?>" value="yes" <?php checked( $settings->get( 'instructor_registration' ) == 'yes', true ); ?> />
31
-
32
- <p class="description"><?php _e( 'Create option for instructors registration', 'learnpress' ); ?></p>
33
- </td>
34
- </tr>
35
- <tr>
36
- <th><label><?php _e( 'Auto update post name', 'learnpress' ); ?></label></th>
37
- <td>
38
- <input type="hidden" name="<?php echo $this->get_field_name( 'auto_update_post_name' ); ?>" value="no">
39
- <input type="checkbox" name="<?php echo $this->get_field_name( 'auto_update_post_name' ); ?>" value="yes" <?php checked( $settings->get( 'auto_update_post_name' ) == 'yes', true ); ?> />
40
- <p class="description">
41
- <?php _e( 'The post\'s name will update along with the title when changes title of lesson or quiz in course curriculum or question in quiz<br />The permalink also is changed, therefore uncheck this if you don\'t want to change the permalink', 'learnpress' );?>
42
- </p>
43
- </td>
44
- </tr>
45
- <tr>
46
- <th><label><?php _e( 'Currency', 'learnpress' ); ?></label></th>
47
- <td>
48
- <select name="<?php echo $this->get_field_name( 'currency' ); ?>">
49
- <?php if ( $payment_currencies = learn_press_get_payment_currencies() ) foreach ( $payment_currencies as $code => $symbol ) { ?>
50
- <?php $selected = selected( $settings->get( 'currency' ) == $code ? 1 : 0, 1, false ); ?>
51
- <option <?php echo $selected; ?> value="<?php echo $code; ?>"><?php echo $symbol; ?></option>
52
- <?php } ?>
53
- </select>
54
- </td>
55
- </tr>
56
- <tr>
57
- <th><label><?php _e( 'Currency Position', 'learnpress' ); ?></label>
58
- </th>
59
- <td>
60
- <select name="<?php echo $this->get_field_name( 'currency_pos' ); ?>">
61
- <?php foreach ( learn_press_currency_positions() as $pos => $text ) { ?>
62
- <option value="<?php echo $pos; ?>" <?php selected( $settings->get( 'currency_pos' ) == $pos ? 1 : 0, 1 ); ?>>
63
- <?php
64
- switch ( $pos ) {
65
- case 'left':
66
- printf( '%s ( %s%s )', $text, learn_press_get_currency_symbol(), '69.99' );
67
- break;
68
- case 'right':
69
- printf( '%s ( %s%s )', $text, '69.99', learn_press_get_currency_symbol() );
70
- break;
71
- case 'left_with_space':
72
- printf( '%s ( %s %s )', $text, learn_press_get_currency_symbol(), '69.99' );
73
- break;
74
- case 'right_with_space':
75
- printf( '%s ( %s %s )', $text, '69.99', learn_press_get_currency_symbol() );
76
- break;
77
- }
78
- ?>
79
- </option>
80
- <?php } ?>
81
- </select>
82
- </td>
83
- </tr>
84
- <tr>
85
- <th><label><?php _e( 'Thousands Separator', 'learnpress' ); ?></label></th>
86
- <td>
87
- <input class="regular_text" type="text" name="<?php echo $this->get_field_name( 'thousands_separator' ); ?>" value="<?php echo $settings->get( 'thousands_separator', ',' ); ?>" />
88
- </td>
89
- </tr>
90
- <tr>
91
- <th><label><?php _e( 'Decimals Separator', 'learnpress' ); ?></label></th>
92
- <td>
93
- <input class="regular_text" type="text" name="<?php echo $this->get_field_name( 'decimals_separator' ); ?>" value="<?php echo $settings->get( 'decimals_separator', '.' ); ?>" />
94
- </td>
95
- </tr>
96
- <tr>
97
- <th><label><?php _e( 'Number of Decimals', 'learnpress' ); ?></label></th>
98
- <td>
99
- <input class="regular_text" type="text" name="<?php echo $this->get_field_name( 'number_of_decimals' ); ?>" value="<?php echo $settings->get( 'number_of_decimals', 2 ); ?>" />
100
- </td>
101
- </tr>
102
- <?php do_action( 'learn_press_after_general_settings_fields', $settings ); ?>
103
- <?php }?>
104
  </tbody>
105
  </table>
13
 
14
  $settings = LP()->settings;
15
  ?>
16
+
17
  <table class="form-table">
18
  <tbody>
19
+ <?php
20
+ do_action( 'learn_press_before_general_settings_fields', $settings );
21
+ $this->output_settings();
22
+ ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  </tbody>
24
  </table>
inc/admin/views/settings/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php // Silence is golden.
inc/admin/views/settings/pages/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php // Silence is golden.
inc/admin/views/settings/profile.php CHANGED
@@ -19,17 +19,6 @@ $settings = LP()->settings;
19
  <?php foreach( $this->get_settings() as $field ){?>
20
  <?php $this->output_field( $field );?>
21
  <?php }?>
22
- <?php if( 1 == 0 ){?>
23
- <tr>
24
- <th scope="row"><label><?php _e( 'Profile page', 'learnpress' ); ?></label></th>
25
- <td>
26
- <?php
27
- $profile_page_id = $settings->get( 'profile_page_id', 0 );
28
- learn_press_pages_dropdown( $this->get_field_name( "profile_page_id" ), $profile_page_id );
29
- ?>
30
- </td>
31
- </tr>
32
- <?php }?>
33
  <?php do_action( 'learn_press_after_' . $this->id . '_settings_fields', $this ); ?>
34
  </tbody>
35
  </table>
19
  <?php foreach( $this->get_settings() as $field ){?>
20
  <?php $this->output_field( $field );?>
21
  <?php }?>
 
 
 
 
 
 
 
 
 
 
 
22
  <?php do_action( 'learn_press_after_' . $this->id . '_settings_fields', $this ); ?>
23
  </tbody>
24
  </table>
inc/admin/views/settings/setting-field.php CHANGED
@@ -36,7 +36,6 @@ switch ( $options['type'] ) {
36
  case 'select' :
37
  case 'multiselect' :
38
 
39
-
40
  break;
41
 
42
  // Radio inputs
@@ -80,11 +79,9 @@ switch ( $options['type'] ) {
80
  // Checkbox input
81
  case 'checkbox' :
82
 
83
-
84
  break;
85
  // Image width settings
86
- case
87
- 'image_width' :
88
 
89
  $image_size = str_replace( '_image_size', '', $options['id'] );
90
  $size = learn_press_get_image_size( $image_size );
36
  case 'select' :
37
  case 'multiselect' :
38
 
 
39
  break;
40
 
41
  // Radio inputs
79
  // Checkbox input
80
  case 'checkbox' :
81
 
 
82
  break;
83
  // Image width settings
84
+ case 'image_width' :
 
85
 
86
  $image_size = str_replace( '_image_size', '', $options['id'] );
87
  $size = learn_press_get_image_size( $image_size );
inc/admin/views/statistics/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php // Silence is golden.
inc/admin/views/updates/0.9/step-welcome.php CHANGED
@@ -1,7 +1,7 @@
1
  <h2><?php _e( 'Welcome to LearnPress!', 'learnpress' ); ?></h2>
2
- <p><?php _e( 'Thank you for choosing LearnPress to sell your course online!', 'learnpress' ); ?></p>
3
  <p><?php printf( __( 'In version <strong>%s</strong> of LearnPress we have a big update and need to upgrade your database to ensure system works properly.', 'learnpress' ), learn_press_get_current_version() ); ?></p>
4
- <p><?php _e( 'We are very careful in the upgrading database but be sure to backup your database before upgrading to avoid the risks may be encountered.', 'learnpress' ); ?></p>
5
  <p><?php _e( 'Click <strong>Yes, upgrade!</strong> button to start.', 'learnpress' ); ?></p>
6
  <p class="lp-update-actions">
7
  <a href="<?php echo esc_url( admin_url( '' ) ); ?>" class="button"><?php _e( 'No, back to Admin', 'learnpress' ); ?></a>
1
  <h2><?php _e( 'Welcome to LearnPress!', 'learnpress' ); ?></h2>
2
+ <p><?php _e( 'Thank you for choosing LearnPress to sell your courses online!', 'learnpress' ); ?></p>
3
  <p><?php printf( __( 'In version <strong>%s</strong> of LearnPress we have a big update and need to upgrade your database to ensure system works properly.', 'learnpress' ), learn_press_get_current_version() ); ?></p>
4
+ <p><?php _e( 'We are very careful in upgrading the database but be sure to backup your database before upgrading to avoid the risks may be encountered.', 'learnpress' ); ?></p>
5
  <p><?php _e( 'Click <strong>Yes, upgrade!</strong> button to start.', 'learnpress' ); ?></p>
6
  <p class="lp-update-actions">
7
  <a href="<?php echo esc_url( admin_url( '' ) ); ?>" class="button"><?php _e( 'No, back to Admin', 'learnpress' ); ?></a>
inc/admin/views/updates/1.0/step-repair-database.php DELETED
@@ -1,19 +0,0 @@
1
- <h2><?php _e( 'Update Database', 'learnpress' ); ?></h2>
2
- <ul id="lp-update-database">
3
- <li id="lp-update-post-type">
4
- <?php _e( 'Update custom post type', 'learnpress' );?>
5
- </li>
6
- <li id="lp-update-post-meta">
7
- <?php _e( 'Update post meta', 'learnpress' );?>
8
- </li>
9
- <li id="lp-update-post-meta">
10
- <?php _e( 'Update post meta', 'learnpress' );?>
11
- </li>
12
- </ul>
13
- <p class="lp-update-message">
14
- <?php _e( 'Updating! Please do not close this page until the work is done', 'learnpress' );?>
15
- </p>
16
- <p class="lp-update-actions">
17
- <a href="" id="button-repair-database" class="button-primary button"><?php _e( 'Update Now', 'learnpress' ); ?></a>
18
- <a href="" id="button-rollback-database" class="button"><?php _e( 'Rollback', 'learnpress' ); ?></a>
19
- </p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/admin/views/updates/1.0/step-upgraded.php DELETED
@@ -1,11 +0,0 @@
1
- <h2><?php _e( 'Upgrade complete successfully!', 'learnpress' ); ?></h2>
2
- <h3 style="font-size: 14px;"><?php _e( 'What\'s next?', 'learnpress' );?></h3>
3
- <ul>
4
- <li>
5
- <a href="<?php echo admin_url( 'edit.php?post_type=lp_course' ); ?>"><?php _e( 'Manage courses', 'learnpress' ); ?></a>
6
- </li>
7
- <li><a href="<?php echo admin_url( 'post-new.php?post_type=lp_course' );?>"><?php _e( 'Create a new course', 'learnpress' ); ?></a></li>
8
- <li><a href="<?php echo admin_url( 'options-general.php?page=learn_press_settings' );?>"><?php _e( 'Setting up your LearnPress', 'learnpress' ); ?></a></li>
9
- <li><a href="<?php echo admin_url( 'admin.php?page=learn_press_add_ons' );?>"><?php _e( 'Manage add-ons', 'learnpress' ); ?></a></li>
10
- <li><a href="<?php echo admin_url( 'index.php' );?>"><?php _e( 'Dashboard', 'learnpress' ); ?></a></li>
11
- </ul>
 
 
 
 
 
 
 
 
 
 
 
inc/admin/views/updates/1.0/step-welcome.php DELETED
@@ -1,10 +0,0 @@
1
- <h2><?php _e( 'Welcome to LearnPress!', 'learnpress' ); ?></h2>
2
- <p><?php _e( 'Thank you for choosing LearnPress to sell your course online!', 'learnpress' ); ?></p>
3
- <p><?php _e( 'In version 1.0 of LearnPress we have a big update and need to upgrade your database to ensure system works properly.', 'learnpress' ); ?></p>
4
- <p><?php _e( 'We are very careful in the upgrading database but be sure to backup your database before upgrading to avoid the risks may be encountered.', 'learnpress' ); ?></p>
5
- <p><?php _e( 'Click <strong>Yes, upgrade!</strong> button to start.', 'learnpress' ); ?></p>
6
- <p class="lp-update-actions">
7
- <a href="<?php echo esc_url( admin_url( '' ) ); ?>" class="button"><?php _e( 'No, back to Admin', 'learnpress' ); ?></a>
8
- <a id="learn-press-update-button" class="button-primary button"><?php _e( 'Yes, upgrade!', 'learnpress' ); ?></a>
9
- </p>
10
- <input type="hidden" name="action" value="upgrade" />
 
 
 
 
 
 
 
 
 
 
inc/admin/views/updates/1.0/update-10-wizard.php DELETED
@@ -1,29 +0,0 @@
1
- <!DOCTYPE html>
2
- <html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
3
- <head>
4
- <meta name="viewport" content="width=device-width" />
5
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
- <title><?php _e( 'LearnPress update version 1.0', 'learnpress' ); ?></title>
7
- <?php wp_print_scripts( 'wc-setup' ); ?>
8
- <?php do_action( 'admin_print_styles' ); ?>
9
- <?php do_action( 'admin_print_scripts' ); ?>
10
- <?php do_action( 'admin_head' ); ?>
11
- <script type="text/javascript">
12
- if( typeof window.ajaxurl == 'undefined' ) {
13
- window.ajaxurl = '<?php echo admin_url( 'admin-ajax.php' );?>';
14
- }
15
- </script>
16
- </head>
17
- <body class="wp-core-ui lp-update-10">
18
- <h1 class="head">
19
- <span class="dashicons dashicons-welcome-learn-more"></span>
20
- <?php _e( 'LearnPress update version 1.0', 'learnpress' );?>
21
- </h1>
22
- <div class="lp-update-content">
23
- <form name="learn-press-upgrade" method="post" action="options-general.php?page=learn_press_upgrade_10&_wpnonce=<?php echo wp_create_nonce( 'learn-press-upgrade' );?>">
24
- <?php do_action( 'learn_press_update_step_' . $this->_current_step );?>
25
- <?php wp_nonce_field( 'learn-press-upgrade', '_wpnonce' );?>
26
- </form>
27
- </div>
28
- </body>
29
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/admin/views/updates/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php // Silence is golden.
inc/cart/class-lp-cart.php CHANGED
@@ -26,19 +26,25 @@ class LP_Cart {
26
  *
27
  * @var array
28
  */
29
- private $_cart_content = array();
 
 
 
 
 
 
 
30
 
31
  /**
32
  * Constructor
33
  */
34
  public function __construct() {
35
- //if ( self::$instance ) return;
36
- if ( !is_array( $this->_cart_content = LP_Session::get( 'cart' ) ) ) {
37
  $this->_cart_content = $this->get_default_cart_content();
38
  }
39
 
40
  $remove_items = array();
41
- if ( $this->_cart_content['items'] ) {
42
  foreach ( $this->_cart_content['items'] as $k => $item ) {
43
  if ( empty( $item['item_id'] ) || !get_post( $item['item_id'] ) ) {
44
  $remove_items[] = $item['item_id'];
@@ -52,7 +58,15 @@ class LP_Cart {
52
  }
53
  LP_Request_Handler::register( 'add-course-to-cart', array( $this, 'add_to_cart' ), 20 );
54
  LP_Request_Handler::register( 'remove-cart-item', array( $this, 'remove_item' ), 20 );
 
55
  add_action( 'learn_press_add_to_cart', array( $this, 'calculate_totals' ), 10 );
 
 
 
 
 
 
 
56
  }
57
 
58
  public function __get( $key ) {
@@ -72,6 +86,45 @@ class LP_Cart {
72
  return $return;
73
  }
74
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
75
  /**
76
  * Add course to cart
77
  *
@@ -81,6 +134,49 @@ class LP_Cart {
81
  */
82
  public function add_to_cart( $course_id, $quantity = 1, $item_data = array() ) {
83
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
84
  if ( !learn_press_is_enable_cart() ) {
85
  $this->empty_cart();
86
  }
@@ -106,6 +202,11 @@ class LP_Cart {
106
  'data' => $item_data
107
  )
108
  );
 
 
 
 
 
109
  do_action( 'learn_press_add_to_cart', $course_id, $quantity, $item_data, $this );
110
  $button = '';
111
 
@@ -118,26 +219,27 @@ class LP_Cart {
118
  } else {
119
  $redirect = add_query_arg( 'next', 'enroll-course', $redirect );
120
  }
121
- learn_press_add_notice( __( 'Please login to continue process.', 'learnpress' ) );
122
  $checkout_results['redirect'] = apply_filters( 'learn_press_no_checkout_free_course_redirect', $redirect );
123
  } else {
124
  add_filter( 'learn_press_checkout_success_result', '_learn_press_checkout_auto_enroll_free_course', 10, 2 );
125
  $checkout_results = LP_Checkout::instance()->process_checkout();
126
  }
127
- if ( is_ajax() ) {
 
128
  learn_press_send_json(
129
  $checkout_results
130
  );
131
  } else {
132
  wp_redirect( $checkout_results['redirect'] );
133
  exit();
134
- }
135
  } else {
136
  if ( learn_press_is_enable_cart() ) {
137
  if ( LP()->settings->get( 'redirect_after_add' ) == 'yes' ) {
138
  $redirect = learn_press_get_page_link( 'cart' );
139
  if ( !$redirect ) {
140
- learn_press_add_notice( sprintf( __( 'Cart page is not setting up.', 'learnpress' ) ) );
141
  $redirect = learn_press_get_current_url();
142
  } else {
143
  $button = sprintf( '<a href="%s">%s</a>', get_the_permalink( $course_id ), __( 'Back to class', 'learnpress' ) );
@@ -145,21 +247,22 @@ class LP_Cart {
145
  } else {
146
  $redirect = get_the_permalink( $course_id );
147
  if ( !learn_press_get_page_link( 'cart' ) ) {
148
- learn_press_add_notice( sprintf( __( 'Checkout page is not setting up.', 'learnpress' ) ) );
149
  } else {
150
  $button = sprintf( '<a href="%s">%s</a>', learn_press_get_page_link( 'cart' ), __( 'View cart', 'learnpress' ) );
151
  }
152
  }
153
- learn_press_add_notice( sprintf( __( '<strong>%s</strong> has been added to your cart. %s', 'learnpress' ), get_the_title( $course_id ), $button ) );
154
 
155
  } else {
156
  $redirect = learn_press_get_page_link( 'checkout' );
157
  if ( !$redirect ) {
158
- learn_press_add_notice( sprintf( __( 'Checkout page is not setting up.', 'learnpress' ) ) );
159
  $redirect = learn_press_get_current_url();
160
  }
161
  }
162
  }
 
163
  $redirect = apply_filters( 'learn_press_add_to_cart_redirect', $redirect, $course_id );
164
 
165
  if ( is_ajax() ) {
@@ -176,10 +279,35 @@ class LP_Cart {
176
  }
177
  }
178
 
 
 
 
 
 
 
 
179
  public function has_item( $item_id ) {
180
  return isset( $this->_cart_content['items'][$item_id] );
181
  }
182
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
183
  public function remove_item( $item_id ) {
184
  if ( isset( $this->_cart_content['items'][$item_id] ) ) {
185
 
@@ -197,9 +325,13 @@ class LP_Cart {
197
  return false;
198
  }
199
 
 
 
 
200
  public function calculate_totals() {
201
- if ( $items = $this->_cart_content['items'] ) {
202
- $subtotal = 0;
 
203
  foreach ( $items as $item_id => $item ) {
204
  $course = learn_press_get_course( $item_id );
205
  if ( $course ) {
@@ -209,15 +341,18 @@ class LP_Cart {
209
  $this->_cart_content['items'][$item_id]['total'] = $_subtotal;
210
  $subtotal += $_subtotal;
211
  }
212
- $this->_cart_content['subtotal'] = $subtotal;
213
- $this->_cart_content['total'] = $subtotal;
214
- }
215
 
 
 
 
216
  $this->update_session();
217
  }
218
 
 
 
 
219
  public function update_session() {
220
- LP_Session::set( 'cart', $this->_cart_content );
221
  }
222
 
223
  /**
@@ -238,12 +373,19 @@ class LP_Cart {
238
  if ( !did_action( 'learn_press_get_cart_from_session' ) ) {
239
  $this->get_cart_from_session();
240
  }
241
- return $this->_cart_content['items'];
242
  }
243
 
244
- public function get_cart_from_session() {
245
- $this->_cart_content = LP_Session::get( 'cart' );
246
- do_action( 'learn_press_get_cart_from_session' );
 
 
 
 
 
 
 
247
  }
248
 
249
  /**
@@ -277,6 +419,14 @@ class LP_Cart {
277
  return md5( time() );
278
  }
279
 
 
 
 
 
 
 
 
 
280
  public function get_item_subtotal( $course, $quantity = 1 ) {
281
  $price = $course->get_price();
282
  $row_price = $price * $quantity;
@@ -293,8 +443,9 @@ class LP_Cart {
293
 
294
  do_action( 'learn_press_before_empty_cart' );
295
 
296
- LP_Session::set( 'cart', $this->get_default_cart_content() );
297
- $this->get_cart_from_session();
 
298
 
299
  do_action( 'learn_press_emptied_cart' );
300
 
@@ -307,9 +458,14 @@ class LP_Cart {
307
  * @return bool
308
  */
309
  public function is_empty() {
310
- return !$this->_cart_content['items'];
311
  }
312
 
 
 
 
 
 
313
  public function get_cart_content() {
314
  return $this->_cart_content;
315
  }
@@ -324,6 +480,9 @@ class LP_Cart {
324
  }
325
 
326
  /**
 
 
 
327
  * @return mixed
328
  */
329
  public function get_checkout_url() {
@@ -331,10 +490,67 @@ class LP_Cart {
331
  return apply_filters( 'learn_press_get_checkout_url', $checkout_url );
332
  }
333
 
 
 
 
 
 
 
334
  public function needs_payment() {
335
  return apply_filters( 'learn_press_cart_needs_payment', $this->total > 0, $this );
336
  }
337
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
338
  /**
339
  * Destroy cart instance
340
  */
@@ -402,14 +618,6 @@ function learn_press_get_cart_total() {
402
  return LP()->cart->total;
403
  }
404
 
405
- /**
406
- * Return true if enable cart
407
- *
408
- * @return bool
409
- */
410
- function learn_press_is_enable_cart() {
411
- return apply_filters( 'learn_press_enable_cart', LP()->settings->get( 'enable_cart' ) == 'yes' );
412
- }
413
 
414
  function learn_press_clear_cart_after_payment() {
415
  global $wp;
@@ -440,4 +648,7 @@ function learn_press_clear_cart_after_payment() {
440
 
441
  add_action( 'get_header', 'learn_press_clear_cart_after_payment' );
442
 
 
 
 
443
  //learn_press_get_cart_description();
26
  *
27
  * @var array
28
  */
29
+ protected $_cart_content = array();
30
+
31
+ /**
32
+ * Key of cart content stored in session
33
+ *
34
+ * @var string
35
+ */
36
+ protected $_cart_session_key = 'cart';
37
 
38
  /**
39
  * Constructor
40
  */
41
  public function __construct() {
42
+ if ( !is_array( $this->_cart_content = learn_press_session_get( $this->_cart_session_key ) ) ) {
 
43
  $this->_cart_content = $this->get_default_cart_content();
44
  }
45
 
46
  $remove_items = array();
47
+ if ( !empty( $this->_cart_content['items'] ) ) {
48
  foreach ( $this->_cart_content['items'] as $k => $item ) {
49
  if ( empty( $item['item_id'] ) || !get_post( $item['item_id'] ) ) {
50
  $remove_items[] = $item['item_id'];
58
  }
59
  LP_Request_Handler::register( 'add-course-to-cart', array( $this, 'add_to_cart' ), 20 );
60
  LP_Request_Handler::register( 'remove-cart-item', array( $this, 'remove_item' ), 20 );
61
+
62
  add_action( 'learn_press_add_to_cart', array( $this, 'calculate_totals' ), 10 );
63
+ add_action( 'wp', array( $this, 'maybe_set_cart_cookies' ), 99 ); // Set cookies
64
+ add_action( 'shutdown', array( $this, 'maybe_set_cart_cookies' ), 0 ); // Set cookies before shutdown and ob flushing
65
+ add_action( 'wp_loaded', array( $this, 'init' ) );
66
+ }
67
+
68
+ function init() {
69
+ $this->get_cart_from_session();
70
  }
71
 
72
  public function __get( $key ) {
86
  return $return;
87
  }
88
 
89
+ public function maybe_set_cart_cookies() {
90
+ if ( !headers_sent()/* && did_action( 'wp_loaded' )*/ ) {
91
+ $this->set_cart_cookies( !$this->is_empty() );
92
+ }
93
+ }
94
+
95
+ private function set_cart_cookies( $set = true ) {
96
+ if ( $set ) {
97
+ learn_press_setcookie( 'learn_press_items_in_cart', 1 );
98
+ $this->get_cart_for_session();
99
+ } elseif ( isset( $_COOKIE['learn_press_items_in_cart'] ) ) {
100
+ learn_press_setcookie( 'learn_press_items_in_cart', 0, time() - HOUR_IN_SECONDS );
101
+ }
102
+ do_action( 'learn_press_set_cart_cookies', $set );
103
+ }
104
+
105
+ public function get_cart_for_session() {
106
+ $cart_session = array();
107
+
108
+ if ( $this->get_cart() ) {
109
+ foreach ( $this->get_cart() as $key => $values ) {
110
+ $cart_session[$key] = $values;
111
+ unset( $cart_session[$key]['data'] ); // Unset product object
112
+ }
113
+ }
114
+
115
+ return $cart_session;
116
+ }
117
+
118
+ public function get_cart() {
119
+ if ( !did_action( 'wp_loaded' ) ) {
120
+ _doing_it_wrong( __FUNCTION__, __( 'Get cart should not be called before the wp_loaded action.', 'woocommerce' ), '2.3' );
121
+ }
122
+ if ( !did_action( 'learn_press_cart_loaded_from_session' ) ) {
123
+ $this->get_cart_from_session();
124
+ }
125
+ return array_filter( (array) $this->_cart_content );
126
+ }
127
+
128
  /**
129
  * Add course to cart
130
  *
134
  */
135
  public function add_to_cart( $course_id, $quantity = 1, $item_data = array() ) {
136
 
137
+ $course = learn_press_get_course( $course_id );
138
+
139
+ // course is not purchasable
140
+ if ( !$course->is_purchasable() ) {
141
+ learn_press_display_message( __( 'Sorry! This course is not purchasable.', 'learnpress' ) );
142
+ if ( $redirect = apply_filter( 'learn_press_course_is_not_purchasable_redirect', get_the_permalink( $course_id ), $course_id ) ) {
143
+ wp_redirect( $redirect );
144
+ exit();
145
+ }
146
+ return;
147
+ }
148
+
149
+ /**
150
+ * Generate course information and stores into session
151
+ * for redirection if needed then we can remove it immediately
152
+ */
153
+ $quantity = apply_filters( 'learn_press_purchase_course_quantity', $quantity, $course_id );
154
+ $price = $course->is_free() ? 0 : $course->get_price();
155
+ /*$course_info = apply_filters( 'learn_press_purchase_course_info', array(
156
+ 'item_id' => $course_id,
157
+ 'quantity' => $quantity,
158
+ 'subtotal' => $price * $quantity,
159
+ 'total' => $price * $quantity,
160
+ 'data' => apply_filters( 'learn_press_purchase_course_info_data', $_REQUEST )
161
+ )
162
+ );*/
163
+
164
+ $this->_cart_content['items'][$course_id] = apply_filters( 'learn_press_add_cart_item', array(
165
+ 'item_id' => $course_id,
166
+ 'quantity' => $quantity,
167
+ 'subtotal' => $price * $quantity,
168
+ 'total' => $price * $quantity,
169
+ 'data' => $item_data
170
+ )
171
+ );
172
+
173
+ if ( did_action( 'wp' ) ) {
174
+ $this->set_cart_cookies( true );
175
+ }
176
+
177
+ do_action( 'learn_press_add_to_cart', $course_id, $quantity, $item_data, $this );
178
+ return;
179
+
180
  if ( !learn_press_is_enable_cart() ) {
181
  $this->empty_cart();
182
  }
202
  'data' => $item_data
203
  )
204
  );
205
+
206
+ learn_press_session_set( $this->_cart_session_key, $this->_cart_content );
207
+
208
+ $this->set_cart_cookies( !$this->is_empty() );
209
+
210
  do_action( 'learn_press_add_to_cart', $course_id, $quantity, $item_data, $this );
211
  $button = '';
212
 
219
  } else {
220
  $redirect = add_query_arg( 'next', 'enroll-course', $redirect );
221
  }
222
+ learn_press_add_message( __( 'Please login to continue process.', 'learnpress' ) );
223
  $checkout_results['redirect'] = apply_filters( 'learn_press_no_checkout_free_course_redirect', $redirect );
224
  } else {
225
  add_filter( 'learn_press_checkout_success_result', '_learn_press_checkout_auto_enroll_free_course', 10, 2 );
226
  $checkout_results = LP_Checkout::instance()->process_checkout();
227
  }
228
+ $redirect = $checkout_results['redirect'];
229
+ /*if ( is_ajax() ) {
230
  learn_press_send_json(
231
  $checkout_results
232
  );
233
  } else {
234
  wp_redirect( $checkout_results['redirect'] );
235
  exit();
236
+ }*/
237
  } else {
238
  if ( learn_press_is_enable_cart() ) {
239
  if ( LP()->settings->get( 'redirect_after_add' ) == 'yes' ) {
240
  $redirect = learn_press_get_page_link( 'cart' );
241
  if ( !$redirect ) {
242
+ learn_press_add_message( sprintf( __( 'Cart page is not setting up.', 'learnpress' ) ) );
243
  $redirect = learn_press_get_current_url();
244
  } else {
245
  $button = sprintf( '<a href="%s">%s</a>', get_the_permalink( $course_id ), __( 'Back to class', 'learnpress' ) );
247
  } else {
248
  $redirect = get_the_permalink( $course_id );
249
  if ( !learn_press_get_page_link( 'cart' ) ) {
250
+ learn_press_add_message( sprintf( __( 'Checkout page is not setting up.', 'learnpress' ) ) );
251
  } else {
252
  $button = sprintf( '<a href="%s">%s</a>', learn_press_get_page_link( 'cart' ), __( 'View cart', 'learnpress' ) );
253
  }
254
  }
255
+ learn_press_add_message( sprintf( __( '<strong>%s</strong> has been added to your cart. %s', 'learnpress' ), get_the_title( $course_id ), $button ) );
256
 
257
  } else {
258
  $redirect = learn_press_get_page_link( 'checkout' );
259
  if ( !$redirect ) {
260
+ learn_press_add_message( sprintf( __( 'Checkout page is not setting up.', 'learnpress' ) ) );
261
  $redirect = learn_press_get_current_url();
262
  }
263
  }
264
  }
265
+
266
  $redirect = apply_filters( 'learn_press_add_to_cart_redirect', $redirect, $course_id );
267
 
268
  if ( is_ajax() ) {
279
  }
280
  }
281
 
282
+ /**
283
+ * Checks to see if there is an item in cart
284
+ *
285
+ * @param $item_id
286
+ *
287
+ * @return bool
288
+ */
289
  public function has_item( $item_id ) {
290
  return isset( $this->_cart_content['items'][$item_id] );
291
  }
292
 
293
+ /**
294
+ * Get an item in cart
295
+ *
296
+ * @param $item_id
297
+ *
298
+ * @return bool
299
+ */
300
+ public function get_item( $item_id ) {
301
+ return $this->has_item( $item_id ) ? $this->_cart_content['items'][$item_id] : null;
302
+ }
303
+
304
+ /**
305
+ * Remove an item from cart
306
+ *
307
+ * @param $item_id
308
+ *
309
+ * @return bool
310
+ */
311
  public function remove_item( $item_id ) {
312
  if ( isset( $this->_cart_content['items'][$item_id] ) ) {
313
 
325
  return false;
326
  }
327
 
328
+ /**
329
+ * Re-calculate cart totals and update data to session
330
+ */
331
  public function calculate_totals() {
332
+ $subtotal = 0;
333
+
334
+ if ( !empty( $this->_cart_content['items'] ) && $items = $this->_cart_content['items'] ) {
335
  foreach ( $items as $item_id => $item ) {
336
  $course = learn_press_get_course( $item_id );
337
  if ( $course ) {
341
  $this->_cart_content['items'][$item_id]['total'] = $_subtotal;
342
  $subtotal += $_subtotal;
343
  }
 
 
 
344
 
345
+ }
346
+ $this->_cart_content['subtotal'] = $subtotal;
347
+ $this->_cart_content['total'] = $subtotal;
348
  $this->update_session();
349
  }
350
 
351
+ /**
352
+ * Update cart content to session
353
+ */
354
  public function update_session() {
355
+ learn_press_session_set( $this->_cart_session_key, $this->_cart_content );
356
  }
357
 
358
  /**
373
  if ( !did_action( 'learn_press_get_cart_from_session' ) ) {
374
  $this->get_cart_from_session();
375
  }
376
+ return !empty( $this->_cart_content['items'] ) ? $this->_cart_content['items'] : array();
377
  }
378
 
379
+ /**
380
+ * Load cart content data from session
381
+ *
382
+ * @param bool $force
383
+ */
384
+ public function get_cart_from_session( $force = false ) {
385
+ if ( !did_action( 'learn_press_get_cart_from_session' ) || $force ) {
386
+ $this->_cart_content = learn_press_session_get( $this->_cart_session_key );
387
+ do_action( 'learn_press_get_cart_from_session' );
388
+ }
389
  }
390
 
391
  /**
419
  return md5( time() );
420
  }
421
 
422
+ /**
423
+ * Return sub-total of cart content
424
+ *
425
+ * @param $course
426
+ * @param int $quantity
427
+ *
428
+ * @return mixed|void
429
+ */
430
  public function get_item_subtotal( $course, $quantity = 1 ) {
431
  $price = $course->get_price();
432
  $row_price = $price * $quantity;
443
 
444
  do_action( 'learn_press_before_empty_cart' );
445
 
446
+ learn_press_session_set( $this->_cart_session_key, $this->get_default_cart_content() );
447
+
448
+ $this->get_cart_from_session( true );
449
 
450
  do_action( 'learn_press_emptied_cart' );
451
 
458
  * @return bool
459
  */
460
  public function is_empty() {
461
+ return sizeof( $this->get_items() ) === 0; //!$this->_cart_content['items'];
462
  }
463
 
464
+ /**
465
+ * Return cart content
466
+ *
467
+ * @return array|mixed|void
468
+ */
469
  public function get_cart_content() {
470
  return $this->_cart_content;
471
  }
480
  }
481
 
482
  /**
483
+ * Get checkout url for checkout page
484
+ * Return default url of checkout page
485
+ *
486
  * @return mixed
487
  */
488
  public function get_checkout_url() {
490
  return apply_filters( 'learn_press_get_checkout_url', $checkout_url );
491
  }
492
 
493
+ /**
494
+ * Checks if need to payment
495
+ * Return true if cart total greater than 0
496
+ *
497
+ * @return mixed|void
498
+ */
499
  public function needs_payment() {
500
  return apply_filters( 'learn_press_cart_needs_payment', $this->total > 0, $this );
501
  }
502
 
503
+ /**
504
+ * Process action for purchase course button
505
+ *
506
+ * @param $course_id
507
+ */
508
+ public function purchase_course_handler( $course_id ) {
509
+
510
+ do_action( 'learn_press_before_purchase_course_handler', $course_id, $this );
511
+
512
+ if ( apply_filters( 'learn_press_purchase_single_course', true ) ) {
513
+ $this->empty_cart();
514
+ }
515
+ $this->add_to_cart( $course_id, 1, $_POST );
516
+ $redirect = learn_press_get_checkout_url();
517
+ $has_checkout = $redirect ? true : false;
518
+ $need_checkout = $this->needs_payment();
519
+
520
+ // In case the course is FREE and "No checkout free course" is turn off
521
+ if ( !$need_checkout ) {
522
+ $user = learn_press_get_current_user();
523
+ if ( !$user->has_purchased_course( $course_id )/* || $user->has_finished_course( $course_id ) */ ) {
524
+ require_once LP_PLUGIN_PATH . '/inc/gateways/class-lp-gateway-none.php';
525
+ $checkout = learn_press_get_checkout( array( 'payment_method' => new LP_Gateway_None() ) );
526
+
527
+ /**
528
+ * + Auto enroll
529
+ */
530
+ add_filter( 'learn_press_checkout_success_result', '_learn_press_checkout_success_result', 10, 2 );
531
+ $results = $checkout->process_checkout();
532
+ remove_filter( 'learn_press_checkout_success_result', '_learn_press_checkout_success_result', 10 );
533
+ }/* else {
534
+ if ( $user->has_finished_course( $course_id ) ) {
535
+ learn_press_add_message( __( 'You have already finished course', 'learnpress' ) );
536
+ } else {
537
+ learn_press_add_message( __( 'You have already enrolled course', 'learnpress' ) );
538
+ }
539
+ }*/
540
+ } else {
541
+
542
+ // Checkout page is not setting up
543
+ if ( !$has_checkout ) {
544
+ learn_press_add_message( __( 'Checkout page is not setup', 'learnpress' ), 'error' );
545
+ } else {
546
+ wp_redirect( apply_filters( 'learn_press_checkout_redirect', $redirect ) );
547
+ exit();
548
+ }
549
+
550
+ }
551
+ return;
552
+ }
553
+
554
  /**
555
  * Destroy cart instance
556
  */
618
  return LP()->cart->total;
619
  }
620
 
 
 
 
 
 
 
 
 
621
 
622
  function learn_press_clear_cart_after_payment() {
623
  global $wp;
648
 
649
  add_action( 'get_header', 'learn_press_clear_cart_after_payment' );
650
 
651
+
652
+
653
+
654
  //learn_press_get_cart_description();
inc/cart/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php // Silence is golden.
inc/class-lp-ajax.php CHANGED
@@ -9,26 +9,22 @@ if ( !class_exists( 'LP_AJAX' ) ) {
9
  * Class LP_AJAX
10
  */
11
  class LP_AJAX {
12
-
 
 
13
  public static function init() {
14
-
15
- // learnpress_ajax_event => nopriv
16
  $ajaxEvents = array(
17
- //'list_quiz' => false,
18
  'load_quiz_question' => true,
19
  'load_prev_question' => false,
20
  'load_next_question' => false,
21
- //'save_question_answer' => false,
22
  'finish_quiz' => true,
23
  'retake_quiz' => true, // anonymous user can retake quiz
24
  'take_free_course' => false,
25
  'load_lesson_content' => false,
26
  'load_next_lesson' => false,
27
  'load_prev_lesson' => false,
28
- 'complete_lesson' => false,
29
  'finish_course' => false,
30
  'not_going' => false,
31
- //
32
  'take_course' => true,
33
  'start_quiz' => true,
34
  'fetch_question' => true
@@ -45,6 +41,11 @@ if ( !class_exists( 'LP_AJAX' ) ) {
45
  LP_Request_Handler::register( 'lp-ajax', array( __CLASS__, 'do_ajax' ) );
46
  }
47
 
 
 
 
 
 
48
  public static function do_ajax( $var ) {
49
  if ( !defined( 'DOING_AJAX' ) ) {
50
  define( 'DOING_AJAX', true );
@@ -59,9 +60,15 @@ if ( !class_exists( 'LP_AJAX' ) ) {
59
  do_action( 'learn_press_ajax_handler_' . $var );
60
  return;
61
  }
 
 
 
62
  learn_press_send_json( $result );
63
  }
64
 
 
 
 
65
  public static function _request_become_a_teacher() {
66
  $response = learn_press_process_become_a_teacher_form(
67
  array(
@@ -73,10 +80,21 @@ if ( !class_exists( 'LP_AJAX' ) ) {
73
  learn_press_send_json( $response );
74
  }
75
 
 
 
 
 
 
76
  public static function _request_checkout() {
77
- return LP()->checkout->process_checkout();
78
  }
79
 
 
 
 
 
 
 
80
  public static function _request_enroll_course() {
81
  $course_id = learn_press_get_request( 'enroll-course' );
82
  if ( !$course_id ) {
@@ -88,16 +106,16 @@ if ( !class_exists( 'LP_AJAX' ) ) {
88
  'result' => 'fail',
89
  'redirect' => apply_filters( 'learn_press_enroll_course_failure_redirect_url', get_the_permalink( $course_id ) )
90
  );
 
91
  if ( $insert_id ) {
92
  $response['result'] = 'success';
93
  $response['redirect'] = apply_filters( 'learn_press_enrolled_course_redirect_url', get_the_permalink( $course_id ) );
94
- $message = apply_filters( 'learn_press_enrolled_course_message', sprintf( __( 'Congrats! You have enrolled <strong>%s</strong>', 'learnpress' ), get_the_title( $course_id ) ), $course_id, LP()->user->id );
95
- learn_press_add_notice( $message );
96
  } else {
97
  $message = apply_filters( 'learn_press_enroll_course_failed_message', sprintf( __( 'Sorry! The course <strong>%s</strong> you want to enroll has failed! Please contact site\'s administrator for more information.', 'learnpress' ), get_the_title( $course_id ) ), $course_id, LP()->user->id );
98
- learn_press_add_notice( $message, 'error' );
99
  }
100
-
101
  if ( is_ajax() ) {
102
  learn_press_send_json( $response );
103
  }
@@ -109,6 +127,11 @@ if ( !class_exists( 'LP_AJAX' ) ) {
109
  return false;
110
  }
111
 
 
 
 
 
 
112
  public static function _request_checkout_login() {
113
  $result = array(
114
  'result' => 'success'
@@ -116,11 +139,11 @@ if ( !class_exists( 'LP_AJAX' ) ) {
116
  ob_start();
117
  if ( empty( $_REQUEST['user_login'] ) ) {
118
  $result['result'] = 'fail';
119
- learn_press_add_notice( __( 'Please enter username', 'learnpress' ), 'error' );
120
  }
121
  if ( empty( $_REQUEST['user_password'] ) ) {
122
  $result['result'] = 'fail';
123
- learn_press_add_notice( __( 'Please enter password', 'learnpress' ), 'error' );
124
  }
125
  if ( $result['result'] == 'success' ) {
126
  $creds = array();
@@ -130,7 +153,7 @@ if ( !class_exists( 'LP_AJAX' ) ) {
130
  $user = wp_signon( $creds, false );
131
  if ( is_wp_error( $user ) ) {
132
  $result['result'] = 'fail';
133
- learn_press_add_notice( $user->get_error_message(), 'error' );
134
  } else {
135
  $result['redirect'] = learn_press_get_page_link( 'checkout' );
136
  }
@@ -143,6 +166,9 @@ if ( !class_exists( 'LP_AJAX' ) ) {
143
  return $result;
144
  }
145
 
 
 
 
146
  public static function _request_login() {
147
  $data_str = learn_press_get_request( 'data' );
148
  $data = null;
@@ -150,24 +176,22 @@ if ( !class_exists( 'LP_AJAX' ) ) {
150
  parse_str( $data_str, $data );
151
  }
152
 
153
- $user = wp_signon(
154
  array(
155
  'user_login' => $data['log'],
156
  'user_password' => $data['pwd'],
157
- 'remember' => isset( $data['rememberme'] ) ? $data['rememberme'] : false
158
  ),
159
  is_ssl()
160
  );
 
161
  $error = is_wp_error( $user );
162
  $return = array(
163
  'result' => $error ? 'error' : 'success',
164
- 'redirect' => !$error && !empty( $_REQUEST['return'] ) ? $_REQUEST['return'] : ''
165
  );
166
  if ( $error ) {
167
- $return['message'] = array(
168
- 'title' => __( 'Login failed', 'learnpress' ),
169
- 'message' => $user->get_error_message() ? $user->get_error_message() : __( 'Please enter your username and/or password', 'learnpress' )
170
- );
171
  } else {
172
  wp_set_current_user( $user->ID );
173
  $next = learn_press_get_request( 'next' );
@@ -185,7 +209,7 @@ if ( !class_exists( 'LP_AJAX' ) ) {
185
  if ( $checkout ) {
186
  LP()->cart->remove_item( $checkout );
187
  $return['redirect'] = get_the_permalink( $checkout );
188
- learn_press_add_notice( sprintf( __( 'Welcome back, %s. You\'ve already enrolled this course', 'learnpress' ), $user->user->display_name ) );
189
  break;
190
  }
191
  }
@@ -195,18 +219,37 @@ if ( !class_exists( 'LP_AJAX' ) ) {
195
  $checkout = LP()->checkout()->process_checkout();
196
  } else {
197
  }
 
198
  }
 
199
  }
200
  learn_press_send_json( $return );
201
  }
202
 
 
 
 
203
  public static function _request_add_to_cart() {
204
- LP()->cart->add_to_cart( learn_press_get_request( 'add-course-to-cart' ) );
 
205
 
 
 
 
 
 
 
 
 
 
 
206
  }
207
 
 
 
 
208
  public static function _request_finish_course() {
209
- $nonce = learn_press_get_request( 'nonce' );
210
  $course_id = absint( learn_press_get_request( 'id' ) );
211
  $user = learn_press_get_current_user();
212
 
@@ -217,19 +260,102 @@ if ( !class_exists( 'LP_AJAX' ) ) {
217
  wp_die( __( 'Access denied!', 'learnpress' ) );
218
  }
219
 
220
- $response = $user->finish_course( $course_id );
221
 
222
- if ( $response['result'] == 'success' ) {
223
- $message = __( 'Congrats! You have finished this course', 'learnpress' );
 
 
224
  $response['redirect'] = get_the_permalink( $course_id );
 
 
225
  } else {
226
- $message = __( 'Error! You cannot finish this course. Please contact your administrator for more information.', 'learnpress' );
 
227
  }
228
 
229
- $response['message'] = array( 'title' => __( 'Finish course', 'learnpress' ), 'message' => $message );
230
  learn_press_send_json( $response );
231
  }
232
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
233
 
234
  /**
235
  * die();
@@ -242,27 +368,6 @@ if ( !class_exists( 'LP_AJAX' ) ) {
242
  do_action( 'learn_press_take_course', $course_id, $payment_method );
243
  }
244
 
245
- private static function update_time_remaining() {
246
- $time_remaining = learn_press_get_request( 'time_remaining' );
247
- $quiz_id = learn_press_get_request( 'quiz_id' );
248
- $user_id = learn_press_get_request( 'user_id' );
249
- if ( $time_remaining ) {
250
- $quiz_time_remaining = learn_press_get_quiz_time_remaining( $user_id, $quiz_id );
251
- if ( $time_remaining != $quiz_time_remaining ) {
252
- $quiz_time = (array) get_user_meta( $user_id, '_lpr_quiz_start_time', true );
253
- $quiz_duration = get_post_meta( $quiz_id, '_lpr_duration', true );
254
-
255
-
256
- if ( !empty( $quiz_time[$quiz_id] ) ) {
257
- echo $quiz_time[$quiz_id], ',';
258
- $quiz_time[$quiz_id] = current_time( 'timestamp' ) - $time_remaining;
259
- echo $quiz_time[$quiz_id], ',';
260
- update_user_meta( $user_id, '_lpr_quiz_start_time', $quiz_time );
261
- }
262
- }
263
- }
264
- }
265
-
266
  /**
267
  * Load quiz question
268
  */
@@ -273,11 +378,7 @@ if ( !class_exists( 'LP_AJAX' ) ) {
273
  global $quiz;
274
  $quiz = LP_Quiz::get_quiz( $quiz_id );
275
  LP()->quiz = $quiz;
276
-
277
-
278
-
279
  do_action( 'learn_press_load_quiz_question', $question_id, $quiz_id, $user_id );
280
-
281
  $user = learn_press_get_current_user();
282
  if ( $user->id != $user_id ) {
283
  learn_press_send_json(
@@ -304,11 +405,7 @@ if ( !class_exists( 'LP_AJAX' ) ) {
304
  }
305
  $question_answers = $user->get_question_answers( $quiz->id, $question_id );
306
  $question->render( array( 'answered' => $question_answers ) );
307
- /*
308
- if ( $hint = get_post_meta( $question->id, '_lp_explanation', true ) ) {
309
- ///echo '<div id="learn-press-question-hint-' . $question->id . '" class="question-hint hide-if-js">' . $hint . '</div>';
310
- }
311
- */
312
  $content = ob_get_clean();
313
  learn_press_send_json(
314
  apply_filters( 'learn_press_load_quiz_question_result_data', array(
@@ -320,55 +417,16 @@ if ( !class_exists( 'LP_AJAX' ) ) {
320
  )
321
  )
322
  );
323
-
324
  }
325
  }
326
 
327
-
328
- /**
329
- * Load previous question
330
- */
331
- public static function load_prev_question() {
332
-
333
- $prev_question_id = $_POST['prev_question_id'];
334
- $question_id = $_POST['question_id'];
335
- $question_answer = $_POST['question_answer'];
336
- $quiz_id = $_POST['quiz_id'];
337
-
338
- lpr_save_question_answer( $quiz_id, $question_id, $question_answer );
339
-
340
- do_action( 'lpr_load_question', $prev_question_id );
341
-
342
- die;
343
- }
344
-
345
- /**
346
- * Load next question
347
- */
348
- public static function load_next_question() {
349
-
350
- $next_question_id = $_POST['next_question_id'];
351
- $quiz_id = $_POST['quiz_id'];
352
- $question_id = $_POST['question_id'];
353
- $question_answer = $_POST['question_answer'];
354
-
355
- lpr_save_question_answer( $quiz_id, $question_id, $question_answer );
356
-
357
- do_action( 'lpr_load_question', $next_question_id );
358
-
359
- die;
360
- }
361
-
362
  /**
363
  * Finish quiz
364
  */
365
  public static function finish_quiz() {
366
  $user = learn_press_get_current_user();
367
  $quiz_id = learn_press_get_request( 'quiz_id' );
368
- // save current answer as if user may change
369
- //self::save_question_if_needed();
370
  $user->finish_quiz( $quiz_id );
371
-
372
  $response = array(
373
  'redirect' => get_the_permalink( $quiz_id )
374
  );
@@ -389,10 +447,8 @@ if ( !class_exists( 'LP_AJAX' ) ) {
389
  )
390
  );
391
  }
392
-
393
- $quiz_id = learn_press_get_request( 'quiz_id' );
394
- $user = learn_press_get_current_user();
395
-
396
  $response = $user->retake_quiz( $quiz_id );
397
  learn_press_send_json( $response );
398
  }
@@ -401,10 +457,8 @@ if ( !class_exists( 'LP_AJAX' ) ) {
401
  * Load lesson content
402
  */
403
  public static function load_lesson_content() {
404
-
405
  learn_press_debug( $_REQUEST );
406
  global $post;
407
-
408
  $lesson_id = $_POST['lesson_id'];
409
  $title = get_the_title( $lesson_id );
410
  $post = get_post( $lesson_id );
@@ -420,38 +474,6 @@ if ( !class_exists( 'LP_AJAX' ) ) {
420
  die;
421
  }
422
 
423
- /**
424
- * Load next lesson
425
- */
426
- public function load_next_lesson() {
427
-
428
- $lesson_id = $_POST['lesson_id'];
429
- $html = '';
430
- $html .= '<h2>' . get_the_title( $lesson_id ) . '</h2>';
431
- $html .= '<p>' . get_post_meta( $lesson_id, '_lpr_lesson_desc', true ) . '</p>';
432
- $lesson = get_post( $lesson_id );
433
- $lesson_content = $lesson->post_content;
434
- $lesson_content = apply_filters( 'the_content', $lesson_content );
435
- $html .= '<p>' . $lesson_content . '</p>';
436
- echo $html;
437
- }
438
-
439
- /**
440
- * Load previous lesson
441
- */
442
- public function load_prev_lesson() {
443
-
444
- $lesson_id = $_POST['lesson_id'];
445
- $html = '';
446
- $html .= '<h2>' . get_the_title( $lesson_id ) . '</h2>';
447
- $html .= '<p>' . get_post_meta( $lesson_id, '_lpr_lesson_desc', true ) . '</p>';
448
- $lesson = get_post( $lesson_id );
449
- $lesson_content = $lesson->post_content;
450
- $lesson_content = apply_filters( 'the_content', $lesson_content );
451
- $html .= '<p>' . $lesson_content . '</p>';
452
- echo $html;
453
- }
454
-
455
  /**
456
  * Complete lesson
457
  */
@@ -501,86 +523,32 @@ if ( !class_exists( 'LP_AJAX' ) ) {
501
  /**
502
  * Retake course action
503
  */
504
- public static function retake_course() {
505
- $course_id = !empty( $_REQUEST['course_id'] ) ? absint( $_REQUEST['course_id'] ) : 0;
506
- $user_id = !empty( $_REQUEST['user_id'] ) ? absint( $_REQUEST['user_id'] ) : get_current_user_id();
507
-
508
- if ( !$user_id || !$course_id ) {
509
- wp_die( __( 'Error', 'learnpress' ) );
510
- }
511
-
512
- ////
513
- // Of course, user only retake course if he has finished
514
- if ( !learn_press_user_has_finished_course( $course_id, $user_id ) ) {
515
- wp_die( __( 'Error', 'learnpress' ) );
516
- }
517
-
518
- // reset course start time
519
- $course_time = get_user_meta( $user_id, '_lpr_course_time', true );
520
- if ( $course_time && !empty( $course_time[$course_id] ) ) {
521
- $course_time[$course_id] = array(
522
- 'start' => current_time( 'timestamp' ),
523
- 'end' => null
524
- );
525
- update_user_meta( $user_id, '_lpr_course_time', $course_time );
526
- }
527
-
528
- // reset course user finished
529
- $course_finished = get_user_meta( $user_id, '_lpr_course_finished', true );
530
- if ( $course_finished && in_array( $course_id, $course_finished ) ) {
531
- if ( false !== ( $position = array_search( $course_id, $course_finished ) ) ) {
532
- unset( $course_finished[$position] );
533
- update_user_meta( $user_id, '_lpr_course_finished', $course_finished );
534
- }
535
- }
536
- $user_finished = get_post_meta( $course_id, '_lpr_user_finished', true );
537
- if ( $user_finished ) {
538
- if ( false !== ( $position = array_search( $user_id, $user_finished ) ) ) {
539
- unset( $user_finished[$position] );
540
- update_post_meta( $course_id, '_lpr_user_finished', $user_finished );
541
- }
542
- }
543
-
544
- // reset the lessons user has completed
545
- $lessons = get_user_meta( $user_id, '_lpr_lesson_completed', true );
546
- if ( $lessons && isset( $lessons[$course_id] ) ) {
547
- unset( $lessons[$course_id] );
548
- update_user_meta( $user_id, '_lpr_lesson_completed', $lessons );
549
- }
550
-
551
- $quizzes = learn_press_get_quizzes( $course_id );
552
-
553
- // remove all quizzes in the course which user has taken
554
- if ( $quizzes ) {
555
- $quiz_start_time = get_user_meta( $user_id, '_lpr_quiz_start_time', true );
556
- $quiz_question = get_user_meta( $user_id, '_lpr_quiz_questions', true );
557
- $quiz_current_question = get_user_meta( $user_id, '_lpr_quiz_current_question', true );
558
- $quiz_question_answer = get_user_meta( $user_id, '_lpr_quiz_question_answer', true );
559
- $quiz_completed = get_user_meta( $user_id, '_lpr_quiz_completed', true );
560
-
561
- foreach ( $quizzes as $quiz_id ) {
562
- delete_user_meta( $user_id, '_lpr_quiz_taken', $quiz_id );
563
- if ( isset( $quiz_start_time[$quiz_id] ) ) unset( $quiz_start_time[$quiz_id] );
564
- if ( isset( $quiz_question[$quiz_id] ) ) unset( $quiz_question[$quiz_id] );
565
- if ( isset( $quiz_current_question[$quiz_id] ) ) unset( $quiz_current_question[$quiz_id] );
566
- if ( isset( $quiz_question_answer[$quiz_id] ) ) unset( $quiz_question_answer[$quiz_id] );
567
- if ( isset( $quiz_completed[$quiz_id] ) ) unset( $quiz_completed[$quiz_id] );
568
  }
569
-
570
- update_user_meta( $user_id, '_lpr_quiz_start_time', $quiz_start_time );
571
- update_user_meta( $user_id, '_lpr_quiz_questions', $quiz_question );
572
- update_user_meta( $user_id, '_lpr_quiz_current_question', $quiz_current_question );
573
- update_user_meta( $user_id, '_lpr_quiz_question_answer', $quiz_question_answer );
574
- update_user_meta( $user_id, '_lpr_quiz_completed', $quiz_completed );
575
  }
576
-
577
- update_user_meta( $user_id, '_lpr_course_taken', $course_id );
578
- wp_send_json(
579
- array(
580
- 'redirect' => get_permalink( $course_id )
581
- )
582
- );
583
- die();
584
  }
585
 
586
  public static function start_quiz() {
@@ -610,7 +578,7 @@ if ( !class_exists( 'LP_AJAX' ) ) {
610
  learn_press_send_json(
611
  array(
612
  'result' => 'error',
613
- 'message' => __( 'Please login to do this quiz', 'learnpress' )
614
  )
615
  );
616
  }
@@ -653,4 +621,5 @@ if ( !class_exists( 'LP_AJAX' ) ) {
653
  }
654
  }
655
  }
 
656
  LP_AJAX::init();
9
  * Class LP_AJAX
10
  */
11
  class LP_AJAX {
12
+ /**
13
+ * Init common ajax events
14
+ */
15
  public static function init() {
 
 
16
  $ajaxEvents = array(
 
17
  'load_quiz_question' => true,
18
  'load_prev_question' => false,
19
  'load_next_question' => false,
 
20
  'finish_quiz' => true,
21
  'retake_quiz' => true, // anonymous user can retake quiz
22
  'take_free_course' => false,
23
  'load_lesson_content' => false,
24
  'load_next_lesson' => false,
25
  'load_prev_lesson' => false,
 
26
  'finish_course' => false,
27
  'not_going' => false,
 
28
  'take_course' => true,
29
  'start_quiz' => true,
30
  'fetch_question' => true
41
  LP_Request_Handler::register( 'lp-ajax', array( __CLASS__, 'do_ajax' ) );
42
  }
43
 
44
+ /**
45
+ * Do ajax if there is a 'lp-ajax' in $_REQUEST
46
+ *
47
+ * @param $var
48
+ */
49
  public static function do_ajax( $var ) {
50
  if ( !defined( 'DOING_AJAX' ) ) {
51
  define( 'DOING_AJAX', true );
60
  do_action( 'learn_press_ajax_handler_' . $var );
61
  return;
62
  }
63
+ if ( learn_press_get_request( 'format' ) == 'html' ) {
64
+ return;
65
+ }
66
  learn_press_send_json( $result );
67
  }
68
 
69
+ /**
70
+ * Become a teacher
71
+ */
72
  public static function _request_become_a_teacher() {
73
  $response = learn_press_process_become_a_teacher_form(
74
  array(
80
  learn_press_send_json( $response );
81
  }
82
 
83
+ /**
84
+ * Checkout process
85
+ *
86
+ * @return array|mixed|void
87
+ */
88
  public static function _request_checkout() {
89
+ return LP()->checkout->process_checkout_handler();
90
  }
91
 
92
+ /**
93
+ * Enroll course
94
+ *
95
+ * @return bool
96
+ * @throws Exception
97
+ */
98
  public static function _request_enroll_course() {
99
  $course_id = learn_press_get_request( 'enroll-course' );
100
  if ( !$course_id ) {
106
  'result' => 'fail',
107
  'redirect' => apply_filters( 'learn_press_enroll_course_failure_redirect_url', get_the_permalink( $course_id ) )
108
  );
109
+
110
  if ( $insert_id ) {
111
  $response['result'] = 'success';
112
  $response['redirect'] = apply_filters( 'learn_press_enrolled_course_redirect_url', get_the_permalink( $course_id ) );
113
+ $message = apply_filters( 'learn_press_enrolled_course_message', sprintf( __( 'You have enrolled in this course <strong>%s</strong>', 'learnpress' ), get_the_title( $course_id ) ), $course_id, LP()->user->id );
114
+ learn_press_add_message( $message );
115
  } else {
116
  $message = apply_filters( 'learn_press_enroll_course_failed_message', sprintf( __( 'Sorry! The course <strong>%s</strong> you want to enroll has failed! Please contact site\'s administrator for more information.', 'learnpress' ), get_the_title( $course_id ) ), $course_id, LP()->user->id );
117
+ learn_press_add_message( $message, 'error' );
118
  }
 
119
  if ( is_ajax() ) {
120
  learn_press_send_json( $response );
121
  }
127
  return false;
128
  }
129
 
130
+ /**
131
+ * Request login in checkout process
132
+ *
133
+ * @return array
134
+ */
135
  public static function _request_checkout_login() {
136
  $result = array(
137
  'result' => 'success'
139
  ob_start();
140
  if ( empty( $_REQUEST['user_login'] ) ) {
141
  $result['result'] = 'fail';
142
+ learn_press_add_message( __( 'Please enter username', 'learnpress' ), 'error' );
143
  }
144
  if ( empty( $_REQUEST['user_password'] ) ) {
145
  $result['result'] = 'fail';
146
+ learn_press_add_message( __( 'Please enter password', 'learnpress' ), 'error' );
147
  }
148
  if ( $result['result'] == 'success' ) {
149
  $creds = array();
153
  $user = wp_signon( $creds, false );
154
  if ( is_wp_error( $user ) ) {
155
  $result['result'] = 'fail';
156
+ learn_press_add_message( $user->get_error_message(), 'error' );
157
  } else {
158
  $result['redirect'] = learn_press_get_page_link( 'checkout' );
159
  }
166
  return $result;
167
  }
168
 
169
+ /**
170
+ * Request login in profile
171
+ */
172
  public static function _request_login() {
173
  $data_str = learn_press_get_request( 'data' );
174
  $data = null;
176
  parse_str( $data_str, $data );
177
  }
178
 
179
+ $user = wp_signon(
180
  array(
181
  'user_login' => $data['log'],
182
  'user_password' => $data['pwd'],
183
+ 'remember' => isset( $data['rememberme'] ) ? $data['rememberme'] : false,
184
  ),
185
  is_ssl()
186
  );
187
+
188
  $error = is_wp_error( $user );
189
  $return = array(
190
  'result' => $error ? 'error' : 'success',
191
+ 'redirect' => ( !$error && !empty( $data['redirect_to'] ) ) ? $data['redirect_to'] : ''
192
  );
193
  if ( $error ) {
194
+ $return['message'] = learn_press_get_message( $user->get_error_message() ? $user->get_error_message() : __( 'Please enter your username and/or password', 'learnpress' ) );
 
 
 
195
  } else {
196
  wp_set_current_user( $user->ID );
197
  $next = learn_press_get_request( 'next' );
209
  if ( $checkout ) {
210
  LP()->cart->remove_item( $checkout );
211
  $return['redirect'] = get_the_permalink( $checkout );
212
+ learn_press_add_message( sprintf( __( 'Welcome back, %s. You\'ve already enrolled this course', 'learnpress' ), $user->user->display_name ) );
213
  break;
214
  }
215
  }
219
  $checkout = LP()->checkout()->process_checkout();
220
  } else {
221
  }
222
+ return;
223
  }
224
+ $return['message'] = learn_press_get_message( sprintf( __( 'Welcome back, %s! Redirecting...', 'learnpress' ), learn_press_get_profile_display_name( $user ) ) );
225
  }
226
  learn_press_send_json( $return );
227
  }
228
 
229
+ /**
230
+ * Request add-to-cart a course
231
+ */
232
  public static function _request_add_to_cart() {
233
+ $cart = learn_press_get_cart();
234
+ $course_id = learn_press_get_request( 'purchase-course' );
235
 
236
+ $cart->add_to_cart( $course_id );
237
+ $return = array(
238
+ 'result' => 'success',
239
+ 'redirect' => learn_press_get_checkout_url()
240
+ );
241
+ if ( is_ajax() ) {
242
+ learn_press_send_json( $return );
243
+ } else {
244
+ wp_redirect( $return['redirect'] );
245
+ }
246
  }
247
 
248
+ /**
249
+ * Request finish course
250
+ */
251
  public static function _request_finish_course() {
252
+ $nonce = learn_press_get_request( 'security' );
253
  $course_id = absint( learn_press_get_request( 'id' ) );
254
  $user = learn_press_get_current_user();
255
 
260
  wp_die( __( 'Access denied!', 'learnpress' ) );
261
  }
262
 
263
+ $finished = $user->finish_course( $course_id );
264
 
265
+ $response = array();
266
+
267
+ if ( $finished ) {
268
+ learn_press_add_message( sprintf( __( 'You have finished this course "%s"', 'learnpress' ), $course->get_title() ) );
269
  $response['redirect'] = get_the_permalink( $course_id );
270
+
271
+ $response['result'] = 'success';
272
  } else {
273
+ $response['message'] = __( 'Error! You cannot finish this course. Please contact your administrator for more information.', 'learnpress' );
274
+ $response['result'] = 'error';
275
  }
276
 
 
277
  learn_press_send_json( $response );
278
  }
279
 
280
+ /**
281
+ * Request complete an item
282
+ */
283
+ public static function _request_complete_item() {
284
+ $user = learn_press_get_current_user();
285
+ $id = learn_press_get_request( 'id' );
286
+ $course_id = !empty( $_REQUEST['course_id'] ) ? $_REQUEST['course_id'] : get_the_ID();
287
+ $type = learn_press_get_request( 'type' );
288
+ $security = learn_press_get_request( 'security' );
289
+ $response = array();
290
+ if ( !wp_verify_nonce( $security, sprintf( 'complete-item-%d-%d-%d', $user->id, $course_id, $id ) ) ) {
291
+ $response['result'] = 'fail';
292
+ $response['message'] = __( 'Bad request!', 'learnpress' );
293
+ } else {
294
+ if ( $type == 'lp_lesson' ) {
295
+ $results = $user->complete_lesson( $id, $course_id );
296
+ if ( is_wp_error( $results ) ) {
297
+ learn_press_add_message( __( 'Error while completing lesson.', 'learnpress' ) );
298
+ } elseif ( $results !== false ) {
299
+ learn_press_add_message( __( 'You have completed lesson.', 'learnpress' ) );
300
+ }
301
+ } else {
302
+ do_action( 'learn_press_user_request_complete_item', $_REQUEST );
303
+ }
304
+ }
305
+ wp_redirect( learn_press_get_current_url() );
306
+ die();
307
+ }
308
+
309
+ /**
310
+ * Request load item content
311
+ */
312
+ public static function _request_load_item() {
313
+ global $wpdb;
314
+ $user = learn_press_get_current_user();
315
+ $item_id = learn_press_get_request( 'id' );
316
+ $course_id = get_the_ID();
317
+ // Ensure that user can view course item
318
+ $can_view_item = $user->can( 'view-item', $item_id, $course_id );
319
+ if ( $can_view_item ) {
320
+ // Update user item if it's not updated
321
+ if ( !$user->get_item_status( $item_id, $course_id ) ) {
322
+ $item_type = learn_press_get_request( 'type' );
323
+ if ( !$item_type ) {
324
+ $item_type = get_post_type( $item_id );
325
+ }
326
+ if ( apply_filters( 'learn_press_insert_user_item_data', true, $item_id, $course_id ) && $can_view_item != 'preview' ) {
327
+ $insert = $wpdb->insert(
328
+ $wpdb->prefix . 'learnpress_user_items',
329
+ apply_filters(
330
+ 'learn_press_user_item_data',
331
+ array(
332
+ 'user_id' => get_current_user_id(),
333
+ 'item_id' => learn_press_get_request( 'id' ),
334
+ 'item_type' => $item_type,
335
+ 'start_time' => $item_type == 'lp_lesson' ? current_time( 'mysql' ) : '0000-00-00 00:00:00',
336
+ 'end_time' => '0000-00-00 00:00:00',
337
+ 'status' => $item_type == 'lp_lesson' ? 'started' : 'viewed',
338
+ 'ref_id' => $course_id,
339
+ 'ref_type' => 'lp_course',
340
+ 'parent_id' => $user->get_course_history_id( $course_id )
341
+ )
342
+ ),
343
+ array(
344
+ '%d', '%d', '%s', '%s', '%s', '%s', '%d', '%s'
345
+ )
346
+ );
347
+ print_r( $wpdb );
348
+ $user_item_id = $wpdb->insert_id;
349
+ }
350
+ }
351
+ // display content item
352
+ learn_press_get_template( 'single-course/content-item.php' );
353
+ } else {
354
+ // display message
355
+ learn_press_get_template( 'singe-course/content-protected.php' );
356
+ }
357
+ die();
358
+ }
359
 
360
  /**
361
  * die();
368
  do_action( 'learn_press_take_course', $course_id, $payment_method );
369
  }
370
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
371
  /**
372
  * Load quiz question
373
  */
378
  global $quiz;
379
  $quiz = LP_Quiz::get_quiz( $quiz_id );
380
  LP()->quiz = $quiz;
 
 
 
381
  do_action( 'learn_press_load_quiz_question', $question_id, $quiz_id, $user_id );
 
382
  $user = learn_press_get_current_user();
383
  if ( $user->id != $user_id ) {
384
  learn_press_send_json(
405
  }
406
  $question_answers = $user->get_question_answers( $quiz->id, $question_id );
407
  $question->render( array( 'answered' => $question_answers ) );
408
+
 
 
 
 
409
  $content = ob_get_clean();
410
  learn_press_send_json(
411
  apply_filters( 'learn_press_load_quiz_question_result_data', array(
417
  )
418
  )
419
  );
 
420
  }
421
  }
422
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
423
  /**
424
  * Finish quiz
425
  */
426
  public static function finish_quiz() {
427
  $user = learn_press_get_current_user();
428
  $quiz_id = learn_press_get_request( 'quiz_id' );
 
 
429
  $user->finish_quiz( $quiz_id );
 
430
  $response = array(
431
  'redirect' => get_the_permalink( $quiz_id )
432
  );
447
  )
448
  );
449
  }
450
+ $quiz_id = learn_press_get_request( 'quiz_id' );
451
+ $user = learn_press_get_current_user();
 
 
452
  $response = $user->retake_quiz( $quiz_id );
453
  learn_press_send_json( $response );
454
  }
457
  * Load lesson content
458
  */
459
  public static function load_lesson_content() {
 
460
  learn_press_debug( $_REQUEST );
461
  global $post;
 
462
  $lesson_id = $_POST['lesson_id'];
463
  $title = get_the_title( $lesson_id );
464
  $post = get_post( $lesson_id );
474
  die;
475
  }
476
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
477
  /**
478
  * Complete lesson
479
  */
523
  /**
524
  * Retake course action
525
  */
526
+ public static function _request_retake_course() {
527
+ $security = learn_press_get_request( 'security' );
528
+ $course_id = learn_press_get_request( 'course_id' );
529
+ $user = learn_press_get_current_user();
530
+ $course = LP_Course::get_course( $course_id );
531
+ $response = array(
532
+ 'result' => 'error'
533
+ );
534
+ $security_action = sprintf( 'learn-press-retake-course-%d-%d', $course->id, $user->id );
535
+ // security check
536
+ if ( !wp_verify_nonce( $security, $security_action ) ) {
537
+ $response['message'] = __( 'Error! Invalid lesson or security checked failure', 'learnpress' );
538
+ } else {
539
+ if ( $user->can( 'retake-course', $course_id ) ) {
540
+ if ( !$result = $user->retake_course( $course_id ) ) {
541
+ $response['message'] = __( 'Error!', 'learnpress' );
542
+ } else {
543
+ learn_press_add_message( sprintf( __( 'You have retaken course "%s"', 'learnpress' ), $course->get_title() ) );
544
+ $response['result'] = 'success';
545
+ $response['redirect'] = apply_filters( 'learn_press_retake_course_redirect', add_query_arg( 'retaken-course', $course_id, get_the_permalink( $course_id ) ) );
546
+ }
547
+ } else {
548
+ $result['message'] = __( 'Error! You can not retake course', 'learnpress' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
549
  }
 
 
 
 
 
 
550
  }
551
+ learn_press_send_json( $response );
 
 
 
 
 
 
 
552
  }
553
 
554
  public static function start_quiz() {
578
  learn_press_send_json(
579
  array(
580
  'result' => 'error',
581
+ 'message' => __( 'Please login to take this quiz', 'learnpress' )
582
  )
583
  );
584
  }
621
  }
622
  }
623
  }
624
+ // Call class
625
  LP_AJAX::init();
inc/class-lp-assets.php CHANGED
@@ -6,202 +6,747 @@
6
  * @author ThimPress
7
  * @package LearnPress/Classes
8
  * @version 1.0
9
- * @extends LP_Abstract_Assets
10
  */
11
 
12
  if ( !defined( 'ABSPATH' ) ) {
13
  exit; // Exit if accessed directly
14
  }
15
 
16
- learn_press_include( 'abstracts/abstract-lp-assets.php' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
 
18
- class LP_Assets extends LP_Abstract_Assets {
19
- static protected $_minify = array(
20
- 'assets/js/admin/meta-box-question.js' => 'assets/js/admin/question.min.js',
21
- 'assets/js/global.js' => 'assets/js/global.min.js'
22
- );
23
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  public static function init() {
25
- parent::$caller = __CLASS__;
26
- add_action( 'learn_press_print_assets', array( __CLASS__, '_print_assets' ) );
27
- add_action( 'wp_footer', array( __CLASS__, 'footer_scripts' ) );
28
- add_action( 'wp_enqueue_scripts', array( __CLASS__, 'eduma_assets' ), 9999 );
29
- /*add_filter( 'script_loader_src', array( __CLASS__, 'script_loader_src' ), 10, 2 );
30
- add_action( 'learn_press_settings_save_general', array( __CLASS__, '_minify_source' ) );*/
31
- parent::init();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
  }
33
 
34
- public static function eduma_assets() {
35
- if ( learn_press_is_course() ) {
36
- self::enqueue_script( 'eduma-single-course' );
37
- self::enqueue_style( 'eduma-single-course' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
39
  }
40
 
41
- public static function footer_scripts() {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42
  global $wp_scripts;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43
  }
44
 
45
- public static function script_loader_src( $src, $handle ) {
46
- if ( LP_Settings::instance()->get( 'debug' ) == 'yes' ) {
47
- return $src;
 
 
 
 
48
  }
49
- $minify = self::$_minify;
50
- foreach ( $minify as $find => $replace ) {
51
- if ( strpos( $src, $find ) !== false ) {
52
- $src = str_replace( $find, $replace, $src );
53
- break;
 
 
54
  }
55
  }
56
- return $src;
57
  }
58
 
59
- public static function _url_to_path( $url, $sub ) {
60
- $path = str_replace( LP_PLUGIN_URL, preg_replace( '/\\\\/', '/', LP_PLUGIN_PATH ), $url );
61
- echo preg_replace( '!\?.*!', '', $path );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
62
  }
63
 
64
- public static function _create_file( $src, $des ) {
65
- if ( $src == $des ) {
66
- return $src;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
67
  }
68
- $read_file = LP_PLUGIN_PATH . '/' . $src;
69
- $write_file = LP_PLUGIN_PATH . '/' . $des;
70
 
71
- global $wp_filesystem;
72
- if ( $wp_filesystem ) {
73
- include_once LP_PLUGIN_PATH . '/inc/libraries/minify/src/Minify.php';
74
- include_once LP_PLUGIN_PATH . '/inc/libraries/minify/src/JS.php';
75
- $code = $wp_filesystem->get_contents( $read_file );
76
- $minifier = new JS( $code );
77
- $code = $minifier->minify();
 
 
 
 
 
 
 
 
 
 
 
 
 
78
 
79
- $wp_filesystem->put_contents(
80
- $write_file,
81
- $code
82
- );
83
- if ( file_exists( $write_file ) ) {
84
- $src = $des;
 
 
 
 
 
 
 
 
 
85
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  * @author ThimPress
7
  * @package LearnPress/Classes
8
  * @version 1.0
 
9
  */
10
 
11
  if ( !defined( 'ABSPATH' ) ) {
12
  exit; // Exit if accessed directly
13
  }
14
 
15
+ class LP_Assets {
16
+ /**
17
+ * Styles
18
+ *
19
+ * @var array
20
+ */
21
+ protected static $styles = array();
22
+
23
+ /**
24
+ * Scripts
25
+ *
26
+ * @var array
27
+ */
28
+ protected static $scripts = array();
29
+
30
+ /**
31
+ * Localize scripts
32
+ *
33
+ * @var array
34
+ */
35
+ protected static $wp_localize_scripts = array();
36
+
37
+ /**
38
+ * Params
39
+ *
40
+ * @var array
41
+ */
42
+ protected static $wp_params = array();
43
+
44
+ /**
45
+ * @var array
46
+ */
47
+ protected static $wp_param_names = array();
48
 
49
+ /**
50
+ * @var array
51
+ */
52
+ protected static $wp_script_codes = array();
 
53
 
54
+ /**
55
+ * Localized flag
56
+ *
57
+ * @var bool
58
+ */
59
+ protected static $localized = array( '__all' => '' );
60
+
61
+ /**
62
+ * @var array
63
+ */
64
+ protected static $param_printed = array( '__all' );
65
+
66
+ /**
67
+ * @var int
68
+ */
69
+ protected static $id = 0;
70
+
71
+ /**
72
+ * @var array
73
+ */
74
+ protected static $_enqueue_scripts = array();
75
+
76
+ /**
77
+ * @var array
78
+ */
79
+ protected static $_enqueue_styles = array();
80
+
81
+ /**
82
+ * @var LP_Assets|null
83
+ */
84
+ protected static $_instance = null;
85
+
86
+ /**
87
+ * @var array
88
+ */
89
+ public static $registered = array();
90
+
91
+ /**
92
+ * @var array
93
+ */
94
+ protected static $js_vars = array();
95
+
96
+ /**
97
+ * Constructor
98
+ */
99
+ public function __construct() {
100
+ self::$_instance = $this;
101
+ self::init();
102
+ }
103
+
104
+ /**
105
+ * Init Asset
106
+ */
107
  public static function init() {
108
+ $priory = 900;
109
+ if ( !is_admin() ) {
110
+ add_action( 'wp_enqueue_scripts', array( self::$_instance, 'load_scripts' ), $priory );
111
+ add_action( 'wp_enqueue_scripts', array( self::$_instance, 'wp_assets' ), $priory );
112
+ //add_action( 'wp_print_scripts', array( self::$_instance, 'localize_printed_scripts' ), $priory );
113
+ add_action( 'wp_print_footer_scripts', array( __CLASS__, 'localize_printed_scripts' ), $priory + 10 );
114
+ add_action( 'wp_enqueue_scripts', array( __CLASS__, '_enqueue_scripts' ), $priory + 10 );
115
+
116
+ } else {
117
+ add_action( 'admin_enqueue_scripts', array( self::$_instance, 'load_scripts' ), $priory );
118
+ add_action( 'admin_enqueue_scripts', array( self::$_instance, 'wp_assets' ), $priory );
119
+ //add_action( 'admin_print_scripts', array( self::$_instance, 'localize_printed_scripts' ), $priory );
120
+ add_action( 'admin_print_footer_scripts', array( self::$_instance, 'localize_printed_scripts' ), $priory + 10 );
121
+ add_action( 'admin_enqueue_scripts', array( __CLASS__, '_enqueue_scripts' ), $priory + 10 );
122
+ }
123
+ add_filter( 'script_loader_src', array( __CLASS__, 'script_localized' ), $priory + 5, 2 );
124
+
125
+ add_action( 'wp_default_scripts', array( __CLASS__, 'add_default_scripts' ) );
126
+ add_action( 'wp_default_styles', array( __CLASS__, 'add_default_styles' ) );
127
+ if ( !defined( 'LP_DEBUG' ) || ( false == LP_DEBUG ) ) {
128
+ add_filter( 'script_loader_tag', array( self::$_instance, 'unload_script_tag' ), $priory, 3 );
129
+ add_filter( 'style_loader_tag', array( self::$_instance, 'unload_script_tag' ), $priory, 3 );
130
+ add_action( 'wp_print_footer_scripts', array( self::$_instance, 'include_script_file' ), $priory );
131
+ add_action( 'admin_print_footer_scripts', array( self::$_instance, 'include_script_file' ), $priory );
132
+ add_action( 'wp_print_scripts', array( self::$_instance, 'include_stylesheet_file' ), $priory );
133
+ add_action( 'admin_print_scripts', array( self::$_instance, 'include_stylesheet_file' ), $priory );
134
+ }
135
  }
136
 
137
+ public static function script_localized( $source, $handle ) {
138
+ //if ( !empty( self::$wp_localize_scripts[$handle] ) ) {
139
+ self::$localized[$handle] = $source;
140
+ //}
141
+ if ( !empty( self::$wp_params[$handle] ) ) {
142
+ self::$param_printed[] = $handle;
143
+ }
144
+ return $source;
145
+ }
146
+
147
+ /**
148
+ * Load default scripts
149
+ *
150
+ * @param $scripts
151
+ */
152
+ public static function default_scripts( &$scripts ) {
153
+ if ( !defined( 'LEARNPRESS_VERSION' ) ) {
154
+ define( 'LEARNPRESS_VERSION', '2.0' );
155
+ }
156
+
157
+ $develop_src = false !== strpos( LEARNPRESS_VERSION, '-src' );
158
+
159
+ if ( !defined( 'SCRIPT_DEBUG' ) ) {
160
+ define( 'SCRIPT_DEBUG', $develop_src );
161
+ }
162
+ if ( !$guessurl = site_url() ) {
163
+ $guessed_url = true;
164
+ $guessurl = wp_guess_url();
165
  }
166
+ $default_dirs = array( '/wp-admin/js/', '/wp-includes/js/' );
167
+ $scripts->base_url = $guessurl;
168
+ $scripts->content_url = defined( 'WP_CONTENT_URL' ) ? WP_CONTENT_URL : '';
169
+ $scripts->default_version = get_bloginfo( 'version' );
170
+ $scripts->default_dirs = $default_dirs;
171
+ self::add_default_scripts( $scripts );
172
+ }
173
+
174
+ public static function add_default_scripts( &$scripts ) {
175
+
176
+ $default_path = '/wp-content/plugins/learnpress/assets/';
177
+ $suffix = '';
178
+ $deps = array( 'jquery', 'backbone', 'utils' );
179
+
180
+ // global
181
+ $scripts->add( 'learn-press-global', $default_path . 'js/global' . $suffix . '.js', $deps, false, 1 );
182
+ $scripts->add( 'learn-press-jalerts', $default_path . 'js/jquery.alert' . $suffix . '.js', $deps, false, 1 );
183
+
184
+ // frontend
185
+ $scripts->add( 'learn-press-js', $default_path . 'js/frontend/learnpress' . $suffix . '.js', $deps, false, 1 );
186
+ $scripts->add( 'learn-press-single-course', $default_path . 'js/frontend/single-course' . $suffix . '.js', $deps, false, 1 );
187
+ $scripts->add( 'learn-press-course-quiz', $default_path . 'js/frontend/quiz' . $suffix . '.js', $deps, false, 1 );
188
+ $scripts->add( 'learn-press-course-lesson', $default_path . 'js/frontend/lesson' . $suffix . '.js', $deps, false, 1 );
189
+ $scripts->add( 'learn-press-enroll', $default_path . 'js/frontend/enroll' . $suffix . '.js', $deps, false, 1 );
190
+ $scripts->add( 'learn-press-timer', $default_path . 'js/jquery.timer' . $suffix . '.js', $deps, false, 1 );
191
+ $scripts->add( 'learn-press-checkout', $default_path . 'js/frontend/checkout' . $suffix . '.js', $deps, false, 1 );
192
+ $scripts->add( 'learn-press-become-teacher', $default_path . 'js/frontend/become-teacher' . $suffix . '.js', $deps, false, 1 );
193
+ $scripts->add( 'learn-press-profile', $default_path . 'js/frontend/profile' . $suffix . '.js', $deps, false, 1 );
194
+
195
+ // admin
196
+ $scripts->add( 'learn-press-admin', $default_path . 'js/admin/admin' . $suffix . '.js', $deps, false, 1 );
197
+ $scripts->add( 'learn-press-admin-settings', $default_path . 'js/admin/settings' . $suffix . '.js', $deps, false, 1 );
198
+ $scripts->add( 'learn-press-mb-question', $default_path . 'js/admin/meta-box-question' . $suffix . '.js', $deps, false, 1 );
199
+ $scripts->add( 'learn-press-mb-course', $default_path . 'js/admin/meta-box-course' . $suffix . '.js', $deps, false, 1 );
200
+ $scripts->add( 'learn-press-mb-quiz', $default_path . 'js/admin/meta-box-quiz' . $suffix . '.js', $deps, false, 1 );
201
+ $scripts->add( 'learn-press-mb-order', $default_path . 'js/admin/meta-box-order' . $suffix . '.js', $deps, false, 1 );
202
+ $scripts->add( 'learn-press-modal-search-items', $default_path . 'js/admin/modal-search-items' . $suffix . '.js', array( 'learn-press-global' ), false, 1 );
203
+ $scripts->add( 'learn-press-order', $default_path . 'js/admin/meta-box-order' . $suffix . '.js', $deps, false, 1 );
204
+
205
+ // upgrade
206
+ $scripts->add( 'learn-press-upgrade', '/wp-content/plugins/learnpress/inc/updates/09/script' . $suffix . '.js', $deps, false, 1 );
207
+
208
  }
209
 
210
+ /**
211
+ * Load default styles
212
+ *
213
+ * @param WP_Styles $styles
214
+ */
215
+ public static function default_styles( &$styles ) {
216
+ if ( !defined( 'LEARNPRESS_VERSION' ) ) {
217
+ define( 'LEARNPRESS_VERSION', '2.0' );
218
+ }
219
+
220
+ $develop_src = false !== strpos( LEARNPRESS_VERSION, '-src' );
221
+
222
+ if ( !defined( 'SCRIPT_DEBUG' ) ) {
223
+ define( 'SCRIPT_DEBUG', $develop_src );
224
+ }
225
+ if ( !$guessurl = site_url() ) {
226
+ $guessed_url = true;
227
+ $guessurl = wp_guess_url();
228
+ }
229
+ $default_dirs = array( '/wp-admin/css/', '/wp-includes/css/' );
230
+ $styles->base_url = $guessurl;
231
+ $styles->content_url = defined( 'WP_CONTENT_URL' ) ? WP_CONTENT_URL : '';
232
+ $styles->default_version = get_bloginfo( 'version' );
233
+ $styles->default_dirs[] = $default_dirs;
234
+
235
+ self::add_default_styles( $styles );
236
+ }
237
+
238
+ public static function add_default_styles( &$styles ) {
239
+ $default_path = '/wp-content/plugins/learnpress/assets/';
240
+ $suffix = '';
241
+ // global
242
+ $styles->add( 'learn-press-global', $default_path . 'css/global' . $suffix . '.css' );
243
+
244
+ // admin
245
+ $styles->add( 'learn-press-admin', $default_path . 'css/admin/admin' . $suffix . '.css' );
246
+ $styles->add( 'learn-press-jquery.ui.datepicker', $default_path . 'css/admin/jquery.ui.datepicker' . $suffix . '.css' );
247
+ $styles->add( 'learn-press-jquery.ui.theme', $default_path . 'css/admin/jquery.ui.theme' . $suffix . '.css' );
248
+ $styles->add( 'learn-press-jquery.ui.core', $default_path . 'css/admin/jquery.ui.core' . $suffix . '.css' );
249
+ $styles->add( 'learn-press-jquery.ui.slider', $default_path . 'css/admin/jquery.ui.slider' . $suffix . '.css' );
250
+ $styles->add( 'learn-press-mb-course', $default_path . 'css/admin/meta-box-course' . $suffix . '.css' );
251
+ $styles->add( 'learn-press-mb-question', $default_path . 'css/admin/meta-box-question' . $suffix . '.css' );
252
+ $styles->add( 'learn-press-mb-order', $default_path . 'css/admin/meta-box-order' . $suffix . '.css' );
253
+ $styles->add( 'learn-press-jalerts', $default_path . 'css/jalert' . $suffix . '.css' );
254
+
255
+ // frontend
256
+ $styles->add( 'learn-press-style', $default_path . 'css/learnpress.css' );
257
+ }
258
+
259
+ /**
260
+ * register script
261
+ *
262
+ * @param string $handle
263
+ * @param string $src
264
+ * @param array $deps
265
+ * @param string $version
266
+ * @param boolean $in_footer
267
+ */
268
+ public static function add_script( $handle, $src, $deps = array( 'jquery' ), $version = LEARNPRESS_VERSION, $in_footer = true ) {
269
+ self::$scripts[] = $handle;
270
+ wp_register_script( $handle, $src, $deps, $version, $in_footer );
271
+ }
272
+
273
+ /**
274
+ * register style
275
+ *
276
+ * @param string $handle
277
+ * @param string $src
278
+ * @param array $deps
279
+ * @param string $version
280
+ * @param string $media
281
+ */
282
+ public static function add_style( $handle, $src, $deps = array(), $version = LEARNPRESS_VERSION, $media = 'all' ) {
283
+ self::$styles[] = $handle;
284
+ wp_register_style( $handle, $src, $deps, $version, $media );
285
+ }
286
+
287
+ /**
288
+ * enqueue script
289
+ *
290
+ * @param string $handle
291
+ * @param string $src
292
+ * @param array $deps
293
+ * @param string $version
294
+ * @param boolean $in_footer
295
+ */
296
+ public static function enqueue_script( $handle, $src = '', $deps = array( 'jquery' ), $version = LEARNPRESS_VERSION, $in_footer = true ) {
297
  global $wp_scripts;
298
+
299
+ if ( is_array( $handle ) ) {
300
+ foreach ( $handle as $_handle ) {
301
+ self::enqueue_script( $_handle, $src, $deps, $version, $in_footer );
302
+ }
303
+ } else {
304
+ if ( !in_array( $handle, self::$scripts ) && $src ) {
305
+ self::add_script( $handle, $src, $deps, $version, $in_footer );
306
+ }
307
+ self::$_enqueue_scripts[$handle] = func_get_args();
308
+ if ( $deps ) {
309
+ foreach ( $deps as $dep ) {
310
+ self::add_script_concat( $dep );
311
+ }
312
+ }
313
+ self::add_script_concat( $handle );
314
+ }
315
  }
316
 
317
+ /**
318
+ * @param $handle
319
+ */
320
+ public static function add_script_concat( $handle ) {
321
+ global $wp_scripts;
322
+ if ( !$wp_scripts ) {
323
+ return;
324
  }
325
+ if ( empty( $wp_scripts->lp_script_concat ) ) {
326
+ $wp_scripts->lp_script_concat = array();
327
+ }
328
+ if ( strpos( $handle, 'learn-press-' ) !== false ) {
329
+ $concat = str_replace( 'learn-press-', '', $handle );
330
+ if ( !in_array( $concat, $wp_scripts->lp_script_concat ) ) {
331
+ $wp_scripts->lp_script_concat[] = $concat;
332
  }
333
  }
 
334
  }
335
 
336
+ /**
337
+ * @param $handle
338
+ */
339
+ public static function add_style_concat( $handle ) {
340
+ global $wp_styles;
341
+ if ( !$wp_styles ) {
342
+ return;
343
+ }
344
+ if ( empty( $wp_styles->lp_style_concat ) ) {
345
+ $wp_styles->lp_style_concat = array();
346
+ }
347
+ if ( strpos( $handle, 'learn-press-' ) !== false ) {
348
+ $concat = str_replace( 'learn-press-', '', $handle );
349
+ if ( !in_array( $concat, $wp_styles->lp_style_concat ) ) {
350
+ $wp_styles->lp_style_concat[] = $concat;
351
+ }
352
+ }
353
  }
354
 
355
+ /**
356
+ * enqueue style
357
+ *
358
+ * @param string $handle
359
+ * @param string $src
360
+ * @param array $deps
361
+ * @param string $version
362
+ * @param string $media
363
+ */
364
+ public static function enqueue_style( $handle, $src = '', $deps = array(), $version = LEARNPRESS_VERSION, $media = 'all' ) {
365
+ if ( is_array( $handle ) ) {
366
+ foreach ( $handle as $_handle ) {
367
+ self::enqueue_style( $_handle, $src, $deps, $version, $media );
368
+ }
369
+ } else {
370
+ if ( !in_array( $handle, self::$styles ) && $src ) {
371
+ self::add_style( $handle, $src, $deps, $version, $media );
372
+ }
373
+ self::$_enqueue_styles[$handle] = func_get_args();
374
+ if ( $deps ) {
375
+ foreach ( $deps as $dep ) {
376
+ self::add_style_concat( $dep );
377
+ }
378
+ }
379
+ self::add_style_concat( $handle );
380
  }
381
+ }
 
382
 
383
+ /**
384
+ * add translate text
385
+ *
386
+ * @param string
387
+ * @param array $localize
388
+ * @param string
389
+ */
390
+ public static function add_localize( $key, $localize = null, $handle = '' ) {
391
+ if ( !$handle ) {
392
+ $handle = is_admin() ? 'learn-press-admin' : 'learn-press-js';
393
+ }
394
+ if ( empty( self::$wp_localize_scripts[$handle] ) ) {
395
+ self::$wp_localize_scripts[$handle] = array();
396
+ }
397
+ if ( is_array( $key ) ) {
398
+ self::$wp_localize_scripts[$handle] = array_merge( self::$wp_localize_scripts[$handle], $key );
399
+ } elseif ( is_string( $key ) && strlen( $key ) ) {
400
+ self::$wp_localize_scripts[$handle][$key] = $localize;
401
+ }
402
+ }
403
 
404
+ /**
405
+ * Add js param
406
+ *
407
+ * @param string
408
+ * @param array
409
+ * @param string
410
+ * @param $name
411
+ */
412
+ public static function add_param( $key, $param = null, $handle = 'learn-press-js', $name = null ) {
413
+ if ( !$handle ) {
414
+ $handle = 'learn-press-js';
415
+ }
416
+ if ( is_array( $handle ) ) {
417
+ foreach ( $handle as $h ) {
418
+ self::add_param( $key, $param, $h, $name );
419
  }
420
+ return;
421
+ }
422
+ if ( empty( $name ) ) {
423
+ $name = $handle;
424
+ }
425
+ if ( empty( self::$wp_params[$handle] ) ) {
426
+ self::$wp_params[$handle] = array( $name => array() );
427
+ }
428
+ if ( empty( self::$wp_params[$handle][$name] ) ) {
429
+ self::$wp_params[$handle][$name] = array();
430
+ }
431
+
432
+ if ( is_array( $key ) ) {
433
+ self::$wp_params[$handle][$name] = array_merge( self::$wp_params[$handle][$name], $key );
434
+ } elseif ( is_string( $key ) && strlen( $key ) ) {
435
+ self::$